input.vue 65 KB

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