From 1614a885dd1958acd5d10c52232f8196a25503da Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期五, 20 三月 2026 13:54:34 +0800
Subject: [PATCH] Merge branch 'dev_衡阳_鹏创电子' of http://114.132.189.42:9002/r/product-inventory-management into dev_衡阳_鹏创电子

---
 vite.config.js                                                  |   18 ++--
 src/views/productionManagement/productionOrder/Detail/index.vue |  183 +++++++++++++++++++++++++++++++++++++++------
 2 files changed, 167 insertions(+), 34 deletions(-)

diff --git a/src/views/productionManagement/productionOrder/Detail/index.vue b/src/views/productionManagement/productionOrder/Detail/index.vue
index 8703826..ae30acd 100644
--- a/src/views/productionManagement/productionOrder/Detail/index.vue
+++ b/src/views/productionManagement/productionOrder/Detail/index.vue
@@ -36,21 +36,30 @@
                   <div
                     class="step-title"
                     :class="{ selected: idx === selectedIndex }"
-                    @click="selectProcess(idx)"
+                    @click.stop="selectProcess(idx)"
                   >
                     {{ `${idx + 1}. ${p.processName || "-"}` }}
                   </div>
                 </template>
                 <template #description>
-                  <div class="step-panel">
-                    <div v-if="idx === active" class="current-progress">
+                  <div
+                    class="step-panel"
+                    :class="{
+                      'step-panel-selected': idx === selectedIndex,
+                      'step-panel-current': idx === active,
+                    }"
+                    @click="selectProcess(idx)"
+                  >
+                    <span v-if="idx === active" class="step-current-badge">鐢熶骇涓�</span>
+                    <div v-if="p.status !== 'wait'" class="current-progress">
                       <div class="current-progress-head">
-                        <span class="current-progress-title">褰撳墠宸ュ簭杩涘害</span>
-                        <!-- <span class="current-progress-value">{{ currentProcessPercentage }}%</span> -->
+                        <span class="current-progress-title">宸ュ簭杩涘害</span>
+                        <!-- <span class="current-progress-value">{{ processPercentage(p) }}%</span> -->
                       </div>
                       <el-progress
-                        :percentage="currentProcessPercentage"
-                        :status="currentProcessPercentage >= 100 ? 'success' : ''"
+                        :percentage="processPercentage(p)"
+                        :color="progressColor(processPercentage(p))"
+                        :status="processPercentage(p) >= 100 ? 'success' : ''"
                         :stroke-width="10"
                       />
                     </div>
@@ -99,7 +108,7 @@
             </div>
 
             <div v-if="!selectedProcess" class="right-empty">
-              鐐瑰嚮宸︿晶鏌愪釜宸ュ簭锛屽彸渚у睍绀鸿宸ュ簭鐨勬姤宸ユ槑缁嗐��
+              鏆傛棤宸ュ簭鏁版嵁銆�
             </div>
 
             <div v-else class="right-content">
@@ -109,20 +118,43 @@
                 <el-table-column label="鎶ュ伐浜哄憳" prop="reportUser" min-width="120" show-overflow-tooltip />
                 <el-table-column label="鎶ュ伐鏃堕棿" prop="reportTime" min-width="160" show-overflow-tooltip />
                 <el-table-column label="浜у嚭鏁伴噺" prop="outputQty" min-width="110" />
+                <el-table-column label="鍚堟牸鏁伴噺" prop="qualifiedQty" min-width="110" />
                 <el-table-column label="涓嶈壇鏁伴噺" prop="badQty" min-width="110" />
                 <el-table-column label="澶囨敞" prop="remark" min-width="160" show-overflow-tooltip />
+                <el-table-column label="鎿嶄綔" width="150" fixed="right">
+                  <template #default="{ row }">
+                    <el-button type="primary" link @click="viewReportRecord(row)">
+                      鐢熶骇璁板綍
+                    </el-button>
+                  </template>
+                </el-table-column>
               </el-table>
             </div>
           </div>
         </div>
       </div>
     </el-card>
+    <el-dialog
+      v-model="reportRecordDialogVisible"
+      title="鎶ュ伐鐢熶骇璁板綍"
+      width="680px"
+      destroy-on-close
+    >
+      <div class="report-record-placeholder">
+        <div>鎶ュ伐鍗曞彿锛歿{ currentReportRow?.reportNo || "-" }}</div>
+        <div>宸ュ簭锛歿{ selectedProcess?.processName || "-" }}</div>
+        <div class="placeholder-tip">寮规鍐呭寰呭畾锛堝悗缁ˉ鍏呰缁嗙敓浜ц褰曪級銆�</div>
+      </div>
+      <template #footer>
+        <el-button @click="reportRecordDialogVisible = false">鍏抽棴</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
-import { computed, ref } from "vue";
-import { useRoute, useRouter } from "vue-router";
+import { computed, ref, watch } from "vue";
+import { useRoute } from "vue-router";
 
 const route = useRoute();
 
@@ -174,15 +206,31 @@
   },
 ]);
 
-const selectedIndex = ref(null);
+// 榛樿閫変腑绗竴閬撳簭锛堟帴鍙f暟鎹氨缁悗浠嶅彲浠� 0 寮�濮嬶級
+const selectedIndex = ref(0);
 
 const selectProcess = (idx) => {
   selectedIndex.value = idx;
 };
 
+watch(
+  () => (processes.value || []).length,
+  (len) => {
+    if (!len) return;
+    if (selectedIndex.value >= len) selectedIndex.value = len - 1;
+    if (selectedIndex.value < 0) selectedIndex.value = 0;
+  }
+);
+
 const selectedProcess = computed(() => {
-  if (selectedIndex.value === null || selectedIndex.value === undefined) return null;
-  return (processes.value || [])[selectedIndex.value] || null;
+  const list = processes.value || [];
+  if (!list.length) return null;
+  const raw = selectedIndex.value;
+  const idx =
+    raw === null || raw === undefined
+      ? 0
+      : Math.min(Math.max(0, raw), list.length - 1);
+  return list[idx] || null;
 });
 
 // 妯℃嫙鎶ュ伐淇℃伅锛堝悗缁敤鎺ュ彛鏇挎崲锛�
@@ -190,7 +238,7 @@
   const p = selectedProcess.value;
   if (!p) return [];
   const code = p.processCode || "GX";
-  return [
+  const reports = [
     {
       reportNo: `${code}-BG-0001`,
       reportUser: "寮犱笁",
@@ -216,7 +264,20 @@
       remark: "鏀跺熬",
     },
   ];
+  return reports.map((item) => ({
+    ...item,
+    qualifiedQty: Math.max(0, Number(item.outputQty ?? 0) - Number(item.badQty ?? 0)),
+  }));
 });
+
+const viewReportRecord = (row) => {
+  if (!row?.reportNo) return;
+  currentReportRow.value = row;
+  reportRecordDialogVisible.value = true;
+};
+
+const reportRecordDialogVisible = ref(false);
+const currentReportRow = ref(null);
 
 const clampPercentage = (val) => {
   const n = Number(val);
@@ -233,20 +294,23 @@
   return idx >= 0 ? idx : 0;
 });
 
-const currentProcess = computed(() => {
-  const list = processes.value || [];
-  return list[active.value] || null;
-});
-
-// 褰撳墠宸ュ簭杩涘害锛氱敤浜у嚭/鎶曞叆浼扮畻锛圲I 鍏堣窇閫氾紝鍚庣画鎸夌湡瀹炶鍒欐浛鎹級
-const currentProcessPercentage = computed(() => {
-  const p = currentProcess.value;
+// 宸ュ簭杩涘害锛氱敤浜у嚭/鎶曞叆浼扮畻锛圲I 鍏堣窇閫氾紝鍚庣画鎸夌湡瀹炶鍒欐浛鎹級
+const processPercentage = (p) => {
   if (!p) return 0;
   const input = Number(p.inputQty ?? 0);
   const output = Number(p.outputQty ?? 0);
   if (!Number.isFinite(input) || input <= 0) return 0;
   return clampPercentage((output / input) * 100);
-});
+};
+
+// 30/50/80/100 鍒嗘棰滆壊锛氱孩/姗�/钃�/缁�
+const progressColor = (percentage) => {
+  const p = clampPercentage(percentage);
+  if (p < 30) return "#f56c6c";
+  if (p < 50) return "#e6a23c";
+  if (p < 80) return "#409eff";
+  return "#67c23a";
+};
 
 // 涓嶈壇鐜囷細涓嶈壇鏁伴噺 / 浜у嚭鏁伴噺锛堝厛鎸夋鍙e緞锛屽悗缁鎺ユ帴鍙e彲璋冩暣锛�
 const defectRateText = (p) => {
@@ -327,13 +391,15 @@
     align-items: center;
     padding: 2px 6px;
     border-radius: 6px;
-    transition: background-color 0.15s ease;
+    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
     &:hover {
       background: #f5f7fa;
+      transform: translateX(2px);
     }
     &.selected {
-      background: rgba(64, 158, 255, 0.12);
+      background: rgba(64, 158, 255, 0.18);
       color: #409eff;
+      font-weight: 700;
     }
   }
 
@@ -371,6 +437,8 @@
   }
 
   .step-panel {
+    position: relative;
+    cursor: pointer;
     background: #f6f8fb;
     border: 1px solid #ebeef5;
     border-radius: 10px;
@@ -378,6 +446,60 @@
     width: 100%;
     max-width: none;
     box-sizing: border-box;
+    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease,
+      background 0.25s ease;
+    &:hover {
+      border-color: #c6e2ff;
+      box-shadow: 0 4px 14px rgba(64, 158, 255, 0.12);
+      transform: translateY(-1px);
+    }
+  }
+
+  /* 琚�変腑锛氭部鐢ㄥ師銆岄珮浜�嶈涔夊苟鍔犲懠鍚稿姩鐢� */
+  .step-panel-selected {
+    background: #ecf5ff;
+    border-color: #409eff;
+    animation: step-panel-selected-pulse 2.2s ease-in-out infinite;
+    &:hover {
+      transform: translateY(-1px);
+    }
+  }
+
+  @keyframes step-panel-selected-pulse {
+    0%,
+    100% {
+      box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.22);
+    }
+    50% {
+      box-shadow: 0 0 0 6px rgba(64, 158, 255, 0.12);
+    }
+  }
+
+  /* 褰撳墠鐢熶骇涓殑宸ュ簭锛氭鑹蹭富棰橈紝涓庨�変腑鍖哄垎锛涜嫢鍚屾椂閫変腑鍒欎互閫変腑涓轰富锛屼粎淇濈暀瑙掓爣 */
+  .step-panel-current:not(.step-panel-selected) {
+    background: #fdf6ec;
+    border-color: #e6a23c;
+    border-left: 4px solid #e6a23c;
+    padding-left: 9px;
+    &:hover {
+      box-shadow: 0 4px 14px rgba(230, 162, 60, 0.18);
+    }
+  }
+
+  .step-current-badge {
+    position: absolute;
+    top: 8px;
+    right: 10px;
+    z-index: 1;
+    font-size: 11px;
+    font-weight: 600;
+    color: #b88230;
+    background: rgba(230, 162, 60, 0.18);
+    border: 1px solid rgba(230, 162, 60, 0.45);
+    border-radius: 4px;
+    padding: 2px 8px;
+    line-height: 1.2;
+    pointer-events: none;
   }
 
   .right-panel {
@@ -439,6 +561,17 @@
     }
   }
 
+  .report-record-placeholder {
+    display: flex;
+    flex-direction: column;
+    gap: 10px;
+    min-height: 120px;
+    color: #303133;
+    .placeholder-tip {
+      color: #909399;
+    }
+  }
+
   .step-meta {
     display: flex;
     gap: 16px;
diff --git a/vite.config.js b/vite.config.js
index 337183a..ef5c787 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -7,16 +7,16 @@
   const env = loadEnv(mode, process.cwd());
   const { VITE_APP_ENV } = env;
   const baseUrl =
-      env.VITE_APP_ENV === "development"
-          ? "http://1.15.17.182:9009"
-          : env.VITE_BASE_API;
+    env.VITE_APP_ENV === "development"
+      ? "http://1.15.17.182:9009"
+      : env.VITE_BASE_API;
   const javaUrl =
-      env.VITE_APP_ENV === "development"
-          ? "http://1.15.17.182:9009"
-          : env.VITE_JAVA_API;
+    env.VITE_APP_ENV === "development"
+      ? "http://1.15.17.182:9008"
+      : env.VITE_JAVA_API;
   return {
-    define:{
-      __BASE_API__: JSON.stringify(javaUrl)
+    define: {
+      __BASE_API__: JSON.stringify(javaUrl),
     },
     // 閮ㄧ讲鐢熶骇鐜鍜屽紑鍙戠幆澧冧笅鐨刄RL銆�
     // 榛樿鎯呭喌涓嬶紝vite 浼氬亣璁句綘鐨勫簲鐢ㄦ槸琚儴缃插湪涓�涓煙鍚嶇殑鏍硅矾寰勪笂
@@ -51,7 +51,7 @@
     },
     // vite 鐩稿叧閰嶇疆
     server: {
-      port: 80,
+      port: 8001,
       host: true,
       open: true,
       proxy: {

--
Gitblit v1.9.3