Explorar el Código

6.1号 奖票版本

guojy hace 1 año
padre
commit
109e69b4b7
Se han modificado 54 ficheros con 1185 adiciones y 464 borrados
  1. 3 3
      Component/process/process.axml
  2. 20 1
      Component/selectSection/selectSection.js
  3. 2 1
      app.json
  4. BIN
      image/paiming-1.png
  5. BIN
      image/paiming-2.png
  6. BIN
      image/paiming-3.png
  7. 15 11
      pages/exchange/prizeDetail/prizeDetail.js
  8. 1 1
      pages/statistics/C_ranking/C_ranking.axml
  9. 1 1
      pages/statistics/C_ranking/C_ranking.js
  10. 21 12
      pages/statistics/awardDetail/awardDetail.axml
  11. 50 66
      pages/statistics/awardDetail/awardDetail.js
  12. 6 9
      pages/statistics/awardJl/awardJl.axml
  13. 17 14
      pages/statistics/awardJl/awardJl.js
  14. 49 0
      pages/statistics/awardTj/awardTj.acss
  15. 40 0
      pages/statistics/awardTj/awardTj.axml
  16. 125 0
      pages/statistics/awardTj/awardTj.js
  17. 7 0
      pages/statistics/awardTj/awardTj.json
  18. 7 6
      pages/statistics/grantAward/grantAward.axml
  19. 59 14
      pages/statistics/grantAward/grantAward.js
  20. 10 9
      pages/statistics/index/index.js
  21. 2 2
      pages/statistics/integralEvent/integralEvent.axml
  22. 9 9
      pages/statistics/integralEvent/integralEvent.js
  23. 0 40
      pages/statistics/myGrant - 副本/myGrant.axml
  24. 46 10
      pages/statistics/myGrant/myGrant.acss
  25. 22 19
      pages/statistics/myGrant/myGrant.axml
  26. 76 15
      pages/statistics/myGrant/myGrant.js
  27. 10 46
      pages/statistics/myGrant2/myGrant.acss
  28. 35 0
      pages/statistics/myGrant2/myGrant.axml
  29. 4 15
      pages/statistics/myGrant2/myGrant.js
  30. 0 0
      pages/statistics/myGrant2/myGrant.json
  31. 8 0
      pages/statistics/prizeBuckleDetail/prizeBuckleDetail.acss
  32. 24 9
      pages/statistics/prizeBuckleDetail/prizeBuckleDetail.axml
  33. 35 5
      pages/statistics/prizeBuckleDetail/prizeBuckleDetail.js
  34. 2 2
      pages/statistics/repetitive_tasks_detail/repetitive_tasks_detail.axml
  35. 1 1
      pages/statistics/taskDetail/taskDetail.axml
  36. 1 1
      pages/statistics/userRamking/userRamking.js
  37. 7 7
      pages/statistics/workDetail/workDetail.axml
  38. 3 1
      pages/statistics/workDetail/workDetail.js
  39. 9 7
      pages/workbench/approve/approve.axml
  40. 1 5
      pages/workbench/approve/approve.js
  41. 9 4
      pages/workbench/approveDetail/approveDetail.axml
  42. 34 1
      pages/workbench/index/index.acss
  43. 32 8
      pages/workbench/index/index.axml
  44. 189 46
      pages/workbench/index/index.js
  45. 43 2
      pages/workbench/jk_B/jk_B.acss
  46. 16 1
      pages/workbench/jk_B/jk_B.axml
  47. 29 1
      pages/workbench/jk_B/jk_B.js
  48. 2 2
      pages/workbench/my_approve/my_approve.axml
  49. 1 1
      pages/workbench/prize_buckle/prize_buckle.js
  50. 7 0
      pages/workbench/review/review.axml
  51. 6 6
      pages/workbench/statistics_A/statistics_A.axml
  52. 34 10
      pages/workbench/statistics_A/statistics_A.js
  53. 13 19
      pages/workbench/statistics_B/statistics_B.axml
  54. 42 21
      pages/workbench/statistics_B/statistics_B.js

+ 3 - 3
Component/process/process.axml

@@ -11,9 +11,9 @@
         <view class="flex-box flex-v-ce names">
           <text class="process-name">{{item.name}}</text>
           <text class="fontColorB" a:if="{{item.remark == '申请人'||item.remark == '发起'}}">{{item.remark}}</text>
-          <text class="yellow" a:if="{{item.remark == '待审核'}}">{{item.remark}}</text>
-          <text class="green" a:if="{{item.remark == '审通过'}}">{{item.remark}}</text>
-          <text class="red" a:if="{{item.remark == '审驳回'}}">{{item.remark}}</text>
+          <text class="yellow" a:if="{{item.remark == '待审核'}}">待审批</text>
+          <text class="green" a:if="{{item.remark == '审通过'}}">{{item.remark}}</text>
+          <text class="red" a:if="{{item.remark == '审驳回'}}">{{item.remark}}</text>
           <text style="color:#FF9600" class="state" a:if="{{item.remark == '待处理'}}">{{item.remark}}</text>
           <text style="color:#F56C6C" a:if="{{item.remark == '驳回'}}">{{item.remark}}</text>
           <text class="flex-1"></text>

+ 20 - 1
Component/selectSection/selectSection.js

@@ -10,17 +10,21 @@ Component({
     ],
     rule_tree: [],
     activeId:'',
+    ids:[],
   },
   props: {
     onConfirm: (data) => console.log(data),
     onClose:(data) => console.log(data),
     defaultSection:'',
+    isAll:false,
+    selectIds:[],
   },
   didMount() {
     that = this;
     this.setData({
       isShow:this.props.isShow,
       activeId:this.props.defaultSection,
+      ids:this.props.selectIds,
       terr:[{name: '全部', id:0}],
       selectTissue:{name:'全公司',id:''}
     })
@@ -34,7 +38,7 @@ Component({
           app.globalData.showToast("请选择部门");
           return;
         }
-        this.props.onConfirm(this.data.selectTissue);
+        this.props.onConfirm(this.data.selectTissue,this.data.ids);
         this.props.onClose();
     },
     //点击导航栏
@@ -76,11 +80,26 @@ Component({
        }
     },
     radioChange: function(e) {
+      console.log(e.target.dataset.item)
+        let ids=[e.target.dataset.item.id];
+        if(this.props.isAll&&e.target.dataset.item._child){
+          this.returnArr(e.target.dataset.item._child,ids)
+        }
         this.setData({
+          ids:ids,
           selectTissue:e.target.dataset.item,
           activeId:e.target.dataset.item.id,
         })
     },
+    returnArr(child,arr){
+      if(child.length>0){
+        child.forEach(item=>{
+          arr.push(item.id)
+          this.returnArr(item._child,arr)
+        })
+      }
+    },
+
     //获取部门列表
     getBmData() {
       app.$get("api/department/tree", {}).then((res) => {

+ 2 - 1
app.json

@@ -87,7 +87,8 @@
     "pages/statistics/grantAward/grantAward",
     "pages/statistics/awardJl/awardJl",
     "pages/statistics/awardDetail/awardDetail",
-    "pages/arLogin/arLogin"
+    "pages/arLogin/arLogin",
+    "pages/statistics/awardTj/awardTj"
   ],
   "window": {
     "defaultTitle": "功道云",

BIN
image/paiming-1.png


BIN
image/paiming-2.png


BIN
image/paiming-3.png


+ 15 - 11
pages/exchange/prizeDetail/prizeDetail.js

@@ -9,6 +9,7 @@ Page({
     sn:'',
     image:'',
     isShowYy:false,
+    corpId:'',
   },
   onLoad(e) {
     that = this;
@@ -19,32 +20,28 @@ Page({
     if (e.is) {
       this.setData({ is: false })
     }
+    if (e.corpId) {
+      this.setData({ corpId: e.corpId })
+    }
     console.log(e)
   },
-  showImg(e) {
-    var url = e.target.dataset.url
-    dd.previewImage({
-      current: 0,
-      urls:[url]
-    });
-  },
-  onShow() {
+  onShow(e) {
     if (app.globalData.userData) {
-      that.getData();
       app.globalData.userData.employee_detail.role_list.forEach(item=>{
         if(item.name=='admin'||item.name=='creator'|| item.name == 'point_manager'){
           this.setData({ isShowYy: true })
         }
       })
+      that.getData();
     } else {
-      app.login(app.globalData.corpId, function (is) {
+      app.login(that.data.corpId||app.globalData.corpId, function (is) {
         if (is) {
-          that.getData();
           app.globalData.userData.employee_detail.role_list.forEach(item=>{
             if(item.name=='admin'||item.name=='creator'|| item.name == 'point_manager'){
               this.setData({ isShowYy: true })
             }
           })
+          that.getData();
         } else {
           dd.reLaunch({
             url: '../../noJurisdiction/noJurisdiction'
@@ -53,6 +50,13 @@ Page({
       }, function () { })
     }
   },
+  showImg(e) {
+    var url = e.target.dataset.url
+    dd.previewImage({
+      current: 0,
+      urls:[url]
+    });
+  },
   openText() {
     this.setData({ disabled: true });
     app.$post("api/shop/exchange/deal", { id: this.data.id }).then((res) => {

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

@@ -24,7 +24,7 @@
         </view>
         <view a:else class="index">{{item.rank}}</view>
         <view class="flex-1 flex-box flex-v-ce">
-          <img-box name="{{item.name}}" a:if="{{item.id}}" imgUrl="{{item.img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+          <img-box name="{{item.name}}" a:if="{{item.employee_id}}" imgUrl="{{item.img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
           <view>
             <view class="name">{{item.name}}</view>
             <view class="name dept_name font-flex-word" style="width:400rpx; overflow: hidden;">{{item.deptName}}</view>

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

@@ -201,7 +201,7 @@ Page({
       // type: 'normal',
       group_id: that.data.id,
     }
-    app.$get('api/integral/statistics/groups/rank', data).then((res) => {
+    app.$get('api/integral/statistics/groups/rank', data,'application/vnd.test.v2+json').then((res) => {
       var data = res.data.data.list;
       data=app.returnDeptName(data);
       this.setData({

+ 21 - 12
pages/statistics/awardDetail/awardDetail.axml

@@ -3,31 +3,40 @@
     <view class="header-main">
       <view class="flex-box flex-v-ce" >
         <view class="laber">奖票对象</view>
-        <view class="flex-1">{{dataDetail.rule_list }}</view>
+        <view class="flex-1">{{dataDetail.employee_name }}</view>
       </view>
-      <view class="flex-box flex-v-ce" >
-        <view class="laber">奖票时间</view>
-        <view class="flex-1">{{dataDetail.date }}</view>
+      <view class="flex-box flex-v-ce" style="margin:0.2rem 0">
+        <view class="laber">事件时间</view>
+        <view class="flex-1">{{dataDetail.dateStr }}</view>
       </view>
       <view class="flex-box flex-v-ce">
         <view class="laber">发放人</view>
-        <view class="flex-1">{{dataDetail.recorder_name}}</view>
+        <view class="flex-1">{{dataDetail.publisher_name||'--'}}</view>
+      </view>
+      <view class="flex-box flex-v-ce" style="margin:0.2rem 0">
+        <view class="laber">发放时间</view>
+        <view class="flex-1">{{dataDetail.ct}}</view>
+      </view>
+      <view class="flex-box flex-v">
+        <view class="laber">奖票事件</view>
+        <view class="flex-1">{{dataDetail.remark.customize||dataDetail.remark.rule}}</view>
       </view>
     </view>
   </view>
-  <view class="main margin-bottom">
-      <view class="mian-title border-bottom">对于积分事件</view>
+  <view class="main margin-bottom" a:if="{{dataDetail.event}}">
+      <view class="mian-title border-bottom">对积分事件</view>
       <view class="header-main">
-          <view class="shijContent">
+          <view class="shijContent" catchTap="openDetail">
             <view style="word-break: break-all;">
-              在本题中,读入一个无向图的邻接矩阵(即数组表示),建立无向图并按照以上描述中的算法遍历所有顶点,输出遍历顶点的顺序。【输入形式】输入的第
-              一行包含一个正整数n,表示图中共有n个顶点。其中n不超过50。以后的n行中每行有n个用空格隔
+                {{dataDetail.event.remark.customize||dataDetail.event.remark.rule}}
             </view>
-            <view class="red">+ 10分</view>
+            <view class="red" a:if="{{dataDetail.event.point>0}}">+{{dataDetail.event.point}} {{dataDetail.event.pt_id==3? 'B分':'A分'}}</view>
+            <view class="green" a:else>{{dataDetail.event.point}} {{dataDetail.event.pt_id==3? 'B分':'A分'}}</view>
           </view>
       </view>
   </view>
 
-  <view class="bottom"> <view class="blueBtn" catchTap="openCx">撤回奖票</view></view>
+  <view class="bottom" a:if="{{isShowYy||dataDetail.publisher_id==userData.id}}"><view class="blueBtn" catchTap="openCx">{{mesStr}}奖票</view></view>
+
   <view style="height:2rem"></view>
 </view>

+ 50 - 66
pages/statistics/awardDetail/awardDetail.js

@@ -1,66 +1,53 @@
 
 var app = getApp()
 var that;
+import moment from 'moment' // 时间库
 Page({
   data: {
-    date: app.globalData.month,
-    review_id: '',
-    userId: '',
-    see_log: 1,
+    id: '',
+    event_id:0,
+    mesStr:'删除',
+    isShowYy:false,
+    userData:app.globalData.userData,
   },
   onLoad(e) {
     that = this;
-    dd.setNavigationBar({ title: "事件详情" });
-    that.setData({
-      userId: app.globalData.userData.id
-    })
+    dd.setNavigationBar({ title: "奖票详情" });
     if (e.id) {
       that.setData({
-        review_id: e.id
+        id: e.id
       })
+      this.getDetail();
     }
-  },
-  onShow() {
-    if (app.globalData.userData) {
-        dd.hideLoading();
-        that.getDetail();
-        that.cheakAx();
-    } else {
-      app.login(app.globalData.corpId, function (is) {
-        if (is) {
-          dd.hideLoading();
-          that.getDetail();
-          that.cheakAx();
-        } else {
-          dd.reLaunch({
-            url: '../../noJurisdiction/noJurisdiction'
-          })
-        }
-      }, function () { })
+    if(e.event_id){
+      that.setData({
+        event_id: e.event_id
+      })
+      this.getDetail();
     }
-
-  },
-  cheakAx() {
-    app.$get("api/integral/site/config", {}).then((res) => {
-      var data = res.data.data;
-      this.setData({ see_log: data.see_log ? data.see_log : 0 })
+    app.globalData.userData.employee_detail.role_list.forEach(item=>{
+      if(item.name=='admin'||item.name=='creator'|| item.name == 'point_manager'){
+         this.setData({
+          isShowYy:true
+         })
+      }
+    })
+    that.setData({
+      userData: app.globalData.userData
     })
   },
   openCx() {
     dd.confirm({
-      title: '撤销奖扣',
-      content: '你确定撤销此项吗?',
+      title: '提示',
+
+      
+      content: `确定${that.data.mesStr}奖票吗?`,
       confirmButtonText: '确定',
       cancelButtonText: '取消',
       success: (result) => {
         if (result.confirm) {
-          app.$post("api/integral/review/prize/destroy", { target_id: that.data.review_id, type: 1 }).then((res) => {
-            app.globalData.showToast("已撤销");
-            // var pages=getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
-            // var active=pages[pages.length-2];
-            // if(active.data.page!=1){
-            //     active.refreshData(that.data.review_id);
-            // }
+          app.$post("api/integral/ticket/del", { id: that.data.dataDetail.id}).then((res) => {
+            app.globalData.showToast(`已${that.data.mesStr}`);
             setTimeout(() => {
               dd.navigateBack({
                 delta: 1
@@ -71,35 +58,32 @@ Page({
       },
     });
   },
-  // 查看日志详情
-  openLog() {
+  //打开兴趣
+  openDetail() {
+    if(this.data.event_id){
+      return false
+    }
     dd.navigateTo({
-      url: '../logDetail/logDetail?id=' + this.data.review_id
+      url: '../prizeBuckleDetail/prizeBuckleDetail?id=' +this.data.dataDetail.event_id+'&is=true&is2=true'
     })
   },
-  showImg(e) {
-    var index = e.target.dataset.index;
-    var item = e.target.dataset.item
-    dd.previewImage({
-      current: index,
-      urls: item
-    });
-  },
-  activeItem(e) {
-    var index = e.target.dataset.index;
-    this.setData({ activeIndex: index })
-  },
-  openSearch() {
-    app.globalData.showToast("暂不支持筛选");
-  },
   getDetail() {
-    app.$get("api/integral/statistics/integral/info", { event_id:  that.data.review_id }).then((res) => {
+    let data={
+      id:that.data.id,
+    }
+    if(this.data.event_id){
+      data={
+        event_id:that.data.event_id,
+      }
+    }
+    app.$get("api/integral/ticket/info", data).then((res) => {
       var data = res.data.data;
-      app.globalData.types.forEach(item => {
-        if (item.id == data.pt_id) {
-          data.typeName = item.name
-        }
-      });
+      data.dateStr=moment(data.date+'').format('YYYY-MM-DD')
+      if(app.globalData.userData.id==data.publisher_id){
+        that.setData({
+          mesStr:'撤回'
+        })
+      }
       this.setData({ dataDetail: data })
     })
   },

+ 6 - 9
pages/statistics/awardJl/awardJl.axml

@@ -13,7 +13,7 @@
         <view style="margin:16rpx 0;padding-bottom:16rpx">
           <view class="search flex-box flex-v-ce">
             <image mode="scaleToFill" src="../../../image/ss.png" />
-            <input class="flex-1" placeholder="请输入任务内容" onInput="bindKeyInput" />
+            <input class="flex-1" placeholder="请输入内容" onInput="bindKeyInput" />
             <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
           </view>
         </view>
@@ -24,16 +24,13 @@
         <view class="flex-box-ce li " a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" key="{{item.id}}">
            <view class="flex-box-v flex-center-center" style="width:140rpx;background:#C3E0FD;height:160rpx">
              <image mode="scaleToFill" src="../../../image/pj.png" style="width:60rpx;height:60rpx;margin-bottom:0.1rem"/>
-             <text style="font-size:28rpx">奖票</text>
+             <text style="font-size:28rpx" class="blue">奖票</text>
            </view>
            <view class="flex-1" style="padding:16rpx 20rpx">
-             <view class="context">
-              在本题中,读入一个无向图的邻接矩阵(即数组表示),建立无向图并按照以上描述中的算法遍历所有顶点,输出遍历
-              顶点的顺序。【输入形式】输入的第一行包含一个正整数n,表示图中共有n个顶点。其中n不超过50。以后的n行中每行有n个用空格隔
-             </view>
+             <view class="context">{{item.remark.customize||item.remark.rule}}</view>
              <view class="flex-box-ce fontColorC" style="font-size:28rpx">
-               <text class="flex-1">某某某</text>
-               <text class="">2024-08-04</text>
+               <text class="flex-1">{{item.employee_name}}</text>
+               <text class="">{{item.dateStr}}</text>
              </view>
            </view>
         </view>
@@ -42,6 +39,6 @@
       <no-data a:if="{{list.length==0}}"></no-data>
     </view>
   </view>
-  <select-staff defaultUser="{{employee_ids}}" isShow="{{showStaff}}" a:if="{{showStaff==true}}" onClose="onClose" onConfirm="onConfirmStaff"></select-staff>
+  <select-staff defaultUser="{{employee_ids}}" isShow="{{showStaff}}" isAllSelect="{{false}}" 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>
 </view>

+ 17 - 14
pages/statistics/awardJl/awardJl.js

@@ -2,6 +2,7 @@
 var app = getApp()
 var that;
 var typeArr = [];
+import moment from 'moment' // 时间库
 Page({
   data: {
     date: app.globalData.month,
@@ -25,10 +26,12 @@ Page({
   },
   onLoad(e) {
     that = this;
-    dd.setNavigationBar({ title: "发放记录" });
+    dd.setNavigationBar({ title: "我发放的" });
   },
   onShow() {
-
+    if (that.data.page == 1) {
+      that.getData();
+    }
   },
   onReset() {
     this.setData({
@@ -46,25 +49,25 @@ Page({
     })
     this.getData();
   },
+  
   getData(is) {
     var data = {
       page: that.data.page,
       page_size: 20,
-      rule_id: that.data.rule_id,
-      pt_id: that.data.types.length > 0 ? that.data.types[that.data.typesIndex].id : '2',
-      employee_ids: that.data.employee_ids,
+      employee_id: that.data.employee_ids,
       keyword:that.data.keyword,
-      dc_status: JSON.stringify([1]),
-      order_key:'update_time'
+      publisher_id:app.globalData.userData.id,
     }
     if (that.data.date_type == 2) {
-      data.start_day = that.data.dateObj[0];
-      data.end_day = that.data.dateObj[1];
+      data.start_date = that.data.dateObj[0];
+      data.end_date = that.data.dateObj[1];
+    } else {
+      data.month = that.data.dateObj || that.data.date;
     }
-    app.$get('api/integral/statistics/integral', data).then((res) => {
+    app.$get('api/integral/ticket',data,'application/vnd.test.v2+json').then((res) => {
       var data = res.data.data.list;
-      data.map((item) => {
-        item.ptObj = app.getTypesItem(item.pt_id);
+      data.forEach(item=>{
+        item.dateStr= moment(item.date+'').format('YYYY-MM-DD')
       })
       if (is) {
         if (data.length == 0) {
@@ -97,7 +100,7 @@ Page({
   openDetail(e) {
     var item = e.target.dataset.item;
     dd.navigateTo({
-      url: '../prizeBuckleDetail/prizeBuckleDetail?id=' + item.id
+      url: '../awardDetail/awardDetail?id=' + item.id
     })
   },
   //显示选择时间组件
@@ -151,6 +154,6 @@ Page({
     } else {
       this.setData({ staffVal: '员工', employee_ids: [], page: 1})
     }
-    // this.getData();
+    this.getData();
   },
 });

+ 49 - 0
pages/statistics/awardTj/awardTj.acss

@@ -0,0 +1,49 @@
+
+.main{
+  background: #fff;
+}
+.item{
+  padding: 0.24rem 0.32rem;
+}
+ .context {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+  margin-bottom: 0.1rem;
+  height: 0.8rem;
+}
+
+.users{
+margin-left: 20rpx;
+}
+.num{
+font-size: 28rpx;
+color: #909399;
+}
+.index{
+width: 90rpx;
+text-align: center;
+}
+.index image{
+width: 40rpx;
+height: 40rpx;
+}
+.scroll {
+ height: calc(100vh - 210rpx);
+}
+.search {
+  background-color: #f1f1f1;
+  border-radius: 0.1rem;
+  width: 90%;
+  margin: 0 auto;
+  padding: 0.06rem 0.1rem;
+}
+.header{
+background-color: #fff;
+}
+.dept_name{
+  max-width: 300rpx;
+  
+}

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

@@ -0,0 +1,40 @@
+<view>
+  <view class="{{popupCx}}">
+    <view class="header margin-bottom">
+      <view class="flex-box flex-v-ce tab" style="border-bottom:1px solid #f1f1f1">
+        <view class="flex-1" catchTap="openDate">
+          <text>{{date}}</text>
+        </view>
+        <view class="flex-1" catchTap="selectTissue">
+          <text class="{{showTissue? 'activeView blue':''}}">{{TissueVal}}</text>
+        </view>
+      </view>
+      <form onReset="onReset">
+        <view style="margin:16rpx 0;padding-bottom:16rpx">
+          <view class="search flex-box flex-v-ce">
+            <image mode="scaleToFill" src="../../../image/ss.png" />
+            <input class="flex-1" placeholder="人员搜索" onInput="bindKeyInput"/>
+            <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
+          </view>
+        </view>
+      </form>
+    </view>
+    <view class="main scroll">
+      <scroll-view class="scroll" scroll-y="{{true}}" a:if="{{list.length>0}}" onScrollToLower="onScrollToLower">
+        <view a:for="{{list}}" data-item="{{item}}" catchTap="openDetail" class="flex-box-ce item border-bottom" key="{{item.id}}">
+          <view class="flex-1 flex-box-ce">
+            <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+            <view class="users">
+              <view class="name">{{item.name}}</view>
+              <view class="dept_name font-flex-word">{{item.dept}}</view>
+            </view>
+          </view>
+          <view class="blue" style="margin-right:28rpx;">{{item.count}}</view>
+        </view>
+        <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
+      </scroll-view>
+      <no-data a:if="{{list.length==0}}"></no-data>
+    </view>
+  </view>
+  <select-section isAll="{{true}}" selectIds="{{dept_ids}}" defaultSection="{{dept_id}}" a:if="{{showTissue==true}}" isShow="{{showTissue}}" onClose="onClose" onConfirm="onConfirmTissue"></select-section>
+</view>

+ 125 - 0
pages/statistics/awardTj/awardTj.js

@@ -0,0 +1,125 @@
+
+var app = getApp()
+var that;
+import moment from 'moment' // 时间库
+import { _debounce } from '../../../utils/util'
+Page({
+  data: {
+    date: app.globalData.month,
+    showTissue: false,//显示部门组件
+    TissueVal: '全公司',
+    scroll_top: 0,
+    page: 1,
+    popupCx: '',
+    list:[],
+    dept_id:0,
+    keyword:'',
+    dept_ids:[],
+  },
+  onLoad(e) {
+    that = this;
+    dd.setNavigationBar({ title: "奖票统计" });
+  },
+  onShow() {
+    if (that.data.page == 1) {
+      that.getData();
+    }
+  },
+  onReset() {
+    this.setData({
+      page: 1,
+      isVal: false,
+      keyword: ''
+    })
+    this.getData();
+  },
+  bindKeyInput:_debounce(function(e){
+    this.setData({
+      page: 1,
+      isVal: e.detail.value ? true : false,
+      keyword: e.detail.value ? e.detail.value : '',
+    })
+    this.getData();
+  }),
+    //选择时间
+  openDate(e) {
+      dd.datePicker({
+        format: 'yyyy-MM',
+        currentDate: that.data.date,
+        success: (res) => {
+          that.setData({
+            page: 1,
+            date: res.date,
+            dateStr:moment(res.date).format('M'),
+          })
+          if (res.date) {
+            that.getData();
+          }
+        },
+      });
+  },
+  //显示部门选择组件
+  selectTissue() {
+    this.setData({ showTissue: !this.data.showTissue, popupCx: 'container__mask', })
+  },
+  //选择部门
+  onConfirmTissue(data,ids) {
+    if (data) {
+      this.setData({ dept_ids: ids,dept_id: data.id, page: 1, TissueVal: data.name })
+    }
+    this.getData();
+  },
+  getData(is) {
+    var data = {
+      page: that.data.page,
+      page_size: 20,
+      keyword:that.data.keyword,
+      dept_ids:that.data.dept_ids.toString(),
+      month: that.data.date,
+    }
+    app.$get('api/integral/ticket/statistics',data).then((res) => {
+      var data = res.data.data.list;
+      if (is) {
+        if (data.length == 0) {
+          this.setData({
+            isData: true
+          })
+          return;
+        }
+        var list = that.data.list;
+        this.setData({
+          list: list.concat(data)
+        })
+      } else {
+        this.setData({ list: [] });
+        this.setData({
+          list: data,
+          isData: false
+        })
+      }
+    })
+  },
+  //上啦加载
+  onScrollToLower() {
+    if (!that.data.isData) {
+      this.setData({ page: ++that.data.page })
+      this.getData(true);
+    }
+  },
+  //打开兴趣
+  openDetail(e) {
+    var item = e.target.dataset.item;
+    dd.navigateTo({
+      url: '../myGrant/myGrant?item=' + JSON.stringify(item)+'&month='+this.data.date
+    })
+  },
+
+  //关闭弹窗
+  onClose() {
+    this.setData({
+      showTissue: false,
+      popupCx: ''
+    })
+  },
+
+});

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

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

+ 7 - 6
pages/statistics/grantAward/grantAward.axml

@@ -13,10 +13,9 @@
             <text>{{minuteArray[minuteIndex].name}}</text>
           </picker>
         </view>
-        <view class="flex-1">
+        <view class="flex-1" a:if="{{isShowYy}}">
           <picker onChange="bingIntegralType" value="{{typesIndex}}" range="{{types}}" range-key="name">
-            <text a:if="{{types[typesIndex].name=='全部'}}">积分类型</text>
-            <text a:else>{{types[typesIndex].name}}</text>
+            <text>{{types[typesIndex].name}}</text>
           </picker>
         </view>
       </view>
@@ -34,19 +33,21 @@
       <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
           <view class="flex-box li border-bottom" a:for="{{list}}" key="{{item.id}}">
             <label style="width:0.8rem;padding-top:0.2rem" key="label-{{index}}" data-item="{{item}}">
-              <checkbox  onChange="onChange" data-index="{{index}}" data-item="{{item}}" checked="{{item.checked}}" name="{{item.id}}"></checkbox>
+              <checkbox  onChange="onChange" data-index="{{index}}" a:if="{{!item.has_ticket}}" data-item="{{item}}" checked="{{item.checked}}" name="{{item.id}}"></checkbox>
             </label>
             <view class="flex-1 flex-box"  catchTap="openDetail" data-item="{{item}}">
               <img-box name="{{item.employee_name}}" key="{{item.id}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx"  fSize="24rpx"></img-box>
               <view class="flex-1 main-right">
                 <view class="flex-box flex-v-ce">
                   <view class="name flex-1">{{item.employee_name}}</view>
-                  <view class="red da" a:if="{{item.point>0}}">+{{item.point}}{{item.ptObj.name}}</view>
-                  <view class="green da" a:else>{{item.point}}{{item.ptObj.name}}</view>
+                  <view class="red da" a:if="{{item.point>0}}">+{{item.point}} {{item.ptObj.name}}</view>
+                  <view class="green da" a:else>{{item.point}} {{item.ptObj.name}}</view>
                 </view>
                 <view class="context" a:if="{{item.remark}}">{{item.remark}}</view>
                 <view class="flex-box flex-v-ce">
                   <view class="date flex-1">{{item.event_time}}</view>
+                  <view class="green" a:if="{{item.has_ticket}}">已发放</view>
+                  <view class="fontColorC" a:else>未发放</view>
                 </view>
               </view>
             </view>

+ 59 - 14
pages/statistics/grantAward/grantAward.js

@@ -2,14 +2,15 @@
 var app = getApp()
 var that;
 var typeArr = [];
+import { _debounce } from '../../../utils/util'
 Page({
   data: {
     date: app.globalData.month,
-    minuteIndex: 0,//条件选择
+    minuteIndex: 2,//条件选择
     minuteArray: [
-      { id: 0, name: '全部' },
+      { id: -1, name: '全部' },
       { id: 1, name: '已发放' },
-      { id: 2, name: '未放发' },
+      { id: 0, name: '未发放' },
     ],
 
     showDate: false,//是否显示时间组件
@@ -19,8 +20,8 @@ Page({
     staffVal: '员工',
 
     types: [
-      { id: 0, name: '我奖扣的' },
-      { id: 1, name: '全部事件' },
+      { id: 0, name: '全部事件' },
+      { id: 1, name: '我奖扣的' },
     ],
     typesIndex: '0',
 
@@ -29,10 +30,20 @@ Page({
     page: 1,
     popupCx: '',
     isAll:true,
+    isShowYy:false,
   },
   onLoad(e) {
     that = this;
     dd.setNavigationBar({ title: "发放奖票" });
+    let isShowYy=false;
+    app.globalData.userData.employee_detail.role_list.forEach(item=>{
+      if(item.name=='admin'||item.name=='creator'|| item.name == 'point_manager'){
+          isShowYy=true;
+      }
+    })
+    this.setData({
+      isShowYy:isShowYy,
+    })
   },
   onShow() {
     typeArr = [{ id: 0, name: '全部' }];
@@ -51,7 +62,9 @@ Page({
   selectAll(e){
     let list=this.data.list
     list.map((item) => {
-      item.checked=this.data.isAll;
+      if(!item.has_ticket){
+        item.checked=this.data.isAll;
+      }
     })
     this.setData({
       list:list,
@@ -60,7 +73,32 @@ Page({
   },
   //提交
   sumbit(){
-    console.log(this.data.list)
+    let list=this.data.list
+    let selectId=[];
+    list.map((item) => {
+      if(item.checked){
+        selectId.push(item.id)
+      }
+    }) 
+    if(selectId.length==0){
+      app.globalData.showToast("请选择需要发放奖票的事件");
+      return false
+    }
+    dd.confirm({
+      title: '提示',
+      content: '你确定发放奖票吗?',
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      success: (result) => {
+        if (result.confirm) {
+          app.$post('api/integral/ticket/create',{event_ids:selectId.toString()},'application/vnd.test.v2+json').then((res) => {
+            app.globalData.showToast("已发放");
+            that.setData({ page: 1 })
+            this.getData();
+          })
+        }
+      },
+    });
   },
   onChange(e) {
     let id=e.target.dataset.item.id;
@@ -79,6 +117,7 @@ Page({
       minuteIndex: e.detail.value,
       page: 1,
     });
+    this.getData();
   },
   bingIntegralType(e) {
     this.setData({
@@ -95,24 +134,23 @@ Page({
     })
     this.getData();
   },
-  bindKeyInput(e) {
+  bindKeyInput:_debounce(function(e){
     this.setData({
       page: 1,
       isVal: e.detail.value ? true : false,
       keyword: e.detail.value ? e.detail.value : '',
     })
     this.getData();
-  },
+  }),
   getData(is) {
     var data = {
       page: that.data.page,
       page_size: 20,
-      rule_id: that.data.rule_id,
-      pt_id: that.data.types.length > 0 ? that.data.types[that.data.typesIndex].id : '2',
       employee_ids: that.data.employee_ids,
-      keyword:that.data.keyword,
       dc_status: JSON.stringify([1]),
-      order_key:'update_time'
+      keyword:this.data.keyword,
+      add_subtract:1,
+      has_ticket:this.data.minuteArray[this.data.minuteIndex].id
     }
     if (that.data.date_type == 2) {
       data.start_day = that.data.dateObj[0];
@@ -120,6 +158,13 @@ Page({
     } else {
       data.month = that.data.dateObj || that.data.date;
     }
+    if(this.data.isShowYy){
+      if(this.data.typesIndex==1){
+        data.recorder_id=app.globalData.userData.id
+      }
+    }else{
+      data.recorder_id=app.globalData.userData.id
+    }
     app.$get('api/integral/statistics/integral', data).then((res) => {
       var data = res.data.data.list;
       data.map((item) => {
@@ -157,7 +202,7 @@ Page({
   openDetail(e) {
     var item = e.target.dataset.item;
     dd.navigateTo({
-      url: '../prizeBuckleDetail/prizeBuckleDetail?id=' + item.id
+      url: '../prizeBuckleDetail/prizeBuckleDetail?id=' + item.id+'&is=true'
     })
   },
   //显示选择时间组件

+ 10 - 9
pages/statistics/index/index.js

@@ -13,8 +13,8 @@ Page({
           { name: '我奖扣的', imgUrl: '../../../image/entry_list.png', url: '../my_PrizeBuckle/my_PrizeBuckle?index=', code: 'creator admin ' },
           { name: '申请积分', imgUrl: '../../../image/a_apply.png', url: '../../workbench/apply/apply', code: 'admin employee' },
           { name: '我申请的', imgUrl: '../../../image/apply_list.png', url: '../my_apply/my_apply?index=', code: 'admin employee' },
-          { name: '发放奖票', imgUrl: '../../../image/add_ticket.png', url: '../grant/grant', code: 'creator admin ' },
-          { name: '我的奖票', imgUrl: '../../../image/my_ticket.png', url: '../myGrant/myGrant', code: 'creator admin employee' },
+          // { name: '发放奖票', imgUrl: '../../../image/add_ticket.png', url: '../grant/grant', code: 'creator admin ' },
+          // { name: '我的奖票', imgUrl: '../../../image/my_ticket.png', url: '../myGrant/myGrant', code: 'creator admin employee' },
         ]
       },
       {
@@ -28,13 +28,14 @@ Page({
           { name: '全部任务', imgUrl: '../../../image/apply_list.png', url: '../allTask/allTask', code: 'creator admin' },
         ]
       },
-      // {
-      //   code: '奖票', child: [
-      //     { name: '发放奖票', imgUrl: '../../../image/my_publish.png', url: '../grantAward/grantAward', code: 'creator admin' },
-      //     { name: '发放记录', imgUrl: '../../../image/caback6.png', url: '../awardJl/awardJl', code: 'creator admin ' },
-      //     { name: '我的奖票', imgUrl: '../../../image/task_hall.png', url: '../myGrant/myGrant', code: 'admin employee' },
-      //   ]
-      // },
+      {
+        code: '奖票', child: [
+          { name: '发放奖票', imgUrl: '../../../image/add_ticket.png', url: '../grantAward/grantAward', code: 'creator admin' },
+          { name: '我发放的', imgUrl: '../../../image/caback6.png', url: '../awardJl/awardJl', code: 'creator admin ' },
+          { name: '我的奖票', imgUrl: '../../../image/my_ticket.png', url: '../myGrant/myGrant', code: 'creator admin employee' },
+          { name: '奖票统计', imgUrl: '../../../image/integral_rank.png', url: '../awardTj/awardTj', code: 'creator admin' },
+        ]
+      },
       {
         code: '统计分析', child: [
           { name: '排行榜', imgUrl: '../../../image/integral_rank.png', url: '../userRamking/userRamking', code: 'creator admin ' },

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

@@ -41,8 +41,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 da" a:if="{{item.point>0}}">+{{item.point}}{{item.ptObj.name}}</view>
-              <view class="green da" a:else>{{item.point}}{{item.ptObj.name}}</view>
+              <view class="red da" a:if="{{item.point>0}}">+{{item.point}} {{item.ptObj.name}}</view>
+              <view class="green da" a:else>{{item.point}} {{item.ptObj.name}}</view>
             </view>
             <view class="context" a:if="{{item.remark}}">{{item.remark}}</view>
             <view class="flex-box flex-v-ce">

+ 9 - 9
pages/statistics/integralEvent/integralEvent.js

@@ -36,27 +36,27 @@ Page({
     typeArr = [{ id: 0, name: '全部' }];
     var arr = typeArr.concat(app.globalData.types);
     arr = app.globalData.arrRemoveObj(arr, arr[1]);
+    // console.log(e)
     dd.setNavigationBar({ title: "积分事件" });
     if (e.month || e.employee_ids) {
       var typesIndex = "0";
       if (e.type) {
-        if (arr) {
-          arr.map((item, index) => {
-            if (item.code == e.type) {
-              typesIndex = index
-            }
-          })
-        }
+        let index=e.type=='AF'? '2':'3';
+        this.setData({
+          sxObj:['1',index]
+        })
       }
       this.setData({
         date: e.month ? e.month : app.globalData.month,
         typesIndex: typesIndex,
-        employee_ids: e.employee_ids ? e.employee_ids : [userData.id],
-        staffVal: e.userName ? e.userName : userData.name,
         selectDateVal: e.month == app.globalData.month ? '本月' : '月',
         defaultDate: { type: '1', date: e.month },
       })
     }
+    this.setData({
+      employee_ids: e.employee_ids>0 ? e.employee_ids : [userData.id],
+      staffVal: e.userName ? e.userName : userData.name,
+    })
     if (e.rule_item_id) {//周报进来
       this.setData({
         rule_item_id: e.rule_item_id,

+ 0 - 40
pages/statistics/myGrant - 副本/myGrant.axml

@@ -1,40 +0,0 @@
-<view>
-  <view class="headed"><view class="top"></view></view>
-  <view class="head flex-box flex-center-center">
-    <view class="{{tabIndex==1?'activeIndex':''}} flex-1" data-index="1" catchTap="tabActive">
-      <view>{{month_total}}</view>
-      <view>{{dateStr}}月奖票</view>
-    </view>
-    <view class="{{tabIndex==2?'activeIndex':''}} flex-1" data-index="2" catchTap="tabActive">
-      <view>{{total}}</view>
-      <view>累计奖票</view>
-    </view>
-  </view>
-  <view class="main">
-    
-    <view class="title" style="padding-bottom:0rpx">
-      <text style="position: relative;"  class="{{showDate? 'activeView':''}} text" catchTap="openDate" a:if="{{tabIndex==1}}">{{date}}</text>
-      <text a:else>累计奖票</text>
-    </view>
-
-    <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
-      <view class="flex-box-ce li " a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" key="{{item.id}}">
-        <view class="flex-box-v flex-center-center" style="width:140rpx;background:#C3E0FD;height:160rpx">
-          <image mode="scaleToFill" src="../../../image/pj.png" style="width:60rpx;height:60rpx;margin-bottom:0.1rem"/>
-          <text style="font-size:28rpx">奖票</text>
-        </view>
-        <view class="flex-1" style="padding:16rpx 20rpx">
-          <view class="context">
-           在本题中,读入一个无向图的邻接矩阵(即数组表示),建立无向图并按照以上描述中的算法遍历所有顶点,输出遍历
-           顶点的顺序。【输入形式】输入的第一行包含一个正整数n,表示图中共有n个顶点。其中n不超过50。以后的n行中每行有n个用空格隔
-          </view>
-          <view class="flex-box-ce fontColorC" style="font-size:28rpx">
-            <text class="flex-1">某某某</text>
-            <text class="">2024-08-04</text>
-          </view>
-        </view>
-     </view>
-    </scroll-view>
-     <no-data a:if="{{list.length==0}}" content="没有奖票" />
-  </view>
-</view>

+ 46 - 10
pages/statistics/myGrant/myGrant.acss

@@ -1,13 +1,26 @@
 .top {
   width: 100%;
-  height: 140rpx;
+  height: 100rpx;
   background-color: #26A2FF;
-  margin-bottom: 70rpx;
+  margin-bottom: 100rpx;
   color: #fff;
   text-align: center;
 }
-
-.top image {
+.li{
+  background: #fff;
+  margin-bottom: 0.2rem;
+  border-radius: 5px;
+}
+.context {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+  margin-bottom: 0.1rem;
+  height: 0.8rem;
+}
+.dates image {
   width: 36rpx;
   height: 36rpx;
   margin-right: 10rpx;
@@ -23,7 +36,7 @@
 
 .head {
   position: absolute;
-  top: 70rpx;
+  top: 30rpx;
   left: 32rpx;
   right: 32rpx;
   border-radius: 20rpx;
@@ -32,7 +45,19 @@
   height: 140rpx;
   text-align: center;
 }
-
+.head .flex-1{
+  position: relative;
+}
+.activeIndex::after{
+  content: "";
+  position: absolute;
+  bottom: -0.1rem;
+  height: 4rpx;
+  width: 1rem;
+  background: #26A2FF;
+  left: 50%;
+  margin-left: -0.5rem;
+}
 .head .flex-1 view:nth-child(1) {
   color: #26A2FF;
   font-weight: 600;
@@ -61,9 +86,20 @@
   font-size: 32rpx;
   font-weight: 600;
   padding-left: 20rpx;
-  margin: 30rpx 0;
+  margin: 24rpx 0;
+}
+.text::after {
+	position: absolute;
+	top: 50%;
+	right: -20rpx;
+	margin-top: -0.1rem;
+	border: 0.06rem solid;
+	border-color: transparent transparent #C0C4CC #C0C4CC;
+	-webkit-transform: rotate(-45deg);
+	transform: rotate(-45deg);
+	opacity: .8;
+	content: '';
 }
-
 .title::before {
   position: absolute;
   content: "";
@@ -83,7 +119,7 @@
 /* 底部 */
 
 .main {
-  padding: 28rpx;
+  padding:0 28rpx;
 }
 
 .list {
@@ -164,5 +200,5 @@
 }
 
 .scroll {
-  height: calc(100vh - 3.35rem);
+  height: calc(100vh - 2.8rem);
 }

+ 22 - 19
pages/statistics/myGrant/myGrant.axml

@@ -1,34 +1,37 @@
 <view>
+  <view class="headed"><view class="top"></view></view>
   <view class="head flex-box flex-center-center">
-    <view class="flex-1">
+    <view class="{{tabIndex==1?'activeIndex':''}} flex-1" data-index="1" catchTap="tabActive">
       <view>{{month_total}}</view>
-      <view>月奖票</view>
+      <view>{{dateStr}}月奖票</view>
     </view>
-    <view class="flex-1">
+    <view class="{{tabIndex==2?'activeIndex':''}} flex-1" data-index="2" catchTap="tabActive">
       <view>{{total}}</view>
       <view>累计奖票</view>
     </view>
   </view>
-  <view class="headed margin-bottom">
-    <view class="top">
-      <view class="dates" style="padding:10rpx 0" catchTap="openDate">
-        <image mode="scaleToFill" src="../../../image/date.png"/>
-        <text style="font-size:32rpx;position: relative;" class="{{showDate? 'activeView':''}}">{{date}}</text>
-      </view>
+  <view class="main">
+    
+    <view class="title" style="padding-bottom:0rpx">
+      <text style="position: relative;"  class="{{showDate? 'activeView':''}} text" catchTap="openDate" a:if="{{tabIndex==1}}">{{date}}</text>
+      <text a:else>累计奖票</text>
     </view>
-  </view>
-  <view class="main margin-bottom">
-    <view class="title" style="padding-bottom:0rpx">本月奖票</view>
+
     <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
-      <view class="ticket-list__item" a:for="{{list}}">
-        <view class="flex-box flex-v-ce">
-          <view class="ticket_left flex-3">{{item.remark.customize}}</view>
-          <view class="ticket_right flex-1">
-            <view style="font-size: 0.42rem; line-height: 0.6rem;">{{item.create_time.substring(item.create_time.length-5)}}</view>
-            <view style="font-size: 0.32rem; line-height: 0.6rem;">{{item.create_time.slice(0,4)}}</view>
+      <view class="flex-box-ce li " a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" key="{{item.id}}">
+        <view class="flex-box-v flex-center-center" style="width:140rpx;background:#C3E0FD;height:160rpx">
+          <image mode="scaleToFill" src="../../../image/pj.png" style="width:60rpx;height:60rpx;margin-bottom:0.1rem"/>
+          <text style="font-size:28rpx" class="blue">奖票</text>
+        </view>
+        <view class="flex-1" style="padding:16rpx 20rpx">
+          <view class="context">{{item.remark.customize||item.remark.rule}}</view>
+          <view class="flex-box-ce fontColorC" style="font-size:28rpx">
+            <text class="flex-1">{{item.employee_name}}</text>
+            <text class="">{{item.dateStr}}</text>
           </view>
         </view>
-      </view>
+     </view>
+     <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
     </scroll-view>
      <no-data a:if="{{list.length==0}}" content="没有奖票" />
   </view>

+ 76 - 15
pages/statistics/myGrant/myGrant.js

@@ -1,16 +1,47 @@
+
 var app = getApp()
 var that;
+import moment from 'moment' // 时间库
 Page({
   data: {
     date: app.globalData.month,
     list: [],
     page: 1,
     month_total: 0,
-    total: 0
+    total: 0,
+    tabIndex:1,
+    employee_id:app.globalData.userData.id,
+    dateStr:moment().format('M'),
   },
-  onLoad() {
+  onLoad(e) {
     that = this;
-    dd.setNavigationBar({ title: "我的奖票" });
+    if(e.item){
+      let item=JSON.parse(e.item);
+      dd.setNavigationBar({ title:item.name+"的奖票" });
+      this.setData({
+        employee_id:item.id,
+        date:e.month,
+        dateStr:moment(e.month).format('M'),
+      })
+    }else{
+      dd.setNavigationBar({ title: "我的奖票" });
+      this.setData({
+        employee_id:app.globalData.userData.id,
+      })
+    }
+    this.getDataAll();
+  },
+  onShow(){
+    if(this.data.page==1){
+      this.getData();
+    }
+  },
+  tabActive(e){
+    var index = e.target.dataset.index;//获取itemS集合中对应的files
+    this.setData({
+      tabIndex:index,
+      page:1,
+    })
     this.getData();
   },
   //选择时间
@@ -20,7 +51,8 @@ Page({
       currentDate: that.data.date,
       success: (res) => {
         that.setData({
-          date: res.date
+          date: res.date,
+          dateStr:moment(res.date).format('M'),
         })
         if (res.date) {
           that.getData();
@@ -32,22 +64,36 @@ Page({
   onScrollToLower() {
     if (!that.data.isData) {
       this.setData({ page: ++that.data.page })
+      this.getData(true);
     }
   },
   getData(is) {
     var data = {
       page: this.data.page,
       page_size: 20,
-      employee_id: app.globalData.userData.id,
-      month: this.data.date
+      employee_id: this.data.employee_id,
     }
-    app.$get('/api/integral/ticket', data).then((res) => {
-      var data = res.data.data.month_list;
-      var list = that.data.list;
-      this.setData({
-        month_total: res.data.data.month_total,
-        total: res.data.data.total
+    if(this.data.tabIndex==2){
+      // data.start_date='2010-01-01';
+      // data.end_date=moment().format('YYYY-MM-DD');
+    }else{
+      data.month=this.data.date
+    }
+    app.$get('/api/integral/ticket', data,'application/vnd.test.v2+json').then((res) => {
+      var data = res.data.data.list;
+      data.forEach(item=>{
+        item.dateStr= moment(item.date+'').format('YYYY-MM-DD')
       })
+      var list = that.data.list;
+      if(this.data.tabIndex==2){
+        this.setData({
+          total: res.data.data.total
+        })
+      }else{
+        this.setData({
+          month_total: res.data.data.total
+        })
+      }
       if (is) {
         if (data.length < 20) {
           this.setData({
@@ -67,10 +113,25 @@ Page({
       }
     })
   },
+  getDataAll() {
+    var data = {
+      page: 1,
+      page_size: 1,
+      employee_id: this.data.employee_id,
+      start_date: '2010-01-01',
+      end_date:moment().format('YYYY-MM-DD'),
+    }
+    app.$get('/api/integral/ticket', data).then((res) => {
+      this.setData({
+        total: res.data.data.total,
+      })
+    })
+  },
   //打开更多
-  openMore() {
+  openDetail(e) {
+    var item = e.target.dataset.item;
     dd.navigateTo({
-      url: '../../statistics/integralEvent/integralEvent?month=' + this.data.date + '&type=BF'
+      url: '../awardDetail/awardDetail?id=' + item.id
     })
   },
-});
+});

+ 10 - 46
pages/statistics/myGrant - 副本/myGrant.acss → pages/statistics/myGrant2/myGrant.acss

@@ -1,26 +1,13 @@
 .top {
   width: 100%;
-  height: 100rpx;
+  height: 140rpx;
   background-color: #26A2FF;
-  margin-bottom: 100rpx;
+  margin-bottom: 70rpx;
   color: #fff;
   text-align: center;
 }
-.li{
-  background: #fff;
-  margin-bottom: 0.2rem;
-  border-radius: 5px;
-}
-.context {
-  overflow: hidden;
-  text-overflow: ellipsis;
-  display: -webkit-box;
-  -webkit-line-clamp: 2;
-  -webkit-box-orient: vertical;
-  margin-bottom: 0.1rem;
-  height: 0.8rem;
-}
-.dates image {
+
+.top image {
   width: 36rpx;
   height: 36rpx;
   margin-right: 10rpx;
@@ -36,7 +23,7 @@
 
 .head {
   position: absolute;
-  top: 30rpx;
+  top: 70rpx;
   left: 32rpx;
   right: 32rpx;
   border-radius: 20rpx;
@@ -45,19 +32,7 @@
   height: 140rpx;
   text-align: center;
 }
-.head .flex-1{
-  position: relative;
-}
-.activeIndex::after{
-  content: "";
-  position: absolute;
-  bottom: -0.1rem;
-  height: 4rpx;
-  width: 1rem;
-  background: #26A2FF;
-  left: 50%;
-  margin-left: -0.5rem;
-}
+
 .head .flex-1 view:nth-child(1) {
   color: #26A2FF;
   font-weight: 600;
@@ -86,20 +61,9 @@
   font-size: 32rpx;
   font-weight: 600;
   padding-left: 20rpx;
-  margin: 24rpx 0;
-}
-.text::after {
-	position: absolute;
-	top: 50%;
-	right: -20rpx;
-	margin-top: -0.1rem;
-	border: 0.06rem solid;
-	border-color: transparent transparent #C0C4CC #C0C4CC;
-	-webkit-transform: rotate(-45deg);
-	transform: rotate(-45deg);
-	opacity: .8;
-	content: '';
+  margin: 30rpx 0;
 }
+
 .title::before {
   position: absolute;
   content: "";
@@ -119,7 +83,7 @@
 /* 底部 */
 
 .main {
-  padding:0 28rpx;
+  padding: 28rpx;
 }
 
 .list {
@@ -200,5 +164,5 @@
 }
 
 .scroll {
-  height: calc(100vh - 2.9rem);
+  height: calc(100vh - 3.35rem);
 }

+ 35 - 0
pages/statistics/myGrant2/myGrant.axml

@@ -0,0 +1,35 @@
+<view>
+  <view class="head flex-box flex-center-center">
+    <view class="flex-1">
+      <view>{{month_total}}</view>
+      <view>本月奖票</view>
+    </view>
+    <view class="flex-1">
+      <view>{{total}}</view>
+      <view>累计奖票</view>
+    </view>
+  </view>
+  <view class="headed margin-bottom">
+    <view class="top">
+      <view class="dates" style="padding:10rpx 0" catchTap="openDate">
+        <image mode="scaleToFill" src="../../../image/date.png"/>
+        <text style="font-size:32rpx;position: relative;" class="{{showDate? 'activeView':''}}">{{date}}</text>
+      </view>
+    </view>
+  </view>
+  <view class="main margin-bottom">
+    <view class="title" style="padding-bottom:0rpx">本月奖票</view>
+    <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+      <view class="ticket-list__item" a:for="{{list}}">
+        <view class="flex-box flex-v-ce">
+          <view class="ticket_left flex-3">{{item.remark.customize}}</view>
+          <view class="ticket_right flex-1">
+            <view style="font-size: 0.42rem; line-height: 0.6rem;">{{item.create_time.substring(item.create_time.length-5)}}</view>
+            <view style="font-size: 0.32rem; line-height: 0.6rem;">{{item.create_time.slice(0,4)}}</view>
+          </view>
+        </view>
+      </view>
+    </scroll-view>
+     <no-data a:if="{{list.length==0}}" content="没有奖票" />
+  </view>
+</view>

+ 4 - 15
pages/statistics/myGrant - 副本/myGrant.js → pages/statistics/myGrant2/myGrant.js

@@ -1,28 +1,18 @@
-
 var app = getApp()
 var that;
-import moment from 'moment' // 时间库
 Page({
   data: {
     date: app.globalData.month,
-    list: [1,2,3,4,5,5,5,5,5,5],
+    list: [],
     page: 1,
     month_total: 0,
-    total: 0,
-    tabIndex:1,
-    dateStr:moment().format('M'),
+    total: 0
   },
   onLoad() {
     that = this;
     dd.setNavigationBar({ title: "我的奖票" });
     this.getData();
   },
-  tabActive(e){
-    var index = e.target.dataset.index;//获取itemS集合中对应的files
-    this.setData({
-      tabIndex:index
-    })
-  },
   //选择时间
   openDate(e) {
     dd.datePicker({
@@ -30,8 +20,7 @@ Page({
       currentDate: that.data.date,
       success: (res) => {
         that.setData({
-          date: res.date,
-          dateStr:moment(res.date).format('M'),
+          date: res.date
         })
         if (res.date) {
           that.getData();
@@ -84,4 +73,4 @@ Page({
       url: '../../statistics/integralEvent/integralEvent?month=' + this.data.date + '&type=BF'
     })
   },
-});
+});

+ 0 - 0
pages/statistics/myGrant - 副本/myGrant.json → pages/statistics/myGrant2/myGrant.json


+ 8 - 0
pages/statistics/prizeBuckleDetail/prizeBuckleDetail.acss

@@ -91,6 +91,14 @@
   color: #fff;
   background: #26A2FF;
   padding: 16rpx 0;
+  border: 1px solid #26A2FF;
+  border-radius: 5rpx;
+}
+.bottom .blueBtn2{
+  color: #26A2FF;
+  background: #fff;
+  border: 1px solid #26A2FF;
+  padding: 16rpx 0;
   border-radius: 5rpx;
 }
 .main{

+ 24 - 9
pages/statistics/prizeBuckleDetail/prizeBuckleDetail.axml

@@ -30,14 +30,21 @@
         <view class="laber">来源类型</view>
         <view class="flex-1">{{dataDetail.source_type_mark }}</view>
       </view>
-      <view class="flex-box flex-v-ce" a:if="{{dataDetail.date}}">
-        <view class="laber">事件时间</view>
-        <view class="flex-1">{{dataDetail.date }}</view>
-      </view>
       <view class="flex-box flex-v-ce" a:if="{{dataDetail.recorder_name}}">
         <view class="laber">记录人</view>
         <view class="flex-1">{{dataDetail.recorder_name}}</view>
       </view>
+      <!-- <view class="flex-box flex-v-ce" a:if="{{is}}">
+        <view class="laber">发放奖票</view>
+        <view class="flex-1">
+          <text a:if="{{dataDetail.has_ticket}}" class="blue"  catchTap="openDetail">已发放</text>
+          <text a:else class="fontColorC">未发放</text>
+        </view>
+      </view> -->
+      <view class="flex-box flex-v-ce" a:if="{{dataDetail.date}}">
+        <view class="laber">事件时间</view>
+        <view class="flex-1">{{dataDetail.date }}</view>
+      </view>
       <view class="flex-box flex-v-ce" a:if="{{dataDetail.complete_task.time}}">
         <view class="laber">完成时间</view>
         <view class="flex-1">{{dataDetail.complete_task.time }}</view>
@@ -86,11 +93,6 @@
       </view>
     </block>
   </view>
-  <view class="bottom flex-box flex-flex-center-center" a:if="{{dataDetail.recorder_id==userId&&dataDetail.process.length==1&&(dataDetail.event_type==3||dataDetail.event_type==4)}}">
-    <text class="flex-2 fontColorB">撤销后数据将不可恢复</text>
-    <view></view>
-    <view class="flex-1 blueBtn" catchTap="openCx">撤销奖扣</view>
-  </view>
   <!-- 调用过程组件 -->
   <view class="margin-bottom">
     <process process="{{dataDetail.process}}" a:if="{{dataDetail.process.length>0}}" />
@@ -98,6 +100,19 @@
   <view  a:if="{{dataDetail.dc_remark.flow}}">
     <review process="{{dataDetail.dc_remark.flow}}" status="{{dataDetail.dc_status}}" />
   </view>
+
+
+  <view class="bottom flex-box flex-flex-center-center" a:if="{{is&&!is2}}">
+    <view class="flex-1 blueBtn" catchTap="openJp" a:if="{{dataDetail.has_ticket==0}}">发放奖票</view>
+    <view class="flex-1 blueBtn2" catchTap="openDetail" a:else>查看奖票</view>
+  </view>
+  <block a:else>
+    <view class="bottom flex-box flex-flex-center-center" a:if="{{dataDetail.recorder_id==userId&&dataDetail.process.length==1&&(dataDetail.event_type==3||dataDetail.event_type==4)}}">
+      <text class="flex-2 fontColorB">撤销后数据将不可恢复</text>
+      <view></view>
+      <view class="flex-1 blueBtn" catchTap="openCx">撤销奖扣</view>
+    </view>
+  </block>
   <view style="height:2rem">
     
   </view>

+ 35 - 5
pages/statistics/prizeBuckleDetail/prizeBuckleDetail.js

@@ -7,6 +7,8 @@ Page({
     review_id: '',
     userId: '',
     see_log: 1,
+    is:false,
+    is2:false,
   },
   onLoad(e) {
     that = this;
@@ -19,6 +21,16 @@ Page({
         review_id: e.id
       })
     }
+    if(e.is){
+      that.setData({
+        is:true
+      })
+    }
+    if(e.is2){
+      that.setData({
+        is2:true
+      })
+    }
   },
   onShow() {
     if (app.globalData.userData) {
@@ -40,12 +52,35 @@ Page({
     }
 
   },
+  openDetail(){
+    dd.navigateTo({
+      url: '../awardDetail/awardDetail?event_id=' + that.data.review_id
+    })
+  },
   cheakAx() {
     app.$get("api/integral/site/config", {}).then((res) => {
       var data = res.data.data;
       this.setData({ see_log: data.see_log ? data.see_log : 0 })
     })
   },
+  openJp(){
+    dd.confirm({
+      title: '提示',
+      content: '你确定发放奖票吗?',
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      success: (result) => {
+        if (result.confirm) {
+          app.$post("api/integral/ticket/create", { event_ids: that.data.review_id},'application/vnd.test.v2+json').then((res) => {
+            app.globalData.showToast("已发放");
+            dd.navigateTo({
+              url: '../awardDetail/awardDetail?event_id=' + that.data.review_id
+            })
+          })
+        }
+      },
+    });
+  },
   openCx() {
     dd.confirm({
       title: '撤销奖扣',
@@ -56,11 +91,6 @@ Page({
         if (result.confirm) {
           app.$post("api/integral/review/prize/destroy", { target_id: that.data.review_id, type: 1 }).then((res) => {
             app.globalData.showToast("已撤销");
-            // var pages=getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
-            // var active=pages[pages.length-2];
-            // if(active.data.page!=1){
-            //     active.refreshData(that.data.review_id);
-            // }
             setTimeout(() => {
               dd.navigateBack({
                 delta: 1

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

@@ -43,13 +43,13 @@
         <view class="flex-1" a:if="{{dataDetail.task_cycle==2}}">{{dataDetail.task_cycle_mark}}{{ weekList[dataDetail.task_cycle_value - 1] }}截止</view>
         <view class="flex-1" a:if="{{dataDetail.task_cycle==3}}">{{dataDetail.task_cycle_mark}}{{dataDetail.task_cycle_value}}号截止</view>
       </view>
-      <view class="flex-box flex-v-ce">
+      <!-- <view class="flex-box flex-v-ce">
         <view class="laber">可见范围</view>
         <view class="flex-1" a:if="{{dataDetail.department_info.length>0}}">
           <text a:for="{{dataDetail.department_info}}">{{item.name}},</text>
         </view>
         <view class="flex-1" a:else>全公司</view>
-      </view>
+      </view> -->
       <!-- <view class="flex-box flex-v-ce">
         <view class="laber">任务类型</view>
         <view class="flex-1">{{dataDetail.pt_name}}</view>

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

@@ -88,7 +88,7 @@
     
     <view class="main margin-bottom">
       <block a:if="{{dataDetail.source_type!=10}}">
-        <view class="mian-title border-bottom" a:if="{{dataDetail.point_config&&dataDetail.point_config.item_info}}">规则依据1
+        <view class="mian-title border-bottom" a:if="{{dataDetail.point_config&&dataDetail.point_config.item_info}}">规则依据
           <text>此事件打分参考以下积分规则</text>
         </view>
         <view class="header-main" a:if="{{dataDetail.point_config&&dataDetail.point_config.item_info}}">

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

@@ -19,7 +19,7 @@ Page({
     //     }
     //   },
     // });
-    dd.setNavigationBar({ title: "我的排名" });
+    dd.setNavigationBar({ title: "更多排名" });
   },
   onShow(){
     this.getData();

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

@@ -119,7 +119,7 @@
     
     <view class="main margin-bottom">
       <block a:if="{{dataDetail.source_type!=10}}">
-        <view class="mian-title border-bottom" a:if="{{dataDetail.point_config&&dataDetail.point_config.item_info}}">规则依据1
+        <view class="mian-title border-bottom" a:if="{{dataDetail.point_config&&dataDetail.point_config.item_info}}">规则依据
           <text>此事件打分参考以下积分规则</text>
         </view>
         <view class="header-main" a:if="{{dataDetail.point_config&&dataDetail.point_config.item_info}}">
@@ -156,10 +156,10 @@
   </view>
   <view class="footer">
     <view class="flex-box flex-v-ce selectItems">
-      <view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-1" catchTap="activeItem">任务过程</view>
+      <view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-1" catchTap="activeItem">工作记录</view>
       <view data-index="2" class="{{activeIndex == 2? 'active':''}} flex-1" catchTap="activeItem">记分记录</view>
       <view a:if="{{activeIndex == 1}}" class="flex-box-end flex-2 blue ji">
-        <text style="padding-right:24rpx" catchTap="openJyt" a:if="{{dataDetail.employee_id==userId&&dataDetail.status<3}}">+记一条</text>
+        <text style="padding-right:24rpx" catchTap="openJyt" a:if="{{dataDetail.employee_id==userId&&dataDetail.status<3}}">+记一条工作记录</text>
       </view>
       <view a:if="{{activeIndex == 2}}" class="flex-box-end flex-2 blue ji">
         <text style="padding-right:24rpx" catchTap="openJf" a:if="{{keepTheScore}}">记分</text>
@@ -183,7 +183,7 @@
       </view>
       <view class="flex-box-v flex-center-center noTask" a:if="{{dataDetail.gc.length==0}}">
         <image mode="scaleToFill" src="../../../image/noTask.png" />
-        <text style="font-size:24rpx">还没有任务过程去记一条吧</text>
+        <text style="font-size:24rpx">暂无工作记录</text>
       </view>
     </view>
     <view a:else style="margin-bottom:0.8rem">
@@ -208,13 +208,13 @@
       </view>
       <view class="flex-box-v flex-center-center noTask" a:if="{{dataDetail.jf.length==0}}">
         <image mode="scaleToFill" src="../../../image/noTask.png" />
-        <text style="font-size:24rpx">还没有任务记录去记一条吧</text>
+        <text style="font-size:24rpx">暂无积分记录</text>
       </view>
     </view>
   </view>
   <view class="btn-area" style="margin-top:28rpx;" a:if="{{(dataDetail.reviewer_id == userId && dataDetail.status == 2)||(dataDetail.employee_id == userId && dataDetail.status == 1)}}">
-    <button type="default" loading="{{disabled}}" a:if="{{dataDetail.reviewer_id == userId && dataDetail.status == 2&&!isNot}}" 
-      class="defBtn" disabled="{{disabled}}" catchTap="openWc">去审批</button>
+    <!-- <button type="default" loading="{{disabled}}" a:if="{{dataDetail.reviewer_id == userId && dataDetail.status == 2&&!isNot}}" 
+      class="defBtn" disabled="{{disabled}}" catchTap="openWc">去审批</button> -->
     <button type="default" loading="{{disabled}}" a:if="{{dataDetail.employee_id == userId && dataDetail.status == 1}}" class="defBtn" 
       disabled="{{disabled}}" catchTap="openPerform">完成</button>
   </view>

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

@@ -216,8 +216,10 @@ Page({
     })
   },
   openWc() {
+    console.log(this.data.dataDetail)
+    // return false
     dd.navigateTo({
-      url: '../../workbench/approve/approve?id=' + this.data.dataDetail.review_id
+      url: '../../workbench/approve/approve?id=' + this.data.dataDetail.reviews.id
     })
   },
   // 完成任务

+ 9 - 7
pages/workbench/approve/approve.axml

@@ -186,19 +186,21 @@
           </view>
         </block>
         
-        <view class="fontColorB" style="font-size:24rpx;padding-left:28rpx">奖票多用于优秀表现和重要事项的表彰</view>
-        <view class="flex-box flex-v-ce li margin-bottom" style="padding:26rpx 28rpx;">
-          <view class="label">发放奖票</view>
-          <view class="flex-1"></view>
-          <switch onChange="switchChange2" disabled="{{item.pid}}" checked="{{item.ticket_count}}" color="#26A2FF"></switch>
-        </view>
+        <block a:if="{{!item.pid}}">
+          <view class="fontColorB" style="font-size:24rpx;padding-left:28rpx">奖票多用于优秀表现和重要事项的表彰</view>
+          <view class="flex-box flex-v-ce li margin-bottom" style="padding:26rpx 28rpx;">
+            <view class="label">发放奖票</view>
+            <view class="flex-1"></view>
+            <switch onChange="switchChange2" disabled="{{item.pid}}" checked="{{item.ticket_count}}" color="#26A2FF"></switch>
+          </view>
+        </block>
         <view class="flex-box flex-v-ce li margin-bottom" data-num="3" catchTap="openSelect">
           <view class="label">递交审批</view>
           <view class="flex-1">{{users.name}}</view>
           <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
         </view>
         <view class="li">
-          <textarea  maxlength="300" value="{{item.remark}}" onInput="bindTextAreaBlur" placeholder="审批意见(选填)"></textarea>
+          <textarea  maxlength="100" value="{{item.remark}}" onInput="bindTextAreaBlur" placeholder="审批意见(选填)"></textarea>
         </view>
       </view>
     </view>

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

@@ -65,8 +65,6 @@ Page({
       reviewerObj: item
     })
   },
-
-
   bindTextAreaBlur(e) {
     this.setData({
       ['item.remark']: e.detail.value,
@@ -80,7 +78,6 @@ Page({
     var item = that.data.item;
     var data, point;
     var num = item.checked ? item.point : item.point2;
-    // console.log(item)
     if (item.checked) {
       if (!item.rule_id) {
         this.showToast("请选择所属规则")
@@ -110,7 +107,6 @@ Page({
         return;
       }
     }
-
     data = {
       review_id: item.review_id,
       action: 'complete',
@@ -225,7 +221,6 @@ 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();
@@ -264,6 +259,7 @@ Page({
         isGzType: data.pt_code,
         isData: isData,
         ['item.pid']: data.pid == 0 ? false : true,
+        ['item.ticket_count']: data.ticket_count == 1 ? true : false,
         ['item.review_id']: data.id,
         ['item.checked']: checked,
         ['item.selectRule']: selectRule,

+ 9 - 4
pages/workbench/approveDetail/approveDetail.axml

@@ -4,9 +4,9 @@
       <img-box a:if="{{dataDetail.employee_name}}" imgUrl="{{dataDetail.employee_img}}" name="{{dataDetail.employee_name}}" height="90rpx" width="90rpx" fSize="24rpx"></img-box>
       <view class="header-top-right">
         <view class="name">{{dataDetail.employee_name}}</view>
-        <view class="orange" a:if="{{dataDetail.review_status==0}}">{{dataDetail.status_mark}}</view>
-        <view class="red" a:if="{{dataDetail.review_status==1}}">{{dataDetail.status_mark}}</view>
-        <view class="green" a:if="{{dataDetail.review_status==2}}">{{dataDetail.status_mark}}</view>
+        <view class="orange" a:if="{{dataDetail.review_status==0}}">{{dataDetail.review_status_mark}}</view>
+        <view class="red" a:if="{{dataDetail.review_status==1}}">{{dataDetail.review_status_mark}}</view>
+        <view class="green" a:if="{{dataDetail.review_status==2}}">{{dataDetail.review_status_mark}}</view>
       </view>
     </view>
     <view class="header-top flex-box-v flex-center-center border-bottom" a:if="{{dataDetail.status==1||dataDetail.status==2}}">
@@ -19,8 +19,9 @@
         <text a:else class="green">{{ dataDetail.review_point }}</text>
         <text style="margin-left:10rpx;">{{dataDetail.typeName}}</text>
       </view>
-      <view>{{dataDetail.status_mark}}</view>
+      <view>{{dataDetail.review_status_mark}}</view>
     </view>
+
     <view class="header-main">
         <view class="flex-box flex-v-ce">
           <view class="laber">积分</view>
@@ -48,6 +49,10 @@
           </view>
         </block>
       </view>
+      <view class="flex-box flex-v-ce" a:if="{{dataDetail.ticket_count==1}}">
+        <view class="laber">奖票</view>
+        <view class="flex-1 blue">1</view>
+      </view>    
       <view class="flex-box-ce" style="padding-top:24rpx;border-top:2rpx solid #f1f1f1" catchTap="openDetail" a:if="{{dataDetail.source_type==1}}">
           <view class="flex-1">任务详情</view>
           <image mode="scaleToFill" class="img-right" src="../../../image/right.png"/>

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

@@ -21,7 +21,40 @@
   height: 0.8rem;
   /* display: block; */
 }
-
+.zn-item2{
+  padding:0.06rem 0.1rem;
+  /* background-image: linear-gradient(to top, #48c6ef 0%, #26A2FF 100%); */
+  border-radius: 5px;
+  color: #909399;
+  font-size: 0.28rem;
+  border: 1px solid #ccc;
+  margin-right: 24rpx;
+  border: 1px solid #909399;
+}
+.zn-item2 text{
+  width: 2rem;
+  display: block
+}
+.active-pl{
+  color: #26A2FF;
+  border: 1px solid #26A2FF;
+}
+.index{
+  width: 140rpx;
+  text-align: center;
+  font-weight: 600;
+  
+}
+.index image{
+  width: 60rpx;
+  height: 60rpx;
+}
+.border-bottom{
+  border-bottom: 0.2rem solid #f1f1f1 !important;
+}
+.name{
+  margin-left: 20rpx;
+}
 .ts{
   height: 128rpx;
   padding: 16rpx 32rpx;

+ 32 - 8
pages/workbench/index/index.axml

@@ -11,11 +11,11 @@
       <view>今日B分</view>
     </view>
     <view class="flex-1" data-index="1" onTap="openView">
-      <view>{{userData.b.month_point}}</view>
+      <view>{{headDayBs.b_month}}</view>
       <view>本月B分</view>
     </view>
     <view class="flex-1" data-index="2" onTap="openView">
-      <view>{{userData.a.month_point}}</view>
+      <view>{{headDayBs.a_month}}</view>
       <view>本月A分</view>
     </view>
   </view>
@@ -51,11 +51,35 @@
   </view>
   
   <view class="main margin-bottom">
-    <view class="main-title flex-box flex-v-ce" onTap="openView" data-index="10">
+    <view class="main-title flex-box flex-v-ce">
       <text class="flex-1" style="font-size:32rpx">排行榜</text>
-      <text class="fontColorB" style="font-size:28rpx">每小时更新一次</text>
+      <text class="fontColorB" style="font-size:28rpx" onTap="openView" data-index="10">更多排名 <image mode="scaleToFill" src="../../../image/right.png" class="img-right"></image></text>
+    </view>
+    <view class="flex-box-ce" style="padding:24rpx 0;overflow-x: scroll;margin:0 24rpx; border-bottom: 1px solid #f1f1f1;">
+      <view class="zn-item2 {{item.group_name==selectPlItem.group_name? 'active-pl':''}}"  a:for="{{rankingList}}" data-item="{{item}}" onTap="tabPositions">
+          <text class="font-flex-word" >{{item.group_name}}</text>
+      </view>
     </view>
-    <view a:for="{{rankingList}}" class="flex-box flex-v-ce" style="padding:0.28rem; border-bottom: 1px solid #f1f1f1; " 
+    <view a:if="{{index<4}}" a:for="{{rankingListDetails}}"  onTap="openViewRanking" style="padding:0.24rem 0.28rem; border-bottom: 1px solid #f1f1f1;position:relative" class="flex-box-ce {{index==0? 'border-bottom':''}}">
+        <view class="flex-1 flex-box flex-v-ce">
+          <img-box name="{{item.employee_name}}" a:if="{{item.employee_id}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+          <view class="name">{{item.employee_name}}</view>
+        </view>
+        <view a:if="{{item.rank==1}}" class="index"><image mode="scaleToFill" src="../../../image/paiming-1.png"></image></view>
+        <view a:elif="{{item.rank==2}}" class="index"><image mode="scaleToFill" src="../../../image/paiming-2.png"></image></view>
+        <view a:elif="{{item.rank==3}}" class="index"><image mode="scaleToFill" src="../../../image/paiming-3.png"></image></view>
+        <view a:else class="index" >
+          <text style="font-weight:400;font-size:0.24rem" a:if="{{item.rank!='--'}}">NO.</text> {{item.rank}}
+        </view>
+        <view a:if="{{index==0}}" style="font-size:24rpx;position:absolute;bottom:0.1rem;right:0.5rem;" class="fontColorD">我的排名</view>
+    </view>
+    
+    <view class="rankingLists" onTap="openViewRanking">
+      <text>查看排名详情</text>
+      <image mode="scaleToFill" src="../../../image/right.png" class="img-right2" ></image>
+    </view>
+
+    <!-- <view a:for="{{rankingList}}" class="flex-box flex-v-ce" style="padding:0.28rem; border-bottom: 1px solid #f1f1f1; " 
       data-item="{{item}}" onTap="openViewRanking">
       <view class="flex-box flex-v-ce flex-1">
         <view class="ranking_name font-flex-word">{{ item.group_name.slice(0,2)}}</view>
@@ -69,11 +93,11 @@
         </view>
         <image mode="scaleToFill" src="../../../image/right.png" class="img-right"></image>
       </view>
-    </view>
-    <view class="rankingLists" onTap="openView" data-index="10">
+    </view> -->
+    <!-- <view class="rankingLists" onTap="openView" data-index="10">
       <text>查看所有排行榜</text>
       <image mode="scaleToFill" src="../../../image/right.png" class="img-right2"></image>
-    </view>
+    </view> -->
   </view>
   <!-- 奖扣展示 -->
   <view a:if="{{userData.task&&isAdministrator}}" class="main margin-bottom">

+ 189 - 46
pages/workbench/index/index.js

@@ -7,6 +7,7 @@ var AParse = require('../../../Component/aParse/aParse.js');
 import 'dingtalk-jsapi/entry/union';
 import { setCache, getCache } from '../../../utils/util'
 import { contactAdminToUseApp } from 'dingtalk-design-libs';
+import moment from 'moment' // 时间库
 Page({
   data: {
     headDayBs: {},
@@ -31,7 +32,7 @@ Page({
       { name: '奖扣A分', imgUrl: '../../../image/a_entry.png', url: '../jk_B/jk_B?type=A', code: 'creator admin' },
       { name: '领任务', imgUrl: '../../../image/task_hall.png', url: '../../statistics/getTask/getTask', code: 'admin employee' },
       { name: '发布悬赏', imgUrl: '../../../image/caback6.png', url: '../../statistics/offerAreward/offerAreward', code: 'creator admin' },
-      { name: '发放奖票', imgUrl: '../../../image/add_ticket.png', url: '../../statistics/grant/grant', code: 'creator admin' },
+      // { name: '发放奖票', imgUrl: '../../../image/add_ticket.png', url: '../../statistics/grant/grant', code: 'creator admin' },
       { name: '全部', imgUrl: '../../../image/all2.png', url: 'all', code: 'creator admin employee' },
     ],
     isUpdate: false,
@@ -47,6 +48,8 @@ Page({
     announcementList:[],
     isShowYy:false,
     isShowAn:true,
+
+    selectPlItem:{},
   },
   onLoad() {
     that = this;
@@ -142,7 +145,7 @@ Page({
     })
   },
   getAnnouncement(){
-    app.$get("api/announcement/list",{type:3}).then((res) => {
+    app.$get2("api/announcement/list",{type:3}).then((res) => {
         let list=res.data.data.list;
 
         that.setData({ announcementList:list})
@@ -165,7 +168,7 @@ Page({
           let data = res.result;
           var task = data.task;
           var ratio = task.ratio.enable== 0 ? '-' : `${task.ratio.reward_ratio}:1`
-          var target_ratio = task.ratio.target <= 0 ? '0:0' : `${task.ratio.target}:1`
+          var target_ratio = task.ratio.target <= 0 ? '0:1' : `${task.ratio.target}:1`
           data.ratio = {
             ratio: ratio,
             target_ratio: target_ratio
@@ -251,7 +254,7 @@ Page({
   },
   // 获取公告
   getNotice() {
-    app.$get("api/information/index", { page: 1, page_size: 1 }).then((res) => {
+    app.$get2("api/information/index", { page: 1, page_size: 1 }).then((res) => {
       let data= res.data.data;
       that.setData({
         noticeTitle: data[0]? data[0].name:'',
@@ -264,7 +267,7 @@ Page({
     if (that.data.title) {
       return
     }
-    app.$get("api/announcement/list", { page: 1, page_size: 1 }).then((res) => {
+    app.$get2("api/announcement/list", { page: 1, page_size: 1 }).then((res) => {
       var data = res.data.data.list[0];
       AParse.aParse('article', 'html', data.focus, that, 5);
       that.setData({
@@ -286,9 +289,10 @@ Page({
     var arr = [];
     that.data.menuList.forEach(item => {
       if(item.name=='复核'){
-        app.globalData.userData.employee_detail.role_list.forEach(e=>{
+        app.globalData.userData.employee_detail.role_list.some(e=>{
           if(e.name=='admin'||e.name=='creator'|| e.name == 'point_manager'){
             arr.push(item)
+            return true;
           }
         })
       }else{
@@ -307,8 +311,8 @@ Page({
   showText() {
     this.setData({ isBh: !this.data.isBh })
   },
-  openViewRanking(e) {
-    var item = e.target.dataset.item;
+  openViewRanking() {
+    var item = this.data.selectPlItem
     var url = '';
     if (item.type == 'normal') {
       url = '../../statistics/sectionRanking/sectionRanking';
@@ -484,7 +488,6 @@ Page({
   },
   //获取个人统计
   getUserData() {
-    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,
@@ -493,57 +496,65 @@ Page({
       employee_ids: app.globalData.isCreator ? '' : app.globalData.userData.id
     })
     var http3 = app.$get2("api/integral/review/list", { type: 'waiting', source_type: 0, page: 1, pt_id: 0 })
-    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 })// 管理者奖扣任务柱状图
-    var work = app.$get('api/integral/work/list', { status: 'running', page: 1, pt_id: 0, source_type: 0 })// 管理者奖扣任务柱状图
-    var headDayBs = app.$get2("api/integral/statistics", { employee_id: app.globalData.userData.id, day: app.globalData.day },'application/vnd.test.v2+json')//获取个人统计-当天B分 - V2
-    var config = app.$get('api/integral/site/config',{})// 系统配置
+    var ranking = app.$get2('api/integral/statistics/ranking/list', { page: 1, page_size: 100 })// 获取排行榜
+    var task = app.$get2('api/integral/statistics/task/pie', { month: app.globalData.month })// 管理者奖扣任务柱状图
+    var work = app.$get2('api/integral/work/list', { status: 'running', page: 1, pt_id: 0, source_type: 0 })// 管理者奖扣任务柱状图
+    var headDayBs = app.$get2("api/integral/statistics", { employee_id: app.globalData.userData.id, day: app.globalData.day },'application/vnd.test.v3+json')//获取个人统计-当天B分 - V2
+    var config = app.$get2('api/integral/site/config',{})// 系统配置
 
-    Promise.all([http1, http2, http3, ranking, task, work, headDayBs,config]).then(function (values) {
+    Promise.all([http2, http3, ranking, task, work, headDayBs,config]).then(function (values) {
       if (values[0]) {
-        // let data = values[0].data.data;
-        // var task = data.task;
-        // 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
-        // })
-      }
-      if (values[1]) {
-        let data = values[1].data.data.list;
+        let data = values[0].data.data.list;
         data.map((item) => {
           item.ptObj = app.getTypesItem(item.pt_id);
         })
         that.setData({
           incidentLsit: data,
-          incidentLsitTotal: values[1].data.data.total
+          incidentLsitTotal: values[0].data.data.total
         })
       }
-      if (values[2]) {
-        let data = values[2].data.data;
+      if (values[1]) {
+        let data = values[1].data.data;
         that.setData({
           total: data.total
         })
       }
-      if (values[3]) {
+      if (values[2]) {
+        let list=values[2].data.data.list;
         that.setData({
-          rankingList: values[3].data.data.list,
-          rankingTotal: values[3].data.data.total
+          rankingList: list,
+          rankingTotal: values[2].data.data.total
         })
+        if(that.data.selectPlItem.group_name){
+          list.some(item=>{
+            if(item.target_id==0&&that.data.selectPlItem.group_name==item.group_name){
+              that.setData({
+                selectPlItem:item
+              })
+              return true
+            }
+            if(item.target_id==that.data.selectPlItem.target_id){
+              that.setData({
+                selectPlItem:item
+              })
+              return true
+            }
+          })
+        }else{
+          that.setData({
+            selectPlItem:values[2].data.data.list[0]
+          })
+        }
+        that.tabPositions({target:{dataset:{item:that.data.selectPlItem}}});
       }
-      if (values[4]) {
+      if (values[3]) {
         if (that.data.isAdministrator) {
-          var data = values[4].data.data.list
+          var data = values[3].data.data.list
           if (data.length > 5) {
             data.pop()
           }
           that.setData({
-            pieTotal: values[4].data.data.total
+            pieTotal: values[3].data.data.total
           })
           if (that.data.pieTotal != 0) {
             var employees = [];
@@ -563,20 +574,20 @@ Page({
           }
         }
       }
-      if (values[5]) {
-        let data = values[5].data.data;
+      if (values[4]) {
+        let data = values[4].data.data;
         that.setData({
           workTotal: data.total
         })
       }
-      if(values[6]){
-        let data = values[6].data.data;
+      if(values[5]){
+        let data = values[5].data.data;
         that.setData({
           headDayBs:data
         })
       }
-      if(values[7]){
-           let data = values[7].data.data;
+      if(values[6]){
+           let data = values[6].data.data;
            app.globalData.config=data;
            let menuList=JSON.parse(JSON.stringify( that.data.menuList))
            if(data.shop_status==1){
@@ -597,9 +608,141 @@ Page({
       }
     })
   },
+  tabPositions(e) {
+    var item = e.target.dataset.item;
+    this.setData({
+      selectPlItem:item
+    })
+    if (item.type == 'normal') {
+      this.departmentOfRanking();
+    } else if (item.type == 'all') {
+      this.addUpRanking();
+    } else if (item.type == 'custom') {
+      this.customRanking(item.target_id, item.date_interval);
+    }
+  },
+
+  departmentOfRanking(){
+    let data={
+      dept_id: 0,
+      sort: 'DESC',
+      pt_id: 3,
+      time_type: 1,
+      page: 1,
+      page_size: 4,
+      position: 'all',
+      month: moment().format('YYYY-MM'),
+      index_ranking: 1,
+    }
+    app.$get('api/integral/statistics/ranking',data,'application/vnd.test.v2+json').then((res) => {
+      let list=res.data.data.list
+      if(list[0].employee_id!=app.globalData.userData.id){
+        let data={
+          employee_id: app.globalData.userData.id,
+          employee_img_url:  app.globalData.userData.img_url,
+          employee_name: app.globalData.userData.name,
+          rank: '--',
+        }
+        list.unshift(data);
+      }
+      this.setData({
+        rankingListDetails:list
+      })
+    })
+  },
+  addUpRanking() {
+    //累计B分排名
+    let params = {
+      dept_id: 0,
+      sort: 'DESC',
+      page: 1,
+      page_size: 4,
+      pt_id: 3,
+      type: 'all',
+      index_ranking: 1
+    };
+    app.$get('/api/integral/statistics/ranking', params, 'application/vnd.test.v2+json').then(res => {
+      let list=res.data.data.list
+      if(list[0].employee_id!=app.globalData.userData.id){
+        let data={
+          employee_id: app.globalData.userData.id,
+          employee_img_url:  app.globalData.userData.img_url,
+          employee_name: app.globalData.userData.name,
+          rank: '--',
+        }
+        list.unshift(data);
+      }
+      this.setData({
+        rankingListDetails:list
+      })
+    })
+  },
+  //分组排行榜
+  customRanking(target_id, date_interval) {
+        //自定义排名   date_interval=时间
+        let data = {
+          group_id: target_id,
+          pt_id: 3,
+          index_ranking: 1,
+          page_size:4
+        };
+        data.date =
+          date_interval == 1
+            ? moment().format('YYYYMM')
+            : date_interval == 2
+            ? moment().format('YYYYQ')
+            : date_interval == 3
+            ? moment().format('YYYY')
+            : '0';
+          app.$get('/api/integral/statistics/groups/rank', data,'application/vnd.test.v2+json').then(res => {
+            let lists = res.data.data.list;
+            let rankingList = [];
+            let arr = false;
+            for (let i in lists) {
+              let rankingJson = {};
+              if (lists[i].employee_name) {
+                arr = true;
+              } else {
+                arr = false;
+                rankingJson.employee_id = lists[i].employee_id;
+                rankingJson.employee_img_url = lists[i].img_url;
+                rankingJson.employee_name = lists[i].name;
+                rankingJson.point = lists[i].point;
+                rankingJson.rank = lists[i].rank;
+                rankingJson.status_remark = '';
+                rankingList.push(rankingJson);
+              }
+            }
+            if (arr) {
+              if(lists[0].employee_id!=app.globalData.userData.id){
+                let data={
+                  employee_id: app.globalData.userData.id,
+                  employee_img_url:  app.globalData.userData.img_url,
+                  employee_name: app.globalData.userData.name,
+                  rank: '--',
+                }
+                lists.unshift(data);
+              }
+
+              this.setData({rankingListDetails:lists })
+            } else {
+              if(rankingList[0].employee_id!=app.globalData.userData.id){
+                let data={
+                  employee_id: app.globalData.userData.id,
+                  employee_img_url:  app.globalData.userData.img_url,
+                  employee_name: app.globalData.userData.name,
+                  rank: '--',
+                }
+                rankingList.unshift(data);
+              }
+
+              this.setData({rankingListDetails:rankingList})
+            }
+          })
+  },
   //获取积分事件
   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.$get2("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);

+ 43 - 2
pages/workbench/jk_B/jk_B.acss

@@ -9,7 +9,7 @@
 }
 .label{
   position: relative;
-  width: 160rpx;
+  width: 180rpx;
   font-size: 32rpx
 }
 .isBt::before{
@@ -189,4 +189,45 @@ textarea::before{
 }
 .results:nth-child(odd){
   background-color: #f1f1f1;
-}
+}
+.text2 {
+  border-radius: 50%;
+  border: 1px solid #909399;
+  color: #909399;
+  width: 26rpx;
+  height: 26rpx;
+  font-size: 22rpx;
+  text-align: center;
+  display: inline-block;
+  margin-left: 10rpx;
+  position: relative;
+  line-height: 26rpx;
+  box-sizing: border-box;
+}
+
+.windows-box2 {
+  background: #fff;
+  border-radius: 20rpx;
+  position: absolute;
+  left: 10%;
+  right: 10%;
+  top: 40%;
+  margin-top: -25%;
+}
+
+.windows-title2 {
+  padding: 32rpx;
+  color: #999;
+  font-size: 24rpx;
+}
+.windows-btn2 view:nth-child(1) {
+  text-align: right;
+  padding: 32rpx;
+  color: #26A2FF;
+}
+
+.windows-content2{
+  height: 1rem;
+  padding: 0 28rpx;
+  font-size: 32rpx;
+}

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

@@ -83,6 +83,12 @@
           <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 border-bottom" style="padding:26rpx 28rpx;" data-index="{{index}}">
+          <view class="label">发放奖票<text class="text2" catchTap="showText">?</text></view>
+          <view class="flex-1"></view>
+          <switch onChange="switchChange2" disabled="{{item.revieweName? true:false}}" checked="{{item.ticket_count}}" data-index="{{index}}" color="#26A2FF"></switch>
+        </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>
@@ -193,5 +199,14 @@
       </view>
     </view>
   </view>
-  
+  <!-- 弹窗 -->
+  <view a:if="{{isBh}}" class="windows">
+    <view class="windows-box2">
+      <view class="windows-title2">温馨提示</view>
+      <view class="windows-content2">选择递交审批人时,发放奖票将失效,由审批上级来发放奖票</view>
+      <view class="windows-btn2 flex-box flex-v-ce">
+        <view class="flex-1" catchTap="showText">我知道了</view>
+      </view>
+    </view>
+  </view>
 </view>

+ 29 - 1
pages/workbench/jk_B/jk_B.js

@@ -31,6 +31,7 @@ Page({
     isShowError: false,
     errorList: [],
     isErrorShow: false,
+    isBh:false,
   },
   onLoad(data) {
     that = this;
@@ -40,6 +41,7 @@ Page({
       isGzType: data.type == "B" ? "BF" : "AF",
       isCreator: app.globalData.isCreator,
       items: [{//录入选项列表
+        ticket_count:false,
         checked: true,//判断是否开启指定规则
         rule_id: '',//积分分类id
         rule_id2: '',
@@ -84,6 +86,11 @@ Page({
   onUnload() {
     app.globalData.socketApi.closewebsocket();
   },
+
+  showText() {
+    this.setData({ isBh: !this.data.isBh })
+  },
+
   //显示图片
   showImg(e) {
     var index = e.target.dataset.index;
@@ -348,7 +355,8 @@ Page({
       this.showToast('一次只能添加10条奖扣')
       return;
     }
-    var arr = {//录入选项列表
+    var arr = {//录入选项列表.
+      ticket_count:false,
       checked: true,
       rule_id: '',
       rule_id2: '',
@@ -455,6 +463,7 @@ Page({
       obj.pt_id = pt_id;
       obj.reviewer_id = item.reviewer_id ? item.reviewer_id : 0;
       obj.files = item.files;
+      obj.ticket_count=item.ticket_count? 1:0,
       arr.push(obj);
     }
     var userIds = []
@@ -600,6 +609,14 @@ Page({
       [item]: e.detail.value
     })
   },
+  switchChange2(e) {
+    var index = e.target.dataset.index;
+    var item = `items[${index}].ticket_count`;
+    that.setData({
+      [item]: e.detail.value
+    })
+  },
+
   //选择时间
   openDate(e) {
     var index = e.target.dataset.index;
@@ -642,10 +659,21 @@ Page({
     var index = this.data.activeIndex;
     var reviewer_id = `items[${index}].reviewer_id`
     var revieweName = `items[${index}].revieweName`
+    var ticket_count = `items[${index}].ticket_count`
+
+    var getTicket_count = this.data.items[index].ticket_count;
     that.setData({
       [reviewer_id]: elm.id,
       [revieweName]: elm.name,
     });
+    if(elm.id){
+      that.setData({
+        [ticket_count]:false
+      });
+      if(getTicket_count){
+        app.globalData.showToast("选择递交审批人时,发放奖票将失效,由审批上级来发放奖票");
+      }
+    }
   },
 
   //选择规则分类

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

@@ -61,8 +61,8 @@
             <view class="context" a:else>{{item.remark.rule}}</view>
             <view class="flex-box flex-v-ce" style="margin-bottom:28rpx">
               <view class="date flex-1">{{item.event_time}}</view>
-              <view class="greenBox" a:if="{{item.status==1}}">审批通过</view>
-              <view class="redBox" a:if="{{item.status==2}}">审批驳回</view>
+              <view class="greenBox" a:if="{{item.review_status==1}}">审批通过</view>
+              <view class="redBox" a:if="{{item.review_status==2}}">审批驳回</view>
             </view>
           </view>
         </view>

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

@@ -153,7 +153,7 @@ Page({
           let data = res.result;
           var task = data.task;
           var ratio = task.ratio.enable== 0 ? '-' : `${task.ratio.reward_ratio}:1`
-          var target_ratio = task.ratio.target <= 0 ? '0:0' : `${task.ratio.target}:1`
+          var target_ratio = task.ratio.target <= 0 ? '0:1' : `${task.ratio.target}:1`
           dd.setNavigationBar({ title: data.name });
           data.ratio = {
             ratio: ratio,

+ 7 - 0
pages/workbench/review/review.axml

@@ -70,6 +70,13 @@
                 <text catchTap="openBh" data-index="1" data-item="{{item}}" class="text">通过</text>
                 <text catchTap="openBh" data-index="2" data-item="{{item}}" class="red">不通过</text>
               </view>
+              <block a:if="{{minuteIndex == 1}}">
+                <view class="red da" a:if="{{item.point>0}}">+{{item.point}} {{item.pt_id==3? 'B分':'A分'}}</view>
+                <view class="green da" a:else>{{item.point}} {{item.pt_id==3? 'B分':'A分'}}</view>
+
+                <!-- <text class="greenBox" style="font-size:0.28rem" a:if="{{item.dc_status == 1}}">通过</text>
+                <text class="redBox" style="font-size:0.28rem" a:if="{{item.dc_status == 2}}">不通过</text> -->
+              </block>
             </view>
           </view>
         </view>

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

@@ -1,15 +1,15 @@
 <view>
     <view class="head flex-box flex-center-center">
     <view class="flex-1">
-      <view>{{data_a.month_point}}</view>
-      <view>月A分</view>
+      <view>{{data_a.a}}</view>
+      <view>{{monthStr}}月A分</view>
     </view>
     <view class="flex-1">
-      <view>{{data_a.year_point}}</view>
-      <view>年A分</view>
+      <view>{{data_year.a}}</view>
+      <view>{{year}}年A分</view>
     </view>
     <view class="flex-1">
-      <view>{{data_a.total_point}}</view>
+      <view>{{data_a.a_total}}</view>
       <view>累计A分</view>
     </view>
   </view>
@@ -29,7 +29,7 @@
   </view>
   <view class="main">
       <view class="flex-box">
-         <view class="title flex-1">月A分事件</view>
+         <view class="title flex-1">月A分事件</view>
          <view class="gengduo" catchTap="openMore">更多<image mode="scaleToFill"  src="../../../image/right.png"/></view>
       </view>
       <view>

+ 34 - 10
pages/workbench/statistics_A/statistics_A.js

@@ -2,6 +2,7 @@
 var app = getApp()
 var that;
 var chart1;
+import moment from 'moment' // 时间库
 Page({
   data: {
     date: app.globalData.month,
@@ -74,16 +75,39 @@ Page({
   },
   //获取积分事件
   getIncidentLsit() {
-    app.$get("api/integral/statistics/a", { employee_id: that.data.employee_id, month: that.data.date }).then((res) => {
-      const { a, chart, list } = res.data.data
-      const points = chart.reward.map((rewardItem, index) => {
-        return { date: rewardItem.month, value: rewardItem.point - (chart.deduction[index].point || 0) }
-      })
-      chart1.changeData(points);
-      that.setData({
-        data_a: a,
-        dataList: list
-      });
+    var http1 =  app.$get("api/integral/statistics/a", { employee_id: that.data.employee_id, month: that.data.date });
+    var headDayBs = app.$get2("api/integral/statistics", { employee_id:  that.data.employee_id,month: that.data.date},'application/vnd.test.v3+json')//获取个人统计-当天B分 - V2
+    var headDayBs2 = app.$get2("api/integral/statistics", { employee_id: that.data.employee_id,year:moment(that.data.date).format('YYYY')},'application/vnd.test.v3+json')//获取个人统计-当天B分 - V2
+    Promise.all([http1,headDayBs,headDayBs2]).then(resArr => {
+      if (resArr[0].data.code == 1) {
+        const {chart, list } = resArr[0].data.data
+        const points = chart.reward.map((rewardItem, index) => {
+          return { date: rewardItem.month, value: rewardItem.point - (chart.deduction[index].point || 0) }
+        })
+        chart1.changeData(points);
+        that.setData({
+          dataList: list
+        });
+      }
+      if (resArr[1].data.code == 1) {
+        const data = resArr[1].data.data
+        that.setData({
+          data_a: data,
+          monthStr:moment(that.data.date).format('M'),
+        });
+      }
+      if (resArr[2].data.code == 1) {
+        const data = resArr[2].data.data
+        that.setData({
+          data_year: data,
+          year:moment(that.data.date).format('YYYY'),
+        });
+      }
+
+
+
+
+
     })
   },
 });

+ 13 - 19
pages/workbench/statistics_B/statistics_B.axml

@@ -1,45 +1,39 @@
 <view>
     <view class="head flex-box flex-center-center">
     <view class="flex-1">
-      <view>{{data_b.month_point}}</view>
-      <view>月B分</view>
+      <view>{{data_b.b}}</view>
+      <view>{{monthStr}}月B分</view>
     </view>
     <view class="flex-1">
-      <view>{{data_b.year_point}}</view>
-      <view>年B分</view>
+      <view>{{data_year.b}}</view>
+      <view>{{year}}年B分</view>
     </view>
     <view class="flex-1">
-      <view>{{data_b.total_point}}</view>
+      <view>{{data_b.b_total}}</view>
       <view>累计B分</view>
     </view>
   </view>
   <view class="headed margin-bottom">
     <view class="top">
       <view class="dates" style="padding:10rpx 0" catchTap="openDate">
-            <image mode="scaleToFill" src="../../../image/date.png"/>
-            <text style="font-size:32rpx;position: relative;" class="{{showDate? 'activeView':''}}">{{date}}</text>
+          <image mode="scaleToFill" src="../../../image/date.png"/>
+          <text style="font-size:32rpx;position: relative;" class="{{showDate? 'activeView':''}}">{{date}}</text>
       </view>
     </view>
     <view class="headed-box">
       <view class="title" style="padding-bottom:0rpx">近半年的B分</view>
-       <view class="f2-chart">
-          <f2 onInit="onInitChart"></f2>
-        </view>
+       <view class="f2-chart"><f2 onInit="onInitChart"></f2></view>
     </view>
   </view>
   <view class="main margin-bottom">
-     <view class="title">B分构成
-      <text class="text2" catchTap="showText">?</text>
-    </view>
-     <view class="f2-chart" a:if="{{pieData.length>0}}" style="height:800rpx">
-        <f2 onInit="onInitChart2"></f2>
-    </view>
+     <view class="title">B分构成<text class="text2" catchTap="showText">?</text></view>
+     <view class="f2-chart" a:if="{{pieData.length>0}}" style="height:800rpx"><f2 onInit="onInitChart2"></f2></view>
     <view style="padding-left:18px" a:if="{{pieData.length==8}}">...</view>
     <no-data a:if="{{pieData.length==0}}" content="无数据" />
   </view>
   <view class="main margin-bottom">
       <view class="flex-box">
-         <view class="title flex-1">奖分最多</view>
+         <view class="title flex-1">奖分最多</view>
          <view class="gengduo" catchTap="openMore">更多<image mode="scaleToFill"  src="../../../image/right.png"/></view>
       </view>
       <view>
@@ -56,7 +50,7 @@
   </view>
     <view class="main">
       <view class="flex-box">
-         <view class="title flex-1">扣分最多</view>
+         <view class="title flex-1">扣分最多</view>
          <view class="gengduo" catchTap="openMore">更多<image mode="scaleToFill" src="../../../image/right.png"/></view>
       </view>
       <view>
@@ -68,7 +62,7 @@
               <view class="num green" a:else>{{item.point}}</view>
             </block>
           </view>
-           <no-data a:if="{{data_bad.length==0}}" content="无数据" />
+          <no-data a:if="{{data_bad.length==0}}" content="无数据" />
       </view>
   </view>
   <view a:if="{{isBh}}" class="windows" >

+ 42 - 21
pages/workbench/statistics_B/statistics_B.js

@@ -3,20 +3,23 @@ var app = getApp()
 var that;
 var chart1;
 var chart2;
+import moment from 'moment' // 时间库
 Page({
   data: {
     date: app.globalData.month,
-    // date:'2021-07' ,
-    data_b: [],
+    data_b: {},
     chartData: [],//折线图数据
     pieData: [1],//饼型图数据
     isShowTb:true,
     employee_id:app.globalData.userData.id||0,
-    isBh:false
+    isBh:false,
+    year:moment().format('YYYY'),
+    data_year:{},
+    userName:'',
   },
   onLoad(e) {
     if(e.employee_id){
-      this.setData({employee_id:e.employee_id})
+      this.setData({employee_id:e.employee_id,userName:e.name? e.name:null})
       dd.setNavigationBar({ title: `${e.name}的B分统计` });
     }else{
       dd.setNavigationBar({ title: "我的B分统计" });
@@ -26,8 +29,9 @@ Page({
   },
   //打开更多
   openMore() {
+    console.log(this.data.userName,this.data.employee_id)
     dd.navigateTo({
-      url: '../../statistics/integralEvent/integralEvent?month=' + this.data.date + '&type=BF'
+      url: '../../statistics/integralEvent/integralEvent?month=' + this.data.date + '&type=BF&employee_ids='+this.data.employee_id+'&userName='+this.data.userName
     })
   },
   showText() {
@@ -36,12 +40,7 @@ Page({
   //则线图
   onInitChart(F2, config) {
     chart1 = new F2.Chart(config);
-    chart1.source(that.data.chartData, {
-      date: {
-        // range: [0, 1],
-        tickCount: 5
-      }
-    });
+    chart1.source(that.data.chartData, {date: {tickCount: 5}});
     chart1.tooltip({
       showCrosshairs: true,
       showItemMarker: false,
@@ -56,7 +55,7 @@ Page({
       stroke: '#fff',
       lineWidth: 1
     });
-    that.getIncidentLsit();
+    // that.getIncidentLsit();
     chart1.render();
     return chart1;
   },
@@ -148,22 +147,23 @@ Page({
       }
       start_date =n+"-"+y;
     }
-    let employee_id=that.data.employee_id||app.globalData.userData.id
-
+    let employee_id=that.data.employee_id||app.globalData.userData.id;
     var incident = app.$get("api/integral/statistics/b", { employee_id: employee_id, start_date: start_date, end_date: that.data.date, show_type: '2' });
     var pei = app.$get("api/integral/statistics/pie/b", { employee_id: employee_id, month: that.data.date },'application/vnd.test.v2+json');
-    Promise.all([incident,pei]).then(resArr => {
+    var headDayBs = app.$get2("api/integral/statistics", { employee_id: employee_id,month: that.data.date},'application/vnd.test.v3+json')//获取个人统计-当天B分 - V2
+    var headDayBs2 = app.$get2("api/integral/statistics", { employee_id: employee_id,year:moment(that.data.date).format('YYYY')},'application/vnd.test.v3+json')//获取个人统计-当天B分 - V2
+    var incident2 = app.$get("api/integral/statistics/b", { employee_id: employee_id, start_date:moment(that.data.date).startOf('month').format('YYYY-MM-DD'), end_date:moment(that.data.date).endOf('month').format('YYYY-MM-DD'), show_type: '1' });
+    Promise.all([incident,pei,headDayBs,headDayBs2,incident2]).then(resArr => {
       if (resArr[0].data.code == 1) {
-        const { b, chart, good, bad } = resArr[0].data.data
+        const {chart} = resArr[0].data.data;
         const points = chart.reward.map((rewardItem, index) => {
           return { date: rewardItem.date, value: rewardItem.point - (chart.deduction[index].point || 0) }
         })
         chart1.changeData(points);
-        that.setData({
-          data_b: b,
-          data_good: good,
-          data_bad: bad,
-        });
+        // that.setData({
+        //   data_good: good,
+        //   data_bad: bad,
+        // });
       }
       if (resArr[1].data.code == 1) {
         let pieData=[];
@@ -180,6 +180,27 @@ Page({
         });
         chart2.changeData(pieData);
       }
+      if (resArr[2].data.code == 1) {
+        const data = resArr[2].data.data
+        that.setData({
+          data_b: data,
+          monthStr:moment(that.data.date).format('M'),
+        });
+      }
+      if (resArr[3].data.code == 1) {
+        const data = resArr[3].data.data
+        that.setData({
+          data_year: data,
+          year:moment(that.data.date).format('YYYY'),
+        });
+      }
+      if (resArr[4].data.code == 1) {
+        const {good, bad } = resArr[4].data.data
+        that.setData({
+          data_good: good,
+          data_bad: bad
+        });
+      }
     }).catch(e => {
       console.error(e)
     })