Commit 69d76b87 authored by 786817560's avatar 786817560

Merge branch 'ren' into develop

parents 1894eda1 97f83b22
......@@ -2,7 +2,7 @@
* @Description: 附件信息
* @Author: your name
* @Date: 2019-09-20 09:35:11
* @LastEditTime: 2019-12-11 19:20:11
* @LastEditTime: 2019-12-12 10:07:29
* @LastEditors: Please set LastEditors
-->
<template>
......@@ -53,6 +53,7 @@ export default {
from: false,
bp_id: '',
flag: false,
isApproved: false,
cddItemList: [], // 资料清单列表
dowload_list: [], // 下载图片列表
upload_list: [], // 上传图片列表
......@@ -65,6 +66,7 @@ export default {
vm.upload_list = [] // 上传图片列表
vm.dowload_list = []
vm.cddItemList = []
vm.isApproved = window.localStorage.isApproved
vm.bp_id = vm.$route.params.bp_id
vm.loadItemList()
}
......@@ -93,46 +95,9 @@ export default {
res.lists.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.attachment_id + '&access_token=' + window.localStorage.access_token
})
switch (cdd_item) {
case 'LEGAL_ID_CARD_F': // 法定代表人身份证正面
if (!vm.idCardFrontUrlFlag) {
vm.idCardFront = res.lists[0].url
}
vm.idCardFrontAttachmentId = res.lists[0].attachment_id
break
case 'LEGAL_ID_CARD_B': // 法定代表人身份证背面
if (!vm.idCardBackUrlFlag) {
vm.idCardBack = res.lists[0].url
}
vm.idCardBackAttachmentId = res.lists[0].attachment_id
break
case 'AUTHOR_ID_CARD_F': // 授权人身份证正面
if (!vm.authidCardFrontUrlFlag) {
vm.authidCardFront = res.lists[0].url
}
vm.authidCardFrontAttachmentId = res.lists[0].attachment_id
break
case 'AUTHOR_ID_CARD_B': // 授权人身份证背面
if (!vm.authidCardBackUrlFlag) {
vm.authidCardBack = res.lists[0].url
}
vm.authidCardBackAttachmentId = res.lists[0].attachment_id
break
case 'ORG_CODE':
if (!vm.licenseImgUrlFlag) {
vm.licenseImg = res.lists[0].url
}
vm.licenseAttachmentId = res.lists[0].attachment_id
break
case 'L/A':
if (!vm.laImgUrlFlag) {
vm.laImg = res.lists[0].url
}
vm.laAttachmentId = res.lists[0].attachment_id
break
default:
vm.dowload_list.push(res.lists)
}
console.log('res.lists', res.lists)
vm.dowload_list.push(res.lists)
console.log('dowload_list', vm.dowload_list)
} else {
hlsPopup.showLongCenter(res.message)
}
......@@ -153,6 +118,7 @@ export default {
// vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.cddItemList = []
console.log('loadItemList', res.lists)
var listTemp = [...res.lists]
listTemp.forEach(item => {
switch (item.cdd_item) {
......@@ -179,11 +145,14 @@ export default {
break
default:
vm.cddItemList.push(item)
console.table('cddItemList', vm.cddItemList)
}
})
// 查询图片
listTemp.forEach((item, index) => {
vm.load_picture(item.check_id, index, item.cdd_item)
if (item.cdd_item !== 'LEGAL_ID_CARD_F' && item.cdd_item !== 'LEGAL_ID_CARD_B' && item.cdd_item !== 'AUTHOR_ID_CARD_F' && item.cdd_item !== 'AUTHOR_ID_CARD_B' && item.cdd_item !== 'ORG_CODE' && item.cdd_item !== 'BANK_CARD' && item.cdd_item !== 'L/A') {
vm.load_picture(item.check_id, index, item.cdd_item)
}
})
if (vm.idCardFrontEditFlag) { // 法定代表人身份证正面图片已修改,重新上传
vm.idCardFrontUrlFlag = true
......@@ -203,96 +172,6 @@ export default {
vm.save_picture(list)
vm.idCardFrontEditFlag = false // 置为false,防止再次保存重复上传,只有重新识别才会重新上传
}
if (vm.idCardBackEditFlag) { // 法定代表人身份证背面图片已修改,重新上传
vm.idCardBackUrlFlag = true
vm.delete_pic_to_ocr(vm.idCardBackAttachmentId)// 先删除之前识别的图片
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': '法人身份证背面',
}
list.push(obj)
vm.save_picture(list)
vm.idCardBackEditFlag = false // 置为false,防止再次保存重复上传,只有重新识别才会重新上传
}
if (vm.authidCardFrontEditFlag) { // 授权人身份证正面图片已修改,重新上传
vm.authidCardFrontUrlFlag = true
vm.delete_pic_to_ocr(vm.authidCardFrontAttachmentId)// 先删除之前识别的图片
var list = []
let obj = {
'pkvalue': vm.authidCardFrontCheck_id,
'source_type': 'PRJ_CDD_ITEM_CHECK',
'picture': '',
'check_id': vm.authidCardFrontCheck_id,
'filePath': vm.authidCardFront,
'attachment_id': '',
'user_id': 1,
'fileName': '授权人身份证正面',
}
list.push(obj)
vm.save_picture(list)
vm.authidCardFrontEditFlag = false // 置为false,防止再次保存重复上传,只有重新识别才会重新上传
}
if (vm.authidCardBackEditFlag) { // 授权人身份证背面图片已修改,重新上传
vm.authidCardBackUrlFlag = true
vm.delete_pic_to_ocr(vm.authidCardBackAttachmentId)// 先删除之前识别的图片
var list = []
let obj = {
'pkvalue': vm.authidCardBackCheck_id,
'source_type': 'PRJ_CDD_ITEM_CHECK',
'picture': '',
'check_id': vm.authidCardBackCheck_id,
'filePath': vm.authidCardBack,
'attachment_id': '',
'user_id': 1,
'fileName': '授权人身份证背面',
}
list.push(obj)
vm.save_picture(list)
vm.authidCardBackEditFlag = false // 置为false,防止再次保存重复上传,只有重新识别才会重新上传
}
if (vm.licenseEditFlag) { // 营业执照图片已修改,重新上传
vm.licenseImgUrlFlag = true
vm.delete_pic_to_ocr(vm.licenseAttachmentId)// 先删除之前识别的图片
var list = []
let obj = {
'pkvalue': vm.licenseCheck_id,
'source_type': 'PRJ_CDD_ITEM_CHECK',
'picture': '',
'check_id': vm.licenseCheck_id,
'filePath': vm.licenseImg,
'attachment_id': '',
'user_id': 1,
'fileName': '企业营业执照',
}
list.push(obj)
vm.save_picture(list)
vm.licenseEditFlag = false // 置为false,防止再次保存重复上传,只有重新识别才会重新上传
}
if (vm.LaEditFlag) { // 授权书图片已修改,重新上传
vm.laImgUrlFlag = true
vm.delete_pic_to_ocr(vm.laAttachmentId)// 先删除之前识别的图片
var list = []
let obj = {
'pkvalue': vm.laCheck_id,
'source_type': 'PRJ_CDD_ITEM_CHECK',
'picture': '',
'check_id': vm.laCheck_id,
'filePath': vm.laImg,
'attachment_id': '',
'user_id': 1,
'fileName': '授权证书',
}
list.push(obj)
vm.save_picture(list)
vm.LaEditFlag = false // 置为false,防止再次保存重复上传,只有重新识别才会重新上传
}
}
})
},
......@@ -436,6 +315,44 @@ export default {
}
vm.dowload_list.sort()
},
// 图片保存
save_picture (list) {
let vm = this
if (list.length) {
// hlsPopup.showLoading('图片上传请稍候')
var alreadyUploadNum = 0
var attLength = 0
var recordUploadInterval = setInterval(function () {
if (alreadyUploadNum === attLength) {
clearInterval(recordUploadInterval)
/* hlsPopup.hideLoading()
hlsPopup.showLongCenter('图片上传成功') */
}
}, 500)
for (var i = 0; i < list.length; i++) {
let uploadSuccess = function (res) {
if (res.result === 'S') {
alreadyUploadNum++
for (var j = 0; j < list.length; j++) {
if (list[j].filePath === res.response.filePath) {
list[j].attachment_id = res.response.attachment_id
vm.upload_list.push(list[j])
break
}
}
} else {
hlsPopup.hideLoading()
}
}
if (!list[i].attachment_id) {
attLength++
hlsUtil.fileUploadSvc(list[i], uploadSuccess)
}
}
} else {
hlsPopup.hideLoading()
}
},
},
}
</script>
......
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