材料站OCR识别

This commit is contained in:
bb_pan 2025-09-11 10:04:07 +08:00
parent a570bec3c5
commit f93891ea26
3 changed files with 30 additions and 22 deletions

View File

@ -93,11 +93,9 @@
<uni-col :span="6">
<button class="item-btn" type="primary" @click="handleRfid">RFID识别</button>
</uni-col>
<!--
<uni-col :span="6">
<button class="item-btn" type="primary" @click="ocrClick">OCR识别</button>
</uni-col>
-->
</uni-row>
</view>
<ScanQrCode
@ -541,7 +539,7 @@ const ocrClick = () => {
console.log('编码识别--', queryParams.value)
uni.navigateTo({
url: `/pages/materialsStation/toolsLease/ocrScan/ocrOutScan?params=${JSON.stringify(
queryParams.value,
{ ...queryParams.value, proId: queryParamsTemp.value.proId },
)}`,
})
}

View File

@ -36,14 +36,14 @@
</view>
<view class="table-list-item">
<uni-forms :model="codeData" label-width="100" :border="true">
<uni-forms-item label="设备类型:" name="maName">
<uni-forms-item label="设备类型:" name="typeName">
<text style="height: 100%; display: flex; align-items: center">{{
codeData.maName
codeData.typeName
}}</text>
</uni-forms-item>
<uni-forms-item label="规格型号:" name="maModel">
<uni-forms-item label="规格型号:" name="typeModelName">
<text style="height: 100%; display: flex; align-items: center">{{
codeData.maModel
codeData.typeModelName
}}</text>
</uni-forms-item>
<uni-forms-item label="设备编码:" name="maCode">
@ -105,7 +105,7 @@
<script>
import { decryptWithSM4 } from '@/utils/sm'
import { getDeviceListAPI, getDeviceListAPINew } from '@/services/picking/outbound'
import { getInfoByCodeApi } from '@/services/picking/outbound'
import ElectronicSeal from '@/components/ElectronicSeal/index.vue'
export default {
@ -176,7 +176,7 @@ export default {
addCode() {
if (this.codeData.typeId != this.queryParams.typeId) {
uni.showToast({
title: `当前添加的 (${this.codeData.maName}) 类型不匹配, 请重新添加`,
title: `当前添加的 (${this.codeData.typeName}) 类型不匹配, 请重新添加`,
icon: 'none',
})
return
@ -191,8 +191,8 @@ export default {
const params = {
maCode: this.codeData.maCode,
maId: this.codeData.maId,
typeName: this.codeData.maModel,
materialName: this.codeData.maName,
typeName: this.codeData.typeModelName,
materialName: this.codeData.typeName,
typeId: this.codeData.typeId,
outType: 4,
}
@ -758,16 +758,17 @@ export default {
title: '加载中...',
mask: true,
})
const res = await getDeviceListAPINew({ maCode: this.queryCodeParams.maCode })
const res = await getInfoByCodeApi({ maCode: this.queryCodeParams.maCode, proId: this.queryParams.proId })
console.log('🚀 ~ getCode ~ res:', res)
if (res.code === 200 && res.data && res.data.length > 0) {
this.optionList = res.data.map((option) => ({
if (res.code === 200 && res.data.recordList && res.data.recordList.length > 0) {
this.optionList = res.data.recordList.map((option) => ({
value: option.maId,
text: option.maCode,
}))
if (res.data.length === 1) {
this.codeData = res.data[0]
if (res.data.recordList.length === 1) {
this.codeData = res.data.recordList[0]
console.log('🚀 ~ getCode ~ this.codeData:', this.codeData)
}
} else {
uni.showToast({
@ -787,9 +788,9 @@ export default {
async changeTag() {
if (!this.queryCodeParams.maId) return
try {
const res = await getDeviceListAPINew({ maId: this.queryCodeParams.maId })
if (res.data && res.data.length !== 0) {
this.codeData = res.data[0]
const res = await getInfoByCodeApi({ maId: this.queryCodeParams.maId, maCode: this.queryCodeParams.maCode, proId: this.queryParams.proId })
if (res.data.recordList && res.data.recordList.length !== 0) {
this.codeData = res.data.recordList[0]
}
} catch (error) {
console.error('获取编号信息失败', error)

View File

@ -116,6 +116,15 @@ export const getDeviceListAPINew = (data) => {
})
}
// 材料站-OCR 编码识别
export const getInfoByCodeApi = (data) => {
return http({
method: 'GET',
url: '/material/material_lease_apply_info/getInfoByCode',
data,
})
}
export const backOutDetailsApi = (data) => {
return http({
method: 'POST',