ソースを参照

feat(produce): 添加批次半成品撤回损耗功能

yusheng 2 週間 前
コミット
fe16df2289

+ 8 - 0
src/api/produce/job.js

@@ -64,3 +64,11 @@ export async function checkReportNumber(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+//撤回损耗
+export async function returnBatch(data) {
+  const res = await request.post(`/pda/mes/feed/returnBatch`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 25 - 2
src/views/produce/components/jobBooking/components/batchSemiProductJobBom.vue

@@ -385,6 +385,22 @@
           v-if="row.confirm == 0 || !row.confirm"
           >确认</el-link
         >
+        <el-link
+          type="text"
+          @click="
+            returnBatch(
+              [
+                {
+                  returnId: row.id,
+                  returnQt: row.feedQuantity
+                }
+              ],
+              $index
+            )
+          "
+          v-if="row.extInfo.isLoss"
+          >撤回</el-link
+        >
         <el-link type="warning" @click="getCancle($index)" v-else>取消</el-link>
         <el-link type="danger" @click="getDelete($index)" v-if="!isChoose"
           >删除</el-link
@@ -761,7 +777,8 @@
   import {
     getTaskInstanceList,
     getComputeParam,
-    saveParam
+    saveParam,
+    returnBatch
   } from '@/api/produce/job';
   import { queryProductLicense } from '@/api/produce';
   import tabMixins from '@/mixins/tableColumnsMixin';
@@ -1729,7 +1746,13 @@
         this.batchForm.unit = item.unit;
         this.batchVisible = true;
       },
-
+      returnBatch(returnBatchDetailPOList, index) {
+        returnBatch({returnBatchDetailPOList}).then((res) => {
+          // this.list.splice(index, 1);
+          // this.$set(this.item, 'product', this.list);
+          this.$emit('reloadData');
+        });
+      },
       batchInput(val) {
         let newVal = val.replace(/[^\d.]/g, '');
 

+ 4 - 0
src/views/produce/components/jobBooking/index.vue

@@ -372,6 +372,7 @@
           :isEngrave="isEngrave"
           :isDisposal="isDisposal"
           @chooseData="chooseData"
+          @reloadData="reloadData"
         ></batchSemiProductJobBom>
 
         <!-- <batchSemiProductJobBom
@@ -791,6 +792,9 @@
     },
 
     methods: {
+      reloadData(){
+        this.$emit('reloadData');
+      },
       setTaskReportInfo(index, data) {
         if (this.List[index]) {
           this.$set(this.List[index], 'taskReportInfo', data || {});

+ 5 - 1
src/views/produceOrder/workReport.vue

@@ -145,6 +145,7 @@
                         ref="jobRef"
                         :reportNeedFeed="reportNeedFeed"
                         @jobSuccess="jobSuccess"
+                        @reloadData="reloadData"
                         :workPlanType="workPlanType"
                       ></jobBooking>
                     </div>
@@ -834,7 +835,10 @@
         this.getOrderData();
         this.getTaskFn();
       },
-
+      reloadData() {
+        this.getOrderData();
+        this.getTaskFn();
+      },
       warehouseSuccess() {
         this.getOrderData();
         this.getTaskFn();