huang_an пре 2 година
родитељ
комит
541ea6aafe

+ 1 - 1
src/views/warehouseManagement/stockManagement/add.vue

@@ -435,7 +435,7 @@
                       placeholder="非必填"
                       @input="
                         (value) =>
-                          (row.univalence = value.replace(/^(0+)|[^\d]+/g, ''))
+                          (row.univalence = value.replace(/[^0-9.]+/g, ''))
                       "
                     >
                       <template slot="append">

+ 40 - 20
src/views/warehouseManagement/warehouseDefinition/components/WarehouseEdit.vue

@@ -203,38 +203,58 @@
             // this.init();
           }
         }
+      },
+      loadingVis: {
+        handler(val) {
+          console.log(val);
+          if (!val && this.type == '新建') {
+            this.formData = {
+              code: '',
+              name: '',
+              inventoryType: '',
+              remarks: '',
+              factoryId: '',
+              status: 1,
+              lockStatus: 0
+            };
+          }
+        }
       }
     },
     created() {},
     methods: {
       open(type, row) {
+        console.log(type);
         this.type = type;
         this.visible = true;
         this.init();
 
         if (type === '修改') {
+          console.log(1);
           this.loadingVis = true;
           this.$nextTick(async () => {
-            const { warehouseVO } = await warehouseDefinition.warehouseDetail(
-              row.id
-            );
-            if (warehouseVO.departmentId) {
-              let userData = await warehouseDefinition.getUserPage({
-                groupId: warehouseVO.departmentId,
-                size: 9999,
-                pageNum: 1
-              });
-              this.userList = userData.list;
-            }
-            this.formData = {
-              ...warehouseVO,
-              location: [
-                warehouseVO.province,
-                warehouseVO.city,
-                warehouseVO.area
-              ]
-            };
-            this.loadingVis = false;
+            setTimeout(async () => {
+              const { warehouseVO } = await warehouseDefinition.warehouseDetail(
+                row.id
+              );
+              if (warehouseVO.departmentId) {
+                let userData = await warehouseDefinition.getUserPage({
+                  groupId: warehouseVO.departmentId,
+                  size: 9999,
+                  pageNum: 1
+                });
+                this.userList = userData.list;
+              }
+              this.formData = {
+                ...warehouseVO,
+                location: [
+                  warehouseVO.province,
+                  warehouseVO.city,
+                  warehouseVO.area
+                ]
+              };
+              this.loadingVis = false;
+            }, 2000);
           });
         }