change
This commit is contained in:
@@ -11,7 +11,16 @@
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
@handleChange="handleChange"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">袋码</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="bagCode"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -91,6 +100,7 @@
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
bagCode: '',
|
||||
num: null,
|
||||
dataList: [],
|
||||
// dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
|
||||
@@ -102,65 +112,9 @@
|
||||
},
|
||||
methods: {
|
||||
toScanAdd () {
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
// console.log('扫码成功:', res.result);
|
||||
if (res.result.includes(';')) {
|
||||
const parts = res.result.split(';')
|
||||
if (parts.length !== 5) {
|
||||
uni.showToast({
|
||||
title: '二维码格式不正确,请扫描符合格式的二维码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
let currObj = {
|
||||
mid: 'mid_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9),
|
||||
container_code: parts[0],
|
||||
material_code: parts[1],
|
||||
material_name: parts[2],
|
||||
qty: parts[3],
|
||||
measure_unit_id: parts[4],
|
||||
}
|
||||
// 检查是否已存在相同卷号
|
||||
const exists = this.dataList.some(item => item.container_code === currObj.container_code)
|
||||
if (exists) {
|
||||
uni.showToast({
|
||||
title: '已存在',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.dataList.push(currObj)
|
||||
} else {
|
||||
let currObj = {
|
||||
mid: 'mid_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9),
|
||||
container_code: res.result,
|
||||
material_code: '',
|
||||
material_name: '',
|
||||
qty: '',
|
||||
measure_unit_id: ''
|
||||
}
|
||||
// 检查是否已存在相同卷号
|
||||
const exists = this.dataList.some(item => item.container_code === currObj.container_code)
|
||||
if (exists) {
|
||||
uni.showToast({
|
||||
title: '已存在',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.dataList.push(currObj)
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('扫码失败:', err)
|
||||
// uni.showToast({
|
||||
// title: err + '扫码失败',
|
||||
// icon: 'none'
|
||||
// })
|
||||
}
|
||||
})
|
||||
if (this.bagCode) {
|
||||
this._getPalletAssemblyOK(this.bagCode)
|
||||
}
|
||||
},
|
||||
toDel () {
|
||||
if (!this.pkId) {
|
||||
@@ -192,11 +146,6 @@
|
||||
// })
|
||||
}
|
||||
},
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this._getPalletAssemblyOK()
|
||||
}
|
||||
},
|
||||
async _getPalletAssemblyOK () {
|
||||
try {
|
||||
let res = await getPalletAssemblyOK(this.val1)
|
||||
|
||||
Reference in New Issue
Block a user