caojunjie hace 2 años
padre
commit
f6d9d740c3

+ 14 - 0
src/api/warehouseBusiness/warehouseInAndOutStock.js

@@ -86,6 +86,20 @@ export function delWarehousebills(fId) {
     method: 'delete'
   })
 }
+// 删除收付款
+export function delItem(fId) {
+  return request({
+    url: '/warehouseBusiness/warehousebillsfees/' + fId,
+    method: 'delete'
+  })
+}
+// 删除出入库
+export function delItemTwo(fId) {
+  return request({
+    url: '/warehouseBusiness/warehousebillsitems/' + fId,
+    method: 'delete'
+  })
+}
 
 // 导出仓库主(出入库)
 export function exportWarehousebills(query) {

+ 73 - 18
src/views/Warehousing/inAndOutStock/AddOrUpdate.vue

@@ -4474,7 +4474,9 @@ import {
   deliveryCalculation,
   matchWarehouse,
   feesCheck,
-  revokefeeCheck
+  delItem,
+  delItemTwo,
+  revokefeeChec
 } from "@/api/warehouseBusiness/warehouseInAndOutStock";
 import {operationAgreement} from "@/api/agreement/agreement";
 import {listCorps} from "@/api/basicdata/corps";
@@ -5499,7 +5501,7 @@ export default {
                 if (response.data.warehouseBillsItem) {
                   response.data.warehouseBillsItem.map((e) => {
                     e.fBsdate = Date.parse(e.fBsdate);
-                    e.fBusinessType = e.fBusinessType.toString();
+                    e.fBusinessType = e.fBusinessType ? e.fBusinessType.toString() : null;
                     e.fLntype = e.fLntype ? e.fLntype.toString() : null;
                   });
                   response.data.warehouseBillsItem.forEach(item => {
@@ -6672,7 +6674,7 @@ export default {
                         if (response.data.warehouseBillsItem) {
                           response.data.warehouseBillsItem.map((e) => {
                             e.fBsdate = Date.parse(e.fBsdate);
-                            e.fBusinessType = e.fBusinessType.toString();
+                            e.fBusinessType = e.fBusinessType ? e.fBusinessType.toString() : null;
                             e.fLntype = e.fLntype ? e.fLntype.toString() : null;
                           });
                           console.log(response.data.warehouseBillsItem)
@@ -7233,23 +7235,76 @@ export default {
       this.CntrTable.push(obj);
     },
     deleteRow(index, rows) {
-      rows.splice(index, 1);
+        this.$confirm("确定删除数据?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+        }).then(() => {
+            if (rows[index].fId) {
+                delItem(rows[index].fId).then(res => {
+                    this.$message({
+                        type: "success",
+                        message: "删除成功!"
+                    });
+                    rows.splice(index, 1);
+                });
+            } else {
+                this.$message({
+                    type: "success",
+                    message: "删除成功!"
+                });
+                rows.splice(index, 1);
+            }
+        });
     },
     wDeleteRow(index, rows) {
-      rows.splice(index, 1);
-      this.sumMum = 0;
-      this.detailList.map((e) => {
-        if (e.fQty) {
-          this.sumMum += e.fQty;
-        }
-      });
-      if (this.detailList.length == 0) {
-        this.form.fProductName = "";
-        this.form.fMarks = "";
-        this.form.fNetweight = 0;
-        this.form.fPlanvolumn = 0;
-        this.form.fGrossweight = 0;
-      }
+        this.$confirm("确定删除数据?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+        }).then(() => {
+            if (rows[index].fId) {
+                delItemTwo(rows[index].fId).then(res => {
+                    this.$message({
+                        type: "success",
+                        message: "删除成功!"
+                    });
+                    rows.splice(index, 1);
+                    this.sumMum = 0;
+                    this.detailList.map((e) => {
+                        if (e.fQty) {
+                            this.sumMum += e.fQty;
+                        }
+                    });
+                    if (this.detailList.length == 0) {
+                        this.form.fProductName = "";
+                        this.form.fMarks = "";
+                        this.form.fNetweight = 0;
+                        this.form.fPlanvolumn = 0;
+                        this.form.fGrossweight = 0;
+                    }
+                });
+            } else {
+                this.$message({
+                    type: "success",
+                    message: "删除成功!"
+                });
+                rows.splice(index, 1);
+                this.sumMum = 0;
+                this.detailList.map((e) => {
+                    if (e.fQty) {
+                        this.sumMum += e.fQty;
+                    }
+                });
+                if (this.detailList.length == 0) {
+                    this.form.fProductName = "";
+                    this.form.fMarks = "";
+                    this.form.fNetweight = 0;
+                    this.form.fPlanvolumn = 0;
+                    this.form.fGrossweight = 0;
+                }
+            }
+        });
     },
     // 入库明细新增list
     addRelevant(status) {