编码采集页面、铭牌更新页面、日期更新页面问题修改

This commit is contained in:
jiang 2025-08-03 17:45:11 +08:00
parent 0f55cce0c4
commit 10d178b4d5
1 changed files with 5 additions and 3 deletions

View File

@ -148,6 +148,7 @@ const supplierSelect = ref('')
//
const searchParams = ref({
keyWord: '',
qrCode: '',
})
//
@ -185,7 +186,7 @@ const handleSearch = async () => {
}
try {
const res = await getInfoByCode({ maCode: searchParams.value.keyWord, qrCode: formData.value.qrCode })
const res = await getInfoByCode({ maCode: searchParams.value.keyWord, qrCode: searchParams.value.qrCode })
if (res.code === 200 && res.data?.length) {
deviceTypes.value = res.data.map(item => ({
...item,
@ -197,6 +198,8 @@ const handleSearch = async () => {
handleDeviceTypeChange(res.data[0])
}
}
searchParams.value.keyWord = ''
searchParams.value.qrCode = ''
} catch (error) {
console.error('获取设备信息失败:', error)
uni.showToast({ title: '查询失败', icon: 'none' })
@ -218,7 +221,6 @@ const fetchSuppliers = async () => {
}
const handleDeviceTypeChange = (item) => {
console.log(item)
selectedDeviceTypeId.value = item.maId
formData.value = {
materialName: item.materialName,
@ -268,7 +270,7 @@ const handleScanSuccess = (result) => {
const qrCode = result?.data?.split('?qrcode=')[1] || result?.data
if (qrCode) {
searchParams.value.keyWord = ''
formData.value.qrCode = qrCode
searchParams.value.qrCode = qrCode
handleSearch()
} else {
uni.showToast({ title: '扫码识别失败', icon: 'none' })