fix:上盘平磨handoverbw展示添加多选
This commit is contained in:
parent
e9a1c6041d
commit
0252ee2361
|
|
@ -117,6 +117,7 @@
|
||||||
</template>
|
</template>
|
||||||
<!-- 批次物料列表 wprList -->
|
<!-- 批次物料列表 wprList -->
|
||||||
<template v-if="route_code=='shangpaipingmo'">
|
<template v-if="route_code=='shangpaipingmo'">
|
||||||
|
<el-checkbox v-model="checkedStatus[bwIndex]" label="全选" @change="checkAllChange(bwIndex)" style="display: block;margin-top: -15px;"/>
|
||||||
<span v-for="item2 in form.handoverb[bwIndex].handoverbw" :key="item2" style="margin-right: 10px;">
|
<span v-for="item2 in form.handoverb[bwIndex].handoverbw" :key="item2" style="margin-right: 10px;">
|
||||||
<el-checkbox v-model="item2.checked" :label="item2.number" @change="handleChange(bwIndex)"/>
|
<el-checkbox v-model="item2.checked" :label="item2.number" @change="handleChange(bwIndex)"/>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -364,6 +365,7 @@ export default {
|
||||||
totalCount: 0,
|
totalCount: 0,
|
||||||
deptID:'',
|
deptID:'',
|
||||||
bwIndex:0,
|
bwIndex:0,
|
||||||
|
checkedStatus:[],
|
||||||
userList: [],
|
userList: [],
|
||||||
userList2: [],
|
userList2: [],
|
||||||
deptOptions:[],
|
deptOptions:[],
|
||||||
|
|
@ -427,6 +429,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
deletebw(index){
|
deletebw(index){
|
||||||
let that = this;
|
let that = this;
|
||||||
|
that.checkedStatus.splice(index,1);
|
||||||
this.form.handoverb[this.bwIndex].handoverbw.splice(index,1);
|
this.form.handoverb[this.bwIndex].handoverbw.splice(index,1);
|
||||||
this.form.handoverb[this.bwIndex].count--;
|
this.form.handoverb[this.bwIndex].count--;
|
||||||
let totalCount = 0;
|
let totalCount = 0;
|
||||||
|
|
@ -613,6 +616,8 @@ export default {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.mode = mode;
|
that.mode = mode;
|
||||||
that.mtype = mtype;
|
that.mtype = mtype;
|
||||||
|
that.checkedStatus=[];
|
||||||
|
that.selectItems=[];
|
||||||
if(mtype==30){
|
if(mtype==30){
|
||||||
that.change_batch = true;
|
that.change_batch = true;
|
||||||
}
|
}
|
||||||
|
|
@ -621,6 +626,8 @@ export default {
|
||||||
that.totalCount = 0;
|
that.totalCount = 0;
|
||||||
data.forEach((item,index)=>{
|
data.forEach((item,index)=>{
|
||||||
item.wm = item.id;
|
item.wm = item.id;
|
||||||
|
that.checkedStatus.push(true)
|
||||||
|
that.selectItems.push(item.id)
|
||||||
that.totalCount += Number(item.count);
|
that.totalCount += Number(item.count);
|
||||||
that.getWprList(item.wm,index);
|
that.getWprList(item.wm,index);
|
||||||
})
|
})
|
||||||
|
|
@ -699,9 +706,19 @@ export default {
|
||||||
that.form.handoverb[index].handoverbw = handoverbw;
|
that.form.handoverb[index].handoverbw = handoverbw;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
checkAllChange(index){
|
||||||
|
this.form.handoverb[index].handoverbw.forEach(item=>{
|
||||||
|
item.checked = this.checkedStatus[index]
|
||||||
|
})
|
||||||
|
},
|
||||||
handleChange(index){
|
handleChange(index){
|
||||||
let trueCount = this.form.handoverb[index].handoverbw.filter(item => item.checked === true).length;
|
let trueCount = this.form.handoverb[index].handoverbw.filter(item => item.checked === true).length;
|
||||||
this.form.handoverb[index].count = trueCount;
|
this.form.handoverb[index].count = trueCount;
|
||||||
|
if(trueCount==this.form.handoverb[index].handoverbw.length){
|
||||||
|
this.checkedStatus[index] = true;
|
||||||
|
}else{
|
||||||
|
this.checkedStatus[index] = false;
|
||||||
|
}
|
||||||
this.countChange();
|
this.countChange();
|
||||||
},
|
},
|
||||||
countChange(){
|
countChange(){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue