修试优化
This commit is contained in:
parent
d2e8fb8097
commit
721c641d3e
|
|
@ -101,7 +101,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<ElectronicSeal :maCode="formData?.maCode" :maId="formData?.maId" />
|
<ElectronicSeal :maCode="formData?.maCode" :maId="formData?.maId" :devType="formData?.devType" />
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@
|
||||||
@scanSuccessBox="handleScanSuccessBox"
|
@scanSuccessBox="handleScanSuccessBox"
|
||||||
@scanErrorBox="handleScanErrorBox"
|
@scanErrorBox="handleScanErrorBox"
|
||||||
/>
|
/>
|
||||||
|
<view style="margin-top: 10px;">
|
||||||
|
<uni-easyinput v-model="maCode" placeholder="请输入设备编码" />
|
||||||
|
</view>
|
||||||
<view class="card" style="margin-top: 10px;">
|
<view class="card" style="margin-top: 10px;">
|
||||||
<view style="font-size: 32rpx;font-weight: 600;margin-bottom: 20rpx;">设备信息</view>
|
<view style="font-size: 32rpx;font-weight: 600;margin-bottom: 20rpx;">设备信息</view>
|
||||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||||
|
|
@ -112,8 +115,12 @@ const boxInfo = ref([])
|
||||||
const scanQrCodeRef = ref(null)
|
const scanQrCodeRef = ref(null)
|
||||||
const scanQrCodeRefBox = ref(null)
|
const scanQrCodeRefBox = ref(null)
|
||||||
//编码识别
|
//编码识别
|
||||||
const ocrScan = () => {
|
const ocrScan = async () => {
|
||||||
|
if (!maCode.value) {
|
||||||
|
uni.showToast({ title: '请输入设备编码', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 扫码识别按钮
|
// 扫码识别按钮
|
||||||
|
|
@ -159,21 +166,32 @@ const codeInBound = async () => {
|
||||||
if(qrCode.value==""){
|
if(qrCode.value==""){
|
||||||
uni.showToast({ title: '扫码识别失败', icon: 'none'})
|
uni.showToast({ title: '扫码识别失败', icon: 'none'})
|
||||||
}else{
|
}else{
|
||||||
let param = {
|
getInfo()
|
||||||
qrCode: qrCode.value,
|
}
|
||||||
}
|
}
|
||||||
|
const getInfo = async () => {
|
||||||
|
let param = {
|
||||||
|
qrCode: qrCode.value || '',
|
||||||
|
maCode: maCode.value || ''
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: '加载中...', mask: true })
|
||||||
//通过二维码获取相绑定的设备编码
|
//通过二维码获取相绑定的设备编码
|
||||||
const res = await getInfoByQrcodeApi(param)
|
const res = await getInfoByQrcodeApi(param)
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if(res.code==200){
|
if(res.code==200){
|
||||||
maInfo.value = res.data[0]
|
maInfo.value = res.data[0]
|
||||||
if(maInfo.value.maId!=undefined&&maInfo.value.maId!=""){
|
if(maInfo.value.maId!=undefined&&maInfo.value.maId!=""){
|
||||||
}else{
|
}else{
|
||||||
uni.showToast({ title: '扫码二维码未绑定设备编码!', icon: 'none'})
|
uni.showToast({ title: '扫码二维码未绑定设备编码!', icon: 'none'})
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
uni.showToast({ title: res.data.msg, icon: 'none'})
|
uni.showToast({ title: res.data.msg, icon: 'none'})
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log('🚀 ~ getInfo ~ error:', error)
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 二维码入库确认
|
// 二维码入库确认
|
||||||
|
|
@ -191,7 +209,7 @@ const cinfirmCodeInBound = async () => {
|
||||||
// agreementId: maInfo.value.agreementId,
|
// agreementId: maInfo.value.agreementId,
|
||||||
// maCodeList: arr,
|
// maCodeList: arr,
|
||||||
// }
|
// }
|
||||||
let param = {qrCode:qrCode.value}
|
let param = { qrCode: qrCode.value, maCode: maInfo.value.maCode }
|
||||||
console.log("bbbbbbbbbbbbbbbbb")
|
console.log("bbbbbbbbbbbbbbbbb")
|
||||||
const res = await repairInputWarehouseApiTwo(param)
|
const res = await repairInputWarehouseApiTwo(param)
|
||||||
console.log("yyyyyyyyy",res)
|
console.log("yyyyyyyyy",res)
|
||||||
|
|
@ -200,9 +218,13 @@ const cinfirmCodeInBound = async () => {
|
||||||
title: '入库成功!',
|
title: '入库成功!',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
// 清空
|
||||||
codeScan()
|
qrCode.value = ''
|
||||||
}, 800)
|
maCode.value = ''
|
||||||
|
maInfo.value = {}
|
||||||
|
// setTimeout(() => {
|
||||||
|
// codeScan()
|
||||||
|
// }, 800)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue