From fbe87c8d043cb038d384df7721bc071676a0c24c Mon Sep 17 00:00:00 2001
From: wangyi <2946747746@qq.com>
Date: 星期二, 03 三月 2026 14:38:49 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev

---
 pages/ZLGL/QcenvironmentTestDotCheckBill/QcenvironmentTestDotCheckBill.vue |  187 +++++++++++++++++++++++++++++++++++++---------
 1 files changed, 148 insertions(+), 39 deletions(-)

diff --git a/pages/ZLGL/QcenvironmentTestDotCheckBill/QcenvironmentTestDotCheckBill.vue b/pages/ZLGL/QcenvironmentTestDotCheckBill/QcenvironmentTestDotCheckBill.vue
index 12fdef4..19b8b94 100644
--- a/pages/ZLGL/QcenvironmentTestDotCheckBill/QcenvironmentTestDotCheckBill.vue
+++ b/pages/ZLGL/QcenvironmentTestDotCheckBill/QcenvironmentTestDotCheckBill.vue
@@ -65,8 +65,15 @@
 					</view>
 					<view class="form-item">
 					    <view class="left">妫�娴嬫柟妗�</view>
-					    <view class="right disabled">
-					        <input type="text" disabled :value="hform.HQCSchemeName" />
+					    <view class="right" :class="{ 'disabled': hasSourceBill }">
+					        <input 
+					            type="text" 
+					            v-model="hform.HQCSchemeName" 
+					            :disabled="hasSourceBill"
+					            @confirm="searchSchemeByInput"
+					            @blur="searchSchemeByInput"
+					            placeholder="璇疯緭鍏ュ崟鎹彿"
+					        />
 					    </view>
 					    <view class="icon-wrapper-big">
 					        <uni-icons type="search" size="20" @click="showSelectorModule(hform, 7)"></uni-icons>
@@ -251,13 +258,13 @@
 			<button class="btn-a" size="mini" @tap="addNew">鏂板</button>
 			<button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
 		</view>
-		<CheckEnvironmentTestItemPopupVue v-if="enablePopupModule == PopupModuleNameList[2]" ref="listPopup"
-			@update="CheckItemComplete" :bindKey="currentChechItemIDCache">
+		<CheckEnvironmentTestItemPopupVue v-if="enablePopupModule == PopupModuleNameList[2]" ref="checkItemPopup"
+		    @update="CheckItemComplete" :bindKey="currentChechItemIDCache">
 		</CheckEnvironmentTestItemPopupVue>
-		<ProcessPopupVue v-if="enablePopupModule == PopupModuleNameList[8]" ref="listPopup" @update="HProcComplete"
-			:bindKey="0"></ProcessPopupVue>
-		<CheckSchemePopupVue v-if="enablePopupModule == PopupModuleNameList[7]" ref="listPopup"
-			@update="HQCSchemeComplete" :bindKey="0"></CheckSchemePopupVue>
+		<ProcessPopupVue v-if="enablePopupModule == PopupModuleNameList[8]" ref="processPopup" @update="HProcComplete"
+		    :bindKey="0"></ProcessPopupVue>
+		<CheckSchemePopupVue v-if="enablePopupModule == PopupModuleNameList[7]" ref="checkSchemePopup"
+		    @update="HQCSchemeComplete" :bindKey="0"></CheckSchemePopupVue>
 	</view>
 </template>
 
@@ -357,15 +364,66 @@
 					HQCSchemeID: "0",
 				},
 				checkItems: {},
+				searchTimer: null, // 娣诲姞鎼滅储闃叉姈瀹氭椂鍣�
 			};
 		},
 		methods: {
-			async showSelectorModule(item, index) {
-			    this.currentChechItemIDCache = item.num || 0;
-			    this.enablePopupModule = this.PopupModuleNameList[index];
-			    await this.$nextTick();
-			    this.$refs.listPopup.showPopup();
-			},
+					async showSelectorModule(item, index) {
+					    console.log('showSelectorModule called with index:', index);
+					    
+					    // 鏍规嵁涓嶅悓鐨勬ā鍧楃被鍨嬭缃笉鍚岀殑缂撳瓨鍊�
+					    if (index === 7) { // 妫�娴嬫柟妗�
+					        this.currentChechItemIDCache = 0;
+					    } else if (index === 2) { // 妫�娴嬮」鐩�
+					        this.currentChechItemIDCache = item.num || 0;
+					    } else if (index === 8) { // 宸ュ簭
+					        this.currentChechItemIDCache = 0;
+					    } else {
+					        this.currentChechItemIDCache = 0;
+					    }
+					    
+					    this.enablePopupModule = this.PopupModuleNameList[index];
+					    console.log('enablePopupModule set to:', this.enablePopupModule);
+					    
+					    await this.$nextTick();
+					    
+					    // 鏍规嵁涓嶅悓鐨勬ā鍧楃被鍨嬭皟鐢ㄤ笉鍚岀殑 ref
+					    let popupRef = null;
+					    if (index === 2) {
+					        popupRef = this.$refs.checkItemPopup;
+					        console.log('checkItemPopup ref:', popupRef);
+					    } else if (index === 7) {
+					        popupRef = this.$refs.checkSchemePopup;
+					        console.log('checkSchemePopup ref:', popupRef);
+					    } else if (index === 8) {
+					        popupRef = this.$refs.processPopup;
+					        console.log('processPopup ref:', popupRef);
+					    }
+					    
+					    if (popupRef) {
+					        console.log('Calling showPopup on ref');
+					        popupRef.showPopup();
+					    } else {
+					        console.error('Popup ref not found for index:', index);
+					        // 灏濊瘯閲嶆柊璁剧疆 enablePopupModule
+					        setTimeout(() => {
+					            this.enablePopupModule = this.PopupModuleNameList[index];
+					            this.$nextTick(() => {
+					                const retryRef = index === 2 ? this.$refs.checkItemPopup : 
+					                                 index === 7 ? this.$refs.checkSchemePopup : 
+					                                 index === 8 ? this.$refs.processPopup : null;
+					                if (retryRef) {
+					                    retryRef.showPopup();
+					                } else {
+					                    uni.showToast({
+					                        title: '寮瑰嚭妗嗗姞杞藉け璐�',
+					                        icon: 'none'
+					                    });
+					                }
+					            });
+					        }, 100);
+					    }
+					},
 			async InitDept() {
 			    try {
 			        let res = await CommonUtils.doRequest2Async({
@@ -427,13 +485,31 @@
 			        })
 			    }
 			},
+			
+			// 鎵嬪姩杈撳叆鎼滅储妫�娴嬫柟妗�
+			searchSchemeByInput() {
+			    if (!this.hform.HQCSchemeName || this.hform.HQCSchemeName.trim() === '') {
+			        return;
+			    }
+			    
+			    // 娓呴櫎涔嬪墠鐨勫畾鏃跺櫒
+			    if (this.searchTimer) {
+			        clearTimeout(this.searchTimer);
+			    }
+			    
+			    // 璁剧疆闃叉姈锛岄伩鍏嶉绻佽姹�
+			    this.searchTimer = setTimeout(() => {
+			        this.getSchemeByNo(this.hform.HQCSchemeName.trim());
+			    }, 500);
+			},
+			
 			// 鎵弿妫�娴嬫柟妗�
 			scanScheme() {
 			    // 璋冪敤鎵弿鍔熻兘
 			    uni.scanCode({
 			        success: (res) => {
 			            if (res.result) {
-			                this.getSchemeByScan(res.result);
+			                this.getSchemeByNo(res.result);
 			            }
 			        },
 			        fail: (err) => {
@@ -446,8 +522,10 @@
 			    });
 			},
 			
-			// 鏍规嵁鎵弿缁撴灉鑾峰彇妫�娴嬫柟妗�
-			async getSchemeByScan(schemeNo) {
+			// 鏍规嵁鍗曟嵁鍙疯幏鍙栨娴嬫柟妗�
+			async getSchemeByNo(schemeNo) {
+			    if (!schemeNo) return;
+			    
 			    uni.showLoading({
 			        title: '鍔犺浇涓�...',
 			        mask: true
@@ -473,6 +551,8 @@
 			                icon: 'success'
 			            });
 			        } else {
+			            // 鏈壘鍒版椂娓呯┖鐩稿叧瀛楁
+			            this.clearSchemeData();
 			            uni.showToast({
 			                title: '鏈壘鍒版娴嬫柟妗�',
 			                icon: 'none'
@@ -487,6 +567,16 @@
 			    } finally {
 			        uni.hideLoading();
 			    }
+			},
+			
+			// 娓呯┖妫�娴嬫柟妗堢浉鍏虫暟鎹�
+			clearSchemeData() {
+			    this.hform.HQCSchemeName = '';
+			    this.hform.HEnvironmentTestSchemeID = '0';
+			    this.hform.HProcName = '';
+			    this.hform.HProcID = '0';
+			    this.checkItems = {};
+			    this.$forceUpdate();
 			},
 			
 			// 澶勭悊妫�娴嬫柟妗堟暟鎹�
@@ -674,17 +764,20 @@
 				return Object.keys(obj).length;
 			},
 			async CheckItemComplete(e) {
-				for (var key in e["retVal"]) {
-					let data = e["retVal"][key];
-					Object.assign(this.checkItems[key], {
-						HEnvironmentItemID: data["HItemID"],
-						HQCCheckItemName: data["鐜妫�娴嬮」鐩悕绉�"],
-					});
-					await this.$nextTick();
-					this.$refs.listPopup.exit();
-					await this.$nextTick();
-					this.enablePopupModule = this.PopupModuleNameList[0];
-				}
+			    for (var key in e["retVal"]) {
+			        let data = e["retVal"][key];
+			        Object.assign(this.checkItems[key], {
+			            HEnvironmentItemID: data["HItemID"],
+			            HQCCheckItemName: data["鐜妫�娴嬮」鐩悕绉�"],
+			        });
+			        await this.$nextTick();
+			        // 淇敼杩欓噷锛氫娇鐢� checkItemPopup 鑰屼笉鏄� listPopup
+			        if (this.$refs.checkItemPopup) {
+			            this.$refs.checkItemPopup.exit();
+			        }
+			        await this.$nextTick();
+			        this.enablePopupModule = this.PopupModuleNameList[0];
+			    }
 			},
 			async HQCSchemeComplete(e) {
 			    let allItems = Object.values(e.retVal);
@@ -763,17 +856,20 @@
 			    this.$forceUpdate();
 			},
 			async HProcComplete(e) {
-				for (var key in e["retVal"]) {
-					let data = e["retVal"][key];
-					Object.assign(this.hform, {
-						HProcName: data["宸ュ簭鍚嶇О"],
-						HProcID: data["HItemID"],
-					});
-					await this.$nextTick();
-					this.$refs.listPopup.exit();
-					await this.$nextTick();
-					this.enablePopupModule = this.PopupModuleNameList[0];
-				}
+			    for (var key in e["retVal"]) {
+			        let data = e["retVal"][key];
+			        Object.assign(this.hform, {
+			            HProcName: data["宸ュ簭鍚嶇О"],
+			            HProcID: data["HItemID"],
+			        });
+			        await this.$nextTick();
+			        // 淇敼杩欓噷锛氫娇鐢� processPopup 鑰屼笉鏄� listPopup
+			        if (this.$refs.processPopup) {
+			            this.$refs.processPopup.exit();
+			        }
+			        await this.$nextTick();
+			        this.enablePopupModule = this.PopupModuleNameList[0];
+			    }
 			},
 			async getMaxBillNo() {
 				try {
@@ -905,6 +1001,12 @@
 			await this.InitDept();
 			await this.WorkCenter1();
 		},
+		// 缁勪欢閿�姣佹椂娓呴櫎瀹氭椂鍣�
+		beforeDestroy() {
+		    if (this.searchTimer) {
+		        clearTimeout(this.searchTimer);
+		    }
+		}
 	};
 </script>
 
@@ -963,6 +1065,13 @@
 
 				.uni-combox { padding: 0; height: auto; }
 				.uni-combox::v-deep input { height: inherit; font-size: 26rpx; }
+				
+				input {
+				    width: 100%;
+				    border: none;
+				    outline: none;
+				    background: transparent;
+				}
 			}
 			.disabled { border: 1px solid #e4e4e4; background-color: #e4e4e4; }
 			.none-border { border: none; }

--
Gitblit v1.9.1