From 0a0aaff74884a8ecab15fb581855a148f442f5c5 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期四, 25 十二月 2025 10:12:52 +0800
Subject: [PATCH] 上下刀调机逻辑优化
---
pages/index.vue | 68 ++++++++++++++++++++++++---------
1 files changed, 49 insertions(+), 19 deletions(-)
diff --git a/pages/index.vue b/pages/index.vue
index 46af944..47cd348 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -361,17 +361,8 @@
onShow() {
this.refresh();
this.resetAutoRedirectTimer();
- // 椤甸潰鏄剧ず鏃跺姞杞藉伐鍗曞垪琛�
+ // 濡傛灉鍦ㄥ伐鍗曢�夋嫨椤甸潰锛屽惎鍔ㄥ畾鏃跺埛鏂�
if (this.currentTab === 7) {
- // 榛樿閫変腑鈥滃緟寮�宸ャ�佹湭寮�宸ャ�佹殏鍋溾��
- this.engineeringNo = '寰呭紑宸ャ�佹湭寮�宸ャ�佹殏鍋�';
- this.engineeringNoMapList = [
- '寰呭紑宸ャ�佹湭寮�宸ャ�佹殏鍋�',
- '寮�宸�',
- '瀹屽伐'
- ];
- this.getWomdaaByStatus();
- // 鍚姩瀹氭椂鍒锋柊
this.startAutoRefresh();
}
},
@@ -474,12 +465,20 @@
refresh() {
this.getMachineList();
- this.getPrintInfo();
- this.getWomdaaIsShow();
+ this.getPrintInfo(); // getPrintInfo 瀹屾垚鍚庝細鑷姩璋冪敤 getWomdaaIsShow()
// 濡傛灉褰撳墠鍦ㄥ伐鍗曢�夋嫨椤甸潰锛岄粯璁ゅ姞杞藉伐鍗曞垪琛�
if (this.currentTab === 7) {
- // 榛樿閫変腑鈥滃緟寮�宸ャ�佹湭寮�宸ャ�佹殏鍋溾��
- this.engineeringNo = '寰呭紑宸ャ�佹湭寮�宸ャ�佹殏鍋�';
+ // 鏍规嵁褰撳墠缁戝畾宸ュ崟鐨勭姸鎬佸喅瀹氶粯璁ょ瓫閫夋潯浠�
+ let defaultStatus = '寰呭紑宸ャ�佹湭寮�宸ャ�佹殏鍋�';
+ if (this.isShowTableData.length > 0) {
+ const currentOrderStatus = this.isShowTableData[0].daa018;
+ if (currentOrderStatus === '寮�宸�') {
+ defaultStatus = '寮�宸�';
+ } else if (currentOrderStatus === '瀹屽伐') {
+ defaultStatus = '瀹屽伐';
+ }
+ }
+ this.engineeringNo = defaultStatus;
this.engineeringNoMapList = [
'寰呭紑宸ャ�佹湭寮�宸ャ�佹殏鍋�',
'寮�宸�',
@@ -862,7 +861,7 @@
getStartBtnText(item) {
const isSelected = this.isShowTableData.length > 0 && this.isShowTableData[0].daa001 === item.daa001;
if (isSelected) {
- return '杞烦鍒颁富鐣岄潰';
+ return '杞烦鎶ュ伐鐣岄潰';
}
return '寮�宸�';
},
@@ -873,8 +872,12 @@
const isSelected = this.isShowTableData.length > 0 && this.isShowTableData[0].daa001 === item.daa001;
if (isSelected) {
- // 濡傛灉宸查�変腑锛屽垯璺宠浆鍒颁富鐣岄潰
+ // 濡傛灉宸查�変腑锛屽垯鍏堣烦杞埌涓荤晫闈紝鐒跺悗璺宠浆鍒版姤宸ョ晫闈�
this.toDetail(item);
+ // 寤惰繜璺宠浆鍒版姤宸ョ晫闈�
+ setTimeout(() => {
+ this.currentTab = 4;
+ }, 100);
} else {
// 濡傛灉鏈�変腑锛屽垯鎵ц寮�宸ラ�昏緫
let orderSelect = [{
@@ -909,7 +912,7 @@
if (!this.machineNo) {
return;
}
-
+
// 鐩存帴鐢� flag 鍒ゆ柇
if (this.hasBindedCutterFlag) {
uni.showToast({
@@ -919,10 +922,10 @@
});
return;
}
-
+
let editDate = this.formatDate(new Date());
this.selectedIndexs = [];
-
+
this.$post({
url: "/MesOrderSelect/Remove",
data: {
@@ -937,8 +940,35 @@
icon: 'success',
duration: 2000
});
+
+ // 鏆傚仠鎴愬姛鍚庯紝鍒锋柊褰撳墠椤甸潰
+ setTimeout(() => {
+ this.refresh();
+ }, 500);
}
});
+ },
+
+ // 鍚姩鑷姩鍒锋柊
+ startAutoRefresh() {
+ // 鍏堟竻闄ょ幇鏈夊畾鏃跺櫒
+ this.stopAutoRefresh();
+ // 鍙湪宸ュ崟閫夋嫨椤甸潰鍚姩瀹氭椂鍒锋柊
+ if (this.currentTab === 7) {
+ this.autoRefreshTimer = setInterval(() => {
+ if (this.currentTab === 7) {
+ this.refresh();
+ }
+ }, this.autoRefreshInterval);
+ }
+ },
+
+ // 鍋滄鑷姩鍒锋柊
+ stopAutoRefresh() {
+ if (this.autoRefreshTimer) {
+ clearInterval(this.autoRefreshTimer);
+ this.autoRefreshTimer = null;
+ }
}
},
computed: {}
--
Gitblit v1.9.3