From bc5c06d63e328fc1aa6847bd034a55761178ed73 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期一, 20 十月 2025 10:59:26 +0800
Subject: [PATCH] 用计算属性,不用v-model表达式
---
components/WorkOrder.vue | 66 +++++++++++++++++++--------------
1 files changed, 38 insertions(+), 28 deletions(-)
diff --git a/components/WorkOrder.vue b/components/WorkOrder.vue
index e0948d0..f12b571 100644
--- a/components/WorkOrder.vue
+++ b/components/WorkOrder.vue
@@ -82,7 +82,8 @@
</view>
<view class="form-item">
<label>鏃ュ仠鏈烘椂闀�(mi):</label>
- <input class="inp" type="text" v-model="todayOnlineTime-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);
@@ -396,33 +406,33 @@
title: title
});
},
- getSJByOrder() {
- this.$post({
- url: "/MesQaItemsDetect02/FindSJByOrderNo",
- data: {
- orderNo: this.orderNo
- }
- }).then(res => {
- let sjList = res.data.tbBillList;
- if (Array.isArray(sjList) && sjList.length > 0) {
- let latest = sjList[0];
- this.lastInitialCheck = latest.fcheckDate;
- this.initialConclusion = latest.fcheckResu;
- 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.fcheckBy; // 棣栨浜哄憳锛堝伐鍙�-濮撳悕锛�
- this.initialCount = sjList.xjCount ?? 1;
- } else {
- this.lastInitialCheck = '';
- this.initialConclusion = '';
- this.initialInspector = '';
- this.initialCount = 0;
- }
- })
- },
+ getSJByOrder() {
+ this.$post({
+ url: "/MesQaItemsDetect02/FindSJByOrderNo",
+ data: {
+ orderNo: this.orderNo
+ }
+ }).then(res => {
+ let sjList = res.data.tbBillList;
+ if (Array.isArray(sjList) && sjList.length > 0) {
+ let latest = sjList[0];
+ this.lastInitialCheck = latest.fcheckDate;
+ this.initialConclusion = latest.fcheckResu;
+ 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.fcheckBy; // 棣栨浜哄憳锛堝伐鍙�-濮撳悕锛�
+ this.initialCount = sjList.xjCount ?? 1;
+ } else {
+ this.lastInitialCheck = '';
+ this.initialConclusion = '';
+ this.initialInspector = '';
+ this.initialCount = 0;
+ }
+ })
+ },
getXJByOrder() {
this.$post({
url: "/MesQaItemsDetect02/FindXJByOrderNo",
--
Gitblit v1.9.3