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

View File

@ -535,14 +535,18 @@ export default {
this.$refs.jobWorkerdlg.showDialog(data); this.$refs.jobWorkerdlg.showDialog(data);
} }
}, },
//
loadAttendanceData(){ loadAttendanceData(){
let data={ let data={
subDeptId:this.deptInfo.id||0, subDeptId:this.deptInfo.id||0,
projectId:this.prj.id||0, projectId:this.prj.id||0,
attendanceTime: this.$dt(new Date()).format("YYYY-MM-DD") 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||[]; let tmps=d.data||[];
const func=(ids)=>{ const func=(ids)=>{
let sum=0; let sum=0;
@ -550,8 +554,7 @@ export default {
sum+=it*1; sum+=it*1;
}) })
return sum; return sum;
} }
this.laborPersonnelTotal = 0; this.laborPersonnelTotal = 0;
this.laborPersonnelData = [{ text: "劳务人员", value: func(["2","3","4","5"]) }, { text: "监理人员", value: func(["8"]) }, { text: "总包人员", value: func(["1","6"]) }]; this.laborPersonnelData = [{ text: "劳务人员", value: func(["2","3","4","5"]) }, { text: "监理人员", value: func(["8"]) }, { text: "总包人员", value: func(["1","6"]) }];
this.laborPersonnelData.forEach(it=>{ this.laborPersonnelData.forEach(it=>{
@ -706,7 +709,7 @@ export default {
// //
this.warningInterval = setInterval(this.automaticRoll, 5000); this.warningInterval = setInterval(this.automaticRoll, 5000);
this.getJournalismList(); this.getJournalismList();
setInterval(this.getDeptWorksList, 600000); setInterval(this.loadAttendanceData, 600000);
setInterval(this.getJournalismList, 600000); setInterval(this.getJournalismList, 600000);
}, },
doPrjProcess(n, text) { doPrjProcess(n, text) {
@ -728,32 +731,8 @@ export default {
} else { } else {
this.surveyUrl = 'images/survey_icon_5.png' this.surveyUrl = 'images/survey_icon_5.png'
} }
this.getDeptWorksList(); this.loadAttendanceData();
}, },
//
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();
}
},
// //
getJournalismList() { getJournalismList() {
// //

View File

@ -771,9 +771,10 @@ export default {
}, },
methods: { methods: {
doShowAttendanceDetail() { doShowAttendanceDetail() {
this.getProjectId(id => {
let data = { let data = {
deptId: this.dept.id || 0, deptId: this.dept.id || 0,
projectId: this.project.id || 0, projectId: id || 0,
attendanceTime: this.$dt(new Date()).format("YYYY-MM-DD") attendanceTime: this.$dt(new Date()).format("YYYY-MM-DD")
} }
if (this.infoNav == 1) { if (this.infoNav == 1) {
@ -781,6 +782,7 @@ export default {
} else { } else {
this.$refs.jobWorkerdlg.showDialog(data); this.$refs.jobWorkerdlg.showDialog(data);
} }
});
}, },
initMe() { initMe() {
this.project = this.$root.project || {}; this.project = this.$root.project || {};
@ -914,7 +916,7 @@ export default {
}); });
this.projectBuildNode = []; this.projectBuildNode = [];
this.getProjectBuildNode(); this.getProjectBuildNode();
this.getDeptWorksList(); this.loadAttendanceData();
this.getProjectUser(); this.getProjectUser();
this.getCostOut(id); this.getCostOut(id);
}); });
@ -953,7 +955,7 @@ export default {
} }
this.minWidth = n * 200 + 100; this.minWidth = n * 200 + 100;
}); });
this.getDeptWorksList(); this.loadAttendanceData();
}); });
}, },
init() { init() {
@ -971,6 +973,7 @@ export default {
// //
this.costInterval = setInterval(this.manufacturingCostRoll, 5000); this.costInterval = setInterval(this.manufacturingCostRoll, 5000);
}, },
//
loadAttendanceData() { loadAttendanceData() {
this.getProjectId(id => { this.getProjectId(id => {
let data = { let data = {
@ -978,7 +981,11 @@ export default {
projectId: id || 0, projectId: id || 0,
attendanceTime: this.$dt(new Date()).format("YYYY-MM-DD") 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 || []; let tmps = d.data || [];
const func = (ids) => { const func = (ids) => {
let sum = 0; let sum = 0;
@ -989,36 +996,14 @@ export default {
} }
this.laborPersonnelTotal = 0; 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.laborPersonnelData.forEach(it => {
this.laborPersonnelTotal += it.value; this.laborPersonnelTotal += it.value;
}) })
this.elDeptWorks++; this.elDeptWorks++;
}); });
}); });
}, },
//
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() { projectIntroduction() {
//this.popupShow = true //this.popupShow = true
@ -1140,7 +1125,7 @@ export default {
onWarningInfoNav(n, text) { onWarningInfoNav(n, text) {
this.infoNav = n this.infoNav = n
this.staffText = text this.staffText = text
this.getDeptWorksList(); this.loadAttendanceData();
if (n == 0) { if (n == 0) {
this.surveyUrl = 'images/survey_icon_4.png' this.surveyUrl = 'images/survey_icon_4.png'
} else { } else {