Просмотр исходного кода

工序报工入库选择仓库有公司名称

695593266@qq.com 5 месяцев назад
Родитель
Сommit
0303970557
1 измененных файлов с 20 добавлено и 6 удалено
  1. 20 6
      src/views/produce/components/warehousing/index.vue

+ 20 - 6
src/views/produce/components/warehousing/index.vue

@@ -684,12 +684,25 @@
         });
       },
 
+      // getWarehouseListFn() {
+      //   getWarehouseList().then((res) => {
+      //     this.warehouseList = res.data.filter((item) => {
+      //       if (item.factoryId == this.$store.state.user.info.factoryId) {
+      //         item.name = item.factoryName + '-' + item.name;
+      //       }
+      //     });
+      //   });
+      // },
       getWarehouseListFn() {
-        getWarehouseList().then((res) => {
-          // this.warehouseList = res.data;
-          this.warehouseList = res.data.filter(
-            (item) => item.factoryId == this.$store.state.user.info.factoryId
-          );
+        const factoryId = this.$store.state.user.info.factoryId;
+
+        getWarehouseList().then(({ data = [] }) => {
+          this.warehouseList = data
+            .filter((item) => item.factoryId === factoryId)
+            .map((item) => ({
+              ...item,
+              name: `${item.factoryName}-${item.name}`
+            }));
         });
       },
 
@@ -970,6 +983,7 @@
       flex-direction: row;
       align-items: center;
       height: 100%;
+      width: 100%;
       .text {
         font-size: 12px;
         width: 100px;
@@ -981,7 +995,7 @@
       }
 
       .select-type {
-        width: 205px;
+        width: 250px;
         padding: 2px;
         box-sizing: border-box;
       }