修试入库
This commit is contained in:
parent
10fa3ea038
commit
13feda7ad3
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
<view class="card" style="margin-top: 10px;">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">入库方式:</uni-col>
|
||||
<uni-col :span="6">
|
||||
<!-- <uni-col :span="6">
|
||||
<view class="coding-btn" @click="ocrScan">编码识别</view>
|
||||
</uni-col>
|
||||
</uni-col> -->
|
||||
<uni-col :span="6">
|
||||
<view class="coding-btn" @click="codeScan">二维码识别</view>
|
||||
</uni-col>
|
||||
|
|
@ -25,7 +25,20 @@
|
|||
@scanErrorBox="handleScanErrorBox"
|
||||
/>
|
||||
<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 class="card" style="margin-top: 10px;">
|
||||
<view style="font-size: 32rpx;font-weight: 600;margin-bottom: 20rpx;">设备信息</view>
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);'
|
||||
|
|
|
|||
Loading…
Reference in New Issue