Browse Source

Merge branch 'dev'

347617796@qq.com 2 năm trước cách đây
mục cha
commit
7737756132
89 tập tin đã thay đổi với 2776 bổ sung379 xóa
  1. 18 0
      .mini-ide/compileMode.json
  2. 33 0
      Component/Review/Review.acss
  3. 24 0
      Component/Review/Review.axml
  4. 24 0
      Component/Review/Review.js
  5. 6 0
      Component/Review/Review.json
  6. 0 1
      Component/selectDate_two/selectDate_two.js
  7. 1 1
      Component/selectEnevt/selectEnevt.js
  8. 0 1
      Component/selectRule/selectRule.axml
  9. 2 2
      Component/selectRule/selectRule.js
  10. 1 0
      Component/selectSectionStaff/selectSectionStaff.acss
  11. 1 1
      Component/selectSectionStaff/selectSectionStaff.axml
  12. 1 1
      Component/selectSectionStaff/selectSectionStaff.js
  13. 23 4
      app.acss
  14. 22 5
      app.js
  15. 5 1
      app.json
  16. BIN
      image/dsp.png
  17. BIN
      image/integral_rank.png
  18. BIN
      image/jr.png
  19. BIN
      image/jxz.png
  20. BIN
      image/money.jpg
  21. BIN
      image/tc.jpg
  22. BIN
      image/yq.png
  23. 5 0
      package-lock.json
  24. 0 1
      pages/deploy/index/index.js
  25. 41 42
      pages/deploy/setCheck/setCheck.axml
  26. 1 1
      pages/reportBox/report/report.js
  27. 5 2
      pages/statistics/B_ranking/B_ranking.axml
  28. 39 34
      pages/statistics/B_ranking/B_ranking.js
  29. 11 9
      pages/statistics/C_ranking/C_ranking.axml
  30. 45 9
      pages/statistics/C_ranking/C_ranking.js
  31. 12 8
      pages/statistics/allTask/allTask.axml
  32. 3 0
      pages/statistics/allTask/allTask.js
  33. 1 1
      pages/statistics/assaign/assaign.axml
  34. 3 1
      pages/statistics/check_top/check_top.axml
  35. 75 1
      pages/statistics/glz_execute/glz_execute.acss
  36. 69 22
      pages/statistics/glz_execute/glz_execute.axml
  37. 62 6
      pages/statistics/glz_execute/glz_execute.js
  38. 1 1
      pages/statistics/index/index.axml
  39. 2 1
      pages/statistics/index/index.js
  40. 11 1
      pages/statistics/integralEvent/integralEvent.acss
  41. 28 16
      pages/statistics/integralEvent/integralEvent.axml
  42. 44 25
      pages/statistics/integralEvent/integralEvent.js
  43. 51 0
      pages/statistics/integralEventTwo/integralEventTwo.acss
  44. 40 0
      pages/statistics/integralEventTwo/integralEventTwo.axml
  45. 193 0
      pages/statistics/integralEventTwo/integralEventTwo.js
  46. 9 0
      pages/statistics/integralEventTwo/integralEventTwo.json
  47. 89 0
      pages/statistics/jfDetail/jfDetail.acss
  48. 42 0
      pages/statistics/jfDetail/jfDetail.axml
  49. 202 0
      pages/statistics/jfDetail/jfDetail.js
  50. 7 0
      pages/statistics/jfDetail/jfDetail.json
  51. 6 1
      pages/statistics/log_rank/log_rank.axml
  52. 8 4
      pages/statistics/my_PrizeBuckle/my_PrizeBuckle.axml
  53. 7 2
      pages/statistics/my_PrizeBuckle/my_PrizeBuckle.js
  54. 12 5
      pages/statistics/my_apply/my_apply.axml
  55. 28 13
      pages/statistics/my_apply/my_apply.js
  56. 2 1
      pages/statistics/my_sp/my_sp.axml
  57. 5 1
      pages/statistics/my_sp/my_sp.js
  58. 3 2
      pages/statistics/my_task/my_task.axml
  59. 4 0
      pages/statistics/my_task/my_task.js
  60. 1 1
      pages/statistics/offerAreward/offerAreward.axml
  61. 13 8
      pages/statistics/prizeBuckleDetail/prizeBuckleDetail.axml
  62. 45 19
      pages/statistics/prizeBuckleDetail/prizeBuckleDetail.js
  63. 2 1
      pages/statistics/prizeBuckleDetail/prizeBuckleDetail.json
  64. 5 2
      pages/statistics/sectionRanking/sectionRanking.axml
  65. 85 45
      pages/statistics/sectionRanking/sectionRanking.js
  66. 91 0
      pages/statistics/taskSList/taskSList.acss
  67. 28 0
      pages/statistics/taskSList/taskSList.axml
  68. 199 0
      pages/statistics/taskSList/taskSList.js
  69. 6 0
      pages/statistics/taskSList/taskSList.json
  70. 229 0
      pages/statistics/taskStatistical/taskStatistical.acss
  71. 137 0
      pages/statistics/taskStatistical/taskStatistical.axml
  72. 394 0
      pages/statistics/taskStatistical/taskStatistical.js
  73. 8 0
      pages/statistics/taskStatistical/taskStatistical.json
  74. 6 1
      pages/statistics/task_rank/task_rank.axml
  75. 1 1
      pages/workbench/apply/apply.axml
  76. 2 1
      pages/workbench/apply/apply.js
  77. 2 2
      pages/workbench/approve/approve.js
  78. 42 3
      pages/workbench/index/index.acss
  79. 17 4
      pages/workbench/index/index.axml
  80. 52 52
      pages/workbench/index/index.js
  81. 1 1
      pages/workbench/jk_B/jk_B.axml
  82. 2 1
      pages/workbench/my_approve/my_approve.axml
  83. 3 0
      pages/workbench/my_approve/my_approve.js
  84. 2 2
      pages/workbench/prize_buckle/prize_buckle.acss
  85. 2 0
      pages/workbench/prize_buckle/prize_buckle.axml
  86. 5 0
      pages/workbench/prize_buckle/prize_buckle.js
  87. 9 3
      pages/workbench/statistics_A/statistics_A.js
  88. 10 4
      pages/workbench/statistics_B/statistics_B.js
  89. 50 1
      utils/util.js

+ 18 - 0
.mini-ide/compileMode.json

@@ -55,6 +55,24 @@
       "title": "周报",
       "page": "pages/reportBox/report/report",
       "pageQuery": ""
+    },
+    {
+      "title": "任务统计",
+      "page": "pages/statistics/taskStatistical/taskStatistical"
+    },
+    {
+      "title": "积分申请",
+      "page": "pages/workbench/apply/apply",
+      "pageQuery": "id=48148"
+    },
+    {
+      "title": "积分明细",
+      "page": "pages/statistics/jfDetail/jfDetail"
+    },
+    {
+      "title": "事件详情",
+      "page": "pages/statistics/prizeBuckleDetail/prizeBuckleDetail",
+      "pageQuery": "id=69380"
     }
   ]
 }

+ 33 - 0
Component/Review/Review.acss

@@ -0,0 +1,33 @@
+.process-title{
+  padding:16rpx 32rpx;
+  background: #fff;
+}
+.process-title text:nth-child(1){
+  font-size: 36rpx;
+  color: #222;
+  font-weight: 600;
+}
+.process-title text:nth-child(2){
+  color: #909399;
+  font-weight: 500;
+  padding-left: 20rpx;
+  font-size: 32rpx;
+}
+.process-bottom{
+  padding:16rpx 32rpx;
+  background: #fff;
+}
+.process-bottom-right{
+  margin-left: 10rpx;
+}
+.process-name{
+  margin-right: 20rpx;
+}
+.process-date{
+  font-size: 24rpx;
+  color: #909399;
+  padding: 4rpx 0;
+}
+.process-context{
+  font-size: 28rpx;
+}

+ 24 - 0
Component/Review/Review.axml

@@ -0,0 +1,24 @@
+<view>
+  <view class="process-title border-bottom flex-box flex-flex-v-ce">
+      <text>复核</text><text>由管理员复核确认</text>
+  </view>
+  <view class="process-bottom">
+    <view class="flex-box" style="position: relative;" a:for="{{info}}">
+      <view class="imgBox" a:if="{{(index+1)!=process.length}}"></view>
+      <img-box name="{{item.employee_name}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx"></img-box>
+      <view class="process-bottom-right flex-1">
+        <view class="flex-box flex-v-ce names">
+          <text class="process-name">{{item.employee_name}}</text>
+          <text class="green" a:if="{{status == 1}}">复核通过</text>
+          <text class="red" a:if="{{status == 2}}">复核不通过</text>
+          <text class="flex-1"></text>
+          <text a:if="{{item.review_point&&item.review_point>0}}">+{{item.review_point}}</text>
+          <text a:if="{{item.review_point&&item.review_point<0}}">{{item.review_point}}</text>
+        </view>
+        <view class="process-date">{{item.time}}</view>
+        <view class="process-context yellow">{{item.action_des}}</view>
+        <view class="process-context">{{item.comment}}</view>
+      </view>
+    </view>
+  </view>
+</view>

+ 24 - 0
Component/Review/Review.js

@@ -0,0 +1,24 @@
+import moment from 'moment' // 时间库
+Component({
+  mixins: [],
+  data: {
+    info:[]
+  },
+  props: {
+    process:[],
+    status:0
+  },
+  didMount() {
+    if(this.props.process.length>0){
+      let info=this.props.process[0];
+      let time=info.time+'000';
+      info.time=moment(Number(time)).format('YYYY-MM-DD HH:mm:ss')
+      this.setData({
+        info:[info]
+      })
+    }
+  },
+  didUpdate() {},
+  didUnmount() {},
+  methods: {},
+});

+ 6 - 0
Component/Review/Review.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "img-box": "/Component/img-box/index"
+  }
+}

+ 0 - 1
Component/selectDate_two/selectDate_two.js

@@ -123,7 +123,6 @@ Component({
             return new Date(ydm).getTime()
           }
           let timeC = (tsTamp(this.data.customIndOn) - tsTamp(this.data.customIndTw)) / (60 * 60 * 24 * 1000)
-          console.log(timeC)
           if(timeC > 0){
             app.globalData.showToast("开始时间不能大于结束时间")
             return

+ 1 - 1
Component/selectEnevt/selectEnevt.js

@@ -50,7 +50,7 @@ Component({
     },
     //获取事件列表
     getlist(is) {
-      app.$get('api/integral/statistics/integral', {page:that.data.page, keyword:that.data.keyVal, page_size: 20}).then((res) => {
+      app.$get('api/integral/statistics/integral', {page:that.data.page, keyword:that.data.keyVal, page_size: 20,order_key:'update_time'}).then((res) => {
         var data = res.data.data.list;
         data.map((item) => {
           item.ptObj = app.getTypesItem(item.pt_id);

+ 0 - 1
Component/selectRule/selectRule.axml

@@ -65,7 +65,6 @@
         </label>
       </radio-group>
       <view a:else class="nodata fontColorT">暂无积分规则,请前往钉钉电脑端添加【积分规则】</view>
-      </view>
     </scroll-view>
   </view>
 </view>

+ 2 - 2
Component/selectRule/selectRule.js

@@ -61,7 +61,6 @@ Component({
         })
         return false;
       }
-      this.setData({item_child_list:[]});
       if(item.child&&item.child.length>0){
           // this.setData({
           //   activeItemIndex:item.child[0].id
@@ -73,7 +72,8 @@ Component({
         // }
       }
       this.setData({
-        activeIndex:item.id
+        activeIndex:item.id,
+        item_child_list:[]
       })
       this.getItem(item.id);
     },

+ 1 - 0
Component/selectSectionStaff/selectSectionStaff.acss

@@ -148,6 +148,7 @@
   position: relative;
   right: 10rpx;
   bottom: 5rpx;
+  top: 0rpx;
 }
 .staff-all{
   background: rgba(245, 247, 250, 1);

+ 1 - 1
Component/selectSectionStaff/selectSectionStaff.axml

@@ -28,7 +28,7 @@
       </view>
       <view class="flex-box flex-v-ce staff-all">
         <view class="flex-1"></view>
-        <label a:if="{{isAll}}">
+        <label a:if="{{isAll}}" class="flex-box-ce">
           <text class="rule-all-text">全选</text>
           <checkbox onChange="ruleActiveAll" disabled="{{item.disabled}}" checked="{{isAllChecked}}"></checkbox>
         </label>

+ 1 - 1
Component/selectSectionStaff/selectSectionStaff.js

@@ -45,7 +45,7 @@ Component({
       that.getBmData();
     // })
   },
-  didUpdate() { },
+  didUpdate() {},
   didUnmount() {
   },
   methods: {

+ 23 - 4
app.acss

@@ -18,7 +18,10 @@
 	view, text {
 		line-height: 40rpx;
 	}
-
+  .dept_name{
+    color: #969799 !important;
+    font-size: 0.24rem;
+  }
 	.blue {
 		color: #26A2FF!important;
 	}
@@ -26,7 +29,11 @@
 	.red {
 		color: #F56C6C!important;
 	}
-
+  .yellowText{
+    color: #E6A23C!important;
+    font-size: 0.24rem;
+    padding: 0 0.24rem;
+  }
 	.yellow {
 		color: #E6A23C!important;
 	}
@@ -452,12 +459,24 @@
 	}
 
 	/*超出部分用....表示的公用样式  */
-
 	.font-flex-word {
 		overflow: hidden;
 		text-overflow: ellipsis;
 		white-space: nowrap;
-	}
+  }
+  
+.clamp2{
+	display: -webkit-box;
+	-webkit-box-orient: vertical;
+	-webkit-line-clamp: 2;
+	overflow: hidden;
+}
+.clamp3{
+	display: -webkit-box;
+	-webkit-box-orient: vertical;
+	-webkit-line-clamp: 3;
+	overflow: hidden;
+}
 
 	/* 内容超出部分自动换行 */
 

+ 22 - 5
app.js

@@ -2,8 +2,8 @@ import { showToast } from './utils/feedback'
 import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 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://app55493.eapps.dingtalkcloud.com/";//正式
 var that;
 var yearArr = [];
 var year = formatTime(new Date()).year;
@@ -14,8 +14,8 @@ App({
   //自定义全局变量
   globalData: {
     baseUrl:baseUrl,
-    webScoketUrl: "test-ding.g107.com",//webScoket测试
-    // webScoketUrl: "ding.insys.g107.com",//webScoket正式
+    // webScoketUrl: "test-ding.g107.com",//webScoket测试
+    webScoketUrl: "app55493.eapps.dingtalkcloud.com",//webScoket正式
     showToast: showToast,//提示框
     arrRemoveObj: arrRemoveObj,//删除数组的某一项
     year: formatTime(new Date()).year,//当前年
@@ -35,6 +35,7 @@ App({
     corpMessage: '',//企业套餐信息
     usersList: [],//缓存的人员列表
     socketApi:socketApi,//长连接
+    config:{} //基础配置
   },
   //获取积分类型
   getTypes(callBack) {
@@ -49,6 +50,22 @@ App({
       this.globalData.corpMessage = res.data.data;
     })
   },
+  //将部门链接在一起
+  returnDeptName(arr){
+     let data=arr.map(item=>{
+        let str='';
+        item.dept_list.forEach((e,index)=>{
+            if(item.dept_list.length-index>1){
+               str+=e.dept_name+','
+            }else{
+               str+=e.dept_name
+            } 
+        })
+        item.deptName=str
+        return item
+      })
+      return data
+  },
   routerGet2(url, data = {}, Accept) {
     return new Promise(function (resolve, reject) {
       dd.httpRequest({
@@ -256,7 +273,7 @@ App({
                 that.globalData.token = token;
                 that.globalData.userData = user;
                 var getIsStart = dd.getStorageSync({ key: 'isStart' });//判断是否需要打开引导页
-                // console.log(JSON.stringify(user));
+                console.log(JSON.stringify(user));
                 that.getUserList();//缓存人员列表
                 if (isStart && !getIsStart.data&&isShowStart) {//判断是否需要打开引导
                   dd.reLaunch({

+ 5 - 1
app.json

@@ -21,6 +21,7 @@
     "pages/statistics/check_top/check_top",
     "pages/statistics/checkDetail/checkDetail",
     "pages/statistics/integralEvent/integralEvent",
+    "pages/statistics/integralEventTwo/integralEventTwo",
     "pages/statistics/sectionRanking/sectionRanking",
     "pages/statistics/B_ranking/B_ranking",
     "pages/statistics/customRamking/customRamking",
@@ -71,7 +72,10 @@
     "pages/reportBox/report/report",
     "pages/reportBox/noUser/noUser",
     "pages/reportBox/newspaperTask/newspaperTask",
-    "pages/reportBox/moreE/moreE"
+    "pages/reportBox/moreE/moreE",
+    "pages/statistics/taskStatistical/taskStatistical",
+    "pages/statistics/taskSList/taskSList",
+    "pages/statistics/jfDetail/jfDetail"
   ],
   "window": {
     "defaultTitle": "功道云",

BIN
image/dsp.png


BIN
image/integral_rank.png


BIN
image/jr.png


BIN
image/jxz.png


BIN
image/money.jpg


BIN
image/tc.jpg


BIN
image/yq.png


+ 5 - 0
package-lock.json

@@ -138,6 +138,11 @@
       "resolved": "https://registry.npm.taobao.org/hammerjs/download/hammerjs-2.0.8.tgz",
       "integrity": "sha1-BO93hiz/K7edMPdpIJWTAiK/YPE="
     },
+    "moment": {
+      "version": "2.29.3",
+      "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz",
+      "integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw=="
+    },
     "object-assign": {
       "version": "4.1.1",
       "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",

+ 0 - 1
pages/deploy/index/index.js

@@ -15,7 +15,6 @@ Page({
     dd.setNavigationBar({ title: "我的" });
     this.setData({userData:app.globalData.userData,corpMessage:app.globalData.corpMessage});
     this.getVip();
-    // console.log("123")
   },
   getVip(){
     app.$get("api/order/goods/special").then((res) => {

+ 41 - 42
pages/deploy/setCheck/setCheck.axml

@@ -1,60 +1,59 @@
 <view>
   <view class="yellow">以下分数皆为B分,请前往电脑端(PC)钉钉设置</view>
   <block a:if="{{data.enable!=0}}">
-  <view class="ul margin-bottom">
-    <!--<view class="flex-box li"><view class="li-left"><view>月度全勤</view><view >当月加分{{data.month_full_ad}}分</view></view></view> -->
-    <view class="flex-box li">
-      <view class="li-left">
-        <view>正常打卡</view>
-        <view>每次加{{data.normal}}分</view>
+    <view class="ul margin-bottom">
+      <!--<view class="flex-box li"><view class="li-left"><view>月度全勤</view><view >当月加分{{data.month_full_ad}}分</view></view></view> -->
+      <view class="flex-box li">
+        <view class="li-left">
+          <view>正常打卡</view>
+          <view>每次加{{data.normal}}分</view>
+        </view>
       </view>
-    </view>
-    <view class="flex-box li">
-      <view class="li-left">
-        <view>缺卡</view>
-        <view>每次扣{{data.no_sign}}分</view>
+      <view class="flex-box li">
+        <view class="li-left">
+          <view>缺卡</view>
+          <view>每次扣{{data.no_sign}}分</view>
+        </view>
       </view>
     </view>
-  </view>
-  <view class="ul margin-bottom">
-    <view class="flex-box li">
-      <view class="li-left">
-        <view>迟到</view>
-        <view>每次扣{{data.on_duty_late}}分</view>
+    <view class="ul margin-bottom">
+      <view class="flex-box li">
+        <view class="li-left">
+          <view>迟到</view>
+          <view>每次扣{{data.on_duty_late}}分</view>
+        </view>
       </view>
-    </view>
-    <!--<view class="flex-box li"><view class="li-left"><view>严重迟到</view><view>加分</view></view><view>{{data.off_duty_early}}</view></view> -->
-    <view class="flex-box li">
-      <view class="li-left">
-        <view>早退</view>
-        <view>每次扣{{data.off_duty_early}}分</view>
+      <!--<view class="flex-box li"><view class="li-left"><view>严重迟到</view><view>加分</view></view><view>{{data.off_duty_early}}</view></view> -->
+      <view class="flex-box li">
+        <view class="li-left">
+          <view>早退</view>
+          <view>每次扣{{data.off_duty_early}}分</view>
+        </view>
       </view>
-    </view>
-    <view class="flex-box li">
-      <view class="li-left">
-        <view>旷工</view>
-        <view>每次扣{{data.absent}}分</view>
+      <view class="flex-box li">
+        <view class="li-left">
+          <view>旷工</view>
+          <view>每次扣{{data.absent}}分</view>
+        </view>
       </view>
     </view>
-  </view>
-  <view class="ul margin-bottom">
-    <view class="flex-box li">
-      <view class="li-left">
-        <view>加班</view>
-        <view>每满一天加{{data.ot_per_day}}分</view>
+    <view class="ul margin-bottom">
+      <view class="flex-box li">
+        <view class="li-left">
+          <view>加班</view>
+          <view>得分值=报表记录的加班时间*{{data.ot_per_day}}分</view>
+        </view>
       </view>
-    </view>
-    <view class="flex-box li">
-      <view class="li-left">
-        <view>全勤</view>
-        <view>月度全勤加{{data.month_full_ad}}分</view>
+      <view class="flex-box li">
+        <view class="li-left">
+          <view>全勤</view>
+          <view>月度全勤加{{data.month_full_ad}}分</view>
+        </view>
       </view>
     </view>
-  </view>
   </block>
   <view a:else class="null">
-      <text class="fontColorF">未启动考勤设置,请前往电脑端(PC)钉钉设置</text>
+    <text class="fontColorF">未启动考勤设置,请前往电脑端(PC)钉钉设置</text>
   </view>
   <!--<view class="flex-box li"><view class="li-left"><view>加班</view><view>每小时加{{data.ot_per_hour}}分</view></view></view><view class="flex-box li"><view class="li-left"><view>请假</view><view>每小时扣{{data.leave_per_hour}}分</view></view></view> -->
-</view>
 </view>

+ 1 - 1
pages/reportBox/report/report.js

@@ -90,7 +90,7 @@ Page({
       })
     } else if (index == 6) {
       openLink({
-        url: 'https://h5.dingtalk.com/open-market/share.html?shareGoodsCode=D34E5A30A9AC7FC6327AB5E6D2D145418457E59F16C3FC969F1A50AEF2E5E320588012470F1AB045&token=d37751d45abad15178adf60f936d7c28&shareUid=C5EB7B5C85793F3D909B2AC4771E12D7'
+        url: 'https://h5.dingtalk.com/appcenter/detail.html?showmenu=false&dd_share=false&goodsCode=DT_GOODS_881607043109331&funnelsource=guangchangzhibodaihuo'
       })
     } else if (index == 7) {
       let data = {

+ 5 - 2
pages/statistics/B_ranking/B_ranking.axml

@@ -12,7 +12,7 @@
     <view class="fontColorF" style="font-size:28rpx;padding:10rpx 28rpx;">排名包含初始分和工龄分</view>
     <view class="main scroll">
       <scroll-view lower-threshold="100" class="scroll" scroll-y="{{true}}" a:if="{{list.length>0}}" onScrollToLower="onScrollToLower">
-        <view a:for="{{list}}" data-item="{{item}}" class="flex-box flex-v-ce item border-bottom">
+        <view a:for="{{list}}" data-item="{{item}}" class="flex-box flex-v-ce item border-bottom" catchTap="openDetail">
           <view a:if="{{item.rank==1}}" class="index">
             <image mode="scaleToFill" src="../../../image/1.png"></image>
           </view>
@@ -25,7 +25,10 @@
           <view a:else class="index">{{item.rank}}</view>
           <view class="flex-1 flex-box flex-v-ce">
             <img-box name="{{item.employee_name}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
-            <view class="name">{{item.employee_name}}</view>
+            <view>
+                <view class="name">{{item.employee_name}}</view>
+                <view class="name dept_name font-flex-word" style="width:400rpx; overflow: hidden;">{{item.deptName}}</view>
+            </view>
           </view>
           <view class="blue" style="margin-right:28rpx;">{{item.point}}</view>
         </view>

+ 39 - 34
pages/statistics/B_ranking/B_ranking.js

@@ -3,13 +3,12 @@ var app = getApp()
 var that;
 Page({
   data: {
-    showTissue:false,//显示部门组件
-    TissueVal:'全公司',
-    isPx:true,
-    page:1,
-    scroll_top:0,
+    showTissue: false,//显示部门组件
+    TissueVal: '全公司',
+    isPx: true,
+    page: 1,
+    scroll_top: 0,
     popupCx: '',
-    // pt_id: app.getTypesItem('BF').id,
   },
   onLoad() {
     that = this;
@@ -41,23 +40,36 @@ Page({
             url: '../../noJurisdiction/noJurisdiction'
           })
         }
-      },function(){})
+      }, function () { })
     }
   },
-  getData(is){
+  openDetail(e) {
+    let item = e.target.dataset.item
+    var data = {
+      pt_id: '3',
+      dept_id: that.data.dept_id,
+      item: item,
+      type: 2,
+    }
+    dd.navigateTo({
+      url: '../jfDetail/jfDetail?data=' + JSON.stringify(data)
+    })
+  },
+  getData(is) {
     var data = {
       page: that.data.page,
       page_size: 20,
-      dept_id:that.data.dept_id,
-      pt_id:3,
-      sort: that.data.isPx?'DESC':'ASC',
+      dept_id: that.data.dept_id,
+      pt_id: 3,
+      sort: that.data.isPx ? 'DESC' : 'ASC',
       type: 'all',
     }
-    app.$get('api/integral/statistics/ranking',data,'application/vnd.test.v2+json').then((res) => {
+    app.$get('api/integral/statistics/ranking', data, 'application/vnd.test.v2+json').then((res) => {
       var data = res.data.data.list;
+       data=app.returnDeptName(data);
       if (is) {
         if (data.length == 0) {
-          this.setData({isData: true})
+          this.setData({ isData: true })
           return;
         }
         var list = that.data.list;
@@ -65,7 +77,7 @@ Page({
           list: list.concat(data)
         })
       } else {
-        this.setData({list:[]});
+        this.setData({ list: [] });
         this.setData({
           list: data,
           isData: false,
@@ -73,42 +85,35 @@ Page({
       }
     })
   },
-    //上啦加载
+  //上啦加载
   onScrollToLower() {
-    if(!that.data.isData){
+    if (!that.data.isData) {
       this.setData({ page: ++that.data.page })
       this.getData(true);
     }
   },
-  selectIsPx(){
+  selectIsPx() {
     this.setData({
-      isPx:!this.data.isPx,
-      page:1
+      isPx: !this.data.isPx,
+      page: 1
     })
     this.getData();
   },
-  //打开兴趣
-  openDetail(e){
-   var item=e.target.dataset.item;
-    dd.navigateTo({
-      url: '../prizeBuckleDetail/prizeBuckleDetail?item='+item
-    })
-  },
-    //关闭弹窗
+  //关闭弹窗
   onClose() {
     this.setData({
-      showTissue:false,
-      popupCx: ''  
+      showTissue: false,
+      popupCx: ''
     })
   },
-    //显示部门选择组件
-  selectTissue(){
-    this.setData({showTissue:!this.data.showTissue,popupCx: 'container__mask',})
+  //显示部门选择组件
+  selectTissue() {
+    this.setData({ showTissue: !this.data.showTissue, popupCx: 'container__mask', })
   },
   //选择部门
   onConfirmTissue(data) {
-    if(data){
-      this.setData({ dept_id: data.id,page:1,TissueVal:data.name })
+    if (data) {
+      this.setData({ dept_id: data.id, page: 1, TissueVal: data.name })
     }
     this.getData();
   },

+ 11 - 9
pages/statistics/C_ranking/C_ranking.axml

@@ -3,18 +3,16 @@
     <view class="flex-1" catchTap="selectDate">
       <text class="{{showDate? 'activeView blue':''}}">{{selectDateVal}}</text>
     </view>
-    <!-- <view class="flex-1" catchTap="selectRule">
-      <text class="{{showRuleTwo? 'activeView blue':''}}">{{ruleVal}}</text>
-    </view> -->
+    <!--<view class="flex-1" catchTap="selectRule"><text class="{{showRuleTwo? 'activeView blue':''}}">{{ruleVal}}</text></view> -->
     <view class="flex-1" catchTap="selectIsPx">
-        <text a:if="{{isPx}}">从高到低</text>
-        <text a:else>从低到高</text>
+      <text a:if="{{isPx}}">从高到低</text>
+      <text a:else>从低到高</text>
     </view>
   </view>
   <view class="fontColorF" style="font-size:28rpx;padding:10rpx 28rpx;">排名不包含初始分和工龄分</view>
   <view class="main scroll">
     <scroll-view class="scroll" scroll-y="{{true}}" a:if="{{list.length>0}}" onScrollToLower="onScrollToLower">
-      <view a:for="{{list}}" a:key="{{item.id}}" data-item="{{item}}" class="flex-box flex-v-ce item border-bottom">
+      <view a:for="{{list}}" a:key="{{item.id}}" data-item="{{item}}" class="flex-box flex-v-ce item border-bottom"  catchTap="openDetail">
         <view a:if="{{item.rank==1}}" class="index">
           <image mode="scaleToFill" src="../../../image/1.png"></image>
         </view>
@@ -26,13 +24,17 @@
         </view>
         <view a:else class="index">{{item.rank}}</view>
         <view class="flex-1 flex-box flex-v-ce">
-          <img-box  name="{{item.name}}" a:if="{{item.id}}" imgUrl="{{item.img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
-          <view class="name">{{item.name}}</view>
+          <img-box name="{{item.name}}" a:if="{{item.id}}" imgUrl="{{item.img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+          <view>
+            <view class="name">{{item.name}}</view>
+            <view class="name dept_name font-flex-word" style="width:400rpx; overflow: hidden;">{{item.deptName}}</view>
+          </view>
         </view>
         <view class="blue" style="margin-right:28rpx;">{{item.point}}</view>
       </view>
     </scroll-view>
     <no-data a:if="{{list.length==0}}"></no-data>
   </view>
-   <select_date_two dateObj="{{dateObj}}" a:if="{{showDate==true}}" showSelectP="{{true}}"  isShow="{{showDate}}" onClose="onClose" onConfirm="onConfirmDate"></select_date_two>
+  <select_date_two dateObj="{{dateObj}}" a:if="{{showDate==true}}" showSelectP="{{true}}" isShow="{{showDate}}" onClose="onClose" 
+    onConfirm="onConfirmDate"></select_date_two>
 </view>

+ 45 - 9
pages/statistics/C_ranking/C_ranking.js

@@ -1,6 +1,7 @@
 
 var app = getApp()
 var that;
+import moment from 'moment' // 时间库
 Page({
   data: {
     month: app.globalData.month,
@@ -68,9 +69,47 @@ Page({
             url: '../../noJurisdiction/noJurisdiction'
           })
         }
-      },function(){})
+      }, function () { })
     }
   },
+  openDetail(e) {
+    let item = e.target.dataset.item
+    item = {
+      dept_list: item.dept_list,
+      employee_id: item.employee_id,
+      employee_img_url: item.img_url,
+      employee_name: item.name,
+      point: item.point,
+      deptName:item.deptName
+    }
+    var data = {
+      dept_id: that.data.dept_id,
+      item: item,
+      month: that.data.month,
+      type: 3,
+      items:that.data.items,
+      date_interval: this.data.parameter.date_interval
+    }
+    if (data.date_interval == '2') {
+      let date = { type: 2, year: that.data.month.slice(0, 4), season: that.data.month.slice(4) }
+      this.getDate((res) => {
+        data.start_day = moment(Number(res.data.start + '000')).format('YYYY-MM-DD')
+        data.end_day = moment(Number(res.data.end + '000')).format('YYYY-MM-DD')
+        dd.navigateTo({
+          url: '../jfDetail/jfDetail?data=' + JSON.stringify(data)
+        })
+      }, date)
+      return false
+    }
+    dd.navigateTo({
+      url: '../jfDetail/jfDetail?data=' + JSON.stringify(data)
+    })
+  },
+  getDate(func, date) {
+    app.$post('/api/timestamp', date).then(res => {
+      func(res.data)
+    });
+  },
   onShareAppMessage() {
     return {
       title: this.data.parameter.name,
@@ -149,7 +188,7 @@ Page({
     return quarter - 1
   },
   getData(is) {
-    if(that.data.page==1){
+    if (that.data.page == 1) {
       this.setData({
         list: []
       })
@@ -164,6 +203,10 @@ Page({
     }
     app.$get('api/integral/statistics/groups/rank', data).then((res) => {
       var data = res.data.data.list;
+      data=app.returnDeptName(data);
+      this.setData({
+          items: res.data.data.items
+      })
       if (is) {
         if (data.length == 0) {
           return;
@@ -197,13 +240,6 @@ Page({
     })
     this.getData();
   },
-  //打开详情
-  openDetail(e) {
-    var item = e.target.dataset.item;
-    dd.navigateTo({
-      url: '../prizeBuckleDetail/prizeBuckleDetail?item=' + item
-    })
-  },
   //关闭弹窗
   onClose() {
     this.setData({

+ 12 - 8
pages/statistics/allTask/allTask.axml

@@ -9,25 +9,27 @@
       <view class="flex-2" catchTap="selectStaff">
         <text class="{{showStaff? 'activeView blue':''}}">{{staffVal}}</text>
       </view>
-     <view catchTap="selectSx" class="flex-1 sxBorder" style="position: relative">
-        <image mode="scaleToFill" class="sxImg" src="../../../image/sx.png"/>
+      <view catchTap="selectSx" class="flex-1 sxBorder" style="position: relative">
+        <image mode="scaleToFill" class="sxImg" src="../../../image/sx.png" />
       </view>
     </view>
     <form onReset="onReset">
       <view style="margin-top:16rpx;">
         <view class="search flex-box flex-v-ce">
-          <image mode="scaleToFill" src="../../../image/ss.png"/>
-          <input class="flex-1" placeholder="请输入任务内容" onInput="bindKeyInput"/>
+          <image mode="scaleToFill" src="../../../image/ss.png" />
+          <input class="flex-1" placeholder="请输入任务内容" onInput="bindKeyInput" />
           <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
         </view>
       </view>
     </form>
   </view>
+  <view class="yellowText" a:if="{{config.event_review_status==1&&config.event_task_review==1}}">复核开启后,积分需管理员复核后才计入排名和统计</view>
   <view class="main scroll">
-    <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+    <scroll-view class="scroll" style="{{(config.event_review_status==1&&config.event_task_review==1)?'height: calc(100vh - 2.5rem)':''}}" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
       <view class="li border-bottom" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" key="{{item.id}}">
         <view class="flex-box li-top">
-          <img-box name="{{item.employee_name}}" a:key="{{index}}" id="{{item.employee_id}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+          <img-box name="{{item.employee_name}}" a:key="{{index}}" id="{{item.employee_id}}" height="80rpx" width="80rpx" 
+            fSize="24rpx"></img-box>
           <view class="flex-1" style="padding-left:16rpx;">
             <view class="flex-box-ce" style="padding-top:16rpx;">
               <text class="flex-1">{{item.employee_name}}</text>
@@ -38,7 +40,8 @@
             <view class="flex-box li-bottom">
               <text class="flex-1 fontColorX">{{item.expire_time}} 截止</text>
               <button type="primary" class="defBtn" catchTap="openDetail" data-item="{{item}}">查看任务</button>
-              <button a:if="{{minuteIndex==1||minuteIndex==2}}" type="primary" class="defBtn" catchTap="openDetail2" data-item="{{item}}" style="margin-left:20rpx;">查看审批</button>
+              <button a:if="{{minuteIndex==1||minuteIndex==2}}" type="primary" class="defBtn" catchTap="openDetail2" data-item="{{item}}" 
+                style="margin-left:20rpx;">查看审批</button>
             </view>
           </view>
         </view>
@@ -47,6 +50,7 @@
     </scroll-view>
     <no-data a:if="{{list.length==0}}"></no-data>
   </view>
-  <select-staff defaultUser="{{employee_ids}}" isAllSelect="{{false}}" isShow="{{showStaff}}" a:if="{{showStaff==true}}" onClose="onClose" onConfirm="onConfirmStaff"></select-staff>
+  <select-staff defaultUser="{{employee_ids}}" isAllSelect="{{false}}" isShow="{{showStaff}}" a:if="{{showStaff==true}}" 
+    onClose="onClose" onConfirm="onConfirmStaff"></select-staff>
   <select-zp defaultSx="{{sxObj}}" typeIndex="2" a:if="{{showZp==true}}" isShow="{{showZp}}" onClose="onClose" onConfirm="onConfirmSx"></select-zp>
 </view>

+ 3 - 0
pages/statistics/allTask/allTask.js

@@ -29,6 +29,9 @@ Page({
   },
   onLoad(e) {
     that = this;
+    this.setData({
+      config: app.globalData.config
+    })
     dd.setNavigationBar({ title: "全部任务" });
   },
   onShow() {

+ 1 - 1
pages/statistics/assaign/assaign.axml

@@ -108,7 +108,7 @@
         <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
       </view>
       <view class="li">
-        <textarea maxlength="100" value="{{items.task_remark}}" onInput="bindTextAreaBlur2" placeholder="请输入任务描述" data-index="{{index}}"></textarea>
+        <textarea maxlength="300" value="{{items.task_remark}}" onInput="bindTextAreaBlur2" placeholder="请输入任务描述" data-index="{{index}}"></textarea>
       </view>
       <view class="flex-box flex-v-ce li">
         <view class="label">重复周期</view>

+ 3 - 1
pages/statistics/check_top/check_top.axml

@@ -32,7 +32,9 @@
           <img-box name="{{item.name}}" key="{{item.id}}" imgUrl="{{item.img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
           <view class="users">
             <view class="name">{{item.name}}</view>
-            <view class="num">{{item.dept_name}}</view>
+            <view class="name flex-box dept_name">
+                 <text class="" a:for="{{item.dept_list}}" a:for-index="idx" a:for-item="e">{{e.dept_name}}</text>
+            </view>
           </view>
         </view>
         <view class="blue" style="margin-right:28rpx;">{{item.point}}分</view>

+ 75 - 1
pages/statistics/glz_execute/glz_execute.acss

@@ -2,6 +2,19 @@
     position: sticky;
     top: 0;
 }
+.staff-all {
+    background: rgba(245, 247, 250, 1);
+    padding: 0.16rem 0.32rem 0 0;
+    font-size: 0.28rem;
+    color: #909399;
+}
+.rule-all-text{
+  font-size: 28rpx;
+  color: #999;
+  position: relative;
+  right: 10rpx;
+  /* bottom: 5rpx; */
+}
 .titles{
   font-size: 24rpx;
   color: #909399;
@@ -23,7 +36,7 @@
 .users{
   margin-left: 20rpx;
 }
-.num{
+.num2{
   font-size: 28rpx;
   color: #909399;
 }
@@ -44,3 +57,64 @@
   line-height: 26rpx;
   box-sizing: border-box;
 }
+.selectItems{
+    padding-top: 20rpx;
+    background-color: #fff;
+}
+.selectItems .selectImg{
+    border-left: 1px solid #f1f1f1;
+    padding: 0 20rpx;
+}
+.selectImg image{
+    width: 30rpx;
+    height: 30rpx;
+}
+.selectItems .flex-1{
+    padding: 20rpx 0;
+    text-align: center;
+    position: relative;
+}
+.headed-box{
+  padding:28rpx 28rpx;
+  color: #303133;
+  background-color: #fff;
+}
+.target_items {
+    text-align: center;
+    padding-top: 0.28rem;
+}
+.selectItems .active::before{
+  position: absolute;
+  content: " ";
+  height: 4rpx;
+  width: 100rpx;
+  background: #26A2FF;
+  bottom: 0rpx; 
+  left: 50%;
+  margin-left: -50rpx;
+}
+.name{
+  margin: 0 10rpx;
+}
+.index{
+  border-radius: 6rpx;
+  background: #67C23A;
+  color: #fff;
+  font-size: 28rpx;
+  padding: 0 6rpx;
+}
+.num{
+  color:rgb(38, 162, 255);
+  font-weight:600;
+  margin-bottom:10rpx;
+  font-size:44rpx;
+}
+.jiangfen{
+  color: #303133;
+  position: relative;
+  font-size: 32rpx;
+}
+.target{
+  color: #909399;
+  font-size: 24rpx;
+}

+ 69 - 22
pages/statistics/glz_execute/glz_execute.axml

@@ -1,5 +1,9 @@
 <view>
   <view class="{{popupCx}}">
+    <view class="flex-box flex-v-ce selectItems border-bottom">
+      <view data-index="1" class="{{dataIndex == 1? 'active':''}} flex-1" catchTap="activeItem">奖扣完成情况</view>
+      <view data-index="2" class="{{dataIndex == 2? 'active':''}} flex-1" catchTap="activeItem">奖扣执行对比</view>
+    </view>
     <view class="flex-box flex-v-ce tab">
       <view class="flex-1" onTap="openDate">
         <text class="{{showDate? 'activeView':''}}">{{month}}</text>
@@ -7,37 +11,80 @@
       <view class="flex-1" onTap="selectTissue">
         <text class="{{showTissue? 'activeView':''}}" a:if="{{tissueValName}}">{{tissueValName}}</text>
       </view>
-      <view class="flex-1">
+      <view class="flex-1" a:if="{{dataIndex==2}}">
         <picker onChange="bindPickerChange" value="{{activeIndex}}" range="{{array}}" range-key="name">
           <text class="picker">{{array[activeIndex].name}}</text>
         </picker>
       </view>
     </view>
-
-
-    <view class="flex-box flex-v-ce titles">
-      <view class="flex-2" style="font-size:28rpx">管理者
-      <text class="text2" catchTap="showText">?</text></view>
-      <view class="flex-1">人均奖分(次)</view>
-      <view class="flex-1">人均扣分(次)</view>
-    </view>
-    <view class="main scroll">
-      <scroll-view scroll-y="{{true}}" class="scroll" a:if="{{list.length>0}}" onScrollToLower="onScrollToLower">
-        <view catchTap="openDetail" data-item={{item}} class="flex-box flex-v-ce item border-bottom" a:for="{{list}}">
-          <view class="flex-2 flex-box flex-v-ce">
-            <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
-            <view class="users">
-              <view class="name">{{item.name}}</view>
-              <view class="num">管理{{item.scope_count}}人</view>
+    <block a:if="{{dataIndex == 2}}">
+      <view class="flex-box flex-v-ce titles">
+        <view class="flex-2" style="font-size:28rpx">管理者
+          <text class="text2" catchTap="showText">?</text></view>
+        <view class="flex-1">人均奖分(次)</view>
+        <view class="flex-1">人均扣分(次)</view>
+      </view>
+      <view class="main">
+        <scroll-view scroll-y="{{true}}" style="height: calc(100vh - 2.7rem);" a:if="{{list.length>0}}" onScrollToLower="onScrollToLower">
+          <view catchTap="openDetail" data-item="{{item}}" class="flex-box flex-v-ce item border-bottom" a:for="{{list}}">
+            <view class="flex-2 flex-box flex-v-ce">
+              <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+              <view class="users">
+                <view class="name">{{item.name}}</view>
+                <view class="num2">管理{{item.scope_count}}人</view>
+              </view>
+            </view>
+            <view class="flex-1">{{item.reward_count}}</view>
+            <view class="flex-1">{{item.deduct_count}}</view>
+          </view>
+          <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
+        </scroll-view>
+        <no-data a:if="{{list.length==0}}" content="暂无数据"></no-data>
+      </view>
+    </block>
+    <block a:else>
+      <view class="flex-box flex-v-ce staff-all">
+        <view class="flex-1"></view>
+        <label class="flex-box-ce">
+          <text class="rule-all-text">只看全部达标</text>
+          <checkbox onChange="ruleActiveAll" checked="{{isAllChecked}}"></checkbox>
+        </label>
+      </view>
+      <scroll-view scroll-y="{{true}}" style="height: calc(100vh - 2.5rem);" a:if="{{listTwo.length>0}}" onScrollToLower="onScrollToLower2">
+        <view class="headed-box margin-top" a:for="{{listTwo}}" catchTap="openDetail" data-item="{{item}}">
+          <view class="flex-box flex-v-ce">
+            <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="70rpx" width="70rpx" fSize="24rpx"></img-box>
+            <view class="name">{{item.name}}</view>
+            <text class="index" a:if="{{item.status==1}}">全部达标</text>
+          </view>
+          <view class="flex-box flex-v-ce target_items">
+            <view class="flex-1">
+              <view class="num">{{item.reward.point}}</view>
+              <view class="jiangfen">奖分</view>
+              <view class="target">目标{{item.reward.target}}</view>
+            </view>
+            <view class="flex-1">
+              <view class="num">{{item.deduction.point}}</view>
+              <view class="jiangfen">扣分</view>
+              <view class="target">目标{{item.deduction.target}}</view>
+            </view>
+            <view class="flex-1">
+              <view class="num" a:if="{{item.ratio.enable==1}}">{{item.ratio.reward_ratio }}:1</view>
+              <view class="num" a:else>-</view>
+              <view class="jiangfen">奖扣比例</view>
+              <view class="target">目标{{item.ratio.target}}</view>
+            </view>
+            <view class="flex-1">
+              <view class="num">{{item.exec.count}}</view>
+              <view class="jiangfen">奖扣人次</view>
+              <view class="target">目标{{item.exec.target}}</view>
             </view>
           </view>
-          <view class="flex-1">{{item.reward_count}}</view>
-          <view class="flex-1">{{item.deduct_count}}</view>
         </view>
-        <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
+        <view class="noDatas" a:if="{{isData2}}">没有更多咯</view>
       </scroll-view>
-      <no-data a:if="{{list.length==0}}" content="未找到考勤组"></no-data>
-    </view>
+      <no-data a:if="{{listTwo.length==0}}" content="暂无数据"></no-data>
+    </block>
   </view>
   <select-section defaultSection="{{tissueVal}}" isShow="{{showTissue}}" a:if="{{showTissue==true}}" onClose="onClose" onConfirm="onConfirmTissue"></select-section>
 </view>

+ 62 - 6
pages/statistics/glz_execute/glz_execute.js

@@ -8,13 +8,19 @@ Page({
     array: [{ name: '奖分次数最多', value: 1 }, { name: '扣分次数最多', value: 0 }],
     showTissue: false,
     page: 1,
+    page2:1,
     tissueValName: '全公司',
-    popupCx: '',  
+    popupCx: '',
+    dataIndex:1,
+    listTwo:[],
+    list:[],
+    isAllChecked:false,  
   },
   onLoad() {
     that = this;
     dd.setNavigationBar({ title: "管理者奖扣执行情况" });
-    this.getData();
+    // this.getData();
+    this.getData2();
   },
   showText() {
     dd.alert({
@@ -26,6 +32,18 @@ Page({
         },
       });
   },
+  ruleActiveAll(e) {
+    this.setData({
+      isAllChecked: e.detail.value,
+      page2:1,
+    })
+    this.getData2();
+  },
+  activeItem(e) {
+    var index = e.target.dataset.index;
+    this.setData({ dataIndex: index,page2: 1, page: 1, list: [],listTwo:[] })
+    index==1? this.getData2():this.getData()
+  },
   sotrs(str) {
     return function (a, b) {
       var val = a[str];
@@ -33,6 +51,37 @@ Page({
       return val2 - val
     }
   },
+  getData2(is) {
+    var data;
+    data = {
+      page: that.data.page2,
+      page_size: 20,
+      month: that.data.month,
+      dept_id: that.data.tissueVal,
+      complete:that.data.isAllChecked? 1:'',
+    }
+    app.$get('api/integral/statistics/prize/list', data,'application/vnd.test.v4+json').then((res) => {
+      var data = res.data.data.list || [];
+      if (is) {
+        if (data.length == 0) {
+          this.setData({
+            isData2: true
+          })
+          return;
+        }
+        var listTwo = that.data.listTwo;
+        this.setData({
+          listTwo: listTwo.concat(data)
+        })
+      } else {
+        this.setData({ listTwo: [] });
+        this.setData({
+          listTwo: data,
+          isData2: false
+        })
+      }
+    })
+  },
   getData(is) {
     var data;
     data = {
@@ -75,6 +124,12 @@ Page({
       this.getData(true);
     }
   },
+  onScrollToLower2() {
+    if (!that.data.isData2) {
+      this.setData({ page2: ++that.data.page2 })
+      this.getData2(true);
+    }
+  },
   openDetail(e) {
     var item = e.target.dataset.item;
     dd.navigateTo({
@@ -108,9 +163,10 @@ Page({
         if (res.date) {
           this.setData({
             month: res.date,
-            page: 1
+            page: 1,
+            page2: 1
           })
-          that.getData();
+          that.data.dataIndex==1? that.getData2():that.getData()
         }
       },
       complete: (res) => {
@@ -132,7 +188,7 @@ Page({
   },
   //选择部门
   onConfirmTissue(data) {
-    this.setData({ tissueValName: data.name, tissueVal: data.id, page: 1 });
-    this.getData();
+    this.setData({ tissueValName: data.name, tissueVal: data.id, page: 1,page2: 1 });
+    this.data.dataIndex==1? this.getData2():this.getData()
   },
 });

+ 1 - 1
pages/statistics/index/index.axml

@@ -11,7 +11,7 @@
         <view a:for="{{itemName.child}}" class="menu-item" data-url="{{item.url}}" onTap="openUrl">
           <image mode="scaleToFill" src="{{item.imgUrl}}"/>
           <view>{{item.name}}</view>
-          <text class="menuNum font-flex-word" a:if="{{item.name=='审批'&&total}}">{{total}}</text>
+          <text class="menuNum font-flex-word" a:if="{{item.new}}">new</text>
         </view>
       </view>
     </view>

+ 2 - 1
pages/statistics/index/index.js

@@ -30,10 +30,11 @@ Page({
       },
       {
         code: '统计分析', child: [
-          { name: '排行榜', imgUrl: '../../../image/att_statistics.png', url: '../userRamking/userRamking', code: 'creator admin ' },
+          { name: '排行榜', imgUrl: '../../../image/integral_rank.png', url: '../userRamking/userRamking', code: 'creator admin ' },
           { name: '考勤分', imgUrl: '../../../image/att_sign.png', url: '../check_top/check_top', code: 'creator admin employee' },
           { name: '日志分', imgUrl: '../../../image/log1.png', url: '../log_rank/log_rank', code: 'creator admin employee' },
           { name: '任务分', imgUrl: '../../../image/log2.png', url: '../task_rank/task_rank', code: 'creator admin employee' },
+          { name: '任务统计', imgUrl: '../../../image/att_statistics.png', url: '../taskStatistical/taskStatistical', code: 'creator admin employee',new:true },
           { name: '积分事件', imgUrl: '../../../image/event_list_a.png', url: '../integralEvent/integralEvent', code: 'creator admin employee' },
           { name: '积分周报', imgUrl: '../../../image/length_point.png', url: '../../reportBox/report/report', code: 'admin' },
         ]

+ 11 - 1
pages/statistics/integralEvent/integralEvent.acss

@@ -47,5 +47,15 @@
   height: 40rpx;
 }
 .scroll {
-   height: calc(100vh - 100rpx);
+   height: calc(100vh - 210rpx);
+}
+.search {
+    background-color: #f1f1f1;
+    border-radius: 0.1rem;
+    width: 90%;
+    margin: 0 auto;
+    padding: 0.06rem 0.1rem;
+}
+.header{
+  background-color: #fff;
 }

+ 28 - 16
pages/statistics/integralEvent/integralEvent.axml

@@ -1,26 +1,38 @@
 <view>
   <view class="{{popupCx}}">
-    <view class="flex-box flex-v-ce tab margin-bottom">
-      <view class="flex-1" catchTap="selectDate">
-        <text class="{{showDate? 'activeView blue':''}}">{{selectDateVal}}</text>
-      </view>
-      <view class="flex-1" catchTap="selectStaff">
-        <text class="{{showStaff? 'activeView blue':''}}">{{staffVal}}</text>
-      </view>
-      <view class="flex-1" catchTap="selectRule">
-        <text class="{{showRuleTwo? 'activeView blue':''}}">{{ruleVal}}</text>
-      </view>
-      <view class="flex-1">
-        <picker onChange="bingIntegralType" value="{{typesIndex}}" range="{{types}}" range-key="name">
-          <text a:if="{{types[typesIndex].name=='全部'}}">积分类型</text>
-          <text a:else>{{types[typesIndex].name}}</text>
-        </picker>
+    <view class="header margin-bottom">
+      <view class="flex-box flex-v-ce tab" style="border-bottom:1px solid #f1f1f1">
+        <view class="flex-1" catchTap="selectDate">
+          <text class="{{showDate? 'activeView blue':''}}">{{selectDateVal}}</text>
+        </view>
+        <view class="flex-1" catchTap="selectStaff">
+          <text class="{{showStaff? 'activeView blue':''}}">{{staffVal}}</text>
+        </view>
+        <view class="flex-1" catchTap="selectRule">
+          <text class="{{showRuleTwo? 'activeView blue':''}}">{{ruleVal}}</text>
+        </view>
+        <view class="flex-1">
+          <picker onChange="bingIntegralType" value="{{typesIndex}}" range="{{types}}" range-key="name">
+            <text a:if="{{types[typesIndex].name=='全部'}}">积分类型</text>
+            <text a:else>{{types[typesIndex].name}}</text>
+          </picker>
+        </view>
       </view>
+      <form onReset="onReset">
+        <view style="margin:16rpx 0;padding-bottom:16rpx">
+          <view class="search flex-box flex-v-ce">
+            <image mode="scaleToFill" src="../../../image/ss.png" />
+            <input class="flex-1" placeholder="请输入任务内容" onInput="bindKeyInput" />
+            <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
+          </view>
+        </view>
+      </form>
     </view>
     <view class="main scroll">
       <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
         <view class="flex-box li border-bottom" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" key="{{item.id}}">
-          <img-box name="{{item.employee_name}}" key="{{item.id}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+          <img-box name="{{item.employee_name}}" key="{{item.id}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" 
+            fSize="24rpx"></img-box>
           <view class="flex-1 main-right">
             <view class="flex-box flex-v-ce">
               <view class="name flex-1">{{item.employee_name}}</view>

+ 44 - 25
pages/statistics/integralEvent/integralEvent.js

@@ -25,8 +25,8 @@ Page({
     ruleVal: "规则分类",
 
     page: 1,
-    popupCx: '',  
-    rule_item_id:'',//细则ID
+    popupCx: '',
+    rule_item_id: '',//细则ID
   },
   onLoad(e) {
     that = this;
@@ -35,27 +35,27 @@ Page({
     var arr = typeArr.concat(app.globalData.types);
     arr = app.globalData.arrRemoveObj(arr, arr[1]);
     dd.setNavigationBar({ title: "积分事件" });
-    if (e.month||e.employee_ids) {
+    if (e.month || e.employee_ids) {
       var typesIndex = "0";
       if (e.type) {
-        if(arr){
-            arr.map((item, index) => {
-              if (item.code == e.type) {
-                typesIndex = index
-              }
-            })
+        if (arr) {
+          arr.map((item, index) => {
+            if (item.code == e.type) {
+              typesIndex = index
+            }
+          })
         }
       }
       this.setData({
-        date: e.month? e.month:app.globalData.month,
+        date: e.month ? e.month : app.globalData.month,
         typesIndex: typesIndex,
-        employee_ids:e.employee_ids ? e.employee_ids:[userData.id],
-        staffVal:e.userName ? e.userName:userData.name,
+        employee_ids: e.employee_ids ? e.employee_ids : [userData.id],
+        staffVal: e.userName ? e.userName : userData.name,
         selectDateVal: e.month == app.globalData.month ? '本月' : '月',
         defaultDate: { type: '1', date: e.month },
       })
     }
-    if(e.rule_item_id){//周报进来
+    if (e.rule_item_id) {//周报进来
       this.setData({
         rule_item_id: e.rule_item_id,
       })
@@ -88,16 +88,35 @@ Page({
             url: '../../noJurisdiction/noJurisdiction'
           })
         }
-      },function(){})
+      }, function () { })
     }
   },
+  onReset() {
+    this.setData({
+      page: 1,
+      isVal: false,
+      keyword: ''
+    })
+    this.getData();
+  },
+  bindKeyInput(e) {
+    this.setData({
+      page: 1,
+      isVal: e.detail.value ? true : false,
+      keyword: e.detail.value ? e.detail.value : '',
+    })
+    this.getData();
+  },
   getData(is) {
     var data = {
       page: that.data.page,
       page_size: 20,
       rule_id: that.data.rule_id,
       pt_id: that.data.types.length > 0 ? that.data.types[that.data.typesIndex].id : '2',
-      employee_ids: that.data.employee_ids
+      employee_ids: that.data.employee_ids,
+      keyword:that.data.keyword,
+      dc_status: JSON.stringify([1]),
+      order_key:'update_time'
     }
     if (that.data.date_type == 2) {
       data.start_day = that.data.dateObj[0];
@@ -105,8 +124,8 @@ Page({
     } else {
       data.month = that.data.dateObj || that.data.date;
     }
-    if(that.data.rule_item_id){//周报进来的细则ID
-      data.item_id=that.data.rule_item_id
+    if (that.data.rule_item_id) {//周报进来的细则ID
+      data.item_id = that.data.rule_item_id
     }
     app.$get('api/integral/statistics/integral', data).then((res) => {
       var data = res.data.data.list;
@@ -176,7 +195,7 @@ Page({
       date_type: data.type == 1 ? 3 : data.type,
       page: 1,
       selectDateVal: data.type == 1 ? (data.date == that.data.date ? '本月' : '月') : '日',
-      rule_item_id:''
+      rule_item_id: ''
     })
     this.getData();
   },
@@ -187,7 +206,7 @@ Page({
       showStaff: false,
       showRuleTwo: false,
       popupCx: '',
-      rule_item_id:''
+      rule_item_id: ''
     })
   },
   //选择积分分类
@@ -195,14 +214,14 @@ Page({
     this.setData({
       typesIndex: e.detail.value,
       page: 1,
-      rule_item_id:''
+      rule_item_id: ''
     });
     this.getData();
   },
   //选择员工
   onConfirmStaff(data) {
     if (!data) {
-      this.setData({ staffVal: '员工', employee_ids: '', page: 1,rule_item_id:'' })
+      this.setData({ staffVal: '员工', employee_ids: '', page: 1, rule_item_id: '' })
       this.getData();
       return false;
     }
@@ -215,12 +234,12 @@ Page({
           arr.push(item.id);
         })
         var employee_ids = arr.join(',');
-        this.setData({ staffVal: str.substring(0, str.length - 1), employee_ids: employee_ids, page: 1,rule_item_id:'' })
+        this.setData({ staffVal: str.substring(0, str.length - 1), employee_ids: employee_ids, page: 1, rule_item_id: '' })
       } else {
-        this.setData({ staffVal: data[0].name, employee_ids: [data[0].id], page: 1,rule_item_id:'' })
+        this.setData({ staffVal: data[0].name, employee_ids: [data[0].id], page: 1, rule_item_id: '' })
       }
     } else {
-      this.setData({ staffVal: '员工', employee_ids: [], page: 1,rule_item_id:'' })
+      this.setData({ staffVal: '员工', employee_ids: [], page: 1, rule_item_id: '' })
     }
     this.getData();
   },
@@ -230,7 +249,7 @@ Page({
       rule_id: e.id ? e.id : '',
       page: 1,
       ruleVal: e.name,
-      rule_item_id:''
+      rule_item_id: ''
     })
     this.getData();
   },

+ 51 - 0
pages/statistics/integralEventTwo/integralEventTwo.acss

@@ -0,0 +1,51 @@
+
+.main{
+    background: #fff;
+}
+.li{
+   padding: 24rpx 32rpx; 
+}
+.main-right{
+  margin-left: 10rpx;
+}
+.main-right .name{
+  padding-top:12rpx;
+  font-size: 36rpx;
+}
+.main-right .context{
+    overflow : hidden;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-line-clamp: 2;
+    -webkit-box-orient: vertical;
+    padding-top: 10rpx;
+    margin-bottom: 10rpx;
+}
+.main-right .date{
+   color: #909399;
+   
+}
+.item{
+  padding: 10rpx 0;
+}
+.item .flex-2{
+    padding-left: 28rpx; 
+}
+.users{
+  margin-left: 20rpx;
+}
+.num{
+  font-size: 28rpx;
+  color: #909399;
+}
+.index{
+  width: 90rpx;
+  text-align: center;
+}
+.index image{
+  width: 40rpx;
+  height: 40rpx;
+}
+.scroll {
+   height: calc(100vh - 160rpx);
+}

+ 40 - 0
pages/statistics/integralEventTwo/integralEventTwo.axml

@@ -0,0 +1,40 @@
+<view>
+  <view class="{{popupCx}}">
+    <view class="flex-box flex-v-ce tab margin-bottom">
+      <view class="flex-1" catchTap="selectStaff">
+        <text class="{{showStaff? 'activeView blue':''}}">{{staffVal}}</text>
+      </view>
+      <view class="flex-1">
+        <picker onChange="bingIntegralType" value="{{typesIndex}}" range="{{types}}" range-key="name">
+          <text a:if="{{types[typesIndex].name=='全部'}}">事件来源</text>
+          <text a:else>{{types[typesIndex].name}}</text>
+        </picker>
+      </view>
+    </view>
+    <view style="font-size: 0.24rem; padding: 0 0.2rem 0.1rem; color: #888;" a:if="{{str}}">当前权限:{{str}}</view>
+    <view class="main scroll">
+      <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+        <view class="flex-box li border-bottom" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" key="{{item.id}}">
+          <img-box name="{{item.employee_name}}" key="{{item.id}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" 
+            fSize="24rpx"></img-box>
+          <view class="flex-1 main-right">
+            <view class="flex-box flex-v-ce">
+              <view class="name flex-1">{{item.employee_name}}</view>
+              <view class="red da" a:if="{{item.point>0}}">+{{item.point}}{{item.ptObj.name}}</view>
+              <view class="green da" a:else>{{item.point}}{{item.ptObj.name}}</view>
+            </view>
+            <view class="context" a:if="{{item.remark}}">{{item.remark}}</view>
+            <view class="flex-box flex-v-ce">
+              <view class="date flex-1">{{item.event_time}}</view>
+            </view>
+          </view>
+        </view>
+        <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
+      </scroll-view>
+      <no-data a:if="{{list.length==0}}"></no-data>
+    </view>
+  </view>
+  <select-staff defaultUser="{{employee_ids}}" isShow="{{showStaff}}" a:if="{{showStaff==true}}" onClose="onClose" onConfirm="onConfirmStaff"></select-staff>
+  <select-date defaultDate="{{defaultDate}}" isShow="{{showDate}}" a:if="{{showDate==true}}" onClose="onClose" onConfirm="onConfirmDate"></select-date>
+  <select-rule-two defaultSection="{{rule_id}}" isShow="{{showRuleTwo}}" a:if="{{showRuleTwo==true}}" onClose="onClose" onConfirm="onConfirmRule"></select-rule-two>
+</view>

+ 193 - 0
pages/statistics/integralEventTwo/integralEventTwo.js

@@ -0,0 +1,193 @@
+
+var app = getApp()
+var that;
+var typeArr = [];
+Page({
+  data: {
+    date: app.globalData.month,
+    typesIndex: 0,//条件选择
+    types: [
+      { id: 0, name: '全部' },
+      { id: 1, name: '积分奖扣' },
+      { id: 2, name: '任务' },
+      { id: 3, name: '积分系统分配' },
+      { id: 4, name: '考勤系统分配' },
+      { id: 5, name: '积分申请' },
+      { id: 8, name: '积分导入' },
+      { id: 9, name: 'A分转B分' },
+      { id: 10, name: '钉钉汇报(日志)奖扣分' }
+    ],
+
+    showStaff: false,//显示员工选择
+    staffVal: '员工',
+    page: 1,
+    popupCx: '',
+
+  },
+  onLoad(e) {
+    that = this;
+    typeArr = [{ id: 0, name: '全部' }];
+    dd.setNavigationBar({ title: "积分事件" });
+    if (e.month && e.id) {
+      this.setData({
+        date: e.month ? e.month : app.globalData.month,
+        recorder_id: e.id
+      })
+    }
+    this.getDataAccess();
+  },
+  onShow() {
+    if (that.data.page == 1) {
+      that.getData();
+    }
+  },
+  getData(is) {
+    var data = {
+      page: that.data.page,
+      page_size: 20,
+      month: that.data.dateObj || that.data.date,
+      recorder_id: that.data.recorder_id,
+      employee_ids: that.data.employee_ids,
+      pt_id:3,
+      dc_status:JSON.stringify([1]),
+      order_key:'update_time'
+    }
+    if (that.data.typesIndex != 0) {
+      data.source_type = that.data.types.length > 0 ? that.data.types[that.data.typesIndex].id : ''
+    }
+    app.$get('api/integral/statistics/integral', data).then((res) => {
+      var data = res.data.data.list;
+      data.map((item) => {
+        item.ptObj = app.getTypesItem(item.pt_id);
+      })
+      if (is) {
+        if (data.length == 0) {
+          this.setData({
+            isData: true
+          })
+          return;
+        }
+        var list = that.data.list;
+        this.setData({
+          list: list.concat(data)
+        })
+      } else {
+        this.setData({ list: [] });
+        this.setData({
+          list: data,
+          isData: false
+        })
+      }
+    })
+  },
+  // 获取数据范围权限
+  getDataAccess() {
+    app.$get('/api/integral/statistics/range_level').then(res => {
+      let resData = res.data.data;
+      if (resData == 1) {
+        this.setData({ str: '仅查看自己的数据' })
+      } else if (resData == 2) {
+        this.setData({ str: '查看自己以及管理范围内用户的数据' })
+      } else {
+        this.setData({ str: '查看全员数据' })
+      }
+    })
+  },
+  //上啦加载
+  onScrollToLower() {
+    if (!that.data.isData) {
+      this.setData({ page: ++that.data.page })
+      this.getData(true);
+    }
+  },
+  //打开兴趣
+  openDetail(e) {
+    var item = e.target.dataset.item;
+    dd.navigateTo({
+      url: '../prizeBuckleDetail/prizeBuckleDetail?id=' + item.id
+    })
+  },
+  //显示规则组件
+  selectRule() {
+    this.setData({
+      popupCx: 'container__mask',
+      showRuleTwo: true
+    })
+  },
+  //显示选择时间组件
+  selectDate() {
+    this.setData({
+      popupCx: 'container__mask',
+      showDate: true
+    })
+  },
+  //显示选择员工
+  selectStaff() {
+    this.setData({
+      popupCx: 'container__mask',
+      showStaff: true
+    })
+  },
+  //选择时间
+  onConfirmDate(data) {
+    that.setData({
+      defaultDate: data,
+      dateObj: data.date,
+      date_type: data.type == 1 ? 3 : data.type,
+      page: 1,
+      selectDateVal: data.type == 1 ? (data.date == that.data.date ? '本月' : '月') : '日',
+    })
+    this.getData();
+  },
+  //关闭弹窗
+  onClose() {
+    this.setData({
+      showDate: false,
+      showStaff: false,
+      showRuleTwo: false,
+      popupCx: '',
+    })
+  },
+  //选择事件来源
+  bingIntegralType(e) {
+    this.setData({
+      typesIndex: e.detail.value,
+      page: 1,
+    });
+    this.getData();
+  },
+  //选择员工
+  onConfirmStaff(data) {
+    if (!data) {
+      this.setData({ staffVal: '员工', employee_ids: '', page: 1 })
+      this.getData();
+      return false;
+    }
+    if (data.length > 0) {
+      if (data.length > 1) {
+        var str = "";
+        var arr = [];
+        data.forEach((item) => {
+          str += item.name + ','
+          arr.push(item.id);
+        })
+        var employee_ids = arr.join(',');
+        this.setData({ staffVal: str.substring(0, str.length - 1), employee_ids: employee_ids, page: 1, })
+      } else {
+        this.setData({ staffVal: data[0].name, employee_ids: [data[0].id], page: 1, })
+      }
+    } else {
+      this.setData({ staffVal: '员工', employee_ids: [], page: 1, })
+    }
+    this.getData();
+  },
+  //选择规则
+  onConfirmRule(e) {
+    this.setData({
+      rule_id: e.id ? e.id : '',
+      page: 1,
+      ruleVal: e.name,
+    })
+    this.getData();
+  },
+});

+ 9 - 0
pages/statistics/integralEventTwo/integralEventTwo.json

@@ -0,0 +1,9 @@
+{
+  "usingComponents": {
+    "img-box": "/Component/img-box/index",
+    "select-date": "/Component/selectDate/selectDate",
+    "select-staff": "/Component/selectStaff/selectStaff",
+    "select-rule-two": "/Component/selectRule_two/selectRule_two",
+    "no-data": "/Component/noData/noData"
+  }
+}

+ 89 - 0
pages/statistics/jfDetail/jfDetail.acss

@@ -0,0 +1,89 @@
+
+.main{
+  background: #fff;
+}
+.item{
+  padding: 16rpx 0;
+}
+.item .flex-2{
+    padding-left: 28rpx; 
+}
+.users{
+  margin-left: 20rpx;
+}
+.num{
+  font-size: 24rpx;
+  color: #909399;
+}
+.index{
+  width: 90rpx;
+  text-align: center;
+}
+.index image{
+  width: 40rpx;
+  height: 40rpx;
+}
+.name2{
+  margin-left: 20rpx;
+}
+
+.main{
+    background: #fff;
+}
+.li{
+   padding: 24rpx 32rpx; 
+}
+.main-right{
+  margin-left: 10rpx;
+}
+.main-right .name{
+  padding-top:12rpx;
+  font-size: 36rpx;
+}
+.main-right .context{
+    overflow : hidden;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-line-clamp: 2;
+    -webkit-box-orient: vertical;
+    padding-top: 10rpx;
+    margin-bottom: 10rpx;
+}
+.main-right .date{
+   color: #909399;
+   
+}
+.item{
+  padding: 10rpx 0;
+}
+.item .flex-2{
+    padding-left: 28rpx; 
+}
+.users{
+  margin-left: 20rpx;
+}
+.num{
+  font-size: 28rpx;
+  color: #909399;
+}
+.index{
+  width: 90rpx;
+  text-align: center;
+}
+.index image{
+  width: 40rpx;
+  height: 40rpx;
+}
+.scroll {
+   height: calc(100vh - 280rpx);
+}
+.search {
+    background-color: #f1f1f1;
+    border-radius: 0.1rem;
+    width: 90%;
+    margin: 0 auto;
+    padding: 0.06rem 0.1rem;
+}
+.header{
+  background-color: #fff;
+}

+ 42 - 0
pages/statistics/jfDetail/jfDetail.axml

@@ -0,0 +1,42 @@
+<view>
+  <view>
+    <view class="flex-box-ce" style="padding:0.24rem;background:#fff">
+      <img-box name="{{userInfo.employee_name}}" imgUrl="{{userInfo.employee_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+      <view class="flex-1">
+          <view class="name2">{{userInfo.employee_name}}</view>
+          <view class="name2 dept_name font-flex-word" style="width:400rpx; overflow: hidden;">{{userInfo.deptName}}</view>
+      </view>
+      <view class="blue" style="font-size:0.24rem" catchTap="open2">看TA的积分统计<text style="font-size:0.18rem;position: relative;right:-8rpx;top:-2rpx">〉</text></view>
+    </view>
+    <view class="fontColorF" style="font-size:28rpx;padding:10rpx 28rpx;" a:if="{{type==2}}">总分:<text class="blue">{{userInfo.point}}</text> (包含基础分<text class="blue">{{base_point}}</text>,工龄分<text class="blue">{{service_point}}</text>)</view>
+    <view class="fontColorF" style="font-size:28rpx;padding:10rpx 28rpx;" a:else>分值:<text class="blue">{{userInfo.point}}</text> (当前明细不包含基础分和工龄分)</view>
+    <view class="flex-box flex-v-ce tab" style="border-bottom:1px solid #f1f1f1">
+      <view class="flex-1">
+        <picker onChange="bingIntegralType" value="{{typesIndex}}" range="{{types}}" range-key="name">
+          <text>{{types[typesIndex].name}}</text>
+        </picker>
+      </view>
+    </view>
+    <view class="main scroll">
+      <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+        <view class="flex-box li border-bottom" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" key="{{item.id}}">
+          <img-box name="{{item.employee_name}}" key="{{item.id}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" 
+            fSize="24rpx"></img-box>
+          <view class="flex-1 main-right">
+            <view class="flex-box flex-v-ce">
+              <view class="name flex-1">{{item.employee_name}}</view>
+              <view class="red da" a:if="{{item.point>0}}">+{{item.point}}{{item.ptObj.name}}</view>
+              <view class="green da" a:else>{{item.point}}{{item.ptObj.name}}</view>
+            </view>
+            <view class="context" a:if="{{item.remark}}">{{item.remark}}</view>
+            <view class="flex-box flex-v-ce">
+              <view class="date flex-1">{{item.event_time}}</view>
+            </view>
+          </view>
+        </view>
+        <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
+      </scroll-view>
+      <no-data a:if="{{list.length==0}}"></no-data>
+    </view>
+  </view>
+</view>

+ 202 - 0
pages/statistics/jfDetail/jfDetail.js

@@ -0,0 +1,202 @@
+
+var app = getApp()
+var that;
+Page({
+  data: {
+    userInfo: {},
+    type: 1,//判断那个列表进入  1阶段排名,2累计排名,3自定义排名
+    point: 0,
+    base_point: 0,//基础分
+    service_point: 0, //工龄发
+    formData: {
+      page: 1,
+      page_size: 20,
+      dc_status: JSON.stringify([1]),
+      order_key: 'create_time',
+      order_type: 'desc',
+      pt_id: "3"
+    },
+    typesIndex: 0,//条件选择
+    types: [
+      { id: 0, name: '按最新事件时间排序' },
+      { id: 1, name: '按积分由高到低排序' },
+      { id: 2, name: '按积分由低到高排序' },
+    ],
+  },
+  onLoad(e) {
+    console.log(JSON.parse(e.data))
+    that = this;
+    dd.setNavigationBar({ title: "积分明细" });
+    let data = JSON.parse(e.data);
+    let newObj = {};
+    this.setData({type:data.type})
+    if (data.type == 1) {
+      let formData = this.data.formData;
+      let parameter = {
+        pt_id: data.pt_id || 0,
+        dept_ids: data.dept_id || 0,
+        rule_id: data.rule || 0,
+        employee_ids: data.item.employee_id,
+      };
+      if (data.dataType == '1') {
+        parameter.year = data.year
+      } else if (data.dataType == '2' || data.dataType == '4') {
+        parameter.start_day = data.start_day
+        parameter.end_day = data.end_day
+      } else {
+        parameter.month = data.month
+      }
+      Object.assign(newObj, formData, parameter);//合并对象
+      this.setData({
+        userInfo: data.item,
+        formData: newObj
+      })
+    } else if (data.type == 2) {
+      this.setData({
+        userInfo: data.item,
+        'formData.dept_ids': data.dept_id || 0,
+        'formData.employee_ids': data.item.employee_id,
+      })
+      this.getUserInfo(data.item.employee_id)
+    } else {
+      if (data.date_interval == '1') {//统计时间区间只有type为custom时有值 1-月度 2-季度 3-年度
+        this.setData({
+          userInfo: data.item,
+          'formData.month': data.month.slice(0, 4)+'-'+data.month.slice(4),
+          'formData.employee_ids': data.item.employee_id,
+          'formData.item_id':data.items.toString()
+        })
+      }else if(data.date_interval == '3'){
+        this.setData({
+          userInfo: data.item,
+          'formData.year': data.month,
+          'formData.employee_ids': data.item.employee_id,
+          'formData.item_id':data.items.toString()
+        })
+      }else{
+        this.setData({
+          userInfo: data.item,
+          'formData.start_day': data.start_day,
+          'formData.end_day': data.end_day,
+          'formData.employee_ids': data.item.employee_id,
+          'formData.item_id':data.items.toString()
+        })
+      }
+    }
+    console.log(this.data.userInfo)
+    this.getData();
+  },
+  getUserInfo(id){
+			app.$get('/api/employee/detail',{target:id}).then(res => {
+          this.setData({
+            	base_point:res.data.data.user.site_config.base_point,//基础分
+					    service_point:res.data.data.user.point_config.service_point //工龄发
+          })
+			})
+		},
+  onShareAppMessage() {
+    return {
+      title: '累计B分排名',
+      desc: '积分排名有变动了,快来看看!',
+      path: 'pages/statistics/B_ranking/B_ranking'
+    };
+  },
+  onShow() {
+    // if (app.globalData.userData) {
+    //   if (that.data.page == 1) {
+    //     dd.hideLoading();
+    //     that.getData();
+    //   }
+    // } else {
+    //   app.login(app.globalData.corpId, function (is) {
+    //     if (is) {
+    //       if (that.data.page == 1) {
+    //         dd.hideLoading();
+    //         that.getData();
+    //       }
+    //     } else {
+    //       dd.reLaunch({
+    //         url: '../../noJurisdiction/noJurisdiction'
+    //       })
+    //     }
+    //   },function(){})
+    // }
+  },
+  open2() {
+    if (this.data.formData.pt_id == '2') {//A分
+      dd.navigateTo({
+        url: '../../workbench/statistics_A/statistics_A?employee_id=' + that.data.userInfo.employee_id + '&name=' + that.data.userInfo.employee_name
+      })
+    } else {
+      dd.navigateTo({
+        url: '../../workbench/statistics_B/statistics_B?employee_id=' + that.data.userInfo.employee_id + '&name=' + that.data.userInfo.employee_name
+      })
+    }
+  },
+  getData(is) {
+    app.$get('api/integral/statistics/integral', this.data.formData).then((res) => {
+      var data = res.data.data.list;
+      data.map((item) => {
+        item.ptObj = app.getTypesItem(item.pt_id);
+      })
+      if (is) {
+        if (data.length == 0) {
+          this.setData({
+            isData: true
+          })
+          return;
+        }
+        var list = that.data.list;
+        this.setData({
+          list: list.concat(data)
+        })
+      } else {
+        this.setData({ list: [] });
+        this.setData({
+          list: data,
+          isData: false
+        })
+      }
+    })
+  },
+  //选择事件来源
+  bingIntegralType(e) {
+    if (e.detail.value == 0) {
+      this.setData({
+        'formData.order_key': 'create_time',
+        'formData.order_type': 'desc',
+      });
+    }
+    if (e.detail.value == 1) {
+      this.setData({
+        'formData.order_key': 'point',
+        'formData.order_type': 'desc',
+      });
+    }
+    if (e.detail.value == 2) {
+      this.setData({
+        'formData.order_key': 'point',
+        'formData.order_type': 'asc',
+      });
+    }
+    this.setData({
+      typesIndex: e.detail.value,
+      'formData.page': 1,
+    });
+    this.getData();
+  },
+  //上啦加载
+  onScrollToLower() {
+    if (!that.data.isData) {
+      this.setData({ 'formData.page': ++that.data.formData.page })
+      this.getData(true);
+    }
+  },
+  //打开兴趣
+  openDetail(e) {
+    var item = e.target.dataset.item;
+    dd.navigateTo({
+      url: '../prizeBuckleDetail/prizeBuckleDetail?id=' + item.id
+    })
+  },
+});

+ 7 - 0
pages/statistics/jfDetail/jfDetail.json

@@ -0,0 +1,7 @@
+{
+  "usingComponents": {
+    "img-box": "/Component/img-box/index",
+    "select-section": "/Component/selectSection/selectSection",
+    "no-data": "/Component/noData/noData"
+  }
+}

+ 6 - 1
pages/statistics/log_rank/log_rank.axml

@@ -30,7 +30,12 @@
           <view a:else class="index">{{item.rank}}</view>
           <view class="flex-1 flex-box flex-v-ce">
             <img-box name="{{item.employee_name}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
-            <view class="name">{{item.employee_name}}</view>
+            <view class="users">
+              <view class="name">{{item.employee_name}}</view>
+              <view class="name flex-box dept_name">
+                  <text class="" a:for="{{item.dept_list}}" a:for-index="idx" a:for-item="e">{{e.dept_name}}</text>
+              </view>
+            </view>
           </view>
           <view class="blue" style="margin-right:28rpx;">{{item.point}}</view>
         </view>

+ 8 - 4
pages/statistics/my_PrizeBuckle/my_PrizeBuckle.axml

@@ -3,7 +3,7 @@
     <form onReset="onReset">
       <view class="search flex-box flex-v-ce">
         <image mode="scaleToFill" src="../../../image/ss.png"></image>
-        <input placeholder="请输入姓名或事件内容搜索" onInput="bindKeyInput" class="flex-1"></input>
+        <input placeholder="请输入事件内容搜索" onInput="bindKeyInput" class="flex-1"></input>
         <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
       </view>
     </form>
@@ -13,10 +13,14 @@
       <view data-index="3" class="{{activeIndex == 3? 'active':''}} flex-1" catchTap="activeItem">被驳回</view>
     </view>
   </view>
+  <view class="yellowText" a:if="{{config.event_review_status==1&&config.event_entry_review==1}}">复核开启后,积分需管理员复核后才计入排名和统计</view>
   <view class="main scroll">
-    <scroll-view class="scroll" a:if="{{activeIndex==1&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
-      <view class="flex-box li border-bottom" data-index="1" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" key="{{item.id}}">
-        <img-box name="{{item.employee_name}}" key="{{item.id}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+    <scroll-view class="scroll" style="{{(config.event_review_status==1&&config.event_entry_review==1)?'height: calc(100vh - 2.6rem)':''}}" 
+      a:if="{{activeIndex==1&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+      <view class="flex-box li border-bottom" data-index="1" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" 
+        key="{{item.id}}">
+        <img-box name="{{item.employee_name}}" key="{{item.id}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" 
+          fSize="24rpx"></img-box>
         <view class="flex-1 main-right">
           <view class="flex-box flex-v-ce">
             <view class="name flex-1">{{item.employee_name}}</view>

+ 7 - 2
pages/statistics/my_PrizeBuckle/my_PrizeBuckle.js

@@ -6,6 +6,7 @@ Page({
     date: app.globalData.month,
     activeIndex: 1,
     page: 1,
+    config: {},
   },
   onLoad(e) {
     if (e.index) {
@@ -13,6 +14,9 @@ Page({
         activeIndex: e.index,
       })
     }
+    this.setData({
+      config: app.globalData.config
+    })
     that = this;
     dd.setNavigationBar({ title: "我奖扣的" });
   },
@@ -34,7 +38,7 @@ Page({
             url: '../../noJurisdiction/noJurisdiction'
           })
         }
-      },function(){})
+      }, function () { })
     }
   },
   onReset() {
@@ -62,7 +66,8 @@ Page({
         page_size: 20,
         recorder_id: app.globalData.userData.id,
         source_type: 1,
-        keyword: that.data.keyword
+        keyword: that.data.keyword,
+        order_key:'update_time'
       }
     } else if (index == 2) {
       data = {

+ 12 - 5
pages/statistics/my_apply/my_apply.axml

@@ -8,20 +8,27 @@
     </view>
   </form>
     <view class="flex-box flex-v-ce selectItems border-bottom">
-      <view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-1" catchTap="activeItem">全部申请</view>
-      <view data-index="2" class="{{activeIndex == 2? 'active':''}} flex-1" catchTap="activeItem">已通过</view>
       <view data-index="3" class="{{activeIndex == 3? 'active':''}} flex-1" catchTap="activeItem">待审批</view>
+      <view data-index="2" class="{{activeIndex == 2? 'active':''}} flex-1" catchTap="activeItem">已通过</view>
       <view data-index="4" class="{{activeIndex == 4? 'active':''}} flex-1" catchTap="activeItem">被驳回</view>
+      <view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-1" catchTap="activeItem">已复核</view>
     </view>
   </view>
+  <view class="yellowText" a:if="{{config.event_review_status==1&&config.event_apply_review==1}}">复核开启后,积分需管理员复核后才计入排名和统计</view>
   <view class="main scroll">
-    <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+    <scroll-view class="scroll" style="{{(config.event_review_status==1&&config.event_apply_review==1)?'height: calc(100vh - 2.68rem)':''}}" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
       <view class="flex-box li border-bottom" catchTap="openDetail" a:for="{{list}}" data-item="{{item}}" key="{{item.id}}">
         <view class="flex-1 main-right">
           <view class="flex-box">
             <view class="name flex-1" style="margin-right: 10rpx;">{{item.remark.customize || item.remark.rule}}</view>
-            <view class="red" a:if="{{item.review_point > 0}}">+{{item.review_point}} {{item.pt_name}}</view>
-            <view class="green" a:else>{{item.point}} {{item.pt_name}}</view>
+            <block a:if="{{activeIndex==1}}">
+              <view class="red" a:if="{{item.point > 0}}">+{{item.point}} {{item.pt_name}}</view>
+              <view class="green" a:else>{{item.point}} {{item.pt_name}}</view>
+            </block>
+            <block a:else>
+              <view class="red" a:if="{{item.review_point > 0}}">+{{item.review_point}} {{item.pt_name}}</view>
+              <view class="green" a:else>{{item.point}} {{item.pt_name}}</view>
+            </block>
           </view>
           <view class="flex-box flex-v-ce">
             <view class="date flex-1">{{item.event_time}}</view>

+ 28 - 13
pages/statistics/my_apply/my_apply.js

@@ -1,23 +1,30 @@
 
 var app = getApp()
 var that;
+import moment from 'moment' // 时间库
 Page({
   data: {
-    activeIndex: 1,
-    page: 1
+    activeIndex: 3,
+    $moment:'',
+    page: 1,
+    config: {},
   },
   onLoad(e) {
-    if(e.index){
+    if (e.index) {
       this.setData({
-          activeIndex:e.index,
+        activeIndex: e.index,
       })
     }
+    this.setData({
+      config: app.globalData.config,
+      $moment:moment
+    })
     that = this;
     dd.setNavigationBar({ title: "我申请的" });
   },
-  onShow(){
-    if(this.data.page==1){
-        that.getData();
+  onShow() {
+    if (this.data.page == 1) {
+      that.getData();
     }
   },
   onReset() {
@@ -32,7 +39,7 @@ Page({
     this.setData({
       keyword: e.detail.value,
       page: 1,
-       isVal:e.detail.value? true:false
+      isVal: e.detail.value ? true : false
     })
     this.getData();
   },
@@ -45,8 +52,11 @@ Page({
       type: '',
       keyword: that.data.keyword
     }
+    let url='api/integral/review/apply/list';
     if (activeIndex == 1) {
       data.type = "all"
+      url='api/integral/statistics/event';
+      delete data.pt_id
     } else if (activeIndex == 2) {
       data.type = "complete"
     } else if (activeIndex == 3) {
@@ -54,12 +64,17 @@ Page({
     } else {
       data.type = "refuse"
     }
-    app.$get('api/integral/review/apply/list', data).then((res) => {
-
+    app.$get(url, data).then((res) => {
       var data = res.data.data.list;
+      if(activeIndex == 1){
+        data=data.map(item=>{
+          item.event_time=moment.unix(item.event_time).format('YYYY-MM-DD')
+          return item;
+        })
+      }
       data.forEach(element => {
-        if(element.pt_id){
-          element.pt_name=app.getTypesItem(element.pt_id).name
+        if (element.pt_id) {
+          element.pt_name = app.getTypesItem(element.pt_id).name
         }
       });
       var list = that.data.list;
@@ -69,7 +84,7 @@ Page({
             list: list.concat(data),
             isData: true
           })
-        }else{
+        } else {
           this.setData({
             list: list.concat(data)
           })

+ 2 - 1
pages/statistics/my_sp/my_sp.axml

@@ -23,8 +23,9 @@
       </view>
     </form>
   </view>
+  <view class="yellowText" a:if="{{config.event_review_status==1}}">复核开启后,积分需管理员复核后才计入排名和统计</view>
   <view class="main scroll">
-    <scroll-view class="scroll" a:if="{{(minuteIndex==0)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+    <scroll-view class="scroll" style="{{config.event_review_status==1?'height: calc(100vh - 2.58rem)':''}}" a:if="{{(minuteIndex==0)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
       <view class="li border-bottom" a:for="{{list}}" key="{{item.id}}">
         <view class="flex-box li-top">
           <img-box name="{{item.employee_name}}" key="{{item.id}}" a:key="{{index}}" id="{{item.employee_id}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>

+ 5 - 1
pages/statistics/my_sp/my_sp.js

@@ -23,10 +23,14 @@ Page({
       { id: 2, name: '已审批' },
     ],
 
-    popupCx: '',  
+    popupCx: '',
+     config: {},  
   },
   onLoad(e) {
     that = this;
+            this.setData({
+      config: app.globalData.config
+    })
     dd.setNavigationBar({ title: "我审批的" });
   },
   onShow() {

+ 3 - 2
pages/statistics/my_task/my_task.axml

@@ -12,14 +12,15 @@
       <view style="margin-top:16rpx;">
         <view class="search flex-box flex-v-ce">
           <image mode="scaleToFill" src="../../../image/ss.png"/>
-          <input class="flex-1" placeholder="请输入任务内容" onInput="bindKeyInput" class="flex-1"/>
+          <input class="flex-1" placeholder="请输入任务内容" onInput="bindKeyInput"/>
           <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
         </view>
       </view>
     </form>
   </view>
+  <view class="yellowText" a:if="{{config.event_review_status==1&&config.event_task_review==1}}">复核开启后,积分需管理员复核后才计入排名和统计</view>
   <view class="main scroll">
-    <scroll-view class="scroll" a:if="{{(activeIndex==1)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+    <scroll-view class="scroll" style="{{(config.event_review_status==1&&config.event_task_review==1)?'height: calc(100vh - 2.6rem)':''}}"  a:if="{{(activeIndex==1)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
       <view class="task" a:if="{{toList.length>0}}">今日任务</view>
       <view class="li border-bottom" a:for="{{toList}}" a:if="{{toList.length>0}}" key="{{item.id}}">
         <view class="flex-box li-top" catchTap="openDetail" data-item="{{item}}">

+ 4 - 0
pages/statistics/my_task/my_task.js

@@ -14,6 +14,7 @@ Page({
       status: 'running',//状态
       sort: 'publish',//排序
     },
+     config: {},
   },
   onLoad(e) {
     that = this;
@@ -22,6 +23,9 @@ Page({
         activeIndex: e.index,
       })
     }
+        this.setData({
+      config: app.globalData.config
+    })
     dd.setNavigationBar({ title: "我的任务" });
   },
   onShow() {

+ 1 - 1
pages/statistics/offerAreward/offerAreward.axml

@@ -85,7 +85,7 @@
         <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
       </view>
       <view class="li">
-        <textarea maxlength="100" value="{{items.task_remark}}" onInput="bindTextAreaBlur2" placeholder="请输入任务描述" data-index="{{index}}"></textarea>
+        <textarea maxlength="300" value="{{items.task_remark}}" onInput="bindTextAreaBlur2" placeholder="请输入任务描述" data-index="{{index}}"></textarea>
       </view>
       <view class="flex-box flex-v-ce li">
         <view class="label">重复周期</view>

+ 13 - 8
pages/statistics/prizeBuckleDetail/prizeBuckleDetail.axml

@@ -1,7 +1,8 @@
 <view>
   <view class="header margin-bottom">
     <view class="header-top flex-box-v flex-center-center border-bottom">
-      <img-box a:if="{{dataDetail.employee_name}}" name="{{dataDetail.employee_name}}" imgUrl="{{dataDetail.img_url}}" height="90rpx" width="90rpx" fSize="24rpx"></img-box>
+      <img-box a:if="{{dataDetail.employee_name}}" name="{{dataDetail.employee_name}}" imgUrl="{{dataDetail.img_url}}" height="90rpx" 
+        width="90rpx" fSize="24rpx"></img-box>
       <view class="name">{{dataDetail.employee_name}}</view>
       <view class="num red" a:if="{{dataDetail.point>0}}">+{{dataDetail.point}}
         <text>{{dataDetail.typeName}}</text></view>
@@ -17,7 +18,7 @@
         <view class="laber">图片</view>
         <view class="flex-1 flex-box flex-d-wrap">
           <block a:for="{{dataDetail.files}}" a:for-item="imgs" a:for-index="idx">
-            <image class="imgs" catchTap="showImg" mode="scaleToFill" src="{{imgs}}" data-index="{{idx}}" data-item="{{dataDetail.files}}"/>
+            <image class="imgs" catchTap="showImg" mode="scaleToFill" src="{{imgs}}" data-index="{{idx}}" data-item="{{dataDetail.files}}" />
           </block>
         </view>
       </view>
@@ -49,7 +50,7 @@
         <view class="laber"></view>
         <view class="flex-1 flex-box flex-d-wrap">
           <block a:for="{{dataDetail.complete_task.files}}" a:for-item="imgs" a:for-index="idx">
-            <image class="imgs" catchTap="showImg" mode="scaleToFill" src="{{imgs}}" data-index="{{idx}}" data-item="{{dataDetail.complete_task.files}}"/>
+            <image class="imgs" catchTap="showImg" mode="scaleToFill" src="{{imgs}}" data-index="{{idx}}" data-item="{{dataDetail.complete_task.files}}" />
           </block>
         </view>
       </view>
@@ -80,16 +81,20 @@
       </view>
     </block>
     <block a:else>
-        <view class="log" catchTap="openLog">查看日志详情内容 <text style="font-size: 36rpx;padding-left:10rpx;">»</text></view>
+      <view a:if="{{see_log==1}}" class="log" catchTap="openLog">查看日志详情内容
+        <text style="font-size: 36rpx;padding-left:10rpx;">»</text></view>
     </block>
   </view>
-  <view class="bottom flex-box flex-flex-center-center" a:if="{{dataDetail.recorder_id==userId&&dataDetail.process.length==1&&(dataDetail.event_type==3||dataDetail.event_type==4)}}">
+  <!-- <view class="bottom flex-box flex-flex-center-center" a:if="{{dataDetail.recorder_id==userId&&dataDetail.process.length==1&&(dataDetail.event_type==3||dataDetail.event_type==4)}}">
     <text class="flex-2 fontColorF">撤销后数据将不可恢复</text>
     <view></view>
     <view class="flex-1 blueBtn" catchTap="openCx">撤销奖扣</view>
-  </view>
+  </view> -->
   <!-- 调用过程组件 -->
-  <view class="" style="margin-bottom:140rpx">
-    <process process="{{dataDetail.process}}" a:if="{{dataDetail.process.length>0}}"/>
+  <view class="margin-bottom">
+    <process process="{{dataDetail.process}}" a:if="{{dataDetail.process.length>0}}" />
+  </view>
+  <view style="margin-bottom:140rpx" a:if="{{dataDetail.dc_remark.flow}}">
+    <review process="{{dataDetail.dc_remark.flow}}" status="{{dataDetail.dc_status}}" />
   </view>
 </view>

+ 45 - 19
pages/statistics/prizeBuckleDetail/prizeBuckleDetail.js

@@ -4,22 +4,48 @@ var that;
 Page({
   data: {
     date: app.globalData.month,
-    review_id:'',
-    userId:''
+    review_id: '',
+    userId: '',
+    see_log: 1,
   },
   onLoad(e) {
     that = this;
     dd.setNavigationBar({ title: "事件详情" });
     that.setData({
-      userId:app.globalData.userData.id
+      userId: app.globalData.userData.id
     })
-    if(e.id){
-        that.setData({
-          review_id:e.id
-        })
-        that.getDetail(e.id);
+    if (e.id) {
+      that.setData({
+        review_id: e.id
+      })
     }
   },
+  onShow() {
+    if (app.globalData.userData) {
+        dd.hideLoading();
+        that.getDetail();
+        that.cheakAx();
+    } else {
+      app.login(app.globalData.corpId, function (is) {
+        if (is) {
+          dd.hideLoading();
+          that.getDetail();
+          that.cheakAx();
+        } else {
+          dd.reLaunch({
+            url: '../../noJurisdiction/noJurisdiction'
+          })
+        }
+      }, function () { })
+    }
+
+  },
+  cheakAx() {
+    app.$get("api/integral/site/config", {}).then((res) => {
+      var data = res.data.data;
+      this.setData({ see_log: data.see_log ? data.see_log : 0 })
+    })
+  },
   openCx() {
     dd.confirm({
       title: '撤销奖扣',
@@ -28,7 +54,7 @@ Page({
       cancelButtonText: '取消',
       success: (result) => {
         if (result.confirm) {
-          app.$post("api/integral/review/prize/destroy", { target_id: that.data.review_id,type:1 }).then((res) => {
+          app.$post("api/integral/review/prize/destroy", { target_id: that.data.review_id, type: 1 }).then((res) => {
             app.globalData.showToast("已撤销");
             // var pages=getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
             // var active=pages[pages.length-2];
@@ -46,18 +72,18 @@ Page({
     });
   },
   // 查看日志详情
-  openLog(){
+  openLog() {
     dd.navigateTo({
       url: '../logDetail/logDetail?id=' + this.data.review_id
     })
   },
-  showImg(e){
-      var index=e.target.dataset.index;
-      var item=e.target.dataset.item
-      dd.previewImage({
-        current: index,
-        urls: item
-      });
+  showImg(e) {
+    var index = e.target.dataset.index;
+    var item = e.target.dataset.item
+    dd.previewImage({
+      current: index,
+      urls: item
+    });
   },
   activeItem(e) {
     var index = e.target.dataset.index;
@@ -66,8 +92,8 @@ Page({
   openSearch() {
     app.globalData.showToast("暂不支持筛选");
   },
-  getDetail(id) {
-    app.$get("api/integral/statistics/integral/info", { event_id: id }).then((res) => {
+  getDetail() {
+    app.$get("api/integral/statistics/integral/info", { event_id:  that.data.review_id }).then((res) => {
       var data = res.data.data;
       app.globalData.types.forEach(item => {
         if (item.id == data.pt_id) {

+ 2 - 1
pages/statistics/prizeBuckleDetail/prizeBuckleDetail.json

@@ -1,6 +1,7 @@
 {
   "usingComponents": {
     "img-box": "/Component/img-box/index",
-    "process": "/Component/process/process"
+    "process": "/Component/process/process",
+    "review": "/Component/Review/Review"
   }
 }

+ 5 - 2
pages/statistics/sectionRanking/sectionRanking.axml

@@ -17,7 +17,7 @@
     <view class="fontColorF" style="font-size:28rpx;padding:10rpx 28rpx;">排名不包含初始分和工龄分</view>
     <view class="main scroll">
       <scroll-view class="scroll" scroll-y="{{true}}" a:if="{{list.length>0}}" onScrollToLower="onScrollToLower">
-        <view a:for="{{list}}" data-item="{{item}}" class="flex-box flex-v-ce item border-bottom" key="{{item.id}}">
+        <view a:for="{{list}}" data-item="{{item}}" class="flex-box flex-v-ce item border-bottom" key="{{item.id}}" catchTap="openDetail">
           <view a:if="{{item.rank==1}}" class="index">
             <image mode="scaleToFill" src="../../../image/1.png"></image>
           </view>
@@ -30,7 +30,10 @@
           <view a:else class="index">{{item.rank}}</view>
           <view class="flex-1 flex-box flex-v-ce">
             <img-box name="{{item.employee_name}}" key="{{item.id}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
-            <view class="name">{{item.employee_name}}</view>
+            <view>
+                <view class="name">{{item.employee_name}}</view>
+                <view class="name dept_name font-flex-word" style="width:400rpx; overflow: hidden;">{{item.deptName}}</view>
+            </view>
           </view>
           <view class="blue" style="margin-right:28rpx;">{{item.point}}</view>
         </view>

+ 85 - 45
pages/statistics/sectionRanking/sectionRanking.js

@@ -1,6 +1,7 @@
 
 var app = getApp()
 var that;
+import moment from 'moment' // 时间库
 Page({
   data: {
     date: app.globalData.month,
@@ -23,13 +24,13 @@ Page({
     showTissue: false,//显示部门组件
     TissueVal: '全公司',
 
-    sort:'DESC',
-    position:'all',
-    year:app.globalData.year,
-    page:1,
-    dateIndex:'3',
+    sort: 'DESC',
+    position: 'all',
+    year: app.globalData.year,
+    page: 1,
+    dateIndex: '3',
     popupCx: '',
-    pt_id:'3',
+    pt_id: '3',
   },
   onShareAppMessage() {
     return {
@@ -60,32 +61,71 @@ Page({
             url: '../../noJurisdiction/noJurisdiction'
           })
         }
-      },function(){})
+      }, function () { })
     }
 
   },
-  getData(is) {  
+  openDetail(e) {
+    let item = e.target.dataset.item
     var data = {
-      pt_id:that.data.pt_id,
-      dept_id:that.data.dept_id,
+      pt_id: that.data.pt_id,
+      dept_id: that.data.dept_id,
+      rule: that.data.rule_id,
+      item:item,
+      type:1,
+      dataType:that.data.dateIndex,
+    }
+    if (that.data.dateIndex == '1') {
+      data.year = that.data.year;
+    } else if (that.data.dateIndex == '2') {
+      let quarter=that.data.quarter.toString()
+      let date={type:2,year:quarter.slice(0,4),season:quarter.slice(4)}
+      this.getDate((res)=>{
+          data.start_day = moment(Number(res.data.start+'000')).format('YYYY-MM-DD')
+          data.end_day = moment(Number(res.data.end+'000')).format('YYYY-MM-DD')
+          dd.navigateTo({
+            url: '../jfDetail/jfDetail?data=' + JSON.stringify(data)
+          })
+      },date)
+      return false
+    } else if (that.data.dateIndex == '4') {
+      data.start_day = that.data.custom.start_date
+      data.end_day = that.data.custom.end_date
+    } else {
+      data.month = that.data.month || app.globalData.month;
+    }
+    dd.navigateTo({
+      url: '../jfDetail/jfDetail?data=' + JSON.stringify(data)
+    })
+  },
+  getDate(func, date) {
+    app.$post('/api/timestamp', date).then(res => {
+      func(res.data)
+    });
+  },
+  getData(is) {
+    var data = {
+      pt_id: that.data.pt_id,
+      dept_id: that.data.dept_id,
       page: that.data.page,
-      rule_id: that.data.rule_id,
-      sort:that.data.sort,
-      position:that.data.position,
-      page_size:20
+      rule: that.data.rule_id,
+      sort: that.data.sort,
+      position: that.data.position,
+      page_size: 20
     }
-    if(that.data.dateIndex=='1'){
-      data.year=that.data.year;
-    }else if(that.data.dateIndex=='2'){
-      data.quarter=that.data.quarter
-    }else if(that.data.dateIndex=='4'){
-      data.start_date=that.data.custom.start_date
-      data.end_date=that.data.custom.end_date
-    }else{
-      data.month=that.data.month||app.globalData.month;
+    if (that.data.dateIndex == '1') {
+      data.year = that.data.year;
+    } else if (that.data.dateIndex == '2') {
+      data.quarter = that.data.quarter
+    } else if (that.data.dateIndex == '4') {
+      data.start_date = that.data.custom.start_date
+      data.end_date = that.data.custom.end_date
+    } else {
+      data.month = that.data.month || app.globalData.month;
     }
-    app.$get('api/integral/statistics/ranking',data,'application/vnd.test.v2+json').then((res) => {
+    app.$get('api/integral/statistics/ranking', data, 'application/vnd.test.v2+json').then((res) => {
       var data = res.data.data.list;
+      data=app.returnDeptName(data);
       if (is) {
         if (data.length == 0) {
           this.setData({
@@ -98,7 +138,7 @@ Page({
           list: list.concat(data)
         })
       } else {
-        this.setData({list:[]});
+        this.setData({ list: [] });
         this.setData({
           list: data,
           isData: false
@@ -108,7 +148,7 @@ Page({
   },
   //上啦加载
   onScrollToLower() {
-    if(!that.data.isData){
+    if (!that.data.isData) {
       this.setData({ page: ++that.data.page })
       this.getData(true);
     }
@@ -145,34 +185,34 @@ Page({
   //选择时间
   onConfirmDate(data) {
     this.setData({
-        dateObj: data,
+      dateObj: data,
     })
     if (data.type == '1') {
       this.setData({
-        selectDateVal:data.date,
-        year:data.date,
-        dateIndex:data.type
+        selectDateVal: data.date,
+        year: data.date,
+        dateIndex: data.type
       })
-    } else if(data.type == '2'){
+    } else if (data.type == '2') {
       this.setData({
-        selectDateVal:data.date+'季度',
+        selectDateVal: data.date + '季度',
         quarter: data.date,
-        dateIndex:data.type
+        dateIndex: data.type
       })
-    } else if(data.type == '4'){
+    } else if (data.type == '4') {
       this.setData({
         selectDateVal: data.date.start_date + '--' + data.date.end_date,
         custom: data.date,
-        dateIndex:data.type
+        dateIndex: data.type
       })
-    }else{
-       this.setData({
+    } else {
+      this.setData({
         selectDateVal: data.date,
-        month:data.date,
-        dateIndex:data.type
+        month: data.date,
+        dateIndex: data.type
       })
     }
-    this.setData({page:1})
+    this.setData({ page: 1 })
     this.getData();
   },
   //关闭弹窗
@@ -182,14 +222,14 @@ Page({
       showSx: false,
       showRuleTwo: false,
       showTissue: false,
-      popupCx: ''  
+      popupCx: ''
     })
   },
   //选择筛选
   onConfirmSx(data) {
     console.log(data)
-   this.setData({sxObj:data, sort:data[1],position:data[0],pt_id:data[2],page:1})
-   this.getData();
+    this.setData({ sxObj: data, sort: data[1], position: data[0], pt_id: data[2], page: 1 })
+    this.getData();
   },
   //选择规则
   onConfirmRule(data) {
@@ -202,11 +242,11 @@ Page({
   },
   //显示部门选择组件
   selectTissue() {
-    this.setData({ showTissue: !this.data.showTissue,popupCx: 'container__mask', })
+    this.setData({ showTissue: !this.data.showTissue, popupCx: 'container__mask', })
   },
   //选择部门
   onConfirmTissue(data) {
-    this.setData({ dept_id: data.id,page:1,TissueVal:data.name })
+    this.setData({ dept_id: data.id, page: 1, TissueVal: data.name })
     this.getData();
   },
 });

+ 91 - 0
pages/statistics/taskSList/taskSList.acss

@@ -0,0 +1,91 @@
+.header {
+  background: #fff;
+  position: sticky;
+  top: 0;
+}
+
+.selectItems {
+  /* margin-top: 20rpx; */
+  text-align: center;
+}
+
+.selectItems .selectImg {
+  border-left: 1px solid #f1f1f1;
+  padding: 0 20rpx;
+}
+
+.selectImg image {
+  width: 30rpx;
+  height: 30rpx;
+}
+
+.selectItems .flex-2 {
+  padding: 24rpx 0;
+  text-align: center;
+  font-size: 32rpx;
+  position: relative;
+}
+
+.selectItems .active::before {
+  position: absolute;
+  content: " ";
+  height: 4rpx;
+  width: 100rpx;
+  background: #26A2FF;
+  bottom: 0rpx;
+  left: 50%;
+  margin-left: -50rpx;
+}
+
+.main {
+  background: #fff;
+}
+
+.li {
+  padding: 24rpx 28rpx;
+}
+
+.li-bottom .fontColorX {
+  font-size: 24rpx;
+}
+.li-bottom .red {
+  padding-left: 20rpx;
+}
+
+.scroll {
+  height: calc(100vh);
+}
+
+.sxImg {
+  width: 30rpx;
+  height: 30rpx;
+}
+
+.defBtn {
+  border-radius: 6rpx;
+  height: 50rpx;
+  text-align: center;
+  line-height: 50rpx;
+  width: 120rpx;
+  font-size: .24rem;
+}
+
+.task {
+  background: #f5f7fa;
+  color: #909399;
+  font-size: .28rem;
+  padding: .05rem .32rem .15rem;
+}
+.content{
+  padding-top: 16rpx;
+  font-size: 32rpx;
+}
+.sxBorder::after{
+  content: " ";
+  width: 2rpx;
+  height: 80rpx;
+  background: #f1f1f1;
+  left: 0;
+  top: 0;
+  position: absolute;
+}

+ 28 - 0
pages/statistics/taskSList/taskSList.axml

@@ -0,0 +1,28 @@
+<view>
+  <view class="main scroll">
+    <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}"  onScrollToLower="onScrollToLower">
+      <view class="li border-bottom" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" key="{{item.id}}">
+        <view class="flex-box li-top">
+          <img-box name="{{item.receiver.name}}" a:key="{{index}}" imgUrl="{{item.receiver.img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+          <view class="flex-1" style="padding-left:16rpx;">
+            <view class="flex-box-ce" style="padding-top:16rpx;">
+              <text class="flex-1">{{item.receiver.name}}</text>
+              <text class="red" a:if="{{item.point_config.base_point>0}}">+{{item.point_config.base_point}}  {{item.pt_name}}</text>
+              <text a:else>{{item.point_config.base_point}}  {{item.pt_name}}</text>
+            </view>
+            <view class="content">{{item.task_name}}</view>
+            <view class="flex-box-ce li-bottom">
+              <text class="flex-1 fontColorX">{{item.date}} 截止 
+                <text class="red" a:if="{{parameter.index=='1'&&item.sub}}">逾期{{item.sub}}</text>
+                <text class="red" a:if="{{parameter.index=='4'&&item.sub}}">已等待{{item.sub}}</text>
+              </text>
+              <button type="primary" class="defBtn" catchTap="activeA" data-item="{{item}}" a:if="{{parameter.index=='1'||parameter.index=='4'}}">催办</button>
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="noDatas" a:if="{{!isData}}">没有更多咯</view>
+    </scroll-view>
+    <no-data a:if="{{list.length==0}}"></no-data>
+  </view>
+</view>

+ 199 - 0
pages/statistics/taskSList/taskSList.js

@@ -0,0 +1,199 @@
+
+var app = getApp()
+var that;
+Page({
+  data: {
+    list: [],
+    parameter:{},
+    isData:true,
+  },
+  onLoad(e) {
+    that = this;
+    this.setData({
+      parameter: JSON.parse(e.data),
+    })
+    if(this.data.parameter.index=='1'){
+       dd.setNavigationBar({ title: "逾期任务" });
+    }else if(this.data.parameter.index=='2'){
+       dd.setNavigationBar({ title: "今日任务" });
+    }else if(this.data.parameter.index=='3'){
+       dd.setNavigationBar({ title: "进行中任务" });
+    }else{
+      dd.setNavigationBar({ title: "待审批任务" });
+    }
+  },
+  onShow() {
+    if(this.data.parameter.page==1){
+      this.opneWebSocket();
+    }
+  },
+  activeA(e){
+      let item = e.target.dataset.item;
+      let text='';
+      let users=[];
+      if(this.data.parameter.index=='1'){//拿执行者ID
+        users.push(item.receiver.ding_user.user_id)
+        text=`积分任务【 ${item.task_name} 】已经逾期啦,请尽快完成`
+      }
+      if(this.data.parameter.index=='4'){//拿审批者ID
+        users.push(item.reviewer_ding_info.user_id)
+        text=`${item.receiver.name}的积分任务【 ${item.task_name} 】还未审批,请及时处理`
+      }
+      dd.createDing({
+          users: users, //默认选中用户工号列表;类型: Array<String>
+          corpId: app.globalData.corpId, // 类型: String
+          alertType: 2, // 钉发送方式 0:电话, 1:短信, 2:应用内;类型 Number
+          alertDate: {"format":"yyyy-MM-dd HH:mm", "value":"2019-08-29 08:25"}, // 非必选,定时发送时间, 非定时DING不需要填写
+          type: 1,// 附件类型 1:image, 2:link;类型: Number
+          
+          // 非必选
+          // 附件信息
+          // attachment: {
+            // images: ["https://www.baidu.com/img/bd_logo1.png?where=super"], // 图片附件, type=1时, 必选;类型: Array<String>
+            // image: "https://www.baidu.com/img/bd_logo1.png?where=super", // 链接附件, type=2时, 必选;类型: String    
+            // title: "这是一个测试", // 链接附件, type=2时, 必选;类型: String
+            // url: "https://www.baidu.com/", // 链接附件, type=2时, 必选;类型 String
+            // text: "测试发钉成功" // 链接附件, type=2时, 必选;类型: String
+          // },
+          text: text,  // 正文
+          bizType :0, // 业务类型 0:通知DING;1:任务;2:会议;
+
+          // 任务信息
+          // bizType=1的时候选填
+          taskInfo: {    
+            ccUsers: ['100', '101'],// 抄送用户列表, 工号,类型: Array<String>
+            deadlineTime: {"format":"yyyy-MM-dd HH:mm", "value":"2015-05-09 08:00"}, // 任务截止时间    
+            taskRemind: 30 // 任务提醒时间, 单位分钟;支持参数: 0:不提醒;15:提前15分钟;60:提前1个小时;180:提前3个小时;1440:提前一天;类型: Number
+          },
+          // 日程信息
+          // bizType=2的时候选填
+          confInfo: {      
+            bizSubType: 0,  // 子业务类型如会议: 0:预约会议, 1:预约电话会议, 2:预约视频会议;类型: Number (注: 目前只有会议才有子业务类型);
+            location: '某某会议室', // 会议地点(非必选),类型: String    
+            startTime: {"format":"yyyy-MM-dd HH:mm", "value":"2015-05-09 08:00"},// 会议开始时间  
+            endTime: {"format":"yyyy-MM-dd HH:mm", "value":"2015-05-09 08:00"},// 会议结束时间    
+            remindMinutes: 30, // 会前提醒。单位分钟;1:不提醒, 0:事件发生时提醒, 5:提前5分钟, 15:提前15分钟, 30:提前30分钟, 60:提前1个小时, 1440:提前一天
+            remindType: 2 // 会议提前提醒方式;0:电话, 1:短信, 2:应用内;类型: Number
+          },
+        
+          success:function(res){
+            /*
+            {
+              "dingId": "1_1_a09f167xxx",
+              "text": "钉正文内容",
+              "result": true
+            }
+            */  
+          },
+          fail:function(err){
+          }
+      })
+  },
+
+    //上啦加载
+  onScrollToLower() {
+    if (that.data.isData) {
+      this.setData({
+        'parameter.page':++this.data.parameter.page
+       })
+      this.opneWebSocket();
+    }
+  },
+  opneWebSocket() {
+    dd.showLoading({
+      content: '加载中...',
+    });
+    setTimeout(() => {
+      dd.hideLoading();
+    }, 600)
+    app.globalData.socketApi.sendData(this.data.parameter, this.onmessageWS);
+  },
+  onmessageWS(e) {
+    // 因为作用域问题,这个函数不能使用this
+    if (e.type == 'task_statistics') {
+      let result = e.result
+      result.map(item => {
+        item.date = that.timestampToTime(item.expire_time);
+        item.pt_name=item.pt_id==3? 'B分':'A分'
+        item.sub= that.formatSeconds(item.sub);
+      })
+      console.log(result)
+      var list = that.data.list || [];
+
+      that.setData({
+        list:that.data.parameter.page=='1'?result:list.concat(result),
+        isData:result.length<100? false:true,
+      })
+    }
+  },
+  formatSeconds(value) { 
+    var theTime = parseInt(value);// 需要转换的时间秒 
+    var theTime1 = 0;// 分 
+    var theTime2 = 0;// 小时 
+    var theTime3 = 0;// 天
+    if(theTime > 60) { 
+      theTime1 = parseInt(theTime/60); 
+      theTime = parseInt(theTime%60); 
+      if(theTime1 > 60) { 
+      theTime2 = parseInt(theTime1/60); 
+      theTime1 = parseInt(theTime1%60); 
+      if(theTime2 > 24){
+        //大于24小时
+        theTime3 = parseInt(theTime2/24);
+        theTime2 = parseInt(theTime2%24);
+      }
+      } 
+    } 
+    var result = '';
+    // if(theTime > 0){
+    //   result = ""+parseInt(theTime)+"秒";
+    // }
+    // if(theTime1 > 0) { 
+    //   result = ""+parseInt(theTime1)+"分"+result; 
+    // } 
+    if(theTime2 > 0) { 
+      result = ""+parseInt(theTime2)+"小时"+result; 
+    } 
+    if(theTime3 > 0) { 
+      result = ""+parseInt(theTime3)+"天"; 
+    }
+
+    return result; 
+  },
+  timestampToTime(timestamp) {
+    var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+    var Y = date.getFullYear() + '-';
+    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
+    var D = date.getDate() + ' ';
+    var h = date.getHours() + ':';
+    var m = date.getMinutes() + ':';
+    var s = date.getSeconds();
+    // return Y + M + D + h + m + s;
+    return Y + M + D;
+  },
+  activeItem(e) {
+    var index = Number(e.detail.value)+1;
+    var status = "";
+    if (index == 1) {
+      status = "all"
+    } else if (index == 2) {
+      status = "on_time"
+    } else if (index == 3) {
+      status = "before"
+    }else{
+      status = "over_due"
+    }
+    this.setData({
+      minuteIndex: e.detail.value,
+      [`parameter.range`]:status
+    })
+    // console.log(this.data.parameter)
+    this.opneWebSocket()
+  },
+  openDetail(e) {
+    var id = e.target.dataset.item.id;
+    dd.navigateTo({
+      url: '../../statistics/workDetail/workDetail?id=' + id
+    })
+  },
+});

+ 6 - 0
pages/statistics/taskSList/taskSList.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    "img-box": "/Component/img-box/index",
+    "no-data":"/Component/noData/noData"
+  }
+}

+ 229 - 0
pages/statistics/taskStatistical/taskStatistical.acss

@@ -0,0 +1,229 @@
+.box{
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: rgba(0,0,0,0.2);
+  z-index: 999;
+  transform: translate(0,100%);
+}
+.userSelect{
+  background-color: #fff;
+  text-align: center;
+  padding-right: 1.4rem;
+  border-bottom:1px solid #f1f1f1 ;
+  position: relative;
+}
+.ren{
+  position: absolute;
+  right: 0.32rem;
+  top: 0.3rem;
+  color: #969799;
+  font-size: 28rpx;
+}
+.userSelect .msg{
+  height: 0.8rem;
+  max-width: 5rem;
+  line-height: 0.8rem;
+  padding: 0 0.32rem;
+  overflow: hidden;
+	text-overflow: ellipsis;
+  white-space: nowrap;
+  position: relative;
+  font-size: 32rpx;
+  display: inline-block;
+  top: 6rpx;
+}
+.btns view{
+    text-align: center;
+    padding:0.32rem;
+    border-top: 1px solid #f1f1f1;
+    font-size: 0.28rem
+}
+.btns view:nth-child(1){
+    border-right: 1px solid #f1f1f1;
+}
+.btns view:nth-child(2){
+   color: #26A2FF;
+}
+.text2 {
+  border-radius: 50%;
+  border: 1px solid #909399;
+  color: #909399;
+  width: 26rpx;
+  height: 26rpx;
+  font-size: 22rpx;
+  text-align: center;
+  display: inline-block;
+  margin-left: 10rpx;
+  position: relative;
+  line-height: 26rpx;
+  box-sizing: border-box;
+}
+.userSelect .msg::after{
+  	position: absolute;
+    top: 50%;
+    right: 10rpx;
+    margin-top: -0.1rem;
+		border: 0.06rem solid;
+		border-color: transparent transparent #666 #666;
+		-webkit-transform: rotate(-45deg);
+		transform: rotate(-45deg);
+		/* opacity: .8; */
+		content: ' ';
+}
+.header{
+  background-color: #fff;
+}
+.title{
+  border-bottom: 1px solid #f1f1f1;
+  padding: 0.28rem 0.32rem;
+  color: #222;
+  font-size: 32rpx;
+  position: relative;
+}
+.title::before{
+  position: absolute;
+  content: "";
+  height: 30rpx;
+  left: 16rpx;
+  top: 50%;
+  margin-top: -16rpx;
+  width: 6rpx;
+  background-color: #26A2FF;
+  border-radius: 50rpx;
+}
+.bfb{
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  color: #26A2FF;
+  width: 1.4rem;
+  font-size: 40rpx;
+  margin-left: -0.7rem;
+  margin-top:-0.1rem;
+  text-align: center;
+}
+.bfb2{
+  position: absolute;
+  top: 50%;
+  left: 25%;
+  color: #222;
+  width: 1.4rem;
+  height: 1.4rem;
+  font-size: 24rpx;
+  margin-left: -0.57rem;
+  margin-top:-0.6rem;
+  text-align: center;
+  /* background-color: #F4C04A; */
+}
+.jt{
+  font-size:32rpx;
+  position: relative;
+  /* padding-right: 0.32rem; */
+}
+/* .jt::after{
+  	position: absolute;
+    top: 50%;
+    right: 10rpx;
+    margin-top: -0.1rem;
+		border: 0.06rem solid;
+		border-color: transparent transparent #666 #666;
+		-webkit-transform: rotate(-45deg);
+		transform: rotate(-45deg);
+		content: ' ';
+} */
+.header .item{
+  padding:0.32rem;
+}
+.item .img{
+  width:80rpx;
+  border-radius: 50%;
+  height: 80rpx;
+  text-align: center;
+  line-height: 100rpx;
+  margin-right: 20rpx;
+}
+.img image{
+  width:40rpx;
+  height: 40rpx;
+}
+.msg .num{
+  color: #222;
+  font-size: 36rpx;
+}
+.msg text{
+  color: #969799;
+  font-size: 24rpx;
+}
+.main{
+  background-color: #fff;
+  padding-bottom: 0.24rem;
+}
+.item2{
+  text-align: center;
+}
+.item2 text{
+  color: #222;
+  font-size: 36rpx;
+  margin-bottom: 10rpx;
+}
+.item2 view{
+  color: #969799;
+  font-size: 24rpx;
+}
+.rule-all-text{
+  font-size: 28rpx;
+  color: #999;
+  position: relative;
+  right: 10rpx;
+  bottom: 5rpx;
+}
+.zk{
+  color: #999;
+  text-decoration:line-through;
+}
+.windows-box {
+  background: #fff;
+  border-radius: 20rpx;
+  position: absolute;
+  left: 10%;
+  right: 10%;
+  top: 40%;
+  margin-top: -25%;
+}
+
+.windows-title {
+  padding: 32rpx;
+  color: #999;
+  font-size: 24rpx;
+}
+
+.windows-btn view:nth-child(1) {
+  text-align: right;
+  padding: 32rpx;
+  color: #26A2FF;
+}
+
+.windows-content {
+  /* height: 1rem; */
+  padding: 0 28rpx;
+  font-size: 28rpx;
+  color: #666;
+}
+.windows-content view{
+  margin-bottom: 16rpx;
+}
+.windows-content .chu{
+  font-weight: 600;
+  font-size: 32rpx;
+  color: #222;
+}
+.windows-content2 {
+  height: auto;
+  max-height: 4rem;
+  overflow-y: auto;
+  padding:28rpx;
+  font-size: 32rpx;
+}

+ 137 - 0
pages/statistics/taskStatistical/taskStatistical.axml

@@ -0,0 +1,137 @@
+<view>
+  <view class="{{popupCx}}">
+    <view class="userSelect" a:if="{{isAdministrator}}" catchTap="openSelect">
+      <text class="{{isAllChecked? 'zk':''}} msg">{{names}}</text>
+      <text class="ren">{{users.length}}人</text>
+    </view>
+    <view class="flex-box flex-v-ce staff-all">
+        <view class="flex-1"></view>
+        <label a:if="{{isAdministrator}}" class="flex-box-ce">
+          <text class="rule-all-text">只看自己</text>
+          <checkbox onChange="ruleActiveAll" checked="{{isAllChecked}}"></checkbox>
+        </label>
+    </view>
+    <view class="header margin-bottom">
+      <view class="title">任务现状</view>
+      <view>
+        <view class="flex-box-ce item" style="border-bottom:1px solid #FAFAFB">
+          <text class="flex-1 flex-box-ce" style="border-right:1px solid #FAFAFB" catchTap="openUrl" data-index="1">
+            <view class="img" style="background-color: rgba(245,108,108,0.1);">
+              <image mode="scaleToFill" src="../../../image/yq.png" /></view>
+            <view class="msg">
+              <view class="num">{{result.now.expired}}</view>
+              <text>逾期未完成</text>
+            </view>
+          </text>
+          <text class="flex-1 flex-box-ce" style="padding-left:0.32rem" catchTap="openUrl" data-index="2">
+            <view class="img" style="background-color: rgba(230,162,60,0.1);">
+              <image mode="scaleToFill" src="../../../image/jr.png" /></view>
+            <view class="msg">
+              <view class="num">{{result.now.today_expire}}</view>
+              <text>今日到期</text>
+            </view>
+          </text>
+        </view>
+        <view class="flex-box-ce item">
+          <text class="flex-1 flex-box-ce" style="border-right:1px solid #FAFAFB" catchTap="openUrl" data-index="3">
+            <view class="img" style="background-color: rgba(38,162,255,0.1);">
+              <image mode="scaleToFill" src="../../../image/jxz.png" /></view>
+            <view class="msg">
+              <view class="num">{{result.now.doing}}</view>
+              <text>进行中</text>
+            </view>
+          </text>
+          <text class="flex-1 flex-box-ce" style="padding-left:0.32rem" catchTap="openUrl" data-index="4">
+            <view class="img" style="background-color: rgba(103,194,58,0.1);">
+              <image mode="scaleToFill" src="../../../image/dsp.png" /></view>
+            <view class="msg">
+              <view class="num">{{result.now.reviewing}}</view>
+              <text>待审批</text>
+            </view>
+          </text>
+        </view>
+      </view>
+    </view>
+    <view class="main margin-bottom">
+      <view class="title flex-box-ce flex-d-center">
+        <text catchTap="showText" data-index="2">任务完成统计 <text class="text2">?</text></text>
+        <view class="flex-box-ce" catchTap="showText" data-index="5">
+          <text class="blue jt" data-num="1">{{start_date}}</text>
+          <text style="padding:0 10rpx">~</text>
+          <text class="blue jt" data-num="2">{{end_date}}</text>
+        </view>
+        <!-- <view class="jt" catchTap="openDate">{{date}}</view> -->
+      </view>
+      <view>
+        <view style="position: relative;">
+            <f2 onInit="onInitChart"></f2>
+            <view class="bfb">{{bfb}}%</view>
+        </view>
+        <view class="flex-box-ce">
+          <view class="item2 flex-1">
+            <text>{{result.complete.all}}条</text>
+            <view>总任务数</view>
+          </view>
+          <view class="item2 flex-1">
+            <text>{{result.complete.done}}条</text>
+            <view>完成任务数</view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="main" style="margin-bottom:1rem">
+      <view class="title" catchTap="showText" data-index="3">完成情况占比 <text class="text2">?</text></view>
+      <view style="position: relative;">
+        <f2 onInit="onInitChart2"></f2>
+      </view>
+    </view>
+  </view>
+  <view class="box" animation="{{animationInfo}}">
+    <select-section-staff isLeadership="{{true}}" a:if="{{showStaff}}" isBoss="{{true}}" selectUser="{{users}}" onClose="onClose"  onConfirm="onSelectUser" />
+  </view>
+  <view a:if="{{isBh=='5'}}" class="windows">
+    <view class="windows-box">
+      <view class="windows-title">请选择时间区间</view>
+      <view class="windows-content" style="height:2rem">
+        <view class="flex-box-ce flex-center-center" style="padding-top:0.6rem">
+          <text class="blue jt" data-num="1" catchTap="openDate">{{start_date2}}</text>
+          <text style="padding:0 20rpx">~</text>
+          <text class="blue jt" data-num="2" catchTap="openDate">{{end_date2}}</text>
+        </view>
+      </view>
+      <view class="btns flex-box flex-v-ce">
+        <view class="flex-1" catchTap="showText" data-index="4">取消</view>
+        <view class="flex-1" catchTap="qrDate">确定</view>
+      </view>
+    </view>
+  </view>
+  <view a:if="{{isBh=='2'}}" class="windows">
+    <view class="windows-box" style="top:30%">
+      <view class="windows-title">温馨提示</view>
+      <view class="windows-content">
+          <!-- <view class="chu">支持自定义选择时间范围</view> -->
+          <view class="chu">总任务数</view>
+          <view>只要任务从开始到截止与选择时间段有交叉,或者在选择时间段内完成的,都会加入统计</view>
+          <view class="chu">完成任务数</view>
+          <view>已经完成的任务,包含待审批和已审批通过的,不计算审批驳回的</view>
+          <view class="chu">百分比计算方式</view>
+          <view>完成百分比=完成任务数/总任务数</view>
+      </view>
+      <view class="windows-btn flex-box flex-v-ce">
+        <view class="flex-1" catchTap="showText" data-index="4">我知道了</view>
+      </view>
+    </view>
+  </view>
+  <view a:if="{{isBh=='3'}}" class="windows">
+    <view class="windows-box">
+      <view class="windows-title">温馨提示</view>
+      <view class="windows-content">
+          <view class="chu">按时完成数</view>
+          <view>按时完成任务为截止时间之前完成的任务</view>
+      </view>
+      <view class="windows-btn flex-box flex-v-ce">
+        <view class="flex-1" catchTap="showText" data-index="4">我知道了</view>
+      </view>
+    </view>
+  </view>
+</view>

+ 394 - 0
pages/statistics/taskStatistical/taskStatistical.js

@@ -0,0 +1,394 @@
+var app = getApp()
+var that;
+var animation;
+var setTime;
+var chart1;
+var chart2;
+Page({
+  data: {
+    animationInfo: '',
+    showStaff: true,
+    date: app.globalData.month,
+    names: '',
+    users: [],
+    isAdministrator: true,//是否管理者
+    isAllChecked: false,
+
+    popupCx: '',
+    start_date: '',
+    end_date: '',
+    result: {},
+    isBh:'4',
+    setECharts: [],//柱形图数据
+
+    bfb: '0',//一图百分比
+    sum: 0,
+  },
+  onLoad() {
+    that = this;
+    chart1, chart2 = '';
+    dd.setNavigationBar({ title: "任务统计" });
+    this.init();
+    this.getMonth();//设置日期
+  },
+  // 页面被关闭
+  onUnload() {
+    app.globalData.socketApi.closewebsocket();
+  },
+  onShow() {
+    animation = dd.createAnimation({
+      duration: 200,
+      timeFunction: "linear",
+    });
+    if(this.data.isAllChecked){
+          this.opneWebSocket(true)
+          return false
+    }
+    this.opneWebSocket()
+  },
+  showText(e) {
+    let index = e.target.dataset.index;
+    if(index=='5'){
+      that.setData({
+        start_date2: that.data.start_date,
+        end_date2: that.data.end_date,
+      })
+    }
+    this.setData({ isBh: index })
+  },
+  init() {
+    let manage_scope = app.globalData.userData.employee_detail.manage_scope;
+    let names = '';
+    let users = [];
+    let isAdministrator = true;//是否员工
+    if (manage_scope.length > 0) {
+      isAdministrator = true;
+      manage_scope.forEach((item,index) => {
+        if((index+1)!=manage_scope.length){
+          names += item.name + ',';
+        }else{
+          names += item.name
+        }
+        users.push(item)
+      })
+    } else {
+      isAdministrator = false;
+      names = app.globalData.userData.name;
+      users = [app.globalData.userData];
+    }
+    this.setData({
+      names: names,
+      users: users,
+      isAdministrator: isAdministrator
+    })
+  },
+  openUrl(e) {
+    let index = e.target.dataset.index;
+    let method = 'expiredList';
+    if (index == '1') {
+      method = 'expiredList';
+    } else if (index == '2') {
+      method = 'todayExpireList';
+    } else if (index == '3') {
+      method = 'doingList';
+    } else {
+      method = 'reviewingList';
+    }
+    let target = [];
+    if (this.data.isAllChecked) {
+      target = [app.globalData.userData.id]
+    } else {
+      target = this.data.users.map(item => {
+        return item.id;
+      })
+    }
+    let data = {
+      type: 'task_statistics',
+      start_date: this.data.start_date,
+      end_date: this.data.end_date,
+      target: target,
+      method: method,
+      index: index,
+      page: 1,
+      page_size: 100
+    }
+    dd.navigateTo({
+      url: '../taskSList/taskSList?data=' + JSON.stringify(data)
+    })
+  },
+  onInitChart(F2, config) {
+    const data = [{
+      x: '1',
+      y: 0
+    }];
+    chart1 = new F2.Chart(config);
+    chart1.source(data, { y: { max: 100, min: 0 } });
+    chart1.axis(false);
+    chart1.tooltip(false);
+    chart1.coord('polar', {
+      transposed: true,
+      innerRadius: 1.2,
+      radius: 0.85
+    });
+    chart1.guide().arc({
+      start: [0, 0],
+      end: [1, 99.98],
+      top: false,
+      style: {
+        lineWidth: 20,
+        stroke: '#ccc'
+      }
+    });
+    chart1.interval().position('x*y').size(20).animate({
+      appear: {
+        duration: 1200,
+        easing: 'cubicIn'
+      }
+    });
+    chart1.render();
+  },
+  onInitChart2(F2, config) {
+    const data = [];
+    chart2 = new F2.Chart(config);
+    chart2.source(data, {
+      percent: {
+        formatter: function formatter(val) {
+          return val * 100 + '%';
+        }
+      }
+    });
+    chart2.tooltip(false);
+    chart2.coord('polar', {
+      transposed: true,
+      radius: 0.85
+    });
+    chart2.axis(false);
+    chart2.interval()
+      .position('a*percent')
+      .color('name', ['#1890FF', '#F56C6C', '#2FC25B', '#FACC14', '#F04864', '#8543E0'])
+      .adjust('stack')
+      .style({
+        lineWidth: 1,
+        stroke: '#fff',
+        lineJoin: 'round',
+        lineCap: 'round'
+      })
+      .animate({
+        appear: {
+          duration: 1200,
+          easing: 'bounceOut'
+        }
+      });
+    chart2.render();
+  },
+  ruleActiveAll(e) {
+    this.setData({
+      isAllChecked: e.detail.value
+    })
+    if (e.detail.value) {
+      this.opneWebSocket(true);
+    } else {
+      this.opneWebSocket();
+    }
+  },
+  tsTamp(ydm) {
+    return new Date(ydm).getTime()
+  },
+  opneWebSocket(is) {
+    let timeC = (this.tsTamp(this.data.start_date) - this.tsTamp(this.data.end_date)) / (60 * 60 * 24 * 1000)
+    if (timeC > 0) {
+      app.globalData.showToast("开始时间不能大于结束时间")
+      return
+    }
+    dd.showLoading({
+      content: '加载中...',
+    });
+    setTimeout(() => {
+      dd.hideLoading();
+    }, 600)
+    let target = this.data.users.map(item => {
+      return item.id;
+    })
+    let data = {
+      type: 'task_statistics',
+      start_date: this.data.start_date,
+      end_date: this.data.end_date,
+      target: is ? [app.globalData.userData.id] : target
+    }
+    app.globalData.socketApi.sendData(data, this.onmessageWS);
+  },
+  onmessageWS(e) {
+    // 因为作用域问题,这个函数不能使用this
+    if (e.type == 'task_statistics') {
+      let result = e.result;
+      that.setData({
+        result: result,
+      })
+      setTimeout(() => {
+        that.setChart(result)
+      }, 600)
+    }
+  },
+  setChart(result) {
+    // 图像一
+    // result.complete={
+    //   done:50,
+    //   all:60,
+    //   ahead:40,
+    //   expired:90,
+    // }
+    let bfb = (Math.round(result.complete.done / result.complete.all * 10000) / 100.00);
+    if (bfb !== bfb) { bfb = 0; };
+    if(result.complete.done > result.complete.all){
+      const setECharts = [{ x: '1', y: 100 }];
+      that.setData({
+        bfb: 100
+      })
+      chart1.changeData(setECharts)
+    }else{
+      const setECharts = [{ x: '1', y: bfb }];
+      chart1.changeData(setECharts)
+      that.setData({
+        bfb: bfb
+      })
+    }
+
+    // 图像二
+    let complete = result.complete
+    let sum = complete.ahead + complete.expired;
+    let ahead = (Math.round(complete.ahead / sum * 10000) / 100.00);
+    let expired = (Math.round(complete.expired / sum * 10000) / 100.00);
+    const data = [{
+      name: '按时完成',
+      percent: ahead !== ahead ? 0 : ahead,
+      num: complete.ahead,
+      a: '1'
+    }, {
+      name: '逾期完成',
+      percent: expired !== expired ? 0 : expired,
+      num: complete.expired,
+      a: '1'
+    }];
+    const map = [];
+    data.forEach(function (obj) {
+      map[obj.name] = obj.num + '项    ' + obj.percent + '%';
+    });
+    chart2.legend({
+      position: 'right',
+      itemFormatter: function itemFormatter(val) {
+        return val + '    ' + map[val];
+      }
+    });
+    chart2.changeData(data)
+  },
+  //选择弹窗
+  openSelect() {
+    that.setData({ showStaff: false });
+    if (this.data.isAllChecked) {
+      return false
+    }
+    animation.translateY(0).step();
+    that.setData({
+      showStaff: true,
+      popupCx: 'container__mask',
+      animationInfo: animation.export()
+    });
+  },
+  //关闭规则
+  onClose() {
+    animation.translateY(1200).step();
+    that.setData({
+      popupCx: '',
+      showStaff: false,
+      animationInfo: animation.export()
+    });
+  },
+  //时间选择
+  openDate(e) {
+    let num = e.target.dataset.num
+    let date = num == '1' ? that.data.start_date : that.data.end_date
+    dd.datePicker({
+      format: 'yyyy-MM-dd',
+      currentDate: date,
+      success: (res) => {
+        if (res.date) {
+          if (num == '1') {
+            that.setData({
+              start_date2: res.date,
+            })
+          } else {
+            that.setData({
+              end_date2: res.date,
+            })
+          }
+        }
+      }
+    });
+  },
+  qrDate(){
+      that.setData({
+        start_date: that.data.start_date2,
+        end_date: that.data.end_date2,
+        isBh: "4"
+      })
+
+      if (that.data.isAllChecked) {
+        that.opneWebSocket(true);
+      } else {
+        that.opneWebSocket();
+      }
+  },
+  //选择员工
+  onSelectUser(data) {
+    let names = '', users = [];
+    data.forEach((item,index) => {
+      if((index+1)!=data.length){
+        names += item.name + ',';
+      }else{
+        names += item.name
+      }
+      users.push(item);
+    })
+    this.setData({
+      names: names,
+      users: users,
+    })
+    this.opneWebSocket()
+  },
+  getMonth() {
+    // 获取当前月的第一天
+    var start = new Date();
+    start.setDate(1);
+    // 获取当前月的最后一天
+    var date = new Date();
+    var currentMonth = date.getMonth();
+    var nextMonth = ++currentMonth;
+    var nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1);
+    var oneDay = 1000 * 60 * 60 * 24;
+    var end = new Date(nextMonthFirstDay - oneDay);
+
+    var startDate = this.transferDate(start); // 日期变换
+    var endDate = this.transferDate(end); // 日期变换
+    this.setData({
+      start_date: startDate,
+      end_date: endDate
+    })
+    // return startDate + ' - ' + endDate;
+  },
+  transferDate(date) {
+    // 年
+    var year = date.getFullYear();
+    // 月
+    var month = date.getMonth() + 1;
+    // 日
+    var day = date.getDate();
+    if (month >= 1 && month <= 9) {
+      month = "0" + month;
+    }
+    if (day >= 0 && day <= 9) {
+      day = "0" + day;
+    }
+    var dateString = year + '-' + month + '-' + day;
+    return dateString;
+  }
+});

+ 8 - 0
pages/statistics/taskStatistical/taskStatistical.json

@@ -0,0 +1,8 @@
+{
+  "usingComponents": {
+    "select-section-staff": "/Component/selectSectionStaff/selectSectionStaff",
+    "f2": "@antv/my-f2",
+    "no-data":"/Component/noData/noData"
+  },
+  "allowsBounceVertical": "NO"
+}

+ 6 - 1
pages/statistics/task_rank/task_rank.axml

@@ -36,7 +36,12 @@
           <view a:else class="index">{{item.rank}}</view>
           <view class="flex-1 flex-box flex-v-ce">
             <img-box name="{{item.employee_name}}" key="{{item.id}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
-            <view class="name">{{item.employee_name}}</view>
+                        <view class="users">
+              <view class="name">{{item.employee_name}}</view>
+              <view class="name flex-box dept_name">
+                  <text class="" a:for="{{item.dept_list}}" a:for-index="idx" a:for-item="e">{{e.dept_name}}</text>
+              </view>
+            </view>
           </view>
           <view class="blue" style="margin-right:28rpx;">{{item.point}}</view>
         </view>

+ 1 - 1
pages/workbench/apply/apply.axml

@@ -41,7 +41,7 @@
           </view>
         </view>
         <view class="li">
-          <textarea value="{{item.remark}}" maxlength="100" onInput="bindTextAreaBlur" placeholder="申请内容" data-index="{{index}}"></textarea>
+          <textarea value="{{item.remark}}" maxlength="300" onInput="bindTextAreaBlur" placeholder="申请内容" data-index="{{index}}"></textarea>
           <image mode="scaleToFill" src="../../../image/addImg.png" data-index="{{index}}" class="addImg" catchTap="openImg"/>
         </view>
         <view style="background:#fff;padding:0 28rpx;" a:if="{{item.files[0]}}" class="flex-box flex-v-ce">

+ 2 - 1
pages/workbench/apply/apply.js

@@ -45,7 +45,6 @@ Page({
   },
   onLoad(e) {
     that = this;
-    this.cheakAx()
     dd.setNavigationBar({ title: "申请积分" });
     if (e.id) {
       this.setData({ //获取扫码进入参数 
@@ -79,10 +78,12 @@ Page({
     });
     if (app.globalData.userData) {
       that.showQrcode();
+      that.cheakAx()
     } else {
       app.login(app.globalData.corpId, function (is) {
         if (is) {
           that.showQrcode();
+          that.cheakAx()
         } else {
           dd.reLaunch({
             url: '../../noJurisdiction/noJurisdiction'

+ 2 - 2
pages/workbench/approve/approve.js

@@ -259,8 +259,8 @@ Page({
           pt_Obj: app.getTypesItem(data.pt_id),
         }
       } else if (data.rule_id && data.point) {
-        console.log(2);
-        isData = 2
+        console.log(3);
+        isData = 3
         selectRule = '';
       } else if (data.rule_id) {
         console.log(3);

+ 42 - 3
pages/workbench/index/index.acss

@@ -22,8 +22,38 @@
   line-height: 56rpx;
   font-size: 24rpx;
 }
-
-
+.btnBox button{
+  border-radius: 10rpx;
+  background-color: #089fff;
+  font-size: 0.32rem;
+  height: 70rpx;
+  line-height: 65rpx;
+  width: 240rpx;
+  border-radius: 50rpx;
+  margin: 0 auto;
+}
+.btnBox .btn2{
+   background-color: #fff;
+   border: 2px solid #089fff;
+   color: #089fff;
+}
+.ah{
+  padding-top: 0.24rem;
+  font-size: 0.24rem;
+}
+.kfImg image{
+  position: absolute;
+  width: 0.3rem;
+  height: 0.3rem;
+  top: 0.2rem;
+  right: 0.2rem;
+  
+}
+.kfBj{
+  width: 100%;
+  border-top-left-radius:0.2rem;
+  border-top-right-radius:0.2rem;
+}
 
 .top {
   width: 100%;
@@ -78,7 +108,16 @@
 .headed {
   background-color: #fff;
 }
-
+.btnB{
+  background-color: #26A2FF;
+  width: 200rpx;
+  text-align: center;
+  color: #fff;
+  border-radius: 6rpx;
+  padding: 14rpx 0;
+  margin: 0 auto;
+  margin-bottom: 20rpx;
+}
 .headed-box {
   padding: 32rpx;
   padding-bottom: 0rpx;

+ 17 - 4
pages/workbench/index/index.axml

@@ -10,7 +10,7 @@
       <view>{{headDayBs.b}}</view>
       <view>今日B分</view>
     </view>
-    <view class="flex-1" data-index="1" onTap="openView">
+    <view class="flex-1" data-index="1" onTap="openWs2">
       <view>{{userData.b.month_point}}</view>
       <view>本月B分</view>
     </view>
@@ -30,7 +30,7 @@
       </view>
     </view>
   </view>
-  <view class="flex-box-ce margin-bottom"  style="background:#fff;padding:24rpx 32rpx" a:if="{{noticeTitle}}" onTap="openUrl2">
+  <view class="flex-box-ce margin-bottom" style="background:#fff;padding:24rpx 32rpx" a:if="{{noticeTitle}}" onTap="openUrl2">
     <image mode="scaleToFill" src="../../../image/lb.png" style="width:30rpx;height:30rpx;position:relative;top:-2px"></image>
     <view style="padding:0 20rpx;" class="flex-1 font-flex-word">{{noticeTitle}}</view>
     <image mode="scaleToFill" src="../../../image/right.png" class="img-right"></image>
@@ -40,7 +40,8 @@
       <text class="flex-1" style="font-size:32rpx">排行榜</text>
       <text class="fontColorF" style="font-size:28rpx">每小时更新一次</text>
     </view>
-    <view a:for="{{rankingList}}" class="flex-box flex-v-ce" style="padding:0.28rem; border-bottom: 1px solid #f1f1f1; " data-item="{{item}}" onTap="openViewRanking">
+    <view a:for="{{rankingList}}" class="flex-box flex-v-ce" style="padding:0.28rem; border-bottom: 1px solid #f1f1f1; " 
+      data-item="{{item}}" onTap="openViewRanking">
       <view class="flex-box flex-v-ce flex-1">
         <view class="ranking_name font-flex-word">{{ item.group_name.slice(0,2)}}</view>
         <view class="ranking_num flex-1">
@@ -142,7 +143,7 @@
     <view class="windows-box">
       <view class="title font-flex-word">{{title}}</view>
       <view class="windows-content2">
-        <!-- <view class="title">{{title}}</view> -->
+        <!--<view class="title">{{title}}</view> -->
         <template is="aParse" data="{{aParseData:article.nodes}}"></template>
       </view>
       <view class="btns flex-box flex-v-ce">
@@ -151,4 +152,16 @@
       </view>
     </view>
   </view>
+  <view class="windows" a:if="{{isGz}}" >
+    <view class="windows-box">
+      <image class="kfBj"  mode="widthFix" src="../../../image/tc.jpg" />
+      <view class="textNr">
+        <view style="color:#fff;padding:0 0.5rem;line-height:50rpx;color:#222;margin-bottom:1rem">为了更好地体验,我们将自动为你导入【工作绩效】【企业文化】【规章制度】三大类积分制度</view>
+        <view class="btnBox flex-box-end" style="margin-bottom:0.4rem">
+          <button type="primary" catchTap="openWs2" class="btn2">自行设置</button>
+          <button type="primary" catchTap="openWs">使用推荐制度</button>
+        </view>
+      </view>
+    </view>
+  </view>
 </view>

+ 52 - 52
pages/workbench/index/index.js

@@ -5,6 +5,7 @@ var chart2;
 var chart3;
 var AParse = require('../../../Component/aParse/aParse.js');
 import 'dingtalk-jsapi/entry/union';
+import { setCache, getCache } from '../../../utils/util'
 import { contactAdminToUseApp } from 'dingtalk-design-libs';
 Page({
   data: {
@@ -41,6 +42,8 @@ Page({
     mainCorpId: '',//如果是个人版,这个企业ID是登录者所在的企业ID,不是钉钉那边提供的隐藏企业ID
 
     noticeTitle:'',
+    isGz:false,
+    islog:true,
   },
   onLoad() {
     that = this;
@@ -48,6 +51,7 @@ Page({
   },
   onShow() {
     if (app.globalData.userData) {
+      dd.setNavigationBar({ title: app.globalData.userData.name });
       that.getUserData();
       that.getGg();
       that.getNotice();
@@ -57,6 +61,9 @@ Page({
         isSubject: app.globalData.userData.is_personal == 1 ? true : false,
         mainCorpId: app.globalData.userData.main_corp_id
       })
+      if(!getCache('init_rule_check')){
+        app.globalData.userData.init_rule_check? '':that.setData({ isGz: true})
+      }
       if (app.globalData.isCreator) {
         that.setMenuList("creator");
       } else if (app.globalData.isAdministrator) {
@@ -67,6 +74,7 @@ Page({
     } else {
       app.login(app.globalData.corpId,function (is) {
         if (is) {
+          dd.setNavigationBar({ title: app.globalData.userData.name });
           if (app.globalData.isCreator) {
             that.setMenuList("creator");
           } else if (app.globalData.isAdministrator) {
@@ -77,6 +85,10 @@ Page({
           that.getUserData();
           that.getGg();
           that.getNotice();
+          if(!getCache('init_rule_check')){
+            app.globalData.userData.init_rule_check? '':that.setData({ isGz: true})
+          }
+
           that.setData({
             isAdministrator: app.globalData.isAdministrator,
             getRole_four: app.globalData.isCreator,
@@ -91,58 +103,46 @@ Page({
       },function(){},true)
     }
   },
-  activeA(){
-      dd.createDing({
-          users: ["102250695436416908"], //默认选中用户工号列表;类型: Array<String>
-          corpId: app.globalData.corpId, // 类型: String
-          alertType: 2, // 钉发送方式 0:电话, 1:短信, 2:应用内;类型 Number
-          alertDate: {"format":"yyyy-MM-dd HH:mm", "value":"2019-08-29 08:25"}, // 非必选,定时发送时间, 非定时DING不需要填写
-          type: 1,// 附件类型 1:image, 2:link;类型: Number
-          
-          // 非必选
-          // 附件信息
-          attachment: {
-            images: ["https://www.baidu.com/img/bd_logo1.png?where=super"], // 图片附件, type=1时, 必选;类型: Array<String>
-            // image: "https://www.baidu.com/img/bd_logo1.png?where=super", // 链接附件, type=2时, 必选;类型: String    
-            title: "这是一个测试", // 链接附件, type=2时, 必选;类型: String
-            url: "https://www.baidu.com/", // 链接附件, type=2时, 必选;类型 String
-            text: "测试发钉成功" // 链接附件, type=2时, 必选;类型: String
-          },
-          text: '测试ding',  // 正文
-          bizType :0, // 业务类型 0:通知DING;1:任务;2:会议;
-
-          // 任务信息
-          // bizType=1的时候选填
-          taskInfo: {    
-            ccUsers: ['100', '101'],// 抄送用户列表, 工号,类型: Array<String>
-            deadlineTime: {"format":"yyyy-MM-dd HH:mm", "value":"2015-05-09 08:00"}, // 任务截止时间    
-            taskRemind: 30 // 任务提醒时间, 单位分钟;支持参数: 0:不提醒;15:提前15分钟;60:提前1个小时;180:提前3个小时;1440:提前一天;类型: Number
-          },
-          // 日程信息
-          // bizType=2的时候选填
-          confInfo: {      
-            bizSubType: 0,  // 子业务类型如会议: 0:预约会议, 1:预约电话会议, 2:预约视频会议;类型: Number (注: 目前只有会议才有子业务类型);
-            location: '某某会议室', // 会议地点(非必选),类型: String    
-            startTime: {"format":"yyyy-MM-dd HH:mm", "value":"2015-05-09 08:00"},// 会议开始时间  
-            endTime: {"format":"yyyy-MM-dd HH:mm", "value":"2015-05-09 08:00"},// 会议结束时间    
-            remindMinutes: 30, // 会前提醒。单位分钟;1:不提醒, 0:事件发生时提醒, 5:提前5分钟, 15:提前15分钟, 30:提前30分钟, 60:提前1个小时, 1440:提前一天
-            remindType: 2 // 会议提前提醒方式;0:电话, 1:短信, 2:应用内;类型: Number
-          },
-        
-          success:function(res){
-            /*
-            {
-              "dingId": "1_1_a09f167xxx",
-              "text": "钉正文内容",
-              "result": true
-            }
-            */  
-          },
-          fail:function(err){
-          }
+  gettrees(fn) {
+      app.$get2("api/integral/rule/trees", {cycle_type: 1 }).then((res)=>{
+        var rule_tree = res.data.data.rule_tree
+        if(rule_tree.length==0&&app.globalData.isCreator){
+          fn(false)
+        }else{
+          fn(true)
+        }
       })
   },
-
+  openWs(){
+    if(!that.data.islog){
+      return false;
+    }
+    that.setData({
+      islog:false
+    })
+    app.globalData.socketApi.sendData({type:'init_rule'}, function(e){
+        console.log(e)
+        that.setData({
+            islog:true
+        })
+        if (e.type == 'init_rule') {
+          if(e.code==1&&e.result.done){
+            that.setData({ isGz:false})
+            app.globalData.showToast('已导入');
+            app.globalData.socketApi.closewebsocket();
+          }else{
+            app.globalData.showToast(e.msg);
+          }
+        }
+    });
+  },
+  openWs2(){
+    app.$post("api/integral/employee/init_rule_notice").then((res) => {
+        app.globalData.showToast('已发送通知');
+        setCache('init_rule_check',true)
+        that.setData({ isGz:false})
+    }, (err) => { })
+  },
   openGly() {
     contactAdminToUseApp({ id: '55493', corpId: that.data.mainCorpId })
       .catch((err) => {
@@ -411,7 +411,6 @@ Page({
       console.error(e)
     })
   },
-
   //获取个人统计
   getUserData() {
     var http1 = app.$get2("api/integral/statistics", { employee_id: 0, month: app.globalData.month })
@@ -419,6 +418,7 @@ Page({
       month: app.globalData.month,
       page: 1,
       page_size: 5,
+	  order_key:'update_time',
       employee_ids: app.globalData.isCreator ? '' : app.globalData.userData.id
     })
     var http3 = app.$get2("api/integral/review/list", { type: 'waiting', source_type: 0, page: 1, pt_id: 0 })
@@ -432,7 +432,6 @@ Page({
       if (values[0]) {
         let data = values[0].data.data;
         var task = data.task;
-        dd.setNavigationBar({ title: data.name });
         var ratio = task.reward.point === 0 || task.deduction.point === 0 ? '-' : `${task.ratio.ratio}:1`
         var target_ratio = task.ratio.target_ratio <= 0 ? '0:0' : `${task.ratio.target_ratio}:1`
         data.ratio = {
@@ -507,6 +506,7 @@ Page({
       }
       if(values[7]){
            let data = values[7].data.data;
+           app.globalData.config=data;
            let menuList=JSON.parse(JSON.stringify( that.data.menuList))
            if(data.shop_status==1){
              if(menuList[menuList.length-2].name!='福利兑换'){

+ 1 - 1
pages/workbench/jk_B/jk_B.axml

@@ -91,7 +91,7 @@
           <image mode="scaleToFill" src="../../../image/right.png" class="rightImg" />
         </view>
         <view class="li">
-          <textarea maxlength="100" value="{{item.remark}}" onInput="bindTextAreaBlur" placeholder="请输入事件内容" data-index="{{index}}"></textarea>
+          <textarea maxlength="300" value="{{item.remark}}" onInput="bindTextAreaBlur" placeholder="请输入事件内容" data-index="{{index}}"></textarea>
           <image mode="scaleToFill" src="../../../image/addImg.png" data-index="{{index}}" class="addImg" catchTap="openImg" />
         </view>
         <view style="background:#fff;padding:0 28rpx;" a:if="{{item.files[0]}}" class="flex-box flex-v-ce">

+ 2 - 1
pages/workbench/my_approve/my_approve.axml

@@ -8,6 +8,7 @@
       </view>
       <button size="mini" type="primary" catchTap="openPl">批量审批</button>
     </form>
+    <view class="yellowText" a:if="{{config.event_review_status==1}}">复核开启后,积分需管理员复核后才计入排名和统计</view>
     <view class="flex-box flex-v-ce selectItems border-bottom">
       <view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-1" catchTap="activeItem">待我审批</view>
       <view data-index="2" class="{{activeIndex == 2? 'active':''}} flex-1" catchTap="activeItem">我已审批</view>
@@ -21,7 +22,7 @@
     </view>
     <view class="main scroll">
       <no-bata a:if="{{dataList.length==0}}"></no-bata>
-      <scroll-view class="scroll" scroll-y="{{true}}" a:if="{{dataList.length>0&&activeIndex==1}}" onScrollToLower="onScrollToLower">
+      <scroll-view class="scroll" style="{{(config.event_review_status==1)?'height: calc(100vh - 2.48rem)':''}}" scroll-y="{{true}}" a:if="{{dataList.length>0&&activeIndex==1}}" onScrollToLower="onScrollToLower">
         <view class="flex-box li border-bottom" data-item="{{item}}" catchTap="openDetail" a:for="{{dataList}}">
           <img-box name="{{item.employee_name}}" id="{{item.employee_id}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
           <view class="flex-1 main-right">

+ 3 - 0
pages/workbench/my_approve/my_approve.js

@@ -33,6 +33,9 @@ Page({
   },
   onLoad() {
     that = this;
+    this.setData({
+      config: app.globalData.config
+    })
     dd.setNavigationBar({ title: "我的审批" });
   },
   onShow() {

+ 2 - 2
pages/workbench/prize_buckle/prize_buckle.acss

@@ -4,7 +4,7 @@
   color: #303133;
   text-align: center;
   margin-bottom: 24rpx;
-  padding: 10rpx 0;
+  /* padding: 10rpx 0; */
 }
 .top text{
   position: relative;
@@ -16,7 +16,7 @@
   margin-right: 10rpx;
 }
 .date{
-  padding: 10rpx 0;
+  padding: 20rpx 0;
 }
 .headed-box{
   padding:28rpx 28rpx;

+ 2 - 0
pages/workbench/prize_buckle/prize_buckle.axml

@@ -11,6 +11,8 @@
         <img-box name="{{userData.name}}" imgUrl="{{userData.img_url}}" height="70rpx" width="70rpx" fSize="24rpx"></img-box>
         <view class="name">{{userData.name}}</view>
         <text class="index" a:if="{{isDb}}">全部达标</text>
+        <text class="flex-1"></text>
+        <text class="blue" catchTap="open2">奖扣明细<text style="font-size:0.24rem;position: relative;right:-10rpx;top:-4rpx">〉</text></text>
       </view>
       <view class="flex-box flex-v-ce target_items">
         <view class="flex-1">

+ 5 - 0
pages/workbench/prize_buckle/prize_buckle.js

@@ -43,6 +43,11 @@ Page({
       },function(){})
     }
   },
+  open2(){
+    dd.navigateTo({
+      url: '../../statistics/integralEventTwo/integralEventTwo?month='+that.data.date+'&id='+that.data.userData.id
+    })
+  },
   onInitChart(F2, config) {
     chart1 = new F2.Chart(config);
     chart1.source(that.data.chartData, {

+ 9 - 3
pages/workbench/statistics_A/statistics_A.js

@@ -7,10 +7,16 @@ Page({
     date: app.globalData.month,
     data_a: [],
     chartData: [],//折线图数据
+    employee_id:0,
   },
-  onLoad() {
+  onLoad(e) {
+    if(e.employee_id){
+      this.setData({employee_id:e.employee_id})
+      dd.setNavigationBar({ title: `${e.name}的A分统计` });
+    }else{
+      dd.setNavigationBar({ title: "我的A分统计" });
+    }
     that = this;
-    dd.setNavigationBar({ title: "我的A分统计" });
   },
   //打开更多
   openMore() {
@@ -68,7 +74,7 @@ Page({
   },
   //获取积分事件
   getIncidentLsit() {
-    app.$get("api/integral/statistics/a", { employee_id: 0, month: that.data.date }).then((res) => {
+    app.$get("api/integral/statistics/a", { employee_id: that.data.employee_id, month: that.data.date }).then((res) => {
       const { a, chart, list } = res.data.data
       const points = chart.reward.map((rewardItem, index) => {
         return { date: rewardItem.month, value: rewardItem.point - (chart.deduction[index].point || 0) }

+ 10 - 4
pages/workbench/statistics_B/statistics_B.js

@@ -10,11 +10,17 @@ Page({
     chartData: [],//折线图数据
     pieData: [1],//饼型图数据
     isShowTb:true,
+    employee_id:0,
   },
-  onLoad() {
+  onLoad(e) {
+    if(e.employee_id){
+      this.setData({employee_id:e.employee_id})
+      dd.setNavigationBar({ title: `${e.name}的B分统计` });
+    }else{
+      dd.setNavigationBar({ title: "我的B分统计" });
+    }
     that = this;
     chart1, chart2 = '';
-    dd.setNavigationBar({ title: "我的B分统计" });
   },
   //打开更多
   openMore() {
@@ -139,8 +145,8 @@ Page({
       }
       start_date =n+"-"+y;
     }
-    var incident = app.$get("api/integral/statistics/b", { employee_id: 0, start_date: start_date, end_date: that.data.date, show_type: '2' });
-    var pei = app.$get("api/integral/statistics/pie/b", { employee_id: 0, month: that.data.date });
+    var incident = app.$get("api/integral/statistics/b", { employee_id: that.data.employee_id, start_date: start_date, end_date: that.data.date, show_type: '2' });
+    var pei = app.$get("api/integral/statistics/pie/b", { employee_id: that.data.employee_id, month: that.data.date });
     Promise.all([incident, pei]).then(resArr => {
       if (resArr[0].data.code == 1) {
         const { b, chart, good, bad } = resArr[0].data.data

+ 50 - 1
utils/util.js

@@ -54,10 +54,59 @@ const generateUUID = () => {
   });
   return uuid;
 };
+// 设置缓存
+const setCache = (key, val) => {
+  dd.setStorageSync({
+    key: key,
+    data: val
+  });
+}
+// 获取缓存
+const getCache = (key) => {
+  return dd.getStorageSync({ key: key }).data;
+}
+// 防抖
+const _debounce = (fn, delay = 500) => {
+  let timeout = null; // 创建一个标记用来存放定时器的返回值
+  return function () {
+    // 每当用户输入的时候把前一个setTimeout clear掉
+    clearTimeout(timeout);
+    // 然后又创建一个新的setTimeout,
+    // 这样就能保证输入字符后的 interval 间隔内如果还有字符输入的话,就不会执行fn函数
+    timeout = setTimeout(() => {
+      // 关键在第一个参数,为了确保上下文环境为当前的this,所以不能直接用fn
+      fn.apply(this, arguments);
+    }, delay);
+  }
+}
+// 节流
+const _throttle = (fn, interval = 500) => {
+  var last;
+  var timer;
+  return function () {
+    var th = this;
+    var args = arguments;
+    var now = +new Date();
+    if (last && now - last < interval) {
+      clearTimeout(timer);
+      timer = setTimeout(function () { //用户最后一次点击时间间隔小于设置时间执行
+        last = now;
+        fn.apply(th, args);
+      }, interval);
+    } else {
+      last = now;
+      fn.apply(th, args);
+    }
+  }
+}
 
 module.exports = {
   formatTime,
   arrRemoveObj,
   getTypeItem,
-  generateUUID
+  generateUUID,
+  setCache,
+  getCache,
+  _debounce,
+  _throttle,
 }