input.vue 57 KB

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