-
@@ -342,11 +342,11 @@ export default {
this.$bus.$on("projectChange", res => {
this.projectInfo=res;
this.doDeptChane();
- //this.getWorkTrainList();
- //this.getEmergencyDrillList();
- //this.getProjectSpecialView();
- //this.getDeptWorksList();
- //this.getProjectInsuranceList();
+ this.getWorkTrainList();
+ this.getEmergencyDrillList();
+ this.getProjectSpecialView();
+ this.getDeptWorksList();
+ this.getProjectInsuranceList();
});
this.$bus.$on("deptChange", dept => {
this.dept = dept;
@@ -391,43 +391,27 @@ export default {
},
// 获取专项培训列表
getWorkTrainList() {
- let deptId = '';
- if (this.dept && this.dept.id != 0) {
- deptId = this.dept.id;
- }
- this.$api.workTrain.getWorkTrainList(0, deptId).then(d => {
+ this.$api.workTrain.getWorkTrainList(0, this.dept?.id||0,this.projectInfo?.id||0).then(d => {
this.workTrainList = d.rows;
});
},
// 获取专项培训列表
getEmergencyDrillList() {
- let deptId = '';
- if (this.dept && this.dept.id != 0) {
- deptId = this.dept.id;
- }
- this.$api.workTrain.getWorkTrainList(1, deptId).then(d => {
+ this.$api.workTrain.getWorkTrainList(1, this.dept?.id||0,this.projectInfo?.id||0).then(d => {
this.emergencyDrillList = d.rows;
});
},
// 获取特种人员数据列表
getProjectSpecialView(){
- let deptId = '';
- if (this.dept && this.dept.id != 0) {
- deptId = this.dept.id;
- }
- this.$api.special.getProjectSpecialView(deptId).then(d => {
+ this.$api.special.getProjectSpecialView(this.dept?.id||0,this.projectInfo?.id||0).then(d => {
this.specialDataList = d.rows;
});
},
//查询在岗人数
getDeptWorksList(){
- let deptId = '';
- if (this.dept && this.dept.id != 0) {
- deptId = this.dept.id;
- }
if (this.infoNav == 0) {
//查询在岗人数
- this.$api.attendance.getDeptWorksList(deptId).then(d => {
+ this.$api.attendance.getDeptWorksList(this.dept?.id||0,this.projectInfo?.id||0).then(d => {
this.laborPersonnelTotal=0;
this.laborPersonnelData=[];
if(d.rows.length>0 && d.rows[0]!=null){
@@ -441,7 +425,7 @@ export default {
});
} else {
//查询出勤人数
- this.$api.attendance.getWorkAttendanceList(deptId).then(d => {
+ this.$api.attendance.getWorkAttendanceList(this.dept?.id||0,this.projectInfo?.id||0).then(d => {
this.laborPersonnelTotal=0;
this.laborPersonnelData=[];
if(d.rows.length>0 && d.rows[0]!=null){
@@ -456,11 +440,7 @@ export default {
}
},
getProjectInsuranceList(){
- let deptId = '';
- if (this.dept && this.dept.id != 0) {
- deptId = this.dept.id;
- }
- this.$api.insurance.getProjectInsuranceList(deptId).then(d => {
+ this.$api.insurance.getProjectInsuranceList(this.dept?.id||0,this.projectInfo?.id||0).then(d => {
this.insuranceDataList=[];
if(d.rows.length>0 && d.rows[0]!=null){
this.insuranceDataList = d.rows;
@@ -561,6 +541,7 @@ export default {
this.warningTypeInterval = setInterval(this.automaticRollType, 5000);
//定时器|一分钟执行一次
+ this.getWorkFileList();
setInterval(this.getWorkFileList, 60000);
setInterval(this.getWorkTrainList, 60000);
setInterval(this.getEmergencyDrillList, 60000);