Commit 0a8e790a authored by zhengke's avatar zhengke

修改

parent 7f00d9ff
......@@ -69,8 +69,8 @@
<el-form-item label="批量设置" size="small" style="margin-bottom:0;padding:18px 0;display:inline-block;">
<el-input @keyup.enter.native="batchAttr()" size="small" type="number" v-model="batchNum">
<el-select v-model="selectData" slot="prepend">
<el-option label="不限" :value="0"></el-option>
<el-option v-for="(item, index) in cList" :value="index" :key="item.Id" :label="item.namwe">
<!-- <el-option label="不限" :value="0"></el-option> -->
<el-option v-for="(item, index) in cList" :value="index" :key="item.Id" :label="item.name">
{{item.name}}
</el-option>
</el-select>
......@@ -88,7 +88,7 @@
<thead>
<tr>
<td style="width:55px;">
<el-checkbox></el-checkbox>
<!-- <el-checkbox v-model="groupPriceList[0].isChecked"></el-checkbox> -->
</td>
<td v-for="(headerItem,headerIndex) in attrGroups" :key="headerIndex">{{headerItem.Name}}</td>
......@@ -103,7 +103,7 @@
<tbody>
<tr v-for="(rootItem,rootIndex) in groupPriceList" :key="rootIndex">
<td>
<el-checkbox></el-checkbox>
<el-checkbox v-model="rootItem.isChecked" @change="getCheck()"></el-checkbox>
</td>
<template v-for="(attrItem, attrIndex) in attrGroups">
<td v-if="attrIndex == index2" v-for="(item2, index2) in rootItem.AttrList" :key="index2">
......@@ -143,17 +143,52 @@
},
methods: {
//单选
getCheck(item){
var num=0;
this.groupPriceList.forEach(x => {
if(x.isChecked=true){
num++;
}
});
if(num==this.groupPriceList.length){
this.attrBatch=true;
}else{
this.attrBatch=false;
}
},
//点击全选
selectClick() {
if(this.attrBatch){
this.groupPriceList.forEach(x => {
x.isChecked=true;
});
}else{
this.groupPriceList.forEach(x => {
x.isChecked=false;
});
}
},
//点击批量设置确定
batchAttr() {
this.groupPriceList.forEach(x=>{
if(x.isChecked){
if(this.selectData==0){
x.PinTuanPrice=this.batchNum;
}
if(this.selectData==1){
x.PinTuanStock=this.batchNum;
}
}
})
}
},
mounted() {
if(this.groupPriceList&&this.groupPriceList.length>0){
this.groupPriceList.forEach(x => {
x.isChecked=false;
});
}
},
computed: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment