From 13feda7ad325642848d6097d4f20cb3fbb539a5f Mon Sep 17 00:00:00 2001 From: bb_pan Date: Thu, 28 Aug 2025 16:49:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E8=AF=95=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/back/backCode.vue | 1 + src/pages/repair/testedInBound/codeScan.vue | 52 +++++++++++++++---- .../uni-data-select/uni-data-select.vue | 2 +- 3 files changed, 43 insertions(+), 12 deletions(-) diff --git a/src/pages/back/backCode.vue b/src/pages/back/backCode.vue index 421f48a..3e07735 100644 --- a/src/pages/back/backCode.vue +++ b/src/pages/back/backCode.vue @@ -721,6 +721,7 @@ const submitCode = () => { backApplyInfo: taskInfo.value, backApplyDetails: obj, } + if (param.backApplyInfo.signUrl) delete param.backApplyInfo.signUrl uni.showLoading({ title: '提交中...', mask: true }) insertApp(param) .then((res) => { diff --git a/src/pages/repair/testedInBound/codeScan.vue b/src/pages/repair/testedInBound/codeScan.vue index ddcfa3d..5701053 100644 --- a/src/pages/repair/testedInBound/codeScan.vue +++ b/src/pages/repair/testedInBound/codeScan.vue @@ -3,9 +3,9 @@ 入库方式: - + 二维码识别 @@ -25,7 +25,20 @@ @scanErrorBox="handleScanErrorBox" /> - +
+ + +
+ +
+ +
设备信息 @@ -109,6 +122,7 @@ const typeId = ref("") //类型id const maStatusName = ref("") //状态 const qrCode = ref("") //二维码 const maInfo = ref({}) //二维码 +const optionList = ref([]) // 编码下拉 const boxCode = ref("") //标准箱 const boxInfo = ref([]) @@ -161,6 +175,10 @@ const handleScanError = (error) => { // } // }); // } +const changeTag = () => { + // 通过选择的编码获取对应的信息 + maInfo.value = optionList.value.find(item => item.maId === maId.value) || {} +} // 二维码入库 const codeInBound = async () => { if(qrCode.value==""){ @@ -180,25 +198,36 @@ const getInfo = async () => { const res = await getInfoByQrcodeApi(param) console.log(res) if(res.code==200){ - maInfo.value = res.data[0] - if(maInfo.value.maId!=undefined&&maInfo.value.maId!=""){ - }else{ - uni.showToast({ title: '扫码二维码未绑定设备编码!', icon: 'none'}) - } + if (res.data.length == 0) { + maInfo.value = {} + optionList.value = [] + return + } else if (res.data.length == 1) { + maInfo.value = res.data[0] + } else { + maInfo.value = {} + optionList.value = res.data.map(item => ({ + ...item, + text: item.maCode + ' -- ' + item.repairCode, + value: item.maId + })) + } }else{ uni.showToast({ title: res.data.msg, icon: 'none'}) } } catch (error) { console.log('🚀 ~ getInfo ~ error:', error) + maInfo.value = {} + optionList.value = [] } finally { uni.hideLoading() } } // 二维码入库确认 const cinfirmCodeInBound = async () => { - if(maInfo.value.taskId==''&&maInfo.value.typeId==''){ + if(!maInfo.value.maCode){ uni.showToast({ - title: '请先扫码!', + title: '请先扫码或输入编码查询数据!', icon: 'none', }) }else{ @@ -209,7 +238,7 @@ const cinfirmCodeInBound = async () => { // agreementId: maInfo.value.agreementId, // maCodeList: arr, // } - let param = { qrCode: qrCode.value, maCode: maInfo.value.maCode } + let param = { qrCode: qrCode.value, maCode: maInfo.value.maCode, maId: maInfo.value.maId } console.log("bbbbbbbbbbbbbbbbb") const res = await repairInputWarehouseApiTwo(param) console.log("yyyyyyyyy",res) @@ -222,6 +251,7 @@ const cinfirmCodeInBound = async () => { qrCode.value = '' maCode.value = '' maInfo.value = {} + optionList.value = [] // setTimeout(() => { // codeScan() // }, 800) diff --git a/src/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue b/src/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue index 66a7745..0a450e3 100644 --- a/src/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue +++ b/src/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue @@ -171,7 +171,7 @@ export default { }, textShow() { const text = this.current - return text.length > 13 ? text.slice(0, 20) + '...' : text + return text.length > 20 ? text.slice(0, 20) + '...' : text }, getOffsetByPlacement() { return this.placement === 'top' ? 'bottom:calc(100% + 12px);' : 'top:calc(100% + 12px);'