提交 120d40a3 authored 作者: 潘鹏's avatar 潘鹏

添加细粒度价格操作功能

上级 81f0dfe3
......@@ -98,8 +98,56 @@ let vm = new Vue({
show_paste_btn:false,// 粘贴按钮
paste_modal:false,
showQuitHint:false,
// 细粒度价格控制,
handleProductAttr_Batch:[],
},
methods: {
//保存批量操作价格的数据
saveBatchDataPrice(e) {
if(this.batchAmount&&this.batchCount){
if(e === 'use'){
let arr = [];
this.handleProductAttr_Batch.map( item => {
item.categoryDescArr.map( _item => {
_item.isSelected?arr.push(_item.name):void(0);
})
})
let str = arr.join('/');
this.prevItem.map( item => {
if(item.skuDesc === str){
item.skuCount = this.batchCount;
item.skuPrice = this.batchAmount;
this.$forceUpdate();
this.$Message.info('应用成功');
}
})
}else{
let arr = [];
this.handleProductAttr_Batch.map( item => {
item.categoryDescArr.map( _item => {
_item.isSelected?arr.push(_item.name):void(0);
})
})
let str = arr.join('/');
this.prevItem.map( item => {
if(item.skuDesc === str){
item.skuCount = this.batchCount;
item.skuPrice = this.batchAmount;
this.$forceUpdate();
}
})
this.showBatch = false;
}
}else{
alert('请先设置价格和库存');
}
},
handleClickProductAttr_Batch(e,index,parent_index){
this.handleProductAttr_Batch[parent_index].categoryDescArr.map( item => item.isSelected = false)
this.handleProductAttr_Batch[parent_index].categoryDescArr[index].isSelected = true;
this.$forceUpdate();
},
//预览
preview(e,to) {
if(to === 'pc'){
......@@ -174,13 +222,23 @@ let vm = new Vue({
count: null,
skuImg: null
}));
// this.attrItem.map( item => item.categoryDesc.split(',').map( _item => this.allAttributes.push({
// text:_item,
// isSelected:false,
// amount:null,
// count:null,
// skuImg:null
// })) );
this.handleProductAttr_Batch = [];
this.attrItem.forEach( item => {
this.handleProductAttr_Batch.push({
categoryDesc : item.categoryDesc,
categoryName : item.categoryName
});
})
this.handleProductAttr_Batch.forEach( item => {
item.categoryDesc = item.categoryDesc.split(',');
item.categoryDescArr = [];
item.categoryDesc.forEach( _item => {
item.categoryDescArr.push({
name:_item,
isSelected: false
})
})
})
},
//切换批量选择按钮
changeSelectBtnArr(item, index) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论