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