fix:待入库商品持久化到localStorage,切换页面后恢复
This commit is contained in:
parent
c51163793c
commit
4b62361f37
@ -1297,6 +1297,13 @@ export default {
|
||||
|
||||
// 页面显示时处理连拍返回的照片
|
||||
onShow() {
|
||||
// 恢复待入库商品列表
|
||||
var savedList = uni.getStorageSync('pendingProductList') || []
|
||||
if (savedList.length > 0) {
|
||||
this.pendingProductList = savedList
|
||||
this.pendingCount = savedList.length
|
||||
}
|
||||
|
||||
if (this.capturedPhotoList && this.capturedPhotoList.length > 0) {
|
||||
var photos = this.capturedPhotoList
|
||||
var targetTab = this.capturedPhotoTab || 'no-isbn'
|
||||
@ -2240,6 +2247,7 @@ export default {
|
||||
}
|
||||
this.pendingProductList.push(entry)
|
||||
this.pendingCount = this.pendingProductList.length
|
||||
uni.setStorageSync('pendingProductList', this.pendingProductList)
|
||||
// 创建/追加波次
|
||||
await this.appendWaveItem(warehouseData, productId, this.stock ?? '1', salePrice)
|
||||
if (this.pendingCount >= 200) {
|
||||
@ -2400,11 +2408,12 @@ export default {
|
||||
stock: this.noIsbnStock ?? '1',
|
||||
warehouseData: this.noIsbnWarehouseData
|
||||
}
|
||||
this.pendingProductList.push(entry)
|
||||
this.pendingCount = this.pendingProductList.length
|
||||
// 创建/追加波次
|
||||
await this.appendWaveItem(this.noIsbnWarehouseData, productId, this.noIsbnStock ?? '1', salePrice)
|
||||
if (this.pendingCount >= 200) {
|
||||
this.pendingProductList.push(entry)
|
||||
this.pendingCount = this.pendingProductList.length
|
||||
uni.setStorageSync('pendingProductList', this.pendingProductList)
|
||||
// 创建/追加波次
|
||||
await this.appendWaveItem(this.noIsbnWarehouseData, productId, this.noIsbnStock ?? '1', salePrice)
|
||||
if (this.pendingCount >= 200) {
|
||||
uni.showToast({ title: '本波次已满200件,请先提交入库', icon: 'none', duration: 2000 })
|
||||
}
|
||||
} else {
|
||||
@ -2702,6 +2711,7 @@ export default {
|
||||
this.marketData = { onSale: 0, old: 0, new: 0, sold: 0 }
|
||||
this.noIsbnProductList = []
|
||||
this.noIsbnMarketData = { onSale: 0, old: 0, new: 0, sold: 0 }
|
||||
uni.removeStorageSync('pendingProductList')
|
||||
uni.removeStorageSync('reuseWaveNo')
|
||||
uni.removeStorageSync('reuseWaveId')
|
||||
uni.removeStorageSync('reuseOrderId')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user