|
@@ -66,11 +66,11 @@
|
|
|
提交
|
|
|
</button>
|
|
|
</view>
|
|
|
- <view v-if="lotnoLogHistory.length > 0" class="history">
|
|
|
+ <view v-if="scanLotnoHistory.length > 0" class="history">
|
|
|
<text class="title">记录(最近5条)</text>
|
|
|
</view>
|
|
|
<view class="history">
|
|
|
- <view class="item" v-for="(item, i) in lotnoLogHistory.slice(0, 5)" :key="i">
|
|
|
+ <view class="item" v-for="(item, i) in scanLotnoHistory.slice(0, 5)" :key="i">
|
|
|
<text class="type">{{ item.type }}</text>
|
|
|
<text class="code" :style="{ color: item.status ? 'green' : '#666' }">{{
|
|
|
item.orderNum
|
|
@@ -118,7 +118,7 @@ const hidePage = ref(false)
|
|
|
const focusType = ref(true)
|
|
|
const editBatchNum = ref(false)
|
|
|
const editPalletNum = ref(false)
|
|
|
-const lotnoLogHistory = ref([] as any)
|
|
|
+const scanLotnoHistory = ref([] as any)
|
|
|
const messageRef = ref()
|
|
|
const messageType = ref()
|
|
|
const messageText = ref()
|
|
@@ -157,7 +157,7 @@ const scanInput = async () => {
|
|
|
uni.scanCode({
|
|
|
success: (res: any) => {
|
|
|
valiFormData.value.orderNum = res.result
|
|
|
- // onsubmit();
|
|
|
+ onsubmit()
|
|
|
},
|
|
|
fail: (err) => {
|
|
|
// 需要注意的是小程序扫码不需要申请相机权限
|
|
@@ -291,29 +291,29 @@ const onsubmit = async () => {
|
|
|
// window.open(path, '_blank');
|
|
|
// });
|
|
|
}
|
|
|
- // const historyItem = {
|
|
|
- // orderNum: valiFormData.value.orderNum,
|
|
|
- // createTime: new Date(),
|
|
|
- // type: valiFormData.value.batchNum ? '绑定批次' : '绑定托盘',
|
|
|
- // status: true,
|
|
|
- // }
|
|
|
- // console.log('lotnoLogHistory--', lotnoLogHistory)
|
|
|
- // lotnoLogHistory.value.unshift(historyItem)
|
|
|
- // uni.setStorageSync('lotnoLogHistory', lotnoLogHistory.value)
|
|
|
- // getHistory()
|
|
|
+ const historyItem = {
|
|
|
+ orderNum: valiFormData.value.orderNum,
|
|
|
+ createTime: new Date(),
|
|
|
+ type: valiFormData.value.batchNum ? '绑定批次' : '绑定托盘',
|
|
|
+ status: true,
|
|
|
+ }
|
|
|
+ console.log('scanLotnoHistory--', scanLotnoHistory)
|
|
|
+ scanLotnoHistory.value.unshift(historyItem)
|
|
|
+ uni.setStorageSync('scanLotnoHistory', scanLotnoHistory.value)
|
|
|
+ getHistory()
|
|
|
} else {
|
|
|
messageType.value = 'error'
|
|
|
messageText.value = res.msg
|
|
|
messageRef.value.open()
|
|
|
- // const historyItem = {
|
|
|
- // orderNum: valiFormData.value.orderNum,
|
|
|
- // createTime: new Date(),
|
|
|
- // type: valiFormData.value.batchNum ? '绑定批次' : '绑定托盘',
|
|
|
- // status: false,
|
|
|
- // }
|
|
|
- // lotnoLogHistory.value.unshift(historyItem)
|
|
|
- // uni.setStorageSync('lotnoLogHistory', lotnoLogHistory.value)
|
|
|
- // getHistory()
|
|
|
+ const historyItem = {
|
|
|
+ orderNum: valiFormData.value.orderNum,
|
|
|
+ createTime: new Date(),
|
|
|
+ type: valiFormData.value.batchNum ? '绑定批次' : '绑定托盘',
|
|
|
+ status: false,
|
|
|
+ }
|
|
|
+ scanLotnoHistory.value.unshift(historyItem)
|
|
|
+ uni.setStorageSync('scanLotnoHistory', scanLotnoHistory.value)
|
|
|
+ getHistory()
|
|
|
}
|
|
|
st = setTimeout(() => {
|
|
|
reset()
|
|
@@ -322,9 +322,9 @@ const onsubmit = async () => {
|
|
|
}, 1000)
|
|
|
}
|
|
|
|
|
|
-// const getHistory = () => {
|
|
|
-// lotnoLogHistory.value = uni.getStorageSync('lotnoLogHistory') || []
|
|
|
-// }
|
|
|
+const getHistory = () => {
|
|
|
+ scanLotnoHistory.value = uni.getStorageSync('scanLotnoHistory') || []
|
|
|
+}
|
|
|
const keypress = (e: any) => {
|
|
|
// 102 左侧 103 右侧 104 中间按键
|
|
|
if (e.keyCode === 102 || e.keyCode === 103 || e.keyCode === 104) {
|
|
@@ -377,7 +377,7 @@ onBackPress(() => {
|
|
|
onShow(() => {
|
|
|
hidePage.value = false
|
|
|
_getBindParams()
|
|
|
- // getHistory()
|
|
|
+ getHistory()
|
|
|
})
|
|
|
const setFocus = () => {
|
|
|
if (hidePage.value) {
|
|
@@ -418,7 +418,7 @@ const _getBindParams = async () => {
|
|
|
onNavigationBarButtonTap((event) => {
|
|
|
if (event.index === 0) {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/scanLotno/lotnoLog',
|
|
|
+ url: '/pages/scanLotno/logList',
|
|
|
})
|
|
|
}
|
|
|
})
|