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