add.vue 22 KB

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