From 45157062cf1ca1a84e343caada2e12795c59ab7a Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期四, 25 十二月 2025 15:03:57 +0800
Subject: [PATCH] 添加开工数采锁定逻辑

---
 pages/index.vue |   47 +++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/pages/index.vue b/pages/index.vue
index 47cd348..43cd4b1 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -894,19 +894,54 @@
 							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: '/MesOrderSelect/AddBySc',
+						data: {
+							machineNo: this.machineNo,
+							editDate: editDate,
+							item: orderSelect
+						}
+					});
+					
+					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