input.vue 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711
  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 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 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 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="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 } 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.getGoodsDetail()
  566. this.getInfo();
  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. this.listData.forEach(item => {
  581. if(item.fieldKey == "idcard") {
  582. this.form.idcard = this.userInfo.idCard;
  583. }
  584. if(item.fieldKey == "telphone") {
  585. this.form.telphone = this.userInfo.telphone;
  586. }
  587. if(item.fieldKey == "name") {
  588. this.form.name = this.userInfo.realname
  589. }
  590. })
  591. }
  592. },
  593. },
  594. methods: {
  595. clickIndex(inds){
  596. if(inds === 0){
  597. this.uploadImgs()
  598. }
  599. if(inds === 1){
  600. this.uploadFieds()
  601. }
  602. },
  603. getChast(){
  604. this.showTableDown = true;
  605. },
  606. seePhotos(url) {
  607. uni.previewImage({
  608. urls: [url]
  609. });
  610. },
  611. async downDocx(url) {
  612. let self = this;
  613. var ast = this.listData.some(item => {
  614. return item.fieldKey === 'commitment_electr_signature';
  615. });
  616. if (ast) {
  617. await this.subCanvas();
  618. }
  619. let data = JSON.parse(JSON.stringify(this.form));
  620. if (data['commitment_electr_signature']) {
  621. data.commitment_electr_signature = await this.$method.uploadFile(data.commitment_electr_signature, 0);
  622. }
  623. console.log(data)
  624. console.log(self.copyData)
  625. console.log(444)
  626. if(this.remarkStatus) {
  627. var arsty = {};
  628. for (let k in data) {
  629. for (let j in self.copyData) {
  630. if (k === j) {
  631. if (self.copyData[j].value === data[k]) {
  632. arsty[k] = {
  633. fieldKey: k,
  634. value: data[k],
  635. fieldName: (function() {
  636. for (let i = 0; i < self.listData.length; i++) {
  637. if (self.listData[i].fieldKey == k) {
  638. return self.listData[i].fieldName;
  639. }
  640. }
  641. })(),
  642. status: 0
  643. };
  644. } else {
  645. arsty[k] = {
  646. fieldKey: k,
  647. value: data[k],
  648. fieldName: (function() {
  649. for (let i = 0; i < self.listData.length; i++) {
  650. if (self.listData[i].fieldKey == k) {
  651. return self.listData[i].fieldName;
  652. }
  653. }
  654. })(),
  655. status: 1
  656. };
  657. }
  658. }
  659. }
  660. }
  661. } else {
  662. var arsty = {};
  663. for (let k in data) {
  664. arsty[k] = {
  665. fieldKey: k,
  666. value: data[k],
  667. fieldName: (function() {
  668. for (let i = 0; i < self.listData.length; i++) {
  669. if (self.listData[i].fieldKey == k) {
  670. return self.listData[i].fieldName;
  671. }
  672. }
  673. })(),
  674. status: 0
  675. };
  676. }
  677. }
  678. console.log(arsty)
  679. this.$api.baseProfileStampV2AddWord({ goodsId: this.goodsId,keyValue:JSON.stringify(arsty) }).then(res => {
  680. uni.downloadFile({
  681. url: this.$method.splitImgHost(res.data.msg),
  682. success: result => {
  683. if (result.statusCode === 200) {
  684. const filePath = result.tempFilePath
  685. console.log(this.$method.splitImgHost(res.data.msg));
  686. this.$method.showToast('下载成功');
  687. uni.saveImageToPhotosAlbum({
  688. filePath: filePath,
  689. success: function (errMsg) {
  690. uni.showToast({
  691. mask: true,
  692. title: '保存成功'
  693. });
  694. },
  695. fail:(errMsg)=>{
  696. uni.showToast({
  697. mask: true,
  698. title: '保存失败'
  699. });
  700. },
  701. complete:(errMsg)=>{
  702. }
  703. });
  704. }
  705. }
  706. });
  707. });
  708. },
  709. getGoodsDetail() {
  710. return new Promise(resolve => {
  711. this.$api.orderInfo({
  712. orderGoodsId:this.orderGoodsId
  713. }).then(res => {
  714. this.goodsData = res.data.data;
  715. if(this.goodsData.categoryName) {
  716. this.form.apply_post = this.goodsData.categoryName;
  717. if(this.goodsData.categoryName) {
  718. this.apply_post_disabled = true;
  719. }
  720. }
  721. resolve()
  722. })
  723. })
  724. },
  725. uploadImgs(){
  726. var self = this
  727. uni.chooseImage({
  728. count: 1, //默认9
  729. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  730. success: function (res) {
  731. if (res.tempFiles[0].size > 2097152) {
  732. self.$method.showToast('上传图片不得大于2M');
  733. return;
  734. } else {
  735. var type = res.tempFiles[0].path.split('.').splice(-1);
  736. if (type[0] != 'jpg' && type[0] != 'png' && type[0] != 'jpeg') {
  737. self.$method.showToast('请上传图片格式');
  738. return;
  739. }
  740. self.$set(self.form, 'commitment_seal', res.tempFiles[0].path);
  741. self.$nextTick(function() {
  742. this.resultForm();
  743. });
  744. }
  745. }
  746. });
  747. },
  748. uploadFieds() {
  749. var self = this;
  750. wx.chooseMessageFile({
  751. count: 1,
  752. size: 2097152,
  753. type: 'file',
  754. success(res) {
  755. if (res.tempFiles[0].size > 2097152) {
  756. self.$method.showToast('上传文件不得大于2M');
  757. return;
  758. } else {
  759. var type = res.tempFiles[0].path.split('.').splice(-1);
  760. if (type[0] != 'jpg' && type[0] != 'png' && type[0] != 'jpeg' && type[0] != 'docx' && type[0] != 'doc') {
  761. self.$method.showToast('请上传word文档或图片');
  762. return;
  763. }
  764. self.titleName = res.tempFiles[0].name;
  765. self.$set(self.form, 'commitment_seal', res.tempFiles[0].path);
  766. self.$nextTick(function() {
  767. this.resultForm();
  768. });
  769. }
  770. }
  771. });
  772. },
  773. agree() {
  774. this.agreementModal = false;
  775. setTimeout(() => {
  776. this.$refs.collapse.init()
  777. },1000)
  778. },
  779. refuseAgreement() {
  780. uni.navigateBack({
  781. delta:1
  782. })
  783. },
  784. clearFun(key) {
  785. this.form[key] = '';
  786. },
  787. //清除按钮
  788. clearWatch(key) {
  789. if (this.form[key]) {
  790. return true;
  791. } else {
  792. return false;
  793. }
  794. },
  795. cahngeText() {
  796. this.$set(this.form, 'name', '唐');
  797. console.log(this.form.name, 123);
  798. },
  799. async uploadDatas(data) {
  800. if(this.form.recent_photos && this.form.idcard_face_photo) {
  801. uni.downloadFile({
  802. url: this.$method.splitImgHost(this.form.idcard_face_photo),
  803. success:async (res) => {
  804. if (res.statusCode === 200) {
  805. let resData = await this.faceCertificationIDCardOCR(1,res.tempFilePath);
  806. if(!resData.data.data) {
  807. uni.showModal({
  808. title:'提示',
  809. content:'身份证人像面照片异常,请重新上传',
  810. showCancel:false,
  811. })
  812. this.isUploading = false;
  813. return;
  814. }
  815. this.veryIdCard = resData.data.data.IdNum
  816. this.veryIdName = resData.data.data.IdName
  817. // if(this.form.idcard) {
  818. // if(this.form.idcard != this.veryIdCard) {
  819. // uni.showModal({
  820. // title:'提示',
  821. // content:'输入的身份证号和身份证人像面照片身份证号不匹配',
  822. // showCancel:false,
  823. // })
  824. // this.isUploading = false;
  825. // return;
  826. // }
  827. // }
  828. uni.downloadFile({
  829. url: this.$method.splitImgHost(this.form.recent_photos),
  830. success: (res) => {
  831. if (res.statusCode === 200) {
  832. console.log('下载成功');
  833. let fileSystem = uni.getFileSystemManager();
  834. fileSystem.readFile({
  835. filePath: res.tempFilePath,
  836. encoding: 'base64',
  837. position: 0,
  838. success:(res) => {
  839. let base64 = 'data:image/jpg;base64,' + res.data;
  840. let newdata = {
  841. urlA:this.form.idcard_face_photo,
  842. oneInchPhotos:base64
  843. }
  844. this.$api.faceCertificationIdCardCompareFace(newdata).then(res1 => {
  845. if(res1.data.data >= 70) {
  846. var self = this;
  847. if (self.remarkStatus) {
  848. var arsty = {};
  849. for (let k in data) {
  850. for (let j in self.copyData) {
  851. if (k === j) {
  852. if (self.copyData[j].value === data[k]) {
  853. arsty[k] = {
  854. fieldKey: k,
  855. value: data[k],
  856. fieldName: (function() {
  857. for (let i = 0; i < self.listData.length; i++) {
  858. if (self.listData[i].fieldKey == k) {
  859. return self.listData[i].fieldName;
  860. }
  861. }
  862. })(),
  863. status: 0
  864. };
  865. } else {
  866. arsty[k] = {
  867. fieldKey: k,
  868. value: data[k],
  869. fieldName: (function() {
  870. for (let i = 0; i < self.listData.length; i++) {
  871. if (self.listData[i].fieldKey == k) {
  872. return self.listData[i].fieldName;
  873. }
  874. }
  875. })(),
  876. status: 1
  877. };
  878. }
  879. }
  880. }
  881. }
  882. var datas = {
  883. id: this.id,
  884. goodsId: this.goodsId,
  885. orderGoodsId:this.orderGoodsId,
  886. keyValue: JSON.stringify(arsty)
  887. };
  888. console.log(datas,'datas0')
  889. // this.isUploading = false;
  890. // return;
  891. this.$api.editbaseprofiletp(datas).then(res => {
  892. this.isUploading = false;
  893. if (res.data.code === 200) {
  894. this.$method.showToast('提交成功');
  895. uni.navigateBack();
  896. } else {
  897. this.$method.showToast(res.data.msg);
  898. this.isUploading = false;
  899. }
  900. });
  901. } else {
  902. var objs = {};
  903. for (let k in data) {
  904. objs[k] = {
  905. fieldKey: k,
  906. value: data[k],
  907. fieldName: (function() {
  908. for (let i = 0; i < self.listData.length; i++) {
  909. if (self.listData[i].fieldKey == k) {
  910. return self.listData[i].fieldName;
  911. }
  912. }
  913. })(),
  914. status: 0
  915. };
  916. }
  917. var datas = {
  918. goodsId: this.goodsId,
  919. profileTpId: this.goodsId,
  920. orderGoodsId:this.orderGoodsId,
  921. keyValue: JSON.stringify(objs)
  922. };
  923. console.log(data,'datas')
  924. // this.isUploading = false;
  925. // return;
  926. this.$api.addbaseprofiletp(datas).then(res => {
  927. this.isUploading = false;
  928. if (res.data.code === 200) {
  929. this.$method.showToast('提交成功');
  930. uni.navigateBack();
  931. } else {
  932. this.$method.showToast(res.data.msg);
  933. this.isUploading = false;
  934. }
  935. });
  936. }
  937. } else {
  938. this.isUploading = false;
  939. uni.showModal({
  940. title:'提示',
  941. content:'个人近照和身份证人像面照片不匹配',
  942. showCancel:false,
  943. })
  944. }
  945. })
  946. },
  947. fail(err) {
  948. this.isUploading = false;
  949. console.error(err,'err')
  950. }
  951. })
  952. }
  953. }
  954. });
  955. }
  956. },
  957. })
  958. return
  959. }
  960. var self = this;
  961. if (self.remarkStatus) {
  962. var arsty = {};
  963. for (let k in data) {
  964. for (let j in self.copyData) {
  965. if (k === j) {
  966. if (self.copyData[j].value === data[k]) {
  967. arsty[k] = {
  968. fieldKey: k,
  969. value: data[k],
  970. fieldName: (function() {
  971. for (let i = 0; i < self.listData.length; i++) {
  972. if (self.listData[i].fieldKey == k) {
  973. return self.listData[i].fieldName;
  974. }
  975. }
  976. })(),
  977. status: 0
  978. };
  979. } else {
  980. arsty[k] = {
  981. fieldKey: k,
  982. value: data[k],
  983. fieldName: (function() {
  984. for (let i = 0; i < self.listData.length; i++) {
  985. if (self.listData[i].fieldKey == k) {
  986. return self.listData[i].fieldName;
  987. }
  988. }
  989. })(),
  990. status: 1
  991. };
  992. }
  993. }
  994. }
  995. }
  996. console.log(arsty,'arsty')
  997. if(Object.keys(arsty).length == 0) {
  998. uni.showModal({
  999. title:'提示',
  1000. content:'数据错误,请联系管理员'
  1001. })
  1002. this.isUploading = false;
  1003. return;
  1004. }
  1005. var datas = {
  1006. id: this.id,
  1007. goodsId: this.goodsId,
  1008. orderGoodsId:this.orderGoodsId,
  1009. keyValue: JSON.stringify(arsty)
  1010. };
  1011. console.log(datas,'datas1')
  1012. // return;
  1013. this.$api.editbaseprofiletp(datas).then(res => {
  1014. this.isUploading = false;
  1015. if (res.data.code === 200) {
  1016. this.$method.showToast('提交成功');
  1017. uni.navigateBack();
  1018. } else {
  1019. this.$method.showToast(res.data.msg);
  1020. this.isUploading = false;
  1021. }
  1022. });
  1023. } else {
  1024. var objs = {};
  1025. for (let k in data) {
  1026. objs[k] = {
  1027. fieldKey: k,
  1028. value: data[k],
  1029. fieldName: (function() {
  1030. for (let i = 0; i < self.listData.length; i++) {
  1031. if (self.listData[i].fieldKey == k) {
  1032. return self.listData[i].fieldName;
  1033. }
  1034. }
  1035. })(),
  1036. status: 0
  1037. };
  1038. }
  1039. var datas = {
  1040. goodsId: this.goodsId,
  1041. profileTpId: this.goodsId,
  1042. orderGoodsId:this.orderGoodsId,
  1043. keyValue: JSON.stringify(objs)
  1044. };
  1045. console.log(datas,'datas2')
  1046. // this.isUploading = false;
  1047. // return;
  1048. this.$api.addbaseprofiletp(datas).then(res => {
  1049. this.isUploading = false;
  1050. if (res.data.code === 200) {
  1051. this.$method.showToast('提交成功');
  1052. uni.navigateBack();
  1053. } else {
  1054. this.$method.showToast(res.data.msg);
  1055. this.isUploading = false;
  1056. }
  1057. }).catch(err => {});
  1058. }
  1059. },
  1060. clearWord() {
  1061. this.$set(this.form, 'commitment_seal', '');
  1062. this.titleName = '';
  1063. },
  1064. backPage() {
  1065. uni.navigateBack();
  1066. },
  1067. //提交表单
  1068. async submitApi() {
  1069. var data = JSON.parse(JSON.stringify(this.form));
  1070. if (data['sex']) {
  1071. data.sex = this.dictObj['sys_user_sex'][Number(data.sex)];
  1072. }
  1073. if (data['education']) {
  1074. data.education = this.dictObj['edu_level'][Number(data.education)];
  1075. }
  1076. if (data['working_years']) {
  1077. data.working_years = this.dictObj['working_years'][Number(data.working_years)];
  1078. }
  1079. if (data['recent_photos']) {
  1080. data.recent_photos = await this.$method.uploadFile(data.recent_photos, 0);
  1081. }
  1082. if (data['idcard_face_photo']) {
  1083. console.log('idcard_face_photo')
  1084. data.idcard_face_photo = await this.$method.uploadFile(data.idcard_face_photo, 0);
  1085. }
  1086. if (data['idcard_national_photo']) {
  1087. data.idcard_national_photo = await this.$method.uploadFile(data.idcard_national_photo, 0);
  1088. }
  1089. if (data['commitment_electr_signature']) {
  1090. data.commitment_electr_signature = await this.$method.uploadFile(data.commitment_electr_signature, 0);
  1091. }
  1092. if (data['commitment_seal']) {
  1093. data.commitment_seal = await this.$method.uploadFile(data.commitment_seal, 0);
  1094. }
  1095. this.uploadDatas(data);
  1096. },
  1097. //验证表单
  1098. resultForm(int) {
  1099. console.log(this.openVerify,'openVerify')
  1100. console.log(this.isRequired,'isRequired')
  1101. if (this.openVerify) {
  1102. if (this.isRequired) {
  1103. this.submitApi();
  1104. } else {
  1105. if(int === 1) {
  1106. this.errorType = ['toast'];
  1107. } else {
  1108. this.errorType = ['message'];
  1109. }
  1110. this.$nextTick(() => {
  1111. this.$refs.uForm.validate(valid => {
  1112. if (valid) {
  1113. if (int === 1) {
  1114. this.submitApi();
  1115. }
  1116. } else {
  1117. this.isUploading = false;
  1118. this.errorType = ['message'];
  1119. console.log(this.form)
  1120. console.log('验证失败');
  1121. }
  1122. });
  1123. })
  1124. }
  1125. }
  1126. },
  1127. async submits() {
  1128. if(this.isUploading) {
  1129. return;
  1130. }
  1131. this.isUploading = true;
  1132. var ast = this.listData.some(item => {
  1133. return item.fieldKey === 'commitment_electr_signature';
  1134. });
  1135. if (ast) {
  1136. await this.subCanvas();
  1137. }
  1138. this.openVerify = true;
  1139. this.resultForm(1);
  1140. },
  1141. faceCertificationIDCardOCR(cardSide,url) {
  1142. return new Promise(resolve => {
  1143. let fileSystem = uni.getFileSystemManager();
  1144. fileSystem.readFile({
  1145. filePath: url,
  1146. encoding: 'base64',
  1147. position: 0,
  1148. success:(res) => {
  1149. let base64 = 'data:image/jpg;base64,' + res.data;
  1150. this.$api.faceCertificationIDCardOCR({
  1151. cardSide:cardSide, //1人像 2 国徽
  1152. cardImageBase64:base64,
  1153. gradeId:this.gradeId
  1154. }).then(res => {
  1155. resolve(res)
  1156. })
  1157. },
  1158. fail(err) {
  1159. console.error(err,'err')
  1160. }
  1161. })
  1162. })
  1163. },
  1164. async changePhotoListHeader1(lists, name) {
  1165. console.log(lists)
  1166. if (lists.length) {
  1167. this.fileList1 = lists;
  1168. console.log(lists,'lists1')
  1169. if (lists[0].url.indexOf('//tmp') !== -1 || lists[0].url.indexOf('//temp') !== -1) {
  1170. this.$set(this.form, 'recent_photos', await this.$method.imageInfos(lists[0].url));
  1171. }
  1172. } else {
  1173. this.fileList1 = [];
  1174. this.$set(this.form, 'recent_photos', '');
  1175. console.log(3, this.form.recent_photos);
  1176. }
  1177. this.openVerify = false;
  1178. this.$nextTick(function() {
  1179. console.log(4);
  1180. this.resultForm();
  1181. });
  1182. },
  1183. async changePhotoListHeader2(lists, name) {
  1184. if (lists.length) {
  1185. this.fileList2 = lists;
  1186. if (lists[0].url.indexOf('//tmp') !== -1 || lists[0].url.indexOf('//temp') !== -1) {
  1187. let url = lists[0].url
  1188. this.$refs.idcard_face_photo[0].remove(0)
  1189. uni.compressImage({
  1190. src: url,
  1191. quality: 75,
  1192. width: '50%',
  1193. height: '50%',
  1194. success: async rest => {
  1195. let res = await this.faceCertificationIDCardOCR(1,rest.tempFilePath);
  1196. if(res.data.code == 500) {
  1197. uni.showToast({
  1198. icon:'none',
  1199. title:'请上传正确清晰的身份证人像面照片'
  1200. })
  1201. return;
  1202. }
  1203. this.$refs.idcard_face_photo[0].lists = [{
  1204. url:this.$method.splitImgHost(res.data.data.IdImgPath)
  1205. }];
  1206. this.$set(this.form, 'idcard_face_photo', res.data.data.IdImgPath);
  1207. console.log(this.form,'idcard_face_photo')
  1208. }
  1209. });
  1210. }
  1211. } else {
  1212. this.fileList2 = [];
  1213. this.$set(this.form, 'idcard_face_photo', '');
  1214. }
  1215. this.openVerify = false;
  1216. this.$nextTick(function() {
  1217. this.resultForm();
  1218. });
  1219. },
  1220. async changePhotoListHeader3(lists, name) {
  1221. if (lists.length) {
  1222. this.fileList3 = lists;
  1223. if (lists[0].url.indexOf('//tmp') !== -1 || lists[0].url.indexOf('//temp') !== -1) {
  1224. console.log('//tem')
  1225. let url = lists[0].url
  1226. this.$refs.idcard_national_photo[0].remove(0)
  1227. uni.compressImage({
  1228. src: url,
  1229. quality: 75,
  1230. width: '50%',
  1231. height: '50%',
  1232. success: async rest => {
  1233. let res = await this.faceCertificationIDCardOCR(2,rest.tempFilePath);
  1234. if(res.data.code == 500) {
  1235. uni.showToast({
  1236. icon:'none',
  1237. title:'请上传正确清晰的身份证国徽面照片'
  1238. })
  1239. return;
  1240. }
  1241. this.$refs.idcard_national_photo[0].lists = [{
  1242. url:this.$method.splitImgHost(res.data.data.IdImgPath)
  1243. }];
  1244. this.$set(this.form, 'idcard_national_photo', res.data.data.IdImgPath);
  1245. console.log(this.form,'idcard_national_photo')
  1246. }
  1247. });
  1248. }
  1249. } else {
  1250. this.fileList3 = [];
  1251. this.$set(this.form, 'idcard_national_photo', '');
  1252. }
  1253. this.openVerify = false;
  1254. this.$nextTick(function() {
  1255. this.resultForm();
  1256. });
  1257. },
  1258. getTimes(key) {
  1259. if (this.form[key]) {
  1260. return this.form[key];
  1261. } else {
  1262. return '请选择时间';
  1263. }
  1264. },
  1265. getarrays(key) {
  1266. if (key === 'sex') {
  1267. return this.dictObj['sys_user_sex'];
  1268. }
  1269. if (key === 'education') {
  1270. return this.dictObj['edu_level'];
  1271. }
  1272. if (key === 'working_years') {
  1273. return this.dictObj['working_years'];
  1274. }
  1275. },
  1276. returnName(key) {
  1277. if (key === 'sex') {
  1278. if (this.form[key]) {
  1279. return this.dictObj['sys_user_sex'][Number(this.form[key])];
  1280. } else {
  1281. return '请选择性别';
  1282. }
  1283. }
  1284. if (key === 'education') {
  1285. if (this.form[key]) {
  1286. return this.dictObj['edu_level'][Number(this.form[key])];
  1287. } else {
  1288. return '请选择学历';
  1289. }
  1290. }
  1291. if (key === 'working_years') {
  1292. if (this.form[key]) {
  1293. return this.dictObj['working_years'][Number(this.form[key])];
  1294. } else {
  1295. return '请选择工作年限';
  1296. }
  1297. }
  1298. },
  1299. /**
  1300. * getbaseprofiletpgetInfo接口返回值result.data.data不存在的话说明是第一次填写资料
  1301. */
  1302. getInfo() {
  1303. console.log('getInfo')
  1304. var self = this;
  1305. this.$api.getbaseprofiletpId(this.goodsId).then(res => {
  1306. self.listData = JSON.parse(res.data.data.keyValue);
  1307. var ast = JSON.parse(res.data.data.keyValue2);
  1308. self.listData = [...self.listData,...ast]
  1309. console.log(self.listData,'listData')
  1310. self.listData.forEach(item => {
  1311. if(item.fieldKey == "idcard") {
  1312. this.form.idcard = this.userInfo.idCard;
  1313. }
  1314. if(item.fieldKey == "telphone") {
  1315. this.form.telphone = this.userInfo.telphone;
  1316. }
  1317. if(item.fieldKey == "name") {
  1318. this.form.name = this.userInfo.realname
  1319. }
  1320. })
  1321. self.isRequired = self.listData.every(ims => {
  1322. return ims.required === false;
  1323. });
  1324. console.log(self.isRequired ,'self.isRequired ')
  1325. this.$nextTick(() => {
  1326. this.agreementModal = true;
  1327. })
  1328. self.$api.getbaseprofiletpgetInfo({ goodsId: self.goodsId ,orderGoodsId:self.orderGoodsId}).then(result => {
  1329. if (result.data.code === 200) {
  1330. if (!result.data.data) {
  1331. self.$api.getbaseprofiletplistProfile({ pageNum: 1, pageSize: 1, status: 1 }).then(kit => {
  1332. if (kit.data.rows.length) {
  1333. var ajson = JSON.parse(kit.data.rows[0].keyValue);
  1334. self.listData.forEach((zyitem, zyindex) => {
  1335. for (let k in ajson) {
  1336. if (zyitem.fieldKey == k && ajson[k].value) {
  1337. if (k === 'sex') {
  1338. const sexIndex = self.dictObj['sys_user_sex'].indexOf(ajson[k].value) + '';
  1339. self.$set(self.form, k, sexIndex);
  1340. } else if (k === 'education') {
  1341. const sexIndex = self.dictObj['edu_level'].indexOf(ajson[k].value) + '';
  1342. self.$set(self.form, k, sexIndex);
  1343. } else if (k === 'working_years') {
  1344. const sexIndex = self.dictObj['working_years'].indexOf(ajson[k].value) + '';
  1345. self.$set(self.form, k, sexIndex);
  1346. } else if (k === 'recent_photos') {
  1347. self.$set(self.form, k, ajson[k].value);
  1348. if (ajson[k].value) {
  1349. self.fileList1 = [{ url: baseUrls.BASE_IMG_URL + ajson[k].value }];
  1350. }
  1351. } else if (k === 'idcard_face_photo') {
  1352. self.$set(self.form, k, ajson[k].value);
  1353. if (ajson[k].value) {
  1354. self.fileList2 = [{ url: baseUrls.BASE_IMG_URL + ajson[k].value }];
  1355. }
  1356. } else if (k === 'idcard_national_photo') {
  1357. self.$set(self.form, k, ajson[k].value);
  1358. if (ajson[k].value) {
  1359. self.fileList3 = [{ url: baseUrls.BASE_IMG_URL + ajson[k].value }];
  1360. }
  1361. } else {
  1362. if(k === 'name'){
  1363. self.$set(self.form, k, this.$store.state.userInfo.realname);
  1364. } else if(k === 'idcard'){
  1365. self.$set(self.form, k, this.$store.state.userInfo.idCard);
  1366. } else if(k === 'telphone'){
  1367. self.$set(self.form, k, this.$store.state.userInfo.telphone);
  1368. } else if(k !== 'commitment_electr_signature'){
  1369. self.$set(self.form, k, ajson[k].value);
  1370. }
  1371. }
  1372. }
  1373. }
  1374. });
  1375. }
  1376. });
  1377. }
  1378. console.log(result.data.data,'result.data.data')
  1379. if (result.data.data && result.data.data.status === 3) {
  1380. self.remark = result.data.data.text;
  1381. self.remarkStatus = true;
  1382. self.id = result.data.data.id;
  1383. console.log(result.data.data,'result.data.data')
  1384. var arrays = JSON.parse(result.data.data.keyValue);
  1385. // var arrays1 = JSON.parse(result.data.data.keyValue2);
  1386. self.copyData = JSON.parse(JSON.stringify(arrays));
  1387. for (let k in arrays) {
  1388. if (k === 'sex') {
  1389. if (arrays[k].value) {
  1390. const sexIndex = self.dictObj['sys_user_sex'].indexOf(arrays[k].value) + '';
  1391. self.$set(self.form, k, sexIndex);
  1392. }
  1393. } else if (k === 'education') {
  1394. if (arrays[k].value) {
  1395. const sexIndex = self.dictObj['edu_level'].indexOf(arrays[k].value) + '';
  1396. self.$set(self.form, k, sexIndex);
  1397. }
  1398. } else if (k === 'working_years') {
  1399. if (arrays[k].value) {
  1400. const sexIndex = self.dictObj['working_years'].indexOf(arrays[k].value) + '';
  1401. self.$set(self.form, k, sexIndex);
  1402. }
  1403. } else if (k === 'recent_photos') {
  1404. self.$set(self.form, k, arrays[k].value);
  1405. if (arrays[k].value) {
  1406. self.fileList1 = [{ url: baseUrls.BASE_IMG_URL + arrays[k].value }];
  1407. }
  1408. } else if (k === 'idcard_face_photo') {
  1409. self.$set(self.form, k, arrays[k].value);
  1410. if (arrays[k].value) {
  1411. self.fileList2 = [{ url: baseUrls.BASE_IMG_URL + arrays[k].value }];
  1412. }
  1413. } else if (k === 'idcard_national_photo') {
  1414. self.$set(self.form, k, arrays[k].value);
  1415. if (arrays[k].value) {
  1416. self.fileList3 = [{ url: baseUrls.BASE_IMG_URL + arrays[k].value }];
  1417. }
  1418. } else {
  1419. self.$set(self.form, k, arrays[k].value);
  1420. }
  1421. }
  1422. } else if (result.data.data && (result.data.data.status === 1 || result.data.data.status === 2)) {
  1423. uni.showModal({
  1424. showCancel: false,
  1425. content:
  1426. result.data.data.status === 1
  1427. ? '该商品审核资料已通过,不可重复提交资料'
  1428. : result.data.data.status === 2
  1429. ? '该商品审核资料处于待审核状态,不可重复提交资料'
  1430. : '请联系管理员',
  1431. success: function(k) {
  1432. if (k.confirm) {
  1433. uni.navigateBack();
  1434. }
  1435. }
  1436. });
  1437. }
  1438. }
  1439. });
  1440. });
  1441. },
  1442. bindPickerChange(key, e) {
  1443. this.$set(this.form, key, e.detail.value);
  1444. this.openVerify = false;
  1445. this.$nextTick(function() {
  1446. this.resultForm();
  1447. });
  1448. },
  1449. bindDateChange(key, e) {
  1450. this.form[key] = e.detail.value;
  1451. },
  1452. retDraw() {
  1453. this.handwriting.retDraw();
  1454. this.$set(this.form, 'commitment_electr_signature', '');
  1455. this.openVerify = false;
  1456. this.$nextTick(function() {
  1457. this.resultForm();
  1458. });
  1459. },
  1460. uploadScaleStart(event) {
  1461. this.handwriting.uploadScaleStart(event);
  1462. },
  1463. uploadScaleMove(event) {
  1464. this.handwriting.uploadScaleMove(event);
  1465. },
  1466. uploadScaleEnd(event) {
  1467. this.handwriting.uploadScaleEnd(event);
  1468. },
  1469. subCanvas() {
  1470. return new Promise((resolve, reject) => {
  1471. var self = this;
  1472. console.log(self.form,'self.form')
  1473. if (self.form.commitment_electr_signature) {
  1474. resolve();
  1475. return;
  1476. }
  1477. self.handwriting
  1478. .saveCanvas()
  1479. .then(res => {
  1480. if (this.handwriting.linePrack.length) {
  1481. this.$set(this.form, 'commitment_electr_signature', res);
  1482. }
  1483. resolve(res);
  1484. })
  1485. .catch(err => {
  1486. uni.showToast({
  1487. title: '签名上传失败',
  1488. icon: 'error'
  1489. });
  1490. this.isUploading = false;
  1491. });
  1492. });
  1493. }
  1494. }
  1495. };
  1496. </script>
  1497. <style>
  1498. page {
  1499. background: #eaeef1;
  1500. }
  1501. </style>
  1502. <style scope lang="scss">
  1503. .ctoples {
  1504. position: absolute;
  1505. top: 0;
  1506. left: 0;
  1507. padding: 2rpx 23rpx;
  1508. display: inline-block;
  1509. background-color: rgba(0, 0, 0, 0.4);
  1510. font-size: 28rpx;
  1511. color: #fff;
  1512. border-bottom-right-radius: 24rpx;
  1513. }
  1514. .quzw {
  1515. width: 638rpx;
  1516. height: 638rpx;
  1517. position: relative;
  1518. border: 2rpx solid #eee;
  1519. border-radius: 8rpx;
  1520. }
  1521. .handWriting {
  1522. width: 100%;
  1523. height: 100%;
  1524. }
  1525. /deep/ .u-collapse-title {
  1526. color: #FF3B30;
  1527. font-size: 24rpx;
  1528. }
  1529. .collapse-item {
  1530. color: #666;
  1531. font-size: 24rpx;
  1532. padding-bottom: 30rpx;
  1533. }
  1534. .dis_stys {
  1535. display: flex;
  1536. align-items: center;
  1537. justify-content: space-between;
  1538. }
  1539. .handCenter {
  1540. background: #f7f7f7;
  1541. border: 2rpx solid #eeeeee;
  1542. border-radius: 24rpx;
  1543. width: 100%;
  1544. height: 300rpx;
  1545. overflow: hidden;
  1546. }
  1547. .headerSDels {
  1548. height: 58rpx;
  1549. padding: 0rpx 24rpx;
  1550. font-weight: bold;
  1551. display: flex;
  1552. align-items: center;
  1553. flex-direction: row-reverse;
  1554. }
  1555. .listBox {
  1556. margin: 24rpx 32rpx 0rpx;
  1557. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1558. border-radius: 32rpx;
  1559. background-color: #fff;
  1560. overflow: hidden;
  1561. }
  1562. .imgBoxs {
  1563. width: 156rpx;
  1564. height: 203rpx;
  1565. }
  1566. .imgBoxs2 {
  1567. width: 171rpx;
  1568. height: 108rpx;
  1569. }
  1570. .submit_btn {
  1571. width: 526rpx;
  1572. height: 80rpx;
  1573. background: #007aff;
  1574. border-radius: 40rpx;
  1575. text-align: center;
  1576. line-height: 80rpx;
  1577. color: #ffffff;
  1578. margin: 30rpx auto;
  1579. }
  1580. .picker {
  1581. text-align: right;
  1582. }
  1583. input {
  1584. text-align: right;
  1585. }
  1586. .bodyBox {
  1587. background: #ffffff;
  1588. border-radius: 24rpx;
  1589. width: 100%;
  1590. }
  1591. .topBox {
  1592. height: 80rpx;
  1593. background: #ffffff;
  1594. border-radius: 24rpx;
  1595. width: 100%;
  1596. display: flex;
  1597. justify-content: space-between;
  1598. line-height: 80rpx;
  1599. padding: 0 20rpx;
  1600. font-size: 24rpx;
  1601. }
  1602. .modal {
  1603. .agreement {
  1604. width: 640rpx;
  1605. height: 740rpx;
  1606. background: #FFFFFF;
  1607. display: flex;
  1608. flex-direction: column;
  1609. .body {
  1610. flex:1;
  1611. .content {
  1612. padding:30rpx 40rpx 28rpx;
  1613. line-height: 40rpx;
  1614. font-size: 26rpx;
  1615. color:#666;
  1616. .bold {
  1617. color:#333;
  1618. font-size: 26rpx;
  1619. font-weight: bold;
  1620. }
  1621. .center {
  1622. text-align: center;
  1623. }
  1624. }
  1625. }
  1626. .footer {
  1627. height:140rpx;
  1628. border-top:1px solid #EEEEEE;
  1629. display: flex;
  1630. align-items: center;
  1631. justify-content: center;
  1632. .btn {
  1633. margin:0 12rpx;
  1634. width: 200rpx;
  1635. height: 80rpx;
  1636. color:#007AFF;
  1637. font-size: 30rpx;
  1638. text-align: center;
  1639. line-height: 80rpx;
  1640. background: #F5F5F5;
  1641. border-radius: 40rpx 40rpx 40rpx 40rpx;
  1642. &.ok {
  1643. width: 336rpx;
  1644. height: 80rpx;
  1645. background: #007AFF;
  1646. color:#fff;
  1647. }
  1648. &.close {
  1649. color:#fff;
  1650. width: 560rpx;
  1651. height: 80rpx;
  1652. background: #007AFF;
  1653. border-radius: 40rpx 40rpx 40rpx 40rpx;
  1654. }
  1655. }
  1656. }
  1657. }
  1658. }
  1659. </style>