joinPerson.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  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="/static/images/comment/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" 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. <picker @change="bindEduChange" :value="index" :range="educationList">
  49. <view class="hflex acenter jbetween cell">
  50. <view class="left">学历</view>
  51. <u-input border="none" v-model="userInfo.education" disabled disabledColor="#fff" placeholder="请选择您的学历" suffixIcon="arrow-right" suffixIconStyle="color: #b7b7b7" inputAlign="right"></u-input>
  52. </view>
  53. </picker>
  54. <view class="hflex acenter jbetween cell">
  55. <view class="left">个人特长</view>
  56. <u-input v-model="userInfo.specialty" placeholder="请输入您的特长" inputAlign="right" border="none"></u-input>
  57. </view>
  58. <view class="hflex acenter jbetween cell">
  59. <view class="left">技能</view>
  60. <u-input v-model="userInfo.skill" placeholder="请输入您的技能描述" inputAlign="right" border="none"></u-input>
  61. </view>
  62. <picker @change="bindTitleChange" :value="index" :range="titleList" range-key="name">
  63. <view class="hflex acenter jbetween cell">
  64. <view class="left">职称选择</view>
  65. <u-input border="none" v-model="userInfo.title" placeholder="请选择您的职称" suffixIcon="arrow-right" suffixIconStyle="color: #b7b7b7" inputAlign="right"></u-input>
  66. </view>
  67. </picker>
  68. </view>
  69. <view class="box">
  70. <view class="box_title">简历及相关信息</view>
  71. <view class="box_title">工作履历</view>
  72. <view class="box_subTitle">请填写您近年来的工作经历</view>
  73. <u-input v-model="userInfo.work" border="bottom"></u-input>
  74. <view class="box_title">资质证书</view>
  75. <view class="box_subTitle">至少上传一张专业证书(包含毕业证书),证书请完整展示姓名,证书名称,证书日期及有效期</view>
  76. <view class="upload">
  77. <u-upload :fileList="userInfo.imgList" @afterRead="afterRead" @delete="deletePic" :maxCount="10" name="1" multiple :previewFullImage="true" width="110" height="110">
  78. <image src="/static/images/comment/upload.png" style="width: 220rpx;height: 220rpx;"></image>
  79. </u-upload>
  80. </view>
  81. <view class="box_title">培训经历</view>
  82. <view class="box_subTitle">请详细描述您的培训经历</view>
  83. <u-input v-model="userInfo.train" border="bottom"></u-input>
  84. <view class="bottom" v-if="state == 0">
  85. <view class="btn" @click="submit">提交</view>
  86. </view>
  87. </view>
  88. </view>
  89. <view class="box1 vflex acenter" v-if="state == 1">
  90. <image src="/static/images/comment/wait.png" class="box1_img"></image>
  91. <view class="box1_title">审核中</view>
  92. <view class="box1_subTitle">预计审核时间3个工作日</view>
  93. <view class="box1_subTitle">请留意当前页面变动</view>
  94. <view class="btn" @click="result">返回</view>
  95. </view>
  96. <view class="box1 vflex acenter" v-if="state == 3">
  97. <image src="/static/images/comment/error.png" class="box1_img"></image>
  98. <view class="box1_title">审核失败</view>
  99. <view class="box1_subTitle">驳回原因</view>
  100. <view class="box1_subTitle">{{reason}}<span style="color: #506dff;margin-left: 8rpx;" @click="edit">立即修改></span></view>
  101. <view class="btn" @click="result">返回</view>
  102. </view>
  103. </view>
  104. </template>
  105. <script>
  106. import $api from '@/static/js/api.js'
  107. var that = ''
  108. export default {
  109. data() {
  110. return {
  111. userInfo: {
  112. id: '',
  113. name: '', //姓名
  114. sex: '', //性别
  115. age: '', //年龄
  116. place: '', //籍贯
  117. phone: '', //电话
  118. email: '', //邮箱
  119. region: '', //所在地区
  120. province: '',
  121. city:'',
  122. area: '',
  123. address: '', //详细地址
  124. education: '', //学历
  125. specialty: '', //特长
  126. skill: '', //技能
  127. title: '', //职称
  128. title_id: '',
  129. work: '', //工作经历
  130. imgList: [], //资质证明
  131. train: '', //培训经历
  132. },
  133. sexList: ['男','女'],
  134. ageList: [],
  135. educationList: ['初中及以下','中专/中技','高中','大专','本科','硕士','博士'],
  136. titleList: [],
  137. state: 0, //0 未加入,1 待审核,2 审核成功, 3审核失败
  138. reason: '资料填写不完整', //驳回原因
  139. }
  140. },
  141. onLoad() {
  142. that = this
  143. that.getPrepage()
  144. that.getzclist()
  145. that.getageList()
  146. },
  147. methods: {
  148. getPrepage() {
  149. var pages = getCurrentPages()
  150. var prePage = pages[pages.length - 2]
  151. var pooltalent = prePage.$vm.user.pooltalent
  152. if(pooltalent) {
  153. that.userInfo = {
  154. name: pooltalent.name, //姓名
  155. sex: pooltalent.sex, //性别
  156. age: pooltalent.age, //年龄
  157. place: pooltalent.jg, //籍贯
  158. phone: pooltalent.phone, //电话
  159. email: pooltalent.email, //邮箱
  160. region: pooltalent.province + pooltalent.city + pooltalent.area, //所在地区
  161. province: pooltalent.province,
  162. city:pooltalent.city,
  163. area: pooltalent.area,
  164. address: pooltalent.address, //详细地址
  165. education: pooltalent.xl, //学历
  166. specialty: pooltalent.tc, //特长
  167. skill: pooltalent.jn, //技能
  168. title: pooltalent.zc.name, //职称
  169. title_id: pooltalent.zc.id,
  170. work: pooltalent.gzll, //工作经历
  171. train: pooltalent.pxjl,
  172. id: pooltalent.id
  173. }
  174. var imgs = pooltalent.zz_imgs.split(',')
  175. let obj = {}
  176. for(let key in imgs) {
  177. obj[key] = imgs[key]
  178. }
  179. var imgList = Object.keys(obj).map(item => ({
  180. url: obj[item]
  181. }))
  182. for(let i in imgList) {
  183. console.log(imgList[i].url.length);
  184. if(imgList[i].url.length <= 1) {
  185. console.log(imgList[i]);
  186. imgList.splice(i, 1)
  187. }
  188. }
  189. that.userInfo.imgList = imgList
  190. that.state = pooltalent.audit
  191. that.reason = pooltalent.why
  192. }
  193. },
  194. getzclist() {
  195. $api.req({
  196. url: '/data/api.auth.Center/zclist',
  197. method: 'POST',
  198. }, function(res) {
  199. if(res.code == 1) {
  200. that.titleList = res.data
  201. }
  202. })
  203. },
  204. getageList() {
  205. for(var i=18;i<=60;i++) {
  206. that.ageList.push(i)
  207. }
  208. },
  209. // 选择性别
  210. bindSexChange(e) {
  211. that.userInfo.sex = that.sexList[e.detail.value]
  212. },
  213. // 选择年龄
  214. bindAgeChange(e) {
  215. that.userInfo.age = that.ageList[e.detail.value]
  216. },
  217. // 选择所在地区
  218. changeAddress(e) {
  219. that.userInfo.region = e.detail.value[0] + '-' + e.detail.value[1] + '-' + e.detail.value[2]
  220. that.userInfo.province = e.detail.value[0]
  221. that.userInfo.city = e.detail.value[1]
  222. that.userInfo.area = e.detail.value[2]
  223. },
  224. // 选择学历
  225. bindEduChange(e) {
  226. that.userInfo.education = that.educationList[e.detail.value]
  227. },
  228. // 选择职称
  229. bindTitleChange(e) {
  230. that.userInfo.title = that.titleList[e.detail.value].name
  231. that.userInfo.title_id = that.titleList[e.detail.value].id
  232. },
  233. // 删除图片
  234. deletePic(event) {
  235. console.log(event);
  236. that.userInfo.imgList.splice(event.index, 1)
  237. console.log(that.userInfo.imgList);
  238. },
  239. // 新增图片
  240. async afterRead(event) {
  241. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  242. let lists = [].concat(event.file)
  243. let imgListLen = that.userInfo.imgList.length
  244. lists.map((item) => {
  245. that.userInfo.imgList.push({
  246. ...item,
  247. status: 'uploading',
  248. message: '上传中'
  249. })
  250. })
  251. for (let i = 0; i < lists.length; i++) {
  252. const result = await that.uploadFilePromise(lists[i].url)
  253. let item = that.userInfo.imgList[imgListLen]
  254. that.userInfo.imgList.splice(imgListLen, 1, Object.assign(item, {
  255. status: 'success',
  256. message: '',
  257. url: result.url
  258. }))
  259. imgListLen++
  260. }
  261. },
  262. // 上传图片
  263. uploadFilePromise(url) {
  264. return new Promise((resolve, reject) => {
  265. let a = uni.uploadFile({
  266. url: $api.config.baseUrl + '/data/api.auth.Center/upload',
  267. filePath: url,
  268. name: 'file',
  269. header: {
  270. 'content-type': 'application/x-www-form-urlencoded',
  271. 'api-token': uni.getStorageSync('token').token?uni.getStorageSync('token').token:'',
  272. 'api-name': 'wxapp'
  273. },
  274. formData: {
  275. user: 'test'
  276. },
  277. success: (res) => {
  278. setTimeout(() => {
  279. var data = JSON.parse(res.data)
  280. resolve(data.data)
  281. }, 1000)
  282. }
  283. });
  284. })
  285. },
  286. // 立即修改
  287. edit() {
  288. that.state = 0
  289. },
  290. // 返回
  291. result() {
  292. $api.jump(-1)
  293. },
  294. // 提交
  295. submit() {
  296. var u = that.userInfo
  297. var zz_imgs = ""
  298. 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')) {
  299. if(u.imgList.length > 0) {
  300. for(var i=0;i<u.imgList.length;i++) {
  301. if(i == u.imgList.length - 1) {
  302. zz_imgs += u.imgList[i].url
  303. } else {
  304. zz_imgs += u.imgList[i].url + ','
  305. }
  306. }
  307. }
  308. $api.req({
  309. url: '/data/api.auth.Center/adduppooltalent',
  310. method: 'POST',
  311. data: {
  312. id: u.id?u.id: '',
  313. name: u.name,
  314. sex: u.sex,
  315. age: u.age,
  316. jg: u.place,
  317. phone: u.phone,
  318. email: u.email,
  319. province: u.province,
  320. city: u.city,
  321. area: u.area,
  322. address: u.address,
  323. xl: u.education,
  324. tc: u.specialty,
  325. jn: u.skill,
  326. zc_id: u.title_id,
  327. gzll: u.work,
  328. zz_imgs: zz_imgs,
  329. pxjl: u.train
  330. }
  331. }, function(res) {
  332. if(res.code == 1) {
  333. $api.info(res.info)
  334. that.state = 1
  335. // $api.jump('/pages/tabbar/mine/mine',3)
  336. }
  337. })
  338. }
  339. }
  340. },
  341. }
  342. </script>
  343. <style lang="scss" scoped>
  344. .content::v-deep {
  345. background-color: #f4f4f4;
  346. // padding-top: 20rpx;
  347. .top {
  348. width: 100%;
  349. height: 60rpx;
  350. background-color: #f8efe2;
  351. padding: 20rpx 32rpx;
  352. box-sizing: border-box;
  353. .top_img {
  354. width: 36rpx;
  355. height: 36rpx;
  356. }
  357. .top_text {
  358. font-size: 26rpx;
  359. margin-left: 6rpx;
  360. color: #330e00;
  361. }
  362. }
  363. .box {
  364. width: 100%;
  365. background-color: #fff;
  366. margin-bottom: 20rpx;
  367. box-sizing: border-box;
  368. padding: 28rpx 30rpx;
  369. .box_title {
  370. font-size: 30rpx;
  371. color: #222;
  372. margin: 20rpx 0 32rpx;
  373. }
  374. .box_subTitle {
  375. font-size: 26rpx;
  376. color: #b7b7b7;
  377. // margin: ;
  378. }
  379. .upload {
  380. margin-top: 20rpx;
  381. width: 100%;
  382. padding-bottom: 20rpx;
  383. border-bottom: 1rpx solid #f4f4f4;
  384. }
  385. .u-input {
  386. width: 100%;
  387. // margin-top: 30rpx;
  388. }
  389. .cell {
  390. width: 100%;
  391. padding: 20rpx 0;
  392. .left {
  393. font-size: 28rpx;
  394. color: #222;
  395. }
  396. .u-input {
  397. font-size: 28rpx;
  398. color: #222;
  399. }
  400. }
  401. .bottom {
  402. margin: 80rpx 0 50rpx;
  403. .btn {
  404. width: 100%;
  405. height: 88rpx;
  406. border-radius: 44rpx;
  407. text-align: center;
  408. line-height: 88rpx;
  409. background-color: #506dff;
  410. font-size: 36rpx;
  411. color: #fff;
  412. }
  413. }
  414. }
  415. .box1 {
  416. width: 100%;
  417. height: 100vh;
  418. background-color: #fff;
  419. .box1_img {
  420. width: 124rpx;
  421. height: 124rpx;
  422. margin: 108rpx 0 40rpx;
  423. }
  424. .box1_title {
  425. font-size: 32rpx;
  426. color: #222;
  427. margin-bottom: 24rpx;
  428. }
  429. .box1_subTitle {
  430. margin: 12rpx 0;
  431. font-size: 26rpx;
  432. color: #595959;
  433. }
  434. .btn {
  435. width: 530rpx;
  436. height: 88rpx;
  437. background-color: #506dff;
  438. color: #fff;
  439. text-align: center;
  440. line-height: 88rpx;
  441. border-radius: 44rpx;
  442. font-size: 36rpx;
  443. margin-top: 122rpx;
  444. }
  445. }
  446. }
  447. </style>