347617796@qq.com 4 lat temu
rodzic
commit
4a5df01614
58 zmienionych plików z 697 dodań i 424 usunięć
  1. 2 2
      .tea/entryFiles-development/index$.web.js
  2. 2 2
      .tea/entryFiles-development/index$.worker.js
  3. 2 2
      .tea/entryFiles-production/index$.web.js
  4. 2 2
      .tea/entryFiles-production/index$.worker.js
  5. 5 2
      Component/noData/noData.acss
  6. 1 1
      Component/noData/noData.axml
  7. 4 4
      Component/selectRule/selectRule.axml
  8. 10 9
      Component/selectRule/selectRule.js
  9. 4 6
      Component/selectRule_two/selectRule_two.axml
  10. 8 23
      Component/selectRule_two/selectRule_two.js
  11. 1 1
      Component/selectSection/selectSection.axml
  12. 1 1
      Component/selectSectionStaff/selectSectionStaff.axml
  13. 9 5
      Component/selectSectionStaff/selectSectionStaff.js
  14. 1 1
      Component/selectSectionStaff_tow/selectSectionStaff_tow.js
  15. 2 2
      Component/selectType/selectType.axml
  16. 12 1
      Component/selectType/selectType.js
  17. 3 3
      app.acss
  18. 5 4
      app.js
  19. 4 4
      pages/deploy/index/index.axml
  20. 1 1
      pages/deploy/integralRule/integralRule.js
  21. 1 0
      pages/deploy/organization/organization.acss
  22. 0 1
      pages/deploy/organization/organization.js
  23. 7 3
      pages/deploy/setCheck/setCheck.acss
  24. 18 31
      pages/deploy/setCheck/setCheck.axml
  25. 13 2
      pages/deploy/setCheck/setCheck.js
  26. 10 9
      pages/init/init.js
  27. 2 2
      pages/statistics/B_ranking/B_ranking.axml
  28. 4 4
      pages/statistics/C_ranking/C_ranking.axml
  29. 1 0
      pages/statistics/addCustom/addCustom.acss
  30. 3 3
      pages/statistics/addCustom/addCustom.axml
  31. 1 1
      pages/statistics/addCustom/addCustom.js
  32. 13 2
      pages/statistics/customRamking/customRamking.acss
  33. 8 5
      pages/statistics/customRamking/customRamking.axml
  34. 21 0
      pages/statistics/customRamking/customRamking.js
  35. 32 23
      pages/statistics/integralEvent/integralEvent.js
  36. 2 2
      pages/statistics/my_PrizeBuckle/my_PrizeBuckle.axml
  37. 13 8
      pages/statistics/my_PrizeBuckle/my_PrizeBuckle.js
  38. 12 8
      pages/statistics/my_apply/my_apply.js
  39. 2 2
      pages/statistics/sectionRanking/sectionRanking.axml
  40. 3 1
      pages/statistics/sectionRanking/sectionRanking.js
  41. 0 1
      pages/workbench/apply/apply.acss
  42. 57 39
      pages/workbench/apply/apply.js
  43. 0 1
      pages/workbench/approve/approve.acss
  44. 10 5
      pages/workbench/approve/approve.js
  45. 2 1
      pages/workbench/approveDetail/approveDetail.acss
  46. 12 3
      pages/workbench/approveDetail/approveDetail.js
  47. 4 0
      pages/workbench/index/index.acss
  48. 23 6
      pages/workbench/index/index.axml
  49. 122 13
      pages/workbench/index/index.js
  50. 2 1
      pages/workbench/index/index.json
  51. 2 2
      pages/workbench/jk_B/jk_B.axml
  52. 123 119
      pages/workbench/jk_B/jk_B.js
  53. 4 4
      pages/workbench/my_approve/my_approve.axml
  54. 30 14
      pages/workbench/my_approve/my_approve.js
  55. 2 1
      pages/workbench/prize_buckle/prize_buckle.js
  56. 1 1
      pages/workbench/statistics_A/statistics_A.axml
  57. 2 3
      pages/workbench/statistics_A/statistics_A.js
  58. 56 27
      pages/workbench/statistics_B/statistics_B.js

+ 2 - 2
.tea/entryFiles-development/index$.web.js

@@ -1,9 +1,9 @@
 require('@alipay/appx-compiler/lib/sjsEnvInit');
 require('./config$');
 
+require('../../node_modules/@antv/my-f2/es/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/img-box/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/noData/noData?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
-require('../../node_modules/@antv/my-f2/es/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectRule/selectRule?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectType/selectType?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectSectionStaff_tow/selectSectionStaff_tow?hash=67592639e2c104cea398f9badcdafb39eb607b02');
@@ -15,7 +15,7 @@ require('../../Component/selectStaff/selectStaff?hash=67592639e2c104cea398f9badc
 require('../../Component/selectRule_two/selectRule_two?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectDate_two/selectDate_two?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectSx/selectSx?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
-require('../../pages/workbench/index/index?hash=515236f8c96af7bcc38156941a11817af0611c88');
+require('../../pages/workbench/index/index?hash=34625d962dc6fc98112eb2057eee0daeef5552eb');
 require('../../pages/statistics/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/deploy/index/index?hash=2480af6fe59ab13e82f53b90e2783b2c750a746c');
 require('../../pages/workbench/statistics_A/statistics_A?hash=bdb0bce92eecbc6877ffeb617de4ef47419f5593');

+ 2 - 2
.tea/entryFiles-development/index$.worker.js

@@ -29,9 +29,9 @@ if(AFAppX.registerApp) {
 
 function success() {
 require('../../app');
+require('../../node_modules/@antv/my-f2/es/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/img-box/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/noData/noData?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
-require('../../node_modules/@antv/my-f2/es/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectRule/selectRule?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectType/selectType?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectSectionStaff_tow/selectSectionStaff_tow?hash=67592639e2c104cea398f9badcdafb39eb607b02');
@@ -43,7 +43,7 @@ require('../../Component/selectStaff/selectStaff?hash=67592639e2c104cea398f9badc
 require('../../Component/selectRule_two/selectRule_two?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectDate_two/selectDate_two?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectSx/selectSx?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
-require('../../pages/workbench/index/index?hash=515236f8c96af7bcc38156941a11817af0611c88');
+require('../../pages/workbench/index/index?hash=34625d962dc6fc98112eb2057eee0daeef5552eb');
 require('../../pages/statistics/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/deploy/index/index?hash=2480af6fe59ab13e82f53b90e2783b2c750a746c');
 require('../../pages/workbench/statistics_A/statistics_A?hash=bdb0bce92eecbc6877ffeb617de4ef47419f5593');

+ 2 - 2
.tea/entryFiles-production/index$.web.js

@@ -1,9 +1,9 @@
 require('@alipay/appx-compiler/lib/sjsEnvInit');
 require('./config$');
 
+require('../../node_modules/@antv/my-f2/es/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/img-box/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/noData/noData?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
-require('../../node_modules/@antv/my-f2/es/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectRule/selectRule?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectType/selectType?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectSectionStaff_tow/selectSectionStaff_tow?hash=67592639e2c104cea398f9badcdafb39eb607b02');
@@ -15,7 +15,7 @@ require('../../Component/selectStaff/selectStaff?hash=67592639e2c104cea398f9badc
 require('../../Component/selectRule_two/selectRule_two?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectDate_two/selectDate_two?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectSx/selectSx?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
-require('../../pages/workbench/index/index?hash=515236f8c96af7bcc38156941a11817af0611c88');
+require('../../pages/workbench/index/index?hash=34625d962dc6fc98112eb2057eee0daeef5552eb');
 require('../../pages/statistics/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/deploy/index/index?hash=2480af6fe59ab13e82f53b90e2783b2c750a746c');
 require('../../pages/workbench/statistics_A/statistics_A?hash=bdb0bce92eecbc6877ffeb617de4ef47419f5593');

+ 2 - 2
.tea/entryFiles-production/index$.worker.js

@@ -54,9 +54,9 @@ if(AFAppX.registerApp) {
 
 function success() {
 require('../../app');
+require('../../node_modules/@antv/my-f2/es/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/img-box/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/noData/noData?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
-require('../../node_modules/@antv/my-f2/es/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectRule/selectRule?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectType/selectType?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectSectionStaff_tow/selectSectionStaff_tow?hash=67592639e2c104cea398f9badcdafb39eb607b02');
@@ -68,7 +68,7 @@ require('../../Component/selectStaff/selectStaff?hash=67592639e2c104cea398f9badc
 require('../../Component/selectRule_two/selectRule_two?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectDate_two/selectDate_two?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
 require('../../Component/selectSx/selectSx?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
-require('../../pages/workbench/index/index?hash=515236f8c96af7bcc38156941a11817af0611c88');
+require('../../pages/workbench/index/index?hash=34625d962dc6fc98112eb2057eee0daeef5552eb');
 require('../../pages/statistics/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/deploy/index/index?hash=2480af6fe59ab13e82f53b90e2783b2c750a746c');
 require('../../pages/workbench/statistics_A/statistics_A?hash=bdb0bce92eecbc6877ffeb617de4ef47419f5593');

+ 5 - 2
Component/noData/noData.acss

@@ -3,6 +3,9 @@
   color: #909399;
 }
 .nodata image{
-  width: 400rpx;
-  height: 400rpx;
+  width: 340rpx;
+  height: 340rpx;
+}
+.nodata .content{
+  margin-bottom: 20rpx;
 }

+ 1 - 1
Component/noData/noData.axml

@@ -1,6 +1,6 @@
 <view>
   <view class="flex-box-v flex-center-center  nodata">
     <image mode="scaleToFill" src="../../../image/noData.png"/>
-    <view>{{content}}</view>
+    <view class="content">{{content}}</view>
   </view>
 </view>

+ 4 - 4
Component/selectRule/selectRule.axml

@@ -27,9 +27,9 @@
               <radio value="{{item}}" checked="{{item.checked}}"/>{{item.value}}</view>
             <view class="radio-right flex-1">
               <view>{{item.remark}}</view>
-              <view class="red num" a:if="{{item.min_point>0}}">+{{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}
+              <view class="red num" a:if="{{item.min_point>0}}">+{{(item.range_type == 1 ? item.min_point : item.min_point +' ~ '+ item.max_point)}}
                 <text class="fontColorT" style="margin-left:10rpx">{{item.pt_Obj.name}}</text></view>
-              <view class="green num" a:if="{{item.min_point<0}}">{{(item.range_type == 1 ? item.min_point : item.min_point+''+item.max_point)}}
+              <view class="green num" a:if="{{item.min_point<0}}">{{(item.range_type == 1 ? item.min_point : item.min_point+' ~ '+item.max_point)}}
                 <text class="fontColorT" style="margin-left:10rpx">{{item.pt_Obj.name}}</text></view>
             </view>
           </label>
@@ -44,9 +44,9 @@
             <radio value="{{item}}" checked="{{item.checked}}"/>{{item.value}}</view>
           <view class="radio-right flex-1">
             <view>{{item.remark}}</view>
-            <view class="red num" a:if="{{item.min_point<0}}">{{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}
+            <view class="green num" a:if="{{item.min_point<0}}">{{(item.range_type == 1 ? item.min_point : item.min_point+' ~ '+item.max_point)}}
               <text class="fontColorT" style="margin-left:10rpx">{{item.pt_Obj.name}}</text></view>
-            <view class="green num" a:if="{{item.min_point>0}}">+{{(item.range_type == 1 ? item.min_point : item.min_point+'~'+item.max_point)}}
+            <view class="red num" a:if="{{item.min_point>0}}">+{{(item.range_type == 1 ? item.min_point : item.min_point+' ~ '+item.max_point)}}
               <text class="fontColorT" style="margin-left:10rpx">{{item.pt_Obj.name}}</text></view>
           </view>
         </label>

+ 10 - 9
Component/selectRule/selectRule.js

@@ -48,19 +48,20 @@ Component({
           activeIndex:'',
           item_child_list:[],
           item_list: item_list,
+          activeItemIndex:'',
         })
         return false;
       }
       this.setData({item_child_list:[]});
       if(item.child&&item.child.length>0){
-          this.setData({
-            activeItemIndex:item.child[0].id
-          })
-        if(item.child[0].child&&item.child[0].child.length>0){
-          this.setData({
-            item_child_list:item.child[0].child
-          })
-        }
+          // this.setData({
+          //   activeItemIndex:item.child[0].id
+          // })
+        // if(item.child[0].child&&item.child[0].child.length>0){
+        //   this.setData({
+        //     item_child_list:item.child[0].child
+        //   })
+        // }
       }
       this.setData({
         activeIndex:item.id
@@ -110,7 +111,7 @@ Component({
         typeObj=app.getTypesItem(that.props.isGzType);
         pt_id=typeObj.id;
       }
-      app.$get("api/integral/rule/trees", { pt_id: pt_id }).then((res)=>{
+      app.$get("api/integral/rule/trees", { pt_id: pt_id,cycle_type: 1 }).then((res)=>{
         var item_list = res.data.data.item_list
         var rule_tree = res.data.data.rule_tree
         var list = []

+ 4 - 6
Component/selectRule_two/selectRule_two.axml

@@ -3,18 +3,16 @@
   <view class="date-header {{isShow?'showPop':''}}">
     <view>
       <view class="flex-box flex-v-ce shu" a:if="{{terr.length>1}}">
-        <view a:for="{{terr}}" class="flex-box flex-v-ce" data-index="{{index}}" catchTap="activeItem" data-item="{{item}}">
-          <image mode="scaleToFill" src="../../../image/right.png" style="width:20rpx;height:20rpx;margin:0 6rpx;" a:if="{{index!=0}}"/>
-                {{item.name}}
+        <view a:for="{{terr}}" class="flex-box flex-v-ce flex-d-wrap" data-index="{{index}}" catchTap="activeItem" data-item="{{item}}">
+          <image mode="scaleToFill" src="../../../image/right.png" style="width:20rpx;height:20rpx;margin:0 6rpx;" a:if="{{index!=0}}"/> {{item.name}}
         </view>
       </view>
       <scroll-view class="ul" scroll-y="{{true}}">
         <radio-group class="radio-group" onChange="radioChange">
           <view class="flex-box flex-v-ce li" a:for="{{rule_tree}}">
             <label class="flex-box flex-v-ce" style="width:88%;height:56rpx">
-              <radio value="{{item}}" checked="{{item.checked}}" name="{{item.id}}"/>
-              <view class="font-flex-word" style="margin-left:10rpx;width:90%">{{item.name}}</view>
-            </label>
+              <radio value="{{item}}" name="{{item.id}}"/>
+              <view class="font-flex-word" style="margin-left:10rpx;width:90%">{{item.name}}</view></label>
             <view class="xia" data-item="{{item}}" catchTap="openDown" a:if="{{item.child.length>0}}">| 下级</view>
           </view>
         </radio-group>

+ 8 - 23
Component/selectRule_two/selectRule_two.js

@@ -46,28 +46,22 @@ Component({
       } else {
         var arr = terr.slice(0, index + 1);
         this.setData({
-          rule_tree: item._child,
+          rule_tree: item.child,
           terr: arr
         })
       }
     },
     // 点击下一级
     openDown(e) {
-      this.setData({ rule_tree: [] });
+      that.setData({ rule_tree:[]});
       var item = e.target.dataset.item;
       var terr = this.data.terr;
       terr.push(item);
-      if (item.child.length > 0) {
-        item.child.map(item => {
-          if (item.id == this.props.defaultSection) {
-            item.checked = true;
-          }
-        })
-        that.setData({
-          rule_tree: item.child,
-          terr: terr
-        })
-      }
+      console.log(item.child);
+      that.setData({
+        rule_tree: item.child,
+        terr: terr
+      })
     },
     radioChange: function (e) {
       this.setData({
@@ -75,22 +69,13 @@ Component({
       })
     },
     getData() {
-      app.$get("api/integral/rule/trees", { pt_id: 3 }).then((res) => {
+      app.$get("api/integral/rule/trees", { pt_id: 3,cycle_type: 1 }).then((res) => {
         var rule_tree = res.data.data.rule_tree;
         rule_tree.unshift({
           name:'全部分类',
           id:'',
           child:[]
         })
-        rule_tree.map((item) => {
-          item.checked = false;
-          item.disabled = false
-          if (item.child.length > 0) {
-            item.child.map((a) => {
-              a.checked = false;
-            })
-          }
-        })
         that.setData({
           rule_tree: rule_tree,
           all_rule_list:rule_tree

+ 1 - 1
Component/selectSection/selectSection.axml

@@ -3,7 +3,7 @@
   <view class="date-header {{isShow?'showPop':''}}">
     <view>
       <view class="flex-box flex-v-ce shu" a:if="{{terr.length>1}}">
-        <view a:for="{{terr}}" class="flex-box flex-v-ce" data-index="{{index}}" catchTap="activeItem" data-item="{{item}}">
+        <view a:for="{{terr}}" class="flex-box flex-v-ce flex-d-wrap" data-index="{{index}}" catchTap="activeItem" data-item="{{item}}">
           <image mode="scaleToFill" src="../../../image/right.png" style="width:20rpx;height:20rpx;margin:0 6rpx;" a:if="{{index!=0}}"/>
                 {{item.name}}
         </view>

+ 1 - 1
Component/selectSectionStaff/selectSectionStaff.axml

@@ -38,7 +38,7 @@
         </view>
         <view a:if="{{userList.length==0}}">
           <view class="fontColorF" style="margin-top:200rpx;text-align: center;">
-              <view>您当前没有可管理人员,请联系公司管理员</view>
+              <view>您当前部门没有可管理人员,请联系公司管理员</view>
               <view>设置对应管理范围</view>
           </view>
         </view>

+ 9 - 5
Component/selectSectionStaff/selectSectionStaff.js

@@ -25,6 +25,7 @@ Component({
     selectUser: [],
     isAllSelect: true,//是否多选
     isLeadership:false,//是否限制人员选择
+    isBoss:false,//是否去除创始人
   },
   didMount() {
     that = this;
@@ -209,11 +210,14 @@ Component({
         var selectUserId = this.data.selectUserId;
         var arr=[];
         var userList=list;
-        // list.forEach(item=>{
-        //   if(item.is_official==1){
-        //       userList.push(item)
-        //   }
-        // })
+        if(this.props.isBoss){
+          userList=[];
+          list.forEach(item=>{
+            if(item.is_creator!=1){
+                userList.push(item)
+            }
+          })
+        }
         userList.map((item) => {
           item.checked = false;
           if (selectUserId.length > 0) {

+ 1 - 1
Component/selectSectionStaff_tow/selectSectionStaff_tow.js

@@ -36,7 +36,7 @@ Component({
     //       }
     //     })
     // }
-    // console.log(this.props.selectUser);/
+    console.log(this.props.selectUser);
     this.setData({selectUserId:this.props.selectUser[0]? this.props.selectUser:[]})
     var superior_list=[];//将传进来的上级集合,转成集合里变成对象(原先是数组)
     this.props.superior_list.forEach(item=>{

+ 2 - 2
Component/selectType/selectType.axml

@@ -1,9 +1,9 @@
 <view class="all2">
    <image mode="scaleToFill" catchTap="plusOne" class="close" src="../../../image/close.png"/>
-   <view class="search flex-box flex-v-ce">
+   <!-- <view class="search flex-box flex-v-ce">
       <image mode="scaleToFill" src="../../../image/ss.png"/>
       <input placeholder="请输入搜索关键字" onInput="bindKeyInput"/>
-   </view>
+   </view> -->
    <view class="content2">
       <view class="flex-box flex-v-ce shu" a:if="{{terr.length>1}}">
         <view a:for="{{terr}}" class="flex-box flex-v-ce" data-index="{{index}}" catchTap="activeItem" data-item="{{item}}">

+ 12 - 1
Component/selectType/selectType.js

@@ -26,6 +26,17 @@ Component({
   didUpdate() { },
   didUnmount() { },
   methods: {
+        //搜索
+    bindKeyInput(e) {
+        var item_list=this.data.allItems;
+        var items=item_list.filter((item)=>{
+            return item.remark.indexOf(e.detail.value) >= 0
+        });
+        this.setData({
+          selectItem: items,
+          isItem:e.detail.value? false:true
+        })
+    },
     //点击导航栏
     activeItem(e) {
       this.setData({ rule_tree: [] });
@@ -78,7 +89,7 @@ Component({
       if (that.props.isGzType) {
         pt_id = app.getTypesItem(that.props.isGzType).id;
       }
-      app.$get("api/integral/rule/trees", { pt_id: pt_id }).then((res) => {
+      app.$get("api/integral/rule/trees", { pt_id: pt_id,cycle_type: 1 }).then((res) => {
         var rule_tree = res.data.data.rule_tree
         if (this.props.defaultId) {
           rule_tree.map(item => {

+ 3 - 3
app.acss

@@ -31,7 +31,7 @@
 	}
 
 	.fontColorF {
-		color: #909399 !important;
+		color: #606266 !important;
 	}
 
 	.fontColorT {
@@ -108,7 +108,7 @@
 		right: -20rpx;
 		margin-top: -0.1rem;
 		border: 0.06rem solid;
-		border-color: transparent transparent #dcdee0 #dcdee0;
+		border-color: transparent transparent #C0C4CC #C0C4CC;
 		-webkit-transform: rotate(-45deg);
 		transform: rotate(-45deg);
 		opacity: .8;
@@ -163,7 +163,7 @@
 		border-radius: 6rpx;
 		background: rgba(245, 108, 108, 0.1);
 		color: #F56C6C;
-		font-size: 24rpx;
+		font-size: 28rpx;
 		padding: 0 6rpx;
 	}
 

+ 5 - 4
app.js

@@ -1,8 +1,8 @@
 import { showToast } from './utils/feedback'
 import { formatTime, arrRemoveObj,getTypeItem } from './utils/util'
 
-const baseUrl = "https://test-ding.g107.com/";//测试
-// const baseUrl = "https://ding.insys.g107.com/";//正式
+// const baseUrl = "https://test-ding.g107.com/";//测试
+const baseUrl = "https://ding.insys.g107.com/";//正式
 var that;
 var yearArr=[];
 var year=formatTime(new Date()).year;
@@ -27,9 +27,10 @@ App({
     yearArr:yearArr,
   },
   //获取积分类型
-  getTypes() {
+  getTypes(callBack) {
     this.$get("api/integral/types", {}).then((res) => {
       this.globalData.types = res.data.data.list;
+      callBack();
     })
   },
  routerGet(url,data={},Accept){
@@ -160,7 +161,7 @@ App({
   },
   onLaunch(options) {
     that = this;
-    that.getTypes();
+    that.getTypes(function(){});
     that.globalData.corpId = options.query.corpId;
   },
 });

+ 4 - 4
pages/deploy/index/index.axml

@@ -15,10 +15,10 @@
         <image class="img-left" mode="scaleToFill" src="../../../image/xf.png"></image>
         <view class="flex-box flex-v-ce flex-1 li-right">
           <view class="title flex-1">
-            <view>当前为试用版本</view>
-            <view class="date">还有<text class="red">15天</text>到期</view>
+            <view>当前为共创版本</view>
+            <!-- <view class="date">还有<text class="red">15天</text>到期</view> -->
           </view>
-          <view class="xusj" data-index="1" onTap="openView">续费升级</view>
+          <!-- <view class="xusj" data-index="1" onTap="openView">续费升级</view> -->
         </view>
       </view>
       <view class="flex-box flex-v-ce li margin-bottom" data-index="2" onTap="openView">
@@ -45,5 +45,5 @@
     </view>
   </view>
   <!-- <view class="fontColorF" style="text-align: center">正式1.0</view> -->
-  <view class="fontColorF" style="text-align: center">测试1.0</view>
+  <!-- <view class="fontColorF" style="text-align: center">测试1.0</view> -->
 </view>

+ 1 - 1
pages/deploy/integralRule/integralRule.js

@@ -81,7 +81,7 @@ Page({
     })
   },
   getData() {
-    app.$get("api/integral/rule/trees", { pt_id: 3 }).then((res) => {
+    app.$get("api/integral/rule/trees",{cycle_type: 1}).then((res) => {
       var item_list = res.data.data.item_list
       var rule_tree = res.data.data.rule_tree
       var list = []

+ 1 - 0
pages/deploy/organization/organization.acss

@@ -81,6 +81,7 @@
   bottom: 0;
   background: rgba(245, 247, 250, 1);
   padding: 10rpx;
+  padding-bottom: 30rpx;
   /* border-top: 1px solid #f1f1f1; */
 }
 .footer view{

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

@@ -51,7 +51,6 @@ Page({
   },
   //点击导航栏
   activeItem(e) {
-    console.log(e);
     var item = e.target.dataset.item;
     var index = e.target.dataset.index;
     var terr = this.data.terr;

+ 7 - 3
pages/deploy/setCheck/setCheck.acss

@@ -14,10 +14,14 @@
   border-bottom: 1px solid #f1f1f1
 }
 .li-left{
-  width: 140rpx;
-  text-align: left;
+  margin-right: 20rpx;
 }
 .fontColorF{
-  padding:10rpx 28rpx;
   font-size: 28rpx;
+}
+.li-left view:nth-child(1){
+  font-weight: 600
+}
+.li-left view:nth-child(2){
+  color: rgb(96, 98, 102)
 }

+ 18 - 31
pages/deploy/setCheck/setCheck.axml

@@ -1,71 +1,58 @@
 <view>
   <view class="yellow">以下分数皆为B分,请前往PC钉钉设置</view>
-  <view class="fontColorF">出勤打卡</view>
-  <view class="ul">
+  <view class="ul margin-bottom">
     <view class="flex-box li">
       <view class="li-left">
         <view>月度全勤</view>
-        <view>加分</view>
+        <view >当月分{{data.month_full_ad}}分</view>
       </view>
-      <view>{{data.month_full_ad}}</view>
     </view>
     <view class="flex-box li">
       <view class="li-left">
         <view>正常打卡</view>
-        <view>加分</view>
+        <view>每次{{data.normal}}分</view>
       </view>
-      <view>{{data.normal}}</view>
     </view>
     <view class="flex-box li">
       <view class="li-left">
-        <view>缺卡扣分</view>
+        <view>缺卡</view>
+        <view>每次扣{{data.no_sign}}分</view>
       </view>
-      <view>{{data.no_sign}}</view>
     </view>
   </view>
-  <view class="fontColorF">迟到/早退/旷工</view>
-  <view class="ul">
+  <view class="ul margin-bottom">
     <view class="flex-box li">
       <view class="li-left">
-        <view>迟到扣分</view>
+        <view>迟到</view>
+        <view>每次扣{{data.on_duty_late}}分</view>
       </view>
-      <view>{{data.on_duty_late}}</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>加分</view></view><view>{{data.off_duty_early}}</view></view> -->
     <view class="flex-box li">
       <view class="li-left">
-        <view>早退扣分</view>
+        <view>早退</view>
+        <view>每次扣{{data.off_duty_early}}分</view>
       </view>
-      <view>{{data.off_duty_early}}</view>
     </view>
     <view class="flex-box li">
       <view class="li-left">
-        <view>旷工扣分</view>
+        <view>旷工</view>
+        <view>每次扣{{data.absent}}分</view>
       </view>
-      <view>{{data.absent}}</view>
     </view>
   </view>
-  <view class="fontColorF">加班/请假</view>
-  <view class="ul">
+  <view class="ul margin-bottom">
     <view class="flex-box li">
       <view class="li-left">
-        <view>加班</view>
-        <view>小时加分</view>
+        <view>加班</view>
+        <view>小时加{{data.ot_per_hour}}分</view>
       </view>
-      <view>{{data.ot_per_hour}}</view>
     </view>
     <view class="flex-box li">
       <view class="li-left">
-        <view>请假</view>
-        <view>小时扣分</view>
+        <view>请假</view>
+        <view>小时扣{{data.leave_per_hour}}分</view>
       </view>
-      <view>{{data.leave_per_hour}}</view>
     </view>
   </view>
 </view>

+ 13 - 2
pages/deploy/setCheck/setCheck.js

@@ -2,15 +2,26 @@ var app = getApp();
 var that;
 Page({
   data: {},
-  onLoad(query) {
+  onLoad() {
     that = this;
     dd.setNavigationBar({ title: "考勤积分" });
+  },
+  onShow(){
     this.getData();
   },
   getData(){
     app.$get("api/ad/info").then((res) => {
+      var obj=res.data.data;
+      for (var i in obj) {
+          var str=String(obj[i]);
+          // console.log(str.indexOf("-"))
+          if(str.indexOf("-")>=0){
+              console.log(obj[i]);
+              obj[i]=str.slice(1,10);
+          }
+      }
       this.setData({
-        data:res.data.data
+        data:obj
       })
     })
   }

+ 10 - 9
pages/init/init.js

@@ -5,16 +5,17 @@ Page({
   onLoad() {
     dd.hideLoading();
     app.login(app.globalData.corpId, function (is) {
-
-        if(is){
-        dd.navigateBack({
-          delta: 1
-        })
-        }else{
+      app.getTypes(function () {
+        if (is) {
+          dd.navigateBack({
+            delta: 1
+          })
+        } else {
           dd.reLaunch({
-            url:'../noJurisdiction/noJurisdiction'
+            url: '../noJurisdiction/noJurisdiction'
           })
         }
-      })
-   },
+      });
+    })
+  },
 });

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

@@ -4,8 +4,8 @@
       <text class="{{showTissue? 'activeView blue':''}}">{{TissueVal}}</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>

+ 4 - 4
pages/statistics/C_ranking/C_ranking.axml

@@ -3,12 +3,12 @@
     <view class="flex-1" catchTap="selectDay">
       <text class="{{showDate? 'activeView':''}} dateVal">{{month}}</text>
     </view>
-    <view class="flex-1" catchTap="selectRule">
+    <!-- <view class="flex-1" catchTap="selectRule">
       <text class="{{showRuleTwo? 'activeView blue':''}}">{{ruleVal}}</text>
-    </view>
+    </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>

+ 1 - 0
pages/statistics/addCustom/addCustom.acss

@@ -46,6 +46,7 @@
   bottom: 0;
   background: #fff;
   padding: 10rpx;
+  padding-bottom: 30rpx;
   border-top: 1px solid #f1f1f1;
 }
 

+ 3 - 3
pages/statistics/addCustom/addCustom.axml

@@ -13,7 +13,7 @@
         <view class="add-right fontColorF">
           <!-- <text a:for="{{selectUser}}">{{item.name}},</text>
           <text>{{selectUser.length}}人</text> -->
-          <image mode="scaleToFill" src="../../../image/right.png"/>
+          <!-- <image mode="scaleToFill" src="../../../image/right.png"/> -->
         </view>
       </view>
     </view>
@@ -32,9 +32,9 @@
     <view onTap="save" class=" flex-2 save" a:else>保存</view>
   </view>
   <view class="box" animation="{{animationInfo}}" a:if="{{isbj}}">
-    <select-section-staff onClose="onClose" selectUser="{{selectUser}}" a:if="{{selectUser.length>0}}" onConfirm="onSelectUser"/>
+    <select-section-staff isBoss="{{true}}" onClose="onClose" selectUser="{{selectUser}}" a:if="{{selectUser.length>0}}" onConfirm="onSelectUser"/>
   </view>
   <view class="box" animation="{{animationInfo}}" a:else>
-    <select-section-staff onClose="onClose" onConfirm="onSelectUser"/>
+    <select-section-staff isBoss="{{true}}" onClose="onClose" onConfirm="onSelectUser"/>
   </view>
 </view>

+ 1 - 1
pages/statistics/addCustom/addCustom.js

@@ -45,7 +45,7 @@ Page({
   },
   //关闭选择人员
   onClose() {
-    animation.translateY(750).step();
+    animation.translateY(1200).step();
     that.setData({
       animationInfo: animation.export()
     });

+ 13 - 2
pages/statistics/customRamking/customRamking.acss

@@ -3,8 +3,8 @@
 }
 
 .all image {
-  width: 40rpx;
-  height: 40rpx;
+  width: 24rpx;
+  height: 24rpx;
 }
 
 .add {
@@ -36,6 +36,7 @@
 
 .message .num {
   margin-top: 10rpx;
+  font-size: 30rpx
 }
 
 .message .openCompile {
@@ -63,4 +64,14 @@
   color: #fff;
   border-radius: 6rpx;
   padding: 20rpx 0;
+}
+.gs{
+  background-color: #FFFBE8;
+  padding: 20rpx;
+  color: #e6a23c;
+}
+.close{
+  padding: 0 10rpx;
+  font-size: 40rpx;
+  font-weight: 600
 }

+ 8 - 5
pages/statistics/customRamking/customRamking.axml

@@ -1,25 +1,28 @@
 <view>
   <view class="all">
     <block a:if="{{dataList.length>0}}">
-    <!-- <block>  -->
+      <view class="gs margin-bottom flex-box flex-v-ce" a:if="{{isShowGs}}">
+          <text class="flex-1">可自定义设置团队、项目、管理者、执行人员等分组,进行自定义排名</text>
+          <text class="close" onTap="activeGs">×</text>
+      </view> 
+      <!-- <block> -->
       <view class="add flex-box flex-v-ce margin-bottom" onTap="openAdd">
         <view class="flex-1 blue">+新增分组</view>
-        <image mode="scaleToFill" src="../../../image/right.png"/>
       </view>
       <view class="main">
         <view a:for="{{dataList}}" class="dataList margin-bottom">
           <view class="flex-box flex-v-ce message border-bottom">
             <view class="flex-1">
               <view class="title">{{item.name}}</view>
-              <view class="num fontColorF">共{{item.employees.length}}参与排名</view>
+              <view class="num fontColorF">共{{item.employees.length}}参与排名</view>
             </view>
             <view onTap="openCompile" class="openCompile" data-item="{{item}}">
-                <image mode="scaleToFill" src="../../../image/Bj.png"/>
+              <image mode="scaleToFill" src="../../../image/Bj.png" style="width:40rpx;height:40rpx"></image>
             </view>
           </view>
           <view class="flex-box flex-v-ce ranking" onTap="openDetail" data-item="{{item}}">
             <view class="flex-1">查看排名</view>
-            <image mode="scaleToFill" src="../../../image/right.png"/>
+            <image mode="scaleToFill" src="../../../image/right.png"></image>
           </view>
         </view>
       </view>

+ 21 - 0
pages/statistics/customRamking/customRamking.js

@@ -4,14 +4,35 @@ var that;
 Page({
   data: {
     // dataList:[],
+    isShowGs:true,
   },
   onLoad() {
     that = this;
+    dd.getStorage({
+      key: 'isShowGs',
+      success: function(res) {
+        if(res.data){
+          that.setData({
+            isShowGs: false
+          })
+        }
+      },
+    });
     dd.setNavigationBar({ title: "自定义分组B分排名" });
   },
   onShow(){
     this.getData();
   },
+  activeGs(){
+      this.setData({
+        isShowGs: false
+      })
+      dd.setStorage({
+        key: 'isShowGs',
+        data: true,
+        success: function() {}
+      });
+  },
   getData(){
     app.$get('api/integral/statistics/groups').then((res) => {
       var data = res.data.data.list;

+ 32 - 23
pages/statistics/integralEvent/integralEvent.js

@@ -1,7 +1,7 @@
 
 var app = getApp()
 var that;
-var typeArr=[];
+var typeArr = [];
 Page({
   data: {
     date: app.globalData.month,
@@ -18,7 +18,7 @@ Page({
     showStaff: false,//显示员工选择
     staffVal: '员工',
 
-    types: '',//积分分类
+    types: [],//积分分类
     typesIndex: '0',
 
     showRuleTwo: false,
@@ -29,11 +29,10 @@ Page({
   },
   onLoad(e) {
     that = this;
-    typeArr=[{ id: 0, name: '全部' }];
-    var arr=typeArr.concat(app.globalData.types);
-    arr=app.globalData.arrRemoveObj(arr,arr[1]);
-    this.setData({types:arr})
-    var userData=app.globalData.userData;
+    var userData = app.globalData.userData;
+    typeArr = [{ id: 0, name: '全部' }];
+    var arr = typeArr.concat(app.globalData.types);
+    arr = app.globalData.arrRemoveObj(arr, arr[1]);
     dd.setNavigationBar({ title: "积分事件" });
     if (e.month) {
       var typesIndex = "0";
@@ -44,23 +43,33 @@ Page({
           }
         })
       }
-      this.setData({ 
+      this.setData({
         date: e.month,
         typesIndex: typesIndex,
-        employee_ids :[userData.id],
-        staffVal:userData.name,
-        selectDateVal:e.month==app.globalData.month? '本月':'月',
-        defaultDate:{type:'1',date:e.month},
+        employee_ids: [userData.id],
+        staffVal: userData.name,
+        selectDateVal: e.month == app.globalData.month ? '本月' : '月',
+        defaultDate: { type: '1', date: e.month },
       })
     }
+  },
+  onShow() {
+    typeArr = [{ id: 0, name: '全部' }];
+    var arr = typeArr.concat(app.globalData.types);
+    arr = app.globalData.arrRemoveObj(arr, arr[1]);
+    if(arr){
+    this.setData({ types: arr })
+    }
+    if(this.data.page==1){
     this.getData();
+    }
   },
   getData(is) {
     var data = {
       page: that.data.page,
       page_size: 20,
       rule_id: that.data.rule_id,
-      pt_id: that.data.types[that.data.typesIndex].id,
+      pt_id: that.data.types.length > 0 ? that.data.types[that.data.typesIndex].id : '2',
       employee_ids: that.data.employee_ids
     }
     if (that.data.date_type == 2) {
@@ -71,8 +80,8 @@ Page({
     }
     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);
+      data.map((item) => {
+        item.ptObj = app.getTypesItem(item.pt_id);
       })
       if (is) {
         if (data.length == 0) {
@@ -129,11 +138,11 @@ Page({
   //选择时间
   onConfirmDate(data) {
     that.setData({
-      defaultDate:data,
+      defaultDate: data,
       dateObj: data.date,
       date_type: data.type == 1 ? 3 : data.type,
       page: 1,
-      selectDateVal: data.type == 1 ? (data.date==that.data.date? '本月':'月') : '日',
+      selectDateVal: data.type == 1 ? (data.date == that.data.date ? '本月' : '月') : '日',
     })
     this.getData();
   },
@@ -160,8 +169,8 @@ Page({
       this.getData();
       return false;
     }
-    if(data.length>0){
-      if (data.length >1 ) {
+    if (data.length > 0) {
+      if (data.length > 1) {
         var str = "";
         var arr = [];
         data.forEach((item) => {
@@ -169,12 +178,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 })
+        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 })
+    } else {
+      this.setData({ staffVal: '员工', employee_ids: [], page: 1 })
     }
 
 
@@ -185,7 +194,7 @@ Page({
     this.setData({
       rule_id: e.id ? e.id : '',
       page: 1,
-      ruleVal:e.name
+      ruleVal: e.name
     })
     this.getData();
   },

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

@@ -17,8 +17,8 @@
         <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" a:if="{{item.point>0}}">+{{item.point}}</view>
-            <view class="green" a:else>{{item.point}}</view>
+            <view class="red" style="font-size:44rpx" a:if="{{item.point>0}}">+{{item.point}}</view>
+            <view class="green" style="font-size:44rpx" a:else>{{item.point}}</view>
           </view>
           <view class="context" a:if="{{item.remark}}">{{item.remark}}</view>
           <view class="flex-box flex-v-ce">

+ 13 - 8
pages/statistics/my_PrizeBuckle/my_PrizeBuckle.js

@@ -15,7 +15,12 @@ Page({
     }
     that = this;
     dd.setNavigationBar({ title: "我奖扣的" });
-    that.getData(1);
+  },
+  onShow(){
+     if(this.data.page==1){
+      dd.hideLoading();
+      that.getData(that.data.activeIndex);
+     }
   },
   bindKeyInput(e) {
     this.setData({
@@ -54,19 +59,19 @@ Page({
     }
     app.$get(urlS[index - 1], data).then((res) => {
       var data = res.data.data.list;
+      var list = that.data.list;
       if (is) {
-        if (data.length == 0) {
+        if (data.length < 20) {
           this.setData({
+            list: list.concat(data),
             isData: true
           })
-          return;
+        }else{
+          this.setData({
+            list: list.concat(data)
+          })
         }
-        var list = that.data.list;
-        this.setData({
-          list: list.concat(data)
-        })
       } else {
-        this.setData({list:[]});
         this.setData({
           list: data,
           isData: false

+ 12 - 8
pages/statistics/my_apply/my_apply.js

@@ -14,7 +14,11 @@ Page({
     }
     that = this;
     dd.setNavigationBar({ title: "我申请的" });
-    that.getData();
+  },
+  onShow(){
+    if(this.data.page==1){
+        that.getData();
+    }
   },
   bindKeyInput(e) {
     this.setData({
@@ -43,19 +47,19 @@ Page({
     }
     app.$get('api/integral/review/apply/list', data).then((res) => {
       var data = res.data.data.list;
+      var list = that.data.list;
       if (is) {
-        if (data.length == 0) {
+        if (data.length < 20) {
           this.setData({
+            list: list.concat(data),
             isData: true
           })
-           return;
+        }else{
+          this.setData({
+            list: list.concat(data)
+          })
         }
-        var list = that.data.list;
-        this.setData({
-          list: list.concat(data)
-        })
       } else {
-        this.setData({ list: [] });
         this.setData({
           list: data,
           isData: false

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

@@ -6,9 +6,9 @@
     <view class="flex-1" catchTap="selectTissue">
       <text class="{{showTissue? 'activeView blue':''}}">{{TissueVal}}</text>
     </view>
-    <view class="flex-1" catchTap="selectRule">
+    <!-- <view class="flex-1" catchTap="selectRule">
       <text class="{{showRuleTwo? 'activeView blue':''}}">{{ruleVal}}</text>
-    </view>
+    </view> -->
     <view class="flex-1" catchTap="selectSx">
       <text class="{{showSx? 'activeView blue':''}}">{{sxVal}}</text>
     </view>

+ 3 - 1
pages/statistics/sectionRanking/sectionRanking.js

@@ -49,8 +49,10 @@ Page({
     }else if(that.data.dateIndex=='2'){
       data.quarter=that.data.quarter
     }else{
-      data.month=that.data.month;
+      data.month=that.data.month||app.globalData.month;
+      console.log(that.data.month);
     }
+    
     app.$get('api/integral/statistics/ranking',data,'application/vnd.test.v2+json').then((res) => {
       var data = res.data.data.list;
       if (is) {

+ 0 - 1
pages/workbench/apply/apply.acss

@@ -33,7 +33,6 @@
 textarea{
   padding-left: 10rpx;
   padding-right: 0;
-  font-size: 28rpx;
   height: 200rpx;
   position: relative;
 }

+ 57 - 39
pages/workbench/apply/apply.js

@@ -19,21 +19,26 @@ Page({
     isShowType: true,//是显示选择规则还是显示选择分类
     activeIndex: '',
     isArr: ['奖', '扣'],
-    reviewerObj:[],
-    disabled:false,
+    reviewerObj: [],
+    disabled: false,
   },
   onLoad() {
     that = this;
     dd.setNavigationBar({ title: "申请积分" });
+    // var userDeptId=app.globalData.userData.employee_detail.dept_list[0].dept_id;//当前登录人部门ID
+    // var superior=app.globalData.userData.employee_detail.superior_list;//当前登录人上级领导
+    // this.getData(userDeptId);
     this.setData({
-        items: [{//录入选项列表
+      items: [{//录入选项列表
         checked: true,//判断是否开启指定规则
         rule_id: '',//积分分类id
         item_id: '',//积分细则id 不选可以为0
         remark: '',//备注
         event_time: app.globalData.day,//事件时间
-        reviewer_id: app.globalData.userData.employee_detail.superior_list[0].id,//审核人ID
-        revieweName: app.globalData.userData.employee_detail.superior_list[0].name,//审批人姓名(非传)
+        reviewer_id:'',
+        revieweName:'',
+        // reviewer_id: app.globalData.userData.employee_detail.superior_list[0].id,//审核人ID
+        // revieweName: app.globalData.userData.employee_detail.superior_list[0].name,//审批人姓名(非传)
         files: '',//附件数组列表
       }],
     })
@@ -44,29 +49,36 @@ Page({
       timeFunction: "linear",
     });
   },
-    //显示图片
-  showImg(e){
-      var index=e.target.dataset.index;
-      var item=e.target.dataset.item
-      dd.previewImage({
-        current: index,
-        urls: item
-      });
+      //获取人员列表
+    getData(dept_id) {
+      var superior=app.globalData.userData.employee_detail.superior_list;
+      app.$get("api/employee/list", { dept_id: dept_id }).then((res) => {
+        var list = res.data.data.list||[];
+      })
+    },
+  //显示图片
+  showImg(e) {
+    var index = e.target.dataset.index;
+    var item = e.target.dataset.item
+    dd.previewImage({
+      current: index,
+      urls: item
+    });
   },
   //关闭规则
   onClose() {
-    animation.translateY(750).step();
+    animation.translateY(1200).step();
     that.setData({
       animationInfo: animation.export()
     });
     that.setData({
-      isShowType:''
+      isShowType: ''
     });
   },
   //选择规则
   openSelect(e) {
-    if(e.target.dataset.item){
-       that.setData({ reviewerObj: [e.target.dataset.item] });
+    if (e.target.dataset.item.id) {
+      that.setData({ reviewerObj: [e.target.dataset.item] });
     }
     that.setData({ activeIndex: '' });
     that.setData({
@@ -115,7 +127,11 @@ Page({
         'name': app.globalData.day
       },
       success: function (res) {
-        var key = 'intesys/' + app.globalData.day + '/' + that.random_string(32) + '.png';
+        if (app.globalData.userData.site_id) {
+          var key = 'intesys/dd/' + app.globalData.userData.site_id + "/" + app.globalData.day + '/' + that.random_string(32) + '.png';
+        } else {
+          var key = 'intesys/dd/' + app.globalData.day + '/' + that.random_string(32) + '.png';
+        }
         var obj = res.data.data;
         dd.uploadFile({
           url: app.globalData.ALIOSS_URL,
@@ -131,15 +147,15 @@ Page({
           },
           success: (res) => {
             if (res.statusCode == 200) {
-              if(files.length>0){
+              if (files.length > 0) {
                 files.push('http://cdn.intesys.g107.com/' + key)
-              }else{
-                files=['http://cdn.intesys.g107.com/' + key];
+              } else {
+                files = ['http://cdn.intesys.g107.com/' + key];
               }
               that.setData({
                 [files_box]: files
               });
-             app.globalData.showToast("已上传");
+              app.globalData.showToast("已上传");
             }
           },
         });
@@ -190,12 +206,12 @@ Page({
         obj.rule_id = 0;
         obj.item_id = 0;
       }
-      if(item.checked){
-          if(!obj.rule_id){
-              app.globalData.showToast(`第${i + 1}项必须选择规则`);
-              isTg = false;
-              break;
-          }
+      if (item.checked) {
+        if (!obj.rule_id) {
+          app.globalData.showToast(`第${i + 1}项必须选择规则`);
+          isTg = false;
+          break;
+        }
       }
       obj.remark = item.remark;
       obj.event_time = item.event_time;
@@ -207,27 +223,27 @@ Page({
       var data = {
         items: JSON.stringify(arr)
       }
-      this.setData({disabled:true});
+      this.setData({ disabled: true });
       app.$post("api/integral/review/apply", data).then((res) => {
         var is = true;
         res.data.data.list.forEach(item => {
-        if (item.status == 0) {
+          if (item.status == 0) {
             is = false;
-            this.setData({disabled:false});
+            this.setData({ disabled: false });
             app.globalData.showToast(item.msg);
           }
         });
         if (is) {
-          app.globalData.showToast('已提交');
+          app.globalData.showToast('申请成功');
           setTimeout(() => {
-            this.setData({disabled:false});
             dd.navigateBack({
               delta: 1
             })
+           this.setData({ disabled: false });  
           }, 1000);
         }
-      }).catch(err=>{
-        this.setData({disabled:false});
+      }).catch(err => {
+        this.setData({ disabled: false });
       })
     }
   },
@@ -242,8 +258,8 @@ Page({
     console.log(that.data.items);
   },
   //选择人
-   onSelectUser(item) {
-    var elm=item.length>0? item[0]:{id:'',name:''};
+  onSelectUser(item) {
+    var elm = item.length > 0 ? item[0] : { id: '', name: '' };
     var index = this.data.activeIndex;
     var reviewer_id = `items[${index}].reviewer_id`
     var revieweName = `items[${index}].revieweName`
@@ -260,8 +276,10 @@ Page({
       item_id: '',//积分细则id 不选可以为0
       remark: '',//备注
       event_time: app.globalData.day,//事件时间
-      reviewer_id: app.globalData.userData.employee_detail.superior_list[0].id,//审核人ID
-      revieweName: app.globalData.userData.employee_detail.superior_list[0].name,//审批人姓名(非传)
+      reviewer_id:'',//审核人ID
+      revieweName:'',//审批人姓名(非传)
+      // reviewer_id: app.globalData.userData.employee_detail.superior_list[0].id,//审核人ID
+      // revieweName: app.globalData.userData.employee_detail.superior_list[0].name,//审批人姓名(非传)
       files: '',//附件数组列表
     };
     var list = that.data.items

+ 0 - 1
pages/workbench/approve/approve.acss

@@ -33,7 +33,6 @@
 textarea{
   padding-left: 10rpx;
   padding-right: 0;
-  font-size: 28rpx;
   height: 200rpx;
   position: relative;
 }

+ 10 - 5
pages/workbench/approve/approve.js

@@ -22,7 +22,8 @@ Page({
       reviewerObj:[],
     },
     users: {
-      id:''
+      id:'',
+      name:'',
     },
     animationInfo: '',
     isShowType: true,//是显示选择规则还是显示选择分类
@@ -43,7 +44,7 @@ Page({
   },
   //关闭规则
   onClose() {
-    animation.translateY(750).step();
+    animation.translateY(1200).step();
     that.setData({
       animationInfo: animation.export()
     });
@@ -55,9 +56,8 @@ Page({
     });
   },
   onSelectUser(item) {
-  
     this.setData({
-      users: item[0],
+      users: item[0]? item[0]:{id:'',name:''},
       reviewerObj:item
     })
   },
@@ -123,7 +123,12 @@ Page({
     this.setData({disabled:true});
     app.$post("api/integral/review", data).then((res) => {
       if(res.data.code==1){
-        this.showToast("已审批");
+        this.showToast("已通过");
+        var pages=getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
+        var active=pages[pages.length-3];
+        if(active.data.page!=1){
+            active.refreshData(item.review_id);
+        }
         setTimeout(() => {
           this.setData({disabled:false});
           dd.navigateBack({delta: 2})

+ 2 - 1
pages/workbench/approveDetail/approveDetail.acss

@@ -40,7 +40,8 @@
   right: 0;
   z-index: 2;
   text-align: center;
-  padding: 16rpx;
+  padding: 10rpx;
+  padding-bottom: 30rpx;
   border-top: 1px solid #f1f1f1;
 
 }

+ 12 - 3
pages/workbench/approveDetail/approveDetail.js

@@ -41,13 +41,17 @@ Page({
     this.setData({ isBh: !this.data.isBh, textArea: '' })
   },
   confirmBh() {
-    var item = that.data.bhItem;
     if (!that.data.textArea) {
       app.globalData.showToast("请输入审批意见");
       return;
     }
     app.$post("api/integral/review", { review_id: that.data.review_id, remark: that.data.textArea, action: "refuse", ticket_count: 0 }).then((res) => {
-      app.globalData.showToast("已审批");
+      app.globalData.showToast("已驳回");
+      var pages=getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
+      var active=pages[pages.length-2];
+      if(active.data.page!=1){
+          active.refreshData(that.data.review_id);
+      }
       setTimeout(() => {
         dd.navigateBack({ delta: 1 });
       }, 1000);
@@ -55,7 +59,7 @@ Page({
   },
   openCx() {
     dd.confirm({
-      title: '温馨提示',
+      title: '撤销审批',
       content: '您确定撤销此项吗?',
       confirmButtonText: '确定',
       cancelButtonText: '取消',
@@ -63,6 +67,11 @@ Page({
         if (result.confirm) {
           app.$post("api/integral/review/destroy", { review_id: that.data.review_id }).then((res) => {
             app.globalData.showToast("已撤销");
+            var pages=getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
+            var active=pages[pages.length-2];
+            if(active.data.page!=1){
+                active.refreshData(that.data.review_id);
+            }
             setTimeout(() => {
               dd.navigateBack({
                 delta: 1

+ 4 - 0
pages/workbench/index/index.acss

@@ -163,4 +163,8 @@
   height: 100rpx;
   padding:0 28rpx;
   font-size: 32rpx;
+}
+.f2-chart {
+  width: 100%;
+  height: 400rpx;
 }

+ 23 - 6
pages/workbench/index/index.axml

@@ -44,26 +44,43 @@
       <view class="main-main flex-box flex-center-center" data-index="7" catchTap="openView">
         <view class="flex-1">
             <view>{{userData.task.reward.point}}</view>
-            <view>奖分</view>
+            <view class="fontColorF" style="font-size:28rpx">奖分</view>
             <view>目标{{userData.task.reward.target_point}}</view>
         </view>
         <view class="flex-1">
             <view>{{userData.task.deduction.point}}</view>
-            <view>扣分</view>
+            <view class="fontColorF" style="font-size:28rpx">扣分</view>
             <view>目标{{userData.task.deduction.target_point}}</view>
         </view>
         <view class="flex-1">
             <view>{{userData.ratio.ratio}}</view>
-            <view>奖扣比例</view>
+            <view class="fontColorF" style="font-size:28rpx">奖扣比例</view>
             <view>目标{{userData.ratio.target_ratio}}</view>
         </view>
         <view class="flex-1">
             <view>{{userData.task.exec.count}}</view>
-            <view>奖扣人次</view>
+            <view class="fontColorF" style="font-size:28rpx">奖扣人次</view>
             <view>目标{{userData.task.exec.target_count}}</view>
         </view>
       </view>
   </view>
+
+
+  <view class="bottom margin-bottom">
+    <view class="bottom-title">近30天B分趋势</view>
+      <view class="f2-chart">
+        <f2 onInit="onInitChart"></f2>
+      </view>
+  </view>
+
+  <view class="bottom margin-bottom">
+     <view class="bottom-title">积分构成</view>
+     <view class="f2-chart" a:if="{{pieData.length>0}}">
+        <f2 onInit="onInitChart2"></f2>
+    </view>
+    <no-data a:if="{{pieData.length==0}}" content="无数据" />
+  </view>
+
   <view class="bottom">
     <view class="bottom-title">积分事件</view>
     <view class="flex-box bottom-time" a:for="{{incidentLsit}}" data-item="{{item}}" data-index="8" onTap="openView"> 
@@ -78,10 +95,10 @@
           <view class="date">{{item.event_time}}</view>
         </view>
     </view>
-    <no-data a:if="{{incidentLsit.length==0}}"/>
+    <no-data a:if="{{incidentLsit.length==0}}"  />
   </view>
   <view data-index="9" onTap="openView" a:if="{{incidentLsitTotal>5}}" class="more">查看更多</view>
-  <view class="windows" a:if="{{isBh}}">
+  <view class="windows" a:if="{{isBh}}" content="还没有积分事件">
     <view class="windows-box">
       <view class="windows-title">温馨提示</view>
       <view class="windows-content">作为管理者,管理执行力是关键,每月按要求完成奖分和扣分任务</view>

+ 122 - 13
pages/workbench/index/index.js

@@ -1,13 +1,17 @@
 var app = getApp();
 var that;
-
+var chart1;
+var chart2;
 Page({
   data: {
     userData: {},
-    isBh:false
+    isBh: false,
+    chartData: [],//折线图数据
+    pieData: [1],//饼型图数据
   },
-  onLoad(query) {
+  onLoad() {
     that = this;
+    chart1, chart2 = '';
   },
   onShow(query) {
     // that.getUserData();
@@ -19,20 +23,20 @@ Page({
       that.getIncidentNum();
     } else {
       app.login(app.globalData.corpId, function (is) {
-        if(is){
+        if (is) {
           that.getUserData();
           that.getIncidentLsit();
           that.getIncidentNum();
-        }else{
+        } else {
           dd.reLaunch({
-            url:'../noJurisdiction/noJurisdiction'
+            url: '../noJurisdiction/noJurisdiction'
           })
         }
       })
     }
   },
   showText() {
-    this.setData({isBh:!this.data.isBh})
+    this.setData({ isBh: !this.data.isBh })
   },
   //跳转
   openView(e) {
@@ -67,11 +71,114 @@ Page({
       url: urls[index].url + '?' + urls[index].query
     })
   },
+  //则线图
+  onInitChart(F2, config) {
+    chart1 = new F2.Chart(config);
+    chart1.source(that.data.chartData, {
+      date: {
+        // range: [0, 1],
+        tickCount: 5
+      }
+    });
+    chart1.tooltip({
+      showCrosshairs: true,
+      showItemMarker: false,
+      onShow: function onShow(ev) {
+        const items = ev.items;
+        items[0].name = "月份:" + items[0].origin.date;
+        items[0].value = "分值:" + items[0].value;
+      }
+    });
+    chart1.line().position('date*value');
+    chart1.point().position('date*value').style({
+      stroke: '#fff',
+      lineWidth: 1
+    });
+    chart1.render();
+    return chart1;
+  },
+  //饼型图
+  onInitChart2(F2, config) {
+    chart2 = new F2.Chart(config);
+    chart2.source(that.data.pieData, {
+      percent: {
+        formatter: function formatter(val) {
+          return val * 100 + '%';
+        }
+      }
+    });
+    chart2.legend({
+      position: 'right',
+      itemFormatter: function itemFormatter(val, index) {
+        var str = '';
+        that.data.pieData.forEach(item => {
+          if (item.name == val) {
+            str = val + '  ' + item.point + '分';
+          }
+        })
+        return str;
+      }
+    });
+    chart2.tooltip(false);
+    chart2.coord('polar', {
+      transposed: true,
+      radius: 0.85
+    });
+    chart2.axis(false);
+    chart2.interval()
+      .position('a*percent')
+      .color('name', ['#1890FF', '#13C2C2', '#2FC25B', '#FACC14', '#F04864', '#8543E0'])
+      .adjust('stack')
+      .style({ lineWidth: 1, stroke: '#fff', lineJoin: 'round', lineCap: 'round' }).animate({
+        appear: { duration: 1200, easing: 'bounceOut' }
+      });
+    chart2.render();
+    // 注意:需要把chart return 出来
+    // that.getLsit();
+    return chart2;
+  },
+  //获取统计数据
+  getLsit() {
+    var date1 = new Date();
+    var date2 = new Date(date1);
+    date2.setDate(date1.getDate() - 30);
+    var start_date= date2.getFullYear() + "-" + (date2.getMonth() + 1) + "-" + date2.getDate();
 
+    var incident = app.$get("api/integral/statistics/b", { employee_id: 0, start_date: start_date, end_date: app.globalData.day, show_type: '1' });
+    var pei = app.$get("api/integral/statistics/pie/b", { employee_id: 0, 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
+        const points = chart.reward.map((rewardItem, index) => {
+          return { date: rewardItem.date, value: rewardItem.point - (chart.deduction[index].point || 0) }
+        })
+        chart1.changeData(points);
+        that.setData({
+          data_b: b,
+          data_good: good,
+          data_bad: bad,
+        });
+      }
+      if (resArr[1].data.code == 1) {
+        const pieData = resArr[1].data.data.list.map((item) => {
+          return { name: item.name, percent: item.point < 0 ? 0 : item.point, a: '1',point:item.point }
+        })
+        var isData=pieData.every(itme=>{
+            return itme.percent == 0;
+         })
+        that.setData({
+          pieData:isData?[]:pieData
+        });
+        chart2.changeData(pieData);
+      }
+    }).catch(e => {
+      console.error(e)
+    })
+  },
 
   //获取个人统计
   getUserData() {
- app.$get("api/integral/statistics", { employee_id: 0, month: app.globalData.month }).then((res) => {
+    app.$get("api/integral/statistics", { employee_id: 0, month: app.globalData.month }).then((res) => {
       var data = res.data.data;
       var task = data.task;
       dd.setNavigationBar({ title: data.name });
@@ -81,24 +188,26 @@ Page({
         ratio: ratio,
         target_ratio: target_ratio
       }
+       that.getLsit();
       this.setData({
         userData: data
       })
     }, (err) => { })
   },
   //获取积分事件
-   getIncidentLsit() {
-      app.$get("api/integral/statistics/integral", { month: app.globalData.month, page: 1, page_size: 5 }).then((res) => {
+  getIncidentLsit() {
+    app.$get("api/integral/statistics/integral", { month: app.globalData.month, page: 1, page_size: 5,employee_ids:app.globalData.userData.id }).then((res) => {
       var data = res.data.data.list;
-       data.map((item)=>{
-        item.ptObj=app.getTypesItem(item.pt_id);
+      data.map((item) => {
+        item.ptObj = app.getTypesItem(item.pt_id);
       })
       this.setData({
         incidentLsit: data,
-        incidentLsitTotal:res.data.data.total
+        incidentLsitTotal: res.data.data.total
       })
     }, (err) => { })
   },
+
   getIncidentNum() {
     app.$get("api/integral/review/list", { type: 'waiting', page: 1, pt_id: 0 }).then((res) => {
       var data = res.data.data;

+ 2 - 1
pages/workbench/index/index.json

@@ -1,6 +1,7 @@
 {
   "usingComponents": {
+    "f2": "@antv/my-f2",
     "img-box":"/Component/img-box/index",
-      "no-data":"/Component/noData/noData"
+    "no-data":"/Component/noData/noData"
   }
 }

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

@@ -95,8 +95,8 @@
         </view>
       </view>
     </view>
-    <view class="add" catchTap="addArr">+  再加一条</view>
-    <view class="btn-area">
+    <!-- <view class="add" catchTap="addArr">+  再加一条</view> -->
+    <view class="btn-area" style="margin-top:28rpx;">
         <button type="default" loading="{{disabled}}" class="defBtn" disabled="{{disabled}}" catchTap="formSubmit">提交</button>
     </view>
   </form>

+ 123 - 119
pages/workbench/jk_B/jk_B.js

@@ -9,45 +9,45 @@ Page({
     isShowType: '',//是显示选择规则还是显示选择分类
     activeIndex: '',
     isArr: ['奖', '扣'],
-    reviewerObj:[],//默认的审批人
-    disabled:false,
-    employeeList:[],//人员列表
-    superior_list:[],//领导人员
-    type:'B',
-    isGzType:'BF',
-    defaultRuleId:'',
+    reviewerObj: [],//默认的审批人
+    disabled: false,
+    employeeList: [],//人员列表
+    superior_list: [],//领导人员
+    type: 'B',
+    isGzType: 'BF',
+    defaultRuleId: '',
   },
   onLoad(data) {
     that = this;
     this.setData({
-      type:data.type,
-      isGzType:data.type=="B"? "BF":"AF",
+      type: data.type,
+      isGzType: data.type == "B" ? "BF" : "AF",
       items: [{//录入选项列表
-              checked: true,//判断是否开启指定规则
-              rule_id: '',//积分分类id
-              rule_id2: '',
-              rule_name: '',//积分分类名称
+        checked: true,//判断是否开启指定规则
+        rule_id: '',//积分分类id
+        rule_id2: '',
+        rule_name: '',//积分分类名称
 
-              item_id: 0,//积分细则id 不选可以为0
+        item_id: 0,//积分细则id 不选可以为0
 
-              point: '',//录入积分可为正负值,不能为0(细则)
-              point2: '',//录入积分可为正负值,不能为0(分类)
+        point: '',//录入积分可为正负值,不能为0(细则)
+        point2: '',//录入积分可为正负值,不能为0(分类)
 
-              remark: '',//备注
-              event_time: app.globalData.day,//事件时间
-              pt_id: '',//积分种类id
-              reviewer_id: '',//审核人ID
-              revieweName: '',//审批人姓名(非传)
-              files: '',//附件数组列表
-              isArrindex: true,//奖扣索引(默认奖)(细则)
-              isArrindex2: true,//奖扣索引(默认奖)(分类)
-              selectRule: '',//选择的规则
-            }],
+        remark: '',//备注
+        event_time: app.globalData.day,//事件时间
+        pt_id: '',//积分种类id
+        reviewer_id: '',//审核人ID
+        revieweName: '',//审批人姓名(非传)
+        files: '',//附件数组列表
+        isArrindex: true,//奖扣索引(默认奖)(细则)
+        isArrindex2: true,//奖扣索引(默认奖)(分类)
+        selectRule: '',//选择的规则
+      }],
     })
-    if(data.type=="B"){
-       dd.setNavigationBar({ title: "奖扣B分" });
-    }else{
-       dd.setNavigationBar({ title: "奖扣A分" });
+    if (data.type == "B") {
+      dd.setNavigationBar({ title: "奖扣B分" });
+    } else {
+      dd.setNavigationBar({ title: "奖扣A分" });
     }
   },
   onShow() {
@@ -57,13 +57,13 @@ Page({
     });
   },
   //显示图片
-  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
+    });
   },
   //选择奖还是扣(细则)
   bindPickerChange(e) {
@@ -85,37 +85,37 @@ Page({
   },
   //关闭规则
   onClose() {
-    animation.translateY(750).step();
+    animation.translateY(1200).step();
     that.setData({
       animationInfo: animation.export()
     });
-    that.setData({isShowType: ''});
+    that.setData({ isShowType: '' });
   },
   //选择弹窗
   openSelect(e) {
-    var num=e.target.dataset.num;
+    var num = e.target.dataset.num;
     var userData = this.data.users;
     var superior_list = this.data.superior_list;
-    if(num==4){
-        if(userData.length==0){
-          this.showToast('请先选择奖扣对象')
-          return;
-        }
-        if(superior_list.length==0){
-          this.showToast('您没有审批人,请联系管理员')
-          return;
-        }
+    if (num == 4) {
+      if (userData.length == 0) {
+        this.showToast('请先选择奖扣对象')
+        return;
+      }
+      if (superior_list.length == 0) {
+        this.showToast('您没有审批人,请联系管理员')
+        return;
+      }
     }
     that.setData({ activeIndex: '' });
-    if(e.target.dataset.ruleId){
-       that.setData({ defaultRuleId:e.target.dataset.ruleId});
+    if (e.target.dataset.ruleId) {
+      that.setData({ defaultRuleId: e.target.dataset.ruleId });
     }
-    if(e.target.dataset.item){
-       if(e.target.dataset.item.id){
-          that.setData({ reviewerObj: [e.target.dataset.item] });
-       }else{
-          that.setData({ reviewerObj: [] });
-       }
+    if (e.target.dataset.item) {
+      if (e.target.dataset.item.id) {
+        that.setData({ reviewerObj: [e.target.dataset.item] });
+      } else {
+        that.setData({ reviewerObj: [] });
+      }
     }
     that.setData({
       isShowType: num,
@@ -137,7 +137,7 @@ Page({
     });
 
   },
-   //图片选择
+  //图片选择
   openImg(e) {
     var index2 = e.target.dataset.index;
     var files = that.data.items[index2].files;
@@ -148,13 +148,13 @@ Page({
     dd.chooseImage({
       count: 1,
       success: (res) => {
-          that.postImg(res.filePaths[0], index2);
+        that.postImg(res.filePaths[0], index2);
       },
     });
   },
-  postImg(img_url,index) {
+  postImg(img_url, index) {
     var files_box = `items[${index}].files`;
-    var files=this.data.items[index].files;
+    var files = this.data.items[index].files;
     dd.httpRequest({
       url: app.globalData.imgHttpUrl,
       method: 'POST',
@@ -163,13 +163,17 @@ Page({
         'name': app.globalData.day
       },
       success: function (res) {
-        var key = 'intesys/' + app.globalData.day + '/' + that.random_string(32) + '.png';
+        if (app.globalData.userData.site_id) {
+          var key = 'intesys/dd/' + app.globalData.userData.site_id + "/" + app.globalData.day + '/' + that.random_string(32) + '.png';
+        } else {
+          var key = 'intesys/dd/' + app.globalData.day + '/' + that.random_string(32) + '.png';
+        }
         var obj = res.data.data;
         dd.uploadFile({
           url: app.globalData.ALIOSS_URL,
           fileType: 'image',
           fileName: 'file',
-          filePath:img_url,
+          filePath: img_url,
           formData: {
             key: key,
             policy: obj.policy,
@@ -179,18 +183,18 @@ Page({
           },
           success: (res) => {
             if (res.statusCode == 200) {
-              if(files.length>0){
+              if (files.length > 0) {
                 files.push('http://cdn.intesys.g107.com/' + key)
-              }else{
-                files=['http://cdn.intesys.g107.com/' + key];
+              } else {
+                files = ['http://cdn.intesys.g107.com/' + key];
               }
               that.setData({
                 [files_box]: files
               });
-             app.globalData.showToast("已上传");
+              app.globalData.showToast("已上传");
             }
           },
-          fail:(err)=>{
+          fail: (err) => {
             console.log(err);
           }
         });
@@ -294,8 +298,8 @@ Page({
       remark: '',
       event_time: app.globalData.day,
       pt_id: '',
-      reviewer_id:'',//审核人ID
-      revieweName:'',//审批人姓名(非传)
+      reviewer_id: '',//审核人ID
+      revieweName: '',//审批人姓名(非传)
       files: '',
       isArrindex: true,
       isArrindex2: true,
@@ -315,9 +319,9 @@ Page({
     var userData = this.data.users;
     var arr = [];
     var isTg = true;
-    var pt_id =app.getTypesItem(this.data.isGzType).id
-    if(userData.length==0){
-      this.showToast('请输入奖扣对象')
+    var pt_id = app.getTypesItem(this.data.isGzType).id
+    if (userData.length == 0) {
+      this.showToast('请选择奖扣对象')
       return;
     }
     for (var i = 0; i < items.length; i++) {
@@ -332,7 +336,7 @@ Page({
           point = num;
         }
         if (point < item.selectRule.min_point || point > item.selectRule.max_point) {
-          this.showToast(`第${i + 1}条,积分超出可输入范围`);
+          this.showToast(`第${i + 1}条,积分分值超出可输入范围`);
           isTg = false;
         }
       } else {
@@ -350,13 +354,13 @@ Page({
         }
       } else {
         if (!item.rule_id2) {
-          this.showToast(`第${i + 1}条请选择规则分类`);
+          this.showToast(`第${i + 1}条请选择分类`);
           isTg = false;
           break;
         }
       }
       if (point == 0 || !point) {
-        this.showToast(`第${i + 1}条积分不能为0或者为空`);
+        this.showToast(`第${i + 1}条积分分值不能为0或者为空`);
         isTg = false;
         break;
       }
@@ -372,12 +376,12 @@ Page({
       obj.remark = item.remark;
       obj.event_time = item.event_time;
       obj.pt_id = pt_id;
-      obj.reviewer_id = item.reviewer_id? item.reviewer_id:0;
+      obj.reviewer_id = item.reviewer_id ? item.reviewer_id : 0;
       obj.files = item.files;
       arr.push(obj);
     }
-    var userIds=[]
-    userData.map(item=>{
+    var userIds = []
+    userData.map(item => {
       userIds.push(item.id)
     })
     if (isTg) {
@@ -385,37 +389,37 @@ Page({
         members: JSON.stringify(userIds),
         items: JSON.stringify(arr)
       }
-      this.setData({disabled:true});
-      var url=this.data.type=='B'? 'api/integral/point/entry':'api/integral/review/a/entry'
+      this.setData({ disabled: true });
+      var url = this.data.type == 'B' ? 'api/integral/point/entry' : 'api/integral/review/a/entry'
       app.$post(url, data).then((res) => {
-        var is = true,msg;
-        if(this.data.type=='B'){
+        var is = true, msg;
+        if (this.data.type == 'B') {
           res.data.data.list.forEach(item => {
             if (item.status != 1) {
               is = false;
-              msg=item.msg;
+              msg = item.msg;
             }
           })
-        }else{
+        } else {
           res.data.data.forEach(item => {
             if (item.status != 1) {
               is = false;
-              msg=item.rule_item;
+              msg = item.rule_item;
             }
           })
         }
         if (is) {
-          this.showToast('提交');
+          this.showToast('提交成功');
           setTimeout(() => {
-            this.setData({disabled:false});
-            dd.navigateBack({ delta: 1})
+            this.setData({ disabled: false });
+            dd.navigateBack({ delta: 1 })
           }, 1000);
-        }else{
-          this.setData({disabled:false});
+        } else {
+          this.setData({ disabled: false });
           this.showToast(msg);
         }
-      }).catch(err=>{
-          this.setData({disabled:false});
+      }).catch(err => {
+        this.setData({ disabled: false });
       })
     }
   },
@@ -443,31 +447,31 @@ Page({
   //选择人
   onSelectUser(item) {
     //空数据
-    this.data.items.forEach((obj,index)=>{
+    this.data.items.forEach((obj, index) => {
       var reviewer_id = `items[${index}].reviewer_id`
       var revieweName = `items[${index}].revieweName`
-      if(obj.reviewer_id){
+      if (obj.reviewer_id) {
         that.setData({
           [reviewer_id]: '',
           [revieweName]: '',
         });
       }
     })
-    this.setData({superior_list:[]});
-    var userIdArr=[];
-    if(item.length>0){
-      item.forEach(el=>{
-         userIdArr.push(el.id)
+    this.setData({ superior_list: [] });
+    var userIdArr = [];
+    if (item.length > 0) {
+      item.forEach(el => {
+        userIdArr.push(el.id)
       })
-     var employee_ids = userIdArr.join(',');
-      this.getEmployeeList(employee_ids,function(res){
-        var arr=[]
-        res.forEach(el=>{
+      var employee_ids = userIdArr.join(',');
+      this.getEmployeeList(employee_ids, function (res) {
+        var arr = []
+        res.forEach(el => {
           arr.push(el.id)
         })
         that.setData({
-          users: item.length>0? item:[],
-          superior_list:arr
+          users: item.length > 0 ? item : [],
+          superior_list: arr
         })
       });
     }
@@ -475,7 +479,7 @@ Page({
   },
   //选择人2
   onSelectUser2(item) {
-    var elm=item.length>0? item[0]:{id:'',name:''};
+    var elm = item.length > 0 ? item[0] : { id: '', name: '' };
     var index = this.data.activeIndex;
     var reviewer_id = `items[${index}].reviewer_id`
     var revieweName = `items[${index}].revieweName`
@@ -521,19 +525,19 @@ Page({
     });
   },
   //获取人员(上级人员)
-  getEmployeeList(userIdArr,callBack) {
-      app.$get("api/employee/superior",{employee_id:userIdArr}).then((res) => {
-          callBack(res.data.data.list)
-      })
+  getEmployeeList(userIdArr, callBack) {
+    app.$get("api/employee/superior", { employee_id: userIdArr, filter_applyor: 1 }).then((res) => {
+      callBack(res.data.data.list)
+    })
   },
-  intersection (arr) {
-      const arrSet = []
-      const intersectionSet = new Set()
-      arr.forEach(items => {
-        arrSet.push(new Set(items.map(item => item.id)))
-        items.forEach(item => intersectionSet.add(item.id))
-      })
-      return [...intersectionSet].filter(item => arrSet.every(set => set.has(item)))
+  intersection(arr) {
+    const arrSet = []
+    const intersectionSet = new Set()
+    arr.forEach(items => {
+      arrSet.push(new Set(items.map(item => item.id)))
+      items.forEach(item => intersectionSet.add(item.id))
+    })
+    return [...intersectionSet].filter(item => arrSet.every(set => set.has(item)))
   },
 });
 

+ 4 - 4
pages/workbench/my_approve/my_approve.axml

@@ -39,10 +39,10 @@
         <img-box name="{{item.employee_name}}" height="70rpx" width="70rpx" fSize="24rpx"></img-box>
         <view class="flex-1 main-right">
           <view class="flex-box flex-v-ce">
-            <view class="name flex-1" a:if="{{item.source_type == 2}}">{{item.employee_name}}提交的积分申请</view>
-            <view class="name flex-1" a:if="{{item.source_type == 1}}">{{item.employee_name}}完成的积分任务</view>
-            <view class="name flex-1" a:if="{{item.source_type == 3}}">{{item.employee_name}}提交的积分奖扣</view>
-            <view class="name flex-1" a:if="{{item.source_type == 4}}">{{item.employee_name}}提交的绩效工作</view>
+            <view class="name flex-1" a:if="{{item.source_type == 2}}">{{item.employee_name}}的积分申请</view>
+            <view class="name flex-1" a:if="{{item.source_type == 1}}">{{item.employee_name}}的积分任务</view>
+            <view class="name flex-1" a:if="{{item.source_type == 3}}">{{item.employee_name}}的积分奖扣</view>
+            <view class="name flex-1" a:if="{{item.source_type == 4}}">{{item.employee_name}}的绩效工作</view>
             <block a:if="{{item.status==1}}">
               <view class="red" a:if="{{item.review_point>0}}">+{{item.review_point}}</view>
               <view class="green" a:else>{{item.review_point}}</view>

+ 30 - 14
pages/workbench/my_approve/my_approve.js

@@ -9,17 +9,34 @@ Page({
     keyword: '',
     page: 1,
     isBh: false,//是否显示驳回弹窗
-    textArea: ""
+    textArea: "",
   },
   onLoad() {
     that = this;
     dd.setNavigationBar({ title: "我的审批" });
   },
   onShow() {
-    this.setData({
-       page: 1,
-    });
-    that.getData();
+    this.refreshData();
+  },
+//当在详情返回时刷新列表,但你请求接口
+  refreshData(id){
+    if(this.data.page==1){
+      dd.hideLoading();
+      that.getData();
+    }else{
+      console.log("进来了")     
+       if(id){//当page不为一并下一页返回上一页不执行onshow()
+        var arr=this.data.dataList;
+        arr.forEach((element,index) => {
+          if(element.id==id){
+            arr.splice(index, 1);
+          }
+        });
+        this.setData({
+          dataList:arr
+        })
+      }
+    }
   },
   bindTextAreaBlur(e) {
     this.setData({
@@ -35,10 +52,7 @@ Page({
     app.$post("api/integral/review", { review_id: item.id, remark: that.data.textArea, action: "refuse", ticket_count: 0 }).then((res) => {
       that.closeBh()
       app.globalData.showToast("已驳回");
-      setTimeout(() => {
-        that.setData({ textArea: '', page: 1 });
-        that.getData();
-      }, 1000);;
+      that.refreshData(item.id);
     })
   },
   closeBh() {
@@ -84,13 +98,15 @@ Page({
       var data = res.data.data.list || [];
       var dataList = that.data.dataList || [];
       if (type == '2') {
-        if (data.length > 0) {
+        if (data.length < 20) {
+          this.setData({
+            dataList: dataList.concat(data),
+            isData: true
+          })
+        }else{
           this.setData({
-            dataList: dataList.concat(data)
+            dataList: dataList.concat(data),
           })
-        } else {
-          this.setData({ isData: true })
-          return;
         }
       } else {
         this.setData({ dataList: data,isData: false })

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

@@ -105,7 +105,8 @@ Page({
       currentDate: that.data.date,
       success: (res) => {
         that.setData({
-          date: res.date
+          date: res.date,
+          isDb:false
         })
           that.getUserData();
           that.getIncidentLsit();

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

@@ -29,7 +29,7 @@
   </view>
   <view class="main">
       <view class="flex-box">
-         <view class="title flex-1">近半年的A分</view>
+         <view class="title flex-1">当月A分事件</view>
          <view class="gengduo" catchTap="openMore">更多<image mode="scaleToFill"  src="../../../image/right.png"/></view>
       </view>
       <view>

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

@@ -31,10 +31,9 @@ Page({
     showCrosshairs: true,
     showItemMarker: false,
     onShow: function onShow(ev) {
-      console.log(ev.items);
       const items = ev.items;
       items[0].name ="月份:"+items[0].origin.date;
-      items[0].value ="分值"+items[0].value;
+      items[0].value ="分值:"+items[0].value;
     }
   });
     chart1.line().position('date*value');
@@ -70,7 +69,7 @@ Page({
       app.$get("api/integral/statistics/a", {  employee_id: 0, 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) }
+            return { date: rewardItem.month, value: rewardItem.point - (chart.deduction[index].point || 0) }
           })
           chart1.changeData(points);
           that.setData({

+ 56 - 27
pages/workbench/statistics_B/statistics_B.js

@@ -9,14 +9,15 @@ Page({
     data_b: [],
     chartData: [],//折线图数据
     pieData: [1],//饼型图数据
+    isShowTb:true,
   },
   onLoad() {
     that = this;
-    chart1,chart2='';
+    chart1, chart2 = '';
     dd.setNavigationBar({ title: "我的B分统计" });
   },
-    //打开更多
-  openMore(){
+  //打开更多
+  openMore() {
     dd.navigateTo({
       url: '../../statistics/integralEvent/integralEvent?month=' + this.data.date + '&type=BF'
     })
@@ -26,19 +27,19 @@ Page({
     chart1 = new F2.Chart(config);
     chart1.source(that.data.chartData, {
       date: {
-        range: [0, 1],
+        // range: [0, 1],
         tickCount: 5
       }
     });
     chart1.tooltip({
-        showCrosshairs: true,
-        showItemMarker: false,
-        onShow: function onShow(ev) {
-          const items = ev.items;
-          items[0].name ="月份:"+items[0].origin.date;
-          items[0].value ="分值:"+items[0].value;
-        }
-      });
+      showCrosshairs: true,
+      showItemMarker: false,
+      onShow: function onShow(ev) {
+        const items = ev.items;
+        items[0].name = "月份:" + items[0].origin.date;
+        items[0].value = "分值:" + items[0].value;
+      }
+    });
     chart1.line().position('date*value');
     chart1.point().position('date*value').style({
       stroke: '#fff',
@@ -59,12 +60,13 @@ Page({
     });
     chart2.legend({
       position: 'right',
-      itemFormatter: function itemFormatter(val,index) {
-        var str='';
-        that.data.pieData.forEach(item=>{
-          if(item.name==val){
-              str=val + '  ' + item.percent+'分';
+      itemFormatter: function itemFormatter(val, index) {
+        var str = '';
+        that.data.pieData.forEach(item => {
+          if (item.name == val) {
+            str = val + '  ' + item.point + '分';
           }
+          
         })
         return str;
       }
@@ -89,7 +91,7 @@ Page({
   },
   //时间选择
   openDate() {
-     that.setData({showDate: true});
+    that.setData({ showDate: true });
     dd.datePicker({
       format: 'yyyy-MM',
       currentDate: that.data.date,
@@ -99,22 +101,48 @@ Page({
         })
         that.getIncidentLsit();
       },
-      complete:(res)=>{
+      complete: (res) => {
         that.setData({
-           showDate: false
+          showDate: false
         })
       }
     });
   },
   //获取积分事件
   getIncidentLsit() {
-    var incident = app.$get("api/integral/statistics/b", { employee_id: 0, month: that.data.date });
+    var y = that.data.date.substr(that.data.date.length - 2, 2);
+    var n = that.data.date.substr(0, 4);
+    var start_date;
+    if (y >= 6) {
+      start_date = n + "-" + "0" + (y - 5).toString();
+    } else {
+      n--;
+      switch (y - 5) {
+        case 0:
+          y = 12
+          break;
+        case -1:
+          y = 11
+          break;
+        case -2:
+          y = 10
+          break;
+        case -3:
+          y = "0"+(9).toString()
+          break;
+        case -4:
+          y = "0"+(8).toString()
+          break;
+      }
+      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 });
     Promise.all([incident, pei]).then(resArr => {
       if (resArr[0].data.code == 1) {
         const { b, chart, good, bad } = resArr[0].data.data
         const points = chart.reward.map((rewardItem, index) => {
-          return { date: rewardItem.month, value: rewardItem.point - (chart.deduction[index].point || 0) }
+          return { date: rewardItem.date, value: rewardItem.point - (chart.deduction[index].point || 0) }
         })
         chart1.changeData(points);
         that.setData({
@@ -124,13 +152,14 @@ Page({
         });
       }
       if (resArr[1].data.code == 1) {
-        let totalPoint = 0
-        const pieData = resArr[1].data.data.list.map((item, index) => {
-          totalPoint += item.point
-          return { name: item.name, percent: item.point<0? 0:item.point, a: '1' }
+        const pieData = resArr[1].data.data.list.map((item) => {
+          return { name: item.name, percent: item.point < 0 ? 0 : item.point, a:"1",point:item.point }
         })
+        var isData=pieData.every(itme=>{
+            return itme.percent == 0;
+         })
         that.setData({
-          pieData: pieData
+          pieData:isData?[]:pieData
         });
         chart2.changeData(pieData);
       }