Commit 6baf19c8 authored by 李晓兵's avatar 李晓兵

'身份证上传'

parent 09d7b422
......@@ -357,6 +357,11 @@ export default {
idCardBack: '', // 身份证反面图片
bankImg: '', // 银行卡图片
cddItemList: [], // 资料清单列表
idCardCheck_id: '', // 身份证check_id
bankCardCheck_id: '', // 银行卡check_id
idCardImgList: [], // 存身份证图片列表
bankCardImgList: [], // 存上传银行卡图片列表
idCardEditFlag: false, // 身份证修改标识,为true则标识已修改,后续需要重新上传此照片
}
},
watch: {
......@@ -460,18 +465,18 @@ export default {
},
async verified () {
this.dowload_list = [] // 保存之前将图片下载列表清空,防止出现重复的图片
let bpId = await this.saveWord()
this.getBankInfo()
// let bpId = await this.saveWord()
// this.getBankInfo()
// 查询资料清单
this.loadItemList()
},
loadItemList () {
let vm = this
let bpId = vm.from ? vm.$route.params.bp_id : window.localStorage.getItem('user_id')
// let bpId = vm.from ? vm.$route.params.bp_id : window.localStorage.getItem('user_id')
let url = process.env.basePath + 'prj_cdd_check_list'
let param = {
master: {
'document_id': bpId,
'document_id': 7730,
'document_table': 'HLS_BP_MASTER',
'tab_group': 'HLS_NP',
},
......@@ -480,11 +485,39 @@ export default {
vm.hlsHttp.post(url, param).then(function (res) {
// vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.cddItemList = [...res.lists]
var listTemp = [...res.lists]
listTemp.forEach(item => {
switch (item.cdd_item) {
case 'NP_ID_CARD':
vm.idCardCheck_id = item.check_id
break
case 'BANK_CARD':
vm.bankCardCheck_id = item.check_id
break
default:
vm.cddItemList.push(item)
}
})
// 查询图片
vm.cddItemList.forEach((item, index) => {
listTemp.forEach((item, index) => {
vm.load_picture(item.check_id, index)
})
if (vm.idCardEditFlag) { // 身份证图片已修改,重新上传
var list = []
for (let i = 0; i < vm.idCardImgList.length; i++) {
let obj = {
'pkvalue': vm.idCardImgList[0].check_id,
'source_type': 'PRJ_CDD_ITEM_CHECK',
'picture': '',
'check_id': vm.idCardImgList[0].check_id,
'filePath': vm.idCardImgList[i],
'attachment_id': '',
'user_id': 1,
}
list.push(obj)
}
vm.save_picture(list)
}
}
})
},
......@@ -622,6 +655,7 @@ export default {
},
// 图片保存
save_picture (list) {
alert('上传列表 '+JSON.stringify(list))
let vm = this
if (list.length) {
// hlsPopup.showLoading('图片上传请稍候')
......@@ -718,8 +752,8 @@ export default {
hlsPopup.showLongCenter('请拍照')
} else {
if (ocrType === 'idCard') {
type === 'front' ? (vm.idCardFront = imgdata, vm.idCardIdentify(imgdata)) : (vm.idCardBack = imgdata)
vm.idCardIdentify(imgdata)
vm.idCardEditFlag = true // 身份证图片状态已修改
type === 'front' ? (vm.idCardFront = imgdata, vm.idCardIdentify(imgdata), vm.idCardImgList.push(imgdata)) : (vm.idCardBack = imgdata, vm.idCardImgList.push(imgdata))
} else if (ocrType === 'bankCard') {
vm.bankImg = imgdata
vm.bankCardIdentify(imgdata)
......@@ -744,7 +778,8 @@ export default {
hlsPopup.showLongCenter('请选择一张图片')
} else {
if (ocrType === 'idCard') {
type === 'front' ? (vm.idCardFront = imgUrl[0], vm.idCardIdentify(imgUrl[0])) : (vm.idCardBack = imgUrl[0])
vm.idCardEditFlag = true // 身份证图片状态已修改
type === 'front' ? (vm.idCardFront = imgUrl[0], vm.idCardIdentify(imgUrl[0]), vm.idCardImgList.push(imgdata)) : (vm.idCardBack = imgUrl[0], vm.idCardImgList.push(imgdata))
} else if (ocrType === 'bankCard') {
vm.bankImg = imgUrl[0]
vm.bankCardIdentify(imgUrl[0])
......
......@@ -1173,7 +1173,6 @@ export default {
} else {
if (ocrType === 'idCard') {
type === 'front' ? (vm.idCardFront = imgUrl[0], vm.idCardIdentify(imgUrl[0])) : (vm.idCardBack = imgUrl[0])
vm.idCardIdentify(imgUrl[0])
} else if (ocrType === 'bankCard') {
vm.bankImg = imgUrl[0]
vm.bankCardIdentify(imgUrl[0])
......@@ -1263,7 +1262,7 @@ export default {
master: {
'document_id': bpId,
'document_table': 'HLS_BP_MASTER',
'tab_group': 'HLS_NP',
'tab_group': vm.flag ? 'HLS_ORG_NAUTH' : 'HLS_ORG_AUTH',
},
}
// vm.hlsPopup.showLoading('请稍候')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment