Quellcode durchsuchen

库存调拨新增名称非空校验并简化库区货架货位判断逻辑

yusheng vor 10 Monaten
Ursprung
Commit
87547a3268
1 geänderte Dateien mit 6 neuen und 15 gelöschten Zeilen
  1. 6 15
      src/views/warehouseManagement/inventoryAllocation/add.vue

+ 6 - 15
src/views/warehouseManagement/inventoryAllocation/add.vue

@@ -1095,6 +1095,9 @@
         }
       },
       submit(status) {
+        if (!this.tableData.name) {
+          return this.$message.error('名称不能为空!');
+        }
         if (this.tableData.length > 0) {
           let params = {
             categoryCode: this.tableData
@@ -1281,11 +1284,7 @@
             //   }
             // }
 
-            if (
-              this.params.inCargoAreaId &&
-              !this.params.inFreightId &&
-              !this.params.inShelvesId
-            ) {
+            if (!this.params.inFreightId && !this.params.inShelvesId) {
               // 只有调入库区
               for (let i = 0; i < this.selection.length; i++) {
                 console.log(this.selection[i].areaId);
@@ -1294,11 +1293,7 @@
                   return this.$message.error('所选物品库区与调入库区重复');
                 }
               }
-            } else if (
-              this.params.inCargoAreaId &&
-              this.params.inShelvesId &&
-              !this.params.inFreightId
-            ) {
+            } else if (this.params.inShelvesId && !this.params.inFreightId) {
               // 只有调入库区/货架
               for (let i = 0; i < this.selection.length; i++) {
                 if (this.selection[i].areaId == this.params.inCargoAreaId) {
@@ -1317,11 +1312,7 @@
                   // 库区不同直接录入
                 }
               }
-            } else if (
-              this.params.inCargoAreaId &&
-              this.params.inShelvesId &&
-              this.params.inFreightId
-            ) {
+            } else if (this.params.inShelvesId && this.params.inFreightId) {
               // 只有调入库区/货架/货位
               for (let i = 0; i < this.selection.length; i++) {
                 if (this.selection[i].areaId == this.params.inCargoAreaId) {