interviewInvitation.vue 18 KB

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