input_tang.vue 53 KB

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