input.vue 67 KB

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