Browse Source

共创版本

347617796@qq.com 4 years ago
parent
commit
99d9582fa6
53 changed files with 233 additions and 147 deletions
  1. 1 1
      Component/selectDate/selectDate.axml
  2. 2 0
      Component/selectDate/selectDate.js
  3. 5 5
      Component/selectRule_two/selectRule_two.acss
  4. 16 4
      Component/selectRule_two/selectRule_two.axml
  5. 6 3
      Component/selectRule_two/selectRule_two.js
  6. 8 5
      Component/selectSection/selectSection.acss
  7. 11 1
      Component/selectSection/selectSection.axml
  8. 5 8
      Component/selectSection/selectSection.js
  9. 1 1
      Component/selectSectionStaff/selectSectionStaff.acss
  10. 4 0
      Component/selectSectionStaff/selectSectionStaff.axml
  11. 6 28
      Component/selectSectionStaff_tow/selectSectionStaff_tow.acss
  12. 2 2
      Component/selectSectionStaff_tow/selectSectionStaff_tow.axml
  13. 29 0
      app.acss
  14. 12 4
      app.js
  15. 3 3
      app.json
  16. BIN
      image/activeSet.png
  17. BIN
      image/my.png
  18. BIN
      image/select_my.png
  19. BIN
      image/set.png
  20. 1 1
      pages/deploy/index/index.axml
  21. 1 1
      pages/deploy/organization/organization.axml
  22. 3 5
      pages/deploy/organization/organization.js
  23. 3 3
      pages/deploy/setCheck/setCheck.axml
  24. 5 7
      pages/statistics/addCustom/addCustom.acss
  25. 3 2
      pages/statistics/addCustom/addCustom.axml
  26. 13 0
      pages/statistics/addCustom/addCustom.js
  27. 1 1
      pages/statistics/check_top/check_top.axml
  28. 7 7
      pages/statistics/check_top/check_top.js
  29. 4 2
      pages/statistics/customRamking/customRamking.acss
  30. 1 1
      pages/statistics/customRamking/customRamking.axml
  31. 1 0
      pages/statistics/customRamking/customRamking.js
  32. 1 1
      pages/statistics/glz_execute/glz_execute.axml
  33. 2 2
      pages/statistics/index/index.axml
  34. 3 3
      pages/statistics/index/index.js
  35. 0 4
      pages/statistics/integralEvent/integralEvent.acss
  36. 1 1
      pages/statistics/integralEvent/integralEvent.axml
  37. 2 2
      pages/statistics/my_PrizeBuckle/my_PrizeBuckle.axml
  38. 1 1
      pages/statistics/sectionRanking/sectionRanking.axml
  39. 7 1
      pages/workbench/apply/apply.js
  40. 2 2
      pages/workbench/approve/approve.axml
  41. 17 4
      pages/workbench/approve/approve.js
  42. 3 2
      pages/workbench/approveDetail/approveDetail.acss
  43. 1 1
      pages/workbench/approveDetail/approveDetail.axml
  44. 4 1
      pages/workbench/approveDetail/approveDetail.js
  45. 1 1
      pages/workbench/index/index.acss
  46. 3 3
      pages/workbench/index/index.axml
  47. 3 0
      pages/workbench/index/index.js
  48. 3 2
      pages/workbench/my_approve/my_approve.acss
  49. 1 1
      pages/workbench/my_approve/my_approve.axml
  50. 3 0
      pages/workbench/my_approve/my_approve.js
  51. 2 2
      pages/workbench/noJurisdiction/noJurisdiction.axml
  52. 6 6
      pages/workbench/statistics_B/statistics_B.axml
  53. 13 12
      pages/workbench/statistics_B/statistics_B.js

+ 1 - 1
Component/selectDate/selectDate.axml

@@ -3,7 +3,7 @@
   <view class="date-header {{isShow?'showPop':''}}" >
     <view class="flex-box selectDateType">
       <view data-index="1" class="{{dateIndex == 1 ? 'dateActive':''}} flex-1" catchTap="activeDate">月</view>
-      <view data-index="2" class="{{dateIndex == 2 ? 'dateActive':''}} flex-1" catchTap="activeDate">日</view>
+      <view a:if="{{notDate}}" data-index="2" class="{{dateIndex == 2 ? 'dateActive':''}} flex-1" catchTap="activeDate">日</view>
     </view>
     <view class="data-main">
         <block a:if="{{dateIndex==1}}">

+ 2 - 0
Component/selectDate/selectDate.js

@@ -7,11 +7,13 @@ Component({
     month: app.globalData.month,//月
     startDay: app.globalData.day,
     endDay: app.globalData.day,
+    
   },
   props: {
     onClose: (data) => console.log(data),
     onConfirm:(data) => console.log(data),
     defaultDate:{type:"1",date:app.globalData.month},
+    notDate:true,
   },
   didMount() {
     if(this.props.defaultDate.type==1){

+ 5 - 5
Component/selectRule_two/selectRule_two.acss

@@ -82,16 +82,15 @@
   margin-left: 10rpx;
 }
 .ul{
-  width: 100%;
   background-color: #fff;
   height: 500rpx;
-  box-sizing: border-box;
 }
-.li{
-    padding: 24rpx;
+.li2{
+    height: 100rpx;
     border-bottom: 1px solid #f1f1f1;
 }
-.ul .li .xia{
+.ul .li2 .xia{
+  padding-right: 24rpx;
   color: #26A2FF !important;
 }
 .shu{
@@ -104,3 +103,4 @@
 .shu view:last-child{
   color: #ccc;
 }
+

+ 16 - 4
Component/selectRule_two/selectRule_two.axml

@@ -7,16 +7,28 @@
           <image mode="scaleToFill" src="../../../image/right.png" style="width:20rpx;height:20rpx;margin:0 6rpx;" a:if="{{index!=0}}"/> {{item.name}}
         </view>
       </view>
+
       <scroll-view class="ul" scroll-y="{{true}}">
+          <view class="flex-box flex-v-ce li2" a:for="{{rule_tree}}">
+            <view  class="{{item.id==activeId? 'active':''}} flex-box flex-v-ce flex-1"  data-item="{{item}}"   catchTap="radioChange">
+              <view class="radio_"></view>
+              <view class="font-flex-word">{{item.name}}</view>
+            </view>
+            <view class="xia" data-item="{{item}}" catchTap="openDown" a:if="{{item.child.length>0}}">| 下级</view>
+          </view>
+      </scroll-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}}">
+          <view class="flex-box flex-v-ce li" a:for="{{rule_tree}}" a:key="{{item.id}}">
             <label class="flex-box flex-v-ce" style="width:88%;height:56rpx">
-              <radio value="{{item}}" name="{{item.id}}"/>
-              <view class="font-flex-word" style="margin-left:10rpx;width:90%">{{item.name}}</view></label>
+              <radio checked="{{item.checked}}" value="{{item}}" name="{{item.id}}"/>
+              <view class="font-flex-word" style="margin-left:10rpx;width:90%">{{item.name}}</view>
+            </label>
             <view class="xia" data-item="{{item}}" catchTap="openDown" a:if="{{item.child.length>0}}">| 下级</view>
           </view>
         </radio-group>
-      </scroll-view>
+      </scroll-view> -->
     </view>
     <view class="flex-box date-btn">
       <view class="flex-1" catchTap="onClose">取消</view>

+ 6 - 3
Component/selectRule_two/selectRule_two.js

@@ -8,7 +8,8 @@ Component({
     terr: [
       { name: '全部', id: 0 }
     ],
-    rule_tree: []
+    rule_tree: [],
+    activeId:'',
   },
   props: {
     onConfirm: (data) => console.log(data),
@@ -19,6 +20,7 @@ Component({
     that = this;
     this.setData({
       isShow: this.props.isShow,
+      activeId:this.props.defaultSection,
       terr: [{ name: '全部', id: 0 }],
       selectTissue: { name: '全部分类', id: '' }
     })
@@ -57,7 +59,6 @@ Component({
       var item = e.target.dataset.item;
       var terr = this.data.terr;
       terr.push(item);
-      console.log(item.child);
       that.setData({
         rule_tree: item.child,
         terr: terr
@@ -65,7 +66,8 @@ Component({
     },
     radioChange: function (e) {
       this.setData({
-        selectTissue: e.detail.value
+        selectTissue: e.target.dataset.item,
+        activeId:e.target.dataset.item.id
       })
     },
     getData() {
@@ -82,6 +84,7 @@ Component({
         })
       })
     },
+    
     //关闭
     onClose(e) {
       this.props.onClose();

+ 8 - 5
Component/selectSection/selectSection.acss

@@ -82,18 +82,18 @@
   margin-left: 10rpx;
 }
 .ul{
-  width: 100%;
   background-color: #fff;
   height: 500rpx;
-  box-sizing: border-box;
 }
-.li{
-    padding: 24rpx;
+.li2{
+    height: 100rpx;
     border-bottom: 1px solid #f1f1f1;
 }
-.ul .li .xia{
+.ul .li2 .xia{
   color: #26A2FF !important;
+  padding-right: 24rpx
 }
+
 .shu{
   padding: 14rpx 24rpx;
   background: #fff;
@@ -104,3 +104,6 @@
 .shu view:last-child{
   color: #ccc;
 }
+.images{
+  width:50rpx;height:50rpx; margin:0 10rpx
+}

+ 11 - 1
Component/selectSection/selectSection.axml

@@ -9,6 +9,16 @@
         </view>
       </view>
       <scroll-view class="ul" scroll-y="{{true}}">
+          <view class="flex-box flex-v-ce li2" a:for="{{rule_tree}}" a:key="{{index}}">
+            <view  class="{{item.id==activeId? 'active':''}} flex-box flex-v-ce flex-1"  data-item="{{item}}"   catchTap="radioChange">
+              <view class="radio_"></view>
+              <image  class="images" src="../../../image/BM.png"/>
+              <view class="font-flex-word">{{item.name}}</view>
+            </view>
+            <view class="xia" data-item="{{item}}" catchTap="openDown" a:if="{{item._child.length>0}}">| 下级</view>
+          </view>
+      </scroll-view>
+      <!-- <scroll-view class="ul" scroll-y="{{true}}">
         <radio-group class="radio-group" onChange="radioChange">
           <view class="flex-box flex-v-ce li" a:for="{{rule_tree}}">
             <label class="flex-box flex-v-ce flex-1">
@@ -17,7 +27,7 @@
             <view class="xia" data-item="{{item}}" catchTap="openDown" a:if="{{item._child.length>0}}">| 下级</view>
           </view>
         </radio-group>
-      </scroll-view>
+      </scroll-view> -->
     </view>
     <view class="flex-box date-btn">
       <view class="flex-1" catchTap="onClose">取消</view>

+ 5 - 8
Component/selectSection/selectSection.js

@@ -8,7 +8,8 @@ Component({
     terr:[
       {name: '全部', id:0}
     ],
-    rule_tree: []
+    rule_tree: [],
+    activeId:'',
   },
   props: {
     onConfirm: (data) => console.log(data),
@@ -19,6 +20,7 @@ Component({
     that = this;
     this.setData({
       isShow:this.props.isShow,
+      activeId:this.props.defaultSection,
       terr:[{name: '全部', id:0}],
       selectTissue:{name:'全公司',id:''}
     })
@@ -75,7 +77,8 @@ Component({
     },
     radioChange: function(e) {
         this.setData({
-          selectTissue:e.detail.value
+          selectTissue:e.target.dataset.item,
+          activeId:e.target.dataset.item.id,
         })
     },
     //获取部门列表
@@ -86,12 +89,6 @@ Component({
           name:'全公司',
           id:''
         })
-        list.map(item=>{
-          item.checked=false;
-          if(item.id==this.props.defaultSection){
-            item.checked=true;
-          }
-        })
         this.setData({
           rule_tree: list,
           all_rule_list:list,

+ 1 - 1
Component/selectSectionStaff/selectSectionStaff.acss

@@ -89,7 +89,7 @@
   height: calc(100vh - 390rpx);
 }
 .userItem{
-    padding:14rpx 32rpx;
+    padding:14rpx 24rpx;
     border-bottom: 1px solid #f1f1f1;
 }
 .staff-ul .userItem .xia{

+ 4 - 0
Component/selectSectionStaff/selectSectionStaff.axml

@@ -58,6 +58,10 @@
         <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>
+      <view a:for="{{selectUserId}}" style="margin-right:10rpx;">
+        <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>
     </view>
     <view class="staffBtn" onTap="onConfirm">确定</view>
   </view>

+ 6 - 28
Component/selectSectionStaff_tow/selectSectionStaff_tow.acss

@@ -58,16 +58,14 @@
   display: inline-block;
 }
 
-.ul2{
-  width: 100%;
-  background-color: #fff;
-  box-sizing: border-box;
-}
+
 .li{
     padding:20rpx 24rpx;
     border-bottom: 1px solid #f1f1f1;
 }
-.ul2 .li .xia{
+
+.ul .li .xia{
+  padding-right: 24rpx;
   color: #26A2FF !important;
 }
 .shu{
@@ -89,7 +87,7 @@
   height: calc(100vh - 390rpx);
 }
 .userItem{
-    padding:14rpx 32rpx;
+    padding:14rpx 24rpx;
     border-bottom: 1px solid #f1f1f1;
 }
 .staff-ul .userItem .xia{
@@ -134,6 +132,7 @@
     padding: 0 40rpx;
 }
 .f-left{
+  margin-right:10rpx; 
   overflow-x: auto;
 }
 .rule-all-text{
@@ -147,27 +146,6 @@
   background: rgba(245, 247, 250, 1);
   padding: 16rpx 32rpx;
 }
-.radio_{
-  width: 40rpx;
-  height: 40rpx;
-  border: 1px solid #ccc;
-  border-radius: 100%;
-  background: #fff;
-  text-align: center;
-  box-sizing: border-box;
-  line-height: 36rpx;
-}
-.active .radio_{
-  border: 1px solid #26A2FF;
-}
-.active .radio_ text{
-    width: 20rpx;
-    height: 20rpx;
-    border-radius: 50rpx;
-    background: #26A2FF;
-    display: inline-block;
-    box-sizing: border-box;
-}
 .img_name_box{
     width: 70rpx;
     height: 70rpx;

+ 2 - 2
Component/selectSectionStaff_tow/selectSectionStaff_tow.axml

@@ -24,7 +24,7 @@
           <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>
-            <view class="radio_"><text a:if="{{item.checked}}"></text></view>
+            <view class="radio_"></view>
           </view>
         </view>
         <view a:if="{{userList.length==0}}">
@@ -44,7 +44,7 @@
   </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;" a:key="{{index}}">
+      <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> -->

+ 29 - 0
app.acss

@@ -4,6 +4,8 @@
 		background: rgba(245, 247, 250, 1);
 		height: 100%;
 		width: 100%;
+		margin: 0;
+		padding: 0;
 	}
 
 	view, text {
@@ -222,6 +224,33 @@
 		color: #909399
 	}
 
+
+.radio_{
+  width: 40rpx !important;
+  height: 40rpx !important;
+  border: 1px solid #ccc;
+  border-radius: 50% !important;
+  background: #fff;
+	position: relative;
+	margin: 0 20rpx 0 24rpx;
+}
+.active .radio_{
+  border: 1px solid #26A2FF;
+}
+.active .radio_::before{
+		content:'';
+    width: 20rpx !important;
+    height: 20rpx !important;
+    border-radius: 50% !important;
+    background: #26A2FF;
+		position: absolute;
+		display: block;
+		top: 50%;
+		left: 50%;
+		margin-top: -10rpx;
+		margin-left: -9.5rpx;
+}
+
 	/* 盒子模型 */
 
 	.flex-box {

+ 12 - 4
app.js

@@ -25,6 +25,7 @@ App({
     imgHttpUrl:'https://intesys.cms.g107.com/integral.php/Api/get_signature',
     corpId:'',
     yearArr:yearArr,
+    isAdministrator:false,//是否管理员
   },
   //获取积分类型
   getTypes(callBack) {
@@ -136,14 +137,21 @@ App({
           if (res.data.code == 1) {
             var { token, user } = res.data.data;
             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;
+                  }
+              });
               that.globalData.token = token;
               that.globalData.userData = user;
-             callBack(true);
+              callBack(true);
             }else{
-             callBack(false);
+              callBack(false);
             }
-          } else {
-            that.globalData.showToast(res.msg)
+          }else if(res.data.code == 3000){
+            that.globalData.showToast("员工信息同步中,请稍后进入")
+          }else{
+              that.globalData.showToast(res.msg)
           }
         }).catch(err=>{
           console.log(err);

+ 3 - 3
app.json

@@ -57,9 +57,9 @@
       },
       {
         "pagePath": "pages/deploy/index/index",
-        "name": "设置",
-        "icon": "image/set.png",
-        "activeIcon": "image/activeSet.png"
+        "name": "我的",
+        "icon": "image/my.png",
+        "activeIcon": "image/select_my.png"
       }
     ]
   }

BIN
image/activeSet.png


BIN
image/my.png


BIN
image/select_my.png


BIN
image/set.png


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

@@ -24,7 +24,7 @@
       <view class="flex-box flex-v-ce li margin-bottom" data-index="2" onTap="openView">
         <image class="img-left" mode="scaleToFill" src="../../../image/bmyg.png"></image>
         <view class="flex-box flex-v-ce flex-1 li-right">
-          <view class="title flex-1">部门/员工</view>
+          <view class="title flex-1">组织架构</view>
           <image mode="scaleToFill" src="../../../image/right.png" class="img-right"></image>
         </view>
       </view>

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

@@ -15,7 +15,7 @@
       <image mode="scaleToFill" src="../../../image/right.png" style="width:20rpx;height:20rpx;margin:0 6rpx;" a:if="{{index!=0}}"/>{{item.name}}
     </view>
   </view>
-  <scroll-view a:if="{{isItem}}" class="main" scroll-y="{{true}}" style="{{terr.length>1? 'height: calc(100vh - 452rpx)':'height: calc(100vh - 388rpx)'}}">
+  <scroll-view a:if="{{isItem}}" class="main" scroll-y="{{true}}" style="{{terr.length>1? 'height: calc(100vh - 472rpx)':'height: calc(100vh - 408rpx)'}}">
     <view class="flex-box flex-v-ce li" a:for="{{rule_tree}}" catchTap="activeTree" data-item="{{item}}">
       <view class="img-left">
         <image mode="scaleToFill" src="../../../image/BM.png"></image></view>

+ 3 - 5
pages/deploy/organization/organization.js

@@ -22,16 +22,14 @@ Page({
   tbDd() {
     dd.confirm({
       title: '温馨提示',
-      content: '下次同步时间需在两小时之后,是否同步',
+      content: '下次同步时间需在10分钟之后,是否同步',
       confirmButtonText: '确定',
       cancelButtonText: '取消',
       success: (result) => {
         if (result.confirm) {
           var http1 = app.$post("api/ding/employee_sync", {});
-          var http2 = app.$post("api/ding/department_sync", {});
-          Promise.all([http1, http2]).then((item) => {
-            app.globalData.showToast("已同步");
-            console.log(item);
+          Promise.all([http1]).then((item) => {
+            app.globalData.showToast(item[0].data.msg);
           })
         }
       },

+ 3 - 3
pages/deploy/setCheck/setCheck.axml

@@ -1,5 +1,5 @@
 <view>
-  <view class="yellow">以下分数皆为B分,请前往PC钉钉设置</view>
+  <view class="yellow">以下分数皆为B分,请前往电脑端(PC钉钉设置</view>
   <view class="ul margin-bottom">
     <view class="flex-box li">
       <view class="li-left">
@@ -41,7 +41,7 @@
       </view>
     </view>
   </view>
-  <view class="ul margin-bottom">
+  <!-- <view class="ul margin-bottom">
     <view class="flex-box li">
       <view class="li-left">
         <view>加班</view>
@@ -54,5 +54,5 @@
         <view>每小时扣{{data.leave_per_hour}}分</view>
       </view>
     </view>
-  </view>
+  </view> -->
 </view>

+ 5 - 7
pages/statistics/addCustom/addCustom.acss

@@ -53,20 +53,18 @@
 .footer .delete {
   background: #fff;
   border: 1px solid #f1f1f1;
-  height: 88rpx;
+  height: 90rpx;
   text-align: center;
-  line-height: 88rpx;
+  line-height: 90rpx;
   margin-right: 10rpx;
   border-radius: 6rpx;
 }
 
 .footer .save {
-  border-radius: 6rpx;
-  background: #26A2FF;
-  color: #fff;
-  height: 88rpx;
+  border-radius: 10rpx;
+  height: 90rpx;
   text-align: center;
-  line-height: 88rpx;
+  line-height: 90rpx;
 }
 
 .scroll {

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

@@ -27,9 +27,10 @@
   <view class="footer flex-box flex-v-ce">
     <block a:if="{{isbj}}">
       <view onTap="delete" class="flex-1 delete">删除</view>
-      <view onTap="compile" class=" flex-2 save">保存</view>
+      <button type="default" loading="{{disabled}}"  class="flex-2 defBtn save " disabled="{{disabled}}" onTap="compile">保存</button>
+      <!-- <view onTap="compile" class=" flex-2 save">保存</view> -->
     </block>
-    <view onTap="save" class=" flex-2 save" a:else>保存</view>
+    <button type="default" loading="{{disabled}}" a:else class="flex-2 defBtn save" disabled="{{disabled}}" onTap="save">保存</button>
   </view>
   <view class="box" animation="{{animationInfo}}" a:if="{{isbj}}">
     <select-section-staff isBoss="{{true}}" onClose="onClose" selectUser="{{selectUser}}" a:if="{{selectUser.length>0}}" onConfirm="onSelectUser"/>

+ 13 - 0
pages/statistics/addCustom/addCustom.js

@@ -8,6 +8,7 @@ Page({
     title: '',
     id: '',
     isCompile: true,
+    disabled:false,
   },
   onLoad(e) {
     that = this;
@@ -69,13 +70,17 @@ Page({
       group_name: this.data.title,
       employees: arr.join(',')
     }
+    this.setData({ disabled: true });
     app.$post("api/integral/statistics/groups", data).then((res) => {
       app.globalData.showToast("保存成功");
       setTimeout(() => {
+        this.setData({ disabled: false });
         dd.navigateBack({
           delta: 1
         })
       }, 1000);
+    }).catch(err => {
+        this.setData({ disabled: false });
     })
   },
   //保存
@@ -84,6 +89,10 @@ Page({
       app.globalData.showToast("请输入分组名称");
       return;
     }
+    if (this.data.selectUser.length==0) {
+      app.globalData.showToast("请选择员工");
+      return;
+    }
     var arr = [];
     this.data.selectUser.forEach(element => {
       arr.push(element.id);
@@ -92,13 +101,17 @@ Page({
       group_name: this.data.title,
       employees: arr.join(',')
     }
+    this.setData({ disabled: true });
     app.$post("api/integral/statistics/groups/create", data).then((res) => {
       app.globalData.showToast("新建分组成功");
       setTimeout(() => {
+        this.setData({ disabled: false });
         dd.navigateBack({
           delta: 1
         })
       }, 1000);
+    }).catch(err => {
+        this.setData({ disabled: false });
     })
   },
   //删除

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

@@ -41,5 +41,5 @@
     </scroll-view>
     <no-data a:if="{{list.length==0}}"></no-data>
   </view>
-  <select-date defaultDate="{{defaultDate}}" isShow="{{showDate}}" a:if="{{showDate==true}}" onClose="onClose" onConfirm="onConfirmDate"></select-date>
+  <select-date notDate="{{false}}" defaultDate="{{defaultDate}}" isShow="{{showDate}}" a:if="{{showDate==true}}" onClose="onClose" onConfirm="onConfirmDate"></select-date>
 </view>

+ 7 - 7
pages/statistics/check_top/check_top.js

@@ -7,13 +7,13 @@ Page({
     minuteIndex: 0,//条件选择
     minuteArray: [
       { id: 1, name: '总分' },
-      { id: 2, name: '早到' },
-      { id: 3, name: '迟到' },
-      { id: 4, name: '加班' },
-      { id: 5, name: '请假' },
-      { id: 8, name: '早退' },
-      { id: 9, name: '缺卡' },
-      { id: 10, name: '缺勤' },
+      // { id: 2, name: '早退' },
+      // { id: 3, name: '迟到' },
+      // { id: 4, name: '加班' },
+      // { id: 5, name: '请假' },
+      // { id: 8, name: '早退' },
+      // { id: 9, name: '缺卡' },
+      // { id: 10, name: '缺勤' },
     ],
     showDate: false,//是否显示时间组件
     selectDateVal: '本月',

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

@@ -62,8 +62,10 @@
 .addBtn {
   background: #26A2FF;
   color: #fff;
-  border-radius: 6rpx;
-  padding: 20rpx 0;
+  margin: 0 auto;
+  border-radius: 10rpx;
+  height: 90rpx;
+  line-height: 90rpx;
 }
 .gs{
   background-color: #FFFBE8;

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

@@ -32,7 +32,7 @@
         <view>暂无分组</view>
         <view>通过分组你可针对性的查看对应人员的B分排名</view>
       </view>
-      <view class="addBtn" onTap="openAdd">新建分组</view>
+      <button type="default" onTap="openAdd" class="addBtn">新建分组</button>
     </view>
   </view>
 </view>

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

@@ -5,6 +5,7 @@ Page({
   data: {
     // dataList:[],
     isShowGs:true,
+    disabled:false,
   },
   onLoad() {
     that = this;

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

@@ -13,7 +13,7 @@
     </view>
   </view>
   <view class="flex-box flex-v-ce titles">
-    <view class="flex-2">管理者</view>
+    <view class="flex-2" style="font-size:28rpx">管理者</view>
     <view class="flex-1">人均奖分(次)</view>
     <view class="flex-1">人均扣分(次)</view>
   </view>

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

@@ -1,6 +1,6 @@
 <view>
   <view class="header">
-    <view class="flex-box flex-v-ce li" data-index="1" onTap="openView">
+    <view class="flex-box flex-v-ce li" data-index="1" onTap="openView"  a:if="{{isAdministrator}}">
       <image class="img-left" mode="scaleToFill" src="../../../image/jk.png"></image>
       <view class="flex-box flex-v-ce flex-1 li-right border-bottom">
         <view class="title flex-1">我奖扣的</view>
@@ -14,7 +14,7 @@
         <image mode="scaleToFill" src="../../../image/right.png" class="img-right"></image>
       </view>
     </view>
-    <view class="flex-box flex-v-ce li" data-index="3" onTap="openView">
+    <view class="flex-box flex-v-ce li" data-index="3" onTap="openView"  a:if="{{isAdministrator}}">
       <image class="img-left" mode="scaleToFill" src="../../../image/glz.png"></image>
       <view class="flex-box flex-v-ce flex-1 li-right border-bottom">
         <view class="title flex-1">管理者奖扣</view>

+ 3 - 3
pages/statistics/index/index.js

@@ -3,12 +3,12 @@ var that;
 Page({
   data: {
     incidentList: [1, 2, 2, 2, 2, 2, 2, 2, 2],
-
+    isAdministrator:false,//是否管理员角色
   },
   onLoad(query) {
     that = this;
-    dd.setNavigationBar({ title: "统计" });
-
+    this.setData({isAdministrator:app.globalData.isAdministrator})
+    dd.setNavigationBar({ title: "统计"});
   },
   //跳转
   openView(e) {

+ 0 - 4
pages/statistics/integralEvent/integralEvent.acss

@@ -49,7 +49,3 @@
 .scroll {
    height: calc(100vh - 100rpx);
 }
-.da{
-  font-size: 44rpx;
-  font-weight: 600;
-}

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

@@ -38,5 +38,5 @@
   </view>
   <select-staff defaultUser="{{employee_ids}}" isShow="{{showStaff}}" a:if="{{showStaff==true}}" onClose="onClose" onConfirm="onConfirmStaff"></select-staff>
   <select-date defaultDate="{{defaultDate}}" isShow="{{showDate}}" a:if="{{showDate==true}}" onClose="onClose" onConfirm="onConfirmDate"></select-date>
-  <select-rule-two isShow="{{showRuleTwo}}" a:if="{{showRuleTwo==true}}" onClose="onClose" onConfirm="onConfirmRule"></select-rule-two>
+  <select-rule-two defaultSection="{{rule_id}}" isShow="{{showRuleTwo}}" a:if="{{showRuleTwo==true}}" onClose="onClose" onConfirm="onConfirmRule"></select-rule-two>
 </view>

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

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

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

@@ -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 a:if="{{showRuleTwo==true}}" isShow="{{showRuleTwo}}" onClose="onClose" onConfirm="onConfirmRule"></select-rule-two> -->
 </view>

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

@@ -77,7 +77,7 @@ Page({
   },
   //选择规则
   openSelect(e) {
-    if (e.target.dataset.item.id) {
+    if (e.target.dataset.item) {
       that.setData({ reviewerObj: [e.target.dataset.item] });
     }
     that.setData({ activeIndex: '' });
@@ -198,6 +198,11 @@ Page({
         isTg = false;
         break;
       }
+      if (!item.reviewer_id) {
+        app.globalData.showToast(`第${i + 1}项申请审批人不能为空`);
+        isTg = false;
+        break;
+      }
       obj.employee_id = app.globalData.userData.id;
       if (item.checked) {
         obj.rule_id = item.selectRule ? item.selectRule.rule_id : 0;
@@ -213,6 +218,7 @@ Page({
           break;
         }
       }
+
       obj.remark = item.remark;
       obj.event_time = item.event_time;
       obj.reviewer_id = item.reviewer_id;

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

@@ -238,8 +238,8 @@
     <button type="default" loading="{{disabled}}" class="defBtn" disabled="{{disabled}}" catchTap="formSubmit">提交</button>
   </view>
   <view class="box" animation="{{animationInfo}}">
-    <select-rule  defaultId="{{defaultRuleId}}" onConfirm="onSelectItem" onClose="onClose" a:if="{{isShowType=='1'}}"/>
-    <select-type  defaultId="{{defaultRuleId}}" onConfirm="onSelectType" onClose="onClose" a:if="{{isShowType=='2'}}"/>
+    <select-rule  defaultId="{{defaultRuleId}}" isGzType="{{isGzType}}" onConfirm="onSelectItem" onClose="onClose" a:if="{{isShowType=='1'}}"/>
+    <select-type  defaultId="{{defaultRuleId}}" isGzType="{{isGzType}}" onConfirm="onSelectType" onClose="onClose" a:if="{{isShowType=='2'}}"/>
     <select-section-staff-two onClose="onClose" selectUser="{{reviewerObj}}" onConfirm="onSelectUser" a:if="{{isShowType=='3'}}"/>
   </view>
 </view>

+ 17 - 4
pages/workbench/approve/approve.js

@@ -26,8 +26,9 @@ Page({
       name:'',
     },
     animationInfo: '',
-    isShowType: true,//是显示选择规则还是显示选择分类
+    isShowType: "1",//是显示选择规则还是显示选择分类
     isData: false,
+    isGzType:'BF',
   },
   onLoad(e) {
     that = this;
@@ -74,6 +75,7 @@ Page({
   //提交
   formSubmit() {
     var item = that.data.item;
+    console.log(item);
     var data, point;
     var num = item.checked ? item.point : item.point2
     if (item.checked) {
@@ -90,10 +92,19 @@ Page({
         this.showToast("积分不能为0或空")
         return;
       }
-      if (point < item.selectRule.min_point || point > item.selectRule.max_point) {
-        this.showToast(`积分超出可输入范围`);
-        return;
+      if(item.selectRule.range_type==1&&item.selectRule.min_point==item.selectRule.max_point){
+          if (point < item.selectRule.min_point || point > item.selectRule.max_point) {
+            this.showToast(`系统发现此条积分规则制度有变动,请驳回后让员工按最新的规则重新申请`);
+            return;
+          }
+      }else{
+          if (point < item.selectRule.min_point || point > item.selectRule.max_point) {
+            this.showToast(`积分超出可输入范围`);
+            return;
+          }
       }
+
+
     } else {
       if (!item.rule_id2) {
         this.showToast("请选择所属分类")
@@ -214,6 +225,7 @@ Page({
     var getPoint = 0;//积分1017 1030 1006 992 985 1389
     app.$get("api/integral/review", { review_id: id }).then((res) => {
       var data = res.data.data;
+
       if (data.point) {
         if (data.point < 0) {
           var min = data.point.toString();
@@ -249,6 +261,7 @@ Page({
         selectRule = '';
       }
       that.setData({
+        isGzType:data.pt_code,
         isData: isData,
         ['item.pid']: data.pid==0 ? false:true,
         ['item.review_id']: data.id,

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

@@ -107,10 +107,11 @@
   padding: 28rpx 0;
   border-right: 1px solid #f1f1f1;
 }
-.windows-btn view:nth-child(2){
+.windows-btn button{
   text-align: center;
-  padding: 28rpx 0;
   color: #26A2FF;
+  background: #fff;
+  border: none;
 }
 .windows-content textarea{
   height: 150rpx;

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

@@ -90,7 +90,7 @@
       </view>
       <view class="windows-btn flex-box flex-v-ce">
         <view class="flex-1" catchTap="openBh">取消</view>
-        <view class="flex-1" catchTap="confirmBh">确定</view>
+        <button type="default" loading="{{disabled}}" class="flex-1" disabled="{{disabled}}" catchTap="confirmBh">确定</button>
       </view>
     </view>
   </view>

+ 4 - 1
pages/workbench/approveDetail/approveDetail.js

@@ -5,7 +5,8 @@ Page({
   data: {
     review_id: '',
     isBh: false,//是否显示驳回弹窗
-    textArea: ""
+    textArea: "",
+     disabled: false,
   },
   onLoad(e) {
     that = this;
@@ -45,8 +46,10 @@ Page({
       app.globalData.showToast("请输入审批意见");
       return;
     }
+     this.setData({disabled:true});
     app.$post("api/integral/review", { review_id: that.data.review_id, remark: that.data.textArea, action: "refuse", ticket_count: 0 }).then((res) => {
       app.globalData.showToast("已驳回");
+      that.setData({disabled:false});
       var pages=getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
       var active=pages[pages.length-2];
       if(active.data.page!=1){

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

@@ -122,7 +122,7 @@
 .num{
   color: #F56C6C;
   margin-right: 28rpx;
-  font-size: 44rpx;
+  font-size: 36rpx;
   font-weight: 600
 }
 .text{

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

@@ -12,7 +12,7 @@
   <view class="headed margin-bottom">
     <view class="top"></view>
     <view class="headed-box">
-          <view class="flex-box headed-box-item">
+          <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>
@@ -36,7 +36,7 @@
 
   </view>
   <!-- 奖扣展示 -->
-  <view class="main margin-bottom" a:if="{{userData.task}}">
+  <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>
@@ -74,7 +74,7 @@
   </view>
 
   <view class="bottom margin-bottom">
-     <view class="bottom-title">积分构成</view>
+     <view class="bottom-title">本月B分积分构成</view>
      <view class="f2-chart" a:if="{{pieData.length>0}}">
         <f2 onInit="onInitChart2"></f2>
     </view>

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

@@ -8,6 +8,7 @@ Page({
     isBh: false,
     chartData: [],//折线图数据
     pieData: [1],//饼型图数据
+    isAdministrator:app.globalData.isAdministrator,//是否管理员角色
   },
   onLoad() {
     that = this;
@@ -21,12 +22,14 @@ Page({
       that.getUserData();
       that.getIncidentLsit();
       that.getIncidentNum();
+      that.setData({isAdministrator:app.globalData.isAdministrator})
     } else {
       app.login(app.globalData.corpId, function (is) {
         if (is) {
           that.getUserData();
           that.getIncidentLsit();
           that.getIncidentNum();
+          that.setData({isAdministrator:app.globalData.isAdministrator})
         } else {
           dd.reLaunch({
             url: '../noJurisdiction/noJurisdiction'

+ 3 - 2
pages/workbench/my_approve/my_approve.acss

@@ -123,10 +123,11 @@
   padding: 28rpx 0;
   border-right: 1px solid #f1f1f1;
 }
-.windows-btn view:nth-child(2){
+.windows-btn button{
   text-align: center;
-  padding: 28rpx 0;
   color: #26A2FF;
+  background: #fff;
+  border: none;
 }
 .windows-content textarea{
   height: 150rpx;

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

@@ -69,7 +69,7 @@
       </view>
       <view class="windows-btn flex-box flex-v-ce">
         <view class="flex-1" catchTap="closeBh">取消</view>
-        <view class="flex-1" catchTap="confirmBh">确定</view>
+        <button type="default" loading="{{disabled}}" class="flex-1" disabled="{{disabled}}" catchTap="confirmBh">确定</button>
       </view>
     </view>
   </view>

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

@@ -10,6 +10,7 @@ Page({
     page: 1,
     isBh: false,//是否显示驳回弹窗
     textArea: "",
+    disabled: false,
   },
   onLoad() {
     that = this;
@@ -49,9 +50,11 @@ Page({
       app.globalData.showToast("请输入审批意见");
       return;
     }
+    this.setData({disabled:true});
     app.$post("api/integral/review", { review_id: item.id, remark: that.data.textArea, action: "refuse", ticket_count: 0 }).then((res) => {
       that.closeBh()
       app.globalData.showToast("已驳回");
+      that.setData({disabled:false});
       that.refreshData(item.id);
     })
   },

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

@@ -1,10 +1,10 @@
 <view>
   <view class="noJ">
       <view>
-        您当前无权限进入系统,请联系企业
+        您当前未启用积分管理,无权限进入应用
       </view>
       <view>
-        管理员授权开通使用
+        请联系企业管理员授权开通使用
       </view>
   </view>
 </view>

+ 6 - 6
pages/workbench/statistics_B/statistics_B.axml

@@ -27,21 +27,21 @@
         </view>
     </view>
   </view>
-  <view class="main margin-bottom">
+  <!-- <view class="main margin-bottom">
      <view class="title">积分构成</view>
      <view class="f2-chart" a:if="{{pieData.length>0}}">
         <f2 onInit="onInitChart2"></f2>
     </view>
     <no-data a:if="{{pieData.length==0}}" content="无数据" />
-  </view>
+  </view> -->
   <view class="main margin-bottom">
       <view class="flex-box">
          <view class="title flex-1">奖分最多</view>
          <view class="gengduo" catchTap="openMore">更多<image mode="scaleToFill"  src="../../../image/right.png"/></view>
       </view>
       <view>
-          <view class="flex-box list" a:for="{{data_good}}">
-            <block a:if="{{index<=4}}">
+          <view class="flex-box list" a:for="{{data_good}}" a:if="{{index<=4}}">
+            <block>
               <view class="text flex-1" a:if="{{item.remark.customize}}">{{item.remark.customize}}</view>
               <view class="text flex-1" a:else>{{item.remark.rule}}</view>
               <view class="num red" a:if="{{item.point>0}}">+{{item.point}}</view>
@@ -57,8 +57,8 @@
          <view class="gengduo" catchTap="openMore">更多<image mode="scaleToFill" src="../../../image/right.png"/></view>
       </view>
       <view>
-          <view class="flex-box list" a:for="{{data_bad}}">
-            <block a:if="{{index<=4}}">
+          <view class="flex-box list" a:for="{{data_bad}}"  a:if="{{index<=4}}">
+            <block>
               <view class="text flex-1" a:if="{{item.remark.customize}}">{{item.remark.customize}}</view>
               <view class="text flex-1" a:else>{{item.remark.rule}}</view>
               <view class="num red" a:if="{{item.point>0}}">+{{item.point}}</view>

+ 13 - 12
pages/workbench/statistics_B/statistics_B.js

@@ -45,6 +45,7 @@ Page({
       stroke: '#fff',
       lineWidth: 1
     });
+    that.getIncidentLsit();
     chart1.render();
     return chart1;
   },
@@ -151,18 +152,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)
     })