<template>
|
<div class="loan" v-loading="loading" element-loading-background="transparent">
|
<el-form :model="form" :rules="rules" ref="form" label-width="120px" inline size="small" v-if="loanStatus == '线下人工放款信息确认' || loanStatus == '导出网银指令信息确认'">
|
<el-form-item label="放款日期" prop="putoutDate" v-if="loanStatus == '线下人工放款信息确认'">
|
<el-date-picker
|
v-model="form.putoutDate"
|
type="date"
|
format="yyyy/MM/dd"
|
value-format="yyyy/MM/dd"
|
size="small"
|
placeholder="选择日期"
|
></el-date-picker>
|
</el-form-item>
|
<el-form-item label="放款账户类型" prop="offlinePutoutBank">
|
<el-select
|
v-model="form.offlinePutoutBank"
|
value-key="itemno"
|
clearable
|
filterable
|
placeholder="请选择"
|
@change="selOfflinePutoutBank"
|
>
|
<el-option
|
v-for="item in offlinePutoutBankList"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="放款账号">
|
<el-input v-model="form.offlinePutoutAccountNo" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="放款账户名称">
|
<el-input v-model="form.offlinePutoutAccountName" disabled></el-input>
|
</el-form-item>
|
</el-form>
|
<el-table
|
:data="putoutCheckInfoList"
|
:header-cell-style="{background:'#FAFAFA',color:'#222222'}"
|
:max-height='480'
|
>
|
<el-table-column
|
prop="serialNo"
|
label="申请编号">
|
</el-table-column>
|
<el-table-column
|
prop="productName"
|
label="产品"
|
width="200">
|
</el-table-column>
|
<el-table-column
|
prop="customerName"
|
label="客户名称"
|
width="200">
|
</el-table-column>
|
<el-table-column
|
prop="businesssum"
|
label="放款金额"
|
width="200">
|
</el-table-column>
|
</el-table>
|
<div class="btn">
|
<el-button size="medium" type="primary" @click="confirm('form')">确认</el-button>
|
</div>
|
</div>
|
</template>
|
<script>
|
import {
|
systemPutout,
|
putoutTurnArtificial,
|
artificialPutoutBatch,
|
getDictionaryList
|
} from '@comprehensive/serve/public'
|
import {
|
getExportPutoutVoucherZip,
|
exportCMBPayExcel
|
} from '@api/product'
|
import qs from 'qs'
|
export default {
|
props: ['loanStatus','putoutCheckInfoList'],
|
data () {
|
return {
|
form:{
|
offlinePutoutBank: ''
|
},
|
rules:{
|
putoutDate:[
|
{ required: true, message: '请输入放款日期', trigger: 'change' }
|
],
|
offlinePutoutBank:[
|
{ required: true, message: '请输入放款账户类型', trigger: 'change' }
|
]
|
},
|
offlinePutoutBankList:[],
|
loading:false,
|
}
|
},
|
async created () {
|
this.offlinePutoutBankList = await this.qryDictionaryList('PutOutAccountType')
|
// 线下人工放款确认弹框,非所有申请单都为非保理产品时, 线上人工放款 放款账户类型为 招行402账户。 当存在保理产品时是默认值为空。
|
let flag = true
|
for (let i = 0; i < this.putoutCheckInfoList.length; i++) {
|
if(this.putoutCheckInfoList[i].flowno === 'CreditFlowPublic'){
|
flag = false;
|
break;
|
}
|
}
|
if(flag){
|
for (let i = 0; i < this.offlinePutoutBankList.length; i++) {
|
if(this.offlinePutoutBankList[i].itemno == '040'){
|
this.form.offlinePutoutBank = this.offlinePutoutBankList[i]
|
this.form.offlinePutoutBankNo = this.offlinePutoutBankList[i].itemno
|
this.form.offlinePutoutBankName = this.offlinePutoutBankList[i].itemname
|
this.form.offlinePutoutAccountNo = this.offlinePutoutBankList[i].attribute1
|
this.form.offlinePutoutAccountName = this.offlinePutoutBankList[i].attribute3
|
break;
|
}
|
}
|
}
|
},
|
methods: {
|
selOfflinePutoutBank(val){
|
console.log(val)
|
this.form.offlinePutoutBankNo = val.itemno
|
this.form.offlinePutoutBankName = val.itemname
|
this.form.offlinePutoutAccountNo = val.attribute1
|
this.form.offlinePutoutAccountName = val.attribute3
|
},
|
// 字典
|
qryDictionaryList(code) {
|
return new Promise(resolve => {
|
getDictionaryList({
|
codeNo: code
|
}).then(res => {
|
resolve(res.result);
|
});
|
});
|
},
|
// 导出文件
|
exportFile(blob,fileName){
|
if (window.navigator.msSaveBlob) {
|
// ie
|
window.navigator.msSaveOrOpenBlob(blob, fileName)
|
return
|
}
|
let elink = document.createElement('a')
|
elink.style.display = 'none'
|
elink.href = window.URL.createObjectURL(blob)
|
elink.download = fileName
|
document.body.appendChild(elink)
|
elink.click()
|
URL.revokeObjectURL(elink.href)
|
document.body.removeChild(elink)
|
},
|
async confirm(formName){
|
const arr = []
|
this.putoutCheckInfoList.forEach(val => {
|
arr.push(val.serialNo)
|
});
|
switch (this.loanStatus) {
|
case '系统放款信息确认':
|
this.loading = true
|
systemPutout({putoutInfoList:arr}).then(res=>{
|
this.loading = false
|
if(res.code == '00'){
|
if(res.result.checkDesc){
|
this.$message.warning(res.result.checkDesc)
|
}else{
|
this.$message.success('系统放款成功')
|
}
|
this.$emit('close',true)
|
}
|
})
|
break;
|
case '转人工放款信息确认':
|
this.loading = true
|
putoutTurnArtificial({putoutTurnArtificialList:arr}).then(res=>{
|
this.loading = false
|
if(res.code == '00'){
|
if(res.result.checkDesc){
|
this.$message.warning(res.result.checkDesc)
|
}else{
|
this.$message.success('转人工放款成功')
|
}
|
this.$emit('close',true)
|
}
|
})
|
break;
|
case '线下人工放款信息确认':
|
this.$refs[formName].validate((valid) => {
|
if (valid) {
|
const obj = {
|
putoutInfoList:arr,
|
offlinePutoutBankNo:this.form.offlinePutoutBankNo,
|
offlinePutoutBankName:this.form.offlinePutoutBankName,
|
offlinePutoutAccountNo:this.form.offlinePutoutAccountNo,
|
offlinePutoutAccountName:this.form.offlinePutoutAccountName,
|
putoutDate:this.form.putoutDate,
|
}
|
this.loading = true
|
artificialPutoutBatch(obj).then(res=>{
|
this.loading = false
|
if(res.code == '00'){
|
if(res.result.checkDesc){
|
this.$message.warning(res.result.checkDesc)
|
}else{
|
this.$message.success('线下人工放款成功')
|
}
|
this.$emit('close',true)
|
}
|
})
|
} else {
|
return false;
|
}
|
});
|
break;
|
case '导出网银指令信息确认':
|
this.$refs[formName].validate((valid) => {
|
if (valid) {
|
const obj = {
|
applySerialnos:arr,
|
offlinePutoutBankNo:this.form.offlinePutoutBankNo,
|
offlinePutoutBankName:this.form.offlinePutoutBankName,
|
offlinePutoutAccountNo:this.form.offlinePutoutAccountNo,
|
offlinePutoutAccountName:this.form.offlinePutoutAccountName,
|
}
|
exportCMBPayExcel(qs.stringify(obj)).then(res=>{
|
let blob = new Blob([res.data])
|
let fileName = `网银指令文件${res.headers['content-disposition'].split('=')[1]}`
|
this.exportFile(blob,fileName)
|
this.$emit('close',true)
|
})
|
} else {
|
return false;
|
}
|
});
|
break;
|
case '导出付款申请书信息确认':
|
this.loading = true
|
getExportPutoutVoucherZip(qs.stringify({ applySerialnos: arr })).then(res=>{
|
this.loading = false
|
let blob = new Blob([res.data])
|
let fileName = `付款申请书${res.headers['content-disposition'].split('=')[1]}`
|
this.exportFile(blob,fileName)
|
this.$emit('close',true)
|
})
|
break;
|
default:
|
break;
|
}
|
}
|
}
|
}
|
</script>
|
<style lang="stylus">
|
.loan
|
.el-form
|
display: flex
|
justify-content: flex-start
|
flex-wrap: wrap
|
.el-form-item
|
display: flex
|
width:50%
|
box-sizing border-box
|
padding-right 30px
|
margin: 0 0 24px 0
|
.el-form-item__label
|
color: #888
|
line-height 32px
|
.el-form-item__content
|
width 220px
|
.el-input.is-disabled .el-input__inner
|
background-color #fafafa
|
color #888
|
.el-date-editor
|
width: auto
|
.el-select
|
display: block
|
.btn
|
margin-top 20px
|
text-align center
|
.el-button
|
width: 120px;
|
font-size: 14px;
|
line-height: 20px;
|
padding: 5px 0;
|
</style>
|