Bladeren bron

规则拖动版本

guojy 1 jaar geleden
bovenliggende
commit
d72342c829
61 gewijzigde bestanden met toevoegingen van 974 en 317 verwijderingen
  1. 8 3
      .mini-ide/compileMode.json
  2. 7 0
      .mini-ide/launch.json
  3. 0 3
      Component/aParse/html2json.js
  4. 4 4
      Component/selectDate_two/selectDate_two.js
  5. 7 3
      Component/selectRule/selectRule.axml
  6. 24 26
      Component/selectRule/selectRule.js
  7. 2 2
      Component/selectType/selectType.axml
  8. 2 2
      app.js
  9. 3 1
      app.json
  10. 3 3
      pages/arLogin/arLogin.json
  11. 5 0
      pages/deploy/organization/organization.js
  12. 13 1
      pages/deploy/setCheck/setCheck.axml
  13. 65 0
      pages/deploy/tb/tb.acss
  14. 23 0
      pages/deploy/tb/tb.axml
  15. 100 0
      pages/deploy/tb/tb.js
  16. 5 0
      pages/deploy/tb/tb.json
  17. 21 0
      pages/statistics/assaign/assaign.js
  18. 19 0
      pages/statistics/assaign_set/assaign_set.js
  19. 1 1
      pages/statistics/checkDetail/checkDetail.axml
  20. 2 0
      pages/statistics/check_top/check_top.js
  21. 18 20
      pages/statistics/getTask/getTask.axml
  22. 75 15
      pages/statistics/getTask/getTask.js
  23. 2 2
      pages/statistics/index/index.js
  24. 3 1
      pages/statistics/log_rank/log_rank.js
  25. 4 0
      pages/statistics/my_issue/my_issue.acss
  26. 20 8
      pages/statistics/my_issue/my_issue.axml
  27. 2 3
      pages/statistics/my_issue/my_issue.js
  28. 2 2
      pages/statistics/my_task/my_task.axml
  29. 26 6
      pages/statistics/offerAreward/offerAreward.axml
  30. 57 5
      pages/statistics/offerAreward/offerAreward.js
  31. 2 1
      pages/statistics/offerAreward/offerAreward.json
  32. 22 1
      pages/statistics/offerAreward_set/offerAreward_set.axml
  33. 64 11
      pages/statistics/offerAreward_set/offerAreward_set.js
  34. 2 1
      pages/statistics/offerAreward_set/offerAreward_set.json
  35. 16 10
      pages/statistics/repetitive_tasks_detail/repetitive_tasks_detail.axml
  36. 3 1
      pages/statistics/sectionRanking/sectionRanking.js
  37. 7 1
      pages/statistics/taskDetail/taskDetail.acss
  38. 24 22
      pages/statistics/taskDetail/taskDetail.axml
  39. 27 13
      pages/statistics/taskDetail/taskDetail.js
  40. 8 1
      pages/statistics/task_rank/task_rank.js
  41. 8 0
      pages/statistics/userList/userList.acss
  42. 28 0
      pages/statistics/userList/userList.axml
  43. 28 0
      pages/statistics/userList/userList.js
  44. 6 0
      pages/statistics/userList/userList.json
  45. 1 28
      pages/statistics/workDetail/workDetail.axml
  46. 1 1
      pages/statistics/workDetail/workDetail.js
  47. 3 2
      pages/workbench/apply/apply.axml
  48. 28 9
      pages/workbench/apply/apply.js
  49. 1 1
      pages/workbench/index/index.axml
  50. 45 24
      pages/workbench/index/index.js
  51. 3 2
      pages/workbench/jk_B/jk_B.axml
  52. 44 23
      pages/workbench/jk_B/jk_B.js
  53. 1 1
      pages/workbench/my_approve/my_approve.axml
  54. 3 0
      pages/workbench/my_approve/my_approve.js
  55. 1 2
      pages/workbench/prize_buckle/prize_buckle.js
  56. 1 1
      pages/workbench/review/review.acss
  57. 31 38
      pages/workbench/review/review.axml
  58. 40 9
      pages/workbench/review/review.js
  59. 1 1
      pages/workbench/tZpoint/tZpoint.acss
  60. 1 1
      pages/workbench/tZpoint/tZpoint.axml
  61. 1 1
      utils/websocket.js

+ 8 - 3
.mini-ide/compileMode.json

@@ -34,7 +34,7 @@
       "page": "pages/statistics/sectionRanking/sectionRanking"
     },
     {
-      "title": "悬赏任务详情",
+      "title": "抢单任务详情",
       "page": "pages/statistics/taskDetail/taskDetail",
       "pageQuery": "id=2538"
     },
@@ -81,9 +81,9 @@
       "update": true
     },
     {
-      "title": "发布悬赏任务",
+      "title": "发布抢单任务",
       "page": "pages/statistics/offerAreward/offerAreward",
-      "pageQuery": "yData={\"id\":124,\"site_id\":124,\"owner_id\":181,\"owner_name\":\"郭家裕\",\"pt_id\":3,\"pt_name\":\"B分\",\"pt_code\":\"BF\",\"type\":2,\"type_mark\":\"任务模板\",\"reviewer_id\":181,\"reviewer_name\":\"郭家裕\",\"name\":\"悬赏任务\",\"remark\":\"随便加27\",\"point_config\":{\"standard\":{\"qualified\":0,\"satisfied\":0,\"unqualified\":0,\"super_satisfied\":0},\"item_info\":{\"id\":703,\"remark\":\"随便加27\",\"rule_id\":215,\"max_point\":110,\"min_point\":110,\"prize_type\":0,\"range_type\":1},\"rule_info\":{\"id\":215,\"name\":\"奖分\"},\"tree_echo\":[\"215\",\"703\"],\"base_point\":\"110\",\"ahead_award_point\":\"1\",\"ahead_award_point_limit\":\"2\",\"timeout_deduction_point\":\"2\",\"timeout_deduction_point_limit\":\"4\"},\"target_info\":[],\"department_info\":[{\"id\":608966095,\"name\":\"技术部\"},{\"id\":608966096,\"name\":\"市场部\"}],\"task_cycle_value\":5,\"task_cycle\":3,\"task_cycle_mark\":\"每月\",\"file_list\":[\"https://integralsys.oss-cn-shenzhen.aliyuncs.com/intesys/dd/17/2022/08/02/NNfJtZQyfp4kkAecEkESJFNAZYhjPHmP.png\",\"https://integralsys.oss-cn-shenzhen.aliyuncs.com/intesys/dd/17/2022/08/02/YQWDHZnRSsmc4pfEjfnjNm835ktbDQC5.png\",\"https://integralsys.oss-cn-shenzhen.aliyuncs.com/intesys/dd/17/2022/08/02/GFXzAQD6d6zcBirwTedbMC4z7pBNGDKz.png\"],\"create_time\":\"2022-08-02\",\"update_time\":\"2022-08-02\",\"img_url\":\"https://static-legacy.dingtalk.com/media/lADPBF8a7BNICxrNAcDNAcA_448_448.jpg\"}"
+      "pageQuery": "yData={\"id\":124,\"site_id\":124,\"owner_id\":181,\"owner_name\":\"郭家裕\",\"pt_id\":3,\"pt_name\":\"B分\",\"pt_code\":\"BF\",\"type\":2,\"type_mark\":\"任务模板\",\"reviewer_id\":181,\"reviewer_name\":\"郭家裕\",\"name\":\"抢单任务\",\"remark\":\"随便加27\",\"point_config\":{\"standard\":{\"qualified\":0,\"satisfied\":0,\"unqualified\":0,\"super_satisfied\":0},\"item_info\":{\"id\":703,\"remark\":\"随便加27\",\"rule_id\":215,\"max_point\":110,\"min_point\":110,\"prize_type\":0,\"range_type\":1},\"rule_info\":{\"id\":215,\"name\":\"奖分\"},\"tree_echo\":[\"215\",\"703\"],\"base_point\":\"110\",\"ahead_award_point\":\"1\",\"ahead_award_point_limit\":\"2\",\"timeout_deduction_point\":\"2\",\"timeout_deduction_point_limit\":\"4\"},\"target_info\":[],\"department_info\":[{\"id\":608966095,\"name\":\"技术部\"},{\"id\":608966096,\"name\":\"市场部\"}],\"task_cycle_value\":5,\"task_cycle\":3,\"task_cycle_mark\":\"每月\",\"file_list\":[\"https://integralsys.oss-cn-shenzhen.aliyuncs.com/intesys/dd/17/2022/08/02/NNfJtZQyfp4kkAecEkESJFNAZYhjPHmP.png\",\"https://integralsys.oss-cn-shenzhen.aliyuncs.com/intesys/dd/17/2022/08/02/YQWDHZnRSsmc4pfEjfnjNm835ktbDQC5.png\",\"https://integralsys.oss-cn-shenzhen.aliyuncs.com/intesys/dd/17/2022/08/02/GFXzAQD6d6zcBirwTedbMC4z7pBNGDKz.png\"],\"create_time\":\"2022-08-02\",\"update_time\":\"2022-08-02\",\"img_url\":\"https://static-legacy.dingtalk.com/media/lADPBF8a7BNICxrNAcDNAcA_448_448.jpg\"}"
     },
     {
       "title": "使用指南",
@@ -112,6 +112,11 @@
     {
       "title": "续费",
       "page": "pages/deploy/addMoney/addMoney"
+    },
+    {
+      "title": "同步",
+      "page": "pages/deploy/tb/tb",
+      "pageQuery": ""
     }
   ]
 }

+ 7 - 0
.mini-ide/launch.json

@@ -0,0 +1,7 @@
+{
+  // 使用 IntelliSense 了解相关属性。 
+  // 悬停以查看现有属性的描述。
+  // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
+  "version": "0.2.0",
+  "configurations": []
+}

+ 0 - 3
Component/aParse/html2json.js

@@ -174,9 +174,6 @@ function html2json(html, bindName) {
             }
             
             if (unary) {
-                // if this tag doesn't have end tag
-                // like <img src="hoge.png"/>
-                // add to parents
                 var parent = bufArray[0] || results;
                 if (parent.nodes === undefined) {
                     parent.nodes = [];

+ 4 - 4
Component/selectDate_two/selectDate_two.js

@@ -127,10 +127,10 @@ Component({
             app.globalData.showToast("开始时间不能大于结束时间")
             return
           }
-          if(Math.abs(timeC) > 30) {
-            app.globalData.showToast("自定义事件区间不能大于一个月")
-            return
-          }
+          // if(Math.abs(timeC) > 30) {
+          //   app.globalData.showToast("自定义事件区间不能大于一个月")
+          //   return
+          // }
           obj = {
             type: this.data.dateIndex,
             date: {

+ 7 - 3
Component/selectRule/selectRule.axml

@@ -41,12 +41,16 @@
             </view>
           </label>
         </radio-group>
-        <view a:if="{{item_list.length==0}}" class="nodata fontColorB">
+        <view a:if="{{item_list.length==0&&item_child_list.length==0}}" class="nodata fontColorB">
           <view>
             <image mode="scaleToFill" src="../../../image/noData.png" style="width: 340rpx;height: 340rpx;margin-bottom:20rpx;"/>
           </view>
-          <text a:if="{{isCreator}}">暂无积分规则,请前往钉钉电脑端添加【积分规则】</text>
-          <text a:else>暂无积分规则,请联系系统管理员“{{creatorName}}”或积分管理员前往钉钉电脑添加【积分规则】</text>
+          <text a:if="{{isCreator}}">暂无积分规则,请前往钉钉电脑端-工作台-进入“功道云积分制”-设置-积分规则 设置添加</text>
+          <text a:else>
+            暂无积分规则,请联系系统管理员“{{creatorName}}”或积分管理员添加【积分规则】或调整【规则分类】的可见范围
+            <!-- 暂无积分规则,请联系系统管理员“{{creatorName}}”或积分管理员前往钉钉电脑添加【积分规则】 -->
+
+          </text>
         </view>
       </view>
     </scroll-view>

+ 24 - 26
Component/selectRule/selectRule.js

@@ -38,15 +38,15 @@ Component({
     },
     //搜索
     bindKeyInput(e) {
-        var item_list=this.data.allItems;
-        var items=item_list.filter((item)=>{
-            return item.remark.indexOf(e.detail.value) >= 0
-        });
-        this.setData({
-          selectItem: items,
-          isItem:e.detail.value? false:true,
-          isVal:e.detail.value? true:false
-        })
+      var item_list=this.data.allItems;
+      var items=item_list.filter((item)=>{
+          return item.remark.indexOf(e.detail.value) >= 0
+      });
+      this.setData({
+        selectItem: items,
+        isItem:e.detail.value? false:true,
+        isVal:e.detail.value? true:false
+      })
     },
     //点击一级
     activeTree(e){
@@ -61,20 +61,18 @@ Component({
         })
         return false;
       }
-      if(item.child&&item.child.length>0){
-          // this.setData({
-          //   activeItemIndex:item.child[0].id
-          // })
-        // if(item.child[0].child&&item.child[0].child.length>0){
-        //   this.setData({
-        //     item_child_list:item.child[0].child
-        //   })
-        // }
-      }
       this.setData({
         activeIndex:item.id,
-        item_child_list:[]
       })
+      if(item.child&&item.child.length>0){
+        this.setData({
+          item_child_list:item.child
+        })
+      }else{
+        this.setData({
+          item_child_list:[]
+        })
+      }
       this.getItem(item.id);
     },
     //点击二级
@@ -85,13 +83,13 @@ Component({
         item_list:[]
       });
       if(item.child&&item.child.length>0){
-          this.setData({
-            item_child_list:item.child
-          })
+        this.setData({
+          item_child_list:item.child
+        })
       }else{
-          this.setData({
-            item_child_list:[]
-          })
+        this.setData({
+          item_child_list:[]
+        })
       }
      this.getItem(item.id);
     },

+ 2 - 2
Component/selectType/selectType.axml

@@ -25,8 +25,8 @@
             <view>
               <image mode="scaleToFill" src="../../../image/noData.png" style="width: 340rpx;height: 340rpx;margin-bottom:20rpx;"/>
             </view>
-            <text a:if="{{isCreator}}">暂无积分分类,请前往钉钉电脑端添加【积分分类】</text>
-            <text a:else>暂无积分分类,请联系主管理员“{{creatorName}}”或积分管理员前往钉钉电脑添加【积分分类】</text>
+            <text a:if="{{isCreator}}">暂无积分规则分类,请前往钉钉电脑端-工作台-进入“功道云积分制”-设置-积分规则 设置添加</text>
+            <text a:else>暂无积分规则分类,请联系系统管理员“{{creatorName}}”或积分管理员添加【规则分类】或调整【规则分类】的可见范围</text>
          </view>
       </scroll-view>
    </view>

+ 2 - 2
app.js

@@ -1,7 +1,7 @@
 import { showToast } from './utils/feedback'
 import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 import * as socketApi from './utils/websocket'
-import { onSubscribeAppBack,openSubscribeMiniApp } from 'dingtalk-service-window-libs/lib/openSubscribeMiniApp'
+import { onSubscribeAppBack} from 'dingtalk-service-window-libs/lib/openSubscribeMiniApp'
 
 // const baseUrl = "https://test-ding.g107.com/";//测试
 const baseUrl = "https://app55493.eapps.dingtalkcloud.com/";//正式
@@ -375,5 +375,5 @@ App({
         // });
         return data;
     });
-   },
+  },
 });

+ 3 - 1
app.json

@@ -88,7 +88,9 @@
     "pages/statistics/awardJl/awardJl",
     "pages/statistics/awardDetail/awardDetail",
     "pages/arLogin/arLogin",
-    "pages/statistics/awardTj/awardTj"
+    "pages/statistics/awardTj/awardTj",
+    "pages/statistics/userList/userList",
+    "pages/deploy/tb/tb"
   ],
   "window": {
     "defaultTitle": "功道云",

+ 3 - 3
pages/arLogin/arLogin.json

@@ -1,7 +1,7 @@
+
 {
-  "component": true,
-    "usingComponents": {
+  "usingComponents": {
     "img-box": "/Component/img-box/index",
-    "no-data": "/Component/noData/noData"
+    "no-data":"/Component/noData/noData"
   }
 }

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

@@ -138,6 +138,11 @@ Page({
 		})
 	},
 	tbDd() {
+    // dd.navigateTo({
+    //   url: '../tb/tb'
+    // })
+    // return false;
+
 		dd.confirm({
 			title: '温馨提示',
 			content: '即将同步钉钉通讯录的人员名单,确定同步吗',

+ 13 - 1
pages/deploy/setCheck/setCheck.axml

@@ -23,6 +23,18 @@
           <view>每次扣{{data.on_duty_late}}分</view>
         </view>
       </view>
+      <view class="flex-box li">
+        <view class="li-left">
+          <view>严重迟到</view>
+          <view>每次扣{{data.serious_late}}分</view>
+        </view>
+      </view>
+      <view class="flex-box li">
+        <view class="li-left">
+          <view>旷工迟到</view>
+          <view>每次扣{{data.absenteeism_late}}分</view>
+        </view>
+      </view>
       <!--<view class="flex-box li"><view class="li-left"><view>严重迟到</view><view>加分</view></view><view>{{data.off_duty_early}}</view></view> -->
       <view class="flex-box li">
         <view class="li-left">
@@ -32,7 +44,7 @@
       </view>
       <view class="flex-box li">
         <view class="li-left">
-          <view>旷工</view>
+          <view>旷工缺席</view>
           <view>每次扣{{data.absent}}分</view>
         </view>
       </view>

+ 65 - 0
pages/deploy/tb/tb.acss

@@ -0,0 +1,65 @@
+.radio {
+  margin-bottom: 20rpx;
+}
+.main{
+  padding: 0.24rem 0.32rem;
+  font-size: 32rpx;
+  background-color: #fff;
+  border-bottom: 1px solid #f1f1f1;
+  position: relative;
+  margin-top: 0.24rem;
+}
+.margin-b{
+  margin-bottom: 1rem;
+}
+.userList{
+  height: 0.4rem;
+  font-size: 0.3rem;
+  overflow: hidden;
+	text-overflow: ellipsis;
+	white-space: nowrap;
+  position: absolute;
+  top: 1.6rem;
+  left: 0.9rem;
+  right: 1rem;
+  border: 1px solid #f1f1f1;
+  padding: 0.1rem 0.24rem;
+  border-radius: 3px;
+}
+.box{
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: rgba(0,0,0,0.2);
+  z-index: 999;
+  transform: translate(0,100%);
+}
+.StaffFooter {
+  position: fixed;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: #fff;
+  padding: 0.1rem;
+  border-top: 1px solid #f1f1f1;
+}
+.staffBtn {
+  background: #26A2FF;
+  color: #fff;
+  border-radius: 0.06rem;
+  height: 0.88rem;
+  text-align: center;
+  line-height: 0.88rem;
+  padding: 0 0.2rem;
+}
+.f-left {
+  overflow-x: auto;
+}
+
+.f-left {
+  margin-right: 0.1rem;
+  overflow-x: auto;
+}
+

+ 23 - 0
pages/deploy/tb/tb.axml

@@ -0,0 +1,23 @@
+<view class="{{popupCx}}">
+  <view class="main">
+        <radio-group class="radio-group" onChange="radioChange" name="lib">
+          <label class="radio flex-box {{index==0? 'margin-b':''}}" a:for="{{tbList}}" key="label-{{index}}">
+            <radio value="{{item.id}}" checked="{{item.checked}}"/>
+            <view style="padding-left:12rpx" class="flex-1">
+              <view style="font-size:16px;font-weight: 600;" class="black">{{item.name}}</view>
+              <view style="font-size:12px;padding-top: 5px;" class="fontColorC">{{item.kam}}</view>
+            </view>
+          </label>
+        </radio-group>
+        <view class="userList"  catchTap="openSelect">
+          <text a:if="{{ defaultSection.length==0 }}" class="fontColorC">请选择部门</text>
+          <view a:else class="font-flex-word">{{deptNames}}</view>
+        </view>
+  </view>
+  <view style="padding:0 32rpx;margin-top:1rem">
+    <button disabled="{{disabled}}" type="primary" catchTap="formSubmit">提交</button>
+  </view>
+  <view class="box" animation="{{animationInfo}}">
+    <select-section-bottom defaultSection="{{defaultSection}}" onClose="onClose" onConfirm="onSelectSection" a:if="{{isShowType=='1'}}"/>
+  </view>
+</view>

+ 100 - 0
pages/deploy/tb/tb.js

@@ -0,0 +1,100 @@
+var app = getApp();
+var that;
+var animation;
+Page({
+  data: {
+    tbList: [{
+        id: 1,
+        name: '仅同步指定部门内的人员信息(可多选)',
+        kam: '该选择不会包含子部门人员,请确保选中需要同步的人员的直属部门',
+        checked: true
+      },
+      {
+        id: 2,
+        name: '仅同步部门信息和上下级关系',
+        kam: '仅同步所有部门名称和上下级所属关系,但不同步人员信息'
+      },
+      {
+        id: 3,
+        name: '同步全部部门和人员信息 ',
+        kam: '同步全部信息所需时间较长,请关注同步成功后推送的工作通知'
+      },
+    ],
+    defaultSection:[],
+    popupCx: '',
+    dept_ids:[],
+    selectTbIndex:1,
+  },
+  onLoad(e) {
+    that = this;
+    dd.setNavigationBar({
+      title: "钉钉通讯录同步"
+    });
+  },
+  onShow() {
+    animation = dd.createAnimation({
+      duration: 200,
+      timeFunction: "linear",
+    });
+  },
+    //抢任务
+  formSubmit() {
+      this.setData({ disabled: true })
+      app.$post("api/integral/task", { task_id: this.data.dataDetail.id }).then((res) => {
+        app.globalData.showToast('抢单成功!');
+        setTimeout(() => {
+          dd.navigateBack({ delta: 1 })
+        }, 1000);
+      }).finally(() => {
+        that.setData({ disabled: false })
+      });
+
+  
+  },
+  radioChange(e) {
+    this.setData({
+      selectTbIndex:e.detail.value
+    })
+  },
+  //选择弹窗
+  openSelect(e) {
+    animation.translateY(0).step();
+    that.setData({
+      isShowType: 1,
+      popupCx: 'container__mask',
+      animationInfo: animation.export()
+    });
+  },
+  //关闭规则
+  onClose() {
+    animation.translateY(1200).step();
+    that.setData({
+      isShowType: '',
+      popupCx: '',
+      animationInfo: animation.export()
+    });
+  },
+  //选择部门
+  onSelectSection(e) {
+    var arr = [];
+    if (e.length > 0) {
+      let names='';
+      e.forEach(user => {
+        arr.push(user.id);
+        names+=(user.name+',')
+      })
+
+      that.setData({
+        defaultSection: e,
+        dept_ids: arr,
+        deptNames:names
+      })
+    } else {
+      that.setData({
+        defaultSection: [],
+        dept_ids: [],
+        deptNames:''
+      })
+    }
+  },
+});

+ 5 - 0
pages/deploy/tb/tb.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "select-section-bottom":"/Component/selectSectionBottom/selectSectionBottom"
+  }
+}

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

@@ -448,20 +448,41 @@ Page({
       items.rule_id=items.rule_id2;
       delete items.item_id
     }
+
     if (items.targets.length == 0) {
       this.showToast('请选择执行对象')
       return;
     }
+    if (items.base_point<=0) {
+      this.showToast('任务积分必须大于0,请调整后再发布')
+      return;
+    }
+
     if (!items.reviewer_id) {
       this.showToast('请选择审批人')
       return;
     }
+
     if (items.task_cycle == 0) {
       if (!items.expire_time) {
         this.showToast('请选择截止时间')
         return;
       }
     }
+    if (!items.ahead_award_point && items.ahead_award_point_limit) {
+      this.showToast('设置提前奖分时,需同时设置每天奖分及奖分上限');
+      return;
+    } else if (items.ahead_award_point && !items.ahead_award_point_limit) {
+      this.showToast('设置提前奖分时,需同时设置每天奖分及奖分上限');
+      return;
+    }
+    if (!items.timeout_deduction_point && items.timeout_deduction_point_limit) {
+      this.showToast('设置逾期扣分时,需同时设置每天扣分及扣分上限');
+      return;
+    } else if (items.timeout_deduction_point && !items.timeout_deduction_point_limit) {
+      this.showToast('设置逾期扣分时,需同时设置每天扣分及扣分上限');
+      return;
+    }
 
     if (!items.task_remark) {
       delete items.task_remark

+ 19 - 0
pages/statistics/assaign_set/assaign_set.js

@@ -405,6 +405,10 @@ Page({
       this.showToast('请选择执行对象')
       return;
     }
+    if (items.base_point<=0) {
+      this.showToast('任务积分必须大于0,请调整后再发布')
+      return;
+    }
     if (!items.reviewer_id) {
       this.showToast('请选择审批人')
       return;
@@ -413,6 +417,21 @@ Page({
       this.showToast('请选择截止时间')
       return;
     }
+
+    if (!items.ahead_award_point && items.ahead_award_point_limit) {
+      this.showToast('设置提前奖分时,需同时设置每天奖分及奖分上限');
+      return;
+    } else if (items.ahead_award_point && !items.ahead_award_point_limit) {
+      this.showToast('设置提前奖分时,需同时设置每天奖分及奖分上限');
+      return;
+    }
+    if (!items.timeout_deduction_point && items.timeout_deduction_point_limit) {
+      this.showToast('设置逾期扣分时,需同时设置每天扣分及扣分上限');
+      return;
+    } else if (items.timeout_deduction_point && !items.timeout_deduction_point_limit) {
+      this.showToast('设置逾期扣分时,需同时设置每天扣分及扣分上限');
+      return;
+    }
     if (!items.task_remark) {
       delete items.task_remark
     }

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

@@ -14,7 +14,7 @@
     <scroll-view scroll-y="{{true}}" class="scroll margin-top" a:if="{{list.length>0}}" onScrollToLower="onScrollToLower">
       <view class="flex-box li" a:if="{{list.length>0}}" a:for="{{list}}" a:for-item="val">
         <view class="flex-1">
-          <view>{{val.event_date}} {{val.remark}}</view>
+          <view>{{val.remark}}</view>
           <view class="date fontColorB">时间:{{val.event_date}}</view>
         </view>
         <view class="text-right">

+ 2 - 0
pages/statistics/check_top/check_top.js

@@ -8,6 +8,8 @@ Page({
     minuteArray: [
       { id: 0, name: '总分' },
       { id: 1, name: '迟到' },
+      { id: 23, name: '严重迟到' },
+      { id: 27, name: '旷工迟到' },
       { id: 2, name: '早退' },
       { id: 6, name: '准时打卡' },
       { id: 20, name: '上班缺卡' },

+ 18 - 20
pages/statistics/getTask/getTask.axml

@@ -1,41 +1,39 @@
 <view>
   <view class="header margin-bottom">
     <view class="flex-box flex-v-ce selectItems border-bottom">
-      <view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-1" catchTap="activeItem">待领取</view>
-      <view data-index="2" class="{{activeIndex == 2? 'active':''}} flex-1" catchTap="activeItem">已领取</view>
+      <view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-1" catchTap="activeItem">正在抢单</view>
+      <!-- <view data-index="2" class="{{activeIndex == 2? 'active':''}} flex-1" catchTap="activeItem">抢单结束</view> -->
+      <view data-index="3" class="{{activeIndex == 3? 'active':''}} flex-1" catchTap="activeItem">我抢到的</view>
     </view>
   </view>
   <view class="main scroll">
-    <scroll-view class="scroll" a:if="{{(activeIndex==1)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+    <scroll-view class="scroll" a:if="{{(activeIndex==1||activeIndex==2)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
       <view class="li border-bottom"  a:for="{{list}}" catchTap="openDetail" data-item="{{item}}">
         <view class="flex-box li-top">
           <view class="flex-1">{{item.task_name}}</view>
-          <text class="fontColorC">{{item.base_point}} {{item.pt_name}}</text>
+          <view class="red" a:if="{{item.base_point>0}}">+{{item.base_point}} {{item.pt_name}}</view>
+          <view class="green" a:else>{{item.base_point}} {{item.pt_name}}</view>
         </view>
         <view class="flex-box li-bottom">
-          <text class="flex-1 fontColorC">{{item.end_time}} 截止</text>
-          <button type="primary" class="defBtn" data-item="{{item}}" a:if="{{item.status == '1' && userId != item.owner_id}}">领取任务</button>
+          <text class="flex-1 fontColorC">{{item.expire_time}} 截止</text>
+          <button type="primary" class="defBtn" data-item="{{item}}" a:if="{{activeIndex == 1&&!userInfo.is_creator&&item.owner_id!=userInfo.id&&item.reviewer_id!=userInfo.id}}">抢任务</button>
         </view>
       </view>
       <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
     </scroll-view>
-    <scroll-view class="scroll" a:if="{{activeIndex==2&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
-      <view class="flex-box li border-bottom" data-index="1" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}">
-        <img-box name="{{item.receiver_name}}" imgUrl="{{item.receiver_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.receiver_name}}领取{{item.pt_name}}任务</view>
-            <view class="red" a:if="{{item.base_point>0}}">+{{item.base_point}} {{item.pt_name}}</view>
-            <view class="green" a:else>{{item.base_point}} {{item.pt_name}}</view>
-          </view>
-          <view class="context" a:if="{{item.task_name}}">{{item.task_name}}</view>
-          <view class="flex-box flex-v-ce">
-            <view class="date fontColorC flex-1">{{item.expire_time}} 截止</view>
-          </view>
+    <scroll-view class="scroll" a:if="{{activeIndex==3&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+      <view class="li border-bottom"  a:for="{{list}}" catchTap="openDetail2" data-item="{{item}}">
+        <view class="flex-box li-top">
+          <view class="flex-1">{{item.task_name}}</view>
+          <view class="red" a:if="{{item.point_config.base_point>0}}">+{{item.point_config.base_point}} {{item.pt_name}}</view>
+          <view class="green" a:else>{{item.point_config.base_point}} {{item.pt_name}}</view>
+        </view>
+        <view class="flex-box li-bottom">
+          <text class="flex-1 fontColorC">{{item.expire_time}} 截止</text>
         </view>
       </view>
       <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
     </scroll-view>
-    <no-data a:if="{{list.length==0}}" content="你来迟了,任务已经被抢光了..."></no-data>
+    <no-data a:if="{{list.length==0}}" content="暂无数据"></no-data>
   </view>
 </view>

+ 75 - 15
pages/statistics/getTask/getTask.js

@@ -7,19 +7,19 @@ Page({
     page: 1,
     hall_type: 'waiting',
     list: [],
-    userId: '',
+    userInfo: '',
   },
   onLoad() {
     that = this;
-    dd.setNavigationBar({ title: "任务" });
+    dd.setNavigationBar({ title: "任务" });
     this.setData({
-      userId: app.globalData.userData.id
+      userInfo: app.globalData.userData
     })
   },
   onShareAppMessage() {
     return {
-      title: '任务',
-      desc: '有新的悬赏任务发布啦,大家快来抢!',
+      title: '任务',
+      desc: '有新的抢单任务发布啦,大家快来抢!',
       path: 'pages/statistics/getTask/getTask'
     };
   },
@@ -27,6 +27,7 @@ Page({
     if (app.globalData.userData) {
       if (that.data.page == 1) {
         dd.hideLoading();
+
         that.getData();
       }
     } else {
@@ -37,7 +38,7 @@ Page({
             that.getData();
           }
           that.setData({
-            userId: app.globalData.userData.id
+            userInfo: app.globalData.userData
           })
         } else {
           dd.reLaunch({
@@ -49,6 +50,10 @@ Page({
 
   },
   getData(is) {
+    if(this.data.activeIndex==3){
+      this.getMyTask();
+      return false
+    }
     var data = {
       page: that.data.page,
       page_size: 20,
@@ -81,16 +86,60 @@ Page({
       }
     })
   },
+  getMyTask(is) {
+    var data = {
+      status:'all',
+      page:that.data.page,
+      page_size:20,
+      source_type:2,
+      sort: 'publish',
+      today: 0
+    }
+    app.$get('api/integral/work/list', data).then((res) => {
+      var data = res.data.data.list;
+      var list = that.data.list;
+      data.forEach(element => {
+        if (element.pt_id) {
+          element.pt_name = app.getTypesItem(element.pt_id).name
+        }
+      });
+      if (is) {
+        if (data.length < 20) {
+          this.setData({
+            list: list.concat(data),
+            isData: true
+          })
+        } else {
+          this.setData({
+            list: list.concat(data)
+          })
+        }
+      } else {
+        this.setData({
+          list: data,
+          isData: false
+        })
+      }
+    })
+  },
   activeItem(e) {
     var index = e.target.dataset.index;
-    this.setData({
-      activeIndex: index,
-      page: 1,
-      list: [],
-      sxObj: [],
-      hall_type: index == 1 ? 'waiting' : 'catch'
-    })
-    this.getData();
+    if(index==3){
+      this.setData({
+        activeIndex: index,
+        page: 1,
+        list: [],
+      })
+      this.getMyTask();
+    }else{
+      this.setData({
+        activeIndex: index,
+        page: 1,
+        list: [],
+        hall_type: index == 1 ? 'waiting' : 'catch'
+      })
+      this.getData();
+    }
   },
   openDetail(e) {
     var id = e.target.dataset.item.id;
@@ -98,11 +147,22 @@ Page({
       url: '../taskDetail/taskDetail?id=' + id
     })
   },
+  openDetail2(e){
+    var id = e.target.dataset.item.id;
+    dd.navigateTo({
+      url: '../workDetail/workDetail?id=' + id
+    })
+  },
   //上啦加载
   onScrollToLower() {
     if (!that.data.isData) {
       this.setData({ page: ++that.data.page })
-      this.getData(true);
+      if(that.data.activeIndex==3){
+        this.getMyTask(true);
+      }else{
+        this.getData(true);
+      }
+      
     }
   },
 });

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

@@ -20,11 +20,11 @@ Page({
       {
         code: '任务管理', child: [
           { name: '指派任务', imgUrl: '../../../image/my_publish.png', url: '../assaign/assaign', code: 'creator admin' },
-          { name: '发布悬赏', imgUrl: '../../../image/caback6.png', url: '../offerAreward/offerAreward', code: 'creator admin ' },
+          { name: '发布抢单', imgUrl: '../../../image/caback6.png', url: '../offerAreward/offerAreward', code: 'creator admin ' },
           { name: '我发布的', imgUrl: '../../../image/my_publish.png', url: '../my_issue/my_issue', code: 'creator admin ' },
           { name: '我的任务', imgUrl: '../../../image/my_task.png', url: '../my_task/my_task', code: 'admin employee' },
           { name: '我审批的', imgUrl: '../../../image/my_examine.png', url: '../my_sp/my_sp', code: 'creator admin' },
-          { name: '任务', imgUrl: '../../../image/task_hall.png', url: '../getTask/getTask', code: 'creator admin employee' },
+          { name: '任务', imgUrl: '../../../image/task_hall.png', url: '../getTask/getTask', code: 'creator admin employee' },
           { name: '全部任务', imgUrl: '../../../image/apply_list.png', url: '../allTask/allTask', code: 'creator admin' },
         ]
       },

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

@@ -128,8 +128,10 @@ Page({
         dateIndex:data.type
       })
     } else if(data.type == '2'){
+      let num=data.date.toString()
+      let numArr=['一','二','三','四']
       this.setData({
-        selectDateVal:data.date+'季度',
+        selectDateVal: num.slice(0,4)+'-'+ numArr[num[4]-1] + '季度',
         quarter: data.date,
         dateIndex:data.type
       })

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

@@ -68,6 +68,10 @@
    font-size: 24rpx;
    color: #909399;
 }
+.date{
+  font-size: 24rpx;
+  color: #909399;
+}
 
 .main-right text{
   color: #26A2FF;

+ 20 - 8
pages/statistics/my_issue/my_issue.axml

@@ -1,8 +1,8 @@
 <view>
   <view class="header margin-bottom" style="padding-bottom:16rpx;">
     <view class="flex-box flex-v-ce selectItems border-bottom">
-      <view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-2" catchTap="activeItem">我指派的</view>
-      <view data-index="2" class="{{activeIndex == 2? 'active':''}} flex-2" catchTap="activeItem">我悬赏的</view>
+      <view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-2" catchTap="activeItem">指派任务</view>
+      <view data-index="2" class="{{activeIndex == 2? 'active':''}} flex-2" catchTap="activeItem">抢单任务</view>
       <view data-index="3" class="{{activeIndex == 3? 'active':''}} flex-2" catchTap="activeItem" style="border-right:1px solid #f1f1f1">重复任务</view>
       <view catchTap="selectSx" class="flex-1">
         <image mode="scaleToFill" class="sxImg" src="../../../image/sx.png"/>
@@ -19,7 +19,7 @@
     </form>
   </view>
   <view class="main scroll">
-    <scroll-view class="scroll" a:if="{{(activeIndex==1||activeIndex==2)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+    <scroll-view class="scroll" a:if="{{activeIndex==1&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
       <view class="flex-box li border-bottom" data-index="1" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" key="{{item.id}}">
         <img-box name="{{item.employee_name}}" key="{{item.id}}" id="{{item.employee_id}}" a:if="{{activeIndex==1}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
         <block a:if="{{activeIndex==2}}">
@@ -60,17 +60,29 @@
             </block>
             <block a:else>
               <view class="orangeBox">{{item.status_mark}}</view>
-              <!-- <view class="orangeBox" a:if="{{item.status==1}}">待领取</view>
-              <view class="yellowBox" a:elif="{{item.status==2}}">进行中</view>
-              <view class="greenBox" a:elif="{{item.status==3}}">已完成</view>
-              <view class="textBox" a:elif="{{item.status==4}}">已撤回</view>
-              <view class="redBox" a:else>已过期</view> -->
             </block>
           </view>
         </view>
       </view>
       <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
     </scroll-view>
+    <scroll-view class="scroll" a:if="{{activeIndex==2&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+      <view class="li border-bottom" data-index="1" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" key="{{item.id}}">
+          <view class="flex-box" style="margin-bottom:24rpx">
+            <view class="context flex-1">{{item.task_name}}</view>
+            <view class="flex-box-ce">
+                <view class="red" a:if="{{item.base_point>0}}">+{{item.base_point}} {{item.pt_name}}</view>
+                <view class="green" a:else>{{item.base_point}} {{item.pt_name}}</view>
+            </view>
+          </view>
+          <view class="flex-box flex-v-ce">
+            <view class="date flex-1">{{item.expire_time}}截止  <text style="padding-left:20rpx" a:if="{{item.total_chance}}">{{ item.total_chance-item.chance }}/{{ item.total_chance }}</text></view>
+            <view class="orangeBox" a:if="{{item.composite_state==1}}">正在抢单</view>
+            <view class="textBox" a:else>抢单结束</view>
+          </view>
+      </view>
+      <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
+    </scroll-view>
     <scroll-view class="scroll" a:if="{{activeIndex==3&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
       <view class="li2 border-bottom" data-index="2" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}">
         <view style="margin-bottom:10rpx;">{{item.name}}</view>

+ 2 - 3
pages/statistics/my_issue/my_issue.js

@@ -12,8 +12,7 @@ Page({
       status: 'all',//状态
       sort: 'publish',//排序
     },
-    parameter2: { //我的悬赏
-      pt_id: 0,
+    parameter2: { //我的抢单
       order_by: 'create_time',
     },
     list: [],
@@ -193,7 +192,7 @@ Page({
         status: 'all',//状态
         sort: 'publish',//排序
       },
-      parameter2: { //我的悬赏
+      parameter2: { //我的抢单
         pt_id: 0,
         order_by: 'create_time',
       }

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

@@ -21,7 +21,7 @@
   <view class="orangeText" a:if="{{config.event_review_status==1&&config.event_task_review==1}}">复核开启后,积分需管理员复核后才计入排名和统计</view>
   <view class="main scroll">
     <scroll-view class="scroll" style="{{(config.event_review_status==1&&config.event_task_review==1)?'height: calc(100vh - 2.6rem)':''}}"  a:if="{{(activeIndex==1)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
-      <view class="task" a:if="{{toList.length>0}}">今日任务</view>
+      <view class="task" a:if="{{toList.length>0}}">今日任务</view>
       <view class="li border-bottom" a:for="{{toList}}" a:if="{{toList.length>0}}" key="{{item.id}}">
         <view class="flex-box li-top" catchTap="openDetail" data-item="{{item}}">
           <view class="flex-1">{{item.task_name}}</view>
@@ -37,7 +37,7 @@
           <text class="greenBox" a:if="{{item.review_status == 1}}">审批通过</text> -->
         </view>
       </view>
-      <view class="task">待完成任务</view>
+      <view class="task">全部待完成任务</view>
       <view class="li border-bottom" a:for="{{list}}">
         <view class="flex-box li-top" catchTap="openDetail" data-item="{{item}}">
           <view class="flex-1">{{item.task_name}}</view>

+ 26 - 6
pages/statistics/offerAreward/offerAreward.axml

@@ -84,7 +84,7 @@
         </view>
         <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
       </view>
-      <view class="flex-box flex-v-ce li  margin-bottom">
+      <view class="flex-box flex-v-ce li">
         <view class="label isBt">截止时间</view>
         <view class="flex-1" a:if="{{items.task_cycle==0}}" catchTap="openDate">{{items.expire_time}}</view>
         <view class="flex-1" a:else>
@@ -94,6 +94,15 @@
         </view>
         <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
       </view>
+
+      <view class="flex-box li margin-bottom" style="padding:15rpx 28rpx;margin-top:24rpx">
+        <view class="label isBt" style="position: relative;top:10rpx;">抢单名额</view>
+        <text class="red" style="position: relative;top:10rpx;"></text>
+        <view class="flex-1">
+          <input value="{{items.chance}}" placeholder="请输入名额(最多100名)" type="number" onInput="bindKeyInput4"/>
+        </view>
+      </view>
+
       <view class="li">
         <textarea maxlength="300" value="{{items.task_remark}}" onInput="bindTextAreaBlur2" placeholder="请输入任务备注" data-index="{{index}}"></textarea>
       </view>
@@ -105,7 +114,7 @@
           <input style="border-left:1px solid #f1f1f1" data-name="ahead_award_point_limit" value="{{items.ahead_award_point_limit}}"  placeholder="奖分上限" type="number" onInput="bindKeyInput3"/>
         </view>
       </view>
-      <view class="flex-box li" style="padding:15rpx 28rpx;">
+      <view class="flex-box li margin-bottom" style="padding:15rpx 28rpx;">
         <view class="label2" style="position: relative;top:10rpx;">逾期扣分(天)</view>
         <text class="green" style="position: relative;top:10rpx;">-</text>
         <view class="flex-box-ce flex-1">
@@ -113,8 +122,11 @@
           <input style="border-left:1px solid #f1f1f1" data-name="timeout_deduction_point_limit"  value="{{items.timeout_deduction_point_limit}}"  placeholder="扣分上限" type="number" onInput="bindKeyInput3"/>
         </view>
       </view>
+      <view class="flex-box flex-v-ce li">
+        <view class="label" style="width:auto">可见范围<text style="font-size:24rpx;color:#ccc">(没有指定部门与人员时默认全公司可见)</text></view>
+      </view>
       <view class="flex-box flex-v-ce li" data-num="1" catchTap="openSelect">
-        <view class="label">可见范围</view>
+        <view class="label">指定部门</view>
         <view class="flex-1 font-flex-word userList">
           <block a:for="{{defaultSection}}">
             <text style="font-size:32rpx">{{item.name}},</text>
@@ -122,9 +134,16 @@
         </view>
         <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
       </view>
-      <!-- <view style="height:2rem">
-        
-      </view> -->
+      <view class="flex-box flex-v-ce li" data-num="5" catchTap="openSelect">
+        <view class="label">指定人员</view>
+        <view class="flex-1 font-flex-word userList">
+          <block a:for="{{employeeList}}">
+            <text style="font-size:32rpx">{{item.name}},</text>
+          </block>
+        </view>
+        <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
+      </view>
+      
     </view>
     <view class="btn-area">
       <button type="default" loading="{{disabled}}" class="defBtn" disabled="{{disabled}}" catchTap="formSubmit">提交</button>
@@ -135,5 +154,6 @@
     <select-type defaultId="{{defaultRuleId}}" isGzType="{{isGzType}}" onConfirm="onSelectType" onClose="onClose" a:if="{{isShowType=='4'}}"/>
     <select-section-bottom defaultSection="{{defaultSection}}" onClose="onClose" onConfirm="onSelectSection" a:if="{{isShowType=='1'}}"/>
     <select-section-staff-two islead="{{true}}"  selectUser="{{reviewerObj}}" onClose="onClose" onConfirm="onSelectUser2" a:if="{{isShowType=='2'}}"/>
+    <select-section-staff  selectUser="{{employeeList}}" onClose="onClose" onConfirm="onSelectUser"  a:if="{{isShowType=='5'}}" />
   </view>
 </view>

+ 57 - 5
pages/statistics/offerAreward/offerAreward.js

@@ -22,14 +22,18 @@ Page({
 
       task_cycle: 0,//任务发布周期 1-天 2-周 3-月
       task_expire_day: 1,//任务截至天数
-      task_type: 1,
+      task_type: 3,
 
       checked: false,//是否选择规则
       rule_id: '',//积分分类id
       rule_id2: '',
       rule_name: '',//积分分类名称
       item_id: '',//积分细则id 不选可以为0
+
+      chance:1,//次数
+      employee_ids:[],
     },
+    employeeList: [],
     reviewerObj: [],//默认审批人
     objectArray: [
       {
@@ -67,7 +71,7 @@ Page({
   },
   onLoad(e) {
     that = this;
-    dd.setNavigationBar({ title: "发布悬赏任务" });
+    dd.setNavigationBar({ title: "发布抢单任务" });
     that.setData({
       types: app.globalData.types,
       [`items.expire_time`]: app.globalData.day + ' 18:00',
@@ -85,7 +89,9 @@ Page({
     })
 
     this.setData({
+      employeeList:data.employee_info,
       [`items.task_name`]: data.name,
+      [`items.chance`]: data.total_chance,
       [`items.range_type`]: 0,
       [`items.pt_id`]: data.pt_id,
       [`items.task_remark`]: data.remark,
@@ -94,9 +100,7 @@ Page({
       arrIndex: data.task_cycle,
       [`items.task_expire_day`]: parseInt(data.task_cycle_value),
       [`items.checked`]: data.point_config.item_info ? true : false,
-      // 执行人
-      users: data.target_info.length > 0 ? data.target_info : [],
-      [`items.targets`]: arr,
+
       //  审批人
       [`items.reviewer_id`]: data.reviewer_id,//审批者id
       [`items.revieweName`]: data.reviewer_name,//审批者id
@@ -258,6 +262,12 @@ Page({
       [`items.base_point2`]: e.detail.value,
     });
   },
+  //抢单名额
+  bindKeyInput4(e) {
+    this.setData({
+      [`items.chance`]: e.detail.value,
+    });
+  },
   //积分输入
   bindKeyInput3(e) {
     var name = e.target.dataset.name;
@@ -501,12 +511,47 @@ Page({
       this.showToast('请选择审批人')
       return;
     }
+    if (items.base_point<=0) {
+      this.showToast('任务积分必须大于0,请调整后再发布')
+      return;
+    }
     if (items.task_cycle == 0) {
       if (!items.expire_time) {
         this.showToast('请选择截止时间')
         return;
       }
     }
+    if (items.chance==0) {
+      this.showToast('抢单人数不能为0')
+      return;
+    }
+    if (items.chance>100) {
+      this.showToast('抢单人数不能大于100')
+      return;
+    }
+    if(that.data.employeeList.length>0){
+      let employee_ids=that.data.employeeList.map(e=>e.id)
+      if(employee_ids.length>50){
+        this.showToast('指定人员最多不能超过50位')
+        return;
+      }
+      items.employee_ids=employee_ids.toString()
+    }
+    if (!items.ahead_award_point && items.ahead_award_point_limit) {
+      this.showToast('设置提前奖分时,需同时设置每天奖分及奖分上限');
+      return;
+    } else if (items.ahead_award_point && !items.ahead_award_point_limit) {
+      this.showToast('设置提前奖分时,需同时设置每天奖分及奖分上限');
+      return;
+    }
+    if (!items.timeout_deduction_point && items.timeout_deduction_point_limit) {
+      this.showToast('设置逾期扣分时,需同时设置每天扣分及扣分上限');
+      return;
+    } else if (items.timeout_deduction_point && !items.timeout_deduction_point_limit) {
+      this.showToast('设置逾期扣分时,需同时设置每天扣分及扣分上限');
+      return;
+    }
+
     if (!items.task_remark) {
       delete items.task_remark
     }
@@ -518,6 +563,7 @@ Page({
     } else {
       items.dept_ids = items.dept_ids.toString();
     }
+
     items.file_list = items.file_list.toString();
     this.setData({ disabled: true });
     var url;
@@ -603,5 +649,11 @@ Page({
     });
 
   },
+  //指定人员
+  onSelectUser(item) {
+    that.setData({
+      employeeList: item.length > 0 ? item : [],
+    })
+  },
 });
 

+ 2 - 1
pages/statistics/offerAreward/offerAreward.json

@@ -3,6 +3,7 @@
     "select-rule": "/Component/selectRule/selectRule",
     "select-type": "/Component/selectType/selectType",
     "select-section-staff-two":"/Component/selectSectionStaff_tow/selectSectionStaff_tow",
-    "select-section-bottom":"/Component/selectSectionBottom/selectSectionBottom"
+    "select-section-bottom":"/Component/selectSectionBottom/selectSectionBottom",
+    "select-section-staff": "/Component/selectSectionStaff/selectSectionStaff"
   }
 }

+ 22 - 1
pages/statistics/offerAreward_set/offerAreward_set.axml

@@ -79,6 +79,13 @@
         <view class="flex-1">{{items.expire_time}}</view>
         <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
       </view>
+      <view class="flex-box li margin-bottom" style="padding:15rpx 28rpx;margin-top:24rpx">
+        <view class="label isBt" style="position: relative;top:10rpx;">抢单名额</view>
+        <text class="red" style="position: relative;top:10rpx;"></text>
+        <view class="flex-1">
+          <input value="{{items.chance}}" placeholder="请输入名额(最多100名)" type="number" onInput="bindKeyInput4"/>
+        </view>
+      </view>
       <view class="li">
         <textarea maxlength="100" value="{{items.task_remark}}" onInput="bindTextAreaBlur2" placeholder="请输入任务备注" data-index="{{index}}"></textarea>
       </view>
@@ -98,8 +105,11 @@
           <input style="border-left:1px solid #f1f1f1" data-name="timeout_deduction_point_limit"  value="{{items.timeout_deduction_point_limit}}"  placeholder="扣分上限" type="number" onInput="bindKeyInput3"/>
         </view>
       </view>
+      <view class="flex-box flex-v-ce li">
+        <view class="label" style="width:auto">可见范围<text style="font-size:24rpx;color:#ccc">(没有指定部门与人员时默认全公司可见)</text></view>
+      </view>
       <view class="flex-box flex-v-ce li" data-num="1" catchTap="openSelect">
-        <view class="label">可见范围</view>
+        <view class="label">指定部门</view>
         <view class="flex-1 font-flex-word userList">
           <block a:for="{{defaultSection}}">
             <text style="font-size:32rpx">{{item.name}},</text>
@@ -107,6 +117,16 @@
         </view>
         <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
       </view>
+      <view class="flex-box flex-v-ce li" data-num="5" catchTap="openSelect">
+        <view class="label">指定人员</view>
+        <view class="flex-1 font-flex-word userList">
+          <block a:for="{{employeeList}}">
+            <text style="font-size:32rpx">{{item.name}},</text>
+          </block>
+        </view>
+        <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
+      </view>
+
     </view>
     <view class="btn-area">
       <button type="default" loading="{{disabled}}" class="defBtn" disabled="{{disabled}}" catchTap="formSubmit">确定修改</button>
@@ -117,5 +137,6 @@
     <select-type defaultId="{{defaultRuleId}}" isGzType="{{isGzType}}" onConfirm="onSelectType" onClose="onClose" a:if="{{isShowType=='4'}}"/>
     <select-section-bottom defaultSection="{{defaultSection}}" onClose="onClose" onConfirm="onSelectSection" a:if="{{isShowType=='1'}}"/>
     <select-section-staff-two islead="{{true}}"  selectUser="{{reviewerObj}}" onClose="onClose" onConfirm="onSelectUser2" a:if="{{isShowType=='2'}}"/>
+    <select-section-staff  selectUser="{{employeeList}}" onClose="onClose" onConfirm="onSelectUser"  a:if="{{isShowType=='5'}}" />
   </view>
 </view>

+ 64 - 11
pages/statistics/offerAreward_set/offerAreward_set.js

@@ -26,7 +26,11 @@ Page({
       checked: false,//是否选择规则
       rule_id: '',//积分分类id
       item_id: 0,//积分细则id 不选可以为0
+      
+      chance:1,//次数
+      employee_ids:[],
     },
+    employeeList: [],
     reviewerObj: [],//默认审批人
     objectArray: [
       {
@@ -58,7 +62,7 @@ Page({
   },
   onLoad(e) {
     that = this;
-    dd.setNavigationBar({ title: "悬赏任务编辑" });
+    dd.setNavigationBar({ title: "抢单任务编辑" });
     if (e.item) {
       var item = JSON.parse(e.item);
       var arr=[];
@@ -67,7 +71,7 @@ Page({
           arr.push(item.id);
         })
       }
-      if(item.item_id){
+      if(item.point_config.item_info&&item.point_config.item_info.id){
         if(item.point_config.base_point<0){
           this.setData({
               isArrindex:false
@@ -75,11 +79,13 @@ Page({
         }
       }
       this.setData({
-        selectRule:item.item_id? item.point_config.item_info:'',
+        selectRule:item.point_config.item_info? item.point_config.item_info:'',
         reviewerObj:[{name:item.reviewer_name,id:item.reviewer_id}],
         users:[{name:item.employee_name,id:item.employee_id}],
         defaultSection:item.department_info,
+        employeeList:item.employee_info,
         items: {
+          chance: item.chance,//次数
           dept_ids:arr,
           id:item.id,
           pt_id: item.pt_id,//积分种类id
@@ -97,13 +103,14 @@ Page({
           ahead_award_point_limit:item.point_config.ahead_award_point_limit,//提前奖分上限
           task_cycle: 0,
           task_expire_day: 1,
-          task_type:1,
+          task_type:item.type,
 
-          rule_id2: (item.rule_id&&!item.item_id)? item.rule_id:'',//积分分类id
-          rule_name: (item.rule_id&&!item.item_id)? '已选择一条分类':'',//积分分类名称
-          rule_id: item.rule_id,//积分分类id
-          item_id: item.item_id,//积分细则id 不选可以为0
-          checked: item.item_id? true:false,//是否选择规则
+          rule_id2: (item.point_config.rule_info&&!item.point_config.item_info)? item.point_config.rule_info.id:'',//积分分类id
+          rule_name: (item.point_config.rule_info&&!item.point_config.item_info)? item.point_config.rule_info.name:'',//积分分类名称
+
+          rule_id: item.point_config.item_info? item.point_config.rule_info.id:'',//积分分类id
+          item_id: item.point_config.item_info? item.point_config.item_info.id:'',//积分细则id 不选可以为0
+          checked: item.point_config.item_info? true:false,//是否选择规则
         },
         types: app.globalData.types,
         point_limit:app.globalData.userData.point_config.point_limit,
@@ -111,6 +118,12 @@ Page({
       })
     }
   },
+    //抢单名额
+    bindKeyInput4(e) {
+      this.setData({
+        [`items.chance`]: e.detail.value,
+      });
+    },
   //选择规则分类
   onSelectType(item) {
     this.setData({
@@ -431,11 +444,45 @@ Page({
       this.showToast('请选择审批人')
       return;
     }
+    if (items.base_point<=0) {
+      this.showToast('任务积分必须大于0,请调整后再发布')
+      return;
+    }
     if (!items.expire_time) {
       this.showToast('请选择截止时间')
       return;
     }
-     var page1 = getCurrentPages()[getCurrentPages().length - 2]//上一个页面的数据
+    if (items.chance==0) {
+      this.showToast('抢单人数不能为0')
+      return;
+    }
+    if (items.chance>100) {
+      this.showToast('抢单人数不能大于100')
+      return;
+    }
+    if(that.data.employeeList.length>0){
+      let employee_ids=that.data.employeeList.map(e=>e.id)
+      if(employee_ids.length>50){
+        this.showToast('指定人员最多不能超过50位')
+        return;
+      }
+      items.employee_ids=employee_ids.toString()
+    }
+
+    if (!items.ahead_award_point && items.ahead_award_point_limit) {
+      this.showToast('设置提前奖分时,需同时设置每天奖分及奖分上限');
+      return;
+    } else if (items.ahead_award_point && !items.ahead_award_point_limit) {
+      this.showToast('设置提前奖分时,需同时设置每天奖分及奖分上限');
+      return;
+    }
+    if (!items.timeout_deduction_point && items.timeout_deduction_point_limit) {
+      this.showToast('设置逾期扣分时,需同时设置每天扣分及扣分上限');
+      return;
+    } else if (items.timeout_deduction_point && !items.timeout_deduction_point_limit) {
+      this.showToast('设置逾期扣分时,需同时设置每天扣分及扣分上限');
+      return;
+    }
     if(!items.task_remark){
       delete items.task_remark
     }
@@ -449,6 +496,7 @@ Page({
     }
     items.file_list=items.file_list.toString();
     this.setData({ disabled: true });
+    var page1 = getCurrentPages()[getCurrentPages().length - 2]//上一个页面的数据
     app.$post('api/integral/task/update',items).then((res) => {
         page1.getDetail(items.id,function(){
             app.globalData.showToast(res.data.msg);
@@ -489,7 +537,12 @@ Page({
       [reviewer_id]: elm.id,
       [revieweName]: elm.name,
     });
-
   },
+    //指定人员
+    onSelectUser(item) {
+      that.setData({
+        employeeList: item.length > 0 ? item : [],
+      })
+    },
 });
 

+ 2 - 1
pages/statistics/offerAreward_set/offerAreward_set.json

@@ -3,6 +3,7 @@
     "select-rule": "/Component/selectRule/selectRule",
     "select-type": "/Component/selectType/selectType",
     "select-section-staff-two":"/Component/selectSectionStaff_tow/selectSectionStaff_tow",
-    "select-section-bottom":"/Component/selectSectionBottom/selectSectionBottom"
+    "select-section-bottom":"/Component/selectSectionBottom/selectSectionBottom",
+    "select-section-staff": "/Component/selectSectionStaff/selectSectionStaff"
   }
 }

+ 16 - 10
pages/statistics/repetitive_tasks_detail/repetitive_tasks_detail.axml

@@ -16,7 +16,7 @@
       </view>
       <view class="flex-box flex-v-ce">
         <view class="laber">执行周期</view>
-        <view class="flex-1">{{dataDetail.target_info.length>0? '临时任务-':'悬赏任务-'}}{{dataDetail.task_cycle_mark}}</view>
+        <view class="flex-1">{{dataDetail.target_info.length>0? '指派任务-':'抢单任务-'}}{{dataDetail.task_cycle_mark}}</view>
       </view>
       <view class="flex-box flex-v-ce" a:if="{{dataDetail.point_config.base_point}}">
         <view class="laber">任务积分</view>
@@ -43,17 +43,23 @@
         <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 ">
+        <view class="laber">抢单人数</view>
+        <view class="flex-1">{{dataDetail.total_chance}}</view>
+      </view>
+      <view class="flex-box flex-v" a:if="{{dataDetail.department_info.length>0||dataDetail.employee_info.length>0}}">
         <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 class="flex-1" style="background-color: rgb(250, 251, 252);padding: 8px;border: 5px;">
+            <view style="margin-bottom:24rpx">
+              <view class="fontColorC" style="font-size:28rpx">指定部门</view>
+              <text a:for="{{dataDetail.department_info}}">{{item.name}}<text a:if="{{(dataDetail.department_info.length-1)>index}}"> ,</text></text>
+            </view>
+            <view>
+              <view class="fontColorC" style="font-size:28rpx">指定人员</view>
+              <text a:for="{{dataDetail.employee_info}}">{{item.name}}<text a:if="{{(dataDetail.employee_info.length-1)>index}}"> ,</text></text>
+            </view>
         </view>
-        <view class="flex-1" a:else>全公司</view>
-      </view> -->
-      <!-- <view class="flex-box flex-v-ce">
-        <view class="laber">任务类型</view>
-        <view class="flex-1">{{dataDetail.pt_name}}</view>
-      </view> -->
+      </view>
       <view class="flex-box flex-v-ce" a:if="{{dataDetail.point_config.ahead_award_point}}">
         <view class="laber">提前奖分</view>
         <view class="flex-1">{{dataDetail.point_config.ahead_award_point}}B分/天</view>

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

@@ -194,8 +194,10 @@ Page({
         dateIndex: data.type
       })
     } else if (data.type == '2') {
+      let num=data.date.toString()
+      let numArr=['一','二','三','四']
       this.setData({
-        selectDateVal: data.date + '季度',
+        selectDateVal: num.slice(0,4)+'-'+ numArr[num[4]-1] + '季度',
         quarter: data.date,
         dateIndex: data.type
       })

+ 7 - 1
pages/statistics/taskDetail/taskDetail.acss

@@ -66,7 +66,13 @@
   margin: 0 10rpx;
 }
 .btn-area{
-  margin-top: 1.5rem;
+  position: fixed;
+  bottom: 0;
+  right: 0;
+  left: 0;
+  z-index: 9;
+  background-color: #fff;
+  padding: 20rpx;
 }
 
 .mian-title{

+ 24 - 22
pages/statistics/taskDetail/taskDetail.axml

@@ -1,19 +1,10 @@
 <view>
-  <view class="header margin-bottom">
+  <view class="header">
     <view class="header-top flex-box flex-v-ce  margin-bottom">
       <view class="flex-box flex-v-ce flex-1 ">
-        <img-box name="{{dataDetail.receiver_name}}" a:if="{{dataDetail.receiver_id!=0}}" imgUrl="{{dataDetail.receiver_img_url}}" height="90rpx" width="90rpx" fSize="28rpx"></img-box>
-        <img-box name="{{dataDetail.owner_name}}" a:if="{{dataDetail.receiver_id==0}}" imgUrl="{{dataDetail.owner_img_url}}" height="90rpx" width="90rpx" fSize="28rpx"></img-box>
+        <img-box name="{{dataDetail.owner_name}}" imgUrl="{{dataDetail.owner_img_url}}" height="90rpx" width="90rpx" fSize="28rpx"></img-box>
         <view class="top-left">
-          <view class="name font-flex-word" a:if="{{dataDetail.status == 1 || dataDetail.status == -1 || dataDetail.receiver_id ==0 &&dataDetail.status == 4}}">{{dataDetail.owner_name}}悬赏的{{dataDetail.pt_name}}任务</view>
-          <view class="name font-flex-word" a:if="{{dataDetail.status == 2 || dataDetail.status == 3 || dataDetail.receiver_id !=0 && dataDetail.status == 4}}">{{dataDetail.receiver_name}}的{{dataDetail.pt_name}}任务</view>
-          <block a:if="{{dataDetail.status==1}}">
-            <view class="orange" a:if="{{dataDetail.expire_time > date}}">待领取</view>
-            <view class="red" a:else>已过期</view>
-          </block>
-          <view class="yellow" a:elif="{{dataDetail.status==2}}">进行中</view>
-          <view class="green" a:elif="{{dataDetail.status==3}}">已完成</view>
-          <view class="red" a:elif="{{dataDetail.status==4}}">已撤回</view>
+          <view class="name font-flex-word">{{dataDetail.owner_name}}发布的{{dataDetail.pt_name}}任务</view>
         </view>
       </view>
       <view class="name">{{dataDetail.point_config.base_point}}{{dataDetail.pt_name}}</view>
@@ -37,11 +28,6 @@
           <image mode="scaleToFill" data-index="{{index}}" a:for="{{dataDetail.task_file_list}}" data-item="{{dataDetail.task_file_list}}" src="{{item}}" catchTap="showImg"/>
         </view>
       </view>
-
-      <view class="flex-box flex-v-ce">
-        <view class="laber">任务类型</view>
-        <view class="flex-1">{{dataDetail.type_mark}}</view>
-      </view>
       <view class="flex-box flex-v-ce">
         <view class="laber">任务积分</view>
         <view class="flex-1">{{dataDetail.point_config.base_point}}{{dataDetail.pt_name}}</view>
@@ -70,11 +56,26 @@
         <view class="laber">逾期扣分</view>
         <view class="flex-1">{{dataDetail.point_config.timeout_deduction_point}}B分/天</view>
       </view>
-      <view class="flex-box flex-v-ce" a:if="{{dataDetail.department_info.length>0}}">
-        <view class="laber">可见范围</view>
+      <view class="flex-box flex-v-ce" a:if="{{dataDetail.total_chance}}">
+        <view class="laber">抢单人数</view>
         <view class="flex-1">
-            <text a:for="{{dataDetail.department_info}}">{{item.name}}<text a:if="{{(dataDetail.department_info.length-1)>index}}"> ,</text></text>
+          <text class="blue">{{dataDetail.total_chance-dataDetail.chance}}</text>/{{dataDetail.total_chance}}
+          <text class="blue" style="padding-left:24rpx" a:if="{{dataDetail.total_chance!=dataDetail.chance}}" catchTap="openUser">查看详情</text>
+        </view>
+      </view>
+      <view class="flex-box flex-v" >
+        <view class="laber">可见范围</view>
+        <view class="flex-1" style="background-color: rgb(250, 251, 252);padding: 8px;border: 5px;" a:if="{{dataDetail.department_info.length>0||dataDetail.employee_info.length>0}}">
+            <view style="margin-bottom:24rpx" a:if="{{dataDetail.department_info.length>0}}">
+              <view class="fontColorC" style="font-size:28rpx">指定部门</view>
+              <text a:for="{{dataDetail.department_info}}">{{item.name}}<text a:if="{{(dataDetail.department_info.length-1)>index}}"> ,</text></text>
+            </view>
+            <view a:if="{{dataDetail.employee_info.length>0}}">
+              <view class="fontColorC" style="font-size:28rpx">指定人员</view>
+              <text a:for="{{dataDetail.employee_info}}">{{item.name}}<text a:if="{{(dataDetail.employee_info.length-1)>index}}"> ,</text></text>
+            </view>
         </view>
+        <view class="flex-1" a:else>全公司</view>
       </view>
       <view class="flex-box flex-v-ce" a:if="{{dataDetail.complete_task&&dataDetail.complete_task.remark}}">
         <view class="laber">完成备注</view>
@@ -112,9 +113,10 @@
           </view>
         </view>
       </block>
+      <view style="height:2rem"></view>
     </view>
-    <view class="btn-area" a:if="{{dataDetail.status == '1' && userId != dataDetail.owner_id && dataDetail.reviewer_id != userId&&!isCreator}}">
-      <button type="default" loading="{{disabled}}" class="defBtn" disabled="{{disabled}}" catchTap="formSubmit">领取任务</button>
+    <view class="btn-area" a:if="{{userId != dataDetail.owner_id && dataDetail.reviewer_id != userId&&!isCreator}}">
+      <button type="default" loading="{{disabled}}" class="defBtn" disabled="{{disabled}}" catchTap="formSubmit">任务</button>
     </view>
   </view>
   <view class="pop-up" a:if="{{isPublisher}}">

+ 27 - 13
pages/statistics/taskDetail/taskDetail.js

@@ -12,17 +12,16 @@ Page({
     id: '',
     isCreator: false,
     date:'',
+    works:[],
   },
   onLoad(e) {
     that = this;
-    dd.setNavigationBar({ title: "任务详情" });
+    dd.setNavigationBar({ title: "抢单详情" });
     this.setData({
       isCreator: app.globalData.isCreator,
       date:moment().format('YYYY-MM-DD HH:mm')
     })
-    console.log(this.data.date)
     if (e.id) {
-      // that.getDetail(e.id);
       this.setData({
         id: e.id,
         userId: app.globalData.userData.id
@@ -49,6 +48,11 @@ Page({
       }, function () { })
     }
   },
+  openUser(){
+    dd.navigateTo({
+      url: '../userList/userList?list=' + JSON.stringify(this.data.works)
+    })
+  },
   onShareAppMessage() {
     return {
       title: '任务详情',
@@ -80,14 +84,26 @@ Page({
       })
     }
   },
-  //领取任务
+  //任务
   formSubmit() {
-    app.$post("api/integral/task", { task_id: this.data.dataDetail.id }).then((res) => {
-      app.globalData.showToast('已领取');
-      setTimeout(() => {
-        dd.navigateBack({ delta: 1 })
-      }, 1000);
+    this.setData({ disabled: true })
+    app.$post('/api/integral/task/exist',{task_id:this.data.dataDetail.id}).then(res => {
+      let exist=res.data.data.exist
+      if(exist){
+        that.setData({ disabled: false })
+        app.globalData.showToast("你已经抢到该任务了,请前往【我抢到的】查看");
+      }else{
+        app.$post("api/integral/task", { task_id: this.data.dataDetail.id }).then((res) => {
+          app.globalData.showToast('抢单成功!');
+          setTimeout(() => {
+            dd.navigateBack({ delta: 1 })
+          }, 1000);
+        }).finally(() => {
+          that.setData({ disabled: false })
+			  });
+      }
     })
+
   },
   //显示图片
   showImg(e) {
@@ -102,15 +118,12 @@ Page({
     var index = e.target.dataset.index;
     this.setData({ activeIndex: index })
   },
-  openSearch() {
-    app.globalData.showToast("暂不支持筛选");
-  },
   getDetail(id, func = function () { }) {
     app.$get("api/integral/task", { task_id: id }).then((res) => {
       func();
       var data = res.data.data;
       data.pt_name = app.getTypesItem(data.pt_id).name;
-      if (data.status == 1 && data.status_mark == '待领取') {
+      if (data.composite_state==1&&data.total_chance == data.chance ) {
         this.setData({
           array: ['编辑任务', '删除任务'],
         })
@@ -121,6 +134,7 @@ Page({
       }
       this.setData({
         dataDetail: data,
+        works:data.works,
         isPublisher: data.owner_id == this.data.userId ? true : false
       })
     })

+ 8 - 1
pages/statistics/task_rank/task_rank.js

@@ -125,6 +125,7 @@ Page({
   },
   //选择时间
   onConfirmDate(data) {
+    console.log(data)
     this.setData({
       dateObj: data,
     })
@@ -135,8 +136,10 @@ Page({
         dateIndex: data.type
       })
     } else if (data.type == '2') {
+      let num=data.date.toString()
+      let numArr=['一','二','三','四']
       this.setData({
-        selectDateVal: data.date + '季度',
+        selectDateVal: num.slice(0,4)+'-'+ numArr[num[4]-1] + '季度',
         quarter: data.date,
         dateIndex: data.type
       })
@@ -156,6 +159,10 @@ Page({
     this.setData({ page: 1 })
     this.getData();
   },
+  returnNum(){
+
+  },
+
   //关闭弹窗
   onClose() {
     this.setData({

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

@@ -0,0 +1,8 @@
+
+.li{
+  background-color: #fff;
+}
+.userItem {
+    padding: 0.24rem;
+    border-bottom: 1px solid #f1f1f1;
+}

+ 28 - 0
pages/statistics/userList/userList.axml

@@ -0,0 +1,28 @@
+<view>
+  <view style="background:#fff;padding:24rpx" class="margin-bottom">
+    {{dataList.length}}人已抢单,其中<text class="blue">{{returnNum}}</text>人已完成
+  </view>
+  <scroll-view class="main" scroll-y="{{true}}">
+    <view class="flex-box flex-v-ce li" a:for="{{dataList}}">
+      <label class="flex-box-ce flex-1 userItem">
+        <img-box imgUrl="{{item.img_url}}" name="{{item.employee_name}}" height="90rpx" width="90rpx" fSize="24rpx"></img-box>
+        <view class="flex-1" style="margin-left:20rpx;">
+          <view class="flex-box-ce" style="margin-bottom:8rpx">
+            <view class="flex-1" style="padding-right:20rpx"><text class="font-flex-word" style="max-width:3rem;display: block;">{{item.employee_name}}</text></view>
+            <view>
+              <text a:if="{{item.status==1}}" class="orange">进行中</text>
+              <text a:if="{{item.status==2}}" class="blue">已完成</text>
+              <text a:if="{{item.status==3}}" class="fontColorB">退回</text>
+              <text a:if="{{item.status==4}}" class="green">已审批</text>
+              <text a:if="{{item.status==5}}" class="fontColorB">发布者已撤回</text>
+            </view>
+          </view>
+          <view class="flex-box-ce fontColorC" style="font-size:24rpx">
+            <view class="flex-1" style="padding-right:20rpx"><text class="font-flex-word" style="max-width:3rem;display: block;">{{item.dept}}</text></view>
+            <view>{{item.create_time}}</view>
+          </view>
+        </view>
+      </label>
+    </view>
+  </scroll-view>
+</view>

+ 28 - 0
pages/statistics/userList/userList.js

@@ -0,0 +1,28 @@
+
+var app = getApp()
+var that;
+Page({
+  data: {
+    dataList:[],
+    returnNum:0,
+  },
+  onLoad(e) {
+    that = this;
+    dd.setNavigationBar({ title: "抢单人员详情" });
+    let data=JSON.parse(e.list)
+    let num=0
+    data.forEach(item=>{
+      if(item.status==2||item.status==4){
+         num++
+      }
+    })
+    this.setData({
+      dataList:data,
+      returnNum:num
+    })
+
+  },
+  onShow(){
+
+  },
+});

+ 6 - 0
pages/statistics/userList/userList.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    "img-box": "/Component/img-box/index",
+    "no-data": "/Component/noData/noData"
+  }
+}

+ 1 - 28
pages/statistics/workDetail/workDetail.axml

@@ -21,34 +21,7 @@
     </view>
     
     <view class="header-main blue" style="text-align:right;padding-top:30rpx" a:if="{{dataDetail.reviews.length>0}}" catchTap="openReview">查看审批记录</view>
-
-
-    <!-- <view class="header-main" a:if="{{dataDetail.review_status==2}}">
-      <view class="flex-box flex-v-ce">
-        <view class="laber">审批状态</view>
-        <view class="flex-1 red">已驳回</view>
-      </view>
-      <view class="flex-box flex-v-ce">
-        <view class="laber">驳回理由</view>
-        <view class="flex-1">{{dataDetail.review_remark}}
-        </view>
-      </view>
-      <view style="height:20rpx;background: rgba(245, 247, 250, 1);"></view>
-    </view>
-
-    <view class="header-main" a:if="{{dataDetail.review_status==1}}">
-      <view class="flex-box flex-v-ce">
-        <view class="laber">审批状态</view>
-        <view class="flex-1 green">已通过</view>
-      </view>
-      <view class="flex-box flex-v-ce">
-        <view class="laber">备注</view>
-        <view class="flex-1">{{dataDetail.review_remark}}
-        </view>
-      </view>
-      <view style="height:20rpx;background: rgba(245, 247, 250, 1);"></view>
-    </view> -->
-
+    
     <view class="header-main">
       <view class="flex-box">
         <view class="laber">任务内容</view>

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

@@ -16,7 +16,7 @@ Page({
   },
   onLoad(e) {
     that = this;
-    dd.setNavigationBar({ title: "工作详情" });
+    dd.setNavigationBar({ title: "任务详情" });
     if (e.id) {
       this.setData({
         id: parseInt(e.id),

+ 3 - 2
pages/workbench/apply/apply.axml

@@ -105,13 +105,14 @@
           </view>
         </view>
         <view class="windows-btn flex-box flex-v-ce" a:if="{{results.length==resultList.length}}">
-          <button type="default" class="flex-1" catchTap="closeTc">确定</button>
+          <button type="default" class="flex-1" data-index="1" catchTap="closeTc">确定并返回</button>
+          <button type="default" class="flex-1" data-index="2" catchTap="closeTc">继续申请</button>
         </view>
       </block>
       <view a:else class="windows-content" style="padding:20rpx;">
         <view style="text-align: center;margin-bottom:20rpx" class="red">服务器繁忙,请稍后再试</view>
         <view class="windows-btn flex-box flex-v-ce">
-          <button type="default" class="flex-1" catchTap="closeTc">确定</button>
+          <button type="default" class="flex-1" catchTap="closeTc">确定并返回</button>
         </view>
       </view>
     </view>

+ 28 - 9
pages/workbench/apply/apply.js

@@ -42,6 +42,7 @@ Page({
     isShowError: false,
     errorList: [],
     isErrorShow: false,
+    reviewerInfo:{},
   },
   onLoad(e) {
     that = this;
@@ -52,8 +53,10 @@ Page({
       })
     } else {
       this.revieList(app.globalData.userData.id, function (res) {
+
         that.setData({
           getReviewerObj: res,
+          reviewerInfo:JSON.parse(JSON.stringify(res)),
           items: [{//录入选项列表
             checked: true,//判断是否开启指定规则
             employee_id: app.globalData.isCreator ? '' : app.globalData.userData.id,
@@ -529,7 +532,8 @@ Page({
       })
     }
   },
-  closeTc() {
+  closeTc(e) {
+    var index = e.target.dataset.index;
     this.setData({
       resultList: [],
       resultIndex: 0,
@@ -538,15 +542,30 @@ Page({
       isShowError: false,
       isResult: false,
       popupCx: '',
+      getReviewerObj: that.data.reviewerInfo,
+      items: [{//录入选项列表
+        checked: true,//判断是否开启指定规则
+        employee_id: app.globalData.isCreator ? '' : app.globalData.userData.id,
+        employeeName: app.globalData.isCreator ? '' : app.globalData.userData.name,
+        rule_id: '',//积分分类id
+        item_id: '',//积分细则id 不选可以为0
+        remark: '',//备注
+        event_time: app.globalData.day,//事件时间
+        reviewer_id: that.data.reviewerInfo.id,
+        revieweName: that.data.reviewerInfo.name,
+        files: '',//附件数组列表
+      }],
     })
-    setTimeout(() => {
-      if (this.data.qrcodeId) {
-        dd.switchTab({ url: '../index/index' })
-      } else {
-        dd.navigateBack({ delta: 1 })
-      }
-      this.setData({ disabled: false });
-    }, 1000);
+    if(index==1){
+      setTimeout(() => {
+        if (this.data.qrcodeId) {
+          dd.switchTab({ url: '../index/index' })
+        } else {
+          dd.navigateBack({ delta: 1 })
+        }
+        this.setData({ disabled: false });
+      }, 1000);
+    }
   },
 
 

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

@@ -30,7 +30,7 @@
       </view>
     </view>
     <view class="menuList flex-box flex-d-wrap">
-      <view a:for="{{menuList}}" class="menu-item" data-url="{{item.url}}" onTap="openUrl">
+      <view a:for="{{menuList}}" class="menu-item" data-url="{{item.url}}" onTap="openUrl" a:if="{{!item.isNoShow}}">
         <image mode="scaleToFill" src="{{item.imgUrl}}"></image>
         <view>{{item.name}}</view>
         <text a:if="{{item.name=='审批'&&total}}" class="menuNum font-flex-word">{{total}}</text>

+ 45 - 24
pages/workbench/index/index.js

@@ -26,13 +26,13 @@ Page({
     menuList: [
       { name: '审批', imgUrl: '../../../image/sp.png', url: '../my_approve/my_approve', code: 'creator admin' },
       { name: '任务', imgUrl: '../../../image/a7.png', url: '../../statistics/my_task/my_task', code: 'admin employee' },
-      { name: '复核', imgUrl: '../../../image/fuhe.png', url: '../review/review', code: 'creator admin' },
+      { name: '复核', imgUrl: '../../../image/fuhe.png', url: '../review/review', code: 'creator admin employee',isNoShow:true },
       { name: '奖扣B分', imgUrl: '../../../image/point_entry.png', url: '../jk_B/jk_B?type=B', code: 'creator admin' },
       { name: '指派任务', imgUrl: '../../../image/my_publish.png', url: '../../statistics/assaign/assaign', code: 'creator admin' },
       { name: '申请积分', imgUrl: '../../../image/a_apply.png', url: '../apply/apply', code: 'admin employee' },
       { 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/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/all2.png', url: 'all', code: 'creator admin employee' },
     ],
@@ -71,13 +71,8 @@ Page({
       if(options.subscribe=='cancel'){
         this.vlinkConfig()
       }else{
-        // app.globalData.showToast("已关注");
         this.vlinkConfig()
       }
-      // dd.alert({
-      //     title:'disposeSubscribeData',
-      //     content:JSON.stringify(options)
-      // })
     })
     if (app.globalData.userData) {
       dd.setNavigationBar({ title: app.globalData.userData.name });
@@ -347,7 +342,11 @@ Page({
   },
   // 获取公告
   getGg() {
-    if (that.data.title) {
+    let accedence_time=moment(app.globalData.userData.accedence_time).format('YYYY-MM-DD');
+    // let accedence_time='2023-10-12'
+    let date = moment().format('YYYY-MM-DD');
+    console.log(accedence_time,date)
+    if (that.data.title||accedence_time==date) {
       return
     }
     app.$get2("api/announcement/list", { page: 1, page_size: 1 }).then((res) => {
@@ -371,18 +370,9 @@ Page({
   setMenuList(str) {
     var arr = [];
     that.data.menuList.forEach(item => {
-      if(item.name=='复核'){
-        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{
         if (item.code.indexOf(str) >= 0) {
           arr.push(item)
         }
-      }
     })
     that.setData({
       menuList: arr
@@ -673,21 +663,52 @@ Page({
            let data = values[6].data.data;
            app.globalData.config=data;
            let menuList=JSON.parse(JSON.stringify( that.data.menuList))
+           //福利
            if(data.shop_status==1){
              if(menuList[menuList.length-2].name!='福利兑换'){
                 menuList.splice(menuList.length-1,0, { name: '福利兑换', imgUrl: '../../../image/fl.png', url: '../../exchange/exchange/exchange', code: 'creator admin employee' })
-                that.setData({
-                  menuList:menuList
-                })
              }
            }else{
               if(menuList[menuList.length-2].name=='福利兑换'){
                 menuList.splice(menuList.length-2,1)
-                that.setData({
-                  menuList:menuList
-                })
              }
            }
+           //复核
+           if(app.globalData.isCreator){
+            menuList.forEach(item=>{
+              if(item.name=='复核'){
+                item.isNoShow=false;
+              }
+            })
+            that.setData({
+              menuList:menuList
+            })
+            return false
+           }
+           if(data.event_review_manager==1){ //不是管理者
+              if(app.globalData.isSuperAdministrator){
+                  menuList.forEach(item=>{
+                    if(item.name=='复核'){
+                      item.isNoShow=false;
+                    }
+                  })
+              }
+           }else{
+            if(data.event_special){
+              let ids=data.event_special.map(e=> e.id);
+              if(ids.length>0&&ids.indexOf(app.globalData.userData.id)!=-1){
+                menuList.forEach(item=>{
+                  if(item.name=='复核'){
+                    item.isNoShow=false;
+                  }
+                })
+              }
+            }
+           }
+
+          that.setData({
+            menuList:menuList
+          })
       }
     })
   },

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

@@ -155,13 +155,14 @@
           </view>
         </view>
         <view class="windows-btn flex-box flex-v-ce" a:if="{{results.length==resultList.length}}">
-          <button type="default" class="flex-1" catchTap="closeTc">确定</button>
+          <button type="default" class="flex-1" data-index="1" catchTap="closeTc">确定并返回</button>
+          <button type="default" class="flex-1" data-index="2" catchTap="closeTc">继续奖扣</button>
         </view>
       </block>
       <view a:else class="windows-content" style="padding:20rpx;">
         <view style="text-align: center;margin-bottom:20rpx" class="red">服务器繁忙,请稍后再试</view>
         <view class="windows-btn flex-box flex-v-ce">
-          <button type="default" class="flex-1" catchTap="closeTc">确定</button>
+          <button type="default" class="flex-1"  data-index="2" catchTap="closeTc">确定并返回</button>
         </view>
       </view>
     </view>

+ 44 - 23
pages/workbench/jk_B/jk_B.js

@@ -40,6 +40,7 @@ Page({
       type: data.type,
       isGzType: data.type == "B" ? "BF" : "AF",
       isCreator: app.globalData.isCreator,
+      superior_list: app.globalData.userData.employee_detail.superior_list,
       items: [{//录入选项列表
         ticket_count:false,
         checked: true,//判断是否开启指定规则
@@ -150,14 +151,9 @@ Page({
   //选择弹窗
   openSelect(e) {
     var num = e.target.dataset.num;
-    var userData = this.data.users;
     var superior_list = this.data.superior_list;
     that.setData({ activeIndex: '', isShowType: '0' });
     if (num == 4) {
-      if (userData.length == 0) {
-        this.showToast('请先选择奖扣对象')
-        return;
-      }
       if (superior_list.length == 0) {
         this.showToast('你没有审批人,请联系管理员')
         return;
@@ -579,7 +575,8 @@ Page({
       })
     }
   },
-  closeTc() {
+  closeTc(e) {
+    var index = e.target.dataset.index;
     this.setData({
       resultList: [],
       resultIndex: 0,
@@ -590,10 +587,35 @@ Page({
       isShowError: false,
       isResult: false,
       popupCx: '',
+      users: [],
+      items: [{//录入选项列表
+        ticket_count:false,
+        checked: true,//判断是否开启指定规则
+        rule_id: '',//积分分类id
+        rule_id2: '',
+        rule_name: '',//积分分类名称
+
+        item_id: 0,//积分细则id 不选可以为0
+
+        point: '',//录入积分可为正负值,不能为0(细则)
+        point2: '',//录入积分可为正负值,不能为0(分类)
+
+        remark: '',//备注
+        event_time: app.globalData.day,//事件时间
+        pt_id: '',//积分种类id
+        reviewer_id: '',//审核人ID
+        revieweName: '',//审批人姓名(非传)
+        files: '',//附件数组列表
+        isArrindex: true,//奖扣索引(默认奖)(细则)
+        isArrindex2: true,//奖扣索引(默认奖)(分类)
+        selectRule: '',//选择的规则
+      }],
     })
-    setTimeout(() => {
-      dd.navigateBack({ delta: 1 })
-    }, 1000);
+    if(index==1){
+      setTimeout(() => {
+        dd.navigateBack({ delta: 1 })
+      }, 1000);
+    }
   },
   returnResult(id) {
     return app.globalData.usersList.filter(item => {
@@ -633,23 +655,22 @@ Page({
   //选择人
   onSelectUser(item) {
     //空数据
-    this.data.items.forEach((obj, index) => {
-      var reviewer_id = `items[${index}].reviewer_id`
-      var revieweName = `items[${index}].revieweName`
-      if (obj.reviewer_id) {
-        that.setData({
-          [reviewer_id]: '',
-          [revieweName]: '',
-        });
-      }
-    })
-    this.setData({ superior_list: [] });
-    if (item.length > 0) {
+    // this.data.items.forEach((obj, index) => {
+    //   var reviewer_id = `items[${index}].reviewer_id`
+    //   var revieweName = `items[${index}].revieweName`
+    //   if (obj.reviewer_id) {
+    //     that.setData({
+    //       [reviewer_id]: '',
+    //       [revieweName]: '',
+    //     });
+    //   }
+    // })
+    // this.setData({ superior_list: [] });
+    // if (item.length > 0) {
       that.setData({
         users: item.length > 0 ? item : [],
-        superior_list: app.globalData.userData.employee_detail.superior_list
       })
-    }
+    // }
 
   },
   //选择人2

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

@@ -20,7 +20,7 @@
         </picker>
       </view>
     </view>
-    <view class="main scroll">
+    <view class="main">
       <no-bata a:if="{{dataList.length==0}}"></no-bata>
       <scroll-view class="scroll" style="{{(config.event_review_status==1)?'height: calc(100vh - 2.48rem)':''}}" scroll-y="{{true}}" a:if="{{dataList.length>0&&activeIndex==1}}" onScrollToLower="onScrollToLower">
         <view class="flex-box li border-bottom" data-item="{{item}}" catchTap="openDetail" a:for="{{dataList}}">

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

@@ -102,6 +102,9 @@ Page({
       app.globalData.showToast("已驳回");
       that.setData({ disabled: false });
       that.refreshData(item.id);
+    }).catch(err=>{
+      that.setData({ disabled: false });
+      that.closeBh()
     })
   },
   closeBh() {

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

@@ -177,11 +177,10 @@ Page({
             return { time: item.date, value: item.count, type: '扣分人次' };
           })
           var charData = rewardArr.concat(deductArr);
+          console.log(charData)
           var charData2 = rewardArrCount.concat(deductArrCount);
           chart1.changeData(charData);
           chart2.changeData(charData2);
-
-
           app.globalData.socketApi.closewebsocket();
       }
     }, true);

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

@@ -146,7 +146,7 @@
   padding: 16rpx 28rpx;
 }
 .scroll {
-  height:  calc(100vh - 230rpx);
+  height:  calc(100vh - 236rpx);
 }
 
 .windows-box{

+ 31 - 38
pages/workbench/review/review.axml

@@ -1,16 +1,6 @@
 <view>
-  <view class="header margin-bottom">
-    <!-- <view class="flex-box flex-v-ce selectItems border-bottom">
-      <view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-1" catchTap="activeItem">待复核</view>
-      <view data-index="2" class="{{activeIndex == 2? 'active':''}} flex-1" catchTap="activeItem">已复核</view>
-      <view class="selectImg"  a:if="{{activeIndex == 2}}">
-        <picker class="picker" onChange="bindObjPickerChange" value="{{arrIndex}}" range="{{objectArray}}" range-key="name">
-          <view style="padding:20rpx 30rpx;">
-              <image mode="scaleToFill" src="../../../image/sx.png"/>
-          </view>
-        </picker>
-      </view>
-    </view> -->
+  <view class="header">
+    <!--<view class="flex-box flex-v-ce selectItems border-bottom"><view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-1" catchTap="activeItem">待复核</view><view data-index="2" class="{{activeIndex == 2? 'active':''}} flex-1" catchTap="activeItem">已复核</view><view class="selectImg"  a:if="{{activeIndex == 2}}"><picker class="picker" onChange="bindObjPickerChange" value="{{arrIndex}}" range="{{objectArray}}" range-key="name"><view style="padding:20rpx 30rpx;"><image mode="scaleToFill" src="../../../image/sx.png"/></view></picker></view></view> -->
     <view class="flex-box flex-v-ce tab border-bottom">
       <view class="flex-1">
         <picker onChange="activeItem" value="{{minuteIndex}}" range="{{minuteArray}}" range-key="name">
@@ -22,42 +12,47 @@
       </view>
       <view class="flex-1" a:if="{{minuteIndex==1}}">
         <picker class="picker" onChange="bindObjPickerChange" value="{{arrIndex}}" range="{{objectArray}}" range-key="name">
-            <text>{{objectArray[arrIndex].name}}</text>
+          <text>{{objectArray[arrIndex].name}}</text>
         </picker>
       </view>
-
+      
     </view>
-
+    
     <form onReset="onReset" class="flex-box-ce" style="padding:16rpx 28rpx;">
       <view class="search flex-box flex-v-ce">
-        <image mode="scaleToFill" src="../../../image/ss.png"/>
-        <input placeholder="输入关键字查找" onInput="bindKeyInput" onConfirm="bindKeyInput" class="flex-1"/>
+        <image mode="scaleToFill" src="../../../image/ss.png" />
+        <input placeholder="输入关键字查找" onInput="bindKeyInput" onConfirm="bindKeyInput" class="flex-1" />
         <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
       </view>
       <button style="width: 100px;" a:if="{{minuteIndex == 0}}" size="mini" type="primary" catchTap="openPl">批量复核</button>
     </form>
-    <!-- <view class="staff-all" a:if="{{isPl}}">
-      <label class="flex-box-ce">
-        <checkbox onChange="ruleActiveAll" disabled="{{item.disabled}}" checked="{{isAllChecked}}"></checkbox>
-        <text class="rule-all-text">全选</text>
-      </label>
-    </view> -->
+    <!--<view class="staff-all" a:if="{{isPl}}"><label class="flex-box-ce"><checkbox onChange="ruleActiveAll" disabled="{{item.disabled}}" checked="{{isAllChecked}}"></checkbox><text class="rule-all-text">全选</text></label></view> -->
   </view>
-    
-    
-    
+  <view style="padding:0.06rem 0.2rem;font-size:24rpx">
+    <text class="orange" a:if="{{!isOpen}}">正在连接服务器,请稍候...</text>
+    <text a:else class="green">成功连接服务器,可操作使用!</text>
+  </view>
+  
+  
   <view class="main scroll">
     <no-bata a:if="{{dataList.length==0}}"></no-bata>
     <scroll-view class="scroll" scroll-y="{{true}}" a:if="{{dataList.length>0}}" onScrollToLower="onScrollToLower">
       <view class="flex-box li border-bottom" a:for="{{dataList}}" data-item="{{item}}" catchTap="openDetail">
         <view style="padding-right:28rpx;padding-top:20rpx;" a:if="{{isPl}}">
-          <checkbox checked="{{item.checked}}" name="{{item.id}}"></checkbox>
+          <view style="height:40rpx;width:40rpx;border:1px solid #ccc;border-radius:4rpx;text-align:center;box-sizing:border-box;padding-top:2rpx">
+            <icon type="success_no_circle" a:if="{{item.checked}}" size="15"/>
+          </view>
+          <!-- <checkbox checked="{{item.checked}}" name="{{item.id}}"></checkbox> -->
         </view>
         <view class="flex-box flex-1">
           <img-box name="{{item.employee_name}}" id="{{item.employee_id}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
           <view class="flex-1 main-right">
             <view class="name flex-box-ce">
-              <text class="flex-1">{{item.employee_name}}</text>
+              <view class="flex-box-ce flex-1">
+                <text class="flex-1">{{item.employee_name}}</text>
+                <view class="red" a:if="{{item.point>0}}">+{{item.point}}{{item.pt_name}}</view>
+                <view class="green" a:else>{{item.point}}{{item.pt_name}}</view>
+              </view>
               <block a:if="{{minuteIndex == 1}}">
                 <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>
@@ -73,9 +68,6 @@
               <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>
@@ -88,17 +80,17 @@
     </scroll-view>
   </view>
   <view class="flex-box-ce footer " style="padding-bottom:0.3rem" a:if="{{isPl}}">
-    <view class="flex-1" catchTap="selectAll">全选</view>
-    <!-- <view class="flex-1 red" catchTap="openBh" style="border-left:1px solid #f1f1f1;border-right:1px solid #f1f1f1;">批量驳回</view> -->
+    <view class="flex-1" catchTap="selectAll">全选(最多50条)</view>
+    <!--<view class="flex-1 red" catchTap="openBh" style="border-left:1px solid #f1f1f1;border-right:1px solid #f1f1f1;">批量驳回</view> -->
     <view class="flex-2 blue" style="border-left:1px solid #f1f1f1" catchTap="openTg">批量通过</view>
   </view>
-
+  
   <!-- 弹出框 -->
   <view class="windows" a:if="{{isBh}}">
     <view class="windows-box">
       <view class="windows-title">确认不通过</view>
       <view class="windows-content">
-        <textarea value="{{textArea}}" onInput="bindTextAreaBlur" maxlength="50" placeholder="请输入不通过原因"/>
+        <textarea value="{{textArea}}" onInput="bindTextAreaBlur" maxlength="50" placeholder="请输入不通过原因" />
       </view>
       <view class="windows-btn flex-box flex-v-ce">
         <view class="flex-1" catchTap="closeBh">取消</view>
@@ -106,7 +98,7 @@
       </view>
     </view>
   </view>
-
+  
   <!-- 结果弹窗 -->
   <view class="windows" a:if="{{isResult}}">
     <view class="windows-box" style="margin-top:15%">
@@ -147,5 +139,6 @@
       </view>
     </view>
   </view>
-  <select-staff defaultUser="{{employee_ids}}" isAllSelect="{{false}}" isShow="{{showStaff}}" a:if="{{showStaff==true}}" onClose="onClose" onConfirm="onConfirmStaff"></select-staff>
-  </view>
+  <select-staff defaultUser="{{employee_ids}}" isAllSelect="{{false}}" isShow="{{showStaff}}" a:if="{{showStaff==true}}" 
+    onClose="onClose" onConfirm="onConfirmStaff"></select-staff>
+</view>

+ 40 - 9
pages/workbench/review/review.js

@@ -36,10 +36,12 @@ Page({
     config: {}, 
     showStaff: false,//显示员工选择
     staffVal: '人员',
+    isOpen:false,
   },
   onLoad() {
     that = this;
     dd.setNavigationBar({ title: "复核" });
+    app.globalData.socketApi.sendData({},this.onmessageWS,true);
   },
   onShow() {
     if (app.globalData.userData) {
@@ -56,6 +58,9 @@ Page({
       },function(){})
     }
   },
+  onUnload (){
+    app.globalData.socketApi.closewebsocket();
+  },
   //选择员工
   onConfirmStaff(data) {
     if (!data) {
@@ -134,8 +139,11 @@ Page({
       });
   },
   selectAll() {
-    let dataList = this.data.dataList.map(item => {
-      item.checked = this.data.isAll;
+    let dataList = this.data.dataList.map((item,index) => {
+      item.checked= false;
+      if(index<50){
+        item.checked = this.data.isAll;
+      }
       return item;
     })
     this.setData({
@@ -222,6 +230,10 @@ Page({
     }
   },
   webSocket(data,is) {
+    if(!this.data.isOpen){
+      app.globalData.showToast("正在连接服务器,请稍侯...");
+      return false;
+    }
     let resultList=is? data:[data];
     this.setData({
       resultList:resultList,
@@ -251,6 +263,11 @@ Page({
     }
   },
   onmessageWS(e) {
+    if(e.type=='auth'){
+      that.setData({
+        isOpen:true
+      })
+    }
     // 因为作用域问题,这个函数不能使用this
     if (e.type == 'event_check') {
       //  clearTimeout(setTime);
@@ -282,16 +299,17 @@ Page({
           msg:'提交成功'
         }
       }else{
+        let item = that.data.resultList[that.data.resultIndex];
         user={
-          name:e.result.task.msg.name,
-          point:e.result.task.msg.point,
-          remark:e.result.task.msg.remark,
-          pt_id:e.result.task.msg.pt_id,
+          name:item.name,
+          point:item.point,
+          remark:item.remark,
+          pt_id:item.pt_id,
           msg:e.msg
         }
       }
       let results=that.data.results
-      results.push(user);
+      results.unshift(user);
       that.setData({
         results: results,
         resultIndex: that.data.resultIndex + 1
@@ -353,9 +371,20 @@ Page({
   openDetail(e) {
     var item = e.target.dataset.item;
     if(this.data.isPl){
+      let num=0;
+      this.data.dataList.map(e=>{
+        if(e.checked){
+          num++
+        }
+      })
       let dataList = this.data.dataList.map(e => {
         if(item.id==e.id){
-          e.checked = !e.checked;
+          if(num>=50&&!e.checked){
+            app.globalData.showToast('最多只能选择50条');
+           
+          }else{
+            e.checked = !e.checked;
+          }
         }
         return e;
       })
@@ -370,7 +399,6 @@ Page({
   },
   getData(type) {
     let dc_status=that.data.minuteIndex==0? "[0]":'[1,2]';
-
     if(that.data.minuteIndex=="1"){
       if(that.data.arrIndex==0){
         dc_status='[1,2]'
@@ -393,6 +421,9 @@ Page({
       var list = res.data.data.list || [];
       list.forEach(element => {
           element.checked = false
+          if (element.pt_id) {
+            element.pt_name = app.getTypesItem(element.pt_id).name
+          }
       });
       if(that.data.page==1){
         this.setData({

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

@@ -18,7 +18,7 @@
 .page-section-btns{
   position: relative;
   padding: 0 0.32rem;
-  margin-top: 2rem;
+  margin-top: 1rem;
 }
 .nameBox{
   position: absolute;

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

@@ -19,7 +19,7 @@
           </view>
         </view>
         <view class="item">
-          <textarea value="{{textArea}}" onInput="bindKeyInput2" maxlength="50" placeholder="请输入调整原因"/>
+          <textarea style="height:160rpx" value="{{textArea}}" onInput="bindKeyInput2" maxlength="50" placeholder="请输入调整原因"/>
         </view>
       </view>
       <view class="page-section-btns">

+ 1 - 1
utils/websocket.js

@@ -51,8 +51,8 @@ let initWebSocket = (callback,is) => {
     return weboscket_callback({ type: 'error' })
     // opneWebSocket();
   });
+  
   // 创建
-
   let url=is? 'wss://' + dd.globalData.webScoketUrl + '/ws2/':'wss://' + dd.globalData.webScoketUrl + '/ws/'
   // url='wss://app55493.eapps.dingtalkcloud.com/ws2/'
   dd.connectSocket({