ysy hai 1 ano
pai
achega
cb28c19407

+ 12 - 0
src/api/produce/index.js

@@ -23,4 +23,16 @@ export async function getWarehouseList() {
     }
     return Promise.reject(new Error(res.data.message));
   }
+  
+
+
+  // bom 信息
+
+  export async function getByTaskId(data) {
+    const res = await request.get(`/main/categoryparam/getByTaskId`, { params: data });
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
   

+ 5 - 2
src/views/produce/components/produceOrder.vue

@@ -16,7 +16,7 @@
       :need-page="false"
     >
       <template v-slot:toolbar>
-        <div class="c_title">工单列表 {{ internalIsFullscreen }}</div>
+        <div class="c_title">工单列表 </div>
       </template>
 
       <template v-slot:code="{ row }">
@@ -244,7 +244,10 @@
         this.$emit('workSelect', ids);
       },
 
-      rowClick() {},
+      rowClick(e) {
+        this.$emit('rowClick', e, this.taskObj.id);
+      
+      },
 
       handRoute(row) {
         this.routeObj = row;

+ 23 - 5
src/views/produce/components/productionResource/index.vue

@@ -2,7 +2,7 @@
   <div>
     <el-tabs v-model="activeName" type="border-card">
       <el-tab-pane label="工艺路线" name="1" lazy>
-        <processRoute></processRoute>
+        {{ newBomObj.id }}
       </el-tab-pane>
       <el-tab-pane lazy label="工艺参数" name="2"></el-tab-pane>
       <el-tab-pane lazy label="质检参数" name="3"></el-tab-pane>
@@ -18,14 +18,32 @@
 </template>
 
 <script>
-  import processRoute from './processRoute';
   export default {
-    components: {
-      processRoute
+    components: {},
+
+    props: {
+      BomObj: {
+        type: Object
+
+    },
+  },
+
+    watch: {
+      BomObj: {
+        handler(val) {
+          this.newBomObj = JSON.parse(JSON.stringify(val));
+
+          this.$forceUpdate();
+        },
+        immediate: true,
+        deep: true
+      }
     },
+
     data() {
       return {
-        activeName: '1'
+        activeName: '1',
+        newBomObj: {}
       };
     }
   };

+ 0 - 118
src/views/produce/components/productionResource/processRoute.vue

@@ -1,118 +0,0 @@
-<template>
-    <ele-pro-table
-      ref="table"
-      :columns="columns"
-      height="400px"
-      :datasource="datasource"
-      cache-key="produceOrderZ"
-      highlight-current-row
-      @row-click="rowClick"
-      :need-page="false"
-    >
-      <template v-slot:toolbar>
-      
-      </template>
-    </ele-pro-table>
-  </template>
-  
-  <script>
-    import { getList } from '@/api/warehousing/index.js';
-  
-    export default {
-      components: {},
-      data() {
-        return {
-          loading: false
-        };
-      },
-      computed: {
-        // 表格列配置
-        columns() {
-          return [
-            {
-              columnKey: 'index',
-              label: '序号',
-              type: 'index',
-              width: 55,
-              align: 'center',
-              showOverflowTooltip: true,
-              fixed: 'left'
-            },
-            {
-              prop: 'workOrderCode',
-              label: '工单编码',
-              align: 'center',
-              minWidth: 110
-            },
-            {
-              prop: 'warehouseName',
-              label: '仓库名称	',
-              align: 'center'
-            },
-  
-            {
-              prop: 'categoryLevelName',
-              label: '物品分类名称',
-              align: 'center'
-            },
-            {
-              prop: 'categoryName',
-              label: '物品名称',
-              align: 'center'
-            },
-            {
-              slot: 'totalCount',
-              label: '总数量',
-              align: 'center'
-            },
-  
-            {
-              slot: 'totalPackage',
-              label: '总包装',
-              align: 'center'
-            },
-  
-            {
-              slot: 'totalWeight',
-              label: '总重量',
-              align: 'center'
-            },
-  
-       
-            {
-              slot: 'approvalStatus',
-              label: '状态',
-              align: 'center'
-            }
-          ];
-        }
-      },
-      created() {},
-      methods: {
-        /* 表格数据源 */
-        datasource({ page, limit, where }) {
-          return getList({
-            pageNum: page,
-            size: limit,
-            ...where
-          });
-        },
-  
-        /* 刷新表格 */
-        reload(where) {
-          this.$nextTick(() => {
-            this.$refs.table.reload({ page: 1, where });
-          });
-        },
-  
-        rowClick() {}
-      }
-    };
-  </script>
-  
-  <style lang="scss" scoped>
-    .table {
-      height: calc((100vh - 70px - 50px - 80px - 20px) / 2);
-    }
-  </style>
-  

+ 24 - 3
src/views/produce/index.vue

@@ -39,11 +39,11 @@
           class="left_main"
         >
           <div class="top">
-            <produceOrder @workSelect="workSelect"></produceOrder>
+            <produceOrder @workSelect="workSelect" @rowClick="rowClick"></produceOrder>
           </div>
           <template #content>
             <div class="bottom">
-              <productionResource></productionResource>
+              <productionResource :BomObj="BomObj"></productionResource>
             </div>
           </template>
         </ele-split-layout>
@@ -101,6 +101,8 @@
   import jobBooking from './components/jobBooking/index.vue';
   import warehousing from './components/warehousing/index.vue';
 
+  import { getByTaskId } from   '@/api/produce/index';
+ 
   export default {
     components: {
       Search,
@@ -122,7 +124,8 @@
         operationType: null,
         workListIds: [],
 
-        pickingShow: false
+        pickingShow: false,
+        BomObj: {}
       };
     },
 
@@ -177,6 +180,24 @@
           });
         }
         this.pickingShow = false;
+      },
+
+      rowClick(row,taskId) {
+        console.log(6666,row)
+         if(taskId) {
+          console.log(6666)
+          let params = {
+            categoryId:row.categoryId,
+            taskId: taskId
+           }
+          getByTaskId(params).then(res => {
+        
+            this.BomObj = res.data 
+            this.$forceUpdate()
+
+            console.log(88,  this.BomObj)
+          })
+         }
       }
     },