input.vue 59 KB

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