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

update:修改日历列表数据

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