input.vue 67 KB

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