电子标签查询

This commit is contained in:
bb_pan 2025-08-18 11:24:08 +08:00
parent 0f0d69a1bd
commit 84c8377dd8
1 changed files with 45 additions and 26 deletions

View File

@ -9,7 +9,7 @@
class="input-field"
/>
<button @click="handQuery" class="query-btn">查询</button>
<button @click="handleRecognition" class="recognition-btn">识别</button>
<!-- <button @click="handleRecognition" class="recognition-btn">识别</button> -->
</div>
<div v-if="optionList.length > 0" class="select-container">
@ -67,7 +67,7 @@
<div
style="width: 50%; display: flex; justify-content: end; align-items: center"
>
<span style="color: #ef3e3e; margin-right: 20px; font-size: 14px">
<span style="color: #ef3e3e; margin: 20px 25px 0 0; font-size: 20px">
{{ tagInfo.inspectStatus }}
</span>
</div>
@ -93,14 +93,14 @@
<div style="margin-top: 0px; display: flex">
<div style="width: 50%; display: flex; align-items: center">
<span style="color: #4dad7e">检修员</span>
<span style="margin-left: 40px">{{ tagInfo.inspectMan }}</span>
<span style="margin-left: 40px">{{ tagInfo.checkMan }}</span>
</div>
<div
style="width: 50%; display: flex; justify-content: end; align-items: center"
>
<span style="color: #4dad7e; font-size: 14px">检验员</span>
<span style="margin-left: 20px; margin-right: 20px; font-size: 14px">
{{ tagInfo.checkMan }}
{{ tagInfo.inspectMan || '高民'}}
</span>
</div>
</div>
@ -112,7 +112,7 @@
</div>
<!-- 检测报告链接 -->
<div style="margin-top: 1px; display: flex; align-items: center">
<!-- <div style="margin-top: 1px; display: flex; align-items: center" v-if="tagInfo.exUrl">
<span style="color: #4dad7e">出库检验报告</span>
<span
style="
@ -121,19 +121,19 @@
cursor: pointer;
color: #4dad7e;
"
@click="handleReportClick"
@click="handleReportClick(tagInfo.exUrl)"
>
检测报告
</span>
</div>
</div> -->
<!-- 印章位置 -->
<canvas
canvas-id="canvas"
style="
position: absolute;
bottom: 15px;
right: 20px;
bottom: 28px;
right: 3px;
width: 200px;
height: 200px;
z-index: 10;
@ -193,18 +193,18 @@
<div style="margin-top: 0px; display: flex; align-items: center">
<span>试验人</span>
<span style="margin-left: 40px">{{ tagInfo.checkMan }}</span>
<span style="margin-left: 40px">{{ tagInfo.inspectMan || tagInfo.checkMan }}</span>
</div>
<div style="margin-top: 0px; display: flex; align-items: center">
<span>检验结果</span>
<span style="margin-left: 40px; color: #ef3e3e">
<span style="margin-left: 40px; color: #ef3e3e; font-size: 20px">
{{ tagInfo.inspectStatus }}
</span>
</div>
<!-- 检测报告链接 -->
<div style="margin-top: 0px; display: flex; align-items: center">
<!-- <div style="margin-top: 0px; display: flex; align-items: center" v-if="tagInfo.exUrl">
<span>检测报告</span>
<span
style="
@ -213,19 +213,19 @@
cursor: pointer;
color: #0055aa;
"
@click="handleReportClick"
@click="handleReportClick(tagInfo.exUrl)"
>
检测报告
</span>
</div>
</div> -->
<!-- 印章位置 -->
<canvas
canvas-id="canvasTwo"
style="
position: absolute;
bottom: 15px;
right: 20px;
bottom: 28px;
right: 3px;
width: 200px;
height: 200px;
z-index: 10;
@ -277,11 +277,16 @@ const handQuery = () => {
return
}
getSelectionList({ maCode: code.value }).then((response) => {
uni.showLoading({
title: '查询中...',
mask: true,
})
getSelectionList({ maCode: code.value, maId: 0 }).then((response) => {
if (response.data && response.data.length !== 0) {
optionList.value = response.data.map((option) => ({
value: option.maId,
text: option.maCode,
devType: option.devType,
}))
} else {
uni.showToast({
@ -290,6 +295,8 @@ const handQuery = () => {
duration: 2000,
})
}
}).finally(() => {
uni.hideLoading()
})
}
@ -297,14 +304,18 @@ const handQuery = () => {
const changeTag = async (e) => {
console.log('🚀 ~ changeTag ~ e:', e)
// maId optionList.value maCode
maCodeTwo.value = optionList.value.find(
(item) => item.value === maId.value,
)?.text || ''
const option = optionList.value.find((item) => item.value === e)
console.log('🚀 ~ changeTag ~ option:', option.devType)
maCodeTwo.value = option.text || ''
console.log('🚀 ~ changeTag ~ maCodeTwo:', maCodeTwo.value)
if (!maCodeTwo.value) return
try {
const response = await getListTag({ maCode: maCodeTwo.value, maId: maId.value })
uni.showLoading({
title: '加载中...',
mask: true,
})
const response = await getListTag({ maCode: maCodeTwo.value, maId: maId.value, devType: option.devType })
if (response.data && response.data.length !== 0) {
tagInfo.value = response.data[0]
isJj.value = tagInfo.value.isJj
@ -321,6 +332,9 @@ const changeTag = async (e) => {
drawStamp(stampText, companyName, canvasId)
})
} else {
console.log('未找到标签信息')
isJj.value = null
}
} catch (error) {
console.error('获取标签信息失败', error)
@ -329,6 +343,8 @@ const changeTag = async (e) => {
icon: 'none',
duration: 2000,
})
} finally {
uni.hideLoading()
}
}
@ -420,12 +436,14 @@ const create5star = (
}
// PDF
const handleReportClick = async () => {
return
const handleReportClick = async (url) => {
// url = 'http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api/' + url
// http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api
if (!url.startsWith('http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api')) {
url = 'http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api/' + url
}
try {
const pdfUrl = encodeURI(
'http://192.168.0.244:18583/statics/2025/03/05/清新互联智能事件格式_2021(1)_20250305153249A001.pdf',
)
const pdfUrl = encodeURI(url)
uni.showLoading({ title: '下载中...', mask: true })
uni.downloadFile({
@ -490,6 +508,7 @@ page {
/* min-width: 100%; */
overflow: visible;
margin: 0 auto;
color: #333;
/* padding: 10px; */
}