ysy 1 год назад
Родитель
Сommit
4d0b05e51b

+ 24 - 0
src/api/produce/workOrder.js

@@ -145,3 +145,27 @@ export async function listPcToWarehouseTG(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+
+
+// pda根据工单id和工序id查询报工详情
+export async function listWorkReport(data) {
+  const res = await request.post('/pda/mes/workreport/listWorkReport', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+// pda根据工单id和工序id查询报工详情  (入库)
+export async function listApplystorage(data) {
+  const res = await request.get('/mes/applystorage/list', {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 10 - 10
src/views/produce/components/feeding/details.vue

@@ -77,18 +77,21 @@
         }
       },
 
-      curTaskId: {
-        type: String,
+      curTaskObj: {
+        type: Object,
         default() {
-          return '';
+          return () => {};
         }
       }
     },
 
     watch: {
-      curTaskId: {
-        handler(val) {
-          this.getList(val);
+        curTaskObj: {
+        handler(obj) {
+            if(obj) {
+          this.getList(obj.taskId);
+            }
+
         },
         deep: true,
         immediate: true
@@ -111,14 +114,11 @@
 
     created() {
       //   this.getList();
-      console.log(this.routeObj);
+
     },
 
     methods: {
       async getList(taskId) {
-        if (!taskId) {
-          return false;
-        }
         let param = {
           ids: [this.routeObj.id],
           taskId: taskId

+ 35 - 7
src/views/produce/components/jobBooking/details.vue

@@ -1,8 +1,10 @@
 <template>
-  <div> 444 </div>
+  <div> 
+    {{ list }} </div>
 </template>
 
 <script>
+  import { listWorkReport, listApplystorage } from '@/api/produce/workOrder';
   export default {
     props: {
       routeObj: {
@@ -12,22 +14,48 @@
         }
       },
 
-      curTaskId: {
-        type: String,
+      curTaskObj: {
+        type: Object,
         default() {
-          return '';
+          return () => {};
         }
       }
     },
 
     watch: {
-      curTaskId: {
-        handler(val) {
-          this.getList(val);
+      curTaskObj: {
+        handler(obj) {
+          if (obj) {
+            this.taskType = obj.type;
+            this.getList(obj.taskId);
+          }
         },
         deep: true,
         immediate: true
       }
+    },
+
+    data() {
+      return {
+        taskType: null,
+        list: [],
+        taskType: 1,
+      };
+    },
+
+    created() {},
+
+    methods: {
+      getList(taskId) {
+        let param = {
+          workOrderId: this.routeObj.id,
+          taskId: taskId
+        };
+        let URL = this.taskType == 5 ? listApplystorage : listWorkReport;
+        URL(param).then((res) => {
+          this.list = JSON.parse(JSON.stringify(res));
+        });
+      }
     }
   };
 </script>

+ 9 - 9
src/views/produce/components/routings.vue

@@ -18,7 +18,7 @@
             v-for="(item, index) in routeList"
             :key="index"
             :title="item.taskTypeName"
-            @click.native="handIdx(index, item.taskId)"
+            @click.native="handIdx(index, item)"
             :description="desIndex == index ? '此处' : ''"
           ></el-step>
         </el-steps>
@@ -27,13 +27,13 @@
           <el-tab-pane label="投料详情">
             <feedDetails
               :routeObj="routeObj"
-              :curTaskId="curTaskId"
+              :curTaskObj="curTaskObj"
             ></feedDetails>
           </el-tab-pane>
           <el-tab-pane label="报工详情">
             <jobDetails
               :routeObj="routeObj"
-              :curTaskId="curTaskId"
+              :curTaskObj="curTaskObj"
             ></jobDetails>
           </el-tab-pane>
         </el-tabs>
@@ -64,7 +64,7 @@
         routeList: [],
         activeIndex: 0,
         desIndex: 0,
-        curTaskId: null
+        curTaskObj: null
       };
     },
 
@@ -81,9 +81,9 @@
           this.desIndex = index;
 
           if (this.routeObj.taskId != -2) {
-            this.curTaskId = this.routeObj.taskId;
+            this.curTaskObj = JSON.parse(JSON.stringify( this.routeObj));
           } else {
-            this.curTaskId = this.routeList[0].taskId;
+            this.curTaskObj  =  JSON.parse(JSON.stringify( this.routeList[0])); 
             this.desIndex = 0;
           }
           this.activeIndex = index;
@@ -95,9 +95,9 @@
         this.$emit('closeRoute');
       },
 
-      handIdx(index, taskId) {
-        this.curTaskId = taskId;
-        if (taskId == -2) {
+      handIdx(index, item) {
+        this.curTaskObj = JSON.parse(JSON.stringify(item));
+        if (item.taskId == -2) {
           this.$message.info('完结状态不能点击');
         } else {
           this.desIndex = index;

+ 4 - 3
src/views/produceOrder/index.vue

@@ -111,7 +111,7 @@
           >
           <template v-if="activeName != 'second'">
             <el-link
-              v-if="row.isSplit == 0"
+              v-if="row.status == 4 "
               type="primary"
               :underline="false"
               icon="el-icon-truck"
@@ -120,7 +120,7 @@
               报工
             </el-link>
             <el-link
-              v-if="row.status == 4 && row.originalCode"
+              v-if="row.status == 4 && row.isSplit == 0"
               type="primary"
               :underline="false"
               icon="el-icon-truck"
@@ -129,7 +129,7 @@
               拆分
             </el-link>
             <el-link
-              v-if="row.isSplit == 0"
+               v-if="row.status == 4 "
               type="primary"
               :underline="false"
               icon="el-icon-edit"
@@ -433,6 +433,7 @@
       },
       /* 表格数据源 */
       async datasource({ page, limit, where, order }) {
+      
         let res = await getPage({
           ...where,
           ...order,