From 91dec349aa88c58c587199d9601529d60824e1d0 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 02 七月 2026 13:24:34 +0800
Subject: [PATCH] 生产订单对齐管理端新增两个字段展示

---
 src/pages/productionManagement/productionOrder/index.vue |  180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 170 insertions(+), 10 deletions(-)

diff --git a/src/pages/productionManagement/productionOrder/index.vue b/src/pages/productionManagement/productionOrder/index.vue
index 4894507..b22016f 100644
--- a/src/pages/productionManagement/productionOrder/index.vue
+++ b/src/pages/productionManagement/productionOrder/index.vue
@@ -55,8 +55,16 @@
               <text class="detail-value">{{ item.model || '-' }}</text>
             </view>
             <view class="detail-row">
-              <text class="detail-label">璁㈠崟鏁伴噺</text>
+              <text class="detail-label">宸ヨ壓璺嚎缂栧彿</text>
+              <text class="detail-value">{{ item.processRouteCode || '-' }}</text>
+            </view>
+            <view class="detail-row">
+              <text class="detail-label">闇�姹傛暟閲�</text>
               <text class="detail-value">{{ item.quantity || 0 }}</text>
+            </view>
+            <view class="detail-row">
+              <text class="detail-label">瀹屾垚鏁伴噺</text>
+              <text class="detail-value">{{ item.completeQuantity || 0 }}</text>
             </view>
             <view class="detail-row">
               <text class="detail-label">瀹屾垚杩涘害</text>
@@ -67,6 +75,39 @@
                 <text class="progress-text">{{ item.completeQuantity || 0 }} / {{ item.quantity || 0 }}</text>
               </view>
             </view>
+            <!-- 宸ュ簭鐢熶骇杩涘害灞曠ず -->
+            <view class="detail-row process-row">
+              <text class="detail-label">宸ュ簭杩涘害</text>
+              <scroll-view scroll-x
+                           class="process-scroll">
+                <view class="process-container">
+                  <view v-for="(process, pIdx) in item.processRouteStatus"
+                        :key="pIdx"
+                        class="process-item">
+                    <view class="process-node">
+                      <view class="node-circle"
+                            :class="{ 'is-complete': process.percentage >= 100 }">
+                        <text class="node-percentage"
+                              :style="{ color: process.percentage >= 100 ? '#52c41a' : (process.percentage >= 70 ? '#f56c6c' : '#3c9cff') }">{{ process.percentage }}%</text>
+                      </view>
+                      <text class="node-name">{{ process.name }}</text>
+                    </view>
+                    <view v-if="pIdx < item.processRouteStatus.length - 1"
+                          class="node-line"></view>
+                  </view>
+                  <view v-if="!item.processRouteStatus || !item.processRouteStatus.length"
+                        class="no-process">-</view>
+                </view>
+              </scroll-view>
+            </view>
+            <view class="detail-row">
+              <text class="detail-label">寮�濮嬫棩鏈�</text>
+              <text class="detail-value">{{ formatDate(item.startTime) }}</text>
+            </view>
+            <view class="detail-row">
+              <text class="detail-label">缁撴潫鏃ユ湡</text>
+              <text class="detail-value">{{ formatDate(item.endTime) }}</text>
+            </view>
             <view class="detail-row">
               <text class="detail-label">璁″垝瀹屾垚</text>
               <text class="detail-value">{{ formatDate(item.planCompleteTime) }}</text>
@@ -75,17 +116,22 @@
           <view class="item-footer">
             <view class="action-btns">
               <up-button type="info"
-                         size="mini"
+                         size="small"
+                         plain
+                         text="鐢熶骇杩芥函"
+                         @click="goTraceability(item)"></up-button>
+              <up-button type="info"
+                         size="small"
                          plain
                          text="宸ヨ壓璺嚎"
                          @click="goProcessRoute(item)"></up-button>
               <up-button type="primary"
-                         size="mini"
+                         size="small"
                          plain
                          text="鏉ユ簮"
                          @click="goSource(item)"></up-button>
               <up-button type="success"
-                         size="mini"
+                         size="small"
                          plain
                          text="棰嗘枡璇︽儏"
                          @click="goPickingDetail(item)"></up-button>
@@ -112,6 +158,7 @@
     productOrderListPage,
     getOrderProcessRouteMain,
   } from "@/api/productionManagement/productionOrder.js";
+  import { productWorkOrderPage } from "@/api/productionManagement/workOrder.js";
   import PageHeader from "@/components/PageHeader.vue";
 
   const { proxy } = getCurrentInstance();
@@ -166,7 +213,7 @@
       2: "warning",
       3: "success",
       4: "info",
-      5: "danger",
+      5: "error",
     };
     return typeMap[status] || "info";
   };
@@ -216,16 +263,44 @@
     };
 
     productOrderListPage(params)
-      .then(res => {
-        loading.value = false;
+      .then(async res => {
         const records = res.data.records || [];
+
+        // 涓烘瘡涓鍗曞苟琛屾煡璇㈠伐搴忚繘搴�
+        const processPromises = records.map(async item => {
+          if (item.npsNo) {
+            try {
+              const workOrderRes = await productWorkOrderPage({
+                npsNo: item.npsNo,
+                size: 100,
+              });
+              const workOrders = workOrderRes.data.records || [];
+              const processRouteStatus = workOrders.map(wo => ({
+                name: wo.operationName || "鏈煡宸ュ簭",
+                percentage:
+                  Number(wo.completionStatus) > 100
+                    ? 100
+                    : Number(wo.completionStatus || 0),
+              }));
+              return { ...item, processRouteStatus };
+            } catch (error) {
+              console.error(`鑾峰彇宸ュ崟 ${item.npsNo} 杩涘害澶辫触:`, error);
+              return { ...item, processRouteStatus: [] };
+            }
+          }
+          return { ...item, processRouteStatus: [] };
+        });
+
+        const updatedRecords = await Promise.all(processPromises);
+
+        loading.value = false;
         if (page.current === 1) {
-          tableData.value = records;
+          tableData.value = updatedRecords;
         } else {
-          tableData.value = [...tableData.value, ...records];
+          tableData.value = [...tableData.value, ...updatedRecords];
         }
 
-        if (records.length < page.size) {
+        if (updatedRecords.length < page.size) {
           loadStatus.value = "nomore";
         } else {
           loadStatus.value = "loadmore";
@@ -283,6 +358,13 @@
   const goPickingDetail = item => {
     uni.navigateTo({
       url: `/pages/productionManagement/productionOrder/pickingDetail?id=${item.id}&npsNo=${item.npsNo}`,
+    });
+  };
+
+  // 璺宠浆鐢熶骇杩芥函
+  const goTraceability = item => {
+    uni.navigateTo({
+      url: `/pages/productionManagement/productionTraceability/index?npsNo=${item.npsNo}`,
     });
   };
 
@@ -380,6 +462,84 @@
             text-align: right;
           }
         }
+
+        &.process-row {
+          flex-direction: column;
+          margin: 20rpx 0;
+
+          .process-scroll {
+            width: 100%;
+            margin-top: 16rpx;
+
+            .process-container {
+              display: flex;
+              align-items: flex-start;
+              padding: 10rpx 0;
+              min-height: 120rpx;
+
+              .process-item {
+                display: flex;
+                align-items: center;
+
+                .process-node {
+                  display: flex;
+                  flex-direction: column;
+                  align-items: center;
+                  width: 100rpx;
+
+                  .node-circle {
+                    width: 60rpx;
+                    height: 60rpx;
+                    border-radius: 50%;
+                    border: 2rpx solid #3c9cff;
+                    display: flex;
+                    align-items: center;
+                    justify-content: center;
+                    background: #fff;
+                    margin-bottom: 8rpx;
+
+                    .node-percentage {
+                      font-size: 18rpx;
+                      color: #3c9cff;
+                      font-weight: bold;
+                    }
+
+                    &.is-complete {
+                      border-color: #52c41a;
+                      background: #f6ffed;
+
+                      .node-percentage {
+                        color: #52c41a;
+                      }
+                    }
+                  }
+
+                  .node-name {
+                    font-size: 20rpx;
+                    color: #666;
+                    text-align: center;
+                    width: 120rpx;
+                    white-space: nowrap;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+                  }
+                }
+
+                .node-line {
+                  width: 40rpx;
+                  height: 2rpx;
+                  background: #e8e8e8;
+                  margin: -30rpx 0 0 0;
+                }
+              }
+
+              .no-process {
+                font-size: 24rpx;
+                color: #ccc;
+              }
+            }
+          }
+        }
       }
     }
 

--
Gitblit v1.9.3