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

---
 components/WorkOrder.vue |   86 ++++++++++++++++++++++++------------------
 1 files changed, 49 insertions(+), 37 deletions(-)

diff --git a/components/WorkOrder.vue b/components/WorkOrder.vue
index 80b576d..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;
 					}
@@ -386,11 +397,12 @@
 					//this.productionDuration = (this.order.todayOnlineTime / 3600).toFixed(2) + "h";
 					this.todayFaultNum = this.order.todayFaultNum;
 					this.utilizationRate = this.order.jdl + '%';
-					let title = this.machineNo + '鍙锋満鍙� 宸ュ崟鍙�' + this.order.daa001 + ',褰撳墠鏁伴噰' + this.order.currentCjNum;
+					let title = this.machineNo + '鍙锋満鍙� 宸ュ崟鍙�' + this.order.daa001 + ',褰撳墠鏁伴噰' + this.order.currentCjNum; // 鏍囬涓娇鐢� currentCjNum
 					this.setTitle(title);
 				})
 			},
 			setTitle(title) {
+				// 淇敼椤甸潰鏍囬鐨勬柟娉曪紝uni-app涓彲浠ラ�氳繃api鐩存帴璁剧疆褰撳墠椤甸潰鐨勬爣棰�
 				uni.setNavigationBarTitle({
 					title: title
 				});
@@ -407,13 +419,13 @@
 						let latest = sjList[0];
 						this.lastInitialCheck = latest.fcheckDate;
 						this.initialConclusion = latest.fcheckResu;
-						this.initialInspector = latest.checkUser;
-						this.initialCount = sjList.length;
+						this.initialInspector = latest.fcheckBy; // 棣栨浜哄憳锛堝伐鍙�-濮撳悕锛�
+						this.initialCount = latest.xjCount ?? sjList.length; // 浼樺厛鐢▁jCount瀛楁
 					} else if (sjList) {
 						this.lastInitialCheck = sjList.fcheckDate;
 						this.initialConclusion = sjList.fcheckResu;
-						this.initialInspector = sjList.checkUser;
-						this.initialCount = 1;
+						this.initialInspector = sjList.fcheckBy; // 棣栨浜哄憳锛堝伐鍙�-濮撳悕锛�
+						this.initialCount = sjList.xjCount ?? 1;
 					} else {
 						this.lastInitialCheck = '';
 						this.initialConclusion = '';
@@ -422,33 +434,33 @@
 					}
 				})
 			},
-            getXJByOrder() {
-                this.$post({
-                    url: "/MesQaItemsDetect02/FindXJByOrderNo",
-                    data: {
-                        orderNo: this.orderNo
-                    }
-                }).then(res => {
-                    let xjList = res.data.tbBillList;
-                    if (Array.isArray(xjList) && xjList.length > 0) {
-                        let latest = xjList[0];
-                        this.lastPatrolCheck = latest.fcheckDate;
-                        this.patrolConclusion = latest.fcheckResu;
-                        this.patrolInspector = latest.checkUser;
-                        this.patrolCount = latest.xjCount ?? xjList.length;
-                    } else if (xjList) {
-                        this.lastPatrolCheck = xjList.fcheckDate;
-                        this.patrolConclusion = xjList.fcheckResu;
-                        this.patrolInspector = xjList.checkUser;
-                        this.patrolCount = xjList.xjCount ?? 1;
-                    } else {
-                        this.lastPatrolCheck = '';
-                        this.patrolConclusion = '';
-                        this.patrolInspector = '';
-                        this.patrolCount = 0;
-                    }
-                })
-            }
+			getXJByOrder() {
+				this.$post({
+					url: "/MesQaItemsDetect02/FindXJByOrderNo",
+					data: {
+						orderNo: this.orderNo
+					}
+				}).then(res => {
+					let xjList = res.data.tbBillList;
+					if (Array.isArray(xjList) && xjList.length > 0) {
+						let latest = xjList[0];
+						this.lastPatrolCheck = latest.fcheckDate;
+						this.patrolConclusion = latest.fcheckResu;
+						this.patrolInspector = latest.fcheckBy; // 宸℃浜哄憳锛堝伐鍙�-濮撳悕锛�
+						this.patrolCount = latest.xjCount ?? xjList.length;
+					} else if (xjList) {
+						this.lastPatrolCheck = xjList.fcheckDate;
+						this.patrolConclusion = xjList.fcheckResu;
+						this.patrolInspector = xjList.fcheckBy; // 宸℃浜哄憳锛堝伐鍙�-濮撳悕锛�
+						this.patrolCount = xjList.xjCount ?? 1;
+					} else {
+						this.lastPatrolCheck = '';
+						this.patrolConclusion = '';
+						this.patrolInspector = '';
+						this.patrolCount = 0;
+					}
+				})
+			}
 		}
 	}
 </script>

--
Gitblit v1.9.3