From f29627ec7bee0fe77411cbcd49b8b5a971c32b01 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期一, 20 十月 2025 11:20:53 +0800
Subject: [PATCH] 下拉框显示完工工单状态

---
 components/WorkOrder.vue |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/components/WorkOrder.vue b/components/WorkOrder.vue
index 90115c8..bd2864a 100644
--- a/components/WorkOrder.vue
+++ b/components/WorkOrder.vue
@@ -77,12 +77,13 @@
 		<view class="section card">
 			<view class="form-row">
 				<view class="form-item">
-					<label style="color: red;">鏃ュ仠鏈烘鏁�(鏃堕暱瓒�5鍒嗛挓):</label>
-					<input class="inp" style="width: 40%;" type="number" v-model="todayFaultNum" disabled="true" />
+					<label style="color: red;">鏃ュ仠鏈烘鏁�(鏃堕暱瓒�3鍒嗛挓):</label>
+					<input class="inp" style="width: 40%;" type="number" v-model="order.todayDowntimeCount" disabled="true" />
 				</view>
 				<view class="form-item">
 					<label>鏃ュ仠鏈烘椂闀�(mi):</label>
-					<input class="inp" type="text" v-model="todayRunTime" disabled="true" />
+					<!-- 杩欓噷鐢ㄨ绠楀睘鎬э紝涓嶈兘鐢╲-model琛ㄨ揪寮� -->
+					<input class="inp" type="text" :value="downtimeDuration" disabled="true" />
 				</view>
 				<view class="form-item">
 					<label>璁惧绋煎姩鐜�:</label>
@@ -181,6 +182,15 @@
 				DAA003List: [],
 				lineList: [],
 			};
+		},
+		computed: {
+			// 鏃ュ仠鏈烘椂闀� = todayOnlineTime - todayRunTime
+			downtimeDuration() {
+				// 鍙杘rder瀵硅薄涓殑todayOnlineTime鍜宼odayRunTime锛岄兘涓哄垎閽�
+				const online = Number(this.order.todayOnlineTime) || 0;
+				const run = Number(this.order.todayRunTime) || 0;
+				return online - run;
+			}
 		},
 		created() {
 			this.fetchData(true);
@@ -363,8 +373,9 @@
 							cutterName,  //鍒�鍏峰悕绉�
 							cutterModel, //鍒�鍏疯鏍�
 							jdl: '',
-							startCjNum: 0, // 鏂板鍏滃簳瀛楁 淇濈暀鍏跺畠娉ㄩ噴
-							currentCjNum: 0 // 鏂板鍏滃簳瀛楁
+                            startCjNum: 0, // 寮�宸ユ暟閲�
+                            currentCjNum: 0, // 褰撳墠鏁伴噰
+                            todayDowntimeCount //浠婃棩鍋滄満娆℃暟
 						};
 						return;
 					}
@@ -409,12 +420,12 @@
 						this.lastInitialCheck = latest.fcheckDate;
 						this.initialConclusion = latest.fcheckResu;
 						this.initialInspector = latest.fcheckBy; // 棣栨浜哄憳锛堝伐鍙�-濮撳悕锛�
-						this.initialCount = sjList.length;
+						this.initialCount = latest.xjCount ?? sjList.length; // 浼樺厛鐢▁jCount瀛楁
 					} else if (sjList) {
 						this.lastInitialCheck = sjList.fcheckDate;
 						this.initialConclusion = sjList.fcheckResu;
 						this.initialInspector = sjList.fcheckBy; // 棣栨浜哄憳锛堝伐鍙�-濮撳悕锛�
-						this.initialCount = 1;
+						this.initialCount = sjList.xjCount ?? 1;
 					} else {
 						this.lastInitialCheck = '';
 						this.initialConclusion = '';

--
Gitblit v1.9.3