update code
parent
af0a0131ec
commit
11c29edfd4
|
@ -157,6 +157,7 @@ export default {
|
|||
this.data = [{ id: 0, text: '所有项目' }, ...objs];
|
||||
let dept={id:0,text:''};
|
||||
this.$root.dept=dept;
|
||||
this.$root.hasInitHeader=true;
|
||||
this.$bus.$emit("deptChange", dept)
|
||||
this.$root._prjIds=objs.map(it=>it.id);
|
||||
Cookies.set("__ids__",objs.map(it=>it.id).join(","));
|
||||
|
|
|
@ -485,22 +485,50 @@ export default {
|
|||
}
|
||||
});
|
||||
} else {
|
||||
//查询出勤人数
|
||||
this.$api.attendance.getWorkAttendanceList(this.dept?.id||0,this.projectInfo?.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});
|
||||
}
|
||||
});
|
||||
this.loadAttendanceData();
|
||||
}
|
||||
},
|
||||
getProjectId(cb) {
|
||||
let func = () => {
|
||||
let prjId = this.projectInfo?.id||0;
|
||||
if (prjId == 0) {
|
||||
if (!this.projects||this.projects.length == 0) {
|
||||
setTimeout(func, 100);
|
||||
} else {
|
||||
cb && cb(this.projects[1].id);
|
||||
}
|
||||
} else {
|
||||
cb && cb(prjId);
|
||||
}
|
||||
}
|
||||
func();
|
||||
},
|
||||
loadAttendanceData(){
|
||||
this.getProjectId(id => {
|
||||
let data={
|
||||
subDeptId:this.dept.id||0,
|
||||
projectId:id||0,
|
||||
attendanceTime: this.$dt(new Date()).format("YYYY-MM-DD")
|
||||
}
|
||||
this.$api.attendance.groupByComany(data).then(d=>{
|
||||
let tmps=d.data||[];
|
||||
const func=(ids)=>{
|
||||
let sum=0;
|
||||
tmps.filter(it=>ids.includes(it.companyTypeId)).map(it=>it.id).forEach(it=>{
|
||||
sum+=it*1;
|
||||
})
|
||||
return sum;
|
||||
}
|
||||
|
||||
this.laborPersonnelTotal = 0;
|
||||
this.laborPersonnelData = [{ text: "劳务人员", value: func(["2","3"]) }, { text: "监理人员", value: func(["8"]) }, { text: "总包人员", value: func(["1"]) }];
|
||||
this.laborPersonnelData.forEach(it=>{
|
||||
this.laborPersonnelTotal += it.value;
|
||||
})
|
||||
this.elDeptWorks++;
|
||||
});
|
||||
});
|
||||
},
|
||||
getProjectInsuranceList(){
|
||||
this.$api.insurance.getProjectInsuranceList(this.dept?.id||0,this.projectInfo?.id||0).then(d => {
|
||||
this.insuranceDataList=[];
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
</el-col>
|
||||
<el-col :span="fontSize==2?12:12" class="item-data">
|
||||
<img src="images/title_icon.png"><span class="sp-lbl sp-lbl2">送检时间:</span>
|
||||
<div class="div-text">{{ it.checkTime|dateFormat }}</div>
|
||||
<div class="div-text">{{ it.checkTime|formatDate }}</div>
|
||||
</el-col>
|
||||
<el-col :span="fontSize==2?12:12" class="item-data">
|
||||
<img src="images/title_icon.png"><span class="sp-lbl sp-lbl2">检测结果:</span>
|
||||
|
@ -107,7 +107,7 @@
|
|||
</el-col>
|
||||
<el-col :span="fontSize==2?24:12" class="item-data">
|
||||
<img src="images/title_icon.png"><span class="sp-lbl sp-lbl2">提交时间:</span>
|
||||
<div class="div-text">{{ it.createTime|dateFormat }}</div>
|
||||
<div class="div-text">{{ it.createTime|formatDate }}</div>
|
||||
</el-col>
|
||||
<el-col :span="fontSize==2?24:12" class="item-data" v-if="it.updateBy">
|
||||
<img src="images/title_icon.png"><span class="sp-lbl sp-lbl2">登记结果用户:</span>
|
||||
|
@ -115,7 +115,7 @@
|
|||
</el-col>
|
||||
<el-col :span="fontSize==2?24:12" class="item-data" v-if="it.updateTime">
|
||||
<img src="images/title_icon.png"><span class="sp-lbl sp-lbl2">登记结果时间:</span>
|
||||
<div class="div-text">{{ it.updateTime|dateFormat }}</div>
|
||||
<div class="div-text">{{ it.updateTime|formatDate }}</div>
|
||||
</el-col>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
</el-col>
|
||||
<el-col :span="fontSize==2?24:12" class="item-data">
|
||||
<img src="images/title_icon.png"><span class="sp-lbl sp-lbl2">测量时间:</span>
|
||||
<div class="div-text">{{ it.measureTime|dateFormat }}</div>
|
||||
<div class="div-text">{{ it.measureTime|formatDate }}</div>
|
||||
</el-col>
|
||||
<el-col :span="fontSize==2?12:12" class="item-data">
|
||||
<img src="images/title_icon.png"><span class="sp-lbl sp-lbl2">测量点位:</span>
|
||||
|
@ -97,7 +97,7 @@
|
|||
</el-col>
|
||||
<el-col :span="fontSize==2?24:12" class="item-data">
|
||||
<img src="images/title_icon.png"><span class="sp-lbl sp-lbl2">提交时间:</span>
|
||||
<div class="div-text">{{ it.createTime|dateFormat }}</div>
|
||||
<div class="div-text">{{ it.createTime|formatDate }}</div>
|
||||
</el-col>
|
||||
<el-col :span="fontSize==2?24:12" class="item-data" v-if="it.updateBy">
|
||||
<img src="images/title_icon.png"><span class="sp-lbl sp-lbl2">登记结果用户:</span>
|
||||
|
@ -105,7 +105,7 @@
|
|||
</el-col>
|
||||
<el-col :span="fontSize==2?24:12" class="item-data" v-if="it.updateTime">
|
||||
<img src="images/title_icon.png"><span class="sp-lbl sp-lbl2">登记结果时间:</span>
|
||||
<div class="div-text">{{ it.updateTime|dateFormat }}</div>
|
||||
<div class="div-text">{{ it.updateTime|formatDate }}</div>
|
||||
</el-col>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -144,4 +144,7 @@
|
|||
}
|
||||
.el-message-box__content{
|
||||
color: #fff;
|
||||
}
|
||||
.head-title-tab{
|
||||
white-space: nowrap;
|
||||
}
|
Loading…
Reference in New Issue