From c5b8288bd4116d831c84a3caafbf1bc409222daf Mon Sep 17 00:00:00 2001
From: paidaxing444 <12qwaszx>
Date: Fri, 25 Sep 2020 11:57:56 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E6=A0=A1=E8=80=83=E5=8B=A4=E7=BB=9F?=
 =?UTF-8?q?=E8=AE=A1=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../benyi/checkinstatisticsschool/index.vue   | 28 ++++++++++++++++++-
 .../benyi/controller/ByChildController.java   |  2 +-
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/ruoyi-ui/src/views/benyi/checkinstatisticsschool/index.vue b/ruoyi-ui/src/views/benyi/checkinstatisticsschool/index.vue
index 86531668a..e7d8a5b14 100644
--- a/ruoyi-ui/src/views/benyi/checkinstatisticsschool/index.vue
+++ b/ruoyi-ui/src/views/benyi/checkinstatisticsschool/index.vue
@@ -41,7 +41,11 @@
     </el-form>
 
     <div ref="printMe">
-      <h2 style="text-align: center">幼儿园班级儿童考勤表({{ this.month }})</h2>
+      <h2 style="text-align: center">{{this.user.dept.deptName}}班级儿童考勤表</h2>
+      <h4 style="text-align: left">
+        考勤月份:{{ this.month }} ------ 班级总数:{{ this.classcount }} ------
+        幼儿总数:{{ this.chilidcount }}
+      </h4>
       <el-table
         v-loading="loading"
         style="width: 100%"
@@ -75,10 +79,19 @@
 <script>
 import { listDatetime } from "@/api/benyi/checkindetail";
 import { listClassCheck } from "@/api/system/class";
+import { listChild } from "@/api/benyi/child";
+import { getUserProfile } from "@/api/system/user";
 export default {
   name: "checkinstatisticsschool",
   data() {
     return {
+      //用户信息
+      user: {},
+      //幼儿总数
+      chilidcount: "",
+      //班级数量
+      classcount: "",
+      //月份
       month: "",
       // 遮罩层
       loading: true,
@@ -127,8 +140,14 @@ export default {
   created() {
     this.getNowTime(); //得到月份
     this.getHeadList();
+    this.getUser();
   },
   methods: {
+    getUser() {
+      getUserProfile().then(response => {
+        this.user = response.data;
+      });
+    },
     getNowTime() {
       var now = new Date();
       var year = now.getFullYear(); // 得到年份
@@ -157,6 +176,12 @@ export default {
       });
 
       this.getList();
+      this.getChildCount();
+    },
+    getChildCount() {
+      listChild(null).then((response) => {
+        this.chilidcount = response.rows.length;
+      });
     },
     getList() {
       this.loading = true;
@@ -166,6 +191,7 @@ export default {
       }
       listClassCheck(this.queryParams).then((response) => {
         console.log(response.rows);
+        this.classcount = response.rows.length - 1;
         // this.tableData = response.rows;
         response.rows.forEach((res) => {
           this.tableData.push({
diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByChildController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByChildController.java
index dca03bf7f..7eefb46fb 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByChildController.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByChildController.java
@@ -41,7 +41,7 @@ public class ByChildController extends BaseController {
     /**
      * 查询幼儿信息列表
      */
-    @PreAuthorize("@ss.hasPermi('benyi:child:list')")
+    @PreAuthorize("@ss.hasPermi('benyi:child:list')" + "||@ss.hasPermi('benyi:checkinstatisticsschool:list')")
     @GetMapping("/list")
     public TableDataInfo list(ByChild byChild) {
         startPage();