Browse Source

周报版本

347617796@qq.com 3 years ago
parent
commit
51732c9ac8

+ 1 - 1
.mini-ide/compileMode.json

@@ -54,7 +54,7 @@
     {
     {
       "title": "周报",
       "title": "周报",
       "page": "pages/reportBox/report/report",
       "page": "pages/reportBox/report/report",
-      "pageQuery": "employee_id=181"
+      "pageQuery": ""
     }
     }
   ]
   ]
 }
 }

+ 4 - 4
app.js

@@ -2,8 +2,8 @@ import { showToast } from './utils/feedback'
 import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 import * as socketApi from './utils/websocket'
 import * as socketApi from './utils/websocket'
 
 
-// const baseUrl = "https://test-ding.g107.com/";//测试
-const baseUrl = "https://ding.insys.g107.com/";//正式
+const baseUrl = "https://test-ding.g107.com/";//测试
+// const baseUrl = "https://ding.insys.g107.com/";//正式
 var that;
 var that;
 var yearArr = [];
 var yearArr = [];
 var year = formatTime(new Date()).year;
 var year = formatTime(new Date()).year;
@@ -14,8 +14,8 @@ App({
   //自定义全局变量
   //自定义全局变量
   globalData: {
   globalData: {
     baseUrl:baseUrl,
     baseUrl:baseUrl,
-    // webScoketUrl: "test-ding.g107.com",//webScoket测试
-    webScoketUrl: "ding.insys.g107.com",//webScoket正式
+    webScoketUrl: "test-ding.g107.com",//webScoket测试
+    // webScoketUrl: "ding.insys.g107.com",//webScoket正式
     showToast: showToast,//提示框
     showToast: showToast,//提示框
     arrRemoveObj: arrRemoveObj,//删除数组的某一项
     arrRemoveObj: arrRemoveObj,//删除数组的某一项
     year: formatTime(new Date()).year,//当前年
     year: formatTime(new Date()).year,//当前年

+ 8 - 8
pages/reportBox/report/report.axml

@@ -11,7 +11,7 @@
     </view>
     </view>
     <!-- 任务模块 -->
     <!-- 任务模块 -->
     <view class="task" style="padding-bottom:0rpx;position:relative">
     <view class="task" style="padding-bottom:0rpx;position:relative">
-      <view class="flex-box-end" style="color:#666;font-size:24rpx;position:absolute;top:30rpx;right:32rpx">数据实时更新</view>
+      <view class="flex-box-end" style="color:#666;font-size:24rpx;position:absolute;top:30rpx;right:32rpx">*数据实时更新</view>
       <image mode="widthFix" src="../../../image/ch2.png" style="width:360rpx" />
       <image mode="widthFix" src="../../../image/ch2.png" style="width:360rpx" />
       <view class="title">任务情况</view>
       <view class="title">任务情况</view>
       <view class="item" data-index="1" catchTap="openView">
       <view class="item" data-index="1" catchTap="openView">
@@ -23,7 +23,7 @@
       </view>
       </view>
       <view class="openUrl" a:if="{{isUrl}}" data-index="1" catchTap="openView">查看我的任务<text class="jt" style="top:2rpx">»</text></view>
       <view class="openUrl" a:if="{{isUrl}}" data-index="1" catchTap="openView">查看我的任务<text class="jt" style="top:2rpx">»</text></view>
       <view class="item" data-index="7" catchTap="openView">
       <view class="item" data-index="7" catchTap="openView">
-        <view class="text margin-Top">本周任务</view>
+        <view class="text margin-Top">上周</view>
         <view>共完成
         <view>共完成
           <text class="num">{{result.my_tasks.range_overdue_count+result.my_tasks.range_before_count+result.my_tasks.range_on_time_count}}</text>项任务</view>
           <text class="num">{{result.my_tasks.range_overdue_count+result.my_tasks.range_before_count+result.my_tasks.range_on_time_count}}</text>项任务</view>
         <view>其中按时完成
         <view>其中按时完成
@@ -47,7 +47,7 @@
       <view class="openUrl" data-index="2" a:if="{{isUrl}}" catchTap="openView">查看相关任务
       <view class="openUrl" data-index="2" a:if="{{isUrl}}" catchTap="openView">查看相关任务
         <text class="jt" style="top:2rpx">»</text></view>
         <text class="jt" style="top:2rpx">»</text></view>
       <view class="item" data-index="8" catchTap="openView">
       <view class="item" data-index="8" catchTap="openView">
-        <view class="text margin-Top">本周任务</view>
+        <view class="text margin-Top">上周</view>
         <view>共完成
         <view>共完成
           <text class="num">{{result.tasks.range_before_count+result.tasks.range_overdue_count+result.tasks.range_on_time_count}}</text>项任务</view>
           <text class="num">{{result.tasks.range_before_count+result.tasks.range_overdue_count+result.tasks.range_on_time_count}}</text>项任务</view>
         <view>其中按时完成
         <view>其中按时完成
@@ -65,7 +65,7 @@
       <image mode="widthFix" src="../../../image/ch11.png" style="width:360rpx;top:3rem" />
       <image mode="widthFix" src="../../../image/ch11.png" style="width:360rpx;top:3rem" />
       <view class="title">积分执行情况</view>
       <view class="title">积分执行情况</view>
       <view class="item">
       <view class="item">
-        <view class="text">周共完成
+        <view class="text">周共完成
           <text class="num">{{result.award.count_all}}</text>次积分奖扣</view>
           <text class="num">{{result.award.count_all}}</text>次积分奖扣</view>
         <view>B分情况 人次
         <view>B分情况 人次
           <text class="num">{{result.award.count_b}}</text>次</view>
           <text class="num">{{result.award.count_b}}</text>次</view>
@@ -83,7 +83,7 @@
         <text class="jt" style="top:2rpx">»</text></view>
         <text class="jt" style="top:2rpx">»</text></view>
     </view>
     </view>
     <view class="task" style="margin-top:40rpx">
     <view class="task" style="margin-top:40rpx">
-      <view class="title" style="margin-bottom:20rpx"><text class="blue">{{result.rank.free_man.length}}</text>人在本周内未被奖扣</view>
+      <view class="title" style="margin-bottom:20rpx">上周<text class="blue">{{result.rank.free_man.length}}</text>人未被奖扣</view>
       <view data-index="5" catchTap="openView" a:if="{{isUrl}}" class="openUrl">查看名单<text class="jt" style="top:0rpx">»</text></view>
       <view data-index="5" catchTap="openView" a:if="{{isUrl}}" class="openUrl">查看名单<text class="jt" style="top:0rpx">»</text></view>
     </view>
     </view>
     <view class="task">
     <view class="task">
@@ -99,7 +99,7 @@
               <text class="num">{{item.count}}</text>次</view>
               <text class="num">{{item.count}}</text>次</view>
           </view>
           </view>
         </block>
         </block>
-        <view a:else style="text-align: center;color:#666">暂无数据</view>
+        <view a:else style="color:#666;padding:32rpx 0">暂无数据</view>
       </view>
       </view>
     </view>
     </view>
     <view class="task">
     <view class="task">
@@ -117,7 +117,7 @@
           </view>
           </view>
         </view>
         </view>
       </view>
       </view>
-      <view a:else style="text-align: center;color:#666">暂无数据</view>
+      <view a:else style="color:#666;padding:32rpx 0">暂无数据</view>
       <view class="text">A分</view>
       <view class="text">A分</view>
       <view class="item" a:if="{{result.rule.point_top_a_events.length>0}}">
       <view class="item" a:if="{{result.rule.point_top_a_events.length>0}}">
         <view class="li" a:for="{{result.rule.point_top_a_events}}">
         <view class="li" a:for="{{result.rule.point_top_a_events}}">
@@ -131,7 +131,7 @@
           </view>
           </view>
         </view>
         </view>
       </view>
       </view>
-      <view a:else style="text-align: center;color:#666">暂无数据</view>
+      <view a:else style="color:#666;padding:32rpx 0">暂无数据</view>
     </view>
     </view>
     <view class="footer" data-index="6" catchTap="openView">
     <view class="footer" data-index="6" catchTap="openView">
       <image mode="scaleToFill" src="../../../image/logo.png"></image>
       <image mode="scaleToFill" src="../../../image/logo.png"></image>

+ 44 - 3
pages/reportBox/report/report.js

@@ -12,7 +12,7 @@ Page({
     employee_id: '',
     employee_id: '',
     isUrl: true,
     isUrl: true,
     start: '',//查看周开始时间
     start: '',//查看周开始时间
-    allDate:'',
+    allDate: '',
   },
   },
   onLoad(e) {
   onLoad(e) {
     that = this;
     that = this;
@@ -24,7 +24,7 @@ Page({
     }
     }
     if (e.start) {
     if (e.start) {
       this.setData({
       this.setData({
-        isUrl: e.start,
+        start: e.start,
       })
       })
     }
     }
     if (e.isUrl) {
     if (e.isUrl) {
@@ -33,7 +33,7 @@ Page({
       })
       })
     }
     }
     this.setData({
     this.setData({
-        allDate: app.globalData.allDate,
+      allDate: app.globalData.allDate,
     })
     })
     this.setDate();
     this.setDate();
     dd.showLoading({
     dd.showLoading({
@@ -118,7 +118,48 @@ Page({
       })
       })
     }
     }
   },
   },
+  getTime(n) {
+    var now = new Date();
+    var year = now.getFullYear();
+    //因为月份是从0开始的,所以获取这个月的月份数要加1才行
+    var month = now.getMonth() + 1;
+    var date = now.getDate();
+    var day = now.getDay();
+    console.log(date);
+    //判断是否为周日,如果不是的话,就让今天的day-1(例如星期二就是2-1)
+    if (day !== 0) {
+      n = n + (day - 1);
+    } else {
+      n = n + day;
+    }
+    if (day) {
+      //这个判断是为了解决跨年的问题
+      if (month > 1) {
+        month = month;
+      }
+      //这个判断是为了解决跨年的问题,月份是从0开始的
+      else {
+        year = year - 1;
+        month = 12;
+      }
+    }
+    now.setDate(now.getDate() - n);
+    year = now.getFullYear();
+    month = now.getMonth() + 1;
+    date = now.getDate();
+    // console.log(n);
+    var s = year + "-" + (month < 10 ? ('0' + month) : month) + "-" + (date < 10 ? ('0' + date) : date);
+    return s;
+  },
+
   setDate() {
   setDate() {
+    this.setData({
+      thisweek: {
+        start_day:this.getTime(7),
+        end_day:this.getTime(7)
+      }
+    })
+    return false
     var thisweek = {};
     var thisweek = {};
     var date = new Date();
     var date = new Date();
     // 本周一的日期
     // 本周一的日期

+ 0 - 0
pages/workbench/noJurisdiction/noJurisdiction.acss


+ 3 - 0
pages/workbench/noJurisdiction/noJurisdiction.axml

@@ -0,0 +1,3 @@
+<view>
+  New Page
+</view>

+ 4 - 0
pages/workbench/noJurisdiction/noJurisdiction.js

@@ -0,0 +1,4 @@
+Page({
+  data: {},
+  onLoad() {},
+});

+ 3 - 0
pages/workbench/noJurisdiction/noJurisdiction.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}