Commit eaa775ab authored by zhengke's avatar zhengke

增加全选

parent 2900448e
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
<div class="hotelProductManage2_calendar"> <div class="hotelProductManage2_calendar">
<div class="hotelProductManage2_calendarItem" v-for="(item, index) in days" :key="index"> <div class="hotelProductManage2_calendarItem" v-for="(item, index) in days" :key="index">
<div class="calendarItem_month" @click="calendarShow(item, index)">{{item.date}}</div> <div class="calendarItem_month" @click="calendarShow(item, index)">{{item.date}}</div>
<div class="hotelproductCkbox">
<el-checkbox v-model="item.isCked" @change="changeHotelStatus(item,index)">全选</el-checkbox>
</div>
<div class="calendarItem_week"> <div class="calendarItem_week">
<div>周一</div> <div>周一</div>
<div>周二</div> <div>周二</div>
...@@ -747,6 +750,8 @@ ...@@ -747,6 +750,8 @@
} }
}, },
calendarDayOn: function (item, item2) { calendarDayOn: function (item, item2) {
console.log(item,'item');
console.log(item2,'item2');
if (item.date === item2.month) { if (item.date === item2.month) {
let dayIndex = this.msg2.DateList.indexOf(item2.day) let dayIndex = this.msg2.DateList.indexOf(item2.day)
if (dayIndex === -1) { if (dayIndex === -1) {
...@@ -756,6 +761,7 @@ ...@@ -756,6 +761,7 @@
this.msg2.DateList.splice(dayIndex, 1) this.msg2.DateList.splice(dayIndex, 1)
} }
} }
console.log(this.msg2.DateList);
}, },
calendarDayOff: function (item) { calendarDayOff: function (item) {
let dayIndex = this.msg2.DateList.indexOf(item) let dayIndex = this.msg2.DateList.indexOf(item)
...@@ -803,7 +809,8 @@ ...@@ -803,7 +809,8 @@
} }
this.days[key] = { this.days[key] = {
date: month, date: month,
days: days days: days,
isCked:false
} }
this.getData(date, key) this.getData(date, key)
}, },
...@@ -1003,6 +1010,26 @@ ...@@ -1003,6 +1010,26 @@
} }
}); });
}, },
//增加全选
changeHotelStatus(item,index){
if(item.isCked){
item.days.forEach(x=>{
if(x.month==item.date){
if(this.msg2.DateList.indexOf(x.day)==-1){
this.msg2.DateList.push(x.day);
}
}
})
}else{
item.days.forEach(x=>{
this.msg2.DateList.forEach((y,index)=>{
if(x.day==y){
this.msg2.DateList.splice(index, 1)
}
})
})
}
}
}, },
created: function () { created: function () {
this.hotelId = this.$route.query.id === undefined ? '0' : this.$route.query.id this.hotelId = this.$route.query.id === undefined ? '0' : this.$route.query.id
...@@ -1027,7 +1054,12 @@ ...@@ -1027,7 +1054,12 @@
.hotelProductManage2 { .hotelProductManage2 {
padding: 20px 0; padding: 20px 0;
} }
.hotelproductCkbox{
width:10%;
height:30px;
float:right;
margin:5px 20px 0 0;
}
.hotelProductManage2>.hotelProductManage2_btnList { .hotelProductManage2>.hotelProductManage2_btnList {
position: fixed; position: fixed;
top: 36px; top: 36px;
...@@ -1130,8 +1162,10 @@ ...@@ -1130,8 +1162,10 @@
} }
.hotelProductManage2_calendarItem>.calendarItem_month { .hotelProductManage2_calendarItem>.calendarItem_month {
width: 100%; width: 50%;
height: 30px; height: 30px;
float:left;
margin-left:110px;
line-height: 30px; line-height: 30px;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
......
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