createInfo.vue 28 KB

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