347617796@qq.com 3 years ago
parent
commit
78e3bf1bf0

+ 9 - 0
.mini-ide/compileMode.json

@@ -55,6 +55,15 @@
       "title": "周报",
       "page": "pages/reportBox/report/report",
       "pageQuery": ""
+    },
+    {
+      "title": "任务统计",
+      "page": "pages/statistics/taskStatistical/taskStatistical"
+    },
+    {
+      "title": "积分申请",
+      "page": "pages/workbench/apply/apply",
+      "pageQuery": "id=48148"
     }
   ]
 }

+ 0 - 1
Component/selectDate_two/selectDate_two.js

@@ -123,7 +123,6 @@ Component({
             return new Date(ydm).getTime()
           }
           let timeC = (tsTamp(this.data.customIndOn) - tsTamp(this.data.customIndTw)) / (60 * 60 * 24 * 1000)
-          console.log(timeC)
           if(timeC > 0){
             app.globalData.showToast("开始时间不能大于结束时间")
             return

+ 1 - 0
Component/selectSectionStaff/selectSectionStaff.acss

@@ -148,6 +148,7 @@
   position: relative;
   right: 10rpx;
   bottom: 5rpx;
+  top: 0rpx;
 }
 .staff-all{
   background: rgba(245, 247, 250, 1);

+ 1 - 1
Component/selectSectionStaff/selectSectionStaff.axml

@@ -28,7 +28,7 @@
       </view>
       <view class="flex-box flex-v-ce staff-all">
         <view class="flex-1"></view>
-        <label a:if="{{isAll}}">
+        <label a:if="{{isAll}}" class="flex-box-ce">
           <text class="rule-all-text">全选</text>
           <checkbox onChange="ruleActiveAll" disabled="{{item.disabled}}" checked="{{isAllChecked}}"></checkbox>
         </label>

+ 1 - 1
Component/selectSectionStaff/selectSectionStaff.js

@@ -45,7 +45,7 @@ Component({
       that.getBmData();
     // })
   },
-  didUpdate() { },
+  didUpdate() {},
   didUnmount() {
   },
   methods: {

+ 14 - 2
app.acss

@@ -452,12 +452,24 @@
 	}
 
 	/*超出部分用....表示的公用样式  */
-
 	.font-flex-word {
 		overflow: hidden;
 		text-overflow: ellipsis;
 		white-space: nowrap;
-	}
+  }
+  
+.clamp2{
+	display: -webkit-box;
+	-webkit-box-orient: vertical;
+	-webkit-line-clamp: 2;
+	overflow: hidden;
+}
+.clamp3{
+	display: -webkit-box;
+	-webkit-box-orient: vertical;
+	-webkit-line-clamp: 3;
+	overflow: hidden;
+}
 
 	/* 内容超出部分自动换行 */
 

+ 5 - 5
app.js

@@ -2,8 +2,8 @@ import { showToast } from './utils/feedback'
 import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 import * as socketApi from './utils/websocket'
 
-const baseUrl = "https://test-ding.g107.com/";//测试
-// const baseUrl = "https://ding.insys.g107.com/";//正式
+// const baseUrl = "https://test-ding.g107.com/";//测试
+const baseUrl = "https://ding.insys.g107.com/";//正式
 var that;
 var yearArr = [];
 var year = formatTime(new Date()).year;
@@ -14,8 +14,8 @@ App({
   //自定义全局变量
   globalData: {
     baseUrl:baseUrl,
-    webScoketUrl: "test-ding.g107.com",//webScoket测试
-    // webScoketUrl: "ding.insys.g107.com",//webScoket正式
+    // webScoketUrl: "test-ding.g107.com",//webScoket测试
+    webScoketUrl: "ding.insys.g107.com",//webScoket正式
     showToast: showToast,//提示框
     arrRemoveObj: arrRemoveObj,//删除数组的某一项
     year: formatTime(new Date()).year,//当前年
@@ -256,7 +256,7 @@ App({
                 that.globalData.token = token;
                 that.globalData.userData = user;
                 var getIsStart = dd.getStorageSync({ key: 'isStart' });//判断是否需要打开引导页
-                // console.log(JSON.stringify(user));
+                console.log(JSON.stringify(user));
                 that.getUserList();//缓存人员列表
                 if (isStart && !getIsStart.data&&isShowStart) {//判断是否需要打开引导
                   dd.reLaunch({

+ 3 - 1
app.json

@@ -71,7 +71,9 @@
     "pages/reportBox/report/report",
     "pages/reportBox/noUser/noUser",
     "pages/reportBox/newspaperTask/newspaperTask",
-    "pages/reportBox/moreE/moreE"
+    "pages/reportBox/moreE/moreE",
+    "pages/statistics/taskStatistical/taskStatistical",
+    "pages/statistics/taskSList/taskSList"
   ],
   "window": {
     "defaultTitle": "功道云",

BIN
image/dsp.png


BIN
image/integral_rank.png


BIN
image/jr.png


BIN
image/jxz.png


BIN
image/money.jpg


BIN
image/yq.png


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

@@ -108,7 +108,7 @@
         <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
       </view>
       <view class="li">
-        <textarea maxlength="100" value="{{items.task_remark}}" onInput="bindTextAreaBlur2" placeholder="请输入任务描述" data-index="{{index}}"></textarea>
+        <textarea maxlength="300" value="{{items.task_remark}}" onInput="bindTextAreaBlur2" placeholder="请输入任务描述" data-index="{{index}}"></textarea>
       </view>
       <view class="flex-box flex-v-ce li">
         <view class="label">重复周期</view>

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

@@ -11,7 +11,7 @@
         <view a:for="{{itemName.child}}" class="menu-item" data-url="{{item.url}}" onTap="openUrl">
           <image mode="scaleToFill" src="{{item.imgUrl}}"/>
           <view>{{item.name}}</view>
-          <text class="menuNum font-flex-word" a:if="{{item.name=='审批'&&total}}">{{total}}</text>
+          <text class="menuNum font-flex-word" a:if="{{item.new}}">new</text>
         </view>
       </view>
     </view>

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

@@ -30,10 +30,11 @@ Page({
       },
       {
         code: '统计分析', child: [
-          { name: '排行榜', imgUrl: '../../../image/att_statistics.png', url: '../userRamking/userRamking', code: 'creator admin ' },
+          { name: '排行榜', imgUrl: '../../../image/integral_rank.png', url: '../userRamking/userRamking', code: 'creator admin ' },
           { name: '考勤分', imgUrl: '../../../image/att_sign.png', url: '../check_top/check_top', code: 'creator admin employee' },
           { name: '日志分', imgUrl: '../../../image/log1.png', url: '../log_rank/log_rank', code: 'creator admin employee' },
           { name: '任务分', imgUrl: '../../../image/log2.png', url: '../task_rank/task_rank', code: 'creator admin employee' },
+          { name: '任务统计', imgUrl: '../../../image/att_statistics.png', url: '../taskStatistical/taskStatistical', code: 'creator admin employee',new:true },
           { name: '积分事件', imgUrl: '../../../image/event_list_a.png', url: '../integralEvent/integralEvent', code: 'creator admin employee' },
           { name: '积分周报', imgUrl: '../../../image/length_point.png', url: '../../reportBox/report/report', code: 'admin' },
         ]

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

@@ -85,7 +85,7 @@
         <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
       </view>
       <view class="li">
-        <textarea maxlength="100" value="{{items.task_remark}}" onInput="bindTextAreaBlur2" placeholder="请输入任务描述" data-index="{{index}}"></textarea>
+        <textarea maxlength="300" value="{{items.task_remark}}" onInput="bindTextAreaBlur2" placeholder="请输入任务描述" data-index="{{index}}"></textarea>
       </view>
       <view class="flex-box flex-v-ce li">
         <view class="label">重复周期</view>

+ 91 - 0
pages/statistics/taskSList/taskSList.acss

@@ -0,0 +1,91 @@
+.header {
+  background: #fff;
+  position: sticky;
+  top: 0;
+}
+
+.selectItems {
+  /* margin-top: 20rpx; */
+  text-align: center;
+}
+
+.selectItems .selectImg {
+  border-left: 1px solid #f1f1f1;
+  padding: 0 20rpx;
+}
+
+.selectImg image {
+  width: 30rpx;
+  height: 30rpx;
+}
+
+.selectItems .flex-2 {
+  padding: 24rpx 0;
+  text-align: center;
+  font-size: 32rpx;
+  position: relative;
+}
+
+.selectItems .active::before {
+  position: absolute;
+  content: " ";
+  height: 4rpx;
+  width: 100rpx;
+  background: #26A2FF;
+  bottom: 0rpx;
+  left: 50%;
+  margin-left: -50rpx;
+}
+
+.main {
+  background: #fff;
+}
+
+.li {
+  padding: 24rpx 28rpx;
+}
+
+.li-bottom .fontColorX {
+  font-size: 24rpx;
+}
+.li-bottom .red {
+  padding-left: 20rpx;
+}
+
+.scroll {
+  height: calc(100vh);
+}
+
+.sxImg {
+  width: 30rpx;
+  height: 30rpx;
+}
+
+.defBtn {
+  border-radius: 6rpx;
+  height: 50rpx;
+  text-align: center;
+  line-height: 50rpx;
+  width: 120rpx;
+  font-size: .24rem;
+}
+
+.task {
+  background: #f5f7fa;
+  color: #909399;
+  font-size: .28rem;
+  padding: .05rem .32rem .15rem;
+}
+.content{
+  padding-top: 16rpx;
+  font-size: 32rpx;
+}
+.sxBorder::after{
+  content: " ";
+  width: 2rpx;
+  height: 80rpx;
+  background: #f1f1f1;
+  left: 0;
+  top: 0;
+  position: absolute;
+}

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

@@ -0,0 +1,28 @@
+<view>
+  <view class="main scroll">
+    <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}"  onScrollToLower="onScrollToLower">
+      <view class="li border-bottom" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" key="{{item.id}}">
+        <view class="flex-box li-top">
+          <img-box name="{{item.receiver.name}}" a:key="{{index}}" imgUrl="{{item.receiver.img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+          <view class="flex-1" style="padding-left:16rpx;">
+            <view class="flex-box-ce" style="padding-top:16rpx;">
+              <text class="flex-1">{{item.receiver.name}}</text>
+              <text class="red" a:if="{{item.point_config.base_point>0}}">+{{item.point_config.base_point}}  {{item.pt_name}}</text>
+              <text a:else>{{item.point_config.base_point}}  {{item.pt_name}}</text>
+            </view>
+            <view class="content">{{item.task_name}}</view>
+            <view class="flex-box-ce li-bottom">
+              <text class="flex-1 fontColorX">{{item.date}} 截止 
+                <text class="red" a:if="{{parameter.index=='1'&&item.sub}}">逾期{{item.sub}}</text>
+                <text class="red" a:if="{{parameter.index=='4'&&item.sub}}">已等待{{item.sub}}</text>
+              </text>
+              <button type="primary" class="defBtn" catchTap="activeA" data-item="{{item}}" a:if="{{parameter.index=='1'||parameter.index=='4'}}">催办</button>
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="noDatas" a:if="{{!isData}}">没有更多咯</view>
+    </scroll-view>
+    <no-data a:if="{{list.length==0}}"></no-data>
+  </view>
+</view>

+ 199 - 0
pages/statistics/taskSList/taskSList.js

@@ -0,0 +1,199 @@
+
+var app = getApp()
+var that;
+Page({
+  data: {
+    list: [],
+    parameter:{},
+    isData:true,
+  },
+  onLoad(e) {
+    that = this;
+    this.setData({
+      parameter: JSON.parse(e.data),
+    })
+    if(this.data.parameter.index=='1'){
+       dd.setNavigationBar({ title: "逾期任务" });
+    }else if(this.data.parameter.index=='2'){
+       dd.setNavigationBar({ title: "今日任务" });
+    }else if(this.data.parameter.index=='3'){
+       dd.setNavigationBar({ title: "进行中任务" });
+    }else{
+      dd.setNavigationBar({ title: "待审批任务" });
+    }
+  },
+  onShow() {
+    if(this.data.parameter.page==1){
+      this.opneWebSocket();
+    }
+  },
+  activeA(e){
+      let item = e.target.dataset.item;
+      let text='';
+      let users=[];
+      if(this.data.parameter.index=='1'){//拿执行者ID
+        users.push(item.receiver.ding_user.user_id)
+        text=`积分任务【 ${item.task_name} 】已经逾期啦,请尽快完成`
+      }
+      if(this.data.parameter.index=='4'){//拿审批者ID
+        users.push(item.reviewer_ding_info.user_id)
+        text=`${item.receiver.name}的积分任务【 ${item.task_name} 】还未审批,请及时处理`
+      }
+      dd.createDing({
+          users: users, //默认选中用户工号列表;类型: Array<String>
+          corpId: app.globalData.corpId, // 类型: String
+          alertType: 2, // 钉发送方式 0:电话, 1:短信, 2:应用内;类型 Number
+          alertDate: {"format":"yyyy-MM-dd HH:mm", "value":"2019-08-29 08:25"}, // 非必选,定时发送时间, 非定时DING不需要填写
+          type: 1,// 附件类型 1:image, 2:link;类型: Number
+          
+          // 非必选
+          // 附件信息
+          // attachment: {
+            // images: ["https://www.baidu.com/img/bd_logo1.png?where=super"], // 图片附件, type=1时, 必选;类型: Array<String>
+            // image: "https://www.baidu.com/img/bd_logo1.png?where=super", // 链接附件, type=2时, 必选;类型: String    
+            // title: "这是一个测试", // 链接附件, type=2时, 必选;类型: String
+            // url: "https://www.baidu.com/", // 链接附件, type=2时, 必选;类型 String
+            // text: "测试发钉成功" // 链接附件, type=2时, 必选;类型: String
+          // },
+          text: text,  // 正文
+          bizType :0, // 业务类型 0:通知DING;1:任务;2:会议;
+
+          // 任务信息
+          // bizType=1的时候选填
+          taskInfo: {    
+            ccUsers: ['100', '101'],// 抄送用户列表, 工号,类型: Array<String>
+            deadlineTime: {"format":"yyyy-MM-dd HH:mm", "value":"2015-05-09 08:00"}, // 任务截止时间    
+            taskRemind: 30 // 任务提醒时间, 单位分钟;支持参数: 0:不提醒;15:提前15分钟;60:提前1个小时;180:提前3个小时;1440:提前一天;类型: Number
+          },
+          // 日程信息
+          // bizType=2的时候选填
+          confInfo: {      
+            bizSubType: 0,  // 子业务类型如会议: 0:预约会议, 1:预约电话会议, 2:预约视频会议;类型: Number (注: 目前只有会议才有子业务类型);
+            location: '某某会议室', // 会议地点(非必选),类型: String    
+            startTime: {"format":"yyyy-MM-dd HH:mm", "value":"2015-05-09 08:00"},// 会议开始时间  
+            endTime: {"format":"yyyy-MM-dd HH:mm", "value":"2015-05-09 08:00"},// 会议结束时间    
+            remindMinutes: 30, // 会前提醒。单位分钟;1:不提醒, 0:事件发生时提醒, 5:提前5分钟, 15:提前15分钟, 30:提前30分钟, 60:提前1个小时, 1440:提前一天
+            remindType: 2 // 会议提前提醒方式;0:电话, 1:短信, 2:应用内;类型: Number
+          },
+        
+          success:function(res){
+            /*
+            {
+              "dingId": "1_1_a09f167xxx",
+              "text": "钉正文内容",
+              "result": true
+            }
+            */  
+          },
+          fail:function(err){
+          }
+      })
+  },
+
+    //上啦加载
+  onScrollToLower() {
+    if (that.data.isData) {
+      this.setData({
+        'parameter.page':++this.data.parameter.page
+       })
+      this.opneWebSocket();
+    }
+  },
+  opneWebSocket() {
+    dd.showLoading({
+      content: '加载中...',
+    });
+    setTimeout(() => {
+      dd.hideLoading();
+    }, 600)
+    app.globalData.socketApi.sendData(this.data.parameter, this.onmessageWS);
+  },
+  onmessageWS(e) {
+    // 因为作用域问题,这个函数不能使用this
+    if (e.type == 'task_statistics') {
+      let result = e.result
+      result.map(item => {
+        item.date = that.timestampToTime(item.expire_time);
+        item.pt_name=item.pt_id==3? 'B分':'A分'
+        item.sub= that.formatSeconds(item.sub);
+      })
+      // console.log(result)
+      var list = that.data.list || [];
+
+      that.setData({
+        list:that.data.parameter.page=='1'?result:list.concat(result),
+        isData:result.length<100? false:true,
+      })
+    }
+  },
+  formatSeconds(value) { 
+    var theTime = parseInt(value);// 需要转换的时间秒 
+    var theTime1 = 0;// 分 
+    var theTime2 = 0;// 小时 
+    var theTime3 = 0;// 天
+    if(theTime > 60) { 
+      theTime1 = parseInt(theTime/60); 
+      theTime = parseInt(theTime%60); 
+      if(theTime1 > 60) { 
+      theTime2 = parseInt(theTime1/60); 
+      theTime1 = parseInt(theTime1%60); 
+      if(theTime2 > 24){
+        //大于24小时
+        theTime3 = parseInt(theTime2/24);
+        theTime2 = parseInt(theTime2%24);
+      }
+      } 
+    } 
+    var result = '';
+    // if(theTime > 0){
+    //   result = ""+parseInt(theTime)+"秒";
+    // }
+    // if(theTime1 > 0) { 
+    //   result = ""+parseInt(theTime1)+"分"+result; 
+    // } 
+    if(theTime2 > 0) { 
+      result = ""+parseInt(theTime2)+"小时"+result; 
+    } 
+    if(theTime3 > 0) { 
+      result = ""+parseInt(theTime3)+"天"; 
+    }
+
+    return result; 
+  },
+  timestampToTime(timestamp) {
+    var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+    var Y = date.getFullYear() + '-';
+    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
+    var D = date.getDate() + ' ';
+    var h = date.getHours() + ':';
+    var m = date.getMinutes() + ':';
+    var s = date.getSeconds();
+    // return Y + M + D + h + m + s;
+    return Y + M + D;
+  },
+  activeItem(e) {
+    var index = Number(e.detail.value)+1;
+    var status = "";
+    if (index == 1) {
+      status = "all"
+    } else if (index == 2) {
+      status = "on_time"
+    } else if (index == 3) {
+      status = "before"
+    }else{
+      status = "over_due"
+    }
+    this.setData({
+      minuteIndex: e.detail.value,
+      [`parameter.range`]:status
+    })
+    // console.log(this.data.parameter)
+    this.opneWebSocket()
+  },
+  openDetail(e) {
+    var id = e.target.dataset.item.id;
+    dd.navigateTo({
+      url: '../../statistics/workDetail/workDetail?id=' + id
+    })
+  },
+});

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

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

+ 229 - 0
pages/statistics/taskStatistical/taskStatistical.acss

@@ -0,0 +1,229 @@
+.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%);
+}
+.userSelect{
+  background-color: #fff;
+  text-align: center;
+  padding-right: 1.4rem;
+  border-bottom:1px solid #f1f1f1 ;
+  position: relative;
+}
+.ren{
+  position: absolute;
+  right: 0.32rem;
+  top: 0.3rem;
+  color: #969799;
+  font-size: 28rpx;
+}
+.userSelect .msg{
+  height: 0.8rem;
+  max-width: 5rem;
+  line-height: 0.8rem;
+  padding: 0 0.32rem;
+  overflow: hidden;
+	text-overflow: ellipsis;
+  white-space: nowrap;
+  position: relative;
+  font-size: 32rpx;
+  display: inline-block;
+  top: 6rpx;
+}
+.btns view{
+    text-align: center;
+    padding:0.32rem;
+    border-top: 1px solid #f1f1f1;
+    font-size: 0.28rem
+}
+.btns view:nth-child(1){
+    border-right: 1px solid #f1f1f1;
+}
+.btns view:nth-child(2){
+   color: #26A2FF;
+}
+.text2 {
+  border-radius: 50%;
+  border: 1px solid #909399;
+  color: #909399;
+  width: 26rpx;
+  height: 26rpx;
+  font-size: 22rpx;
+  text-align: center;
+  display: inline-block;
+  margin-left: 10rpx;
+  position: relative;
+  line-height: 26rpx;
+  box-sizing: border-box;
+}
+.userSelect .msg::after{
+  	position: absolute;
+    top: 50%;
+    right: 10rpx;
+    margin-top: -0.1rem;
+		border: 0.06rem solid;
+		border-color: transparent transparent #666 #666;
+		-webkit-transform: rotate(-45deg);
+		transform: rotate(-45deg);
+		/* opacity: .8; */
+		content: ' ';
+}
+.header{
+  background-color: #fff;
+}
+.title{
+  border-bottom: 1px solid #f1f1f1;
+  padding: 0.28rem 0.32rem;
+  color: #222;
+  font-size: 32rpx;
+  position: relative;
+}
+.title::before{
+  position: absolute;
+  content: "";
+  height: 30rpx;
+  left: 16rpx;
+  top: 50%;
+  margin-top: -16rpx;
+  width: 6rpx;
+  background-color: #26A2FF;
+  border-radius: 50rpx;
+}
+.bfb{
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  color: #26A2FF;
+  width: 1.4rem;
+  font-size: 40rpx;
+  margin-left: -0.7rem;
+  margin-top:-0.1rem;
+  text-align: center;
+}
+.bfb2{
+  position: absolute;
+  top: 50%;
+  left: 25%;
+  color: #222;
+  width: 1.4rem;
+  height: 1.4rem;
+  font-size: 24rpx;
+  margin-left: -0.57rem;
+  margin-top:-0.6rem;
+  text-align: center;
+  /* background-color: #F4C04A; */
+}
+.jt{
+  font-size:32rpx;
+  position: relative;
+  /* padding-right: 0.32rem; */
+}
+/* .jt::after{
+  	position: absolute;
+    top: 50%;
+    right: 10rpx;
+    margin-top: -0.1rem;
+		border: 0.06rem solid;
+		border-color: transparent transparent #666 #666;
+		-webkit-transform: rotate(-45deg);
+		transform: rotate(-45deg);
+		content: ' ';
+} */
+.header .item{
+  padding:0.32rem;
+}
+.item .img{
+  width:80rpx;
+  border-radius: 50%;
+  height: 80rpx;
+  text-align: center;
+  line-height: 100rpx;
+  margin-right: 20rpx;
+}
+.img image{
+  width:40rpx;
+  height: 40rpx;
+}
+.msg .num{
+  color: #222;
+  font-size: 36rpx;
+}
+.msg text{
+  color: #969799;
+  font-size: 24rpx;
+}
+.main{
+  background-color: #fff;
+  padding-bottom: 0.24rem;
+}
+.item2{
+  text-align: center;
+}
+.item2 text{
+  color: #222;
+  font-size: 36rpx;
+  margin-bottom: 10rpx;
+}
+.item2 view{
+  color: #969799;
+  font-size: 24rpx;
+}
+.rule-all-text{
+  font-size: 28rpx;
+  color: #999;
+  position: relative;
+  right: 10rpx;
+  bottom: 5rpx;
+}
+.zk{
+  color: #999;
+  text-decoration:line-through;
+}
+.windows-box {
+  background: #fff;
+  border-radius: 20rpx;
+  position: absolute;
+  left: 10%;
+  right: 10%;
+  top: 40%;
+  margin-top: -25%;
+}
+
+.windows-title {
+  padding: 32rpx;
+  color: #999;
+  font-size: 24rpx;
+}
+
+.windows-btn view:nth-child(1) {
+  text-align: right;
+  padding: 32rpx;
+  color: #26A2FF;
+}
+
+.windows-content {
+  /* height: 1rem; */
+  padding: 0 28rpx;
+  font-size: 28rpx;
+  color: #666;
+}
+.windows-content view{
+  margin-bottom: 16rpx;
+}
+.windows-content .chu{
+  font-weight: 600;
+  font-size: 32rpx;
+  color: #222;
+}
+.windows-content2 {
+  height: auto;
+  max-height: 4rem;
+  overflow-y: auto;
+  padding:28rpx;
+  font-size: 32rpx;
+}

+ 137 - 0
pages/statistics/taskStatistical/taskStatistical.axml

@@ -0,0 +1,137 @@
+<view>
+  <view class="{{popupCx}}">
+    <view class="userSelect" a:if="{{isAdministrator}}" catchTap="openSelect">
+      <text class="{{isAllChecked? 'zk':''}} msg">{{names}}</text>
+      <text class="ren">{{users.length}}人</text>
+    </view>
+    <view class="flex-box flex-v-ce staff-all">
+        <view class="flex-1"></view>
+        <label a:if="{{isAdministrator}}" class="flex-box-ce">
+          <text class="rule-all-text">只看自己</text>
+          <checkbox onChange="ruleActiveAll" checked="{{isAllChecked}}"></checkbox>
+        </label>
+    </view>
+    <view class="header margin-bottom">
+      <view class="title">任务现状</view>
+      <view>
+        <view class="flex-box-ce item" style="border-bottom:1px solid #FAFAFB">
+          <text class="flex-1 flex-box-ce" style="border-right:1px solid #FAFAFB" catchTap="openUrl" data-index="1">
+            <view class="img" style="background-color: rgba(245,108,108,0.1);">
+              <image mode="scaleToFill" src="../../../image/yq.png" /></view>
+            <view class="msg">
+              <view class="num">{{result.now.expired}}</view>
+              <text>逾期未完成</text>
+            </view>
+          </text>
+          <text class="flex-1 flex-box-ce" style="padding-left:0.32rem" catchTap="openUrl" data-index="2">
+            <view class="img" style="background-color: rgba(230,162,60,0.1);">
+              <image mode="scaleToFill" src="../../../image/jr.png" /></view>
+            <view class="msg">
+              <view class="num">{{result.now.today_expire}}</view>
+              <text>今日到期</text>
+            </view>
+          </text>
+        </view>
+        <view class="flex-box-ce item">
+          <text class="flex-1 flex-box-ce" style="border-right:1px solid #FAFAFB" catchTap="openUrl" data-index="3">
+            <view class="img" style="background-color: rgba(38,162,255,0.1);">
+              <image mode="scaleToFill" src="../../../image/jxz.png" /></view>
+            <view class="msg">
+              <view class="num">{{result.now.doing}}</view>
+              <text>进行中</text>
+            </view>
+          </text>
+          <text class="flex-1 flex-box-ce" style="padding-left:0.32rem" catchTap="openUrl" data-index="4">
+            <view class="img" style="background-color: rgba(103,194,58,0.1);">
+              <image mode="scaleToFill" src="../../../image/dsp.png" /></view>
+            <view class="msg">
+              <view class="num">{{result.now.reviewing}}</view>
+              <text>待审批</text>
+            </view>
+          </text>
+        </view>
+      </view>
+    </view>
+    <view class="main margin-bottom">
+      <view class="title flex-box-ce flex-d-center">
+        <text catchTap="showText" data-index="2">任务完成统计 <text class="text2">?</text></text>
+        <view class="flex-box-ce" catchTap="showText" data-index="5">
+          <text class="blue jt" data-num="1">{{start_date}}</text>
+          <text style="padding:0 10rpx">~</text>
+          <text class="blue jt" data-num="2">{{end_date}}</text>
+        </view>
+        <!-- <view class="jt" catchTap="openDate">{{date}}</view> -->
+      </view>
+      <view>
+        <view style="position: relative;">
+            <f2 onInit="onInitChart"></f2>
+            <view class="bfb">{{bfb}}%</view>
+        </view>
+        <view class="flex-box-ce">
+          <view class="item2 flex-1">
+            <text>{{result.complete.all}}条</text>
+            <view>总任务数</view>
+          </view>
+          <view class="item2 flex-1">
+            <text>{{result.complete.done}}条</text>
+            <view>完成任务数</view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="main" style="margin-bottom:1rem">
+      <view class="title" catchTap="showText" data-index="3">完成情况占比 <text class="text2">?</text></view>
+      <view style="position: relative;">
+        <f2 onInit="onInitChart2"></f2>
+      </view>
+    </view>
+  </view>
+  <view class="box" animation="{{animationInfo}}">
+    <select-section-staff isLeadership="{{true}}" a:if="{{showStaff}}" isBoss="{{true}}" selectUser="{{users}}" onClose="onClose"  onConfirm="onSelectUser" />
+  </view>
+  <view a:if="{{isBh=='5'}}" class="windows">
+    <view class="windows-box">
+      <view class="windows-title">请选择时间区间</view>
+      <view class="windows-content" style="height:2rem">
+        <view class="flex-box-ce flex-center-center" style="padding-top:0.6rem">
+          <text class="blue jt" data-num="1" catchTap="openDate">{{start_date2}}</text>
+          <text style="padding:0 20rpx">~</text>
+          <text class="blue jt" data-num="2" catchTap="openDate">{{end_date2}}</text>
+        </view>
+      </view>
+      <view class="btns flex-box flex-v-ce">
+        <view class="flex-1" catchTap="showText" data-index="4">取消</view>
+        <view class="flex-1" catchTap="qrDate">确定</view>
+      </view>
+    </view>
+  </view>
+  <view a:if="{{isBh=='2'}}" class="windows">
+    <view class="windows-box" style="top:30%">
+      <view class="windows-title">温馨提示</view>
+      <view class="windows-content">
+          <view class="chu">支持自定义选择时间范围</view>
+          <view class="chu">总任务数</view>
+          <view>只要任务从开始到截止与选择时间段有交叉,或者在选择时间段内完成的,都会加入统计</view>
+          <view class="chu">完成任务数</view>
+          <view>只已经完成的任务,包含待审批和已审批通过的,不计算审批驳回的</view>
+          <view class="chu">百分比计算方式</view>
+          <view>完成百分比=完成任务数/总任务数</view>
+      </view>
+      <view class="windows-btn flex-box flex-v-ce">
+        <view class="flex-1" catchTap="showText" data-index="4">我知道了</view>
+      </view>
+    </view>
+  </view>
+  <view a:if="{{isBh=='3'}}" class="windows">
+    <view class="windows-box">
+      <view class="windows-title">温馨提示</view>
+      <view class="windows-content">
+          <view class="chu">按时完成数</view>
+          <view>按时完成任务为截止时间之前完成的任务</view>
+      </view>
+      <view class="windows-btn flex-box flex-v-ce">
+        <view class="flex-1" catchTap="showText" data-index="4">我知道了</view>
+      </view>
+    </view>
+  </view>
+</view>

+ 394 - 0
pages/statistics/taskStatistical/taskStatistical.js

@@ -0,0 +1,394 @@
+var app = getApp()
+var that;
+var animation;
+var setTime;
+var chart1;
+var chart2;
+Page({
+  data: {
+    animationInfo: '',
+    showStaff: true,
+    date: app.globalData.month,
+    names: '',
+    users: [],
+    isAdministrator: true,//是否管理者
+    isAllChecked: false,
+
+    popupCx: '',
+    start_date: '',
+    end_date: '',
+    result: {},
+    isBh:'4',
+    setECharts: [],//柱形图数据
+
+    bfb: '0',//一图百分比
+    sum: 0,
+  },
+  onLoad() {
+    that = this;
+    chart1, chart2 = '';
+    dd.setNavigationBar({ title: "任务统计" });
+    this.init();
+    this.getMonth();//设置日期
+  },
+  // 页面被关闭
+  onUnload() {
+    app.globalData.socketApi.closewebsocket();
+  },
+  onShow() {
+    animation = dd.createAnimation({
+      duration: 200,
+      timeFunction: "linear",
+    });
+    if(this.data.isAllChecked){
+          this.opneWebSocket(true)
+          return false
+    }
+    this.opneWebSocket()
+  },
+  showText(e) {
+    let index = e.target.dataset.index;
+    if(index=='5'){
+      that.setData({
+        start_date2: that.data.start_date,
+        end_date2: that.data.end_date,
+      })
+    }
+    this.setData({ isBh: index })
+  },
+  init() {
+    let manage_scope = app.globalData.userData.employee_detail.manage_scope;
+    let names = '';
+    let users = [];
+    let isAdministrator = true;//是否员工
+    if (manage_scope.length > 0) {
+      isAdministrator = true;
+      manage_scope.forEach((item,index) => {
+        if((index+1)!=manage_scope.length){
+          names += item.name + ',';
+        }else{
+          names += item.name
+        }
+        users.push(item)
+      })
+    } else {
+      isAdministrator = false;
+      names = app.globalData.userData.name;
+      users = [app.globalData.userData];
+    }
+    this.setData({
+      names: names,
+      users: users,
+      isAdministrator: isAdministrator
+    })
+  },
+  openUrl(e) {
+    let index = e.target.dataset.index;
+    let method = 'expiredList';
+    if (index == '1') {
+      method = 'expiredList';
+    } else if (index == '2') {
+      method = 'todayExpireList';
+    } else if (index == '3') {
+      method = 'doingList';
+    } else {
+      method = 'reviewingList';
+    }
+    let target = [];
+    if (this.data.isAllChecked) {
+      target = [app.globalData.userData.id]
+    } else {
+      target = this.data.users.map(item => {
+        return item.id;
+      })
+    }
+    let data = {
+      type: 'task_statistics',
+      start_date: this.data.start_date,
+      end_date: this.data.end_date,
+      target: target,
+      method: method,
+      index: index,
+      page: 1,
+      page_size: 100
+    }
+    dd.navigateTo({
+      url: '../taskSList/taskSList?data=' + JSON.stringify(data)
+    })
+  },
+  onInitChart(F2, config) {
+    const data = [{
+      x: '1',
+      y: 0
+    }];
+    chart1 = new F2.Chart(config);
+    chart1.source(data, { y: { max: 100, min: 0 } });
+    chart1.axis(false);
+    chart1.tooltip(false);
+    chart1.coord('polar', {
+      transposed: true,
+      innerRadius: 1.2,
+      radius: 0.85
+    });
+    chart1.guide().arc({
+      start: [0, 0],
+      end: [1, 99.98],
+      top: false,
+      style: {
+        lineWidth: 20,
+        stroke: '#ccc'
+      }
+    });
+    chart1.interval().position('x*y').size(20).animate({
+      appear: {
+        duration: 1200,
+        easing: 'cubicIn'
+      }
+    });
+    chart1.render();
+  },
+  onInitChart2(F2, config) {
+    const data = [];
+    chart2 = new F2.Chart(config);
+    chart2.source(data, {
+      percent: {
+        formatter: function formatter(val) {
+          return val * 100 + '%';
+        }
+      }
+    });
+    chart2.tooltip(false);
+    chart2.coord('polar', {
+      transposed: true,
+      radius: 0.85
+    });
+    chart2.axis(false);
+    chart2.interval()
+      .position('a*percent')
+      .color('name', ['#1890FF', '#F56C6C', '#2FC25B', '#FACC14', '#F04864', '#8543E0'])
+      .adjust('stack')
+      .style({
+        lineWidth: 1,
+        stroke: '#fff',
+        lineJoin: 'round',
+        lineCap: 'round'
+      })
+      .animate({
+        appear: {
+          duration: 1200,
+          easing: 'bounceOut'
+        }
+      });
+    chart2.render();
+  },
+  ruleActiveAll(e) {
+    this.setData({
+      isAllChecked: e.detail.value
+    })
+    if (e.detail.value) {
+      this.opneWebSocket(true);
+    } else {
+      this.opneWebSocket();
+    }
+  },
+  tsTamp(ydm) {
+    return new Date(ydm).getTime()
+  },
+  opneWebSocket(is) {
+    let timeC = (this.tsTamp(this.data.start_date) - this.tsTamp(this.data.end_date)) / (60 * 60 * 24 * 1000)
+    if (timeC > 0) {
+      app.globalData.showToast("开始时间不能大于结束时间")
+      return
+    }
+    dd.showLoading({
+      content: '加载中...',
+    });
+    setTimeout(() => {
+      dd.hideLoading();
+    }, 600)
+    let target = this.data.users.map(item => {
+      return item.id;
+    })
+    let data = {
+      type: 'task_statistics',
+      start_date: this.data.start_date,
+      end_date: this.data.end_date,
+      target: is ? [app.globalData.userData.id] : target
+    }
+    app.globalData.socketApi.sendData(data, this.onmessageWS);
+  },
+  onmessageWS(e) {
+    // 因为作用域问题,这个函数不能使用this
+    if (e.type == 'task_statistics') {
+      let result = e.result;
+      that.setData({
+        result: result,
+      })
+      setTimeout(() => {
+        that.setChart(result)
+      }, 600)
+    }
+  },
+  setChart(result) {
+    // 图像一
+    // result.complete={
+    //   done:50,
+    //   all:60,
+    //   ahead:40,
+    //   expired:90,
+    // }
+    let bfb = (Math.round(result.complete.done / result.complete.all * 10000) / 100.00);
+    if (bfb !== bfb) { bfb = 0; };
+    if(result.complete.done > result.complete.all){
+      const setECharts = [{ x: '1', y: 100 }];
+      that.setData({
+        bfb: 100
+      })
+      chart1.changeData(setECharts)
+    }else{
+      const setECharts = [{ x: '1', y: bfb }];
+      chart1.changeData(setECharts)
+      that.setData({
+        bfb: bfb
+      })
+    }
+
+    // 图像二
+    let complete = result.complete
+    let sum = complete.ahead + complete.expired;
+    let ahead = (Math.round(complete.ahead / sum * 10000) / 100.00);
+    let expired = (Math.round(complete.expired / sum * 10000) / 100.00);
+    const data = [{
+      name: '按时完成',
+      percent: ahead !== ahead ? 0 : ahead,
+      num: complete.ahead,
+      a: '1'
+    }, {
+      name: '逾期完成',
+      percent: expired !== expired ? 0 : expired,
+      num: complete.expired,
+      a: '1'
+    }];
+    const map = [];
+    data.forEach(function (obj) {
+      map[obj.name] = obj.num + '项    ' + obj.percent + '%';
+    });
+    chart2.legend({
+      position: 'right',
+      itemFormatter: function itemFormatter(val) {
+        return val + '    ' + map[val];
+      }
+    });
+    chart2.changeData(data)
+  },
+  //选择弹窗
+  openSelect() {
+    that.setData({ showStaff: false });
+    if (this.data.isAllChecked) {
+      return false
+    }
+    animation.translateY(0).step();
+    that.setData({
+      showStaff: true,
+      popupCx: 'container__mask',
+      animationInfo: animation.export()
+    });
+  },
+  //关闭规则
+  onClose() {
+    animation.translateY(1200).step();
+    that.setData({
+      popupCx: '',
+      showStaff: false,
+      animationInfo: animation.export()
+    });
+  },
+  //时间选择
+  openDate(e) {
+    let num = e.target.dataset.num
+    let date = num == '1' ? that.data.start_date : that.data.end_date
+    dd.datePicker({
+      format: 'yyyy-MM-dd',
+      currentDate: date,
+      success: (res) => {
+        if (res.date) {
+          if (num == '1') {
+            that.setData({
+              start_date2: res.date,
+            })
+          } else {
+            that.setData({
+              end_date2: res.date,
+            })
+          }
+        }
+      }
+    });
+  },
+  qrDate(){
+      that.setData({
+        start_date: that.data.start_date2,
+        end_date: that.data.end_date2,
+        isBh: "4"
+      })
+
+      if (that.data.isAllChecked) {
+        that.opneWebSocket(true);
+      } else {
+        that.opneWebSocket();
+      }
+  },
+  //选择员工
+  onSelectUser(data) {
+    let names = '', users = [];
+    data.forEach((item,index) => {
+      if((index+1)!=data.length){
+        names += item.name + ',';
+      }else{
+        names += item.name
+      }
+      users.push(item);
+    })
+    this.setData({
+      names: names,
+      users: users,
+    })
+    this.opneWebSocket()
+  },
+  getMonth() {
+    // 获取当前月的第一天
+    var start = new Date();
+    start.setDate(1);
+    // 获取当前月的最后一天
+    var date = new Date();
+    var currentMonth = date.getMonth();
+    var nextMonth = ++currentMonth;
+    var nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1);
+    var oneDay = 1000 * 60 * 60 * 24;
+    var end = new Date(nextMonthFirstDay - oneDay);
+
+    var startDate = this.transferDate(start); // 日期变换
+    var endDate = this.transferDate(end); // 日期变换
+    this.setData({
+      start_date: startDate,
+      end_date: endDate
+    })
+    // return startDate + ' - ' + endDate;
+  },
+  transferDate(date) {
+    // 年
+    var year = date.getFullYear();
+    // 月
+    var month = date.getMonth() + 1;
+    // 日
+    var day = date.getDate();
+    if (month >= 1 && month <= 9) {
+      month = "0" + month;
+    }
+    if (day >= 0 && day <= 9) {
+      day = "0" + day;
+    }
+    var dateString = year + '-' + month + '-' + day;
+    return dateString;
+  }
+});

+ 8 - 0
pages/statistics/taskStatistical/taskStatistical.json

@@ -0,0 +1,8 @@
+{
+  "usingComponents": {
+    "select-section-staff": "/Component/selectSectionStaff/selectSectionStaff",
+    "f2": "@antv/my-f2",
+    "no-data":"/Component/noData/noData"
+  },
+  "allowsBounceVertical": "NO"
+}

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

@@ -41,7 +41,7 @@
           </view>
         </view>
         <view class="li">
-          <textarea value="{{item.remark}}" maxlength="100" onInput="bindTextAreaBlur" placeholder="申请内容" data-index="{{index}}"></textarea>
+          <textarea value="{{item.remark}}" maxlength="300" onInput="bindTextAreaBlur" placeholder="申请内容" data-index="{{index}}"></textarea>
           <image mode="scaleToFill" src="../../../image/addImg.png" data-index="{{index}}" class="addImg" catchTap="openImg"/>
         </view>
         <view style="background:#fff;padding:0 28rpx;" a:if="{{item.files[0]}}" class="flex-box flex-v-ce">

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

@@ -45,7 +45,6 @@ Page({
   },
   onLoad(e) {
     that = this;
-    this.cheakAx()
     dd.setNavigationBar({ title: "申请积分" });
     if (e.id) {
       this.setData({ //获取扫码进入参数 
@@ -79,10 +78,12 @@ Page({
     });
     if (app.globalData.userData) {
       that.showQrcode();
+      that.cheakAx()
     } else {
       app.login(app.globalData.corpId, function (is) {
         if (is) {
           that.showQrcode();
+          that.cheakAx()
         } else {
           dd.reLaunch({
             url: '../../noJurisdiction/noJurisdiction'

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

@@ -259,8 +259,8 @@ Page({
           pt_Obj: app.getTypesItem(data.pt_id),
         }
       } else if (data.rule_id && data.point) {
-        console.log(2);
-        isData = 2
+        console.log(3);
+        isData = 3
         selectRule = '';
       } else if (data.rule_id) {
         console.log(3);

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

@@ -91,58 +91,6 @@ Page({
       },function(){},true)
     }
   },
-  activeA(){
-      dd.createDing({
-          users: ["102250695436416908"], //默认选中用户工号列表;类型: Array<String>
-          corpId: app.globalData.corpId, // 类型: String
-          alertType: 2, // 钉发送方式 0:电话, 1:短信, 2:应用内;类型 Number
-          alertDate: {"format":"yyyy-MM-dd HH:mm", "value":"2019-08-29 08:25"}, // 非必选,定时发送时间, 非定时DING不需要填写
-          type: 1,// 附件类型 1:image, 2:link;类型: Number
-          
-          // 非必选
-          // 附件信息
-          attachment: {
-            images: ["https://www.baidu.com/img/bd_logo1.png?where=super"], // 图片附件, type=1时, 必选;类型: Array<String>
-            // image: "https://www.baidu.com/img/bd_logo1.png?where=super", // 链接附件, type=2时, 必选;类型: String    
-            title: "这是一个测试", // 链接附件, type=2时, 必选;类型: String
-            url: "https://www.baidu.com/", // 链接附件, type=2时, 必选;类型 String
-            text: "测试发钉成功" // 链接附件, type=2时, 必选;类型: String
-          },
-          text: '测试ding',  // 正文
-          bizType :0, // 业务类型 0:通知DING;1:任务;2:会议;
-
-          // 任务信息
-          // bizType=1的时候选填
-          taskInfo: {    
-            ccUsers: ['100', '101'],// 抄送用户列表, 工号,类型: Array<String>
-            deadlineTime: {"format":"yyyy-MM-dd HH:mm", "value":"2015-05-09 08:00"}, // 任务截止时间    
-            taskRemind: 30 // 任务提醒时间, 单位分钟;支持参数: 0:不提醒;15:提前15分钟;60:提前1个小时;180:提前3个小时;1440:提前一天;类型: Number
-          },
-          // 日程信息
-          // bizType=2的时候选填
-          confInfo: {      
-            bizSubType: 0,  // 子业务类型如会议: 0:预约会议, 1:预约电话会议, 2:预约视频会议;类型: Number (注: 目前只有会议才有子业务类型);
-            location: '某某会议室', // 会议地点(非必选),类型: String    
-            startTime: {"format":"yyyy-MM-dd HH:mm", "value":"2015-05-09 08:00"},// 会议开始时间  
-            endTime: {"format":"yyyy-MM-dd HH:mm", "value":"2015-05-09 08:00"},// 会议结束时间    
-            remindMinutes: 30, // 会前提醒。单位分钟;1:不提醒, 0:事件发生时提醒, 5:提前5分钟, 15:提前15分钟, 30:提前30分钟, 60:提前1个小时, 1440:提前一天
-            remindType: 2 // 会议提前提醒方式;0:电话, 1:短信, 2:应用内;类型: Number
-          },
-        
-          success:function(res){
-            /*
-            {
-              "dingId": "1_1_a09f167xxx",
-              "text": "钉正文内容",
-              "result": true
-            }
-            */  
-          },
-          fail:function(err){
-          }
-      })
-  },
-
   openGly() {
     contactAdminToUseApp({ id: '55493', corpId: that.data.mainCorpId })
       .catch((err) => {

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

@@ -91,7 +91,7 @@
           <image mode="scaleToFill" src="../../../image/right.png" class="rightImg" />
         </view>
         <view class="li">
-          <textarea maxlength="100" value="{{item.remark}}" onInput="bindTextAreaBlur" placeholder="请输入事件内容" data-index="{{index}}"></textarea>
+          <textarea maxlength="300" value="{{item.remark}}" onInput="bindTextAreaBlur" placeholder="请输入事件内容" data-index="{{index}}"></textarea>
           <image mode="scaleToFill" src="../../../image/addImg.png" data-index="{{index}}" class="addImg" catchTap="openImg" />
         </view>
         <view style="background:#fff;padding:0 28rpx;" a:if="{{item.files[0]}}" class="flex-box flex-v-ce">