347617796@qq.com před 4 roky
rodič
revize
1764f2b419
66 změnil soubory, kde provedl 1647 přidání a 624 odebrání
  1. 1 1
      Component/selectDate_two/selectDate_two.js
  2. 15 6
      Component/selectRule/selectRule.axml
  3. 12 3
      Component/selectRule/selectRule.js
  4. 40 32
      Component/selectSectionStaff/selectSectionStaff.axml
  5. 99 59
      Component/selectSectionStaff/selectSectionStaff.js
  6. 6 12
      Component/selectSectionStaff_tow/selectSectionStaff_tow.axml
  7. 46 94
      Component/selectSectionStaff_tow/selectSectionStaff_tow.js
  8. 8 5
      Component/selectStaff/selectStaff.axml
  9. 37 17
      Component/selectStaff/selectStaff.js
  10. 8 0
      Component/selectType/selectType.axml
  11. 5 1
      Component/selectType/selectType.js
  12. 13 0
      app.acss
  13. 145 65
      app.js
  14. 3 1
      app.json
  15. binární
      image/dt.png
  16. binární
      image/money.jpg
  17. binární
      image/start1.png
  18. binární
      image/start2.png
  19. binární
      image/start3.png
  20. 1 1
      pages/deploy/addMoney/addMoney.axml
  21. 5 5
      pages/deploy/addMoney/addMoney.js
  22. 1 1
      pages/deploy/index/index.acss
  23. 2 2
      pages/deploy/index/index.axml
  24. 3 2
      pages/deploy/index/index.js
  25. 4 1
      pages/deploy/integralRule/integralRule.axml
  26. 9 1
      pages/deploy/integralRule/integralRule.js
  27. 4 1
      pages/deploy/organization/organization.axml
  28. 9 1
      pages/deploy/organization/organization.js
  29. 1 1
      pages/deploy/sku/sku.axml
  30. 6 6
      pages/deploy/sku/sku.js
  31. 67 0
      pages/start/start.acss
  32. 63 0
      pages/start/start.axml
  33. 23 0
      pages/start/start.js
  34. 1 0
      pages/start/start.json
  35. 4 4
      pages/statistics/B_ranking/B_ranking.axml
  36. 7 7
      pages/statistics/C_ranking/C_ranking.axml
  37. 87 16
      pages/statistics/C_ranking/C_ranking.js
  38. 11 10
      pages/statistics/customRamking/customRamking.axml
  39. 12 11
      pages/statistics/my_PrizeBuckle/my_PrizeBuckle.axml
  40. 32 15
      pages/statistics/my_PrizeBuckle/my_PrizeBuckle.js
  41. 3 0
      pages/statistics/my_apply/my_apply.axml
  42. 9 0
      pages/statistics/my_apply/my_apply.js
  43. 1 1
      pages/statistics/prizeBuckleDetail/prizeBuckleDetail.acss
  44. 5 5
      pages/statistics/sectionRanking/sectionRanking.axml
  45. 6 3
      pages/statistics/sectionRanking/sectionRanking.js
  46. 79 0
      pages/statistics/userRamking/userRamking.acss
  47. 39 0
      pages/statistics/userRamking/userRamking.axml
  48. 74 0
      pages/statistics/userRamking/userRamking.js
  49. 1 0
      pages/statistics/userRamking/userRamking.json
  50. 10 4
      pages/workbench/apply/apply.axml
  51. 149 44
      pages/workbench/apply/apply.js
  52. 2 1
      pages/workbench/apply/apply.json
  53. 2 2
      pages/workbench/approve/approve.axml
  54. 0 1
      pages/workbench/approve/approve.js
  55. 1 1
      pages/workbench/approveDetail/approveDetail.acss
  56. 172 40
      pages/workbench/index/index.acss
  57. 107 68
      pages/workbench/index/index.axml
  58. 149 48
      pages/workbench/index/index.js
  59. 1 1
      pages/workbench/jk_B/jk_B.acss
  60. 3 3
      pages/workbench/jk_B/jk_B.axml
  61. 15 11
      pages/workbench/jk_B/jk_B.js
  62. 4 1
      pages/workbench/my_approve/my_approve.axml
  63. 10 3
      pages/workbench/my_approve/my_approve.js
  64. 5 4
      pages/workbench/noJurisdiction/noJurisdiction.axml
  65. 9 2
      pages/workbench/noJurisdiction/noJurisdiction.js
  66. 1 0
      utils/util.js

+ 1 - 1
Component/selectDate_two/selectDate_two.js

@@ -17,7 +17,7 @@ Component({
     jdArr: ['一季度', '二季度', '三季度', '四季度'],
     yearIndex:yearIndex,
     yearArr:app.globalData.yearArr,
-    jdYearIndex:0,
+    jdYearIndex:yearIndex,
   },
   props: {
     onClose: (data) => console.log(data),

+ 15 - 6
Component/selectRule/selectRule.axml

@@ -1,9 +1,12 @@
 <view class="all">
   <image mode="scaleToFill" catchTap="plusOne" class="close" src="../../../image/close.png"/>
-  <view class="search flex-box flex-v-ce">
-    <image mode="scaleToFill" src="../../../image/ss.png"/>
-    <input placeholder="请输入规则内容搜索" onInput="bindKeyInput"/>
-  </view>
+  <form onReset="onReset">
+    <view class="search flex-box flex-v-ce">
+      <image mode="scaleToFill" src="../../../image/ss.png"/>
+      <input placeholder="请输入规则内容搜索" onInput="bindKeyInput" class="flex-1"/>
+      <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
+    </view>
+  </form>
   <view class="flex-box content">
     <scroll-view class="flex-2 left" scroll-y="{{true}}" a:if="{{isItem}}">
       <view class="tree" a:for="{{rule_tree}}">
@@ -34,7 +37,13 @@
             </view>
           </label>
         </radio-group>
-        <view a:if="{{item_list.length==0}}" class="nodata fontColorF">暂无相关规则</view>
+        <view a:if="{{item_list.length==0}}" class="nodata fontColorF">
+          <view>
+            <image mode="scaleToFill" src="../../../image/noData.png" style="width: 340rpx;height: 340rpx;margin-bottom:20rpx;"/>
+          </view>
+          <text a:if="{{isCreator}}">暂无积分规则,请前往钉钉电脑端添加【积分规则】</text>
+          <text a:else>暂无积分规则,请联系主管理员“{{creatorName}}”或积分管理员前往钉钉电脑添加【积分规则】</text>
+        </view>
       </view>
     </scroll-view>
     <scroll-view class="flex-5 right" scroll-y="{{true}}" a:else>
@@ -51,7 +60,7 @@
           </view>
         </label>
       </radio-group>
-      <view a:else class="nodata fontColorT">暂无相关规则</view>
+      <view a:else class="nodata fontColorT">暂无积分规则,请前往钉钉电脑端添加【积分规则】</view>
       </view>
     </scroll-view>
   </view>

+ 12 - 3
Component/selectRule/selectRule.js

@@ -12,6 +12,8 @@ Component({
     item_child_list:[],//子数据集合
     isItem:true,//判断是否显示左侧
     selectItem:[],//选择的数据
+    isCreator:false,
+    creatorName:'',
   },
   props: {
     onClose: (data) => console.log(data),
@@ -21,12 +23,19 @@ Component({
   },
   didMount() {
     that = this;
-    this.setData({types:app.globalData.types})
+    this.setData({types:app.globalData.types,isCreator: app.globalData.isCreator,creatorName:app.globalData.corpMessage.creators})
     this.getData();
   },
   didUpdate() { },
   didUnmount() { },
   methods: {
+    onReset(){
+      this.setData({
+          selectItem: [],
+          isItem:true,
+          isVal:false
+      })
+    },
     //搜索
     bindKeyInput(e) {
         var item_list=this.data.allItems;
@@ -35,9 +44,9 @@ Component({
         });
         this.setData({
           selectItem: items,
-          isItem:e.detail.value? false:true
+          isItem:e.detail.value? false:true,
+          isVal:e.detail.value? true:false
         })
-
     },
     //点击一级
     activeTree(e){

+ 40 - 32
Component/selectSectionStaff/selectSectionStaff.axml

@@ -1,9 +1,12 @@
 <view class="all">
   <image mode="scaleToFill" catchTap="onClose" class="close" src="../../../image/close.png"></image>
-  <view class="search flex-box flex-v-ce">
-    <image mode="scaleToFill" src="../../../image/ss.png"></image>
-    <input placeholder="请输入姓名搜索" onInput="bindKeyInput"></input>
-  </view>
+  <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>
+      <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
+    </view>
+  </form>
   <view class="content">
     <view a:if="{{terr.length>1}}" class="flex-box flex-v-ce shu">
       <view a:for="{{terr}}" class="flex-box flex-v-ce" data-index="{{index}}" catchTap="activeItem" data-item="{{item}}">
@@ -12,49 +15,54 @@
       </view>
     </view>
     <scroll-view class="staff-ul" scroll-y="{{true}}" style="{{terr.length>1? 'height: calc(100vh - 390rpx);':'height: calc(100vh - 320rpx);'}}">
-      <block a:if="{{isItem}}">
-        <view class="ul2">
-          <view a:for="{{rule_tree}}" class="flex-box flex-v-ce li">
-            <view class="flex-box flex-v-ce flex-1" data-item="{{item}}" catchTap="changeSection">
-              <image mode="scaleToFill" style="width:50rpx;height:50rpx; margin:0 10rpx;" src="../../../image/BM.png"></image>
+      <view class="ul2">
+        <view a:for="{{rule_tree}}" class="flex-box flex-v-ce li">
+          <view class="flex-box flex-v-ce flex-1" data-item="{{item}}" catchTap="changeSection">
+            <image mode="scaleToFill" style="width:50rpx;height:50rpx; margin:0 10rpx;" src="../../../image/BM.png"></image>
               {{item.name}}
-            </view>
-            <view a:if="{{item._child.length>0}}" class="xia" data-item="{{item}}" catchTap="openDown">| 下级</view>
           </view>
+          <view a:if="{{item._child.length>0}}" class="xia" data-item="{{item}}" catchTap="openDown">| 下级</view>
         </view>
-        <view class="flex-box flex-v-ce staff-all">
-          <view class="flex-1"></view>
-          <label a:if="{{isAll}}">
-            <text class="rule-all-text">全选</text>
-            <checkbox onChange="ruleActiveAll" disabled="{{item.disabled}}" checked="{{isAllChecked}}"></checkbox>
-          </label>
-        </view>
-        <view a:if="{{userList.length>0}}" a:for="{{userList}}"  class="flex-box flex-v-ce userItem">
+      </view>
+      <view class="flex-box flex-v-ce staff-all">
+        <view class="flex-1"></view>
+        <label a:if="{{isAll}}">
+          <text class="rule-all-text">全选</text>
+          <checkbox onChange="ruleActiveAll" disabled="{{item.disabled}}" checked="{{isAllChecked}}"></checkbox>
+        </label>
+      </view>
+      <view a:if="{{userList.length>0&&isAll&&item.name.indexOf(keyVal)>= 0}}" a:for="{{userList}}" class="flex-box flex-v-ce userItem">
           <label class="flex-box flex-v-ce flex-1">
             <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="70rpx" width="70rpx"></img-box>
             <text style="margin-left:20rpx;" class="flex-1">{{item.name}}</text>
             <checkbox onChange="radioChange" data-index="{{index}}" data-item="{{item}}" checked="{{item.checked}}" name="{{item.id}}"></checkbox>
           </label>
-        </view>
-        <view a:if="{{userList.length==0}}">
-          <view class="fontColorF" style="margin-top:200rpx;text-align: center;">
-              <view>您当前部门没有可管理人员,请联系公司管理员</view>
-              <view>设置对应管理范围</view>
+      </view>
+      <view a:if="{{userList.length>0&&!isAll&&item.name.indexOf(keyVal)>= 0}}" a:for="{{userList}}" class="flex-box flex-v-ce userItem">
+          <view class="{{item.checked? 'active':''}} flex-box flex-v-ce flex-1" catchTap="radioChange" data-index="{{index}}" data-item="{{item}}">
+            <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="70rpx" width="70rpx"></img-box>
+            <text style="margin-left:20rpx;" class="flex-1">{{item.name}}</text>
+            <view class="radio_"></view>
           </view>
+      </view>
+      <view a:if="{{userList.length==0}}">
+        <view style="text-align:center">
+          <image mode="scaleToFill" src="../../../image/noData.png" style="width: 340rpx;height: 340rpx;margin-bottom:20rpx;"/>
+        </view>
+        <view class="fontColorF" style="margin-top:0rpx;text-align: center;" a:if="{{isCreator}}">
+          <view  style="font-size:0.28rem">未授权员工进入系统,请前往钉钉电脑端</view>
+          <view  style="font-size:0.28rem">为员工【启用积分管理】</view>
+        </view>
+        <view class="fontColorF" style="margin-top:0rpx;text-align: center;" a:else>
+          <view style="font-size:0.28rem">您当前没有可管理人员,请联系主管理员“{{creatorName}}”</view>
+          <view  style="font-size:0.28rem" >或积分管理员前往钉钉电脑端为您设置【管理范围】</view>
         </view>
-      </block>
-      <view a:else a:for="{{searchVal}}" class="flex-box flex-v-ce userItem">
-        <label class="flex-box flex-v-ce flex-1">
-          <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="70rpx" width="70rpx"></img-box>
-          <text style="margin-left:20rpx;" class="flex-1">{{item.name}}</text>
-          <checkbox onChange="radioChange" data-index="{{index}}" data-item="{{item}}" checked="{{item.checked}}" name="{{item.id}}"></checkbox>
-        </label>
       </view>
     </scroll-view>
   </view>
   <view class="StaffFooter flex-box flex-v-ce">
     <view class="flex-1 f-left flex-box flex-v-ce">
-      <view a:for="{{selectUserId}}" style="margin-right:10rpx;">
+      <view a:for="{{selectUserId}}" style="margin-right:10rpx;" a:if="{{item.id}}">
         <image a:if="{{item.img_url}}" class="img-url" style="width:70rpx;height:70rpx;display: inline-block;  position: relative;top: 6rpx;" src="{{item.img_url}}"></image>
         <view a:else style="width: 70rpx;height: 70rpx;border-radius: 100%;background: #26A2FF;color: #fff;text-align: center;line-height: 70rpx;font-size: 24rpx;">{{item.name.substr(item.name.length-2)}}</view>
       </view>

+ 99 - 59
Component/selectSectionStaff/selectSectionStaff.js

@@ -14,28 +14,31 @@ Component({
     rule_tree: [],
     selectUserId: [],
     isAllChecked: false,
-    isItem: true,
-    searchVal: '',
     isAll: true,
-    userData:[],
+    userData: [],
+    isCreator: false,
+    creatorName: '',
+    keyVal:'',
   },
   props: {
     onClose: (data) => console.log(data),
     onConfirm: (data) => console.log(data),
     selectUser: [],
     isAllSelect: true,//是否多选
-    isLeadership:false,//是否限制人员选择
-    isBoss:false,//是否去除创始人
+    isLeadership: false,//数据源是否是自己的管理范围
+    isBoss: false,//是否去除创始人
+    isUser: false,//是否去除自己
   },
   didMount() {
     that = this;
+    this.setData({ isCreator: app.globalData.isCreator, creatorName: app.globalData.corpMessage.creators })
     app.login(app.globalData.corpId, function (is) {
-      if(is){
+      if (is) {
         that.setData({
-          selectUserId: that.props.selectUser,
+          selectUserId: that.props.selectUser[0] ? that.props.selectUser : [],
           isAll: that.props.isAllSelect,
           userData:app.globalData.userData.employee_detail.manage_scope,
-          terr:[{name: '全部', id:0}]
+          terr: [{ name: '全部', id: 0 }]
         })
       }
       that.getData(0);
@@ -44,10 +47,16 @@ Component({
   },
   didUpdate() { },
   didUnmount() {
-   },
+  },
   methods: {
+    onReset() {
+      this.setData({
+        isVal: false,
+        keyVal:''
+      })
+    },
     onConfirm() {
-      if(this.data.selectUserId.length==0){
+      if (this.data.selectUserId.length == 0) {
         app.globalData.showToast("请选择一名员工")
         return
       }
@@ -56,15 +65,10 @@ Component({
     },
     //搜索
     bindKeyInput(e) {
-      var userList = this.data.userList;
-      var items = userList.filter((item) => {
-        return item.name.indexOf(e.detail.value) >= 0
-      });
       this.setData({
-        searchVal: items,
-        isItem: e.detail.value ? false : true
+        keyVal:e.detail.value,
+        isVal: e.detail.value ? true : false
       })
-
     },
     changeSection(e) {
       var item = e.target.dataset.item;
@@ -164,35 +168,70 @@ Component({
         })
       }
     },
-    //选择
+    //选择
     radioChange: function (e) {
-      var item = e.target.dataset.item;
       var selectUserId = this.data.selectUserId;
       var isExist = false;
-      if (e.detail.value) {
-        if (!this.data.isAll) {//当设置单选择时
-          if (selectUserId.length > 0) {
-            app.globalData.showToast("只能选择一名人员");
-            return;
+      var userList = this.data.userList;
+      if (!this.data.isAll) {//单选择
+        let item = e.target.dataset.item;
+        let index = e.target.dataset.index;
+        let checked = `userList[${index}].checked`;//获取当前控制选中的字段
+        let elm = this.data.userList[index].checked;//当前的状态
+
+        //将所有的选中状态改成未中
+        var userList = this.data.userList;
+        userList.map((item, item_index) => {  
+          if (item.checked) {
+            var item_checked = `userList[${item_index}].checked`;
+            this.setData({
+              [item_checked]: false
+            })
           }
-        }
-        selectUserId.forEach((element, index, _this) => {
-          if (element.id == item.id) {
-            isExist = true;
+        })
+        if(!elm){
+          selectUserId.forEach((element, _this) => {
+            if (element.id == item.id) {
+              isExist = true;
+            }
+          });
+          if (!isExist) {
+            selectUserId=[];
+            selectUserId.push(item);
           }
-        });
-        if (!isExist) {
-          selectUserId.push(item);
+        }else{//取消选中
+            selectUserId=[];
         }
-      } else {
-        selectUserId.forEach((element, index, _this) => {
-          if (element.id == item.id) {
-            _this.splice(index, 1);
+        this.setData({
+            [checked]: !elm,
+        })
+      } else {//多选择
+        let item = e.target.dataset.item;
+        let index = e.target.dataset.index;
+        let checked = `userList[${index}].checked`;//获取当前控制选中的字段
+        let elm = this.data.userList[index].checked;//当前的状态
+        this.setData({
+           [checked]: !elm,
+        })
+        if (e.detail.value) {//当有值时选中
+          selectUserId.forEach((element, _this) => {
+            if (element.id == item.id) {
+              isExist = true;
+            }
+          });
+          if (!isExist) {
+            selectUserId.push(item);
           }
-        });
+        } else {//取消选中
+          selectUserId.forEach((element, index, _this) => {
+            if (element.id == item.id) {
+              _this.splice(index, 1);
+            }
+          });
+        }
       }
       this.setData({
-        selectUserId: selectUserId
+          selectUserId: selectUserId
       })
     },
     //关闭
@@ -202,23 +241,24 @@ Component({
     //获取人员列表
     getData(dept_id) {
       this.setData({
-          userList:[],
-          all_user_list:[]
+        userList: [],
+        all_user_list: []
       })
       app.$get("api/employee/list", { dept_id: dept_id }).then((res) => {
-        var list = res.data.data.list||[];
+        var list = res.data.data.list || [];
         var selectUserId = this.data.selectUserId;
-        var arr=[];
-        var userList=list;
-        if(this.props.isBoss){
-          userList=[];
-          list.forEach(item=>{
-            if(item.is_creator!=1){
-                userList.push(item)
-            }
-          })
-        }
-        userList.map((item) => {
+        var arr = [];
+        var userList = [];
+        list.forEach(item => {
+          if(this.props.isBoss&&item.is_creator == 1){
+              return null
+          }else if(this.props.isUser&&item.id == app.globalData.userData.id){
+              return null
+          }else{
+              userList.push(item)
+          }
+        });
+        userList.map((item) => { //设置列表的选中状态
           item.checked = false;
           if (selectUserId.length > 0) {
             selectUserId.forEach(item2 => {
@@ -228,16 +268,16 @@ Component({
             })
           }
         })
-        that.data.userData.map((item)=>{
-              userList.map((item2)=>{
-                  if(item.id==item2.id){
-                      arr.push(item2);
-                  }
-            })
+        that.data.userData.map((item) => {//列表数据是否是自己的管理范围
+          userList.map((item2) => {
+            if (item.id == item2.id) {
+              arr.push(item2);
+            }
+          })
         })
         this.setData({
-          userList:that.props.isLeadership? arr:userList,
-          all_user_list:that.props.isLeadership? arr:userList,
+          userList: that.props.isLeadership ? arr : userList,
+          all_user_list: that.props.isLeadership ? arr : userList,
         })
       })
     },

+ 6 - 12
Component/selectSectionStaff_tow/selectSectionStaff_tow.axml

@@ -1,9 +1,12 @@
 <view class="all">
   <image mode="scaleToFill" catchTap="onClose" class="close" src="../../../image/close.png"/>
+    <form onReset="onReset">
   <view class="search flex-box flex-v-ce">
     <image mode="scaleToFill" src="../../../image/ss.png"/>
-    <input placeholder="请输入姓名搜索" onInput="bindKeyInput"/>
+    <input placeholder="请输入姓名搜索" onInput="bindKeyInput" class="flex-1"/>
+    <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
   </view>
+   </form>
   <view class="content">
     <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}}">
@@ -11,7 +14,6 @@
       </view>
     </view>
     <scroll-view class="staff-ul" scroll-y="{{true}}" style="{{terr.length>1? 'height: calc(100vh - 390rpx);':'height: calc(100vh - 320rpx);'}}">
-      <block a:if="{{isItem}}">
         <view class="ul2">
           <view class="flex-box flex-v-ce li" a:for="{{rule_tree}}">
             <view class="flex-box flex-v-ce flex-1" data-item="{{item}}" catchTap="changeSection">
@@ -20,7 +22,7 @@
             <view class="xia" a:if="{{item._child.length>0}}" data-item="{{item}}" catchTap="openDown">| 下级</view>
           </view>
         </view>
-        <view class="flex-box flex-v-ce userItem" a:for="{{userList}}" a:key="{{index}}">
+        <view a:if="{{item.name.indexOf(keyVal)>= 0}}" class="flex-box flex-v-ce userItem" a:for="{{userList}}" a:key="{{index}}">
           <view class="{{item.checked? 'active':''}} flex-box flex-v-ce flex-1" catchTap="bindtap1" data-index="{{index}}" data-item="{{item}}">
             <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="70rpx" width="70rpx"></img-box>
             <text style="margin-left:20rpx;" class="flex-1">{{item.name}}</text>
@@ -32,14 +34,7 @@
               <view>您暂无相关审批人</view>
           </view>
         </view>
-      </block>
-      <view class="flex-box flex-v-ce userItem" a:for="{{searchVal}}" a:else a:key="{{index}}">
-          <view class="{{item.checked? 'active':''}} flex-box flex-v-ce flex-1" catchTap="bindtap2" data-index="{{index}}" data-item="{{item}}">
-            <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="70rpx" width="70rpx"></img-box>
-            <text style="margin-left:20rpx;" class="flex-1">{{item.name}}</text>
-            <view class="radio_"><text a:if="{{item.checked}}"></text></view>
-          </view>
-      </view>
+
     </scroll-view>
   </view>
   <view class="StaffFooter flex-box flex-v-ce">
@@ -47,7 +42,6 @@
       <view a:for="{{selectUserId}}" style="margin-right:10rpx;" a:key="{{index}}" a:if="{{item.id}}">
         <image mode="scaleToFill" class="img_box" src="{{item.img_url}}" a:if="{{item.img_url}}"/>
         <view a:else class="img_name_box">{{item.name.substr(item.name.length-2)}}</view>
-        <!-- <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="70rpx" width="70rpx"></img-box> -->
       </view>
     </view>
     <view class="staffBtn" onTap="onConfirm">确定</view>

+ 46 - 94
Component/selectSectionStaff_tow/selectSectionStaff_tow.js

@@ -14,61 +14,45 @@ Component({
     rule_tree: [],
     selectUserId: [],
     isAllChecked: false,
-    isItem: true,
-    searchVal: [],
-    userData:[]
+    userData: [],//初次显示的数据源
+    keyVal:''
   },
   props: {
     onClose: (data) => console.log(data),
     onConfirm: (data) => console.log(data),
     selectUser: [],
     isAllSelect: true,//是否多选
-    isLeadership:false,//是否选择领导
-    superior_list:[],//上级交叉领导集合
+    isLeadership: false,//是否选择领导
+    superior_list: [],//上级交叉领导集合
   },
   didMount() {
     that = this;
-    // if(this.props.selectUser.length>0){//当有默认的审批人
-    //     var arr=app.globalData.userData.employee_detail.superior_list;
-    //     arr.forEach(item=>{
-    //       if(item.id==this.props.selectUser[0].id){
-    //         this.setData({selectUserId:[item]})
-    //       }
-    //     })
-    // }
-    console.log(this.props.selectUser);
-    this.setData({selectUserId:this.props.selectUser[0]? this.props.selectUser:[]})
-    var superior_list=[];//将传进来的上级集合,转成集合里变成对象(原先是数组)
-    this.props.superior_list.forEach(item=>{
-        superior_list.push({id:item});
-    })
-    var userData=app.globalData.userData.employee_detail;
+    this.setData({ selectUserId: this.props.selectUser[0] ? this.props.selectUser : [] })
+    var superior_list = this.props.superior_list;//将传进来的上级集合,转成集合里变成对象(原先是数组)【】
+    var userData = app.globalData.userData.employee_detail;
     this.setData({
-        userData:this.props.isLeadership ? userData.manage_scope:superior_list.length>0? superior_list:userData.superior_list ,
-        terr:[{name: '全部', id:0}]
+      userData: this.props.isLeadership ? userData.manage_scope : superior_list.length > 0 ? superior_list : userData.superior_list,
+      terr: [{ name: '全部', id: 0 }]
     })
-
     this.getBmData();
     this.getData(0);
   },
-  didUpdate() {
-  },
-  didUnmount() {
-  },
   methods: {
+    onReset() {
+      this.setData({
+        isVal: false,
+        keyVal:''
+      })
+    },
     onConfirm() {
       this.props.onConfirm(this.data.selectUserId);
       this.onClose();
     },
     //搜索
     bindKeyInput(e) {
-      var userList = this.data.userList;
-      var items = userList.filter((item) => {
-        return item.name.indexOf(e.detail.value) >= 0
-      });
       this.setData({
-        searchVal: items,
-        isItem: e.detail.value ? false : true
+        keyVal:e.detail.value,
+        isVal: e.detail.value ? true : false
       })
 
     },
@@ -98,7 +82,7 @@ Component({
       var terr = this.data.terr;
       if ((index + 1) == terr.length) { return false };
 
-      this.setData({ rule_tree: [],userList:[],all_user_list:[] });
+      this.setData({ rule_tree: [], userList: [], all_user_list: [] });
       if (index == 0) {
         this.setData({
           terr: [{ name: '全部', id: 0 }],
@@ -137,79 +121,47 @@ Component({
       });
       return obj;
     },
-        //单选择
-    bindtap1(e){
-      this.setData({selectUserId: []});
+    //单选择
+    bindtap1(e) {
+      this.setData({ selectUserId: [] });
       var index = e.target.dataset.index;
       var checked = `userList[${index}].checked`;
-      var elm=this.data.userList[index].checked;
+      var elm = this.data.userList[index].checked;
       var userList = this.data.userList;
-      userList.map((item,item_index) => {
-          if(item.checked){
-              var item_checked = `userList[${item_index}].checked`;
-              this.setData({
-                [item_checked]:false
-              })
-          }
+      userList.map((item, item_index) => {
+        if (item.checked) {
+          var item_checked = `userList[${item_index}].checked`;
+          this.setData({
+            [item_checked]: false
+          })
+        }
       })
-      var arr=[];
+      var arr = [];
       arr.push(e.target.dataset.item);
-      if(!elm){
-        this.setData({
-          [checked]:!elm,
-          selectUserId:arr
-        })
-      }else{
-        this.setData({
-          [checked]:!elm,
-          selectUserId: []
-        })
-      }
-    },
-    bindtap2(e){
-      var index = e.target.dataset.index;
-      var checked = `searchVal[${index}].checked`;
-      var elm=this.data.searchVal[index].checked;
-      var searchVal = this.data.searchVal;
-      searchVal.map((item,item_index) => {
-          if(item.checked){
-              var item_checked = `searchVal[${item_index}].checked`;
-              this.setData({
-                [item_checked]:false
-              })
-          }
-      })
-      if(!elm){
+      if (!elm) {
         this.setData({
-          [checked]:!elm,
-          selectUserId: [e.target.dataset.item]
+          [checked]: !elm,
+          selectUserId: arr
         })
-      }else{
+      } else {
         this.setData({
-          [checked]:!elm,
+          [checked]: !elm,
           selectUserId: []
         })
       }
     },
-    //单选择
-    radioChange: function (e) {
-      // console.log(e.detail.value);
-      this.setData({
-       
-      })
-    },
     //关闭
     onClose(e) {
       this.props.onClose();
     },
     //获取人员列表
     getData(dept_id) {
-      this.setData({userList: [], all_user_list: []})
+      this.setData({ userList: [], all_user_list: [] })
       app.$get("api/employee/list", { dept_id: dept_id }).then((res) => {
         var list = res.data.data.list;
         var selectUserId = this.data.selectUserId;
-        var arr=[];
-        var ids=[];
+        var arr = [];
+        var ids = [];
         list.map((item) => {
           item.checked = false;
           if (selectUserId.length > 0) {
@@ -221,18 +173,18 @@ Component({
             })
           }
         })
-        that.data.userData.map((item)=>{
-              list.map((item2)=>{
-                  if(item.id==item2.id){
-                      arr.push(item2);
-                  }
-            })
+        that.data.userData.map((item) => {
+          list.map((item2) => {
+            if (item.id == item2.id) {
+              arr.push(item2);
+            }
+          })
         })
-        
+
         this.setData({
           userList: arr,
           all_user_list: arr,
-          selectUserId:ids.length>0? ids:this.data.selectUserId
+          selectUserId: ids.length > 0 ? ids : this.data.selectUserId
         })
       })
     },

+ 8 - 5
Component/selectStaff/selectStaff.axml

@@ -1,20 +1,23 @@
 <view class="all-date">
   <view class="data-tier" catchTap="onClose"></view>
   <view class="staff-header {{isShow?'showPop':''}}">
+  <form  onReset="onReset">
     <view class="search flex-box flex-v-ce">
       <image mode="scaleToFill" src="../../../image/ss.png"/>
-      <input placeholder="请输入姓名搜索" onInput="bindKeyInput"/>
+      <input placeholder="请输入姓名搜索" onInput="bindKeyInput" class="flex-1"/>
+      <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
     </view>
+    </form>
     <scroll-view class="staff-ul" scroll-y="{{true}}">
-      <checkbox-group class="radio-group" onChange="radioChange">
-        <view class="flex-box flex-v-ce userItem" a:for="{{userList}}">
+      <!-- <checkbox-group class="radio-group" onChange="radioChange"> -->
+        <view class="flex-box flex-v-ce userItem" a:for="{{userList}}" a:if="{{item.name.indexOf(keyVal)>= 0}}">
           <label class="flex-box flex-v-ce flex-1">
             <img-box name="{{item.name}}" imgUrl="{{item.img_url}}"  height="70rpx" width="70rpx"></img-box>
             <text style="margin-left:20rpx;" class="flex-1">{{item.name}}</text>
-            <checkbox value="{{item}}" checked="{{item.checked}}" name="{{item.id}}"/>
+            <checkbox  onChange="radioChange" data-index="{{index}}" data-item="{{item}}" checked="{{item.checked}}" name="{{item.id}}" value="{{item}}"/>
           </label>
         </view>
-      </checkbox-group>
+      <!-- </checkbox-group> -->
       <view a:if="{{userList.length==0}}" class="fontColorF" style="margin-top:200rpx;text-align: center;">
           <view>暂无相关人员</view>
       </view>

+ 37 - 17
Component/selectStaff/selectStaff.js

@@ -5,6 +5,7 @@ Component({
   data: {
     all_user_list: {},
     isShow: false,
+    keyVal:''
   },
   props: {
     onConfirm: (data) => console.log(data),
@@ -19,33 +20,52 @@ Component({
   didUpdate() { },
   didUnmount() { },
   methods: {
+    onReset(){
+          this.setData({
+            isVal: false,
+            keyVal:''
+          })
+    },
     //搜索
     bindKeyInput(e) {
-      if (e.detail.value) {
-        var all_user_list = this.data.all_user_list;
-        var items = all_user_list.filter((item) => {
-          return item.name.indexOf(e.detail.value) >= 0
-        });
-        this.setData({ userList: items });
-      } else {
-        this.setData({ userList: this.data.all_user_list });
-      }
+      this.setData({
+        keyVal:e.detail.value,
+        isVal: e.detail.value ? true : false
+      })
     },
     onConfirm() {
       this.props.onConfirm(this.data.selectUserId);
       this.props.onClose();
     },
     radioChange: function (e) {
-      if (e.detail.value) {
-        var arr = e.detail.value;
-        this.setData({
-          selectUserId: e.detail.value
-        })
-      } else {
+        var selectUserId = this.data.selectUserId;
+        var isExist = false;
+        let item = e.target.dataset.item;
+        let index = e.target.dataset.index;
+        let checked = `userList[${index}].checked`;//获取当前控制选中的字段
+        let elm = this.data.userList[index].checked;//当前的状态
         this.setData({
-          selectUserId:[]
+           [checked]: !elm,
         })
-      }
+        if (e.detail.value) {//当有值时选中
+          selectUserId.forEach((element, _this) => {
+            if (element.id == item.id) {
+              isExist = true;
+            }
+          });
+          if (!isExist) {
+            selectUserId.push(item);
+          }
+        } else {//取消选中
+          selectUserId.forEach((element, index, _this) => {
+            if (element.id == item.id) {
+              _this.splice(index, 1);
+            }
+          });
+        }
+      this.setData({
+          selectUserId: selectUserId
+      })
     },
     getData(keywords) {
       app.$get("api/employee/list", { dept_id: 0, keywords: keywords }).then((res) => {

+ 8 - 0
Component/selectType/selectType.axml

@@ -11,6 +11,7 @@
             {{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}}">
@@ -18,6 +19,13 @@
                <view class="xia" data-item="{{item}}" catchTap="openDown" a:if="{{item.child.length>0}}">| 下级</view>
             </view>
          </radio-group>
+         <view a:if="{{rule_tree.length==0}}" class="nodata fontColorF">
+            <view>
+              <image mode="scaleToFill" src="../../../image/noData.png" style="width: 340rpx;height: 340rpx;margin-bottom:20rpx;"/>
+            </view>
+            <text a:if="{{isCreator}}">暂无积分分类,请前往钉钉电脑端添加【积分分类】</text>
+            <text a:else>暂无积分分类,请联系主管理员“{{creatorName}}”或积分管理员前往钉钉电脑添加【积分分类】</text>
+         </view>
       </scroll-view>
    </view>
 </view>

+ 5 - 1
Component/selectType/selectType.js

@@ -8,6 +8,8 @@ Component({
     terr: [
       { name: '全部', id: 0 }
     ],
+    isCreator:false,
+    creatorName:'',
 
   },
   props: {
@@ -19,7 +21,9 @@ Component({
   didMount() {
     that = this;
     this.setData({
-      terr: [{ name: '全部', id: 0 }]
+      terr: [{ name: '全部', id: 0 }],
+      isCreator: app.globalData.isCreator,
+      creatorName:app.globalData.corpMessage.creators
     })
     this.getData();
   },

+ 13 - 0
app.acss

@@ -6,6 +6,9 @@
 		width: 100%;
 		margin: 0;
 		padding: 0;
+		-webkit-font-smoothing: antialiased;
+		-webkit-tap-highlight-color: transparent;
+		font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
 	}
 
 	view, text {
@@ -143,6 +146,16 @@
 		right: 0;
 		top: 80rpx;
 	}
+	.delVal{
+		height: 40rpx;
+		width: 40rpx;
+		border-radius: 100%;
+		background-color: #909399;
+		color: #fff;
+		text-align: center;
+		line-height: 40rpx;
+		margin: 0 10rpx;
+	}
 
 	/* 弹窗过程 */
 

+ 145 - 65
app.js

@@ -1,12 +1,12 @@
 import { showToast } from './utils/feedback'
-import { formatTime, arrRemoveObj,getTypeItem } from './utils/util'
+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;
-for(var i=2018;i<=year;i++){
+var yearArr = [];
+var year = formatTime(new Date()).year;
+for (var i = 2018; i <= year; i++) {
   yearArr.push(i);
 }
 App({
@@ -17,15 +17,18 @@ App({
     year: formatTime(new Date()).year,//当前年
     month: formatTime(new Date()).month,//当前月
     day: formatTime(new Date()).day,//当前日
-    types:[],
+    month_tow:formatTime(new Date()).month_tow,//当前月份
+    types: [],
     userData: '',
-    token:'',
+    token: '',
     // token:' eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvZGluZy5pbnN5cy5nMTA3LmNvbVwvYXBpXC9kaW5nXC9sb2dpbiIsImlhdCI6MTYwMDMxNDM0NywiZXhwIjoxNjAwOTE0MzQ3LCJuYmYiOjE2MDAzMTQzNDcsImp0aSI6IjgwMFJUS0J4RllIbnU5M3EiLCJzdWIiOjIsInBydiI6ImNhNjQ4OWQ1MGYyNDA3YTY3ODMwZTgwOTBkMDE0ODgzNTY4NTk2MmIiLCJyb2xlIjoiZW1wbG95ZWUifQ.E1RiQ6uMRICoL-2qDTeh5j5y-QLaUsGGs6PYLm-_1m8',
-    ALIOSS_URL:'https://integralsys.oss-cn-shenzhen.aliyuncs.com',
-    imgHttpUrl:'https://intesys.cms.g107.com/integral.php/Api/get_signature',
-    corpId:'',
-    yearArr:yearArr,
-    isAdministrator:false,//是否管理员
+    ALIOSS_URL: 'https://integralsys.oss-cn-shenzhen.aliyuncs.com',
+    imgHttpUrl: 'https://intesys.cms.g107.com/integral.php/Api/get_signature',
+    corpId: '',
+    yearArr: yearArr,
+    isAdministrator: false,//是否管理员
+    isCreator: false,//是否是创始人
+    corpMessage: '',//企业套餐信息
   },
   //获取积分类型
   getTypes(callBack) {
@@ -34,7 +37,54 @@ App({
       callBack();
     })
   },
- routerGet(url,data={},Accept){
+  //获取套餐信息
+  getCorp(corpId) {
+    this.$get("api/order/corp", { corp_id: corpId }).then((res) => {
+      this.globalData.corpMessage = res.data.data;
+    })
+  },
+  routerGet2(url, data = {}, Accept) {
+    return new Promise(function (resolve, reject) {
+      dd.httpRequest({
+        url: baseUrl + url,
+        method: 'GET',
+        headers: {
+          'Content-Type': 'application/x-www-form-urlencoded',
+          'A-Token': that.globalData.token,
+          'Accept': Accept ? Accept : ''
+        },
+        data: data,
+        dataType: 'json',
+        success: function (res) {
+          if (res.data.code == 1) {
+            if (res.data.refresh_token && res.data.refresh_token != that.globalData.token) {
+              that.globalData.token = res.data.refresh_token
+            }
+            resolve(res);
+          } else if (res.data.code == 401) {
+            that.globalData.showToast("登录已过期");
+            // reject(res);
+          } else {
+            that.globalData.showToast(res.data.msg)
+            // reject(res);
+          }
+        },
+        fail: function (res) {
+          if (res.errorMessage == 'NETWORK ERROR') {
+            dd.alert({
+              title: '网络异常',
+              content: '网络异常,请检查网络是否畅通,再重新进入应用',
+              buttonText: '我知道了',
+              success: () => { },
+            });
+            return;
+          }
+          reject(res);
+        }
+      });
+    })
+  },
+  routerGet(url, data = {}, Accept) {
     return new Promise(function (resolve, reject) {
       dd.showLoading();
       dd.httpRequest({
@@ -43,7 +93,7 @@ App({
         headers: {
           'Content-Type': 'application/x-www-form-urlencoded',
           'A-Token': that.globalData.token,
-          'Accept': Accept ? Accept:''
+          'Accept': Accept ? Accept : ''
         },
         data: data,
         dataType: 'json',
@@ -62,31 +112,32 @@ App({
           }
         },
         fail: function (res) {
-          if(res.errorMessage=='NETWORK ERROR'){
-           dd.alert({
+          if (res.errorMessage == 'NETWORK ERROR') {
+            dd.alert({
               title: '网络异常',
               content: '网络异常,请检查网络是否畅通,再重新进入应用',
               buttonText: '我知道了',
-              success: () => {},
+              success: () => { },
             });
             return;
           }
           reject(res);
         },
-        complete:function(){
-            dd.hideLoading();
+        complete: function () {
+          dd.hideLoading();
         }
       });
     })
   },
- routerPost(url,data={}){
+  routerPost(url, data = {}, Accept) {
     return new Promise(function (resolve, reject) {
       dd.httpRequest({
         url: baseUrl + url,
         method: 'POST',
         headers: {
           'Content-Type': 'application/x-www-form-urlencoded',
-          'A-Token': that.globalData.token
+          'A-Token': that.globalData.token,
+          'Accept': Accept ? Accept : ''
         },
         data: data,
         dataType: 'json',
@@ -98,19 +149,19 @@ App({
             resolve(res);
           } else if (res.data.code == 401) {
             that.globalData.showToast("登录已过期");
-             reject(res);
+            reject(res);
           } else {
             that.globalData.showToast(res.data.msg);
-             reject(res);
+            reject(res);
           }
         },
         fail: function (res) {
-         if(res.errorMessage=='NETWORK ERROR'){
-           dd.alert({
+          if (res.errorMessage == 'NETWORK ERROR') {
+            dd.alert({
               title: '网络异常',
               content: '网络异常,请检查网络是否畅通,再重新进入应用',
               buttonText: '我知道了',
-              success: () => {},
+              success: () => { },
             });
             return;
           }
@@ -120,74 +171,103 @@ App({
     })
   },
   //封装post
- $post(url, data={}) {
-    if(url=='api/ding/login'){
-      return  that.routerPost(url,data);
+  $post(url, data = {}, Accept) {
+    if (url == 'api/ding/login') {
+      return that.routerPost(url, data, Accept);
     }
-    if(!that.globalData.token){
-        dd.navigateTo({
-             url:'../../init/init'
-        })
-        return Promise.reject("登录中")
-    }else{
-       return that.routerPost(url,data);
+    if (!that.globalData.token) {
+      dd.navigateTo({
+        url: '../../init/init'
+      })
+      return Promise.reject("登录中")
+    } else {
+      return that.routerPost(url, data, Accept);
     }
   },
   //封装get
-  $get(url,data={},Accept) {
-    if(url=='api/integral/types'){
-      return that.routerGet(url,data,Accept);
+  $get(url, data = {}, Accept) {
+    if (url == 'api/integral/types' || url == 'api/order/corp') {
+      return that.routerGet(url, data, Accept);
     }
-    if(!that.globalData.token){
-        dd.navigateTo({
-             url:'../../init/init'
-        })
-         return Promise.reject("登录中")
-    }else{
-      return that.routerGet(url,data,Accept);
+    if (!that.globalData.token) {
+      dd.navigateTo({
+        url: '../../init/init'
+      })
+      return Promise.reject("登录中")
+    } else {
+      return that.routerGet(url, data, Accept);
+    }
+  },
+  //封装get
+  $get2(url, data = {}, Accept) {
+    if (url == 'api/integral/types' || url == 'api/order/corp') {
+      return that.routerGet2(url, data, Accept);
+    }
+    if (!that.globalData.token) {
+      dd.navigateTo({
+        url: '../../init/init'
+      })
+      return Promise.reject("登录中")
+    } else {
+      return that.routerGet2(url, data, Accept);
     }
   },
   //免登
   login(corpId, callBack) {
-      dd.getAuthCode({
+    dd.getAuthCode({
       success: function (res) {
-       that.$post('api/ding/login', { authCode: res.authCode, corpId: corpId }).then(res => {
+        // console.log(res.authCode,corpId)
+        // return;
+        that.$post('api/ding/login', { authCode: res.authCode, corpId: corpId }).then(res => {
           if (res.data.code == 1) {
             var { token, user } = res.data.data;
-            if(user.is_official==1){
+            var isStart = false;
+            if (user.is_official == 1) {
               user.employee_detail.role_list.forEach(item => {
-                  if (item.name == 'admin' || item.name == 'creator' || item.name == 'point_manager') {
-                     that.globalData.isAdministrator = true;
-                  }
+                if (item.name == 'creator') {
+                  that.globalData.isCreator = true;
+                  isStart = true;
+                }
+                if (item.name == 'admin' || item.name == 'creator' || item.name == 'point_manager'||item.name=='dept_manager') {
+                  that.globalData.isAdministrator = true;
+                }
               });
               that.globalData.token = token;
               that.globalData.userData = user;
-              callBack(true);
-            }else{
+              var getIsStart = dd.getStorageSync({ key: 'isStart' });//判断是否需要打开引导页
+              // console.log(JSON.stringify(user));
+              if (isStart && !getIsStart.data) {//判断是否需要打开引导
+                dd.reLaunch({
+                  url: '../../start/start'
+                })
+              } else {
+                callBack(true);
+              }
+            } else {
               callBack(false);
             }
-          }else if(res.data.code == 3000){
+          } else if (res.data.code == 3000) {
             that.globalData.showToast("员工信息同步中,请稍后进入")
-          }else{
-              that.globalData.showToast(res.msg)
+          } else {
+            that.globalData.showToast(res.msg)
           }
-        }).catch(err=>{
+        }).catch(err => {
           console.log(err);
         })
       },
-      fail:function(err){
-          console.log(err)
+      fail: function (err) {
+        console.log(err)
       }
     });
   },
 
-
-  getTypesItem(id){
-      return getTypeItem(this.globalData.types,id);
+  getTypesItem(id) {
+    return getTypeItem(this.globalData.types, id);
   },
   onLaunch(options) {
     that = this;
-    that.getTypes(function(){});
+    that.getTypes(function () { });
+    that.getCorp(options.query.corpId);
     that.globalData.corpId = options.query.corpId;
   },
 });

+ 3 - 1
app.json

@@ -24,6 +24,7 @@
     "pages/statistics/customRamking/customRamking",
     "pages/statistics/addCustom/addCustom",
     "pages/statistics/customDetail/customDetail",
+    "pages/statistics/userRamking/userRamking",
     "pages/deploy/organization/organization",
     "pages/deploy/addMoney/addMoney",
     "pages/deploy/setCheck/setCheck",
@@ -32,7 +33,8 @@
     "pages/statistics/C_ranking/C_ranking",
     "pages/workbench/noJurisdiction/noJurisdiction",
     "pages/init/init",
-    "pages/deploy/sku/sku"
+    "pages/deploy/sku/sku",
+    "pages/start/start"
   ],
   "window": {
     "defaultTitle": "功道云",

binární
image/dt.png


binární
image/money.jpg


binární
image/start1.png


binární
image/start2.png


binární
image/start3.png


+ 1 - 1
pages/deploy/addMoney/addMoney.axml

@@ -1,5 +1,5 @@
 <view>
-  <image mode="scaleToFill" src="../../../image/money.png" style="width:100%;height:1500rpx"/>
+  <image mode="scaleToFill" src="../../../image/money.jpg" style="width:100%;height:1360rpx"/>
   <view style="height:100rpx">
     
   </view>

+ 5 - 5
pages/deploy/addMoney/addMoney.js

@@ -9,21 +9,21 @@ Page({
     dd.setNavigationBar({ title: "续费升级" });
   },
   openUrl() {
-    app.$get("api/order/goods/sku", { callback: "page/deploy/sku/sku", goods_code: 'DT_GOODS_881607043109331' }).then((res) => {
+    // app.$get("api/order/goods/sku", { callback: "page/deploy/sku/sku", goods_code: 'DT_GOODS_881607043109331' }).then((res) => {
       openLink({
-        url: res.data.data.url
+        url: 'https://h5.dingtalk.com/open-market/share.html?shareGoodsCode=D34E5A30A9AC7FC6327AB5E6D2D145418457E59F16C3FC969F1A50AEF2E5E320588012470F1AB045&token=d37751d45abad15178adf60f936d7c28&shareUid=C5EB7B5C85793F3D909B2AC4771E12D7'
       })
       // this.setData({
       //   src: res.data.data.url
       // })
-    }, (err) => {
+    // }, (err) => {
 
-    })
+    // })
   },
   //跳转
   openView() {
     dd.navigateTo({
-      url: ''
+      url: '../sku/sku'
     })
   },
 });

+ 1 - 1
pages/deploy/index/index.acss

@@ -5,7 +5,7 @@
   margin-bottom: 94rpx;
 }
 .xusj{
-  opacity: 0
+  /* opacity: 0 */
 }
 .head{
   position: absolute;

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

@@ -15,8 +15,8 @@
         <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>当前为{{corpMessage.package_name}}</view>
+            <view class="date">有效期至 <text style="color:#FF9600">{{corpMessage.expire_time}}</text></view>
           </view>
           <view class="xusj" data-index="1" onTap="openView">续费升级</view>
         </view>

+ 3 - 2
pages/deploy/index/index.js

@@ -2,12 +2,13 @@ var app = getApp();
 var that;
 Page({
   data: {
-    userData:[]
+    userData:[],
+    corpMessage:{}
   },
   onLoad(query) {
     that = this;
     dd.setNavigationBar({ title: "我的" });
-    this.setData({userData:app.globalData.userData});
+    this.setData({userData:app.globalData.userData,corpMessage:app.globalData.corpMessage});
   },
   //跳转
   openView(e) {

+ 4 - 1
pages/deploy/integralRule/integralRule.axml

@@ -1,9 +1,12 @@
 <view>
   <view class="header margin-bottom">
+  <form onReset="onReset">  
     <view class="search flex-box flex-v-ce">
       <image mode="scaleToFill" src="../../../image/ss.png"/>
-      <input placeholder="请输入规则内容" onInput="bindKeyInput"/>
+      <input placeholder="请输入规则内容" onInput="bindKeyInput" class="flex-1"/>
+      <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
     </view>
+  </form>
     <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}}

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

@@ -24,6 +24,13 @@ Page({
     this.setData({ types: app.globalData.types })
     this.getData();
   },
+    onReset(){
+      this.setData({
+          selectItem: [],
+          isItem:true,
+          isVal:false
+      })
+    },  
   //搜索
   bindKeyInput(e) {
     var item_list = this.data.allItems;
@@ -32,7 +39,8 @@ Page({
     });
     this.setData({
       selectItem: items,
-      isItem: e.detail.value ? false : true
+      isItem: e.detail.value ? false : true,
+          isVal:e.detail.value? true:false      
     })
 
   },

+ 4 - 1
pages/deploy/organization/organization.axml

@@ -1,9 +1,12 @@
 <view>
   <view class="header margin-bottom">
+  <form onReset="onReset">
     <view class="search flex-box flex-v-ce">
       <image mode="scaleToFill" src="../../../image/ss.png"/>
-      <input class="flex-1" placeholder="请输入姓名搜索" onInput="bindKeyInput"/>
+      <input class="flex-1" placeholder="请输入姓名搜索" onInput="bindKeyInput" class="flex-1"/>
+      <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
     </view>
+  </form>
     <view class="flex-box flex-v-ce" style="margin-top:28rpx;">
       <image a:if="{{gsData.logo_ur}}" mode="scaleToFill" src="{{gsData.logo_url}}" class="logo"/>
       <image a:else mode="scaleToFill" src="../../../image/gs_logo.png" class="logo"/>

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

@@ -35,6 +35,13 @@ Page({
       },
     });
   },
+  onReset() {
+    this.setData({
+      searchUser: [],
+      isItem: true,
+      isVal: false
+    })
+  },
   bindKeyInput(e) {
     app.$get("api/employee/list", { dept_id: 0 }).then((res) => {
       var list = res.data.data.list;
@@ -43,7 +50,8 @@ Page({
       });
       this.setData({
         searchUser: items,
-        isItem: e.detail.value ? false : true
+        isItem: e.detail.value ? false : true,
+        isVal: e.detail.value ? true : false
       })
     })
   },

+ 1 - 1
pages/deploy/sku/sku.axml

@@ -1,3 +1,3 @@
 <view>
-  <web-view id="web-view-1" src="{{src}}" onMessage="test"></web-view>
+  <web-view id="web-view-1" src="https://h5.dingtalk.com/open-market/share.html?shareGoodsCode=D34E5A30A9AC7FC6327AB5E6D2D145418457E59F16C3FC969F1A50AEF2E5E320588012470F1AB045&token=d37751d45abad15178adf60f936d7c28&shareUid=C5EB7B5C85793F3D909B2AC4771E12D7" onMessage="test"></web-view>
 </view>

+ 6 - 6
pages/deploy/sku/sku.js

@@ -8,16 +8,16 @@ Page({
     src: '',
   },
   onLoad(e) {
-    app.$get("api/order/goods/sku", { callback: "page/deploy/sku/sku", goods_code: 'DD_GOODS-610003' }).then((res) => {
+    // app.$get("api/order/goods/sku", { callback: "page/deploy/sku/sku", goods_code: 'DD_GOODS-610003' }).then((res) => {
 
-      openLink({
-        url:res.data.data.url
-      })
+    //   openLink({
+    //     url:res.data.data.url
+    //   })
       // this.setData({
       //   src: res.data.data.url
       // })
-    }, (err) => {
+    // }, (err) => {
 
-    })
+    // })
   },
 });

+ 67 - 0
pages/start/start.acss

@@ -0,0 +1,67 @@
+.box{
+  background: #fff;
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.title{
+  font-size: 32rpx;
+  color: #222;
+  padding: 20rpx 0;
+  text-align: center
+}
+.content{
+  padding: 0 30rpx;
+}
+.c_top{
+  padding: 70rpx 0 60rpx 0;
+  font-size: 30rpx;
+}
+.c_top view:nth-child(1){
+    text-align: center;
+    font-size: 44rpx;
+    margin-bottom: 16rpx;
+}
+.c_top view:nth-child(2){
+    text-align: center;
+}
+.c_main image{
+  width: 30rpx;
+  height: 30rpx;
+  margin-right: 20rpx;
+  box-sizing: border-box
+}
+.c_text{
+  font-size: 28rpx;
+}
+.c_footer{
+  padding: 50rpx 0 60rpx 0;
+}
+.c_footer image{
+  width: 100%;
+  height: 350rpx;
+}
+
+.btn{
+  background-color: #26A2FF;
+  border-radius: 10rpx;
+  position: fixed;
+  z-index: 2;
+  bottom: 140rpx;
+  left: 30rpx;
+  right: 30rpx;
+}
+.openApp{
+  text-align: center;
+  position: fixed;
+  z-index: 2;
+  bottom: 70rpx;
+  left: 30rpx;
+  right: 30rpx;
+}
+.text_f{
+  font-size: 24rpx;
+  text-align: center;
+}

+ 63 - 0
pages/start/start.axml

@@ -0,0 +1,63 @@
+<view>
+  <view a:if="{{showIndex==1}}" class="box">
+    <view class="title">欢迎使用功道云积分制</view>
+    <view class="content fontColorZ">
+      <view class="c_top">
+        您是开通应用的
+        <text class="yellow">创始人</text>
+        ,可在
+        <text class="yellow">“设置-组织架构”</text>
+        授权员工【开启积分管理】
+      </view>
+      <view class="flex-box  c_main">
+        <image mode="scaleToFill" src="../../image/dt.png"></image>
+        <view class="c_text fontColorZ">
+          <view>授权后,员工才能正式进入应用</view>
+          <view class="fontColorF">设置路径:钉钉电脑版-工作-功道云积分制-设置-组织架构</view>
+        </view>
+      </view>
+      <view class="c_footer">
+        <image mode="scaleToFill" src="../../image/start3.png" data-str="../../image/start1.png"></image>
+      </view>
+      <button type="primary" class="btn" data-index="2" catchTap="openView">下一步</button>
+    </view>
+  </view>
+  <view a:if="{{showIndex==2}}" class="box">
+    <view class="title">欢迎使用功道云积分制</view>
+    <view class="content fontColorZ">
+      <view class="c_top">
+        您可在
+        <text class="yellow">“设置-角色权限”</text>
+        添加【积分管理员】来协助执行积分管理
+      </view>
+      <view class="flex-box  c_main">
+        <image mode="scaleToFill" src="../../image/dt.png"></image>
+        <view class="c_text fontColorZ">
+          <view>推荐行政人事或有执行力的管理层来当【积分管理员】</view>
+          <view class="fontColorF">设置路径:钉钉电脑版-工作-功道云积分制-设置-角色权限</view>
+        </view>
+      </view>
+      <view class="c_footer">
+        <image mode="scaleToFill" src="../../image/start2.png" data-str="../../image/start1.png"></image>
+      </view>
+      <button type="primary" class="btn" data-index="3" catchTap="openView">下一步</button>
+    </view>
+  </view>
+  <view a:if="{{showIndex==3}}" class="box">
+    <view class="title">欢迎使用功道云积分制</view>
+    <view class="content fontColorZ">
+      <view class="c_top">
+        <view>3步走,轻松搭建积分管理</view>
+        <view class="fontColorF">请前往电脑端体验完整管理流程</view>
+      </view>
+      <view class="c_footer">
+        <image mode="scaleToFill" src="../../image/start1.png" data-str="../../image/start1.png"></image>
+      </view>
+      <view class="fontColorT text_f">路径:钉钉电脑端(需下载安装)-工作-功道云积分制</view>
+
+      <button type="primary" class="btn" catchTap="openUrl">已熟悉电脑端,直达手机端功能</button>
+      <!-- <button type="primary" class="btn" catchTap="openView">前往PC端操作</button> -->
+      <!-- <view class="blue openApp" catchTap="openUrl">已熟悉电脑端,直达手机端功能 ></view> -->
+    </view>
+  </view>
+</view>

+ 23 - 0
pages/start/start.js

@@ -0,0 +1,23 @@
+var app = getApp();
+var that;
+Page({
+  data: {
+    showIndex:1,
+  },
+  onLoad() {
+
+  },
+  //跳转
+  openView(e) {
+    this.setData({
+      showIndex:e.target.dataset.index
+    })
+  },
+  // 跳转到首页
+  openUrl(){
+      dd.setStorageSync({ key: 'isStart', data: true});
+      dd.reLaunch({
+        url: '../workbench/index/index'
+      })
+  },
+});

+ 1 - 0
pages/start/start.json

@@ -0,0 +1 @@
+{}

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

@@ -12,16 +12,16 @@
   <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:if="{{index==0}}" class="index">
+        <view a:if="{{item.rank==1}}" class="index">
           <image mode="scaleToFill" src="../../../image/1.png"></image>
         </view>
-        <view a:elif="{{index==1}}" class="index">
+        <view a:elif="{{item.rank==2}}" class="index">
           <image mode="scaleToFill" src="../../../image/2.png"></image>
         </view>
-        <view a:elif="{{index==2}}" class="index">
+        <view a:elif="{{item.rank==3}}" class="index">
           <image mode="scaleToFill" src="../../../image/3.png"></image>
         </view>
-        <view a:else class="index">{{index+1}}</view>
+        <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>

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

@@ -1,7 +1,7 @@
 <view>
   <view class="flex-box flex-v-ce tab">
     <view class="flex-1" catchTap="selectDay">
-      <text class="{{showDate? 'activeView':''}} dateVal">{{month}}</text>
+      <text class="{{showDate? 'activeView':''}} dateVal">{{date}}</text>
     </view>
     <!-- <view class="flex-1" catchTap="selectRule">
       <text class="{{showRuleTwo? 'activeView blue':''}}">{{ruleVal}}</text>
@@ -15,19 +15,19 @@
   <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">
-        <view a:if="{{index==0}}" class="index">
+        <view a:if="{{item.rank==1}}" class="index">
           <image mode="scaleToFill" src="../../../image/1.png"></image>
         </view>
-        <view a:elif="{{index==1}}" class="index">
+        <view a:elif="{{item.rank==2}}" class="index">
           <image mode="scaleToFill" src="../../../image/2.png"></image>
         </view>
-        <view a:elif="{{index==2}}" class="index">
+        <view a:elif="{{item.rank==3}}" class="index">
           <image mode="scaleToFill" src="../../../image/3.png"></image>
         </view>
-        <view a:else class="index">{{index}}</view>
+        <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>
+          <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+          <view class="name">{{item.name}}</view>
         </view>
         <view class="blue" style="margin-right:28rpx;">{{item.point}}</view>
       </view>

+ 87 - 16
pages/statistics/C_ranking/C_ranking.js

@@ -4,34 +4,89 @@ var that;
 Page({
   data: {
     month: app.globalData.month,
-
     showRuleTwo: false,//显示规则组件
     ruleVal: "规则分类",
-
+    date:app.globalData.month,
     isPx: true,
     id: '',
-    page:1,
+    page: 1,
+    dateType: 1,
   },
   onLoad(e) {
     that = this;
+    if (e.date_interval == 3) {
+      this.setData({
+        dateType: e.date_interval,
+        month:app.globalData.year,
+        date:app.globalData.year,
+      })
+    } else if (e.date_interval == 2) { // 传进入如果是季度
+      this.setData({
+        month:app.globalData.year+String(this.getJ()+1),
+        dateType: e.date_interval
+      })
+    } else {
+      this.setData({
+        month:app.globalData.year+String(app.globalData.month_tow),
+        dateType: e.date_interval
+      })
+    }
     if (e.id) {
       this.setData({ id: e.id });
       dd.setNavigationBar({ title: e.name });
       this.getData();
     }
   },
+  // 获取当前是第几季
+  getJ() {
+    var getYearWeek = function (a, b, c) {
+      var date1 = new Date(a, parseInt(b) - 1, c), date2 = new Date(a, 0, 1),
+        d = Math.round((date1.valueOf() - date2.valueOf()) / 86400000)
+      return Math.ceil((d + ((date2.getDay() + 1) - 1)) / 7)
+    }
+    var today = new Date()// 获取当前时间
+    var y = today.getFullYear()
+    var m = today.getMonth() + 1
+    var d = today.getDate()
+    var week, quarter = ''
+    var result = getYearWeek(y, m, d)
+    if (m < 4) {
+      quarter = 1
+      week = result
+    } else if (m < 7) {
+      quarter = 2
+      week = result - getYearWeek(y, 4, 1)
+      var day = new Date(y, 4, 1)
+      if (day.getDay() > 1) {
+        week += 1
+      }
+    } else if (m < 10) {
+      quarter = 3
+      week = result - getYearWeek(y, 7, 1)
+      var day = new Date(y, 7, 1)
+      if (day.getDay() > 1) {
+        week += 1
+      }
+    } else {
+      quarter = 4
+      week = result - getYearWeek(y, 10, 1)
+      var day = new Date(y, 10, 1)
+      if (day.getDay() > 1) {
+        week += 1
+      }
+    }
+    return quarter - 1
+  },
   getData(is) {
     var data = {
-      month: that.data.month,
+      date: that.data.month,
       page: that.data.page,
       page_size: 10,
-      pt_id: app.getTypesItem('BF').id,
-      sort: that.data.isPx ? 'DESC' : 'ASC',
+      sort: that.data.isPx ? 'asc' : 'desc',
       // type: 'normal',
       group_id: that.data.id,
-      rule_id: that.data.rule_id
     }
-    app.$get('api/integral/statistics/ranking', data, 'application/vnd.test.v2+json').then((res) => {
+    app.$get('api/integral/statistics/groups/rank',data).then((res) => {
       var data = res.data.data.list;
       if (is) {
         if (data.length == 0) {
@@ -54,24 +109,40 @@ Page({
     this.getData(true);
   },
   selectDay() {
-    this.setData({ showDate:true })
+    var str="yyyy-MM";
+    if(this.data.dateType==3){
+        str="yyyy"
+    }
+    this.setData({ showDate: true })
     dd.datePicker({
-      format: 'yyyy-MM',
-      currentDate: this.data.month,
+      format: str,
+      currentDate: this.data.date,
       success: (res) => {
+
+        if(res.date&&that.data.dateType!=3){
+        var str=res.date.substr(0,4)
+        var str2=res.date.substr(res.date.length-2,2)
         this.setData({
-          month: res.date,
+          month: String(str)+String(str2),
+          date:res.date
         })
         this.getData();
+        }else{
+            this.setData({
+              month: res.date,
+              date:res.date
+            })
+            this.getData();
+        }
       },
-      complete:(res)=>{
+      complete: (res) => {
         that.setData({
-           showDate: false
+          showDate: false
         })
       }
     });
   },
-    //显示规则组件
+  //显示规则组件
   selectRule() {
     this.setData({
       showRuleTwo: true
@@ -99,7 +170,7 @@ Page({
   },
   //选择规则
   onConfirmRule(data) {
-    this.setData({ rule_id: data.id, page: 1,ruleVal:data.name })
+    this.setData({ rule_id: data.id, page: 1, ruleVal: data.name })
     this.getData();
   },
 });

+ 11 - 10
pages/statistics/customRamking/customRamking.axml

@@ -1,24 +1,25 @@
 <view>
   <view class="all">
-    <block a:if="{{dataList.length>0}}">
-      <view class="gs margin-bottom flex-box flex-v-ce" a:if="{{isShowGs}}">
+   <block>
+    <!-- <block a:if="{{dataList.length>0}}"> -->
+      <!-- <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> 
+      </view>  -->
       <!-- <block> -->
-      <view class="add flex-box flex-v-ce margin-bottom" onTap="openAdd">
+      <!-- <view class="add flex-box flex-v-ce margin-bottom" onTap="openAdd">
         <view class="flex-1 blue">+新增分组</view>
-      </view>
+      </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}}">
+            <!-- <view onTap="openCompile" class="openCompile" data-item="{{item}}">
               <image mode="scaleToFill" src="../../../image/Bj.png" style="width:40rpx;height:40rpx"></image>
-            </view>
+            </view> -->
           </view>
           <view class="flex-box flex-v-ce ranking" onTap="openDetail" data-item="{{item}}">
             <view class="flex-1">查看排名</view>
@@ -27,12 +28,12 @@
         </view>
       </view>
     </block>
-    <view a:else class="noDataBox">
+    <!-- <view a:else class="noDataBox">
       <view class="noDataTop fontColorF">
         <view>暂无分组</view>
         <view>通过分组你可针对性的查看对应人员的B分排名</view>
       </view>
       <button type="default" onTap="openAdd" class="addBtn">新建分组</button>
-    </view>
+    </view> -->
   </view>
 </view>

+ 12 - 11
pages/statistics/my_PrizeBuckle/my_PrizeBuckle.axml

@@ -1,9 +1,12 @@
 <view>
   <view class="header margin-bottom">
-    <view class="search flex-box flex-v-ce">
-      <image mode="scaleToFill" src="../../../image/ss.png"></image>
-      <input placeholder="请输入姓名或事件内容搜索" onInput="bindKeyInput" class="flex-1"></input>
-    </view>
+    <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>
+        <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
+      </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>
@@ -12,13 +15,13 @@
   </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}}">
+      <view class="flex-box li border-bottom" data-index="1" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}">
         <img-box name="{{item.employee_name}}" 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" a:if="{{item.point>0}}">+{{item.point}}</view>
-            <view class="green" a:else>{{item.point}}</view>
+            <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>
           </view>
           <view class="context" a:if="{{item.remark}}">{{item.remark}}</view>
           <view class="flex-box flex-v-ce">
@@ -36,8 +39,7 @@
         <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" a:if="{{item.point>0}}">+{{item.point}}</view><view class="green" a:else>{{item.point}}</view> -->
           </view>
           <view class="context" a:if="{{item.remark}}">{{item.remark.customize}}</view>
           <view class="flex-box flex-v-ce">
@@ -54,8 +56,7 @@
         <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" a:if="{{item.point>0}}">+{{item.point}}</view><view class="green" a:else>{{item.point}}</view> -->
           </view>
           <view class="context" a:if="{{item.remark}}">{{item.remark.customize}}</view>
           <view class="flex-box flex-v-ce">

+ 32 - 15
pages/statistics/my_PrizeBuckle/my_PrizeBuckle.js

@@ -8,23 +8,32 @@ Page({
     page: 1,
   },
   onLoad(e) {
-    if(e.index){
+    if (e.index) {
       this.setData({
-          activeIndex:e.index,
+        activeIndex: e.index,
       })
     }
     that = this;
     dd.setNavigationBar({ title: "我奖扣的" });
   },
-  onShow(){
-     if(this.data.page==1){
+  onShow() {
+    if (this.data.page == 1) {
       dd.hideLoading();
       that.getData(that.data.activeIndex);
-     }
+    }
+  },
+  onReset() {
+    this.setData({
+      keyword: '',
+      isVal: false,
+      page: 1,
+    })
+    this.getData(that.data.activeIndex);
   },
   bindKeyInput(e) {
     this.setData({
       keyword: e.detail.value,
+      isVal:e.detail.value? true:false,
       page: 1,
     })
     this.getData(that.data.activeIndex);
@@ -35,7 +44,7 @@ Page({
     if (index == 1) {
       data = {
         page: that.data.page,
-        page_size:20,
+        page_size: 20,
         recorder_id: app.globalData.userData.id,
         source_type: 1,
         keyword: that.data.keyword
@@ -43,7 +52,7 @@ Page({
     } else if (index == 2) {
       data = {
         page: that.data.page,
-        page_size:20,
+        page_size: 20,
         type: 'waiting',
         pt_id: 0,
         keyword: that.data.keyword
@@ -51,7 +60,7 @@ Page({
     } else {
       data = {
         page: that.data.page,
-        page_size:20,
+        page_size: 20,
         type: 'refuse',
         pt_id: 0,
         keyword: that.data.keyword
@@ -60,13 +69,21 @@ Page({
     app.$get(urlS[index - 1], data).then((res) => {
       var data = res.data.data.list;
       var list = that.data.list;
+      
+      data.forEach(element => {
+        if(element.pt_id){
+          element.pt_name=app.getTypesItem(element.pt_id).name
+        }
+      });
+
+
       if (is) {
         if (data.length < 20) {
           this.setData({
             list: list.concat(data),
             isData: true
           })
-        }else{
+        } else {
           this.setData({
             list: list.concat(data)
           })
@@ -81,25 +98,25 @@ Page({
   },
   activeItem(e) {
     var index = e.target.dataset.index;
-    this.setData({ activeIndex: index, page: 1,list:[] })
+    this.setData({ activeIndex: index, page: 1, list: [] })
     this.getData(index);
   },
   openDetail(e) {
     var id = e.target.dataset.item.id;
-    var index=e.target.dataset.index;
-    if (index=='1') {
+    var index = e.target.dataset.index;
+    if (index == '1') {
       dd.navigateTo({
-        url: '../prizeBuckleDetail/prizeBuckleDetail?id='+id
+        url: '../prizeBuckleDetail/prizeBuckleDetail?id=' + id
       })
     } else {
       dd.navigateTo({
-        url: '../../workbench/approveDetail/approveDetail?id='+id+'&is='+true
+        url: '../../workbench/approveDetail/approveDetail?id=' + id + '&is=' + true
       })
     }
   },
   //上啦加载
   onScrollToLower() {
-    if(!that.data.isData){
+    if (!that.data.isData) {
       this.setData({ page: ++that.data.page })
       this.getData(that.data.activeIndex, true);
     }

+ 3 - 0
pages/statistics/my_apply/my_apply.axml

@@ -1,9 +1,12 @@
 <view>
   <view class="header margin-bottom">
+  <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>
+      <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
     </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>

+ 9 - 0
pages/statistics/my_apply/my_apply.js

@@ -20,10 +20,19 @@ Page({
         that.getData();
     }
   },
+  onReset() {
+    this.setData({
+      keyword: '',
+      isVal: false,
+      page: 1,
+    })
+    this.getData();
+  },
   bindKeyInput(e) {
     this.setData({
       keyword: e.detail.value,
       page: 1,
+       isVal:e.detail.value? true:false
     })
     this.getData();
   },

+ 1 - 1
pages/statistics/prizeBuckleDetail/prizeBuckleDetail.acss

@@ -15,7 +15,7 @@
 }
 .header-main .laber{
   color: #909399;
-  width: 140rpx;
+  width: 150rpx;
 }
 .header-main .flex-box{
  padding: 5rpx 0;

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

@@ -17,16 +17,16 @@
   <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">
-        <view a:if="{{index==0}}" class="index">
+        <view a:if="{{item.rank==1}}" class="index">
           <image mode="scaleToFill" src="../../../image/1.png"></image>
         </view>
-        <view a:elif="{{index==1}}" class="index">
+        <view a:elif="{{item.rank==2}}" class="index">
           <image mode="scaleToFill" src="../../../image/2.png"></image>
         </view>
-        <view a:elif="{{index==2}}" class="index">
+        <view a:elif="{{item.rank==3}}" class="index">
           <image mode="scaleToFill" src="../../../image/3.png"></image>
         </view>
-        <view a:else class="index">{{index+1}}</view>
+        <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>
@@ -40,5 +40,5 @@
   <select-section defaultSection="{{dept_id}}" a:if="{{showTissue==true}}" isShow="{{showTissue}}" onClose="onClose" onConfirm="onConfirmTissue"></select-section>
   <select-sx defaultSx="{{sxObj}}" a:if="{{showSx==true}}" isShow="{{showSx}}" onClose="onClose" onConfirm="onConfirmSx"></select-sx>
   <select-date dateObj="{{dateObj}}" a:if="{{showDate==true}}" isShow="{{showDate}}" onClose="onClose" onConfirm="onConfirmDate"></select-date>
-  <!-- <select-rule-two a:if="{{showRuleTwo==true}}" isShow="{{showRuleTwo}}" onClose="onClose" onConfirm="onConfirmRule"></select-rule-two> -->
+  <select-rule-two defaultSection="{{rule_id}}" a:if="{{showRuleTwo==true}}" isShow="{{showRuleTwo}}" onClose="onClose" onConfirm="onConfirmRule"></select-rule-two>
 </view>

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

@@ -31,7 +31,7 @@ Page({
   },
   onLoad() {
     that = this;
-    dd.setNavigationBar({ title: "部门排名" });
+    dd.setNavigationBar({ title: "部门B分排名" });
     this.getData();
   },
   getData(is) {  
@@ -50,7 +50,6 @@ Page({
       data.quarter=that.data.quarter
     }else{
       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) => {
@@ -151,7 +150,11 @@ Page({
   },
   //选择规则
   onConfirmRule(data) {
-    this.setData({rule_id:data.join(','),page:1})
+    this.setData({
+      rule_id: data.id ? data.id : '',
+      page: 1,
+      ruleVal: data.name
+    })
     this.getData();
   },
   //显示部门选择组件

+ 79 - 0
pages/statistics/userRamking/userRamking.acss

@@ -0,0 +1,79 @@
+.all {
+  padding: 28rpx;
+}
+
+.all image {
+  width: 24rpx;
+  height: 24rpx;
+}
+
+.add {
+  background: #fff;
+  padding: 28rpx;
+  border-radius: 6rpx;
+}
+
+.dataList {
+  background: #fff;
+  border-radius: 6rpx;
+}
+
+.message, .ranking {
+  padding: 28rpx;
+}
+
+.message .title {
+  font-size: 36rpx;
+}
+
+.message {
+  padding-right: 0;
+}
+
+.ranking view:nth-child(1) {
+  font-size: 32rpx;
+}
+
+.message .num {
+  margin-top: 10rpx;
+  font-size: 30rpx
+}
+
+.message .openCompile {
+  box-sizing: border-box;
+  padding: 20rpx 28rpx;
+}
+
+.noDataBox {
+  margin-top: 30%;
+  text-align: center;
+}
+
+.noDataTop view:nth-child(1) {
+  font-size: 32rpx;
+  font-weight: 600;
+  margin-bottom: 10rpx;
+}
+
+.noDataTop view:nth-child(2) {
+  margin-bottom: 80rpx;
+}
+
+.addBtn {
+  background: #26A2FF;
+  color: #fff;
+  margin: 0 auto;
+  border-radius: 10rpx;
+  height: 90rpx;
+  line-height: 90rpx;
+}
+.gs{
+  background-color: #FFFBE8;
+  padding: 20rpx;
+  color: #e6a23c;
+}
+.close{
+  padding: 0 10rpx;
+  font-size: 40rpx;
+  font-weight: 600
+}

+ 39 - 0
pages/statistics/userRamking/userRamking.axml

@@ -0,0 +1,39 @@
+<view>
+  <view class="all">
+   <block>
+    <!-- <block a:if="{{dataList.length>0}}"> -->
+      <!-- <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>
+      </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.group_name}}</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" 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>
+          </view>
+        </view>
+      </view>
+    </block>
+    <!-- <view a:else class="noDataBox">
+      <view class="noDataTop fontColorF">
+        <view>暂无分组</view>
+        <view>通过分组你可针对性的查看对应人员的B分排名</view>
+      </view>
+      <button type="default" onTap="openAdd" class="addBtn">新建分组</button>
+    </view> -->
+  </view>
+</view>

+ 74 - 0
pages/statistics/userRamking/userRamking.js

@@ -0,0 +1,74 @@
+
+var app = getApp()
+var that;
+Page({
+  data: {
+    // dataList:[],
+    isShowGs:true,
+    disabled:false,
+  },
+  onLoad() {
+    that = this;
+    // dd.getStorage({
+    //   key: 'isShowGs',
+    //   success: function(res) {
+    //     if(res.data){
+    //       that.setData({
+    //         isShowGs: false
+    //       })
+    //     }
+    //   },
+    // });
+    dd.setNavigationBar({ title: "我的排名" });
+  },
+  onShow(){
+    this.getData();
+  },
+  activeGs(){
+      this.setData({
+        isShowGs: false
+      })
+      dd.setStorage({
+        key: 'isShowGs',
+        data: true,
+        success: function() {}
+      });
+  },
+  getData(){
+    app.$get('api/integral/statistics/ranking/list').then((res) => {
+      var data = res.data.data.list;
+        this.setData({
+          dataList: data
+        })
+    })
+  },
+  //打开编辑
+  openCompile(e){
+    var item=e.target.dataset.item;
+    dd.navigateTo({
+      url: '../addCustom/addCustom?id='+item.id
+    })
+  },
+    //打开排名
+  openDetail(e){
+    var item = e.target.dataset.item;
+    var url = '';
+    console.log(item)
+    if (item.type == 'normal') {
+      url = '../../statistics/sectionRanking/sectionRanking';
+    } else if (item.type == 'all') {
+      url = '../../statistics/B_ranking/B_ranking';
+    } else {
+      url = '../../statistics/C_ranking/C_ranking?id=' + item.target_id + '&name=' + item.group_name+'&date_interval='+item.date_interval;
+    }
+    dd.navigateTo({
+      url: url
+    })
+  },
+  //打开添加
+  openAdd(){
+    dd.navigateTo({
+      url: '../addCustom/addCustom'
+    })
+  },
+});

+ 1 - 0
pages/statistics/userRamking/userRamking.json

@@ -0,0 +1 @@
+{}

+ 10 - 4
pages/workbench/apply/apply.axml

@@ -6,12 +6,17 @@
         <view style="font-size:24rpx" data-index="{{index}}" class="blue" a:if="{{items.length>1}}" catchTap="deleteArr">删除</view>
       </view>
       <view class="inputs">
+        <view class="flex-box flex-v-ce li" data-index="{{index}}" data-num="3" data-item="{{{id:item.employee_id,name:item.employeeName}}}" catchTap="openSelect">
+          <view class="label isBt">录入对象</view>
+          <view class="flex-1">{{item.employeeName}}</view>
+          <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
+        </view>
         <view class="flex-box flex-v-ce li" style="padding:26rpx 28rpx;" data-index="{{index}}">
           <view class="label">指定规则</view>
           <view class="flex-1"></view>
           <switch onChange="switchChange" checked="{{item.checked}}" data-index="{{index}}" color="#26A2FF"></switch>
         </view>
-        <view class="flex-box flex-v-ce li" a:if="{{item.checked}}" data-index="{{index}}" data-num="1" catchTap="openSelect">
+        <view class="flex-box flex-v-ce li" a:if="{{item.checked}}" data-ruleId="{{item.selectRule.id}}" data-index="{{index}}" data-num="1" catchTap="openSelect">
           <view class="label isBt">选择规则</view>
           <view class="flex-1" a:if="{{item.selectRule}}">已选择1条</view>
           <view class="flex-1" a:else></view>
@@ -50,7 +55,7 @@
           <view class="flex-1">{{item.event_time}}</view>
           <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
         </view>
-        <view class="flex-box flex-v-ce li" data-index="{{index}}" data-num="2" data-item="{{{id:item.reviewer_id,name:item.revieweName}}}" catchTap="openSelect">
+        <view class="flex-box flex-v-ce li" data-index="{{index}}" data-num="2" data-item="{{{id:item.reviewer_id,name:item.revieweName,employee_id:item.employee_id}}}" catchTap="openSelect">
           <view class="label isBt">审批人</view>
           <view class="flex-1">{{item.revieweName}}</view>
           <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
@@ -63,7 +68,8 @@
     </view>
   </form>
   <view class="box" animation="{{animationInfo}}">
-        <select-rule onConfirm="onSelectItem" onClose="onClose" a:if="{{isShowType=='1'}}"/>
-        <select-section-staff-two onClose="onClose" selectUser="{{reviewerObj}}" onConfirm="onSelectUser" a:if="{{isShowType=='2'}}"/>
+        <select-rule defaultId="{{defaultRuleId}}" onConfirm="onSelectItem" onClose="onClose" a:if="{{isShowType=='1'}}"/>
+        <select-section-staff-two superior_list="{{superior_list}}" onClose="onClose" selectUser="{{reviewerObj}}" onConfirm="onSelectUser" a:if="{{isShowType=='2'}}"/>
+        <select-section-staff  isAllSelect="{{false}}" isBoss="{{true}}" selectUser="{{employeeObj}}" onClose="onClose" onConfirm="onSelectUserEmployee" a:if="{{isShowType=='3'}}"/>
   </view>
 </view>

+ 149 - 44
pages/workbench/apply/apply.js

@@ -6,6 +6,8 @@ Page({
     members: '',//用户id
     userName: '',//用户名称
     items: [{//录入选项列表
+      employee_id: '',
+			employeeName: '', 
       checked: true,//判断是否开启指定规则
       rule_id: '',//积分分类id
       item_id: '',//积分细则id 不选可以为0
@@ -19,43 +21,54 @@ Page({
     isShowType: true,//是显示选择规则还是显示选择分类
     activeIndex: '',
     isArr: ['奖', '扣'],
-    reviewerObj: [],
+    reviewerObj: [],//选中的审批人
+    employeeObj:[],//选中的录入对象
     disabled: false,
+    superior_list:[],//录入人的上级
+    getReviewerObj:{},//默认当前的缓存对象
+    defaultRuleId: '',
   },
   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: [{//录入选项列表
-        checked: true,//判断是否开启指定规则
-        rule_id: '',//积分分类id
-        item_id: '',//积分细则id 不选可以为0
-        remark: '',//备注
-        event_time: app.globalData.day,//事件时间
-        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: '',//附件数组列表
-      }],
+    this.getReviewerObj(app.globalData.userData.id,function(res){
+      that.setData({
+        getReviewerObj:res,
+        items: [{//录入选项列表
+          checked: true,//判断是否开启指定规则
+          employee_id: app.globalData.userData.id,
+          employeeName: app.globalData.userData.name,
+          rule_id: '',//积分分类id
+          item_id: '',//积分细则id 不选可以为0
+          remark: '',//备注
+          event_time: app.globalData.day,//事件时间
+          reviewer_id:res.id,
+          revieweName:res.name,
+          files: '',//附件数组列表
+        }],
+      })
     })
   },
+  //获取缓存的审批人
+  getReviewerObj(id,fuc){
+    dd.getStorage({
+      key: String(id),
+      success: function(res) {
+        if(res.data){
+          fuc(res.data);
+        }else{
+          fuc({});
+        }
+      }
+    });
+  },
+
   onShow() {
     animation = dd.createAnimation({
       duration: 200,
       timeFunction: "linear",
     });
   },
-      //获取人员列表
-    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;
@@ -75,20 +88,66 @@ Page({
       isShowType: ''
     });
   },
-  //选择规则
+  showToast(text) {
+    app.globalData.showToast(text);
+  },
+  //选择
   openSelect(e) {
-    if (e.target.dataset.item) {
-      that.setData({ reviewerObj: [e.target.dataset.item] });
-    }
+    var index = e.target.dataset.index;
+    var item = e.target.dataset.item;
+    var num = e.target.dataset.num;
     that.setData({ activeIndex: '' });
-    that.setData({
-      isShowType: e.target.dataset.num,
-      activeIndex: e.target.dataset.index,
-    });
-    animation.translateY(0).step();
-    that.setData({
-      animationInfo: animation.export()
-    });
+    if (num == 2) {
+      if (!item.employee_id) {
+        this.showToast('请先选择录入对象')
+        return;
+      }
+      // 获取录入对象的上级
+      this.getEmployeeList([item.employee_id], function (res) {//获取共同上级
+        var reviewer_id = `items[${index}].reviewer_id`
+        var revieweName = `items[${index}].revieweName`
+        let is=false;//是否还在
+        res.forEach(items=>{
+          if(items.id==item.id){//判断缓存起来的审批人是否还在审批人列表中
+              is=true;
+          }
+        })
+        if(is){
+          that.setData({ 
+            superior_list: res,
+            isShowType: num,
+            activeIndex: index,
+            reviewerObj: [item]
+          })
+        }else{
+         that.setData({ 
+            superior_list: res,
+            isShowType: num,
+            activeIndex: index,
+            reviewerObj: [],
+            [reviewer_id]:'',
+            [revieweName]:''
+          })
+        }
+        animation.translateY(0).step();
+        that.setData({
+          animationInfo: animation.export()
+        });
+      });
+    }else{
+      if (e.target.dataset.ruleId) {
+          that.setData({ defaultRuleId: e.target.dataset.ruleId });
+      }
+      that.setData({ 
+        employeeObj:num==3? [e.target.dataset.item]:[],
+        isShowType: num,
+        activeIndex: index,
+      });
+      animation.translateY(0).step();
+      that.setData({
+        animationInfo: animation.export()
+      });
+    }
   },
   //删除图片
   deteleImg(e) {
@@ -99,7 +158,6 @@ Page({
     that.setData({
       [files_box]: files
     });
-
   },
   //图片选择
   openImg(e) {
@@ -203,7 +261,7 @@ Page({
         isTg = false;
         break;
       }
-      obj.employee_id = app.globalData.userData.id;
+      obj.employee_id = item.employee_id;
       if (item.checked) {
         obj.rule_id = item.selectRule ? item.selectRule.rule_id : 0;
         obj.item_id = item.selectRule ? item.selectRule.id : 0;
@@ -222,6 +280,7 @@ Page({
       obj.remark = item.remark;
       obj.event_time = item.event_time;
       obj.reviewer_id = item.reviewer_id;
+      obj.revieweName = item.revieweName;
       obj.files = item.files;
       arr.push(obj);
     }
@@ -250,6 +309,16 @@ Page({
         }
       }).catch(err => {
         this.setData({ disabled: false });
+      }).finally(()=>{
+        console.log(arr);
+        if(arr.length>0){
+          arr.forEach(item=>{
+            dd.setStorage({
+              key: String(item.employee_id),
+              data: {id:item.reviewer_id,name:item.revieweName},
+            });
+          })
+        }
       })
     }
   },
@@ -261,9 +330,43 @@ Page({
     that.setData({
       items: list
     })
-    console.log(that.data.items);
   },
-  //选择人
+  //选择录入对象
+  onSelectUserEmployee(item) {
+    var elm = item.length > 0 ? item[0] : { id: '', name: '' };
+    var index = this.data.activeIndex;
+    var employee_id = `items[${index}].employee_id`
+    var employeeName = `items[${index}].employeeName`
+    var reviewer_id = `items[${index}].reviewer_id`
+    var revieweName = `items[${index}].revieweName`
+    that.setData({
+      [employee_id]: elm.id,
+      [employeeName]: elm.name,
+    });
+    dd.getStorage({
+      key: String(elm.id),
+      success: function(res) {
+        if(res.data){
+          that.setData({
+            [reviewer_id]:res.data.id,
+            [revieweName]:res.data.name
+          });  
+        }else{
+          that.setData({
+            [reviewer_id]:'',
+            [revieweName]:''
+          });  
+        }
+      }
+    });
+  },
+    //获取人员(上级人员)
+  getEmployeeList(userIdArr, callBack) {
+    app.$get("api/employee/superior", { employee_id: userIdArr, filter_applyor: 1 }).then((res) => {
+      callBack(res.data.data.list||[])
+    })
+  },
+  //选择审批人
   onSelectUser(item) {
     var elm = item.length > 0 ? item[0] : { id: '', name: '' };
     var index = this.data.activeIndex;
@@ -276,16 +379,18 @@ Page({
   },
   //添加一条
   addArr() {
+
+
     var arr = {//录入选项列表
+      employee_id: app.globalData.userData.id,
+			employeeName: app.globalData.userData.name,
       checked: true,//判断是否开启指定规则
       rule_id: '',//积分分类id
       item_id: '',//积分细则id 不选可以为0
       remark: '',//备注
       event_time: app.globalData.day,//事件时间
-      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,//审批人姓名(非传)
+      reviewer_id:this.data.getReviewerObj.id,
+      revieweName:this.data.getReviewerObj.name,
       files: '',//附件数组列表
     };
     var list = that.data.items

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

@@ -1,6 +1,7 @@
 {
   "usingComponents": {
     "select-rule":"/Component/selectRule/selectRule",
-    "select-section-staff-two":"/Component/selectSectionStaff_tow/selectSectionStaff_tow"
+    "select-section-staff-two":"/Component/selectSectionStaff_tow/selectSectionStaff_tow",
+        "select-section-staff":"/Component/selectSectionStaff/selectSectionStaff"
   }
 }

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

@@ -38,9 +38,9 @@
           <text class="green" a:else style="position: relative;top:8rpx;">-</text>
           <view class="flex-1">
             <view class="flex-box flex-v-ce">
-              <view a:if="{{item.selectRule.range_type==1&&item.selectRule.min_point==item.selectRule.max_point}}" style="padding-left:10rpx; height:60rpx;line-height:60rpx;" class="flex-1">{{item.point}}</view>
+              <view a:if="{{(item.selectRule.range_type==1&&item.selectRule.min_point==item.selectRule.max_point)||item.pid>0}}" style="padding-left:10rpx; height:60rpx;line-height:60rpx;" class="flex-1">{{item.point}}</view>
               <input a:else value="{{item.point}}"  placeholder="0" type="number" onInput="bindKeyInput"  class="flex-1"/>
-              <view class="picker-box"  catchTap="bindPickerChange" a:if="{{item.selectRule.range_type!=1}}">
+              <view class="picker-box"  catchTap="bindPickerChange" a:if="{{item.selectRule.range_type!=1&&item.pid==0}}">
                 <view class="{{item.isArrindex==true ? 'picker-right':'picker-left'}} yuan"></view>
                 <view class="flex-box flex-v-ce" class="picker">
                   <text class="red flex-1">奖</text>

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

@@ -75,7 +75,6 @@ Page({
   //提交
   formSubmit() {
     var item = that.data.item;
-    console.log(item);
     var data, point;
     var num = item.checked ? item.point : item.point2
     if (item.checked) {

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

@@ -14,7 +14,7 @@
 }
 .header-main .laber{
   color: #909399;
-  width: 140rpx;
+  width: 150rpx;
 }
 .header-main .flex-box{
  padding: 5rpx 0;

+ 172 - 40
pages/workbench/index/index.acss

@@ -4,7 +4,8 @@
   background-color: #26A2FF;
   margin-bottom: 70rpx;
 }
-.head{
+
+.head {
   position: absolute;
   top: 0;
   left: 32rpx;
@@ -14,56 +15,67 @@
   box-shadow: 0rpx 4rpx 10rpx rgba(0, 0, 0, 0.05);
   height: 140rpx;
   text-align: center;
-  
 }
-.head .flex-1 view:nth-child(1){
+
+.head .flex-1 view:nth-child(1) {
   color: #26A2FF;
   font-weight: 600;
   margin-bottom: 10rpx;
   font-size: 44rpx;
 }
-.head .flex-1 view:nth-child(2){
+
+.head .flex-1 view:nth-child(2) {
   color: #909399;
   margin-bottom: 5rpx;
   font-size: 28rpx;
 }
-.headed{
+
+.headed {
   background-color: #fff;
 }
-.headed-box{
+
+.headed-box {
   padding: 32rpx;
   padding-bottom: 0rpx;
   color: #303133;
 }
-.headed-box .headed-box-item .left{
+
+.headed-box .headed-box-item .left {
   margin-right: 32rpx;
 }
-.headed-box .headed-box-item .flex-1{
+
+.headed-box .headed-box-item .flex-1 {
   border: 1px solid #f1f1f1;
   border-radius: 8rpx;
   padding: 32rpx;
   margin-bottom: 32rpx;
 }
-.headed-box-item image{
+
+.headed-box-item image {
   width: 60rpx;
   height: 60rpx;
   margin-right: 10rpx;
 }
-.headed-box-item text{
-    font-size: 32rpx;
+
+.headed-box-item text {
+  font-size: 32rpx;
 }
+
 /* 中间部分 */
-.main{
+
+.main {
   background-color: #fff;
 }
-.main .main-title{
+
+.main .main-title {
   border-bottom: 1px solid #f1f1f1;
   padding: 28rpx 32rpx;
   color: #222;
 }
-.main .main-title .text2{
+
+.main .main-title .text2 {
   border-radius: 50%;
-  border:1px solid #909399;
+  border: 1px solid #909399;
   color: #909399;
   width: 26rpx;
   height: 26rpx;
@@ -75,96 +87,216 @@
   line-height: 26rpx;
   box-sizing: border-box;
 }
-.main-main{
+
+.main-main {
   text-align: center;
   padding: 32rpx;
 }
-.main-main .flex-1 view:nth-child(1){
+
+.main-main .flex-1 view:nth-child(1) {
   color: #26A2FF;
   font-weight: 600;
   margin-bottom: 10rpx;
   font-size: 44rpx;
 }
-.main-main .flex-1 view:nth-child(2){
+
+.main-main .flex-1 view:nth-child(2) {
   color: #303133;
   margin-bottom: 5rpx;
 }
-.main-main .flex-1 view:nth-child(3){
-  color: #909399;;
+
+.main-main .flex-1 view:nth-child(3) {
+  color: #909399;
+  ;
   margin-bottom: 5rpx;
   font-size: 24rpx;
 }
+
 /* 底部 */
-.bottom{
-    background-color: #fff;
-    /* position: sticky;
+
+.bottom {
+  background-color: #fff;
+  /* position: sticky;
     top: 100rpx; */
 }
-.bottom .bottom-title{
+
+.bottom .bottom-title {
   border-bottom: 1px solid #f1f1f1;
   padding: 28rpx 32rpx;
   color: #222;
   font-size: 32rpx
 }
-.bottom-time{
+
+.bottom-time {
   padding: 28rpx 0 0rpx 28rpx;
 }
-.bottom-right{
+
+.bottom-right {
   border-bottom: 1px solid #f1f1f1;
   padding-bottom: 28rpx;
   margin-left: 16rpx;
   padding-top: 20rpx;
 }
-.bottom-right .name{
+
+.bottom-right .name {
   font-size: 36rpx;
   margin-bottom: 16rpx;
 }
-.num{
+
+.num {
   color: #F56C6C;
   margin-right: 28rpx;
   font-size: 36rpx;
   font-weight: 600
 }
-.text{
+
+.text {
   margin-bottom: 16rpx;
   font-size: 32rpx;
 }
-.date{
+
+.date {
   color: #C0C4CC;
   font-size: 28rpx;
 }
-.more{
+
+.more {
   height: 60rpx;
   text-align: center;
   color: #909399;
   line-height: 60rpx;
   font-size: 28rpx;
 }
-.windows-box{
+
+.windows-box {
   background: #fff;
   margin: 0 10%;
   margin-top: 50%;
-  border-radius: 20rpx; 
+  border-radius: 20rpx;
 }
-.windows-title{
+
+.windows-title {
   padding: 32rpx;
   color: #999;
   font-size: 24rpx;
 }
-.windows-btn{
-   /* border-top: 1px solid #f1f1f1; */
+
+.windows-btn {
+  /* border-top: 1px solid #f1f1f1; */
 }
-.windows-btn view:nth-child(1){
+
+.windows-btn view:nth-child(1) {
   text-align: right;
   padding: 32rpx;
   color: #26A2FF;
 }
-.windows-content{
+
+.windows-content {
   height: 100rpx;
-  padding:0 28rpx;
+  padding: 0 28rpx;
   font-size: 32rpx;
 }
+
 .f2-chart {
-  width: 100%;
+  /* width: 100%; */
   height: 400rpx;
+  /* padding-right: 20rpx; */
+}
+
+.numPoint {
+  width: 100rpx;
+}
+
+.li {
+  background-color: #fff;
+}
+
+.img-left {
+  width: 46rpx;
+  height: 46rpx;
+  margin: 0 28rpx;
+}
+
+.img-right {
+  width: 24rpx;
+  height: 24rpx;
+}
+
+.li-right {
+  padding: 28rpx 0;
+}
+
+.ranking_name {
+  background-color: #26A2FF;
+  border-radius: 5px;
+  color: #fff;
+  font-size: 0.32rem;
+  margin-right: 0.26rem;
+  width: 0.9rem;
+  height: 0.9rem;
+  line-height: 0.9rem;
+  box-sizing: border-box;
+  text-align: center;
+}
+
+.ranking_num view {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  max-width: 5rem;
+  font-size: 0.32rem;
+}
+
+.ranking_num text {
+  font-size: 0.28rem;
+}
+
+.rankingLists {
+  text-align: center;
+  color: #909399;
+  padding: 0.24rem 0.32rem;
+  font-size: 0.28rem;
+}
+
+.chart-legend__wrap {
+  display: flex;
+  flex: 1;
+  font-size: 0.24rem;
+  flex-direction: row;
+  justify-content: flex-end;
+}
+
+.chart-legend__pink {
+  position: relative;
+  padding-left: 0.3rem;
+  padding-right: 0.24rem;
+}
+
+.chart-legend__pink:after {
+  content: '';
+  position: absolute;
+  margin-top: -0.1rem;
+  top: 50%;
+  left: 0;
+  width: 0.2rem;
+  height: 0.2rem;
+  background-image: linear-gradient(to top, #26A2FF 0%, #4ECFFF 100%);
+  border-radius: 100%;
+}
+
+.chart-legend__green {
+  position: relative;
+  padding-left: 0.3rem;
+}
+
+.chart-legend__green:after {
+  content: '';
+  position: absolute;
+  margin-top: -0.1rem;
+  top: 50%;
+  left: 0;
+  width: 0.2rem;
+  height: 0.2rem;
+  background-image: linear-gradient(to top, #F2A640 0%, #F8C748 100%);
+  border-radius: 100%;
 }

+ 107 - 68
pages/workbench/index/index.axml

@@ -12,93 +12,132 @@
   <view class="headed margin-bottom">
     <view class="top"></view>
     <view class="headed-box">
-          <view class="flex-box headed-box-item" a:if="{{isAdministrator}}">
-              <view class="flex-box flex-center-center flex-1 left" data-index="3" onTap="openView">
-                <image mode="scaleToFill" src="../../../image/jkbf.png"/>
-                <text>奖扣B分</text>
-              </view>
-              <view class="flex-box  flex-center-center flex-1" data-index="4" onTap="openView">
-                <image mode="scaleToFill" src="../../../image/jkaf.png"/>
-                <text>奖扣A分</text>
-              </view>
-          </view>
-          <view class="flex-box headed-box-item">
-              <view class="flex-box  flex-center-center flex-1 left" data-index="5" onTap="openView">
-                <image mode="scaleToFill" src="../../../image/sqjf.png"/>
-                <text>申请积分</text>
-              </view>
-              <view class="flex-box  flex-center-center flex-1" data-index="6" onTap="openView">
-                <image mode="scaleToFill" src="../../../image/sp.png"/>
-                <text>审批<text class="red">({{total}})</text></text>
-              </view>
-          </view>
-    </view>
-
-  </view>
-  <!-- 奖扣展示 -->
-  <view class="main margin-bottom" a:if="{{userData.task&&isAdministrator}}">
-      <view class="main-title flex-box flex-v-ce">
-          <text style="font-size:32rpx">本月B分奖扣</text>
-          <text class="text2" catchTap="showText">?</text>
-      </view>
-      <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 class="fontColorF" style="font-size:28rpx">奖分</view>
-            <view>目标{{userData.task.reward.target_point}}</view>
+      <view a:if="{{isAdministrator}}" class="flex-box headed-box-item">
+        <view class="flex-box flex-center-center flex-1 left" data-index="3" onTap="openView">
+          <image mode="scaleToFill" src="../../../image/jkbf.png"></image>
+          <text>奖扣B分</text>
+        </view>
+        <view class="flex-box  flex-center-center flex-1" data-index="4" onTap="openView">
+          <image mode="scaleToFill" src="../../../image/jkaf.png"></image>
+          <text>奖扣A分</text>
         </view>
-        <view class="flex-1">
-            <view>{{userData.task.deduction.point}}</view>
-            <view class="fontColorF" style="font-size:28rpx">扣分</view>
-            <view>目标{{userData.task.deduction.target_point}}</view>
+      </view>
+      <view class="flex-box headed-box-item">
+        <view class="flex-box  flex-center-center flex-1 left" data-index="5" onTap="openView">
+          <image mode="scaleToFill" src="../../../image/sqjf.png"></image>
+          <text>申请积分</text>
         </view>
-        <view class="flex-1">
-            <view>{{userData.ratio.ratio}}</view>
-            <view class="fontColorF" style="font-size:28rpx">奖扣比例</view>
-            <view>目标{{userData.ratio.target_ratio}}</view>
+        <view class="flex-box  flex-center-center flex-1" data-index="6" onTap="openView">
+          <image mode="scaleToFill" src="../../../image/sp.png"></image>
+          <text>
+            审批
+            <text class="red">({{total}})</text>
+          </text>
         </view>
-        <view class="flex-1">
-            <view>{{userData.task.exec.count}}</view>
-            <view class="fontColorF" style="font-size:28rpx">奖扣人次</view>
-            <view>目标{{userData.task.exec.target_count}}</view>
+      </view>
+    </view>
+  </view>
+
+  <view class="main margin-bottom">
+    <view class="main-title flex-box flex-v-ce" onTap="openView" data-index="10">
+      <text class="flex-1" style="font-size:32rpx">排行榜</text>
+      <text class="fontColorF" style="font-size:28rpx">每小时更新一下</text>
+    </view>
+    <view class="flex-box flex-v-ce" style="padding:0.28rem; border-bottom: 1px solid #f1f1f1; " a:for="{{rankingList}}" 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">
+            <view>{{ item.group_name }}</view>
+            <text class="fontColorF" a:if="{{getRole_four}}">第 {{ item.rank }} 名:{{item.employee_name}}</text>
+            <text class="fontColorF" a:else>第 {{ item.rank }} 名</text>
         </view>
+        <image mode="scaleToFill" src="../../../image/right.png" class="img-right"></image> 
       </view>
+    </view>
+    <view a:if="{{rankingTotal > 5}}" class="rankingLists" onTap="openView" data-index="10">
+        <text>查看所有排行榜</text>
+        <image mode="scaleToFill" src="../../../image/right.png" class="img-right"></image> 
+    </view>
   </view>
 
 
-  <view class="bottom margin-bottom">
-    <view class="bottom-title">近30天B分趋势</view>
-      <view class="f2-chart">
-        <f2 onInit="onInitChart"></f2>
+  <!-- 奖扣展示 -->
+  <view a:if="{{userData.task&&isAdministrator}}" class="main margin-bottom">
+    <view class="main-title flex-box flex-v-ce">
+      <text style="font-size:32rpx">本月B分奖扣</text>
+      <text class="text2" catchTap="showText">?</text>
+    </view>
+    <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 class="fontColorF" style="font-size:28rpx">奖分</view>
+        <view class="font-flex-word numPoint">目标{{userData.task.reward.target_point}}</view>
+      </view>
+      <view class="flex-1">
+        <view>{{userData.task.deduction.point}}</view>
+        <view class="fontColorF" style="font-size:28rpx">扣分</view>
+        <view class="font-flex-word numPoint">目标{{userData.task.deduction.target_point}}</view>
+      </view>
+      <view class="flex-1">
+        <view>{{userData.ratio.ratio}}</view>
+        <view class="fontColorF" style="font-size:28rpx">奖扣比例</view>
+        <view class="font-flex-word numPoint">目标{{userData.ratio.target_ratio}}</view>
       </view>
+      <view class="flex-1">
+        <view>{{userData.task.exec.count}}</view>
+        <view class="fontColorF" style="font-size:28rpx">奖扣人次</view>
+        <view class="font-flex-word numPoint">目标{{userData.task.exec.target_count}}</view>
+      </view>
+    </view>
   </view>
 
-  <view class="bottom margin-bottom">
-     <view class="bottom-title">本月B分积分构成</view>
-     <view class="f2-chart" a:if="{{pieData.length>0}}">
-        <f2 onInit="onInitChart2"></f2>
+  <!-- 管理者奖扣 -->
+  <view class="bottom margin-bottom" a:if="{{isAdministrator}}">
+    <view class="flex-box flex-v-ce bottom-title">
+      <view class="flex-1">管理者奖扣</view>
+       <view class="chart-legend__wrap">
+          <text class="chart-legend__pink">奖分</text>
+          <text class="chart-legend__green">扣分</text>
+       </view>
+    </view>
+    <view class="f2-chart" a:if="{{pieTotal>0}}">
+      <f2 onInit="onInitChart3"></f2>
     </view>
-    <no-data a:if="{{pieData.length==0}}" content="无数据" />
+     <no-data a:if="{{pieTotal==0}}" content="无数据"></no-data>
   </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">本月B分积分构成</view>
+    <view a:if="{{pieData.length>0}}" class="f2-chart">
+      <f2 onInit="onInitChart2"></f2>
+    </view>
+    <no-data a:if="{{pieData.length==0}}" content="无数据"></no-data>
+  </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"> 
-        <img-box name="{{item.employee_name}}" imgUrl="{{item.employee_img_url}}"/>
-        <view class="flex-1 bottom-right">
-          <view class="flex-box">
-            <text class="flex-1 name">{{item.employee_name}}</text>
-            <text class="num" a:if="{{item.point>0}}">+{{item.point}} {{item.ptObj.name}}</text>
-            <text class="num green" a:else>{{item.point}} {{item.ptObj.name}}</text>
-          </view>
-          <view class="text">{{item.remark}}</view>
-          <view class="date">{{item.event_time}}</view>
+    <view a:for="{{incidentLsit}}" class="flex-box bottom-time" data-item="{{item}}" data-index="8" onTap="openView">
+      <img-box name="{{item.employee_name}}" imgUrl="{{item.employee_img_url}}"></img-box>
+      <view class="flex-1 bottom-right">
+        <view class="flex-box">
+          <text class="flex-1 name">{{item.employee_name}}</text>
+          <text a:if="{{item.point>0}}" class="num">+{{item.point}} {{item.ptObj.name}}</text>
+          <text a:else class="num green">{{item.point}} {{item.ptObj.name}}</text>
         </view>
+        <view class="text">{{item.remark}}</view>
+        <view class="date">{{item.event_time}}</view>
+      </view>
     </view>
-    <no-data a:if="{{incidentLsit.length==0}}"  />
+    <no-data a:if="{{incidentLsit.length==0}}"></no-data>
   </view>
-  <view data-index="9" onTap="openView" a:if="{{incidentLsitTotal>5}}" class="more">查看更多</view>
-  <view class="windows" a:if="{{isBh}}" content="还没有积分事件">
+  <view a:if="{{incidentLsitTotal>5}}" data-index="9" onTap="openView" class="more">查看更多</view>
+  <view a:if="{{isBh}}" class="windows" content="还没有积分事件">
     <view class="windows-box">
       <view class="windows-title">温馨提示</view>
       <view class="windows-content">作为管理者,管理执行力是关键,每月按要求完成奖分和扣分任务</view>

+ 149 - 48
pages/workbench/index/index.js

@@ -2,34 +2,37 @@ var app = getApp();
 var that;
 var chart1;
 var chart2;
+var chart3;
 Page({
   data: {
     userData: {},
     isBh: false,
     chartData: [],//折线图数据
     pieData: [1],//饼型图数据
-    isAdministrator:app.globalData.isAdministrator,//是否管理员角色
+    isAdministrator: app.globalData.isAdministrator,//是否管理员角色
+    rankingTotal: 0,
+    rankingList: [],
+    getRole_four: app.globalData.isCreator,//是否创始人
+    setECharts: [],//柱形图数据
+    pieTotal: 1
   },
   onLoad() {
     that = this;
-    chart1, chart2 = '';
+    chart1, chart2, chart3 = '';
   },
   onShow(query) {
-    // that.getUserData();
-    // that.getIncidentLsit();
-    // that.getIncidentNum();
     if (app.globalData.userData) {
       that.getUserData();
-      that.getIncidentLsit();
-      that.getIncidentNum();
-      that.setData({isAdministrator:app.globalData.isAdministrator})
+      // that.getIncidentLsit();
+      // that.getIncidentNum();
+      that.setData({ isAdministrator: app.globalData.isAdministrator, getRole_four: app.globalData.isCreator })
     } else {
       app.login(app.globalData.corpId, function (is) {
         if (is) {
           that.getUserData();
-          that.getIncidentLsit();
-          that.getIncidentNum();
-          that.setData({isAdministrator:app.globalData.isAdministrator})
+          // that.getIncidentLsit();
+          // that.getIncidentNum();
+          that.setData({ isAdministrator: app.globalData.isAdministrator, getRole_four: app.globalData.isCreator })
         } else {
           dd.reLaunch({
             url: '../noJurisdiction/noJurisdiction'
@@ -41,6 +44,20 @@ Page({
   showText() {
     this.setData({ isBh: !this.data.isBh })
   },
+  openViewRanking(e) {
+    var item = e.target.dataset.item;
+    var url = '';
+    if (item.type == 'normal') {
+      url = '../../statistics/sectionRanking/sectionRanking';
+    } else if (item.type == 'all') {
+      url = '../../statistics/B_ranking/B_ranking';
+    } else {
+      url = '../../statistics/C_ranking/C_ranking?id=' + item.target_id + '&name=' + item.group_name+'&date_interval='+item.date_interval;
+    }
+    dd.navigateTo({
+      url: url
+    })
+  },
   //跳转
   openView(e) {
     var index = e.target.dataset.index - 1;
@@ -56,6 +73,7 @@ Page({
         { url: '../prize_buckle/prize_buckle', query: '' },
         { url: '../../statistics/prizeBuckleDetail/prizeBuckleDetail', query: 'id=' + e.target.dataset.item.id },
         { url: '../../statistics/integralEvent/integralEvent', query: '' },
+        { url: '../../statistics/userRamking/userRamking', query: '' },
       ];
     } else {
       urls = [
@@ -68,6 +86,7 @@ Page({
         { url: '../prize_buckle/prize_buckle', query: '' },
         { url: '../../statistics/prizeBuckleDetail/prizeBuckleDetail', query: '' },
         { url: '../../statistics/integralEvent/integralEvent', query: '' },
+        { url: '../../statistics/userRamking/userRamking', query: '' },
       ];
     }
     dd.navigateTo({
@@ -78,20 +97,28 @@ Page({
   onInitChart(F2, config) {
     chart1 = new F2.Chart(config);
     chart1.source(that.data.chartData, {
-      date: {
-        // range: [0, 1],
-        tickCount: 5
-      }
+      date: { tickCount: 4 }
     });
     chart1.tooltip({
       showCrosshairs: true,
-      showItemMarker: false,
+      showItemMarker: true,
       onShow: function onShow(ev) {
         const items = ev.items;
         items[0].name = "月份:" + items[0].origin.date;
         items[0].value = "分值:" + items[0].value;
       }
     });
+    chart1.axis('date', {
+      label: function label(text, index, total) {
+        const textCfg = {};
+        if (index === 0) {
+          textCfg.textAlign = 'left';
+        } else if (index === total - 1) {
+          textCfg.textAlign = 'right';
+        }
+        return textCfg;
+      }
+    });
     chart1.line().position('date*value');
     chart1.point().position('date*value').style({
       stroke: '#fff',
@@ -140,16 +167,34 @@ Page({
     // that.getLsit();
     return chart2;
   },
+  //柱形图
+  onInitChart3(F2, config) {
+    chart3 = new F2.Chart(config);
+    chart3.source(that.data.setECharts, {
+      date: { tickCount: 5 }
+    });
+    chart3.legend(false);
+    chart3.interval().position('name*val').color('type', (type) => { // 通过回调函数
+      if (type === '奖分') {
+        return 'l(90) 0:#4ECFFF 1:#26A2FF';
+      }
+      return 'l(90) 0:#F8C748 1:#F2A640';
+    }).adjust({
+      type: 'dodge',
+      marginRatio: 0.05 // 设置分组间柱子的间距
+    });
+    chart3.render()
+    return chart3;
+  },
   //获取统计数据
   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 => {
+    var start_date = date2.getFullYear() + "-" + (date2.getMonth() + 1) + "-" + date2.getDate();
+    var incident = app.$get2("api/integral/statistics/b", { employee_id: 0, start_date: start_date, end_date: app.globalData.day, show_type: '1' });
+    // var pei = app.$get2("api/integral/statistics/pie/b", { employee_id: 0, month: that.data.date });
+    Promise.all([incident]).then(resArr => {
       if (resArr[0].data.code == 1) {
         const { b, chart, good, bad } = resArr[0].data.data
         const points = chart.reward.map((rewardItem, index) => {
@@ -162,18 +207,18 @@ Page({
           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);
-      }
+      // 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)
     })
@@ -181,25 +226,81 @@ Page({
 
   //获取个人统计
   getUserData() {
-    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 });
-      var ratio = task.reward.point === 0 || task.deduction.point === 0 ? '-' : `${task.ratio.ratio}:1`
-      var target_ratio = task.ratio.target_ratio <= 0 ? '0:0' : `${task.ratio.target_ratio}:1`
-      data.ratio = {
-        ratio: ratio,
-        target_ratio: target_ratio
+    var http1 = app.$get2("api/integral/statistics", { employee_id: 0, month: app.globalData.month })
+    var http2 = app.$get2("api/integral/statistics/integral", { month: app.globalData.month, page: 1, page_size: 5, employee_ids: app.globalData.userData.id })
+    var http3 = app.$get2("api/integral/review/list", { type: 'waiting', page: 1, pt_id: 0 })
+    var ranking = app.$get('api/integral/statistics/ranking/list', { page: 1, page_size: 5 })// 获取排行榜
+    var task = app.$get('api/integral/statistics/task/pie', { month: app.globalData.month })// 管理者奖扣任务柱状图
+    Promise.all([http1, http2, http3, ranking, task]).then(function (values) {
+      if (values[0]) {
+        let data = values[0].data.data;
+        var task = data.task;
+        dd.setNavigationBar({ title: data.name });
+        var ratio = task.reward.point === 0 || task.deduction.point === 0 ? '-' : `${task.ratio.ratio}:1`
+        var target_ratio = task.ratio.target_ratio <= 0 ? '0:0' : `${task.ratio.target_ratio}:1`
+        data.ratio = {
+          ratio: ratio,
+          target_ratio: target_ratio
+        }
+        that.getLsit();
+        that.setData({
+          userData: data
+        })
       }
-       that.getLsit();
-      this.setData({
-        userData: data
-      })
-    }, (err) => { })
+      if (values[1]) {
+        let data = values[1].data.data.list;
+        data.map((item) => {
+          item.ptObj = app.getTypesItem(item.pt_id);
+        })
+        that.setData({
+          incidentLsit: data,
+          incidentLsitTotal: values[1].data.data.total
+        })
+      }
+      if (values[2]) {
+        let data = values[2].data.data;
+        that.setData({
+          total: data.total
+        })
+      }
+      if (values[3]) {
+        that.setData({
+          rankingList: values[3].data.data.list,
+          rankingTotal: values[3].data.data.total
+        })
+      }
+      if (values[4]) {
+        if (that.data.isAdministrator) {
+          var data = values[4].data.data.list
+          if (data.length > 5) {
+            data.pop()
+          }
+          that.setData({
+            pieTotal: values[4].data.data.total
+          })
+          if (that.data.pieTotal != 0) {
+            var employees = [];
+            data.forEach((item) => {
+              var obj = [{
+                type: '奖分',
+                name: item.employee_name,
+                val: item.deduction
+              }, {
+                type: '扣分',
+                name: item.employee_name,
+                val: item.reward
+              }]
+              employees.push(...obj)
+            })
+            chart3.changeData(employees);
+          }
+        }
+      }
+    })
   },
   //获取积分事件
   getIncidentLsit() {
-    app.$get("api/integral/statistics/integral", { month: app.globalData.month, page: 1, page_size: 5,employee_ids:app.globalData.userData.id }).then((res) => {
+    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);

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

@@ -129,7 +129,7 @@ textarea::before{
 .yuan{
   width: 50rpx;
   height: 50rpx;
-  background: #fff;
+  background: #26A2FF;
   border-radius: 100rpx;
   position: absolute;
   top: 5rpx;

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

@@ -78,8 +78,8 @@
           <view class="flex-1">{{item.event_time}}</view>
           <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
         </view>
-        <view class="flex-box flex-v-ce li" data-index="{{index}}"  data-num="4"  data-item="{{{id:item.reviewer_id,name:item.revieweName}}}"  catchTap="openSelect">
-          <view class="label">审批</view>
+        <view class="flex-box flex-v-ce li" data-index="{{index}}"  data-num="4" a:if="{{!isCreator}}"  data-item="{{{id:item.reviewer_id,name:item.revieweName}}}"  catchTap="openSelect">
+          <view class="label">递交审批</view>
           <view class="flex-1">{{item.revieweName}}</view>
           <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
         </view>
@@ -95,7 +95,7 @@
         </view>
       </view>
     </view>
-    <!-- <view class="add" catchTap="addArr">+  再加一条</view> -->
+    <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>

+ 15 - 11
pages/workbench/jk_B/jk_B.js

@@ -16,12 +16,14 @@ Page({
     type: 'B',
     isGzType: 'BF',
     defaultRuleId: '',
+    isCreator:false,//是否创始人
   },
   onLoad(data) {
     that = this;
     this.setData({
       type: data.type,
       isGzType: data.type == "B" ? "BF" : "AF",
+      isCreator:app.globalData.isCreator,
       items: [{//录入选项列表
         checked: true,//判断是否开启指定规则
         rule_id: '',//积分分类id
@@ -393,6 +395,7 @@ Page({
       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') {
           res.data.data.list.forEach(item => {
             if (item.status != 1) {
@@ -408,6 +411,7 @@ Page({
             }
           })
         }
+
         if (is) {
           this.showToast('提交成功');
           setTimeout(() => {
@@ -460,20 +464,20 @@ Page({
     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 => {
-          arr.push(el.id)
-        })
+      // item.forEach(el => {
+      //   userIdArr.push(el.id)
+      // })
+      // 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
+          superior_list: app.globalData.userData.employee_detail.superior_list
         })
-      });
+      // });
     }
 
   },

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

@@ -1,9 +1,12 @@
 <view>
   <view class="header margin-bottom">
+   <form onReset="onReset">
     <view class="search flex-box flex-v-ce">
       <image mode="scaleToFill" src="../../../image/ss.png"/>
       <input placeholder="请输入姓名或内容" onInput="bindKeyInput" onConfirm="bindKeyInput" class="flex-1"/>
-    </view>
+        <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
+      </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>

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

@@ -24,8 +24,7 @@ Page({
     if(this.data.page==1){
       dd.hideLoading();
       that.getData();
-    }else{
-      console.log("进来了")     
+    }else{  
        if(id){//当page不为一并下一页返回上一页不执行onshow()
         var arr=this.data.dataList;
         arr.forEach((element,index) => {
@@ -78,14 +77,22 @@ Page({
     })
     this.getData();
   },
+  onReset() {
+    this.setData({
+      keyword: '',
+      isVal: false,
+      page: 1,
+    })
+    this.getData();
+  },
   //选择规则分类
   bindKeyInput(e) {
     this.setData({
       keyword: e.detail.value,
       page: 1,
+      isVal:e.detail.value? true:false,
     });
     this.getData();
-    dd.hideKeyboard();
   },
   openSearch() {
     app.globalData.showToast("暂不支持筛选");

+ 5 - 4
pages/workbench/noJurisdiction/noJurisdiction.axml

@@ -1,10 +1,11 @@
 <view>
   <view class="noJ">
-      <view>
-        您当前未启用积分管理,无权限进入应用
+      <image mode="scaleToFill" src="../../../image/noData.png" style="width: 340rpx;height: 340rpx;margin-bottom:20rpx;"/>
+      <view a:if="{{isCreator}}">
+        您当前未授权自己进入应用,请修改应用的可见范围为全部或包含自己,如需咨询客服,请到您企业专属的功道云服务群咨询
       </view>
-      <view>
-        请联系企业管理员授权开通使用
+      <view a:else>
+        请联系创始人“{{creatorName}}”为您【启用积分管理】,如需咨询客服,请到您企业专属的功道云服务群咨询
       </view>
   </view>
 </view>

+ 9 - 2
pages/workbench/noJurisdiction/noJurisdiction.js

@@ -1,4 +1,11 @@
+var app = getApp()
+var that;
 Page({
-  data: {},
-  onLoad() {},
+  data: {
+    isCreator: false,
+    creatorName:'',
+  },
+  onLoad() {
+      this.setData({isCreator: app.globalData.isCreator,creatorName:app.globalData.corpMessage.creators})
+  },
 });

+ 1 - 0
utils/util.js

@@ -11,6 +11,7 @@ const formatTime = (date) => {
     year:year,
     month:[year, month].map(formatNumber).join('-'),
     day:[year, month, day].map(formatNumber).join('-'),
+    month_tow:month
   }
 }