input.vue 68 KB

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