input.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882
  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. <image v-else style="width:100%;height:100%;" :src="$method.splitImgHost(form[item.fieldKey])" mode=""></image>
  253. </view>
  254. </u-form-item>
  255. </view>
  256. </template>
  257. </u-form>
  258. </view>
  259. <view @click="submits" class="submit_btn">提交资料</view>
  260. </view>
  261. </template>
  262. <script>
  263. import * as baseUrls from '@/common/request.js';
  264. import { mapGetters } from 'vuex';
  265. import Handwriting from '@/common/signature.js';
  266. export default {
  267. data() {
  268. return {
  269. itemStyle: {
  270. marginTop: '20px',
  271. backgroundColor: '#fff',
  272. borderRadius: '24rpx',
  273. padding: '0rpx 20rpx'
  274. },
  275. form: {
  276. name: '',
  277. sex: '',
  278. idcard: '',
  279. telphone: '',
  280. education: '',
  281. school: '',
  282. graduation_time: '',
  283. work_unit: '',
  284. unit_contact: '',
  285. unit_tel: '',
  286. apply_post: '',
  287. major: '',
  288. working_years: '',
  289. recent_photos: '',
  290. idcard_face_photo: '',
  291. idcard_national_photo: '',
  292. commitment_electr_signature: ''
  293. },
  294. lineColor: 'black',
  295. slideValue: 50,
  296. handwriting: '',
  297. goodsId: null,
  298. listData: [], //页面数据
  299. fileList1: [], //个人近照
  300. fileList2: [], //人像
  301. fileList3: [], //国徽
  302. openVerify: false, // 控制是否手动验证
  303. id: null, //获取修改ID内容
  304. remark: '', //反馈文本
  305. remarkStatus: false, //是否存在审核结果反馈
  306. // nextStatus: false, //是否有下一步
  307. copyData: [], //备份数据
  308. rules: {
  309. name: [
  310. {
  311. required: true,
  312. message: '请输入姓名',
  313. trigger: ['change', 'blur']
  314. }
  315. ],
  316. sex: [
  317. {
  318. required: true,
  319. message: '请选择性别',
  320. trigger: 'change'
  321. }
  322. ],
  323. idcard: [
  324. {
  325. required: true,
  326. message: '请输入身份证号',
  327. trigger: ['change', 'blur']
  328. },
  329. {
  330. validator: (rule, value, callback) => {
  331. return this.$u.test.idCard(value);
  332. },
  333. message: '身份证号不正确',
  334. trigger: ['change', 'blur']
  335. }
  336. ],
  337. telphone: [
  338. {
  339. required: true,
  340. message: '请输入手机号码',
  341. trigger: ['change', 'blur']
  342. },
  343. {
  344. validator: (rule, value, callback) => {
  345. return this.$u.test.mobile(value);
  346. },
  347. message: '手机号码不正确',
  348. trigger: ['change', 'blur']
  349. }
  350. ],
  351. education: [
  352. {
  353. required: true,
  354. message: '请选择学历',
  355. trigger: 'change'
  356. }
  357. ],
  358. school: [
  359. {
  360. required: true,
  361. message: '请输入毕业院校',
  362. trigger: ['change', 'blur']
  363. }
  364. ],
  365. graduation_time: [
  366. {
  367. required: true,
  368. message: '请选择毕业时间',
  369. trigger: 'change'
  370. }
  371. ],
  372. work_unit: [
  373. {
  374. required: true,
  375. message: '请输入工作单位',
  376. trigger: ['change', 'blur']
  377. }
  378. ],
  379. unit_contact: [
  380. {
  381. required: true,
  382. message: '请输入单位联系人',
  383. trigger: ['change', 'blur']
  384. }
  385. ],
  386. unit_tel: [
  387. {
  388. required: true,
  389. message: '请输入单位联系电话',
  390. trigger: ['change', 'blur']
  391. },
  392. {
  393. validator: (rule, value, callback) => {
  394. return this.$u.test.mobile(value);
  395. },
  396. message: '单位联系电话不正确',
  397. trigger: ['change', 'blur']
  398. }
  399. ],
  400. apply_post: [
  401. {
  402. required: true,
  403. message: '请输入报名岗位',
  404. trigger: ['change', 'blur']
  405. }
  406. ],
  407. major: [
  408. {
  409. required: true,
  410. message: '请输入所学专业',
  411. trigger: ['change', 'blur']
  412. }
  413. ],
  414. working_years: [
  415. {
  416. required: true,
  417. message: '请选择工作年限',
  418. trigger: 'change'
  419. }
  420. ],
  421. recent_photos: [
  422. {
  423. required: true,
  424. message: '请上传个人近照',
  425. trigger: ['change', 'blur']
  426. }
  427. ],
  428. idcard_face_photo: [
  429. {
  430. required: true,
  431. message: '请上传身份证正面照',
  432. trigger: ['change', 'blur']
  433. }
  434. ],
  435. idcard_national_photo: [
  436. {
  437. required: true,
  438. message: '请上传身份证国徽照',
  439. trigger: ['change', 'blur']
  440. }
  441. ],
  442. commitment_electr_signature: [
  443. {
  444. required: true,
  445. message: '请签写承诺书电子签',
  446. trigger: ['change', 'blur']
  447. }
  448. ]
  449. }
  450. };
  451. },
  452. onLoad(option) {
  453. this.goodsId = Number(option.id);
  454. this.getInfo();
  455. },
  456. onReady(res) {
  457. this.handwriting = new Handwriting({
  458. lineColor: this.lineColor,
  459. slideValue: this.slideValue, // 0, 25, 50, 75, 100
  460. canvasName: 'handWriting'
  461. });
  462. this.$refs.uForm.setRules(this.rules);
  463. },
  464. computed: { ...mapGetters(['dictObj']) },
  465. methods: {
  466. cahngeText() {
  467. this.$set(this.form, 'name', '唐');
  468. console.log(this.form.name, 123);
  469. },
  470. uploadDatas(data) {
  471. var self = this;
  472. if (self.remarkStatus) {
  473. var arsty = {};
  474. for (let k in data) {
  475. for (let j in self.copyData) {
  476. if (k === j) {
  477. if (self.copyData[j].value === data[k]) {
  478. arsty[k] = {
  479. fieldKey: k,
  480. value: data[k],
  481. fieldName: (function() {
  482. for (let i = 0; i < self.listData.length; i++) {
  483. if (self.listData[i].fieldKey == k) {
  484. return self.listData[i].fieldName;
  485. }
  486. }
  487. })(),
  488. status: 0
  489. };
  490. } else {
  491. arsty[k] = {
  492. fieldKey: k,
  493. value: data[k],
  494. fieldName: (function() {
  495. for (let i = 0; i < self.listData.length; i++) {
  496. if (self.listData[i].fieldKey == k) {
  497. return self.listData[i].fieldName;
  498. }
  499. }
  500. })(),
  501. status: 1
  502. };
  503. }
  504. }
  505. }
  506. }
  507. var datas = {
  508. id: this.id,
  509. goodsId: this.goodsId,
  510. keyValue: JSON.stringify(arsty)
  511. };
  512. this.$api.editbaseprofiletp(datas).then(res => {
  513. if (res.data.code === 200) {
  514. this.$method.showToast('提交成功');
  515. uni.navigateBack();
  516. }
  517. });
  518. } else {
  519. var objs = {};
  520. for (let k in data) {
  521. objs[k] = {
  522. fieldKey: k,
  523. value: data[k],
  524. fieldName: (function() {
  525. for (let i = 0; i < self.listData.length; i++) {
  526. if (self.listData[i].fieldKey == k) {
  527. return self.listData[i].fieldName;
  528. }
  529. }
  530. })(),
  531. status: 0
  532. };
  533. }
  534. var datas = {
  535. goodsId: this.goodsId,
  536. keyValue: JSON.stringify(objs)
  537. };
  538. this.$api.addbaseprofiletp(datas).then(res => {
  539. if (res.data.code === 200) {
  540. this.$method.showToast('提交成功');
  541. uni.navigateBack();
  542. }
  543. });
  544. }
  545. },
  546. backPage() {
  547. uni.navigateBack();
  548. },
  549. //提交表单
  550. async submitApi() {
  551. var data = JSON.parse(JSON.stringify(this.form));
  552. if (data['sex']) {
  553. data.sex = this.dictObj['sys_user_sex'][Number(data.sex)];
  554. }
  555. if (data['education']) {
  556. data.education = this.dictObj['edu_level'][Number(data.education)];
  557. }
  558. if (data['working_years']) {
  559. data.working_years = this.dictObj['working_years'][Number(data.working_years)];
  560. }
  561. if (data['recent_photos']) {
  562. data.recent_photos = await this.$method.uploadFile(data.recent_photos, 0);
  563. }
  564. if (data['idcard_face_photo']) {
  565. data.idcard_face_photo = await this.$method.uploadFile(data.idcard_face_photo, 0);
  566. }
  567. if (data['idcard_national_photo']) {
  568. data.idcard_national_photo = await this.$method.uploadFile(data.idcard_national_photo, 0);
  569. }
  570. if (data['commitment_electr_signature']) {
  571. data.commitment_electr_signature = await this.$method.uploadFile(data.commitment_electr_signature, 0);
  572. }
  573. this.uploadDatas(data);
  574. },
  575. //验证表单
  576. resultForm(int) {
  577. if (this.openVerify) {
  578. this.$refs.uForm.validate(valid => {
  579. if (valid) {
  580. if (int === 1) {
  581. this.submitApi();
  582. }
  583. } else {
  584. console.log('验证失败');
  585. }
  586. });
  587. }
  588. },
  589. async submits() {
  590. await this.subCanvas();
  591. this.openVerify = true;
  592. this.resultForm(1);
  593. },
  594. async changePhotoListHeader1(lists, name) {
  595. if (lists.length) {
  596. this.fileList1 = lists;
  597. if (lists[0].url.indexOf('//tmp/') !== -1) {
  598. this.form.recent_photos = await this.$method.imageInfos(lists[0].url);
  599. }
  600. } else {
  601. this.fileList1 = [];
  602. this.$set(this.form, 'recent_photos', '');
  603. }
  604. this.$nextTick(function() {
  605. this.resultForm();
  606. });
  607. },
  608. async changePhotoListHeader2(lists, name) {
  609. if (lists.length) {
  610. this.fileList2 = lists;
  611. if (lists[0].url.indexOf('//tmp/') !== -1) {
  612. this.form.idcard_face_photo = await this.$method.imageInfos(lists[0].url);
  613. }
  614. } else {
  615. this.fileList2 = [];
  616. this.$set(this.form, 'idcard_face_photo', '');
  617. }
  618. this.$nextTick(function() {
  619. this.resultForm();
  620. });
  621. },
  622. async changePhotoListHeader3(lists, name) {
  623. if (lists.length) {
  624. this.fileList3 = lists;
  625. if (lists[0].url.indexOf('//tmp/') !== -1) {
  626. this.form.idcard_national_photo = await this.$method.imageInfos(lists[0].url);
  627. }
  628. } else {
  629. this.fileList3 = [];
  630. this.$set(this.form, 'idcard_national_photo', '');
  631. }
  632. this.$nextTick(function() {
  633. this.resultForm();
  634. });
  635. },
  636. getTimes(key) {
  637. if (this.form[key]) {
  638. return this.form[key];
  639. } else {
  640. return '请选择时间';
  641. }
  642. },
  643. getarrays(key) {
  644. if (key === 'sex') {
  645. return this.dictObj['sys_user_sex'];
  646. }
  647. if (key === 'education') {
  648. return this.dictObj['edu_level'];
  649. }
  650. if (key === 'working_years') {
  651. return this.dictObj['working_years'];
  652. }
  653. },
  654. returnName(key) {
  655. if (key === 'sex') {
  656. if (this.form[key]) {
  657. return this.dictObj['sys_user_sex'][Number(this.form[key])];
  658. } else {
  659. return '请选择性别';
  660. }
  661. }
  662. if (key === 'education') {
  663. if (this.form[key]) {
  664. return this.dictObj['edu_level'][Number(this.form[key])];
  665. } else {
  666. return '请选择学历';
  667. }
  668. }
  669. if (key === 'working_years') {
  670. if (this.form[key]) {
  671. return this.dictObj['working_years'][Number(this.form[key])];
  672. } else {
  673. return '请选择工作年限';
  674. }
  675. }
  676. },
  677. getInfo() {
  678. var self = this;
  679. this.$api.getbaseprofiletpId(this.goodsId).then(res => {
  680. self.listData = JSON.parse(res.data.data.keyValue);
  681. self.$api.getbaseprofiletpgetInfo({ goodsId: self.goodsId }).then(result => {
  682. if (result.data.code === 200) {
  683. if (result.data.data && result.data.data.status === 3) {
  684. self.remark = result.data.data.text;
  685. self.remarkStatus = true;
  686. self.id = result.data.data.id;
  687. var arrays = JSON.parse(result.data.data.keyValue);
  688. self.copyData = JSON.parse(JSON.stringify(arrays));
  689. for (let k in arrays) {
  690. if (k === 'sex') {
  691. if (arrays[k].value) {
  692. const sexIndex = self.dictObj['sys_user_sex'].indexOf(arrays[k].value) + '';
  693. self.$set(self.form, k, sexIndex);
  694. }
  695. } else if (k === 'education') {
  696. if (arrays[k].value) {
  697. const sexIndex = self.dictObj['edu_level'].indexOf(arrays[k].value) + '';
  698. self.$set(self.form, k, sexIndex);
  699. }
  700. } else if (k === 'working_years') {
  701. if (arrays[k].value) {
  702. const sexIndex = self.dictObj['working_years'].indexOf(arrays[k].value) + '';
  703. self.$set(self.form, k, sexIndex);
  704. }
  705. } else if (k === 'recent_photos') {
  706. self.$set(self.form, k, arrays[k].value);
  707. if (arrays[k].value) {
  708. self.fileList1 = [{ url: baseUrls.BASE_IMG_URL + arrays[k].value }];
  709. }
  710. } else if (k === 'idcard_face_photo') {
  711. self.$set(self.form, k, arrays[k].value);
  712. if (arrays[k].value) {
  713. self.fileList2 = [{ url: baseUrls.BASE_IMG_URL + arrays[k].value }];
  714. }
  715. } else if (k === 'idcard_national_photo') {
  716. self.$set(self.form, k, arrays[k].value);
  717. if (arrays[k].value) {
  718. self.fileList3 = [{ url: baseUrls.BASE_IMG_URL + arrays[k].value }];
  719. }
  720. } else {
  721. self.$set(self.form, k, arrays[k].value);
  722. }
  723. }
  724. } else if (result.data.data && (result.data.data.status === 1 || result.data.data.status === 2)) {
  725. uni.showModal({
  726. showCancel: false,
  727. content:
  728. result.data.data.status === 1
  729. ? '该商品审核资料已通过,不可重复提交资料'
  730. : result.data.data.status === 2
  731. ? '该商品审核资料处于待审核状态,不可重复提交资料'
  732. : '请联系管理员',
  733. success: function(k) {
  734. if (k.confirm) {
  735. uni.navigateBack();
  736. }
  737. }
  738. });
  739. }
  740. }
  741. });
  742. });
  743. },
  744. bindPickerChange(key, e) {
  745. this.$set(this.form, key, e.detail.value);
  746. this.$nextTick(function() {
  747. this.resultForm();
  748. });
  749. },
  750. bindDateChange(key, e) {
  751. this.form[key] = e.detail.value;
  752. },
  753. retDraw() {
  754. this.handwriting.retDraw();
  755. this.$set(this.form, 'commitment_electr_signature', '');
  756. this.$nextTick(function() {
  757. this.resultForm();
  758. });
  759. },
  760. uploadScaleStart(event) {
  761. this.handwriting.uploadScaleStart(event);
  762. },
  763. uploadScaleMove(event) {
  764. this.handwriting.uploadScaleMove(event);
  765. },
  766. uploadScaleEnd(event) {
  767. this.handwriting.uploadScaleEnd(event);
  768. },
  769. subCanvas() {
  770. return new Promise((resolve, reject) => {
  771. var self = this;
  772. if (self.form.commitment_electr_signature) {
  773. resolve();
  774. return;
  775. }
  776. self.handwriting
  777. .saveCanvas()
  778. .then(res => {
  779. if (this.handwriting.linePrack.length) {
  780. this.$set(this.form, 'commitment_electr_signature', res);
  781. }
  782. resolve(res);
  783. })
  784. .catch(err => {
  785. uni.showToast({
  786. title: '签名上传失败',
  787. icon: 'error'
  788. });
  789. });
  790. });
  791. }
  792. }
  793. };
  794. </script>
  795. <style>
  796. page {
  797. background: #eaeef1;
  798. }
  799. </style>
  800. <style scope>
  801. .handWriting {
  802. width: 100%;
  803. height: 100%;
  804. }
  805. /deep/ .u-collapse-title {
  806. color: red;
  807. font-size: 24rpx;
  808. }
  809. .collapse-item {
  810. color: #666;
  811. font-size: 24rpx;
  812. padding-bottom: 30rpx;
  813. }
  814. .dis_stys {
  815. display: flex;
  816. align-items: center;
  817. justify-content: space-between;
  818. }
  819. .handCenter {
  820. background: #f7f7f7;
  821. border: 2rpx solid #eeeeee;
  822. border-radius: 24rpx;
  823. width: 100%;
  824. height: 300rpx;
  825. }
  826. .headerSDels {
  827. height: 58rpx;
  828. padding: 0rpx 24rpx;
  829. font-weight: bold;
  830. display: flex;
  831. align-items: center;
  832. flex-direction: row-reverse;
  833. }
  834. .listBox {
  835. margin: 24rpx 32rpx 0rpx;
  836. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  837. border-radius: 32rpx;
  838. background-color: #fff;
  839. overflow: hidden;
  840. }
  841. .imgBoxs {
  842. width: 156rpx;
  843. height: 203rpx;
  844. }
  845. .imgBoxs2 {
  846. width: 171rpx;
  847. height: 108rpx;
  848. }
  849. .submit_btn {
  850. width: 526rpx;
  851. height: 80rpx;
  852. background: #007aff;
  853. border-radius: 40rpx;
  854. text-align: center;
  855. line-height: 80rpx;
  856. color: #ffffff;
  857. margin: 30rpx auto;
  858. }
  859. .picker {
  860. text-align: right;
  861. }
  862. input {
  863. text-align: right;
  864. }
  865. .bodyBox {
  866. background: #ffffff;
  867. border-radius: 24rpx;
  868. width: 100%;
  869. }
  870. .topBox {
  871. height: 80rpx;
  872. background: #ffffff;
  873. border-radius: 24rpx;
  874. width: 100%;
  875. display: flex;
  876. justify-content: space-between;
  877. line-height: 80rpx;
  878. padding: 0 20rpx;
  879. font-size: 24rpx;
  880. }
  881. </style>