diff --git a/src/components/ElectronicSeal/index.vue b/src/components/ElectronicSeal/index.vue index 5b6a21a..2e9f822 100644 --- a/src/components/ElectronicSeal/index.vue +++ b/src/components/ElectronicSeal/index.vue @@ -241,15 +241,19 @@ const props = defineProps({ type: String, default: '', }, + maId: { + type: [String, Number], + default: '', + }, }) -// 监听 props.maCode 值变化 +// 监听 props.maId 值变化 watch( - () => props.maCode, + () => props.maId, (newValue) => { console.log('newValue', newValue) if (newValue) { - maCodeTwo.value = newValue + maCodeTwo.value = props.maCode changeTag() } }, @@ -265,7 +269,7 @@ const changeTag = async () => { if (!maCodeTwo.value) return try { - const response = await getListTag({ maCode: maCodeTwo.value }) + const response = await getListTag({ maCode: maCodeTwo.value, maId: props.maId }) if (response.data && response.data.length !== 0) { tagInfo.value = response.data[0] isJj.value = tagInfo.value.isJj @@ -282,6 +286,9 @@ const changeTag = async () => { drawStamp(stampText, companyName, canvasId) }) + } else { + console.log('未找到标签信息') + isJj.value = null } } catch (error) { console.error('获取标签信息失败', error) diff --git a/src/pages/devicesSearch/codeSearch.vue b/src/pages/devicesSearch/codeSearch.vue index f3f04e2..cfc352a 100644 --- a/src/pages/devicesSearch/codeSearch.vue +++ b/src/pages/devicesSearch/codeSearch.vue @@ -101,7 +101,7 @@ - + diff --git a/src/pages/devicesSearch/ocrSearch.vue b/src/pages/devicesSearch/ocrSearch.vue index 0644133..a6c548b 100644 --- a/src/pages/devicesSearch/ocrSearch.vue +++ b/src/pages/devicesSearch/ocrSearch.vue @@ -100,7 +100,7 @@ - + diff --git a/src/pages/devicesSearch/qrSearch.vue b/src/pages/devicesSearch/qrSearch.vue index 99608ca..db01bec 100644 --- a/src/pages/devicesSearch/qrSearch.vue +++ b/src/pages/devicesSearch/qrSearch.vue @@ -75,7 +75,7 @@ - + diff --git a/src/pages/integratedQuery/electronicTag/index.vue b/src/pages/integratedQuery/electronicTag/index.vue index 7a2ef8b..5c737b7 100644 --- a/src/pages/integratedQuery/electronicTag/index.vue +++ b/src/pages/integratedQuery/electronicTag/index.vue @@ -14,7 +14,7 @@
('') const isJj = ref(null) +const maId = ref('') const maCodeTwo = ref('') const optionList = ref>([]) const tagInfo = ref({ @@ -279,7 +280,7 @@ const handQuery = () => { getSelectionList({ maCode: code.value }).then((response) => { if (response.data && response.data.length !== 0) { optionList.value = response.data.map((option) => ({ - value: option.maCode, + value: option.maId, text: option.maCode, })) } else { @@ -293,11 +294,17 @@ const handQuery = () => { } // 标签变更处理 -const changeTag = async () => { +const changeTag = async (e) => { + console.log('🚀 ~ changeTag ~ e:', e) + // 根据 maId 获取optionList.value maCode + maCodeTwo.value = optionList.value.find( + (item) => item.value === maId.value, + )?.text || '' + console.log('🚀 ~ changeTag ~ maCodeTwo:', maCodeTwo.value) if (!maCodeTwo.value) return try { - const response = await getListTag({ maCode: maCodeTwo.value }) + const response = await getListTag({ maCode: maCodeTwo.value, maId: maId.value }) if (response.data && response.data.length !== 0) { tagInfo.value = response.data[0] isJj.value = tagInfo.value.isJj