From 8f8a20ba4a2c3835d6dc53b6f9012d5bfa8ac266 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Sat, 23 Aug 2025 14:46:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B5=E5=AD=90=E6=A0=87=E7=AD=BE=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integratedQuery/electronicTag/index.vue | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/pages/integratedQuery/electronicTag/index.vue b/src/pages/integratedQuery/electronicTag/index.vue index 1cb8799..e319a27 100644 --- a/src/pages/integratedQuery/electronicTag/index.vue +++ b/src/pages/integratedQuery/electronicTag/index.vue @@ -12,7 +12,7 @@ -
+
{ }) getSelectionList({ maCode: code.value, maId: 0 }).then((response) => { if (response.data && response.data.length !== 0) { + if (response.data.length === 1) { + const option = response.data[0] + maCodeTwo.value = code.value + maId.value = option.maId + getTagInfo(option.devType) + } optionList.value = response.data.map((option) => ({ value: option.maId, text: option.maCode, devType: option.devType, })) } else { + isJj.value = null uni.showToast({ title: '未查询到该编号信息', icon: 'none', @@ -296,6 +303,7 @@ const handQuery = () => { }) } }).finally(() => { + isJj.value = null uni.hideLoading() }) } @@ -309,13 +317,16 @@ const changeTag = async (e) => { maCodeTwo.value = option.text || '' console.log('🚀 ~ changeTag ~ maCodeTwo:', maCodeTwo.value) if (!maCodeTwo.value) return + getTagInfo(option.devType) +} +const getTagInfo = async (devType) => { try { uni.showLoading({ title: '加载中...', mask: true, }) - const response = await getListTag({ maCode: maCodeTwo.value, maId: maId.value, devType: option.devType }) + const response = await getListTag({ maCode: maCodeTwo.value, maId: maId.value, devType: devType }) if (response.data && response.data.length !== 0) { tagInfo.value = response.data[0] isJj.value = tagInfo.value.isJj @@ -338,11 +349,19 @@ const changeTag = async (e) => { } } catch (error) { console.error('获取标签信息失败', error) - uni.showToast({ - title: '获取信息失败', - icon: 'none', - duration: 2000, - }) + if (error.data && error.data.msg && error.data.msg.includes('检验时间')) { + uni.showModal({ + title: '提示', + content: '该工器具已临近下次检验时间,请及时退还至机具(物流)分公司!', + showCancel: false, + }) + } else { + uni.showToast({ + title: '获取信息失败', + icon: 'none', + duration: 2000, + }) + } } finally { uni.hideLoading() }