<template>
|
<div class="product">
|
<div v-for="(item,index) in customerInterestArr" :key="index">
|
<div class="_block">
|
<p class="title">
|
<span></span>
|
客户息费信息
|
</p>
|
<el-form :model="customerInterestForm[index]" :rules="rules" ref="customerInterestForm" label-width="165px" size="small" inline>
|
<div class="form">
|
<el-form-item label="收取方式" prop="collectionMethod" v-if="item.collectionMethod.visible">
|
<el-select
|
v-model="customerInterestForm[index].collectionMethod"
|
:disabled="!item.collectionMethod.writeAble"
|
@change="updateAdvanceFee(customerInterestForm[index])"
|
clearable
|
filterable
|
placeholder="请选择"
|
>
|
<el-option
|
v-for="(item,index) in collectionMethods"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="预计放款日" prop="projectedLendersDay" v-if="item.projectedLendersDay.visible">
|
<el-date-picker
|
v-model="customerInterestForm[index].projectedLendersDay"
|
type="date"
|
format="yyyy/MM/dd"
|
value-format="yyyy/MM/dd"
|
size="small"
|
placeholder="选择日期"
|
:picker-options="pickerOptions"
|
:disabled="!item.projectedLendersDay.writeAble"
|
@change="updateAdvanceFee(customerInterestForm[index])"
|
></el-date-picker>
|
</el-form-item>
|
</div>
|
<div class="form">
|
<el-form-item label="预收利息金额" prop="advaninterest" v-if="item.advaninterest.visible">
|
<el-input
|
v-model="customerInterestForm[index].advaninterest"
|
:disabled="!item.advaninterest.writeAble"
|
>
|
</el-input>
|
</el-form-item>
|
<el-form-item label="预收手续费金额" prop="advancecharge" v-if="item.advancecharge.visible">
|
<el-input
|
v-model="customerInterestForm[index].advancecharge"
|
:disabled="!item.advancecharge.writeAble"
|
>
|
</el-input>
|
</el-form-item>
|
<el-form-item label="预收担保费金额" prop="advanceguarantee" v-if="item.advanceguarantee.visible">
|
<el-input
|
v-model="customerInterestForm[index].advanceguarantee"
|
:disabled="!item.advanceguarantee.writeAble"
|
>
|
</el-input>
|
</el-form-item>
|
<el-form-item label="预收平台服务费金额" prop="advanceservicefee" v-if="item.advanceservicefee.visible">
|
<el-input
|
v-model="customerInterestForm[index].advanceservicefee"
|
:disabled="!item.advanceservicefee.writeAble"
|
>
|
</el-input>
|
</el-form-item>
|
<el-form-item label="预收总金额" prop="advanceTotal" v-if="item.advanceTotal.visible">
|
<el-input
|
v-model="customerInterestForm[index].advanceTotal"
|
:disabled="!item.advanceTotal.writeAble"
|
>
|
</el-input>
|
</el-form-item>
|
</div>
|
<div class="form">
|
<el-form-item label="自动扣款支付流水号" prop="transno" v-if="item.transno.visible">
|
<el-input v-model="customerInterestForm[index].transno" :disabled="!item.transno.writeAble"></el-input>
|
</el-form-item>
|
<el-form-item label="自动扣款状态" prop="ischarge" v-if="item.ischarge.visible">
|
<el-select
|
v-model="customerInterestForm[index].ischarge"
|
:disabled="!item.ischarge.writeAble"
|
clearable
|
filterable
|
placeholder="请选择"
|
>
|
<el-option
|
v-for="(item,index) in ischarges"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="自动扣款失败原因" prop="transresult" v-if="item.transresult.visible">
|
<el-input v-model="customerInterestForm[index].transresult" :disabled="!item.transresult.writeAble"></el-input>
|
</el-form-item>
|
</div>
|
<div class="form">
|
<el-form-item label="绿信收款对公户开户行" prop="balanceBankNo" v-if="item.balanceBankNo.visible">
|
<el-input v-model="customerInterestForm[index].balanceBankNo" :disabled="!item.balanceBankNo.writeAble"></el-input>
|
</el-form-item>
|
<el-form-item label="绿信收款对公户账号" prop="balanceaccount" v-if="item.balanceaccount.visible">
|
<el-input v-model="customerInterestForm[index].balanceaccount" :disabled="!item.balanceaccount.writeAble"></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="applyInfo.flowno == 'BuildingBusinessFlow' ? '渠道结算虚拟账号' : '客户还款虚拟账号'"
|
prop="balancefictitiousaccount"
|
v-if="item.balancefictitiousaccount.visible"
|
>
|
<el-input v-model="customerInterestForm[index].balancefictitiousaccount" :disabled="!item.balancefictitiousaccount.writeAble"></el-input>
|
</el-form-item>
|
</div>
|
</el-form>
|
</div>
|
<!-- 待认领资金 -->
|
<WaitFunds
|
v-if="customerInterestForm[index].collectionMethod != '01' && customerInterestForm[index].ischarge != '1'"
|
v-on:sendClaim="sendClaim"
|
:balancefictitiousaccount='customerInterestForm[index].balancefictitiousaccount'
|
:collectionMethod='customerInterestForm[index].collectionMethod'
|
:projectedLendersDay='customerInterestForm[index].projectedLendersDay'
|
operationType='1'
|
></WaitFunds>
|
<!-- 已认领资金 -->
|
<ClaimedFunds
|
v-if="customerInterestForm[index].collectionMethod != '01'"
|
:claimedFunds="claimedFunds"
|
operationType='1'
|
></ClaimedFunds>
|
</div>
|
<div class="fixedBtn">
|
<el-button
|
size="medium"
|
plain
|
@click="prevStep"
|
>上一页</el-button>
|
<el-button
|
size="medium"
|
type="primary"
|
@click="nextPage()"
|
>下一页</el-button>
|
</div>
|
</div>
|
</template>
|
<script>
|
import {
|
qryPreCustomerInterestInfo,
|
updateAdvanceFee,
|
getDictionaryList
|
} from '@api/product'
|
import common from "@/utils/common";
|
import ClaimedFunds from '../../components/ClaimedFunds'
|
import WaitFunds from '../../components/WaitFunds'
|
export default {
|
data () {
|
return {
|
applyInfo:this.$store.state.product.applyInfo,
|
applyMenu: this.$store.state.product.applyMenu,
|
customerInterestForm:[],
|
customerInterestArr:[],
|
collectionMethods:[],
|
claimedFunds:[],
|
ischarges:[],
|
rules:{},
|
pickerOptions: { // 限制收货时间不让选择今天以前的
|
disabledDate(time) {
|
return time.getTime() < Date.now() - 24 * 60 * 60 * 1000
|
}
|
}
|
}
|
},
|
async created () {
|
this.$parent._data.loading = true;
|
const result = await this.qryPreCustomerInterestInfo()
|
this.qryPreCustomerInterestData(result)
|
this.collectionMethods = await this.qryDictionaryList('CollectionMethod')
|
// 预收息费阶段——收取方式去掉自动扣款和无需收取
|
this.collectionMethods.forEach((val,index) => {
|
if(val.itemno == '01' || val.itemno == '03'){
|
this.collectionMethods.splice(index,1)
|
}
|
});
|
this.ischarges = await this.qryDictionaryList('IsCharge')
|
this.$parent._data.loading = false;
|
},
|
components: {
|
ClaimedFunds,
|
WaitFunds
|
},
|
methods: {
|
// 字典
|
qryDictionaryList(code) {
|
return new Promise(resolve => {
|
getDictionaryList({
|
codeNo: code
|
}).then(res => {
|
resolve(res.result);
|
});
|
});
|
},
|
// 对已认领资金数据进行处理
|
qryClaimedFunds(array){
|
this.claimedFunds = []
|
array.forEach(val => {
|
const obj = {}
|
for (const key in val) {
|
obj[key] = val[key].value
|
}
|
this.claimedFunds.push(obj)
|
});
|
},
|
// 查询预收客户息费详情
|
qryPreCustomerInterestInfo(){
|
return new Promise(resolve=>{
|
qryPreCustomerInterestInfo({serialNo:this.applyInfo.serialNo}).then(res=>{
|
resolve(res.result)
|
})
|
})
|
},
|
// 接受子组件传值并更新已认领资金列表
|
async sendClaim(data){
|
const projectedLendersDay = this.customerInterestForm[0].projectedLendersDay
|
const collectionMethod = this.customerInterestForm[0].collectionMethod
|
const result = await this.qryPreCustomerInterestInfo()
|
this.qryPreCustomerInterestData(result)
|
// 重新查询这两个值要附上,因为接口数据没有返回
|
this.customerInterestForm[0].projectedLendersDay = projectedLendersDay
|
this.customerInterestForm[0].collectionMethod = collectionMethod
|
},
|
// 对数据进行重新排列
|
qryPreCustomerInterestData(result){
|
this.customerInterestArr = [result]
|
this.customerInterestForm = []
|
this.customerInterestArr.forEach((val,index) => {
|
if (index == 0) {
|
for (const key in val) {
|
// 格式化金额
|
if (
|
key == "advaninterest" ||
|
key == "advanceguarantee" ||
|
key == "advanceservicefee" ||
|
key == "advanceTotal" ||
|
key == "advancecharge"
|
) {
|
val[key].value = this.formatMoney(val[key].value);
|
}
|
this.rules[key] = [];
|
if (val[key].required) {
|
this.rules[key].push({
|
required: true,
|
message: `请输入${val[key].filedDescription}`,
|
trigger: "blur"
|
});
|
}
|
}
|
}
|
// 将数据重新排列
|
let obj = {};
|
for (const key in val) {
|
if (key != "acctBankRecord") {
|
obj[key] = val[key].value;
|
} else {
|
this.qryClaimedFunds(val[key])
|
}
|
}
|
this.customerInterestForm.push(obj);
|
});
|
},
|
// 更新预收息费
|
updateAdvanceFee(form){
|
if(form.projectedLendersDay&&form.collectionMethod){
|
const projectedLendersDay = form.projectedLendersDay
|
const collectionMethod = form.collectionMethod
|
this.$parent._data.loading = true;
|
updateAdvanceFee({
|
applySerialno:this.applyInfo.serialNo,
|
projectedLendersDay:form.projectedLendersDay,
|
collectionMethod:form.collectionMethod
|
}).then(async res=>{
|
this.$parent._data.loading = false;
|
if(res.code=='00'){
|
// 成功后重新查询
|
const result = await this.qryPreCustomerInterestInfo()
|
this.qryPreCustomerInterestData(result)
|
// 重新查询这两个值要附上,因为接口数据没有返回
|
this.customerInterestForm[0].projectedLendersDay = projectedLendersDay
|
this.customerInterestForm[0].collectionMethod = collectionMethod
|
}
|
})
|
}
|
},
|
// 金额格式化
|
formatMoney(value) {
|
if (value) {
|
value =
|
parseFloat((value + "").replace(/[^\d\.-]/g, "")).toFixed(2) + "";
|
if (value == "NaN") return;
|
let l = value
|
.split(".")[0]
|
.split("")
|
.reverse();
|
let r = value.split(".")[1];
|
let t = "";
|
for (let i = 0; i < l.length; i++) {
|
t += l[i] + ((i + 1) % 3 === 0 && i + 1 !== l.length ? "," : "");
|
}
|
return (
|
t
|
.split("")
|
.reverse()
|
.join("") +
|
"." +
|
r
|
);
|
}
|
},
|
// 上一页
|
prevStep(){
|
this.applyMenu.forEach((val, index) => {
|
if (val.tabname == "预收客户息费") {
|
common.tabInfo(this.applyMenu[index - 1].tabname,this.applyInfo.flowno,this);
|
}
|
});
|
},
|
// 下一页
|
nextPage(){
|
this.applyMenu.forEach((val, index) => {
|
if (val.tabname == "预收客户息费") {
|
common.tabInfo(this.applyMenu[index + 1].tabname,this.applyInfo.flowno,this);
|
}
|
});
|
}
|
}
|
}
|
</script>
|