<template>
|
<div class="product" ref="product">
|
<div v-for="(item, index) in loanArr" :key="index">
|
<el-form
|
:model="loanForm[index]"
|
:rules="rules"
|
ref="loanForm"
|
label-width="165px"
|
inline
|
size="small"
|
>
|
<div class="_block">
|
<p class="title">
|
<span></span>
|
基本信息
|
</p>
|
<div class="form">
|
<el-form-item label="申请编号">
|
<el-input v-model="loanForm[index].serialno" disabled></el-input>
|
</el-form-item>
|
<el-form-item
|
label="合同编号"
|
v-if="loanArr[index].contractartificialno.visible"
|
>
|
<el-input
|
v-model="loanForm[index].contractartificialno"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="产品名称"
|
v-if="loanArr[index].productid.visible"
|
prop="productid"
|
>
|
<el-input
|
v-model="loanForm[index].productname"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="产品维度名称"
|
v-if="loanArr[index].productdimension.visible"
|
prop="productdimension"
|
>
|
<el-input
|
v-show="false"
|
v-model="loanForm[index].productdimension"
|
></el-input>
|
<el-input
|
v-model="loanForm[index].productdimensionname"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="产品客群名称"
|
v-if="loanArr[index].customerbasename.visible"
|
prop="customerbasename"
|
>
|
<el-input
|
v-model="loanForm[index].customerbasename"
|
:disabled="!loanArr[index].customerbasename.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="业务城市"
|
v-if="loanArr[index].businesscity.visible"
|
prop="businesscity"
|
>
|
<el-select
|
v-model="loanForm[index].businesscity"
|
:disabled="!loanArr[index].businesscity.writeAble"
|
clearable
|
filterable
|
placeholder="支持输入搜索选择"
|
>
|
<el-option
|
v-for="(item, index) in allCityList"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
label="贷款金额"
|
v-if="loanArr[index].businesssum.visible"
|
prop="businesssum"
|
>
|
<el-input
|
v-model="loanForm[index].businesssum"
|
:disabled="!loanArr[index].businesssum.writeAble"
|
@blur="
|
loanForm[index].businesssum = formatMoney(
|
loanForm[index].businesssum
|
)
|
"
|
@change="editBusinesssum(loanForm[index])"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="还款方式"
|
v-if="loanArr[index].repaymenttype.visible"
|
prop="repaymenttype"
|
>
|
<el-select
|
v-model="loanForm[index].repaymenttype"
|
:disabled="!loanArr[index].repaymenttype.writeAble"
|
clearable
|
filterable
|
placeholder="支持输入搜索选择"
|
@change="qryTrial(loanForm[index])"
|
>
|
<el-option
|
v-for="(item, index) in repayTypeList"
|
:key="index"
|
:label="item.paymentName"
|
:value="item.paymentType"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
label="融资成数"
|
v-if="loanArr[index].financingcvs.visible"
|
prop="financingcvs"
|
>
|
<el-input
|
v-model="loanForm[index].financingcvs"
|
:disabled="!loanArr[index].financingcvs.writeAble"
|
@change="editFinancingcvs(loanForm[index])"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="执行起息日"
|
v-if="loanArr[index].exevaluedate.visible"
|
prop="exevaluedate"
|
>
|
<el-date-picker
|
v-model="loanForm[index].exevaluedate"
|
type="date"
|
format="yyyy/MM/dd"
|
value-format="yyyy/MM/dd"
|
size="small"
|
placeholder="选择日期"
|
:disabled="!item.exevaluedate.writeAble"
|
@change="qryTrial(loanForm[index])"
|
></el-date-picker>
|
</el-form-item>
|
<el-form-item
|
label="贷款到期日"
|
v-if="loanArr[index].maturitydate.visible"
|
prop="maturitydate"
|
>
|
<el-input
|
v-model="loanForm[index].maturitydate"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="贷款类型"
|
v-if="
|
loanArr[index].baseLoanType &&
|
loanArr[index].baseLoanType.visible
|
"
|
prop="baseLoanType"
|
>
|
<el-select
|
v-model="loanForm[index].baseLoanType"
|
:disabled="!loanArr[index].baseLoanType.writeAble"
|
clearable
|
filterable
|
placeholder="支持输入搜索选择"
|
>
|
<el-option
|
v-for="item in BaseLoanTypeList"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
label="预计放款金额"
|
v-if="loanArr[index].hopebusinesssum.visible"
|
prop="hopebusinesssum"
|
>
|
<el-input
|
v-model="loanForm[index].hopebusinesssum"
|
disabled
|
></el-input>
|
</el-form-item>
|
<!-- <el-form-item
|
label="预计贷款期限"
|
v-if="loanArr[index].hopebusinesstermday.visible"
|
prop="hopebusinesstermday"
|
>
|
<el-input v-model="loanForm[index].hopebusinesstermday" disabled></el-input>
|
</el-form-item> -->
|
<el-form-item
|
label="实际放款日期"
|
v-if="loanArr[index].actualputoutdate.visible"
|
prop="actualputoutdate"
|
>
|
<el-date-picker
|
v-model="loanForm[index].actualputoutdate"
|
type="date"
|
format="yyyy/MM/dd"
|
value-format="yyyy/MM/dd"
|
size="small"
|
placeholder="选择日期"
|
:disabled="!item.actualputoutdate.writeAble"
|
></el-date-picker>
|
</el-form-item>
|
<el-form-item
|
label="实际放款金额"
|
v-if="loanArr[index].actualputoutsum.visible"
|
prop="actualputoutsum"
|
>
|
<el-input
|
v-model="loanForm[index].actualputoutsum"
|
:disabled="!loanArr[index].actualputoutsum.writeAble"
|
@blur="
|
loanForm[index].actualputoutsum = formatMoney(
|
loanForm[index].actualputoutsum
|
)
|
"
|
></el-input>
|
</el-form-item>
|
<!-- 贷款期限天 -->
|
<el-form-item
|
label="贷款期限"
|
v-if="loanArr[index].businesstermday.visible"
|
prop="businesstermday"
|
>
|
<el-select
|
v-model="loanForm[index].businesstermday"
|
:disabled="!loanArr[index].businesstermday.writeAble"
|
clearable
|
filterable
|
placeholder="支持输入搜索选择"
|
@change="qryTrial(loanForm[index])"
|
>
|
<el-option
|
v-for="item in businesstermArr"
|
:key="item.creditTerm"
|
:label="item.creditTerm"
|
:value="item.creditTerm"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<!-- 贷款期限月 -->
|
<el-form-item
|
label="贷款期限"
|
v-if="loanArr[index].businesstermmonth.visible"
|
prop="businesstermmonth"
|
>
|
<el-select
|
v-model="loanForm[index].businesstermmonth"
|
:disabled="!loanArr[index].businesstermmonth.writeAble"
|
clearable
|
filterable
|
placeholder="支持输入搜索选择"
|
@change="qryTrial(loanForm[index])"
|
>
|
<el-option
|
v-for="item in businesstermArr"
|
:key="item.creditTerm"
|
:label="item.creditTerm"
|
:value="item.creditTerm"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
|
<el-form-item
|
label="期限单位"
|
v-if="loanArr[index].termunit.visible"
|
prop="termunit"
|
>
|
<el-select
|
v-model="loanForm[index].termunit"
|
:disabled="!loanArr[index].termunit.writeAble"
|
clearable
|
filterable
|
placeholder="支持输入搜索选择"
|
>
|
<el-option
|
v-for="item in termunitList"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
|
<el-form-item
|
label="还款渠道"
|
v-if="loanArr[index].repaymentChannel.visible"
|
prop="repaymentChannel"
|
>
|
<el-select
|
v-model="loanForm[index].repaymentChannel"
|
:disabled="!loanArr[index].repaymentChannel.writeAble"
|
clearable
|
filterable
|
placeholder="支持输入搜索选择"
|
>
|
<el-option
|
v-for="item in repaymentChannelList"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
|
<el-form-item
|
label="贷款用途"
|
v-if="loanArr[index].purposedescription.visible"
|
prop="purposedescription"
|
>
|
<el-select
|
v-model="loanForm[index].purposedescription"
|
:disabled="!loanArr[index].purposedescription.writeAble"
|
clearable
|
filterable
|
placeholder="支持输入搜索选择"
|
>
|
<el-option
|
v-for="item in purposeDescriptionList"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
|
<el-form-item
|
label="担保方式"
|
v-if="loanArr[index].vouchtype.visible"
|
prop="vouchtype"
|
>
|
<el-select
|
v-model="loanForm[index].vouchtype"
|
:disabled="!loanArr[index].vouchtype.writeAble"
|
clearable
|
filterable
|
placeholder="支持输入搜索选择"
|
>
|
<el-option
|
v-for="item in vouchtypeList"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
|
<el-form-item
|
label="签约方式"
|
v-if="loanArr[index].contractsigntype.visible"
|
prop="contractsigntype"
|
>
|
<el-input
|
v-model="loanForm[index].contractsigntype"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
class="remark"
|
label="备注"
|
v-if="loanArr[index].remark.visible"
|
prop="remark"
|
>
|
<el-input
|
type="textarea"
|
maxlength="200"
|
:autosize="{ minRows: 2, maxRows: 2 }"
|
v-model="loanForm[index].remark"
|
:disabled="!loanArr[index].remark.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="放款资金单元"
|
v-if="loanArr[index].fundunitno.visible"
|
prop="fundunitno"
|
>
|
<el-select
|
v-model="loanForm[index].fundunitno"
|
:disabled="!loanArr[index].fundunitno.writeAble"
|
clearable
|
filterable
|
placeholder="支持输入搜索选择"
|
@change="selfundunitno"
|
>
|
<el-option
|
v-for="item in fundUnitList"
|
:key="item.fundunitno"
|
:label="item.fundunitname"
|
:value="item.fundunitno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].loanOrgList.filedDescription"
|
v-if="loanArr[index].loanOrgList.visible"
|
prop="loanOrgList"
|
>
|
<el-input
|
v-model="loanForm[index].loanOrgList"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].fundunitremanentamt.filedDescription"
|
v-if="loanArr[index].fundunitremanentamt.visible"
|
prop="fundunitremanentamt"
|
>
|
<el-input
|
v-model="loanForm[index].fundunitremanentamt"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].basecreditamt.filedDescription"
|
v-if="loanArr[index].basecreditamt.visible"
|
prop="basecreditamt"
|
>
|
<el-input
|
v-model="loanForm[index].basecreditamt"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].productcreditamtlimit.filedDescription"
|
v-if="loanArr[index].productcreditamtlimit.visible"
|
prop="productcreditamtlimit"
|
>
|
<el-input
|
v-model="loanForm[index].productcreditamtlimit"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].productremanentamt.filedDescription"
|
v-if="loanArr[index].productremanentamt.visible"
|
prop="productremanentamt"
|
>
|
<el-input
|
v-model="loanForm[index].productremanentamt"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].productQuotaValidDate.filedDescription"
|
v-if="loanArr[index].productQuotaValidDate.visible"
|
prop="productQuotaValidDate"
|
>
|
<el-input
|
v-model="loanForm[index].productQuotaValidDate"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].productQuotaInvalidDate.filedDescription"
|
v-if="loanArr[index].productQuotaInvalidDate.visible"
|
prop="productQuotaInvalidDate"
|
>
|
<el-input
|
v-model="loanForm[index].productQuotaInvalidDate"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].refereephone.filedDescription"
|
v-if="loanArr[index].refereephone.visible"
|
prop="refereephone"
|
>
|
<el-input
|
v-model="loanForm[index].refereephone"
|
@change="getRefereerInfo('refereePhone', '0')"
|
:disabled="!loanArr[index].refereephone.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].refereeid.filedDescription"
|
v-if="loanArr[index].refereeid.visible"
|
prop="refereeid"
|
>
|
<el-input
|
v-model="loanForm[index].refereeid"
|
@change="getRefereerInfo('refereeId', '1')"
|
:disabled="!loanArr[index].refereeid.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].refereename.filedDescription"
|
v-if="loanArr[index].refereename.visible"
|
>
|
<el-input
|
v-model="loanForm[index].refereename"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].refereeorgname.filedDescription"
|
v-if="loanArr[index].refereeorgname.visible"
|
>
|
<el-input
|
v-model="loanForm[index].refereeorgname"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].refereefirstinternallevel.filedDescription"
|
v-if="loanArr[index].refereefirstinternallevel.visible"
|
>
|
<el-input
|
v-model="loanForm[index].refereefirstinternallevelName"
|
disabled
|
></el-input>
|
<el-input
|
v-model="loanForm[index].refereefirstinternallevel"
|
v-show="false"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].operateuserid.filedDescription"
|
v-if="loanArr[index].operateuserid.visible"
|
>
|
<el-input
|
v-model="loanForm[index].operateuserid"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].operateuserName.filedDescription"
|
v-if="loanArr[index].operateuserName.visible"
|
>
|
<el-input
|
v-model="loanForm[index].operateuserName"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].operateorgName.filedDescription"
|
v-if="loanArr[index].operateorgName.visible"
|
>
|
<el-input
|
v-model="loanForm[index].operateorgName"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].operatefirstinternallevel.filedDescription"
|
v-if="loanArr[index].operatefirstinternallevel.visible"
|
>
|
<el-input
|
v-model="loanForm[index].operatefirstinternallevelName"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="loanArr[index].operatedate.filedDescription"
|
v-if="loanArr[index].operatedate.visible"
|
>
|
<el-input
|
v-model="loanForm[index].operatedate"
|
disabled
|
></el-input>
|
</el-form-item>
|
</div>
|
</div>
|
<div class="_block">
|
<p class="title">
|
<span></span>
|
账户信息
|
</p>
|
<!-- <div class="form">
|
<el-form-item
|
label="贷款发放方式"
|
v-if="
|
loanArr[index].paymentMode && loanArr[index].paymentMode.visible
|
"
|
prop="paymentMode"
|
>
|
<el-select
|
v-model="loanForm[index].paymentMode"
|
:disabled="!loanArr[index].paymentMode.writeAble"
|
clearable
|
filterable
|
placeholder="支持输入搜索选择"
|
>
|
<el-option
|
v-for="item in paymentModeList"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
</div> -->
|
<div class="form">
|
<el-form-item
|
label="收款账户开户行"
|
v-if="loanArr[index].putoutbankno.visible"
|
prop="putoutbankno"
|
>
|
<el-select
|
v-model="loanForm[index].putoutbankno"
|
:disabled="!loanArr[index].putoutbankno.writeAble"
|
@change="selputoutbankno"
|
clearable
|
filterable
|
placeholder="支持输入搜索选择"
|
>
|
<el-option
|
v-for="item in putoutbankList"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
label="收款账户名"
|
v-if="loanArr[index].putoutbankname.visible"
|
prop="putoutbankname"
|
>
|
<el-input
|
v-model="loanForm[index].putoutbankname"
|
:disabled="!loanArr[index].putoutbankname.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="收款账户账号"
|
v-if="loanArr[index].putoutcardno.visible"
|
prop="putoutcardno"
|
>
|
<el-input
|
v-model="loanForm[index].putoutcardno"
|
:disabled="!loanArr[index].putoutcardno.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="收款账户开户地所在省"
|
v-if="loanArr[index].putoutbankprovince.visible"
|
prop="putoutbankprovince"
|
>
|
<el-select
|
v-model="loanForm[index].putoutbankprovince"
|
filterable
|
clearable
|
placeholder="支持输入搜索选择"
|
:disabled="!loanArr[index].putoutbankprovince.writeAble"
|
@change="
|
getprovince(
|
loanForm[index].putoutbankprovince,
|
'putoutbankcityList',
|
loanForm[index],
|
function (arr) {
|
putoutbankcityList = arr;
|
}
|
)
|
"
|
>
|
<el-option
|
v-for="(item, index) in provinceList"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
label="收款账户开户地所在市"
|
v-if="loanArr[index].putoutbankcity.visible"
|
prop="putoutbankcity"
|
>
|
<el-select
|
v-model="loanForm[index].putoutbankcity"
|
filterable
|
clearable
|
placeholder="支持输入搜索选择"
|
:disabled="!loanArr[index].putoutbankcity.writeAble"
|
>
|
<el-option
|
v-for="(item, index) in putoutbankcityList"
|
:key="index"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
style="width: 66.6%;"
|
label="收款账户开户分支行"
|
v-if="loanArr[index].putoutbankbranchname.visible"
|
prop="putoutbankbranchname"
|
>
|
<el-input
|
v-model="loanForm[index].putoutbankbranchno"
|
:disabled="!loanArr[index].putoutbankbranchno.writeAble"
|
class="input-with-select"
|
>
|
<el-button
|
slot="append"
|
icon="el-icon-search"
|
v-if="loanArr[index].putoutbankbranchno.writeAble"
|
@click="getBankBranch"
|
></el-button>
|
</el-input>
|
<el-autocomplete
|
v-model="loanForm[index].putoutbankbranchname"
|
clearable
|
:fetch-suggestions="querySearchAsync"
|
:trigger-on-focus="false"
|
:popper-append-to-body="false"
|
:debounce='300'
|
value-key="label"
|
placeholder="请输入名称进行选择"
|
@select="handleSelect"
|
@clear="blurForBug()"
|
ref="myAutocomplete"
|
></el-autocomplete>
|
</el-form-item>
|
|
|
<el-form-item
|
label="还款账户开户行"
|
v-if="loanArr[index].repaymentbankno.visible"
|
prop="putoutbankno"
|
>
|
<el-select
|
v-model="loanForm[index].repaymentbankno"
|
:disabled="!loanArr[index].repaymentbankno.writeAble"
|
@change="selputoutbankno"
|
clearable
|
filterable
|
placeholder="支持输入搜索选择"
|
>
|
<el-option
|
v-for="item in putoutbankList"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
label="还款账户名"
|
v-if="loanArr[index].repaymentbankname.visible"
|
prop="putoutbankname"
|
>
|
<el-input
|
v-model="loanForm[index].repaymentbankname"
|
:disabled="!loanArr[index].repaymentbankname.writeAble"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
label="还款账户账号"
|
v-if="loanArr[index].repaymentcardno.visible"
|
prop="putoutcardno"
|
>
|
<el-input
|
v-model="loanForm[index].repaymentcardno"
|
:disabled="!loanArr[index].repaymentcardno.writeAble"
|
></el-input>
|
</el-form-item>
|
</div>
|
</div>
|
<PriceInfo
|
v-if="applyInfo.phaseNo >= '0040'"
|
:pricingInfo="loanForm[index].pricingInfo"
|
:discountAgreementFile="loanArr[index].discountAgreementFile.visible"
|
></PriceInfo>
|
</el-form>
|
</div>
|
<div class="fixedBtn">
|
<el-button
|
size="medium"
|
plain
|
@click="saveDraft(loanForm)"
|
v-if="applyInfo.phaseNo == '0040'"
|
>保存草稿</el-button
|
>
|
<el-button
|
size="medium"
|
plain
|
@click="save(loanForm)"
|
v-if="applyInfo.phaseNo > '0040' && writeAble"
|
>保存</el-button
|
>
|
<el-button
|
size="medium"
|
plain
|
@click="prevStep"
|
v-if="applyInfo.phaseNo == '0040' || applyInfo.phaseNo == '0060'"
|
>上一步</el-button
|
>
|
<el-button size="medium" plain @click="prevStep" v-else>上一步</el-button>
|
<el-button
|
size="medium"
|
type="primary"
|
@click="submit(loanForm)"
|
v-if="applyInfo.phaseNo >= '0040' && writeAble"
|
>下一步</el-button
|
>
|
<el-button size="medium" type="primary" @click="nextPage()" v-else
|
>下一步</el-button
|
>
|
</div>
|
<Branch
|
v-if="showBranch"
|
:visible="showBranch"
|
:bank="loanForm[0].putoutbankno"
|
@closeBranch="showBranch = false"
|
@sendBranch="sendBranch"
|
></Branch>
|
</div>
|
</template>
|
<script>
|
import {
|
qryApplyDetail,
|
getDictionaryList,
|
qryCustomerBaseList,
|
getAllCityAreaList,
|
tryTrialPriceInfo,
|
qryRepayTypeList,
|
qryFundUnitList,
|
qryRefereerInfo,
|
saveOrUpdatePreApplyLoan,
|
submitApplyLoan,
|
qryLoanOrgList,
|
getProvinceCodeList,
|
getBankList,
|
calculateLoanMes,
|
qryLoanTermList,
|
qryBankBranchList
|
} from "@/api/product";
|
import common from "@/utils/common";
|
import PriceInfo from "@views/product/components/PriceInfo";
|
import Branch from "@views/product/components/Branch";
|
export default {
|
data() {
|
return {
|
applyInfo: this.$store.state.product.applyInfo,
|
applyMenu: this.$store.state.product.applyMenu,
|
initialArr: [], //初始数据
|
loanForm: [],
|
loanArr: [],
|
rules: {},
|
allCityList: [],
|
repayTypeList: [],
|
fundUnitList: [],
|
provinceList: [],
|
putoutbankcityList: [],
|
putoutbankList: [],
|
offlinePutoutBankList: [],
|
BaseLoanTypeList: [],
|
repaymentChannelList: [], //还款渠道选项
|
purposeDescriptionList: [], //贷款用途选项
|
vouchtypeList: [], //担保方式选项
|
termunitList: [],
|
yesNoList: [],
|
paymentModeList: [],
|
customerBaseList: [],
|
billtypeArr: [], //应收账款凭证类型
|
showBranch: false,
|
writeAble: false,
|
businesstermArr: [], //贷款期限数组 天,月
|
isSaveDraft: false, //点击了保存草稿则需要置为true
|
};
|
},
|
async created() {
|
this.$parent._data.loading = true;
|
this.fundUnitList = await this.getFundUnitList();
|
const result = await this.getApplyDetail();
|
if(result && result.businesscity.value == '') {
|
result.businesscity.value = '440300'
|
}
|
if(result && result.repaymenttype.value == '') {
|
result.repaymenttype.value = 'RPT-03'
|
}
|
this.getApplyData(result);
|
this.$parent._data.loading = false;
|
},
|
async mounted() {
|
console.log("dom节点渲染完毕后");
|
},
|
components: {
|
PriceInfo,
|
Branch,
|
},
|
methods: {
|
//应收账款明细能否勾选
|
creditorBillsCanSelect(row, index) {
|
if (this.applyInfo.phaseNo < '0130') {
|
return true
|
}else {
|
return false
|
}
|
},
|
//请求接口后初始化选中状态
|
toggleSelection(rows) {
|
// let _this = this;
|
console.log("初始化选中 ===>", rows);
|
if (rows) {
|
rows.forEach((row) => {
|
console.log("初始化选中行 ===>", row.selected);
|
if (row.selected === "1") {
|
this.$refs.creditorBillsTable[0].toggleRowSelection(row, true);
|
}
|
});
|
} else {
|
this.$refs.creditorBillsTable[0].clearSelection();
|
}
|
},
|
//应收账款明细选择
|
handleSelectionChange(selectBillArr) {
|
if (this.isSaveDraft) {
|
console.log("保存草稿来的,不用处理");
|
this.isSaveDraft = false;
|
return;
|
}
|
setTimeout(() => {
|
console.log("应收账款明细操作", selectBillArr);
|
if (selectBillArr.length > 0) {
|
this.loanForm[0].creditorBills.forEach((item) => {
|
item.selected = "0";
|
});
|
for (let iSelect = 0; iSelect < selectBillArr.length; iSelect++) {
|
for (
|
let index = 0;
|
index < this.loanForm[0].creditorBills.length;
|
index++
|
) {
|
let selectItem = selectBillArr[iSelect];
|
let item = this.loanForm[0].creditorBills[index];
|
if (selectItem.billno == item.billno) {
|
item.selected = "1";
|
}
|
}
|
}
|
} else {
|
this.loanForm[0].creditorBills.forEach((item) => {
|
item.selected = "0";
|
});
|
}
|
this.loanForm[0].creditorBills.forEach((item, index) => {
|
console.log("第" + index + "个", item.selected);
|
});
|
}, 10);
|
},
|
// 获取客群名称描述
|
getCustomerbasename(val) {
|
const { customerBaseList, loanForm } = this;
|
this.qryTrial(loanForm[0]);
|
for (let i = 0; i < customerBaseList.length; i++) {
|
if (customerBaseList[i].customersCode == val) {
|
this.loanForm[0].customerbasename = customerBaseList[i].customersName;
|
break;
|
}
|
}
|
},
|
// 处理数据,并校验规则
|
async getApplyData(result) {
|
//获取应收账款明细类型
|
this.billtypeArr = await this.qryDictionaryList("AccountsCertType");
|
// 获取贷款机构清单
|
if (result.fundunitno.value) {
|
const res = await qryLoanOrgList({
|
fundUnitNo: result.fundunitno.value,
|
});
|
|
result["loanOrgList"].value = res.result[0].orgName;
|
}
|
|
// 保理-放款资金单元默认填写SLB
|
// result["fundunitno"].value = "SLBL";
|
|
this.loanArr = [];
|
this.loanForm = [];
|
this.initialArr = [];
|
this.loanArr.push(result);
|
|
// 初始化数据和校验规则
|
this.loanArr.forEach(async (val, index) => {
|
for (const key in val) {
|
if (key == "putOutInfo") {
|
for (const child in val[key]) {
|
val[child] = val[key][child];
|
}
|
}
|
|
// 格式化保证金信息
|
// if(key == 'earnestMoneyInfo') {
|
// val[key].value = {}
|
// for (const child in val[key]) {
|
// val[key]['value'][child] = val[key][child];
|
// }
|
// }
|
}
|
|
// 将数据重新排列
|
const obj = {};
|
for (const key in val) {
|
// 格式化金额
|
if (
|
key == "stillproceedssum" ||
|
key == "hasproceedsallsum" ||
|
key == "stayproceedssum" ||
|
key == "stillpaybalance" ||
|
key == "haspaybalance" ||
|
key == "staypaybalance" ||
|
key == "stillbackpaysum" ||
|
key == "hasbackpaysum" ||
|
key == "hopebusinesssum" ||
|
key == "businesssum" ||
|
key == "actualputoutsum" ||
|
key == "payprincipalamt" ||
|
key == "actualpayprincipalamt" ||
|
key == "actualpayinterestamt" ||
|
key == "payinterestamt" ||
|
key == "payduepenaltyamt" ||
|
key == "payprincipalpenaltyamt" ||
|
key == "actualpayprincipalpenaltyamt" ||
|
key == "paypenaltyamt" ||
|
key == "paypenaltyamt" ||
|
key == "alreadypayprincipalpenalty" ||
|
key == "backpayallsum" ||
|
key == "payallsum" ||
|
key == "haspayallsum" ||
|
key == "stillpayallsum" ||
|
key == "debtorpaysum" ||
|
key == "fundunitremanentamt" ||
|
key == "basecreditamt" ||
|
key == "productcreditamtlimit" ||
|
key == "productremanentamt"
|
) {
|
val[key].value = this.formatMoney(val[key].value);
|
}
|
// 自定义校验规则,涉及金额将进行格式化
|
this.rules[key] = [];
|
switch (key) {
|
case "putoutcardno":
|
this.rules[key].push(common.validate("number"));
|
break;
|
case "hopebusinesstermday":
|
this.rules[key].push(common.validate("number"));
|
break;
|
case "businesstermday":
|
this.rules[key].push(common.validate("number"));
|
break;
|
case "businesstermmonth":
|
this.rules[key].push(common.validate("number"));
|
break;
|
default:
|
break;
|
}
|
if (val[key].required) {
|
this.rules[key].push({
|
required: true,
|
message: `请输入${val[key].filedDescription}`,
|
trigger: "change",
|
});
|
}
|
// 如果是定价信息或者订单信息不能直接置空
|
if (
|
key != "pricingInfo" &&
|
key != "voucherInfo" &&
|
key != "putOutInfo"
|
) {
|
obj[key] = val[key].value;
|
obj["hopebusinesstermday"] = obj["hopebusinesstermday"]
|
? parseInt(obj["hopebusinesstermday"])
|
: "";
|
val[key].value = "";
|
} else {
|
obj[key] = val[key];
|
}
|
if (key == "creditorBills") {
|
obj.creditorBills = val[key];
|
obj.creditorBills.forEach((billItem) => {
|
this.billtypeArr.forEach((billTypeItem) => {
|
if (billItem.billtype === billTypeItem.itemno) {
|
billItem.billtypeDesc = billTypeItem.itemname;
|
}
|
});
|
});
|
}
|
}
|
// 获取资金单元剩余可用额度
|
this.getFundunitname(obj);
|
this.loanForm.push(obj);
|
this.initialArr.push(Object.assign({}, obj));
|
});
|
this.qryAllCityAreaList();
|
this.getRepayTypeList();
|
this.getLoanTermList();
|
this.getCustomerBaseList();
|
getProvinceCodeList({}).then((res) => {
|
this.provinceList = res.result;
|
});
|
// 根据省获取市
|
this.loanForm[0].putoutbankprovince
|
? (this.putoutbankcityList = await common.qryCityCodeList(
|
this.loanForm[0].putoutbankprovince
|
))
|
: "";
|
this.writeAble =
|
this.loanArr[0].remark.writeAble ||
|
this.loanArr[0].debtorpaydate.writeAble ||
|
(this.loanArr[0].putOutInfo &&
|
this.loanArr[0].offlineputoutbankno.writeAble);
|
this.putoutbankList = await this.qryBankList("1,3");
|
this.offlinePutoutBankList = await this.qryDictionaryList(
|
"PutOutAccountType"
|
);
|
this.BaseLoanTypeList = await this.qryDictionaryList("BaseLoanType");
|
this.purposeDescriptionList = await this.qryDictionaryList(
|
"PurposeDescription"
|
);
|
this.repaymentChannelList = await this.qryDictionaryList(
|
"repaymentChannel"
|
);
|
this.vouchtypeList = await this.qryDictionaryList("vouchType");
|
this.paymentModeList = await this.qryDictionaryList("PaymentMode");
|
this.termunitList = await this.qryDictionaryList("TermUnit");
|
this.yesNoList = await this.qryDictionaryList("YesNo");
|
|
console.log(this.loanForm[0].creditorBills);
|
//处理初始化选中的应收账款明细
|
setTimeout(() => {
|
this.toggleSelection(this.loanForm[0].creditorBills);
|
}, 100);
|
|
console.log("getApplyData完成**", this.loanForm[0]);
|
},
|
// 查询贷款申请信息
|
getApplyDetail() {
|
return new Promise((resolve) => {
|
qryApplyDetail({ serialNo: this.applyInfo.serialNo }).then((res) => {
|
resolve(res.result);
|
});
|
});
|
},
|
// 计算保理财务信息
|
calculateLoanMes(form) {
|
if (!form.debtorpaydate || !form.debtorpaysum) return;
|
const obj = {
|
applyserialno: this.applyInfo.serialNo,
|
debtorpaydate: form.debtorpaydate,
|
debtorpaysum: form.debtorpaysum,
|
};
|
this.$parent._data.loading = true;
|
calculateLoanMes(obj).then((res) => {
|
if (res.code == "00") {
|
for (const key in res.result) {
|
if (form.hasOwnProperty(key)) {
|
if (key == "debtorpaydate") {
|
form[key] = res.result[key];
|
} else {
|
form[key] = this.formatMoney(res.result[key]);
|
}
|
}
|
}
|
}
|
this.$parent._data.loading = false;
|
});
|
},
|
// 定价信息试算
|
qryTrial(form) {
|
|
if (form.operatedate >= form.exevaluedate && form.exevaluedate) {
|
form.exevaluedate = "";
|
this.$message.warning("执行起息日不能小于申请日期!");
|
return;
|
}
|
if (
|
(form.productcustomerscode ||
|
!this.loanArr[0].productcustomerscode.visible ||
|
!this.loanArr[0].productcustomerscode.writeAble ||
|
!this.loanArr[0].productcustomerscode.required) &&
|
(form.productcreditamtlimit ||
|
!this.loanArr[0].productcreditamtlimit.visible ||
|
!this.loanArr[0].productcreditamtlimit.writeAble) &&
|
(form.basecreditamt ||
|
!this.loanArr[0].basecreditamt.visible ||
|
!this.loanArr[0].basecreditamt.writeAble) &&
|
(form.putoutdate ||
|
!this.loanArr[0].putOutInfo ||
|
!this.loanArr[0].putoutdate.visible) &&
|
(form.businesssum || !this.loanArr[0].businesssum.visible) &&
|
(form.businesstermday || !this.loanArr[0].businesstermday.visible) &&
|
(form.businesstermmonth || !this.loanArr[0].businesstermmonth.visible) &&
|
(form.repaymenttype || !this.loanArr[0].repaymenttype.visible) &&
|
this.applyInfo.phaseNo >= "0040"
|
) {
|
form.businesssum = this.formatMoney(form.businesssum);
|
const obj = {
|
serialno: this.applyInfo.serialNo,
|
productcustomerscode: form.productcustomerscode,
|
businesssum: form.businesssum,
|
repaymenttype: form.repaymenttype,
|
productcreditamtlimit: form.productcreditamtlimit,
|
basecreditamt: form.basecreditamt,
|
actualputoutdate: form.putoutdate,
|
exevaluedate: form.exevaluedate,
|
businesstermday: form.businesstermday,
|
businesstermmonth: form.businesstermmonth,
|
};
|
this.$parent._data.loading = true;
|
if (
|
/^\d{1,3}(,?\d{3})*(\.\d{1,2})?$/.test(form.businesssum) &&
|
obj.repaymenttype &&
|
(obj.businesstermday || obj.businesstermmonth)
|
) {
|
tryTrialPriceInfo(obj).then((res) => {
|
this.$parent._data.loading = false;
|
if (res.code == "00") {
|
//根据返回参数调用fundunitno,调用放款资金单元列表
|
if (res.result.fundunitno) {
|
this.loanForm[0].fundunitno = res.result.fundunitno
|
this.selfundunitno(res.result.fundunitno);
|
}
|
res.result.msg = "";
|
//更新放款金额,产品剩余可用额度
|
form.productdimension = res.result.productdimension;
|
form.productdimensionname = res.result.productdimensionname;
|
form.productremanentamt = this.formatMoney(
|
res.result.productremanentamt
|
);
|
form.amountloan = this.formatMoney(res.result.amountloan);
|
form.productcreditamtlimit = this.formatMoney(
|
res.result.productcreditamtlimit
|
);
|
form.basecreditamt = this.formatMoney(res.result.basecreditamt);
|
form.hopebusinesssum = this.formatMoney(
|
res.result.hopebusinesssum
|
);
|
form.hopebusinesstermday = res.result.hopebusinesstermday;
|
form.actualputoutdate = res.result.actualputoutdate;
|
form.maturitydate = res.result.maturitydate;
|
form.actualputoutsum = this.formatMoney(
|
res.result.actualputoutsum
|
);
|
// form.businesstermday = res.result.businesstermday;
|
// form.businesstermmonth = res.result.businesstermmonth;
|
//更新定价信息
|
if (JSON.stringify(res.result.pricingInfo) != "{}") {
|
form.pricingInfo = res.result.pricingInfo;
|
}
|
// 提示试算结果
|
if (res.result.flags) {
|
for (const key in res.result.flags) {
|
if (res.result.flags[key]) {
|
if (res.result.msg) {
|
res.result.msg += "," + res.result.flags[key];
|
} else {
|
res.result.msg += res.result.flags[key];
|
}
|
// 将还款方式,放款金额清空值
|
switch (key) {
|
case "flagBusinesssum":
|
form.businesssum = "";
|
break;
|
case "flagRepaymenttype":
|
form.repaymenttype = "";
|
break;
|
case "flagProductcreditamtlimit":
|
form.productcreditamtlimit = "";
|
break;
|
default:
|
break;
|
}
|
// 将定价信息里面的所有字段value清空
|
for (const key in form.pricingInfo) {
|
form.pricingInfo[key] = "";
|
}
|
}
|
}
|
}
|
// 提示语
|
if (res.result.msg) {
|
this.$message.warning(res.result.msg);
|
}
|
// 更新还款方式下拉选项
|
if (res.result.repaymentTermList.length) {
|
let flag = true;
|
this.repayTypeList = res.result.repaymentTermList;
|
for (let i = 0; i < this.repayTypeList.length; i++) {
|
if (this.repayTypeList[i].paymentType == form.repaymenttype) {
|
flag = false;
|
break;
|
}
|
}
|
if (flag) {
|
form.repaymenttype = "";
|
}
|
} else {
|
this.getRepayTypeList();
|
}
|
//获取贷款期限
|
// this.getLoanTermList();
|
}
|
});
|
} else {
|
this.$message.warning("贷款金额输入格式有误,请重新输入!");
|
form.businesssum = "";
|
this.$parent._data.loading = false;
|
}
|
}
|
},
|
getBankBranch() {
|
if (!this.loanForm[0].putoutbankno) {
|
this.$message.warning("请输入收款账户开户行");
|
return;
|
}
|
this.showBranch = true;
|
this.loanForm[0].putoutbankbranchno = "";
|
},
|
selOfflinePutoutBank(val) {
|
for (let i = 0; i < this.offlinePutoutBankList.length; i++) {
|
if (this.offlinePutoutBankList[i].itemno == val) {
|
this.loanForm[0].offlineputoutbankname =
|
this.offlinePutoutBankList[i].itemname;
|
this.loanForm[0].offlineputoutaccountno =
|
this.offlinePutoutBankList[i].attribute1;
|
this.loanForm[0].offlineputoutaccountname =
|
this.offlinePutoutBankList[i].attribute3;
|
break;
|
}
|
}
|
},
|
// 子组件回传
|
sendBranch(data) {
|
this.loanForm[0].putoutbankbranchno = data.bankno;
|
this.loanForm[0].putoutbankbranchname = data.bankname;
|
},
|
// 监听收款账户开户行
|
selputoutbankno() {
|
// 当重新选择开户行就要更新开户行分支行
|
this.loanForm[0].putoutbankbranchno = "";
|
this.loanForm[0].putoutbankbranchname = "";
|
},
|
editBusinesssum(form) {
|
form.businesssum = this.formatMoney(form.businesssum);
|
// 计算时去除空格
|
form.financingcvs = (
|
parseInt(form.businesssum.replace(/,/g, "").replace(/\s/g, "")) /
|
parseInt(form.billsum)
|
).toFixed(5);
|
|
// if (parseFloat(form.financingcvs) > 1) {
|
// form.businesssum = "";
|
// form.financingcvs = "";
|
// this.$message.warning("融资成数不能大于1");
|
// } else {
|
// this.qryTrial(form);
|
// }
|
this.qryTrial(form);
|
},
|
async querySearchAsync(query, cb) {
|
console.log(this.loanForm[0].putoutbankbranchno )
|
if(query.length>1){
|
this.loanForm[0].putoutbankbranchno = ''
|
const { result } = await qryBankBranchList({
|
currentPage:1,
|
pageSize:10,
|
bankcode:this.loanForm[0].putoutbankno,
|
bankname:query
|
})
|
result.records.forEach(val => {
|
val.label = `${val.bankname}`
|
val.value = `${val.bankno}`
|
});
|
cb(result.records);
|
}else{
|
cb([]);
|
}
|
},
|
handleSelect(data) {
|
this.loanForm[0].putoutbankbranchno = data.bankno;
|
this.loanForm[0].putoutbankbranchname = data.bankname;
|
},
|
// 点击clearable清空小图标按钮以后,继续重新在输入框中输入数据,querySearch会触发,但是cb函数不会触发
|
// 这样的话就会出现发请求了,也获取数据了,但是input框的输入建议下拉框不呈现在页面上的问题,所以解决方法就是
|
// 只要用户点击了
|
blurForBug(){
|
document.activeElement.blur()
|
},
|
editFinancingcvs(form) {
|
if (parseFloat(form.financingcvs) > 1) {
|
form.financingcvs = "";
|
this.$message.warning("融资成数不能大于1");
|
} else {
|
form.businesssum = this.formatMoney(
|
parseFloat(form.financingcvs) * parseInt(form.billsum)
|
);
|
this.qryTrial(form);
|
}
|
},
|
// 保存接口
|
saveApplyLoan(arr) {
|
return new Promise((resolve) => {
|
saveOrUpdatePreApplyLoan(arr[0]).then((res) => {
|
resolve(res);
|
});
|
});
|
},
|
// 提交接口
|
getSubmitApplyLoan(arr) {
|
return new Promise((resolve) => {
|
submitApplyLoan(arr[0]).then((res) => {
|
resolve(res);
|
});
|
});
|
},
|
// 保存草稿
|
async saveDraft(arr) {
|
this.$parent._data.loading = true;
|
const res = await this.saveApplyLoan(arr);
|
if (res.code == "00") {
|
const result = await this.getApplyDetail();
|
//保存草稿时出现的问题,临时解决方案
|
result.creditorBills.forEach((item) => {
|
if (item.selected == "1") {
|
this.isSaveDraft = true;
|
}
|
});
|
this.getApplyData(result);
|
this.$message.success("保存成功");
|
// 保存草稿需要调用父组件的查询左侧tab的方法
|
// this.$parent.getApplyTabTree('贷款申请信息');
|
}
|
this.$parent._data.loading = false;
|
},
|
// 保存并校验数据完整性
|
async save(arr) {
|
if (!common.validateForm(this.$refs.loanForm).flag) return;
|
this.$parent._data.loading = true;
|
const res = await this.saveApplyLoan(arr);
|
if (res.code == "00") {
|
const result = await this.getApplyDetail();
|
//保存草稿时出现的问题,临时解决方案
|
result.creditorBills.forEach((item) => {
|
if (item.selected == "1") {
|
this.isSaveDraft = true;
|
}
|
});
|
this.getApplyData(result);
|
this.$message.success("保存成功");
|
}
|
this.$parent._data.loading = false;
|
},
|
// 上一步或上一页
|
prevStep() {
|
this.applyMenu.forEach((val, index) => {
|
if (val.tabname == "贷款申请信息") {
|
common.tabInfo(
|
this.applyMenu[index - 1].tabname,
|
this.applyInfo.flowno,
|
this
|
);
|
}
|
});
|
},
|
// 提交
|
async submit(arr) {
|
if (!common.validateForm(this.$refs.loanForm).flag) return;
|
this.$parent._data.loading = true;
|
const res = await this.getSubmitApplyLoan(arr);
|
if (res.code == "00") {
|
const result = await this.getApplyDetail();
|
//保存草稿时出现的问题,临时解决方案
|
result.creditorBills.forEach((item) => {
|
if (item.selected == "1") {
|
this.isSaveDraft = true;
|
}
|
});
|
this.getApplyData(result);
|
this.$parent._data.loading = false;
|
this.nextPage();
|
}
|
},
|
// 下一页
|
nextPage() {
|
// 调用父组件的查询左侧tab的方法
|
this.$parent.updateApplyTabTree("贷款申请信息");
|
},
|
// 产品客群
|
getCustomerBaseList() {
|
qryCustomerBaseList({
|
productCode: this.loanForm[0].productid,
|
applySerialNo: this.applyInfo.serialNo,
|
}).then((res) => {
|
this.customerBaseList = res.result;
|
});
|
},
|
// 银行列表
|
qryBankList(code) {
|
return new Promise((resolve) => {
|
getBankList({
|
codeNo: "BankCode",
|
itmeNo: code,
|
}).then((res) => {
|
resolve(res.result);
|
});
|
});
|
},
|
// 根据推荐人手机号获取推荐人信息
|
getRefereerInfo(code, i) {
|
const obj = {
|
getFromType: i,
|
};
|
obj[code] = this.loanForm[0][code.toLowerCase()];
|
qryRefereerInfo(obj).then((res) => {
|
if (res.code == "00") {
|
this.loanForm[0].refereephone = res.result.refereePhone;
|
this.loanForm[0].refereeid = res.result.refereeID;
|
this.loanForm[0].refereename = res.result.refereeName;
|
this.loanForm[0].refereeorgid = res.result.refereeOrgID;
|
this.loanForm[0].refereeorgname = res.result.refereeOrgName;
|
this.loanForm[0].refereefirstinternallevelName =
|
res.result.refereefirstinternallevelName;
|
this.loanForm[0].refereefirstinternallevel =
|
res.result.refereefirstinternallevel;
|
}
|
});
|
},
|
// 根据放款资金单元获取获取贷款机构清单
|
async selfundunitno(val) {
|
//有可能没有放款资金单元的配置项,在该位置请求一次
|
if (this.fundUnitList.length === 0) {
|
this.fundUnitList = await this.getFundUnitList();
|
}
|
this.getFundunitname(this.loanForm[0]);
|
// 获取贷款机构清单
|
if (val) {
|
const res = await qryLoanOrgList({ fundUnitNo: val });
|
console.log("调用自动测算**", this.loanForm[0]);
|
this.loanForm[0].loanOrgList = res.result[0].orgName;
|
}
|
},
|
getFundunitname(form) {
|
for (let i = 0; i < this.fundUnitList.length; i++) {
|
if (form.fundunitno == this.fundUnitList[i].fundunitno) {
|
form.fundunitremanentamt = this.formatMoney(
|
this.fundUnitList[i].remainTotalSum
|
);
|
form.fundunitname = this.fundUnitList[i].fundunitname;
|
break;
|
}
|
}
|
},
|
// 放款资金单元下拉
|
getFundUnitList() {
|
return new Promise((resolve) => {
|
qryFundUnitList({}).then((res) => {
|
resolve(res.result);
|
});
|
});
|
},
|
// 还款方式
|
getRepayTypeList() {
|
qryRepayTypeList({
|
termUnit: this.loanForm[0].termunit,
|
productCode: this.loanForm[0].productid,
|
creditTerm: this.loanForm[0].businesstermmonth,
|
dimensionCode: this.loanForm[0].productdimension,
|
}).then((res) => {
|
this.repayTypeList = res.result;
|
});
|
},
|
// 城市公用列表
|
qryAllCityAreaList() {
|
getAllCityAreaList({ queryFlag: "02" }).then((res) => {
|
this.allCityList = res.result;
|
});
|
},
|
qryDictionaryList(code) {
|
return new Promise((resolve) => {
|
getDictionaryList({
|
codeNo: code,
|
}).then((res) => {
|
resolve(res.result);
|
});
|
});
|
},
|
// 金额格式化
|
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;
|
}
|
},
|
//获取贷款期限
|
getLoanTermList() {
|
qryLoanTermList({
|
termUnit: this.loanForm[0].termunit,
|
productCode: this.loanForm[0].productid,
|
repaymentType: this.loanForm[0].repaymenttype,
|
dimensionCode: this.loanForm[0].productdimension,
|
}).then((res) => {
|
this.businesstermArr = res.result;
|
if(this.loanForm[0] && this.loanForm[0].businesstermday == '') {
|
this.loanForm[0].businesstermday = res.result[0].creditTerm
|
this.initialArr[0].businesstermday = this.loanForm[0].businesstermday
|
}
|
});
|
},
|
},
|
beforeRouteLeave(to, from, next) {
|
!this.loanForm.length ||
|
common.compareFormData(this.initialArr, this.loanForm, next)
|
? next()
|
: "";
|
},
|
};
|
</script>
|
|
<style lang="postcss" scoped>
|
.product {
|
& >>> .el-autocomplete{
|
width: 100%;
|
}
|
}
|
</style>
|