input.vue 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006
  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. let resData = await this.faceCertificationIDCardOCR(1, base64);
  810. if (!resData.data) {
  811. uni.showModal({
  812. title: "提示",
  813. content: "身份证人像面照片异常,请重新上传",
  814. showCancel: false,
  815. });
  816. this.isUploading = false;
  817. return;
  818. }
  819. base64 = await this.$method.imageToBase64(this.form.recent_photos,1);
  820. let func1 = () => {
  821. var self = this;
  822. if (self.remarkStatus) {
  823. var arsty = {};
  824. for (let k in data) {
  825. for (let j in self.copyData) {
  826. if (k === j) {
  827. if (self.copyData[j].value === data[k]) {
  828. arsty[k] = {
  829. fieldKey: k,
  830. value: data[k],
  831. fieldName: (function() {
  832. for (let i = 0; i < self.listData
  833. .length; i++) {
  834. if (self.listData[i].fieldKey == k) {
  835. return self.listData[i].fieldName;
  836. }
  837. }
  838. })(),
  839. status: 0,
  840. };
  841. } else {
  842. arsty[k] = {
  843. fieldKey: k,
  844. value: data[k],
  845. fieldName: (function() {
  846. for (let i = 0; i < self.listData
  847. .length; i++) {
  848. if (self.listData[i].fieldKey == k) {
  849. return self.listData[i].fieldName;
  850. }
  851. }
  852. })(),
  853. status: 1,
  854. };
  855. }
  856. }
  857. }
  858. }
  859. var datas = {
  860. id: this.id,
  861. goodsId: this.goodsId,
  862. orderGoodsId: this.orderGoodsId,
  863. keyValue: JSON.stringify(arsty),
  864. };
  865. // this.isUploading = false;
  866. // return;
  867. this.$api.editbaseprofiletp(datas).then((res) => {
  868. this.isUploading = false;
  869. if (res.data.code === 200) {
  870. this.$method.showToast("提交成功");
  871. this.getUserInfo();
  872. setTimeout(() => {
  873. console.log("延迟");
  874. uni.navigateBack();
  875. }, 1500);
  876. } else {
  877. this.$method.showToast(res.data.msg);
  878. this.isUploading = false;
  879. }
  880. });
  881. } else {
  882. var objs = {};
  883. for (let k in data) {
  884. objs[k] = {
  885. fieldKey: k,
  886. value: data[k],
  887. fieldName: (function() {
  888. for (let i = 0; i < self.listData.length; i++) {
  889. if (self.listData[i].fieldKey == k) {
  890. return self.listData[i].fieldName;
  891. }
  892. }
  893. })(),
  894. status: 0,
  895. };
  896. }
  897. var datas = {
  898. goodsId: this.goodsId,
  899. profileTpId: this.goodsId,
  900. orderGoodsId: this.orderGoodsId,
  901. keyValue: JSON.stringify(objs),
  902. };
  903. // this.isUploading = false;
  904. // return;
  905. this.$api.addbaseprofiletp(datas).then((res) => {
  906. this.isUploading = false;
  907. if (res.data.code === 200) {
  908. this.$method.showToast("提交成功");
  909. this.getUserInfo();
  910. setTimeout(() => {
  911. console.log("延迟");
  912. uni.navigateBack();
  913. }, 1500);
  914. } else {
  915. this.$method.showToast(res.data.msg);
  916. this.isUploading = false;
  917. }
  918. });
  919. }
  920. }
  921. if (this.form.idcard_face_photo !== this.idcard_face_photo_old || this.form.recent_photos !== this
  922. .recent_photos_old) {
  923. const res1 = await this.$api
  924. .faceCertificationIdCardCompareFace({
  925. urlA: this.form.idcard_face_photo,
  926. oneInchPhotos: base64,
  927. })
  928. if (res1.data.data >= 70) {
  929. func1()
  930. } else {
  931. this.isUploading = false;
  932. uni.showModal({
  933. title: "提示",
  934. content: "个人近照和身份证人像面照片不匹配",
  935. showCancel: false,
  936. });
  937. }
  938. } else {
  939. func1()
  940. }
  941. return;
  942. }
  943. var self = this;
  944. if (self.remarkStatus) {
  945. var arsty = {};
  946. for (let k in data) {
  947. for (let j in self.copyData) {
  948. if (k === j) {
  949. if (self.copyData[j].value === data[k]) {
  950. arsty[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. } else {
  963. arsty[k] = {
  964. fieldKey: k,
  965. value: data[k],
  966. fieldName: (function() {
  967. for (let i = 0; i < self.listData.length; i++) {
  968. if (self.listData[i].fieldKey == k) {
  969. return self.listData[i].fieldName;
  970. }
  971. }
  972. })(),
  973. status: 1,
  974. };
  975. }
  976. }
  977. }
  978. }
  979. console.log(arsty, "arsty");
  980. if (Object.keys(arsty).length == 0) {
  981. uni.showModal({
  982. title: "提示",
  983. content: "数据错误,请联系管理员",
  984. });
  985. this.isUploading = false;
  986. return;
  987. }
  988. var datas = {
  989. id: this.id,
  990. goodsId: this.goodsId,
  991. orderGoodsId: this.orderGoodsId,
  992. keyValue: JSON.stringify(arsty),
  993. };
  994. console.log(datas, "datas1");
  995. this.$api.editbaseprofiletp(datas).then((res) => {
  996. this.isUploading = false;
  997. if (res.data.code === 200) {
  998. this.$method.showToast("提交成功");
  999. this.getUserInfo();
  1000. setTimeout(() => {
  1001. console.log("延迟");
  1002. uni.navigateBack();
  1003. }, 1500);
  1004. } else {
  1005. this.$method.showToast(res.data.msg);
  1006. this.isUploading = false;
  1007. }
  1008. });
  1009. } else {
  1010. var objs = {};
  1011. for (let k in data) {
  1012. objs[k] = {
  1013. fieldKey: k,
  1014. value: data[k],
  1015. fieldName: (function() {
  1016. for (let i = 0; i < self.listData.length; i++) {
  1017. if (self.listData[i].fieldKey == k) {
  1018. return self.listData[i].fieldName;
  1019. }
  1020. }
  1021. })(),
  1022. status: 0,
  1023. };
  1024. }
  1025. var datas = {
  1026. goodsId: this.goodsId,
  1027. profileTpId: this.goodsId,
  1028. orderGoodsId: this.orderGoodsId,
  1029. keyValue: JSON.stringify(objs),
  1030. };
  1031. console.log(datas, "datas2");
  1032. // this.isUploading = false;
  1033. // return;
  1034. this.$api
  1035. .addbaseprofiletp(datas)
  1036. .then((res) => {
  1037. this.isUploading = false;
  1038. if (res.data.code === 200) {
  1039. this.$method.showToast("提交成功");
  1040. this.getUserInfo();
  1041. setTimeout(() => {
  1042. console.log("延迟");
  1043. uni.navigateBack();
  1044. }, 1500);
  1045. } else {
  1046. this.$method.showToast(res.data.msg);
  1047. this.isUploading = false;
  1048. }
  1049. })
  1050. .catch((err) => {});
  1051. }
  1052. },
  1053. clearWord() {
  1054. this.$set(this.form, "commitment_seal", "");
  1055. this.titleName = "";
  1056. },
  1057. //提交表单
  1058. async submitApi() {
  1059. var data = JSON.parse(JSON.stringify(this.form));
  1060. if (data["sex"]) {
  1061. data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
  1062. }
  1063. if (data["education"]) {
  1064. data.education = this.dictObj["edu_level"][Number(data.education)];
  1065. }
  1066. if (data["apply_post"]) {
  1067. data.apply_post = this.dictObj["apply_post"][Number(data.apply_post)];
  1068. }
  1069. if (data["working_years"]) {
  1070. data.working_years =
  1071. this.dictObj["working_years"][Number(data.working_years)];
  1072. }
  1073. if (
  1074. data["idcard_face_photo"] &&
  1075. data["idcard_face_photo"].indexOf("oss/images") == -1
  1076. ) {
  1077. data.idcard_face_photo = await this.$method.uploadFile(
  1078. data.idcard_face_photo,
  1079. 0
  1080. );
  1081. }
  1082. if (
  1083. data["idcard_national_photo"] &&
  1084. data["idcard_national_photo"].indexOf("oss/images") == -1
  1085. ) {
  1086. data.idcard_national_photo = await this.$method.uploadFile(
  1087. data.idcard_national_photo,
  1088. 0
  1089. );
  1090. }
  1091. if (
  1092. data["commitment_electr_signature"] &&
  1093. data["commitment_electr_signature"].indexOf("oss/images") == -1
  1094. ) {
  1095. data.commitment_electr_signature = await this.$method.uploadFile(
  1096. data.commitment_electr_signature,
  1097. 0
  1098. );
  1099. }
  1100. if (
  1101. data["commitment_seal"] &&
  1102. data["commitment_seal"].indexOf("oss/images") == -1
  1103. ) {
  1104. data.commitment_seal = await this.$method.uploadFile(
  1105. data.commitment_seal,
  1106. 0
  1107. );
  1108. }
  1109. this.uploadDatas(data);
  1110. },
  1111. //验证表单
  1112. resultForm(int) {
  1113. console.log(this.openVerify, "openVerify");
  1114. console.log(this.isRequired, "isRequired");
  1115. if (this.openVerify) {
  1116. if (this.isRequired) {
  1117. this.submitApi();
  1118. } else {
  1119. if (int === 1) {
  1120. this.errorType = ["toast"];
  1121. } else {
  1122. this.errorType = ["message"];
  1123. }
  1124. this.$nextTick(() => {
  1125. this.$refs.uForm.validate((valid) => {
  1126. if (valid) {
  1127. if (int === 1) {
  1128. this.submitApi();
  1129. }
  1130. } else {
  1131. this.isUploading = false;
  1132. this.errorType = ["message"];
  1133. console.log(this.form);
  1134. console.log("验证失败");
  1135. }
  1136. });
  1137. });
  1138. }
  1139. }
  1140. },
  1141. async submits() {
  1142. if (this.isUploading) {
  1143. return;
  1144. }
  1145. this.isUploading = true;
  1146. var ast = this.listData.some((item) => {
  1147. return item.fieldKey === "commitment_electr_signature";
  1148. });
  1149. if (ast) {
  1150. await this.subCanvas();
  1151. }
  1152. this.openVerify = true;
  1153. this.resultForm(1);
  1154. },
  1155. async faceCertificationIDCardOCR(cardSide, base64) {
  1156. if (!this.$method.isBase64(base64)) {
  1157. base64 = await this.$method.fileToBase64(base64);
  1158. }
  1159. let res = await this.$api.faceCertificationIDCardOCR({
  1160. cardSide: cardSide, //1人像 2 国徽
  1161. cardImageBase64: base64,
  1162. gradeId: this.gradeId,
  1163. });
  1164. return Promise.resolve(res.data);
  1165. },
  1166. async changePhotoListHeader(lists, key) {
  1167. const map = {
  1168. recent_photos: 1,
  1169. idcard_face_photo: 2,
  1170. idcard_national_photo: 3,
  1171. };
  1172. const index = map[key];
  1173. if (lists.length) {
  1174. // #ifdef MP-WEIXIN
  1175. const isJPG =
  1176. lists[0].url.indexOf("//tmp") !== -1 ||
  1177. lists[0].url.indexOf("//temp") !== -1;
  1178. // #endif
  1179. // #ifdef H5
  1180. console.log(lists,'lists')
  1181. const isJPG =
  1182. lists[0].file.type === "image/jpeg" ||
  1183. lists[0].file.type === "image/png" ||
  1184. lists[0].file.type === "image/jpg";
  1185. // #endif
  1186. if (isJPG) {
  1187. // myCompressImage(lists[0].file, 100, async (url) => {
  1188. // if (index == 1) {
  1189. // url = await this.$method.uploadFile(url, 0);
  1190. // this.$set(this.form, "recent_photos", url);
  1191. // } else {
  1192. // this.$refs[key][0].remove(0);
  1193. // let titleMsg =
  1194. // "请上传正确清晰的身份证" +
  1195. // (index == 2 ? "人像" : "国徽") +
  1196. // "面照片";
  1197. // this.checkIdCard(index - 1, url, titleMsg, key);
  1198. // }
  1199. // });
  1200. let size = lists[0].file.size;
  1201. if (size < 2 * 1024 * 1024) {
  1202. this["fileList" + index] = lists;
  1203. if (index == 1) {
  1204. let url = lists[0].url;
  1205. // #ifdef MP-WEIXIN
  1206. url = await this.$method.imageInfos(url);
  1207. // #endif
  1208. // #ifdef H5
  1209. url = await this.$method.uploadFile(url, 0);
  1210. // #endif
  1211. this.$set(this.form, "recent_photos", url);
  1212. } else {
  1213. // #ifdef MP-WEIXIN
  1214. let url = lists[0].url;
  1215. // #endif
  1216. // #ifdef H5
  1217. let url = lists[0].file;
  1218. // #endif
  1219. this.$refs[key][0].remove(0);
  1220. let titleMsg =
  1221. "请上传正确清晰的身份证" +
  1222. (index == 2 ? "人像" : "国徽") +
  1223. "面照片";
  1224. this.checkIdCard(index - 1, url, titleMsg, key);
  1225. }
  1226. } else {
  1227. this.$refs[key][0].remove(0);
  1228. uni.showModal({
  1229. title: "提示",
  1230. content: "上传图片大小不能超过 2MB!",
  1231. showCancel: false,
  1232. });
  1233. return;
  1234. }
  1235. }
  1236. } else {
  1237. this["fileList" + index] = [];
  1238. this.$set(this.form, key, "");
  1239. }
  1240. this.openVerify = false;
  1241. this.$nextTick(function() {
  1242. this.resultForm();
  1243. });
  1244. },
  1245. async checkIdCard(cardSide, url, titleMsg, paramType) {
  1246. let res = await this.faceCertificationIDCardOCR(cardSide, url);
  1247. if (res.code == 500) {
  1248. uni.showToast({
  1249. icon: "none",
  1250. title: titleMsg,
  1251. });
  1252. return;
  1253. }
  1254. if (cardSide == 1) {
  1255. let {
  1256. IdName,
  1257. IdNum
  1258. } = res.data;
  1259. if (IdName != this.form.name || IdNum != this.form.idcard) {
  1260. uni.showModal({
  1261. content: IdName != this.form.name ?
  1262. "输入的姓名和身份证人像面照片姓名不匹配,请联系客服" : "输入的身份证号和身份证人像面照片身份证号不匹配,请联系客服",
  1263. showCancel: false,
  1264. success: (resultst) => {
  1265. if (resultst.confirm) {
  1266. uni.navigateBack();
  1267. }
  1268. },
  1269. });
  1270. return;
  1271. }
  1272. }
  1273. this.$refs[paramType][0].lists = [{
  1274. url: this.$method.splitImgHost(res.data.IdImgPath),
  1275. }, ];
  1276. this.$set(this.form, paramType, res.data.IdImgPath);
  1277. },
  1278. getTimes(key) {
  1279. if (this.form[key]) {
  1280. return this.form[key];
  1281. } else {
  1282. return "请选择时间";
  1283. }
  1284. },
  1285. getarrays(key) {
  1286. if (!this.dictObj) return;
  1287. if (key === "apply_post") {
  1288. return this.dictObj["apply_post"];
  1289. }
  1290. if (key === "sex") {
  1291. return this.dictObj["sys_user_sex"];
  1292. }
  1293. if (key === "education") {
  1294. if (
  1295. this.goodsData.educationName == "继续教育" &&
  1296. this.goodsData.projectName == "施工现场专业人员" &&
  1297. this.goodsData.businessName == "七大员"
  1298. ) {
  1299. if (
  1300. this.goodsData.categoryName == "材料员" ||
  1301. this.goodsData.categoryName == "资料员" ||
  1302. this.goodsData.categoryName == "劳务员"
  1303. ) {
  1304. return [
  1305. "职高",
  1306. "高中",
  1307. "专科",
  1308. "本科",
  1309. "硕士研究生",
  1310. "博士研究生"
  1311. ]
  1312. } else {
  1313. return ["专科", "本科", "硕士研究生", "博士研究生"]
  1314. }
  1315. } else {
  1316. return this.dictObj["edu_level"];
  1317. }
  1318. }
  1319. if (key === "working_years") {
  1320. return this.dictObj["working_years"];
  1321. }
  1322. },
  1323. returnName(key) {
  1324. if (!this.dictObj) return;
  1325. if (key === "apply_post") {
  1326. if (this.form[key]) {
  1327. return this.dictObj["apply_post"][Number(this.form[key])];
  1328. } else {
  1329. return "请选择报名岗位";
  1330. }
  1331. }
  1332. if (key === "sex") {
  1333. if (this.form[key]) {
  1334. return this.dictObj["sys_user_sex"][Number(this.form[key])];
  1335. } else {
  1336. return "请选择性别";
  1337. }
  1338. }
  1339. if (key === "education") {
  1340. if (this.form[key]) {
  1341. if (
  1342. this.goodsData.educationName == "继续教育" &&
  1343. this.goodsData.projectName == "施工现场专业人员" &&
  1344. this.goodsData.businessName == "七大员"
  1345. ) {
  1346. if (
  1347. this.goodsData.categoryName == "材料员" ||
  1348. this.goodsData.categoryName == "资料员" ||
  1349. this.goodsData.categoryName == "劳务员"
  1350. ) {
  1351. return [
  1352. "职高",
  1353. "高中",
  1354. "专科",
  1355. "本科",
  1356. "硕士研究生",
  1357. "博士研究生"
  1358. ][Number(this.form[key])]
  1359. } else {
  1360. return ["专科", "本科", "硕士研究生", "博士研究生"][Number(this.form[key])]
  1361. }
  1362. } else {
  1363. return this.dictObj["edu_level"][Number(this.form[key])];
  1364. }
  1365. } else {
  1366. return "请选择学历";
  1367. }
  1368. }
  1369. if (key === "working_years") {
  1370. if (this.form[key]) {
  1371. return this.dictObj["working_years"][Number(this.form[key])];
  1372. } else {
  1373. return "请选择工作年限";
  1374. }
  1375. }
  1376. },
  1377. /**
  1378. * getbaseprofiletpgetInfo接口返回值result.data.data不存在的话说明是第一次填写资料
  1379. */
  1380. getInfo() {
  1381. return new Promise((resolve) => {
  1382. var self = this;
  1383. this.$api.getbaseprofiletpId(this.goodsId).then((res) => {
  1384. self.listData = JSON.parse(res.data.data.keyValue);
  1385. var ast = JSON.parse(res.data.data.keyValue2);
  1386. self.listData = [...self.listData, ...ast];
  1387. self.listData.forEach((item, index) => {
  1388. if (item.fieldKey == "idcard") {
  1389. this.form.idcard = this.userInfo.idCard;
  1390. this.disCard = this.form.idcard ? true : false;
  1391. }
  1392. if (item.fieldKey == "telphone") {
  1393. this.form.telphone = this.userInfo.telphone;
  1394. }
  1395. if (item.fieldKey == "name") {
  1396. this.form.name = this.userInfo.realname;
  1397. this.disName = this.form.name ? true : false;
  1398. }
  1399. });
  1400. self.isRequired = self.listData.every((ims) => {
  1401. return ims.required === false;
  1402. });
  1403. if (!this.disable) {
  1404. this.$nextTick(() => {
  1405. this.agreementModal = true;
  1406. });
  1407. }
  1408. self.$api
  1409. .getbaseprofiletpgetInfo({
  1410. goodsId: self.goodsId,
  1411. orderGoodsId: self.orderGoodsId,
  1412. })
  1413. .then((result) => {
  1414. console.log(
  1415. "🚀 ~ file: input.vue:1592 ~ .then ~ result:",
  1416. result
  1417. );
  1418. if (result.data.code === 200) {
  1419. if (!result.data.data) {
  1420. self.$api
  1421. .getbaseprofiletplistProfile({
  1422. pageNum: 1,
  1423. pageSize: 1
  1424. })
  1425. .then((kit) => {
  1426. if (kit.data.rows.length) {
  1427. var ajson = JSON.parse(kit.data.rows[0]
  1428. .keyValue);
  1429. self.listData.forEach((zyitem, zyindex) => {
  1430. for (let k in ajson) {
  1431. if (zyitem.fieldKey == k &&
  1432. ajson[k].value) {
  1433. if (k === "sex") {
  1434. const sexIndex =
  1435. self.dictObj[
  1436. "sys_user_sex"]
  1437. .indexOf(
  1438. ajson[k].value
  1439. ) + "";
  1440. self.$set(self.form, k,
  1441. sexIndex);
  1442. } else if (k ===
  1443. "education") {
  1444. if (
  1445. this.goodsData
  1446. .educationName ==
  1447. "继续教育" &&
  1448. this.goodsData
  1449. .projectName ==
  1450. "施工现场专业人员" &&
  1451. this.goodsData
  1452. .businessName ==
  1453. "七大员"
  1454. ) {
  1455. self.$set(self
  1456. .form, k,
  1457. "");
  1458. } else {
  1459. const sexIndex =
  1460. self.dictObj[
  1461. "edu_level"
  1462. ]
  1463. .indexOf(
  1464. ajson[k]
  1465. .value
  1466. ) + "";
  1467. self.$set(self
  1468. .form, k,
  1469. sexIndex);
  1470. }
  1471. } else if (k ===
  1472. "working_years") {
  1473. const sexIndex =
  1474. self.dictObj[
  1475. "working_years"
  1476. ].indexOf(
  1477. ajson[k].value
  1478. ) + "";
  1479. self.$set(self.form, k,
  1480. sexIndex);
  1481. } else if (k ===
  1482. "apply_post") {
  1483. const sexIndex =
  1484. self.dictObj[
  1485. "apply_post"
  1486. ].indexOf(
  1487. ajson[k].value
  1488. ) + "";
  1489. self.$set(self.form, k,
  1490. sexIndex);
  1491. } else if (k ===
  1492. "recent_photos") {
  1493. self.$set(self.form, k,
  1494. ajson[k].value);
  1495. self.recent_photos_old =
  1496. ajson[k].value
  1497. if (ajson[k].value) {
  1498. self.fileList1 = [{
  1499. url: self
  1500. .baseUrls +
  1501. ajson[
  1502. k
  1503. ]
  1504. .value,
  1505. }, ];
  1506. }
  1507. } else if (k ===
  1508. "idcard_face_photo") {
  1509. self.$set(self.form, k,
  1510. ajson[k].value);
  1511. self.idcard_face_photo_old =
  1512. ajson[k].value
  1513. if (ajson[k].value) {
  1514. self.fileList2 = [{
  1515. url: self
  1516. .baseUrls +
  1517. ajson[
  1518. k
  1519. ]
  1520. .value,
  1521. }, ];
  1522. }
  1523. } else if (k ===
  1524. "idcard_national_photo"
  1525. ) {
  1526. self.$set(self.form, k,
  1527. ajson[k].value);
  1528. if (ajson[k].value) {
  1529. self.fileList3 = [{
  1530. url: self
  1531. .baseUrls +
  1532. ajson[
  1533. k
  1534. ]
  1535. .value,
  1536. }, ];
  1537. }
  1538. } else {
  1539. if (k === "name") {
  1540. self.$set(
  1541. self.form,
  1542. k,
  1543. this.$store
  1544. .state
  1545. .userInfo
  1546. .realname
  1547. );
  1548. } else if (k ===
  1549. "idcard") {
  1550. self.$set(
  1551. self.form,
  1552. k,
  1553. this.$store
  1554. .state
  1555. .userInfo
  1556. .idCard
  1557. );
  1558. } else if (k ===
  1559. "telphone") {
  1560. self.$set(
  1561. self.form,
  1562. k,
  1563. this.$store
  1564. .state
  1565. .userInfo
  1566. .telphone
  1567. );
  1568. } else if (
  1569. k !==
  1570. "commitment_electr_signature"
  1571. ) {
  1572. self.$set(self
  1573. .form, k,
  1574. ajson[k]
  1575. .value);
  1576. }
  1577. }
  1578. }
  1579. }
  1580. });
  1581. resolve();
  1582. } else {
  1583. resolve();
  1584. }
  1585. });
  1586. }
  1587. if (
  1588. self.disable ||
  1589. (result.data.data && result.data.data.status === 3)
  1590. ) {
  1591. self.remark = result.data.data.text;
  1592. self.remarkStatus = true;
  1593. self.id = result.data.data.id;
  1594. var arrays = JSON.parse(result.data.data.keyValue);
  1595. // var arrays1 = JSON.parse(result.data.data.keyValue2);
  1596. self.copyData = JSON.parse(JSON.stringify(arrays));
  1597. for (let k in arrays) {
  1598. if (k === "sex") {
  1599. if (arrays[k].value) {
  1600. const sexIndex =
  1601. self.dictObj["sys_user_sex"].indexOf(
  1602. arrays[k].value
  1603. ) + "";
  1604. self.$set(self.form, k, sexIndex);
  1605. }
  1606. } else if (k === "education") {
  1607. if (arrays[k].value) {
  1608. const sexIndex =
  1609. self.dictObj["edu_level"].indexOf(arrays[k]
  1610. .value) +
  1611. "";
  1612. self.$set(self.form, k, sexIndex);
  1613. }
  1614. } else if (k === "apply_post") {
  1615. if (arrays[k].value) {
  1616. const sexIndex =
  1617. self.dictObj["apply_post"].indexOf(arrays[k]
  1618. .value) +
  1619. "";
  1620. self.$set(self.form, k, sexIndex);
  1621. }
  1622. } else if (k === "working_years") {
  1623. if (arrays[k].value) {
  1624. const sexIndex =
  1625. self.dictObj["working_years"].indexOf(
  1626. arrays[k].value
  1627. ) + "";
  1628. self.$set(self.form, k, sexIndex);
  1629. }
  1630. } else if (k === "recent_photos") {
  1631. self.$set(self.form, k, arrays[k].value);
  1632. self.recent_photos_old = arrays[k].value
  1633. if (arrays[k].value) {
  1634. self.fileList1 = [{
  1635. url: self.baseUrls + arrays[k].value
  1636. }, ];
  1637. }
  1638. } else if (k === "idcard_face_photo") {
  1639. self.$set(self.form, k, arrays[k].value);
  1640. self.idcard_face_photo_old = arrays[k].value
  1641. if (arrays[k].value) {
  1642. self.fileList2 = [{
  1643. url: self.baseUrls + arrays[k].value
  1644. }, ];
  1645. }
  1646. } else if (k === "idcard_national_photo") {
  1647. self.$set(self.form, k, arrays[k].value);
  1648. if (arrays[k].value) {
  1649. self.fileList3 = [{
  1650. url: self.baseUrls + arrays[k].value
  1651. }, ];
  1652. }
  1653. } else if (k === "name") {
  1654. self.$set(
  1655. self.form,
  1656. k,
  1657. this.$store.state.userInfo.realname
  1658. );
  1659. } else if (k === "idcard") {
  1660. self.$set(
  1661. self.form,
  1662. k,
  1663. this.$store.state.userInfo.idCard
  1664. );
  1665. } else if (k === "telphone") {
  1666. self.$set(
  1667. self.form,
  1668. k,
  1669. this.$store.state.userInfo.telphone
  1670. );
  1671. } else {
  1672. self.$set(self.form, k, arrays[k].value);
  1673. }
  1674. }
  1675. resolve();
  1676. } else if (
  1677. result.data.data &&
  1678. (result.data.data.status === 1 ||
  1679. result.data.data.status === 2)
  1680. ) {
  1681. uni.showModal({
  1682. showCancel: false,
  1683. content: result.data.data.status === 1 ?
  1684. "该商品审核资料已通过,不可重复提交资料" : result.data.data
  1685. .status === 2 ?
  1686. "该商品审核资料处于待审核状态,不可重复提交资料" : "请联系管理员",
  1687. success: function(k) {
  1688. if (k.confirm) {
  1689. uni.navigateBack();
  1690. }
  1691. },
  1692. });
  1693. }
  1694. }
  1695. });
  1696. });
  1697. });
  1698. },
  1699. bindPickerChange(key, e) {
  1700. let value = e.detail.value + "";
  1701. // if (key === "apply_post") {
  1702. // value = this.dictObj["apply_post"][value];
  1703. // }
  1704. this.$set(this.form, key, value);
  1705. this.openVerify = false;
  1706. this.$nextTick(function() {
  1707. this.resultForm();
  1708. });
  1709. },
  1710. bindDateChange(key, e) {
  1711. this.form[key] = e.detail.value;
  1712. },
  1713. retDraw() {
  1714. this.handwriting.retDraw();
  1715. this.$set(this.form, "commitment_electr_signature", "");
  1716. this.openVerify = false;
  1717. this.$nextTick(function() {
  1718. this.resultForm();
  1719. });
  1720. },
  1721. uploadScaleStart(event) {
  1722. this.handwriting.uploadScaleStart(event);
  1723. },
  1724. uploadScaleMove(event) {
  1725. this.handwriting.uploadScaleMove(event);
  1726. },
  1727. uploadScaleEnd(event) {
  1728. this.handwriting.uploadScaleEnd(event);
  1729. },
  1730. subCanvas() {
  1731. return new Promise((resolve, reject) => {
  1732. var self = this;
  1733. if (self.form.commitment_electr_signature) {
  1734. resolve();
  1735. return;
  1736. }
  1737. self.handwriting
  1738. .saveCanvas()
  1739. .then((res) => {
  1740. if (this.handwriting.linePrack.length) {
  1741. this.$set(this.form, "commitment_electr_signature", res);
  1742. }
  1743. resolve(res);
  1744. })
  1745. .catch((err) => {
  1746. uni.showToast({
  1747. title: "签名上传失败",
  1748. icon: "error",
  1749. });
  1750. this.isUploading = false;
  1751. });
  1752. });
  1753. },
  1754. },
  1755. };
  1756. </script>
  1757. <style>
  1758. page {
  1759. background: #eaeef1;
  1760. }
  1761. </style>
  1762. <style scope lang="scss">
  1763. .infos {
  1764. position: relative;
  1765. top: 0rpx;
  1766. left: 0rpx;
  1767. .photo_can {
  1768. width: 100%;
  1769. height: 100%;
  1770. position: absolute;
  1771. z-index: -1;
  1772. left: -10000rpx;
  1773. top: -10000rpx;
  1774. }
  1775. .zip_canvas {
  1776. width: 100%;
  1777. height: 600rpx;
  1778. border: 2rpx solid #333;
  1779. }
  1780. }
  1781. .ctoples {
  1782. position: absolute;
  1783. top: 0;
  1784. left: 0;
  1785. padding: 2rpx 23rpx;
  1786. display: inline-block;
  1787. background-color: rgba(0, 0, 0, 0.4);
  1788. font-size: 28rpx;
  1789. color: #fff;
  1790. border-bottom-right-radius: 24rpx;
  1791. }
  1792. .quzw {
  1793. width: 638rpx;
  1794. height: 638rpx;
  1795. position: relative;
  1796. border: 2rpx solid #eee;
  1797. border-radius: 8rpx;
  1798. .optionsAbs {
  1799. position: absolute;
  1800. right: 5px;
  1801. top: 5px;
  1802. }
  1803. }
  1804. .handWriting {
  1805. width: 100%;
  1806. height: 100%;
  1807. }
  1808. /deep/ .u-collapse-title {
  1809. color: #ff3b30;
  1810. font-size: 24rpx;
  1811. }
  1812. // /deep/ .u-input {
  1813. // text-align: right !important;
  1814. // }
  1815. .picker {
  1816. flex: 1;
  1817. }
  1818. /deep/ .u-form-item--right {
  1819. .u-input__input {
  1820. text-align: right;
  1821. }
  1822. uni-picker {
  1823. flex: 1;
  1824. }
  1825. }
  1826. .collapse-item {
  1827. color: #666;
  1828. font-size: 24rpx;
  1829. padding-bottom: 30rpx;
  1830. }
  1831. .dis_stys {
  1832. display: flex;
  1833. align-items: center;
  1834. justify-content: space-between;
  1835. }
  1836. .handCenter {
  1837. background: #f7f7f7;
  1838. border: 2rpx solid #eeeeee;
  1839. border-radius: 24rpx;
  1840. width: 100%;
  1841. height: 400rpx;
  1842. overflow: hidden;
  1843. }
  1844. .headerSDels {
  1845. height: 58rpx;
  1846. padding: 0rpx 24rpx;
  1847. font-weight: bold;
  1848. display: flex;
  1849. align-items: center;
  1850. flex-direction: row-reverse;
  1851. }
  1852. .listBox {
  1853. margin: 24rpx 32rpx 0rpx;
  1854. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1855. border-radius: 32rpx;
  1856. background-color: #fff;
  1857. overflow: hidden;
  1858. }
  1859. .imgBoxs {
  1860. width: 156rpx;
  1861. height: 203rpx;
  1862. }
  1863. .imgBoxs2 {
  1864. width: 171rpx;
  1865. height: 108rpx;
  1866. }
  1867. .submit_btn {
  1868. width: 526rpx;
  1869. height: 80rpx;
  1870. background: #007aff;
  1871. border-radius: 40rpx;
  1872. text-align: center;
  1873. line-height: 80rpx;
  1874. color: #ffffff;
  1875. margin: 30rpx auto;
  1876. }
  1877. .picker {
  1878. text-align: right;
  1879. }
  1880. input {
  1881. text-align: right;
  1882. }
  1883. .bodyBox {
  1884. background: #ffffff;
  1885. border-radius: 24rpx;
  1886. width: 100%;
  1887. }
  1888. .topBox {
  1889. height: 80rpx;
  1890. background: #ffffff;
  1891. border-radius: 24rpx;
  1892. width: 100%;
  1893. display: flex;
  1894. justify-content: space-between;
  1895. line-height: 80rpx;
  1896. padding: 0 20rpx;
  1897. font-size: 24rpx;
  1898. }
  1899. .modal {
  1900. .agreement {
  1901. width: 640rpx;
  1902. height: 740rpx;
  1903. background: #ffffff;
  1904. display: flex;
  1905. flex-direction: column;
  1906. .body {
  1907. flex: 1;
  1908. .content {
  1909. padding: 30rpx 40rpx 28rpx;
  1910. line-height: 40rpx;
  1911. font-size: 26rpx;
  1912. color: #666;
  1913. .bold {
  1914. color: #333;
  1915. font-size: 26rpx;
  1916. font-weight: bold;
  1917. }
  1918. .center {
  1919. text-align: center;
  1920. }
  1921. }
  1922. }
  1923. .footer {
  1924. height: 140rpx;
  1925. border-top: 1px solid #eeeeee;
  1926. display: flex;
  1927. align-items: center;
  1928. justify-content: center;
  1929. .btn {
  1930. margin: 0 12rpx;
  1931. width: 200rpx;
  1932. height: 80rpx;
  1933. color: #007aff;
  1934. font-size: 30rpx;
  1935. text-align: center;
  1936. line-height: 80rpx;
  1937. background: #f5f5f5;
  1938. border-radius: 40rpx 40rpx 40rpx 40rpx;
  1939. &.ok {
  1940. width: 336rpx;
  1941. height: 80rpx;
  1942. background: #007aff;
  1943. color: #fff;
  1944. }
  1945. &.close {
  1946. color: #fff;
  1947. width: 560rpx;
  1948. height: 80rpx;
  1949. background: #007aff;
  1950. border-radius: 40rpx 40rpx 40rpx 40rpx;
  1951. }
  1952. }
  1953. }
  1954. }
  1955. }
  1956. </style>