|
|
@@ -147,34 +147,6 @@ export default {
|
|
|
}
|
|
|
let that = this
|
|
|
},
|
|
|
- globalRememberRefresh(){
|
|
|
- let that = this
|
|
|
- if(that.$util.isEmpty(that.globalItemData)){
|
|
|
- return false
|
|
|
- }
|
|
|
- let selectListData = []
|
|
|
- if(!that.$util.isEmpty(that.selectList)){
|
|
|
- that.selectList.forEach((i)=>{
|
|
|
- selectListData[i.id] = i
|
|
|
- })
|
|
|
- }
|
|
|
- //修改数据需要复制一份,否则不会生效
|
|
|
- that.globalItemData = this.$util.copyObject(that.globalItemData);
|
|
|
- for (let i=0;i<that.globalItemData.length;i++){
|
|
|
- let currentProduct = that.globalItemData[i]
|
|
|
- let currentPId = currentProduct.id
|
|
|
- let selectProduct = selectListData[currentPId] || []
|
|
|
- if(!that.$util.isEmpty(selectProduct)){
|
|
|
- that.globalItemData[i].bigCount = selectProduct.bigCount || 0
|
|
|
- that.globalItemData[i].userPrice = selectProduct.userPrice || 0
|
|
|
- that.globalItemData[i].smallCount = selectProduct.smallCount || 0
|
|
|
- }else{
|
|
|
- that.globalItemData[i].bigCount = 0
|
|
|
- that.globalItemData[i].userPrice = 0
|
|
|
- that.globalItemData[i].smallCount = 0
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
globalSwitchClass(cur,item) {
|
|
|
this.globalGoToTop()
|
|
|
this.globalClassIndex = cur
|
|
|
@@ -187,7 +159,7 @@ export default {
|
|
|
},
|
|
|
pushToSave(selectData){
|
|
|
this.setSelectInfo({ selectJobType: this.selectJobType, info: selectData,selectJobId:this.selectJobId })
|
|
|
- localStorage.setItem('selectList_'+this.selectJobType+'_target_'+this.selectJobId, selectData);
|
|
|
+ localStorage.setItem('selectList_'+this.selectJobType+'_target_'+this.selectJobId, JSON.stringify(selectData));
|
|
|
},
|
|
|
globalChangeClass(index,item){
|
|
|
this.$refs.globalClassImgRef.close()
|
|
|
@@ -197,7 +169,7 @@ export default {
|
|
|
let that = this
|
|
|
that.$util.confirmModal({content:'确认清除花材?'},() => {
|
|
|
that.removeFromSaveDirect()
|
|
|
- that.$msg('已清除')
|
|
|
+ that.$message({message: '已清除'})
|
|
|
})
|
|
|
},
|
|
|
removeFromSaveDirect(){
|
|
|
@@ -291,7 +263,6 @@ export default {
|
|
|
if(Number(item.bigCount)<0 || Number(item.smallCount)<0){
|
|
|
return false
|
|
|
}
|
|
|
-
|
|
|
if(this.globalCheckStock){
|
|
|
let currentCount = Number(item.bigCount) * item.ratio + Number(item.smallCount)
|
|
|
currentCount = currentCount.toFixed(2)
|
|
|
@@ -299,9 +270,8 @@ export default {
|
|
|
currentNum = currentNum.toFixed(2)
|
|
|
console.log(currentCount+' '+currentNum)
|
|
|
if (Number(currentCount) > Number(currentNum)) {
|
|
|
- console.log('库存不足。。。')
|
|
|
- this.$util.noStockRemind()
|
|
|
- this.$msg("库存不足哦")
|
|
|
+ //this.$util.noStockRemind()
|
|
|
+ this.$message({message: '库存不足哦',type: 'warning'})
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
@@ -329,9 +299,7 @@ export default {
|
|
|
if(scan == 1){
|
|
|
this.$util.hitRemind()
|
|
|
}
|
|
|
- //数据放到仓库
|
|
|
this.pushToSave(list)
|
|
|
- this.globalRememberRefresh()
|
|
|
},
|
|
|
delSelectedItem(product){
|
|
|
let item = this.$util.copyObject(product)
|
|
|
@@ -386,15 +354,15 @@ export default {
|
|
|
let curPage = getCurrentPages();
|
|
|
let route = curPage[curPage.length - 1].route;
|
|
|
if(route == 'admin/billing/affirm'){
|
|
|
- this.$msg('多颜色花材,请返回修改')
|
|
|
+ this.$message({message: '多颜色花材,请返回修改',type: 'warning'});
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(info.bigNum <= 0 && info.smallNum <= 0){
|
|
|
if(this.globalCheckStock){
|
|
|
- this.$util.noStockRemind()
|
|
|
- this.$msg('库存不足哦..')
|
|
|
+ //this.$util.noStockRemind()
|
|
|
+ this.$message({message: '库存不足哦..',type: 'warning'});
|
|
|
return false
|
|
|
}
|
|
|
}
|