input.vue 68 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071
  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. <u-upload
  248. :show-progress="false"
  249. :max-size="2097152"
  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. cahngeText() {
  983. this.$set(this.form, "name", "唐");
  984. console.log(this.form.name, 123);
  985. },
  986. async uploadDatas(data) {
  987. console.log('sfsfg---data', data)
  988. if (this.form.recent_photos && this.form.idcard_face_photo) {
  989. uni.downloadFile({
  990. url: this.$method.splitImgHost(this.form.idcard_face_photo),
  991. success: async (res) => {
  992. if (res.statusCode === 200) {
  993. let resData = await this.faceCertificationIDCardOCR(
  994. 1,
  995. res.tempFilePath
  996. );
  997. if (!resData.data.data) {
  998. uni.showModal({
  999. title: "提示",
  1000. content: "身份证人像面照片异常,请重新上传",
  1001. showCancel: false,
  1002. });
  1003. this.isUploading = false;
  1004. return;
  1005. }
  1006. this.veryIdCard = resData.data.data.IdNum;
  1007. this.veryIdName = resData.data.data.IdName;
  1008. // if(this.form.idcard) {
  1009. // if(this.form.idcard != this.veryIdCard) {
  1010. // uni.showModal({
  1011. // title:'提示',
  1012. // content:'输入的身份证号和身份证人像面照片身份证号不匹配',
  1013. // showCancel:false,
  1014. // })
  1015. // this.isUploading = false;
  1016. // return;
  1017. // }
  1018. // }
  1019. uni.downloadFile({
  1020. url: this.$method.splitImgHost(this.form.recent_photos),
  1021. success: (res) => {
  1022. if (res.statusCode === 200) {
  1023. console.log("下载成功");
  1024. let fileSystem = uni.getFileSystemManager();
  1025. fileSystem.readFile({
  1026. filePath: res.tempFilePath,
  1027. encoding: "base64",
  1028. position: 0,
  1029. success: (res) => {
  1030. let base64 = "data:image/jpg;base64," + res.data;
  1031. let newdata = {
  1032. urlA: this.form.idcard_face_photo,
  1033. oneInchPhotos: base64,
  1034. };
  1035. this.$api
  1036. .faceCertificationIdCardCompareFace(newdata)
  1037. .then((res1) => {
  1038. if (res1.data.data >= 70) {
  1039. var self = this;
  1040. if (self.remarkStatus) {
  1041. var arsty = {};
  1042. for (let k in data) {
  1043. for (let j in self.copyData) {
  1044. if (k === j) {
  1045. if (self.copyData[j].value === data[k]) {
  1046. arsty[k] = {
  1047. fieldKey: k,
  1048. value: data[k],
  1049. fieldName: (function () {
  1050. for (
  1051. let i = 0;
  1052. i < self.listData.length;
  1053. i++
  1054. ) {
  1055. if (
  1056. self.listData[i].fieldKey == k
  1057. ) {
  1058. return self.listData[i]
  1059. .fieldName;
  1060. }
  1061. }
  1062. })(),
  1063. status: 0,
  1064. };
  1065. } else {
  1066. arsty[k] = {
  1067. fieldKey: k,
  1068. value: data[k],
  1069. fieldName: (function () {
  1070. for (
  1071. let i = 0;
  1072. i < self.listData.length;
  1073. i++
  1074. ) {
  1075. if (
  1076. self.listData[i].fieldKey == k
  1077. ) {
  1078. return self.listData[i]
  1079. .fieldName;
  1080. }
  1081. }
  1082. })(),
  1083. status: 1,
  1084. };
  1085. }
  1086. }
  1087. }
  1088. }
  1089. var datas = {
  1090. id: this.id,
  1091. goodsId: this.goodsId,
  1092. orderGoodsId: this.orderGoodsId,
  1093. keyValue: JSON.stringify(arsty),
  1094. };
  1095. console.log(datas, "datas0");
  1096. // this.isUploading = false;
  1097. // return;
  1098. this.$api
  1099. .editbaseprofiletp(datas)
  1100. .then((res) => {
  1101. this.isUploading = false;
  1102. if (res.data.code === 200) {
  1103. this.$method.showToast("提交成功");
  1104. this.getUserInfo();
  1105. setTimeout(() => {
  1106. console.log('延迟')
  1107. uni.navigateBack();
  1108. }, 1500)
  1109. } else {
  1110. this.$method.showToast(res.data.msg);
  1111. this.isUploading = false;
  1112. }
  1113. });
  1114. } else {
  1115. var objs = {};
  1116. for (let k in data) {
  1117. objs[k] = {
  1118. fieldKey: k,
  1119. value: data[k],
  1120. fieldName: (function () {
  1121. for (
  1122. let i = 0;
  1123. i < self.listData.length;
  1124. i++
  1125. ) {
  1126. if (self.listData[i].fieldKey == k) {
  1127. return self.listData[i].fieldName;
  1128. }
  1129. }
  1130. })(),
  1131. status: 0,
  1132. };
  1133. }
  1134. var datas = {
  1135. goodsId: this.goodsId,
  1136. profileTpId: this.goodsId,
  1137. orderGoodsId: this.orderGoodsId,
  1138. keyValue: JSON.stringify(objs),
  1139. };
  1140. console.log(data, "datas");
  1141. // this.isUploading = false;
  1142. // return;
  1143. this.$api
  1144. .addbaseprofiletp(datas)
  1145. .then((res) => {
  1146. this.isUploading = false;
  1147. if (res.data.code === 200) {
  1148. this.$method.showToast("提交成功");
  1149. this.getUserInfo();
  1150. setTimeout(() => {
  1151. console.log('延迟')
  1152. uni.navigateBack();
  1153. }, 1500)
  1154. } else {
  1155. this.$method.showToast(res.data.msg);
  1156. this.isUploading = false;
  1157. }
  1158. });
  1159. }
  1160. } else {
  1161. this.isUploading = false;
  1162. uni.showModal({
  1163. title: "提示",
  1164. content: "个人近照和身份证人像面照片不匹配",
  1165. showCancel: false,
  1166. });
  1167. }
  1168. });
  1169. },
  1170. fail(err) {
  1171. this.isUploading = false;
  1172. console.error(err, "err");
  1173. },
  1174. });
  1175. }
  1176. },
  1177. });
  1178. }
  1179. },
  1180. });
  1181. return;
  1182. }
  1183. var self = this;
  1184. if (self.remarkStatus) {
  1185. var arsty = {};
  1186. for (let k in data) {
  1187. for (let j in self.copyData) {
  1188. if (k === j) {
  1189. if (self.copyData[j].value === data[k]) {
  1190. arsty[k] = {
  1191. fieldKey: k,
  1192. value: data[k],
  1193. fieldName: (function () {
  1194. for (let i = 0; i < self.listData.length; i++) {
  1195. if (self.listData[i].fieldKey == k) {
  1196. return self.listData[i].fieldName;
  1197. }
  1198. }
  1199. })(),
  1200. status: 0,
  1201. };
  1202. } else {
  1203. arsty[k] = {
  1204. fieldKey: k,
  1205. value: data[k],
  1206. fieldName: (function () {
  1207. for (let i = 0; i < self.listData.length; i++) {
  1208. if (self.listData[i].fieldKey == k) {
  1209. return self.listData[i].fieldName;
  1210. }
  1211. }
  1212. })(),
  1213. status: 1,
  1214. };
  1215. }
  1216. }
  1217. }
  1218. }
  1219. console.log(arsty, "arsty");
  1220. if (Object.keys(arsty).length == 0) {
  1221. uni.showModal({
  1222. title: "提示",
  1223. content: "数据错误,请联系管理员",
  1224. });
  1225. this.isUploading = false;
  1226. return;
  1227. }
  1228. var datas = {
  1229. id: this.id,
  1230. goodsId: this.goodsId,
  1231. orderGoodsId: this.orderGoodsId,
  1232. keyValue: JSON.stringify(arsty),
  1233. };
  1234. console.log(datas, "datas1");
  1235. // return;
  1236. this.$api.editbaseprofiletp(datas).then((res) => {
  1237. this.isUploading = false;
  1238. if (res.data.code === 200) {
  1239. this.$method.showToast("提交成功");
  1240. this.getUserInfo();
  1241. setTimeout(() => {
  1242. console.log('延迟')
  1243. uni.navigateBack();
  1244. }, 1500)
  1245. } else {
  1246. this.$method.showToast(res.data.msg);
  1247. this.isUploading = false;
  1248. }
  1249. });
  1250. } else {
  1251. var objs = {};
  1252. for (let k in data) {
  1253. objs[k] = {
  1254. fieldKey: k,
  1255. value: data[k],
  1256. fieldName: (function () {
  1257. for (let i = 0; i < self.listData.length; i++) {
  1258. if (self.listData[i].fieldKey == k) {
  1259. return self.listData[i].fieldName;
  1260. }
  1261. }
  1262. })(),
  1263. status: 0,
  1264. };
  1265. }
  1266. var datas = {
  1267. goodsId: this.goodsId,
  1268. profileTpId: this.goodsId,
  1269. orderGoodsId: this.orderGoodsId,
  1270. keyValue: JSON.stringify(objs),
  1271. };
  1272. console.log(datas, "datas2");
  1273. // this.isUploading = false;
  1274. // return;
  1275. this.$api
  1276. .addbaseprofiletp(datas)
  1277. .then((res) => {
  1278. this.isUploading = false;
  1279. if (res.data.code === 200) {
  1280. this.$method.showToast("提交成功");
  1281. this.getUserInfo();
  1282. setTimeout(() => {
  1283. console.log('延迟')
  1284. uni.navigateBack();
  1285. }, 1500)
  1286. } else {
  1287. this.$method.showToast(res.data.msg);
  1288. this.isUploading = false;
  1289. }
  1290. })
  1291. .catch((err) => {});
  1292. }
  1293. },
  1294. clearWord() {
  1295. this.$set(this.form, "commitment_seal", "");
  1296. this.titleName = "";
  1297. },
  1298. //提交表单
  1299. async submitApi() {
  1300. var data = JSON.parse(JSON.stringify(this.form));
  1301. if (data["sex"]) {
  1302. data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
  1303. }
  1304. if (data["education"]) {
  1305. data.education = this.dictObj["edu_level"][Number(data.education)];
  1306. }
  1307. if (data["working_years"]) {
  1308. data.working_years =
  1309. this.dictObj["working_years"][Number(data.working_years)];
  1310. }
  1311. if (data["recent_photos"]) {
  1312. data.recent_photos = await this.$method.uploadFile(
  1313. data.recent_photos,
  1314. 0
  1315. );
  1316. }
  1317. if (data["idcard_face_photo"]) {
  1318. console.log("idcard_face_photo");
  1319. data.idcard_face_photo = await this.$method.uploadFile(
  1320. data.idcard_face_photo,
  1321. 0
  1322. );
  1323. }
  1324. if (data["idcard_national_photo"]) {
  1325. data.idcard_national_photo = await this.$method.uploadFile(
  1326. data.idcard_national_photo,
  1327. 0
  1328. );
  1329. }
  1330. if (data["commitment_electr_signature"]) {
  1331. data.commitment_electr_signature = await this.$method.uploadFile(
  1332. data.commitment_electr_signature,
  1333. 0
  1334. );
  1335. }
  1336. if (data["commitment_seal"]) {
  1337. data.commitment_seal = await this.$method.uploadFile(
  1338. data.commitment_seal,
  1339. 0
  1340. );
  1341. }
  1342. this.uploadDatas(data);
  1343. },
  1344. //验证表单
  1345. resultForm(int) {
  1346. console.log(this.openVerify, "openVerify");
  1347. console.log(this.isRequired, "isRequired");
  1348. if (this.openVerify) {
  1349. if (this.isRequired) {
  1350. this.submitApi();
  1351. } else {
  1352. if (int === 1) {
  1353. this.errorType = ["toast"];
  1354. } else {
  1355. this.errorType = ["message"];
  1356. }
  1357. this.$nextTick(() => {
  1358. this.$refs.uForm.validate((valid) => {
  1359. if (valid) {
  1360. if (int === 1) {
  1361. this.submitApi();
  1362. }
  1363. } else {
  1364. this.isUploading = false;
  1365. this.errorType = ["message"];
  1366. console.log(this.form);
  1367. console.log("验证失败");
  1368. }
  1369. });
  1370. });
  1371. }
  1372. }
  1373. },
  1374. async submits() {
  1375. if (this.isUploading) {
  1376. return;
  1377. }
  1378. this.isUploading = true;
  1379. var ast = this.listData.some((item) => {
  1380. return item.fieldKey === "commitment_electr_signature";
  1381. });
  1382. if (ast) {
  1383. await this.subCanvas();
  1384. }
  1385. this.openVerify = true;
  1386. this.resultForm(1);
  1387. },
  1388. faceCertificationIDCardOCR(cardSide, url) {
  1389. return new Promise((resolve) => {
  1390. let fileSystem = uni.getFileSystemManager();
  1391. fileSystem.readFile({
  1392. filePath: url,
  1393. encoding: "base64",
  1394. position: 0,
  1395. success: (res) => {
  1396. let base64 = "data:image/jpg;base64," + res.data;
  1397. this.$api
  1398. .faceCertificationIDCardOCR({
  1399. cardSide: cardSide, //1人像 2 国徽
  1400. cardImageBase64: base64,
  1401. gradeId: this.gradeId,
  1402. })
  1403. .then((res) => {
  1404. resolve(res);
  1405. });
  1406. },
  1407. fail(err) {
  1408. console.error(err, "err");
  1409. },
  1410. });
  1411. });
  1412. },
  1413. async changePhotoListHeader1(lists, name) {
  1414. console.log(lists);
  1415. if (lists.length) {
  1416. this.fileList1 = lists;
  1417. console.log(lists, "lists1");
  1418. if (
  1419. lists[0].url.indexOf("//tmp") !== -1 ||
  1420. lists[0].url.indexOf("//temp") !== -1
  1421. ) {
  1422. this.$set(
  1423. this.form,
  1424. "recent_photos",
  1425. await this.$method.imageInfos(lists[0].url)
  1426. );
  1427. }
  1428. } else {
  1429. this.fileList1 = [];
  1430. this.$set(this.form, "recent_photos", "");
  1431. console.log(3, this.form.recent_photos);
  1432. }
  1433. this.openVerify = false;
  1434. this.$nextTick(function () {
  1435. console.log(4);
  1436. this.resultForm();
  1437. });
  1438. },
  1439. async changePhotoListHeader2(lists, name) {
  1440. if (lists.length) {
  1441. this.fileList2 = lists;
  1442. if (
  1443. lists[0].url.indexOf("//tmp") !== -1 ||
  1444. lists[0].url.indexOf("//temp") !== -1
  1445. ) {
  1446. let url = lists[0].url;
  1447. this.$refs.idcard_face_photo[0].remove(0);
  1448. uni.compressImage({
  1449. src: url,
  1450. quality: 75,
  1451. width: "50%",
  1452. height: "50%",
  1453. success: async (rest) => {
  1454. let res = await this.faceCertificationIDCardOCR(
  1455. 1,
  1456. rest.tempFilePath
  1457. );
  1458. if (res.data.code == 500) {
  1459. uni.showToast({
  1460. icon: "none",
  1461. title: "请上传正确清晰的身份证人像面照片",
  1462. });
  1463. return;
  1464. }
  1465. this.$refs.idcard_face_photo[0].lists = [
  1466. {
  1467. url: this.$method.splitImgHost(res.data.data.IdImgPath),
  1468. },
  1469. ];
  1470. this.$set(
  1471. this.form,
  1472. "idcard_face_photo",
  1473. res.data.data.IdImgPath
  1474. );
  1475. console.log(this.form, "idcard_face_photo");
  1476. },
  1477. });
  1478. }
  1479. } else {
  1480. this.fileList2 = [];
  1481. this.$set(this.form, "idcard_face_photo", "");
  1482. }
  1483. this.openVerify = false;
  1484. this.$nextTick(function () {
  1485. this.resultForm();
  1486. });
  1487. },
  1488. async changePhotoListHeader3(lists, name) {
  1489. if (lists.length) {
  1490. this.fileList3 = lists;
  1491. if (
  1492. lists[0].url.indexOf("//tmp") !== -1 ||
  1493. lists[0].url.indexOf("//temp") !== -1
  1494. ) {
  1495. console.log("//tem");
  1496. let url = lists[0].url;
  1497. this.$refs.idcard_national_photo[0].remove(0);
  1498. uni.compressImage({
  1499. src: url,
  1500. quality: 75,
  1501. width: "50%",
  1502. height: "50%",
  1503. success: async (rest) => {
  1504. let res = await this.faceCertificationIDCardOCR(
  1505. 2,
  1506. rest.tempFilePath
  1507. );
  1508. if (res.data.code == 500) {
  1509. uni.showToast({
  1510. icon: "none",
  1511. title: "请上传正确清晰的身份证国徽面照片",
  1512. });
  1513. return;
  1514. }
  1515. this.$refs.idcard_national_photo[0].lists = [
  1516. {
  1517. url: this.$method.splitImgHost(res.data.data.IdImgPath),
  1518. },
  1519. ];
  1520. this.$set(
  1521. this.form,
  1522. "idcard_national_photo",
  1523. res.data.data.IdImgPath
  1524. );
  1525. console.log(this.form, "idcard_national_photo");
  1526. },
  1527. });
  1528. }
  1529. } else {
  1530. this.fileList3 = [];
  1531. this.$set(this.form, "idcard_national_photo", "");
  1532. }
  1533. this.openVerify = false;
  1534. this.$nextTick(function () {
  1535. this.resultForm();
  1536. });
  1537. },
  1538. getTimes(key) {
  1539. if (this.form[key]) {
  1540. return this.form[key];
  1541. } else {
  1542. return "请选择时间";
  1543. }
  1544. },
  1545. getarrays(key) {
  1546. if (key === "sex") {
  1547. return this.dictObj["sys_user_sex"];
  1548. }
  1549. if (key === "education") {
  1550. return this.dictObj["edu_level"];
  1551. }
  1552. if (key === "working_years") {
  1553. return this.dictObj["working_years"];
  1554. }
  1555. },
  1556. returnName(key) {
  1557. if (key === "sex") {
  1558. if (this.form[key]) {
  1559. return this.dictObj["sys_user_sex"][Number(this.form[key])];
  1560. } else {
  1561. return "请选择性别";
  1562. }
  1563. }
  1564. if (key === "education") {
  1565. if (this.form[key]) {
  1566. return this.dictObj["edu_level"][Number(this.form[key])];
  1567. } else {
  1568. return "请选择学历";
  1569. }
  1570. }
  1571. if (key === "working_years") {
  1572. if (this.form[key]) {
  1573. return this.dictObj["working_years"][Number(this.form[key])];
  1574. } else {
  1575. return "请选择工作年限";
  1576. }
  1577. }
  1578. },
  1579. /**
  1580. * getbaseprofiletpgetInfo接口返回值result.data.data不存在的话说明是第一次填写资料
  1581. */
  1582. getInfo() {
  1583. console.log("getInfo", this.userInfo);
  1584. return new Promise((resolve) => {
  1585. var self = this;
  1586. this.$api.getbaseprofiletpId(this.goodsId).then((res) => {
  1587. self.listData = JSON.parse(res.data.data.keyValue);
  1588. var ast = JSON.parse(res.data.data.keyValue2);
  1589. self.listData = [...self.listData, ...ast];
  1590. console.log(self.listData, "listData");
  1591. self.listData.forEach((item) => {
  1592. if (item.fieldKey == "idcard") {
  1593. console.log(this.userInfo.idCard, "this.userInfo.idCard");
  1594. this.form.idcard = this.userInfo.idCard;
  1595. this.disCard = this.form.idcard ? true : false
  1596. console.log(this.form.idcard);
  1597. }
  1598. if (item.fieldKey == "telphone") {
  1599. console.log(this.userInfo.telphone, "this.userInfo.telphone");
  1600. this.form.telphone = this.userInfo.telphone;
  1601. console.log(this.form.telphone);
  1602. }
  1603. if (item.fieldKey == "name") {
  1604. console.log(this.userInfo.realname, "this.userInfo.realname");
  1605. this.form.name = this.userInfo.realname;
  1606. this.disName = this.form.name ? true : false
  1607. console.log('this.disName', this.form.name, this.disName);
  1608. }
  1609. });
  1610. self.isRequired = self.listData.every((ims) => {
  1611. return ims.required === false;
  1612. });
  1613. console.log(self.isRequired, "self.isRequired ");
  1614. this.$nextTick(() => {
  1615. this.agreementModal = true;
  1616. });
  1617. self.$api
  1618. .getbaseprofiletpgetInfo({
  1619. goodsId: self.goodsId,
  1620. orderGoodsId: self.orderGoodsId,
  1621. })
  1622. .then((result) => {
  1623. if (result.data.code === 200) {
  1624. if (!result.data.data) {
  1625. self.$api
  1626. .getbaseprofiletplistProfile({ pageNum: 1, pageSize: 1 })
  1627. .then((kit) => {
  1628. if (kit.data.rows.length) {
  1629. var ajson = JSON.parse(kit.data.rows[0].keyValue);
  1630. self.listData.forEach((zyitem, zyindex) => {
  1631. for (let k in ajson) {
  1632. if (zyitem.fieldKey == k && ajson[k].value) {
  1633. if (k === "sex") {
  1634. const sexIndex =
  1635. self.dictObj["sys_user_sex"].indexOf(
  1636. ajson[k].value
  1637. ) + "";
  1638. self.$set(self.form, k, sexIndex);
  1639. } else if (k === "education") {
  1640. const sexIndex =
  1641. self.dictObj["edu_level"].indexOf(
  1642. ajson[k].value
  1643. ) + "";
  1644. self.$set(self.form, k, sexIndex);
  1645. } else if (k === "working_years") {
  1646. const sexIndex =
  1647. self.dictObj["working_years"].indexOf(
  1648. ajson[k].value
  1649. ) + "";
  1650. self.$set(self.form, k, sexIndex);
  1651. } else if (k === "recent_photos") {
  1652. self.$set(self.form, k, ajson[k].value);
  1653. if (ajson[k].value) {
  1654. self.fileList1 = [
  1655. {
  1656. url:
  1657. baseUrls.BASE_IMG_URL + ajson[k].value,
  1658. },
  1659. ];
  1660. }
  1661. } else if (k === "idcard_face_photo") {
  1662. self.$set(self.form, k, ajson[k].value);
  1663. if (ajson[k].value) {
  1664. self.fileList2 = [
  1665. {
  1666. url:
  1667. baseUrls.BASE_IMG_URL + ajson[k].value,
  1668. },
  1669. ];
  1670. }
  1671. } else if (k === "idcard_national_photo") {
  1672. self.$set(self.form, k, ajson[k].value);
  1673. if (ajson[k].value) {
  1674. self.fileList3 = [
  1675. {
  1676. url:
  1677. baseUrls.BASE_IMG_URL + ajson[k].value,
  1678. },
  1679. ];
  1680. }
  1681. } else {
  1682. if (k === "name") {
  1683. self.$set(
  1684. self.form,
  1685. k,
  1686. this.$store.state.userInfo.realname
  1687. );
  1688. } else if (k === "idcard") {
  1689. self.$set(
  1690. self.form,
  1691. k,
  1692. this.$store.state.userInfo.idCard
  1693. );
  1694. } else if (k === "telphone") {
  1695. self.$set(
  1696. self.form,
  1697. k,
  1698. this.$store.state.userInfo.telphone
  1699. );
  1700. } else if (
  1701. k !== "commitment_electr_signature"
  1702. ) {
  1703. self.$set(self.form, k, ajson[k].value);
  1704. }
  1705. }
  1706. }
  1707. }
  1708. });
  1709. resolve();
  1710. } else {
  1711. resolve();
  1712. }
  1713. });
  1714. }
  1715. console.log(result.data.data, "result.data.data");
  1716. if (result.data.data && result.data.data.status === 3) {
  1717. self.remark = result.data.data.text;
  1718. self.remarkStatus = true;
  1719. self.id = result.data.data.id;
  1720. console.log(result.data.data, "result.data.data");
  1721. var arrays = JSON.parse(result.data.data.keyValue);
  1722. // var arrays1 = JSON.parse(result.data.data.keyValue2);
  1723. self.copyData = JSON.parse(JSON.stringify(arrays));
  1724. for (let k in arrays) {
  1725. if (k === "sex") {
  1726. if (arrays[k].value) {
  1727. const sexIndex =
  1728. self.dictObj["sys_user_sex"].indexOf(
  1729. arrays[k].value
  1730. ) + "";
  1731. self.$set(self.form, k, sexIndex);
  1732. }
  1733. } else if (k === "education") {
  1734. if (arrays[k].value) {
  1735. const sexIndex =
  1736. self.dictObj["edu_level"].indexOf(arrays[k].value) +
  1737. "";
  1738. self.$set(self.form, k, sexIndex);
  1739. }
  1740. } else if (k === "working_years") {
  1741. if (arrays[k].value) {
  1742. const sexIndex =
  1743. self.dictObj["working_years"].indexOf(
  1744. arrays[k].value
  1745. ) + "";
  1746. self.$set(self.form, k, sexIndex);
  1747. }
  1748. } else if (k === "recent_photos") {
  1749. self.$set(self.form, k, arrays[k].value);
  1750. if (arrays[k].value) {
  1751. self.fileList1 = [
  1752. { url: baseUrls.BASE_IMG_URL + arrays[k].value },
  1753. ];
  1754. }
  1755. } else if (k === "idcard_face_photo") {
  1756. self.$set(self.form, k, arrays[k].value);
  1757. if (arrays[k].value) {
  1758. self.fileList2 = [
  1759. { url: baseUrls.BASE_IMG_URL + arrays[k].value },
  1760. ];
  1761. }
  1762. } else if (k === "idcard_national_photo") {
  1763. self.$set(self.form, k, arrays[k].value);
  1764. if (arrays[k].value) {
  1765. self.fileList3 = [
  1766. { url: baseUrls.BASE_IMG_URL + arrays[k].value },
  1767. ];
  1768. }
  1769. } else if (k === "name") {
  1770. self.$set(
  1771. self.form,
  1772. k,
  1773. this.$store.state.userInfo.realname
  1774. );
  1775. } else if (k === "idcard") {
  1776. self.$set(
  1777. self.form,
  1778. k,
  1779. this.$store.state.userInfo.idCard
  1780. );
  1781. } else if (k === "telphone") {
  1782. self.$set(
  1783. self.form,
  1784. k,
  1785. this.$store.state.userInfo.telphone
  1786. );
  1787. } else {
  1788. self.$set(self.form, k, arrays[k].value);
  1789. }
  1790. }
  1791. resolve();
  1792. } else if (
  1793. result.data.data &&
  1794. (result.data.data.status === 1 ||
  1795. result.data.data.status === 2)
  1796. ) {
  1797. uni.showModal({
  1798. showCancel: false,
  1799. content:
  1800. result.data.data.status === 1
  1801. ? "该商品审核资料已通过,不可重复提交资料"
  1802. : result.data.data.status === 2
  1803. ? "该商品审核资料处于待审核状态,不可重复提交资料"
  1804. : "请联系管理员",
  1805. success: function (k) {
  1806. if (k.confirm) {
  1807. uni.navigateBack();
  1808. }
  1809. },
  1810. });
  1811. }
  1812. }
  1813. });
  1814. });
  1815. });
  1816. },
  1817. bindPickerChange(key, e) {
  1818. this.$set(this.form, key, e.detail.value);
  1819. this.openVerify = false;
  1820. this.$nextTick(function () {
  1821. this.resultForm();
  1822. });
  1823. },
  1824. bindDateChange(key, e) {
  1825. this.form[key] = e.detail.value;
  1826. },
  1827. retDraw() {
  1828. this.handwriting.retDraw();
  1829. this.$set(this.form, "commitment_electr_signature", "");
  1830. this.openVerify = false;
  1831. this.$nextTick(function () {
  1832. this.resultForm();
  1833. });
  1834. },
  1835. uploadScaleStart(event) {
  1836. this.handwriting.uploadScaleStart(event);
  1837. },
  1838. uploadScaleMove(event) {
  1839. this.handwriting.uploadScaleMove(event);
  1840. },
  1841. uploadScaleEnd(event) {
  1842. this.handwriting.uploadScaleEnd(event);
  1843. },
  1844. subCanvas() {
  1845. return new Promise((resolve, reject) => {
  1846. var self = this;
  1847. console.log(self.form, "self.form");
  1848. if (self.form.commitment_electr_signature) {
  1849. resolve();
  1850. return;
  1851. }
  1852. self.handwriting
  1853. .saveCanvas()
  1854. .then((res) => {
  1855. if (this.handwriting.linePrack.length) {
  1856. this.$set(this.form, "commitment_electr_signature", res);
  1857. }
  1858. resolve(res);
  1859. })
  1860. .catch((err) => {
  1861. uni.showToast({
  1862. title: "签名上传失败",
  1863. icon: "error",
  1864. });
  1865. this.isUploading = false;
  1866. });
  1867. });
  1868. },
  1869. },
  1870. };
  1871. </script>
  1872. <style>
  1873. page {
  1874. background: #eaeef1;
  1875. }
  1876. </style>
  1877. <style scope lang="scss">
  1878. .ctoples {
  1879. position: absolute;
  1880. top: 0;
  1881. left: 0;
  1882. padding: 2rpx 23rpx;
  1883. display: inline-block;
  1884. background-color: rgba(0, 0, 0, 0.4);
  1885. font-size: 28rpx;
  1886. color: #fff;
  1887. border-bottom-right-radius: 24rpx;
  1888. }
  1889. .quzw {
  1890. width: 638rpx;
  1891. height: 638rpx;
  1892. position: relative;
  1893. border: 2rpx solid #eee;
  1894. border-radius: 8rpx;
  1895. }
  1896. .handWriting {
  1897. width: 100%;
  1898. height: 100%;
  1899. }
  1900. /deep/ .u-collapse-title {
  1901. color: #ff3b30;
  1902. font-size: 24rpx;
  1903. }
  1904. .collapse-item {
  1905. color: #666;
  1906. font-size: 24rpx;
  1907. padding-bottom: 30rpx;
  1908. }
  1909. .dis_stys {
  1910. display: flex;
  1911. align-items: center;
  1912. justify-content: space-between;
  1913. }
  1914. .handCenter {
  1915. background: #f7f7f7;
  1916. border: 2rpx solid #eeeeee;
  1917. border-radius: 24rpx;
  1918. width: 100%;
  1919. height: 400rpx;
  1920. overflow: hidden;
  1921. }
  1922. .headerSDels {
  1923. height: 58rpx;
  1924. padding: 0rpx 24rpx;
  1925. font-weight: bold;
  1926. display: flex;
  1927. align-items: center;
  1928. flex-direction: row-reverse;
  1929. }
  1930. .listBox {
  1931. margin: 24rpx 32rpx 0rpx;
  1932. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1933. border-radius: 32rpx;
  1934. background-color: #fff;
  1935. overflow: hidden;
  1936. }
  1937. .imgBoxs {
  1938. width: 156rpx;
  1939. height: 203rpx;
  1940. }
  1941. .imgBoxs2 {
  1942. width: 171rpx;
  1943. height: 108rpx;
  1944. }
  1945. .submit_btn {
  1946. width: 526rpx;
  1947. height: 80rpx;
  1948. background: #007aff;
  1949. border-radius: 40rpx;
  1950. text-align: center;
  1951. line-height: 80rpx;
  1952. color: #ffffff;
  1953. margin: 30rpx auto;
  1954. }
  1955. .picker {
  1956. text-align: right;
  1957. }
  1958. input {
  1959. text-align: right;
  1960. }
  1961. .bodyBox {
  1962. background: #ffffff;
  1963. border-radius: 24rpx;
  1964. width: 100%;
  1965. }
  1966. .topBox {
  1967. height: 80rpx;
  1968. background: #ffffff;
  1969. border-radius: 24rpx;
  1970. width: 100%;
  1971. display: flex;
  1972. justify-content: space-between;
  1973. line-height: 80rpx;
  1974. padding: 0 20rpx;
  1975. font-size: 24rpx;
  1976. }
  1977. .modal {
  1978. .agreement {
  1979. width: 640rpx;
  1980. height: 740rpx;
  1981. background: #ffffff;
  1982. display: flex;
  1983. flex-direction: column;
  1984. .body {
  1985. flex: 1;
  1986. .content {
  1987. padding: 30rpx 40rpx 28rpx;
  1988. line-height: 40rpx;
  1989. font-size: 26rpx;
  1990. color: #666;
  1991. .bold {
  1992. color: #333;
  1993. font-size: 26rpx;
  1994. font-weight: bold;
  1995. }
  1996. .center {
  1997. text-align: center;
  1998. }
  1999. }
  2000. }
  2001. .footer {
  2002. height: 140rpx;
  2003. border-top: 1px solid #eeeeee;
  2004. display: flex;
  2005. align-items: center;
  2006. justify-content: center;
  2007. .btn {
  2008. margin: 0 12rpx;
  2009. width: 200rpx;
  2010. height: 80rpx;
  2011. color: #007aff;
  2012. font-size: 30rpx;
  2013. text-align: center;
  2014. line-height: 80rpx;
  2015. background: #f5f5f5;
  2016. border-radius: 40rpx 40rpx 40rpx 40rpx;
  2017. &.ok {
  2018. width: 336rpx;
  2019. height: 80rpx;
  2020. background: #007aff;
  2021. color: #fff;
  2022. }
  2023. &.close {
  2024. color: #fff;
  2025. width: 560rpx;
  2026. height: 80rpx;
  2027. background: #007aff;
  2028. border-radius: 40rpx 40rpx 40rpx 40rpx;
  2029. }
  2030. }
  2031. }
  2032. }
  2033. }
  2034. </style>