From b7489ca57d67daddfdd81b38b7a93780e304b1d2 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期二, 31 三月 2026 17:03:09 +0800
Subject: [PATCH] fix:销售台账产品型号id绑定

---
 src/views/productionManagement/workOrder/index.vue |   48 +++++++++++++++++++-----------------------------
 1 files changed, 19 insertions(+), 29 deletions(-)

diff --git a/src/views/productionManagement/workOrder/index.vue b/src/views/productionManagement/workOrder/index.vue
index 90003cc..eaceff1 100644
--- a/src/views/productionManagement/workOrder/index.vue
+++ b/src/views/productionManagement/workOrder/index.vue
@@ -173,6 +173,13 @@
                label-width="120px">
         <el-row :gutter="30">
           <el-col :span="12">
+            <el-form-item label="浜у搧鍚嶇О">
+              <el-input v-model="reportForm.productName"
+                        readonly
+                        style="width: 300px" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="寰呯敓浜ф暟閲�">
               <el-input v-model="reportForm.planQuantity"
                         readonly
@@ -212,18 +219,6 @@
                     @input="handleScrapQtyInput" />
         </el-form-item></el-col>
         <el-col :span="12">
-          <el-form-item label="妫�鍝佹暟閲�"
-                      prop="inspectedQuantity">
-          <el-input v-model.number="reportForm.inspectedQuantity"
-                    type="number"
-                    min="0"
-                    step="1"
-                    style="width: 300px"
-                    placeholder="璇疯緭鍏ユ鍝佹暟閲�"
-                    @input="handleInspectedQuantity"/>
-        </el-form-item>
-        </el-col>
-        <el-col :span="12">
           <el-form-item label="鐝粍淇℃伅">
           <el-select v-model="reportForm.userId"
                      style="width: 300px"
@@ -262,6 +257,8 @@
             <el-table-column prop="productName" label="浜у搧鍚嶇О" min-width="160" />
             <el-table-column prop="model" label="鍨嬪彿" min-width="150" />
             <el-table-column prop="unit" label="鍗曚綅" width="90" align="center" />
+            <el-table-column prop="customer" label="渚涘簲鍟�" min-width="160" show-overflow-tooltip />
+            <el-table-column prop="batchNo" label="鎵瑰彿" min-width="180" show-overflow-tooltip />
             <el-table-column prop="reportQty" label="棰嗙敤鏁伴噺" width="160" align="center">
               <template #default="{ row }">
                 <el-input-number
@@ -269,8 +266,8 @@
                   :min="0"
                   :precision="2"
                   :controls="false"
-                  :max="row.qualitity || 0"
-                  :disabled="!row.qualitity"
+                  :max="row.requisitionQty || 0"
+                  :disabled="!row.requisitionQty"
                   style="width: 100%"
                 />
               </template>
@@ -300,7 +297,7 @@
     <el-dialog
       v-model="addMaterialDialogVisible"
       title="閫夋嫨鍘熸潗鏂�"
-      width="1000px"
+      width="1400px"
       top="5vh"
       :close-on-click-modal="false"
       append-to-body
@@ -320,7 +317,9 @@
           <el-table-column prop="productName" label="浜у搧鍚嶇О" min-width="160" />
           <el-table-column prop="model" label="鍨嬪彿" min-width="150" />
           <el-table-column prop="unit" label="鍗曚綅" width="90" align="center" />
-          <el-table-column prop="qualitity" label="鍙鐢ㄦ暟閲�" width="140" align="center" />
+          <el-table-column prop="customer" label="渚涘簲鍟�" min-width="160" show-overflow-tooltip />
+          <el-table-column prop="batchNo" label="鎵瑰彿" min-width="180" show-overflow-tooltip />
+          <el-table-column prop="requisitionQty" label="鍙鐢ㄦ暟閲�" width="140" align="center" />
         </el-table>
 
         <!-- 宸查�夋嫨鏄庣粏灞曠ず鏀惧湪鎶ュ伐寮规涓嬫柟鐨� reportForm.drawMaterialList 琛ㄦ牸閲� -->
@@ -488,6 +487,8 @@
   const userOptions = ref([]);
   const deviceOptions = ref([]);
   const reportForm = reactive({
+    // 鎶ュ伐寮规閲屸�滀骇鍝佸悕绉扳�濆彧璇诲洖鏄�
+    productName: "",
     planQuantity: 0,
     totalInvestment: 0,
     quantity: null,
@@ -618,7 +619,6 @@
   const handleQuantityInput = value => {
     if (value === "" || value === null || value === undefined) {
       reportForm.quantity = null;
-      reportForm.scrapQty = null;
       return;
     }
     const num = Number(value);
@@ -627,29 +627,17 @@
     }
     if (num < 1) {
       reportForm.quantity = null;
-      reportForm.scrapQty = null;
       return;
     }
     if (!Number.isInteger(num)) {
       const intValue = Math.floor(num);
       if (intValue < 1) {
         reportForm.quantity = null;
-        reportForm.scrapQty = null;
         return;
       }
       reportForm.quantity = intValue;
     } else {
       reportForm.quantity = num;
-    }
-    // 濡傛灉 totalInvestment 鏈夊�硷紝鑷姩璁$畻 scrapQty = totalInvestment - quantity
-    if (reportForm.totalInvestment !== null && reportForm.totalInvestment !== undefined && reportForm.totalInvestment !== "") {
-      const total = Number(reportForm.totalInvestment);
-      const qty = Number(reportForm.quantity);
-      if (total > qty) {
-        reportForm.scrapQty = total - qty;
-      } else {
-        reportForm.scrapQty = null;
-      }
     }
   };
 
@@ -914,6 +902,8 @@
   const showReportDialog = async row => {
     currentReportRowData.value = row;
     processParamList.value = await getProcessParamList(row)
+    // 鍏煎鍚庣/琛ㄦ牸瀛楁鍛藉悕锛氫紭鍏� row.productName锛屽叾娆� row.productCategory
+    reportForm.productName = row.productName ?? row.productCategory ?? ''
     reportForm.planQuantity = row.planQuantity;
     reportForm.totalInvestment = row.totalInvestment;
     reportForm.quantity =

--
Gitblit v1.9.3