update code
parent
ec38bb02ed
commit
d938a781d4
|
@ -15,7 +15,16 @@ const getWorkAttendanceList=(deptId,projectId)=> {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
const groupByComany=(data)=> {
|
||||
return request({
|
||||
url: `bgscreen/attendance/groupByComany`,
|
||||
data:data,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
export default{
|
||||
getDeptWorksList,
|
||||
getWorkAttendanceList
|
||||
getWorkAttendanceList,
|
||||
groupByComany
|
||||
}
|
|
@ -491,6 +491,7 @@ export default {
|
|||
this.elKey++;
|
||||
this.onWarningInfoNav(0);
|
||||
this.sumCostOutByDeptId();
|
||||
|
||||
}));
|
||||
this.$bus.$on("deptChange", debounce(dept => {
|
||||
this.deptInfo = dept;
|
||||
|
@ -502,6 +503,31 @@ export default {
|
|||
}));
|
||||
},
|
||||
methods: {
|
||||
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 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++;
|
||||
});
|
||||
},
|
||||
planSummaryChartClick(p){
|
||||
let idx=0;
|
||||
if(p.event.target.parent.style && p.event.target.parent.style.text){
|
||||
|
@ -633,7 +659,6 @@ export default {
|
|||
},
|
||||
init() {
|
||||
|
||||
|
||||
this.localStorage = JSON.parse(localStorage.getItem("data1"))
|
||||
|
||||
//地图数据
|
||||
|
@ -666,7 +691,7 @@ export default {
|
|||
this.surveyUrl = 'images/survey_icon_4.png'
|
||||
} else {
|
||||
this.surveyUrl = 'images/survey_icon_5.png'
|
||||
}
|
||||
}
|
||||
this.getDeptWorksList();
|
||||
},
|
||||
//查询在岗人数
|
||||
|
@ -690,20 +715,7 @@ export default {
|
|||
});
|
||||
} else {
|
||||
//查询出勤人数
|
||||
this.$api.attendance.getWorkAttendanceList(deptId).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++;
|
||||
});
|
||||
this.loadAttendanceData();
|
||||
}
|
||||
},
|
||||
//集团新闻列表
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
<div :class="infoNav == 1 ? 'active' : ''" @click="onWarningInfoNav(1, '今日出勤')">今日出勤
|
||||
</div>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-row :key="elDeptWorks">
|
||||
<el-col :span="8">
|
||||
<div class="survey_content">
|
||||
<div class="survey_content_img">
|
||||
|
@ -752,7 +752,8 @@ export default {
|
|||
mapName: '',
|
||||
costOut: {},
|
||||
finishBuildNode: [],
|
||||
modleMap: []
|
||||
modleMap: [],
|
||||
elDeptWorks:0,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -950,6 +951,32 @@ export default {
|
|||
//造价 定时器
|
||||
this.costInterval = setInterval(this.manufacturingCostRoll, 5000);
|
||||
},
|
||||
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++;
|
||||
});
|
||||
});
|
||||
},
|
||||
//查询在岗人数
|
||||
getDeptWorksList() {
|
||||
if (this.infoNav == 0) {
|
||||
|
@ -969,20 +996,7 @@ export default {
|
|||
});
|
||||
|
||||
} else {
|
||||
//查询出勤人数
|
||||
this.$api.attendance.getWorkAttendanceList(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 });
|
||||
}
|
||||
});
|
||||
this.loadAttendanceData();
|
||||
}
|
||||
},
|
||||
//项目介绍弹窗
|
||||
|
|
|
@ -97,10 +97,14 @@ service.interceptors.response.use(res => {
|
|||
}
|
||||
return Promise.reject(new Error(msg))
|
||||
} else if (code === 601) {
|
||||
Message({ message: msg, type: 'warning' })
|
||||
if(msg.indexOf('重复提交')==-1){
|
||||
Message({ message: msg, type: 'warning' })
|
||||
}
|
||||
return Promise.reject('error')
|
||||
} else if (code !== 200) {
|
||||
Notification.error({ title: msg })
|
||||
if(msg.indexOf('重复提交')==-1){
|
||||
Notification.error({ title: msg })
|
||||
}
|
||||
return Promise.reject('error')
|
||||
} else {
|
||||
return res.data
|
||||
|
@ -116,7 +120,9 @@ service.interceptors.response.use(res => {
|
|||
} else if (message.includes("Request failed with status code")) {
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
}
|
||||
Message({ message: message, type: 'error', duration: 5 * 1000 })
|
||||
if(message.indexOf('重复提交')==-1){
|
||||
Message({ message: message, type: 'error', duration: 5 * 1000 })
|
||||
}
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue