|
@@ -390,12 +390,11 @@ const spaceRes = computed(() => {
|
|
|
return ''
|
|
|
}
|
|
|
})
|
|
|
-onShow(() => {
|
|
|
+onShow(async () => {
|
|
|
focusType.value = true
|
|
|
loading.value = false
|
|
|
- _getWarehouseSpace()
|
|
|
- _getBindParams()
|
|
|
- _getPrinterList()
|
|
|
+ await _getWarehouseSpace()
|
|
|
+ await Promise.all([_getBindParams(), _getPrinterList()])
|
|
|
})
|
|
|
onHide(() => {
|
|
|
focusType.value = false
|
|
@@ -404,7 +403,7 @@ onHide(() => {
|
|
|
onNavigationBarButtonTap((event: any) => {
|
|
|
if (event.index === 0) {
|
|
|
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
|
|
|
message.value.open()
|
|
|
// 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) {
|
|
|
// console.log('有打印面单')
|
|
|
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'
|
|
|
messageText.value = res.msg
|
|
|
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(() => {
|
|
|
reset()
|
|
|
st && clearTimeout(st)
|
|
@@ -600,17 +599,17 @@ const scanOutstock = async () => {
|
|
|
messageText.value = res.msg
|
|
|
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) {
|
|
|
// console.log('有打印面单')
|
|
|
selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0
|
|
@@ -628,17 +627,17 @@ const scanOutstock = async () => {
|
|
|
messageText.value = res.msg
|
|
|
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(() => {
|
|
|
reset()
|
|
|
st && clearTimeout(st)
|
|
@@ -658,30 +657,30 @@ const weighScan = async () => {
|
|
|
messageType.value = 'success'
|
|
|
messageText.value = res.msg
|
|
|
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 {
|
|
|
messageType.value = 'error'
|
|
|
messageText.value = res.msg
|
|
|
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(() => {
|
|
|
reset()
|
|
@@ -734,7 +733,7 @@ const onsubmit = () => {
|
|
|
})
|
|
|
}
|
|
|
const getHistory = () => {
|
|
|
- // this.instockHistory = uni.getStorageSync('history')
|
|
|
+ instockHistory.value = uni.getStorageSync('instockHistory')
|
|
|
}
|
|
|
const getImages = () => {
|
|
|
const res = images.value.map((item: any) => {
|