学校考勤统计总计
This commit is contained in:
parent
0a5400379e
commit
3b9a4ac766
@ -41,7 +41,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div ref="printMe">
|
<div ref="printMe">
|
||||||
<h2 style="text-align: center">{{this.user.dept.deptName}}班级儿童考勤表</h2>
|
<h2 style="text-align: center">{{ this.deptName }}班级儿童考勤表</h2>
|
||||||
<h4 style="text-align: left">
|
<h4 style="text-align: left">
|
||||||
考勤月份:{{ this.month }} ------ 班级总数:{{ this.classcount }} ------
|
考勤月份:{{ this.month }} ------ 班级总数:{{ this.classcount }} ------
|
||||||
幼儿总数:{{ this.chilidcount }}
|
幼儿总数:{{ this.chilidcount }}
|
||||||
@ -86,7 +86,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
//用户信息
|
//用户信息
|
||||||
user: {},
|
deptName: "",
|
||||||
//幼儿总数
|
//幼儿总数
|
||||||
chilidcount: "",
|
chilidcount: "",
|
||||||
//班级数量
|
//班级数量
|
||||||
@ -144,8 +144,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getUser() {
|
getUser() {
|
||||||
getUserProfile().then(response => {
|
getUserProfile().then((response) => {
|
||||||
this.user = response.data;
|
// console.log(response.data);
|
||||||
|
this.deptName = response.data.dept.deptName;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getNowTime() {
|
getNowTime() {
|
||||||
@ -167,6 +168,10 @@ export default {
|
|||||||
column_name: "bjmc",
|
column_name: "bjmc",
|
||||||
sort: "班级",
|
sort: "班级",
|
||||||
});
|
});
|
||||||
|
this.tableHead.push({
|
||||||
|
column_name: "zj",
|
||||||
|
sort: "总计",
|
||||||
|
});
|
||||||
response.rows.forEach((res) => {
|
response.rows.forEach((res) => {
|
||||||
this.tableHead.push({
|
this.tableHead.push({
|
||||||
column_name: "",
|
column_name: "",
|
||||||
@ -196,6 +201,39 @@ export default {
|
|||||||
response.rows.forEach((res) => {
|
response.rows.forEach((res) => {
|
||||||
this.tableData.push({
|
this.tableData.push({
|
||||||
bjmc: res.bjmc,
|
bjmc: res.bjmc,
|
||||||
|
zj: this.avg([
|
||||||
|
res.day1,
|
||||||
|
res.day2,
|
||||||
|
res.day3,
|
||||||
|
res.day4,
|
||||||
|
res.day5,
|
||||||
|
res.day6,
|
||||||
|
res.day7,
|
||||||
|
res.day8,
|
||||||
|
res.day9,
|
||||||
|
res.day10,
|
||||||
|
res.day11,
|
||||||
|
res.day12,
|
||||||
|
res.day13,
|
||||||
|
res.day14,
|
||||||
|
res.day15,
|
||||||
|
res.day16,
|
||||||
|
res.day17,
|
||||||
|
res.day18,
|
||||||
|
res.day19,
|
||||||
|
res.day20,
|
||||||
|
res.day21,
|
||||||
|
res.day22,
|
||||||
|
res.day23,
|
||||||
|
res.day24,
|
||||||
|
res.day25,
|
||||||
|
res.day26,
|
||||||
|
res.day27,
|
||||||
|
res.day28,
|
||||||
|
res.day29,
|
||||||
|
res.day30,
|
||||||
|
res.day31,
|
||||||
|
]),
|
||||||
day1:
|
day1:
|
||||||
res.day1 == "0"
|
res.day1 == "0"
|
||||||
? ""
|
? ""
|
||||||
@ -326,6 +364,22 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
avg(a1) {
|
||||||
|
console.log("a" + a1.length);
|
||||||
|
//bug 这个地方的分母a 应该取值所有班级的最大值
|
||||||
|
var a = 0;
|
||||||
|
var sum = 0;
|
||||||
|
a1.forEach((res) => {
|
||||||
|
if (res > 0) {
|
||||||
|
a = a + 1;
|
||||||
|
sum = sum + res;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (a == 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return parseFloat(((sum / a) * 100).toFixed(2)) + "%";
|
||||||
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user