Jelajahi Sumber

更改签收方法

xuefy 4 tahun lalu
induk
melakukan
fcaf39af2f
1 mengubah file dengan 56 tambahan dan 2 penghapusan
  1. 56 2
      front-vue/src/views/service/credit/addInformation.vue

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

@@ -1125,8 +1125,62 @@ export default {
     },
     //签收
     sign(){
-        //预览文件
-        this.getContractFile();
+
+         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();
+                    });
+                }
+            }
+        });
     },
     //获取合同文件
     getContractFile(){