input.vue 49 KB

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