生产投料-切换按钮修改
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
<u-tag type="success" :text="item.previousNumbered" plain></u-tag>
|
||||
</u-col>
|
||||
<u-col span="2">
|
||||
<u-switch v-model="item.selected" @change="change_selected(index)" size="38"></u-switch>
|
||||
<u-switch v-model="item.selected" size="38"></u-switch>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<u-line></u-line>
|
||||
@@ -138,20 +138,32 @@ export default {
|
||||
getworkorderlist(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.workerorder_list = res.data;
|
||||
this.workerorder_list.forEach((item) => {
|
||||
item['selected'] = false;
|
||||
item['previousNumbered'] = 0;
|
||||
});
|
||||
let newList = [];
|
||||
for(let item of workerorder_list){
|
||||
item.selected = false;
|
||||
item.previousNumbered = 0;
|
||||
newList.push(item);
|
||||
}
|
||||
this.workerorder_list = newList;
|
||||
// this.workerorder_list.forEach((item) => {
|
||||
// item['selected'] = false;
|
||||
// item['previousNumbered'] = 0;
|
||||
// });
|
||||
}
|
||||
});
|
||||
},
|
||||
//todo 选中事件
|
||||
change_selected(index) {
|
||||
console.log(index);
|
||||
//this.workerorder_list[index].selected = true;
|
||||
this.$set(this.workerorder_list[index], 'selected', true);
|
||||
console.log(this.workerorder_list[index])
|
||||
}
|
||||
// change_selected(value) {
|
||||
// // 修改值
|
||||
// console.log('change_selected',value);
|
||||
// // console.log(index);
|
||||
// // //this.workerorder_list[index].selected = true;
|
||||
// // this.$nextTick(()=>{
|
||||
// // this.workerorder_list[index].selected = true;
|
||||
// // })
|
||||
// // // this.$set(this.workerorder_list[index], 'selected', true);
|
||||
// // console.log('123456',this.workerorder_list[index])
|
||||
// }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user