input.vue 67 KB

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