input.vue 68 KB

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