<template>
|
<div class="product">
|
<div class="borrower">
|
<p class="title">
|
<span></span>
|
授信额度有效期
|
</p>
|
<el-form
|
ref="creditLineForm"
|
inline
|
label-width="165px"
|
size="small"
|
style="margin-bottom: 36px"
|
>
|
<el-form-item label="总授信额度" prop="productCreditAmt">
|
<el-input
|
:value="formatMoney(customerQuotaInfo.productCreditAmt)"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item label="已使用额度" prop="creditUsedAmt">
|
<el-input
|
:value="formatMoney(customerQuotaInfo.creditUsedAmt)"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item label="系统占用额度" prop="businesssum">
|
<el-input
|
:value="formatMoney(customerQuotaInfo.businesssum)"
|
disabled
|
></el-input>
|
</el-form-item>
|
<el-form-item label="剩余额度" prop="creditRemainAmt">
|
<el-input
|
:value="formatMoney(customerQuotaInfo.creditRemainAmt)"
|
disabled
|
></el-input>
|
</el-form-item>
|
</el-form>
|
<div class="btn">
|
<el-button
|
size="medium"
|
plain
|
@click="prevStep"
|
>上一步</el-button
|
>
|
<el-button
|
size="medium"
|
type="primary"
|
@click="nextPage"
|
>下一步</el-button
|
>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import common from "@/utils/common";
|
import {
|
saveCreditorBillInfo, //新增/修改明细
|
queryCustomerQuotaInfo
|
} from "@/api/product";
|
export default {
|
data() {
|
return {
|
applyInfo: this.$store.state.product.applyInfo,
|
applyMenu: this.$store.state.product.applyMenu,
|
creditLineForm: [], //明细网络请求值
|
customerQuotaInfo: [],
|
};
|
},
|
async created() {
|
this.customerQuotaInfo = await this.getqueryCustomerQuotaInfo()
|
},
|
components: {},
|
methods: {
|
// 金额格式化
|
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;
|
}else{
|
return value
|
}
|
},
|
|
//金额变成数字
|
moneyFomatNumber(number, n) {
|
if(typeof number == 'number') return number
|
if (number != null && number != "" && number != undefined) {
|
number = number.replace(/,/g, ""); //去除千分位的','
|
if (isNaN(number)) {
|
//判断是否是数字
|
number = "0";
|
} else {
|
number = Math.round(number * Math.pow(10, n)) / Math.pow(10, n); //n幂
|
number = number.toString();
|
}
|
} else {
|
number = "0";
|
}
|
//a.indexOf(x,y);返回x值在a字符串值中从y位置开始检索首次出现的位置
|
var numLength = number.indexOf(".");
|
//判断传递的值是整数增加小数点再补"0"
|
if (numLength < 0) {
|
numLength = number.length;
|
number += ".";
|
}
|
//不足n位小数的,循环补"0"
|
while (number.length <= numLength + n) {
|
number += "0";
|
}
|
return number;
|
},
|
// 查询客户额度信息查询
|
getqueryCustomerQuotaInfo() {
|
return new Promise((resolve) => {
|
queryCustomerQuotaInfo({
|
applyserialno: this.applyInfo.serialNo,
|
}).then((res) => {
|
resolve(res.result);
|
});
|
});
|
},
|
// 保存接口
|
save(row) {
|
return new Promise((resolve) => {
|
saveCreditorBillInfo(row).then((res) => {
|
resolve(res);
|
});
|
});
|
},
|
prevStep() {
|
this.applyMenu.forEach((val, index) => {
|
if (val.tabname == "额度信息") {
|
const ispubile = this.applyInfo.borrowertype == '01' && this.applyInfo.objectType == 'CreditApplyCommon'
|
common.tabInfo(
|
this.applyMenu[index - 1].tabname,
|
ispubile?'CreditFlowPublic':this.applyInfo.flowno,
|
this
|
);
|
}
|
});
|
},
|
// 下一页
|
nextPage() {
|
// 调用父组件的查询左侧tab的方法
|
|
this.$parent.updateApplyTabTree("额度信息");
|
},
|
},
|
};
|
</script>
|