From e9ebe0b65f45b5ecb5729f22bc7e54ce479314d7 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期五, 20 六月 2025 17:12:38 +0800
Subject: [PATCH] 报工以及取消报工联调

---
 pages/product/report/index.vue |   84 ++++++++++++++++++++----------------------
 1 files changed, 40 insertions(+), 44 deletions(-)

diff --git a/pages/product/report/index.vue b/pages/product/report/index.vue
index c327e83..448dd3a 100644
--- a/pages/product/report/index.vue
+++ b/pages/product/report/index.vue
@@ -43,8 +43,8 @@
       <u-form-item label="闆朵欢鎻忚堪" :border-bottom="false" prop="partName">
         <u-input v-model="form.partName" placeholder="" disabled />
       </u-form-item>
-      <u-form-item label="鎵归噺澶у皬" :border-bottom="false" prop="qtyrequired">
-        <u-input v-model="form.qtyrequired" placeholder="" disabled />
+      <u-form-item label="鎵归噺澶у皬" :border-bottom="false" prop="qtyRequired">
+        <u-input v-model="form.qtyRequired" placeholder="" disabled />
       </u-form-item>
       <u-form-item
         label="鍓╀綑鏁伴噺"
@@ -68,19 +68,19 @@
           <u-radio name="part">鏇夸唬闆朵欢</u-radio>
         </u-radio-group>
       </u-form-item>
-      <u-form-item label="鐗╂枡" prop="materialcost">
-        <u-radio-group v-model="form.materialcost" :disabled="true">
+      <u-form-item label="鐗╂枡" prop="materialCost">
+        <u-radio-group v-model="form.materialCost" :disabled="true">
           <u-radio name="鍊掑啿">鍊掑啿</u-radio>
           <u-radio name="鎶曟枡">鎶曟枡</u-radio>
         </u-radio-group>
       </u-form-item>
-      <u-form-item label="宸ュ簭" prop="value11">
+      <u-form-item label="宸ュ簭">
         <u-checkbox-group>
           <u-checkbox
             :name="item.name"
             v-for="(item, index) in checkboxList"
             :key="index"
-            v-model="item.value11"
+            v-model="item.value"
             @change="changeCheckbox"
             :disabled="subdisabled || item.disabled"
           >
@@ -111,7 +111,7 @@
                   <view class="_label-name">鎵瑰彿锛�</view>
                 </view>
                 <view class="_content">
-                  {{ item.productNo }}
+                  {{ item.outBatchNo }}
                 </view>
               </view>
               <view class="row-list">
@@ -119,7 +119,7 @@
                   <view class="_label-name">鏁伴噺锛�</view>
                 </view>
                 <view class="_content">
-                  {{ item.value1 }}
+                  {{ item.netWeight }}
                 </view>
               </view>
               <view class="row-list">
@@ -147,7 +147,7 @@
     </modalBg>
     <saveForm
       ref="saveForm"
-      :operationTaskId="this.form"
+      :operationTaskList="this.form"
       @update="handleUpdate"
     />
     <scan></scan>
@@ -180,18 +180,19 @@
       ],
       InventoryReceiptList: [],
       form: {
+        workstationId: "",
         work: "",
         taskNo: "",
         name: "",
         moOn: "",
         partNo: "",
         partName: "",
-        qtyrequired: "",
+        qtyRequired: "",
         Jianqtyfinished: "",
         proposedLocation: "",
         productType: "dep",
-        receive: "mo", // 澶嶉�夋缁勭殑鍊�
-        materialcost: "",
+        receive: "mo",
+        materialCost: "",
         autoReport: false,
         simplifyMaterials: false,
       },
@@ -242,32 +243,30 @@
       showSave: false,
       operationTaskId: "",
       subdisabled: false,
+      codeInfoId: "",
     };
   },
   // 鐐瑰嚮鎻愪氦鎸夐挳鐨勪簨浠跺鐞嗗嚱鏁�
   onNavigationBarButtonTap() {
     this.$refs.uForm.validate((valid) => {
-		if (valid) {
-		uni.showLoading({
+      if (valid) {
+        uni.showLoading({
           mask: true,
           title: "鍔犺浇涓�",
         });
-        console.log("楠岃瘉閫氳繃");
         // 澶勭悊鎻愪氦閫昏緫
         this.$u.api.workReporting
           .operationTask({
             id: this.form.id,
           })
           .then((res) => {
-            console.log("res", res);
+            res.data.name = this.form.name
             this.$refs.saveForm.open(res);
             uni.hideLoading();
           });
       } else {
-        console.log("楠岃瘉澶辫触");
         // 鍙互鑾峰彇鍏蜂綋鐨勯敊璇俊鎭�
         const errors = this.$refs.uForm.getError();
-        console.log("閿欒淇℃伅:", errors);
       }
     });
   },
@@ -276,42 +275,38 @@
   },
   onShow() {
     let that = this;
-    console.log("1111111111111");
     uni.$off("scan"); // 姣忔杩涙潵鍏� 绉婚櫎鍏ㄥ眬鑷畾涔変簨浠剁洃鍚櫒
     uni.$on("scan", function (data) {
-      console.log("onscan");
       //鎵爜鎴愬姛鍚庣殑鍥炶皟锛屼綘鍙互鍐欒嚜宸辩殑閫昏緫浠g爜鍦ㄨ繖閲�
-      console.log("椤甸潰鎵爜缁撴灉锛�", data.code);
       if (data.code) {
         let codeInfo = JSON.parse(data.code);
+        that.codeInfoId = codeInfo.id;
         if (codeInfo.moOn) {
           // 鎵弿鎶ュ伐鍗曚簩缁寸爜
           that.saveForm(codeInfo);
-          that.$u.api.workReporting
-            .getProductMainV1({
-              current: 1,
-              size: -1,
-              operationTaskId: codeInfo.id,
-            })
-            .then((res) => {
-              console.log("res", res);
-              let InventoryReceiptList = JSON.parse(res.data.records);
-              that.saveInventory(InventoryReceiptList);
-            });
-          console.log("this.InventoryReceiptList", that.InventoryReceiptList);
+          that.getHandelList();
         }
       }
     });
   },
   watch: {
     "form.taskNo": function (newVal, oldVal) {
-      console.log("taskNo changed:", newVal, oldVal);
       this.subdisabled = false;
+      this.checkboxList[1].value = false;
+      this.checkboxList[0].value = false;
     },
   },
   methods: {
-    saveInventory(val) {
-      this.InventoryReceiptList = val;
+    getHandelList() {
+      this.$u.api.workReporting
+        .getProductMainV1({
+          current: 1,
+          size: -1,
+          id: this.codeInfoId,
+        })
+        .then((res) => {
+          this.InventoryReceiptList = res.data.productOutputList;
+        });
     },
     // 澶氶�夊鐞�
     changeCheckbox(val) {
@@ -324,15 +319,14 @@
     },
     handleUpdate() {
       this.subdisabled = true;
+      this.getHandelList();
     },
     // 鎵撳紑寮规--鍚庨潰杩橀渶瑕佺洃鍚壂鐮佹灙鎵爜缁撴灉锛岃祴鍊肩粰鎶ュ伐鍗曞彿瀛楁锛岀劧鍚庢墦寮�寮规閫夋嫨璁㈠崟鍙风瓑鎿嶄綔
     open() {
       this.$refs.modalBg.open();
     },
     // 寮规淇濆瓨
-    confirm() {
-      console.log("淇濆瓨", this.form.taskNo);
-    },
+    confirm() {},
     // 閫夋嫨璁㈠崟鍙�
     openList() {
       if (this.form.taskNo === "") {
@@ -352,25 +346,27 @@
     },
     // 鍥炴樉鎵爜鐨勪俊鎭�-鎶ュ伐鍗�
     saveForm(val) {
-      console.log("鍥炴樉鐨勬暟鎹�", val);
       this.form = {
         id: val.id,
+        workstationId: val.workstationId,
         work: val.work,
         taskNo: val.taskNo,
         name: val.name,
         moOn: val.moOn,
         partNo: val.partNo,
         partName: val.partName,
-        qtyrequired: val.qtyrequired,
-        Jianqtyfinished: val.qtyrequired - val.qtyfinished,
+        qtyRequired: val.qtyRequired,
+        Jianqtyfinished: val.qtyRequired - val.qtyFinished,
         proposedLocation: val.proposedLocation,
         productType: "dep",
         receive: "mo", // 澶嶉�夋缁勭殑鍊�
-        materialcost: val.materialcost,
+        materialCost: val.materialCost,
         autoReport: false,
         simplifyMaterials: false,
       };
-      if (this.form.materialcost == "鍊掑啿") {
+      this.checkboxList[1].value = false;
+      this.checkboxList[0].value = false;
+      if (this.form.materialCost == "鍊掑啿") {
         this.checkboxList[1].disabled = true;
       }
     },

--
Gitblit v1.9.3