劳务人员相关

dev-login
姜玉琦 2023-08-16 20:42:07 +08:00
parent b141ed6723
commit 3f4b5c228e
3 changed files with 70 additions and 14 deletions

View File

@ -0,0 +1,20 @@
import request from '@/utils/request'
const getDeptWorksList=(deptId,projectId)=> {
return request({
url: `bgscreen/attendance/getDeptWorksList?deptId=${deptId}&projectId=${projectId}`,
method: 'get'
})
}
const getWorkAttendanceList=(deptId,projectId,date)=> {
return request({
url: `bgscreen/attendance/getWorkAttendanceList?deptId=${deptId}&projectId=${projectId}&date=${date}`,
method: 'get'
})
}
export default{
getDeptWorksList,
getWorkAttendanceList
}

View File

@ -7,6 +7,7 @@ import workFile from './workFile/index'
import workTrain from './workTrain/index'
import special from './special/index'
import dict from './dict/index'
import attendance from './attendance/index'
export default {
project,
dept,
@ -16,5 +17,6 @@ export default {
workFile,
workTrain,
special,
dict
dict,
attendance
}

View File

@ -318,7 +318,7 @@ export default {
laborPersonnelData: [
{ text: "总包人员", value: 10 },
{ text: "监理人员", value: 70 },
{ text: "劳务人员", value: 20 },
{ text: "劳务人员", value: 220 },
],
//
specialDataList:[],
@ -341,6 +341,7 @@ export default {
this.getWorkTrainList();
this.getEmergencyDrillList();
this.getProjectSpecialView();
this.getDeptWorksList();
},
mounted() {
this.$bus.$on("deptChange", dept => {
@ -349,6 +350,11 @@ export default {
this.getWorkTrainList();
this.getEmergencyDrillList();
this.getProjectSpecialView();
if (this.infoNav == 0) {
this.getDeptWorksList();
} else {
this.getWorkAttendanceList();
}
});
},
methods: {
@ -411,6 +417,44 @@ export default {
this.specialDataList = d.rows;
});
},
//
getDeptWorksList(){
let deptId = '';
if (this.dept && this.dept.id != 0) {
deptId = this.dept.id;
}
this.$api.attendance.getDeptWorksList(deptId).then(d => {
this.laborPersonnelTotal=0;
this.laborPersonnelData=[];
if(d.rows.length>0 && d.rows[0]!=null){
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});
}
});
},
//
getWorkAttendanceList(){
let deptId = '';
if (this.dept && this.dept.id != 0) {
deptId = this.dept.id;
}
this.$api.attendance.getWorkAttendanceList(deptId).then(d => {
this.laborPersonnelTotal=0;
this.laborPersonnelData=[];
if(d.rows.length>0 && d.rows[0]!=null){
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});
}
});
},
fmt(n) {
n = "" + n;
return " ".substring(0, 3 - n.length) + n;
@ -482,20 +526,10 @@ export default {
this.staffText = text
if (n == 0) {
this.surveyUrl = 'images/survey_icon_4.png'
this.laborPersonnelData = [
{ text: "总包人员", value: 118 },
{ text: "监理人员", value: 3 },
{ text: "劳务人员", value: 28 },
]
this.laborPersonnelTotal = 149;
this.getDeptWorksList();
} else {
this.surveyUrl = 'images/survey_icon_5.png'
this.laborPersonnelTotal = 133;
this.laborPersonnelData = [
{ text: "总包人员", value: 105 },
{ text: "监理人员", value: 3 },
{ text: "劳务人员", value: 25 },
]
this.getWorkAttendanceList();
}
},
doSafeNav(n, t) {