xuefy 3 år sedan
förälder
incheckning
4635c5bbf3

+ 55 - 0
front-vue/src/api/service/credit/credit.js

@@ -9,6 +9,34 @@ export function listCredit(query) {
   })
 }
 
+// 融信开立
+export function addCredit(data) {
+  return request({
+    url: '/sc-service/ownCredit',
+    method: 'post',
+    data: data
+  })
+}
+
+//融信详情
+export function getCreditDetail(zfiId) {
+  return request({
+    url: '/sc-service/ownCredit/' + zfiId,
+    method: 'get'
+  })
+}
+
+
+// 修改融信信息
+export function updateCredit(data) {
+  return request({
+    url: '/sc-service/ownCredit',
+    method: 'put',
+    data: data
+  })
+}
+
+
 //查询授信额度
 export function listCreditLine(query) {
   return request({
@@ -16,4 +44,31 @@ export function listCreditLine(query) {
     method: 'get',
     params: query
   })
+}
+//核心开立获取接收方
+export function getReceiverList(query) {
+  return request({
+    url: '/sc-service/ownCredit/getReceiverList',
+    method: 'get',
+    params: query
+  })
+}
+
+//核心开立获取应付账款
+export function getAccountsPay(query) {
+  return request({
+    url: '/sc-service/ownCredit/getAccountsPay',
+    method: 'get',
+    params: query
+  })
+}
+
+
+//查询可用额度
+export function getAvailableBalance(query) {
+  return request({
+    url: '/sc-service/ownCredit/getAvailableBalance',
+    method: 'get',
+    params: query
+  })
 }

+ 14 - 2
front-vue/src/router/index.js

@@ -136,16 +136,28 @@ export const constantRoutes = [
     ]
   },
   {
-    path: '/service',
+    path: '/credit',
     component: Layout,
     hidden: true,
     children: [
       {
-        path: 'credit/addCredit',
+        path: 'addCredit',
         component: (resolve) => require(['@/views/service/credit/addCredit'], resolve),
         name: 'addCredit',
         meta: { title: '开立融信',noCache: true }
       },
+      {
+        path: 'creditDetail/:zfiId',
+        component: (resolve) => require(['@/views/service/credit/creditDetail'], resolve),
+        name: 'creditDetail',
+        meta: { title: '融信详情',noCache: true }
+      },
+      {
+                path: 'creditUpdate/:zfiId',
+                component: (resolve) => require(['@/views/service/credit/creditUpdate'], resolve),
+                name: 'creditUpdate',
+                meta: { title: '融信修改',noCache: true }
+      },
     ]
   },
   {

+ 544 - 29
front-vue/src/views/service/credit/addCredit.vue

@@ -16,6 +16,7 @@
                             filterable
                             clearable
                             remote
+                            @change="change"
                             >
                             <el-option
                             v-for="item in creditLineList"
@@ -25,19 +26,175 @@
                             </el-option>
                             </el-select>
                     </el-form-item>
+               
                 </el-col>
+                <el-col :span="8">
+                    <span>可用额度:</span>
+                    <span>{{availableAmt}}</span>
+                    <br>   
+                    <span>有效期:</span>
+                    <span>{{validityDate}}</span>  
+                </el-col>    
+            </el-row>
+            <el-row>
+                <el-col :span="8">
+                    <el-form-item label="接收方" prop="zfiSupplierId">
+                        <el-select
+                            style="width: 200px"
+                            v-model="form.zfiSupplierId"
+                            filterable
+                            clearable
+                            remote
+                            >
+                            <el-option
+                            v-for="item in supplierList"
+                            :key="item.value"
+                            :label="item.label"
+                            :value="item.value">
+                            </el-option>
+                            </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <el-form-item label="签发有效期" prop="zfiEffectiveDate"> 
+                       <el-date-picker clearable size="small" style="width: 200px"
+                            v-model="form.zfiEffectiveDate"
+                            type="date"
+                            value-format="yyyy-MM-dd"
+                            placeholder="选择签发有效期">
+                        </el-date-picker>
+                    </el-form-item>
+                </el-col> 
+            </el-row>  
+            <el-divider content-position="left" >应付账款</el-divider>
+            <el-form-item  style="margin-left: 100px">
+                <el-button size="mini" type="primary" @click="openTicket">选择</el-button>
+                <el-button size="mini" @click="deleteTicekt">清空全部</el-button>
+                <el-form-item label="合计金额:"> 
+                        <span>{{checkTotalAmt}}</span>
+                </el-form-item>
+                <el-form-item label="金额大写:"> 
+                        <span>{{checkTotalBigAmt}}</span>
+                </el-form-item>
+                
+                <el-table :data="ticketList" style="width: 1100px">
+                    <el-table-column label="账款名称"  align="center"  prop="zbiName" show-overflow-tooltip />
+                    <el-table-column label="应收企业"  align="center"  prop="receiveName"/>
+                    <el-table-column label="应付企业"  align="center"  prop="payName"    />
+                    <el-table-column label="预计还款期"  align="center"  prop="zbiPayDate" show-overflow-tooltip />
+                    <el-table-column label="金额"  align="center"  prop="zbiAmount" />
+                    <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
+                        <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-delete"
+                            @click="handleDelete(scope.$index, ticketList)"
+                        >删除</el-button>
+                        </template>
+                    </el-table-column>
+                </el-table>
+            </el-form-item>
+            <el-row>
+                <el-col :span="8">
+                    <el-form-item label="签发金额" prop="zfiAmount"> 
+                         <el-input v-model="form.zfiAmount" style="width: 200px" @input="getBigSmall" />
+                    </el-form-item>
+                </el-col> 
+                <el-col :span="8">
+                    <el-form-item label="承诺还款日" prop="zfiExpireDate"> 
+                        <el-date-picker clearable size="small" style="width: 200px"
+                            v-model="form.zfiExpireDate"
+                            type="date"
+                            value-format="yyyy-MM-dd"
+                            placeholder="选择承诺还款日">
+                        </el-date-picker>
+                    </el-form-item>
+                </el-col> 
             </el-row>
+            <el-row>
+                <el-col :span="8">
+                    <el-form-item label="金额大写" prop="issuedAmount"> 
+                         {{issuedAmount}}
+                    </el-form-item>
+                </el-col>  
+            </el-row>      
         </el-form>
         <div class="footer" style="float: right;
             margin-bottom:2px;">
-           <el-button type="primary" @click="submitForm">确 定</el-button>
+            <el-button type="primary" @click="submitForm">确 定</el-button>
             <el-button @click="cancel">取 消</el-button>
         </div>
+        <!-- 应付账款信息 -->
+        <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body>
+        <el-form :model="queryParamsPay"  ref="formQuery"  :inline="true"  label-width="68px"  style="margin-bottom: -21px">
+            <el-form-item label="账款名称" prop="zbiName">
+                <el-input
+                    v-model="queryParamsPay.zbiName"
+                    placeholder="请输入账款名称"
+                    clearable
+                    size="small"
+                    maxlength="11"
+                    @keyup.enter.native="handleQuerys"/>
+            </el-form-item>
+            <el-form-item label="应收企业" prop="receiveName">
+                <el-input
+                    v-model="queryParamsPay.receiveName"
+                    placeholder="请输入应收企业"
+                    clearable
+                    size="small"
+                    maxlength="11"
+                    @keyup.enter.native="handleQuerys"/>
+            </el-form-item>
+            <el-form-item>
+                <el-button
+                    type="cyan"
+                    icon="el-icon-search"
+                    size="mini"
+                    @click="handleQuerys"
+                    >搜索</el-button>
+                <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys"
+                    >重置</el-button>
+            </el-form-item>
+        </el-form>
+        <el-table :data="payList"
+            ref="tablePay"
+            class="single-select-table"
+            @selection-change="handleSelectionChange" 
+            :row-key="rowkey">
+            <el-table-column
+            type="selection"
+            :reserve-selection="true"
+            width="50"
+            align="center"/>
+            <el-table-column label="序号" type="index" width="50" align="center">
+            <template slot-scope="scope">
+                <span>{{ (queryParamsPay.pageNum - 1) * queryParamsPay.pageSize + scope.$index + 1}}</span>
+            </template>
+            </el-table-column>
+            <el-table-column label="账款名称"  align="center"  prop="zbiName" show-overflow-tooltip />
+            <el-table-column label="应收企业"  align="center"  prop="receiveName"/>
+            <el-table-column label="应付企业"  align="center"  prop="payName"    />
+            <el-table-column label="预计还款期"  align="center"  prop="zbiPayDate" show-overflow-tooltip />
+            <el-table-column label="金额"  align="center"  prop="zbiAmount" />
+        </el-table>
+        <pagination
+            v-show="total > 0"
+            :total="total"
+            :page.sync="queryParamsPay.pageNum"
+            :limit.sync="queryParamsPay.pageSize"
+            @pagination="getAccountsPay" />
+        <span slot="footer" class="dialog-footer">
+            <el-button size="mini" @click="cancelTicket">取消</el-button>
+            <el-button size="mini" type="primary" @click="closeTicket">确认</el-button>
+        </span>
+        </el-dialog>
   </div>
 </template>
 <script>
-import {listCreditLine} from "@/api/service/credit/credit";
+import {listCreditLine,getReceiverList,getAccountsPay,getAvailableBalance,addCredit} from "@/api/service/credit/credit";
 import {getRandom} from "@/api/common/getRandom";
+import {accAdd} from "@/utils/calculation";
 export default {
     name: "addCredit",
     components: {},
@@ -50,17 +207,99 @@ export default {
                 pageNum: 1,
                 pageSize: 10,
             },
+            creditParams: {
+                zfpcrId:null,
+                type:'1'
+            },
+            queryParamsPay: {
+                pageNum: 1,
+                pageSize: 10,
+                receiveName:null,
+                zbiName:null
+            },
             // 表单参数
             form: {
 
             },
             // 表单校验
             rules: {
+                //授信额度 
+                zfiCoreQuotaId: [
+                    {
+                        required: true,
+                        message: "请选择授信额度",
+                        trigger: ["blur", "change"],
+                    },
+                ],
+                //接收方
+                zfiSupplierId: [
+                    {
+                        required: true,
+                        message: "请选择接收方",
+                        trigger: ["blur", "change"],
+                    },
+                ],
+                //签发有效期
+                zfiEffectiveDate: [
+                    {
+                        required: true,
+                        message: "请选择签发有效期",
+                        trigger: ["blur", "change"],
+                    },
+                ],
+                //签发金额
+                zfiAmount: [
+                    {
+                        required: true,
+                        message: "请输入签发金额",
+                        trigger: ["blur", "change"],
+                    },
+                    {
+                        pattern: /^(?:0|[1-9]\d{0,8})(?:\.\d{1,2})?$/,
+                        message: "请输入正确的签发金额",
+                        trigger: ["blur", "change"],
+                    },
+                ],
+                //承诺还款日
+                zfiExpireDate: [
+                    {
+                        required: true,
+                        message: "请选择承诺还款日",
+                        trigger: ["blur", "change"],
+                    },
+                ],
                 
             },
+            // 是否显示弹出层
+            open: false,
            //授信
-           creditLineList:[]
-        
+           creditLineList:[],
+           //接收方
+           supplierList:[],
+           //应付账款
+           payList:[],
+           //应付账款表格数据
+           ticketList: [],
+           //应付标题
+           payTitle:"",
+           //可用额度
+           availableAmt:"0.00",
+           //有效期
+           validityDate:"",
+           //有效期类型
+           zfpcrDateType:"" ,
+           //合计选中的应付账款的金额
+           checkTotalAmt:"0.00",
+           //合计选中的应付账款的大写金额
+            checkTotalBigAmt:"零元整",
+            //签发金额大写
+            issuedAmount:"零元整",
+            //产品是否可拆分
+            zfpSplit:"",
+            //融资放款方式
+            zfpcrLoanType:"",
+            //产品编号
+            zfpId:""
         };
     },
     queryParams: {
@@ -68,19 +307,26 @@ export default {
        type:'00'
       },
     created() {
-
+        //获取当前公司
         getRandom().then((response) => {
              if(response.data){
-                 this.$set(this.form, "openName",response.data.createUserName);
+                 this.$set(this.form, "openName",response.data.companyName);
              }
         }),
         //获取授信额度
-        listCreditLine().then((response) => {
+        listCreditLine(this.creditParams).then((response) => {
             this.creditLineList = response.data.map(item => {
-                return { value: item.zfpcrId, label: item.zfpName};
+                return { value: item.zfpcrId, label: item.zfpName,zfpcrDateType:item.zfpcrDateType,zfpcrEndDate:item.zfpcrEndDate,zfpcrLoanType:item.zfpcrLoanType,zfpSplit:item.zfpSplit,zfpId:item.zfpId};
             }); 
         });
-        
+        //获取接收方
+         getReceiverList(null).then((response) => {
+            this.supplierList = response.data.records.map(item => {
+                return { value: item.scyId, label: item.scyName};
+            }); 
+        });
+        //签发金额
+        this.$set(this.form, "zfiAmount","0.00");
 
     },
     methods: {
@@ -99,29 +345,298 @@ export default {
         handle(){
             
         },
-    
-     
-        //新增
-        submitForm(){
-            this.$refs["form"].validate(valid => {
-                if (valid) {
-                const loading = this.$loading({
-                    lock: true,
-                    text: "Loading",
-                    spinner: "el-icon-loading",
-                    background: "rgba(0, 0, 0, 0.7)",
-                })
-              /*   addInf(this.form).then(response => {
-                    loading.close();
-                    this.msgSuccess("新增成功");
-                    this.$store.dispatch("tagsView/delView", this.$route);
-                    this.$router.go(-1);
-                }).catch((response)=>{
-                loading.close();
-                }); */
+        //应付账款查询列表
+        getAccountsPay() {
+            getAccountsPay(this.queryParamsPay).then((response) => {
+                this.payList = response.data.records;
+                this.selectChecked();
+                this.total = response.data.total;
+            });
+        },
+        resetQuerys() {
+            this.resetForm("formQuery");
+            this.handleQuerys();
+        },
+        handleQuerys() {
+            this.queryParamsPay.pageNum = 1;
+            this.getAccountsPay();
+        },
+        //打开应付账款选择列表
+        openTicket() {
+            this.getAccountsPay();
+            this.open = true;
+            this.payTitle = "应付账款";
+        },
+        //获取签发金额大写
+        getBigSmall(){
+            this.issuedAmount = this.smallToBig(this.form.zfiAmount);
+        },
+        selectChecked() {
+            this.ticketList.forEach((item) => {
+                this.payList.forEach(row => {
+                if (row.zbiId == item.zbiId) {
+                    this.$nextTick(() => {
+                    this.$refs.tablePay && this.$refs.tablePay.toggleRowSelection(row, true);
+                    })
                 }
+                });
             });
+             //合计
+            this.getReTotal(this.ticketList);
         },
+        /* 多选框跨页 */
+        rowkey(row) {
+            return row.zbiId;
+        },
+        // 多选框选中数据
+        handleSelectionChange(val) {
+            this.chooseTicket = val
+        },
+        // 确认选择
+      closeTicket() {
+        if(this.chooseTicket){
+                //如果长度大于1,则需要进行对比应收企业和预计还款日期是否一致
+                if(this.chooseTicket.length > 1){
+                    //获取选中第一个的应收企业
+                    var receiveName = this.chooseTicket[0].receiveName;
+                    //获取选中第一个的预计还款日期
+                    var zbiPayDate = this.chooseTicket[0].zbiPayDate;
+                    for(var i = 0 ;i < this.chooseTicket.length;i++){
+                        if(receiveName != this.chooseTicket[i].receiveName){
+                                this.$message({
+                                    message: '请选择应收企业相同的应付账款',
+                                    type: 'warning'
+                                });
+                                return;
+                        }
+                        if(zbiPayDate != this.chooseTicket[i].zbiPayDate){
+                                this.$message({
+                                    message: '请选择预计还款日期相同的应付账款',
+                                    type: 'warning'
+                                });
+                                return;
+                        }
+                    }
+                }
+                //合计
+                this.getReTotal(this.chooseTicket);
+                this.ticketList = this.chooseTicket;
+                this.open = false;
+        }else{
+            this.$message({
+            message: '请选择应付账款',
+            type: 'warning'
+            });
+        }
+    },
+
+    //重新合计
+    getReTotal(chooseTicket){
+                 //合计
+                this.checkTotalAmt = "0.00";
+                for(var i = 0; i < chooseTicket.length;i++){
+                        this.checkTotalAmt  = accAdd(this.checkTotalAmt,chooseTicket[i].zbiAmount,2);
+                }
+                //签发金额
+                this.$set(this.form, "zfiAmount",this.checkTotalAmt);
+                //签发金额大写
+                this.issuedAmount = this.smallToBig(this.checkTotalAmt);
+                this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
+                this.checkTotalAmt = this.amtFormat(this.checkTotalAmt);
+    },
+    //取消选择按钮
+    cancelTicket(){
+        this.ticketList = [];
+        if(this.$refs.tablePay){
+            this.$refs.tablePay.clearSelection();
+        }
+        this.open = false;
+    },
+    /** 清空选择信息 */
+    deleteTicekt() {
+        this.ticketList = [];
+        this.checkTotalAmt = "0.00";
+        this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
+        //签发金额
+        this.$set(this.form, "zfiAmount","0.00");
+        this.issuedAmount = this.smallToBig(this.checkTotalAmt);
+        if(this.$refs.tablePay){
+            this.$refs.tablePay.clearSelection();
+        }
+    },
+    /* 删除按钮 */
+    handleDelete(index, rows) {
+        rows.splice(index, 1);
+        if(this.$refs.tablePay){
+            this.$refs.tablePay.clearSelection();
+        }
+        this.selectChecked();
+    },
+    onSelectAll() {
+        if(this.$refs.tablePay){
+            this.$refs.tablePay.clearSelection();
+        }
+    },
+    //选择授信触发
+    change(val) {
+       if (!val) {
+            //可用额度
+            this.availableAmt = "0.00";
+            //有效期
+            this.validityDate ="";
+            //产品是否可拆分
+            this.zfpSplit= "",
+            //融资放款方式
+            this.zfpcrLoanType = "";
+            //产品
+            this.zfpId = "";
+            return;
+        }
+        let obj = {};
+        obj = this.creditLineList.find(item => {
+            return item.value === val;
+        });
+        //获取有效期的类型
+         this.zfpcrDateType = obj.zfpcrDateType;
+         //产品是否可拆分
+        this.zfpSplit= obj.zfpSplit;
+        //放款方式
+        this.zfpcrLoanType = obj.zfpcrLoanType;
+        //产品
+         this.zfpId = obj.zfpId;
+        //长期
+        if("0"== this.zfpcrDateType){
+            this.validityDate = "长期";
+        }else{
+             this.validityDate = obj.zfpcrEndDate;
+        }
+        var lineQueryParam = {};
+        lineQueryParam.zfpcrId = val;
+        //获取可用额度
+        getAvailableBalance(lineQueryParam).then((response) => {
+             this.availableAmt = response.data.remaining;
+        });
+    },
+    //格式化金额 
+    amtFormat(cellValue) {
+      if(cellValue == null || cellValue== undefined || cellValue == ''){
+      cellValue = '0.00'
+      }
+      cellValue += '';
+            if (!cellValue.includes('.')) {
+      cellValue += '.00';
+      }
+      console.log(cellValue);
+            return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
+              return $1 + ',';
+            }).replace(/\.$/, '');
+    },
+     /* //  将数字金额转换为大写金额 */
+    smallToBig(money) {
+      //  将数字金额转换为大写金额
+      var cnNums = new Array(
+        "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" ); //汉字的数字
+      var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
+      var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
+      var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
+      var cnInteger = "整"; //整数金额时后面跟的字符
+      var cnIntLast = "元"; //整数完以后的单位
+      //最大处理的数字
+      var maxNum = 999999999999999.9999;
+      var integerNum; //金额整数部分
+      var decimalNum; //金额小数部分
+      //输出的中文金额字符串
+      var chineseStr = "";
+      var parts; //分离金额后用的数组,预定义
+      if (money == "" || money == null || money == undefined) {
+        return "零元零角零分";
+      }
+      money = parseFloat(money);
+      if (money >= maxNum) {
+        //超出最大处理数字
+        return "超出最大处理数字";
+      }
+      if (money == 0) {
+        chineseStr = cnNums[0] + cnIntLast + cnInteger;
+        return chineseStr;
+      }
+      //四舍五入保留两位小数,转换为字符串
+      money = Math.round(money * 100).toString();
+      integerNum = money.substr(0, money.length - 2);
+      decimalNum = money.substr(money.length - 2);
+      //获取整型部分转换
+      if (parseInt(integerNum, 10) > 0) {
+        var zeroCount = 0;
+        var IntLen = integerNum.length;
+        for (var i = 0; i < IntLen; i++) {
+          var n = integerNum.substr(i, 1);
+          var p = IntLen - i - 1;
+          var q = p / 4;
+          var m = p % 4;
+          if (n == "0") {
+            zeroCount++;
+          } else {
+            if (zeroCount > 0) {
+              chineseStr += cnNums[0];
+            }
+            //归零
+            zeroCount = 0;
+            chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
+          }
+          if (m == 0 && zeroCount < 4) {
+            chineseStr += cnIntUnits[q];
+          }
+        }
+        chineseStr += cnIntLast;
+      }
+      //小数部分
+      if (decimalNum != "") {
+        var decLen = decimalNum.length;
+        for (var i = 0; i < decLen; i++) {
+          var n = decimalNum.substr(i, 1);
+          if (n != "0") {
+            chineseStr += cnNums[Number(n)] + cnDecUnits[i];
+          }
+        }
+      }
+      if (chineseStr == "") {
+        chineseStr += cnNums[0] + cnIntLast + cnInteger;
+      } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
+        chineseStr += cnInteger;
+      }
+      return chineseStr;
+    },
+    //新增
+    submitForm(){
+        this.$refs["form"].validate(valid => {
+            if (valid) {
+            const loading = this.$loading({
+                lock: true,
+                text: "Loading",
+                spinner: "el-icon-loading",
+                background: "rgba(0, 0, 0, 0.7)",
+            })
+            //应付账款
+            this.form.ticketList = this.ticketList;
+            //产品是否可拆分
+            this.form.zfpSplit = this.zfpSplit;
+            //放款方式
+            this.form.zfpcrLoanType = this.zfpcrLoanType;
+            //融信类型
+            this.form.type = "00";
+            //产品
+            this.form.zfpId = this.zfpId;
+            addCredit(this.form).then(response => {
+                loading.close();
+                this.msgSuccess("新增成功");
+                this.$store.dispatch("tagsView/delView", this.$route);
+                this.$router.go(-1);
+            }).catch((response)=>{
+            loading.close();
+            });
+            }
+        });
+    },
        
     }
 };

+ 36 - 20
front-vue/src/views/service/credit/credit.vue

@@ -11,9 +11,9 @@
           </div>
           <hr  style="margin-top: 16px;">
           <el-form :model="queryParams" ref="queryForm" :inline="true" v-if="showSearch" label-width="68px">
-              <el-form-item label="融信编码" prop="zfiId">
+              <el-form-item label="融信编码" prop="zfiNumber">
                   <el-input
-                  v-model.trim="queryParams.zfiId"
+                  v-model.trim="queryParams.zfiNumber"
                   placeholder="请输入融信编码"
                   clearable
                   size="small"
@@ -126,15 +126,16 @@
           <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
         </template>
       </el-table-column>
-      <el-table-column label="融信编号" align="center" prop="zfiQuotaId" v-if="uncheckList.zfiQuotaId" :show-overflow-tooltip="true"/>
+      <el-table-column label="融信编号" align="center" prop="zfiNumber" v-if="uncheckList.zfiNumber" :show-overflow-tooltip="true"/>
       <el-table-column label="开立方"  align="center" prop="openName"  v-if="uncheckList.openName" :show-overflow-tooltip="true"/>
       <el-table-column label="接收方"  align="center" prop="receiveName"  v-if="uncheckList.receiveName" :show-overflow-tooltip="true"/>
       <el-table-column label="融信类型"  align="center" prop="zfiCreateType"  v-if="uncheckList.zfiCreateType" :show-overflow-tooltip="true"/>
       <el-table-column label="融信产品" align="center" prop="zfpName"   v-if="uncheckList.zfpName" :show-overflow-tooltip="true"/>
       <el-table-column label="融信金额" align="center" :formatter="moneyFormat" prop="zfiAmount" :show-overflow-tooltip="true" v-if="uncheckList.zfiAmount"/>
       <el-table-column label="融信利率" align="center"  prop="zfpcrRate" :show-overflow-tooltip="true" v-if="uncheckList.zfpcrRate"/>
-      <el-table-column label="签收日期" align="center" prop="zfiSignDate" :show-overflow-tooltip="true" v-if="uncheckList.zfiSignDate"/>
+      <el-table-column label="签发有效期" align="center" prop="zfiEffectiveDate" :show-overflow-tooltip="true" v-if="uncheckList.zfiEffectiveDate"/>
       <el-table-column label="承诺还款日" align="center" prop="zfiExpireDate" :show-overflow-tooltip="true" v-if="uncheckList.zfiExpireDate"/>
+      <el-table-column label="签收日期" align="center" prop="zfiSignDate" :show-overflow-tooltip="true" v-if="uncheckList.zfiSignDate"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
         <template slot-scope="scope">
           <el-button
@@ -142,16 +143,15 @@
             type="text"
             icon="el-icon-view"
             @click="handleDetail(scope.row)"
-            v-hasPermi="['invoice:invoice:query']"
+            v-hasPermi="['credit:credit:query']"
           >详情</el-button>
-          <el-button
-            :disabled="!scope.row.ziiFile"
-            style="font-size:12px"
+           <el-button
+            size="mini"
             type="text"
-            icon="el-icon-download"
-            @click="handleDownload(scope.row)"
-            v-hasPermi="['invoice:invoice:download']"
-          >下载</el-button>
+            icon="el-icon-view"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['credit:credit:update']"
+          >修改</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -201,10 +201,10 @@ export default {
       //结束金额
       endAmt:undefined,
       // 查询参数
-      queryParams: {
+      queryParams:{
        pageNum: 1,
         pageSize: 10,
-        zfiId: null,
+        zfiNumber: null,
         zfiStatus:null,
         openCompany:null,
         receiveCompany:null,
@@ -223,7 +223,7 @@ export default {
       //筛选按钮的数据列表,与table表头的数据一致 --显示隐藏列用
       tableList: [
             {
-              label: 'zfiQuotaId',
+              label: 'zfiNumber',
               value: '融信编号'
             },
             {
@@ -251,12 +251,16 @@ export default {
               value: '融信利率'
             },
             {
-              label: 'zfiSignDate',
-              value: '签收日期'
+              label: 'zfiEffectiveDate',
+              value: '签发有效期'
             },
             {
               label: 'zfiExpireDate',
               value: '承诺还款日'
+            },
+            {
+              label: 'zfiSignDate',
+              value: '签收日期'
             }
             ],
       checkList: [],//筛选列选中的数据列表--显示隐藏列用
@@ -310,7 +314,7 @@ export default {
     // 表单重置
     reset() {
       this.form = {
-        zfiId: null,
+        zfiNumber: null,
         zfiStatus:null,
         openCompany:null,
         receiveCompany:null,
@@ -344,8 +348,20 @@ export default {
     /** 新增按钮操作 */
     handleAdd() {
         this.reset();
-        Cookies.set("/service/credit/addCredit/", this.$route.fullPath);
-        this.$router.push({ path: "/service/credit/addCredit/" });
+        Cookies.set("/credit/addCredit/", this.$route.fullPath);
+        this.$router.push({ path: "/credit/addCredit/" });
+    },
+    //详情
+    handleDetail(row){
+          const zfiId = row.zfiId || this.ids
+          Cookies.set("/credit/creditDetail/"+zfiId + "/", this.$route.fullPath)
+          this.$router.push({ path: "/credit/creditDetail/"+zfiId + "/" });
+    },
+    //修改
+    handleUpdate(row){
+          const zfiId = row.zfiId || this.ids
+          Cookies.set("/credit/creditUpdate/"+zfiId + "/", this.$route.fullPath)
+          this.$router.push({ path: "/credit/creditUpdate/"+zfiId + "/" });
     },
     //列表格式化金额
     moneyFormat(row, column, cellValue) {

+ 262 - 0
front-vue/src/views/service/credit/creditDetail.vue

@@ -0,0 +1,262 @@
+<template>
+    <div class="app-container">
+        <el-form ref="form" :model="form"  disabled :rules="rules" :inline="true" style="margin-top: 20px" label-width="auto" >
+            <el-divider content-position="left">融信详情</el-divider>
+            <el-row>
+                <el-col :span="8">
+                        <el-form-item label="融信编号" prop="zfiNumber">
+                            <el-input v-model="form.zfiNumber" style="width: 200px"/>
+                        </el-form-item>
+                </el-col> 
+                <el-col :span="8">
+                        <el-form-item label="创建时间" prop="createTime">
+                            <el-input v-model="form.createTime" style="width: 200px"/>
+                        </el-form-item>
+                </el-col> 
+                <el-col :span="8">
+                        <el-form-item label="创建人" prop="createName">
+                            <el-input v-model="form.createName" style="width: 200px"/>
+                        </el-form-item>
+                </el-col> 
+                <el-col :span="8">
+                        <el-form-item label="开立方" prop="openName">
+                            <el-input v-model="form.openName" style="width: 200px"/>
+                        </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <el-form-item label="接收方" prop="receiveName">
+                        <el-input v-model="form.receiveName" style="width: 200px"/>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <el-form-item label="授信额度" prop="zfpName">
+                         <el-input v-model="form.zfpName" style="width: 200px"/>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-row>
+                <el-col :span="8">
+                    <el-form-item label="签发有效期" prop="zfiEffectiveDate"> 
+                        <el-input v-model="form.zfiEffectiveDate" style="width: 200px"/>
+                    </el-form-item>
+                </el-col> 
+                <el-col :span="8">
+                    <el-form-item label="承诺还款日" prop="zfiExpireDate"> 
+                        <el-input v-model="form.zfiExpireDate" style="width: 200px"/>
+                    </el-form-item>
+                </el-col> 
+            </el-row>  
+            <el-divider content-position="left" >应付账款</el-divider>
+            <el-form-item  style="margin-left: 100px">
+                <el-form-item label="合计金额:"> 
+                        <span>{{checkTotalAmt}}</span>
+                </el-form-item>
+                <el-form-item label="金额大写:"> 
+                        <span>{{checkTotalBigAmt}}</span>
+                </el-form-item>
+                
+                <el-table :data="payList" style="width: 1100px">
+                    <el-table-column label="账款名称"  align="center"  prop="zbiName" show-overflow-tooltip />
+                    <el-table-column label="应收企业"  align="center"  prop="receiveName"/>
+                    <el-table-column label="应付企业"  align="center"  prop="payName"    />
+                    <el-table-column label="预计还款期"  align="center"  prop="zbiPayDate" show-overflow-tooltip />
+                    <el-table-column label="金额"  align="center"  prop="zbiAmount" />
+                </el-table>
+            </el-form-item>
+            <el-row>
+                <el-col :span="8">
+                    <el-form-item label="签发金额" prop="zfiAmount"> 
+                         <el-input v-model="form.zfiAmount" style="width: 200px"/>
+                    </el-form-item>
+                </el-col> 
+             
+            </el-row>
+            <el-row>
+                <el-col :span="8">
+                    <el-form-item label="金额大写" prop="issuedAmount"> 
+                         {{issuedAmount}}
+                    </el-form-item>
+                </el-col>  
+            </el-row>      
+        </el-form>
+        <div class="footer" style="float: right;
+            margin-bottom:2px;">
+            <el-button @click="cancel">取 消</el-button>
+        </div>
+  </div>
+</template>
+<script>
+import {getCreditDetail} from "@/api/service/credit/credit";
+import {accAdd} from "@/utils/calculation";
+export default {
+    name: "addCredit",
+    components: {},
+    data() {
+        return {
+            // 总条数
+            total: 0,
+            // 表单参数
+            form: {
+
+            },
+            // 表单校验
+            rules: {
+            },
+            // 是否显示弹出层
+            open: false,
+           //应付账款
+           payList:[],
+           //签发金额大写
+           issuedAmount:"零元整",
+           //合计选中的应付账款的金额
+           checkTotalAmt:"0.00",
+           //合计选中的应付账款的大写金额
+            checkTotalBigAmt:"零元整"
+        };
+    },
+    created() {
+         const zfiId = this.$route.params && this.$route.params.zfiId;
+         getCreditDetail(zfiId).then((response) => {
+             if(response.data.creditList.records){
+                 this.form = response.data.creditList.records[0];
+                  //签发金额大写
+                this.issuedAmount = this.smallToBig(this.form.zfiAmount);
+             }
+             if(response.data.payList){
+                 this.payList = response.data.payList.records;
+                 this.getReTotal(this.payList);
+             }
+             
+        })
+    },
+    methods: {
+
+        // 取消按钮
+        cancel() {
+            this.$store.dispatch("tagsView/delView", this.$route);
+            this.$router.go(-1);
+        },
+         /* 多选框跨页 */
+        rowkeyCustomer(row) {
+            return row.cciId;
+        },
+        //重新合计
+        getReTotal(chooseTicket){
+                 //合计
+                this.checkTotalAmt = "0.00";
+                for(var i = 0; i < chooseTicket.length;i++){
+                        this.checkTotalAmt  = accAdd(this.checkTotalAmt,chooseTicket[i].zbiAmount,2);
+                }
+                this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
+                this.checkTotalAmt = this.amtFormat(this.checkTotalAmt);
+    },
+    //格式化金额 
+    amtFormat(cellValue) {
+      if(cellValue == null || cellValue== undefined || cellValue == ''){
+      cellValue = '0.00'
+      }
+      cellValue += '';
+            if (!cellValue.includes('.')) {
+      cellValue += '.00';
+      }
+      return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
+        return $1 + ',';
+      }).replace(/\.$/, '');
+    },
+     /* //  将数字金额转换为大写金额 */
+    smallToBig(money) {
+      //  将数字金额转换为大写金额
+      var cnNums = new Array(
+        "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" ); //汉字的数字
+      var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
+      var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
+      var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
+      var cnInteger = "整"; //整数金额时后面跟的字符
+      var cnIntLast = "元"; //整数完以后的单位
+      //最大处理的数字
+      var maxNum = 999999999999999.9999;
+      var integerNum; //金额整数部分
+      var decimalNum; //金额小数部分
+      //输出的中文金额字符串
+      var chineseStr = "";
+      var parts; //分离金额后用的数组,预定义
+      if (money == "" || money == null || money == undefined) {
+        return "零元零角零分";
+      }
+      money = parseFloat(money);
+      if (money >= maxNum) {
+        //超出最大处理数字
+        return "超出最大处理数字";
+      }
+      if (money == 0) {
+        chineseStr = cnNums[0] + cnIntLast + cnInteger;
+        return chineseStr;
+      }
+      //四舍五入保留两位小数,转换为字符串
+      money = Math.round(money * 100).toString();
+      integerNum = money.substr(0, money.length - 2);
+      decimalNum = money.substr(money.length - 2);
+      //获取整型部分转换
+      if (parseInt(integerNum, 10) > 0) {
+        var zeroCount = 0;
+        var IntLen = integerNum.length;
+        for (var i = 0; i < IntLen; i++) {
+          var n = integerNum.substr(i, 1);
+          var p = IntLen - i - 1;
+          var q = p / 4;
+          var m = p % 4;
+          if (n == "0") {
+            zeroCount++;
+          } else {
+            if (zeroCount > 0) {
+              chineseStr += cnNums[0];
+            }
+            //归零
+            zeroCount = 0;
+            chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
+          }
+          if (m == 0 && zeroCount < 4) {
+            chineseStr += cnIntUnits[q];
+          }
+        }
+        chineseStr += cnIntLast;
+      }
+      //小数部分
+      if (decimalNum != "") {
+        var decLen = decimalNum.length;
+        for (var i = 0; i < decLen; i++) {
+          var n = decimalNum.substr(i, 1);
+          if (n != "0") {
+            chineseStr += cnNums[Number(n)] + cnDecUnits[i];
+          }
+        }
+      }
+      if (chineseStr == "") {
+        chineseStr += cnNums[0] + cnIntLast + cnInteger;
+      } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
+        chineseStr += cnInteger;
+      }
+      return chineseStr;
+    }
+       
+    }
+};
+</script>
+
+<style lang="scss">
+
+.uoloadfj .el-upload--picture-card{
+  width:110px;
+  height:110px;
+  line-height:110px;
+}
+.fjUoloadSty .el-upload--picture-card{
+  display:none;   
+}
+
+table th.star div::before {
+    content: '*';
+    color: red;
+}
+
+</style>

+ 637 - 0
front-vue/src/views/service/credit/creditUpdate.vue

@@ -0,0 +1,637 @@
+<template>
+    <div class="app-container">
+        <el-form ref="form" :model="form"  :rules="rules" :inline="true" style="margin-top: 20px" label-width="auto" >
+            <el-divider content-position="left">融信修改</el-divider>
+            <el-row>
+                <el-col :span="8">
+                        <el-form-item label="融信编号" prop="zfiNumber">
+                            <el-input v-model="form.zfiNumber" style="width: 200px" disabled/>
+                        </el-form-item>
+                </el-col> 
+                <el-col :span="8">
+                        <el-form-item label="创建时间" prop="createTime">
+                            <el-input v-model="form.createTime" style="width: 200px" disabled/>
+                        </el-form-item>
+                </el-col> 
+                <el-col :span="8">
+                        <el-form-item label="创建人" prop="createName">
+                            <el-input v-model="form.createName" style="width: 200px" disabled/>
+                        </el-form-item>
+                </el-col> 
+                <el-col :span="8">
+                        <el-form-item label="开立方" prop="openName">
+                            <el-input v-model="form.openName" style="width: 200px" disabled/>
+                        </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <el-form-item label="接收方" prop="zfiSupplierId">
+                        <el-select
+                            style="width: 200px"
+                            v-model="form.zfiSupplierId"
+                            filterable
+                            clearable
+                            remote
+                            >
+                            <el-option
+                            v-for="item in supplierList"
+                            :key="item.value"
+                            :label="item.label"
+                            :value="item.value">
+                            </el-option>
+                            </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <el-form-item label="签发有效期" prop="zfiEffectiveDate"> 
+                        <el-date-picker clearable size="small" style="width: 200px"
+                            v-model="form.zfiEffectiveDate"
+                            type="date"
+                            value-format="yyyy-MM-dd"
+                            placeholder="选择签发有效期">
+                        </el-date-picker>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-row>
+                <el-col :span="8">
+                    <el-form-item label="承诺还款日" prop="zfiExpireDate"> 
+                        <el-date-picker clearable size="small" style="width: 200px"
+                            v-model="form.zfiExpireDate"
+                            type="date"
+                            value-format="yyyy-MM-dd"
+                            placeholder="选择承诺还款日">
+                        </el-date-picker>
+                    </el-form-item>
+                </el-col> 
+                <el-col :span="8">
+                    <el-form-item label="授信额度" prop="zfiCoreQuotaId">
+                        <el-select
+                            style="width: 200px"
+                            v-model="form.zfiCoreQuotaId"
+                            filterable
+                            clearable
+                            remote
+                            >
+                            <el-option
+                            v-for="item in creditLineList"
+                            :key="item.value"
+                            :label="item.label"
+                            :value="item.value">
+                            </el-option>
+                            </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <span>可用额度:</span>
+                    <span>{{availableAmt}}</span>
+                    <br>   
+                    <span>有效期:</span>
+                    <span>{{validityDate}}</span>  
+                </el-col>
+            </el-row>  
+            <el-divider content-position="left" >应付账款</el-divider>
+            <el-form-item  style="margin-left: 100px">
+                 <el-button size="mini" type="primary" @click="openTicket">选择</el-button>
+                 <el-button size="mini" @click="deleteTicekt">清空全部</el-button>
+                <el-form-item label="合计金额:"> 
+                        <span>{{checkTotalAmt}}</span>
+                </el-form-item>
+                <el-form-item label="金额大写:"> 
+                        <span>{{checkTotalBigAmt}}</span>
+                </el-form-item>
+                
+                <el-table :data="ticketList" style="width: 1100px">
+                    <el-table-column label="账款名称"  align="center"  prop="zbiName" show-overflow-tooltip />
+                    <el-table-column label="应收企业"  align="center"  prop="receiveName"/>
+                    <el-table-column label="应付企业"  align="center"  prop="payName"    />
+                    <el-table-column label="预计还款期"  align="center"  prop="zbiPayDate" show-overflow-tooltip />
+                    <el-table-column label="金额"  align="center"  prop="zbiAmount" />
+                    <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
+                        <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-delete"
+                            @click="handleDelete(scope.$index, ticketList)"
+                        >删除</el-button>
+                        </template>
+                    </el-table-column>
+                </el-table>
+            </el-form-item>
+            <el-row>
+                <el-col :span="8">
+                    <el-form-item label="签发金额" prop="zfiAmount"> 
+                         <el-input v-model="form.zfiAmount" style="width: 200px" @input="getBigSmall"/>
+                    </el-form-item>
+                </el-col> 
+             
+            </el-row>
+            <el-row>
+                <el-col :span="8">
+                    <el-form-item label="金额大写" prop="issuedAmount"> 
+                         {{issuedAmount}}
+                    </el-form-item>
+                </el-col>  
+            </el-row>      
+        </el-form>
+        <div class="footer" style="float: right;
+            margin-bottom:2px;">
+            <el-button type="primary" @click="submitForm">确 定</el-button>
+            <el-button @click="cancel">取 消</el-button>
+        </div>
+           <!-- 应付账款信息 -->
+        <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body>
+        <el-form :model="queryParamsPay"  ref="formQuery"  :inline="true"  label-width="68px"  style="margin-bottom: -21px">
+            <el-form-item label="账款名称" prop="zbiName">
+                <el-input
+                    v-model="queryParamsPay.zbiName"
+                    placeholder="请输入账款名称"
+                    clearable
+                    size="small"
+                    maxlength="11"
+                    @keyup.enter.native="handleQuerys"/>
+            </el-form-item>
+            <el-form-item label="应收企业" prop="receiveName">
+                <el-input
+                    v-model="queryParamsPay.receiveName"
+                    placeholder="请输入应收企业"
+                    clearable
+                    size="small"
+                    maxlength="11"
+                    @keyup.enter.native="handleQuerys"/>
+            </el-form-item>
+            <el-form-item>
+                <el-button
+                    type="cyan"
+                    icon="el-icon-search"
+                    size="mini"
+                    @click="handleQuerys"
+                    >搜索</el-button>
+                <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys"
+                    >重置</el-button>
+            </el-form-item>
+        </el-form>
+        <el-table :data="payList"
+            ref="tablePay"
+            class="single-select-table"
+            @selection-change="handleSelectionChange" 
+            :row-key="rowkey">
+            <el-table-column
+            type="selection"
+            :reserve-selection="true"
+            width="50"
+            align="center"/>
+            <el-table-column label="序号" type="index" width="50" align="center">
+            <template slot-scope="scope">
+                <span>{{ (queryParamsPay.pageNum - 1) * queryParamsPay.pageSize + scope.$index + 1}}</span>
+            </template>
+            </el-table-column>
+            <el-table-column label="账款名称"  align="center"  prop="zbiName" show-overflow-tooltip />
+            <el-table-column label="应收企业"  align="center"  prop="receiveName"/>
+            <el-table-column label="应付企业"  align="center"  prop="payName"    />
+            <el-table-column label="预计还款期"  align="center"  prop="zbiPayDate" show-overflow-tooltip />
+            <el-table-column label="金额"  align="center"  prop="zbiAmount" />
+        </el-table>
+        <pagination
+            v-show="total > 0"
+            :total="total"
+            :page.sync="queryParamsPay.pageNum"
+            :limit.sync="queryParamsPay.pageSize"
+            @pagination="getAccountsPay" />
+        <span slot="footer" class="dialog-footer">
+            <el-button size="mini" @click="cancelTicket">取消</el-button>
+            <el-button size="mini" type="primary" @click="closeTicket">确认</el-button>
+        </span>
+        </el-dialog>
+  </div>
+</template>
+<script>
+import {getCreditDetail,getReceiverList,listCreditLine,getAvailableBalance,getAccountsPay,updateCredit} from "@/api/service/credit/credit";
+import {accAdd} from "@/utils/calculation";
+export default {
+    name: "addCredit",
+    components: {},
+    data() {
+        return {
+            // 总条数
+            total: 0,
+            // 表单参数
+            form: {
+
+            },
+            // 表单校验
+            rules: {
+            },
+            // 是否显示弹出层
+            open: false,
+           //选择的应付账款
+           payList:[],
+           //现有的应付账款
+           ticketList:[],
+           //签发金额大写
+           issuedAmount:"零元整",
+           //合计选中的应付账款的金额
+           checkTotalAmt:"0.00",
+           //合计选中的应付账款的大写金额
+           checkTotalBigAmt:"零元整",
+           //接收方
+          supplierList:[],
+          supplierForm:{},
+          queryParamsPay: {
+                pageNum: 1,
+                pageSize: 10,
+                receiveName:null,
+                zbiName:null
+            },
+          //授信额度
+          creditLineList:[],
+          //可用额度
+          availableAmt:"0.00",
+          //有效期
+          validityDate:"",
+          //有效期类型
+          zfpcrDateType:"" ,
+          //产品是否可拆分
+          zfpSplit:"",
+          //融资放款方式
+          zfpcrLoanType:"",
+          //产品编号
+          zfpId:"",
+          //标题
+          payTitle:"",
+          //授信额度
+          creditParams: {
+                zfpcrId:null,
+                type:'1'
+            },
+        };
+    },
+    watch:{
+        'form.zfiCoreQuotaId':'change'
+    },
+    created() {
+         const zfiId = this.$route.params && this.$route.params.zfiId;
+         getCreditDetail(zfiId).then((response) => {
+             if(response.data.creditList.records){
+                this.form = response.data.creditList.records[0];
+                  //签发金额大写
+                this.issuedAmount = this.smallToBig(this.form.zfiAmount);
+                //接收方编号
+                this.supplierForm.zfiSupplierId = this.form.zfiSupplierId;
+                getReceiverList(this.supplierForm).then((response) => {
+                  this.supplierList = response.data.records.map(item => {
+                      return { value: item.scyId, label: item.scyName};
+                  }); 
+                });
+                //授信额度
+                this.listCreditLine();
+             }
+             if(response.data.payList){
+                 this.ticketList = response.data.payList.records;
+                 this.getReTotal(this.ticketList);
+             }
+             
+        })
+    },
+    methods: {
+        // 取消按钮
+        cancel() {
+            this.$store.dispatch("tagsView/delView", this.$route);
+            this.$router.go(-1);
+        },
+         /* 多选框跨页 */
+        rowkeyCustomer(row) {
+            return row.cciId;
+        },
+        //重新合计
+        getReTotal(chooseTicket){
+                 //合计
+                this.checkTotalAmt = "0.00";
+                for(var i = 0; i < chooseTicket.length;i++){
+                        this.checkTotalAmt  = accAdd(this.checkTotalAmt,chooseTicket[i].zbiAmount,2);
+                }
+                this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
+                this.checkTotalAmt = this.amtFormat(this.checkTotalAmt);
+        },
+        resetQuerys() {
+            this.resetForm("formQuery");
+            this.handleQuerys();
+        },
+        handleQuerys() {
+            this.queryParamsPay.pageNum = 1;
+            this.getAccountsPay();
+        },
+        //打开应付账款选择列表
+        openTicket() {
+            this.getAccountsPay();
+            this.open = true;
+            this.payTitle = "应付账款";
+        },
+        //授信额度
+        listCreditLine(){
+              this.creditParams.zfpcrId = this.form.zfiCoreQuotaId;
+              listCreditLine(this.creditParams).then((response) => {
+                this.creditLineList = response.data.map(item => {
+                    return { value: item.zfpcrId, label: item.zfpName,zfpcrDateType:item.zfpcrDateType,zfpcrEndDate:item.zfpcrEndDate,zfpcrLoanType:item.zfpcrLoanType,zfpSplit:item.zfpSplit,zfpId:item.zfpId};
+                }); 
+              });
+        },       
+        //应付账款查询列表
+        getAccountsPay() {
+            getAccountsPay(this.queryParamsPay).then((response) => {
+                this.payList = response.data.records;
+                this.selectChecked();
+                this.total = response.data.total;
+            });
+        },
+        selectChecked() {
+            this.ticketList.forEach((item) => {
+                this.payList.forEach(row => {
+                if (row.zbiId == item.zbiId) {
+                    this.$nextTick(() => {
+                    this.$refs.tablePay && this.$refs.tablePay.toggleRowSelection(row, true);
+                    })
+                }
+                });
+            });
+             //合计
+            this.getReTotal(this.ticketList);
+        },
+        /* 删除按钮 */
+        handleDelete(index, rows) {
+            rows.splice(index, 1);
+            if(this.$refs.tablePay){
+                this.$refs.tablePay.clearSelection();
+            }
+            this.selectChecked();
+        },
+        /* 多选框跨页 */
+        rowkey(row) {
+            return row.zbiId;
+        },
+        // 多选框选中数据
+        handleSelectionChange(val) {
+            this.chooseTicket = val
+        },
+        // 确认选择
+      closeTicket() {
+        if(this.chooseTicket){
+                //如果长度大于1,则需要进行对比应收企业和预计还款日期是否一致
+                if(this.chooseTicket.length > 1){
+                    //获取选中第一个的应收企业
+                    var receiveName = this.chooseTicket[0].receiveName;
+                    //获取选中第一个的预计还款日期
+                    var zbiPayDate = this.chooseTicket[0].zbiPayDate;
+                    for(var i = 0 ;i < this.chooseTicket.length;i++){
+                        if(receiveName != this.chooseTicket[i].receiveName){
+                                this.$message({
+                                    message: '请选择应收企业相同的应付账款',
+                                    type: 'warning'
+                                });
+                                return;
+                        }
+                        if(zbiPayDate != this.chooseTicket[i].zbiPayDate){
+                                this.$message({
+                                    message: '请选择预计还款日期相同的应付账款',
+                                    type: 'warning'
+                                });
+                                return;
+                        }
+                    }
+                }
+                //合计
+                this.getReTotal(this.chooseTicket);
+                this.ticketList = this.chooseTicket;
+                this.open = false;
+        }else{
+            this.$message({
+            message: '请选择应付账款',
+            type: 'warning'
+            });
+        }
+    },
+      //重新合计
+    getReTotal(chooseTicket){
+                      //合计
+                      this.checkTotalAmt = "0.00";
+                      for(var i = 0; i < chooseTicket.length;i++){
+                              this.checkTotalAmt  = accAdd(this.checkTotalAmt,chooseTicket[i].zbiAmount,2);
+                      }
+                      this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
+                      this.checkTotalAmt = this.amtFormat(this.checkTotalAmt);
+      },
+    //取消选择按钮
+    cancelTicket(){
+        this.ticketList = [];
+        if(this.$refs.tablePay){
+            this.$refs.tablePay.clearSelection();
+        }
+        this.open = false;
+    },
+    /** 清空选择信息 */
+    deleteTicekt() {
+        this.ticketList = [];
+        this.checkTotalAmt = "0.00";
+        this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
+        if(this.$refs.tablePay){
+            this.$refs.tablePay.clearSelection();
+        }
+    },
+    /* 删除按钮 */
+    handleDelete(index, rows) {
+        rows.splice(index, 1);
+        if(this.$refs.tablePay){
+            this.$refs.tablePay.clearSelection();
+        }
+        this.selectChecked();
+    },
+    onSelectAll() {
+        if(this.$refs.tablePay){
+            this.$refs.tablePay.clearSelection();
+        }
+    },
+    //格式化金额 
+    amtFormat(cellValue) {
+      if(cellValue == null || cellValue== undefined || cellValue == ''){
+      cellValue = '0.00'
+      }
+      cellValue += '';
+            if (!cellValue.includes('.')) {
+      cellValue += '.00';
+      }
+      return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
+        return $1 + ',';
+      }).replace(/\.$/, '');
+    },
+    //获取签发金额大写
+    getBigSmall(){
+        this.issuedAmount = this.smallToBig(this.form.zfiAmount);
+    },
+    /* //  将数字金额转换为大写金额 */
+    smallToBig(money) {
+      //  将数字金额转换为大写金额
+      var cnNums = new Array(
+        "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" ); //汉字的数字
+      var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
+      var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
+      var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
+      var cnInteger = "整"; //整数金额时后面跟的字符
+      var cnIntLast = "元"; //整数完以后的单位
+      //最大处理的数字
+      var maxNum = 999999999999999.9999;
+      var integerNum; //金额整数部分
+      var decimalNum; //金额小数部分
+      //输出的中文金额字符串
+      var chineseStr = "";
+      var parts; //分离金额后用的数组,预定义
+      if (money == "" || money == null || money == undefined) {
+        return "零元零角零分";
+      }
+      money = parseFloat(money);
+      if (money >= maxNum) {
+        //超出最大处理数字
+        return "超出最大处理数字";
+      }
+      if (money == 0) {
+        chineseStr = cnNums[0] + cnIntLast + cnInteger;
+        return chineseStr;
+      }
+      //四舍五入保留两位小数,转换为字符串
+      money = Math.round(money * 100).toString();
+      integerNum = money.substr(0, money.length - 2);
+      decimalNum = money.substr(money.length - 2);
+      //获取整型部分转换
+      if (parseInt(integerNum, 10) > 0) {
+        var zeroCount = 0;
+        var IntLen = integerNum.length;
+        for (var i = 0; i < IntLen; i++) {
+          var n = integerNum.substr(i, 1);
+          var p = IntLen - i - 1;
+          var q = p / 4;
+          var m = p % 4;
+          if (n == "0") {
+            zeroCount++;
+          } else {
+            if (zeroCount > 0) {
+              chineseStr += cnNums[0];
+            }
+            //归零
+            zeroCount = 0;
+            chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
+          }
+          if (m == 0 && zeroCount < 4) {
+            chineseStr += cnIntUnits[q];
+          }
+        }
+        chineseStr += cnIntLast;
+      }
+      //小数部分
+      if (decimalNum != "") {
+        var decLen = decimalNum.length;
+        for (var i = 0; i < decLen; i++) {
+          var n = decimalNum.substr(i, 1);
+          if (n != "0") {
+            chineseStr += cnNums[Number(n)] + cnDecUnits[i];
+          }
+        }
+      }
+      if (chineseStr == "") {
+        chineseStr += cnNums[0] + cnIntLast + cnInteger;
+      } else if (decimalNum == "" || /^0*$/.test(decimalNum)) {
+        chineseStr += cnInteger;
+      }
+      return chineseStr;
+    },
+    //选择授信触发
+    change(val) {
+      if (!val) {
+            //可用额度
+            this.availableAmt = "0.00";
+            //有效期
+            this.validityDate ="";
+            //产品是否可拆分
+            this.zfpSplit= "",
+            //融资放款方式
+            this.zfpcrLoanType = "";
+            //产品
+            this.zfpId = "";
+            return;
+        }
+        let obj = {};
+        obj = this.creditLineList.find(item => {
+            return item.value === val;
+        });
+        //获取有效期的类型
+        this.zfpcrDateType = obj.zfpcrDateType;
+        //产品是否可拆分
+        this.zfpSplit= obj.zfpSplit;
+        //放款方式
+        this.zfpcrLoanType = obj.zfpcrLoanType;
+        //产品
+        this.zfpId = obj.zfpId;
+        //长期
+        if("0"== this.zfpcrDateType){
+            this.validityDate = "长期";
+        }else{
+            this.validityDate = obj.zfpcrEndDate;
+        }
+        var lineQueryParam = {};
+        lineQueryParam.zfpcrId = val;
+        //获取可用额度
+        getAvailableBalance(lineQueryParam).then((response) => {
+            this.availableAmt = response.data.remaining;
+        });
+    },
+    //修改
+    submitForm(){
+        this.$refs["form"].validate(valid => {
+            if (valid) {
+            const loading = this.$loading({
+                lock: true,
+                text: "Loading",
+                spinner: "el-icon-loading",
+                background: "rgba(0, 0, 0, 0.7)",
+            })
+            //应付账款
+            this.form.ticketList = this.ticketList;
+            //产品是否可拆分
+            this.form.zfpSplit = this.zfpSplit;
+            //放款方式
+            this.form.zfpcrLoanType = this.zfpcrLoanType;
+            //融信类型
+            this.form.type = "00";
+            //产品
+            this.form.zfpId = this.zfpId;
+            updateCredit(this.form).then(response => {
+                loading.close();
+                this.msgSuccess("修改成功");
+                this.$store.dispatch("tagsView/delView", this.$route);
+                this.$router.go(-1);
+            }).catch((response)=>{
+            loading.close();
+            });
+            }
+        });
+    },   
+    
+  }
+};
+</script>
+
+<style lang="scss">
+
+.uoloadfj .el-upload--picture-card{
+  width:110px;
+  height:110px;
+  line-height:110px;
+}
+.fjUoloadSty .el-upload--picture-card{
+  display:none;   
+}
+
+table th.star div::before {
+    content: '*';
+    color: red;
+}
+
+</style>