input.vue 67 KB

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