hire.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. <template>
  2. <view>
  3. <view style="padding:5rpx 20rpx 45rpx 20rpx;">
  4. <view style="background-color: #f7f7f7;padding: 20rpx;border-radius: 10rpx;color: #000000;">
  5. <view class="desc">
  6. <uni-row>
  7. <uni-col :span="5">
  8. <view class="desc" style="font-size: 25rpx;">
  9. 姓名
  10. </view>
  11. </uni-col>
  12. <uni-col :span="19">
  13. <view>
  14. <uni-easyinput primaryColor="#37babd" v-model="form.name">
  15. </uni-easyinput>
  16. </view>
  17. </uni-col>
  18. </uni-row>
  19. </view>
  20. <view class="desc">
  21. <uni-row>
  22. <uni-col :span="5">
  23. <view class="desc" style="font-size: 25rpx;">
  24. 性别
  25. </view>
  26. </uni-col>
  27. <uni-col :span="19">
  28. <view class="pickerView">
  29. <picker @change="sexsBindPickerChange" :value="sexs.index" :range="sexs.data"
  30. range-key="dictLabel">
  31. <view class="pickerText"
  32. v-if="sexs.data && sexs.data.length>0 && sexs.index !== undefined">
  33. {{ sexs.data[sexs.index].dictLabel }}
  34. </view>
  35. <view class="pickerText" v-else>
  36. 待 选 择
  37. </view>
  38. </picker>
  39. </view>
  40. </uni-col>
  41. </uni-row>
  42. </view>
  43. <view class="desc">
  44. <uni-row>
  45. <uni-col :span="5">
  46. <view class="desc" style="font-size: 25rpx;">
  47. 手机号
  48. </view>
  49. </uni-col>
  50. <uni-col :span="19">
  51. <view>
  52. <uni-easyinput primaryColor="#37babd" v-model="form.phone">
  53. </uni-easyinput>
  54. </view>
  55. </uni-col>
  56. </uni-row>
  57. </view>
  58. <view class="desc">
  59. <uni-row>
  60. <uni-col :span="5">
  61. <view class="desc" style="font-size: 25rpx;">
  62. 生日
  63. </view>
  64. </uni-col>
  65. <uni-col :span="19">
  66. <view>
  67. <uni-datetime-picker type="date" :clear-icon="false" v-model="form.birthdate"
  68. @maskClick="maskClick" @change="onchange()" />
  69. </view>
  70. </uni-col>
  71. </uni-row>
  72. </view>
  73. <view class="desc">
  74. <uni-row>
  75. <uni-col :span="5">
  76. <view class="desc" style="font-size: 25rpx;">
  77. 毕业院校
  78. </view>
  79. </uni-col>
  80. <uni-col :span="19">
  81. <view>
  82. <uni-easyinput primaryColor="#37babd" v-model="form.graduateSchool">
  83. </uni-easyinput>
  84. </view>
  85. </uni-col>
  86. </uni-row>
  87. </view>
  88. <view class="desc">
  89. <uni-row>
  90. <uni-col :span="5">
  91. <view class="desc" style="font-size: 25rpx;">
  92. 学历学位
  93. </view>
  94. </uni-col>
  95. <uni-col :span="19">
  96. <view>
  97. <view class="pickerView">
  98. <picker @change="degreeBindPickerChange" :value="degree.index" :range="degree.data"
  99. range-key="dictLabel">
  100. <view class="pickerText"
  101. v-if="degree.data && degree.data.length>0 && degree.index !== undefined">
  102. {{ degree.data[degree.index].dictLabel }}
  103. </view>
  104. <view class="pickerText" v-else>
  105. 待 选 择
  106. </view>
  107. </picker>
  108. </view>
  109. </view>
  110. </uni-col>
  111. </uni-row>
  112. </view>
  113. <view class="desc">
  114. <view class="desc" style="font-size: 25rpx;">
  115. 专业技能</view>
  116. <view>
  117. <uni-easyinput type="textarea" primaryColor="#37babd" v-model="form.skill">
  118. </uni-easyinput>
  119. </view>
  120. </view>
  121. </view>
  122. <view class="desc">
  123. <uni-row>
  124. <uni-col :span="5">
  125. <view class="desc" style="font-size: 25rpx;">
  126. 入职部门
  127. </view>
  128. </uni-col>
  129. <uni-col :span="19">
  130. <view class="pickerView">
  131. <picker @change="deptBindPickerChange" :value="deptConfig.deptIndex"
  132. :range="deptConfig.deptDatas" range-key="deptName">
  133. <view class="pickerText"
  134. v-if="deptConfig.deptDatas && deptConfig.deptDatas.length>0 && deptConfig.deptIndex !== undefined">
  135. {{ deptConfig.deptDatas[deptConfig.deptIndex].deptName }}
  136. </view>
  137. <view class="pickerText" v-else>
  138. 待 选 择
  139. </view>
  140. </picker>
  141. </view>
  142. </uni-col>
  143. </uni-row>
  144. </view>
  145. <view class="desc">
  146. <uni-row>
  147. <uni-col :span="5">
  148. <view class="desc" style="font-size: 25rpx;">
  149. 入职岗位
  150. </view>
  151. </uni-col>
  152. <uni-col :span="19">
  153. <view class="pickerView">
  154. <picker @change="postBindPickerChange" :value="post.index" :range="post.data"
  155. range-key="postName">
  156. <view class="pickerText"
  157. v-if="post.data && post.data.length>0 && post.index !== undefined">
  158. {{ post.data[post.index].postName }}
  159. </view>
  160. <view class="pickerText" v-else>
  161. 待 选 择
  162. </view>
  163. </picker>
  164. </view>
  165. </uni-col>
  166. </uni-row>
  167. </view>
  168. <view class="desc">
  169. <uni-row>
  170. <uni-col :span="5">
  171. <view class="desc" style="font-size: 25rpx;">
  172. 报到时间
  173. </view>
  174. </uni-col>
  175. <uni-col :span="19">
  176. <view>
  177. <uni-datetime-picker type="date" :clear-icon="false" v-model="form.interviewTime"
  178. @maskClick="maskClick" @change="onchange()" />
  179. </view>
  180. </uni-col>
  181. </uni-row>
  182. </view>
  183. <view class="desc">
  184. 面试形式
  185. </view>
  186. <view class="desc">
  187. <uni-row>
  188. <uni-col :span="5">
  189. <view class="desc" style="font-size: 25rpx;">
  190. 录用结论
  191. </view>
  192. </uni-col>
  193. <uni-col :span="19">
  194. <view class="pickerView">
  195. <picker @change="hireBindPickerChange" :value="hire_result.index" :range="hire_result.data"
  196. range-key="dictLabel">
  197. <view class="pickerText"
  198. v-if="hire_result.data && hire_result.data.length>0 && hire_result.index !== undefined">
  199. {{ hire_result.data[hire_result.index].dictLabel }}
  200. </view>
  201. <view class="pickerText" v-else>
  202. 待 选 择
  203. </view>
  204. </picker>
  205. </view>
  206. </uni-col>
  207. </uni-row>
  208. </view>
  209. <view class="desc">
  210. <uni-row>
  211. <uni-col :span="5">
  212. <view class="desc" style="font-size: 25rpx;">
  213. 录用职级
  214. </view>
  215. </uni-col>
  216. <uni-col :span="19">
  217. <view>
  218. <uni-easyinput primaryColor="#37babd" v-model="form.name">
  219. </uni-easyinput>
  220. </view>
  221. </uni-col>
  222. </uni-row>
  223. </view>
  224. <view class="desc">
  225. <view class="desc" style="font-size: 25rpx;">
  226. 备注
  227. </view>
  228. <view>
  229. <uni-easyinput type="textarea" primaryColor="#37babd" v-model="form.remark">
  230. </uni-easyinput>
  231. </view>
  232. </view>
  233. </view>
  234. <u-gap height="70" bgColor="#ffffff"></u-gap>
  235. <view class="bottim_view">
  236. <view>
  237. <u-row>
  238. <u-col span="11">
  239. <u-button :disabled="isDisabled" class="btnDoPay" shape="circle" @click="submit"
  240. color="rgb(55,186,189)" text="提交"></u-button>
  241. </u-col>
  242. </u-row>
  243. </view>
  244. </view>
  245. <!-- 下一步选择人员弹窗 -->
  246. <uni-popup ref="popup" background-color="#fff">
  247. <view style="height: 800rpx;">
  248. <view class="desc">
  249. <uni-row>
  250. <uni-col :span="10">
  251. <view style="font-size: 40rpx;color: rgb(145, 145, 145);">
  252. </view>
  253. </uni-col>
  254. <uni-col :span="11">
  255. <view style="font-size: 40rpx;color: rgb(98, 98, 98);">
  256. 下一步
  257. </view>
  258. </uni-col>
  259. <uni-col :span="3">
  260. <view @click="submitPass" style="font-size: 40rpx;color: rgb(55,186,189);">
  261. 确认
  262. </view>
  263. </uni-col>
  264. </uni-row>
  265. </view>
  266. <view>
  267. <!-- -->
  268. <uni-row>
  269. <uni-col>
  270. <view style="padding: 15rpx 20rpx;">
  271. <uni-data-picker ref="picker" placeholder="请选择" :popup-title="selectTitle"
  272. :localdata="dataTree" v-model="hxForm.candidate" @change="nextApprovalChange">
  273. </uni-data-picker>
  274. </view>
  275. </uni-col>
  276. </uni-row>
  277. </view>
  278. </view>
  279. </uni-popup>
  280. </view>
  281. </template>
  282. <script>
  283. export default {
  284. data() {
  285. return {
  286. isDisabled: false,
  287. selectTitle: '',
  288. hxForm: {},
  289. dataTree: [],
  290. fileList: [],
  291. form: {},
  292. header: {
  293. "Authorization": "Bearer " + uni.getStorageSync('token')
  294. },
  295. index: 0,
  296. sexs: {
  297. data: [],
  298. index: undefined
  299. },
  300. degree: {
  301. data: [],
  302. index: undefined
  303. },
  304. interview_type: {
  305. data: [],
  306. index: undefined
  307. },
  308. post: {
  309. data: [],
  310. index: undefined
  311. },
  312. hire_result: {
  313. data: uni.getStorageSync('hire_result'),
  314. index: undefined
  315. },
  316. deptConfig: {
  317. deptDatas: uni.getStorageSync('deptData'),
  318. deptIndex: undefined
  319. },
  320. }
  321. },
  322. onLoad() {
  323. //机构信息初始化
  324. this.sexs.data = uni.getStorageSync('sys_user_sex')
  325. this.degree.data = uni.getStorageSync('degree_dict')
  326. this.post.data = uni.getStorageSync('postsData')
  327. this.interview_type.data = uni.getStorageSync('interview_type')
  328. },
  329. methods: {
  330. async submit() {
  331. this.isDisabled = true
  332. if (!this.form.name) {
  333. this.isDisabled = false
  334. uni.showModal({
  335. content: '请输入姓名',
  336. title: '提交失败',
  337. showCancel: false
  338. })
  339. return
  340. }
  341. if (!this.form.sex) {
  342. this.isDisabled = false
  343. uni.showModal({
  344. content: '请选择性别',
  345. title: '提交失败',
  346. showCancel: false
  347. })
  348. return
  349. }
  350. if (!this.form.phone) {
  351. this.isDisabled = false
  352. uni.showModal({
  353. content: '请输入手机号',
  354. title: '提交失败',
  355. showCancel: false
  356. })
  357. return
  358. }
  359. if (this.form.phone.length != 11) {
  360. this.isDisabled = false
  361. uni.showModal({
  362. content: '请输入手机号',
  363. title: '提交失败',
  364. showCancel: false
  365. })
  366. return
  367. }
  368. if (!this.form.birthdate) {
  369. this.isDisabled = false
  370. uni.showModal({
  371. content: '请选择出生日期',
  372. title: '提交失败',
  373. showCancel: false
  374. })
  375. return
  376. }
  377. if (!this.form.degree) {
  378. this.isDisabled = false
  379. uni.showModal({
  380. content: '请选择学历',
  381. title: '提交失败',
  382. showCancel: false
  383. })
  384. return
  385. }
  386. if (!this.form.skill) {
  387. this.isDisabled = false
  388. uni.showModal({
  389. content: '请选择专业技能',
  390. title: '提交失败',
  391. showCancel: false
  392. })
  393. return
  394. }
  395. if (!this.form.jobInterview) {
  396. this.isDisabled = false
  397. uni.showModal({
  398. content: '请选择意向岗位',
  399. title: '提交失败',
  400. showCancel: false
  401. })
  402. return
  403. }
  404. if (!this.form.interviewType) {
  405. this.isDisabled = false
  406. uni.showModal({
  407. content: '请选择面试时间',
  408. title: '提交失败',
  409. showCancel: false
  410. })
  411. return
  412. }
  413. if (!this.form.interviewer) {
  414. this.isDisabled = false
  415. uni.showModal({
  416. content: '请选择面试官',
  417. title: '提交失败',
  418. showCancel: false
  419. })
  420. return
  421. }
  422. if (!this.form.skillScore) {
  423. this.isDisabled = false
  424. uni.showModal({
  425. content: '请选择技术水平',
  426. title: '提交失败',
  427. showCancel: false
  428. })
  429. return
  430. }
  431. if (!this.form.expectSalary) {
  432. this.isDisabled = false
  433. uni.showModal({
  434. content: '请填写期望薪资',
  435. title: '提交失败',
  436. showCancel: false
  437. })
  438. return
  439. }
  440. // if (this.fileList.length === 0) {
  441. // this.isDisabled = false
  442. // uni.showModal({
  443. // content: '请上传简历附件',
  444. // title: '提交失败',
  445. // showCancel: false
  446. // })
  447. // return
  448. // }
  449. setTimeout(() => {
  450. this.isDisabled = false
  451. }, 1000)
  452. //统一写入参数
  453. this.form.userCode = uni.getStorageSync('setUserName')
  454. this.form.avatar = this.fileList[0].url
  455. this.form.hireOrDimission = '1'
  456. const {
  457. data: res
  458. } = await this.$httpRequest({
  459. url: '/app/submitApply/personnelHire',
  460. method: 'post',
  461. data: this.form
  462. });
  463. if (res.code === 200) {
  464. this.dataTree = res.data.tree
  465. this.hxForm.taskId = res.data.taskId
  466. this.$refs.popup.open('bottom')
  467. this.selectTitle = "请选择" + this.dataTree[0].text
  468. this.isDisabled = false
  469. } else {
  470. this.$showModal(res.msg)
  471. }
  472. this.isDisabled = false
  473. },
  474. async getPostData() {
  475. const {
  476. data: res
  477. } = await this.$httpRequest({
  478. url: '/app/posts',
  479. method: 'get'
  480. });
  481. if (res.code === 200) {
  482. this.post.data = res.data
  483. } else {
  484. }
  485. },
  486. nextApprovalChange(e) {
  487. // console.log('onchange:', e.detail.value[1].text);
  488. this.hxForm.applyUserName = e.detail.value[1].text
  489. this.hxForm.candidate = e.detail.value[1].value
  490. },
  491. onchange(e) {
  492. setTimeout(() => {
  493. }, 200)
  494. },
  495. maskClick(e) {
  496. },
  497. bindPickerChange: function(e) {
  498. this.index = e.detail.value
  499. },
  500. deptBindPickerChange: function(e) {
  501. this.deptConfig.deptIndex = e.detail.value
  502. this.form.department = this.deptConfig.deptDatas[this.deptConfig.deptIndex].deptId
  503. },
  504. postBindPickerChange: function(e) {
  505. this.post.index = e.detail.value
  506. this.form.jobInterview = this.post.data[this.post.index].postId
  507. },
  508. hireBindPickerChange: function(e) {
  509. this.hire_result.index = e.detail.value
  510. this.form.hire_result = this.hire_result.data[this.hire_result.index].dictValue
  511. },
  512. interviewTypeBindPickerChange: function(e) {
  513. this.interview_type.index = e.detail.value
  514. this.form.interviewType = this.interview_type.data[this.interview_type.index].dictValue
  515. },
  516. sexsBindPickerChange: function(e) {
  517. this.sexs.index = e.detail.value
  518. this.form.sex = this.sexs.data[this.sexs.index].dictValue
  519. },
  520. degreeBindPickerChange: function(e) {
  521. this.degree.index = e.detail.value
  522. this.form.degree = this.degree.data[this.degree.index].dictValue
  523. },
  524. // 删除图片
  525. deletePic(event) {
  526. this.fileList.splice(event.index, 1)
  527. },
  528. async submitPass() {
  529. if (!this.hxForm.candidate) {
  530. uni.showModal({
  531. content: '请选择' + this.dataTree[0].text,
  532. title: '提交失败',
  533. showCancel: false,
  534. })
  535. }
  536. const {
  537. data: res
  538. } = await this.$httpRequest({
  539. url: '/app/task/submit/candidate?taskId=' + this.hxForm.taskId +
  540. '&candidate=' + this.hxForm.candidate + '&applyUserName=' + this.hxForm.applyUserName,
  541. method: 'get',
  542. });
  543. if (res.code === 200) {
  544. uni.showModal({
  545. content: '已提交给审批人员',
  546. title: '提交成功',
  547. showCancel: false,
  548. success() {
  549. uni.navigateBack()
  550. }
  551. })
  552. } else {
  553. uni.showModal({
  554. content: res.msg,
  555. title: '提交失败',
  556. showCancel: false,
  557. success() {
  558. uni.navigateBack()
  559. }
  560. })
  561. }
  562. },
  563. // 新增图片
  564. async afterRead(event) {
  565. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  566. let lists = [].concat(event.file)
  567. let fileListLen
  568. if (this.fileList) {
  569. fileListLen = this.fileList.length
  570. } else {
  571. this.fileList = []
  572. fileListLen = 0
  573. }
  574. lists.map((item) => {
  575. this.fileList.push({
  576. ...item,
  577. status: 'uploading',
  578. message: '上传中'
  579. })
  580. })
  581. for (let i = 0; i < lists.length; i++) {
  582. const result = await this.uploadFilePromise(lists[i].url)
  583. let item = this.fileList[fileListLen]
  584. this.fileList.splice(fileListLen, 1, Object.assign(item, {
  585. status: 'success',
  586. message: '',
  587. url: result
  588. }))
  589. fileListLen++
  590. }
  591. this.form.involveFile = this.this.fileList[0].url
  592. },
  593. uploadFilePromise(url) {
  594. return new Promise((resolve, reject) => {
  595. let a = uni.uploadFile({
  596. url: this.$BASE_URL + '/common/upload', // 仅为示例,非真实的接口地址
  597. filePath: url,
  598. name: 'file',
  599. header: this.header,
  600. success: (res) => {
  601. // console.log(JSON.parse(res.data).url);
  602. setTimeout(() => {
  603. resolve(JSON.parse(res.data).url)
  604. }, 1000)
  605. }
  606. });
  607. })
  608. }
  609. }
  610. }
  611. </script>
  612. <style lang="scss" scoped>
  613. .desc {
  614. padding: 10rpx 5rpx;
  615. color: #818181;
  616. font-size: 20rpx;
  617. }
  618. .pickerView {
  619. // align-items: flex-end;
  620. padding: 10rpx 20rpx;
  621. border: 1rpx #eeeeee solid;
  622. }
  623. .pickerText {
  624. font-size: 26rpx;
  625. color: #b1b1b1;
  626. }
  627. .bottim_view {
  628. padding: 5px 20px 30px;
  629. position: fixed;
  630. left: 0px;
  631. bottom: 0px;
  632. width: 100%;
  633. height: 40px;
  634. background-color: #ffffff;
  635. }
  636. </style>