修试入库

This commit is contained in:
bb_pan 2025-08-28 16:49:03 +08:00
parent 10fa3ea038
commit 13feda7ad3
3 changed files with 43 additions and 12 deletions

View File

@ -721,6 +721,7 @@ const submitCode = () => {
backApplyInfo: taskInfo.value, backApplyInfo: taskInfo.value,
backApplyDetails: obj, backApplyDetails: obj,
} }
if (param.backApplyInfo.signUrl) delete param.backApplyInfo.signUrl
uni.showLoading({ title: '提交中...', mask: true }) uni.showLoading({ title: '提交中...', mask: true })
insertApp(param) insertApp(param)
.then((res) => { .then((res) => {

View File

@ -3,9 +3,9 @@
<view class="card" style="margin-top: 10px;"> <view class="card" style="margin-top: 10px;">
<uni-row :gutter="24"> <uni-row :gutter="24">
<uni-col :span="6">入库方式</uni-col> <uni-col :span="6">入库方式</uni-col>
<uni-col :span="6"> <!-- <uni-col :span="6">
<view class="coding-btn" @click="ocrScan">编码识别</view> <view class="coding-btn" @click="ocrScan">编码识别</view>
</uni-col> </uni-col> -->
<uni-col :span="6"> <uni-col :span="6">
<view class="coding-btn" @click="codeScan">二维码识别</view> <view class="coding-btn" @click="codeScan">二维码识别</view>
</uni-col> </uni-col>
@ -25,7 +25,20 @@
@scanErrorBox="handleScanErrorBox" @scanErrorBox="handleScanErrorBox"
/> />
<view style="margin-top: 10px;"> <view style="margin-top: 10px;">
<uni-easyinput v-model="maCode" placeholder="请输入设备编码" /> <div style="display: flex; align-items: center;">
<uni-easyinput v-model="maCode" placeholder="请输入设备编码" style="margin-right: 10px" />
<button type="primary" size="mini" @click="ocrScan">编码识别</button>
</div>
<!-- 下拉框 -->
<div v-if="optionList.length > 1" >
<uni-data-select
v-model="maId"
:localdata="optionList"
@change="changeTag"
placeholder="请选择编码"
style="margin-top: 5px"
></uni-data-select>
</div>
</view> </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>
@ -109,6 +122,7 @@ const typeId = ref("") //类型id
const maStatusName = ref("") // const maStatusName = ref("") //
const qrCode = ref("") // const qrCode = ref("") //
const maInfo = ref({}) // const maInfo = ref({}) //
const optionList = ref([]) //
const boxCode = ref("") // const boxCode = ref("") //
const boxInfo = 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 () => { const codeInBound = async () => {
if(qrCode.value==""){ if(qrCode.value==""){
@ -180,25 +198,36 @@ const getInfo = async () => {
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] if (res.data.length == 0) {
if(maInfo.value.maId!=undefined&&maInfo.value.maId!=""){ maInfo.value = {}
}else{ optionList.value = []
uni.showToast({ title: '扫码二维码未绑定设备编码!', icon: 'none'}) 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{ }else{
uni.showToast({ title: res.data.msg, icon: 'none'}) uni.showToast({ title: res.data.msg, icon: 'none'})
} }
} catch (error) { } catch (error) {
console.log('🚀 ~ getInfo ~ error:', error) console.log('🚀 ~ getInfo ~ error:', error)
maInfo.value = {}
optionList.value = []
} finally { } finally {
uni.hideLoading() uni.hideLoading()
} }
} }
// //
const cinfirmCodeInBound = async () => { const cinfirmCodeInBound = async () => {
if(maInfo.value.taskId==''&&maInfo.value.typeId==''){ if(!maInfo.value.maCode){
uni.showToast({ uni.showToast({
title: '请先扫码', title: '请先扫码或输入编码查询数据',
icon: 'none', icon: 'none',
}) })
}else{ }else{
@ -209,7 +238,7 @@ const cinfirmCodeInBound = async () => {
// agreementId: maInfo.value.agreementId, // agreementId: maInfo.value.agreementId,
// maCodeList: arr, // 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") console.log("bbbbbbbbbbbbbbbbb")
const res = await repairInputWarehouseApiTwo(param) const res = await repairInputWarehouseApiTwo(param)
console.log("yyyyyyyyy",res) console.log("yyyyyyyyy",res)
@ -222,6 +251,7 @@ const cinfirmCodeInBound = async () => {
qrCode.value = '' qrCode.value = ''
maCode.value = '' maCode.value = ''
maInfo.value = {} maInfo.value = {}
optionList.value = []
// setTimeout(() => { // setTimeout(() => {
// codeScan() // codeScan()
// }, 800) // }, 800)

View File

@ -171,7 +171,7 @@ export default {
}, },
textShow() { textShow() {
const text = this.current const text = this.current
return text.length > 13 ? text.slice(0, 20) + '...' : text return text.length > 20 ? text.slice(0, 20) + '...' : text
}, },
getOffsetByPlacement() { getOffsetByPlacement() {
return this.placement === 'top' ? 'bottom:calc(100% + 12px);' : 'top:calc(100% + 12px);' return this.placement === 'top' ? 'bottom:calc(100% + 12px);' : 'top:calc(100% + 12px);'