joinPerson.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <template>
  2. <view class="content">
  3. <view class="" v-if="state == 0 || state == 2">
  4. <view class="top hflex acenter" v-if="state == 2">
  5. <image src="https://ship-expert.zhousi.hdlkeji.com/common/person.png" class="top_img"></image>
  6. <view class="top_text">你已成功加入人才库</view>
  7. </view>
  8. <view class="box" style="margin-top: 20rpx;">
  9. <view class="box_title">基本信息</view>
  10. <view class="hflex acenter jbetween cell">
  11. <view class="left">姓名</view>
  12. <u-input v-model="userInfo.name" placeholder="请输入您的姓名" inputAlign="right" border="none"></u-input>
  13. </view>
  14. <picker @change="bindSexChange" :value="index" :range="sexList">
  15. <view class="hflex acenter jbetween cell">
  16. <view class="left">性别</view>
  17. <u-input border="none" v-model="userInfo.sex" disabled disabledColor="#fff" placeholder="请选择您的性别" suffixIcon="arrow-right" suffixIconStyle="color: #b7b7b7" inputAlign="right"></u-input>
  18. </view>
  19. </picker>
  20. <picker @change="bindAgeChange" :value="index" :range="ageList">
  21. <view class="hflex acenter jbetween cell">
  22. <view class="left">年龄</view>
  23. <u-input border="none" v-model="userInfo.age" disabled disabledColor="#fff" placeholder="请选择您的年龄" suffixIcon="arrow-right" suffixIconStyle="color: #b7b7b7" inputAlign="right"></u-input>
  24. </view>
  25. </picker>
  26. <view class="hflex acenter jbetween cell">
  27. <view class="left">籍贯</view>
  28. <u-input v-model="userInfo.place" placeholder="请输入您的籍贯" inputAlign="right" border="none"></u-input>
  29. </view>
  30. <view class="hflex acenter jbetween cell">
  31. <view class="left">电话</view>
  32. <u-input v-model="userInfo.phone" placeholder="请输入您的电话" inputAlign="right" border="none"></u-input>
  33. </view>
  34. <view class="hflex acenter jbetween cell">
  35. <view class="left">邮箱</view>
  36. <u-input v-model="userInfo.email" placeholder="请输入您的邮箱" inputAlign="right" border="none"></u-input>
  37. </view>
  38. <picker mode="region" @change="changeAddress" :value="index" >
  39. <view class="hflex acenter jbetween cell">
  40. <view class="left">所在地区</view>
  41. <u-input border="none" inputAlign="right" disabled disabledColor="#fff" v-model="userInfo.region" placeholder="请选择省市区" suffixIcon="arrow-right" suffixIconStyle="color: #b7b7b7"></u-input>
  42. </view>
  43. </picker>
  44. <view class="hflex acenter jbetween cell">
  45. <view class="left">详细地址</view>
  46. <u-input v-model="userInfo.address" placeholder="街道,楼牌号等" inputAlign="right" border="none"></u-input>
  47. </view>
  48. <view class="hflex acenter jbetween cell">
  49. <view class="left">毕业院校</view>
  50. <u-input v-model="userInfo.school" placeholder="请输入您的毕业院校" inputAlign="right" border="none"></u-input>
  51. </view>
  52. <picker @change="bindEduChange" :value="index" :range="educationList">
  53. <view class="hflex acenter jbetween cell">
  54. <view class="left">学历</view>
  55. <u-input border="none" v-model="userInfo.education" disabled disabledColor="#fff" placeholder="请选择您的学历" suffixIcon="arrow-right" suffixIconStyle="color: #b7b7b7" inputAlign="right"></u-input>
  56. </view>
  57. </picker>
  58. <view class="hflex acenter jbetween cell">
  59. <view class="left">专业</view>
  60. <u-input v-model="userInfo.major" placeholder="请输入您的专业" inputAlign="right" border="none"></u-input>
  61. </view>
  62. <view class="hflex acenter jbetween cell">
  63. <view class="left">工作年限</view>
  64. <u-input v-model="userInfo.year" placeholder="请输入您的工作年限" inputAlign="right" border="none"></u-input>
  65. </view>
  66. <view class="hflex acenter jbetween cell">
  67. <view class="left">个人特长</view>
  68. <u-input v-model="userInfo.specialty" placeholder="请输入您的特长" inputAlign="right" border="none"></u-input>
  69. </view>
  70. <view class="hflex acenter jbetween cell">
  71. <view class="left">专业技能</view>
  72. <u-input v-model="userInfo.skill" placeholder="请输入您的技能描述" inputAlign="right" border="none"></u-input>
  73. </view>
  74. <picker @change="bindTitleChange" :value="index" :range="titleList" range-key="name">
  75. <view class="hflex acenter jbetween cell">
  76. <view class="left">职称选择</view>
  77. <u-input border="none" disabled disabledColor="#fff" v-model="userInfo.title" placeholder="请选择您的职称" suffixIcon="arrow-right" suffixIconStyle="color: #b7b7b7" inputAlign="right"></u-input>
  78. </view>
  79. </picker>
  80. </view>
  81. <view class="box">
  82. <view class="box_title">简历及相关信息</view>
  83. <view class="hflex acenter jbetween">
  84. <view class="box_title">工作经历</view>
  85. <view class="hflex acenter" @click="perfect(3)">
  86. <u-icon name="plus-circle-fill" color="#555555" size="12"></u-icon>
  87. <view class="text_style1">添加</view>
  88. </view>
  89. </view>
  90. <block v-for="(item,index) in userInfo.work" :key="index">
  91. <view class="padT-26" @click="editInfo(item.id)">
  92. <view class="hflex acenter jbetween">
  93. <view class="box_title">{{item.content.company_name}}</view>
  94. <u-icon name="arrow-right" color="#555555" size="12"></u-icon>
  95. </view>
  96. <view class="hflex acenter padT-26">
  97. <view class="box_subTitle padR-24" style="padding-right: 24rpx;">{{item.content.on_job_start}}-{{item.content.on_job_end}}</view>
  98. <view class="box_subTitle">{{item.content.position_name}}</view>
  99. </view>
  100. <view class="hflex fwrap padT-26 box_subTitle">工作内容:{{item.content.job_description}}</view>
  101. </view>
  102. </block>
  103. <view class="box_title">培训经历</view>
  104. <view class="box_subTitle">请详细描述您的培训经历</view>
  105. <u-input v-model="userInfo.train" border="bottom"></u-input>
  106. <view class="box_title">资质证书</view>
  107. <view class="box_subTitle">至少上传一张专业证书(包含毕业证书),证书请完整展示姓名,证书名称,证书日期及有效期</view>
  108. <view class="upload">
  109. <u-upload :fileList="userInfo.fileList1" @afterRead="afterRead" @delete="deletePic" :maxCount="9" name="1" multiple width="100" height="100">
  110. <image src="https://ship-expert.zhousi.hdlkeji.com/common/upload.png" style="width: 200rpx;height: 200rpx;"></image>
  111. </u-upload>
  112. </view>
  113. <view class="bottom" v-if="state == 0">
  114. <view class="btn" @click="submit">提交</view>
  115. </view>
  116. </view>
  117. </view>
  118. <view class="box1 vflex acenter" v-if="state == 1">
  119. <image src="https://ship-expert.zhousi.hdlkeji.com/common/wait.png" class="box1_img"></image>
  120. <view class="box1_title">审核中</view>
  121. <view class="box1_subTitle">预计审核时间3个工作日</view>
  122. <view class="box1_subTitle">请留意当前页面变动</view>
  123. <view class="btn" @click="result">返回</view>
  124. </view>
  125. <view class="box1 vflex acenter" v-if="state == 3">
  126. <image src="https://ship-expert.zhousi.hdlkeji.com/common/error.png" class="box1_img"></image>
  127. <view class="box1_title">审核失败</view>
  128. <view class="box1_subTitle">驳回原因</view>
  129. <view class="box1_subTitle">{{reason}}<span style="color: #506dff;margin-left: 8rpx;" @click="edit">立即修改></span></view>
  130. <view class="btn" @click="result">返回</view>
  131. </view>
  132. </view>
  133. </template>
  134. <script>
  135. import $api from '@/static/js/api.js'
  136. var that = ''
  137. export default {
  138. data() {
  139. return {
  140. userInfo: {
  141. id: '',
  142. name: '', //姓名
  143. sex: '', //性别
  144. age: '', //年龄
  145. place: '', //籍贯
  146. phone: '', //电话
  147. email: '', //邮箱
  148. region: '', //所在地区
  149. school: '',
  150. major: '',
  151. year: '',
  152. province: '',
  153. city:'',
  154. area: '',
  155. address: '', //详细地址
  156. education: '', //学历
  157. specialty: '', //特长
  158. skill: '', //技能
  159. title: '', //职称
  160. title_id: '',
  161. work: [], //工作经历
  162. fileList1: [], //资质证明
  163. train: '', //培训经历
  164. },
  165. sexList: ['男','女'],
  166. ageList: [],
  167. educationList: ['初中及以下','中专/中技','高中','大专','本科','硕士','博士'],
  168. titleList: [],
  169. state: 0, //0 未加入,1 待审核,2 审核成功, 3审核失败
  170. reason: '', //驳回原因
  171. }
  172. },
  173. onLoad() {
  174. that = this
  175. that.getzclist()
  176. that.getageList()
  177. that.getPrepage()
  178. },
  179. onShow() {
  180. that.getWork()
  181. },
  182. methods: {
  183. getPrepage() {
  184. var pooltalent = {}
  185. $api.req({
  186. url: '/data/api.auth.Center/get',
  187. method: 'POST',
  188. }, function(res) {
  189. if(res.code == 1) {
  190. pooltalent = res.data.pooltalent
  191. if(pooltalent) {
  192. that.userInfo = {
  193. name: pooltalent.name, //姓名
  194. sex: pooltalent.sex, //性别
  195. age: pooltalent.age?pooltalent.age:'', //年龄
  196. place: pooltalent.jg, //籍贯
  197. phone: pooltalent.phone, //电话
  198. email: pooltalent.email, //邮箱
  199. region: pooltalent.province? pooltalent.province + pooltalent.city + pooltalent.area:'', //所在地区
  200. province: pooltalent.province,
  201. city:pooltalent.city,
  202. area: pooltalent.area,
  203. address: pooltalent.address, //详细地址
  204. school: pooltalent.graduate_school,
  205. major: pooltalent.major,
  206. year: pooltalent.working_life,
  207. education: pooltalent.xl, //学历
  208. specialty: pooltalent.tc, //特长
  209. skill: pooltalent.jn, //技能
  210. title: pooltalent.zc?pooltalent.zc.name:'', //职称
  211. title_id: pooltalent.zc?pooltalent.zc.id:'',
  212. work: pooltalent.gzll, //工作经历
  213. train: pooltalent.pxjl,
  214. id: pooltalent.id
  215. }
  216. var imgs = pooltalent.zz_imgs
  217. let obj = {}
  218. for(let key in imgs) {
  219. obj[key] = imgs[key]
  220. }
  221. var fileList1 = Object.keys(obj).map(item => ({
  222. url: obj[item]
  223. }))
  224. for(let i in fileList1) {
  225. console.log(fileList1[i].url.length);
  226. if(fileList1[i].url.length <= 1) {
  227. console.log(fileList1[i]);
  228. fileList1.splice(i, 1)
  229. }
  230. }
  231. that.userInfo.fileList1 = fileList1
  232. console.log(that.userInfo.fileList1);
  233. that.state = pooltalent.audit
  234. that.reason = pooltalent.why
  235. }
  236. }
  237. })
  238. },
  239. getzclist() {
  240. $api.req({
  241. url: '/data/api.auth.Center/zclist',
  242. method: 'POST',
  243. }, function(res) {
  244. if(res.code == 1) {
  245. that.titleList = res.data
  246. }
  247. })
  248. },
  249. getWork() {
  250. var data = uni.getStorageSync('work_experience')
  251. if(!data) {
  252. return
  253. }
  254. var work = {
  255. content: JSON.parse(data)
  256. }
  257. that.userInfo.work.push(work)
  258. // console.log(that.userInfo.work);
  259. uni.removeStorageSync('work_experience')
  260. },
  261. getageList() {
  262. for(var i=18;i<=60;i++) {
  263. that.ageList.push(i)
  264. }
  265. },
  266. // 选择性别
  267. bindSexChange(e) {
  268. that.userInfo.sex = that.sexList[e.detail.value]
  269. },
  270. // 选择年龄
  271. bindAgeChange(e) {
  272. that.userInfo.age = that.ageList[e.detail.value]
  273. },
  274. // 选择所在地区
  275. changeAddress(e) {
  276. that.userInfo.region = e.detail.value[0] + '-' + e.detail.value[1] + '-' + e.detail.value[2]
  277. that.userInfo.province = e.detail.value[0]
  278. that.userInfo.city = e.detail.value[1]
  279. that.userInfo.area = e.detail.value[2]
  280. },
  281. // 选择学历
  282. bindEduChange(e) {
  283. that.userInfo.education = that.educationList[e.detail.value]
  284. },
  285. // 选择职称
  286. bindTitleChange(e) {
  287. that.userInfo.title = that.titleList[e.detail.value].name
  288. that.userInfo.title_id = that.titleList[e.detail.value].id
  289. },
  290. // 删除图片
  291. deletePic(event) {
  292. this.userInfo[`fileList${event.name}`].splice(event.index, 1)
  293. this.$forceUpdate()
  294. },
  295. // 新增图片
  296. async afterRead(event) {
  297. uni.showLoading({
  298. title: '上传中',
  299. mask: true
  300. })
  301. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  302. let lists = [].concat(event.file)
  303. let fileListLen = this.userInfo[`fileList${event.name}`].length
  304. lists.map((item) => {
  305. this.userInfo[`fileList${event.name}`].push({
  306. ...item,
  307. status: 'uploading',
  308. message: '上传中'
  309. })
  310. })
  311. for (let i = 0; i < lists.length; i++) {
  312. const result = await this.uploadFilePromise(lists[i].url)
  313. let item = this.userInfo[`fileList${event.name}`][fileListLen]
  314. this.userInfo[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  315. status: 'success',
  316. message: '',
  317. url: result.url
  318. }))
  319. fileListLen++
  320. if(lists.length - 1 == i) {
  321. uni.hideLoading()
  322. }
  323. }
  324. console.log(that.userInfo.fileList1);
  325. this.$forceUpdate()
  326. },
  327. // 上传图片
  328. uploadFilePromise(url) {
  329. return new Promise((resolve, reject) => {
  330. let a = uni.uploadFile({
  331. url: $api.config.baseUrl + '/data/api.auth.Center/upload',
  332. filePath: url,
  333. name: 'file',
  334. header: {
  335. 'content-type': 'application/x-www-form-urlencoded',
  336. 'api-token': uni.getStorageSync('token').token?uni.getStorageSync('token').token:'',
  337. 'api-name': 'wxapp'
  338. },
  339. formData: {
  340. user: 'test'
  341. },
  342. success: (res) => {
  343. setTimeout(() => {
  344. var data = JSON.parse(res.data)
  345. resolve(data.data)
  346. }, 1000)
  347. }
  348. });
  349. })
  350. },
  351. // 立即修改
  352. edit() {
  353. that.state = 0
  354. },
  355. // 添加或完善
  356. perfect(index) {
  357. $api.jump('/page_shop/pages/service/perfect')
  358. },
  359. // 修改工作经历
  360. editInfo(id) {
  361. $api.jump('/page_shop/pages/service/perfect?id='+ id)
  362. },
  363. // 返回
  364. result() {
  365. $api.jump(-1)
  366. },
  367. // 提交
  368. submit() {
  369. uni.showLoading({
  370. title: '上传中',
  371. mask: true
  372. })
  373. var u = that.userInfo
  374. var zz_imgs = ""
  375. if ($api.formCheck(u.name,'truename') && $api.formCheck(u.sex,'required') && $api.formCheck(u.age,'required') && $api.formCheck(u.phone,'mobile') && $api.formCheck(u.email,'email')) {
  376. if(u.fileList1.length == 0) {
  377. $api.info('请上传资质证书!')
  378. return
  379. }
  380. if(u.fileList1.length > 0) {
  381. for(var i=0;i<u.fileList1.length;i++) {
  382. if(i == u.fileList1.length - 1) {
  383. zz_imgs += u.fileList1[i].url
  384. } else {
  385. zz_imgs += u.fileList1[i].url + ','
  386. }
  387. }
  388. }
  389. $api.req({
  390. url: '/data/api.auth.Center/adduppooltalent',
  391. method: 'POST',
  392. data: {
  393. id: u.id?u.id: '',
  394. name: u.name,
  395. sex: u.sex,
  396. age: u.age,
  397. jg: u.place,
  398. phone: u.phone,
  399. email: u.email,
  400. province: u.province,
  401. city: u.city,
  402. area: u.area,
  403. address: u.address,
  404. graduate_school: u.school,
  405. xl: u.education,
  406. major: u.major,
  407. working_life: u.year,
  408. tc: u.specialty,
  409. jn: u.skill,
  410. zc_id: u.title_id,
  411. gzll: u.work,
  412. zz_imgs: zz_imgs,
  413. pxjl: u.train
  414. }
  415. }, function(res) {
  416. if(res.code == 1) {
  417. $api.info(res.info)
  418. that.state = 1
  419. // $api.jump('/pages/tabbar/mine/mine',3)
  420. }
  421. uni.hideLoading()
  422. })
  423. } else {
  424. uni.hideLoading()
  425. }
  426. }
  427. },
  428. }
  429. </script>
  430. <style lang="scss" scoped>
  431. .content::v-deep {
  432. background-color: #f4f4f4;
  433. // padding-top: 20rpx;
  434. .top {
  435. width: 100%;
  436. height: 60rpx;
  437. background-color: #f8efe2;
  438. padding: 20rpx 32rpx;
  439. box-sizing: border-box;
  440. .top_img {
  441. width: 36rpx;
  442. height: 36rpx;
  443. }
  444. .top_text {
  445. font-size: 26rpx;
  446. margin-left: 6rpx;
  447. color: #330e00;
  448. }
  449. }
  450. .box {
  451. width: 100%;
  452. background-color: #fff;
  453. margin-bottom: 20rpx;
  454. box-sizing: border-box;
  455. padding: 28rpx 30rpx;
  456. .box_title {
  457. font-size: 30rpx;
  458. color: #222;
  459. margin: 20rpx 0 32rpx;
  460. }
  461. .box_subTitle {
  462. font-size: 26rpx;
  463. color: #b7b7b7;
  464. // margin: ;
  465. }
  466. .upload {
  467. margin-top: 20rpx;
  468. width: 100%;
  469. padding-bottom: 20rpx;
  470. border-bottom: 1rpx solid #f4f4f4;
  471. }
  472. .u-input {
  473. width: 100%;
  474. // margin-top: 30rpx;
  475. }
  476. .cell {
  477. width: 100%;
  478. padding: 20rpx 0;
  479. .left {
  480. font-size: 28rpx;
  481. color: #222;
  482. }
  483. .u-input {
  484. font-size: 28rpx;
  485. color: #222;
  486. }
  487. }
  488. .bottom {
  489. margin: 80rpx 0 50rpx;
  490. .btn {
  491. width: 100%;
  492. height: 88rpx;
  493. border-radius: 44rpx;
  494. text-align: center;
  495. line-height: 88rpx;
  496. background-color: #506dff;
  497. font-size: 36rpx;
  498. color: #fff;
  499. }
  500. }
  501. }
  502. .box1 {
  503. width: 100%;
  504. height: 100vh;
  505. background-color: #fff;
  506. .box1_img {
  507. width: 124rpx;
  508. height: 124rpx;
  509. margin: 108rpx 0 40rpx;
  510. }
  511. .box1_title {
  512. font-size: 32rpx;
  513. color: #222;
  514. margin-bottom: 24rpx;
  515. }
  516. .box1_subTitle {
  517. margin: 12rpx 0;
  518. font-size: 26rpx;
  519. color: #595959;
  520. }
  521. .btn {
  522. width: 530rpx;
  523. height: 88rpx;
  524. background-color: #506dff;
  525. color: #fff;
  526. text-align: center;
  527. line-height: 88rpx;
  528. border-radius: 44rpx;
  529. font-size: 36rpx;
  530. margin-top: 122rpx;
  531. }
  532. }
  533. }
  534. </style>