From a6baad20258a61d9ce9a786029ca4cb63a7c992e Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期二, 21 四月 2026 17:31:33 +0800
Subject: [PATCH] 优化出入库功能,新增对未完全入库和出库商品的检查,更新相关API接口以支持审批人字段的统一命名

---
 src/pages/equipmentManagement/upkeep/add.vue |   31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/src/pages/equipmentManagement/upkeep/add.vue b/src/pages/equipmentManagement/upkeep/add.vue
index fbdf304..c89e05a 100644
--- a/src/pages/equipmentManagement/upkeep/add.vue
+++ b/src/pages/equipmentManagement/upkeep/add.vue
@@ -41,6 +41,14 @@
 				</template>
 			</u-form-item>
 			
+			<u-form-item label="淇濆吇椤圭洰" prop="maintenanceLocation" border-bottom>
+				<u-input
+					v-model="form.maintenanceLocation"
+					placeholder="璇疯緭鍏ヤ繚鍏婚」鐩�"
+					clearable
+				/>
+			</u-form-item>
+			
 			<!-- 鎻愪氦鎸夐挳 -->
 			<view class="footer-btns">
 				<u-button class="cancel-btn" @click="goBack">鍙栨秷</u-button>
@@ -122,6 +130,7 @@
 	deviceLedgerId: undefined, // 璁惧ID
 	deviceModel: undefined, // 瑙勬牸鍨嬪彿
 	maintenancePlanTime: dayjs().format("YYYY-MM-DD"), // 璁″垝淇濆吇鏃ユ湡
+	maintenanceLocation: undefined, // 淇濆吇椤圭洰
 });
 
 // 鍔犺浇璁惧鍒楄〃
@@ -144,6 +153,7 @@
 				form.value.deviceLedgerId = data.deviceLedgerId;
 				form.value.deviceModel = data.deviceModel;
 				form.value.maintenancePlanTime = dayjs(data.maintenancePlanTime).format("YYYY-MM-DD");
+				form.value.maintenanceLocation = data.maintenanceLocation;
 				// 璁剧疆璁惧鍚嶇О鏄剧ず
 				const device = deviceOptions.value.find(item => item.id === data.deviceLedgerId);
 				if (device) {
@@ -187,24 +197,25 @@
 	}
 	
 	isScanning.value = true;
-	showToast('鎵爜鎴愬姛锛�3绉掑悗鑷姩濉厖璁惧淇℃伅');
+	showToast('鎵爜鎴愬姛');
 	
 	// 3绉掑悗澶勭悊鎵爜缁撴灉
 	scanTimer.value = setTimeout(() => {
 		processScanResult(scanResult);
 		isScanning.value = false;
-	}, 3000);
+	}, 1000);
 };
-
+function getDeviceIdByRegExp(url) {
+	// 鍖归厤deviceId=鍚庨潰鐨勬暟瀛�
+	const reg = /deviceId=(\d+)/;
+	const match = url.match(reg);
+	// 濡傛灉鍖归厤鍒扮粨鏋滐紝杩斿洖鏁板瓧绫诲瀷锛屽惁鍒欒繑鍥瀗ull
+	return match ? Number(match[1]) : null;
+}
 // 澶勭悊鎵爜缁撴灉骞跺尮閰嶈澶�
 const processScanResult = (scanResult) => {
-	// 鍦ㄨ澶囧垪琛ㄤ腑鏌ユ壘鍖归厤鐨勮澶�
-	// 鍋囪浜岀淮鐮佸唴瀹规槸璁惧鍚嶇О鎴栬澶囩紪鍙�
-	const matchedDevice = deviceOptions.value.find(device => 
-		device.deviceName === scanResult || 
-		device.deviceCode === scanResult ||
-		device.id.toString() === scanResult
-	);
+	const deviceId = getDeviceIdByRegExp(scanResult);
+	const matchedDevice = deviceOptions.value.find(item => item.id == deviceId);
 	
 	if (matchedDevice) {
 		// 鎵惧埌鍖归厤鐨勮澶囷紝鑷姩濉厖

--
Gitblit v1.9.3