Commit 94676e95 authored by 李晓兵's avatar 李晓兵

'身份证修改'

parent 41e5d6a4
......@@ -100,38 +100,38 @@
>
</item>
<item>
<div slot="name" class="required">身份证有效期从</div>
<input
<div slot="name" class="required">户籍地址</div>
<textarea
slot="content"
v-model="baseInfo.id_card_date_from"
ref="myTestarea"
v-model="baseInfo.address_on_resident_booklit"
readonly
cols="30"
rows="1"
placeholder="上传身份证自动填充"
class="auto"
>
@input="addRows(baseInfo.address_on_resident_booklit)"
/>
</item>
<item>
<div slot="name" class="required">身份证有效期</div>
<div slot="name" class="required">身份证有效期</div>
<input
slot="content"
v-model="baseInfo.id_card_date_to"
v-model="baseInfo.id_card_date_from"
readonly
placeholder="上传身份证自动填充"
class="auto"
>
</item>
<item>
<div slot="name" class="required">户籍地址</div>
<textarea
<div slot="name" class="required">身份证有效期到</div>
<input
slot="content"
ref="myTestarea"
v-model="baseInfo.address_on_resident_booklit"
v-model="baseInfo.id_card_date_to"
readonly
cols="30"
rows="1"
placeholder="上传身份证自动填充"
class="auto"
@input="addRows(baseInfo.address_on_resident_booklit)"
/>
>
</item>
<item>
<div slot="name" class="required">手机号码</div>
......@@ -596,17 +596,17 @@ export default {
item['url'] = process.env.filePath + 'attachment_id=' + item.attachment_id + '&access_token=' + window.localStorage.access_token
})
switch (cdd_item) {
case 'NP_ID_CARD_F': // 承租人身份证正面
vm.idCardFront = item.url
case 'NP_ID_CARD_F': // 承租人身份证正面
vm.idCardFront = res.lists[0].url
break
case 'NP_ID_CARD_B': // 承租人身份证背面
vm.idCardBack = item.url
case 'NP_ID_CARD_B': // 承租人身份证背面
vm.idCardBack = res.lists[0].url
break
case 'MATE_ID_CARD_F': // 配偶身份证正面
vm.idCardFrontSp = item.url
case 'MATE_ID_CARD_F': // 配偶身份证正面
vm.idCardFrontSp = res.lists[0].url
break
case 'MATE_ID_CARD_B': // 配偶身份证背面
vm.idCardBackSp = item.url
case 'MATE_ID_CARD_B': // 配偶身份证背面
vm.idCardBackSp = res.lists[0].url
break
default:
vm.dowload_list.push(res.lists)
......@@ -643,16 +643,16 @@ export default {
var listTemp = [...res.lists]
listTemp.forEach(item => {
switch (item.cdd_item) {
case 'NP_ID_CARD_F': // 承租人身份证正面
case 'NP_ID_CARD_F': // 承租人身份证正面
vm.idCardFrontCheck_id = item.check_id
break
case 'NP_ID_CARD_B': // 承租人身份证背面
case 'NP_ID_CARD_B': // 承租人身份证背面
vm.idCardBackCheck_id = item.check_id
break
case 'MATE_ID_CARD_F': // 配偶身份证正面
case 'MATE_ID_CARD_F': // 配偶身份证正面
vm.idCardFrontSpCheck_id = item.check_id
break
case 'MATE_ID_CARD_B': // 配偶身份证背面
case 'MATE_ID_CARD_B': // 配偶身份证背面
vm.idCardBackSpCheck_id = item.check_id
break
case 'BANK_CARD':
......@@ -668,17 +668,17 @@ export default {
})
if (vm.idCardFrontEditFlag) { // 身份证正面图片已修改,重新上传
var list = []
let obj = {
'pkvalue': vm.idCardFrontCheck_id,
'source_type': 'PRJ_CDD_ITEM_CHECK',
'picture': '',
'check_id': vm.idCardFrontCheck_id,
'filePath': vm.idCardFront,
'attachment_id': '',
'user_id': 1,
'fileName': 'front',
}
list.push(obj)
let obj = {
'pkvalue': vm.idCardFrontCheck_id,
'source_type': 'PRJ_CDD_ITEM_CHECK',
'picture': '',
'check_id': vm.idCardFrontCheck_id,
'filePath': vm.idCardFront,
'attachment_id': '',
'user_id': 1,
'fileName': 'front',
}
list.push(obj)
vm.save_picture(list)
}
if (vm.idCardBackEditFlag) { // 身份证反面图片已修改,重新上传
......@@ -999,11 +999,9 @@ export default {
hlsPopup.showLongCenter('请拍照')
} else {
if (ocrType === 'idCard') {
// vm.idCardEditFlag = true // 身份证图片状态已修改
type === 'front' ? (vm.idCardFront = imgdata, vm.idCardIdentify(imgdata,'idCard'),vm.idCardFrontEditFlag = true) : (vm.idCardBack = imgdata,vm.idCardBackIdentify(imgdata,'idCard'),vm.idCardBackEditFlag = true)
type === 'front' ? (vm.idCardFront = imgdata, vm.idCardIdentify(imgdata, 'idCard'), vm.idCardFrontEditFlag = true) : (vm.idCardBack = imgdata, vm.idCardBackIdentify(imgdata, 'idCard'), vm.idCardBackEditFlag = true)
} else if (ocrType === 'idCardSp') { // 配偶身份证识别
vm.idCardSpEditFlag = true // 身份证图片状态已修改
type === 'front' ? (vm.idCardFrontSp = imgdata, vm.idCardIdentify(imgdata,'idCardSp'),vm.idCardFrontSpEditFlag = true) : (vm.idCardBackSp = imgdata,vm.idCardBackIdentify(imgdata,'idCardSp'),vm.idCardBackSpEditFlag = true)
type === 'front' ? (vm.idCardFrontSp = imgdata, vm.idCardIdentify(imgdata, 'idCardSp'), vm.idCardFrontSpEditFlag = true) : (vm.idCardBackSp = imgdata, vm.idCardBackIdentify(imgdata, 'idCardSp'), vm.idCardBackSpEditFlag = true)
} else if (ocrType === 'bankCard') {
vm.bankImg = imgdata
vm.bankCardIdentify(imgdata)
......@@ -1028,12 +1026,10 @@ export default {
hlsPopup.showLongCenter('请选择一张图片')
} else {
if (ocrType === 'idCard') {
vm.idCardEditFlag = true // 身份证图片状态已修改
type === 'front' ? (vm.idCardFront = imgUrl[0], vm.idCardIdentify(imgUrl[0],'idCard'),vm.idCardFrontEditFlag = true) : (vm.idCardBack = imgUrl[0],vm.idCardBackIdentify(imgUrl[0],'idCard'),vm.idCardBackEditFlag = true)
}else if (ocrType === 'idCardSp') { // 配偶身份证识别
vm.idCardSpEditFlag = true // 身份证图片状态已修改
type === 'front' ? (vm.idCardFrontSp = imgUrl[0], vm.idCardIdentify(imgUrl[0],'idCardSp'),vm.idCardFrontSpEditFlag = true) : (vm.idCardBackSp = imgUrl[0],vm.idCardBackIdentify(imgUrl[0],'idCardSp'),vm.idCardBackSpEditFlag = true)
} else if (ocrType === 'bankCard') {
type === 'front' ? (vm.idCardFront = imgUrl[0], vm.idCardIdentify(imgUrl[0], 'idCard'), vm.idCardFrontEditFlag = true) : (vm.idCardBack = imgUrl[0], vm.idCardBackIdentify(imgUrl[0], 'idCard'), vm.idCardBackEditFlag = true)
} else if (ocrType === 'idCardSp') { // 配偶身份证识别
type === 'front' ? (vm.idCardFrontSp = imgUrl[0], vm.idCardIdentify(imgUrl[0], 'idCardSp'), vm.idCardFrontSpEditFlag = true) : (vm.idCardBackSp = imgUrl[0], vm.idCardBackIdentify(imgUrl[0], 'idCardSp'), vm.idCardBackSpEditFlag = true)
} else if (ocrType === 'bankCard') {
vm.bankImg = imgUrl[0]
vm.bankCardIdentify(imgUrl[0])
}
......@@ -1045,40 +1041,40 @@ export default {
vm.hlsUtil.takePicture(cameraoptions, success, error)
},
// 身份证识别
idCardIdentify (fileUrl,cardType) {
idCardIdentify (fileUrl, cardType) {
let vm = this
hlsPopup.showLoading('正在识别')
let url = process.env.ocrPath + '/baidu/ocr/idCard'
hlsUtil.baiduOcr(fileUrl, url, function (res) {
hlsPopup.hideLoading()
let result = res.result.words_result
if(cardType === 'idCard'){
if (cardType === 'idCard') {
vm.baseInfo.bp_name = result.姓名.words
vm.baseInfo.id_card_no = result.公民身份号码.words
vm.baseInfo.address_on_resident_booklit = result.住址.words
}else{
} else {
vm.baseInfo.bp_name_sp = result.姓名.words
vm.baseInfo.id_card_no_sp = result.公民身份号码.words
}
})
},
// 身份证背面识别
idCardBackIdentify (fileUrl,cardType) {
let vm = this
hlsPopup.showLoading('正在识别')
let url = process.env.ocrPath + '/baidu/ocr/idCardBack'
hlsUtil.baiduOcr(fileUrl, url, function (res) {
hlsPopup.hideLoading()
let result = res.result.words_result
if(cardType === 'idCard'){
vm.baseInfo.id_card_date_from = result.签发日期.words
vm.baseInfo.id_card_date_to = result.失效日期.words
}else{
vm.baseInfo.id_card_date_from_sp = result.签发日期.words
vm.baseInfo.id_card_date_to_sp = result.失效日期.words
}
})
},
idCardBackIdentify (fileUrl, cardType) {
let vm = this
hlsPopup.showLoading('正在识别')
let url = process.env.ocrPath + '/baidu/ocr/idCardBack'
hlsUtil.baiduOcr(fileUrl, url, function (res) {
hlsPopup.hideLoading()
let result = res.result.words_result
if (cardType === 'idCard') {
vm.baseInfo.id_card_date_from = result.签发日期.words
vm.baseInfo.id_card_date_to = result.失效日期.words
} else {
vm.baseInfo.id_card_date_from_sp = result.签发日期.words
vm.baseInfo.id_card_date_to_sp = result.失效日期.words
}
})
},
// 银行卡识别
bankCardIdentify (fileUrl) {
let vm = this
......
......@@ -235,6 +235,26 @@
class="auto"
>
</item>
<item>
<div slot="name" class="required">身份证有效期从</div>
<input
slot="content"
v-model="authMsg.auth_id_card_date_from"
readonly
placeholder="上传身份证自动填充"
class="auto"
>
</item>
<item>
<div slot="name" class="required">身份证有效期到</div>
<input
slot="content"
v-model="authMsg.auth_id_card_date_to"
readonly
placeholder="上传身份证自动填充"
class="auto"
>
</item>
<item>
<div slot="name" class="font-color required">公司职务</div>
<input slot="content" v-model="authMsg.auth_person_position" placeholder="请输入公司职务" >
......@@ -268,6 +288,26 @@
class="auto"
>
</item>
<item>
<div slot="name" class="required">身份证有效期从</div>
<input
slot="content"
v-model="legal_personMsg.id_card_date_from"
readonly
placeholder="上传身份证自动填充"
class="auto"
>
</item>
<item>
<div slot="name" class="required">身份证有效期到</div>
<input
slot="content"
v-model="legal_personMsg.id_card_date_to"
readonly
placeholder="上传身份证自动填充"
class="auto"
>
</item>
<item>
<div slot="name" class="font-color required">手机号</div>
<input slot="content" v-model="legal_personMsg.cell_phone" placeholder="请输入手机号" >
......@@ -467,6 +507,8 @@ export default {
// legal_person: '',
cell_phone: null,
living_address: '',
id_card_date_from: '',// 法定代表人身份证有效期从
id_card_date_to: '', //法定代表人身份证有效期到
},
baseInfo: {
district_id: '',
......@@ -503,6 +545,8 @@ export default {
auth_person_matter: '',
auth_person_id_card: '',
auth_person_position: '',
auth_id_card_date_from: '', // 授权人身份证有效期从
auth_id_card_date_to: '',// 授权人身份证有效期到
},
idCardFront: '', // 身份证正面图片
idCardBack: '', // 身份证反面图片
......@@ -512,13 +556,15 @@ export default {
upload_list: [], // 上传图片列表
dowload_list: [], // 下载图片列表
cddItemList: [], // 资料清单列表
idCardCheck_id: '', // 身份证check_id
idCardFrontCheck_id: '', // 身份证正面check_id
idCardBackCheck_id: '', // 身份证背面check_id
bankCardCheck_id: '', // 银行卡check_id
licenseCheck_id: '', // 营业执照check_id
laCheck_id: '', // 授权书check_id
idCardImgList: [], // 存身份证图片列表
bankCardImgList: [], // 存上传银行卡图片列表
idCardEditFlag: false, // 身份证修改标识,为true则标识已修改,后续需要重新上传此照片
idCardFrontEditFlag: false, // 身份证正面修改标识,为true则标识已修改,后续需要重新上传此照片
idCardBackEditFlag: false, // 身份证正面修改标识,为true则标识已修改,后续需要重新上传此照片
licenseEditFlag: false, // 营业执照照片修改标识,为true则标识已修改,后续需要重新上传此照片
LaEditFlag: false, // 授权书图片修改标识,为true则标识已修改,后续需要重新上传此照片
isClear: false,
......@@ -812,12 +858,24 @@ export default {
case 'living_address':
vm.hlsPopup.showLongCenter('居住地址未填写')
break
case 'id_card_date_from':
vm.hlsPopup.showLongCenter('身份证有效期从未填写')
break
case 'id_card_date_to':
vm.hlsPopup.showLongCenter('身份证有效期到未填写')
break
case 'auth_person_name':
vm.hlsPopup.showLongCenter('授权人姓名未填写')
break
case 'auth_person_id_card':
vm.hlsPopup.showLongCenter('身份证号未填写')
break
case 'auth_id_card_date_from':
vm.hlsPopup.showLongCenter('身份证有效期从未填写')
break
case 'auth_id_card_date_to':
vm.hlsPopup.showLongCenter('身份证有效期到未填写')
break
case 'user_phone':
vm.hlsPopup.showLongCenter('您还未登录')
break
......@@ -1201,8 +1259,7 @@ export default {
hlsPopup.showLongCenter('请拍照')
} else {
if (ocrType === 'idCard') {
vm.idCardEditFlag = true // 身份证图片状态已修改
type === 'front' ? (vm.idCardFront = imgdata, vm.idCardIdentify(imgdata), vm.idCardImgList.push({'url': imgdata, 'fileName': 'front'})) : (vm.idCardBack = imgdata, vm.idCardImgList.push({'url': imgdata, 'fileName': 'back'}))
type === 'front' ? (vm.idCardFront = imgdata, vm.idCardIdentify(imgdata),vm.idCardFrontEditFlag = true) : (vm.idCardBack = imgdata,vm.idCardBackIdentify(imgdata)vm.idCardBackEditFlag = true)
} else if (ocrType === 'bankCard') {
vm.bankImg = imgdata
vm.bankCardIdentify(imgdata)
......@@ -1231,8 +1288,7 @@ export default {
hlsPopup.showLongCenter('请选择一张图片')
} else {
if (ocrType === 'idCard') {
vm.idCardEditFlag = true // 身份证图片状态已修改
type === 'front' ? (vm.idCardFront = imgUrl[0], vm.idCardIdentify(imgUrl[0]), vm.idCardImgList.push({'url': imgUrl[0], 'fileName': 'front'})) : (vm.idCardBack = imgUrl[0], vm.idCardImgList.push({'url': imgUrl[0], 'fileName': 'back'}))
type === 'front' ? (vm.idCardFront = imgUrl[0], vm.idCardIdentify(imgUrl[0]),vm.idCardFrontEditFlag = true) : (vm.idCardBack = imgUrl[0],vm.idCardBackIdentify(imgUrl[0]),vm.idCardBackEditFlag = true)
} else if (ocrType === 'bankCard') {
vm.bankImg = imgUrl[0]
vm.bankCardIdentify(imgUrl[0])
......@@ -1267,6 +1323,25 @@ export default {
}
})
},
// 身份证背面识别
idCardBackIdentify (fileUrl) {
let vm = this
hlsPopup.showLoading('正在识别')
let url = process.env.ocrPath + '/baidu/ocr/idCardBack'
hlsUtil.baiduOcr(fileUrl, url, function (res) {
hlsPopup.hideLoading()
let result = res.result.words_result
if (vm.flag) {
// 未授权 身份证有效期从,身份证有效期到
vm.legal_personMsg.id_card_date_from = result.签发日期.words
vm.legal_personMsg.id_card_date_to = result.失效日期.words
} else {
// 已授权 身份证有效期从,身份证有效期到
vm.authMsg.auth_id_card_date_from = result.签发日期.words
vm.authMsg.auth_id_card_date_to = result.失效日期.words
}
})
},
// 银行卡识别
bankCardIdentify (fileUrl) {
let vm = this
......@@ -1310,14 +1385,11 @@ export default {
item['url'] = process.env.filePath + 'attachment_id=' + item.attachment_id + '&access_token=' + window.localStorage.access_token
})
switch (cdd_item) {
case 'NP_ID_CARD':
res.lists.forEach(item => {
if (item.file_name === 'front.jpg') {
vm.idCardFront = item.url
} else {
vm.idCardBack = item.url
}
})
case 'NP_ID_CARD_F': // 身份证正面
vm.idCardFront = res.lists[0].url
break
case 'NP_ID_CARD_B': // 身份证背面
vm.idCardBack = res.lists[0].url
break
case 'ORG_CODE':
vm.licenseImg = res.lists[0].url
......@@ -1352,8 +1424,11 @@ export default {
var listTemp = [...res.lists]
listTemp.forEach(item => {
switch (item.cdd_item) {
case 'NP_ID_CARD':
vm.idCardCheck_id = item.check_id
case 'NP_ID_CARD_F': // 身份证正面
vm.idCardFrontCheck_id = item.check_id
break
case 'NP_ID_CARD_B': // 身份证背面
vm.idCardBackCheck_id = item.check_id
break
case 'ORG_CODE':
vm.licenseCheck_id = item.check_id
......@@ -1372,21 +1447,34 @@ export default {
listTemp.forEach((item, index) => {
vm.load_picture(item.check_id, index, item.cdd_item)
})
if (vm.idCardEditFlag) { // 身份证图片已修改,重新上传
if (vm.idCardFrontEditFlag) { // 身份证正面图片已修改,重新上传
var list = []
for (let i = 0; i < vm.idCardImgList.length; i++) {
let obj = {
'pkvalue': vm.idCardCheck_id,
'pkvalue': vm.idCardFrontCheck_id,
'source_type': 'PRJ_CDD_ITEM_CHECK',
'picture': '',
'check_id': vm.idCardCheck_id,
'filePath': vm.idCardImgList[i].url,
'check_id': vm.idCardFrontCheck_id,
'filePath': vm.idCardFront,
'attachment_id': '',
'user_id': 1,
'fileName': vm.idCardImgList[i].fileName,
'fileName': 'front',
}
list.push(obj)
vm.save_picture(list)
}
if (vm.idCardBackEditFlag) { // 身份证背面图片已修改,重新上传
var list = []
let obj = {
'pkvalue': vm.idCardBackCheck_id,
'source_type': 'PRJ_CDD_ITEM_CHECK',
'picture': '',
'check_id': vm.idCardBackCheck_id,
'filePath': vm.idCardBack,
'attachment_id': '',
'user_id': 1,
'fileName': 'back',
}
list.push(obj)
vm.save_picture(list)
}
if (vm.licenseEditFlag) { // 营业执照图片已修改,重新上传
......
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