Browse Source

解决深拷贝的问题

Qukatie 1 day ago
parent
commit
f9fa25a97a

+ 3 - 3
src/views/tirePartsMall/purchaseService/outStorage/components/viewArea.vue

@@ -155,11 +155,11 @@ export default {
       this.form = form;
       this.query = row;
       this.index = index;
-      this.data = row.historyList;
+      this.data = this.deepClone(row.historyList);
       this.qtyMax = row.remainingNum;
       this.dialogVisible = true;
-      if(row.historyList.length==0){
-        this.onLoad()
+      if (row.historyList.length == 0) {
+        this.onLoad();
       }
     },
     submit() {

+ 1 - 1
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/components/viewArea.vue

@@ -176,7 +176,7 @@ export default {
       this.form = form;
       this.query = row;
       this.index = index;
-      this.data = row.historyList;
+      this.data = this.deepClone(row.historyList);
       this.qtyMax = row.remainingNum;
       this.dialogVisible = true;
     },

+ 1 - 1
src/views/tirePartsMall/salesManagement/Inventory/components/viewArea.vue

@@ -155,7 +155,7 @@ export default {
       this.form = form;
       this.query = row;
       this.index = index;
-      this.data = row.historyList;
+      this.data = this.deepClone(row.historyList);
       this.qtyMax = row.goodsNum;
       this.dialogVisible = true;
       if (row.historyList.length == 0) {

+ 1 - 1
src/views/tirePartsMall/salesManagement/outboundWorkOrder/components/viewArea.vue

@@ -154,7 +154,7 @@ export default {
       this.form = form;
       this.query = row;
       this.index = index;
-      this.data = row.historyList;
+      this.data = this.deepClone(row.historyList);
       this.qtyMax = row.remainingNum;
       this.dialogVisible = true;
       if (row.historyList.length == 0) {

+ 1 - 1
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/components/viewArea.vue

@@ -185,7 +185,7 @@ export default {
       this.form = form;
       this.query = row;
       this.index = index;
-      this.data = row.historyList;
+        this.data = this.deepClone(row.historyList);
       this.qtyMax = row.inventory;
       this.callInStorageId = form.callInStorageId;
       this.dialogVisible = true;

+ 10 - 4
src/views/tirePartsMall/salesService/inStorage/components/viewArea.vue

@@ -142,9 +142,15 @@ export default {
       });
     },
     addRow() {
-      this.data.push({
-        quantity: 0
-      });
+      if (this.data.length == 0) {
+        this.data.push({
+          quantity: this.qtyMax
+        });
+      }else{
+        this.data.push({
+          quantity: 0
+        });
+      }
     },
     rowDicChange(name, row, el) {
       if (name == "reservoirAreaName") {
@@ -176,7 +182,7 @@ export default {
       this.form = form;
       this.query = row;
       this.index = index;
-      this.data = row.historyList;
+      this.data = this.deepClone(row.historyList);
       this.qtyMax = row.remainingNum;
       this.dialogVisible = true;
     },