ysy пре 1 година
родитељ
комит
07f56c5de4

+ 11 - 1
src/api/produce/picking.js

@@ -11,4 +11,14 @@ export async function batchSave(data) {
     return Promise.reject(new Error(res.data.message));
     return Promise.reject(new Error(res.data.message));
   }
   }
   
   
- 
+ 
+
+  // 领料单详细信息
+export async function pickDetails(data) {
+  const res = await request.post(`/pda/mes/pickorder/list`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 17 - 0
src/views/produce/components/picking/details.vue

@@ -0,0 +1,17 @@
+<template>
+  <div>
+    <div> 领料详情 </div>
+  </div>
+</template>
+
+<script>
+import { pickDetails } from '@/api/produce/picking'
+  export default {
+    name: 'picking-details',
+    data() {
+      return {};
+    },
+    methods: {},
+    created() {}
+  };
+</script>

+ 1 - 1
src/views/produce/components/produceOrder.vue

@@ -119,7 +119,7 @@
         return workorderPage({
         return workorderPage({
           pageNum: page,
           pageNum: page,
           size: limit,
           size: limit,
-          taskId: this.taskObj.id,
+          taskId:  this.taskObj&& this.taskObj.id,
           ...where
           ...where
         });
         });
       },
       },

+ 14 - 1
src/views/produce/components/search.vue

@@ -60,6 +60,20 @@
       this.updateCurrentTime();
       this.updateCurrentTime();
       setInterval(this.updateCurrentTime, 1000); // 每秒更新一次时间
       setInterval(this.updateCurrentTime, 1000); // 每秒更新一次时间
     },
     },
+
+    watch: {
+      'search.taskId': {
+        handler(val) {
+          if(val) {
+            this.changeSelect(val)
+          } else {
+            this.$store.commit('user/setTaskObj', {});
+          }
+         
+        },
+        immediate: true,
+      }
+    },
     methods: {
     methods: {
       getTaskList() {
       getTaskList() {
         listTask().then((res) => {
         listTask().then((res) => {
@@ -70,7 +84,6 @@
       changeSelect(e) {
       changeSelect(e) {
         let taskObj = {};
         let taskObj = {};
         taskObj = this.produceTaskList.find((item) => item.id === e);
         taskObj = this.produceTaskList.find((item) => item.id === e);
-  
 
 
         this.$store.commit('user/setTaskObj', taskObj);
         this.$store.commit('user/setTaskObj', taskObj);
       },
       },

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

@@ -13,7 +13,7 @@
           </div>
           </div>
         </div>
         </div>
         <div class="right_main">
         <div class="right_main">
-          {{ operationType }}
+          <pickDetails></pickDetails>
         </div>
         </div>
       </div>
       </div>
       <footBtn @footBtn="footBtn"></footBtn>
       <footBtn @footBtn="footBtn"></footBtn>
@@ -35,6 +35,7 @@
   import productionResource from './components/productionResource/index.vue';
   import productionResource from './components/productionResource/index.vue';
 
 
   import picking from './components/picking/index.vue';
   import picking from './components/picking/index.vue';
+  import pickDetails from './components/picking/details.vue';
   export default {
   export default {
     components: {
     components: {
       Search,
       Search,
@@ -42,7 +43,8 @@
       produceOrder,
       produceOrder,
       productionResource,
       productionResource,
 
 
-      picking
+      picking,
+      pickDetails
     },
     },
     data() {
     data() {
       return {
       return {
@@ -66,6 +68,14 @@
       footBtn(t) {
       footBtn(t) {
         this.operationType = t;
         this.operationType = t;
         if (t == 'pick') {
         if (t == 'pick') {
+          if (
+            Object.keys(this.$store.state.user.taskObj).length === 0 &&
+            this.$store.state.user.taskObj.constructor === Object
+          ) {
+            this.$message.warning('请选择工序');
+            return false;
+          }
+
           if (this.workListIds.length == 0) {
           if (this.workListIds.length == 0) {
             this.$message.warning('请选择工单列表');
             this.$message.warning('请选择工单列表');
             return false;
             return false;
@@ -168,6 +178,5 @@
     min-width: 640px;
     min-width: 640px;
     height: calc((100vh - 70px - 50px - 80px - 12px));
     height: calc((100vh - 70px - 50px - 80px - 12px));
     margin-top: 6px;
     margin-top: 6px;
-    background: blueviolet;
   }
   }
 </style>
 </style>