ysy пре 2 година
родитељ
комит
15c249b3a4

+ 1 - 1
src/views/ItemInformation/detail.vue

@@ -188,7 +188,7 @@
   import { finishPageTab, reloadPageTab } from '@/utils/page-tab-util';
   export default {
     name: 'ManageMaterial',
-    components: {
+    components: {      
       linkMsg,
       GroupDialog,
       deptSelect,

+ 7 - 4
src/views/factoryModel/plant/index.vue

@@ -25,12 +25,15 @@
             添加
           </el-button>
         </template>
-        <template v-slot:factory="{ row }">
-          {{ showgfactory(row, 1) }}
-        </template>
+
         <template v-slot:parent="{ row }">
           {{ showgfactory(row, 2) }}
         </template>
+        
+        <template v-slot:factory="{ row }">
+          {{ showgfactory(row, 1) }}
+        </template>
+
         <template v-slot:enabled="{ row }">
           {{ dict.enabled[row.enabled] }}
         </template>
@@ -109,7 +112,7 @@
           },
           {
             label: '工厂编码',
-            prop: 'parent[0].id',
+            prop: 'parentCode',
             slot: 'parent'
            
           },

+ 27 - 10
src/views/factoryModel/productionLine/index.vue

@@ -28,9 +28,17 @@
         <template v-slot:workshop="{ row }">
           {{ showWorkshop(row) }}
         </template>
+ 
+        
+        <template v-slot:parent="{ row }">
+          {{ showgfactory(row, 2) }}
+        </template>
+        
         <template v-slot:factory="{ row }">
-          {{ showgfactory(row) }}
+          {{ showgfactory(row, 1) }}
         </template>
+
+
         <template v-slot:enabled="{ row }">
           {{ dict.enabled[row.enabled] }}
         </template>
@@ -98,6 +106,12 @@ export default {
           prop: 'extInfo.factoryId',
           slot: 'factory'
         },
+        {
+            label: '工厂编码',
+            prop: 'parentCode',
+            slot: 'parent'
+           
+          },
         {
           label: '所属车间',
           prop: 'parentId',
@@ -170,15 +184,18 @@ export default {
         this.dict.groupId = list;
       });
     },
-    // 回显工厂名称
-    showgfactory(row) {
-      let result = row.parent.find((n) => n.id == row.extInfo.factoryId);
-      if (result) {
-        return result.name;
-      } else {
-        return '';
-      }
-    },
+      // 回显工厂名称
+      showgfactory (row, type) {
+        let result = row.parent.find((n) => n.id == row.parentId);
+        if (result && type == 1) {
+          return result.name;
+        } else if(result && type == 2) {
+          return result.code;
+        }
+        else {
+          return '';
+        }
+      },
     // 回显车间
     showWorkshop(row) {
       let result = row.parent.find((n) => n.id == row.parentId);

+ 20 - 5
src/views/factoryModel/workshop/index.vue

@@ -28,9 +28,15 @@
         <template v-slot:groupId="{ row }">
           {{ showgroupName(row.groupId) }}
         </template>
+
+        <template v-slot:parent="{ row }">
+          {{ showgfactory(row, 2) }}
+        </template>
+        
         <template v-slot:factory="{ row }">
-          {{ showgfactory(row.parentId) }}
+          {{ showgfactory(row, 1) }}
         </template>
+  
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-link
@@ -100,6 +106,12 @@
             prop: 'parentId',
             slot: 'factory'
           },
+          {
+            label: '工厂编码',
+            prop: 'parentCode',
+            slot: 'parent'
+           
+          },
           {
             label: '详细地址',
             prop: 'extInfo.location'
@@ -159,11 +171,14 @@
         }
       },
       // 回显工厂名称
-      showgfactory (id) {
-        let result = this.dict.factory.find((n) => n.id == id);
-        if (result) {
+      showgfactory (row, type) {
+        let result = row.parent.find((n) => n.id == row.parentId);
+        if (result && type == 1) {
           return result.name;
-        } else {
+        } else if(result && type == 2) {
+          return result.code;
+        }
+        else {
           return '';
         }
       },