createInfo.vue 26 KB

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