From 0043a1a24cbed3ddd40c56c7931da9c5d14e4bc2 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期二, 19 八月 2025 17:09:40 +0800
Subject: [PATCH] PDA报工页面增加投料功能,扫描二维码取消获取产出记录列表,放开取消报工页面,编写取消报工逻辑,联调取消报工接口

---
 pages/product/report/components/saveForm.vue |  381 +++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 262 insertions(+), 119 deletions(-)

diff --git a/pages/product/report/components/saveForm.vue b/pages/product/report/components/saveForm.vue
index 03049c7..ec1c7f5 100644
--- a/pages/product/report/components/saveForm.vue
+++ b/pages/product/report/components/saveForm.vue
@@ -1,144 +1,217 @@
 <template>
-  <u-modal
-    v-model="show"
-    ref="uModal"
-    title=""
-    :show-cancel-button="true"
-    @confirm="confirm"
-    @cancel="cancel"
-    :async-close="true"
-    :loading="loading"
-  >
-    <view class="packing-registration-param">
-      <scroll-view scroll-y="true" style="height: 100%;transform: translateZ(0);-webkit-font-smoothing: antialiased;">
+  <view>
+    <u-modal
+      v-model="show"
+      ref="uModal"
+      title=""
+      :show-cancel-button="true"
+      @confirm="confirm"
+      @cancel="cancel"
+      :async-close="true"
+      :loading="loading"
+    >
+      <view class="packing-registration-param">
+        <scroll-view
+          scroll-y="true"
+          style="
+            height: 100%;
+            transform: translateZ(0);
+            -webkit-font-smoothing: antialiased;
+          "
+        >
+          <view class="packing-registration-param-view">
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">鎵瑰彿</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input class="item-one item-two" v-model="form.outBatchNo" />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">鎶曟枡鎵规</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input
+                  class="item-one item-two"
+                  v-model="form.ifsBatchNoArr"
+                  disabled
+                />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">闀垮害</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input
+                  class="item-one item-two"
+                  v-model="form.overallLength"
+                />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">搴撲綅</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input
+                  class="item-one item-two"
+                  v-model="form.proposedLocation"
+                  disabled
+                />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">鐩樺彿</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input class="item-one item-two" v-model="form.reelNumber" />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">鐩橀噸</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input class="item-one item-two" v-model="form.reelWeight" />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">姣涢噸</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input class="item-one item-two" v-model="form.grossWeight" />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">鍑�閲�</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input
+                  class="item-one item-two"
+                  v-model="form.netWeight"
+                  disabled
+                />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">搴熸枡</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input class="item-one item-two" v-model="form.waste" />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">宸ュ簭</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input
+                  class="item-one item-two"
+                  v-model="form.name"
+                  disabled
+                />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">鎴愬搧澶栧緞娴嬮噺鍊�</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input
+                  class="item-one item-two"
+                  v-model="form.outerDiameter"
+                />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">閫�鐏數鍘�</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input class="item-one item-two" v-model="form.voltage" />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">杞��</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input class="item-one item-two" v-model="form.speed" />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one">澶栭儴姘斿帇</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input class="item-one item-two" v-model="form.pressure" />
+              </view>
+            </view>
+            <view class="packing-registration-param-item param-extra">
+              <view class="packing-registration-param-item-left">
+                <text class="item-one item-two">鐢熶骇閫熷害</text>
+              </view>
+              <view class="packing-registration-param-item-right">
+                <u-input
+                  class="item-one item-two"
+                  v-model="form.productionSpeed"
+                />
+              </view>
+            </view>
+          </view>
+        </scroll-view>
+      </view>
+    </u-modal>
+    <u-modal
+      v-model="showModal"
+      title=""
+      :show-cancel-button="true"
+      :show-confirm-button="true"
+      @confirm="confirmTl"
+      @cancel="cancelTl"
+    >
+      <view class="packing-registration-param">
         <view class="packing-registration-param-view">
           <view class="packing-registration-param-item param-extra">
             <view class="packing-registration-param-item-left">
               <text class="item-one">鎵瑰彿</text>
             </view>
             <view class="packing-registration-param-item-right">
-              <u-input class="item-one item-two" v-model="form.outBatchNo" />
+              <text class="item-one item-two">{{
+                detailedList.ifsBatchNo
+              }}</text>
             </view>
           </view>
           <view class="packing-registration-param-item param-extra">
             <view class="packing-registration-param-item-left">
-              <text class="item-one">闀垮害</text>
+              <text class="item-one">闆朵欢鎻忚堪</text>
             </view>
             <view class="packing-registration-param-item-right">
-              <u-input class="item-one item-two" v-model="form.overallLength" />
+              <text class="item-one item-two">{{ detailedList.partName }}</text>
             </view>
           </view>
           <view class="packing-registration-param-item param-extra">
             <view class="packing-registration-param-item-left">
-              <text class="item-one">搴撲綅</text>
+              <text class="item-one">鏁伴噺</text>
             </view>
             <view class="packing-registration-param-item-right">
               <u-input
                 class="item-one item-two"
-                v-model="form.proposedLocation"
-                disabled
-              />
-            </view>
-          </view>
-          <view class="packing-registration-param-item param-extra">
-            <view class="packing-registration-param-item-left">
-              <text class="item-one">鐩樺彿</text>
-            </view>
-            <view class="packing-registration-param-item-right">
-              <u-input class="item-one item-two" v-model="form.reelNumber" />
-            </view>
-          </view>
-          <view class="packing-registration-param-item param-extra">
-            <view class="packing-registration-param-item-left">
-              <text class="item-one">鐩橀噸</text>
-            </view>
-            <view class="packing-registration-param-item-right">
-              <u-input class="item-one item-two" v-model="form.reelWeight" />
-            </view>
-          </view>
-          <view class="packing-registration-param-item param-extra">
-            <view class="packing-registration-param-item-left">
-              <text class="item-one">姣涢噸</text>
-            </view>
-            <view class="packing-registration-param-item-right">
-              <u-input class="item-one item-two" v-model="form.grossWeight" />
-            </view>
-          </view>
-          <view class="packing-registration-param-item param-extra">
-            <view class="packing-registration-param-item-left">
-              <text class="item-one">鍑�閲�</text>
-            </view>
-            <view class="packing-registration-param-item-right">
-              <u-input
-                class="item-one item-two"
-                v-model="form.netWeight"
-                disabled
-              />
-            </view>
-          </view>
-          <view class="packing-registration-param-item param-extra">
-            <view class="packing-registration-param-item-left">
-              <text class="item-one">搴熸枡</text>
-            </view>
-            <view class="packing-registration-param-item-right">
-              <u-input class="item-one item-two" v-model="form.waste" />
-            </view>
-          </view>
-          <view class="packing-registration-param-item param-extra">
-            <view class="packing-registration-param-item-left">
-              <text class="item-one">宸ュ簭</text>
-            </view>
-            <view class="packing-registration-param-item-right">
-              <u-input class="item-one item-two" v-model="form.name" disabled />
-            </view>
-          </view>
-          <view class="packing-registration-param-item param-extra">
-            <view class="packing-registration-param-item-left">
-              <text class="item-one">鎴愬搧澶栧緞娴嬮噺鍊�</text>
-            </view>
-            <view class="packing-registration-param-item-right">
-              <u-input class="item-one item-two" v-model="form.outerDiameter" />
-            </view>
-          </view>
-          <view class="packing-registration-param-item param-extra">
-            <view class="packing-registration-param-item-left">
-              <text class="item-one">閫�鐏數鍘�</text>
-            </view>
-            <view class="packing-registration-param-item-right">
-              <u-input class="item-one item-two" v-model="form.voltage" />
-            </view>
-          </view>
-          <view class="packing-registration-param-item param-extra">
-            <view class="packing-registration-param-item-left">
-              <text class="item-one">杞��</text>
-            </view>
-            <view class="packing-registration-param-item-right">
-              <u-input class="item-one item-two" v-model="form.speed" />
-            </view>
-          </view>
-          <view class="packing-registration-param-item param-extra">
-            <view class="packing-registration-param-item-left">
-              <text class="item-one">澶栭儴姘斿帇</text>
-            </view>
-            <view class="packing-registration-param-item-right">
-              <u-input class="item-one item-two" v-model="form.pressure" />
-            </view>
-          </view>
-          <view class="packing-registration-param-item param-extra">
-            <view class="packing-registration-param-item-left">
-              <text class="item-one item-two">鐢熶骇閫熷害</text>
-            </view>
-            <view class="packing-registration-param-item-right">
-              <u-input
-                class="item-one item-two"
-                v-model="form.productionSpeed"
+                v-model="detailedList.suppliedQuantity"
               />
             </view>
           </view>
         </view>
-      </scroll-view>
-    </view>
-  </u-modal>
+      </view>
+    </u-modal>
+  </view>
 </template>
 
 <script>
@@ -150,15 +223,19 @@
       default: () => ({}),
     },
     dutyId: {
-      type: String,
+      type: Number,
       required: true,
-      default: '',
+      default: "",
     },
   },
   data() {
     return {
+      showModal: false,
+      detailedList: {},
       show: false,
       form: {},
+      ifsBatchNo: [],
+      productInputList: [],
       loading: false,
     };
   },
@@ -221,6 +298,11 @@
         this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵��
         return;
       }
+      if (this.form.productInputList.length == 0) {
+        this.$u.toast("鎶曟枡鎵规涓嶈兘涓虹┖锛岃鎵爜鎶曟枡");
+        this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵��
+        return;
+      }
       this.operationTaskList.operationTaskId = this.operationTaskList.id;
       this.form.operationTaskId = this.operationTaskList.id;
       this.form.status = this.operationTaskList.status;
@@ -235,7 +317,7 @@
       this.$u.api.workReporting
         .submitPDA(this.operationTaskList)
         .then((res) => {
-          this.$emit("update");
+          this.$emit("update",this.operationTaskList);
           this.$refs.uModal.cancel();
         })
         .finally(() => {
@@ -246,11 +328,72 @@
     cancel() {
       this.show = false;
       this.form = {};
+      this.ifsBatchNo = [];
+      this.productInputList = [];
+    },
+    cancelTl() {
+      this.showModal = false;
+      this.detailedList = {};
+    },
+    updateArray(arr, newObj) {
+    // 鏌ユ壘鏁扮粍涓槸鍚︽湁鐩稿悓鐨� id
+    let index = arr.findIndex(item => item.ifsBatchNo === newObj.ifsBatchNo);
+    
+    if (index !== -1) {
+        // 濡傛灉鎵惧埌鐩稿悓 id 鐨勫璞★紝鏇挎崲鍘熸湁瀵硅薄
+        arr[index] = newObj;
+    } else {
+        // 濡傛灉娌℃湁鎵惧埌鐩稿悓 id 鐨勫璞★紝鐩存帴鎺ㄥ叆鏂板璞�
+        arr.push(newObj);
+    }
+    return arr;
+},
+    confirmTl() {
+      let ifsBatchNoArr = [];
+      let updatedArrayList = this.updateArray(this.productInputList, this.detailedList);
+      console.log("updatedArrayList", updatedArrayList);
+      // this.productInputList.push(updatedArrayList);
+      this.$set(this.form, "productInputList", this.productInputList);
+
+      this.productInputList.forEach((item) => { 
+        ifsBatchNoArr.push(item.ifsBatchNo)
+      })
+      console.log("ifsBatchNoArr", ifsBatchNoArr);
+      // this.ifsBatchNo.push(ifsBatchNoArr);
+      this.$set(this.form, "ifsBatchNoArr", ifsBatchNoArr);
+      console.log("this.form", this.form);
+      this.showModal = false;
+      this.detailedList = {};
     },
     open(val) {
       this.show = true;
       this.form = val.data;
     },
+    // 鍥炴樉鎵爜鐨勪俊鎭�-鎶ュ伐鍗�
+    saveForm(val) {
+      this.$u.api.cancelReporting
+        .selInputPartInfoPDA({
+          outBatchNo: val.BN,
+          partNo: val.PN,
+          moOn: this.operationTaskList.moOn,
+        })
+        .then((res) => {
+          const list = {
+            suppliedQuantity: res.data.suppliedQuantity,
+            ifsBatchNo: res.data.ifsBatchNo,
+            partNo: res.data.partNo,
+            partName: res.data.partName,
+            locationNo: res.data.locationNo,
+            ifsLineItemNo: res.data.ifsLineItemNo,
+            serialNo: res.data.serialNo,
+            engChgLevel: res.data.engChgLevel,
+            ifsWdr: res.data.waivDevRejNo,
+            activitySeq: res.data.activitySeq,
+          };
+          this.detailedList = list;
+          this.showModal = true;
+        });
+    },
   },
 };
 </script>

--
Gitblit v1.9.3