createInfo.vue 26 KB

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