ysy před 1 rokem
rodič
revize
52dbd77764

+ 1 - 1
src/api/produce/job.js

@@ -44,4 +44,4 @@ export async function saveParam(data) {
 }
 
 
-  
+  

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

@@ -133,3 +133,15 @@ export async function removeCache(data) {
 }
 
 
+
+
+// PDA  碳谷 入库查询
+
+export async function listPcToWarehouseTG(data) {
+  const res = await request.post('/mes/workreport/listPCToWarehouseTG', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 5 - 3
src/views/produce/components/jobBooking/index.vue

@@ -7,7 +7,7 @@
       <el-button type="primary" size="mini" @click="removeCacheFn('all')"
         >清空缓存</el-button
       >
-      <el-button type="primary" size="mini" @click="save(1, 'all')"
+      <el-button v-if="taskObj.type == 1" type="primary" size="mini" @click="save(1, 'all')" 
         >缓存</el-button
       >
     </div>
@@ -35,7 +35,7 @@
               @click="removeCacheFn(item.workOrderId)"
               >清空缓存</el-button
             >
-            <el-button type="text" size="mini" @click="save(1, index)"
+            <el-button v-if="taskObj.type == 1" type="text" size="mini" @click="save(1, index)"
               >缓存</el-button
             >
           </div>
@@ -447,7 +447,8 @@
         // 	}
         // }
 
-        if (this.taskObj.type == 1) {
+
+        if (this.taskObj.type == 1 ) {
           const isCache = await this.checkCache(type);
 
           if (!isCache) {
@@ -488,6 +489,7 @@
       },
 
       checkCache(type) {
+  
         return new Promise((resolve) => {
           if (type == 1) {
             saveCache(this.List).then((rr) => {

+ 2 - 0
src/views/produce/components/search.vue

@@ -78,6 +78,8 @@
       getTaskList() {
         listTask().then((res) => {
           this.produceTaskList = res;
+
+         
         });
       },
 

+ 144 - 13
src/views/produce/components/warehousing/index.vue

@@ -1,30 +1,161 @@
 <template>
-    <div>
+  <div>
+    <div class="top_fixed">
+      <el-button type="primary" size="mini" @click="save">一键报工</el-button>
+    </div>
 
-        <div class="top_fixed">
-      <el-button type="primary" size="mini" @click="save"
-        >一键报工</el-button
-      >
+    <div class="warehousing_box">
+      <div v-for="(item, index) in List" :key="index" class="card_box">
+        <div class="title_box rx-bc">
+          <div class="name">工单信息 </div>
+        </div>
+        <workOrderBom :item="item" v-if="item"></workOrderBom>
+        {{clientEnvironmentId}}
+     
 
-    </div>
+  
+        <div v-if="clientEnvironmentId == 3 ">
+       {{  item.toWarehouseList }}
 
-    <div class="warehousing_box"></div>
 
-    </div>
 
+ 
+
+          <!-- <packingTgBom :list='it.extInfo.pickOutInList' :isWarehousing='true'></packingTgBom> -->
+        </div>
+
+        
+
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
+  import workOrderBom from '../feeding/components/workOrderBom.vue';
+  import  packingTgBom from '../jobBooking/components/packingTgBom.vue'
+
+  import { getWarehouseList } from '@/api/produce/index.js';
+  import { listByIdsReport } from '@/api/produce/job';
+  import { listPcToWarehouseTG } from '@/api/produce/workOrder';
+
+
   export default {
-    
+    components: {
+      workOrderBom,
+      packingTgBom
+    },
+    props: {
+      workListIds: {
+        type: Array,
+        default() {
+          return [];
+        }
+      }
+    },
     data() {
-      return {}
-    }
-  }
+      return {
+        isLoad: false,
+        List: [],
 
-</script>
+        idsList: [],
+        warehouseList: []
+      };
+    },
+
+    computed: {
+      taskObj() {
+        return this.$store.state.user.taskObj;
+      },
+
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
 
 
+    watch: {
+      workListIds: {
+        handler(val) {
+          this.getList(val);
+        },
+        deep: true,
+        immediate: true
+      }
+    },
+
+
+    created() {
+      this.getWarehouseListFn();
+    },
+
+    methods: {
+      getList(ids) {
+        this.idsList = ids || [];
+        let param = {
+          ids: ids,
+          taskId: this.taskObj.id,
+          type: 0
+        };
+        this.isLoad = false;
+        listByIdsReport(param)
+          .then((res) => {
+            this.List = res.map((obj) => {
+              obj.workReportInfo = {
+                formingNum: null,
+                formingWeight: null,
+                formedNum: null,
+                formedWeight: null,
+                taskId: this.taskObj.id
+              };
+
+              return {
+                ...obj
+              };
+            });
+          })
+          .finally(() => {
+            this.isLoad = true;
+
+            this.getTgWarehouse();
+          });
+      },
+
+      getTgWarehouse() {
+  const param = {
+    workOrderIds: this.idsList,
+    taskId: this.taskObj.id
+  };
+  listPcToWarehouseTG(param).then((res) => {
+    // 创建一个映射,以便快速查找
+    const workOrderMap = new Map(res.map(it => [it.workOrderId, it]));
+
+
+    // 更新List中的每个项目
+    this.List.forEach(item => {
+      if (workOrderMap.has(item.workOrderId)) {
+        // 直接从映射中获取数据,避免嵌套循环
+        this.$set(item, 'toWarehouseList', [workOrderMap.get(item.workOrderId)]);
+      } else {
+        this.$set(item, 'toWarehouseList', []);
+      }
+    });
+
+
+  });
+},
+
+      getWarehouseListFn() {
+        getWarehouseList().then((res) => {
+          this.warehouseList = res.data;
+        });
+      },
+
+      save() {}
+    }
+  };
+</script>
+
 <style scoped lang="scss">
   .top_fixed {
     width: 100%;

+ 23 - 10
src/views/produce/index.vue

@@ -5,7 +5,7 @@
 
       <ele-split-layout
         space="0px"
-          width="45%"
+        width="45%"
         :resizable="true"
         :min-size="200"
         :max-size="-200"
@@ -17,9 +17,8 @@
         :right-style="{ overflow: 'hidden' }"
         :responsive="false"
         style="height: calc(100vh - 70px - 50px - 80px)"
-    
       >
-        <div class="left_main" >
+        <div class="left_main">
           <div class="top">
             <produceOrder @workSelect="workSelect"></produceOrder>
           </div>
@@ -32,13 +31,17 @@
             <div v-if="operationType == 'pick'">
               <pickDetails ref="pickListRef"></pickDetails>
             </div>
-  
+
             <div v-if="operationType == 'feed'">
               <feeding :workListIds="workListIds"></feeding>
             </div>
-  
+
+
             <div v-if="operationType == 'job'">
-              <jobBooking :workListIds="workListIds" ref="jobRef"></jobBooking>
+
+              <warehousing v-if="taskObj.id == -1" :workListIds="workListIds" ref="wareRef"></warehousing>
+          
+              <jobBooking v-else :workListIds="workListIds" ref="jobRef"></jobBooking>
             </div>
           </div>
         </template>
@@ -47,8 +50,8 @@
       <footBtn @footBtn="footBtn"></footBtn>
     </div>
 
-        <!--领料弹框 -->
-        <picking
+    <!--领料弹框 -->
+    <picking
       v-if="pickingShow"
       @close="pickingClose"
       :workListIds="workListIds"
@@ -68,6 +71,7 @@
   import feeding from './components/feeding/index.vue';
 
   import jobBooking from './components/jobBooking/index.vue';
+  import warehousing from './components/warehousing/index.vue'
   export default {
     components: {
       Search,
@@ -80,7 +84,8 @@
 
       feeding,
 
-      jobBooking
+      jobBooking,
+      warehousing
     },
     data() {
       return {
@@ -92,6 +97,15 @@
       };
     },
 
+
+    computed: {
+      taskObj() {
+        return this.$store.state.user.taskObj;
+      },
+
+   
+    },
+
     created() {
       this.operationType = null;
       this.workListIds = [];
@@ -277,7 +291,6 @@
   }
 
   .right_main {
-
     min-width: 640px;
     height: calc((100vh - 70px - 50px - 80px - 12px));
     margin-top: 6px;