Quellcode durchsuchen

融信往来账款新增功能

dudm vor 3 Jahren
Ursprung
Commit
5e53a07d98

Datei-Diff unterdrückt, da er zu groß ist
+ 1185 - 0
front-vue/src/views/service/bill/addBill.vue


+ 8 - 0
front-vue/src/views/service/bill/billAdd.vue

@@ -80,6 +80,7 @@
               value-format="yyyy-MM-dd"
               type="date"
               placeholder="选择日期"
+              :picker-options="pickerOptionsStart"
             >
             </el-date-picker>
           </el-form-item>
@@ -657,6 +658,13 @@ export default {
       //链属企业
       company: {},
       disabled: true,
+      pickerOptionsStart: {
+          disabledDate: time => {
+                if (this.form.zbiPayDate) {
+                        return time.getTime() > new Date(this.form.zbiPayDate).getTime()
+                }
+            }
+      },
       pickerOptionsEnd: {
           disabledDate: time => {
                 if (this.form.zbiDate) {

+ 8 - 0
front-vue/src/views/service/bill/billEdit.vue

@@ -106,6 +106,7 @@
               value-format="yyyy-MM-dd"
               type="date"
               placeholder="选择日期"
+              :picker-options="pickerOptionsStart"
             >
             </el-date-picker>
           </el-form-item>
@@ -703,6 +704,13 @@ export default {
       companyRelList: [],
       //链属企业
       company: {},
+      pickerOptionsStart: {
+          disabledDate: time => {
+                if (this.form.zbiPayDate) {
+                        return time.getTime() > new Date(this.form.zbiPayDate).getTime()
+                }
+            }
+      },
       pickerOptionsEnd: {
           disabledDate: time => {
                 if (this.form.zbiDate) {

+ 51 - 12
front-vue/src/views/service/credit/addCredit.vue

@@ -48,7 +48,7 @@
             </el-row>
             <el-divider content-position="left">应付账款</el-divider>
             <el-form-item style="margin-left: 100px">
-                <!-- <el-button size="mini" type="success" @click="addPay">新增应付账款</el-button> -->
+                <el-button size="mini" type="success" @click="addPay">新增应付账款</el-button>
                 <el-button size="mini" type="primary" @click="openTicket">选择</el-button>
                 <el-button size="mini" @click="deleteTicekt">清空全部</el-button>
                 <el-form-item label="合计金额:">
@@ -200,6 +200,12 @@
                 <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" @addClick="emitAddClick"></add-bill>
+        </el-dialog>
+
         <el-dialog
             title="预览"
             :visible.sync="pdfShowDialog" 
@@ -227,9 +233,10 @@ import { getRandom } from "@/api/common/getRandom";
 import { accAdd } from "@/utils/calculation";
 import pdfShow from "./pdfShow";
 import {getToken} from "@/utils/auth";
+import AddBill from "@/views/service/bill/addBill";
 export default {
     name: "addCredit",
-    components: {pdfShow},
+    components: {pdfShow,AddBill},
     data() {
         return {
             // 总条数
@@ -301,6 +308,7 @@ export default {
             },
             // 是否显示弹出层
             open: false,
+            openAddBill: false,
             //授信
             creditLineList: [],
             //接收方
@@ -355,7 +363,8 @@ export default {
             openFile:false,
             wordUrl: "",
             show:false,
-            heid:false
+            heid:false,
+            chooseTicket:[]
         };
     },
     created() {
@@ -427,10 +436,11 @@ export default {
         },
         //应付账款查询列表
         getAccountsPay() {
-            getAccountsPay(this.queryParamsPay).then((response) => {
+           return getAccountsPay(this.queryParamsPay).then((response) => {
                 this.payList = response.data.records;
                 this.selectChecked();
                 this.total = response.data.total;
+                return Promise.resolve(response)
             });
         },
         resetQuerys() {
@@ -508,6 +518,7 @@ export default {
         // 确认选择
         closeTicket() {
             if (this.chooseTicket) {
+                var flag = true;
                 //如果长度大于1,则需要进行对比应收企业和预计还款日期是否一致
                 if (this.chooseTicket.length > 1) {
                     //获取选中第一个的应收企业
@@ -516,26 +527,30 @@ export default {
                     var zbiPayDate = this.chooseTicket[0].zbiPayDate;
                     for (var i = 0; i < this.chooseTicket.length; i++) {
                         if (receiveName != this.chooseTicket[i].receiveName) {
+                            flag = false
                             this.$message({
                                 message: "请选择应收企业相同的应付账款",
                                 type: "warning",
                             });
-                            return;
+                            return false;
                         }
                         if (zbiPayDate != this.chooseTicket[i].zbiPayDate) {
+                            flag = false
                             this.$message({
                                 message: "请选择预计还款日期相同的应付账款",
                                 type: "warning",
                             });
-                            return;
+                            return false;
                         }
                     }
                 }
-                //合计
-                this.getReTotal(this.chooseTicket);
-                this.ticketList = this.chooseTicket;
-                //更新附件信息
-                this.getFile(this.ticketList);
+                if(flag){
+                    //合计
+                    this.getReTotal(this.chooseTicket);
+                    this.ticketList = this.chooseTicket;
+                    //更新附件信息
+                    this.getFile(this.ticketList);
+                }
                 this.open = false;
             } else {
                 this.$message({
@@ -967,7 +982,31 @@ export default {
         },
         //新增应付
         addPay(){
-
+            if(this.form.zfiSupplierId){
+                this.openAddBill = true
+            }else{
+                this.$message({
+                    message: "请选择接收方",
+                    type: "warning",
+                });
+            }
+        },
+        //新增账款回调
+        emitAddClick(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()
+                        }
+                    });
+                }
+            })
+            self.openAddBill = false
         }
     },
 };

+ 57 - 14
front-vue/src/views/service/credit/addInformation.vue

@@ -98,6 +98,7 @@
             </el-row>  
             <el-divider content-position="left" >应收账款</el-divider>
             <el-form-item  style="margin-left: 100px">
+                <el-button size="mini" type="success" @click="addPay">新增应收账款</el-button>
                  <el-button size="mini" type="primary" @click="openTicket">选择</el-button>
                  <el-button size="mini" @click="deleteTicekt">清空全部</el-button>
                 <el-form-item label="合计金额:"> 
@@ -264,6 +265,12 @@
             <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" @addClick="emitAddClick"></add-bill>
+        </el-dialog>
+
          <!--预览-->
         <el-dialog  :visible.sync="openFile" width="1000px" append-to-body>
             <img :src="wordUrl" v-if="show" width='450px' height='500px'/>
@@ -276,9 +283,10 @@ import {getCreditDetail,getAvailableBalance,getAccountsCollection,getFile} from
 import {addInfor} from "@/api/service/credit/creditHandle";
 import {accAdd} from "@/utils/calculation";
 import {getToken} from "@/utils/auth";
+import AddBill from "@/views/service/bill/addBill";
 export default {
     name: "addCredit",
-    components: {},
+    components: {AddBill},
     data() {
         return {
             // 总条数
@@ -293,6 +301,7 @@ export default {
             },
             // 是否显示弹出层
             open: false,
+            openAddBill: false,
            //选择的应收账款
            payList:[],
            //现有的应收账款
@@ -347,7 +356,8 @@ export default {
           openFile:false,
           wordUrl: "",
           show:false,
-          heid:false
+          heid:false,
+          chooseTicket:[]
         };
     },
     /* watch:{
@@ -456,10 +466,11 @@ export default {
             this.queryParamsPay.payId = this.zfiCoreId;
             //接收方
             this.queryParamsPay.zfiSupplierId = this.zfiSupplierId;
-            getAccountsCollection(this.queryParamsPay).then((response) => {
+           return getAccountsCollection(this.queryParamsPay).then((response) => {
                 this.payList = response.data.records;
                 this.selectChecked();
                 this.total = response.data.total;
+                return Promise.resolve(response)
             });
         },
         selectChecked() {
@@ -509,25 +520,29 @@ export default {
         // 确认选择
       closeTicket() {
         if(this.chooseTicket){
+                var flag = true;
                 //如果长度大于1,则需要进行对比应收企业和预计还款日期是否一致
                 if(this.chooseTicket.length > 1){
                     //获取选中第一个的预计还款日期
                     var zbiPayDate = this.chooseTicket[0].zbiPayDate;
                     for(var i = 0 ;i < this.chooseTicket.length;i++){
                         if(zbiPayDate != this.chooseTicket[i].zbiPayDate){
-                                this.$message({
-                                    message: '请选择预计还款日期相同的应收账款',
-                                    type: 'warning'
-                                });
-                                return;
+                            flag = false
+                            this.$message({
+                                message: '请选择预计还款日期相同的应收账款',
+                                type: 'warning'
+                            });
+                            return false;
                         }
                     }
                 }
-                //合计
-                this.getReTotal(this.chooseTicket);
-                this.ticketList = this.chooseTicket;
-                //更新附件信息
-                this.getFile(this.ticketList);
+                if(flag){
+                    //合计
+                    this.getReTotal(this.chooseTicket);
+                    this.ticketList = this.chooseTicket;
+                    //更新附件信息
+                    this.getFile(this.ticketList);
+                }
                 this.open = false;
         }else{
             this.$message({
@@ -835,7 +850,35 @@ export default {
             }
         }
         this.openFile = true;
-    },  
+    },
+    //新增应付
+    addPay(){
+        if(this.form.zfiCoreId){
+            this.openAddBill = true
+        }else{
+            this.$message({
+                message: "开立方不能为空",
+                type: "warning",
+            });
+        }
+    },
+    //新增账款回调
+    emitAddClick(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()
+                    }
+                });
+            }
+        })
+        self.openAddBill = false
+    }  
     
   }
 };

+ 66 - 20
front-vue/src/views/service/credit/applyCreditEdit.vue

@@ -22,6 +22,7 @@
                 <el-row>
                     <el-divider content-position="left" >应收账款</el-divider>
                 <el-form-item  style="margin-left: 100px">
+                    <el-button size="mini" type="success" @click="addPay">新增应收账款</el-button>
                     <el-button size="mini" type="primary" @click="openTicket">选择</el-button>
                     <el-button size="mini" @click="deleteTicekt">清空全部</el-button>
                     <el-form-item label="合计金额:"> 
@@ -260,6 +261,12 @@
             <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" @addClick="emitAddClick"></add-bill>
+        </el-dialog>
+
         <!--预览-->
         <el-dialog  :visible.sync="openFile" width="1000px" append-to-body>
             <img :src="wordUrl" v-if="show" width='450px' height='500px'/>
@@ -271,9 +278,10 @@
 import {getFile,getCreditDetail,getAccountsCollection,updateCredit} from "@/api/service/credit/credit";
 import {accAdd} from "@/utils/calculation";
 import {getToken} from "@/utils/auth";
+import AddBill from "@/views/service/bill/addBill";
 export default {
     name: "addCredit",
-    components: {},
+    components: {AddBill},
     data() {
         return {
             // 总条数
@@ -350,6 +358,7 @@ export default {
             },
             // 是否显示弹出层
             open: false,
+            openAddBill: false,
            //授信
            creditLineList:[],
            //接收方
@@ -389,7 +398,8 @@ export default {
             openFile:false,
             wordUrl: "",
             show:false,
-            heid:false
+            heid:false,
+            chooseTicket:[]
         };
     },
     watch:{
@@ -404,6 +414,8 @@ export default {
                 this.form.receiveName = response.data.receiveName;
                 //开立方
                 this.form.openName = response.data.openName;
+                //开立方
+                this.form.zfiCoreId = response.data.zfiCoreId;
                 //创建人
                 this.form.createName = response.data.createName;
                 //签发金额大写
@@ -427,10 +439,11 @@ export default {
         },
         //应收账款查询列表
         getAccountsCollection() {
-            getAccountsCollection(this.queryParamsPay).then((response) => {
+           return getAccountsCollection(this.queryParamsPay).then((response) => {
                 this.payList = response.data.records;
                 this.selectChecked();
                 this.total = response.data.total;
+                return Promise.resolve(response)
             });
         },
         //获取附件信息
@@ -508,6 +521,7 @@ export default {
         // 确认选择
       closeTicket() {
         if(this.chooseTicket){
+                var flag = true;
                 //如果长度大于1,则需要进行对比应收企业和预计还款日期是否一致
                 if(this.chooseTicket.length > 1){
                     //获取选中第一个的应付企业
@@ -516,28 +530,32 @@ export default {
                     var zbiPayDate = this.chooseTicket[0].zbiPayDate;
                     for(var i = 0 ;i < this.chooseTicket.length;i++){
                         if(payName != this.chooseTicket[i].payName){
-                                this.$message({
-                                    message: '请选择应付企业相同的应付账款',
-                                    type: 'warning'
-                                });
-                                return;
+                            flag = false
+                            this.$message({
+                                message: '请选择应付企业相同的应付账款',
+                                type: 'warning'
+                            });
+                            return false;
                         }
                         if(zbiPayDate != this.chooseTicket[i].zbiPayDate){
-                                this.$message({
-                                    message: '请选择预计还款日期相同的应付账款',
-                                    type: 'warning'
-                                });
-                                return;
+                            flag = false
+                            this.$message({
+                                message: '请选择预计还款日期相同的应付账款',
+                                type: 'warning'
+                            });
+                            return false;
                         }
                     }
                 }
-                //合计
-                this.getReTotal(this.chooseTicket);
-                this.ticketList = this.chooseTicket;
-                //附件
-                this.getFile(this.ticketList);
-                //开立方赋值
-                 this.$set(this.form, "openName",this.chooseTicket[0].payName);
+                if(flag){
+                    //合计
+                    this.getReTotal(this.chooseTicket);
+                    this.ticketList = this.chooseTicket;
+                    //更新附件信息
+                    this.getFile(this.ticketList);
+                    //开立方赋值
+                    this.$set(this.form, "openName",this.chooseTicket[0].payName);
+                }
                 this.open = false;
         }else{
             this.$message({
@@ -813,6 +831,34 @@ export default {
       this.input=e.target.value
       this.form.zfiAmount=this.input
     },
+    //新增应付
+    addPay(){
+        if(this.form.zfiCoreId){
+            this.openAddBill = true
+        }else{
+            this.$message({
+                message: "开立方不能为空",
+                type: "warning",
+            });
+        }
+    },
+    //新增账款回调
+    emitAddClick(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()
+                    }
+                });
+            }
+        })
+        self.openAddBill = false
+    }
     }
 };
 </script>

+ 57 - 20
front-vue/src/views/service/credit/creditApply.vue

@@ -4,6 +4,7 @@
                 <el-row>
                     <el-divider content-position="left" >应收账款</el-divider>
                 <el-form-item  style="margin-left: 100px">
+                    <el-button size="mini" type="success" @click="addPay">新增应收账款</el-button>
                     <el-button size="mini" type="primary" @click="openTicket">选择</el-button>
                     <el-button size="mini" @click="deleteTicekt">清空全部</el-button>
                     <el-form-item label="合计金额:"> 
@@ -245,6 +246,12 @@
             <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" @addClick="emitAddClick"></add-bill>
+        </el-dialog>
+
         <!--预览-->
         <el-dialog  :visible.sync="openFile" width="1000px" append-to-body>
             <img :src="wordUrl" v-if="show" width='450px' height='500px'/>
@@ -256,9 +263,10 @@
 import {getAccountsCollection,addCredit,getFile} from "@/api/service/credit/credit";
 import {accAdd} from "@/utils/calculation";
 import {getToken} from "@/utils/auth";
+import AddBill from "@/views/service/bill/addBill";
 export default {
     name: "creditApply",
-    components: {},
+    components: {AddBill},
     data() {
         return {
             // 总条数
@@ -300,6 +308,7 @@ export default {
             },
             // 是否显示弹出层
             open: false,
+            openAddBill: false,
            //应付账款
            payList:[],
            //应付账款表格数据
@@ -321,7 +330,8 @@ export default {
             openFile:false,
             wordUrl: "",
             show:false,
-            heid:false
+            heid:false,
+            chooseTicket:[]
           
         };
     },
@@ -339,10 +349,11 @@ export default {
         },
         //应收账款查询列表
         getAccountsCollection() {
-            getAccountsCollection(this.queryParamsPay).then((response) => {
+           return getAccountsCollection(this.queryParamsPay).then((response) => {
                 this.payList = response.data.records;
                 this.selectChecked();
                 this.total = response.data.total;
+                return Promise.resolve(response)
             });
         },
         resetQuerys() {
@@ -420,6 +431,7 @@ export default {
         // 确认选择
       closeTicket() {
         if(this.chooseTicket){
+                var flag = true;
                 //如果长度大于1,则需要进行对比应收企业和预计还款日期是否一致
                 if(this.chooseTicket.length > 1){
                     //获取选中第一个的应付企业
@@ -428,28 +440,32 @@ export default {
                     var zbiPayDate = this.chooseTicket[0].zbiPayDate;
                     for(var i = 0 ;i < this.chooseTicket.length;i++){
                         if(payName != this.chooseTicket[i].payName){
-                                this.$message({
-                                    message: '请选择应付企业相同的应付账款',
-                                    type: 'warning'
-                                });
-                                return;
+                            flag = false
+                            this.$message({
+                                message: '请选择应付企业相同的应付账款',
+                                type: 'warning'
+                            });
+                            return false;
                         }
                         if(zbiPayDate != this.chooseTicket[i].zbiPayDate){
-                                this.$message({
-                                    message: '请选择预计还款日期相同的应付账款',
-                                    type: 'warning'
-                                });
-                                return;
+                            flag = false
+                            this.$message({
+                                message: '请选择预计还款日期相同的应付账款',
+                                type: 'warning'
+                            });
+                            return false;
                         }
                     }
                 }
-                //合计
-                this.getReTotal(this.chooseTicket);
-                this.ticketList = this.chooseTicket;
-                //附件
-                this.getFile(this.ticketList);
-                //开立方赋值
-                 this.$set(this.form, "openName",this.chooseTicket[0].payName);
+                if(flag){
+                    //合计
+                    this.getReTotal(this.chooseTicket);
+                    this.ticketList = this.chooseTicket;
+                    //更新附件信息
+                    this.getFile(this.ticketList);
+                    //开立方赋值
+                    this.$set(this.form, "openName",this.chooseTicket[0].payName);
+                }
                 this.open = false;
         }else{
             this.$message({
@@ -733,6 +749,27 @@ export default {
       this.input=e.target.value
       this.form.zfiAmount=this.input
     },
+    //新增应付
+    addPay(){
+        this.openAddBill = true
+    },
+    //新增账款回调
+    emitAddClick(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()
+                    }
+                });
+            }
+        })
+        self.openAddBill = false
+    }
        
     }
 };