From 1b72f42677758b500ef67cda169c845750203e71 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Wed, 6 Aug 2025 14:48:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/devicesSearch/ocrSearch.vue | 115 ++++++++++++-------------- 1 file changed, 53 insertions(+), 62 deletions(-) diff --git a/src/pages/devicesSearch/ocrSearch.vue b/src/pages/devicesSearch/ocrSearch.vue index 98b6954..7f3f3e2 100644 --- a/src/pages/devicesSearch/ocrSearch.vue +++ b/src/pages/devicesSearch/ocrSearch.vue @@ -36,42 +36,67 @@ - - {{ codeData.materialType }} + + {{ codeData.maName }} - - {{ codeData.materialName }} - - - {{ codeData.materialModel }} + + {{ codeData.maModel }} {{ codeData.maCode }} - - {{ codeData.statusName }} + + {{ codeData.maStatus }} - - {{ codeData.inspectionTime }} + + {{ codeData.thisCheckTime }} - - {{ codeData.nextInspectionTime }} + + {{ codeData.nextCheckTime }} + + + {{ codeData.inOutNum }} + + + {{ codeData.inTime }} + + + {{ codeData.serviceNum }} + + + {{ codeData.serviceNum }} + + + {{ codeData.checkNum }} {{ codeData.inspectionPerson }} - - {{ codeData.inspectionVerifier }} + + {{ codeData.scrapTime }} - - {{ codeData.contactNumber }} + + {{}} - - {{ codeData.materialProject }} + + {{ codeData.leaseUnit }} - - {{ codeData.materialUnit }} + + {{ codeData.leaseProject }} + + {{ codeData.leaseTime }} + + + {{ codeData.backUnit }} + + + {{ codeData.backProject }} + + + {{ codeData.backTime }} + + @@ -700,7 +725,7 @@ export default { }, // 编码检索 - async getCode() { + getCode() { if (!this.queryCodeParams.maCode.trim()) { uni.showToast({ title: '请输入设备编码', @@ -710,16 +735,16 @@ export default { } try { getDeviceListAPI({'maCode': this.queryCodeParams.maCode}).then(response => { - console.log("xxxxxxxxxxx",response) - if (response.data && response.data.length !== 0) { - this.optionList = response.data.data.map(option => ({ + console.log("xxxxxxxxxxx", response) + if (response.code === 200 && response.data && response.data.length > 0) { + this.optionList = response.data.map(option => ({ value: option.maId, text: option.maCode })); - if (response.data.data.length === 1) { - this.codeData = response.data.data[0]; + if (response.data.length === 1) { + this.codeData = response.data[0]; } - }else{ + } else { uni.showToast({ title: '未查询到该编号信息', icon: 'none', @@ -730,40 +755,6 @@ export default { console.error("获取设备信息失败", error) uni.hideLoading() }) - - // const response = await new Promise((resolve, reject)=> - // { - // uni.request({ - // url: '/material/ma_machine/getHisByCode', - // method: 'GET', - // data: {maCode: this.queryCodeParams.maCode}, - // success: resolve, - // fail: reject - // }); - // } - // ) - // ; - // let res; - // if (!response.data.code) { - // res=JSON.parse(decryptWithSM4(res.data)) - // } else { - // res =res.data - // } - // console.log("res", res); - // if (response.data?.data && response.data.data.length > 0) { - // this.optionList = response.data.data.map(option => ({ - // value: option.maId, - // text: option.maCode - // })); - // if (response.data.data.length === 1) { - // this.codeData = response.data.data[0]; - // } - // } else { - // uni.showToast({ - // title: '未查询到该编号信息', - // icon: 'none' - // }); - // } } catch (error) { console.error('查询失败:', error); uni.showToast({