From c7d99f5e11c4cf0667f67b8170e1c585db2e2016 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期六, 08 二月 2025 15:34:15 +0800
Subject: [PATCH] Merge branch '2.0.1' of http://139.186.142.91:10010/r/productDev/funingyunwei into 2.0.1

---
 h5/pages/operation/device.vue |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/h5/pages/operation/device.vue b/h5/pages/operation/device.vue
index 9377ebb..25d7921 100644
--- a/h5/pages/operation/device.vue
+++ b/h5/pages/operation/device.vue
@@ -83,7 +83,8 @@
 	import {
 		uploadUrl,
 		ywDevicePost,
-		ywDeviceCreate
+		ywDeviceCreate,
+		getFindByCode
 	} from '@/api'
 	import dayjs from 'dayjs';
 	import {
@@ -122,7 +123,7 @@
 			},
 			handleP() {
 				const {
-					param,
+					param, 
 					fileList
 				} = this
 				ywDeviceCreate({
@@ -284,9 +285,19 @@
 								qrbox: 280 //璁剧疆浜岀淮鐮佹壂鎻忔澶у皬
 							},
 							(decodeText, decodeResult) => {
-								if (decodeText) { //杩欓噷decodeText灏辨槸閫氳繃鎵弿浜岀淮鐮佸緱鍒扮殑鍐呭
-									this.$set(this.param, 'deviceCode', decodeText)
-									this.stopScan(); //鍏抽棴鎵爜鍔熻兘
+								if (decodeText) { //杩欓噷decodeText灏辨槸閫氳繃鎵弿浜岀淮鐮佸緱鍒扮殑鍐呭
+									this.stopScan(); //鍏抽棴鎵爜鍔熻兘
+									getFindByCode(decodeText).then(ress => {
+										if (ress.data) {
+											console.log('ress', ress.data);
+											this.$set(this.param, 'deviceCode', ress.data.code)
+											this.$set(this.param, 'deviceId', ress.data.id)
+											this.$set(this.param, 'deviceName', ress.data.name)
+										} else {
+											this.showToast('鏈尮閰嶅埌宸℃鐐�,璇烽噸鏂版壂鎻�')
+										}
+									})
+									
 								}
 							},
 							(err) => {

--
Gitblit v1.9.3