Commit 1d72b224 authored by 786817560's avatar 786817560

''

parent 69d76b87
......@@ -2,7 +2,7 @@
* @Description: 附件信息
* @Author: your name
* @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
-->
<template>
......@@ -17,29 +17,60 @@
<div v-for="(list, index) in cddItemList" :key="index" class="card2">
<span>{{ list.description }}</span>
<div class="img-content">
<!--待上传图片列表-->
<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="showBigPicture(item.picture)">
<div class="close" @click="remove_pic(item.attachment_id, index)">
<img src="@/assets/userBind/deleteIcon.png">
<div v-if="list.cdd_item==='CAR_CARD' || list.cdd_item==='HOUSE_CARD'">
<!--从服务器上下载的图片-->
<div v-for="item in dowload_list">
<div v-for="(pic, index) in item" v-if="pic.check_id==list.check_id" :key="index">
<!-- 通过 -->
<div v-if="isApproved" class="card-upload">
<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 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">
<img :src="pic.url" @click="showBigPicture(pic.url)">
<div class="close" @click="delete_pic(pic.attachment_id)">
<div v-else>
<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">
<img :src="pic.url" @click="showBigPicture(pic.url)">
<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">
</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 class="card-upload plus" @click="imgUploadShow(list.description,list.check_id)">
<img src="@/assets/userBind/camera.png" class="upload-btn">
</div>
</div>
</div>
<!-- </div> -->
</h-content>
<bottom-tab class="footer-button">
<tab-button class="save" @click.native="verified">下一步</tab-button>
......@@ -50,10 +81,14 @@
export default {
data () {
return {
carImg: '',
houseImg: '',
from: false,
bp_id: '',
flag: false,
isApproved: false,
isUploadCar: false,
isUploadHouse: false,
cddItemList: [], // 资料清单列表
dowload_list: [], // 下载图片列表
upload_list: [], // 上传图片列表
......@@ -82,27 +117,71 @@ export default {
},
})
},
load_picture (check_id, index, cdd_item) {
// 房产证/车辆证识别
ocrShow (ocrType, type) {
let vm = this
let url = process.env.basePath + 'attachment_list_query' + '&index' + index // 附件查询
let param = {
check_id: check_id,
hlsPopup.showActionSheet({
titleText: '请选择照片',
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('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
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)
let success = function (imgdata) {
if (!imgdata) {
hlsPopup.showLongCenter('请拍照')
} 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 () {
let vm = this
let url = process.env.basePath + 'prj_cdd_check_list'
......@@ -113,65 +192,36 @@ export default {
'tab_group': window.localStorage.authFlag ? 'HLS_ORG_NAUTH' : 'HLS_ORG_AUTH',
},
}
// vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) {
// 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) {
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)
}
})
vm.cddItemList = res.lists.filter(item => { return item.cdd_item === 'HOUSE_CARD' || item.cdd_item === 'CAR_CARD' || item.cdd_item === 'ASSETS_CARD' })
// 查询图片
listTemp.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.cddItemList.forEach((item, index) => {
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 = {
'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': '法人身份证正面',
}
list.push(obj)
vm.save_picture(list)
vm.idCardFrontEditFlag = false // 置为false,防止再次保存重复上传,只有重新识别才会重新上传
}
}
})
},
load_picture (check_id, index, cdd_item) {
let vm = this
let url = process.env.basePath + 'attachment_list_query' + '&index' + index // 附件查询
let param = {
check_id: check_id,
}
hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
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 {
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