input.vue 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672
  1. <template>
  2. <view style="padding: 30rpx;">
  3. <nav-bar title="填写审核资料"></nav-bar>
  4. <view v-show="!agreementModal">
  5. <view class="topBox">
  6. <view>
  7. <u-icon name="error-circle-fill" color="#FF3B30" size="28"></u-icon>
  8. <text style="color: #FF3B30;margin-left: 10rpx;">学习前请提交完整审核资料</text>
  9. </view>
  10. <view style="color: #007AFF;" @click="backPage">稍后再填</view>
  11. </view>
  12. <u-collapse v-show="remarkStatus" :item-style="itemStyle" event-type="close" ref="collapse">
  13. <u-collapse-item title="审核结果反馈">
  14. <view style="padding-bottom: 30rpx;">
  15. <text class="collapse-item">{{ remark || '' }}</text>
  16. </view>
  17. </u-collapse-item>
  18. </u-collapse>
  19. <view class="bodyBox" style="margin-top: 30rpx;padding:0 20rpx;">
  20. <u-form :model="form" ref="uForm" :error-type="errorType">
  21. <template v-for="(item,index) in listData" >
  22. <u-form-item
  23. :key="index"
  24. v-if="item.fieldKey == 'name'"
  25. :label="item.fieldName"
  26. :required="item.required"
  27. :label-width="auto"
  28. :prop="item.required ? item.fieldKey : ''"
  29. >
  30. <u-input v-model="form.name" :placeholder="`请输入${item.fieldName}`" />
  31. </u-form-item>
  32. <u-form-item
  33. :key="index"
  34. v-if="item.fieldKey == 'idcard'"
  35. :label="item.fieldName"
  36. :required="item.required"
  37. :label-width="auto"
  38. :prop="item.required ? item.fieldKey : ''"
  39. >
  40. <u-input v-model="form.idcard" :placeholder="`请输入${item.fieldName}`" />
  41. </u-form-item>
  42. <u-form-item
  43. :key="index"
  44. v-if="item.fieldKey == 'telphone'"
  45. :label="item.fieldName"
  46. :required="item.required"
  47. :label-width="auto"
  48. :prop="item.required ? item.fieldKey : ''"
  49. >
  50. <u-input v-model="form.telphone" :placeholder="`请输入${item.fieldName}`" />
  51. </u-form-item>
  52. <u-form-item
  53. :key="index"
  54. v-if="item.fieldKey == 'school'"
  55. :label="item.fieldName"
  56. :required="item.required"
  57. :label-width="auto"
  58. :prop="item.required ? item.fieldKey : ''"
  59. >
  60. <u-input v-model="form.school" :placeholder="`请输入${item.fieldName}`" />
  61. </u-form-item>
  62. <u-form-item
  63. :key="index"
  64. v-if="item.fieldKey == 'work_unit'"
  65. :label="item.fieldName"
  66. :required="item.required"
  67. :label-width="auto"
  68. :prop="item.required ? item.fieldKey : ''"
  69. >
  70. <u-input v-model="form.work_unit" :placeholder="`请输入${item.fieldName}`" />
  71. </u-form-item>
  72. <u-form-item
  73. :key="index"
  74. v-if="item.fieldKey == 'unit_contact'"
  75. :label="item.fieldName"
  76. :required="item.required"
  77. :label-width="auto"
  78. :prop="item.required ? item.fieldKey : ''"
  79. >
  80. <u-input v-model="form.unit_contact" :placeholder="`请输入${item.fieldName}`" />
  81. </u-form-item>
  82. <u-form-item
  83. :key="index"
  84. v-if="item.fieldKey == 'unit_tel'"
  85. :label="item.fieldName"
  86. :required="item.required"
  87. :label-width="auto"
  88. :prop="item.required ? item.fieldKey : ''"
  89. >
  90. <u-input v-model="form.unit_tel" :placeholder="`请输入${item.fieldName}`" />
  91. </u-form-item>
  92. <u-form-item
  93. :key="index"
  94. v-if="item.fieldKey == 'apply_post'"
  95. :label="item.fieldName"
  96. :required="item.required"
  97. :label-width="auto"
  98. :prop="item.required ? item.fieldKey : ''"
  99. >
  100. <u-input v-model="form.apply_post" :disabled="apply_post_disabled" :placeholder="`请输入${item.fieldName}`" />
  101. </u-form-item>
  102. <u-form-item
  103. :key="index"
  104. v-if="item.fieldKey == 'major'"
  105. :label="item.fieldName"
  106. :required="item.required"
  107. :label-width="auto"
  108. :prop="item.required ? item.fieldKey : ''"
  109. >
  110. <u-input v-model="form.major" :placeholder="`请输入${item.fieldName}`" />
  111. </u-form-item>
  112. <u-form-item
  113. :key="index"
  114. v-if="item.inputType == 2"
  115. :label="item.fieldName"
  116. :label-width="auto"
  117. :required="item.required"
  118. :prop="item.required ? item.fieldKey : ''"
  119. >
  120. <picker @change="bindPickerChange(item.fieldKey, $event)" :value="form[item.fieldKey]" :range="getarrays(item.fieldKey)">
  121. <view class="picker">
  122. {{ returnName(item.fieldKey) }}
  123. <image
  124. src="@/static/icon/clears.png"
  125. v-if="clearWatch(item.fieldKey)"
  126. @click.stop="clearFun(item.fieldKey)"
  127. mode=""
  128. style="width:30rpx;height:30rpx;vertical-align: middle;margin-left:10rpx;"
  129. ></image>
  130. </view>
  131. </picker>
  132. </u-form-item>
  133. <u-form-item
  134. :key="index"
  135. v-if="item.inputType == 5"
  136. :label="item.fieldName"
  137. :label-width="auto"
  138. :required="item.required"
  139. :prop="item.required ? item.fieldKey : ''"
  140. >
  141. <picker mode="date" :value="form[item.fieldKey]" @change="bindDateChange(item.fieldKey, $event)">
  142. <view class="picker">
  143. {{ getTimes(item.fieldKey) }}
  144. <image
  145. src="@/static/icon/clears.png"
  146. v-if="clearWatch(item.fieldKey)"
  147. @click.stop="clearFun(item.fieldKey)"
  148. mode=""
  149. style="width:30rpx;height:30rpx;vertical-align: middle;margin-left:10rpx;"
  150. ></image>
  151. </view>
  152. </picker>
  153. </u-form-item>
  154. <u-form-item
  155. :key="index"
  156. v-if="item.inputType == 3 && item.fieldKey !== 'commitment_electr_signature'"
  157. :label="item.fieldName"
  158. :required="item.required"
  159. :label-width="auto"
  160. label-position="top"
  161. :prop="item.required ? item.fieldKey : ''"
  162. >
  163. <text v-if="item.fieldKey === 'recent_photos'" style="color: #999999;position: absolute;top: 20rpx;left: 130rpx;">竖向证件照 文件大小≤2M</text>
  164. <text
  165. v-if="item.fieldKey === 'idcard_face_photo' || item.fieldKey === 'idcard_national_photo'"
  166. style="color: #999999;position: absolute;top: 20rpx;left: 180rpx;"
  167. >
  168. 文件大小≤2M
  169. </text>
  170. <u-upload
  171. :show-progress="false"
  172. :max-size="2097152"
  173. :ref="
  174. item.fieldKey === 'recent_photos'
  175. ? 'recent_photos'
  176. : item.fieldKey === 'idcard_face_photo'
  177. ? 'idcard_face_photo'
  178. : item.fieldKey === 'idcard_national_photo'
  179. ? 'idcard_national_photo'
  180. : ''
  181. "
  182. @on-list-change="
  183. item.fieldKey === 'recent_photos'
  184. ? changePhotoListHeader1($event)
  185. : item.fieldKey === 'idcard_face_photo'
  186. ? changePhotoListHeader2($event)
  187. : item.fieldKey === 'idcard_national_photo'
  188. ? changePhotoListHeader3($event)
  189. : ''
  190. "
  191. :auto-upload="false"
  192. custom-btn="true"
  193. :action="action"
  194. :file-list="
  195. item.fieldKey === 'recent_photos'
  196. ? fileList1
  197. : item.fieldKey === 'idcard_face_photo'
  198. ? fileList2
  199. : item.fieldKey === 'idcard_national_photo'
  200. ? fileList3
  201. : ''
  202. "
  203. width="120"
  204. height="120"
  205. size-type="['compressed']"
  206. max-count="1"
  207. >
  208. <template v-slot:addBtn>
  209. <image
  210. :src="
  211. item.fieldKey === 'recent_photos'
  212. ? '/static/info_1.png'
  213. : item.fieldKey === 'idcard_face_photo'
  214. ? '/static/info_2.png'
  215. : item.fieldKey === 'idcard_national_photo'
  216. ? '/static/info_3.png'
  217. : ''
  218. "
  219. :style="
  220. item.fieldKey === 'recent_photos'
  221. ? 'width: 120rpx; height: 169rpx;'
  222. : item.fieldKey === 'idcard_face_photo'
  223. ? 'width: 120rpx; height: 82rpx;'
  224. : item.fieldKey === 'idcard_national_photo'
  225. ? 'width: 120rpx; height: 82rpx;'
  226. : ''
  227. "
  228. ></image>
  229. </template>
  230. </u-upload>
  231. </u-form-item>
  232. <view :key="index" v-if="item.inputType == 3 && item.fieldKey === 'commitment_electr_signature'">
  233. <u-form-item
  234. v-if="item.inputType == 3 && item.fieldKey === 'commitment_electr_signature'"
  235. label="承诺书"
  236. :required="item.required"
  237. :label-width="auto"
  238. label-position="top"
  239. >
  240. <view style="line-height: 40rpx;text-indent:2em">
  241. <text>
  242. 本人自愿做出如下承诺:本人己仔细阅读《广东省住房和城乡建设厅关于推进住房和城乡建设领域施工现场专业人员职业培训工作的通知》
  243. 全部内容并知晓和理解,本人的学历证书、身份证、工作年限、相片等所有资料完全真实、符合报名条件、资格审查要求和相关规定,本人在报名、审查、培训、测试等有关的事项中会严格道守相关规定和要求,如有虛假或与实际规定不符等情况造成的一切后果由本人承担。
  244. </text>
  245. <view style="line-height: 40rpx;text-indent:2em"><text>特此承诺!</text></view>
  246. </view>
  247. </u-form-item>
  248. <u-form-item
  249. v-if="item.inputType == 3 && item.fieldKey === 'commitment_electr_signature'"
  250. label="签名板"
  251. :required="item.required"
  252. :label-width="auto"
  253. label-position="top"
  254. :prop="item.required ? item.fieldKey : ''"
  255. >
  256. <view class="dis_stys">
  257. <text style="color: #999999;">请在下方签名区进行签名</text>
  258. <text @click="retDraw" mode="">清空</text>
  259. </view>
  260. <view class="handCenter">
  261. <canvas
  262. v-if="!form[item.fieldKey]"
  263. class="handWriting"
  264. disable-scroll="true"
  265. :catchtouchmove="true"
  266. @touchstart="uploadScaleStart"
  267. @touchmove="uploadScaleMove"
  268. @touchend="uploadScaleEnd"
  269. canvas-id="handWriting"
  270. ></canvas>
  271. <view v-else style="width:100%;height: 100%;position: relative;">
  272. <view class="ctoples">图片</view>
  273. <image style="width:100%;height:100%;" :src="$method.splitImgHost(form[item.fieldKey])" mode=""></image>
  274. </view>
  275. </view>
  276. </u-form-item>
  277. </view>
  278. <u-form-item
  279. v-if="item.inputType == 4"
  280. :key="index"
  281. :label="item.fieldName"
  282. :required="item.required"
  283. :label-width="auto"
  284. :prop="item.required ? item.fieldKey : ''"
  285. label-position="top"
  286. >
  287. <text style="color: #007AFF;position: absolute;top: 20rpx;left: 180rpx;text-decoration: underline;" @click="downDocx(item.url)">点击下载</text>
  288. <view class="dis_stys"><text style="color: #999999;">下载承诺书进行填写并签名盖章后上传(≤2M)</text></view>
  289. <image v-if="!form[item.fieldKey]" style="width: 169rpx; height: 169rpx;" @click="getChast" src="@/static/info_4.png"></image>
  290. <view class="quzw" v-if="form[item.fieldKey]">
  291. <view v-if="form[item.fieldKey].split('.').splice(-1)[0] == 'docx' || form[item.fieldKey].split('.').splice(-1)[0] == 'doc'" class="borsrs">
  292. <image src="@/static/icon/jy_icon.png" style="width: 168rpx; height: 168rpx;"></image>
  293. <text>{{ titleName }}</text>
  294. </view>
  295. <image v-else :src="form[item.fieldKey]" style="width: 100%; height: 100%;" mode="aspectFit" @click="seePhotos(form[item.fieldKey])"></image>
  296. <u-icon name="close-circle-fill" color="red" size="44" class="optionsAbs" @click="clearWord"></u-icon>
  297. </view>
  298. </u-form-item>
  299. </template>
  300. </u-form>
  301. </view>
  302. <view @click="submits" class="submit_btn">提交资料</view>
  303. </view>
  304. <u-popup class="modal" catchtouchmove='return' v-model="agreementModal" mode="center" border-radius="24" :mask-close-able="false">
  305. <view class="agreement">
  306. <view class="body">
  307. <scroll-view scroll-y="true" style="height:600rpx;">
  308. <view class="content">
  309. <view>本产品(或服务)提供【{{goodsData.goodsName}}】课程的在线学习功能,为使用这些功能,我们需要使用您设备上的摄像头,并收集以下个人信息:
  310. <text v-for="(item,listIndex) in listData" :key="listIndex">{{item.fieldName}}、</text>
  311. <!-- 姓名、性别、身份证号码、移动电话号码、身份证照片、一寸照、证书名称/岗位、证书编号、有效期、人脸照片(每节课随机拍摄三张)、 -->
  312. 学习详细记录。</view>
  313. <view>我们会将上述信息提供至广东省建设执业注册管理中心等第三方组织使用,用于继续教育备案等。如果您拒绝,将导致这些功能无法实现,但不影响您使用本产品(或服务)的其他业务功能。</view>
  314. </view>
  315. </scroll-view>
  316. </view>
  317. <view class="footer">
  318. <view class="btn cancel" @click="refuseAgreement">取消</view>
  319. <view class="btn ok" @click="agree">同意并继续</view>
  320. </view>
  321. </view>
  322. </u-popup>
  323. <u-action-sheet :list="list" v-model="showTableDown" @click="clickIndex"></u-action-sheet>
  324. </view>
  325. </template>
  326. <script>
  327. import * as baseUrls from '@/common/request.js';
  328. import { mapGetters } from 'vuex';
  329. import Handwriting from '@/common/signature.js';
  330. export default {
  331. data() {
  332. return {
  333. list: [
  334. {
  335. text: '上传图片'
  336. },
  337. // {
  338. // text: '上传文件'
  339. // }
  340. ],
  341. showTableDown: false,
  342. gradeId:0,
  343. errorType: ['message'],
  344. agreementModal:true,
  345. goodsData:{},
  346. itemStyle: {
  347. marginTop: '20px',
  348. backgroundColor: '#fff',
  349. borderRadius: '24rpx',
  350. padding: '0rpx 20rpx'
  351. },
  352. isUploading:false,
  353. form: {
  354. name: '',
  355. sex: '',
  356. idcard: '',
  357. telphone: '',
  358. education: '',
  359. school: '',
  360. graduation_time: '',
  361. work_unit: '',
  362. unit_contact: '',
  363. unit_tel: '',
  364. apply_post: '',
  365. major: '',
  366. working_years: '',
  367. recent_photos: '',
  368. idcard_face_photo: '',
  369. idcard_national_photo: '',
  370. commitment_electr_signature: '',
  371. commitment_seal: ''
  372. },
  373. lineColor: 'black',
  374. slideValue: 50,
  375. handwriting: '',
  376. goodsId: null,
  377. listData: [], //页面数据
  378. ast:[],
  379. fileList1: [], //个人近照
  380. fileList2: [], //人像
  381. fileList3: [], //国徽
  382. openVerify: false, // 控制是否手动验证
  383. id: null, //获取修改ID内容
  384. remark: '', //反馈文本
  385. remarkStatus: false, //是否存在审核结果反馈
  386. // nextStatus: false, //是否有下一步
  387. copyData: [], //备份数据
  388. rules: {
  389. name: [
  390. {
  391. required: true,
  392. message: '请输入姓名',
  393. trigger: ['change', 'blur']
  394. }
  395. ],
  396. sex: [
  397. {
  398. required: true,
  399. message: '请选择性别',
  400. trigger: 'change'
  401. }
  402. ],
  403. idcard: [
  404. {
  405. required: true,
  406. message: '请输入身份证号',
  407. trigger: ['change', 'blur']
  408. },
  409. {
  410. validator: (rule, value, callback) => {
  411. return this.$u.test.idCard(value);
  412. },
  413. message: '身份证号不正确',
  414. trigger: ['change', 'blur']
  415. }
  416. ],
  417. telphone: [
  418. {
  419. required: true,
  420. message: '请输入手机号码',
  421. trigger: ['change', 'blur']
  422. },
  423. {
  424. validator: (rule, value, callback) => {
  425. var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
  426. if (this.$u.test.mobile(value) || vartest.test(value)) {
  427. return true;
  428. } else {
  429. return false;
  430. }
  431. },
  432. message: '手机号码不正确',
  433. trigger: ['change', 'blur']
  434. }
  435. ],
  436. education: [
  437. {
  438. required: true,
  439. message: '请选择学历',
  440. trigger: 'change'
  441. }
  442. ],
  443. school: [
  444. {
  445. required: true,
  446. message: '请输入毕业院校',
  447. trigger: ['change', 'blur']
  448. }
  449. ],
  450. graduation_time: [
  451. {
  452. required: true,
  453. message: '请选择毕业时间',
  454. trigger: 'change'
  455. }
  456. ],
  457. work_unit: [
  458. {
  459. required: true,
  460. message: '请输入工作单位',
  461. trigger: ['change', 'blur']
  462. }
  463. ],
  464. unit_contact: [
  465. {
  466. required: true,
  467. message: '请输入单位联系人',
  468. trigger: ['change', 'blur']
  469. }
  470. ],
  471. unit_tel: [
  472. {
  473. required: true,
  474. message: '请输入单位联系电话',
  475. trigger: ['change', 'blur']
  476. },
  477. {
  478. validator: (rule, value, callback) => {
  479. var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
  480. var vartest1 = /^([0-9]{3,4})?[0-9]{7,8}$/;
  481. if (this.$u.test.mobile(value) || vartest.test(value) || vartest1.test(value)) {
  482. return true;
  483. } else {
  484. return false;
  485. }
  486. },
  487. message: '单位联系电话不正确',
  488. trigger: ['change', 'blur']
  489. }
  490. ],
  491. apply_post: [
  492. {
  493. required: true,
  494. message: '请输入报名岗位',
  495. trigger: ['change', 'blur']
  496. }
  497. ],
  498. major: [
  499. {
  500. required: true,
  501. message: '请输入所学专业',
  502. trigger: ['change', 'blur']
  503. }
  504. ],
  505. working_years: [
  506. {
  507. required: true,
  508. message: '请选择工作年限',
  509. trigger: 'change'
  510. }
  511. ],
  512. recent_photos: [
  513. {
  514. required: true,
  515. message: '请上传个人近照',
  516. trigger: ['change', 'blur']
  517. }
  518. ],
  519. idcard_face_photo: [
  520. {
  521. required: true,
  522. message: '请上传身份证人像面',
  523. trigger: ['change', 'blur']
  524. }
  525. ],
  526. idcard_national_photo: [
  527. {
  528. required: true,
  529. message: '请上传身份证国徽面',
  530. trigger: ['change', 'blur']
  531. }
  532. ],
  533. commitment_electr_signature: [
  534. {
  535. required: true,
  536. message: '请签写承诺书电子签',
  537. trigger: ['change', 'blur']
  538. }
  539. ],
  540. commitment_seal: [
  541. {
  542. required: true,
  543. message: '请上传承诺书盖章',
  544. trigger: ['change', 'blur']
  545. }
  546. ]
  547. },
  548. apply_post_disabled:false,
  549. isRequired: false,
  550. orderGoodsId:0,
  551. veryIdCard:'',
  552. veryIdName:'',
  553. };
  554. },
  555. created() {
  556. this.$store.getters.dictObj;
  557. },
  558. async onLoad(option) {
  559. this.orderGoodsId = Number(option.orderGoodsId)
  560. this.goodsId = Number(option.id);
  561. this.gradeId = Number(option.gradeId)
  562. await this.getGoodsDetail()
  563. this.getInfo();
  564. },
  565. onReady(res) {
  566. this.handwriting = new Handwriting({
  567. lineColor: this.lineColor,
  568. slideValue: this.slideValue, // 0, 25, 50, 75, 100
  569. canvasName: 'handWriting'
  570. });
  571. this.$refs.uForm.setRules(this.rules);
  572. },
  573. computed: { ...mapGetters(['dictObj','userInfo']) },
  574. watch:{
  575. userInfo(val, oldVal){//普通的watch监听
  576. if(val){
  577. this.listData.forEach(item => {
  578. if(item.fieldKey == "idcard") {
  579. this.form.idcard = this.userInfo.idCard;
  580. }
  581. if(item.fieldKey == "telphone") {
  582. this.form.telphone = this.userInfo.telphone;
  583. }
  584. if(item.fieldKey == "name") {
  585. this.form.name = this.userInfo.realname
  586. }
  587. })
  588. }
  589. },
  590. },
  591. methods: {
  592. clickIndex(inds){
  593. if(inds === 0){
  594. this.uploadImgs()
  595. }
  596. if(inds === 1){
  597. this.uploadFieds()
  598. }
  599. },
  600. getChast(){
  601. this.showTableDown = true;
  602. },
  603. seePhotos(url) {
  604. uni.previewImage({
  605. urls: [url]
  606. });
  607. },
  608. async downDocx(url) {
  609. let self = this;
  610. let data = JSON.parse(JSON.stringify(this.form));
  611. var ast = this.listData.some(item => {
  612. return item.fieldKey === 'commitment_electr_signature';
  613. });
  614. if (ast) {
  615. await this.subCanvas();
  616. }
  617. if (data['commitment_electr_signature']) {
  618. data.commitment_electr_signature = await this.$method.uploadFile(data.commitment_electr_signature, 0);
  619. }
  620. console.log(444)
  621. let arsty = {};
  622. for (let k in data) {
  623. for (let j in self.copyData) {
  624. if (k === j) {
  625. if (self.copyData[j].value === data[k]) {
  626. arsty[k] = {
  627. fieldKey: k,
  628. value: data[k],
  629. fieldName: (function() {
  630. for (let i = 0; i < self.listData.length; i++) {
  631. if (self.listData[i].fieldKey == k) {
  632. return self.listData[i].fieldName;
  633. }
  634. }
  635. })(),
  636. status: 0
  637. };
  638. } else {
  639. arsty[k] = {
  640. fieldKey: k,
  641. value: data[k],
  642. fieldName: (function() {
  643. for (let i = 0; i < self.listData.length; i++) {
  644. if (self.listData[i].fieldKey == k) {
  645. return self.listData[i].fieldName;
  646. }
  647. }
  648. })(),
  649. status: 1
  650. };
  651. }
  652. }
  653. }
  654. }
  655. this.$api.baseProfileStampV2AddWord({ goodsId: this.goodsId,keyValue:JSON.stringify(arsty) }).then(res => {
  656. uni.downloadFile({
  657. url: this.$method.splitImgHost(res.data.msg),
  658. success: result => {
  659. if (result.statusCode === 200) {
  660. const filePath = result.tempFilePath
  661. console.log(this.$method.splitImgHost(res.data.msg));
  662. this.$method.showToast('下载成功');
  663. uni.saveImageToPhotosAlbum({
  664. filePath: filePath,
  665. success: function (errMsg) {
  666. uni.showToast({
  667. mask: true,
  668. title: '保存成功'
  669. });
  670. },
  671. fail:(errMsg)=>{
  672. uni.showToast({
  673. mask: true,
  674. title: '保存失败'
  675. });
  676. },
  677. complete:(errMsg)=>{
  678. }
  679. });
  680. }
  681. }
  682. });
  683. });
  684. },
  685. getGoodsDetail() {
  686. return new Promise(resolve => {
  687. this.$api.orderInfo({
  688. orderGoodsId:this.orderGoodsId
  689. }).then(res => {
  690. this.goodsData = res.data.data;
  691. if(this.goodsData.categoryName) {
  692. this.form.apply_post = this.goodsData.categoryName;
  693. if(this.goodsData.categoryName) {
  694. this.apply_post_disabled = true;
  695. }
  696. }
  697. resolve()
  698. })
  699. })
  700. },
  701. uploadImgs(){
  702. var self = this
  703. uni.chooseImage({
  704. count: 1, //默认9
  705. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  706. success: function (res) {
  707. if (res.tempFiles[0].size > 2097152) {
  708. self.$method.showToast('上传图片不得大于2M');
  709. return;
  710. } else {
  711. var type = res.tempFiles[0].path.split('.').splice(-1);
  712. if (type[0] != 'jpg' && type[0] != 'png' && type[0] != 'jpeg') {
  713. self.$method.showToast('请上传图片格式');
  714. return;
  715. }
  716. self.$set(self.form, 'commitment_seal', res.tempFiles[0].path);
  717. self.$nextTick(function() {
  718. this.resultForm();
  719. });
  720. }
  721. }
  722. });
  723. },
  724. uploadFieds() {
  725. var self = this;
  726. wx.chooseMessageFile({
  727. count: 1,
  728. size: 2097152,
  729. type: 'file',
  730. success(res) {
  731. if (res.tempFiles[0].size > 2097152) {
  732. self.$method.showToast('上传文件不得大于2M');
  733. return;
  734. } else {
  735. var type = res.tempFiles[0].path.split('.').splice(-1);
  736. if (type[0] != 'jpg' && type[0] != 'png' && type[0] != 'jpeg' && type[0] != 'docx' && type[0] != 'doc') {
  737. self.$method.showToast('请上传word文档或图片');
  738. return;
  739. }
  740. self.titleName = res.tempFiles[0].name;
  741. self.$set(self.form, 'commitment_seal', res.tempFiles[0].path);
  742. self.$nextTick(function() {
  743. this.resultForm();
  744. });
  745. }
  746. }
  747. });
  748. },
  749. agree() {
  750. this.agreementModal = false;
  751. setTimeout(() => {
  752. this.$refs.collapse.init()
  753. },1000)
  754. },
  755. refuseAgreement() {
  756. uni.navigateBack({
  757. delta:1
  758. })
  759. },
  760. clearFun(key) {
  761. this.form[key] = '';
  762. },
  763. //清除按钮
  764. clearWatch(key) {
  765. if (this.form[key]) {
  766. return true;
  767. } else {
  768. return false;
  769. }
  770. },
  771. cahngeText() {
  772. this.$set(this.form, 'name', '唐');
  773. console.log(this.form.name, 123);
  774. },
  775. async uploadDatas(data) {
  776. if(this.form.recent_photos && this.form.idcard_face_photo) {
  777. uni.downloadFile({
  778. url: this.$method.splitImgHost(this.form.idcard_face_photo),
  779. success:async (res) => {
  780. if (res.statusCode === 200) {
  781. let resData = await this.faceCertificationIDCardOCR(1,res.tempFilePath);
  782. if(!resData.data.data) {
  783. uni.showModal({
  784. title:'提示',
  785. content:'身份证人像面照片异常,请重新上传',
  786. showCancel:false,
  787. })
  788. this.isUploading = false;
  789. return;
  790. }
  791. this.veryIdCard = resData.data.data.IdNum
  792. this.veryIdName = resData.data.data.IdName
  793. // if(this.form.idcard) {
  794. // if(this.form.idcard != this.veryIdCard) {
  795. // uni.showModal({
  796. // title:'提示',
  797. // content:'输入的身份证号和身份证人像面照片身份证号不匹配',
  798. // showCancel:false,
  799. // })
  800. // this.isUploading = false;
  801. // return;
  802. // }
  803. // }
  804. uni.downloadFile({
  805. url: this.$method.splitImgHost(this.form.recent_photos),
  806. success: (res) => {
  807. if (res.statusCode === 200) {
  808. console.log('下载成功');
  809. let fileSystem = uni.getFileSystemManager();
  810. fileSystem.readFile({
  811. filePath: res.tempFilePath,
  812. encoding: 'base64',
  813. position: 0,
  814. success:(res) => {
  815. let base64 = 'data:image/jpg;base64,' + res.data;
  816. let newdata = {
  817. urlA:this.form.idcard_face_photo,
  818. oneInchPhotos:base64
  819. }
  820. this.$api.faceCertificationIdCardCompareFace(newdata).then(res1 => {
  821. if(res1.data.data >= 70) {
  822. var self = this;
  823. if (self.remarkStatus) {
  824. var arsty = {};
  825. for (let k in data) {
  826. for (let j in self.copyData) {
  827. if (k === j) {
  828. if (self.copyData[j].value === data[k]) {
  829. arsty[k] = {
  830. fieldKey: k,
  831. value: data[k],
  832. fieldName: (function() {
  833. for (let i = 0; i < self.listData.length; i++) {
  834. if (self.listData[i].fieldKey == k) {
  835. return self.listData[i].fieldName;
  836. }
  837. }
  838. })(),
  839. status: 0
  840. };
  841. } else {
  842. arsty[k] = {
  843. fieldKey: k,
  844. value: data[k],
  845. fieldName: (function() {
  846. for (let i = 0; i < self.listData.length; i++) {
  847. if (self.listData[i].fieldKey == k) {
  848. return self.listData[i].fieldName;
  849. }
  850. }
  851. })(),
  852. status: 1
  853. };
  854. }
  855. }
  856. }
  857. }
  858. var datas = {
  859. id: this.id,
  860. goodsId: this.goodsId,
  861. orderGoodsId:this.orderGoodsId,
  862. keyValue: JSON.stringify(arsty)
  863. };
  864. console.log(datas,'datas0')
  865. // this.isUploading = false;
  866. // return;
  867. this.$api.editbaseprofiletp(datas).then(res => {
  868. this.isUploading = false;
  869. if (res.data.code === 200) {
  870. this.$method.showToast('提交成功');
  871. uni.navigateBack();
  872. } else {
  873. this.$method.showToast(res.data.msg);
  874. this.isUploading = false;
  875. }
  876. });
  877. } else {
  878. var objs = {};
  879. for (let k in data) {
  880. objs[k] = {
  881. fieldKey: k,
  882. value: data[k],
  883. fieldName: (function() {
  884. for (let i = 0; i < self.listData.length; i++) {
  885. if (self.listData[i].fieldKey == k) {
  886. return self.listData[i].fieldName;
  887. }
  888. }
  889. })(),
  890. status: 0
  891. };
  892. }
  893. var datas = {
  894. goodsId: this.goodsId,
  895. profileTpId: this.goodsId,
  896. orderGoodsId:this.orderGoodsId,
  897. keyValue: JSON.stringify(objs)
  898. };
  899. console.log(data,'datas')
  900. // this.isUploading = false;
  901. // return;
  902. this.$api.addbaseprofiletp(datas).then(res => {
  903. this.isUploading = false;
  904. if (res.data.code === 200) {
  905. this.$method.showToast('提交成功');
  906. uni.navigateBack();
  907. } else {
  908. this.$method.showToast(res.data.msg);
  909. this.isUploading = false;
  910. }
  911. });
  912. }
  913. } else {
  914. this.isUploading = false;
  915. uni.showModal({
  916. title:'提示',
  917. content:'个人近照和身份证人像面照片不匹配',
  918. showCancel:false,
  919. })
  920. }
  921. })
  922. },
  923. fail(err) {
  924. this.isUploading = false;
  925. console.error(err,'err')
  926. }
  927. })
  928. }
  929. }
  930. });
  931. }
  932. },
  933. })
  934. return
  935. }
  936. var self = this;
  937. if (self.remarkStatus) {
  938. var arsty = {};
  939. for (let k in data) {
  940. for (let j in self.copyData) {
  941. if (k === j) {
  942. if (self.copyData[j].value === data[k]) {
  943. arsty[k] = {
  944. fieldKey: k,
  945. value: data[k],
  946. fieldName: (function() {
  947. for (let i = 0; i < self.listData.length; i++) {
  948. if (self.listData[i].fieldKey == k) {
  949. return self.listData[i].fieldName;
  950. }
  951. }
  952. })(),
  953. status: 0
  954. };
  955. } else {
  956. arsty[k] = {
  957. fieldKey: k,
  958. value: data[k],
  959. fieldName: (function() {
  960. for (let i = 0; i < self.listData.length; i++) {
  961. if (self.listData[i].fieldKey == k) {
  962. return self.listData[i].fieldName;
  963. }
  964. }
  965. })(),
  966. status: 1
  967. };
  968. }
  969. }
  970. }
  971. }
  972. console.log(arsty,'arsty')
  973. if(Object.keys(arsty).length == 0) {
  974. uni.showModal({
  975. title:'提示',
  976. content:'数据错误,请联系管理员'
  977. })
  978. this.isUploading = false;
  979. return;
  980. }
  981. var datas = {
  982. id: this.id,
  983. goodsId: this.goodsId,
  984. orderGoodsId:this.orderGoodsId,
  985. keyValue: JSON.stringify(arsty)
  986. };
  987. console.log(datas,'datas1')
  988. // return;
  989. this.$api.editbaseprofiletp(datas).then(res => {
  990. this.isUploading = false;
  991. if (res.data.code === 200) {
  992. this.$method.showToast('提交成功');
  993. uni.navigateBack();
  994. } else {
  995. this.$method.showToast(res.data.msg);
  996. this.isUploading = false;
  997. }
  998. });
  999. } else {
  1000. var objs = {};
  1001. for (let k in data) {
  1002. objs[k] = {
  1003. fieldKey: k,
  1004. value: data[k],
  1005. fieldName: (function() {
  1006. for (let i = 0; i < self.listData.length; i++) {
  1007. if (self.listData[i].fieldKey == k) {
  1008. return self.listData[i].fieldName;
  1009. }
  1010. }
  1011. })(),
  1012. status: 0
  1013. };
  1014. }
  1015. var datas = {
  1016. goodsId: this.goodsId,
  1017. profileTpId: this.goodsId,
  1018. orderGoodsId:this.orderGoodsId,
  1019. keyValue: JSON.stringify(objs)
  1020. };
  1021. console.log(datas,'datas2')
  1022. // this.isUploading = false;
  1023. // return;
  1024. this.$api.addbaseprofiletp(datas).then(res => {
  1025. this.isUploading = false;
  1026. if (res.data.code === 200) {
  1027. this.$method.showToast('提交成功');
  1028. uni.navigateBack();
  1029. } else {
  1030. this.$method.showToast(res.data.msg);
  1031. this.isUploading = false;
  1032. }
  1033. }).catch(err => {});
  1034. }
  1035. },
  1036. backPage() {
  1037. uni.navigateBack();
  1038. },
  1039. //提交表单
  1040. async submitApi() {
  1041. var data = JSON.parse(JSON.stringify(this.form));
  1042. if (data['sex']) {
  1043. data.sex = this.dictObj['sys_user_sex'][Number(data.sex)];
  1044. }
  1045. if (data['education']) {
  1046. data.education = this.dictObj['edu_level'][Number(data.education)];
  1047. }
  1048. if (data['working_years']) {
  1049. data.working_years = this.dictObj['working_years'][Number(data.working_years)];
  1050. }
  1051. if (data['recent_photos']) {
  1052. data.recent_photos = await this.$method.uploadFile(data.recent_photos, 0);
  1053. }
  1054. if (data['idcard_face_photo']) {
  1055. console.log('idcard_face_photo')
  1056. data.idcard_face_photo = await this.$method.uploadFile(data.idcard_face_photo, 0);
  1057. }
  1058. if (data['idcard_national_photo']) {
  1059. data.idcard_national_photo = await this.$method.uploadFile(data.idcard_national_photo, 0);
  1060. }
  1061. if (data['commitment_electr_signature']) {
  1062. data.commitment_electr_signature = await this.$method.uploadFile(data.commitment_electr_signature, 0);
  1063. }
  1064. if (data['commitment_seal']) {
  1065. data.commitment_seal = await this.$method.uploadFile(data.commitment_seal, 0);
  1066. }
  1067. this.uploadDatas(data);
  1068. },
  1069. //验证表单
  1070. resultForm(int) {
  1071. console.log(this.openVerify,'openVerify')
  1072. console.log(this.isRequired,'isRequired')
  1073. if (this.openVerify) {
  1074. if (this.isRequired) {
  1075. this.submitApi();
  1076. } else {
  1077. if(int === 1) {
  1078. this.errorType = ['toast'];
  1079. } else {
  1080. this.errorType = ['message'];
  1081. }
  1082. this.$nextTick(() => {
  1083. this.$refs.uForm.validate(valid => {
  1084. if (valid) {
  1085. if (int === 1) {
  1086. this.submitApi();
  1087. }
  1088. } else {
  1089. this.isUploading = false;
  1090. this.errorType = ['message'];
  1091. console.log(this.form)
  1092. console.log('验证失败');
  1093. }
  1094. });
  1095. })
  1096. }
  1097. }
  1098. },
  1099. async submits() {
  1100. if(this.isUploading) {
  1101. return;
  1102. }
  1103. this.isUploading = true;
  1104. var ast = this.listData.some(item => {
  1105. return item.fieldKey === 'commitment_electr_signature';
  1106. });
  1107. if (ast) {
  1108. await this.subCanvas();
  1109. }
  1110. this.openVerify = true;
  1111. this.resultForm(1);
  1112. },
  1113. faceCertificationIDCardOCR(cardSide,url) {
  1114. return new Promise(resolve => {
  1115. let fileSystem = uni.getFileSystemManager();
  1116. fileSystem.readFile({
  1117. filePath: url,
  1118. encoding: 'base64',
  1119. position: 0,
  1120. success:(res) => {
  1121. let base64 = 'data:image/jpg;base64,' + res.data;
  1122. this.$api.faceCertificationIDCardOCR({
  1123. cardSide:cardSide, //1人像 2 国徽
  1124. cardImageBase64:base64,
  1125. gradeId:this.gradeId
  1126. }).then(res => {
  1127. resolve(res)
  1128. })
  1129. },
  1130. fail(err) {
  1131. console.error(err,'err')
  1132. }
  1133. })
  1134. })
  1135. },
  1136. async changePhotoListHeader1(lists, name) {
  1137. console.log(lists)
  1138. if (lists.length) {
  1139. this.fileList1 = lists;
  1140. console.log(lists,'lists1')
  1141. if (lists[0].url.indexOf('//tmp') !== -1 || lists[0].url.indexOf('//temp') !== -1) {
  1142. this.$set(this.form, 'recent_photos', await this.$method.imageInfos(lists[0].url));
  1143. }
  1144. } else {
  1145. this.fileList1 = [];
  1146. this.$set(this.form, 'recent_photos', '');
  1147. console.log(3, this.form.recent_photos);
  1148. }
  1149. this.openVerify = false;
  1150. this.$nextTick(function() {
  1151. console.log(4);
  1152. this.resultForm();
  1153. });
  1154. },
  1155. async changePhotoListHeader2(lists, name) {
  1156. if (lists.length) {
  1157. this.fileList2 = lists;
  1158. if (lists[0].url.indexOf('//tmp') !== -1 || lists[0].url.indexOf('//temp') !== -1) {
  1159. let url = lists[0].url
  1160. this.$refs.idcard_face_photo[0].remove(0)
  1161. uni.compressImage({
  1162. src: url,
  1163. quality: 75,
  1164. width: '50%',
  1165. height: '50%',
  1166. success: async rest => {
  1167. let res = await this.faceCertificationIDCardOCR(1,rest.tempFilePath);
  1168. if(res.data.code == 500) {
  1169. uni.showToast({
  1170. icon:'none',
  1171. title:'请上传正确清晰的身份证人像面照片'
  1172. })
  1173. return;
  1174. }
  1175. this.$refs.idcard_face_photo[0].lists = [{
  1176. url:this.$method.splitImgHost(res.data.data.IdImgPath)
  1177. }];
  1178. this.$set(this.form, 'idcard_face_photo', res.data.data.IdImgPath);
  1179. console.log(this.form,'idcard_face_photo')
  1180. }
  1181. });
  1182. }
  1183. } else {
  1184. this.fileList2 = [];
  1185. this.$set(this.form, 'idcard_face_photo', '');
  1186. }
  1187. this.openVerify = false;
  1188. this.$nextTick(function() {
  1189. this.resultForm();
  1190. });
  1191. },
  1192. async changePhotoListHeader3(lists, name) {
  1193. if (lists.length) {
  1194. this.fileList3 = lists;
  1195. if (lists[0].url.indexOf('//tmp') !== -1 || lists[0].url.indexOf('//temp') !== -1) {
  1196. console.log('//tem')
  1197. let url = lists[0].url
  1198. this.$refs.idcard_national_photo[0].remove(0)
  1199. uni.compressImage({
  1200. src: url,
  1201. quality: 75,
  1202. width: '50%',
  1203. height: '50%',
  1204. success: async rest => {
  1205. let res = await this.faceCertificationIDCardOCR(2,rest.tempFilePath);
  1206. if(res.data.code == 500) {
  1207. uni.showToast({
  1208. icon:'none',
  1209. title:'请上传正确清晰的身份证国徽面照片'
  1210. })
  1211. return;
  1212. }
  1213. this.$refs.idcard_national_photo[0].lists = [{
  1214. url:this.$method.splitImgHost(res.data.data.IdImgPath)
  1215. }];
  1216. this.$set(this.form, 'idcard_national_photo', res.data.data.IdImgPath);
  1217. console.log(this.form,'idcard_national_photo')
  1218. }
  1219. });
  1220. }
  1221. } else {
  1222. this.fileList3 = [];
  1223. this.$set(this.form, 'idcard_national_photo', '');
  1224. }
  1225. this.openVerify = false;
  1226. this.$nextTick(function() {
  1227. this.resultForm();
  1228. });
  1229. },
  1230. getTimes(key) {
  1231. if (this.form[key]) {
  1232. return this.form[key];
  1233. } else {
  1234. return '请选择时间';
  1235. }
  1236. },
  1237. getarrays(key) {
  1238. if (key === 'sex') {
  1239. return this.dictObj['sys_user_sex'];
  1240. }
  1241. if (key === 'education') {
  1242. return this.dictObj['edu_level'];
  1243. }
  1244. if (key === 'working_years') {
  1245. return this.dictObj['working_years'];
  1246. }
  1247. },
  1248. returnName(key) {
  1249. if (key === 'sex') {
  1250. if (this.form[key]) {
  1251. return this.dictObj['sys_user_sex'][Number(this.form[key])];
  1252. } else {
  1253. return '请选择性别';
  1254. }
  1255. }
  1256. if (key === 'education') {
  1257. if (this.form[key]) {
  1258. return this.dictObj['edu_level'][Number(this.form[key])];
  1259. } else {
  1260. return '请选择学历';
  1261. }
  1262. }
  1263. if (key === 'working_years') {
  1264. if (this.form[key]) {
  1265. return this.dictObj['working_years'][Number(this.form[key])];
  1266. } else {
  1267. return '请选择工作年限';
  1268. }
  1269. }
  1270. },
  1271. /**
  1272. * getbaseprofiletpgetInfo接口返回值result.data.data不存在的话说明是第一次填写资料
  1273. */
  1274. getInfo() {
  1275. console.log('getInfo')
  1276. var self = this;
  1277. this.$api.getbaseprofiletpId(this.goodsId).then(res => {
  1278. self.listData = JSON.parse(res.data.data.keyValue);
  1279. var ast = JSON.parse(res.data.data.keyValue2);
  1280. self.listData = [...self.listData,...ast]
  1281. console.log(self.listData,'listData')
  1282. self.listData.forEach(item => {
  1283. if(item.fieldKey == "idcard") {
  1284. this.form.idcard = this.userInfo.idCard;
  1285. }
  1286. if(item.fieldKey == "telphone") {
  1287. this.form.telphone = this.userInfo.telphone;
  1288. }
  1289. if(item.fieldKey == "name") {
  1290. this.form.name = this.userInfo.realname
  1291. }
  1292. })
  1293. self.isRequired = self.listData.every(ims => {
  1294. return ims.required === false;
  1295. });
  1296. console.log(self.isRequired ,'self.isRequired ')
  1297. this.$nextTick(() => {
  1298. this.agreementModal = true;
  1299. })
  1300. self.$api.getbaseprofiletpgetInfo({ goodsId: self.goodsId ,orderGoodsId:self.orderGoodsId}).then(result => {
  1301. if (result.data.code === 200) {
  1302. if (!result.data.data) {
  1303. self.$api.getbaseprofiletplistProfile({ pageNum: 1, pageSize: 1, status: 1 }).then(kit => {
  1304. if (kit.data.rows.length) {
  1305. var ajson = JSON.parse(kit.data.rows[0].keyValue);
  1306. self.listData.forEach((zyitem, zyindex) => {
  1307. for (let k in ajson) {
  1308. if (zyitem.fieldKey == k && ajson[k].value) {
  1309. if (k === 'sex') {
  1310. const sexIndex = self.dictObj['sys_user_sex'].indexOf(ajson[k].value) + '';
  1311. self.$set(self.form, k, sexIndex);
  1312. } else if (k === 'education') {
  1313. const sexIndex = self.dictObj['edu_level'].indexOf(ajson[k].value) + '';
  1314. self.$set(self.form, k, sexIndex);
  1315. } else if (k === 'working_years') {
  1316. const sexIndex = self.dictObj['working_years'].indexOf(ajson[k].value) + '';
  1317. self.$set(self.form, k, sexIndex);
  1318. } else if (k === 'recent_photos') {
  1319. self.$set(self.form, k, ajson[k].value);
  1320. if (ajson[k].value) {
  1321. self.fileList1 = [{ url: baseUrls.BASE_IMG_URL + ajson[k].value }];
  1322. }
  1323. } else if (k === 'idcard_face_photo') {
  1324. self.$set(self.form, k, ajson[k].value);
  1325. if (ajson[k].value) {
  1326. self.fileList2 = [{ url: baseUrls.BASE_IMG_URL + ajson[k].value }];
  1327. }
  1328. } else if (k === 'idcard_national_photo') {
  1329. self.$set(self.form, k, ajson[k].value);
  1330. if (ajson[k].value) {
  1331. self.fileList3 = [{ url: baseUrls.BASE_IMG_URL + ajson[k].value }];
  1332. }
  1333. } else {
  1334. if(k === 'name'){
  1335. self.$set(self.form, k, this.$store.state.userInfo.realname);
  1336. } else if(k === 'idcard'){
  1337. self.$set(self.form, k, this.$store.state.userInfo.idCard);
  1338. } else if(k === 'telphone'){
  1339. self.$set(self.form, k, this.$store.state.userInfo.telphone);
  1340. } else if(k !== 'commitment_electr_signature'){
  1341. self.$set(self.form, k, ajson[k].value);
  1342. }
  1343. }
  1344. }
  1345. }
  1346. });
  1347. }
  1348. });
  1349. }
  1350. console.log(result.data.data,'result.data.data')
  1351. if (result.data.data && result.data.data.status === 3) {
  1352. self.remark = result.data.data.text;
  1353. self.remarkStatus = true;
  1354. self.id = result.data.data.id;
  1355. console.log(result.data.data,'result.data.data')
  1356. var arrays = JSON.parse(result.data.data.keyValue);
  1357. // var arrays1 = JSON.parse(result.data.data.keyValue2);
  1358. self.copyData = JSON.parse(JSON.stringify(arrays));
  1359. for (let k in arrays) {
  1360. if (k === 'sex') {
  1361. if (arrays[k].value) {
  1362. const sexIndex = self.dictObj['sys_user_sex'].indexOf(arrays[k].value) + '';
  1363. self.$set(self.form, k, sexIndex);
  1364. }
  1365. } else if (k === 'education') {
  1366. if (arrays[k].value) {
  1367. const sexIndex = self.dictObj['edu_level'].indexOf(arrays[k].value) + '';
  1368. self.$set(self.form, k, sexIndex);
  1369. }
  1370. } else if (k === 'working_years') {
  1371. if (arrays[k].value) {
  1372. const sexIndex = self.dictObj['working_years'].indexOf(arrays[k].value) + '';
  1373. self.$set(self.form, k, sexIndex);
  1374. }
  1375. } else if (k === 'recent_photos') {
  1376. self.$set(self.form, k, arrays[k].value);
  1377. if (arrays[k].value) {
  1378. self.fileList1 = [{ url: baseUrls.BASE_IMG_URL + arrays[k].value }];
  1379. }
  1380. } else if (k === 'idcard_face_photo') {
  1381. self.$set(self.form, k, arrays[k].value);
  1382. if (arrays[k].value) {
  1383. self.fileList2 = [{ url: baseUrls.BASE_IMG_URL + arrays[k].value }];
  1384. }
  1385. } else if (k === 'idcard_national_photo') {
  1386. self.$set(self.form, k, arrays[k].value);
  1387. if (arrays[k].value) {
  1388. self.fileList3 = [{ url: baseUrls.BASE_IMG_URL + arrays[k].value }];
  1389. }
  1390. } else {
  1391. self.$set(self.form, k, arrays[k].value);
  1392. }
  1393. }
  1394. } else if (result.data.data && (result.data.data.status === 1 || result.data.data.status === 2)) {
  1395. uni.showModal({
  1396. showCancel: false,
  1397. content:
  1398. result.data.data.status === 1
  1399. ? '该商品审核资料已通过,不可重复提交资料'
  1400. : result.data.data.status === 2
  1401. ? '该商品审核资料处于待审核状态,不可重复提交资料'
  1402. : '请联系管理员',
  1403. success: function(k) {
  1404. if (k.confirm) {
  1405. uni.navigateBack();
  1406. }
  1407. }
  1408. });
  1409. }
  1410. }
  1411. });
  1412. });
  1413. },
  1414. bindPickerChange(key, e) {
  1415. this.$set(this.form, key, e.detail.value);
  1416. this.openVerify = false;
  1417. this.$nextTick(function() {
  1418. this.resultForm();
  1419. });
  1420. },
  1421. bindDateChange(key, e) {
  1422. this.form[key] = e.detail.value;
  1423. },
  1424. retDraw() {
  1425. this.handwriting.retDraw();
  1426. this.$set(this.form, 'commitment_electr_signature', '');
  1427. this.openVerify = false;
  1428. this.$nextTick(function() {
  1429. this.resultForm();
  1430. });
  1431. },
  1432. uploadScaleStart(event) {
  1433. this.handwriting.uploadScaleStart(event);
  1434. },
  1435. uploadScaleMove(event) {
  1436. this.handwriting.uploadScaleMove(event);
  1437. },
  1438. uploadScaleEnd(event) {
  1439. this.handwriting.uploadScaleEnd(event);
  1440. },
  1441. subCanvas() {
  1442. return new Promise((resolve, reject) => {
  1443. var self = this;
  1444. if (self.form.commitment_electr_signature) {
  1445. resolve();
  1446. return;
  1447. }
  1448. self.handwriting
  1449. .saveCanvas()
  1450. .then(res => {
  1451. if (this.handwriting.linePrack.length) {
  1452. this.$set(this.form, 'commitment_electr_signature', res);
  1453. }
  1454. resolve(res);
  1455. })
  1456. .catch(err => {
  1457. uni.showToast({
  1458. title: '签名上传失败',
  1459. icon: 'error'
  1460. });
  1461. this.isUploading = false;
  1462. });
  1463. });
  1464. }
  1465. }
  1466. };
  1467. </script>
  1468. <style>
  1469. page {
  1470. background: #eaeef1;
  1471. }
  1472. </style>
  1473. <style scope lang="scss">
  1474. .ctoples {
  1475. position: absolute;
  1476. top: 0;
  1477. left: 0;
  1478. padding: 2rpx 23rpx;
  1479. display: inline-block;
  1480. background-color: rgba(0, 0, 0, 0.4);
  1481. font-size: 28rpx;
  1482. color: #fff;
  1483. border-bottom-right-radius: 24rpx;
  1484. }
  1485. .handWriting {
  1486. width: 100%;
  1487. height: 100%;
  1488. }
  1489. /deep/ .u-collapse-title {
  1490. color: #FF3B30;
  1491. font-size: 24rpx;
  1492. }
  1493. .collapse-item {
  1494. color: #666;
  1495. font-size: 24rpx;
  1496. padding-bottom: 30rpx;
  1497. }
  1498. .dis_stys {
  1499. display: flex;
  1500. align-items: center;
  1501. justify-content: space-between;
  1502. }
  1503. .handCenter {
  1504. background: #f7f7f7;
  1505. border: 2rpx solid #eeeeee;
  1506. border-radius: 24rpx;
  1507. width: 100%;
  1508. height: 300rpx;
  1509. overflow: hidden;
  1510. }
  1511. .headerSDels {
  1512. height: 58rpx;
  1513. padding: 0rpx 24rpx;
  1514. font-weight: bold;
  1515. display: flex;
  1516. align-items: center;
  1517. flex-direction: row-reverse;
  1518. }
  1519. .listBox {
  1520. margin: 24rpx 32rpx 0rpx;
  1521. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1522. border-radius: 32rpx;
  1523. background-color: #fff;
  1524. overflow: hidden;
  1525. }
  1526. .imgBoxs {
  1527. width: 156rpx;
  1528. height: 203rpx;
  1529. }
  1530. .imgBoxs2 {
  1531. width: 171rpx;
  1532. height: 108rpx;
  1533. }
  1534. .submit_btn {
  1535. width: 526rpx;
  1536. height: 80rpx;
  1537. background: #007aff;
  1538. border-radius: 40rpx;
  1539. text-align: center;
  1540. line-height: 80rpx;
  1541. color: #ffffff;
  1542. margin: 30rpx auto;
  1543. }
  1544. .picker {
  1545. text-align: right;
  1546. }
  1547. input {
  1548. text-align: right;
  1549. }
  1550. .bodyBox {
  1551. background: #ffffff;
  1552. border-radius: 24rpx;
  1553. width: 100%;
  1554. }
  1555. .topBox {
  1556. height: 80rpx;
  1557. background: #ffffff;
  1558. border-radius: 24rpx;
  1559. width: 100%;
  1560. display: flex;
  1561. justify-content: space-between;
  1562. line-height: 80rpx;
  1563. padding: 0 20rpx;
  1564. font-size: 24rpx;
  1565. }
  1566. .modal {
  1567. .agreement {
  1568. width: 640rpx;
  1569. height: 740rpx;
  1570. background: #FFFFFF;
  1571. display: flex;
  1572. flex-direction: column;
  1573. .body {
  1574. flex:1;
  1575. .content {
  1576. padding:30rpx 40rpx 28rpx;
  1577. line-height: 40rpx;
  1578. font-size: 26rpx;
  1579. color:#666;
  1580. .bold {
  1581. color:#333;
  1582. font-size: 26rpx;
  1583. font-weight: bold;
  1584. }
  1585. .center {
  1586. text-align: center;
  1587. }
  1588. }
  1589. }
  1590. .footer {
  1591. height:140rpx;
  1592. border-top:1px solid #EEEEEE;
  1593. display: flex;
  1594. align-items: center;
  1595. justify-content: center;
  1596. .btn {
  1597. margin:0 12rpx;
  1598. width: 200rpx;
  1599. height: 80rpx;
  1600. color:#007AFF;
  1601. font-size: 30rpx;
  1602. text-align: center;
  1603. line-height: 80rpx;
  1604. background: #F5F5F5;
  1605. border-radius: 40rpx 40rpx 40rpx 40rpx;
  1606. &.ok {
  1607. width: 336rpx;
  1608. height: 80rpx;
  1609. background: #007AFF;
  1610. color:#fff;
  1611. }
  1612. &.close {
  1613. color:#fff;
  1614. width: 560rpx;
  1615. height: 80rpx;
  1616. background: #007AFF;
  1617. border-radius: 40rpx 40rpx 40rpx 40rpx;
  1618. }
  1619. }
  1620. }
  1621. }
  1622. }
  1623. </style>