<template>
|
<div class="file-page">
|
<SectionTitle title="影像资料信息"></SectionTitle>
|
<p class="file-top-buttons" v-if="isEdit">
|
<el-button
|
size="small"
|
@click="createContract"
|
v-if="transCode === 'T1009' && deliveryWay !== '2'"
|
class="top-button"
|
>预览电子结清证明</el-button>
|
<el-button
|
size="small"
|
@click="createContractByPf"
|
class="top-button"
|
v-if="showAccountingOrg"
|
>预览浦发结清证明</el-button>
|
</p>
|
<p v-else>
|
<el-button
|
size="small"
|
@click="createContract"
|
v-if="transCode === 'T1009' && deliveryWay !== '2'"
|
class="top-button"
|
>生成电子结清证明</el-button>
|
</p>
|
<ul class="file-ul">
|
<li v-for="item in menu" :key="item.imageListCode">
|
<div class="file-section">
|
<p class="section-title">
|
<span v-if="isEdit && isRequiredUpload" class="require-dot">*</span>
|
<span>{{item.imageListName}}</span>
|
<span
|
v-if="Array.isArray(item.list) && item.list.length > 0"
|
class="img-num"
|
>({{item.list.length}}张)</span>
|
</p>
|
<div class="file-content">
|
<PhotoList
|
:list="item.list"
|
@action="init"
|
:isEdit="isEdit"
|
:info="item"
|
@getList="getList"
|
:imageEditStatus="$route.query.imageEditStatus"
|
></PhotoList>
|
</div>
|
</div>
|
</li>
|
</ul>
|
</div>
|
</template>
|
<script>
|
// 影像资料信息
|
import { mapState } from 'vuex'
|
import SectionTitle from '@/components/SectionTitle'
|
import PhotoList from '@/components/PhotoList'
|
import qryImageMenuList from '@/controller/qryImageMenuList'
|
import queryEcmPageList from '@/controller/queryEcmPageList'
|
import syncCreateContract from '@/controller/syncCreateContract'
|
import syncCreateContractByPf from '@/controller/syncCreateContractByPf'
|
import dataSupplementInfo from '@/controller/dataSupplementInfo'
|
|
export default {
|
components: {
|
SectionTitle,
|
PhotoList
|
},
|
props: {
|
conf: {
|
type: Object,
|
default: () => ({})
|
}
|
},
|
data() {
|
return {
|
menu: [],
|
query: {},
|
isEdit: true,
|
transCode: '',
|
model: null,
|
menuModel: null,
|
isRequiredUpload: false,
|
showAccountingOrg: false
|
}
|
},
|
created() {
|
this.init()
|
},
|
methods: {
|
init() {
|
const { $route, conf } = this
|
const { query } = $route
|
|
const { edit } = conf
|
|
const { transCode, isRequiredUpload } = query
|
|
this.query = query
|
this.isEdit = edit === 'Y'
|
this.isRequiredUpload = parseInt(isRequiredUpload) === 1
|
this.transCode = transCode
|
this.model = queryEcmPageList()
|
this.menuModel = qryImageMenuList()
|
this.getMenu()
|
this.getloanModel()
|
},
|
async getMenu() {
|
const { query, menuModel } = this
|
const {
|
transLogSerialno = '',
|
transCode = '',
|
imgTransCode = '',
|
pageId,
|
phaseNo
|
} = query
|
|
let reqData = null
|
if (pageId === '30') {
|
reqData = {
|
phaseNo,
|
transCode: '6001'
|
}
|
} else if (transCode === 'T1009') {
|
reqData = {
|
phaseNo,
|
transCode: '300'
|
}
|
} else {
|
reqData = transLogSerialno
|
? { businessNo: transLogSerialno }
|
: { transCode: imgTransCode || transCode }
|
}
|
const { list } = await menuModel.request(reqData)
|
this.menu = list
|
this.getList()
|
},
|
getList(item) {
|
const { menu } = this
|
menu.forEach(item => {
|
this.getItem(item)
|
})
|
},
|
|
async getItem(item) {
|
const { query, model } = this
|
const {
|
transLogSerialno,
|
objectType,
|
objectNo,
|
transCode,
|
serialNo
|
} = query
|
const { imageListCode } = item
|
let list = null
|
if (transCode === 'T1009') {
|
console.log('结清证明发送影像件')
|
const res = await model.request({
|
objectNo: serialNo,
|
objectType: 'jbo.acct.ACCT_LOAN',
|
typeNo: imageListCode
|
})
|
list = res.list
|
} else {
|
const res = await model.request({
|
objectNo: transLogSerialno || objectNo,
|
objectType,
|
typeNo: imageListCode
|
})
|
list = res.list
|
}
|
const { menu } = this
|
this.menu = menu.map(menuItem => {
|
if (menuItem.imageListCode === imageListCode) {
|
return {
|
...item,
|
list
|
}
|
} else {
|
return menuItem
|
}
|
})
|
},
|
|
// 生成电子结清证明
|
async createContract() {
|
const { query } = this
|
const { serialNo } = query
|
const model = syncCreateContract()
|
const { url } = await model.request({
|
loanSerialNo: serialNo
|
})
|
setTimeout(() => {
|
this.init()
|
}, 400);
|
const framAttrs =
|
'height=700px, width=800px, top=100px,left=400px, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no'
|
let newUrl = "/rlc-cts/server/oss?bucket=" + url.match(/\/\/([^.]+)/)[1] + "&ossKey=" + url.match(/\/(\d[\w]+)/)[1]
|
window.open(newUrl, 'newWindow', framAttrs)
|
},
|
// 预览瀞发结清证明
|
async createContractByPf() {
|
const { serialNo } = this.query
|
const model = syncCreateContractByPf()
|
const { url } = await model.request({
|
loanSerialNo: serialNo
|
})
|
const framAttrs =
|
'height=700px, width=800px, top=100px,left=400px, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no'
|
let newUrl = "/rlc-cts/server/oss?bucket=" + url.match(/\/\/([^.]+)/)[1] + "&ossKey=" + url.match(/\/(\d[\w]+)/)[1]
|
window.open(newUrl, 'newWindow', framAttrs)
|
},
|
|
showImg(item) {
|
const { isEdit, query } = this
|
const { objectType, objectNo } = query
|
const { serialno, typeno } = item
|
this.$goPhoto(
|
{
|
objectNo,
|
objectType,
|
typeNo: typeno,
|
serialno,
|
isEdit: isEdit ? 1 : ''
|
},
|
() => this.$emit('action')
|
)
|
},
|
async getloanModel() {
|
const { serialNo } = this.query
|
const res = await dataSupplementInfo(this.query.transCode).request({
|
serialNo
|
})
|
this.accountingOrgId = res.accountingOrgId
|
// accountingOrgId 为 YH_PF 或 YH_PFFB就是浦发银行的合同
|
const pfOrgs = ['YH_PF', 'YH_PFFB']
|
this.showAccountingOrg = pfOrgs.includes(res.accountingOrgId)
|
}
|
},
|
computed: {
|
...mapState({
|
deliveryWay: state => state.tabsModule.deliveryWay
|
})
|
},
|
watch: {
|
$route() {
|
const { transLogSerialno, transCode } = this.$route.query
|
if (transLogSerialno || transCode) {
|
this.init()
|
}
|
}
|
}
|
}
|
</script>
|
<style lang="postcss" scoped>
|
.file-page {
|
& .file-top-buttons {
|
padding: 0 0 20px 0;
|
& .top-button {
|
line-height: 23px;
|
border-radius: 2px;
|
padding: 0 8px;
|
border: 1px solid rgba(238, 238, 238, 1);
|
font-size: 12px;
|
font-weight: 400;
|
color: rgba(119, 119, 119, 1);
|
margin: 0 28px 0 0;
|
}
|
}
|
& .section-title {
|
font-size: 14px;
|
font-weight: 400;
|
color: rgba(51, 51, 51, 1);
|
line-height: 20px;
|
& .require-dot {
|
color: #f56c6c;
|
margin-right: 4px;
|
}
|
& .img-num {
|
font-weight: 400;
|
color: rgba(197, 197, 197, 1);
|
}
|
}
|
& .file-ul {
|
margin: 0;
|
padding: 0 40px 0 0;
|
list-style: none;
|
display: grid;
|
grid-column-gap: 165px;
|
grid-template-columns: 1fr 1fr;
|
& .file-content {
|
background: rgba(249, 249, 249, 1);
|
border-radius: 4px;
|
padding: 11px 11px 0 11px;
|
}
|
}
|
}
|
</style>
|