Browse Source

融信中往来账款修改

ch 3 years ago
parent
commit
4d2edf280e

+ 10 - 14
front-vue/src/views/service/bill/editBill.vue

@@ -270,16 +270,12 @@
           <el-form-item label="大写:">{{
             smallToBig(allAmount())
           }}</el-form-item>
-          <el-form-item style="float: right"
-            ><el-button type="primary" @click="delInvoice"
-              >删除</el-button
-            ></el-form-item
-          >
-          <el-form-item style="float: right"
-            ><el-button type="primary" @click="openUpload()"
-              >上传/修改</el-button
-            ></el-form-item
-          >
+          <el-form-item style="float: right">
+            <el-button type="danger" @click="delInvoice">删除</el-button>
+          </el-form-item>
+          <el-form-item style="float: right">
+            <el-button type="success" @click="openUpload()">上传/修改</el-button>
+          </el-form-item>
         </el-form>
 
         <el-table
@@ -616,7 +612,7 @@
     </el-card>
 
     <!-- 查看图片 -->
-    <el-dialog :visible.sync="invoiceVisible">
+    <el-dialog :visible.sync="invoiceVisible" append-to-body>
       <img width="100%" :src="invoiceImageUrl" alt="" />
     </el-dialog>
 
@@ -655,7 +651,7 @@ export default {
       required: true,
       default: () => "",
     },
-    
+
   },
   data() {
     return {
@@ -1280,7 +1276,7 @@ export default {
     //删除发票
     delInvoice(row) {
       var self = this;
-      const ids = [row.id] || this.ids;
+      const ids = row.id ? [row.id] : this.ids;
       if (ids && ids.length != 0) {
         this.$confirm("是否确认删除此数据项?", "警告", {
           confirmButtonText: "确定",
@@ -1450,4 +1446,4 @@ export default {
 .el-table .warning-row {
   background: rgb(223, 223, 223);
 }
-</style>
+</style>

+ 35 - 33
front-vue/src/views/service/credit/addCredit.vue

@@ -122,7 +122,7 @@
         <el-button type="primary" plain @click="cancel">取 消</el-button>
     </el-row>
     <!-- 应付账款信息 -->
-    <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body>
+    <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body destroy-on-close>
         <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" />
@@ -201,6 +201,7 @@ import pdfShow from "./pdfShow";
 import {
     getToken
 } from "@/utils/auth";
+import { getBill} from "@/api/service/bill/bill";
 import AddBill from "@/views/service/bill/addBill";
 import EditBill from "@/views/service/bill/editBill";
 import DetailBill from "@/views/service/credit/billDetail";
@@ -466,6 +467,7 @@ export default {
                 });
                 return false;
             }
+            this.chooseTicket = eval("(" + JSON.stringify(this.ticketList) + ")");
             this.getAccountsPay();
             this.open = true;
             this.payTitle = "应付账款";
@@ -476,8 +478,8 @@ export default {
         },
         selectChecked() {
             //清空选择
-            this.$refs.tablePay && this.$refs.tablePay.clearSelection();
-            this.ticketList.forEach((item) => {
+            // this.$refs.tablePay && this.$refs.tablePay.clearSelection();
+            this.chooseTicket.forEach((item) => {
                 this.payList.forEach((row) => {
                     if (row.zbiId == item.zbiId) {
                         this.$nextTick(() => {
@@ -491,9 +493,9 @@ export default {
                 });
             });
             //合计
-            this.getReTotal(this.ticketList);
+            // this.getReTotal(this.ticketList);
             //附件
-            this.getFile(this.ticketList);
+            // this.getFile(this.ticketList);
         },
         /* 多选框跨页 */
         rowkey(row) {
@@ -862,7 +864,7 @@ export default {
                                                         _this.$store.dispatch(
                                                             "tagsView/delView",
                                                             _this.$route
-                                                        ); 
+                                                        );
                                                         _this.$router.go(-1);
                                                     }else{
                                                         //当前用户是经办人,判断有无核心开立融信的内部审批
@@ -877,7 +879,7 @@ export default {
                                                                 _this.$store.dispatch(
                                                                     "tagsView/delView",
                                                                      _this.$route
-                                                                ); 
+                                                                );
                                                                 _this.$router.go(-1);
                                                             }else{//无核心开立内部审批
                                                                 //关闭当前页面
@@ -887,14 +889,14 @@ export default {
                                                                 );
                                                                 //跳转盖章页面
                                                                 Cookies.set("/credit/creditSeal/"+zfiId + "/", _this.$route.fullPath)
-                                                                _this.$router.push({ path: "/credit/creditSeal/"+zfiId + "/" });            
+                                                                _this.$router.push({ path: "/credit/creditSeal/"+zfiId + "/" });
                                                             }
                                                         });
-                                                        
+
                                                     }
                                                 });
 
-                                                
+
                                             }).catch((e) => {
                                                 loading.close();
                                             });
@@ -930,7 +932,7 @@ export default {
                                                 this.$store.dispatch(
                                                     "tagsView/delView",
                                                      this.$route
-                                                ); 
+                                                );
                                                 this.$router.go(-1);
                                             }else{
                                                 //当前用户是经办人,判断有无核心开立融信的内部审批
@@ -945,7 +947,7 @@ export default {
                                                         this.$store.dispatch(
                                                             "tagsView/delView",
                                                             this.$route
-                                                        ); 
+                                                        );
                                                         this.$router.go(-1);
                                                     }else{//无核心开立内部审批
                                                         //关闭当前页面
@@ -955,10 +957,10 @@ export default {
                                                         );
                                                         //跳转盖章页面
                                                         Cookies.set("/credit/creditSeal/"+zfiId + "/", this.$route.fullPath)
-                                                        this.$router.push({ path: "/credit/creditSeal/"+zfiId + "/" });            
+                                                        this.$router.push({ path: "/credit/creditSeal/"+zfiId + "/" });
                                                     }
                                                 });
-                                                
+
                                             }
                                         });
                                     }).catch((response) => {
@@ -994,7 +996,7 @@ export default {
                                         this.$store.dispatch(
                                             "tagsView/delView",
                                                 this.$route
-                                        ); 
+                                        );
                                         this.$router.go(-1);
                                     }else{
                                         //当前用户是经办人,判断有无核心开立融信的内部审批
@@ -1009,27 +1011,27 @@ export default {
                                                 this.$store.dispatch(
                                                     "tagsView/delView",
                                                     this.$route
-                                                ); 
+                                                );
                                                 this.$router.go(-1);
                                             }else{//无核心开立内部审批
                                                 //关闭当前页面
                                                 this.$store.dispatch(
-                                                    "tagsView/delView", 
+                                                    "tagsView/delView",
                                                         this.$route
                                                 );
                                                 //跳转盖章页面
                                                 Cookies.set("/credit/creditSeal/"+zfiId + "/", this.$route.fullPath)
-                                                this.$router.push({ path: "/credit/creditSeal/"+zfiId + "/" });            
+                                                this.$router.push({ path: "/credit/creditSeal/"+zfiId + "/" });
                                             }
                                         });
-                                        
+
                                     }
                                 });
                             }).catch((response) => {
                                 loading.close();
                             });
                     }
-                   
+
                 }
             });
         },
@@ -1136,20 +1138,20 @@ export default {
         //修改账款回调
         emitEditClick(val) {
             var self = this
-            this.getAccountsPay().then((response) => {
-                //修改付款返回id直接选中
-                if (val) {
-                    // self.payList.forEach(element => {
-                    //     if (element.zbiId == val) {
-                    //         // 将当前点击项选中
-                    //         // self.chooseTicket.push(element)
-                    //         //self.closeTicket()
-                    //     }
-                    // });
-                    console.log(self.chooseTicket,"!!!!!!!!")
-                    self.ticketList = response.data.records
-                    self.closeTicket()
+            getBill(val).then((response) => {
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.ticketList, i, response.data)
+                        break;
+                    }
+                }
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.chooseTicket, i, response.data)
+                        break;
+                    }
                 }
+                self.closeTicket();
             })
             self.openEditBill = false
         },

+ 25 - 20
front-vue/src/views/service/credit/addInformation.vue

@@ -104,7 +104,7 @@
                 </el-row>  
                 <el-divider content-position="left" >应收账款</el-divider>
                 <el-form-item  style="margin-left: 100px">
-                    <el-button type="success" @click="openTicket">选择</el-button>
+                    <el-button type="success" @click="openTicket(form.zfiId)">选择</el-button>
                     <el-button type="primary" @click="addPay">新增应付账款</el-button>
                     <el-button size="mini" @click="deleteTicekt">清空全部</el-button>
                     <el-form-item label="合计金额:"> 
@@ -246,7 +246,7 @@
                 <el-button @click="cancel">取 消</el-button>
             </div>
             <!-- 应收账款信息 -->
-            <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body>
+            <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body destroy-on-close>
             <el-form :model="queryParamsPay"  ref="formQuery"  :inline="true"  label-width="68px"  style="margin-bottom: -21px">
                 <el-form-item label="账款名称" prop="zbiName">
                     <el-input
@@ -382,6 +382,7 @@ import {getCreditDetail,getAccountsCollection,getFile,getFinanceSign} from "@/ap
 import {addInfor,getCreditSealFile,creditRefuse,getContractFile} from "@/api/service/credit/creditHandle";
 import {accAdd} from "@/utils/calculation";
 import {getToken} from "@/utils/auth";
+import { getBill} from "@/api/service/bill/bill";
 import AddBill from "@/views/service/bill/addBill";
 import EditBill from "@/views/service/bill/editBill";
 import {isOpenApproval} from "@/api/service/credit/approvalRelatedCredit";
@@ -600,9 +601,13 @@ export default {
             this.getAccountsCollection();
         },
         //打开应收账款选择列表
-        openTicket() {
+        openTicket(id) {
             this.queryParamsPay.zbiName = "";
             this.queryParamsPay.pageNum = 1;
+            if(id){
+                this.queryParamsPay.zfiId = id;
+            }
+            this.chooseTicket = eval("(" + JSON.stringify(this.ticketList) + ")");
             this.getAccountsCollection();
             this.open = true;
             this.payTitle = "应收账款";
@@ -642,8 +647,8 @@ export default {
         },
         selectChecked() {
              //清空选择
-            this.$refs.tablePay && this.$refs.tablePay.clearSelection();
-            this.ticketList.forEach((item) => {
+//             this.$refs.tablePay && this.$refs.tablePay.clearSelection();
+            this.chooseTicket.forEach((item) => {
                 this.payList.forEach(row => {
                 if (row.zbiId == item.zbiId) {
                     this.$nextTick(() => {
@@ -653,9 +658,9 @@ export default {
                 });
             });
              //合计
-            this.getReTotal(this.ticketList);
+            // this.getReTotal(this.ticketList);
             //附件
-             this.getFile(this.ticketList);
+            //  this.getFile(this.ticketList);
         },
         //文件下载
         handleDownload(row){
@@ -1060,20 +1065,20 @@ export default {
     //修改账款回调
         emitEditClick(val) {
             var self = this
-            this.getAccountsCollection().then((response) => {
-                //修改付款返回id直接选中
-                if (val) {
-                    // self.payList.forEach(element => {
-                    //     if (element.zbiId == val) {
-                    //         // 将当前点击项选中
-                    //         // self.chooseTicket.push(element)
-                    //         //self.closeTicket()
-                    //     }
-                    // });
-                    console.log(self.chooseTicket)
-                    self.ticketList = response.data.records
-                    self.closeTicket()
+            getBill(val).then((response) => {
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.ticketList, i, response.data)
+                        break;
+                    }
+                }
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.chooseTicket, i, response.data)
+                        break;
+                    }
                 }
+                self.closeTicket();
             })
             self.openEditBill = false
         },

+ 76 - 53
front-vue/src/views/service/credit/applyCreditEdit.vue

@@ -6,32 +6,32 @@
                             <el-form-item label="融信编号" prop="zfiNumber">
                                 <el-input v-model="form.zfiNumber" style="width: 200px" disabled/>
                             </el-form-item>
-                    </el-col> 
+                    </el-col>
                     <el-col :span="8">
                             <el-form-item label="创建时间" prop="createTime">
                             <el-date-picker disabled size="small" style="width: 200px" v-model="form.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
                                 </el-date-picker>
                             </el-form-item>
-                    </el-col> 
+                    </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>
                 </el-row>
                 <el-row>
                     <el-divider content-position="left" >应收账款</el-divider>
                 <el-form-item  style="margin-left: 100px">
-                    <el-button type="success" @click="openTicket">选择</el-button>
+                    <el-button type="success" @click="openTicket(form.zfiId)">选择</el-button>
                     <el-button type="primary" @click="addPay">新增应付账款</el-button>
                     <el-button size="mini" @click="deleteTicekt">清空全部</el-button>
-                    <el-form-item label="合计金额:"> 
+                    <el-form-item label="合计金额:">
                             <span>{{checkTotalAmt}}</span>
                     </el-form-item>
-                    <el-form-item label="金额大写:"> 
+                    <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"/>
@@ -68,15 +68,15 @@
                             </el-option>
                             </el-select>
                     </el-form-item>
-               
+
                 </el-col>
                 <el-col :span="8">
                     <span>可用额度:</span>
                     <span>{{availableAmt}}</span>
-                    <br>   
+                    <br>
                     <span>有效期:</span>
-                    <span>{{validityDate}}</span>  
-                </el-col>   -->  
+                    <span>{{validityDate}}</span>
+                </el-col>   -->
             </el-row>
            <!--  <el-row>
                 <el-col :span="8">
@@ -85,7 +85,7 @@
                     </el-form-item>
                 </el-col>
                 <el-col :span="8">
-                    <el-form-item label="签发有效期" prop="zfiEffectiveDate"> 
+                    <el-form-item label="签发有效期" prop="zfiEffectiveDate">
                        <el-date-picker clearable size="small" style="width: 200px"
                             v-model="form.zfiEffectiveDate"
                             type="date"
@@ -95,7 +95,7 @@
                     </el-form-item>
                 </el-col>
                 <el-col :span="8">
-                    <el-form-item label="承诺还款日" prop="zfiExpireDate"> 
+                    <el-form-item label="承诺还款日" prop="zfiExpireDate">
                         <el-date-picker clearable size="small" style="width: 200px"
                             v-model="form.zfiExpireDate"
                             type="date"
@@ -103,11 +103,11 @@
                             placeholder="选择承诺还款日">
                         </el-date-picker>
                     </el-form-item>
-                </el-col> 
-            </el-row> -->  
+                </el-col>
+            </el-row> -->
             <el-row>
                 <el-col :span="8">
-                    <el-form-item label="签发金额" prop="zfiAmount"> 
+                    <el-form-item label="签发金额" prop="zfiAmount">
                          <el-input v-model="form.zfiAmount" style="width: 200px" @input="getBigSmall" @input.native="changeRate($event,form.zfiAmount)" />
                     </el-form-item>
                 </el-col>
@@ -115,20 +115,20 @@
                         <el-form-item label="开立方" prop="openName">
                             <el-input v-model="form.openName" style="width: 200px" disabled />
                         </el-form-item>
-                </el-col> 
+                </el-col>
              <!--     <el-col :span="8">
                         <el-form-item label="收款账号" prop="zfiCollectionAccount" v-if="zfpcrLoanType != '0'">
                             <el-input v-model="form.zfiCollectionAccount" style="width: 200px" />
                         </el-form-item>
-                </el-col>  --> 
+                </el-col>  -->
             </el-row>
             <el-row>
                 <el-col :span="8">
-                    <el-form-item label="金额大写" prop="issuedAmount"> 
+                    <el-form-item label="金额大写" prop="issuedAmount">
                          {{issuedAmount}}
                     </el-form-item>
-                </el-col>  
-            </el-row>      
+                </el-col>
+            </el-row>
         </el-form>
         <!-- 发票附件 -->
         <el-divider content-position="left">发票附件</el-divider>
@@ -220,7 +220,7 @@
             <el-button @click="cancel">取 消</el-button>
         </div>
         <!-- 应付账款信息 -->
-        <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body>
+        <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body destroy-on-close>
         <el-form :model="queryParamsPay"  ref="formQuery"  :inline="true"  label-width="68px"  style="margin-bottom: -21px">
             <el-form-item label="账款名称" prop="zbiName">
                 <el-input
@@ -254,7 +254,7 @@
         <el-table :data="payList"
             ref="tablePay"
             class="single-select-table"
-            @selection-change="handleSelectionChange" 
+            @selection-change="handleSelectionChange"
             :row-key="rowkey">
             <el-table-column
             type="selection"
@@ -283,7 +283,7 @@
             <el-button size="mini" type="primary" @click="closeTicket">确认</el-button>
         </span>
         </el-dialog>
-        
+
         <!-- 新增往来账款 -->
         <el-dialog title="新增往来账款" :visible.sync="openAddBill" width="1120px" append-to-body>
             <add-bill :companyId="form.zfiCoreId" companyType="01" :payDate="payDate" @addClick="emitAddClick" v-if="openAddBill"></add-bill>
@@ -301,6 +301,7 @@
 </template>
 <script>
 import {getFile,getCreditDetail,getAccountsCollection,updateCredit} from "@/api/service/credit/credit";
+import { getBill} from "@/api/service/bill/bill";
 import {accAdd} from "@/utils/calculation";
 import {getToken} from "@/utils/auth";
 import AddBill from "@/views/service/bill/addBill";
@@ -337,7 +338,7 @@ export default {
             },
             // 表单校验
             rules: {
-                //授信额度 
+                //授信额度
                 zfiSupplierQuotaId: [
                     {
                         required: true,
@@ -382,7 +383,7 @@ export default {
                         trigger: ["blur", "change"],
                     },
                 ],
-                
+
             },
             // 是否显示弹出层
             open: false,
@@ -441,13 +442,14 @@ export default {
         const zfiId = this.$route.params && this.$route.params.zfiId;
         getCreditDetail(zfiId).then((response) => {
              if(response.data){
+                 debugger
                  this.form = response.data.financeInf;
                 //接收方
                 this.form.receiveName = response.data.receiveName;
                 //开立方
                 this.form.openName = response.data.openName;
                 //开立方
-                this.form.zfiCoreId = response.data.zfiCoreId;
+                // this.form.zfiCoreId = response.data.zfiCoreId;
                 //创建人
                 this.form.createName = response.data.createName;
                 //签发金额大写
@@ -459,7 +461,7 @@ export default {
                  //附件
                  this.getFile(this.ticketList);
              }
-             
+
         })
     },
     methods: {
@@ -517,11 +519,15 @@ export default {
             this.getAccountsCollection();
         },
         //打开应付账款选择列表
-        openTicket() {
+        openTicket(id) {
             //清空搜索条件
             this.queryParamsPay.zbiName = "";
             this.queryParamsPay.payName = "";
             this.queryParamsPay.pageNum = 1;
+            if(id){
+                this.queryParamsPay.zfiId = id;
+            }
+            this.chooseTicket = eval("(" + JSON.stringify(this.ticketList) + ")");
             this.getAccountsCollection();
             this.open = true;
             this.payTitle = "应收账款";
@@ -532,8 +538,8 @@ export default {
         },
         selectChecked() {
               //清空选择
-            this.$refs.tablePay && this.$refs.tablePay.clearSelection();
-            this.ticketList.forEach((item) => {
+//             this.$refs.tablePay && this.$refs.tablePay.clearSelection();
+            this.chooseTicket.forEach((item) => {
                 this.payList.forEach(row => {
                 if (row.zbiId == item.zbiId) {
                     this.$nextTick(() => {
@@ -543,17 +549,17 @@ export default {
                 });
             });
              //合计
-            this.getReTotal(this.ticketList);
+            //this.getReTotal(this.ticketList);
             //附件
-            this.getFile(this.ticketList);
+            //this.getFile(this.ticketList);
         },
         /* 多选框跨页 */
         rowkey(row) {
             return row.zbiId;
         },
         // 多选框选中数据
-        handleSelectionChange(val) {
-            this.chooseTicket = val
+        handleSelectionChange(selection) {
+            this.chooseTicket = selection;
         },
         // 确认选择
       closeTicket() {
@@ -591,7 +597,7 @@ export default {
                 //开立方赋值
                 this.$set(this.form, "openName",this.chooseTicket[0].payName);
             }
-                
+
         }else{
             this.$message({
             message: '请选择应收账款',
@@ -648,7 +654,7 @@ export default {
             this.$refs.tablePay.clearSelection();
         }
     },
-    //格式化金额 
+    //格式化金额
     amtFormat(cellValue) {
       if(cellValue == null || cellValue== undefined || cellValue == ''){
       cellValue = '0.00'
@@ -759,7 +765,7 @@ export default {
                         lock: true,
                         text: 'Loading',
                         background: 'rgba(0, 0, 0,0)'
-                    });   
+                    });
             //如果签发金额小于合计金额
             if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
                         var _this = this;
@@ -831,7 +837,7 @@ export default {
                 pfiFileName.substr(-3) == "JPG" ||
                 pfiFileName.substr(-3) == "PNG" ||
                 pfiFileName.substr(-4) == "jpeg" ||
-                pfiFileName.substr(-3) == "JPEG" 
+                pfiFileName.substr(-3) == "JPEG"
             ) {
                 this.wordUrl =
                     pfiUrl +
@@ -907,21 +913,38 @@ export default {
     //修改账款回调
         emitEditClick(val) {
             var self = this
-            this.getAccountsCollection().then((response) => {
+            getBill(val).then((response) => {
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.ticketList, i, response.data)
+                        break;
+                    }
+                }
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.chooseTicket, i, response.data)
+                        break;
+                    }
+                }
+                self.closeTicket();
+            })
+            /* this.getAccountsCollection().then((response) => {
                 //修改付款返回id直接选中
                 if (val) {
-                    // self.payList.forEach(element => {
-                    //     if (element.zbiId == val) {
-                    //         // 将当前点击项选中
-                    //         // self.chooseTicket.push(element)
-                    //         //self.closeTicket()
-                    //     }
-                    // });
-                    console.log(self.chooseTicket,"!!!!!!!")
-                    self.ticketList = response.data.records
-                    self.closeTicket()
+                    response.data.records.forEach(element => {
+                        if (element.zbiId == val) {
+                            将当前点击项选中
+                            self.chooseTicket.push(element)
+                            console.log(element,"是什么")
+                            self.closeTicket()
+
+                        }
+                    });
+                    // console.log(self.chooseTicket,"!!!!!!!")
+                    // self.ticketList = self.chooseTicket
+                    // self.closeTicket()
                 }
-            })
+            }) */
             self.openEditBill = false
         },
     }
@@ -936,7 +959,7 @@ export default {
   line-height:110px;
 }
 .fjUoloadSty .el-upload--picture-card{
-  display:none;   
+  display:none;
 }
 
 table th.star div::before {
@@ -944,4 +967,4 @@ table th.star div::before {
     color: red;
 }
 
-</style>
+</style>

+ 21 - 19
front-vue/src/views/service/credit/creditApply.vue

@@ -80,7 +80,7 @@
         <el-button type="primary" plain @click="cancel">取 消</el-button>
     </el-row>
     <!-- 应收账款信息 -->
-    <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body>
+    <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body destroy-on-close>
         <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" />
@@ -149,6 +149,7 @@ import {
 import {
     getToken
 } from "@/utils/auth";
+import { getBill} from "@/api/service/bill/bill";
 import AddBill from "@/views/service/bill/addBill";
 import DetailBill from "@/views/service/credit/billDetail";
 import EditBill from "@/views/service/bill/editBill";
@@ -280,6 +281,7 @@ export default {
             this.queryParamsPay.zbiName = "";
             this.queryParamsPay.payName = "";
             this.queryParamsPay.pageNum = 1;
+            this.chooseTicket = eval("(" + JSON.stringify(this.ticketList) + ")");
             this.getAccountsCollection();
             this.open = true;
             this.payTitle = "应收账款";
@@ -305,8 +307,8 @@ export default {
         },
         selectChecked() {
             //清空选择
-            this.$refs.tablePay && this.$refs.tablePay.clearSelection();
-            this.ticketList.forEach((item) => {
+            // this.$refs.tablePay && this.$refs.tablePay.clearSelection();
+            this.chooseTicket.forEach((item) => {
                 this.payList.forEach(row => {
                     if (row.zbiId == item.zbiId) {
                         this.$nextTick(() => {
@@ -316,9 +318,9 @@ export default {
                 });
             });
             //合计
-            this.getReTotal(this.ticketList);
+            // this.getReTotal(this.ticketList);
             //附件
-            this.getFile(this.ticketList);
+            // this.getFile(this.ticketList);
         },
         /* 多选框跨页 */
         rowkey(row) {
@@ -446,7 +448,7 @@ export default {
                 this.$refs.tablePay.clearSelection();
             }
         },
-        //格式化金额 
+        //格式化金额
         amtFormat(cellValue) {
             if (cellValue == null || cellValue == undefined || cellValue == '') {
                 cellValue = '0.00'
@@ -757,20 +759,20 @@ export default {
         //修改账款回调
         emitEditClick(val) {
             var self = this
-            this.getAccountsCollection().then((response) => {
-                //修改付款返回id直接选中
-                if (val) {
-                    // self.payList.forEach(element => {
-                    //     if (element.zbiId == val) {
-                    //         // 将当前点击项选中
-                    //         // self.chooseTicket.push(element)
-                    //         //self.closeTicket()
-                    //     }
-                    // });
-                    console.log(self.chooseTicket)
-                    self.ticketList = response.data.records
-                    self.closeTicket()
+            getBill(val).then((response) => {
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.ticketList, i, response.data)
+                        break;
+                    }
+                }
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.chooseTicket, i, response.data)
+                        break;
+                    }
                 }
+                self.closeTicket();
             })
             self.openEditBill = false
         },

+ 66 - 61
front-vue/src/views/service/credit/creditUpdate.vue

@@ -7,18 +7,18 @@
                         <el-form-item label="融信编号" prop="zfiNumber">
                             <el-input v-model="form.zfiNumber" style="width: 200px" disabled/>
                         </el-form-item>
-                </el-col> 
+                </el-col>
                 <el-col :span="8">
                         <el-form-item label="创建时间" prop="createTime">
                            <el-date-picker disabled size="small" style="width: 200px" v-model="form.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
                             </el-date-picker>
                         </el-form-item>
-                </el-col> 
+                </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>
                 <el-col :span="8">
                         <el-form-item label="开立方" prop="openName">
                             <el-input v-model="form.openName" style="width: 200px" disabled/>
@@ -43,7 +43,7 @@
                     </el-form-item>
                 </el-col>
                 <el-col :span="8">
-                    <el-form-item label="签发有效期" prop="zfiEffectiveDate"> 
+                    <el-form-item label="签发有效期" prop="zfiEffectiveDate">
                         <el-date-picker clearable size="small" style="width: 200px"
                             v-model="form.zfiEffectiveDate"
                             type="date"
@@ -59,7 +59,7 @@
             </el-row>
             <el-row>
                 <el-col :span="8">
-                    <el-form-item label="承诺还款日" prop="zfiExpireDate"> 
+                    <el-form-item label="承诺还款日" prop="zfiExpireDate">
                         <el-date-picker clearable size="small" style="width: 200px"
                             v-model="form.zfiExpireDate"
                             type="date"
@@ -68,7 +68,7 @@
                             :picker-options="pickerOptions">
                         </el-date-picker>
                     </el-form-item>
-                </el-col> 
+                </el-col>
                 <el-col :span="8">
                     <el-form-item label="授信额度" prop="zfiCoreQuotaId">
                         <el-select
@@ -96,34 +96,34 @@
                     <span>最小融资金额:</span>
                     <span>{{zfpMinimumAmount}}</span>
                 </el-col>
-            </el-row> 
+            </el-row>
             <el-row>
                 <el-col :span="8">
-                    <el-form-item label="签发金额" prop="zfiAmount"> 
+                    <el-form-item label="签发金额" prop="zfiAmount">
                          <el-input v-model="form.zfiAmount" style="width: 200px" @input="getBigSmall"  @input.native="changeRate($event,form.zfiAmount)" />
                     </el-form-item>
-                </el-col> 
-             
+                </el-col>
+
             </el-row>
             <el-row>
                 <el-col :span="8">
-                    <el-form-item label="金额大写" prop="issuedAmount"> 
+                    <el-form-item label="金额大写" prop="issuedAmount">
                          {{issuedAmount}}
                     </el-form-item>
-                </el-col>  
-            </el-row>  
+                </el-col>
+            </el-row>
             <el-divider content-position="left" >应付账款</el-divider>
             <el-form-item  style="margin-left: 100px">
-                <el-button type="success" @click="openTicket">选择</el-button>
+                <el-button type="success" @click="openTicket(form.zfiId)">选择</el-button>
                 <el-button type="primary" @click="addPay">新增应付账款</el-button>
                 <el-button size="mini" @click="deleteTicekt">清空全部</el-button>
-                <el-form-item label="合计金额:"> 
+                <el-form-item label="合计金额:">
                         <span>{{checkTotalAmt}}</span>
                 </el-form-item>
-                <el-form-item label="金额大写:"> 
+                <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"/>
@@ -234,7 +234,7 @@
             <el-button @click="cancel">取 消</el-button>
         </div>
            <!-- 应付账款信息 -->
-        <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body>
+        <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body destroy-on-close>
         <el-form :model="queryParamsPay"  ref="formQuery"  :inline="true"  label-width="68px"  style="margin-bottom: -21px">
             <el-form-item label="账款名称" prop="zbiName">
                 <el-input
@@ -268,7 +268,7 @@
         <el-table :data="payList"
             ref="tablePay"
             class="single-select-table"
-            @selection-change="handleSelectionChange" 
+            @selection-change="handleSelectionChange"
             :row-key="rowkey">
             <el-table-column
             type="selection"
@@ -297,7 +297,7 @@
             <el-button size="mini" type="primary" @click="closeTicket">确认</el-button>
         </span>
         </el-dialog>
-        
+
         <!-- 新增往来账款 -->
         <el-dialog title="新增往来账款" :visible.sync="openAddBill" width="1120px" append-to-body>
             <add-bill :companyId="form.zfiSupplierId" companyType="00" :payDate="payDate" @addClick="emitAddClick" v-if="openAddBill"></add-bill>
@@ -317,6 +317,7 @@
 import {getCreditDetail,getReceiverList,listCreditLine,getAvailableBalance,getAccountsPay,updateCredit,getFile} from "@/api/service/credit/credit";
 import {accAdd} from "@/utils/calculation";
 import {getToken} from "@/utils/auth";
+import {getBill} from "@/api/service/bill/bill";
 import AddBill from "@/views/service/bill/addBill";
 import EditBill from "@/views/service/bill/editBill";
 export default {
@@ -334,7 +335,7 @@ export default {
             },
             // 表单校验
             rules: {
-                   //授信额度 
+                   //授信额度
                 zfiCoreQuotaId: [
                     {
                         required: true,
@@ -379,7 +380,7 @@ export default {
                         trigger: ["blur", "change"],
                     },
                 ],
-                
+
             },
             // 是否显示弹出层
             open: false,
@@ -447,7 +448,7 @@ export default {
             show:false,
             heid:false,
             chooseTicket:[],
-            payDate:null 
+            payDate:null
         };
     },
     watch:{
@@ -462,7 +463,7 @@ export default {
                 getReceiverList(this.supplierForm).then((response) => {
                   this.supplierList = response.data.records.map(item => {
                       return { value: item.scyId, label: item.scyName};
-                  }); 
+                  });
                 });
                 this.listCreditLine(response.data);
              }
@@ -472,7 +473,7 @@ export default {
                  //附件
                  this.getFile(this.ticketList);
              }
-             
+
         })
     },
     methods: {
@@ -485,7 +486,7 @@ export default {
         rowkeyCustomer(row) {
             return row.cciId;
         },
-       
+
         //获取附件信息
         getFile(datas){
             var queryParamsFile = {};
@@ -512,18 +513,22 @@ export default {
             this.getAccountsPay();
         },
         //打开应付账款选择列表
-        openTicket() {
+        openTicket(id) {
             if(!this.form.zfiSupplierId){
                     this.$message({
                         message: "请选择接收方",
                         type: "warning",
                     });
-                    return false;    
+                    return false;
             }
             //搜索条件清空
             this.queryParamsPay.zbiName = "";
             this.queryParamsPay.receiveName = "";
             this.queryParamsPay.pageNum = 1;
+            if(id){
+                this.queryParamsPay.zfiId = id;
+            }
+            this.chooseTicket = eval("(" + JSON.stringify(this.ticketList) + ")");
             this.getAccountsPay();
             this.open = true;
             this.payTitle = "应付账款";
@@ -536,7 +541,7 @@ export default {
                     return { value: item.zfpcrId, label: item.zfpName,zfpcrDateType:item.zfpcrDateType,
                             zfpcrEndDate:item.zfpcrEndDate,zfpcrLoanType:item.zfpcrLoanType,zfpSplit:item.zfpSplit,
                             zfpId:item.zfpId,zfpcrRate:item.zfpcrRate,remaining:item.remaining,zfpMinimumAmount:item.zfpMinimumAmount};
-                }); 
+                });
                 this.form = data.financeInf;
                 //开立方
                 this.form.openName = data.openName;
@@ -545,10 +550,10 @@ export default {
                 //签发金额大写
                 this.issuedAmount = this.smallToBig(this.form.zfiAmount);
               });
-        },   
+        },
         //应付账款查询列表
         getAccountsPay() {
-           this.queryParamsPay.zbiPayeeId = this.form.zfiSupplierId; 
+           this.queryParamsPay.zbiPayeeId = this.form.zfiSupplierId;
            return getAccountsPay(this.queryParamsPay).then((response) => {
                 this.payList = response.data.records;
                 this.selectChecked();
@@ -558,8 +563,8 @@ export default {
         },
         selectChecked() {
              //清空选择
-            this.$refs.tablePay && this.$refs.tablePay.clearSelection();
-            this.ticketList.forEach((item) => {
+//             this.$refs.tablePay && this.$refs.tablePay.clearSelection();
+            this.chooseTicket.forEach((item) => {
                 this.payList.forEach(row => {
                 if (row.zbiId == item.zbiId) {
                     this.$nextTick(() => {
@@ -569,9 +574,9 @@ export default {
                 });
             });
              //合计
-            this.getReTotal(this.ticketList);
+            // this.getReTotal(this.ticketList);
             //附件
-             this.getFile(this.ticketList);
+            //  this.getFile(this.ticketList);
         },
         /* 删除按钮 */
         handleDelete(index, rows) {
@@ -622,7 +627,7 @@ export default {
                     this.getFile(this.ticketList);
                     this.open = false;
                 }
-                
+
         }else{
             this.$message({
             message: '请选择应付账款',
@@ -690,7 +695,7 @@ export default {
             this.$refs.tablePay.clearSelection();
         }
     },
-    //格式化金额 
+    //格式化金额
     amtFormat(cellValue) {
       if(cellValue == null || cellValue== undefined || cellValue == ''){
       cellValue = '0.00'
@@ -852,7 +857,7 @@ export default {
                     lock: true,
                     text: 'Loading',
                     background: 'rgba(0, 0, 0,0)'
-                }); 
+                });
             //如果签发金额小于合计金额
             if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
                         var _this = this;
@@ -917,7 +922,7 @@ export default {
             }
             }
         });
-    }, 
+    },
      //金额去掉千分位
     moneyDelete(num){
             if(num &&num != undefined && num != null){
@@ -945,7 +950,7 @@ export default {
                 pfiFileName.substr(-3) == "JPG" ||
                 pfiFileName.substr(-3) == "PNG" ||
                 pfiFileName.substr(-4) == "jpeg" ||
-                pfiFileName.substr(-3) == "JPEG" 
+                pfiFileName.substr(-3) == "JPEG"
             ) {
                 this.wordUrl =
                     pfiUrl +
@@ -1013,25 +1018,25 @@ export default {
     },
     //修改账款回调
     emitEditClick(val) {
-        var self = this
-        this.getAccountsPay().then((response) => {
-            //修改付款返回id直接选中
-            if (val) {
-                // self.payList.forEach(element => {
-                //     if (element.zbiId == val) {
-                //         // 将当前点击项选中
-                //         // self.chooseTicket.push(element)
-                //         //self.closeTicket()
-                //     }
-                // });
-                console.log(self.chooseTicket)
-                self.ticketList = response.data.records
-                self.closeTicket()
-            }
-        })
-        self.openEditBill = false
-    },
-    
+            var self = this
+            getBill(val).then((response) => {
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.ticketList, i, response.data)
+                        break;
+                    }
+                }
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.chooseTicket, i, response.data)
+                        break;
+                    }
+                }
+                self.closeTicket();
+            })
+            self.openEditBill = false
+        },
+
   }
 };
 </script>
@@ -1044,7 +1049,7 @@ export default {
   line-height:110px;
 }
 .fjUoloadSty .el-upload--picture-card{
-  display:none;   
+  display:none;
 }
 
 table th.star div::before {
@@ -1052,4 +1057,4 @@ table th.star div::before {
     color: red;
 }
 
-</style>
+</style>

+ 22 - 20
front-vue/src/views/service/credit/financeOpen.vue

@@ -101,7 +101,7 @@
         <el-button type="primary" plain @click="cancel">取 消</el-button>
     </el-row>
     <!-- 应付账款信息 -->
-    <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body>
+    <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body destroy-on-close>
         <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" />
@@ -172,6 +172,7 @@ import {
 import {
     getToken
 } from "@/utils/auth";
+import { getBill} from "@/api/service/bill/bill";
 import AddBill from "@/views/service/bill/addBill";
 import EditBill from "@/views/service/bill/editBill";
 import DetailBill from "@/views/service/credit/billDetail";
@@ -215,7 +216,7 @@ export default {
             },
             // 表单校验
             rules: {
-                //授信额度 
+                //授信额度
                 zfiSupplierQuotaId: [{
                     required: true,
                     message: "请选择授信额度",
@@ -390,6 +391,7 @@ export default {
             this.queryParamsPay.zbiName = "";
             this.queryParamsPay.payName = "";
             this.queryParamsPay.pageNum = 1;
+            this.chooseTicket = eval("(" + JSON.stringify(this.ticketList) + ")");
             this.getAccountsCollection();
             this.open = true;
             this.payTitle = "应收账款";
@@ -400,8 +402,8 @@ export default {
         },
         selectChecked() {
             //清空选择
-            this.$refs.tablePay && this.$refs.tablePay.clearSelection();
-            this.ticketList.forEach((item) => {
+            // this.$refs.tablePay && this.$refs.tablePay.clearSelection();
+            this.chooseTicket.forEach((item) => {
                 this.payList.forEach(row => {
                     if (row.zbiId == item.zbiId) {
                         this.$nextTick(() => {
@@ -411,9 +413,9 @@ export default {
                 });
             });
             //合计
-            this.getReTotal(this.ticketList);
+            // this.getReTotal(this.ticketList);
             //附件
-            this.getFile(this.ticketList);
+            // this.getFile(this.ticketList);
         },
         //获取附件信息
         getFile(datas) {
@@ -597,7 +599,7 @@ export default {
                 this.availableAmt = response.data.remaining;
             });
         },
-        //格式化金额 
+        //格式化金额
         amtFormat(cellValue) {
             if (cellValue == null || cellValue == undefined || cellValue == '') {
                 cellValue = '0.00'
@@ -1021,20 +1023,20 @@ export default {
         //修改账款回调
         emitEditClick(val) {
             var self = this
-            this.getAccountsCollection().then((response) => {
-                //修改付款返回id直接选中
-                if (val) {
-                    // self.payList.forEach(element => {
-                    //     if (element.zbiId == val) {
-                    //         // 将当前点击项选中
-                    //         // self.chooseTicket.push(element)
-                    //         //self.closeTicket()
-                    //     }
-                    // });
-                    console.log(self.chooseTicket)
-                    self.ticketList = response.data.records
-                    self.closeTicket()
+            getBill(val).then((response) => {
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.ticketList, i, response.data)
+                        break;
+                    }
+                }
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.chooseTicket, i, response.data)
+                        break;
+                    }
                 }
+                self.closeTicket();
             })
             self.openEditBill = false
         },

+ 65 - 60
front-vue/src/views/service/credit/financeOpenUpdate.vue

@@ -6,32 +6,32 @@
                             <el-form-item label="融信编号" prop="zfiNumber">
                                 <el-input v-model="form.zfiNumber" style="width: 200px" disabled/>
                             </el-form-item>
-                    </el-col> 
+                    </el-col>
                     <el-col :span="8">
                             <el-form-item label="创建时间" prop="createTime">
                             <el-date-picker disabled size="small" style="width: 200px" v-model="form.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
                                 </el-date-picker>
                             </el-form-item>
-                    </el-col> 
+                    </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>
                 </el-row>
                 <el-row>
                     <el-divider content-position="left" >应收账款</el-divider>
                 <el-form-item  style="margin-left: 100px">
-                    <el-button type="success" @click="openTicket">选择</el-button>
+                    <el-button type="success" @click="openTicket(form.zfiId)">选择</el-button>
                     <el-button type="primary" @click="addPay">新增应付账款</el-button>
                     <el-button size="mini" @click="deleteTicekt">清空全部</el-button>
-                    <el-form-item label="合计金额:"> 
+                    <el-form-item label="合计金额:">
                             <span>{{checkTotalAmt}}</span>
                     </el-form-item>
-                    <el-form-item label="金额大写:"> 
+                    <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"/>
@@ -55,7 +55,7 @@
                         <el-form-item label="开立方" prop="openName">
                             <el-input v-model="form.openName" style="width: 200px" disabled />
                         </el-form-item>
-                </el-col> 
+                </el-col>
                 <el-col :span="8">
                     <el-form-item label="授信额度" prop="zfiSupplierQuotaId">
                         <el-select
@@ -73,7 +73,7 @@
                             </el-option>
                             </el-select>
                     </el-form-item>
-               
+
                 </el-col>
                 <el-col :span="8">
                     <span style="display:none">可用额度:</span>
@@ -82,8 +82,8 @@
                     <span>{{validityDate}}</span>
                      <br>
                     <span>最小融资金额:</span>
-                    <span>{{zfpMinimumAmount}}</span>  
-                </el-col>    
+                    <span>{{zfpMinimumAmount}}</span>
+                </el-col>
             </el-row>
             <el-row>
                 <el-col :span="8">
@@ -92,7 +92,7 @@
                     </el-form-item>
                 </el-col>
                 <el-col :span="8">
-                    <el-form-item label="签发有效期" prop="zfiEffectiveDate"> 
+                    <el-form-item label="签发有效期" prop="zfiEffectiveDate">
                        <el-date-picker clearable size="small" style="width: 200px"
                             v-model="form.zfiEffectiveDate"
                             type="date"
@@ -106,7 +106,7 @@
                     </el-form-item>
                 </el-col>
                 <el-col :span="8">
-                    <el-form-item label="承诺还款日" prop="zfiExpireDate"> 
+                    <el-form-item label="承诺还款日" prop="zfiExpireDate">
                         <el-date-picker clearable size="small" style="width: 200px"
                             v-model="form.zfiExpireDate"
                             type="date"
@@ -115,11 +115,11 @@
                             :picker-options="pickerOptions">
                         </el-date-picker>
                     </el-form-item>
-                </el-col> 
-            </el-row>  
+                </el-col>
+            </el-row>
             <el-row>
                 <el-col :span="8">
-                    <el-form-item label="签发金额" prop="zfiAmount"> 
+                    <el-form-item label="签发金额" prop="zfiAmount">
                          <el-input v-model="form.zfiAmount" style="width: 200px" @input="getBigSmall" @input.native="changeRate($event,form.zfiAmount)" />
                     </el-form-item>
                 </el-col>
@@ -127,15 +127,15 @@
                         <el-form-item label="收款账号" prop="zfiCollectionAccount" v-if="zfpcrLoanType != '0'">
                             <el-input v-model="form.zfiCollectionAccount" style="width: 200px" />
                         </el-form-item>
-                </el-col> -->  
+                </el-col> -->
             </el-row>
             <el-row>
                 <el-col :span="8">
-                    <el-form-item label="金额大写" prop="issuedAmount"> 
+                    <el-form-item label="金额大写" prop="issuedAmount">
                          {{issuedAmount}}
                     </el-form-item>
-                </el-col>  
-            </el-row>      
+                </el-col>
+            </el-row>
         </el-form>
         <!-- 发票附件 -->
         <el-divider content-position="left">发票附件</el-divider>
@@ -227,7 +227,7 @@
             <el-button @click="cancel">取 消</el-button>
         </div>
         <!-- 应付账款信息 -->
-        <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body>
+        <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body destroy-on-close>
         <el-form :model="queryParamsPay"  ref="formQuery"  :inline="true"  label-width="68px"  style="margin-bottom: -21px">
             <el-form-item label="账款名称" prop="zbiName">
                 <el-input
@@ -261,7 +261,7 @@
         <el-table :data="payList"
             ref="tablePay"
             class="single-select-table"
-            @selection-change="handleSelectionChange" 
+            @selection-change="handleSelectionChange"
             :row-key="rowkey">
             <el-table-column
             type="selection"
@@ -290,7 +290,7 @@
             <el-button size="mini" type="primary" @click="closeTicket">确认</el-button>
         </span>
         </el-dialog>
-        
+
         <!-- 新增往来账款 -->
         <el-dialog title="新增往来账款" :visible.sync="openAddBill" width="1120px" append-to-body>
             <add-bill :companyId="form.zfiCoreId" companyType="01" :payDate="payDate" @addClick="emitAddClick" v-if="openAddBill"></add-bill>
@@ -310,6 +310,7 @@
 import {listSupplierCreditLine,getCreditDetail,getAccountsCollection,getSupplierAvailableBalance,updateCredit,getFile} from "@/api/service/credit/credit";
 import {accAdd} from "@/utils/calculation";
 import {getToken} from "@/utils/auth";
+import { getBill} from "@/api/service/bill/bill";
 import AddBill from "@/views/service/bill/addBill";
 import EditBill from "@/views/service/bill/editBill";
 export default {
@@ -344,7 +345,7 @@ export default {
             },
             // 表单校验
             rules: {
-                //授信额度 
+                //授信额度
                 zfiSupplierQuotaId: [
                     {
                         required: true,
@@ -389,7 +390,7 @@ export default {
                         trigger: ["blur", "change"],
                     },
                 ],
-                
+
             },
             // 是否显示弹出层
             open: false,
@@ -463,7 +464,7 @@ export default {
                 //附件
                  this.getFile(this.ticketList);
              }
-             
+
         })
     },
     methods: {
@@ -490,13 +491,13 @@ export default {
                 return;
             }
         },
-        //供应商授信额度    
+        //供应商授信额度
         listSupplierCreditLine(data){
               this.supplierCreditParams.zfsqId = data.financeInf.zfiSupplierQuotaId;
               listSupplierCreditLine(this.supplierCreditParams).then((response) => {
                 this.creditLineList = response.data.map(item => {
-                      return { 
-                        value: item.zfsqId, 
+                      return {
+                        value: item.zfsqId,
                         label: item.zfpName,
                         zfpcrDateType: item.zfpcrDateType,
                         zfpcrEndDate: item.zfpcrEndDate,
@@ -506,7 +507,7 @@ export default {
                         zfpcrRate:item.zfpcrRate,
                         remaining:item.remaining,
                         zfpMinimumAmount:item.zfpMinimumAmount};
-                }); 
+                });
                 this.form = data.financeInf;
                 //接收方
                 this.form.receiveName = data.receiveName;
@@ -536,11 +537,15 @@ export default {
             this.getAccountsCollection();
         },
         //打开应付账款选择列表
-        openTicket() {
+        openTicket(id) {
             //清空搜搜索条件
             this.queryParamsPay.zbiName = "";
             this.queryParamsPay.payName = "";
             this.queryParamsPay.pageNum = 1;
+            if(id){
+                this.queryParamsPay.zfiId = id;
+            }
+            this.chooseTicket = eval("(" + JSON.stringify(this.ticketList) + ")");
             this.getAccountsCollection();
             this.open = true;
             this.payTitle = "应收账款";
@@ -551,8 +556,8 @@ export default {
         },
         selectChecked() {
              //清空选择
-            this.$refs.tablePay && this.$refs.tablePay.clearSelection();
-            this.ticketList.forEach((item) => {
+//             this.$refs.tablePay && this.$refs.tablePay.clearSelection();
+            this.chooseTicket.forEach((item) => {
                 this.payList.forEach(row => {
                 if (row.zbiId == item.zbiId) {
                     this.$nextTick(() => {
@@ -562,9 +567,9 @@ export default {
                 });
             });
              //合计
-            this.getReTotal(this.ticketList);
+            // this.getReTotal(this.ticketList);
              //附件
-            this.getFile(this.ticketList);
+            // this.getFile(this.ticketList);
         },
         //获取附件信息
         getFile(datas){
@@ -627,7 +632,7 @@ export default {
                     this.$set(this.form, "openName",this.chooseTicket[0].payName);
                     this.open = false;
                 }
-                
+
         }else{
             this.$message({
             message: '请选择应收账款',
@@ -738,7 +743,7 @@ export default {
              this.availableAmt = response.data.remaining;
         });
     },
-    //格式化金额 
+    //格式化金额
     amtFormat(cellValue) {
       if(cellValue == null || cellValue== undefined || cellValue == ''){
       cellValue = '0.00'
@@ -873,7 +878,7 @@ export default {
                         lock: true,
                         text: 'Loading',
                         background: 'rgba(0, 0, 0,0)'
-                    }); 
+                    });
             //签发金额小于合计金额
             if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
                         var _this = this;
@@ -944,7 +949,7 @@ export default {
                     loading.close();
                 });
             }
-           
+
             }
         });
     },
@@ -975,7 +980,7 @@ export default {
                 pfiFileName.substr(-3) == "JPG" ||
                 pfiFileName.substr(-3) == "PNG" ||
                 pfiFileName.substr(-4) == "jpeg" ||
-                pfiFileName.substr(-3) == "JPEG" 
+                pfiFileName.substr(-3) == "JPEG"
             ) {
                 this.wordUrl =
                     pfiUrl +
@@ -1043,24 +1048,24 @@ export default {
     },
     //修改账款回调
     emitEditClick(val) {
-        var self = this
-        this.getAccountsCollection().then((response) => {
-            //修改付款返回id直接选中
-            if (val) {
-                // self.payList.forEach(element => {
-                //     if (element.zbiId == val) {
-                //         // 将当前点击项选中
-                //         // self.chooseTicket.push(element)
-                //         //self.closeTicket()
-                //     }
-                // });
-                console.log(self.chooseTicket)
-                self.ticketList = response.data.records
-                self.closeTicket()
-            }
-        })
-        self.openEditBill = false
-    }, 
+            var self = this
+            getBill(val).then((response) => {
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.ticketList, i, response.data)
+                        break;
+                    }
+                }
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.chooseTicket, i, response.data)
+                        break;
+                    }
+                }
+                self.closeTicket();
+            })
+            self.openEditBill = false
+        },
     }
 };
 </script>
@@ -1073,7 +1078,7 @@ export default {
   line-height:110px;
 }
 .fjUoloadSty .el-upload--picture-card{
-  display:none;   
+  display:none;
 }
 
 table th.star div::before {
@@ -1081,4 +1086,4 @@ table th.star div::before {
     color: red;
 }
 
-</style>
+</style>

+ 62 - 57
front-vue/src/views/service/credit/signFor.vue

@@ -73,7 +73,7 @@
             </el-form>
             <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-form-item label="融信利率:"> 
+                 <el-form-item label="融信利率:">
                             <span>{{this.zfiRate}}</span>%
                  </el-form-item>
                 <table class="gridtable" style="width:80%;text-align:center" align="center">
@@ -90,19 +90,19 @@
                         <td>{{openCode}}</td>
                         <td>社会统一码</td>
                         <td>{{receiverCode}}</td>
-                    </tr>    
+                    </tr>
                     <tr>
                         <td>开户银行</td>
                         <td>{{openBank}}</td>
                         <td>开户银行</td>
                         <td>{{receiverBank}}</td>
-                    </tr>    
+                    </tr>
                     <tr>
                         <td>账号</td>
                         <td>{{openAccount}}</td>
                         <td>账号</td>
                         <td>{{receiverAccount}}</td>
-                    </tr> 
+                    </tr>
                     <tr>
                         <td colspan="2">粮信金额</td>
                         <td colspan="4">人民币(大写):{{issuedAmount}}<br>人民币(小写)¥{{form.zfiAmount}}</td>
@@ -110,19 +110,19 @@
                     <tr>
                         <td colspan="2">起止日期</td>
                         <td colspan="4">{{stopDate}}</td>
-                    </tr>           
-                </table>    
+                    </tr>
+                </table>
                 <el-form-item  style="margin-left: 100px">
-                    <el-button size="mini" type="success" :disabled="isClick" @click="openTicket">选择</el-button>
+                    <el-button size="mini" type="success" :disabled="isClick" @click="openTicket(form.zfiId)">选择</el-button>
                     <el-button size="mini" type="primary" :disabled="isClick" @click="addPay">新增应收账款</el-button>
                     <el-button size="mini" @click="deleteTicekt" :disabled="isClick" >清空全部</el-button>
-                    <el-form-item label="合计金额:"> 
+                    <el-form-item label="合计金额:">
                             <span>{{checkTotalAmt}}</span>
                     </el-form-item>
-                    <el-form-item label="金额大写:"> 
+                    <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"/>
@@ -151,19 +151,19 @@
                 </el-form-item>
                 <el-row>
                     <el-col :span="8">
-                        <el-form-item label="签发金额" prop="zfiAmount"> 
+                        <el-form-item label="签发金额" prop="zfiAmount">
                             <el-input v-model="form.zfiAmount" style="width: 200px"  disabled @input="getBigSmall"/>
                         </el-form-item>
-                    </el-col> 
-                
+                    </el-col>
+
                 </el-row>
                 <el-row>
                     <el-col :span="8">
-                        <el-form-item label="金额大写" prop="issuedAmount"> 
+                        <el-form-item label="金额大写" prop="issuedAmount">
                             {{issuedAmount}}
                         </el-form-item>
-                    </el-col>  
-                </el-row>      
+                    </el-col>
+                </el-row>
                 <p>请知悉,资产信息仅能接受指定的销售方与购买方的往来账款(含账款基本信息、贸易合同与贸易发票等);如须使用系统尚未维护的往来账款,请点击新增应付账款
                 </p>
             </el-form>
@@ -238,7 +238,7 @@
                 <el-button @click="cancel">取 消</el-button>
             </div>
             <!-- 应收账款信息 -->
-            <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body>
+            <el-dialog :title="payTitle" :visible.sync="open" width="1120px" append-to-body destroy-on-close>
             <el-form :model="queryParamsPay"  ref="formQuery"  :inline="true"  label-width="68px"  style="margin-bottom: -21px">
                 <el-form-item label="账款名称" prop="zbiName">
                     <el-input
@@ -263,7 +263,7 @@
             <el-table :data="payList"
                 ref="tablePay"
                 class="single-select-table"
-                @selection-change="handleSelectionChange" 
+                @selection-change="handleSelectionChange"
                 :row-key="rowkey">
                 <el-table-column
                 type="selection"
@@ -292,7 +292,7 @@
                 <el-button size="mini" type="primary" @click="closeTicket">确认</el-button>
             </span>
             </el-dialog>
-            
+
             <!-- 新增往来账款 -->
             <el-dialog title="新增往来账款" :visible.sync="openAddBill" width="1120px" append-to-body>
                 <add-bill :companyId="form.zfiCoreId" companyType="01" :payDate="payDate" @addClick="emitAddClick" v-if="openAddBill"></add-bill>
@@ -336,7 +336,7 @@
                     <div slot="footer" class="dialog-footer">
                         <el-button type="primary" @click="goFinance">去融资</el-button>
                         <el-button @click="cancelGo">取 消</el-button>
-                    </div>    
+                    </div>
             </el-dialog>
         </el-tab-pane>
         <el-tab-pane label="签署合同">
@@ -344,7 +344,7 @@
                 <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip>
                     <template slot-scope="scope">
                         <img    style="width:30px;height:30px;"
-                            src="../../../assets/images/pdf.png"  
+                            src="../../../assets/images/pdf.png"
                         />
                         <span>{{scope.row.pfiFileName}}
                         </span>
@@ -376,6 +376,7 @@ import {getCreditDetail,getAvailableBalance,getAccountsCollection,getFile,getFin
 import {signFor,getCreditSealFile,getContractFile} from "@/api/service/credit/creditHandle";
 import {accAdd} from "@/utils/calculation";
 import {getToken} from "@/utils/auth";
+import { getBill} from "@/api/service/bill/bill";
 import AddBill from "@/views/service/bill/addBill";
 import EditBill from "@/views/service/bill/editBill";
 import {isOpenApproval} from "@/api/service/credit/approvalRelatedCredit";
@@ -401,7 +402,7 @@ export default {
             forms:{},
             // 表单校验
             rules: {
-               
+
             },
             financeSignForm:{},
             // 是否显示弹出层
@@ -503,7 +504,7 @@ export default {
           goShow:false,
           //状态
           stateOptions:[],
-          
+
         };
     },
     watch:{
@@ -547,7 +548,7 @@ export default {
                this.receiverAccount = response.data.receiverAccount;
                this.stopDate = response.data.stopDate;
                this.zfiRate = response.data.financeInf.zfiRate;
-               
+
              }
              if(response.data.payList){
                  this.ticketList = response.data.payList.records;
@@ -646,10 +647,14 @@ export default {
             this.getAccountsCollection();
         },
         //打开应收账款选择列表
-        openTicket() {
+        openTicket(id) {
             //清空搜索条件
             this.queryParamsPay.zbiName = "";
             this.queryParamsPay.pageNum = 1;
+            if(id){
+                this.queryParamsPay.zfiId = id;
+            }
+            this.chooseTicket = eval("(" + JSON.stringify(this.ticketList) + ")");
             this.getAccountsCollection();
             this.open = true;
             this.payTitle = "应收账款";
@@ -669,8 +674,8 @@ export default {
         },
         selectChecked() {
              //清空选择
-            this.$refs.tablePay && this.$refs.tablePay.clearSelection();
-            this.ticketList.forEach((item) => {
+//             this.$refs.tablePay && this.$refs.tablePay.clearSelection();
+            this.chooseTicket.forEach((item) => {
                 this.payList.forEach(row => {
                 if (row.zbiId == item.zbiId) {
                     this.$nextTick(() => {
@@ -680,9 +685,9 @@ export default {
                 });
             });
              //合计
-            this.getReTotal(this.ticketList);
+            // this.getReTotal(this.ticketList);
             //附件
-             this.getFile(this.ticketList);
+            //  this.getFile(this.ticketList);
         },
         /* 删除按钮 */
         handleDelete(index, rows) {
@@ -743,7 +748,7 @@ export default {
                     this.getFile(this.ticketList);
                     this.open = false;
                 }
-               
+
         }else{
             this.$message({
             message: '请选择应收账款',
@@ -793,7 +798,7 @@ export default {
             this.$refs.tablePay.clearSelection();
         }
     },
-    //格式化金额 
+    //格式化金额
     amtFormat(cellValue) {
       if(cellValue == null || cellValue== undefined || cellValue == ''){
       cellValue = '0.00'
@@ -949,13 +954,13 @@ export default {
                         return;
                 }
            }
-            
+
             if (valid) {
                 const loading = this.$loading({
                     lock: true,
                     text: 'Loading',
                     background: 'rgba(0, 0, 0,0)'
-                }); 
+                });
             //如果签发金额小于合计金额
             if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
                         var _this = this;
@@ -1008,7 +1013,7 @@ export default {
             }
             }
         });
-    }, 
+    },
      //金额去掉千分位
     moneyDelete(num){
             if(num &&num != undefined && num != null){
@@ -1036,7 +1041,7 @@ export default {
                 pfiFileName.substr(-3) == "JPG" ||
                 pfiFileName.substr(-3) == "PNG" ||
                 pfiFileName.substr(-4) == "jpeg" ||
-                pfiFileName.substr(-3) == "JPEG" 
+                pfiFileName.substr(-3) == "JPEG"
             ) {
                 this.wordUrl =
                     pfiUrl +
@@ -1106,24 +1111,24 @@ export default {
     },
     //修改账款回调
     emitEditClick(val) {
-        var self = this
-        this.getAccountsCollection().then((response) => {
-            //修改付款返回id直接选中
-            if (val) {
-                // self.payList.forEach(element => {
-                //     if (element.zbiId == val) {
-                //         // 将当前点击项选中
-                //         // self.chooseTicket.push(element)
-                //         //self.closeTicket()
-                //     }
-                // });
-                console.log(self.chooseTicket)
-                self.ticketList = response.data.records
-                self.closeTicket()
-            }
-        })
-        self.openEditBill = false
-    }, 
+            var self = this
+            getBill(val).then((response) => {
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.ticketList, i, response.data)
+                        break;
+                    }
+                }
+                for (var i = 0; i < this.ticketList.length; i ++) {
+                    if (response.data.zbiId == this.ticketList[i].zbiId) {
+                        this.$set(this.chooseTicket, i, response.data)
+                        break;
+                    }
+                }
+                self.closeTicket();
+            })
+            self.openEditBill = false
+        },
     //查询有无签收内部审批
     isOpenApproval(){
          var confirmParam = {};
@@ -1177,13 +1182,13 @@ export default {
                         });
                         return;
                 }
-                
+
                 if (valid) {
                     const loading = this.$loading({
                         lock: true,
                         text: 'Loading',
                         background: 'rgba(0, 0, 0,0)'
-                    }); 
+                    });
                 //如果签发金额小于合计金额
                 if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
                             var _this = this;
@@ -1332,7 +1337,7 @@ export default {
   line-height:110px;
 }
 .fjUoloadSty .el-upload--picture-card{
-  display:none;   
+  display:none;
 }
 
 table th.star div::before {
@@ -1360,4 +1365,4 @@ table th.star div::before {
         padding: 8px;
         border-style: solid;
     }
- </style>
+ </style>