Browse Source

签收方法修改

xuefy 3 years ago
parent
commit
debdadb7bb

+ 2 - 56
front-vue/src/views/service/credit/addInformation.vue

@@ -1127,62 +1127,8 @@ export default {
     },
     //签收
     sign(){
-
-         this.$refs["form"].validate(valid => {
-            if(this.ticketList.length < 1){
-                    this.$message({
-                        message: '请选择应收账款',
-                        type: 'warning'
-                    });
-                    return;
-            }
-            if(parseFloat(this.form.zfiAmount) > parseFloat(this.moneyDelete(this.checkTotalAmt))){
-                this.$message({
-                        message: '签发金额不可大于合计金额',
-                        type: 'warning'
-                    });
-                    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;
-                        this.$confirm('签发金额小于应收金额合计,是否确认提交', "警告", {
-                            confirmButtonText: "确定",
-                            cancelButtonText: "取消",
-                            type: "warning"
-                        }).then(function() {
-                           //应收账款
-                            _this.form.ticketList = _this.ticketList;
-                            addInfor(_this.form).then(response => {
-                                loading.close();
-                                //预览文件
-                                _this.getContractFile();
-                            }).catch((response)=>{
-                                loading.close();
-                            });
-                        }).catch((e) => {
-                                loading.close();
-                            });
-
-            }else{
-                    //应收账款
-                    this.form.ticketList = this.ticketList;
-                    addInfor(this.form).then(response => {
-                        loading.close();
-                        //预览文件
-                        this.getContractFile();
-                    }).catch((response)=>{
-                        loading.close();
-                    });
-                }
-            }
-        });
+        //预览文件
+         this.getContractFile();
     },
     //获取合同文件
     getContractFile(){

+ 64 - 59
front-vue/src/views/service/credit/signFor.vue

@@ -791,7 +791,7 @@ export default {
             this.availableAmt = response.data.remaining;
         });
     },
-    //修改
+    //内部审批
     submitForm(param){
         this.$refs["form"].validate(valid => {
             //通过
@@ -987,66 +987,71 @@ export default {
     },
     //签收
     sign(){
-
-        this.$refs["form"].validate(valid => {
-            //通过
-            if(this.ticketList.length < 1){
+        //融资方通过
+        if(this.zfiSupplierStatus == '01'){
+            //预览文件
+            this.getContractFile();
+        }else{
+                this.$refs["form"].validate(valid => {
+                //通过
+                if(this.ticketList.length < 1){
+                        this.$message({
+                            message: '请选择应收账款',
+                            type: 'warning'
+                        });
+                        return;
+                }
+                if(parseFloat(this.form.zfiAmount) > parseFloat(this.moneyDelete(this.checkTotalAmt))){
                     this.$message({
-                        message: '请选择应收账款',
-                        type: 'warning'
-                    });
-                    return;
-            }
-            if(parseFloat(this.form.zfiAmount) > parseFloat(this.moneyDelete(this.checkTotalAmt))){
-                this.$message({
-                        message: '签发金额不可大于合计金额',
-                        type: 'warning'
-                    });
-                    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;
-                        this.$confirm('签发金额小于应收金额合计,是否确认提交', "警告", {
-                            confirmButtonText: "确定",
-                            cancelButtonText: "取消",
-                            type: "warning"
-                        }).then(function() {
-                           //应收账款
-                            _this.form.ticketList = _this.ticketList;
-                             _this.form.flag = "00";
-                            signFor(_this.form).then(response => {
-                                 loading.close();
-                                 //预览文件
-                                 _this.getContractFile();
-                            }).catch((response)=>{
-                                loading.close();
-                            });
-                        }).catch((e) => {
-                                loading.close();
-                            });
+                            message: '签发金额不可大于合计金额',
+                            type: 'warning'
+                        });
+                        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;
+                            this.$confirm('签发金额小于应收金额合计,是否确认提交', "警告", {
+                                confirmButtonText: "确定",
+                                cancelButtonText: "取消",
+                                type: "warning"
+                            }).then(function() {
+                            //应收账款
+                                _this.form.ticketList = _this.ticketList;
+                                _this.form.flag = "00";
+                                signFor(_this.form).then(response => {
+                                    loading.close();
+                                    //预览文件
+                                    _this.getContractFile();
+                                }).catch((response)=>{
+                                    loading.close();
+                                });
+                            }).catch((e) => {
+                                    loading.close();
+                                });
 
-            }else{
-                    //应收账款
-                    this.form.ticketList = this.ticketList;
-                    this.form.flag = "00";
-                    signFor(this.form).then(response => {
-                         loading.close();
-                         //预览文件
-                        this.getContractFile();
-                    }).catch((response)=>{
-                        loading.close();
-                    });
-            }
-            }
-        });
+                }else{
+                        //应收账款
+                        this.form.ticketList = this.ticketList;
+                        this.form.flag = "00";
+                        signFor(this.form).then(response => {
+                            loading.close();
+                            //预览文件
+                            this.getContractFile();
+                        }).catch((response)=>{
+                            loading.close();
+                        });
+                }
+                }
+            });
+        }
 
     },
     //获取合同文件