Commit 27e97dcd authored by 张海景's avatar 张海景

update:修改日历列表数据

parent c2ad4645
import request from '@/utils/request'
// 查询节假日设置列表
// 查询工作日设置列表
export function listCalholiday(query) {
return request({
url: '/mes/cal/calholiday/list',
method: 'get',
params: query
})
url: "/mes/cal/calendar/list",
method: "get",
params: query,
});
}
// 查询上班数据工作单元列表
......
......@@ -15,8 +15,8 @@
<div class="lunar" :class="{ festival : isFestival(date, data) }">{{ solarDate2lunar(data.day) }}</div>
</el-col>
<el-col :span="6">
<el-tag v-if="holidayList.indexOf(data.day) ==-1" effect="dark"></el-tag>
<el-tag v-else effect="dark" type="success"></el-tag>
<el-tag v-if="workdayList.indexOf(data.day)> -1" effect="dark"></el-tag>
<el-tag v-else-if="holidayList.indexOf(data.day) > -1" effect="dark" type="success"></el-tag>
</el-col>
</el-row>
<el-row v-for="calendarDay in calendarDayList " :key="calendarDay.theDay">
......@@ -51,13 +51,11 @@ export default {
calendarDayList:[
],
teamShiftQueryParams:{
isWork: 1
isWork: 1
},
queryParams: {
theDay: null,
holidayType: null,
startTime: null,
endTime: null,
theDay: null,
isWork: 1
},
}
},
......@@ -66,11 +64,11 @@ export default {
handler(newVal,oldVal){
console.log(newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate());
this.teamShiftQueryParams.theDay = newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate();
this.loading = true;
this.queryParams.theDay = newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate();
listCalendars(this.teamShiftQueryParams).then(response =>{
this.calendarDayList = response.data;
this.loading = false;
});
this.getList();
}
}
},
......@@ -89,8 +87,8 @@ export default {
response.data.forEach(theDay => {
if(theDay.holidayType =='HOLIDAY'){
that.holidayList.push(theDay.theDay);
}else{
that.workdayList.push(theDay.theDay);
} else if(theDay.holidayType == 'WORKDAY'){
that.workdayList.push(theDay.theDay);
}
});
this.loading = false;
......
......@@ -24,8 +24,8 @@
<div class="lunar" :class="{ festival : isFestival(date, data) }">{{ solarDate2lunar(data.day) }}</div>
</el-col>
<el-col :span="6">
<el-tag v-if="holidayList.indexOf(data.day) ==-1" effect="dark"></el-tag>
<el-tag v-else effect="dark" type="success"></el-tag>
<el-tag v-if="workdayList.indexOf(data.day)> -1" effect="dark"></el-tag>
<el-tag v-else-if="holidayList.indexOf(data.day) > -1" effect="dark" type="success"></el-tag>
</el-col>
</el-row>
<el-row v-for="calendarDay in calendarDayList " :key="calendarDay.theDay">
......@@ -65,10 +65,8 @@ export default {
isWork: 1
},
queryParams: {
theDay: null,
holidayType: null,
startTime: null,
endTime: null,
theDay: null,
isWork: 1
}
}
},
......@@ -77,11 +75,11 @@ export default {
handler(newVal,oldVal){
console.log(newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate());
this.teamShiftQueryParams.theDay = newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate();
this.loading = true;
this.queryParams.theDay = newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate();
listCalendars(this.teamShiftQueryParams).then(response =>{
this.calendarDayList = response.data;
this.loading = false;
});
this.getList();
}
}
},
......@@ -106,8 +104,8 @@ export default {
response.data.forEach(theDay => {
if(theDay.holidayType =='HOLIDAY'){
that.holidayList.push(theDay.theDay);
}else{
that.workdayList.push(theDay.theDay);
}else if(theDay.holidayType == 'WORKDAY'){
that.workdayList.push(theDay.theDay);
}
});
this.loading = false;
......
......@@ -10,8 +10,8 @@
</div>
</el-col>
<el-col :span="8">
<el-tag v-if="holidayList.indexOf(data.day) ==-1" effect="dark"></el-tag>
<el-tag v-else effect="dark" type="success"></el-tag>
<el-tag v-if="workdayList.indexOf(data.day)> -1" effect="dark"></el-tag>
<el-tag v-else-if="holidayList.indexOf(data.day) > -1" effect="dark" type="success"></el-tag>
</el-col>
</el-row>
<el-row>
......@@ -79,9 +79,7 @@ export default {
theDay: null,
queryParams: {
theDay: null,
holidayType: null,
startTime: null,
endTime: null,
isWork: 1
},
// 表单校验
rules: {
......@@ -91,6 +89,15 @@ export default {
}
}
},
watch:{
date:{
handler(newVal,oldVal){
console.log(newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate());
this.queryParams.theDay = newVal.getFullYear()+'-'+(newVal.getMonth()+1)+'-'+newVal.getDate();
this.getList()
}
}
},
created() {
this.getList();
},
......@@ -102,12 +109,11 @@ export default {
this.workdayList =[];
let that = this;
listCalholiday(this.queryParams).then(response => {
debugger;
if(response.data !=null){
response.data.forEach(theDay => {
if(theDay.holidayType =='HOLIDAY'){
that.holidayList.push(theDay.theDay);
}else{
} else if(theDay.holidayType == 'WORKDAY'){
that.workdayList.push(theDay.theDay);
}
});
......
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