yanym 5 лет назад
Родитель
Сommit
20a01be0f4
1 измененных файлов с 18 добавлено и 10 удалено
  1. 18 10
      dorm-manager-wx/pages/teacher/statistics/statistics.js

+ 18 - 10
dorm-manager-wx/pages/teacher/statistics/statistics.js

@@ -22,6 +22,7 @@ Page({
     ],
     ],
     value: [0, 0],
     value: [0, 0],
     state: '',
     state: '',
+    type: 1,
     listTitle: '无进出记录人员',
     listTitle: '无进出记录人员',
     list: []
     list: []
   },
   },
@@ -45,7 +46,7 @@ Page({
       startDate: e.detail.value
       startDate: e.detail.value
     })
     })
     this.getStatisticsInfo();
     this.getStatisticsInfo();
-    this.getUnInInfo();
+    this.qiehuan(this.data.type);
   },
   },
 
 
   bindendDateChange: function(e) {
   bindendDateChange: function(e) {
@@ -53,7 +54,7 @@ Page({
       endDate: e.detail.value
       endDate: e.detail.value
     })
     })
     this.getStatisticsInfo();
     this.getStatisticsInfo();
-    this.getUnInInfo();
+    this.qiehuan(this.data.type);
   },
   },
 
 
   getCollegeInfo: function(e) {
   getCollegeInfo: function(e) {
@@ -98,7 +99,7 @@ Page({
               listDept: res.data
               listDept: res.data
             })
             })
             that.getStatisticsInfo();
             that.getStatisticsInfo();
-            that.getUnOut();
+            that.qiehuan(that.data.type);
           }
           }
         }
         }
       } else {
       } else {
@@ -128,6 +129,7 @@ Page({
       that.getDeptInfo()
       that.getDeptInfo()
     } else if (e.detail.column == 1) {
     } else if (e.detail.column == 1) {
       that.getStatisticsInfo();
       that.getStatisticsInfo();
+      that.qiehuan(that.data.type)
     }
     }
   },
   },
 
 
@@ -149,7 +151,7 @@ Page({
         fontSize: 15
         fontSize: 15
       },
       },
       subtitle: {
       subtitle: {
-        name: that.data.totalInfo.attendance + '%',
+        name: that.data.totalInfo.attendance * 100 + '%',
         color: '#6282f4',
         color: '#6282f4',
         fontSize: 18
         fontSize: 18
       },
       },
@@ -305,38 +307,44 @@ Page({
 
 
   qiehuan: function(e) {
   qiehuan: function(e) {
     const that = this;
     const that = this;
-    let type = e.currentTarget.dataset.type;
-    let state = e.currentTarget.dataset.state;
+    let type = e.currentTarget ? e.currentTarget.dataset.type : e;
+    let state = e.currentTarget ? e.currentTarget.dataset.state : that.data.state;
     if (type == 1) {
     if (type == 1) {
       that.setData({
       that.setData({
-        listTitle: '无进出记录人员'
+        listTitle: '无进出记录人员',
+        type: 1
       })
       })
       that.getUnOut();
       that.getUnOut();
     } else if (type == 2) {
     } else if (type == 2) {
       that.setData({
       that.setData({
         listTitle: '已出宿舍人员',
         listTitle: '已出宿舍人员',
+        type: 2,
         state: state
         state: state
       })
       })
       that.getOutAndInInfo();
       that.getOutAndInInfo();
     } else if (type == 3) {
     } else if (type == 3) {
       that.setData({
       that.setData({
         listTitle: '已归宿舍人员',
         listTitle: '已归宿舍人员',
+        type: 3,
         state: state
         state: state
       })
       })
       that.getOutAndInInfo();
       that.getOutAndInInfo();
     } else if (type == 4) {
     } else if (type == 4) {
       that.setData({
       that.setData({
-        listTitle: '晚归宿舍人员'
+        listTitle: '晚归宿舍人员',
+        type: 4
       })
       })
       that.getLateIn();
       that.getLateIn();
     } else if (type == 5) {
     } else if (type == 5) {
       that.setData({
       that.setData({
-        listTitle: '未归宿舍人员'
+        listTitle: '未归宿舍人员',
+        type: 5
       })
       })
       that.getUnInInfo();
       that.getUnInInfo();
     } else if (type == 6) {
     } else if (type == 6) {
       that.setData({
       that.setData({
-        listTitle: '未出宿舍人员'
+        listTitle: '未出宿舍人员',
+        type: 6
       })
       })
       that.getInUnOut();
       that.getInUnOut();
     }
     }