update code

prv
haha 2024-02-29 23:25:35 +08:00
parent 3683005b57
commit 67015cb5f6
3 changed files with 33 additions and 61 deletions

View File

@ -23,6 +23,13 @@ const groupByComany=(data)=> {
method: 'post'
})
}
const groupAllByComany=(data)=> {
return request({
url: `bgscreen/attendance/groupByComany`,
data:data,
method: 'post'
})
}
const todayAttendance=(data)=>{
return request({
url: `bgscreen/attendance/todayAttendance`,
@ -43,5 +50,6 @@ export default{
getWorkAttendanceList,
groupByComany,
todayAttendance,
selectList
selectList,
groupAllByComany
}

View File

@ -535,14 +535,18 @@ export default {
this.$refs.jobWorkerdlg.showDialog(data);
}
},
//
loadAttendanceData(){
let data={
subDeptId:this.deptInfo.id||0,
projectId:this.prj.id||0,
attendanceTime: this.$dt(new Date()).format("YYYY-MM-DD")
}
this.$api.attendance.groupByComany(data).then(d=>{
let ajax=this.$api.attendance.groupByComany
if (this.infoNav == 0) {
ajax=this.$api.attendance.groupAllByComany
}
ajax(data).then(d=>{
let tmps=d.data||[];
const func=(ids)=>{
let sum=0;
@ -551,7 +555,6 @@ export default {
})
return sum;
}
this.laborPersonnelTotal = 0;
this.laborPersonnelData = [{ text: "劳务人员", value: func(["2","3","4","5"]) }, { text: "监理人员", value: func(["8"]) }, { text: "总包人员", value: func(["1","6"]) }];
this.laborPersonnelData.forEach(it=>{
@ -706,7 +709,7 @@ export default {
//
this.warningInterval = setInterval(this.automaticRoll, 5000);
this.getJournalismList();
setInterval(this.getDeptWorksList, 600000);
setInterval(this.loadAttendanceData, 600000);
setInterval(this.getJournalismList, 600000);
},
doPrjProcess(n, text) {
@ -728,31 +731,7 @@ export default {
} else {
this.surveyUrl = 'images/survey_icon_5.png'
}
this.getDeptWorksList();
},
//
getDeptWorksList() {
let deptId = this.deptInfo?.id || 0;
if (this.infoNav == 0) {
//
this.$api.attendance.getDeptWorksList(deptId, this.prj.id).then(d => {
this.laborPersonnelTotal = 0;
this.laborPersonnelData = [{ text: "劳务人员", value: 0 }, { text: "监理人员", value: 0 }, { text: "总包人员", value: 0 }];
if (d.rows.length > 0 && d.rows[0] != null) {
this.laborPersonnelData = [];
this.laborPersonnelTotal += d.rows[0].servicePersonnel;
this.laborPersonnelData.push({ text: "劳务人员", value: d.rows[0].servicePersonnel });
this.laborPersonnelTotal += d.rows[0].supervisorPersonnel;
this.laborPersonnelData.push({ text: "监理人员", value: d.rows[0].supervisorPersonnel });
this.laborPersonnelTotal += d.rows[0].contractorPersonnel;
this.laborPersonnelData.push({ text: "总包人员", value: d.rows[0].contractorPersonnel });
}
this.elDeptWorks++;
});
} else {
//
this.loadAttendanceData();
}
this.loadAttendanceData();
},
//
getJournalismList() {

View File

@ -771,9 +771,10 @@ export default {
},
methods: {
doShowAttendanceDetail() {
this.getProjectId(id => {
let data = {
deptId: this.dept.id || 0,
projectId: this.project.id || 0,
projectId: id || 0,
attendanceTime: this.$dt(new Date()).format("YYYY-MM-DD")
}
if (this.infoNav == 1) {
@ -781,6 +782,7 @@ export default {
} else {
this.$refs.jobWorkerdlg.showDialog(data);
}
});
},
initMe() {
this.project = this.$root.project || {};
@ -914,7 +916,7 @@ export default {
});
this.projectBuildNode = [];
this.getProjectBuildNode();
this.getDeptWorksList();
this.loadAttendanceData();
this.getProjectUser();
this.getCostOut(id);
});
@ -953,7 +955,7 @@ export default {
}
this.minWidth = n * 200 + 100;
});
this.getDeptWorksList();
this.loadAttendanceData();
});
},
init() {
@ -971,6 +973,7 @@ export default {
//
this.costInterval = setInterval(this.manufacturingCostRoll, 5000);
},
//
loadAttendanceData() {
this.getProjectId(id => {
let data = {
@ -978,7 +981,11 @@ export default {
projectId: id || 0,
attendanceTime: this.$dt(new Date()).format("YYYY-MM-DD")
}
this.$api.attendance.groupByComany(data).then(d => {
let ajax=this.$api.attendance.groupByComany;
if (this.infoNav == 0) {
ajax=this.$api.attendance.groupAllByComany;
}
ajax(data).then(d => {
let tmps = d.data || [];
const func = (ids) => {
let sum = 0;
@ -989,7 +996,7 @@ export default {
}
this.laborPersonnelTotal = 0;
this.laborPersonnelData = [{ text: "劳务人员", value: func(["2", "3"]) }, { text: "监理人员", value: func(["8"]) }, { text: "总包人员", value: func(["1"]) }];
this.laborPersonnelData = [{ text: "劳务人员", value: func(["2","3","4","5"]) }, { text: "监理人员", value: func(["8"]) }, { text: "总包人员", value: func(["1","6"]) }];
this.laborPersonnelData.forEach(it => {
this.laborPersonnelTotal += it.value;
})
@ -997,28 +1004,6 @@ export default {
});
});
},
//
getDeptWorksList() {
if (this.infoNav == 0) {
//
this.$api.attendance.getDeptWorksList(this.dept?.id || 0, this.project?.id || 0).then(d => {
this.laborPersonnelTotal = 0;
this.laborPersonnelData = [{ text: "劳务人员", value: 0 }, { text: "监理人员", value: 0 }, { text: "总包人员", value: 0 }];
if (d.rows.length > 0 && d.rows[0] != null) {
this.laborPersonnelData = [];
this.laborPersonnelTotal += d.rows[0].servicePersonnel;
this.laborPersonnelData.push({ text: "劳务人员", value: d.rows[0].servicePersonnel });
this.laborPersonnelTotal += d.rows[0].supervisorPersonnel;
this.laborPersonnelData.push({ text: "监理人员", value: d.rows[0].supervisorPersonnel });
this.laborPersonnelTotal += d.rows[0].contractorPersonnel;
this.laborPersonnelData.push({ text: "总包人员", value: d.rows[0].contractorPersonnel });
}
});
} else {
this.loadAttendanceData();
}
},
//
projectIntroduction() {
//this.popupShow = true
@ -1140,7 +1125,7 @@ export default {
onWarningInfoNav(n, text) {
this.infoNav = n
this.staffText = text
this.getDeptWorksList();
this.loadAttendanceData();
if (n == 0) {
this.surveyUrl = 'images/survey_icon_4.png'
} else {