Commit 1d72b224 authored by 786817560's avatar 786817560

''

parent 69d76b87
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: 附件信息 * @Description: 附件信息
* @Author: your name * @Author: your name
* @Date: 2019-09-20 09:35:11 * @Date: 2019-09-20 09:35:11
* @LastEditTime: 2019-12-12 10:07:29 * @LastEditTime: 2019-12-12 14:37:36
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
--> -->
<template> <template>
...@@ -17,29 +17,60 @@ ...@@ -17,29 +17,60 @@
<div v-for="(list, index) in cddItemList" :key="index" class="card2"> <div v-for="(list, index) in cddItemList" :key="index" class="card2">
<span>{{ list.description }}</span> <span>{{ list.description }}</span>
<div class="img-content"> <div class="img-content">
<!--待上传图片列表--> <div v-if="list.cdd_item==='CAR_CARD' || list.cdd_item==='HOUSE_CARD'">
<div <!--从服务器上下载的图片-->
v-for="(item, index) in upload_list" v-if="item.check_id==list.check_id" :key="index" <div v-for="item in dowload_list">
class="card-upload"> <div v-for="(pic, index) in item" v-if="pic.check_id==list.check_id" :key="index">
<img :src="item.picture" @click="showBigPicture(item.picture)"> <!-- 通过 -->
<div class="close" @click="remove_pic(item.attachment_id, index)"> <div v-if="isApproved" class="card-upload">
<img src="@/assets/userBind/deleteIcon.png"> <img :src="pic.url" @click="showBigPicture(pic.url)">
</div>
<!-- 未通过 -->
<div v-if="!isApproved" class="card-upload">
<img :src="pic.url" @click="ocrShow(list.cdd_item, '')">
</div>
<!-- <div v-if="pic.length === 0" class="card-upload plus" @click="imgUploadShow(list.description,list.check_id)">
<img src="@/assets/userBind/camera.png" class="upload-btn">
</div> -->
</div>
</div>
<!--待上传图片列表-->
<div
v-for="(item, index) in upload_list" v-if="item.check_id==list.check_id" :key="index"
class="card-upload">
<img :src="item.picture" @click="ocrShow(list.cdd_item, '')">
<!-- <div class="close" @click="remove_pic(item.attachment_id, index)">
<img src="@/assets/userBind/deleteIcon.png">
</div> -->
</div> </div>
</div> </div>
<!--从服务器上下载的图片--> <div v-else>
<div v-for="item in dowload_list"> <div v-for="item in dowload_list">
<div v-for="(pic, index) in item" v-if="pic.check_id==list.check_id" :key="index" class="card-upload"> <div v-for="(pic, index) in item" v-if="pic.check_id==list.check_id" :key="index" class="card-upload">
<img :src="pic.url" @click="showBigPicture(pic.url)"> <img :src="pic.url" @click="showBigPicture(pic.url)">
<div class="close" @click="delete_pic(pic.attachment_id)"> <div class="close" @click="delete_pic(pic.attachment_id)">
<img src="@/assets/userBind/deleteIcon.png">
</div>
</div>
</div>
<!--待上传图片列表-->
<div
v-for="(item, index) in upload_list" v-if="item.check_id==list.check_id" :key="index"
class="card-upload">
<img :src="item.picture" @click="ocrShow(list.cdd_item, '')">
<div class="close" @click="remove_pic(item.attachment_id, index)">
<img src="@/assets/userBind/deleteIcon.png"> <img src="@/assets/userBind/deleteIcon.png">
</div> </div>
</div> </div>
<div class="card-upload plus" @click="imgUploadShow(list.description,list.check_id)">
<img src="@/assets/userBind/camera.png" class="upload-btn">
</div>
</div> </div>
<div class="card-upload plus" @click="imgUploadShow(list.description,list.check_id)">
<img src="@/assets/userBind/camera.png" class="upload-btn">
</div>
</div> </div>
</div> </div>
<!-- </div> -->
</h-content> </h-content>
<bottom-tab class="footer-button"> <bottom-tab class="footer-button">
<tab-button class="save" @click.native="verified">下一步</tab-button> <tab-button class="save" @click.native="verified">下一步</tab-button>
...@@ -50,10 +81,14 @@ ...@@ -50,10 +81,14 @@
export default { export default {
data () { data () {
return { return {
carImg: '',
houseImg: '',
from: false, from: false,
bp_id: '', bp_id: '',
flag: false, flag: false,
isApproved: false, isApproved: false,
isUploadCar: false,
isUploadHouse: false,
cddItemList: [], // 资料清单列表 cddItemList: [], // 资料清单列表
dowload_list: [], // 下载图片列表 dowload_list: [], // 下载图片列表
upload_list: [], // 上传图片列表 upload_list: [], // 上传图片列表
...@@ -82,27 +117,71 @@ export default { ...@@ -82,27 +117,71 @@ export default {
}, },
}) })
}, },
load_picture (check_id, index, cdd_item) { // 房产证/车辆证识别
ocrShow (ocrType, type) {
let vm = this let vm = this
let url = process.env.basePath + 'attachment_list_query' + '&index' + index // 附件查询 hlsPopup.showActionSheet({
let param = { titleText: '请选择照片',
check_id: check_id, buttonArray: ['拍照', '从相册取'],
callback: index => {
if (index === 0) {
vm.openCamera(ocrType, type)
} else {
vm.takePicture(ocrType, type)
}
},
})
},
openCamera (ocrType, type) {
let vm = this
let cameraoptions = {
quality: 60,
width: 1843,
height: 1382,
} }
hlsPopup.showLoading('请稍候') let success = function (imgdata) {
vm.$post(url, param).then(function (res) { if (!imgdata) {
vm.hlsPopup.hideLoading() hlsPopup.showLongCenter('请拍照')
if (res.result === 'S') {
res.lists.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.attachment_id + '&access_token=' + window.localStorage.access_token
})
console.log('res.lists', res.lists)
vm.dowload_list.push(res.lists)
console.log('dowload_list', vm.dowload_list)
} else { } else {
hlsPopup.showLongCenter(res.message) if (ocrType === 'HOUSE_CARD') {
vm.isUploadHouse = true
vm.houseImg = imgdata
} else if (ocrType === 'CAR_CARD') {
vm.isUploadCar = true
vm.carImg = imgdata
}
} }
}) }
let error = function () {
hlsPopup.showLongCenter('请拍照')
}
hlsUtil.openCamera(cameraoptions, success, error)
}, },
takePicture (ocrType, type) {
let vm = this
var cameraoptions = {
quality: 70,
width: 1843,
height: 1382,
maxCount: 1,
}
let success = function (imgUrl) {
if (imgUrl.length === 0) {
hlsPopup.showLongCenter('请选择一张图片')
} else {
if (ocrType === 'HOUSE_CARD') {
vm.houseImg = imgUrl[0]
} else if (ocrType === 'CAR_CARD') {
vm.carImg = imgUrl[0]
}
}
}
let error = function () {
hlsPopup.showLongCenter(error)
}
vm.hlsUtil.takePicture(cameraoptions, success, error)
},
loadItemList () { loadItemList () {
let vm = this let vm = this
let url = process.env.basePath + 'prj_cdd_check_list' let url = process.env.basePath + 'prj_cdd_check_list'
...@@ -113,65 +192,36 @@ export default { ...@@ -113,65 +192,36 @@ export default {
'tab_group': window.localStorage.authFlag ? 'HLS_ORG_NAUTH' : 'HLS_ORG_AUTH', 'tab_group': window.localStorage.authFlag ? 'HLS_ORG_NAUTH' : 'HLS_ORG_AUTH',
}, },
} }
// vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) { vm.hlsHttp.post(url, param).then(function (res) {
// vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.cddItemList = [] vm.cddItemList = []
console.log('loadItemList', res.lists) vm.cddItemList = res.lists.filter(item => { return item.cdd_item === 'HOUSE_CARD' || item.cdd_item === 'CAR_CARD' || item.cdd_item === 'ASSETS_CARD' })
var listTemp = [...res.lists]
listTemp.forEach(item => {
switch (item.cdd_item) {
case 'LEGAL_ID_CARD_F': // 法定代表人身份证正面
vm.idCardFrontCheck_id = item.check_id
break
case 'LEGAL_ID_CARD_B': // 法定代表人身份证背面
vm.idCardBackCheck_id = item.check_id
break
case 'AUTHOR_ID_CARD_F': // 授权人身份证正面
vm.authidCardFrontCheck_id = item.check_id
break
case 'AUTHOR_ID_CARD_B': // 授权人身份证背面
vm.authidCardBackCheck_id = item.check_id
break
case 'ORG_CODE':
vm.licenseCheck_id = item.check_id
break
case 'BANK_CARD':
break
case 'L/A':
vm.laCheck_id = item.check_id
break
default:
vm.cddItemList.push(item)
console.table('cddItemList', vm.cddItemList)
}
})
// 查询图片 // 查询图片
listTemp.forEach((item, index) => { vm.cddItemList.forEach((item, index) => {
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)
vm.load_picture(item.check_id, index, item.cdd_item)
}
}) })
if (vm.idCardFrontEditFlag) { // 法定代表人身份证正面图片已修改,重新上传 }
vm.idCardFrontUrlFlag = true })
vm.delete_pic_to_ocr(vm.idCardFrontAttachmentId)// 先删除之前识别的图片 },
var list = []
let obj = { load_picture (check_id, index, cdd_item) {
'pkvalue': vm.idCardFrontCheck_id, let vm = this
'source_type': 'PRJ_CDD_ITEM_CHECK', let url = process.env.basePath + 'attachment_list_query' + '&index' + index // 附件查询
'picture': '', let param = {
'check_id': vm.idCardFrontCheck_id, check_id: check_id,
'filePath': vm.idCardFront, }
'attachment_id': '', hlsPopup.showLoading('请稍候')
'user_id': 1, vm.$post(url, param).then(function (res) {
'fileName': '法人身份证正面', vm.hlsPopup.hideLoading()
} if (res.result === 'S') {
list.push(obj) res.lists.forEach(item => {
vm.save_picture(list) item['url'] = process.env.filePath + 'attachment_id=' + item.attachment_id + '&access_token=' + window.localStorage.access_token
vm.idCardFrontEditFlag = false // 置为false,防止再次保存重复上传,只有重新识别才会重新上传 })
} console.log('res.lists', res.lists)
vm.dowload_list.push(res.lists)
console.log('dowload_list', vm.dowload_list)
} else {
hlsPopup.showLongCenter(res.message)
} }
}) })
}, },
......
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