<template>
|
<div class="product">
|
<div v-for="(item,index) in merchantInterestArr" :key="index">
|
<el-form
|
:model="merchantInterestForm[index]"
|
:rules="rules"
|
ref="merchantInterestForm"
|
label-width="165px"
|
size="small"
|
inline
|
>
|
<div class="_block">
|
<p class="title">
|
<span></span>
|
商户补贴方案
|
</p>
|
<div class="form">
|
<el-form-item
|
label="贴息类型"
|
prop="discountCase.isAllPostedInterest"
|
v-if="item.discountCase.isAllPostedInterest.visible"
|
>
|
<el-select
|
v-model="merchantInterestForm[index].discountCase.isAllPostedInterest"
|
:disabled="!item.discountCase.isAllPostedInterest.writeAble"
|
clearable
|
filterable
|
placeholder="请选择"
|
>
|
<el-option
|
v-for="(item,index) in isAllPostedInterests"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
label="贴手续费类型"
|
prop="discountCase.isAllPostedPoundage"
|
v-if="item.discountCase.isAllPostedPoundage.visible"
|
>
|
<el-select
|
v-model="merchantInterestForm[index].discountCase.isAllPostedPoundage"
|
:disabled="!item.discountCase.isAllPostedPoundage.writeAble"
|
clearable
|
filterable
|
placeholder="请选择"
|
>
|
<el-option
|
v-for="(item,index) in isAllPostedInterests"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
label="贴担保费类型"
|
prop="discountCase.isAllPostedGuaranty"
|
v-if="item.discountCase.isAllPostedGuaranty.visible"
|
>
|
<el-select
|
v-model="merchantInterestForm[index].discountCase.isAllPostedGuaranty"
|
:disabled="!item.discountCase.isAllPostedGuaranty.writeAble"
|
clearable
|
filterable
|
placeholder="请选择"
|
>
|
<el-option
|
v-for="(item,index) in isAllPostedInterests"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
label="贴平台服务费类型"
|
prop="discountCase.isAllPostedService"
|
v-if="item.discountCase.isAllPostedService.visible"
|
>
|
<el-select
|
v-model="merchantInterestForm[index].discountCase.isAllPostedService"
|
:disabled="!item.discountCase.isAllPostedService.writeAble"
|
clearable
|
filterable
|
placeholder="请选择"
|
>
|
<el-option
|
v-for="(item,index) in isAllPostedInterests"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
label="贴息期数"
|
prop="discountCase.discountTerm"
|
v-if="item.discountCase.discountTerm.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountCase.discountTerm"
|
:disabled="!item.discountCase.discountTerm.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="贴息固额"
|
prop="discountCase.discountSum"
|
v-if="item.discountCase.discountSum.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountCase.discountSum"
|
:disabled="!item.discountCase.discountSum.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="贴息月利率(%)"
|
prop="discountCase.discountRate"
|
v-if="item.discountCase.discountRate.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountCase.discountRate"
|
:disabled="!item.discountCase.discountRate.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="贴手续费固额"
|
prop="discountCase.poundageSum"
|
v-if="item.discountCase.poundageSum.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountCase.poundageSum"
|
:disabled="!item.discountCase.poundageSum.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="贴手续费费率(%)"
|
prop="discountCase.poundageRate"
|
v-if="item.discountCase.poundageRate.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountCase.poundageRate"
|
:disabled="!item.discountCase.poundageRate.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="贴担保费固额"
|
prop="discountCase.guarantySum"
|
v-if="item.discountCase.guarantySum.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountCase.guarantySum"
|
:disabled="!item.discountCase.guarantySum.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="贴担保费费率(%)"
|
prop="discountCase.guarantyRate"
|
v-if="item.discountCase.guarantyRate.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountCase.guarantyRate"
|
:disabled="!item.discountCase.guarantyRate.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="贴平台服务费固额"
|
prop="discountCase.serviceSum"
|
v-if="item.discountCase.serviceSum.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountCase.serviceSum"
|
:disabled="!item.discountCase.serviceSum.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="贴平台服务费费率(%)"
|
prop="discountCase.serviceRate"
|
v-if="item.discountCase.serviceRate.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountCase.serviceRate"
|
:disabled="!item.discountCase.serviceRate.writeAble"
|
></el-input>
|
</el-form-item>
|
</div>
|
</div>
|
<div class="_block">
|
<p class="title">
|
<span></span>
|
商户补贴信息
|
</p>
|
<div class="form">
|
<el-form-item
|
label="收取方式"
|
prop="discountInfo.discountCollectionMethod"
|
v-if="item.discountInfo.discountCollectionMethod.visible"
|
>
|
<el-select
|
v-model="merchantInterestForm[index].discountInfo.discountCollectionMethod"
|
:disabled="!item.discountInfo.discountCollectionMethod.writeAble"
|
@change="updateAdvanceFee(merchantInterestForm[index])"
|
clearable
|
filterable
|
placeholder="请选择"
|
>
|
<el-option
|
v-for="(item,index) in discountCollectionMethods"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
label="利息补贴金额"
|
prop="discountInfo.discountinterestamount"
|
v-if="item.discountInfo.discountinterestamount.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountInfo.discountinterestamount"
|
:disabled="!item.discountInfo.discountinterestamount.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="手续费补贴金额"
|
prop="discountInfo.discountpoundageamount"
|
v-if="item.discountInfo.discountpoundageamount.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountInfo.discountpoundageamount"
|
:disabled="!item.discountInfo.discountpoundageamount.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="担保费补贴金额"
|
prop="discountInfo.discountguaranteemount"
|
v-if="item.discountInfo.discountguaranteemount.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountInfo.discountguaranteemount"
|
:disabled="!item.discountInfo.discountguaranteemount.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="平台服务费补贴金额"
|
prop="discountInfo.discountservicefeeamount"
|
v-if="item.discountInfo.discountservicefeeamount.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountInfo.discountservicefeeamount"
|
:disabled="!item.discountInfo.discountservicefeeamount.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="息费补贴总额"
|
prop="discountInfo.discountTotalAmount"
|
v-if="item.discountInfo.discountTotalAmount.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountInfo.discountTotalAmount"
|
:disabled="!item.discountInfo.discountTotalAmount.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="贴息商户名称"
|
prop="discountInfo.enterpriseName"
|
v-if="item.discountInfo.enterpriseName.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountInfo.enterpriseName"
|
:disabled="!item.discountInfo.enterpriseName.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="贴息项目名称"
|
prop="discountInfo.discountProjectName"
|
v-if="item.discountInfo.discountProjectName.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountInfo.discountProjectName"
|
:disabled="!item.discountInfo.discountProjectName.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="绿信收款对公户开户行"
|
prop="discountInfo.settlementBankNameDesc"
|
v-if="item.discountInfo.settlementBankNameDesc.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountInfo.settlementBankNameDesc"
|
:disabled="!item.discountInfo.settlementBankNameDesc.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="绿信收款对公户账号"
|
prop="discountInfo.settlementAccountDesc"
|
v-if="item.discountInfo.settlementAccountDesc.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountInfo.settlementAccountDesc"
|
:disabled="!item.discountInfo.settlementAccountDesc.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="商户补贴虚拟账号"
|
prop="discountInfo.clearingVirtual"
|
v-if="item.discountInfo.clearingVirtual.visible"
|
>
|
<el-input
|
v-model="merchantInterestForm[index].discountInfo.clearingVirtual"
|
:disabled="!item.discountInfo.clearingVirtual.writeAble"
|
></el-input>
|
</el-form-item>
|
</div>
|
</div>
|
</el-form>
|
<!-- 待认领资金 -->
|
<!-- applyInfo.flowno != 'CreditFlowPublic' && 测试让改的-->
|
<WaitFunds
|
v-if="merchantInterestForm[index].discountInfo.isdiscount != '1' &&
|
'0205,0208,0190,0180'.indexOf(applyInfo.phaseNo) == -1"
|
v-on:sendClaim="sendClaim"
|
:collectionMethod='merchantInterestForm[index].discountInfo.discountCollectionMethod'
|
:balancefictitiousaccount='merchantInterestForm[index].discountInfo.clearingVirtual'
|
operationType='2'
|
>
|
</WaitFunds>
|
<!-- 已认领资金 -->
|
<ClaimedFunds
|
:claimedFunds="claimedFunds"
|
operationType='2'
|
></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 { qryPreMerchantInterestInfo, getDictionaryList, updateAdvanceFee } 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,
|
merchantInterestForm: [],
|
merchantInterestArr: [],
|
isAllPostedInterests: [],
|
isAllPostedPoundages: [],
|
discountCollectionMethods: [],
|
claimedFunds: [],
|
rules: {}
|
};
|
},
|
async created() {
|
this.$parent._data.loading = true;
|
const result = await this.qryPreMerchantInterestInfo();
|
this.qryPreMerchantInterestData(result);
|
this.isAllPostedInterests = await this.qryDictionaryList("DiscountType01");
|
this.discountCollectionMethods = await this.qryDictionaryList(
|
"CollectionMethod"
|
);
|
this.$parent._data.loading = false;
|
},
|
components: {
|
WaitFunds,
|
ClaimedFunds
|
},
|
methods: {
|
// 字典
|
qryDictionaryList(code) {
|
return new Promise(resolve => {
|
getDictionaryList({
|
codeNo: code
|
}).then(res => {
|
resolve(res.result);
|
});
|
});
|
},
|
// 查询预收商户贴息详情
|
qryPreMerchantInterestInfo() {
|
return new Promise(resolve => {
|
qryPreMerchantInterestInfo({ serialNo: this.applyInfo.serialNo }).then(
|
res => {
|
resolve(res.result);
|
}
|
);
|
});
|
},
|
// 对数据进行重新排列
|
qryPreMerchantInterestData(result) {
|
this.merchantInterestArr = [result];
|
this.merchantInterestForm = [];
|
this.merchantInterestArr.forEach((val, index) => {
|
if (index == 0) {
|
for (const key in val) {
|
if (key == "discountCase") {
|
for (const child in val[key]) {
|
// 格式化金额
|
if (
|
child == "discountSum" ||
|
child == "poundageSum" ||
|
child == "serviceSum" ||
|
child == "guarantySum"
|
) {
|
val[key][child].value = this.formatMoney(
|
val[key][child].value
|
);
|
}
|
this.rules["discountCase." + child] = [];
|
if (val[key][child].required) {
|
this.rules["discountCase." + child].push({
|
required: true,
|
message: `请输入${val[key][child].filedDescription}`,
|
trigger: "blur"
|
});
|
}
|
}
|
} else if (key == "discountInfo") {
|
for (const child in val[key]) {
|
// 格式化金额
|
if (
|
child == "discountinterestamount" ||
|
child == "discountguaranteemount" ||
|
child == "discountservicefeeamount" ||
|
child == "discountTotalAmount" ||
|
child == 'discountpoundageamount'
|
) {
|
val[key][child].value = this.formatMoney(
|
val[key][child].value
|
);
|
}
|
this.rules["discountInfo." + child] = [];
|
if (val[key][child].required) {
|
this.rules["discountInfo." + child].push({
|
required: true,
|
message: `请输入${val[key][child].filedDescription}`,
|
trigger: "blur"
|
});
|
}
|
}
|
}
|
}
|
}
|
// 将数据重新排列
|
let obj = {};
|
for (const key in val) {
|
if (key == "acctBankRecord") {
|
this.qryClaimedFunds(val[key])
|
} else if (key == "discountCase") {
|
obj["discountCase"] = {};
|
for (const child in val[key]) {
|
obj["discountCase"][child] = val[key][child].value;
|
}
|
} else if (key == "discountInfo") {
|
obj["discountInfo"] = {};
|
for (const child in val[key]) {
|
obj["discountInfo"][child] = val[key][child].value;
|
}
|
}
|
}
|
this.merchantInterestForm.push(obj);
|
});
|
},
|
// 对已认领资金数据进行处理
|
qryClaimedFunds(array){
|
this.claimedFunds = []
|
array.forEach(val => {
|
const obj = {}
|
for (const key in val) {
|
obj[key] = val[key].value
|
}
|
this.claimedFunds.push(obj)
|
});
|
},
|
// 接受子组件传值并更新已认领资金列表
|
async sendClaim(data){
|
const collectionMethod = this.merchantInterestForm[0].collectionMethod
|
const result = await this.qryPreMerchantInterestInfo()
|
this.qryPreMerchantInterestData(result)
|
// 重新查询这两个值要附上,因为接口数据没有返回
|
this.customerInterestForm[0].collectionMethod = collectionMethod
|
},
|
// 更新预收息费
|
updateAdvanceFee(form){
|
const collectionMethod = form.discountInfo.discountCollectionMethod
|
this.$parent._data.loading = true;
|
updateAdvanceFee({
|
applySerialno:this.applyInfo.serialNo,
|
collectionMethod:form.discountInfo.discountCollectionMethod
|
}).then(async res=>{
|
this.$parent._data.loading = false;
|
if(res.code=='00'){
|
// 成功后重新查询
|
const result = await this.qryPreMerchantInterestInfo();
|
this.qryPreMerchantInterestData(result);
|
// 重新查询这两个值要附上,因为接口数据没有返回
|
this.merchantInterestForm[0].discountInfo.discountCollectionMethod = 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>
|