|
@@ -264,30 +264,30 @@ const printConfirm = async () => {
|
|
|
messageText.value = res.msg
|
|
|
messageRef.value.open()
|
|
|
|
|
|
- // const historyItem = {
|
|
|
- // order_code: valiFormData.value.order_code,
|
|
|
- // createTime: new Date(),
|
|
|
- // type: type,
|
|
|
- // status: res.data.code,
|
|
|
- // }
|
|
|
- // printLogHistory.value.unshift(historyItem)
|
|
|
- // uni.setStorageSync('printLogHistory', printLogHistory.value)
|
|
|
- // getHistory()
|
|
|
+ const historyItem = {
|
|
|
+ order_code: valiFormData.value.order_code,
|
|
|
+ createTime: new Date(),
|
|
|
+ type: type,
|
|
|
+ status: res.code,
|
|
|
+ }
|
|
|
+ printLogHistory.value.unshift(historyItem)
|
|
|
+ uni.setStorageSync('printLogHistory', printLogHistory.value)
|
|
|
+ getHistory()
|
|
|
close()
|
|
|
} else {
|
|
|
subLoading.value = false
|
|
|
messageType.value = 'error'
|
|
|
messageText.value = '打印失败'
|
|
|
messageRef.value.open()
|
|
|
- // const historyItem = {
|
|
|
- // order_code: valiFormData.value.order_code,
|
|
|
- // createTime: new Date(),
|
|
|
- // type: type,
|
|
|
- // status: false,
|
|
|
- // }
|
|
|
- // printLogHistory.value.unshift(historyItem)
|
|
|
- // uni.setStorageSync('printLogHistory', printLogHistory.value)
|
|
|
- // getHistory()
|
|
|
+ const historyItem = {
|
|
|
+ order_code: valiFormData.value.order_code,
|
|
|
+ createTime: new Date(),
|
|
|
+ type: type,
|
|
|
+ status: false,
|
|
|
+ }
|
|
|
+ printLogHistory.value.unshift(historyItem)
|
|
|
+ uni.setStorageSync('printLogHistory', printLogHistory.value)
|
|
|
+ getHistory()
|
|
|
close()
|
|
|
}
|
|
|
}
|
|
@@ -317,9 +317,9 @@ const onsubmit = async () => {
|
|
|
loading.value = false
|
|
|
}
|
|
|
|
|
|
-// const getHistory = () => {
|
|
|
-// printLogHistory.value = uni.getStorageSync('printLogHistory') || []
|
|
|
-// }
|
|
|
+const getHistory = () => {
|
|
|
+ printLogHistory.value = uni.getStorageSync('printLogHistory') || []
|
|
|
+}
|
|
|
const keypress = (e: any) => {
|
|
|
// 102 左侧 103 右侧 104 中间按键
|
|
|
if (e.keyCode === 102 || e.keyCode === 103 || e.keyCode === 104) {
|
|
@@ -372,14 +372,14 @@ onBackPress(() => {
|
|
|
|
|
|
onShow(() => {
|
|
|
hidePage.value = false
|
|
|
- // getHistory()
|
|
|
+ getHistory()
|
|
|
_getPrinterList()
|
|
|
})
|
|
|
|
|
|
onNavigationBarButtonTap((event) => {
|
|
|
if (event.index === 0) {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/warehouseScan/warehouseLog',
|
|
|
+ url: '/pages/printer/logList',
|
|
|
})
|
|
|
}
|
|
|
})
|