interviewInvitation.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  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. let stationNameInfo = this.$queue.getJson('companyAddressInfo') || [];
  255. this.selectedAddress = this.$queue.getData('companyAddress')
  256. this.detailedAddress = stationNameInfo.addressDetail
  257. this.address = stationNameInfo.address
  258. this.latitude=stationNameInfo.latitude
  259. this.longitude=stationNameInfo.longitude
  260. this.PostPushDetails()
  261. this.getCurrentDateTime()
  262. this.selectHrPhone()
  263. },
  264. methods: {
  265. change(e) {
  266. this.interviewDateTime = e.fulldate
  267. console.log('change 返回:', this.interviewDateTime)
  268. },
  269. monthSwitch(e) {
  270. console.log('monthSwitchs 返回:', e)
  271. },
  272. updateLength(e) {
  273. this.textareaLength = e.target.value.length
  274. },
  275. //根据传过来的Id查询对应岗位
  276. PostPushDetails() {
  277. uni.showLoading({
  278. title: '加载中'
  279. })
  280. let data = {
  281. postPushId: this.postPushId,
  282. }
  283. this.$Request.get('/app/postPush/selectPostPushDetails', data).then(res => {
  284. if (res.code == 0) {
  285. uni.hideLoading()
  286. this.jobList = [{
  287. ...res.data,
  288. index: 0 // 添加下标
  289. }];
  290. this.companyId = res.data.companyId;
  291. this.selectedJob = res.data;
  292. this.popRadioValue = res.data.ruleClassifyId;
  293. if(this.recordId!=''){
  294. this.getData()
  295. }
  296. console.log(this.jobList)
  297. } else {
  298. uni.hideLoading()
  299. uni.showModal({
  300. title: '提示',
  301. content: '数据不存在',
  302. showCancel: false,
  303. complete(ret) {
  304. uni.navigateBack()
  305. }
  306. })
  307. }
  308. })
  309. },
  310. //获取联系人列表
  311. selectHrPhone(){
  312. this.$Request.get('/app/interviewRecord/selectHrPhone', {}).then(res => {
  313. if (res.code == 0) {
  314. uni.hideLoading()
  315. this.personList=res.data;
  316. if(res.data.length > 0){
  317. this.personText = res.data[0].hrName;
  318. this.hrPhone = res.data[0].hrPhone
  319. }else{
  320. this.personText = this.$queue.getData("userName");
  321. this.hrPhone = this.$queue.getData("phone");
  322. }
  323. console.log(res.data)
  324. } else {
  325. uni.hideLoading()
  326. uni.showModal({
  327. title: '提示',
  328. content: '数据不存在',
  329. showCancel: false,
  330. complete(ret) {
  331. uni.navigateBack()
  332. }
  333. })
  334. }
  335. })
  336. },
  337. chooseJob(item) {
  338. this.selectedJob = item;
  339. this.popRadioValue = item.ruleClassifyId;
  340. this.position = false;
  341. },
  342. // 选择地址 联系人 以及编辑联系人
  343. goPage(type, item) {
  344. uni.navigateTo({
  345. url: `/pages/msg/selectInterview?type=${type}`,
  346. success: (res) => {
  347. res.eventChannel.emit('sendData', {
  348. type,
  349. item,
  350. callback: (data) => {
  351. console.log(data)
  352. if (type === 'address') {
  353. this.selectedAddress = data.address + data.floor
  354. this.detailedAddress = data.floor
  355. this.address = data.address
  356. this.latitude=data.latitude
  357. this.longitude=data.longitude
  358. } else if (type === 'addPerson') {
  359. this.personList.push(data)
  360. } else if (type === 'editPerson') {
  361. const index = this.personList.findIndex(p => p.id === data.id)
  362. if (index !== -1) this.personList.splice(index, 1, data);
  363. this.personText = data.hrName;
  364. }
  365. }
  366. })
  367. }
  368. })
  369. },
  370. selectPerson(item) {
  371. this.personText = item.hrName;
  372. this.person = false;
  373. this.hrPhone = item.hrPhone
  374. },
  375. bindChange(e) {
  376. console.log(e.detail.value)
  377. this.timeValue = e.detail.value
  378. },
  379. changeBtn() {
  380. console.log(this.timeValue)
  381. const val = this.timeValue
  382. const hour = this.hours[val[0]]
  383. const minute = this.minutes[val[1]]
  384. const ampm = this.meridiem[val[2]]
  385. this.selectedTime = `${hour}:${minute < 10 ? '0' + minute : minute} ${ampm}`
  386. console.log(ampm)
  387. var hourss = hour
  388. if (ampm == "PM") {
  389. hourss = hour + 12;
  390. }
  391. var time = `${hourss}:${minute < 10 ? '0' + minute : minute}`
  392. if (this.isTimeGreaterThanNow(time)) {
  393. uni.showToast({
  394. title: '选择的时间不能早于当前时间',
  395. icon: 'none'
  396. });
  397. this.selectedTime = '';
  398. return;
  399. }
  400. this.isShowTime = false;
  401. },
  402. // 判断时间是否大于当前时间(同一天)
  403. isTimeGreaterThanNow(selectedTime) {
  404. const now = new Date();
  405. //const today = `${now.getFullYear()}-${(now.getMonth() + 1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')}`;
  406. const timeString = `${this.interviewDateTime} ${selectedTime}`;
  407. const selectedDate = new Date(timeString);
  408. console.log(this.interviewDateTime)
  409. console.log("选择的日期和时间:", timeString);
  410. console.log("选择的日期和时间chuooooo:", selectedDate);
  411. console.log("今天的chuooooo:", now);
  412. return selectedDate < now;
  413. },
  414. // 获取当前日期和时间(格式:YYYY-MM-DD HH:mm:ss)
  415. getCurrentDateTime() {
  416. const now = new Date();
  417. const year = now.getFullYear();
  418. const month = (now.getMonth() + 1).toString().padStart(2, '0');
  419. const day = now.getDate().toString().padStart(2, '0');
  420. const hours = now.getHours().toString().padStart(2, '0');
  421. const minutes = now.getMinutes().toString().padStart(2, '0');
  422. const seconds = now.getSeconds().toString().padStart(2, '0');
  423. this.date = `${year}-${month}-${day}`
  424. this.time = `${hours}:${minutes}:${seconds}`
  425. this.interviewDateTime = `${year}-${month}-${day}`
  426. // dateTime: `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`,
  427. // fullDate: `${year}年${month}月${day}日`,
  428. // fullTime: `${hours}:${minutes}:${seconds}`
  429. console.log(this.date)
  430. },
  431. changeMethod(i, val) {
  432. this.methodActiveIndex = i
  433. this.selecteMethodText = val
  434. },
  435. getData(){
  436. var that=this
  437. this.$Request.getT("/app/interviewRecord/getInterviewInfo", {recordId:this.recordId}).then((res) => {
  438. if (res.code == 0) {
  439. this.type=res.data.type
  440. this.popRadioValue = res.data.postPush.ruleClassifyId;
  441. this.jobList.forEach(function(item){
  442. if(item.ruleClassifyId==that.popRadioValue)
  443. that.selectedJob = item
  444. })
  445. this.latitude=res.data.lat
  446. this.longitude=res.data.lng
  447. this.textareaValue=res.data.remarks
  448. this.interviewDateTime=res.data.interviewDateTime.substring(0,10)
  449. this.selectedDate=[{date:this.interviewDateTime,info:'已预约'}]
  450. this.address=res.data.address
  451. this.detailedAddress=res.data.detailedAddress
  452. this.selectedAddress = this.address + this.detailedAddress
  453. this.hrPhone=res.data.hrPhone
  454. this.personText=res.data.hrName
  455. this.selectedTime=res.data.detailTime
  456. if(this.selectedTime){
  457. var timeLimit=res.data.detailTime.split(' ')
  458. var hourMinute=timeLimit[0].split(':')
  459. this.timeValue=[this.hours.indexOf(parseInt(hourMinute[0])),this.minutes.indexOf(parseInt(hourMinute[1])),this.meridiem.indexOf(timeLimit[1])]
  460. }
  461. this.selecteMethodText=res.data.onlineType||''
  462. this.onlineMsg=res.data=res.data.onlineMsg||''
  463. } else {
  464. uni.showToast({
  465. title: res.msg,
  466. icon: "none",
  467. });
  468. }
  469. });
  470. },
  471. confirmRules() {
  472. var data = {
  473. recordId:this.recordId,
  474. interviewDateTime: this.interviewDateTime+' 00:00:00',
  475. postPushId: this.postPushId,
  476. resumesId: this.resumesId,
  477. companyId: this.companyId,
  478. remarks: this.textareaValue,
  479. detailedAddress: this.detailedAddress,
  480. type: this.radioValue,
  481. address: this.address,
  482. lat:this.latitude,
  483. lng:this.longitude,
  484. detailTime: this.selectedTime,
  485. onlineType: this.selecteMethodText,
  486. onlineMsg: this.onlineMsg,
  487. interviewerId: this.interviewerId,
  488. hrPhone: this.hrPhone,
  489. hrName: this.personText,
  490. }
  491. if(!data.hrPhone || !data.hrName){
  492. uni.showToast({
  493. title: '请选择联系人',
  494. icon: 'none'
  495. });
  496. return
  497. }
  498. if(!this.interviewDateTime || !data.detailTime){
  499. uni.showToast({
  500. title: '请选择面试时间',
  501. icon: 'none'
  502. });
  503. return
  504. }
  505. if(!this.postPushId){
  506. uni.showToast({
  507. title: '请选择面试岗位',
  508. icon: 'none'
  509. });
  510. return
  511. }
  512. console.log('面试邀约信息====', data);
  513. //发哦那个面试邀约
  514. this.$Request.postJson('/app/interviewRecord/saveInterview', data).then(ret => {
  515. if (ret.code == 0) {
  516. // 回传上一页
  517. this.$Request.getT("/app/chat/selectByTwoIds", {userId:this.interviewerId,'focusedUserId':this.$queue.getData('userId')}).then((res) => {
  518. if (res.code == 0)
  519. this.$queue.sendImMessage(this.interviewerId,'一份面试邀约',99,res.data)
  520. })
  521. uni.$emit('saveInterviewResult', "success");
  522. uni.navigateBack();
  523. }
  524. })
  525. setTimeout(() => {
  526. this.isCancel = true;
  527. }, 200);
  528. },
  529. }
  530. };
  531. </script>
  532. <style scoped lang="scss">
  533. @import "./css/interviewInvitation.scss";
  534. </style>