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()
}