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) { ...@@ -5,7 +5,16 @@ export function listCalholiday(query) {
return request({ return request({
url: "/mes/cal/calendar/list", url: "/mes/cal/calendar/list",
method: "get", 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 @@ ...@@ -50,7 +50,7 @@
<script> <script>
import { listAllTeam } from "@/api/mes/cal/team"; 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'; import calendar from '@/utils/calendar';
export default { export default {
name: 'TeamView', name: 'TeamView',
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
}); });
}, },
/** 查询节假日设置列表 */ /** 查询节假日设置列表 */
getList() { getList(type) {
this.loading = true; this.loading = true;
this.holidayList =[]; this.holidayList =[];
this.workdayList =[]; this.workdayList =[];
...@@ -114,7 +114,13 @@ export default { ...@@ -114,7 +114,13 @@ export default {
if (this.teamShiftQueryParams.workunitName) { if (this.teamShiftQueryParams.workunitName) {
this.queryParams.workunitName = 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; this.calendarDayList = response.data;
if(response.data !=null){ if(response.data !=null){
response.data.forEach(theDay => { response.data.forEach(theDay => {
...@@ -128,6 +134,16 @@ export default { ...@@ -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){ onSelected(data){
if(data['level'] === 4){ if(data['level'] === 4){
...@@ -135,6 +151,11 @@ export default { ...@@ -135,6 +151,11 @@ export default {
this.queryParams.workunitName = data['label']; this.queryParams.workunitName = data['label'];
this.queryParams.theDay = this.date.getFullYear()+'-'+(this.date.getMonth()+1)+'-'+this.date.getDate(); this.queryParams.theDay = this.date.getFullYear()+'-'+(this.date.getMonth()+1)+'-'+this.date.getDate();
this.getList() 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) { 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