From 6da8d7c3e2fb6aa02b14b0af63a8b5fadc0716bc Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期三, 29 四月 2026 17:24:13 +0800
Subject: [PATCH] 合格率加百分号

---
 src/views/productionManagement/processRoute/processRouteItem/index.vue |   82 ++++++++++++++++++++++++++++++++++-------
 1 files changed, 68 insertions(+), 14 deletions(-)

diff --git a/src/views/productionManagement/processRoute/processRouteItem/index.vue b/src/views/productionManagement/processRoute/processRouteItem/index.vue
index 734d34c..fd1a6a8 100644
--- a/src/views/productionManagement/processRoute/processRouteItem/index.vue
+++ b/src/views/productionManagement/processRoute/processRouteItem/index.vue
@@ -38,6 +38,15 @@
             <span class="info-value">{{ routeInfo.bomNo || '-' }}</span>
           </div>
         </div>
+        <div class="info-item"
+             v-if="routeInfo.quantity && routeInfo.quantity !== 0">
+          <div class="info-label-wrapper">
+            <span class="info-label">闇�姹傛暟閲�</span>
+          </div>
+          <div class="info-value-wrapper">
+            <span class="info-value">{{ routeInfo.quantity || '-' }}</span>
+          </div>
+        </div>
         <div class="info-item full-width"
              v-if="routeInfo.description">
           <div class="info-label-wrapper">
@@ -293,6 +302,7 @@
                                      :step="1"
                                      controls-position="right"
                                      style="width: 100%"
+                                     @change="handleUnitQuantityChange(row)"
                                      :disabled="!bomDataValue.isEdit || bomDataValue.dataList.some(item => (item).tempId === row.tempId)" />
                   </el-form-item>
                 </template>
@@ -369,6 +379,7 @@
                :rules="rules"
                label-width="120px">
         <el-form-item label="宸ュ簭"
+                      v-if="operationType === 'add' || pageType === 'route'"
                       prop="technologyOperationId">
           <el-select v-model="form.technologyOperationId"
                      placeholder="璇烽�夋嫨宸ュ簭"
@@ -381,7 +392,12 @@
                        :value="process.id" />
           </el-select>
         </el-form-item>
+        <el-form-item label="宸ュ簭"
+                      v-else>
+          <span>{{ getProcessName(form.technologyOperationId) }}</span>
+        </el-form-item>
         <el-form-item label="浜у搧鍚嶇О"
+                      v-if="operationType === 'add' || pageType === 'route'"
                       prop="productModelId">
           <el-button type="primary"
                      @click="showProductSelectDialog = true">
@@ -390,12 +406,21 @@
               : '閫夋嫨浜у搧' }}
           </el-button>
         </el-form-item>
+        <el-form-item label="浜у搧鍚嶇О"
+                      v-else>
+          <span>{{ form.productName }}{{ form.model ? ' - ' + form.model : '' }}</span>
+        </el-form-item>
         <el-form-item label="鍗曚綅"
+                      v-if="operationType === 'add' || pageType === 'route'"
                       prop="unit">
           <el-input v-model="form.unit"
                     :placeholder="form.productModelId ? '鏍规嵁閫夋嫨鐨勪骇鍝佽嚜鍔ㄥ甫鍑�' : '璇峰厛閫夋嫨浜у搧'"
                     clearable
                     :disabled="true" />
+        </el-form-item>
+        <el-form-item label="鍗曚綅"
+                      v-else>
+          <span>{{ form.unit }}</span>
         </el-form-item>
         <el-form-item label="鏄惁璐ㄦ"
                       prop="isQuality">
@@ -471,7 +496,7 @@
   import {
     queryList,
     queryList2,
-    addBomDetail,
+    add2,
   } from "@/api/productionManagement/productStructure.js";
 
   import { useRoute } from "vue-router";
@@ -501,6 +526,7 @@
     model: "",
     bomNo: "",
     description: "",
+    quantity: 0,
   });
 
   const processOptions = ref([]);
@@ -631,6 +657,7 @@
       bomNo: route.query.bomNo || "",
       bomId: route.query.bomId || "",
       description: route.query.description || "",
+      quantity: route.query.quantity || 0,
       status: !(route.query.status == 1 || route.query.status === "false"),
     };
     bomTableData.value[0].productName = routeInfo.value.productName;
@@ -721,9 +748,11 @@
 
           const addPromise = isOrderPage
             ? addRouteItem({
-                productOrderId: Number(orderId.value),
-                productRouteId: Number(routeId.value),
+                productionOrderId: Number(orderId.value),
+                orderRoutingId: Number(routeId.value),
                 technologyOperationId: form.value.technologyOperationId,
+                technologyRoutingId: Number(routeId.value),
+                operationName: getProcessName(form.value.technologyOperationId),
                 productModelId: form.value.productModelId,
                 isQuality: form.value.isQuality,
                 isProduction: form.value.isProduction,
@@ -758,6 +787,7 @@
             ? addOrUpdateProductProcessRouteItem({
                 id: form.value.id,
                 technologyOperationId: form.value.technologyOperationId,
+                operationName: getProcessName(form.value.technologyOperationId),
                 productModelId: form.value.productModelId,
                 isQuality: form.value.isQuality,
                 isProduction: form.value.isProduction,
@@ -813,15 +843,19 @@
   // 鏌ョ湅鍙傛暟鍒楄〃
   const handleViewParams = row => {
     currentProcess.value = row;
-    const query = {
+    const param = {
+      productionOrderRoutingOperationId: row.id,
+      productionOrderId: orderId.value,
+    };
+    const param1 = {
       technologyRoutingOperationId: row.id,
       productionOrderId: orderId.value,
     };
 
     const apiPromise =
       pageType.value === "order"
-        ? findProcessParamListOrder(query)
-        : getProcessParamList(query);
+        ? findProcessParamListOrder(param)
+        : getProcessParamList(param1);
 
     apiPromise
       .then(res => {
@@ -995,7 +1029,8 @@
   });
 
   const syncProcessOperationFields = item => {
-    const processId = item.processId ?? item.operationId ?? "";
+    const processId =
+      item.processId ?? item.operationId ?? item.technologyOperationId ?? "";
     if (!processId) {
       item.processId = "";
       return;
@@ -1007,7 +1042,11 @@
       option?.name || item.processName || item.operationName || "";
 
     item.processId = processId;
-    item.operationId = processId;
+    if (pageType.value === "order") {
+      item.technologyOperationId = processId;
+    } else {
+      item.operationId = processId;
+    }
     item.processName = processName;
     item.operationName = processName;
   };
@@ -1143,6 +1182,12 @@
     });
   };
 
+  const handleUnitQuantityChange = row => {
+    if (routeInfo.value.quantity && routeInfo.value.quantity !== 0) {
+      row.demandedQuantity = (row.unitQuantity || 0) * routeInfo.value.quantity;
+    }
+  };
+
   const addchildItem = (item, tempId) => {
     if (item.tempId === tempId) {
       if (!item.children) {
@@ -1157,10 +1202,14 @@
         productModelId: undefined,
         processId: "",
         processName: "",
-        operationId: "",
+        [pageType.value === "order" ? "technologyOperationId" : "operationId"]:
+          "",
         operationName: "",
         unitQuantity: 1,
-        demandedQuantity: 0,
+        demandedQuantity:
+          routeInfo.value.quantity && routeInfo.value.quantity !== 0
+            ? 1 * routeInfo.value.quantity
+            : 0,
         children: [],
         unit: "",
         tempId: new Date().getTime(),
@@ -1192,10 +1241,14 @@
           productModelId: undefined,
           processId: "",
           processName: "",
-          operationId: "",
+          [pageType.value === "order" ? "technologyOperationId" : "operationId"]:
+            "",
           operationName: "",
           unitQuantity: 1,
-          demandedQuantity: 0,
+          demandedQuantity:
+            routeInfo.value.quantity && routeInfo.value.quantity !== 0
+              ? 1 * routeInfo.value.quantity
+              : 0,
           unit: "",
           children: [],
           tempId: new Date().getTime(),
@@ -1270,8 +1323,9 @@
 
     const valid = validateAllBom();
     if (valid) {
-      addBomDetail({
-        bomId: Number(routeInfo.value.bomId),
+      add2({
+        // bomId: Number(routeInfo.value.bomId),
+        productionOrderBomId: Number(routeInfo.value.bomId) || null,
         children: buildSubmitTree(bomDataValue.value.dataList || []),
       })
         .then(() => {

--
Gitblit v1.9.3