Commit 5aff3621 authored by zhuli's avatar zhuli

Merge branch 'dev' of http://git.local.topsunit.com/mes/mes-ui into dev

parents 08dbd69e 82d33f60
......@@ -5,7 +5,16 @@ export function listCalholiday(query) {
return request({
url: "/mes/cal/calendar/list",
method: "get",
params: query,
params: query
});
}
// 查询工作日设置列表
export function getCalWorkunits(query) {
return request({
url: "/mes/cal/calendar/getCalWorkunits",
method: "post",
data: query
});
}
......
......@@ -50,7 +50,7 @@
<script>
import { listAllTeam } from "@/api/mes/cal/team";
import { listCalholiday } from "@/api/mes/cal/calholiday";
import { listCalholiday, getCalWorkunits } from "@/api/mes/cal/calholiday";
import calendar from '@/utils/calendar';
export default {
name: 'TeamView',
......@@ -106,7 +106,7 @@ export default {
});
},
/** 查询节假日设置列表 */
getList() {
getList(type) {
this.loading = true;
this.holidayList =[];
this.workdayList =[];
......@@ -114,7 +114,13 @@ export default {
if (this.teamShiftQueryParams.workunitName) {
this.queryParams.workunitName = this.teamShiftQueryParams.workunitName
}
listCalholiday(this.queryParams).then(response => {
if (type) {
delete this.queryParams.workunitName
} else {
delete this.queryParams.workunitIds
}
const fn = type ? getCalWorkunits : listCalholiday
fn(this.queryParams).then(response => {
this.calendarDayList = response.data;
if(response.data !=null){
response.data.forEach(theDay => {
......@@ -128,6 +134,16 @@ export default {
}
});
},
getGroupId (data) {
return data.reduce((pre, {id,children})=>{
if(children && children.length){
pre = [...pre, ...this.getGroupId(children)]
} else {
pre.push(id)
}
return pre
},[])
},
//点击班组类型
onSelected(data){
if(data['level'] === 4){
......@@ -135,6 +151,11 @@ export default {
this.queryParams.workunitName = data['label'];
this.queryParams.theDay = this.date.getFullYear()+'-'+(this.date.getMonth()+1)+'-'+this.date.getDate();
this.getList()
} else if (data['level'] === 2 || data['level'] === 3){
this.loading = true;
this.queryParams.workunitIds = this.getGroupId(data.children);
this.queryParams.theDay = this.date.getFullYear()+'-'+(this.date.getMonth()+1)+'-'+this.date.getDate();
this.getList('id')
}
},
isFestival(slotDate, slotData) {
......
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