ysy hai 1 ano
pai
achega
feb4ad5893

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

@@ -106,3 +106,30 @@ export async function saveCache(data) {
 }
 
 
+
+// pda报工查缓存
+
+
+
+export async function getCache(data) {
+  const res = await request.post('/mes/workreport/getCache', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+
+
+// 清空缓存
+export async function removeCache(data) {
+  const res = await request.post('/mes/workreport/removeCache', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+

+ 1 - 1
src/views/produce/components/feeding/index.vue

@@ -324,7 +324,7 @@ export default {
       this.$confirm('是否清空缓存', '缓存')
         .then(() => {
           let parma = {
-            workOrderIds: this.type == 'all' ? this.idsList : [type],
+            workOrderIds: type == 'all' ? this.idsList : [type],
             taskId: this.taskObj.id,
             type: 2
           };

+ 39 - 6
src/views/produce/components/jobBooking/index.vue

@@ -10,6 +10,7 @@
       <el-button type="primary" size="mini" @click="save(1, 'all')"
         >缓存</el-button
       >
+
     </div>
 
     <div class="job_box">
@@ -26,10 +27,10 @@
             <el-button
               type="text"
               size="mini"
-              @click="openPicking(item.id, item)"
+              @click="openPicking(item.workOrderId, item)"
               >添加物料</el-button
             >
-            <el-button type="text" size="mini" @click="removeCacheFn(item.id)"
+            <el-button type="text" size="mini" @click="removeCacheFn(item.workOrderId)"
               >清空缓存</el-button
             >
             <el-button type="text" size="mini" @click="save(1, index)"
@@ -120,7 +121,7 @@
           :isType="true"
         ></aridRegion>
 
-        <!-- <packingBom :taskId='taskObj.id' :workOrderId="item.id" :objData="item" ref="packRef"
+        <!-- <packingBom :taskId='taskObj.id' :workOrderId="item.workOrderId" :objData="item" ref="packRef"
           v-if='taskObj.type == 4 && clientEnvironmentId != 3 && item'></packingBom> -->
 
         <packingTgBom
@@ -147,7 +148,7 @@
 <script>
   import { listByIdsReport } from '@/api/produce/job';
   import { getWarehouseList } from '@/api/produce/index';
-  import { jobSave , saveCache} from '@/api/produce/workOrder'
+  import { jobSave , saveCache ,getCache, removeCache} from '@/api/produce/workOrder'
   import pickingList from '../picking/pickingList.vue';
 
   import workOrderBom from '../feeding/components/workOrderBom.vue';
@@ -461,6 +462,9 @@
             setTimeout(function () {
               this.loading.close();
             }, 3000);
+
+  
+
           });
       },
 
@@ -500,9 +504,38 @@
 			},
 
 
-      getCacheFn() {},
+      getCacheFn() {
+				let parma = {
+					workOrderId:  this.idsList,
+          taskId: this.taskObj.id,
+					type: 1
+				}
+
+				getCache(parma).then(res => {
+				  
+  console.log(res)
+	
+
+
+				})
+			},
 
-      removeCacheFn(type) {},
+      removeCacheFn(type) {
+    
+      this.$confirm('是否清空缓存', '缓存')
+        .then(() => {
+          let parma = {
+            workOrderIds: type == 'all' ? this.idsList : [type],
+            taskId: this.taskObj.id,
+            type: 1
+          };
+          removeCache(parma).then((res) => {
+            this.$message.success('已经清空缓存')
+            this.getList(this.idsList);
+          });
+        })
+        .catch(() => { });
+    },
 
       getWarehouseListFn() {
         getWarehouseList().then((res) => {