|
@@ -394,8 +394,7 @@ onShow(async () => {
|
|
focusType.value = true
|
|
focusType.value = true
|
|
loading.value = false
|
|
loading.value = false
|
|
await _getWarehouseSpace()
|
|
await _getWarehouseSpace()
|
|
- await _getBindParams()
|
|
|
|
- await _getPrinterList()
|
|
|
|
|
|
+ await Promise.all([_getBindParams(), _getPrinterList()])
|
|
})
|
|
})
|
|
onHide(() => {
|
|
onHide(() => {
|
|
focusType.value = false
|
|
focusType.value = false
|
|
@@ -404,7 +403,7 @@ onHide(() => {
|
|
onNavigationBarButtonTap((event: any) => {
|
|
onNavigationBarButtonTap((event: any) => {
|
|
if (event.index === 0) {
|
|
if (event.index === 0) {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: '/pages/instock/instockLog',
|
|
|
|
|
|
+ url: '/pages/weigh/instockLog',
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -538,16 +537,16 @@ const instockScan = async (is_save_goods: number) => {
|
|
messageText.value = res.msg
|
|
messageText.value = res.msg
|
|
message.value.open()
|
|
message.value.open()
|
|
// console.log('res.data.data---', res.data.data)
|
|
// console.log('res.data.data---', res.data.data)
|
|
- // const historyItem = {
|
|
|
|
- // orderNum: valiFormData.orderNum,
|
|
|
|
- // createTime: new Date(),
|
|
|
|
- // space: spaceRes.value,
|
|
|
|
- // type: '入库',
|
|
|
|
- // status: true,
|
|
|
|
- // }
|
|
|
|
- // instockHistory.value.unshift(historyItem)
|
|
|
|
- // uni.setStorageSync('instockHistory', instockHistory.value)
|
|
|
|
- // getHistory()
|
|
|
|
|
|
+ const historyItem = {
|
|
|
|
+ orderNum: valiFormData.orderNum,
|
|
|
|
+ createTime: new Date(),
|
|
|
|
+ space: spaceRes.value,
|
|
|
|
+ type: '入库',
|
|
|
|
+ status: true,
|
|
|
|
+ }
|
|
|
|
+ instockHistory.value.unshift(historyItem)
|
|
|
|
+ uni.setStorageSync('instockHistory', instockHistory.value)
|
|
|
|
+ getHistory()
|
|
if (res.data.express_label) {
|
|
if (res.data.express_label) {
|
|
// console.log('有打印面单')
|
|
// console.log('有打印面单')
|
|
selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0
|
|
selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0
|
|
@@ -562,16 +561,16 @@ const instockScan = async (is_save_goods: number) => {
|
|
messageType.value = 'error'
|
|
messageType.value = 'error'
|
|
messageText.value = res.msg
|
|
messageText.value = res.msg
|
|
message.value.open()
|
|
message.value.open()
|
|
- // const historyItem = {
|
|
|
|
- // orderNum: valiFormData.orderNum,
|
|
|
|
- // createTime: new Date(),
|
|
|
|
- // space: spaceRes.value,
|
|
|
|
- // type: '入库',
|
|
|
|
- // status: false,
|
|
|
|
- // }
|
|
|
|
- // instockHistory.value.unshift(historyItem)
|
|
|
|
- // uni.setStorageSync('instockHistory', instockHistory.value)
|
|
|
|
- // getHistory()
|
|
|
|
|
|
+ const historyItem = {
|
|
|
|
+ orderNum: valiFormData.orderNum,
|
|
|
|
+ createTime: new Date(),
|
|
|
|
+ space: spaceRes.value,
|
|
|
|
+ type: '入库',
|
|
|
|
+ status: false,
|
|
|
|
+ }
|
|
|
|
+ instockHistory.value.unshift(historyItem)
|
|
|
|
+ uni.setStorageSync('instockHistory', instockHistory.value)
|
|
|
|
+ getHistory()
|
|
st = setTimeout(() => {
|
|
st = setTimeout(() => {
|
|
reset()
|
|
reset()
|
|
st && clearTimeout(st)
|
|
st && clearTimeout(st)
|
|
@@ -600,17 +599,17 @@ const scanOutstock = async () => {
|
|
messageText.value = res.msg
|
|
messageText.value = res.msg
|
|
message.value.open()
|
|
message.value.open()
|
|
|
|
|
|
- // const historyItem = {
|
|
|
|
- // orderNum: valiFormData.orderNum,
|
|
|
|
- // batch_text: batchText(valiFormData.batch_number),
|
|
|
|
- // createTime: new Date(),
|
|
|
|
- // type: '出库',
|
|
|
|
- // status: true,
|
|
|
|
- // }
|
|
|
|
- // instockHistory.value.unshift(historyItem)
|
|
|
|
- // instockHistory.value.length > 10 && (instockHistory.value.length = 10)
|
|
|
|
- // uni.setStorageSync('instockHistory', instockHistory.value)
|
|
|
|
- // getHistory()
|
|
|
|
|
|
+ const historyItem = {
|
|
|
|
+ orderNum: valiFormData.orderNum,
|
|
|
|
+ batch_text: batchText(valiFormData.batch_number),
|
|
|
|
+ createTime: new Date(),
|
|
|
|
+ type: '出库',
|
|
|
|
+ status: true,
|
|
|
|
+ }
|
|
|
|
+ instockHistory.value.unshift(historyItem)
|
|
|
|
+ instockHistory.value.length > 10 && (instockHistory.value.length = 10)
|
|
|
|
+ uni.setStorageSync('instockHistory', instockHistory.value)
|
|
|
|
+ getHistory()
|
|
if (res.data.labels && res.data.labels.length > 0) {
|
|
if (res.data.labels && res.data.labels.length > 0) {
|
|
// console.log('有打印面单')
|
|
// console.log('有打印面单')
|
|
selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0
|
|
selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0
|
|
@@ -628,17 +627,17 @@ const scanOutstock = async () => {
|
|
messageText.value = res.msg
|
|
messageText.value = res.msg
|
|
message.value.open()
|
|
message.value.open()
|
|
|
|
|
|
- // const historyItem = {
|
|
|
|
- // orderNum: valiFormData.orderNum,
|
|
|
|
- // batch_text: batchText(valiFormData.batch_number),
|
|
|
|
- // createTime: new Date(),
|
|
|
|
- // type: '出库',
|
|
|
|
- // status: false,
|
|
|
|
- // }
|
|
|
|
- // instockHistory.value.unshift(historyItem)
|
|
|
|
- // instockHistory.value.length > 10 && (instockHistory.value.length = 10)
|
|
|
|
- // uni.setStorageSync('instockHistory', instockHistory.value)
|
|
|
|
- // getHistory()
|
|
|
|
|
|
+ const historyItem = {
|
|
|
|
+ orderNum: valiFormData.orderNum,
|
|
|
|
+ batch_text: batchText(valiFormData.batch_number),
|
|
|
|
+ createTime: new Date(),
|
|
|
|
+ type: '出库',
|
|
|
|
+ status: false,
|
|
|
|
+ }
|
|
|
|
+ instockHistory.value.unshift(historyItem)
|
|
|
|
+ instockHistory.value.length > 10 && (instockHistory.value.length = 10)
|
|
|
|
+ uni.setStorageSync('instockHistory', instockHistory.value)
|
|
|
|
+ getHistory()
|
|
st = setTimeout(() => {
|
|
st = setTimeout(() => {
|
|
reset()
|
|
reset()
|
|
st && clearTimeout(st)
|
|
st && clearTimeout(st)
|
|
@@ -658,30 +657,30 @@ const weighScan = async () => {
|
|
messageType.value = 'success'
|
|
messageType.value = 'success'
|
|
messageText.value = res.msg
|
|
messageText.value = res.msg
|
|
message.value.open()
|
|
message.value.open()
|
|
- // const historyItem = {
|
|
|
|
- // orderNum: valiFormData.orderNum,
|
|
|
|
- // createTime: new Date(),
|
|
|
|
- // type: '称重',
|
|
|
|
- // status: true,
|
|
|
|
- // }
|
|
|
|
- // instockHistory.value.unshift(historyItem)
|
|
|
|
- // instockHistory.value.length > 10 && (instockHistory.value.length = 10)
|
|
|
|
- // uni.setStorageSync('instockHistory', instockHistory.value)
|
|
|
|
- // getHistory()
|
|
|
|
|
|
+ const historyItem = {
|
|
|
|
+ orderNum: valiFormData.orderNum,
|
|
|
|
+ createTime: new Date(),
|
|
|
|
+ type: '称重',
|
|
|
|
+ status: true,
|
|
|
|
+ }
|
|
|
|
+ instockHistory.value.unshift(historyItem)
|
|
|
|
+ instockHistory.value.length > 10 && (instockHistory.value.length = 10)
|
|
|
|
+ uni.setStorageSync('instockHistory', instockHistory.value)
|
|
|
|
+ getHistory()
|
|
} else {
|
|
} else {
|
|
messageType.value = 'error'
|
|
messageType.value = 'error'
|
|
messageText.value = res.msg
|
|
messageText.value = res.msg
|
|
message.value.open()
|
|
message.value.open()
|
|
- // const historyItem = {
|
|
|
|
- // orderNum: valiFormData.orderNum,
|
|
|
|
- // createTime: new Date(),
|
|
|
|
- // type: '称重',
|
|
|
|
- // status: false,
|
|
|
|
- // }
|
|
|
|
- // instockHistory.value.unshift(historyItem)
|
|
|
|
- // instockHistory.value.length > 10 && (instockHistory.value.length = 10)
|
|
|
|
- // uni.setStorageSync('instockHistory', instockHistory.value)
|
|
|
|
- // getHistory()
|
|
|
|
|
|
+ const historyItem = {
|
|
|
|
+ orderNum: valiFormData.orderNum,
|
|
|
|
+ createTime: new Date(),
|
|
|
|
+ type: '称重',
|
|
|
|
+ status: false,
|
|
|
|
+ }
|
|
|
|
+ instockHistory.value.unshift(historyItem)
|
|
|
|
+ instockHistory.value.length > 10 && (instockHistory.value.length = 10)
|
|
|
|
+ uni.setStorageSync('instockHistory', instockHistory.value)
|
|
|
|
+ getHistory()
|
|
}
|
|
}
|
|
st = setTimeout(() => {
|
|
st = setTimeout(() => {
|
|
reset()
|
|
reset()
|
|
@@ -734,7 +733,7 @@ const onsubmit = () => {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
const getHistory = () => {
|
|
const getHistory = () => {
|
|
- // this.instockHistory = uni.getStorageSync('history')
|
|
|
|
|
|
+ instockHistory.value = uni.getStorageSync('instockHistory')
|
|
}
|
|
}
|
|
const getImages = () => {
|
|
const getImages = () => {
|
|
const res = images.value.map((item: any) => {
|
|
const res = images.value.map((item: any) => {
|