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