diff --git a/ruoyi-ui/src/views/benyi/checkinstatisticsclass/index.vue b/ruoyi-ui/src/views/benyi/checkinstatisticsclass/index.vue index e4f737be0..c32eaa2df 100644 --- a/ruoyi-ui/src/views/benyi/checkinstatisticsclass/index.vue +++ b/ruoyi-ui/src/views/benyi/checkinstatisticsclass/index.vue @@ -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> \ No newline at end of file diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByChild.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByChild.java index cf203e817..3788e4668 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByChild.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByChild.java @@ -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; + } } \ No newline at end of file diff --git a/ruoyi/src/main/resources/mybatis/benyi/ByChildMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/ByChildMapper.xml index 036b7f10f..c35e49838 100644 --- a/ruoyi/src/main/resources/mybatis/benyi/ByChildMapper.xml +++ b/ruoyi/src/main/resources/mybatis/benyi/ByChildMapper.xml @@ -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