Browse Source

凯合订单、财务模块修改

wengyuwen 4 years ago
parent
commit
b899102786

+ 124 - 87
src/views/finance/applyForInvoice/chargeInvoice/index.vue

@@ -3120,28 +3120,61 @@ export default {
       const { columns, data } = param
       const sums = []
       columns.forEach((column, index) => {
-        sums[0] = '合计'
-        sums[10] = this.totAL.toFixed(2)
-        sums[9] = this.Ttime.toFixed(2)
+        if(this.selection.length == 0){
+          if (index === 0) {
+            sums[index] = "合计";
+          } else if ( column.label == '金额' || column.label == '本次金额') {
+            const values = data.map((item) => Number(item[column.property]));
+            if (!values.every((value) => isNaN(value))) {
+              sums[index] = values.reduce((prev, curr) => {
+                const value = Number(curr);
+                if (!isNaN(value)) {
+                  return prev + curr;
+                } else {
+                  return prev;
+                }
+              }, 0);
+            }
+          }
+        }else{
+          if (index === 0) {
+            sums[index] = "合计";
+          } else if (column.label == '金额' || column.label == '本次金额') {
+            const values = this.selection.map((selection) => Number(selection[column.property]));
+            if (!values.every((value) => isNaN(value))) {
+              sums[index] = values.reduce((prev, curr) => {
+                const value = Number(curr);
+                if (!isNaN(value)) {
+                  return prev + curr;
+                } else {
+                  return prev;
+                }
+              }, 0);
+            }
+          }
+        }
+        // sums[0] = '合计'
+        // sums[10] = this.totAL.toFixed(2)
+        // sums[9] = this.Ttime.toFixed(2)
       })
       return sums
     },
     // 导入多选框
     handleSelectionChange_s(selection) {
-      this.totAL = 0
-      this.Ttime = 0
+      // this.totAL = 0
+      // this.Ttime = 0
       this.selection = selection
-      if (this.selection.length == 0) {
-        for (let item in this.chargeList_s) {
-          this.totAL += Number(this.chargeList_s[item].fAmt)
-          this.Ttime += Number(this.chargeList_s[item].fAmtdr)
-        }
-      } else {
-        for (let index in selection) {
-          this.totAL += Number(selection[index].fAmt)
-          this.Ttime += Number(selection[index].fAmtdr)
-        }
-      }
+      // if (this.selection.length == 0) {
+      //   for (let item in this.chargeList_s) {
+      //     this.totAL += Number(this.chargeList_s[item].fAmt)
+      //     this.Ttime += Number(this.chargeList_s[item].fAmtdr)
+      //   }
+      // } else {
+      //   for (let index in selection) {
+      //     this.totAL += Number(selection[index].fAmt)
+      //     this.Ttime += Number(selection[index].fAmtdr)
+      //   }
+      // }
       // this.getSummaries()
     },
     // 多选框选中数据
@@ -3239,72 +3272,75 @@ export default {
                 fSystemType: Cookies.get('sysType')
               }
               return
-            } else {
-              for (let li in this.increase_s) {
-                if (this.selection[item].fSrcid !== this.increase_s[li].fSrcid) {
-                  this.Fee = this.increase_s.concat(this.selection)
-                  console.log(this.Fee)
-                  let result = []
-                  let obj = {}
-                  for (let lis in this.Fee) {
-                    if (!obj[this.Fee[lis].fSrcid]) {
-                      result.push(this.Fee[lis])
-                      obj[this.Fee[lis].fSrcid] = true
-                    }
+            }
+          }
+          for (let li in this.increase_s) {
+            for(let item in this.selection){
+              if (this.selection[item].fSrcid !== this.increase_s[li].fSrcid) {
+                this.Fee = this.increase_s.concat(this.selection)
+                console.log(this.Fee)
+                let result = []
+                let obj = {}
+                for (let lis in this.Fee) {
+                  if (!obj[this.Fee[lis].fSrcid]) {
+                    result.push(this.Fee[lis])
+                    obj[this.Fee[lis].fSrcid] = true
                   }
-                  //去重提单号
-                  this.empty = new Set(this.empty)
-                  this.empty = Array.from(this.empty)
-                  //去重货权方
-                  this.nothing = new Set(this.nothing)
-                  this.nothing = Array.from(this.nothing)
+                }
+                //去重提单号
+                this.empty = new Set(this.empty)
+                this.empty = Array.from(this.empty)
+                //去重货权方
+                this.nothing = new Set(this.nothing)
+                this.nothing = Array.from(this.nothing)
 
-                  if (this.empty.length <= 1) {
-                    this.pass.fMblno = this.empty[0]
-                  } else {
-                    this.pass.fMblno = this.empty[0] + '...'
-                  }
-                  if (this.nothing.length <= 1) {
-                    this.pass.fName = this.nothing[0]
-                  } else {
-                    this.pass.fName = this.nothing[0] + '...'
-                  }
-                  // this.increase_s = this.increase_s.concat(this.selection);
-                  this.queryParams.tMblno = this.pass.fMblno //提单号
-                  this.queryParams.fCtrlcorpid = this.pass.fName
-                  this.queryParams.fCorpid = this.queryParameter.fToCorpid
-                  this.queryParams.fAmtcr = Number(this.pass.fAmtcr).toFixed(2)
-                  this.queryParams.fAmtdr = Number(this.pass.fAmtdr).toFixed(2)
-                  this.innerVisible = false
-                  this.chargeList_s = []
-                  this.queryParameter = {
-                    fCorpid: '',
-                    fToCorpid: this.queryParams.fCorpid,
-                    fMblno: '',
-                    fStatementNo: '',
-                    fFeeid: '',
-                    fBilltype: '',
-                    fBusinessType: '',
-                    fVslid: '',
-                    fVoyid: '',
-                    timeExamine: '',
-                    timeInterval: '',
-                    fSystemType: Cookies.get('sysType')
-                  }
-                  this.increase_s = result
+                if (this.empty.length <= 1) {
+                  this.pass.fMblno = this.empty[0]
+                } else {
+                  this.pass.fMblno = this.empty[0] + '...'
+                }
+                if (this.nothing.length <= 1) {
+                  this.pass.fName = this.nothing[0]
                 } else {
-                  let i = Number(item) + 1
-                  Num += i + '、'
+                  this.pass.fName = this.nothing[0] + '...'
                 }
+                // this.increase_s = this.increase_s.concat(this.selection);
+                this.queryParams.tMblno = this.pass.fMblno //提单号
+                this.queryParams.fCtrlcorpid = this.pass.fName
+                this.queryParams.fCorpid = this.queryParameter.fToCorpid
+                this.queryParams.fAmtcr = Number(this.pass.fAmtcr).toFixed(2)
+                this.queryParams.fAmtdr = Number(this.pass.fAmtdr).toFixed(2)
+                this.innerVisible = false
+                this.chargeList_s = []
+                this.queryParameter = {
+                  fCorpid: '',
+                  fToCorpid: this.queryParams.fCorpid,
+                  fMblno: '',
+                  fStatementNo: '',
+                  fFeeid: '',
+                  fBilltype: '',
+                  fBusinessType: '',
+                  fVslid: '',
+                  fVoyid: '',
+                  timeExamine: '',
+                  timeInterval: '',
+                  fSystemType: Cookies.get('sysType')
+                }
+                this.increase_s = result
+              } else {
+                let i = Number(li) + 1
+                Num += i + '、'
               }
             }
           }
-          MessageBox.confirm('选中的第' + (Num).slice(0, Num.length - 1) + '行重复,请重新选择', {
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              type: 'warning'
-            }
-          )
+          if(Num.length != 0){
+            MessageBox.confirm("从表的第" + (Num).slice(0,Num.length-1) + "行重复,如本次金额变更,请删除后重新选择","提示",{
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+              }
+            )
+          }
         }
       } else if (this.state_s == false) {
         this.$message.error('本次金额不能大于原定金额')
@@ -3358,19 +3394,20 @@ export default {
       if (this.notChange == true) {
         this.mainTable = false
       } else {
-        MessageBox.confirm('是否已保存?', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          }
-        ).then(() => {
-          this.activeIndex = '1'
-          console.log('1')
-          this.mainTable = false
-          this.approve = false
-          this.getList()
-          this.reset()
+        this.$confirm("返回列表,是否保存?", "提示", {
+          confirmButtonText: "保存",
+          cancelButtonText: "取消",
+          type: "warning",
         })
+          .then(() => {
+            this.submitForm(Cookies.get("sysType"))
+            this.mainTable = false
+            this.getList();
+          })
+          .catch(() => {
+            this.mainTable = false
+            this.getList();
+          });
       }
     },
     // 表单重置

+ 86 - 42
src/views/finance/charge/index.vue

@@ -2717,28 +2717,61 @@ export default {
       const { columns, data } = param;
       const sums = [];
       columns.forEach((column, index) => {
-        sums[0] = "合计";
-        sums[10] = this.totAL.toFixed(2);
-        sums[9] = this.Ttime.toFixed(2);
+        if(this.selection.length == 0){
+          if (index === 0) {
+            sums[index] = "合计";
+          } else if ( column.label == '金额' || column.label == '本次金额') {
+            const values = data.map((item) => Number(item[column.property]));
+            if (!values.every((value) => isNaN(value))) {
+              sums[index] = values.reduce((prev, curr) => {
+                const value = Number(curr);
+                if (!isNaN(value)) {
+                  return prev + curr;
+                } else {
+                  return prev;
+                }
+              }, 0);
+            }
+          }
+        }else{
+          if (index === 0) {
+            sums[index] = "合计";
+          } else if (column.label == '金额' || column.label == '本次金额') {
+            const values = this.selection.map((selection) => Number(selection[column.property]));
+            if (!values.every((value) => isNaN(value))) {
+              sums[index] = values.reduce((prev, curr) => {
+                const value = Number(curr);
+                if (!isNaN(value)) {
+                  return prev + curr;
+                } else {
+                  return prev;
+                }
+              }, 0);
+            }
+          }
+        }
+        // sums[0] = "合计";
+        // sums[10] = this.totAL.toFixed(2);
+        // sums[9] = this.Ttime.toFixed(2);
       });
       return sums;
     },
     // 导入多选框
     handleSelectionChange_s(selection) {
-      this.totAL = 0;
-      this.Ttime = 0;
+      // this.totAL = 0;
+      // this.Ttime = 0;
       this.selection = selection;
-      if (this.selection.length == 0) {
-        for (let item in this.chargeList_s) {
-          this.totAL += Number(this.chargeList_s[item].fAmt);
-          this.Ttime += Number(this.chargeList_s[item].fAmtdr);
-        }
-      } else {
-        for (let index in selection) {
-          this.totAL += Number(selection[index].fAmt);
-          this.Ttime += Number(selection[index].fAmtdr);
-        }
-      }
+      // if (this.selection.length == 0) {
+      //   for (let item in this.chargeList_s) {
+      //     this.totAL += Number(this.chargeList_s[item].fAmt);
+      //     this.Ttime += Number(this.chargeList_s[item].fAmtdr);
+      //   }
+      // } else {
+      //   for (let index in selection) {
+      //     this.totAL += Number(selection[index].fAmt);
+      //     this.Ttime += Number(selection[index].fAmtdr);
+      //   }
+      // }
       // this.getSummaries()
     },
     // 多选框选中数据
@@ -2837,21 +2870,21 @@ export default {
                 fSystemType: Cookies.get("sysType")
               };
               return
-            }else {
-              for (let li in this.increase_s) {
+            }
+          }
+          for (let li in this.increase_s) {
+              for(let item in this.selection) {
                 if (this.selection[item].fSrcid !== this.increase_s[li].fSrcid) {
-                  for(let li in this.increase_s){
-                    if(this.increase_s[li].fSrcdc == 'D'){
-                      this.increase_s[li].fSrcdc = "收"
-                    }else if(this.increase_s[li].fSrcdc == 'C'){
-                      this.increase_s[li].fSrcdc = "付"
-                    }
-                  }
                   this.Fee = this.increase_s.concat(this.selection);
                   console.log(this.Fee);
                   let result = [];
                   let obj = {};
                   for (let lis in this.Fee) {
+                    if(this.Fee[lis].fSrcdc == 'D'){
+                      this.Fee[lis].fSrcdc = "收"
+                    }else if(this.Fee[lis].fSrcdc == 'C'){
+                      this.Fee[lis].fSrcdc = "付"
+                    }
                     if (!obj[this.Fee[lis].fSrcid]) {
                       result.push(this.Fee[lis]);
                       obj[this.Fee[lis].fSrcid] = true;
@@ -2898,18 +2931,19 @@ export default {
                   };
                   this.increase_s = result;
                 } else {
-                  let i = Number(item) + 1;
+                  let i = Number(li) + 1;
                   Num += i + '、'
                 }
               }
             }
+          if(Num.length != 0){
+            MessageBox.confirm("从表的第" + (Num).slice(0,Num.length-1) + "行重复,如本次金额变更,请删除后重新选择","提示",{
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+              }
+            )
           }
-          MessageBox.confirm("选中的第" + (Num).slice(0,Num.length-1) + "行重复,请重新选择",{
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              type: 'warning'
-            }
-          )
         }
       } else if (this.state_s == false) {
         this.$message.error("本次金额不能大于原定金额");
@@ -2956,17 +2990,20 @@ export default {
       if(this.notChange == true){
         this.mainTable = false
       }else{
-        MessageBox.confirm("是否已保存?",{
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          }
-        ).then(() => {
-          this.mainTable = false
-          this.approve = false;
-          this.getList();
-          this.reset();
+        this.$confirm("返回列表,是否保存?", "提示", {
+          confirmButtonText: "保存",
+          cancelButtonText: "取消",
+          type: "warning",
         })
+          .then(() => {
+            this.submitForm()
+            this.mainTable = false
+            this.getList();
+          })
+          .catch(() => {
+            this.mainTable = false
+            this.getList();
+          });
       }
     },
     // 表单重置
@@ -3350,6 +3387,13 @@ export default {
           }else if(Cookies.get("sysType") == 3){
             this.queryParams.fBillstatus = "1";
             let formData = new window.FormData();
+            for(let li in this.increase_s){
+              if(this.increase_s[li].fSrcdc == '收'){
+                this.increase_s[li].fSrcdc = 'D'
+              }else if(this.increase_s[li].fSrcdc == '付'){
+                this.increase_s[li].fSrcdc = 'C'
+              }
+            }
             formData.append("tFee", JSON.stringify(this.queryParams));
             formData.append("tFeeDo", JSON.stringify(this.increase_s));
             formData.append("billsType", 'KHSF');

+ 89 - 41
src/views/finance/contrast/index.vue

@@ -2002,7 +2002,7 @@ export default {
     getRow2() {
       let that = this;
       this.data = {
-        tableName: "对账明细",
+        tableName: "-列表对账明细",
         userId: Cookies.get("userName"),
       };
       select(this.data).then((res) => {
@@ -2027,7 +2027,7 @@ export default {
     save2() {
       this.showSetting2 = false;
       this.data = {
-        tableName: "对账明细",
+        tableName: "-列表对账明细",
         userId: Cookies.get("userName"),
         sysTableSetList: this.setRowList2,
       };
@@ -2038,7 +2038,7 @@ export default {
     //重置列表
     delRow2() {
       this.data = {
-        tableName: "对账明细",
+        tableName: "-列表对账明细",
         userId: Cookies.get("userName"),
       };
       resetModule(this.data).then((res) => {
@@ -2462,28 +2462,58 @@ export default {
       const { columns, data } = param;
       const sums = [];
       columns.forEach((column, index) => {
-        sums[0] = "合计";
-        sums[10] = this.totAL.toFixed(2);
-        sums[9] = this.Ttime.toFixed(2);
+        if(this.selection.length == 0){
+          if (index === 0) {
+            sums[index] = "合计";
+          } else if ( column.label == '金额' || column.label == '本次金额') {
+            const values = data.map((item) => Number(item[column.property]));
+            if (!values.every((value) => isNaN(value))) {
+              sums[index] = values.reduce((prev, curr) => {
+                const value = Number(curr);
+                if (!isNaN(value)) {
+                  return prev + curr;
+                } else {
+                  return prev;
+                }
+              }, 0);
+            }
+          }
+        }else{
+          if (index === 0) {
+            sums[index] = "合计";
+          } else if (column.label == '金额' || column.label == '本次金额') {
+            const values = this.selection.map((selection) => Number(selection[column.property]));
+            if (!values.every((value) => isNaN(value))) {
+              sums[index] = values.reduce((prev, curr) => {
+                const value = Number(curr);
+                if (!isNaN(value)) {
+                  return prev + curr;
+                } else {
+                  return prev;
+                }
+              }, 0);
+            }
+          }
+        }
       });
       return sums;
     },
     // 导入多选框
     handleSelectionChange_s(selection) {
-      this.totAL = 0;
-      this.Ttime = 0;
+      // this.totAL = 0;
+      // this.Ttime = 0;
       this.selection = selection;
-      if (this.selection.length == 0) {
-        for (let item in this.feeList) {
-          this.totAL += Number(this.feeList[item].fAmt);
-          this.Ttime += Number(this.feeList[item].fAmtdr);
-        }
-      } else {
-        for (let index in selection) {
-          this.totAL += Number(selection[index].fAmt);
-          this.Ttime += Number(selection[index].fAmtdr);
-        }
-      }
+      // if (this.selection.length == 0) {
+      //   for (let item in this.feeList) {
+      //     this.totAL += Number(this.feeList[item].fAmt);
+      //     this.Ttime += Number(this.feeList[item].fAmtdr);
+      //   }
+      // } else {
+      //   for (let index in selection) {
+      //     this.totAL += Number(selection[index].fAmt);
+      //     this.Ttime += Number(selection[index].fAmtdr);
+      //   }
+      // }
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
@@ -2541,6 +2571,13 @@ export default {
             this.nothing.push(this.selection[item].fName);
             if (this.DzfeeList.length === 0) {
               this.DzfeeList = this.DzfeeList.concat(this.selection);
+              for(let li in this.DzfeeList){
+                if(this.DzfeeList[li].fSrcdc == 'D'){
+                  this.DzfeeList[li].fSrcdc = "收"
+                }else if(this.DzfeeList[li].fSrcdc == 'C'){
+                  this.DzfeeList[li].fSrcdc = "付"
+                }
+              }
 
               //去重提单号
               this.empty = new Set(this.empty);
@@ -2581,14 +2618,20 @@ export default {
                 fDc: "D",
               };
               return;
-            } else {
-              for (let li in this.DzfeeList) {
+            }
+          }
+          for (let li in this.DzfeeList) {
+            for(let item in this.selection){
                 if (this.selection[item].fSrcid !== this.DzfeeList[li].fSrcid) {
                   this.Fee = this.DzfeeList.concat(this.selection);
-                  console.log(this.Fee);
                   let result = [];
                   let obj = {};
                   for (let lis in this.Fee) {
+                    if(this.Fee[lis].fSrcdc == 'D'){
+                      this.Fee[lis].fSrcdc = "收"
+                    }else if(this.Fee[lis].fSrcdc == 'C'){
+                      this.Fee[lis].fSrcdc = "付"
+                    }
                     if (!obj[this.Fee[lis].fSrcid]) {
                       result.push(this.Fee[lis]);
                       obj[this.Fee[lis].fSrcid] = true;
@@ -2634,18 +2677,20 @@ export default {
                   };
                   this.DzfeeList = result;
                 } else {
-                  let i = Number(item) + 1;
+                  console.log("222",this.selection[item].fSrcid)
+                  let i = Number(li) + 1;
                   Num += i + '、'
                 }
               }
-            }
           }
-          MessageBox.confirm("选中的第" + (Num).slice(0,Num.length-1) + "行重复,请重新选择",{
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              type: 'warning'
-            }
-          )
+          if(Num.length != 0){
+            MessageBox.confirm("从表的第" + (Num).slice(0,Num.length-1) + "行重复,如本次金额变更,请删除后重新选择","提示",{
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+              }
+            )
+          }
         }
       } else if (this.state_s == false) {
         this.$message.error("本次金额不能大于原定金额");
@@ -2769,18 +2814,21 @@ export default {
     cancel() {
       if(this.notChange == true){
         this.mainTable = false
-      }else{
-        MessageBox.confirm("是否已保存?",{
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          }
-        ).then(() => {
-          this.mainTable = false
-          this.reset();
-          this.getList();
-          this.queryParams.fSystemType = "";
+      }else {
+        this.$confirm("返回列表,是否保存?", "提示", {
+          confirmButtonText: "保存",
+          cancelButtonText: "取消",
+          type: "warning",
         })
+          .then(() => {
+            this.submitForm(Cookies.get("sysType"))
+            this.mainTable = false
+            this.getList();
+          })
+        .catch(() => {
+            this.mainTable = false
+            this.getList();
+          });
       }
     },
     // 表单重置

+ 141 - 89
src/views/finance/payment/index.vue

@@ -599,10 +599,10 @@
             @click="addOrUpdateHandle"
           >查看审批流</el-button
           >
-          <el-button type="primary" @click="submitForm" size="mini" :disabled="notChange"
+          <el-button type="success" @click="submitForm" size="mini" :disabled="notChange"
           >保 存</el-button
           >
-          <el-button @click="addPage" size="mini">新 增</el-button>
+          <el-button type="primary" @click="addPage" size="mini">新 增</el-button>
         </div>
         <div style="margin: 0 12px">
           <el-button
@@ -3409,28 +3409,61 @@ export default {
       const { columns, data } = param;
       const sums = [];
       columns.forEach((column, index) => {
-        sums[0] = "合计";
-        sums[10] = this.totAL.toFixed(2);
-        sums[9] = this.Ttime.toFixed(2);
+        if(this.selection.length == 0){
+          if (index === 0) {
+            sums[index] = "合计";
+          } else if ( column.label == '金额' || column.label == '本次金额') {
+            const values = data.map((item) => Number(item[column.property]));
+            if (!values.every((value) => isNaN(value))) {
+              sums[index] = values.reduce((prev, curr) => {
+                const value = Number(curr);
+                if (!isNaN(value)) {
+                  return prev + curr;
+                } else {
+                  return prev;
+                }
+              }, 0);
+            }
+          }
+        }else{
+          if (index === 0) {
+            sums[index] = "合计";
+          } else if (column.label == '金额' || column.label == '本次金额') {
+            const values = this.selection.map((selection) => Number(selection[column.property]));
+            if (!values.every((value) => isNaN(value))) {
+              sums[index] = values.reduce((prev, curr) => {
+                const value = Number(curr);
+                if (!isNaN(value)) {
+                  return prev + curr;
+                } else {
+                  return prev;
+                }
+              }, 0);
+            }
+          }
+        }
+        // sums[0] = "合计";
+        // sums[10] = this.totAL.toFixed(2);
+        // sums[9] = this.Ttime.toFixed(2);
       });
       return sums;
     },
     // 导入多选框
     handleSelectionChange_s(selection) {
-      this.totAL = 0;
-      this.Ttime = 0;
+      // this.totAL = 0;
+      // this.Ttime = 0;
       this.selection = selection;
-      if (this.selection.length == 0) {
-        for (let item in this.chargeList_s) {
-          this.totAL += Number(this.chargeList_s[item].fAmt);
-          this.Ttime += Number(this.chargeList_s[item].fAmtdr);
-        }
-      } else {
-        for (let index in selection) {
-          this.totAL += Number(selection[index].fAmt);
-          this.Ttime += Number(selection[index].fAmtdr);
-        }
-      }
+      // if (this.selection.length == 0) {
+      //   for (let item in this.chargeList_s) {
+      //     this.totAL += Number(this.chargeList_s[item].fAmt);
+      //     this.Ttime += Number(this.chargeList_s[item].fAmtdr);
+      //   }
+      // } else {
+      //   for (let index in selection) {
+      //     this.totAL += Number(selection[index].fAmt);
+      //     this.Ttime += Number(selection[index].fAmtdr);
+      //   }
+      // }
       // this.getSummaries()
     },
     // 多选框选中数据
@@ -3485,6 +3518,13 @@ export default {
             this.nothing.push(this.selection[item].fName);
             if (this.increase_s.length === 0) {
               this.increase_s = this.increase_s.concat(this.selection);
+              for(let li in this.increase_s){
+                if(this.increase_s[li].fSrcdc == 'D'){
+                  this.increase_s[li].fSrcdc = "收"
+                }else if(this.increase_s[li].fSrcdc == 'C'){
+                  this.increase_s[li].fSrcdc = "付"
+                }
+              }
               //去重提单号
               this.empty = new Set(this.empty);
               this.empty = Array.from(this.empty);
@@ -3520,71 +3560,80 @@ export default {
                 fSystemType: Cookies.get("sysType")
               };
               return
-            }else{
-              for (let li in this.increase_s) {
-                if (this.selection[item].fSrcid !== this.increase_s[li].fSrcid) {
-                  this.Fee = this.increase_s.concat(this.selection);
-                  let result = [];
-                  let obj = {};
-                  for (let lis in this.Fee) {
-                    if (!obj[this.Fee[lis].fSrcid]) {
-                      result.push(this.Fee[lis]);
-                      obj[this.Fee[lis].fSrcid] = true;
-                    }
-                  }
-                  //去重提单号
-                  this.empty = new Set(this.empty);
-                  this.empty = Array.from(this.empty);
-                  //去重货权方
-                  this.nothing = new Set(this.nothing);
-                  this.nothing = Array.from(this.nothing);
-
-                  if (this.empty.length <= 1) {
-                    this.pass.fMblno = this.empty[0];
-                  } else {
-                    this.pass.fMblno = this.empty[0] + "...";
-                  }
-                  if (this.nothing.length <= 1) {
-                    this.pass.fName = this.nothing[0];
-                  } else {
-                    this.pass.fName = this.nothing[0] + "...";
-                  }
-                  // this.increase_s = this.increase_s.concat(this.selection);
-                  this.queryParams.tMblno = this.pass.fMblno; //提单号
-                  this.queryParams.fCtrlcorpid = this.pass.fName;
-                  this.queryParams.fCorpid = this.queryParameter.fToCorpid;
-                  this.queryParams.fAmtcr = Number(this.pass.fAmtcr).toFixed(2);
-                  this.queryParams.fAmtdr = Number(this.pass.fAmtdr).toFixed(2);
-                  this.innerVisible = false;
-                  this.chargeList_s = [];
-                  this.queryParameter = {
-                    fCorpid: "",
-                    fToCorpid: this.queryParams.fCorpid,
-                    fMblno: "",
-                    fStatementNo: "",
-                    fFeeid: "",
-                    fBilltype: "",
-                    fBusinessType: "",
-                    fVslid: "",
-                    fVoyid: "",
-                    timeExamine: "",
-                    timeInterval: "",
-                    fSystemType: Cookies.get("sysType")
-                  };
-                  this.increase_s = result;
-                } else {
-                  let i = Number(item) + 1;
-                  Num += i + '、'
+            }
+          }
+          for (let li in this.increase_s) {
+            for(let item in this.selection) {
+            if (this.selection[item].fSrcid !== this.increase_s[li].fSrcid) {
+              this.Fee = this.increase_s.concat(this.selection);
+              let result = [];
+              let obj = {};
+              for (let lis in this.Fee) {
+                if(this.Fee[lis].fSrcdc == 'D'){
+                  this.Fee[lis].fSrcdc = "收"
+                }else if(this.Fee[lis].fSrcdc == 'C'){
+                  this.Fee[lis].fSrcdc = "付"
+                }
+                if (!obj[this.Fee[lis].fSrcid]) {
+                  result.push(this.Fee[lis]);
+                  obj[this.Fee[lis].fSrcid] = true;
                 }
               }
+              //去重提单号
+              this.empty = new Set(this.empty);
+              this.empty = Array.from(this.empty);
+              //去重货权方
+              this.nothing = new Set(this.nothing);
+              this.nothing = Array.from(this.nothing);
+
+              if (this.empty.length <= 1) {
+                this.pass.fMblno = this.empty[0];
+              } else {
+                this.pass.fMblno = this.empty[0] + "...";
+              }
+              if (this.nothing.length <= 1) {
+                this.pass.fName = this.nothing[0];
+              } else {
+                this.pass.fName = this.nothing[0] + "...";
+              }
+              // this.increase_s = this.increase_s.concat(this.selection);
+              this.queryParams.tMblno = this.pass.fMblno; //提单号
+              this.queryParams.fCtrlcorpid = this.pass.fName;
+              this.queryParams.fCorpid = this.queryParameter.fToCorpid;
+              this.queryParams.fAmtcr = Number(this.pass.fAmtcr).toFixed(2);
+              this.queryParams.fAmtdr = Number(this.pass.fAmtdr).toFixed(2);
+              this.innerVisible = false;
+              this.chargeList_s = [];
+              this.queryParameter = {
+                fCorpid: "",
+                fToCorpid: this.queryParams.fCorpid,
+                fMblno: "",
+                fStatementNo: "",
+                fFeeid: "",
+                fBilltype: "",
+                fBusinessType: "",
+                fVslid: "",
+                fVoyid: "",
+                timeExamine: "",
+                timeInterval: "",
+                fSystemType: Cookies.get("sysType")
+              };
+              this.increase_s = result;
+            } else {
+              let i = Number(li) + 1;
+              Num += i + '、'
             }
-          }
-          MessageBox.confirm("选中的第" + (Num).slice(0,Num.length-1) + "行重复,请重新选择",{
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              type: 'warning'
+
             }
-          )
+          }
+          if(Num.length != 0){
+            MessageBox.confirm("从表的第" + (Num).slice(0,Num.length-1) + "行重复,如本次金额变更,请删除后重新选择","提示",{
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+              }
+            )
+          }
         }
       } else if (this.state_s == false) {
         this.$message.error("本次金额不能大于原定金额");
@@ -3629,17 +3678,20 @@ export default {
       if(this.notChange == true){
         this.mainTable = false
       }else{
-        MessageBox.confirm("是否已保存?",{
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          }
-        ).then(()=>{
-          this.mainTable = false
-          this.approve = false;
-          this.getList();
-          this.reset();
+        this.$confirm("返回列表,是否保存?", "提示", {
+          confirmButtonText: "保存",
+          cancelButtonText: "取消",
+          type: "warning",
         })
+          .then(() => {
+            this.submitForm(Cookies.get("sysType"))
+            this.mainTable = false
+            this.getList();
+          })
+          .catch(() => {
+            this.mainTable = false
+            this.getList();
+          });
       }
     },
     // 表单重置

+ 68 - 13
src/views/kaihe/domesticTrade/orderInformation/index.vue

@@ -1101,6 +1101,10 @@
       <el-button type="success" v-if="approVal" @click="addOrUpdateHand(form)">审 批</el-button>
       <el-button type="danger" :disabled="disappear" v-if="form.moneyStatus === 4 && current == before" @click="revokeTwo">撤销请核</el-button>
       <el-button type="primary" v-if="this.form.fBillstatus != 11 || this.form.moneyStatus != null && this.form.moneyStatus != 6"@click="addOrUpdateHandle(form)">查看审批</el-button>
+      <el-button icon="el-icon-arrow-left" type="danger" v-if="cancelButton === true" @click="cancel">返回列表</el-button>
+      <el-button icon="el-icon-arrow-left" type="danger" v-if="cancelButton === false" @click="cancelTwo"
+      >返回首页</el-button
+      >
     </div>
 <!--    附件查看-->
     <el-dialog
@@ -1272,6 +1276,7 @@ export default {
   },
   data() {
     return {
+      cancelButton: true,
       jumpDonot:false,
       disappear:false,
       businessTypeOptions:[],
@@ -1356,24 +1361,18 @@ export default {
       }
       this.formList = formDate
       this.approVal = true;
+      this.cancelButton = false;
     }else if(this.$route.query.data){
-      console.log("222")
-      console.log(JSON.parse(this.$route.query.data))
       formDate = {
         fId:JSON.parse(this.$route.query.data).fId,
         num:JSON.parse(this.$route.query.data).num
       }
-      console.log(formDate.num)
       this.id = formDate.fId
-      this.formList = formDate.fId
+      this.formList = {
+        fId:formDate.fId
+      }
       this.approVal = false;
     }
-    if(formDate.num){
-      this.jumpDonot = false
-    }else{
-      this.jumpDonot = true
-    }
-    console.log(formDate.fId)
     if (formDate) {
       addmodify(formDate).then(response => {
         console.log(response)
@@ -1389,7 +1388,21 @@ export default {
         })
         queryUserVal().then((response) => {
           this.current = response.user.userName;
+          console.log(this.current,this.before)
+          if(formDate.num){
+            this.jumpDonot = false
+            console.log(this.current)
+            console.log(this.before)
+            if(this.current == this.before){
+              console.log("111")
+              this.disappear = false;
+            }
+          }else{
+            this.jumpDonot = true
+            this.disappear = true;
+          }
         });
+
         this.goodsList = response.rows[0].tWarehousebillsCntrList
         this.estimatedTime = response.rows[0].tVoyageL
         this.dataList = response.rows[0].tWarehousebillsCntritemsList
@@ -1406,8 +1419,6 @@ export default {
             this.$set(this.warehouseCrList[item], 'fFeeUnitid', JSON.stringify(this.warehouseCrList[item].fFeeunitid))
           }
         }
-        if(this.current == this.before)
-        this.disappear = true;
       })
     }
   },
@@ -1452,6 +1463,47 @@ export default {
     });
   },
   methods: {
+    homePage() {
+      this.open = false;
+      let view = {
+        fullPath: "/finance/contrast",
+        hash: "",
+        matched: Array(2),
+        meta: Object,
+        name: "Contrast",
+        params: Object,
+        path: "/finance/contrast",
+        query: Object,
+        title: "对账",
+      };
+      this.$router.push({ path: "/index" });
+      this.$store
+        .dispatch("tagsView/delView", view)
+        .then(({ visitedViews }) => {
+          if (this.isActive(view)) {
+            this.toLastView(visitedViews, view);
+          }
+        });
+      Global.$emit("removeCache", "closeSelectedTag", view);
+    },
+    cancel(){
+      if(this.form.moneyStatus === 4){
+        this.$router.push({path:'/domesticTrade/myOrder'})
+      }else{
+        this.$confirm("返回列表,是否保存?", "提示", {
+          confirmButtonText: "保存",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(() => {
+            this.approval()
+            this.$router.push({path:'/domesticTrade/myOrder'})
+          })
+          .catch(() => {
+            this.$router.push({path:'/domesticTrade/myOrder'})
+          });
+      }
+  },
     //撤销审批
     revokeTwo() {
       let data = {
@@ -1578,9 +1630,9 @@ export default {
         })
       })
     },
+    //箱信息操作限制
     cntrWeight(res){
       if (res < 40 && res > 0){
-        console.log("1111");
         return
       }else if( res == '' || res == null){
         console.log("222")
@@ -1849,7 +1901,9 @@ export default {
       for(let item in this.warehouseCrList){
         this.warehouseCrList[item].fMblno = this.form.fMblno
       }
+      console.log(this.form)
       formData.append("tWarehousebills",JSON.stringify(form))
+      // formData.append("tWarehousebills",JSON.stringify(this.form))
       formData.append("tWarehousebillsCntritems",JSON.stringify(this.dataList))
       formData.append("tWarehousebillsfeesDr",JSON.stringify(this.warehouseDrList))
       formData.append("tWarehousebillsfeesCr",JSON.stringify(this.warehouseCrList))
@@ -1859,6 +1913,7 @@ export default {
         this.msgSuccess("操作成功");
         if(response.data.tWarehouseBills){
           this.form = response.data.tWarehouseBills
+          console.log(this.form)
         }
         if(response.data.tWarehousebillsCntritemsList){
           this.dataList = response.data.tWarehousebillsCntritemsList