班级考勤部分代码

This commit is contained in:
sk1551 2020-09-25 13:45:20 +08:00
parent c5b8288bd4
commit 0a5400379e
3 changed files with 71 additions and 17 deletions

View File

@ -16,18 +16,30 @@
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button type="primary" plain size="mini" icon="el-icon-printer" @click="prints">打印</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" style="width: 100%" border :data="tableData">
<template v-for="(item,index) in tableHead">
<el-table-column
:prop=" item.column_name==''?'day'+(item.sort+1) : item.column_name"
:label=" item.column_name==''?(item.sort+1)+'' : item.sort"
:key="index"
></el-table-column>
</template>
</el-table>
<div ref="printMe">
<h2 style="text-align:center;">儿童考勤表</h2>
<h4 style="text-align: left">
班级名称{{ this.bjmc }}------
考勤月份{{ this.month }}------
在册人数{{ this.childcount }} ------
班长姓名{{ this.jsmc }} ------
</h4>
<el-table v-loading="loading" style="width: 100%" border :data="tableData">
<template v-for="(item,index) in tableHead">
<el-table-column
:prop=" item.column_name==''?'day'+(item.sort+1) : item.column_name"
:fixed="item.column_name!=''"
:label=" item.column_name==''?(item.sort+1)+'' : item.sort"
:key="index"
></el-table-column>
</template>
</el-table>
</div>
<pagination
v-show="total>0"
@ -48,6 +60,12 @@ export default {
data() {
return {
month: "",
//
bjmc: "",
// :
childcount: "",
//
jsmc: "",
//
loading: true,
//
@ -88,8 +106,8 @@ export default {
],
//
queryParams: {
month: "",
},
month: ""
}
};
},
created() {
@ -110,16 +128,17 @@ export default {
if (this.queryParams.month == "") {
this.queryParams.month = this.month;
}
await listDatetime(this.queryParams).then((response) => {
await listDatetime(this.queryParams).then(response => {
console.log(response.rows);
this.tableHead.push({
column_name: "name",
sort: "姓名",
sort: "姓名"
});
response.rows.forEach((res) => {
response.rows.forEach(res => {
this.tableHead.push({
column_name: "",
sort: res.sort,
sort: res.sort
});
});
});
@ -131,8 +150,11 @@ export default {
if (this.queryParams.month == "") {
this.queryParams.month = this.month;
}
listChildCheck(this.queryParams).then((response) => {
listChildCheck(this.queryParams).then(response => {
console.log(response.rows);
this.bjmc =response.rows[0].bjmc;
this.childcount = response.rows.length;
this.jsmc = response.rows[0].zbjsmc;
this.tableData = response.rows;
this.total = response.total;
this.loading = false;
@ -148,6 +170,11 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
},
//
prints() {
//console.log(this.$refs.printMe);
this.$print(this.$refs.printMe);
},
}
};
</script>

View File

@ -297,6 +297,8 @@ public class ByChild extends BaseEntity {
private String day29;
private String day30;
private String day31;
private String bjmc;
private String zbjsmc;
public String getDay1() {
return day1;
@ -958,6 +960,8 @@ public class ByChild extends BaseEntity {
.append("day29", getDay29())
.append("day30", getDay30())
.append("day31", getDay31())
.append("bjmc", getBjmc())
.append("zbjsmc", getZbjsmc())
.toString();
}
@ -968,4 +972,21 @@ public class ByChild extends BaseEntity {
public void setByChildContactpeople(ByChildContactpeople byChildContactpeople) {
this.byChildContactpeople = byChildContactpeople;
}
public String getBjmc() {
return bjmc;
}
public void setBjmc(String bjmc) {
this.bjmc = bjmc;
}
public String getZbjsmc() {
return zbjsmc;
}
public void setZbjsmc(String zbjsmc) {
this.zbjsmc = zbjsmc;
}
}

View File

@ -78,6 +78,8 @@
<result property="day29" column="day29"/>
<result property="day30" column="day30"/>
<result property="day31" column="day31"/>
<result property="bjmc" column="bjmc"/>
<result property="zbjsmc" column="zbjsmc"/>
<association property="byChildContactpeople" column="childid" javaType="ByChildContactpeople" resultMap="ByChildContactpeopleResult" />
</resultMap>
@ -413,6 +415,10 @@
resultMap="ByChildResult">
select c.id, c.classid, c.name,
(select bjmc from by_class where bjbh=c.classid) as bjmc,
(select nick_name from sys_user where user_id in (select zbjs from by_class where bjbh=c.classid)) as zbjsmc,
(select (select dict_label from sys_dict_data
where dict_type='sys_dm_cqzt' and dict_value= type)
from by_child_checkin_detail where childid=c.id