zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<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>