input.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. <template>
  2. <view style="padding: 30rpx;">
  3. <view class="topBox">
  4. <view>
  5. <u-icon name="error-circle-fill" color="#FF3B30" size="28"></u-icon>
  6. <text style="color: #FF3B30;margin-left: 10rpx;">学习前请提交完整审核资料</text>
  7. </view>
  8. <view style="color: #007AFF;" @click="backPage">稍后再填</view>
  9. </view>
  10. <u-collapse v-if="remarkStatus" :item-style="itemStyle" event-type="close">
  11. <u-collapse-item title="审核结果反馈">
  12. <view style="padding-bottom: 30rpx;">
  13. <text class="collapse-item">{{ remark }}</text>
  14. </view>
  15. </u-collapse-item>
  16. </u-collapse>
  17. <view class="bodyBox" style="margin-top: 30rpx;padding:0 20rpx;">
  18. <u-form :model="form" ref="uForm">
  19. <template v-for="(item, index) in listData">
  20. <u-form-item
  21. :key="index"
  22. v-if="item.fieldKey == 'name'"
  23. :label="item.fieldName"
  24. :required="item.required"
  25. :label-width="auto"
  26. :prop="item.required ? item.fieldKey : ''"
  27. >
  28. <u-input v-model="form.name" :placeholder="`请输入${item.fieldName}`" />
  29. </u-form-item>
  30. <u-form-item
  31. :key="index"
  32. v-if="item.fieldKey == 'idcard'"
  33. :label="item.fieldName"
  34. :required="item.required"
  35. :label-width="auto"
  36. :prop="item.required ? item.fieldKey : ''"
  37. >
  38. <u-input v-model="form.idcard" :placeholder="`请输入${item.fieldName}`" />
  39. </u-form-item>
  40. <u-form-item
  41. :key="index"
  42. v-if="item.fieldKey == 'telphone'"
  43. :label="item.fieldName"
  44. :required="item.required"
  45. :label-width="auto"
  46. :prop="item.required ? item.fieldKey : ''"
  47. >
  48. <u-input v-model="form.telphone" :placeholder="`请输入${item.fieldName}`" />
  49. </u-form-item>
  50. <u-form-item
  51. :key="index"
  52. v-if="item.fieldKey == 'school'"
  53. :label="item.fieldName"
  54. :required="item.required"
  55. :label-width="auto"
  56. :prop="item.required ? item.fieldKey : ''"
  57. >
  58. <u-input v-model="form.school" :placeholder="`请输入${item.fieldName}`" />
  59. </u-form-item>
  60. <u-form-item
  61. :key="index"
  62. v-if="item.fieldKey == 'work_unit'"
  63. :label="item.fieldName"
  64. :required="item.required"
  65. :label-width="auto"
  66. :prop="item.required ? item.fieldKey : ''"
  67. >
  68. <u-input v-model="form.work_unit" :placeholder="`请输入${item.fieldName}`" />
  69. </u-form-item>
  70. <u-form-item
  71. :key="index"
  72. v-if="item.fieldKey == 'unit_contact'"
  73. :label="item.fieldName"
  74. :required="item.required"
  75. :label-width="auto"
  76. :prop="item.required ? item.fieldKey : ''"
  77. >
  78. <u-input v-model="form.unit_contact" :placeholder="`请输入${item.fieldName}`" />
  79. </u-form-item>
  80. <u-form-item
  81. :key="index"
  82. v-if="item.fieldKey == 'unit_tel'"
  83. :label="item.fieldName"
  84. :required="item.required"
  85. :label-width="auto"
  86. :prop="item.required ? item.fieldKey : ''"
  87. >
  88. <u-input v-model="form.unit_tel" :placeholder="`请输入${item.fieldName}`" />
  89. </u-form-item>
  90. <u-form-item
  91. :key="index"
  92. v-if="item.fieldKey == 'apply_post'"
  93. :label="item.fieldName"
  94. :required="item.required"
  95. :label-width="auto"
  96. :prop="item.required ? item.fieldKey : ''"
  97. >
  98. <u-input v-model="form.apply_post" :placeholder="`请输入${item.fieldName}`" />
  99. </u-form-item>
  100. <u-form-item
  101. :key="index"
  102. v-if="item.fieldKey == 'major'"
  103. :label="item.fieldName"
  104. :required="item.required"
  105. :label-width="auto"
  106. :prop="item.required ? item.fieldKey : ''"
  107. >
  108. <u-input v-model="form.major" :placeholder="`请输入${item.fieldName}`" />
  109. </u-form-item>
  110. <u-form-item
  111. :key="index"
  112. v-if="item.fieldKey == 'apply_post'"
  113. :label="item.fieldName"
  114. :required="item.required"
  115. :label-width="auto"
  116. :prop="item.required ? item.fieldKey : ''"
  117. >
  118. <u-input v-model="form.apply_post" :placeholder="`请输入${item.fieldName}`" />
  119. </u-form-item>
  120. <u-form-item
  121. :key="index"
  122. v-if="item.inputType == 2"
  123. :label="item.fieldName"
  124. :label-width="auto"
  125. :required="item.required"
  126. :prop="item.required ? item.fieldKey : ''"
  127. >
  128. <picker @change="bindPickerChange(item.fieldKey, $event)" :value="form[item.fieldKey]" :range="getarrays(item.fieldKey)">
  129. <view class="picker">{{ returnName(item.fieldKey) }}</view>
  130. </picker>
  131. </u-form-item>
  132. <u-form-item
  133. :key="index"
  134. v-if="item.inputType == 5"
  135. :label="item.fieldName"
  136. :label-width="auto"
  137. :required="item.required"
  138. :prop="item.required ? item.fieldKey : ''"
  139. >
  140. <picker mode="date" :value="form[item.fieldKey]" @change="bindDateChange(item.fieldKey, $event)">
  141. <view class="picker">{{ getTimes(item.fieldKey) }}</view>
  142. </picker>
  143. </u-form-item>
  144. <u-form-item
  145. :key="index"
  146. v-if="item.inputType == 3 && item.fieldKey !== 'commitment_electr_signature'"
  147. :label="item.fieldName"
  148. :required="item.required"
  149. :label-width="auto"
  150. label-position="top"
  151. :prop="item.required ? item.fieldKey : ''"
  152. >
  153. <text v-if="item.fieldKey === 'recent_photos'" style="color: #999999;position: absolute;top: 20rpx;left: 130rpx;">竖向证件照 文件大小≤2M</text>
  154. <text
  155. v-if="item.fieldKey === 'idcard_face_photo' || item.fieldKey === 'idcard_national_photo'"
  156. style="color: #999999;position: absolute;top: 20rpx;left: 180rpx;"
  157. >
  158. 文件大小≤2M
  159. </text>
  160. <u-upload
  161. :show-progress="false"
  162. :max-size="2097152"
  163. @on-list-change="
  164. item.fieldKey === 'recent_photos'
  165. ? changePhotoListHeader1($event)
  166. : item.fieldKey === 'idcard_face_photo'
  167. ? changePhotoListHeader2($event)
  168. : item.fieldKey === 'idcard_national_photo'
  169. ? changePhotoListHeader3($event)
  170. : ''
  171. "
  172. :auto-upload="false"
  173. custom-btn="true"
  174. :action="action"
  175. :file-list="
  176. item.fieldKey === 'recent_photos'
  177. ? fileList1
  178. : item.fieldKey === 'idcard_face_photo'
  179. ? fileList2
  180. : item.fieldKey === 'idcard_national_photo'
  181. ? fileList3
  182. : ''
  183. "
  184. width="120"
  185. height="120"
  186. size-type="['compressed']"
  187. max-count="1"
  188. >
  189. <template v-slot:addBtn>
  190. <image
  191. :src="
  192. item.fieldKey === 'recent_photos'
  193. ? '/static/info_1.png'
  194. : item.fieldKey === 'idcard_face_photo'
  195. ? '/static/info_2.png'
  196. : item.fieldKey === 'idcard_national_photo'
  197. ? '/static/info_3.png'
  198. : ''
  199. "
  200. :style="
  201. item.fieldKey === 'recent_photos'
  202. ? 'width: 120rpx; height: 169rpx;'
  203. : item.fieldKey === 'idcard_face_photo'
  204. ? 'width: 120rpx; height: 82rpx;'
  205. : item.fieldKey === 'idcard_national_photo'
  206. ? 'width: 120rpx; height: 82rpx;'
  207. : ''
  208. "
  209. ></image>
  210. </template>
  211. </u-upload>
  212. </u-form-item>
  213. <view :key="index" v-if="item.inputType == 3 && item.fieldKey === 'commitment_electr_signature'">
  214. <u-form-item
  215. v-if="item.inputType == 3 && item.fieldKey === 'commitment_electr_signature'"
  216. label="承诺书"
  217. :required="true"
  218. :label-width="auto"
  219. label-position="top"
  220. >
  221. <view style="line-height: 40rpx;text-indent:2em">
  222. <text>
  223. 本人自愿做出如下承诺:本人己仔细阅读《广东省住房和城乡建设厅关于推进住房和城乡建设领域施工现场专业人员职业培训工作的通知》
  224. 全部内容并知晓和理解,本人的学历证书、身份证、工作年限、相片等所有资料完全真实、符合报名条件、资格审查要求和相关规定,本人在报名、审查、培训、测试等有关的事项中会严格道守相关规定和要求,如有虛假或与实际规定不符等情况造成的一切后果由本人承担。
  225. </text>
  226. <view style="line-height: 40rpx;text-indent:2em"><text>特此承诺!</text></view>
  227. </view>
  228. </u-form-item>
  229. <u-form-item
  230. v-if="item.inputType == 3 && item.fieldKey === 'commitment_electr_signature'"
  231. label="签名板"
  232. :required="true"
  233. :label-width="auto"
  234. label-position="top"
  235. :prop="item.required ? item.fieldKey : ''"
  236. >
  237. <view class="dis_stys">
  238. <text style="color: #999999;">请在下方签名区进行签名</text>
  239. <text @click="retDraw" mode="">清空</text>
  240. </view>
  241. <view class="handCenter">
  242. <canvas
  243. v-if="!form[item.fieldKey]"
  244. class="handWriting"
  245. disable-scroll="true"
  246. @touchstart="uploadScaleStart"
  247. @touchmove="uploadScaleMove"
  248. @touchend="uploadScaleEnd"
  249. @tap="mouseDown"
  250. canvas-id="handWriting"
  251. ></canvas>
  252. <view v-else style="width:100%;height: 100%;position: relative;">
  253. <view class="ctoples">图片</view>
  254. <image style="width:100%;height:100%;" :src="$method.splitImgHost(form[item.fieldKey])" mode=""></image>
  255. </view>
  256. </view>
  257. </u-form-item>
  258. </view>
  259. </template>
  260. </u-form>
  261. </view>
  262. <view @click="submits" class="submit_btn">提交资料</view>
  263. </view>
  264. </template>
  265. <script>
  266. import * as baseUrls from '@/common/request.js';
  267. import { mapGetters } from 'vuex';
  268. import Handwriting from '@/common/signature.js';
  269. export default {
  270. data() {
  271. return {
  272. itemStyle: {
  273. marginTop: '20px',
  274. backgroundColor: '#fff',
  275. borderRadius: '24rpx',
  276. padding: '0rpx 20rpx'
  277. },
  278. form: {
  279. name: '',
  280. sex: '',
  281. idcard: '',
  282. telphone: '',
  283. education: '',
  284. school: '',
  285. graduation_time: '',
  286. work_unit: '',
  287. unit_contact: '',
  288. unit_tel: '',
  289. apply_post: '',
  290. major: '',
  291. working_years: '',
  292. recent_photos: '',
  293. idcard_face_photo: '',
  294. idcard_national_photo: '',
  295. commitment_electr_signature: ''
  296. },
  297. lineColor: 'black',
  298. slideValue: 50,
  299. handwriting: '',
  300. goodsId: null,
  301. listData: [], //页面数据
  302. fileList1: [], //个人近照
  303. fileList2: [], //人像
  304. fileList3: [], //国徽
  305. openVerify: false, // 控制是否手动验证
  306. id: null, //获取修改ID内容
  307. remark: '', //反馈文本
  308. remarkStatus: false, //是否存在审核结果反馈
  309. // nextStatus: false, //是否有下一步
  310. copyData: [], //备份数据
  311. rules: {
  312. name: [
  313. {
  314. required: true,
  315. message: '请输入姓名',
  316. trigger: ['change', 'blur']
  317. }
  318. ],
  319. sex: [
  320. {
  321. required: true,
  322. message: '请选择性别',
  323. trigger: 'change'
  324. }
  325. ],
  326. idcard: [
  327. {
  328. required: true,
  329. message: '请输入身份证号',
  330. trigger: ['change', 'blur']
  331. },
  332. {
  333. validator: (rule, value, callback) => {
  334. return this.$u.test.idCard(value);
  335. },
  336. message: '身份证号不正确',
  337. trigger: ['change', 'blur']
  338. }
  339. ],
  340. telphone: [
  341. {
  342. required: true,
  343. message: '请输入手机号码',
  344. trigger: ['change', 'blur']
  345. },
  346. {
  347. validator: (rule, value, callback) => {
  348. var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
  349. if (this.$u.test.mobile(value) || vartest.test(value)) {
  350. return true;
  351. }else{
  352. return false
  353. }
  354. },
  355. message: '手机号码不正确',
  356. trigger: ['change', 'blur']
  357. }
  358. ],
  359. education: [
  360. {
  361. required: true,
  362. message: '请选择学历',
  363. trigger: 'change'
  364. }
  365. ],
  366. school: [
  367. {
  368. required: true,
  369. message: '请输入毕业院校',
  370. trigger: ['change', 'blur']
  371. }
  372. ],
  373. graduation_time: [
  374. {
  375. required: true,
  376. message: '请选择毕业时间',
  377. trigger: 'change'
  378. }
  379. ],
  380. work_unit: [
  381. {
  382. required: true,
  383. message: '请输入工作单位',
  384. trigger: ['change', 'blur']
  385. }
  386. ],
  387. unit_contact: [
  388. {
  389. required: true,
  390. message: '请输入单位联系人',
  391. trigger: ['change', 'blur']
  392. }
  393. ],
  394. unit_tel: [
  395. {
  396. required: true,
  397. message: '请输入单位联系电话',
  398. trigger: ['change', 'blur']
  399. },
  400. {
  401. validator: (rule, value, callback) => {
  402. var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
  403. if (this.$u.test.mobile(value) || vartest.test(value)) {
  404. return true;
  405. }else{
  406. return false
  407. }
  408. },
  409. message: '单位联系电话不正确',
  410. trigger: ['change', 'blur']
  411. }
  412. ],
  413. apply_post: [
  414. {
  415. required: true,
  416. message: '请输入报名岗位',
  417. trigger: ['change', 'blur']
  418. }
  419. ],
  420. major: [
  421. {
  422. required: true,
  423. message: '请输入所学专业',
  424. trigger: ['change', 'blur']
  425. }
  426. ],
  427. working_years: [
  428. {
  429. required: true,
  430. message: '请选择工作年限',
  431. trigger: 'change'
  432. }
  433. ],
  434. recent_photos: [
  435. {
  436. required: true,
  437. message: '请上传个人近照',
  438. trigger: ['change', 'blur']
  439. }
  440. ],
  441. idcard_face_photo: [
  442. {
  443. required: true,
  444. message: '请上传身份证正面照',
  445. trigger: ['change', 'blur']
  446. }
  447. ],
  448. idcard_national_photo: [
  449. {
  450. required: true,
  451. message: '请上传身份证国徽照',
  452. trigger: ['change', 'blur']
  453. }
  454. ],
  455. commitment_electr_signature: [
  456. {
  457. required: true,
  458. message: '请签写承诺书电子签',
  459. trigger: ['change', 'blur']
  460. }
  461. ]
  462. }
  463. };
  464. },
  465. created() {
  466. this.$store.getters.dictObj;
  467. },
  468. onLoad(option) {
  469. this.goodsId = Number(option.id);
  470. this.getInfo();
  471. },
  472. onReady(res) {
  473. this.handwriting = new Handwriting({
  474. lineColor: this.lineColor,
  475. slideValue: this.slideValue, // 0, 25, 50, 75, 100
  476. canvasName: 'handWriting'
  477. });
  478. this.$refs.uForm.setRules(this.rules);
  479. },
  480. computed: { ...mapGetters(['dictObj']) },
  481. methods: {
  482. cahngeText() {
  483. this.$set(this.form, 'name', '唐');
  484. console.log(this.form.name, 123);
  485. },
  486. uploadDatas(data) {
  487. var self = this;
  488. if (self.remarkStatus) {
  489. var arsty = {};
  490. for (let k in data) {
  491. for (let j in self.copyData) {
  492. if (k === j) {
  493. if (self.copyData[j].value === data[k]) {
  494. arsty[k] = {
  495. fieldKey: k,
  496. value: data[k],
  497. fieldName: (function() {
  498. for (let i = 0; i < self.listData.length; i++) {
  499. if (self.listData[i].fieldKey == k) {
  500. return self.listData[i].fieldName;
  501. }
  502. }
  503. })(),
  504. status: 0
  505. };
  506. } else {
  507. arsty[k] = {
  508. fieldKey: k,
  509. value: data[k],
  510. fieldName: (function() {
  511. for (let i = 0; i < self.listData.length; i++) {
  512. if (self.listData[i].fieldKey == k) {
  513. return self.listData[i].fieldName;
  514. }
  515. }
  516. })(),
  517. status: 1
  518. };
  519. }
  520. }
  521. }
  522. }
  523. var datas = {
  524. id: this.id,
  525. goodsId: this.goodsId,
  526. keyValue: JSON.stringify(arsty)
  527. };
  528. this.$api.editbaseprofiletp(datas).then(res => {
  529. if (res.data.code === 200) {
  530. this.$method.showToast('提交成功');
  531. uni.navigateBack();
  532. }
  533. });
  534. } else {
  535. var objs = {};
  536. for (let k in data) {
  537. objs[k] = {
  538. fieldKey: k,
  539. value: data[k],
  540. fieldName: (function() {
  541. for (let i = 0; i < self.listData.length; i++) {
  542. if (self.listData[i].fieldKey == k) {
  543. return self.listData[i].fieldName;
  544. }
  545. }
  546. })(),
  547. status: 0
  548. };
  549. }
  550. var datas = {
  551. goodsId: this.goodsId,
  552. keyValue: JSON.stringify(objs)
  553. };
  554. this.$api.addbaseprofiletp(datas).then(res => {
  555. if (res.data.code === 200) {
  556. this.$method.showToast('提交成功');
  557. uni.navigateBack();
  558. }
  559. });
  560. }
  561. },
  562. backPage() {
  563. uni.navigateBack();
  564. },
  565. //提交表单
  566. async submitApi() {
  567. var data = JSON.parse(JSON.stringify(this.form));
  568. if (data['sex']) {
  569. data.sex = this.dictObj['sys_user_sex'][Number(data.sex)];
  570. }
  571. if (data['education']) {
  572. data.education = this.dictObj['edu_level'][Number(data.education)];
  573. }
  574. if (data['working_years']) {
  575. data.working_years = this.dictObj['working_years'][Number(data.working_years)];
  576. }
  577. if (data['recent_photos']) {
  578. data.recent_photos = await this.$method.uploadFile(data.recent_photos, 0);
  579. }
  580. if (data['idcard_face_photo']) {
  581. data.idcard_face_photo = await this.$method.uploadFile(data.idcard_face_photo, 0);
  582. }
  583. if (data['idcard_national_photo']) {
  584. data.idcard_national_photo = await this.$method.uploadFile(data.idcard_national_photo, 0);
  585. }
  586. if (data['commitment_electr_signature']) {
  587. data.commitment_electr_signature = await this.$method.uploadFile(data.commitment_electr_signature, 0);
  588. }
  589. this.uploadDatas(data);
  590. },
  591. //验证表单
  592. resultForm(int) {
  593. if (this.openVerify) {
  594. this.$refs.uForm.validate(valid => {
  595. if (valid) {
  596. if (int === 1) {
  597. this.submitApi();
  598. }
  599. } else {
  600. console.log('验证失败');
  601. }
  602. });
  603. }
  604. },
  605. async submits() {
  606. var ast = this.listData.some(item => {
  607. return item.fieldKey === 'commitment_electr_signature';
  608. });
  609. if (ast) {
  610. await this.subCanvas();
  611. }
  612. this.openVerify = true;
  613. this.resultForm(1);
  614. },
  615. async changePhotoListHeader1(lists, name) {
  616. console.log(lists[0].url);
  617. if (lists.length) {
  618. this.fileList1 = lists;
  619. if (lists[0].url.indexOf('//tmp') !== -1) {
  620. this.$set(this.form, 'recent_photos', await this.$method.imageInfos(lists[0].url));
  621. }
  622. } else {
  623. this.fileList1 = [];
  624. this.$set(this.form, 'recent_photos', '');
  625. console.log(3, this.form.recent_photos);
  626. }
  627. this.$nextTick(function() {
  628. console.log(4);
  629. this.resultForm();
  630. });
  631. },
  632. async changePhotoListHeader2(lists, name) {
  633. if (lists.length) {
  634. this.fileList2 = lists;
  635. if (lists[0].url.indexOf('//tmp') !== -1) {
  636. this.$set(this.form, 'idcard_face_photo', await this.$method.imageInfos(lists[0].url));
  637. }
  638. } else {
  639. this.fileList2 = [];
  640. this.$set(this.form, 'idcard_face_photo', '');
  641. }
  642. this.$nextTick(function() {
  643. this.resultForm();
  644. });
  645. },
  646. async changePhotoListHeader3(lists, name) {
  647. if (lists.length) {
  648. this.fileList3 = lists;
  649. if (lists[0].url.indexOf('//tmp') !== -1) {
  650. this.$set(this.form, 'idcard_national_photo', await this.$method.imageInfos(lists[0].url));
  651. }
  652. } else {
  653. this.fileList3 = [];
  654. this.$set(this.form, 'idcard_national_photo', '');
  655. }
  656. this.$nextTick(function() {
  657. this.resultForm();
  658. });
  659. },
  660. getTimes(key) {
  661. if (this.form[key]) {
  662. return this.form[key];
  663. } else {
  664. return '请选择时间';
  665. }
  666. },
  667. getarrays(key) {
  668. if (key === 'sex') {
  669. return this.dictObj['sys_user_sex'];
  670. }
  671. if (key === 'education') {
  672. return this.dictObj['edu_level'];
  673. }
  674. if (key === 'working_years') {
  675. return this.dictObj['working_years'];
  676. }
  677. },
  678. returnName(key) {
  679. if (key === 'sex') {
  680. if (this.form[key]) {
  681. return this.dictObj['sys_user_sex'][Number(this.form[key])];
  682. } else {
  683. return '请选择性别';
  684. }
  685. }
  686. if (key === 'education') {
  687. if (this.form[key]) {
  688. return this.dictObj['edu_level'][Number(this.form[key])];
  689. } else {
  690. return '请选择学历';
  691. }
  692. }
  693. if (key === 'working_years') {
  694. if (this.form[key]) {
  695. return this.dictObj['working_years'][Number(this.form[key])];
  696. } else {
  697. return '请选择工作年限';
  698. }
  699. }
  700. },
  701. getInfo() {
  702. var self = this;
  703. this.$api.getbaseprofiletpId(this.goodsId).then(res => {
  704. self.listData = JSON.parse(res.data.data.keyValue);
  705. self.$api.getbaseprofiletpgetInfo({ goodsId: self.goodsId }).then(result => {
  706. if (result.data.code === 200) {
  707. if (result.data.data && result.data.data.status === 3) {
  708. self.remark = result.data.data.text;
  709. self.remarkStatus = true;
  710. self.id = result.data.data.id;
  711. var arrays = JSON.parse(result.data.data.keyValue);
  712. self.copyData = JSON.parse(JSON.stringify(arrays));
  713. for (let k in arrays) {
  714. if (k === 'sex') {
  715. if (arrays[k].value) {
  716. const sexIndex = self.dictObj['sys_user_sex'].indexOf(arrays[k].value) + '';
  717. self.$set(self.form, k, sexIndex);
  718. }
  719. } else if (k === 'education') {
  720. if (arrays[k].value) {
  721. const sexIndex = self.dictObj['edu_level'].indexOf(arrays[k].value) + '';
  722. self.$set(self.form, k, sexIndex);
  723. }
  724. } else if (k === 'working_years') {
  725. if (arrays[k].value) {
  726. const sexIndex = self.dictObj['working_years'].indexOf(arrays[k].value) + '';
  727. self.$set(self.form, k, sexIndex);
  728. }
  729. } else if (k === 'recent_photos') {
  730. self.$set(self.form, k, arrays[k].value);
  731. if (arrays[k].value) {
  732. self.fileList1 = [{ url: baseUrls.BASE_IMG_URL + arrays[k].value }];
  733. }
  734. } else if (k === 'idcard_face_photo') {
  735. self.$set(self.form, k, arrays[k].value);
  736. if (arrays[k].value) {
  737. self.fileList2 = [{ url: baseUrls.BASE_IMG_URL + arrays[k].value }];
  738. }
  739. } else if (k === 'idcard_national_photo') {
  740. self.$set(self.form, k, arrays[k].value);
  741. if (arrays[k].value) {
  742. self.fileList3 = [{ url: baseUrls.BASE_IMG_URL + arrays[k].value }];
  743. }
  744. } else {
  745. self.$set(self.form, k, arrays[k].value);
  746. }
  747. }
  748. } else if (result.data.data && (result.data.data.status === 1 || result.data.data.status === 2)) {
  749. uni.showModal({
  750. showCancel: false,
  751. content:
  752. result.data.data.status === 1
  753. ? '该商品审核资料已通过,不可重复提交资料'
  754. : result.data.data.status === 2
  755. ? '该商品审核资料处于待审核状态,不可重复提交资料'
  756. : '请联系管理员',
  757. success: function(k) {
  758. if (k.confirm) {
  759. uni.navigateBack();
  760. }
  761. }
  762. });
  763. }
  764. }
  765. });
  766. });
  767. },
  768. bindPickerChange(key, e) {
  769. this.$set(this.form, key, e.detail.value);
  770. this.$nextTick(function() {
  771. this.resultForm();
  772. });
  773. },
  774. bindDateChange(key, e) {
  775. this.form[key] = e.detail.value;
  776. },
  777. retDraw() {
  778. this.handwriting.retDraw();
  779. this.$set(this.form, 'commitment_electr_signature', '');
  780. this.$nextTick(function() {
  781. this.resultForm();
  782. });
  783. },
  784. uploadScaleStart(event) {
  785. this.handwriting.uploadScaleStart(event);
  786. },
  787. uploadScaleMove(event) {
  788. this.handwriting.uploadScaleMove(event);
  789. },
  790. uploadScaleEnd(event) {
  791. this.handwriting.uploadScaleEnd(event);
  792. },
  793. subCanvas() {
  794. return new Promise((resolve, reject) => {
  795. var self = this;
  796. if (self.form.commitment_electr_signature) {
  797. resolve();
  798. return;
  799. }
  800. self.handwriting
  801. .saveCanvas()
  802. .then(res => {
  803. if (this.handwriting.linePrack.length) {
  804. this.$set(this.form, 'commitment_electr_signature', res);
  805. }
  806. resolve(res);
  807. })
  808. .catch(err => {
  809. uni.showToast({
  810. title: '签名上传失败',
  811. icon: 'error'
  812. });
  813. });
  814. });
  815. }
  816. }
  817. };
  818. </script>
  819. <style>
  820. page {
  821. background: #eaeef1;
  822. }
  823. </style>
  824. <style scope>
  825. .ctoples {
  826. position: absolute;
  827. top: 0;
  828. left: 0;
  829. padding: 2rpx 23rpx;
  830. display: inline-block;
  831. background-color: rgba(0, 0, 0, 0.4);
  832. font-size: 28rpx;
  833. color: #fff;
  834. border-bottom-right-radius: 24rpx;
  835. }
  836. .handWriting {
  837. width: 100%;
  838. height: 100%;
  839. }
  840. /deep/ .u-collapse-title {
  841. color: red;
  842. font-size: 24rpx;
  843. }
  844. .collapse-item {
  845. color: #666;
  846. font-size: 24rpx;
  847. padding-bottom: 30rpx;
  848. }
  849. .dis_stys {
  850. display: flex;
  851. align-items: center;
  852. justify-content: space-between;
  853. }
  854. .handCenter {
  855. background: #f7f7f7;
  856. border: 2rpx solid #eeeeee;
  857. border-radius: 24rpx;
  858. width: 100%;
  859. height: 300rpx;
  860. overflow: hidden;
  861. }
  862. .headerSDels {
  863. height: 58rpx;
  864. padding: 0rpx 24rpx;
  865. font-weight: bold;
  866. display: flex;
  867. align-items: center;
  868. flex-direction: row-reverse;
  869. }
  870. .listBox {
  871. margin: 24rpx 32rpx 0rpx;
  872. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  873. border-radius: 32rpx;
  874. background-color: #fff;
  875. overflow: hidden;
  876. }
  877. .imgBoxs {
  878. width: 156rpx;
  879. height: 203rpx;
  880. }
  881. .imgBoxs2 {
  882. width: 171rpx;
  883. height: 108rpx;
  884. }
  885. .submit_btn {
  886. width: 526rpx;
  887. height: 80rpx;
  888. background: #007aff;
  889. border-radius: 40rpx;
  890. text-align: center;
  891. line-height: 80rpx;
  892. color: #ffffff;
  893. margin: 30rpx auto;
  894. }
  895. .picker {
  896. text-align: right;
  897. }
  898. input {
  899. text-align: right;
  900. }
  901. .bodyBox {
  902. background: #ffffff;
  903. border-radius: 24rpx;
  904. width: 100%;
  905. }
  906. .topBox {
  907. height: 80rpx;
  908. background: #ffffff;
  909. border-radius: 24rpx;
  910. width: 100%;
  911. display: flex;
  912. justify-content: space-between;
  913. line-height: 80rpx;
  914. padding: 0 20rpx;
  915. font-size: 24rpx;
  916. }
  917. </style>