input_tang.vue 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944
  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. if (this.userInfo.oneInchPhotos&&!this.form.recent_photos) {
  410. this.form.recent_photos = this.userInfo.oneInchPhotos;
  411. this.recent_photos_old = this.userInfo.oneInchPhotos;
  412. this.fileList1=[{url:this.baseUrls+this.userInfo.oneInchPhotos}];
  413. }
  414. if (this.userInfo.idCardImg1&&!this.form.idcard_face_photo) {
  415. this.form.idcard_face_photo = this.userInfo.idCardImg1;
  416. this.idcard_face_photo_old = this.userInfo.idCardImg1;
  417. this.fileList2=[{url:this.baseUrls+this.userInfo.idCardImg1}];
  418. }
  419. if (this.userInfo.idCardImg2&&! this.form.idcard_national_photo) {
  420. this.form.idcard_national_photo = this.userInfo.idCardImg2;
  421. this.fileList3=[{url:this.baseUrls+this.userInfo.idCardImg2}];
  422. }
  423. },
  424. onReady(res) {
  425. this.handwriting = new Handwriting({
  426. lineColor: this.lineColor,
  427. slideValue: this.slideValue, // 0, 25, 50, 75, 100
  428. canvasName: "handWriting",
  429. });
  430. this.$refs.uForm.setRules(this.rules);
  431. },
  432. computed: {
  433. ...mapGetters(["dictObj", "userInfo"]),
  434. disable() {
  435. return this.isDetail == 1;
  436. },
  437. },
  438. watch: {
  439. userInfo(val, oldVal) {
  440. //普通的watch监听
  441. if (val) {
  442. this.listData.forEach((item) => {
  443. if (item.fieldKey == "idcard") {
  444. this.form.idcard = this.userInfo.idCard;
  445. }
  446. if (item.fieldKey == "telphone") {
  447. this.form.telphone = this.userInfo.telphone;
  448. }
  449. if (item.fieldKey == "name") {
  450. this.form.name = this.userInfo.realname;
  451. }
  452. });
  453. }
  454. },
  455. },
  456. methods: {
  457. ...mapActions(["getUserInfo"]),
  458. inputName(event) {
  459. console.log("enevt", event, this.form.name);
  460. },
  461. clickIndex(inds) {
  462. if (inds === 0) {
  463. this.uploadImgs();
  464. }
  465. if (inds === 1) {
  466. this.uploadFieds();
  467. }
  468. },
  469. getChast() {
  470. this.showTableDown = true;
  471. },
  472. seePhotos(url) {
  473. console.log(url, 798);
  474. uni.previewImage({
  475. urls: [url],
  476. });
  477. },
  478. async downDocx(url) {
  479. let self = this;
  480. var ast = this.listData.some((item) => {
  481. return item.fieldKey === "commitment_electr_signature";
  482. });
  483. if (ast) {
  484. await this.subCanvas();
  485. }
  486. let data = JSON.parse(JSON.stringify(this.form));
  487. if (data["commitment_electr_signature"]) {
  488. data.commitment_electr_signature = await this.$method.uploadFile(
  489. data.commitment_electr_signature,
  490. 0
  491. );
  492. }
  493. if (this.remarkStatus) {
  494. var arsty = {};
  495. for (let k in data) {
  496. for (let j in self.copyData) {
  497. if (k === j) {
  498. if (self.copyData[j].value === data[k]) {
  499. arsty[k] = {
  500. fieldKey: k,
  501. value: data[k],
  502. fieldName: (function() {
  503. for (let i = 0; i < self.listData.length; i++) {
  504. if (self.listData[i].fieldKey == k) {
  505. return self.listData[i].fieldName;
  506. }
  507. }
  508. })(),
  509. status: 0,
  510. };
  511. } else {
  512. arsty[k] = {
  513. fieldKey: k,
  514. value: data[k],
  515. fieldName: (function() {
  516. for (let i = 0; i < self.listData.length; i++) {
  517. if (self.listData[i].fieldKey == k) {
  518. return self.listData[i].fieldName;
  519. }
  520. }
  521. })(),
  522. status: 1,
  523. };
  524. }
  525. }
  526. }
  527. }
  528. } else {
  529. var arsty = {};
  530. for (let k in data) {
  531. arsty[k] = {
  532. fieldKey: k,
  533. value: data[k],
  534. fieldName: (function() {
  535. for (let i = 0; i < self.listData.length; i++) {
  536. if (self.listData[i].fieldKey == k) {
  537. return self.listData[i].fieldName;
  538. }
  539. }
  540. })(),
  541. status: 0,
  542. };
  543. }
  544. }
  545. if (arsty["sex"]) {
  546. arsty.sex.value = this.dictObj["sys_user_sex"][Number(data.sex)];
  547. }
  548. if (arsty["education"]) {
  549. arsty.education.value = this.dictObj["edu_level"][Number(data.education)];
  550. }
  551. if (arsty["apply_post"]) {
  552. console.log(data)
  553. arsty.apply_post.value = this.dictObj["apply_post"][Number(data.apply_post)];
  554. }
  555. if (arsty["working_years"]) {
  556. arsty.working_years.value =
  557. this.dictObj["working_years"][Number(data.working_years)];
  558. }
  559. this.$api
  560. .baseProfileStampV2AddWord({
  561. goodsId: this.goodsId,
  562. keyValue: JSON.stringify(arsty),
  563. })
  564. .then((res) => {
  565. // #ifdef H5
  566. window.location.href = this.$method.splitImgHost(res.data.msg);
  567. // #endif
  568. // #ifdef MP-WEIXIN
  569. uni.downloadFile({
  570. url: this.$method.splitImgHost(res.data.msg),
  571. success: (result) => {
  572. if (result.statusCode === 200) {
  573. const filePath = result.tempFilePath;
  574. console.log(this.$method.splitImgHost(res.data.msg));
  575. this.$method.showToast("下载成功");
  576. uni.saveImageToPhotosAlbum({
  577. filePath: filePath,
  578. success: function(errMsg) {
  579. uni.showToast({
  580. mask: true,
  581. title: "保存成功",
  582. });
  583. },
  584. fail: (errMsg) => {
  585. uni.showToast({
  586. mask: true,
  587. title: "保存失败",
  588. });
  589. },
  590. complete: (errMsg) => {},
  591. });
  592. }
  593. },
  594. });
  595. // #endif
  596. });
  597. },
  598. getGoodsDetail() {
  599. return new Promise((resolve) => {
  600. this.$api
  601. .orderInfo({
  602. orderGoodsId: this.orderGoodsId,
  603. })
  604. .then((res) => {
  605. this.goodsData = res.data.data;
  606. console.log(
  607. "🚀 ~ file: input.vue:908 ~ .then ~ goodsData:",
  608. this.goodsData
  609. );
  610. // if (this.goodsData.categoryName) {
  611. // this.$set(this.form, "apply_post", this.goodsData.categoryName);
  612. // if (this.goodsData.categoryName) {
  613. // this.apply_post_disabled = true;
  614. // }
  615. // }
  616. if (this.userInfo && this.userInfo.companyName) {
  617. this.$set(this.form, "work_unit", this.userInfo.companyName);
  618. }
  619. resolve();
  620. });
  621. });
  622. },
  623. uploadImgs() {
  624. uni.chooseImage({
  625. count: 1, //默认9
  626. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  627. success: (res) => {
  628. if (res.tempFiles[0].size > 2097152) {
  629. this.$method.showToast("上传图片不得大于2M");
  630. return;
  631. } else {
  632. // this.uploadImgsChild(res.tempFiles[0].path);
  633. // #ifdef MP-WEIXIN
  634. var type = res.tempFiles[0].path.split(".").splice(-1);
  635. // #endif
  636. // #ifdef H5
  637. var type = res.tempFiles[0].type.split("/").splice(-1);
  638. // #endif
  639. if (type[0] != "jpg" && type[0] != "png" && type[0] != "jpeg") {
  640. this.$method.showToast("请上传图片格式");
  641. return;
  642. }
  643. this.$set(this.form, "commitment_seal", res.tempFiles[0].path);
  644. // 查看 职能修改承诺书
  645. if (this.disable) {
  646. this.$method
  647. .uploadFile(res.tempFiles[0].path, 0)
  648. .then((imageUrl) => {
  649. this.$api
  650. .updateCommitment({
  651. imageUrl,
  652. id: this.id
  653. })
  654. .then((res) => {
  655. if (res.data.code == 200) {
  656. this.$method.showToast("上传承诺书成功");
  657. } else {
  658. this.$method.showToast(res.data.msg);
  659. }
  660. });
  661. });
  662. }
  663. this.$nextTick(() => {
  664. this.resultForm();
  665. });
  666. }
  667. },
  668. });
  669. },
  670. uploadImgsChild(path) {
  671. // #ifdef MP-WEIXIN
  672. var type = path.split(".").splice(-1);
  673. // #endif
  674. // #ifdef H5
  675. var type = type.split("/").splice(-1);
  676. // #endif
  677. if (type[0] != "jpg" && type[0] != "png" && type[0] != "jpeg") {
  678. this.$method.showToast("请上传图片格式");
  679. return;
  680. }
  681. this.$set(this.form, "commitment_seal", path);
  682. this.$nextTick(() => {
  683. this.resultForm();
  684. });
  685. },
  686. uploadFieds() {
  687. var self = this;
  688. wx.chooseMessageFile({
  689. count: 1,
  690. size: 2097152,
  691. type: "file",
  692. success(res) {
  693. if (res.tempFiles[0].size > 2097152) {
  694. self.$method.showToast("上传文件不得大于2M");
  695. return;
  696. } else {
  697. var type = res.tempFiles[0].path.split(".").splice(-1);
  698. if (
  699. type[0] != "jpg" &&
  700. type[0] != "png" &&
  701. type[0] != "jpeg" &&
  702. type[0] != "docx" &&
  703. type[0] != "doc"
  704. ) {
  705. self.$method.showToast("请上传word文档或图片");
  706. return;
  707. }
  708. self.titleName = res.tempFiles[0].name;
  709. self.$set(self.form, "commitment_seal", res.tempFiles[0].path);
  710. self.$nextTick(function() {
  711. this.resultForm();
  712. });
  713. }
  714. },
  715. });
  716. },
  717. agree() {
  718. this.agreementModal = false;
  719. setTimeout(() => {
  720. this.$refs.collapse.init();
  721. }, 1000);
  722. },
  723. refuseAgreement() {
  724. uni.navigateBack({
  725. delta: 2,
  726. });
  727. },
  728. clearFun(key) {
  729. this.form[key] = "";
  730. },
  731. //清除按钮
  732. clearWatch(key) {
  733. if (this.disable) {
  734. return false;
  735. }
  736. if (this.form[key]) {
  737. return true;
  738. } else {
  739. return false;
  740. }
  741. },
  742. async uploadDatas(data) {
  743. if (this.form.recent_photos && this.form.idcard_face_photo) {
  744. let base64 = await this.$method.imageToBase64(
  745. this.form.idcard_face_photo
  746. );
  747. let resData = await this.faceCertificationIDCardOCR(1, base64);
  748. if (!resData.data) {
  749. uni.showModal({
  750. title: "提示",
  751. content: "身份证人像面照片异常,请重新上传",
  752. showCancel: false,
  753. });
  754. this.isUploading = false;
  755. return;
  756. }
  757. base64 = await this.$method.imageToBase64(this.form.recent_photos);
  758. let func1 = () => {
  759. var self = this;
  760. if (self.remarkStatus) {
  761. var arsty = {};
  762. for (let k in data) {
  763. for (let j in self.copyData) {
  764. if (k === j) {
  765. if (self.copyData[j].value === data[k]) {
  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: 0,
  778. };
  779. } else {
  780. arsty[k] = {
  781. fieldKey: k,
  782. value: data[k],
  783. fieldName: (function() {
  784. for (let i = 0; i < self.listData
  785. .length; i++) {
  786. if (self.listData[i].fieldKey == k) {
  787. return self.listData[i].fieldName;
  788. }
  789. }
  790. })(),
  791. status: 1,
  792. };
  793. }
  794. }
  795. }
  796. }
  797. var datas = {
  798. id: this.id,
  799. goodsId: this.goodsId,
  800. orderGoodsId: this.orderGoodsId,
  801. keyValue: JSON.stringify(arsty),
  802. };
  803. // this.isUploading = false;
  804. // return;
  805. this.$api.editbaseprofiletp(datas).then((res) => {
  806. this.isUploading = false;
  807. if (res.data.code === 200) {
  808. this.$method.showToast("提交成功");
  809. this.getUserInfo();
  810. setTimeout(() => {
  811. console.log("延迟");
  812. uni.navigateBack();
  813. }, 1500);
  814. } else {
  815. this.$method.showToast(res.data.msg);
  816. this.isUploading = false;
  817. }
  818. });
  819. } else {
  820. var objs = {};
  821. for (let k in data) {
  822. objs[k] = {
  823. fieldKey: k,
  824. value: data[k],
  825. fieldName: (function() {
  826. for (let i = 0; i < self.listData.length; i++) {
  827. if (self.listData[i].fieldKey == k) {
  828. return self.listData[i].fieldName;
  829. }
  830. }
  831. })(),
  832. status: 0,
  833. };
  834. }
  835. var datas = {
  836. goodsId: this.goodsId,
  837. profileTpId: this.goodsId,
  838. orderGoodsId: this.orderGoodsId,
  839. keyValue: JSON.stringify(objs),
  840. };
  841. // this.isUploading = false;
  842. // return;
  843. this.$api.addbaseprofiletp(datas).then((res) => {
  844. this.isUploading = false;
  845. if (res.data.code === 200) {
  846. this.$method.showToast("提交成功");
  847. this.getUserInfo();
  848. setTimeout(() => {
  849. console.log("延迟");
  850. uni.navigateBack();
  851. }, 1500);
  852. } else {
  853. this.$method.showToast(res.data.msg);
  854. this.isUploading = false;
  855. }
  856. });
  857. }
  858. }
  859. if (this.form.idcard_face_photo !== this.idcard_face_photo_old || this.form.recent_photos !== this
  860. .recent_photos_old) {
  861. const res1 = await this.$api
  862. .faceCertificationIdCardCompareFace({
  863. urlA: this.form.idcard_face_photo,
  864. oneInchPhotos: base64,
  865. })
  866. if (res1.data.data >= 70) {
  867. func1()
  868. } else {
  869. this.isUploading = false;
  870. uni.showModal({
  871. title: "提示",
  872. content: "个人近照和身份证人像面照片不匹配",
  873. showCancel: false,
  874. });
  875. }
  876. } else {
  877. func1()
  878. }
  879. return;
  880. }
  881. var self = this;
  882. if (self.remarkStatus) {
  883. var arsty = {};
  884. for (let k in data) {
  885. for (let j in self.copyData) {
  886. if (k === j) {
  887. if (self.copyData[j].value === data[k]) {
  888. arsty[k] = {
  889. fieldKey: k,
  890. value: data[k],
  891. fieldName: (function() {
  892. for (let i = 0; i < self.listData.length; i++) {
  893. if (self.listData[i].fieldKey == k) {
  894. return self.listData[i].fieldName;
  895. }
  896. }
  897. })(),
  898. status: 0,
  899. };
  900. } else {
  901. arsty[k] = {
  902. fieldKey: k,
  903. value: data[k],
  904. fieldName: (function() {
  905. for (let i = 0; i < self.listData.length; i++) {
  906. if (self.listData[i].fieldKey == k) {
  907. return self.listData[i].fieldName;
  908. }
  909. }
  910. })(),
  911. status: 1,
  912. };
  913. }
  914. }
  915. }
  916. }
  917. console.log(arsty, "arsty");
  918. if (Object.keys(arsty).length == 0) {
  919. uni.showModal({
  920. title: "提示",
  921. content: "数据错误,请联系管理员",
  922. });
  923. this.isUploading = false;
  924. return;
  925. }
  926. var datas = {
  927. id: this.id,
  928. goodsId: this.goodsId,
  929. orderGoodsId: this.orderGoodsId,
  930. keyValue: JSON.stringify(arsty),
  931. };
  932. console.log(datas, "datas1");
  933. this.$api.editbaseprofiletp(datas).then((res) => {
  934. this.isUploading = false;
  935. if (res.data.code === 200) {
  936. this.$method.showToast("提交成功");
  937. this.getUserInfo();
  938. setTimeout(() => {
  939. console.log("延迟");
  940. uni.navigateBack();
  941. }, 1500);
  942. } else {
  943. this.$method.showToast(res.data.msg);
  944. this.isUploading = false;
  945. }
  946. });
  947. } else {
  948. var objs = {};
  949. for (let k in data) {
  950. objs[k] = {
  951. fieldKey: k,
  952. value: data[k],
  953. fieldName: (function() {
  954. for (let i = 0; i < self.listData.length; i++) {
  955. if (self.listData[i].fieldKey == k) {
  956. return self.listData[i].fieldName;
  957. }
  958. }
  959. })(),
  960. status: 0,
  961. };
  962. }
  963. var datas = {
  964. goodsId: this.goodsId,
  965. profileTpId: this.goodsId,
  966. orderGoodsId: this.orderGoodsId,
  967. keyValue: JSON.stringify(objs),
  968. };
  969. console.log(datas, "datas2");
  970. // this.isUploading = false;
  971. // return;
  972. this.$api
  973. .addbaseprofiletp(datas)
  974. .then((res) => {
  975. this.isUploading = false;
  976. if (res.data.code === 200) {
  977. this.$method.showToast("提交成功");
  978. this.getUserInfo();
  979. setTimeout(() => {
  980. console.log("延迟");
  981. uni.navigateBack();
  982. }, 1500);
  983. } else {
  984. this.$method.showToast(res.data.msg);
  985. this.isUploading = false;
  986. }
  987. })
  988. .catch((err) => {});
  989. }
  990. },
  991. clearWord() {
  992. this.$set(this.form, "commitment_seal", "");
  993. this.titleName = "";
  994. },
  995. //提交表单
  996. async submitApi() {
  997. var data = JSON.parse(JSON.stringify(this.form));
  998. if (data["sex"]) {
  999. data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
  1000. }
  1001. if (data["education"]) {
  1002. data.education = this.dictObj["edu_level"][Number(data.education)];
  1003. }
  1004. if (data["apply_post"]) {
  1005. data.apply_post = this.dictObj["apply_post"][Number(data.apply_post)];
  1006. }
  1007. if (data["working_years"]) {
  1008. data.working_years =
  1009. this.dictObj["working_years"][Number(data.working_years)];
  1010. }
  1011. if (
  1012. data["idcard_face_photo"] &&
  1013. data["idcard_face_photo"].indexOf("oss/images") == -1
  1014. ) {
  1015. data.idcard_face_photo = await this.$method.uploadFile(
  1016. data.idcard_face_photo,
  1017. 0
  1018. );
  1019. }
  1020. if (
  1021. data["idcard_national_photo"] &&
  1022. data["idcard_national_photo"].indexOf("oss/images") == -1
  1023. ) {
  1024. data.idcard_national_photo = await this.$method.uploadFile(
  1025. data.idcard_national_photo,
  1026. 0
  1027. );
  1028. }
  1029. if (
  1030. data["commitment_electr_signature"] &&
  1031. data["commitment_electr_signature"].indexOf("oss/images") == -1
  1032. ) {
  1033. data.commitment_electr_signature = await this.$method.uploadFile(
  1034. data.commitment_electr_signature,
  1035. 0
  1036. );
  1037. }
  1038. if (
  1039. data["commitment_seal"] &&
  1040. data["commitment_seal"].indexOf("oss/images") == -1
  1041. ) {
  1042. data.commitment_seal = await this.$method.uploadFile(
  1043. data.commitment_seal,
  1044. 0
  1045. );
  1046. }
  1047. this.uploadDatas(data);
  1048. },
  1049. //验证表单
  1050. resultForm(int) {
  1051. console.log(this.openVerify, "openVerify");
  1052. console.log(this.isRequired, "isRequired");
  1053. if (this.openVerify) {
  1054. if (this.isRequired) {
  1055. this.submitApi();
  1056. } else {
  1057. if (int === 1) {
  1058. this.errorType = ["toast"];
  1059. } else {
  1060. this.errorType = ["message"];
  1061. }
  1062. this.$nextTick(() => {
  1063. this.$refs.uForm.validate((valid) => {
  1064. if (valid) {
  1065. if (int === 1) {
  1066. this.submitApi();
  1067. }
  1068. } else {
  1069. this.isUploading = false;
  1070. this.errorType = ["message"];
  1071. console.log(this.form);
  1072. console.log("验证失败");
  1073. }
  1074. });
  1075. });
  1076. }
  1077. }
  1078. },
  1079. async submits() {
  1080. if (this.isUploading) {
  1081. return;
  1082. }
  1083. this.isUploading = true;
  1084. var ast = this.listData.some((item) => {
  1085. return item.fieldKey === "commitment_electr_signature";
  1086. });
  1087. if (ast) {
  1088. await this.subCanvas();
  1089. }
  1090. this.openVerify = true;
  1091. this.resultForm(1);
  1092. },
  1093. async faceCertificationIDCardOCR(cardSide, base64) {
  1094. if (!this.$method.isBase64(base64)) {
  1095. base64 = await this.$method.fileToBase64(base64);
  1096. }
  1097. let res = await this.$api.faceCertificationIDCardOCR({
  1098. cardSide: cardSide, //1人像 2 国徽
  1099. cardImageBase64: base64,
  1100. gradeId: this.gradeId,
  1101. });
  1102. return Promise.resolve(res.data);
  1103. },
  1104. async changePhotoListHeader(lists, key) {
  1105. const map = {
  1106. recent_photos: 1,
  1107. idcard_face_photo: 2,
  1108. idcard_national_photo: 3,
  1109. };
  1110. const index = map[key];
  1111. if (lists.length) {
  1112. // #ifdef MP-WEIXIN
  1113. const isJPG =
  1114. lists[0].url.indexOf("//tmp") !== -1 ||
  1115. lists[0].url.indexOf("//temp") !== -1;
  1116. // #endif
  1117. // #ifdef H5
  1118. const isJPG =
  1119. lists[0].file.type === "image/jpeg" ||
  1120. lists[0].file.type === "image/png" ||
  1121. lists[0].file.type === "image/jpg";
  1122. // #endif
  1123. if (isJPG) {
  1124. // myCompressImage(lists[0].file, 100, async (url) => {
  1125. // if (index == 1) {
  1126. // url = await this.$method.uploadFile(url, 0);
  1127. // this.$set(this.form, "recent_photos", url);
  1128. // } else {
  1129. // this.$refs[key][0].remove(0);
  1130. // let titleMsg =
  1131. // "请上传正确清晰的身份证" +
  1132. // (index == 2 ? "人像" : "国徽") +
  1133. // "面照片";
  1134. // this.checkIdCard(index - 1, url, titleMsg, key);
  1135. // }
  1136. // });
  1137. let size = lists[0].file.size;
  1138. if (size < 2 * 1024 * 1024) {
  1139. this["fileList" + index] = lists;
  1140. if (index == 1) {
  1141. let url = lists[0].url;
  1142. // #ifdef MP-WEIXIN
  1143. url = await this.$method.imageInfos(url);
  1144. // #endif
  1145. // #ifdef H5
  1146. url = await this.$method.uploadFile(url, 0);
  1147. // #endif
  1148. this.$set(this.form, "recent_photos", url);
  1149. } else {
  1150. // #ifdef MP-WEIXIN
  1151. let url = lists[0].url;
  1152. // #endif
  1153. // #ifdef H5
  1154. let url = lists[0].file;
  1155. // #endif
  1156. this.$refs[key][0].remove(0);
  1157. let titleMsg =
  1158. "请上传正确清晰的身份证" +
  1159. (index == 2 ? "人像" : "国徽") +
  1160. "面照片";
  1161. this.checkIdCard(index - 1, url, titleMsg, key);
  1162. }
  1163. } else {
  1164. this.$refs[key][0].remove(0);
  1165. uni.showModal({
  1166. title: "提示",
  1167. content: "上传图片大小不能超过 2MB!",
  1168. showCancel: false,
  1169. });
  1170. return;
  1171. }
  1172. }
  1173. } else {
  1174. this["fileList" + index] = [];
  1175. this.$set(this.form, key, "");
  1176. }
  1177. this.openVerify = false;
  1178. this.$nextTick(function() {
  1179. this.resultForm();
  1180. });
  1181. },
  1182. async checkIdCard(cardSide, url, titleMsg, paramType) {
  1183. let res = await this.faceCertificationIDCardOCR(cardSide, url);
  1184. if (res.code == 500) {
  1185. uni.showToast({
  1186. icon: "none",
  1187. title: titleMsg,
  1188. });
  1189. return;
  1190. }
  1191. if (cardSide == 1) {
  1192. let {
  1193. IdName,
  1194. IdNum
  1195. } = res.data;
  1196. if (IdName != this.form.name || IdNum != this.form.idcard) {
  1197. uni.showModal({
  1198. content: IdName != this.form.name ?
  1199. "输入的姓名和身份证人像面照片姓名不匹配,请联系客服" : "输入的身份证号和身份证人像面照片身份证号不匹配,请联系客服",
  1200. showCancel: false,
  1201. success: (resultst) => {
  1202. if (resultst.confirm) {
  1203. uni.navigateBack();
  1204. }
  1205. },
  1206. });
  1207. return;
  1208. }
  1209. }
  1210. this.$refs[paramType][0].lists = [{
  1211. url: this.$method.splitImgHost(res.data.IdImgPath),
  1212. }, ];
  1213. this.$set(this.form, paramType, res.data.IdImgPath);
  1214. },
  1215. getTimes(key) {
  1216. if (this.form[key]) {
  1217. return this.form[key];
  1218. } else {
  1219. return "请选择时间";
  1220. }
  1221. },
  1222. getarrays(key) {
  1223. if (!this.dictObj) return;
  1224. if (key === "apply_post") {
  1225. return this.dictObj["apply_post"];
  1226. }
  1227. if (key === "sex") {
  1228. return this.dictObj["sys_user_sex"];
  1229. }
  1230. if (key === "education") {
  1231. if (
  1232. this.goodsData.educationName == "继续教育" &&
  1233. this.goodsData.projectName == "施工现场专业人员" &&
  1234. this.goodsData.businessName == "七大员"
  1235. ) {
  1236. if (
  1237. this.goodsData.categoryName == "材料员" ||
  1238. this.goodsData.categoryName == "资料员" ||
  1239. this.goodsData.categoryName == "劳务员"
  1240. ) {
  1241. return [
  1242. "职高",
  1243. "高中",
  1244. "专科",
  1245. "本科",
  1246. "硕士研究生",
  1247. "博士研究生"
  1248. ]
  1249. } else {
  1250. return ["专科", "本科", "硕士研究生", "博士研究生"]
  1251. }
  1252. } else {
  1253. return this.dictObj["edu_level"];
  1254. }
  1255. }
  1256. if (key === "working_years") {
  1257. return this.dictObj["working_years"];
  1258. }
  1259. },
  1260. returnName(key) {
  1261. if (!this.dictObj) return;
  1262. if (key === "apply_post") {
  1263. if (this.form[key]) {
  1264. return this.dictObj["apply_post"][Number(this.form[key])];
  1265. } else {
  1266. return "请选择报名岗位";
  1267. }
  1268. }
  1269. if (key === "sex") {
  1270. if (this.form[key]) {
  1271. return this.dictObj["sys_user_sex"][Number(this.form[key])];
  1272. } else {
  1273. return "请选择性别";
  1274. }
  1275. }
  1276. if (key === "education") {
  1277. if (this.form[key]) {
  1278. if (
  1279. this.goodsData.educationName == "继续教育" &&
  1280. this.goodsData.projectName == "施工现场专业人员" &&
  1281. this.goodsData.businessName == "七大员"
  1282. ) {
  1283. if (
  1284. this.goodsData.categoryName == "材料员" ||
  1285. this.goodsData.categoryName == "资料员" ||
  1286. this.goodsData.categoryName == "劳务员"
  1287. ) {
  1288. return [
  1289. "职高",
  1290. "高中",
  1291. "专科",
  1292. "本科",
  1293. "硕士研究生",
  1294. "博士研究生"
  1295. ][Number(this.form[key])]
  1296. } else {
  1297. return ["专科", "本科", "硕士研究生", "博士研究生"][Number(this.form[key])]
  1298. }
  1299. } else {
  1300. return this.dictObj["edu_level"][Number(this.form[key])];
  1301. }
  1302. } else {
  1303. return "请选择学历";
  1304. }
  1305. }
  1306. if (key === "working_years") {
  1307. if (this.form[key]) {
  1308. return this.dictObj["working_years"][Number(this.form[key])];
  1309. } else {
  1310. return "请选择工作年限";
  1311. }
  1312. }
  1313. },
  1314. /**
  1315. * getbaseprofiletpgetInfo接口返回值result.data.data不存在的话说明是第一次填写资料
  1316. */
  1317. getInfo() {
  1318. return new Promise((resolve) => {
  1319. var self = this;
  1320. this.$api.getbaseprofiletpId(this.goodsId).then((res) => {
  1321. self.listData = JSON.parse(res.data.data.keyValue);
  1322. var ast = JSON.parse(res.data.data.keyValue2);
  1323. self.listData = [...self.listData, ...ast];
  1324. console.log(self.listData, 'listData')
  1325. self.listData.forEach((item, index) => {
  1326. if (item.fieldKey == "idcard") {
  1327. this.form.idcard = this.userInfo.idCard;
  1328. this.disCard = this.form.idcard ? true : false;
  1329. }
  1330. if (item.fieldKey == "telphone") {
  1331. this.form.telphone = this.userInfo.telphone;
  1332. }
  1333. if (item.fieldKey == "name") {
  1334. this.form.name = this.userInfo.realname;
  1335. this.disName = this.form.name ? true : false;
  1336. }
  1337. });
  1338. self.isRequired = self.listData.every((ims) => {
  1339. return ims.required === false;
  1340. });
  1341. if (!this.disable) {
  1342. this.$nextTick(() => {
  1343. this.agreementModal = true;
  1344. });
  1345. }
  1346. self.$api
  1347. .getbaseprofiletpgetInfo({
  1348. goodsId: self.goodsId,
  1349. orderGoodsId: self.orderGoodsId,
  1350. })
  1351. .then((result) => {
  1352. console.log(
  1353. "🚀 ~ file: input.vue:1592 ~ .then ~ result:",
  1354. result
  1355. );
  1356. if (result.data.code === 200) {
  1357. if (!result.data.data) {
  1358. self.$api
  1359. .getbaseprofiletplistProfile({
  1360. pageNum: 1,
  1361. pageSize: 1
  1362. })
  1363. .then((kit) => {
  1364. if (kit.data.rows.length) {
  1365. var ajson = JSON.parse(kit.data.rows[0]
  1366. .keyValue);
  1367. self.listData.forEach((zyitem, zyindex) => {
  1368. for (let k in ajson) {
  1369. if (zyitem.fieldKey == k &&
  1370. ajson[k].value) {
  1371. if (k === "sex") {
  1372. const sexIndex =
  1373. self.dictObj[
  1374. "sys_user_sex"]
  1375. .indexOf(
  1376. ajson[k].value
  1377. ) + "";
  1378. self.$set(self.form, k,
  1379. sexIndex);
  1380. } else if (k ===
  1381. "education") {
  1382. if (
  1383. this.goodsData
  1384. .educationName ==
  1385. "继续教育" &&
  1386. this.goodsData
  1387. .projectName ==
  1388. "施工现场专业人员" &&
  1389. this.goodsData
  1390. .businessName ==
  1391. "七大员"
  1392. ) {
  1393. self.$set(self
  1394. .form, k,
  1395. "");
  1396. } else {
  1397. const sexIndex =
  1398. self.dictObj[
  1399. "edu_level"
  1400. ]
  1401. .indexOf(
  1402. ajson[k]
  1403. .value
  1404. ) + "";
  1405. self.$set(self
  1406. .form, k,
  1407. sexIndex);
  1408. }
  1409. } else if (k ===
  1410. "working_years") {
  1411. const sexIndex =
  1412. self.dictObj[
  1413. "working_years"
  1414. ].indexOf(
  1415. ajson[k].value
  1416. ) + "";
  1417. self.$set(self.form, k,
  1418. sexIndex);
  1419. } else if (k ===
  1420. "apply_post") {
  1421. const sexIndex =
  1422. self.dictObj[
  1423. "apply_post"
  1424. ].indexOf(
  1425. ajson[k].value
  1426. ) + "";
  1427. self.$set(self.form, k,
  1428. sexIndex);
  1429. } else if (k ===
  1430. "recent_photos") {
  1431. self.$set(self.form, k,
  1432. ajson[k].value);
  1433. self.recent_photos_old =
  1434. ajson[k].value
  1435. if (ajson[k].value) {
  1436. self.fileList1 = [{
  1437. url: self
  1438. .baseUrls +
  1439. ajson[
  1440. k
  1441. ]
  1442. .value,
  1443. }, ];
  1444. }
  1445. } else if (k ===
  1446. "idcard_face_photo") {
  1447. self.$set(self.form, k,
  1448. ajson[k].value);
  1449. self.idcard_face_photo_old =
  1450. ajson[k].value
  1451. if (ajson[k].value) {
  1452. self.fileList2 = [{
  1453. url: self
  1454. .baseUrls +
  1455. ajson[
  1456. k
  1457. ]
  1458. .value,
  1459. }, ];
  1460. }
  1461. } else if (k ===
  1462. "idcard_national_photo"
  1463. ) {
  1464. self.$set(self.form, k,
  1465. ajson[k].value);
  1466. if (ajson[k].value) {
  1467. self.fileList3 = [{
  1468. url: self
  1469. .baseUrls +
  1470. ajson[
  1471. k
  1472. ]
  1473. .value,
  1474. }, ];
  1475. }
  1476. } else {
  1477. if (k === "name") {
  1478. self.$set(
  1479. self.form,
  1480. k,
  1481. this.$store
  1482. .state
  1483. .userInfo
  1484. .realname
  1485. );
  1486. } else if (k ===
  1487. "idcard") {
  1488. self.$set(
  1489. self.form,
  1490. k,
  1491. this.$store
  1492. .state
  1493. .userInfo
  1494. .idCard
  1495. );
  1496. } else if (k ===
  1497. "telphone") {
  1498. self.$set(
  1499. self.form,
  1500. k,
  1501. this.$store
  1502. .state
  1503. .userInfo
  1504. .telphone
  1505. );
  1506. } else if (
  1507. k !==
  1508. "commitment_electr_signature"
  1509. ) {
  1510. self.$set(self
  1511. .form, k,
  1512. ajson[k]
  1513. .value);
  1514. }
  1515. }
  1516. }
  1517. }
  1518. });
  1519. resolve();
  1520. } else {
  1521. resolve();
  1522. }
  1523. });
  1524. }
  1525. if (
  1526. self.disable ||
  1527. (result.data.data && result.data.data.status === 3)
  1528. ) {
  1529. self.remark = result.data.data.text;
  1530. self.remarkStatus = true;
  1531. self.id = result.data.data.id;
  1532. var arrays = JSON.parse(result.data.data.keyValue);
  1533. // var arrays1 = JSON.parse(result.data.data.keyValue2);
  1534. self.copyData = JSON.parse(JSON.stringify(arrays));
  1535. for (let k in arrays) {
  1536. if (k === "sex") {
  1537. if (arrays[k].value) {
  1538. const sexIndex =
  1539. self.dictObj["sys_user_sex"].indexOf(
  1540. arrays[k].value
  1541. ) + "";
  1542. self.$set(self.form, k, sexIndex);
  1543. }
  1544. } else if (k === "education") {
  1545. if (arrays[k].value) {
  1546. const sexIndex =
  1547. self.dictObj["edu_level"].indexOf(arrays[k]
  1548. .value) +
  1549. "";
  1550. self.$set(self.form, k, sexIndex);
  1551. }
  1552. } else if (k === "apply_post") {
  1553. if (arrays[k].value) {
  1554. const sexIndex =
  1555. self.dictObj["apply_post"].indexOf(arrays[k]
  1556. .value) +
  1557. "";
  1558. self.$set(self.form, k, sexIndex);
  1559. }
  1560. } else if (k === "working_years") {
  1561. if (arrays[k].value) {
  1562. const sexIndex =
  1563. self.dictObj["working_years"].indexOf(
  1564. arrays[k].value
  1565. ) + "";
  1566. self.$set(self.form, k, sexIndex);
  1567. }
  1568. } else if (k === "recent_photos") {
  1569. self.$set(self.form, k, arrays[k].value);
  1570. self.recent_photos_old = arrays[k].value
  1571. if (arrays[k].value) {
  1572. self.fileList1 = [{
  1573. url: self.baseUrls + arrays[k].value
  1574. }, ];
  1575. }
  1576. } else if (k === "idcard_face_photo") {
  1577. self.$set(self.form, k, arrays[k].value);
  1578. self.idcard_face_photo_old = arrays[k].value
  1579. if (arrays[k].value) {
  1580. self.fileList2 = [{
  1581. url: self.baseUrls + arrays[k].value
  1582. }, ];
  1583. }
  1584. } else if (k === "idcard_national_photo") {
  1585. self.$set(self.form, k, arrays[k].value);
  1586. if (arrays[k].value) {
  1587. self.fileList3 = [{
  1588. url: self.baseUrls + arrays[k].value
  1589. }, ];
  1590. }
  1591. } else if (k === "name") {
  1592. self.$set(
  1593. self.form,
  1594. k,
  1595. this.$store.state.userInfo.realname
  1596. );
  1597. } else if (k === "idcard") {
  1598. self.$set(
  1599. self.form,
  1600. k,
  1601. this.$store.state.userInfo.idCard
  1602. );
  1603. } else if (k === "telphone") {
  1604. self.$set(
  1605. self.form,
  1606. k,
  1607. this.$store.state.userInfo.telphone
  1608. );
  1609. } else {
  1610. self.$set(self.form, k, arrays[k].value);
  1611. }
  1612. }
  1613. resolve();
  1614. } else if (
  1615. result.data.data &&
  1616. (result.data.data.status === 1 ||
  1617. result.data.data.status === 2)
  1618. ) {
  1619. uni.showModal({
  1620. showCancel: false,
  1621. content: result.data.data.status === 1 ?
  1622. "该商品审核资料已通过,不可重复提交资料" : result.data.data
  1623. .status === 2 ?
  1624. "该商品审核资料处于待审核状态,不可重复提交资料" : "请联系管理员",
  1625. success: function(k) {
  1626. if (k.confirm) {
  1627. uni.navigateBack();
  1628. }
  1629. },
  1630. });
  1631. }
  1632. }
  1633. });
  1634. });
  1635. });
  1636. },
  1637. bindPickerChange(key, e) {
  1638. let value = e.detail.value + "";
  1639. // if (key === "apply_post") {
  1640. // value = this.dictObj["apply_post"][value];
  1641. // }
  1642. this.$set(this.form, key, value);
  1643. this.openVerify = false;
  1644. this.$nextTick(function() {
  1645. this.resultForm();
  1646. });
  1647. },
  1648. bindDateChange(key, e) {
  1649. this.form[key] = e.detail.value;
  1650. },
  1651. retDraw() {
  1652. this.handwriting.retDraw();
  1653. this.$set(this.form, "commitment_electr_signature", "");
  1654. this.openVerify = false;
  1655. this.$nextTick(function() {
  1656. this.resultForm();
  1657. });
  1658. },
  1659. uploadScaleStart(event) {
  1660. this.handwriting.uploadScaleStart(event);
  1661. },
  1662. uploadScaleMove(event) {
  1663. this.handwriting.uploadScaleMove(event);
  1664. },
  1665. uploadScaleEnd(event) {
  1666. this.handwriting.uploadScaleEnd(event);
  1667. },
  1668. subCanvas() {
  1669. return new Promise((resolve, reject) => {
  1670. var self = this;
  1671. if (self.form.commitment_electr_signature) {
  1672. resolve();
  1673. return;
  1674. }
  1675. self.handwriting
  1676. .saveCanvas()
  1677. .then((res) => {
  1678. if (this.handwriting.linePrack.length) {
  1679. this.$set(this.form, "commitment_electr_signature", res);
  1680. }
  1681. resolve(res);
  1682. })
  1683. .catch((err) => {
  1684. uni.showToast({
  1685. title: "签名上传失败",
  1686. icon: "error",
  1687. });
  1688. this.isUploading = false;
  1689. });
  1690. });
  1691. },
  1692. },
  1693. };
  1694. </script>
  1695. <style>
  1696. page {
  1697. background: #eaeef1;
  1698. }
  1699. </style>
  1700. <style scope lang="scss">
  1701. .infos {
  1702. position: relative;
  1703. top: 0rpx;
  1704. left: 0rpx;
  1705. .photo_can {
  1706. width: 100%;
  1707. height: 100%;
  1708. position: absolute;
  1709. z-index: -1;
  1710. left: -10000rpx;
  1711. top: -10000rpx;
  1712. }
  1713. .zip_canvas {
  1714. width: 100%;
  1715. height: 600rpx;
  1716. border: 2rpx solid #333;
  1717. }
  1718. }
  1719. .ctoples {
  1720. position: absolute;
  1721. top: 0;
  1722. left: 0;
  1723. padding: 2rpx 23rpx;
  1724. display: inline-block;
  1725. background-color: rgba(0, 0, 0, 0.4);
  1726. font-size: 28rpx;
  1727. color: #fff;
  1728. border-bottom-right-radius: 24rpx;
  1729. }
  1730. .quzw {
  1731. width: 638rpx;
  1732. height: 638rpx;
  1733. position: relative;
  1734. border: 2rpx solid #eee;
  1735. border-radius: 8rpx;
  1736. .optionsAbs {
  1737. position: absolute;
  1738. right: 5px;
  1739. top: 5px;
  1740. }
  1741. }
  1742. .handWriting {
  1743. width: 100%;
  1744. height: 100%;
  1745. }
  1746. /deep/ .u-collapse-title {
  1747. color: #ff3b30;
  1748. font-size: 24rpx;
  1749. }
  1750. // /deep/ .u-input {
  1751. // text-align: right !important;
  1752. // }
  1753. .picker {
  1754. flex: 1;
  1755. }
  1756. /deep/ .u-form-item--right {
  1757. .u-input__input {
  1758. text-align: right;
  1759. }
  1760. uni-picker {
  1761. flex: 1;
  1762. }
  1763. }
  1764. .collapse-item {
  1765. color: #666;
  1766. font-size: 24rpx;
  1767. padding-bottom: 30rpx;
  1768. }
  1769. .dis_stys {
  1770. display: flex;
  1771. align-items: center;
  1772. justify-content: space-between;
  1773. }
  1774. .handCenter {
  1775. background: #f7f7f7;
  1776. border: 2rpx solid #eeeeee;
  1777. border-radius: 24rpx;
  1778. width: 100%;
  1779. height: 400rpx;
  1780. overflow: hidden;
  1781. }
  1782. .headerSDels {
  1783. height: 58rpx;
  1784. padding: 0rpx 24rpx;
  1785. font-weight: bold;
  1786. display: flex;
  1787. align-items: center;
  1788. flex-direction: row-reverse;
  1789. }
  1790. .listBox {
  1791. margin: 24rpx 32rpx 0rpx;
  1792. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1793. border-radius: 32rpx;
  1794. background-color: #fff;
  1795. overflow: hidden;
  1796. }
  1797. .imgBoxs {
  1798. width: 156rpx;
  1799. height: 203rpx;
  1800. }
  1801. .imgBoxs2 {
  1802. width: 171rpx;
  1803. height: 108rpx;
  1804. }
  1805. .submit_btn {
  1806. width: 526rpx;
  1807. height: 80rpx;
  1808. background: #007aff;
  1809. border-radius: 40rpx;
  1810. text-align: center;
  1811. line-height: 80rpx;
  1812. color: #ffffff;
  1813. margin: 30rpx auto;
  1814. }
  1815. .picker {
  1816. text-align: right;
  1817. }
  1818. input {
  1819. text-align: right;
  1820. }
  1821. .bodyBox {
  1822. background: #ffffff;
  1823. border-radius: 24rpx;
  1824. width: 100%;
  1825. }
  1826. .topBox {
  1827. height: 80rpx;
  1828. background: #ffffff;
  1829. border-radius: 24rpx;
  1830. width: 100%;
  1831. display: flex;
  1832. justify-content: space-between;
  1833. line-height: 80rpx;
  1834. padding: 0 20rpx;
  1835. font-size: 24rpx;
  1836. }
  1837. .modal {
  1838. .agreement {
  1839. width: 640rpx;
  1840. height: 740rpx;
  1841. background: #ffffff;
  1842. display: flex;
  1843. flex-direction: column;
  1844. .body {
  1845. flex: 1;
  1846. .content {
  1847. padding: 30rpx 40rpx 28rpx;
  1848. line-height: 40rpx;
  1849. font-size: 26rpx;
  1850. color: #666;
  1851. .bold {
  1852. color: #333;
  1853. font-size: 26rpx;
  1854. font-weight: bold;
  1855. }
  1856. .center {
  1857. text-align: center;
  1858. }
  1859. }
  1860. }
  1861. .footer {
  1862. height: 140rpx;
  1863. border-top: 1px solid #eeeeee;
  1864. display: flex;
  1865. align-items: center;
  1866. justify-content: center;
  1867. .btn {
  1868. margin: 0 12rpx;
  1869. width: 200rpx;
  1870. height: 80rpx;
  1871. color: #007aff;
  1872. font-size: 30rpx;
  1873. text-align: center;
  1874. line-height: 80rpx;
  1875. background: #f5f5f5;
  1876. border-radius: 40rpx 40rpx 40rpx 40rpx;
  1877. &.ok {
  1878. width: 336rpx;
  1879. height: 80rpx;
  1880. background: #007aff;
  1881. color: #fff;
  1882. }
  1883. &.close {
  1884. color: #fff;
  1885. width: 560rpx;
  1886. height: 80rpx;
  1887. background: #007aff;
  1888. border-radius: 40rpx 40rpx 40rpx 40rpx;
  1889. }
  1890. }
  1891. }
  1892. }
  1893. }
  1894. </style>