|
|
@@ -115,17 +115,17 @@ export default {
|
|
|
onShow(){
|
|
|
//修改花材
|
|
|
if(this.option.modifyProductKey){
|
|
|
- if(uni.getStorageSync('selectList'+this.option.modifyProductKey)){
|
|
|
+ if(uni.getStorageSync('selectList_'+this.option.modifyProductKey)){
|
|
|
//由于价格会变化,所以在initData()重新载入已经选择的花材
|
|
|
}
|
|
|
}else if(this.pageType == 'bill' && !this.$util.isEmpty(this.option.customId)){
|
|
|
- if(uni.getStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId)){
|
|
|
+ if(uni.getStorageSync('selectList_'+this.pageType+'_custom_'+this.option.customId)){
|
|
|
//由于价格会变化,所以在initData()重新载入已经选择的花材
|
|
|
}
|
|
|
}else{
|
|
|
//盘点和报损等不需要考虑价格
|
|
|
- if(uni.getStorageSync('selectList'+this.pageType)){
|
|
|
- this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType) })
|
|
|
+ if(uni.getStorageSync('selectList_'+this.pageType)){
|
|
|
+ this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList_'+this.pageType) })
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -140,9 +140,9 @@ export default {
|
|
|
rememberProduct(){
|
|
|
if(this.pageType == 'bill' && !this.$util.isEmpty(this.option.customId)){
|
|
|
//开单根据客户记住已选的花材
|
|
|
- uni.setStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId, this.selectList)
|
|
|
+ uni.setStorageSync('selectList_'+this.pageType+'_custom_'+this.option.customId, this.selectList)
|
|
|
}else{
|
|
|
- uni.setStorageSync('selectList'+this.pageType, this.selectList)
|
|
|
+ uni.setStorageSync('selectList_'+this.pageType, this.selectList)
|
|
|
}
|
|
|
},
|
|
|
//清除记忆花材
|
|
|
@@ -156,22 +156,22 @@ export default {
|
|
|
that.removeMemoryDirect(customId)
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
+ that.$msg('已清除')
|
|
|
},
|
|
|
//直接清除记忆花材不提示
|
|
|
removeMemoryDirect(customId=0){
|
|
|
let that = this
|
|
|
if(customId!=0){
|
|
|
- uni.removeStorageSync('selectList'+that.pageType+'_custom_'+customId);
|
|
|
+ uni.removeStorageSync('selectList_'+that.pageType+'_custom_'+customId);
|
|
|
//删除小菊的记忆
|
|
|
uni.removeStorageSync("xj"+customId)
|
|
|
}else{
|
|
|
console.log(983)
|
|
|
- uni.removeStorageSync('selectList'+that.pageType);
|
|
|
+ uni.removeStorageSync('selectList_'+that.pageType);
|
|
|
}
|
|
|
- console.log('selectList'+that.pageType)
|
|
|
- that.resetSelectInfoByType(that.pageType);
|
|
|
- that.$msg('已清除')
|
|
|
+ console.log('selectList_'+that.pageType)
|
|
|
+ that.resetSelectInfoByType(that.pageType)
|
|
|
},
|
|
|
//请求商品数据
|
|
|
async initData(extendInfo) {
|
|
|
@@ -199,8 +199,8 @@ export default {
|
|
|
this.productInfoList = data;
|
|
|
//修改花材
|
|
|
if(this.option.modifyProductKey){
|
|
|
- if(uni.getStorageSync('selectList'+this.option.modifyProductKey)){
|
|
|
- let currentInfo = uni.getStorageSync('selectList'+this.option.modifyProductKey)
|
|
|
+ if(uni.getStorageSync('selectList_'+this.option.modifyProductKey)){
|
|
|
+ let currentInfo = uni.getStorageSync('selectList_'+this.option.modifyProductKey)
|
|
|
if(!this.$util.isEmpty(currentInfo)){
|
|
|
currentInfo.forEach((currentItem,currentIndex,currentArray)=>{
|
|
|
let currentId = currentItem.id
|
|
|
@@ -210,12 +210,12 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
this.setSelectInfoByType({ type: this.pageType, info: currentInfo})
|
|
|
- uni.removeStorageSync('selectList'+this.option.modifyProductKey)
|
|
|
+ uni.removeStorageSync('selectList_'+this.option.modifyProductKey)
|
|
|
}
|
|
|
}
|
|
|
}else if(this.pageType == 'bill' && !this.$util.isEmpty(this.option.customId)){
|
|
|
- if(uni.getStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId)){
|
|
|
- let currentInfo = uni.getStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId)
|
|
|
+ if(uni.getStorageSync('selectList_'+this.pageType+'_custom_'+this.option.customId)){
|
|
|
+ let currentInfo = uni.getStorageSync('selectList_'+this.pageType+'_custom_'+this.option.customId)
|
|
|
if(!this.$util.isEmpty(currentInfo)){
|
|
|
currentInfo.forEach((currentItem,currentIndex,currentArray)=>{
|
|
|
let currentId = currentItem.id
|