createInfo.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825
  1. <template>
  2. <view class="content">
  3. <uni-card class="card">
  4. <uni-section title="基本信息" type="line">
  5. <view>
  6. <view class="lzcOCR">
  7. <view class="imgBox">
  8. <image :src="zjcaijianSrc" style="width: 40vw;" mode="widthFix" @click="paizhao('front')">
  9. </image>
  10. <view class="text">拍摄人像面</view>
  11. </view>
  12. <view class="imgBox">
  13. <image :src="zjcaijianSrcFan" style="width: 40vw;" mode="widthFix" @click="paizhao('back')">
  14. </image>
  15. <view class="text">拍摄国徽面</view>
  16. </view>
  17. </view>
  18. <view class="miaoshu">
  19. 身份信息会跟进拍照的证件照片白动识别,不支持手动输入。如果识别错误,可尝试再次拍照.
  20. </view>
  21. </view>
  22. <uni-forms ref="baseForm" :modelValue="baseFormData" :rules="rules" validateTrigger="blur" label-width="108px" style="margin-top: 3vh;">
  23. <uni-forms-item label="姓名" required name="lrXm">
  24. <uni-easyinput ref="xm" type="text" :disabled="disabled" v-model="baseFormData.lrXm" placeholder="请输入姓名"
  25. :inputBorder="true"></uni-easyinput>
  26. </uni-forms-item>
  27. <uni-forms-item label="手机号" required name="lrCydh">
  28. <uni-easyinput type="text" v-model="baseFormData.lrCydh" :disabled="disabled" placeholder="请输入手机号" :inputBorder="true"></uni-easyinput>
  29. </uni-forms-item>
  30. <uni-forms-item label="监护人姓名">
  31. <uni-easyinput ref="xm" type="text" :disabled="disabled" v-model="baseFormData.jhrxm" placeholder="请输入监护人姓名"
  32. :inputBorder="true"></uni-easyinput>
  33. </uni-forms-item>
  34. <uni-forms-item label="监护人联系电话" name="jhrlxdh">
  35. <uni-easyinput type="text" v-model="baseFormData.jhrlxdh" :disabled="disabled" placeholder="请输入监护人联系电话"
  36. :inputBorder="true"></uni-easyinput>
  37. </uni-forms-item>
  38. <uni-forms-item label="所属园区" name="mchnt" required>
  39. <uni-data-select v-model="baseFormData.mchntName" :localdata="mchntList" @change="mchntChange"></uni-data-select>
  40. </uni-forms-item>
  41. <uni-forms-item label="所属社区" name="lrHjdz" required>
  42. <uni-data-picker ref="lrhjdz" v-model="baseFormData.lrHjdz" :localdata="lrhjdzList" popup-title="请选择社区" @change="lrhjdzChange"
  43. @nodeclick="lrhjdzNodeClick" :readonly="lrhjdzList.length === 0" :class="{'readonly':lrhjdzList.length === 0}"></uni-data-picker>
  44. </uni-forms-item>
  45. <uni-forms-item label="住址" required name="jzdz">
  46. <uni-easyinput type="text" v-model="baseFormData.jzdz" :disabled="disabled" placeholder="请输入住址" :inputBorder="true"></uni-easyinput>
  47. </uni-forms-item>
  48. <uni-forms-item label="是否特困">
  49. <uni-data-checkbox v-model="baseFormData.istk" :localdata="radioData"></uni-data-checkbox>
  50. </uni-forms-item>
  51. <uni-forms-item label="特困证明" v-if="baseFormData.istk == 1">
  52. <myfile :zczmList="tkzmList" @recordsChange="tkChange"></myfile>
  53. </uni-forms-item>
  54. <uni-forms-item label="是否低保">
  55. <uni-data-checkbox v-model="baseFormData.isdb" :localdata="radioData"></uni-data-checkbox>
  56. </uni-forms-item>
  57. <uni-forms-item label="低保证明" v-if="baseFormData.isdb == 1">
  58. <myfile :zczmList="dbzmList" @recordsChange="dbChange"></myfile>
  59. </uni-forms-item>
  60. <uni-forms-item label="是否重残">
  61. <uni-data-checkbox v-model="baseFormData.iszc" :localdata="radioData"></uni-data-checkbox>
  62. </uni-forms-item>
  63. <uni-forms-item label="重残证明" v-if="baseFormData.iszc == 1">
  64. <!-- <uni-file-picker v-model="zczm" @select="imgSelect3" @delete="imgDelete3"></uni-file-picker> -->
  65. <myfile :zczmList="zczmList" @recordsChange="zcChange"></myfile>
  66. </uni-forms-item>
  67. <view v-if="show" style="border: 1px solid red;">
  68. <uni-forms-item label="直接上传">
  69. <uni-data-checkbox v-model="radio" :localdata="radioData"></uni-data-checkbox>
  70. </uni-forms-item>
  71. <text style="color: red; font-weight: bolder;">注意:人证比对不成功可以直接注册人工审核!</text>
  72. </view>
  73. <uni-forms-item v-if="baseFormData.lrSpyj" label="审核意见" name="lrSpyj">
  74. <uni-easyinput ref="lrSpyj" v-model="baseFormData.lrSpyj" type="textarea" disabled
  75. placeholder="请输入审核意见" />
  76. </uni-forms-item>
  77. <view class="miaoshu" v-if="isCheck">
  78. 该人员存在未审核信息,请先审核!
  79. </view>
  80. <view>
  81. <view v-if="isCheck">
  82. <button cursor-spacing="22px" :disabled="isCheck" class="buttonClass" @click="preSave()">认证</button>
  83. </view>
  84. <view v-else>
  85. <button v-if="faceBase64 && ((show && radio == '1') || (!show && radio == '0'))" cursor-spacing="22px" class="buttonClass"
  86. @click="save()">保存</button>
  87. <button v-else cursor-spacing="22px" class="buttonClass" @click="preSave()">认证</button>
  88. </view>
  89. </view>
  90. </uni-forms>
  91. </uni-section>
  92. </uni-card>
  93. </view>
  94. </template>
  95. <script>
  96. import myfile from '@/components/my-file/my-file.vue';
  97. // let jl = require('../../static/bufen.json')
  98. import { decryptRowData_ECB, decryptData_ECB } from '@/common/sm4.js'
  99. import { GetChildListByCode, getChildListByMchnt } from '@/api/dict.js'
  100. import { showConfirm, getDictInfo, toast, toBase64 } from '@/common/common.js'
  101. import { UploadOne, UploadSome, UploadSomeFile } from '@/api/upload.js'
  102. import { Register } from '@/api/login.js'
  103. import { getUser } from '@/common/auth.js'
  104. import CryptoJS from 'crypto-js';
  105. import config from '@/config.js';
  106. import idCardNoUtil from '@/common/idcard.js'
  107. import { translate, base64ToUrl, blobToDataURI, translateAll, base64toFilen, fileToBlob } from '@/common/image.js'
  108. import { setToken, setOpenid, getOpenid, setUser } from '@/common/auth.js'
  109. import { getAccessToken, idcard, match } from '@/common/baiduUtil.js'
  110. import { updateKhjbxx, infoKhjbxx, GetLrByZjhm, createInfoBySelf, YlhtUpdate, CheckReturn, GetUrl, getMchntList,editInfoBySelf } from '@/api/kh.js'
  111. export default {
  112. components: {
  113. myfile,
  114. },
  115. data() {
  116. return {
  117. mchntList: [],
  118. lrhjdzList: [],
  119. level: 3,
  120. updateFlag: false,
  121. diqu: '',
  122. tkzmList: [],
  123. dbzmList: [],
  124. zczmList: [],
  125. isCheck: false,
  126. disabled: true,
  127. show: false,
  128. radio: "0",
  129. radioData: [{
  130. text: '否',
  131. value: "0"
  132. }, {
  133. text: '是',
  134. value: "1"
  135. }],
  136. // 字典
  137. dicts: {
  138. // 民族
  139. C0009: [],
  140. // 性别
  141. C0007: [],
  142. },
  143. // 百度云access_token
  144. token: '',
  145. // 人像地址
  146. src: "/static/images/head.png",
  147. // 身份拍摄地址
  148. zjSrc: "",
  149. // 身份证裁剪地址
  150. zjcaijianSrc: '/static/images/sfza.png',
  151. zjcaijianSrcFan: '/static/images/sfzb.png',
  152. cardType: 'front',
  153. frontBase64: '',
  154. backBase64: '',
  155. file1: "",
  156. file2: "",
  157. file3: "",
  158. file4: "",
  159. file5: "",
  160. file6: "",
  161. showSrc: "",
  162. // 人员信息
  163. userInfo: {},
  164. // 身份证号加密
  165. idcardMD5: '',
  166. // 人像base64
  167. faceBase64: '',
  168. // 身份证base64
  169. idcardFace: '',
  170. idcardFaceUrl: '',
  171. // 对比份数
  172. score: 0,
  173. // ocrXm
  174. ocrXm: '',
  175. isSearch: false,
  176. baseFormData: {
  177. mchntName:'',
  178. lrXm: '',
  179. lrZjhm: '',
  180. lrHjbcxx: '',
  181. lrCydh: '',
  182. code: '',
  183. diqu: '',
  184. lrHjdz: '',
  185. istk: "0",
  186. isdb: "0",
  187. iszc: "0",
  188. lzzt: 0,
  189. lrZjz: ""
  190. },
  191. rules: {
  192. jzdz: {
  193. rules: [{
  194. required: true,
  195. errorMessage: '住址不能为空'
  196. }]
  197. },
  198. lrXm: {
  199. rules: [{
  200. required: true,
  201. errorMessage: '姓名不能为空'
  202. }]
  203. },
  204. mchnt: {
  205. rules: [{
  206. required: true,
  207. errorMessage: '所属园区不能为空'
  208. }]
  209. },
  210. lrHjdz: {
  211. rules: [{
  212. required: true,
  213. errorMessage: '请选择地区'
  214. }]
  215. },
  216. photo: {
  217. rules: [{
  218. required: true,
  219. errorMessage: '请上传人像'
  220. }]
  221. },
  222. lrCydh: {
  223. rules: [{
  224. required: true,
  225. errorMessage: '手机号不能为空'
  226. },
  227. {
  228. format: 'number',
  229. errorMessage: '请输入正确的手机号',
  230. },
  231. {
  232. pattern:'^1[3-9]\\d{9}$',
  233. // pattern: '^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\\d{8})$',
  234. errorMessage: '请输入正确的手机号',
  235. }
  236. ]
  237. },
  238. jhrlxdh: {
  239. rules: [{
  240. required: false,
  241. errorMessage: '监护人联系电话不能为空'
  242. },
  243. {
  244. format: 'number',
  245. errorMessage: '请输入正确的手机号',
  246. },
  247. {
  248. pattern:'^1[3-9]\\d{9}$',
  249. // pattern: '^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\\d{8})$',
  250. errorMessage: '请输入正确的手机号',
  251. }
  252. ]
  253. }
  254. },
  255. }
  256. },
  257. onLoad(o) {
  258. // 获取所属园区数据
  259. getMchntList().then(res => {
  260. if (res.code !== 200) return
  261. const { rows } = res
  262. this.mchntList = []
  263. rows.forEach(item => {
  264. this.mchntList.push({ text: item.name, value: item.name,key:item.mchnt})
  265. })
  266. })
  267. getAccessToken(this.callbackToken)
  268. window.addEventListener("message", this.msgCallback, false)
  269. },
  270. destroyed() {
  271. window.removeEventListener("message", this.msgCallback, false)
  272. },
  273. watch: {
  274. 'baseFormData.mchntName': {
  275. immediate: true,
  276. handler(newVal, oldVal) {
  277. if (newVal) {
  278. let newValValue='';
  279. this.mchntList.map(item=>{
  280. if(item.value==newVal)
  281. {
  282. newValValue=item.key
  283. }
  284. })
  285. this.baseFormData.mchnt=newValValue
  286. getChildListByMchnt({ mchnt: newValValue,name:newVal}).then(res => {
  287. if (res.code !== 200) return
  288. const { data } = res
  289. this.lrhjdzList = []
  290. let str1 = JSON.stringify(data).replaceAll('code', 'value').replaceAll('label', 'text').replaceAll('null', '')
  291. this.lrhjdzList = JSON.parse(str1)
  292. })
  293. } else {
  294. this.lrhjdzList = []
  295. this.baseFormData.mchnt=''
  296. this.baseFormData.lrHjdz = ''
  297. }
  298. }
  299. }
  300. },
  301. methods: {
  302. msgCallback(e) {
  303. if (e.data.data && e.data.data.arg.base64) {
  304. setTimeout(() => {
  305. uni.showLoading({
  306. title: '正在识别中...',
  307. mask: true,
  308. })
  309. this.faceBase64 = ''
  310. this.cardType = uni.getStorageSync("cardType")
  311. // if (this.cardType == 'front') e.data.data.arg.base64 = jl.front
  312. // if (this.cardType == 'back') e.data.data.arg.base64 = jl.back
  313. // 压缩
  314. translateAll(base64ToUrl(e.data.data.arg.base64), (base64, blobUrl) => {
  315. idcard(base64, this.token, this.cardType, this.callbackIdcard)
  316. })
  317. // uni.removeStorageSync('cardType')
  318. }, 1000);
  319. }
  320. if (e.data.data && e.data.data.arg.faceBase64) {
  321. setTimeout(() => {
  322. uni.showLoading({
  323. title: '正在识别中...',
  324. mask: true,
  325. })
  326. this.faceBase64 = e.data.data.arg.faceBase64
  327. // 压缩
  328. translateAll(base64ToUrl(this.faceBase64), (base64, blobUrl) => {
  329. this.src = this.faceBase64
  330. match(this.token, base64.split(",")[1], this.idcardFace, this.callbackFace)
  331. })
  332. }, 1000);
  333. }
  334. },
  335. mchntChange(mchnt) {
  336. console.log(mchnt,'我改变了');
  337. },
  338. lrhjdzChange(e) {
  339. const { value } = e.detail
  340. if (value.length > 0) {
  341. this.baseFormData.lrHjdz = value[value.length - 1].value
  342. }
  343. },
  344. lrhjdzNodeClick(e) {
  345. // console.log(e);
  346. },
  347. tkChange(e) {
  348. this.tkzmList = e
  349. },
  350. dbChange(e) {
  351. this.dbzmList = e
  352. },
  353. zcChange(e) {
  354. this.zczmList = e
  355. },
  356. callbackFace(res) {
  357. uni.hideLoading()
  358. if (res.data.error_msg == 'SUCCESS') {
  359. this.score = res.data.result.score;
  360. this.baseFormData.lrTxdb = JSON.stringify({
  361. "lrJmzjhm": this.idcardMD5,
  362. "xsfs": this.score
  363. })
  364. if (this.score >= config.score) {
  365. this.show = false
  366. // this.baseFormData.lzzt = 3
  367. this.baseFormData.lzzt = 0
  368. // this.baseFormData.lrSpyj = '同意'
  369. this.baseFormData.lrSpyj = ''
  370. } else {
  371. // 低于80选项是否人工审核,是的话进记录表
  372. // 身份证头像保存后端
  373. // 人脸库注册人脸、身份证md5
  374. // 修改的时候去人脸库搜索,搜索不到不允许修改
  375. // 修改成功替换原始人脸库照片
  376. // 首次修改搜索身份证
  377. // 后端没入库,人脸库相应删除
  378. // ocr失败身份证原版入库,ocr成功人脸入库
  379. // showConfirm('人像与身份证不符,请重新上传')
  380. // this.baseFormData.lzzt = 1
  381. // this.baseFormData.lrSpyj = ''
  382. this.baseFormData.lzzt = 0
  383. this.baseFormData.lrSpyj = ''
  384. this.show = true
  385. }
  386. // this.baseFormData.prelrZjz = this.zjcaijianSrc
  387. } else {
  388. showConfirm(res.data.error_msg)
  389. this.faceBase64 = ''
  390. }
  391. },
  392. callbackToken(e) {
  393. this.token = e
  394. },
  395. callbackIdcard(words) {
  396. uni.hideLoading()
  397. if (!this.cardType) {
  398. this.cardType = uni.getStorageSync("cardType")
  399. }
  400. if (this.cardType == 'front') {
  401. if (!words) {
  402. showConfirm('请上传正确的身份证人像面')
  403. return
  404. }
  405. if (words.image_status == "other_type_card") {
  406. showConfirm('请上传正确的身份证人像面')
  407. return
  408. }
  409. if (words.image_status == "reversed_side") {
  410. showConfirm('身份证正反面颠倒')
  411. return
  412. }
  413. if (words.image_status == "non_idcard") {
  414. showConfirm('上传的图片中不包含身份证')
  415. return
  416. }
  417. if (words.image_status == "blurred") {
  418. showConfirm('身份证模糊')
  419. return
  420. }
  421. if (words.image_status == "over_exposure") {
  422. showConfirm('身份证关键字段反光或过曝')
  423. return
  424. }
  425. if (words.image_status == "over_dark") {
  426. showConfirm('身份证欠曝')
  427. return
  428. }
  429. if (words.image_status == "reversed_side") {
  430. showConfirm('请上传身份证人像面')
  431. return
  432. }
  433. if (words.risk_type != "normal") {
  434. // normal-正常身份证;copy-复印件;temporary-临时身份证;screen-翻拍;unknown-其他未知情况
  435. showConfirm('请上传正确的身份证人像面')
  436. return
  437. }
  438. let id = words.words_result['公民身份号码'].words
  439. let csrq = words.words_result['出生'].words
  440. let sex = words.words_result['性别'].words
  441. let zz = words.words_result['住址'].words
  442. let info = idCardNoUtil.getIdCardInfo(id)
  443. if (!idCardNoUtil.checkIdCardNo(id)) {
  444. showConfirm('身份证号识别有误,请重新上传')
  445. return
  446. }
  447. if (info.birthday != csrq) {
  448. showConfirm('身份证出生日期识别有误,请重新上传')
  449. return
  450. }
  451. if (info.gender != sex) {
  452. showConfirm('身份证性别识别有误,请重新上传')
  453. return
  454. }
  455. // todo 根据身份证号查询此人信息是否可修改。this.isCheck = true
  456. this.frontBase64 = words.card_image
  457. this.zjcaijianSrc = 'data:image/jpeg;base64,' + words.card_image
  458. this.disabled = false
  459. // this.baseFormData.lrXb = getDictInfo(this.dicts.C0007, words.words_result['性别'].words)[0].value
  460. // this.baseFormData.lrMz = getDictInfo(this.dicts.C0009, words.words_result['民族'].words)[0].value
  461. this.baseFormData.lrXb = sex
  462. this.baseFormData.lrMz = words.words_result['民族'].words
  463. this.idcardFace = words.photo
  464. this.idcardFaceUrl = base64ToUrl(words.photo);
  465. this.baseFormData.lrZjhm = id
  466. this.baseFormData.lrCsrq = csrq
  467. this.idcardMD5 = CryptoJS.MD5(this.baseFormData.lrZjhm).toString()
  468. this.baseFormData.lrXm = words.words_result['姓名'].words
  469. this.baseFormData.lrHjbcxx = zz
  470. this.ocrXm = words.words_result['姓名'].words
  471. if (this.userInfo.userType != '07') {
  472. GetLrByZjhm({
  473. lrJmzjhm: this.idcardMD5
  474. }).then(res => {
  475. if(res.data&&res.data.lzzt=="9")
  476. {
  477. if (res.data) this.baseFormData = decryptData_ECB(res.data, ["lrZjhm", "lrXm",
  478. "lrHjbcxx",
  479. "lrXjdzBcxx",
  480. "lrCydh", "lrPoxm", "lrPoZjmh", "jhrXm", "jhrSjhm", "zlrXm", "zlrDh",
  481. "cjzh",
  482. "yhzh", "khmc", "jhrxm", "jhrlxdh"
  483. ], [2, 1, 4, 4, 3, 1, 2, 1, 2, 1, 3, 5, 5, 5]);
  484. if (this.baseFormData.lrTx) this.src = config.baseUrl + this.baseFormData.lrTx
  485. if (res.data && res.data.sfzzpb) this.zjcaijianSrcFan = res.data.sfzzpb
  486. if (res.data && res.data.tkzm) this.tkzmList = [res.data.tkzm]
  487. if (res.data && res.data.dbzm) this.dbzmList = [res.data.dbzm]
  488. if (res.data && res.data.zczm) this.zczmList = [res.data.zczm]
  489. if (res.data) this.updateFlag = true
  490. }
  491. })
  492. }
  493. } else if (this.cardType == 'back') {
  494. if (!words) {
  495. showConfirm('请上传正确的身份证国徽面')
  496. return
  497. }
  498. if (words.image_status == "other_type_card") {
  499. showConfirm('请上传正确的身份证国徽面')
  500. return
  501. }
  502. if (words.image_status == "reversed_side") {
  503. showConfirm('身份证正反面颠倒')
  504. return
  505. }
  506. if (words.image_status == "non_idcard") {
  507. showConfirm('上传的图片中不包含身份证')
  508. return
  509. }
  510. if (words.image_status == "blurred") {
  511. showConfirm('身份证模糊')
  512. return
  513. }
  514. if (words.image_status == "over_exposure") {
  515. showConfirm('身份证关键字段反光或过曝')
  516. return
  517. }
  518. if (words.image_status == "over_dark") {
  519. showConfirm('身份证欠曝')
  520. return
  521. }
  522. if (words.risk_type != "normal") {
  523. // normal-正常身份证;copy-复印件;temporary-临时身份证;screen-翻拍;unknown-其他未知情况
  524. showConfirm('请上传正确的身份证国徽面')
  525. return
  526. }
  527. // words.words_result['失效日期'].words
  528. // words.words_result['签发日期'].words
  529. // words.words_result['签发机关'].words
  530. if (words && words.words_result) {
  531. this.baseFormData.sfzqfjg = words.words_result['签发机关'].words
  532. this.baseFormData.sfzyxqxs = words.words_result['签发日期'].words
  533. this.baseFormData.sfzyxqxz = words.words_result['失效日期'].words
  534. this.backBase64 = words.card_image
  535. this.zjcaijianSrcFan = 'data:image/jpeg;base64,' + words.card_image
  536. }
  537. }
  538. },
  539. paizhao(type) {
  540. this.type = type
  541. if (this.type == 'back' && !this.ocrXm) {
  542. showConfirm('请先拍摄身份证人像面')
  543. return
  544. }
  545. uni.setStorageSync("cardType", type)
  546. uni.navigateTo({
  547. url: '/pages/info/card'
  548. })
  549. },
  550. preSave() {
  551. if (this.baseFormData.lzzt != 0 && this.baseFormData.lzzt != 3 && this.baseFormData.lzzt != 6 && this.baseFormData.lzzt != 9) {
  552. showConfirm('信息正在审核,请勿重复提交')
  553. return
  554. }
  555. if (!this.ocrXm) {
  556. showConfirm('请先拍摄身份证人像面')
  557. return
  558. }
  559. if (this.zjcaijianSrcFan == '/static/images/sfzb.png') {
  560. showConfirm('请先拍摄身份证国徽面')
  561. return
  562. }
  563. if (this.baseFormData.istk == 1 && this.tkzmList.length == 0) {
  564. showConfirm('请先上传特困证明')
  565. return
  566. }
  567. if (this.baseFormData.isdb == 1 && this.dbzmList.length == 0) {
  568. showConfirm('请先上传低保证明')
  569. return
  570. }
  571. if (this.baseFormData.iszc == 1 && this.zczmList.length == 0) {
  572. showConfirm('请先上传重残证明')
  573. return
  574. }
  575. this.$refs['baseForm'].validate().then(res => {
  576. if (this.ocrXm != this.baseFormData.lrXm) {
  577. showConfirm('姓名与真实姓名不符,请重新上传身份证')
  578. return
  579. }
  580. uni.navigateTo({
  581. url: '/pages/info/face'
  582. })
  583. })
  584. },
  585. save() {
  586. if ((this.score >= config.score) || (this.score < config.score && this.radio == '1')) {
  587. uni.showLoading({
  588. title: '正在保存中...',
  589. mask: true,
  590. })
  591. let paramFiles = []
  592. fileToBlob(base64toFilen('data:image/jpeg;base64,' + this.frontBase64), (e) => {
  593. this.file1 = e
  594. paramFiles.push({
  595. name: "file1",
  596. uri: this.file1
  597. })
  598. })
  599. if (this.backBase64) {
  600. fileToBlob(base64toFilen('data:image/jpeg;base64,' + this.backBase64), (e) => {
  601. this.file2 = e
  602. paramFiles.push({
  603. name: "file2",
  604. uri: this.file2
  605. })
  606. })
  607. }
  608. fileToBlob(base64toFilen(this.src), (e) => {
  609. this.file3 = e
  610. paramFiles.push({
  611. name: "file3",
  612. uri: this.file3
  613. })
  614. })
  615. if (this.baseFormData.istk == 1 && this.tkzmList.length == 1 && this.tkzmList[0].indexOf(
  616. 'data:image') > -1) {
  617. fileToBlob(base64toFilen(this.tkzmList[0]), (e) => {
  618. this.file4 = e
  619. paramFiles.push({
  620. name: "file4",
  621. uri: this.file4
  622. })
  623. })
  624. if (this.baseFormData.lzzt != 2 || this.baseFormData.lzzt != 1) {
  625. // 特殊材料待审核
  626. // this.baseFormData.lzzt = 5
  627. this.baseFormData.lzzt = 0
  628. this.baseFormData.lrSpyj = '无'
  629. }
  630. }
  631. if (this.baseFormData.isdb == 1 && this.dbzmList.length == 1 && this.dbzmList[0].indexOf(
  632. 'data:image') > -1) {
  633. fileToBlob(base64toFilen(this.dbzmList[0]), (e) => {
  634. this.file5 = e
  635. paramFiles.push({
  636. name: "file5",
  637. uri: this.file5
  638. })
  639. })
  640. if (this.baseFormData.lzzt != 2 || this.baseFormData.lzzt != 1) {
  641. // 特殊材料待审核
  642. // this.baseFormData.lzzt = 5
  643. this.baseFormData.lzzt = 0
  644. this.baseFormData.lrSpyj = '无'
  645. }
  646. }
  647. if (this.baseFormData.iszc == 1 && this.zczmList.length == 1 && this.zczmList[0].indexOf(
  648. 'data:image') > -1) {
  649. fileToBlob(base64toFilen(this.zczmList[0]), (e) => {
  650. this.file6 = e
  651. paramFiles.push({
  652. name: "file6",
  653. uri: this.file6
  654. })
  655. })
  656. if (this.baseFormData.lzzt != 2 || this.baseFormData.lzzt != 1) {
  657. // 特殊材料待审核
  658. // this.baseFormData.lzzt = 5
  659. this.baseFormData.lzzt = 0
  660. this.baseFormData.lrSpyj = '无'
  661. }
  662. }
  663. let that = this
  664. setTimeout(function() {
  665. UploadSomeFile(paramFiles).then(res => {
  666. that.baseFormData.lrZjz = res.data.url1
  667. if (that.backBase64) {
  668. that.baseFormData.sfzzpb = res.data.url2
  669. }
  670. that.baseFormData.lrTx = res.data.url3
  671. if (that.baseFormData.istk == 1 && that.tkzmList.length == 1) {
  672. that.baseFormData.tkzm = res.data.url4
  673. }
  674. if (that.baseFormData.isdb == 1 && that.dbzmList.length == 1) {
  675. that.baseFormData.dbzm = res.data.url5
  676. }
  677. if (that.baseFormData.iszc == 1 && that.zczmList.length == 1) {
  678. that.baseFormData.zczm = res.data.url6
  679. }
  680. that.$refs['baseForm'].validate().then(res => {
  681. if (that.updateFlag) {
  682. editInfoBySelf(that.baseFormData).then(r => {
  683. uni.hideLoading()
  684. if (r.code == 200) {
  685. toast('修改已提交,等待审核中...')
  686. setTimeout(() => {
  687. uni.navigateBack()
  688. }, 1000)
  689. }
  690. })
  691. } else {
  692. createInfoBySelf(that.baseFormData).then(r => {
  693. uni.hideLoading()
  694. if (r.code == 200) {
  695. toast('申请已提交,等待审核中...')
  696. setTimeout(() => {
  697. uni.navigateBack()
  698. }, 1000)
  699. }
  700. })
  701. }
  702. }).catch(err => {
  703. uni.hideLoading()
  704. })
  705. })
  706. }, 500)
  707. } else {
  708. showConfirm('请重新上传人像')
  709. return
  710. }
  711. }
  712. }
  713. }
  714. </script>
  715. <style lang="scss" scoped>
  716. .card {
  717. margin: 0 !important;
  718. padding: 0 !important;
  719. }
  720. ::v-deep .uni-forms-item__label {
  721. justify-content: flex-end !important;
  722. padding-right: 8px;
  723. }
  724. ::v-deep .uni-data-checklist {
  725. margin-top: 5px !important;
  726. }
  727. .readonly {
  728. background-color: #f7f6f6;
  729. ::v-deep .placeholder {
  730. color: #d5d5d5;
  731. }
  732. }
  733. .content {
  734. padding: 1vh;
  735. }
  736. .lzcOCR {
  737. display: flex;
  738. justify-content: space-between;
  739. margin-top: 3vh;
  740. }
  741. .miaoshu {
  742. margin-top: 3vh;
  743. font-size: 14px;
  744. }
  745. .imgBox {
  746. width: 47%;
  747. text-align: center;
  748. image {
  749. width: 100%;
  750. }
  751. .text {
  752. width: 100%;
  753. /* background-color: red; */
  754. }
  755. }
  756. .buttonClass {
  757. width: 55vw;
  758. border-radius: 25px;
  759. background: #28d87d;
  760. color: white;
  761. height: 5vh;
  762. display: flex;
  763. align-items: center;
  764. justify-content: center;
  765. box-shadow: 0rpx 4rpx 10rpx 1rpx rgba(40, 216, 125, 0.4);
  766. }
  767. .picker-view {
  768. width: 750rpx;
  769. height: 600rpx;
  770. margin-top: 20rpx;
  771. }
  772. .item {
  773. line-height: 100rpx;
  774. text-align: center;
  775. }
  776. </style>