|
|
@@ -112,6 +112,13 @@ export default {
|
|
|
}
|
|
|
uni.setStorageSync('selectList_'+this.currentJobType+'_target_'+this.currentBackJobId, currentInfo)
|
|
|
|
|
|
+ //多颜色也要挂单
|
|
|
+ let xjInfo = uni.getStorageSync("xj")
|
|
|
+ if (!this.$util.isEmpty(xjInfo)) {
|
|
|
+ uni.setStorageSync("xj_hand_"+this.currentBackJobId, xjInfo)
|
|
|
+ uni.removeStorageSync("xj")
|
|
|
+ }
|
|
|
+
|
|
|
uni.removeStorageSync('selectList_'+that.currentJobType+'_target_'+that.currentJobId)
|
|
|
that.reSetSelectInfo({currentJobType:that.currentJobType,currentJobId:that.currentJobId})
|
|
|
|
|
|
@@ -136,6 +143,13 @@ export default {
|
|
|
//清除挂单
|
|
|
uni.removeStorageSync('selectList_'+that.currentJobType+'_target_'+that.currentBackJobId)
|
|
|
|
|
|
+ //多颜色的处理
|
|
|
+ let xjInfo = uni.getStorageSync("xj_hand_"+this.currentBackJobId)
|
|
|
+ if (!this.$util.isEmpty(xjInfo)) {
|
|
|
+ uni.setStorageSync("xj", xjInfo)
|
|
|
+ uni.removeStorageSync("xj_hand_"+this.currentBackJobId)
|
|
|
+ }
|
|
|
+
|
|
|
this.globalHasHand = 0
|
|
|
},
|
|
|
removeFromSave(){
|
|
|
@@ -195,6 +209,11 @@ export default {
|
|
|
item.currentNum = parseInt(Number(item.currentNum)+Number(list[index].currentNum))
|
|
|
}
|
|
|
|
|
|
+ //多颜色,弹框时,没有选花材,直接点清除全部
|
|
|
+ if(index == -1 && item.currentNum<=0){
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
//扫码会出现负数
|
|
|
if(Number(item.currentNum)<0){
|
|
|
return false
|
|
|
@@ -228,9 +247,9 @@ export default {
|
|
|
}else{
|
|
|
if(item.currentNum <= 0){
|
|
|
list.splice(index,1)
|
|
|
- if(item.variety == 1){
|
|
|
- uni.removeStorageSync("xj")
|
|
|
- }
|
|
|
+ //删除当前花材的多颜色
|
|
|
+ this.delCurrentXj(item)
|
|
|
+
|
|
|
}else{
|
|
|
list[index].currentNum = item.currentNum
|
|
|
list[index].unitPrice = item.unitPrice
|
|
|
@@ -246,6 +265,22 @@ export default {
|
|
|
this.pushToSave(list)
|
|
|
this.addItemModelHidden()
|
|
|
},
|
|
|
+ delCurrentXj(item){
|
|
|
+ if(item.variety == 0){
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ console.log('item',item)
|
|
|
+ let saveInfo = uni.getStorageSync("xj")
|
|
|
+ const ptItemId = item.itemId
|
|
|
+ if (!this.$util.isEmpty(saveInfo)) {
|
|
|
+ saveInfo.forEach((colorItem, colorIndex) => {
|
|
|
+ if (colorItem.ptItemId == ptItemId) {
|
|
|
+ saveInfo.splice(colorIndex, 1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ uni.setStorageSync("xj", saveInfo)
|
|
|
+ }
|
|
|
+ },
|
|
|
//显示可以修改花材的弹框
|
|
|
showAddModelFn(info) {
|
|
|
if(Number(info.stock) <= 0){
|