huang_an 2 tahun lalu
induk
melakukan
f213accccf
2 mengubah file dengan 60 tambahan dan 5 penghapusan
  1. 8 0
      src/api/factoryModel/index.js
  2. 52 5
      src/views/ledgerAssets/equipment/edit.vue

+ 8 - 0
src/api/factoryModel/index.js

@@ -12,6 +12,14 @@ export async function listWorkshopByParentId(params) {
   return Promise.reject(new Error(res.data.message));
 }
 
+export async function listFactoryLine(params) {
+  const res = await request.post(`/main/factoryarea/listFactoryLine`, params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 // 查询工厂列表-分页
 export async function getFactoryarea(params) {
   const res = await request.get(`/main/factoryarea/page`, {

+ 52 - 5
src/views/ledgerAssets/equipment/edit.vue

@@ -403,19 +403,47 @@
                   style="margin-right: 10px; width: 20%"
                   v-model="zcInfo.factoryRoomId2"
                   :augr="2"
+                  @returnItem="returnItem1"
                 />
-                <FactoryAreaSelect
+                <!-- <FactoryAreaSelect
                   placeholder="请选择车间"
                   style="margin-right: 10px; width: 20%"
                   v-model="zcInfo.factoryRoomId3"
                   :augr="3"
-                />
-                <FactoryAreaSelect
+                /> -->
+                <el-select
+                  style="width: 19%; margin-right: 10px"
+                  v-model="zcInfo.factoryRoomId3"
+                  placeholder="请选择"
+                  @change="getCxList"
+                >
+                  <el-option
+                    v-for="item in zjList"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+                <!-- <FactoryAreaSelect
                   style="margin-right: 10px; width: 20%"
                   placeholder="请选择产线"
                   v-model="zcInfo.factoryRoomId4"
                   :augr="4"
-                />
+                /> -->
+                <el-select
+                  style="width: 19%; margin-right: 10px"
+                  v-model="zcInfo.factoryRoomId4"
+                  placeholder="请选择"
+                >
+                  <el-option
+                    v-for="item in cxList"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
                 <FactoryAreaSelect
                   style="margin-right: 10px; width: 15%"
                   placeholder="请输入工位"
@@ -760,6 +788,7 @@
   } from '@/api/ledgerAssets';
   import { getUserPage } from '@/api/system/organization';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+  import { listWorkshopByParentId, listFactoryLine } from '@/api/factoryModel';
   export default {
     components: {
       linkMsg,
@@ -929,7 +958,9 @@
         warehouseList: [],
         areaList: [],
         shelvesList: [],
-        suppList: []
+        suppList: [],
+        zjList: [],
+        cxList: []
       };
     },
     watch: {},
@@ -958,6 +989,15 @@
       }
     },
     methods: {
+      async getCxList(e) {
+        const data = await listFactoryLine([e]);
+        this.cxList = data;
+      },
+      async returnItem1(item) {
+        const data = await listWorkshopByParentId(item.id);
+
+        this.zjList = data;
+      },
       async returnItem(item) {
         const data = await factoryworkstation(item.id);
         console.log(data);
@@ -1322,7 +1362,14 @@
           this.zcInfo.factoryRoomId4 = pathIds[3];
 
           this.zcInfo.factoryRoomId5 = pathIds[4];
+          if (this.zcInfo.factoryRoomId2) {
+            this.returnItem1({ id: pathIds[1] });
+          }
+          if (this.zcInfo.factoryRoomId3) {
+            this.getCxList(pathIds[2]);
+          }
         }
+
         if (data.positionList?.length) {
           this.positionInfo.detailPosition =
             data.positionList[0].detailPosition;