347617796@qq.com 2 年之前
父节点
当前提交
b26229e2ef
共有 63 个文件被更改,包括 1640 次插入317 次删除
  1. 9 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. 1 1
      Component/selectEnevt/selectEnevt.js
  7. 0 1
      Component/selectRule/selectRule.axml
  8. 2 2
      Component/selectRule/selectRule.js
  9. 9 2
      app.acss
  10. 19 2
      app.js
  11. 3 1
      app.json
  12. 二进制
      image/tc.jpg
  13. 5 0
      package-lock.json
  14. 41 42
      pages/deploy/setCheck/setCheck.axml
  15. 1 1
      pages/reportBox/report/report.js
  16. 5 2
      pages/statistics/B_ranking/B_ranking.axml
  17. 39 34
      pages/statistics/B_ranking/B_ranking.js
  18. 11 9
      pages/statistics/C_ranking/C_ranking.axml
  19. 45 9
      pages/statistics/C_ranking/C_ranking.js
  20. 12 8
      pages/statistics/allTask/allTask.axml
  21. 3 0
      pages/statistics/allTask/allTask.js
  22. 3 1
      pages/statistics/check_top/check_top.axml
  23. 75 1
      pages/statistics/glz_execute/glz_execute.acss
  24. 69 22
      pages/statistics/glz_execute/glz_execute.axml
  25. 62 6
      pages/statistics/glz_execute/glz_execute.js
  26. 11 1
      pages/statistics/integralEvent/integralEvent.acss
  27. 28 16
      pages/statistics/integralEvent/integralEvent.axml
  28. 44 25
      pages/statistics/integralEvent/integralEvent.js
  29. 51 0
      pages/statistics/integralEventTwo/integralEventTwo.acss
  30. 40 0
      pages/statistics/integralEventTwo/integralEventTwo.axml
  31. 193 0
      pages/statistics/integralEventTwo/integralEventTwo.js
  32. 9 0
      pages/statistics/integralEventTwo/integralEventTwo.json
  33. 89 0
      pages/statistics/jfDetail/jfDetail.acss
  34. 42 0
      pages/statistics/jfDetail/jfDetail.axml
  35. 202 0
      pages/statistics/jfDetail/jfDetail.js
  36. 7 0
      pages/statistics/jfDetail/jfDetail.json
  37. 6 1
      pages/statistics/log_rank/log_rank.axml
  38. 8 4
      pages/statistics/my_PrizeBuckle/my_PrizeBuckle.axml
  39. 7 2
      pages/statistics/my_PrizeBuckle/my_PrizeBuckle.js
  40. 12 5
      pages/statistics/my_apply/my_apply.axml
  41. 28 13
      pages/statistics/my_apply/my_apply.js
  42. 2 1
      pages/statistics/my_sp/my_sp.axml
  43. 5 1
      pages/statistics/my_sp/my_sp.js
  44. 3 2
      pages/statistics/my_task/my_task.axml
  45. 4 0
      pages/statistics/my_task/my_task.js
  46. 13 8
      pages/statistics/prizeBuckleDetail/prizeBuckleDetail.axml
  47. 42 24
      pages/statistics/prizeBuckleDetail/prizeBuckleDetail.js
  48. 2 1
      pages/statistics/prizeBuckleDetail/prizeBuckleDetail.json
  49. 5 2
      pages/statistics/sectionRanking/sectionRanking.axml
  50. 84 44
      pages/statistics/sectionRanking/sectionRanking.js
  51. 2 2
      pages/statistics/taskStatistical/taskStatistical.axml
  52. 6 1
      pages/statistics/task_rank/task_rank.axml
  53. 42 3
      pages/workbench/index/index.acss
  54. 17 4
      pages/workbench/index/index.axml
  55. 52 2
      pages/workbench/index/index.js
  56. 2 1
      pages/workbench/my_approve/my_approve.axml
  57. 3 0
      pages/workbench/my_approve/my_approve.js
  58. 2 2
      pages/workbench/prize_buckle/prize_buckle.acss
  59. 2 0
      pages/workbench/prize_buckle/prize_buckle.axml
  60. 5 0
      pages/workbench/prize_buckle/prize_buckle.js
  61. 9 3
      pages/workbench/statistics_A/statistics_A.js
  62. 10 4
      pages/workbench/statistics_B/statistics_B.js
  63. 50 1
      utils/util.js

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

@@ -64,6 +64,15 @@
       "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"
+  }
+}

+ 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);
     },

+ 9 - 2
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;
 	}

+ 19 - 2
app.js

@@ -3,7 +3,7 @@ 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://app55493.eapps.dingtalkcloud.com/";//正式
 var that;
 var yearArr = [];
 var year = formatTime(new Date()).year;
@@ -15,7 +15,7 @@ App({
   globalData: {
     baseUrl:baseUrl,
     // webScoketUrl: "test-ding.g107.com",//webScoket测试
-    webScoketUrl: "ding.insys.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({

+ 3 - 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",
@@ -73,7 +74,8 @@
     "pages/reportBox/newspaperTask/newspaperTask",
     "pages/reportBox/moreE/moreE",
     "pages/statistics/taskStatistical/taskStatistical",
-    "pages/statistics/taskSList/taskSList"
+    "pages/statistics/taskSList/taskSList",
+    "pages/statistics/jfDetail/jfDetail"
   ],
   "window": {
     "defaultTitle": "功道云",

二进制
image/tc.jpg


+ 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",

+ 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() {

+ 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()
   },
 });

+ 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() {

+ 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 a:if="{{see_log==1}}" 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>

+ 42 - 24
pages/statistics/prizeBuckleDetail/prizeBuckleDetail.js

@@ -4,30 +4,48 @@ var that;
 Page({
   data: {
     date: app.globalData.month,
-    review_id:'',
-    userId:'',
-    see_log:1,
+    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) => {
+  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})
+      this.setData({ see_log: data.see_log ? data.see_log : 0 })
     })
-	},
+  },
   openCx() {
     dd.confirm({
       title: '撤销奖扣',
@@ -36,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];
@@ -54,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;
@@ -74,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>

+ 84 - 44
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: that.data.rule_id,
-      sort:that.data.sort,
-      position:that.data.position,
-      page_size:20
+      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();
   },
 });

+ 2 - 2
pages/statistics/taskStatistical/taskStatistical.axml

@@ -109,11 +109,11 @@
     <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 class="chu">总任务数</view>
           <view>只要任务从开始到截止与选择时间段有交叉,或者在选择时间段内完成的,都会加入统计</view>
           <view class="chu">完成任务数</view>
-          <view>已经完成的任务,包含待审批和已审批通过的,不计算审批驳回的</view>
+          <view>已经完成的任务,包含待审批和已审批通过的,不计算审批驳回的</view>
           <view class="chu">百分比计算方式</view>
           <view>完成百分比=完成任务数/总任务数</view>
       </view>

+ 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>

+ 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 - 2
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,11 +42,12 @@ Page({
     mainCorpId: '',//如果是个人版,这个企业ID是登录者所在的企业ID,不是钉钉那边提供的隐藏企业ID
 
     noticeTitle:'',
+    isGz:false,
+    islog:true,
   },
   onLoad() {
     that = this;
     chart1, chart2, chart3 = '';
-
   },
   onShow() {
     if (app.globalData.userData) {
@@ -59,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) {
@@ -80,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,
@@ -94,6 +103,46 @@ Page({
       },function(){},true)
     }
   },
+  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) => {
@@ -362,7 +411,6 @@ Page({
       console.error(e)
     })
   },
-
   //获取个人统计
   getUserData() {
     var http1 = app.$get2("api/integral/statistics", { employee_id: 0, month: app.globalData.month })
@@ -370,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 })
@@ -457,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!='福利兑换'){

+ 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,
 }