add.vue 23 KB

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