|
@@ -18,10 +18,10 @@
|
|
<uni-easyinput type="text" v-model="baseFormData.lrHjbcxx" placeholder="请输入住址"
|
|
<uni-easyinput type="text" v-model="baseFormData.lrHjbcxx" placeholder="请输入住址"
|
|
:inputBorder="false"></uni-easyinput>
|
|
:inputBorder="false"></uni-easyinput>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
- <uni-forms-item label="分数">
|
|
|
|
|
|
+ <!-- <uni-forms-item label="分数">
|
|
<uni-easyinput type="text" v-model="score"
|
|
<uni-easyinput type="text" v-model="score"
|
|
:inputBorder="false"></uni-easyinput>
|
|
:inputBorder="false"></uni-easyinput>
|
|
- </uni-forms-item>
|
|
|
|
|
|
+ </uni-forms-item> -->
|
|
<uni-forms-item label="人像" required>
|
|
<uni-forms-item label="人像" required>
|
|
<image :src="src" @click="takePhoto" mode="widthFix" style="width: 25vw;"></image>
|
|
<image :src="src" @click="takePhoto" mode="widthFix" style="width: 25vw;"></image>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
@@ -59,11 +59,19 @@
|
|
} from '@/api/upload.js'
|
|
} from '@/api/upload.js'
|
|
import {
|
|
import {
|
|
updateKhjbxx,
|
|
updateKhjbxx,
|
|
- infoKhjbxx
|
|
|
|
|
|
+ infoKhjbxx,
|
|
|
|
+ GetLrByZjhm,
|
|
|
|
+ SaveKhjbxx
|
|
} from '@/api/kh.js'
|
|
} from '@/api/kh.js'
|
|
import {
|
|
import {
|
|
getUser
|
|
getUser
|
|
} from '@/common/auth.js'
|
|
} from '@/common/auth.js'
|
|
|
|
+ import {
|
|
|
|
+ setToken,
|
|
|
|
+ setOpenid,
|
|
|
|
+ getOpenid,
|
|
|
|
+ setUser
|
|
|
|
+ } from '@/common/auth.js'
|
|
import CryptoJS from 'crypto-js';
|
|
import CryptoJS from 'crypto-js';
|
|
import config from '@/config.js';
|
|
import config from '@/config.js';
|
|
import idCardNoUtil from '@/common/idcard.js'
|
|
import idCardNoUtil from '@/common/idcard.js'
|
|
@@ -71,6 +79,9 @@
|
|
translate,
|
|
translate,
|
|
base64ToUrl
|
|
base64ToUrl
|
|
} from '@/common/image.js'
|
|
} from '@/common/image.js'
|
|
|
|
+ import {
|
|
|
|
+ Register
|
|
|
|
+ } from '@/api/login.js'
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
lzcOCR
|
|
lzcOCR
|
|
@@ -120,6 +131,7 @@
|
|
// ocrXm
|
|
// ocrXm
|
|
ocrXm: '',
|
|
ocrXm: '',
|
|
isSearch: false,
|
|
isSearch: false,
|
|
|
|
+ updateFlag: false,
|
|
baseFormData: {
|
|
baseFormData: {
|
|
lrXm: '',
|
|
lrXm: '',
|
|
lrZjhm: '',
|
|
lrZjhm: '',
|
|
@@ -167,11 +179,16 @@
|
|
onLoad(o) {
|
|
onLoad(o) {
|
|
this.getDictList(Object.keys(this.dicts), this.dicts)
|
|
this.getDictList(Object.keys(this.dicts), this.dicts)
|
|
this.userInfo = getUser()
|
|
this.userInfo = getUser()
|
|
|
|
+ this.baseFormData.lrHjdz = this.userInfo.dept.locationCode
|
|
this.groupId = this.userInfo.dept.locationCode.substring(0, 6)
|
|
this.groupId = this.userInfo.dept.locationCode.substring(0, 6)
|
|
- let info = JSON.parse(o.info)
|
|
|
|
- this.baseFormData = info
|
|
|
|
- // this.zjcaijianSrc = config.baseUrl + info.lrZjz
|
|
|
|
- this.src = config.baseUrl + info.lrTx
|
|
|
|
|
|
+ if (this.userInfo.userType == '07') {
|
|
|
|
+ this.updateFlag = true
|
|
|
|
+ let info = JSON.parse(o.info)
|
|
|
|
+ this.baseFormData.lrHjdz = info.lrHjdz
|
|
|
|
+ this.groupId = info.lrHjdz.substring(0, 6)
|
|
|
|
+ this.baseFormData = info
|
|
|
|
+ this.src = config.baseUrl + info.lrTx
|
|
|
|
+ }
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getAccessToken() {
|
|
getAccessToken() {
|
|
@@ -221,9 +238,15 @@
|
|
console.log('对比', res);
|
|
console.log('对比', res);
|
|
if (res.data.error_msg == 'SUCCESS') {
|
|
if (res.data.error_msg == 'SUCCESS') {
|
|
this.score = res.data.result.score;
|
|
this.score = res.data.result.score;
|
|
|
|
+
|
|
|
|
+ this.baseFormData.lrTxdb = JSON.stringify({
|
|
|
|
+ "lrJmzjhm": this.idcardMD5,
|
|
|
|
+ "xsfs": this.score
|
|
|
|
+ })
|
|
if (this.score >= config.score) {
|
|
if (this.score >= config.score) {
|
|
this.show = false
|
|
this.show = false
|
|
this.baseFormData.lzzt = 3
|
|
this.baseFormData.lzzt = 3
|
|
|
|
+ this.baseFormData.lrSpyj = '同意'
|
|
this.baseFormData.prelrZjz = this.idcardFaceUrl
|
|
this.baseFormData.prelrZjz = this.idcardFaceUrl
|
|
this.faceSearch()
|
|
this.faceSearch()
|
|
} else {
|
|
} else {
|
|
@@ -237,6 +260,7 @@
|
|
// ocr失败身份证原版入库,ocr成功人脸入库
|
|
// ocr失败身份证原版入库,ocr成功人脸入库
|
|
// showConfirm('人像与身份证不符,请重新上传')
|
|
// showConfirm('人像与身份证不符,请重新上传')
|
|
this.baseFormData.lzzt = 1
|
|
this.baseFormData.lzzt = 1
|
|
|
|
+ this.baseFormData.lrSpyj = ''
|
|
this.show = true
|
|
this.show = true
|
|
this.baseFormData.prelrZjz = this.zjcaijianSrc
|
|
this.baseFormData.prelrZjz = this.zjcaijianSrc
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
@@ -331,8 +355,19 @@
|
|
this.createGroup()
|
|
this.createGroup()
|
|
} else {
|
|
} else {
|
|
if (res.data.result.user_list[0].score >= config.score) {
|
|
if (res.data.result.user_list[0].score >= config.score) {
|
|
- this.baseFormData.xslrZjhm = res.data.result.user_list[0].user_id
|
|
|
|
- this.baseFormData.lzzt = 2
|
|
|
|
|
|
+ let xs = []
|
|
|
|
+ res.data.result.user_list.forEach(e => {
|
|
|
|
+ if (e.user_id != this.idcardMD5) {
|
|
|
|
+ xs.push({
|
|
|
|
+ "lrJmzjhm": e.user_id,
|
|
|
|
+ "xsfs": e.score
|
|
|
|
+ })
|
|
|
|
+ this.baseFormData.lzzt = 2
|
|
|
|
+ this.baseFormData.lrSpyj = ''
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ this.baseFormData.xslrZjhm = JSON.stringify(xs)
|
|
}
|
|
}
|
|
this.faceAdd()
|
|
this.faceAdd()
|
|
}
|
|
}
|
|
@@ -363,7 +398,7 @@
|
|
// }
|
|
// }
|
|
if ((this.score >= config.score) || (this.score < config.score && this.radio == '1')) {
|
|
if ((this.score >= config.score) || (this.score < config.score && this.radio == '1')) {
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
- title: '正在修改中...'
|
|
|
|
|
|
+ title: '正在保存中...'
|
|
})
|
|
})
|
|
this.$refs['baseForm'].validate().then(res => {
|
|
this.$refs['baseForm'].validate().then(res => {
|
|
UploadOne(this.baseFormData.prelrZjz, {}).then(re => {
|
|
UploadOne(this.baseFormData.prelrZjz, {}).then(re => {
|
|
@@ -372,19 +407,40 @@
|
|
UploadOne(this.src, {}).then(re => {
|
|
UploadOne(this.src, {}).then(re => {
|
|
console.log("re", re)
|
|
console.log("re", re)
|
|
this.baseFormData.lrTx = re.data.url
|
|
this.baseFormData.lrTx = re.data.url
|
|
- this.baseFormData.id = this.userInfo.userId
|
|
|
|
- updateKhjbxx(this.baseFormData).then(r => {
|
|
|
|
- console.log("r:", r)
|
|
|
|
- uni.hideLoading()
|
|
|
|
- if (r.code == 200) {
|
|
|
|
- toast('修改成功')
|
|
|
|
- setTimeout(function() {
|
|
|
|
- uni.switchTab({
|
|
|
|
- url: '/pages/index/index'
|
|
|
|
- })
|
|
|
|
- }, 1000)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ if (this.userInfo.userType == '07') this.baseFormData.id = this
|
|
|
|
+ .userInfo.userId
|
|
|
|
+
|
|
|
|
+ if (this.updateFlag) {
|
|
|
|
+ updateKhjbxx(this.baseFormData).then(r => {
|
|
|
|
+ console.log("r:", r)
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ if (r.code == 200) {
|
|
|
|
+ toast('保存成功')
|
|
|
|
+ setTimeout(function() {
|
|
|
|
+ uni.switchTab({
|
|
|
|
+ url: '/pages/index/index'
|
|
|
|
+ })
|
|
|
|
+ }, 1000)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ SaveKhjbxx(this.baseFormData).then(r => {
|
|
|
|
+ console.log("r:", r)
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ if (r.code == 200) {
|
|
|
|
+ toast('保存成功')
|
|
|
|
+ // setOpenid(r.data.openId)
|
|
|
|
+ // setUser(r.data.sysUser)
|
|
|
|
+ // setToken(r.data.token.access_token)
|
|
|
|
+ setTimeout(function() {
|
|
|
|
+ uni.switchTab({
|
|
|
|
+ url: '/pages/index/index'
|
|
|
|
+ })
|
|
|
|
+ }, 1000)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
})
|
|
})
|
|
})
|
|
})
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
@@ -455,7 +511,7 @@
|
|
showConfirm('身份证号识别有误,请重新上传')
|
|
showConfirm('身份证号识别有误,请重新上传')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if (this.baseFormData.lrZjhm != id) {
|
|
|
|
|
|
+ if (this.userType == '07' && this.baseFormData.lrZjhm != id) {
|
|
showConfirm('请使用本人身份证重新上传')
|
|
showConfirm('请使用本人身份证重新上传')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -492,6 +548,24 @@
|
|
this.ocrXm = words.words_result['姓名'].words
|
|
this.ocrXm = words.words_result['姓名'].words
|
|
this.zjSrc = src
|
|
this.zjSrc = src
|
|
this.zjcaijianSrc = base64ToUrl(words.card_image);
|
|
this.zjcaijianSrc = base64ToUrl(words.card_image);
|
|
|
|
+
|
|
|
|
+ if (this.userInfo.userType != '07') {
|
|
|
|
+ GetLrByZjhm({
|
|
|
|
+ lrJmzjhm: this.idcardMD5
|
|
|
|
+ }).then(res => {
|
|
|
|
+ console.log(res);
|
|
|
|
+ if (res.data) this.baseFormData = decryptData_ECB(res.data, ["lrZjhm", "lrXm", "lrHjbcxx",
|
|
|
|
+ "lrXjdzBcxx",
|
|
|
|
+ "lrCydh", "lrPoxm", "lrPoZjmh", "jhrXm", "jhrSjhm", "zlrXm", "zlrDh", "cjzh",
|
|
|
|
+ "yhzh", "khmc"
|
|
|
|
+ ], [2, 1, 4, 4, 3, 1, 2, 1, 2, 1, 3, 5, 5, 5]);
|
|
|
|
+ if (res.data && res.data.lrHjdz) this.baseFormData.lrHjdz = res.data
|
|
|
|
+ .lrHjdz
|
|
|
|
+ if (this.baseFormData.lrTx) this.src = config.baseUrl + this.baseFormData.lrTx
|
|
|
|
+ if (res.data) this.updateFlag = true
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
}
|
|
}
|
|
}
|
|
}
|