ysy hace 2 años
padre
commit
d0f397496f

+ 8 - 6
src/views/factoryModel/plant/index.vue

@@ -29,7 +29,7 @@
         <template v-slot:parent="{ row }">
           {{ showgfactory(row, 2) }}
         </template>
-        
+
         <template v-slot:factory="{ row }">
           {{ showgfactory(row, 1) }}
         </template>
@@ -105,17 +105,19 @@
             label: '联系方式',
             prop: 'extInfo.phone'
           },
-          {
-            label: '所属工厂',
-            prop: 'extInfo.parentId',
-            slot: 'factory'
-          },
+
           {
             label: '工厂编码',
             prop: 'parentCode',
             slot: 'parent'
            
           },
+          {
+            label: '所属工厂',
+            prop: 'extInfo.parentId',
+            slot: 'factory'
+          },
+       
           {
             label: '省/市/区',
             prop: 'extInfo.location'

+ 31 - 60
src/views/factoryModel/productionLine/index.vue

@@ -1,39 +1,23 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never">
-      <search
-        ref="search"
-        @search="search"
-        :options_groupId="dict.groupId"
-        :options_factory="dict.factory"
-      ></search>
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        :datasource="datasource"
-        cache-key="systemRoleTable"
-      >
+      <search ref="search" @search="search" :options_groupId="dict.groupId" :options_factory="dict.factory"></search>
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" cache-key="systemRoleTable">
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
-          <el-button
-            size="small"
-            type="primary"
-            icon="el-icon-plus"
-            class="ele-btn-icon"
-            @click="openEdit('add')"
-          >
+          <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openEdit('add')">
             添加
           </el-button>
         </template>
         <template v-slot:workshop="{ row }">
           {{ showWorkshop(row) }}
         </template>
- 
-        
+
+
         <template v-slot:parent="{ row }">
           {{ showgfactory(row, 2) }}
         </template>
-        
+
         <template v-slot:factory="{ row }">
           {{ showgfactory(row, 1) }}
         </template>
@@ -44,19 +28,10 @@
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
-          <el-link
-            type="primary"
-            :underline="false"
-            icon="el-icon-edit"
-            @click="openEdit('edit', row)"
-          >
+          <el-link type="primary" :underline="false" icon="el-icon-edit" @click="openEdit('edit', row)">
             修改
           </el-link>
-          <el-popconfirm
-            class="ele-action"
-            title="确定要删除此角色吗?"
-            @confirm="remove(row)"
-          >
+          <el-popconfirm class="ele-action" title="确定要删除此角色吗?" @confirm="remove(row)">
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
                 删除
@@ -66,12 +41,7 @@
         </template>
       </ele-pro-table>
     </el-card>
-    <edit
-      ref="edit"
-      @done="done"
-      :options_groupId="dict.groupId"
-      :options_factory="dict.factory"
-    ></edit>
+    <edit ref="edit" @done="done" :options_groupId="dict.groupId" :options_factory="dict.factory"></edit>
   </div>
 </template>
 <script>
@@ -101,17 +71,18 @@ export default {
           label: '产线名称',
           prop: 'name'
         },
+
+        {
+          label: '工厂编码',
+          prop: 'parentCode',
+          slot: 'parent'
+        },
         {
           label: '所属工厂',
           prop: 'extInfo.factoryId',
           slot: 'factory'
         },
-        {
-            label: '工厂编码',
-            prop: 'parentCode',
-            slot: 'parent'
-           
-          },
+
         {
           label: '所属车间',
           prop: 'parentId',
@@ -170,9 +141,9 @@ export default {
       });
     },
     openEdit(type, row) {
-      if(row){
-        if(typeof row.mainFactoryCapacityList == 'string'){
-           this.$set(row,'mainFactoryCapacityList', [])
+      if (row) {
+        if (typeof row.mainFactoryCapacityList == 'string') {
+          this.$set(row, 'mainFactoryCapacityList', [])
         }
       }
       this.$refs.edit.open(type, row);
@@ -184,18 +155,18 @@ export default {
         this.dict.groupId = list;
       });
     },
-      // 回显工厂名称
-      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 '';
-        }
-      },
+    // 回显工厂名称
+    showgfactory(row, type) {
+      let result = row.parent.find((n) => n.id == row.extInfo.factoryId);
+      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);

+ 7 - 6
src/views/factoryModel/workshop/index.vue

@@ -32,7 +32,7 @@
         <template v-slot:parent="{ row }">
           {{ showgfactory(row, 2) }}
         </template>
-        
+
         <template v-slot:factory="{ row }">
           {{ showgfactory(row, 1) }}
         </template>
@@ -101,17 +101,18 @@
             prop: 'groupId',
             slot: 'groupId'
           },
-          {
-            label: '所属工厂',
-            prop: 'parentId',
-            slot: 'factory'
-          },
           {
             label: '工厂编码',
             prop: 'parentCode',
             slot: 'parent'
            
           },
+          {
+            label: '所属工厂',
+            prop: 'parentId',
+            slot: 'factory'
+          },
+   
           {
             label: '详细地址',
             prop: 'extInfo.location'