interviewInvitation.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. <template>
  2. <view class="container">
  3. <view class="detail-bg"></view>
  4. <nav-bar title="面试邀约"></nav-bar>
  5. <view class="content">
  6. <view class="detail-title">邀请面试</view>
  7. <view class="card-box">
  8. <view class="cell">
  9. <view class="cell-label">面试类型</view>
  10. <u-radio-group v-model="radioValue">
  11. <u-radio name="0">线下面试</u-radio>
  12. <u-radio name="1">线上面试</u-radio>
  13. </u-radio-group>
  14. </view>
  15. <view class="cell">
  16. <view class="cell-label">面试职位</view>
  17. <view class="cell-input" hover-class="cell-hover" @click="position = true">
  18. <view class="m-ellipsis">
  19. {{ selectedJob ? selectedJob.ruleClassifyName + ' · ' + selectedJob.salaryRange : '请选择职位' }}
  20. </view>
  21. <image class="cell-icon" src="/static/images/msg/down_arrow.svg" mode="aspectFit"></image>
  22. </view>
  23. </view>
  24. <view class="cell" v-if="radioValue == 0">
  25. <view class="cell-label">面试地址</view>
  26. <view class="cell-input" hover-class="cell-hover" @click="goPage('address',{detailedAddress,address,latitude,longitude})">
  27. <view class="m-ellipsis">{{selectedAddress || '请选择地址'}}</view>
  28. <image class="cell-icon" src="/static/images/msg/down_arrow.svg" mode="aspectFit"></image>
  29. </view>
  30. </view>
  31. <view class="cell" v-if="radioValue == 1">
  32. <view class="cell-label">面试方式</view>
  33. <view class="cell-input" hover-class="cell-hover" @click="method = true">
  34. <view class="m-ellipsis">{{selecteMethodText || '请选择面试方式'}}</view>
  35. <image class="cell-icon" src="/static/images/msg/down_arrow.svg" mode="aspectFit"></image>
  36. </view>
  37. </view>
  38. <view class="cell">
  39. <view class="cell-label">联系人</view>
  40. <view class="cell-input" hover-class="cell-hover" @click="person = true">
  41. <view class="m-ellipsis">{{personText || '请选择联系人'}}</view>
  42. <image class="cell-icon" src="/static/images/msg/down_arrow.svg" mode="aspectFit"></image>
  43. </view>
  44. </view>
  45. <view class="explanation">为保证求职者联系到面试企业,求职者接受面试后,可查看职位发布人&联系人的电话</view>
  46. </view>
  47. <view class="card-box" style="padding: 0;">
  48. <view class="note">
  49. <view class="note-label note-time">面试日期</view>
  50. <uni-calendar class="uni-calendar--hook" :selected="selectedDate" :startDate="date" :showMonth="false" @change="change"
  51. @monthSwitch="monthSwitch" />
  52. </view>
  53. </view>
  54. <!-- 选择时间 -->
  55. <view class="card-box">
  56. <view class="cell" style="margin-bottom: 0;">
  57. <view class="cell-label">开始时间</view>
  58. <view class="cell-input flex-end" hover-class="cell-hover" @click="isShowTime = true">
  59. <view class="m-ellipsis">{{selectedTime || '请选择时间' }}</view>
  60. <image class="cell-icon" src="/static/images/msg/down_arrow.svg" mode="aspectFit"></image>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="card-box">
  65. <view class="note">
  66. <view class="note-label">备注事项</view>
  67. <view class="textarea-wrapper">
  68. <textarea v-model="textareaValue" placeholder-class="placeholder-text"
  69. placeholder="请输入告知求职者的其他内容,例如具体路线,所需材料等。" @input="updateLength" :maxlength="140">
  70. </textarea>
  71. <view class="word-count"><text style="color: #016BF6;">{{ textareaLength }}</text>/140</view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. <button class="btn" @click="rules = true">发送面试邀请</button>
  77. <!-- 面试职位 -->
  78. <u-popup v-model="position" mode="bottom" border-radius="40">
  79. <view class="pop-content">
  80. <view class="pop-title">选择面试职位</view>
  81. <scroll-view class="pop-card" scroll-y>
  82. <view class="pop-card-item" v-for="(item, index) in jobList" :key="index" @click="chooseJob(item)">
  83. <u-radio-group v-model="popRadioValue">
  84. <u-radio :name="item.ruleClassifyId"></u-radio>
  85. </u-radio-group>
  86. <view>{{ item.ruleClassifyName }}</view>
  87. <view class="pop-tag">
  88. {{ item.city }}
  89. <u-line color="#999999" direction="col" length="20rpx" margin="10rpx"></u-line>
  90. {{ item.education }}
  91. <u-line color="#999999" direction="col" length="20rpx" margin="10rpx"></u-line>
  92. {{ item.salaryRange }}
  93. </view>
  94. </view>
  95. </scroll-view>
  96. </view>
  97. </u-popup>
  98. <!-- 选择联系人 -->
  99. <u-popup v-model="person" mode="bottom" border-radius="40">
  100. <view class="pop-content">
  101. <view class="pop-title">
  102. <view>选择联系人</view>
  103. <view class="note">您可填写其他面试联系人电话,请保证已获得其授权同意,求职者接受面试后可以查看该号码</view>
  104. </view>
  105. <scroll-view class="pop-card" scroll-y>
  106. <view class="person-item" v-for="(item,index) in personList" :key="item.id"
  107. @click="selectPerson(item)">
  108. <view>{{item.hrName}}</view>
  109. <view class="pop-phone">{{item.hrPhone}}</view>
  110. <image class="pop-icon" src="/static/images/msg/edit.svg" mode="aspectFit"
  111. @click="goPage('editPerson',item)"></image>
  112. </view>
  113. </scroll-view>
  114. <button class="pop-btn" @click="goPage('addPerson')">新增联系人</button>
  115. </view>
  116. </u-popup>
  117. <!-- 选择面试方式 -->
  118. <u-popup v-model="method" mode="bottom" border-radius="40">
  119. <view class="pop-content">
  120. <view class="pop-title">选择面试方式</view>
  121. <view class="pop-method">
  122. <view v-for="(item,i) in methodList" :key="i" class="method-item"
  123. :class="methodActiveIndex == i?'active-item':''" @click="changeMethod(i,item)">{{ item }}
  124. </view>
  125. <view class="method-text">
  126. <textarea placeholder-class="pop-placeholder-text" v-model="onlineMsg" placeholder="粘贴会议邀请信息">
  127. </textarea>
  128. </view>
  129. </view>
  130. <button class="btn btn-m" @click="method = false">确定</button>
  131. </view>
  132. </u-popup>
  133. <!-- 选择时间 -->
  134. <u-popup v-model="isShowTime" mode="bottom" border-radius="40">
  135. <view class="pop-content">
  136. <view class="pop-title">请选择面试开始时间</view>
  137. <picker-view :value="timeValue" @change="bindChange" class="picker-view">
  138. <picker-view-column>
  139. <view class="item" v-for="(item,index) in hours" :key="index">{{ item }}</view>
  140. </picker-view-column>
  141. <picker-view-column>
  142. <view class="item" v-for="(item,index) in minutes" :key="index">{{ item }}</view>
  143. </picker-view-column>
  144. <picker-view-column>
  145. <view class="item" v-for="(item,index) in meridiem" :key="index">{{ item }}</view>
  146. </picker-view-column>
  147. </picker-view>
  148. <button class="pop-time-btn" @click="changeBtn">确定</button>
  149. </view>
  150. </u-popup>
  151. <!-- 原则 -->
  152. <u-popup v-model="rules" mode="center" border-radius="40">
  153. <view class="pop-rules">
  154. <view class="pop-text">
  155. <view class="pop-rules-title">约面试诚信原则</view>
  156. <view v-if="isCancel">1.面试前3小时,双方可以申请取消<br />
  157. 2.如不取消,请按时出席,不要爽约<br />
  158. 3.对方爽约,可在平台内投诉<br />
  159. 4.为了方便联系,约面试后上双方自动交换手机联系方式
  160. </view>
  161. <view v-else>请及时关注面试时间,以免忘记面试</view>
  162. </view>
  163. <view class="rules-btn" v-if="isCancel">
  164. <button class="cancel" hover-class="none" @click="rules = false">思考片刻再决定</button>
  165. <button class="guarantee" @click="isCancel = false">保证不爽约</button>
  166. </view>
  167. <view v-else>
  168. <button class="confirm" @click="confirmRules">确认</button>
  169. </view>
  170. </view>
  171. </u-popup>
  172. </view>
  173. </template>
  174. <script>
  175. import navBar from "@/components/nav-bar/index.vue";
  176. export default {
  177. data() {
  178. return {
  179. radioValue: 0, //类型
  180. position: false,
  181. textareaValue: '',
  182. textareaLength: 0,
  183. popRadioValue: '',
  184. jobList: {},
  185. selectedJob: '',
  186. selectedAddress: '',
  187. person: false,
  188. personList: [{
  189. id: 0,
  190. name: '宋先生',
  191. phone: '18888888888'
  192. }],
  193. personText: '',
  194. method: false,
  195. selected: [],
  196. // 选择时间
  197. isShowTime: false,
  198. selectedTime: '',
  199. timeValue: [0, 0, 0],
  200. hours: Array.from({
  201. length: 12
  202. }, (_, i) => i + 1),
  203. minutes: Array.from({
  204. length: 60
  205. }, (_, i) => i),
  206. meridiem: ['AM', 'PM'],
  207. methodList: ['腾讯会议', '钉钉', '微信视频', '电话面试'],
  208. methodActiveIndex: 0,
  209. selecteMethodText: '腾讯会议',
  210. rules: false,
  211. isCancel: true,
  212. postPushId: "",
  213. interviewDateTime: "",
  214. resumesId: "",
  215. companyId: "",
  216. remarks: "",
  217. detailedAddress: "",
  218. address: "",
  219. latitude:0,
  220. longitude:0,
  221. detailTime: "",
  222. onlineType: "",
  223. onlineMsg: "",
  224. hrPhone: "",
  225. interviewerId: "",
  226. hrName: "",
  227. signTime: "",
  228. date: "",
  229. time: "",
  230. recordId:'',
  231. selectedDate:[]
  232. };
  233. },
  234. components: {
  235. navBar
  236. },
  237. onLoad(option) {
  238. if (option.postPushId) {
  239. this.postPushId = option.postPushId
  240. console.log("接收到的参数postPushId:",option.postPushId)
  241. }
  242. if (option.resumesId) {
  243. this.resumesId = option.resumesId
  244. console.log("接收到的参数resumesId:",option.resumesId)
  245. }
  246. if (option.interviewerId) {
  247. this.interviewerId = option.interviewerId
  248. console.log("接收到的参数interviewerId:",option.interviewerId)
  249. }
  250. if (option&&option.recordId) {
  251. this.recordId = option.recordId
  252. console.log("接收到的参数resumesId:",option.resumesId)
  253. }
  254. this.PostPushDetails()
  255. this.getCurrentDateTime()
  256. this.selectHrPhone()
  257. },
  258. methods: {
  259. change(e) {
  260. this.interviewDateTime = e.fulldate
  261. console.log('change 返回:', this.interviewDateTime)
  262. },
  263. monthSwitch(e) {
  264. console.log('monthSwitchs 返回:', e)
  265. },
  266. updateLength(e) {
  267. this.textareaLength = e.target.value.length
  268. },
  269. //根据传过来的Id查询对应岗位
  270. PostPushDetails() {
  271. uni.showLoading({
  272. title: '加载中'
  273. })
  274. let data = {
  275. postPushId: this.postPushId,
  276. }
  277. this.$Request.get('/app/postPush/selectPostPushDetails', data).then(res => {
  278. if (res.code == 0) {
  279. uni.hideLoading()
  280. this.jobList = [{
  281. ...res.data,
  282. index: 0 // 添加下标
  283. }];
  284. this.companyId = res.data.companyId;
  285. this.selectedJob = res.data;
  286. this.popRadioValue = res.data.ruleClassifyId;
  287. if(this.recordId!=''){
  288. this.getData()
  289. }
  290. this.selectedAddress = res.data.address
  291. this.address = res.data.address?res.data.address.split(' ')[0] : '';
  292. this.detailedAddress = res.data.address?res.data.address.split(' ')[1] : '';
  293. this.latitude=res.data.lat || ''
  294. this.longitude=res.data.lng || ''
  295. console.log(this.jobList)
  296. } else {
  297. uni.hideLoading()
  298. uni.showModal({
  299. title: '提示',
  300. content: '数据不存在',
  301. showCancel: false,
  302. complete(ret) {
  303. uni.navigateBack()
  304. }
  305. })
  306. }
  307. })
  308. },
  309. //获取联系人列表
  310. selectHrPhone(){
  311. this.$Request.get('/app/interviewRecord/selectHrPhone', {}).then(res => {
  312. if (res.code == 0) {
  313. uni.hideLoading()
  314. this.personList=res.data;
  315. if(res.data.length > 0){
  316. this.personText = res.data[0].hrName;
  317. this.hrPhone = res.data[0].hrPhone
  318. }else{
  319. this.personText = this.$queue.getData("userName");
  320. this.hrPhone = this.$queue.getData("phone");
  321. }
  322. console.log(res.data)
  323. } else {
  324. uni.hideLoading()
  325. uni.showModal({
  326. title: '提示',
  327. content: '数据不存在',
  328. showCancel: false,
  329. complete(ret) {
  330. uni.navigateBack()
  331. }
  332. })
  333. }
  334. })
  335. },
  336. chooseJob(item) {
  337. this.selectedJob = item;
  338. this.popRadioValue = item.ruleClassifyId;
  339. this.position = false;
  340. },
  341. // 选择地址 联系人 以及编辑联系人
  342. goPage(type, item) {
  343. uni.navigateTo({
  344. url: `/pages/msg/selectInterview?type=${type}`,
  345. success: (res) => {
  346. res.eventChannel.emit('sendData', {
  347. type,
  348. item,
  349. callback: (data) => {
  350. console.log(data)
  351. if (type === 'address') {
  352. this.selectedAddress = data.address + (data.floor || '')
  353. this.detailedAddress = data.floor
  354. this.address = data.address
  355. this.latitude=data.latitude
  356. this.longitude=data.longitude
  357. } else if (type === 'addPerson') {
  358. this.personList.push(data)
  359. } else if (type === 'editPerson') {
  360. const index = this.personList.findIndex(p => p.id === data.id)
  361. if (index !== -1) this.personList.splice(index, 1, data);
  362. this.personText = data.hrName;
  363. }
  364. }
  365. })
  366. }
  367. })
  368. },
  369. selectPerson(item) {
  370. this.personText = item.hrName;
  371. this.person = false;
  372. this.hrPhone = item.hrPhone
  373. },
  374. bindChange(e) {
  375. console.log(e.detail.value)
  376. this.timeValue = e.detail.value
  377. },
  378. changeBtn() {
  379. console.log(this.timeValue)
  380. const val = this.timeValue
  381. const hour = this.hours[val[0]]
  382. const minute = this.minutes[val[1]]
  383. const ampm = this.meridiem[val[2]]
  384. this.selectedTime = `${hour}:${minute < 10 ? '0' + minute : minute} ${ampm}`
  385. console.log(ampm)
  386. var hourss = hour
  387. if (ampm == "PM") {
  388. hourss = hour + 12;
  389. }
  390. var time = `${hourss}:${minute < 10 ? '0' + minute : minute}`
  391. if (this.isTimeGreaterThanNow(time)) {
  392. uni.showToast({
  393. title: '选择的时间不能早于当前时间',
  394. icon: 'none'
  395. });
  396. this.selectedTime = '';
  397. return;
  398. }
  399. this.isShowTime = false;
  400. },
  401. // 判断时间是否大于当前时间(同一天)
  402. isTimeGreaterThanNow(selectedTime) {
  403. const now = new Date();
  404. //const today = `${now.getFullYear()}-${(now.getMonth() + 1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')}`;
  405. const timeString = `${this.interviewDateTime} ${selectedTime}`;
  406. const selectedDate = new Date(timeString);
  407. console.log(this.interviewDateTime)
  408. console.log("选择的日期和时间:", timeString);
  409. console.log("选择的日期和时间chuooooo:", selectedDate);
  410. console.log("今天的chuooooo:", now);
  411. return selectedDate < now;
  412. },
  413. // 获取当前日期和时间(格式:YYYY-MM-DD HH:mm:ss)
  414. getCurrentDateTime() {
  415. const now = new Date();
  416. const year = now.getFullYear();
  417. const month = (now.getMonth() + 1).toString().padStart(2, '0');
  418. const day = now.getDate().toString().padStart(2, '0');
  419. const hours = now.getHours().toString().padStart(2, '0');
  420. const minutes = now.getMinutes().toString().padStart(2, '0');
  421. const seconds = now.getSeconds().toString().padStart(2, '0');
  422. this.date = `${year}-${month}-${day}`
  423. this.time = `${hours}:${minutes}:${seconds}`
  424. this.interviewDateTime = `${year}-${month}-${day}`
  425. // dateTime: `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`,
  426. // fullDate: `${year}年${month}月${day}日`,
  427. // fullTime: `${hours}:${minutes}:${seconds}`
  428. console.log(this.date)
  429. },
  430. changeMethod(i, val) {
  431. this.methodActiveIndex = i
  432. this.selecteMethodText = val
  433. },
  434. getData(){
  435. var that=this
  436. this.$Request.getT("/app/interviewRecord/getInterviewInfo", {recordId:this.recordId}).then((res) => {
  437. if (res.code == 0) {
  438. this.type=res.data.type
  439. this.popRadioValue = res.data.postPush.ruleClassifyId;
  440. this.jobList.forEach(function(item){
  441. if(item.ruleClassifyId==that.popRadioValue)
  442. that.selectedJob = item
  443. })
  444. this.latitude=res.data.lat
  445. this.longitude=res.data.lng
  446. this.textareaValue=res.data.remarks
  447. this.interviewDateTime=res.data.interviewDateTime.substring(0,10)
  448. this.selectedDate=[{date:this.interviewDateTime,info:'已预约'}]
  449. this.address=res.data.address
  450. this.detailedAddress=res.data.detailedAddress
  451. this.selectedAddress = this.address + (this.detailedAddress || '')
  452. this.hrPhone=res.data.hrPhone
  453. this.personText=res.data.hrName
  454. this.selectedTime=res.data.detailTime
  455. if(this.selectedTime){
  456. var timeLimit=res.data.detailTime.split(' ')
  457. var hourMinute=timeLimit[0].split(':')
  458. this.timeValue=[this.hours.indexOf(parseInt(hourMinute[0])),this.minutes.indexOf(parseInt(hourMinute[1])),this.meridiem.indexOf(timeLimit[1])]
  459. }
  460. this.selecteMethodText=res.data.onlineType||''
  461. this.onlineMsg=res.data=res.data.onlineMsg||''
  462. } else {
  463. uni.showToast({
  464. title: res.msg,
  465. icon: "none",
  466. });
  467. }
  468. });
  469. },
  470. confirmRules() {
  471. var data = {
  472. recordId:this.recordId,
  473. interviewDateTime: this.interviewDateTime+' 00:00:00',
  474. postPushId: this.postPushId,
  475. resumesId: this.resumesId,
  476. companyId: this.companyId,
  477. remarks: this.textareaValue,
  478. detailedAddress: this.detailedAddress,
  479. type: this.radioValue,
  480. address: this.radioValue == 0 ? this.address : '',
  481. lat:this.latitude,
  482. lng:this.longitude,
  483. detailTime: this.selectedTime,
  484. onlineType: this.radioValue == 1 ? this.methodActiveIndex : '',
  485. onlineMsg: this.radioValue == 1 ? this.onlineMsg : '',
  486. interviewerId: this.interviewerId,
  487. hrPhone: this.hrPhone,
  488. hrName: this.personText,
  489. }
  490. if(!data.hrPhone || !data.hrName){
  491. uni.showToast({
  492. title: '请选择联系人',
  493. icon: 'none'
  494. });
  495. return
  496. }
  497. if(!this.interviewDateTime || !data.detailTime){
  498. uni.showToast({
  499. title: '请选择面试时间',
  500. icon: 'none'
  501. });
  502. return
  503. }
  504. if(!this.postPushId){
  505. uni.showToast({
  506. title: '请选择面试岗位',
  507. icon: 'none'
  508. });
  509. return
  510. }
  511. console.log('面试邀约信息====', data);
  512. //发哦那个面试邀约
  513. this.$Request.postJson('/app/interviewRecord/saveInterview', data).then(ret => {
  514. if (ret.code == 0) {
  515. // 回传上一页
  516. this.$Request.getT("/app/chat/selectByTwoIds", {userId:this.interviewerId,'focusedUserId':this.$queue.getData('userId')}).then((res) => {
  517. if (res.code == 0)
  518. this.$queue.sendImMessage(this.interviewerId,'一份面试邀约',99,res.data,ret.data)
  519. })
  520. uni.$emit('saveInterviewResult', "success");
  521. uni.navigateBack();
  522. }
  523. })
  524. setTimeout(() => {
  525. this.isCancel = true;
  526. }, 200);
  527. },
  528. }
  529. };
  530. </script>
  531. <style scoped lang="scss">
  532. @import "./css/interviewInvitation.scss";
  533. </style>