From a8e998ae4591fb97b0fc7a605226424316ae5742 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期四, 25 十二月 2025 16:44:38 +0800
Subject: [PATCH] 没有调机时间转跳到上下刀界面

---
 pages/index.vue |   66 ++++++++++++++++++++++++++++-----
 1 files changed, 56 insertions(+), 10 deletions(-)

diff --git a/pages/index.vue b/pages/index.vue
index 47cd348..805efc3 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -861,7 +861,12 @@
 			getStartBtnText(item) {
 				const isSelected = this.isShowTableData.length > 0 && this.isShowTableData[0].daa001 === item.daa001;
 				if (isSelected) {
-					return '杞烦鎶ュ伐鐣岄潰';
+					// 妫�鏌ユ槸鍚︽湁璋冩満鏃堕棿
+					if (this.isShowTableData[0].maShoutTime) {
+						return '杞烦鎶ュ伐鐣岄潰';
+					} else {
+						return '杞烦涓婁笅鍒�鐣岄潰';
+					}
 				}
 				return '寮�宸�';
 			},
@@ -872,11 +877,18 @@
 				const isSelected = this.isShowTableData.length > 0 && this.isShowTableData[0].daa001 === item.daa001;
 				
 				if (isSelected) {
-					// 濡傛灉宸查�変腑锛屽垯鍏堣烦杞埌涓荤晫闈紝鐒跺悗璺宠浆鍒版姤宸ョ晫闈�
+					// 濡傛灉宸查�変腑锛屽厛璺宠浆鍒颁富鐣岄潰
 					this.toDetail(item);
-					// 寤惰繜璺宠浆鍒版姤宸ョ晫闈�
+					
+					// 寤惰繜璺宠浆锛氭牴鎹槸鍚︽湁璋冩満鏃堕棿鍐冲畾璺宠浆鍒板摢涓晫闈�
 					setTimeout(() => {
-						this.currentTab = 4;
+						if (this.isShowTableData[0].maShoutTime) {
+							// 鏈夎皟鏈烘椂闂达紝璺宠浆鍒版姤宸ョ晫闈�
+							this.currentTab = 4;
+						} else {
+							// 娌℃湁璋冩満鏃堕棿锛岃烦杞埌涓婁笅鍒�鐣岄潰
+							this.currentTab = 2;
+						}
 					}, 100);
 				} else {
 					// 濡傛灉鏈�変腑锛屽垯鎵ц寮�宸ラ�昏緫
@@ -894,19 +906,53 @@
 							editDate: editDate,
 							item: orderSelect
 						}
-					}).then(res => {
+					}).then(async res => {
 						if (res.data.tbBillList) {
 							this.getWomdaaIsShow();
-							uni.showToast({
-								title: '寮�宸ユ垚鍔�',
-								icon: 'success',
-								duration: 2000
-							});
+							
+							// 璋冪敤鍚庣鏂规硶缁戝畾鏁伴噰鏍囧織
+							const bindSuccess = await this.bindDataCollectionFlag(item.daa001);
+							
+							// 缁戝畾鎴愬姛鍚庡啀鎻愮ず寮�宸ユ垚鍔�
+							if (bindSuccess) {
+								uni.showToast({
+									title: '寮�宸ユ垚鍔�',
+									icon: 'success',
+									duration: 2000
+								});
+							}
 						}
 					});
 				}
 			},
 			
+			// 鏂板锛氱粦瀹氭暟閲囨爣蹇楁柟娉�
+			async bindDataCollectionFlag(orderNo) {
+				try {
+					const res = await this.$post({
+						url: '/MesOrderDataCollection/BindDataCollectionFlag',
+						data: {
+							machineNo: this.machineNo,
+							orderNo: orderNo
+						}
+					});
+					
+					if (res && res.status === 0) {
+						console.log('鏁伴噰鏍囧織缁戝畾鎴愬姛');
+						this.$showMessage('鏁伴噰鏍囧織缁戝畾鎴愬姛');
+						return true;
+					} else {
+						console.error('鏁伴噰鏍囧織缁戝畾澶辫触:', res.message || '鏈煡閿欒');
+						this.$showMessage('鏁伴噰鏍囧織缁戝畾澶辫触');
+						return false;
+					}
+				} catch (err) {
+					console.error('缁戝畾鏁伴噰鏍囧織閿欒:', err);
+					this.$showMessage('缁戝畾鏁伴噰鏍囧織澶辫触');
+					return false;
+				}
+			},
+			
 			// 澶勭悊鏆傚仠锛堜娇鐢ㄦ竻绌洪噸閫夌殑閫昏緫锛�
 			async handlePauseWork(item) {
 				if (!this.machineNo) {

--
Gitblit v1.9.3