Browse Source

bug修改

yanym 6 years ago
parent
commit
68c67a6224

+ 117 - 65
dorm-manager-wx/pages/teacher/statistics/statistics.js

@@ -103,6 +103,8 @@ Page({
           }
         }
       } else {
+        that.getStatisticsInfo();
+        that.qiehuan(that.data.type);
         let userArray = that.data.userArray;
         userArray[1] = arrayDept
         that.setData({
@@ -121,11 +123,18 @@ Page({
   columnChange: function(e) {
     const that = this;
     let value = that.data.value
+    if (e.detail.column == 0) {
+      value[1] = 0
+    }
     value[e.detail.column] = e.detail.value
     that.setData({
       value: value
     })
     if (e.detail.column == 0) {
+      that.setData({
+        listDept: '',
+        list: ''
+      })
       that.getDeptInfo()
     } else if (e.detail.column == 1) {
       that.getStatisticsInfo();
@@ -135,71 +144,114 @@ Page({
 
   getChart: function(e) {
     const that = this;
-    ringChart = new wxCharts({
-      animation: true,
-      canvasId: 'ringCanvas',
-      type: 'ring',
-      extra: {
-        ringWidth: 10,
-        pie: {
-          offsetAngle: -40
-        }
-      },
-      title: {
-        name: '归勤率',
-        color: '#333',
-        fontSize: 15
-      },
-      subtitle: {
-        name: that.data.totalInfo.attendance * 100 + '%',
-        color: '#6282f4',
-        fontSize: 18
-      },
-      series: [{
-        name: '无进出记录人员',
-        data: that.data.totalInfo.unAccessCount / that.data.totalInfo.total,
-        stroke: false,
-        color: '#ed5c68'
-      }, {
-        name: '已出宿舍人员',
-        data: that.data.totalInfo.out / that.data.totalInfo.total,
-        stroke: false,
-        color: '#f5a786'
-      }, {
-        name: '已归宿舍人员',
-        data: that.data.totalInfo.in / that.data.totalInfo.total,
-        stroke: false,
-        color: '#7792f5'
-      }, {
-        name: '晚归宿舍人员',
-        data: that.data.totalInfo.laterIn / that.data.totalInfo.total,
-        stroke: false,
-        color: '#79bef4'
-      }, {
-        name: '未归宿舍人员',
-        data: that.data.totalInfo.unIn / that.data.totalInfo.total,
-        stroke: false,
-        color: '#5be0c1'
-      }, {
-        name: '未出宿舍人员',
-        data: that.data.totalInfo.unOut / that.data.totalInfo.total,
-        stroke: false,
-        color: '#ac91f7'
-      }],
-      disablePieStroke: true,
-      width: 160,
-      height: 160,
-      dataLabel: false,
-      legend: false,
-      background: '#fff',
-      padding: 0
-    });
-    ringChart.addEventListener('renderComplete', () => {
-      console.log('renderComplete');
-    });
-    setTimeout(() => {
-      ringChart.stopAnimation();
-    }, 500);
+    if (that.data.totalInfo.total == 0) {
+      ringChart = new wxCharts({
+        animation: true,
+        canvasId: 'ringCanvas',
+        type: 'ring',
+        extra: {
+          ringWidth: 10,
+          pie: {
+            offsetAngle: -40
+          }
+        },
+        title: {
+          name: '归勤率',
+          color: '#333',
+          fontSize: 15
+        },
+        subtitle: {
+          name: '100%',
+          color: '#6282f4',
+          fontSize: 18
+        },
+        series: [{
+          name: '已归宿舍人员',
+          data: 1,
+          stroke: false,
+          color: '#7792f5'
+        }, ],
+        disablePieStroke: true,
+        width: 160,
+        height: 160,
+        dataLabel: false,
+        legend: false,
+        background: '#fff',
+        padding: 0
+      });
+      ringChart.addEventListener('renderComplete', () => {
+        console.log('renderComplete');
+      });
+      setTimeout(() => {
+        ringChart.stopAnimation();
+      }, 500);
+    } else {
+      ringChart = new wxCharts({
+        animation: true,
+        canvasId: 'ringCanvas',
+        type: 'ring',
+        extra: {
+          ringWidth: 10,
+          pie: {
+            offsetAngle: -40
+          }
+        },
+        title: {
+          name: '归勤率',
+          color: '#333',
+          fontSize: 15
+        },
+        subtitle: {
+          name: that.data.totalInfo.attendance * 100 + '%',
+          color: '#6282f4',
+          fontSize: 18
+        },
+        series: [{
+          name: '无进出记录人员',
+          data: that.data.totalInfo.unAccessCount / that.data.totalInfo.total,
+          stroke: false,
+          color: '#ed5c68'
+        }, {
+          name: '已出宿舍人员',
+          data: that.data.totalInfo.out / that.data.totalInfo.total,
+          stroke: false,
+          color: '#f5a786'
+        }, {
+          name: '已归宿舍人员',
+          data: that.data.totalInfo.in / that.data.totalInfo.total,
+          stroke: false,
+          color: '#7792f5'
+        }, {
+          name: '晚归宿舍人员',
+          data: that.data.totalInfo.laterIn / that.data.totalInfo.total,
+          stroke: false,
+          color: '#79bef4'
+        }, {
+          name: '未归宿舍人员',
+          data: that.data.totalInfo.unIn / that.data.totalInfo.total,
+          stroke: false,
+          color: '#5be0c1'
+        }, {
+          name: '未出宿舍人员',
+          data: that.data.totalInfo.unOut / that.data.totalInfo.total,
+          stroke: false,
+          color: '#ac91f7'
+        }],
+        disablePieStroke: true,
+        width: 160,
+        height: 160,
+        dataLabel: false,
+        legend: false,
+        background: '#fff',
+        padding: 0
+      });
+      ringChart.addEventListener('renderComplete', () => {
+        console.log('renderComplete');
+      });
+      setTimeout(() => {
+        ringChart.stopAnimation();
+      }, 500);
+    }
   },
 
   touchHandler: function(e) {

+ 0 - 1
dorm-manager-wx/pages/teacher/suggestion/list.js

@@ -81,7 +81,6 @@ Page({
     } else {
       that.getList('');
     }
-    that.getList(0);
   },
 
   /**

+ 1 - 1
dorm-manager-wx/utils/api.js

@@ -110,7 +110,7 @@ const index = 2,
     getVisitorCheck: '/visitor/approvalAlumniVisitor.if', //访客信息审批
 	getunInByCount: '/access/unInByCount.if', //按天查询未归记录
     getOutAndInInfo: '/access/InAndOut.if', //已出已归记录
-    getUnInInfo: '/access/outUnIn.if', //未归记录
+    getUnInInfo: '/access/OutUnIn.if', //未归记录
     getLateIn: '/access/lateIn.if', //晚归记录
     getInUnOunt: '/access/InUnOunt.if', //未出记录
     getUnOut: '/access/unOut.if', //查询没有进出记录的人员情况