Browse Source

1.5.1期更新

347617796@qq.com 3 years ago
parent
commit
ee4625a30d

+ 13 - 3
Component/img-box/index.js

@@ -1,4 +1,4 @@
-
+var app = getApp()
 Component({
   mixins: [],
   data: {
@@ -6,6 +6,7 @@ Component({
   },
   props: {
       name:'未定义',
+      id:'',
       imgUrl:'',
       width:'',
       height:'',
@@ -25,11 +26,20 @@ Component({
   },
   methods: {
     setName(){
-        // console.log(this.props.name,this.props.imgUrl)
           var str=this.props.name;
           var name=str.substr(str.length-2);
+          let userImg=this.props.imgUrl;
+          if(this.props.id&&app.globalData.usersList.length>0&&!userImg){
+              app.globalData.usersList.some(item=>{
+                if(this.props.id==item.id){
+                  userImg=item.img_url
+                  return true
+                }
+              })
+          }
           this.setData({
-            userName:name
+            userName:name,
+            imgUrl:userImg
           })
     }
   },

+ 2 - 0
Component/selectSectionStaff_tow/selectSectionStaff_tow.axml

@@ -26,6 +26,7 @@
           <view class="xia" a:if="{{item._child.length>0}}" data-item="{{item}}" catchTap="openDown">| 下级</view>
         </view>
       </view>
+
       <view a:if="{{item.name.indexOf(keyVal)>= 0}}" class="flex-box flex-v-ce userItem" a:for="{{userList}}" a:key="{{index}}">
         <view class="{{item.checked? 'active':''}} flex-box flex-v-ce flex-1" catchTap="bindtap1" data-index="{{index}}" data-item="{{item}}">
           <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="70rpx" width="70rpx"></img-box>
@@ -33,6 +34,7 @@
           <view class="radio_"></view>
         </view>
       </view>
+      
       <view a:if="{{userList.length==0}}">
         <view class="fontColorF" style="margin-top:200rpx;text-align: center;">
           <view>您暂无相关审批人</view>

+ 51 - 26
Component/selectStaff/selectStaff.acss

@@ -1,38 +1,41 @@
-.all-date{
+.all-date {
   overflow: hidden;
   height: 100vh;
   position: fixed;
   left: 0;
-  right:0;
-  top:80rpx;
+  right: 0;
+  top: 80rpx;
   z-index: 5;
   /* background-color: rgba(0,0,0,.7); */
 }
-.staff-header{
+
+.staff-header {
   background-color: #fff;
-  box-shadow:inset 0px 0px 5px #ccc;
+  box-shadow: inset 0px 0px 5px #ccc;
   padding-top: 28rpx;
   margin-top: 0rpx;
   transform: translateY(-100%);
-    position: fixed;
+  position: fixed;
   left: 0;
   right: 0;
   z-index: 8;
 }
 
-.staff-btn view{
+.staff-btn view {
   text-align: center;
   padding: 20rpx 0;
 }
-.staff-btn view:nth-child(1){
+
+.staff-btn view:nth-child(1) {
   background-color: #f1f1f1;
 }
-.staff-btn view:nth-child(2){
+
+.staff-btn view:nth-child(2) {
   background-color: #26a2ff;
   color: #fff;
 }
 
-.staff-ul{
+.staff-ul {
   width: 100%;
   background-color: #fff;
   height: 700rpx;
@@ -40,40 +43,62 @@
   margin-top: 28rpx;
   border-top: 1px solid #f1f1f1;
 }
-.userItem{
-    padding:10rpx 32rpx;
-    border-bottom: 1px solid #f1f1f1;
+
+.userItem {
+  padding: 10rpx 32rpx;
+  border-bottom: 1px solid #f1f1f1;
 }
-.staff-ul .userItem .xia{
+
+.staff-ul .userItem .xia {
   color: #26A2FF !important;
 }
-.shu{
+
+.shu {
   padding: 14rpx 24rpx;
   background: #fff;
   font-size: 28rpx;
   color: #26A2FF;
   border-bottom: 1px solid #f1f1f1;
 }
-.shu view:last-child{
+
+.shu view:last-child {
   color: #ccc;
 }
-.search{
-    background-color: #f1f1f1;
-    border-radius: 10rpx;
-    margin: 0 32rpx;
-    padding:8rpx 10rpx;
+
+.search {
+  background-color: #f1f1f1;
+  border-radius: 10rpx;
+  margin: 0 32rpx;
+  padding: 8rpx 10rpx;
 }
-.search input{
-    background-color: #f1f1f1;
+
+.search input {
+  background-color: #f1f1f1;
 }
-.search image{
+
+.search image {
   width: 30rpx;
   height: 30rpx;
   margin-left: 10rpx;
 }
-.selectUsers{
+
+.selectUsers {
   padding: 10rpx;
   border-top: 1px solid #f1f1f1;
-  overflow-y:auto;
+  overflow-y: auto;
   width: 100%;
+}
+
+.date-btn view {
+  text-align: center;
+  padding: 20rpx 0;
+}
+
+.date-btn view:nth-child(1) {
+  background-color: #f1f1f1;
+}
+
+.date-btn view:nth-child(2) {
+  background-color: #26a2ff;
+  color: #fff;
 }

+ 16 - 19
Component/selectStaff/selectStaff.axml

@@ -1,37 +1,34 @@
 <view class="all-date">
   <view class="data-tier" catchTap="onClose"></view>
   <view class="staff-header {{isShow?'showPop':''}}">
-  <form  onReset="onReset">
-    <view class="search flex-box flex-v-ce">
-      <image mode="scaleToFill" src="../../../image/ss.png"/>
-      <input placeholder="请输入姓名搜索" onInput="bindKeyInput" class="flex-1"/>
-      <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
-    </view>
+    <form onReset="onReset">
+      <view class="search flex-box flex-v-ce">
+        <image mode="scaleToFill" src="../../../image/ss.png"/>
+        <input placeholder="请输入姓名搜索" onInput="bindKeyInput" class="flex-1"/>
+        <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
+      </view>
     </form>
     <scroll-view class="staff-ul" scroll-y="{{true}}">
-      <!-- <checkbox-group class="radio-group" onChange="radioChange"> -->
-        <view class="flex-box flex-v-ce userItem" a:for="{{userList}}" a:if="{{item.name.indexOf(keyVal)>= 0}}">
-          <label class="flex-box flex-v-ce flex-1">
-            <img-box name="{{item.name}}" imgUrl="{{item.img_url}}"  height="70rpx" width="70rpx"></img-box>
-            <text style="margin-left:20rpx;" class="flex-1">{{item.name}}</text>
-            <checkbox  onChange="radioChange" data-index="{{index}}" data-item="{{item}}" checked="{{item.checked}}" name="{{item.id}}" value="{{item}}"/>
-          </label>
-        </view>
-      <!-- </checkbox-group> -->
+      <view class="flex-box flex-v-ce userItem" a:for="{{userList}}" a:if="{{item.name.indexOf(keyVal)>= 0}}">
+        <label class="flex-box flex-v-ce flex-1">
+          <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="70rpx" width="70rpx"></img-box>
+          <text style="margin-left:20rpx;" class="flex-1">{{item.name}}</text>
+          <checkbox onChange="radioChange" data-index="{{index}}" data-item="{{item}}" checked="{{item.checked}}" name="{{item.id}}" value="{{item}}"/>
+        </label>
+      </view>
       <view a:if="{{userList.length==0}}" class="fontColorF" style="margin-top:200rpx;text-align: center;">
-          <view>暂无相关人员</view>
+        <view>暂无相关人员</view>
       </view>
     </scroll-view>
     <view class="flex-box flex-v-ce selectUsers" a:if="{{selectUserId.length>0}}">
       <view a:for="{{selectUserId}}" style="margin-right:10rpx;height:70rpx;">
         <image a:if="{{item.img_url}}" class="img-url" style="width:70rpx;height:70rpx;display: inline-block;  position: relative;top: 6rpx;" src="{{item.img_url}}"></image>
         <view a:else style="width: 70rpx;height: 70rpx;border-radius: 100%;background: #26A2FF;color: #fff;text-align: center;line-height: 70rpx;font-size: 24rpx;">{{item.name.substr(item.name.length-2)}}</view>
-         <!-- <img-box name="{{item.name}}" imgUrl="{{item.img_url}}"  height="70rpx" width="70rpx"></img-box> -->
       </view>
     </view>
     <view class="flex-box date-btn">
-        <view class="flex-1" catchTap="onClose">取消</view>
-        <view class="flex-1" catchTap="onConfirm">确定</view>
+      <view class="flex-1" catchTap="onClose">取消</view>
+      <view class="flex-1" catchTap="onConfirm">确定</view>
     </view>
   </view>
   <view class="meng" catchTap="onClose"></view>

+ 41 - 30
Component/selectStaff/selectStaff.js

@@ -5,31 +5,33 @@ Component({
   data: {
     all_user_list: {},
     isShow: false,
-    keyVal:''
+    keyVal: '',
+    isAll: true,
   },
   props: {
     onConfirm: (data) => console.log(data),
     onClose: (data) => console.log(data),
     defaultUser: '',
+    isAllSelect: true,//是否多选
   },
   didMount() {
     that = this;
-    this.setData({ isShow: this.props.isShow })
+    this.setData({ isShow: this.props.isShow, isAll: that.props.isAllSelect, })
     this.getData();
   },
   didUpdate() { },
   didUnmount() { },
   methods: {
-    onReset(){
-          this.setData({
-            isVal: false,
-            keyVal:''
-          })
+    onReset() {
+      this.setData({
+        isVal: false,
+        keyVal: ''
+      })
     },
     //搜索
     bindKeyInput(e) {
       this.setData({
-        keyVal:e.detail.value,
+        keyVal: e.detail.value,
         isVal: e.detail.value ? true : false
       })
     },
@@ -38,15 +40,13 @@ Component({
       this.props.onClose();
     },
     radioChange: function (e) {
-        var selectUserId = this.data.selectUserId;
-        var isExist = false;
-        let item = e.target.dataset.item;
-        let index = e.target.dataset.index;
-        let checked = `userList[${index}].checked`;//获取当前控制选中的字段
-        let elm = this.data.userList[index].checked;//当前的状态
-        this.setData({
-           [checked]: !elm,
-        })
+      var selectUserId = this.data.selectUserId;
+      var isExist = false;
+      let item = e.target.dataset.item;
+      let index = e.target.dataset.index;
+      let checked = `userList[${index}].checked`;//获取当前控制选中的字段
+      let elm = this.data.userList[index].checked;//当前的状态
+      if (this.data.isAll) {//当可多选时
         if (e.detail.value) {//当有值时选中
           selectUserId.forEach((element, _this) => {
             if (element.id == item.id) {
@@ -63,26 +63,37 @@ Component({
             }
           });
         }
+      } else {//单选择
+        let userList=this.data.userList;
+        userList.map(item => {
+          item.checked = false;
+        })
+        selectUserId = [];
+        if (e.detail.value) {//当有值时选中
+            selectUserId.push(item);
+            this.setData({
+              userList: userList
+            })
+        } else {//取消选中
+          // selectUserId = [];
+        }
+      }
+      this.setData({
+        [checked]: !elm,
+      })
       this.setData({
-          selectUserId: selectUserId
+        selectUserId: selectUserId
       })
     },
     getData(keywords) {
       app.$get("api/employee/list", { dept_id: 0, keywords: keywords }).then((res) => {
         var list = res.data.data.list;
         var arr = this.props.defaultUser;
-        if(typeof(arr)=='string'){
-          //  arr=arr.substr(1, arr.length-2);
-           arr= arr.split(',');
+        if (typeof (arr) == 'string') {
+          arr = arr.split(',');
         }
-        var ids=[],userList=list;
-        // list.forEach(item=>{
-        //   if(item.is_official==1){
-        //       userList.push(item)
-        //   }
-        // })
-
-        userList.map(item=>{
+        var ids = [], userList = list;
+        userList.map(item => {
           item.checked = false;
           if (arr.length > 0) {
             arr.forEach(item2 => {
@@ -96,7 +107,7 @@ Component({
         this.setData({
           userList: userList,
           all_user_list: userList,
-          selectUserId:ids.length>0? ids:[]
+          selectUserId: ids.length > 0 ? ids : []
         })
       })
     },

+ 11 - 0
app.acss

@@ -343,6 +343,17 @@
 		flex-flow: column !important;
 	}
 
+	.flex-box-ce{
+		display: -webkit-box;
+		display: -moz-box;
+		display: -ms-flexbox;
+		display: -webkit-flex;
+		display: flex;
+		align-items: center;
+		-webkit-align-items: center;
+		-webkit-box-align: center;
+	}
+
 	/* 水平等列排版(容器左右没缝隙,子元素左右两边自适应) */
 
 	.flex-d-center {

+ 34 - 5
app.js

@@ -29,6 +29,8 @@ App({
     isAdministrator: false,//是否管理员
     isCreator: false,//是否是创始人
     corpMessage: '',//企业套餐信息
+    usersList: [],//缓存的人员列表
+
   },
   //获取积分类型
   getTypes(callBack) {
@@ -150,8 +152,6 @@ App({
           } else if (res.data.code == 401) {
             that.globalData.showToast("授权已过期");
             reject(res);
-          } else if (res.data.code == 2001) {
-            reject(res);
           } else {
             that.globalData.showToast(res.data.msg);
             reject(res);
@@ -215,7 +215,7 @@ App({
     // }
   },
   //免登
-  login(corpId, callBack,errBack) {
+  login(corpId, callBack, errBack) {
     if (that.globalData.token) {
       callBack(true)
     } else {
@@ -239,6 +239,7 @@ App({
                 that.globalData.userData = user;
                 var getIsStart = dd.getStorageSync({ key: 'isStart' });//判断是否需要打开引导页
                 // console.log(JSON.stringify(user));
+                that.getUserList();//缓存人员列表
                 if (isStart && !getIsStart.data) {//判断是否需要打开引导
                   dd.reLaunch({
                     url: '../../start/start'
@@ -276,17 +277,45 @@ App({
           })
         },
         fail: function (err) {
-          that.globalData.showToast("错误"+JSON.stringify(err))
+          that.globalData.showToast("错误" + JSON.stringify(err))
         }
       });
     }
   },
-
+  getUserList() {
+    this.$get("api/employee/list", { dept_id: 0 }).then((res) => {
+      that.globalData.usersList = res.data.data.list;
+    })
+  },
   getTypesItem(id) {
     return getTypeItem(this.globalData.types, id);
   },
+  updateApp(){
+    const updateManager = dd.getUpdateManager()
+    updateManager.onCheckForUpdate(function (res) {
+      // 请求完新版本信息的回调
+      console.log(res.hasUpdate) // 是否有更新
+    })
+    updateManager.onUpdateReady(function (ret) {
+      console.log(ret.version) // 更新版本号
+      dd.confirm({
+        title: '更新提示',
+        content: '新版本已经准备好,是否重启应用?',
+        success: function (res) {
+          if (res.confirm) {
+            // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+            updateManager.applyUpdate()
+          }
+        }
+      })
+    })
+    updateManager.onUpdateFailed(function () {
+      // 新版本下载失败
+    })
+  },
   onLaunch(options) {
     that = this;
+    // that.updateApp();
     that.getTypes(function () { });
     that.getCorp(options.query.corpId);
     that.globalData.corpId = options.query.corpId;

+ 2 - 1
app.json

@@ -56,7 +56,8 @@
     "pages/statistics/offerAreward_set/offerAreward_set",
     "pages/statistics/logDetail/logDetail",
     "pages/demo/demo",
-    "pages/statistics/my_sp/my_sp"
+    "pages/statistics/my_sp/my_sp",
+    "pages/statistics/allTask/allTask"
   ],
   "window": {
     "defaultTitle": "功道云",

BIN
image/logo.png


+ 93 - 0
pages/statistics/allTask/allTask.acss

@@ -0,0 +1,93 @@
+.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 text {
+  position: relative;
+  top: 10rpx;
+  font-size: 28rpx;
+}
+
+.scroll {
+  height: calc(100vh - 220rpx);
+}
+
+.sxImg {
+  width: 30rpx;
+  height: 30rpx;
+}
+
+.defBtn {
+  border-radius: 6rpx;
+  height: 50rpx;
+  text-align: center;
+  line-height: 50rpx;
+  width: 120rpx;
+  font-size: .24rem;
+}
+
+.li-top {
+  margin-bottom: 14rpx;
+}
+.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;
+}

+ 52 - 0
pages/statistics/allTask/allTask.axml

@@ -0,0 +1,52 @@
+<view>
+  <view class="header margin-bottom" style="padding-bottom:16rpx;">
+    <view class="flex-box flex-v-ce tab border-bottom">
+      <view class="flex-2">
+        <picker onChange="activeItem" value="{{minuteIndex}}" range="{{minuteArray}}" range-key="name">
+          <text>{{minuteArray[minuteIndex].name}}</text>
+        </picker>
+      </view>
+      <view class="flex-2" catchTap="selectStaff">
+        <text class="{{showStaff? 'activeView blue':''}}">{{staffVal}}</text>
+      </view>
+     <view catchTap="selectSx" class="flex-1 sxBorder" style="position: relative">
+        <image mode="scaleToFill" class="sxImg" src="../../../image/sx.png"/>
+      </view>
+    </view>
+    <form onReset="onReset">
+      <view style="margin-top:16rpx;">
+        <view class="search flex-box flex-v-ce">
+          <image mode="scaleToFill" src="../../../image/ss.png"/>
+          <input class="flex-1" placeholder="请输入任务内容" onInput="bindKeyInput" class="flex-1"/>
+          <button a:if="{{isVal}}" class="delVal" formType="reset">×</button>
+        </view>
+      </view>
+    </form>
+  </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}}">
+        <view class="flex-box li-top">
+          <img-box name="{{item.employee_name}}" a:key="{{index}}" id="{{item.employee_id}}" 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.employee_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 li-bottom">
+              <text class="flex-1 fontColorX">{{item.expire_time}} 截止</text>
+              <button type="primary" class="defBtn" catchTap="openDetail" data-item="{{item}}">查看任务</button>
+              <button a:if="{{minuteIndex==1||minuteIndex==2}}" type="primary" class="defBtn" catchTap="openDetail2" data-item="{{item}}" style="margin-left:20rpx;">查看审批</button>
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
+    </scroll-view>
+    <no-data a:if="{{list.length==0}}"></no-data>
+  </view>
+  <select-staff defaultUser="{{employee_ids}}" isAllSelect="{{false}}" isShow="{{showStaff}}" a:if="{{showStaff==true}}" onClose="onClose" onConfirm="onConfirmStaff"></select-staff>
+  <select-zp defaultSx="{{sxObj}}" typeIndex="2" a:if="{{showZp==true}}" isShow="{{showZp}}" onClose="onClose" onConfirm="onConfirmSx"></select-zp>
+</view>

+ 223 - 0
pages/statistics/allTask/allTask.js

@@ -0,0 +1,223 @@
+
+var app = getApp()
+var that;
+Page({
+  data: {
+    date: app.globalData.month,
+    page: 1,
+    toList: [], // 放今天待完成
+    list: [],
+    showZp: false,//显示sx选择
+    parameter: { //我指派的参数
+      pt_id: 0,//类型
+      status: 'running',//状态
+      sort: 'publish',//排序
+    },
+
+    minuteIndex: 0,//条件选择
+    minuteArray: [
+      { id: 0, name: '待完成' },
+      { id: 1, name: '待审批' },
+      { id: 2, name: '已审批' },
+    ],
+
+
+    showStaff: false,//显示员工选择
+    staffVal: '负责人',
+
+    popupCx: '',  
+  },
+  onLoad(e) {
+    that = this;
+    dd.setNavigationBar({ title: "全部任务" });
+  },
+  onShow() {
+    if (app.globalData.userData) {
+      if (this.data.page == 1) {
+        dd.hideLoading();
+        that.getData();
+      }
+    } else {
+      app.login(app.globalData.corpId, function (is) {
+        if (is) {
+          if (that.data.page == 1) {
+            dd.hideLoading();
+            that.getData();
+          }
+        } else {
+          dd.reLaunch({
+            url: '../noJurisdiction/noJurisdiction'
+          })
+        }
+      },function(){})
+    }
+  },
+  openDetail2(e){
+    var id = e.target.dataset.item.review_id;
+    dd.navigateTo({
+      url: '../../workbench/approveDetail/approveDetail?id=' + id
+    })
+  },
+  onReset() {
+    this.setData({
+      page: 1,
+      isVal: false,
+      searchName:''
+    })
+    this.getData();
+  },
+  bindKeyInput(e) {
+      this.setData({
+        page: 1,
+        isVal: e.detail.value ? true : false,
+        searchName: e.detail.value? e.detail.value:'',
+      })
+      this.getData();
+  },
+  //显示选择员工
+  selectStaff() {
+    this.setData({
+      popupCx: 'container__mask',
+      showStaff: true
+    })
+  },
+  selectSx() {
+    this.setData({ showZp: true })
+  },
+    //选择员工
+  onConfirmStaff(data) {
+    if (!data) {
+      this.setData({ staffVal: '负责人', employee_ids: '', page: 1 })
+      this.getData();
+      return false;
+    }
+    if (data.length > 0) {
+      if (data.length > 1) {
+        var str = "";
+        var arr = [];
+        data.forEach((item) => {
+          str += item.name + ','
+          arr.push(item.id);
+        })
+        var employee_ids = arr.join(',');
+        this.setData({ staffVal: str.substring(0, str.length - 1), employee_ids: employee_ids, page: 1 })
+      } else {
+        this.setData({ staffVal: data[0].name, employee_ids: [data[0].id], page: 1 })
+      }
+    } else {
+      this.setData({ staffVal: '负责人', employee_ids: [], page: 1 })
+    }
+    this.getData();
+  },
+  //关闭弹窗
+  onClose() {
+    this.setData({
+      showZp: false,
+      showStaff: false,
+      popupCx: ''
+    })
+  },
+  //选择筛选
+  onConfirmSx(data) {
+    this.setData({
+      sxObj: data,
+      page: 1,
+      parameter: { //我指派的参数
+        pt_id: data[0],//类型
+        status: this.data.parameter.status,
+        sort: data[2]
+      }
+    })
+    this.getData();
+  },
+  getData(is) {
+    var parameter = this.data.parameter;
+    let sort_by="";
+    if(parameter.sort=='publish'){
+      sort_by='create_time'
+    }else if(parameter.sort=='expire'){
+      sort_by='expire_time'
+    }
+    var data = {
+      page: that.data.page,
+      page_size: 20,
+      content:this.data.searchName,
+      pt_id: parameter.pt_id,//类型
+      status: parameter.status,//工作状态 all-全部 running-进行中 complete-工作已完成 refuse-拒绝 reviewed-已审批 revocation-发布者撤回
+      // sort: parameter.sort,//排序种类 expire-过期时间倒序 publish-指派时间倒序
+      employee_id:this.data.employee_ids,
+      sort_by: sort_by,// ‘create_time’创建时间,’expire_time’过期时间,’base_point’,积分大小
+      order: 'desc'//‘desc’ 倒序,’asc’ 正序
+    }
+    app.$get('api/integral/work/list/manage', data).then((res) => {
+      var data = res.data.data.list;
+      data.forEach(item => {
+        item.isCs = item.expire_time < app.globalData.allDate;
+      })
+      if(that.data.page==1){
+        this.setData({
+            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 = Number(e.detail.value)+1;
+    var status = "";
+    if (index == 1) {
+      status = "running"
+    } else if (index == 2) {
+      status = "complete"
+    } else {
+      status = "reviewed"
+    }
+    this.setData({
+      minuteIndex: e.detail.value,
+      page: 1,
+      list: [],
+      sxObj: [],
+      parameter: {
+        pt_id: 0,//类型
+        status: status,//状态
+        sort: 'publish',//排序
+      }
+    })
+    this.getData();
+  },
+  openDetail(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);
+    }
+  },
+});

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

@@ -0,0 +1,8 @@
+{
+  "usingComponents": {
+    "select-staff": "/Component/selectStaff/selectStaff",
+    "img-box": "/Component/img-box/index",
+    "select-zp": "/Component/selectSxZp/selectSxZp",
+    "no-data":"/Component/noData/noData"
+  }
+}

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

@@ -48,7 +48,6 @@ Page({
     dd.setNavigationBar({ title: "任务编辑" });
     if (e.item) {
       var item = JSON.parse(e.item);
-      console.log(item)
       this.setData({
         reviewerObj:[{name:item.reviewer_name,id:item.reviewer_id}],
         users:[{name:item.employee_name,id:item.employee_id}],

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

@@ -67,7 +67,7 @@
 
 .li-top text {
   font-size: 36rpx;
-  font-weight: 600
+  /* font-weight: 600 */
 }
 
 .task {

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

@@ -10,7 +10,7 @@
       <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="fontColorX">{{item.base_point}}</text>
+          <text class="fontColorX">{{item.base_point}} {{item.pt_name}}</text>
         </view>
         <view class="flex-box li-bottom">
           <text class="flex-1 fontColorX">{{item.end_time}} 截止</text>
@@ -21,7 +21,7 @@
     </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.employee_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+        <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>

+ 3 - 0
pages/statistics/getTask/getTask.js

@@ -29,6 +29,9 @@ Page({
             dd.hideLoading();
             that.getData();
           }
+          that.setData({
+            userId: app.globalData.userData.id
+          })
         } else {
           dd.reLaunch({
             url: '../noJurisdiction/noJurisdiction'

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

@@ -23,7 +23,9 @@ Page({
           { 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_task.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/apply_list.png', url: '../allTask/allTask', code: 'creator admin' },
         ]
       },
       {

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

@@ -21,7 +21,6 @@
           <view class="flex-box">
             <view class="name flex-1" style="margin-right: 10rpx;">{{item.remark.customize || item.remark.rule}}</view>
             <view class="red" a:if="{{item.review_point > 0}}">+{{item.review_point}} {{item.pt_name}}</view>
-            <view class="green" a:else>{{item.review_point}} {{item.pt_name}}</view>
           </view>
           <view class="flex-box flex-v-ce">
             <view class="date flex-1">{{item.event_time}}</view>

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

@@ -13,7 +13,7 @@
   <view class="main scroll">
     <scroll-view class="scroll" a:if="{{(activeIndex==1||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.employee_name}}" a:if="{{activeIndex==1}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+        <img-box name="{{item.employee_name}}" 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}}">
           <img-box name="{{item.owner_name}}" a:if="{{item.receiver_id==0}}" imgUrl="{{item.owner_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
           <img-box name="{{item.receiver_name}}" a:else imgUrl="{{item.receiver_img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>

+ 13 - 5
pages/statistics/my_sp/my_sp.acss

@@ -72,14 +72,22 @@
 .li-top {
   margin-bottom: 14rpx;
 }
-
-.li-top .flex-1 {
-  padding-right: 50rpx;
-}
-
 .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;
 }

+ 43 - 46
pages/statistics/my_sp/my_sp.axml

@@ -1,67 +1,64 @@
 <view>
   <view class="header margin-bottom">
-    <!--<form onReset="onReset"><view class="search flex-box flex-v-ce"><image mode="scaleToFill" src="../../../image/ss.png"></image><input placeholder="请输入姓名或事件内容搜索" onInput="bindKeyInput" class="flex-1"></input><button a:if="{{isVal}}" class="delVal" formType="reset">×</button></view></form> -->
-    <view class="flex-box flex-v-ce selectItems border-bottom">
-      <view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-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">
+    <view class="flex-box flex-v-ce tab border-bottom">
+      <view class="flex-2">
+        <picker onChange="activeItem" value="{{minuteIndex}}" range="{{minuteArray}}" range-key="name">
+          <text>{{minuteArray[minuteIndex].name}}</text>
+        </picker>
+      </view>
+      <view class="flex-2" catchTap="selectStaff">
+        <text class="{{showStaff? 'activeView blue':''}}">{{staffVal}}</text>
+      </view>
+      <view catchTap="selectSx" class="flex-1 sxBorder" style="position: relative">
         <image mode="scaleToFill" class="sxImg" src="../../../image/sx.png"/>
       </view>
     </view>
   </view>
   <view class="main scroll">
-    <scroll-view class="scroll" a:if="{{(activeIndex==1)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
-      <view class="task" a:if="{{toList.length>0}}">今日任务</view>
-      <view class="li border-bottom" a:for="{{toList}}" a:if="{{toList.length>0}}">
-        <view class="flex-box li-top" catchTap="openDetail" data-item="{{item}}">
-          <view class="flex-1">{{item.task_name}}</view>
-          <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="flex-box li-bottom">
-          <text class="flex-1 fontColorX" catchTap="openDetail" data-item="{{item}}">{{item.expire_time}} 截止</text>
-          <button type="primary" class="defBtn" a:if="{{item.status == 1}}" data-is="{{true}}" data-item="{{item}}" onTap="openPerform">完成任务</button>
-          <text class="yellowBox" a:if="{{item.status == 2}}">待审批</text>
-          <text class="redBox" a:if="{{item.review_status == 2}}">审批驳回</text>
-          <text class="greenBox" a:if="{{item.review_status == 1}}">审批通过</text>
-        </view>
-      </view>
-      <view class="task">待完成任务</view>
+    <scroll-view class="scroll" a:if="{{(minuteIndex==0)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
       <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>
-          <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="flex-box li-bottom">
-          <text class="flex-1 fontColorX {{item.isCs? 'red':''}}" catchTap="openDetail" data-item="{{item}}">{{item.expire_time}} 截止</text>
-          <button type="primary" class="defBtn" a:if="{{item.status == 1}}" data-item="{{item}}" onTap="openPerform">完成任务</button>
-          <text class="yellowBox" a:if="{{item.status == 2}}">待审批</text>
-          <text class="redBox" a:if="{{item.status == 3}}">审批驳回</text>
-          <text class="greenBox" a:if="{{item.status == 4}}">审批通过</text>
+        <view class="flex-box li-top">
+          <img-box name="{{item.employee_name}}" a:key="{{index}}" id="{{item.employee_id}}" 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.employee_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 li-bottom">
+              <text class="flex-1 fontColorX {{item.isCs? 'red':''}}">{{item.expire_time}} 截止</text>
+              <button type="primary" class="defBtn" catchTap="openDetail" data-item="{{item}}">查看任务</button>
+            </view>
+          </view>
         </view>
       </view>
       <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
     </scroll-view>
-    <scroll-view class="scroll" a:if="{{(activeIndex==2||activeIndex==3)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
+    <scroll-view class="scroll" a:if="{{(minuteIndex==1||minuteIndex==2)&&list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
       <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>
-          <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="flex-box li-bottom">
-          <text class="flex-1 fontColorX" catchTap="openDetail" data-item="{{item}}">{{item.expire_time}} 截止</text>
-          <button type="primary" class="defBtn" a:if="{{item.status == 1}}" data-item="{{item}}" onTap="openPerform">完成任务</button>
-          <text class="yellow" a:if="{{item.review_status == 0}}">待处理</text>
-          <text class="green" a:if="{{item.review_status == 1}}">已通过</text>
-          <text class="red" a:if="{{item.review_status == 2}}">已驳回</text>
+        <view class="flex-box li-top">
+          <img-box name="{{item.employee_name}}" a:key="{{index}}" id="{{item.employee_id}}" 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.employee_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 li-bottom">
+              <text class="flex-1 fontColorX">{{item.expire_time}} 截止</text>
+              <button type="primary" class="defBtn" catchTap="openDetail" data-item="{{item}}">查看任务</button>
+              <button a:if="{{minuteIndex==1}}" type="primary" class="defBtn" catchTap="openDetail2" data-item="{{item}}" style="margin-left:20rpx;">去审批</button>
+              <button a:if="{{minuteIndex==2}}" type="primary" class="defBtn" catchTap="openDetail2" data-item="{{item}}" style="margin-left:20rpx;">查看审批</button>
+            </view>
+          </view>
         </view>
       </view>
       <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
     </scroll-view>
     <no-data a:if="{{list.length==0}}"></no-data>
   </view>
+  <select-staff defaultUser="{{employee_ids}}" isAllSelect="{{false}}" isShow="{{showStaff}}" a:if="{{showStaff==true}}" onClose="onClose" onConfirm="onConfirmStaff"></select-staff>
   <select-zp defaultSx="{{sxObj}}" typeIndex="2" a:if="{{showZp==true}}" isShow="{{showZp}}" onClose="onClose" onConfirm="onConfirmSx"></select-zp>
 </view>

+ 63 - 23
pages/statistics/my_sp/my_sp.js

@@ -4,7 +4,6 @@ var that;
 Page({
   data: {
     date: app.globalData.month,
-    activeIndex: 1,
     page: 1,
     toList: [], // 放今天待完成
     list: [],
@@ -14,27 +13,31 @@ Page({
       status: 'running',//状态
       sort: 'publish',//排序
     },
+    
+    showStaff: false,//显示员工选择
+    staffVal: '负责人',
+    minuteIndex: 0,//条件选择
+    minuteArray: [
+      { id: 0, name: '待完成' },
+      { id: 1, name: '待审批' },
+      { id: 2, name: '已审批' },
+    ],
+
+    popupCx: '',  
   },
   onLoad(e) {
     that = this;
-    if (e.index) {
-      this.setData({
-        activeIndex: e.index,
-      })
-    }
-    dd.setNavigationBar({ title: "我的任务" });
+    dd.setNavigationBar({ title: "我审批的" });
   },
   onShow() {
     if (app.globalData.userData) {
       if (this.data.page == 1) {
         dd.hideLoading();
-        that.getToDay();
         that.getData();
       }
     } else {
       app.login(app.globalData.corpId, function (is) {
         if (is) {
-          that.getToDay();
           if (that.data.page == 1) {
             dd.hideLoading();
             that.getData();
@@ -48,13 +51,46 @@ Page({
     }
   },
   //显示选择员工
+  selectStaff() {
+    this.setData({
+      popupCx: 'container__mask',
+      showStaff: true
+    })
+  },
   selectSx() {
     this.setData({ showZp: true })
+  },
+    //选择员工
+  onConfirmStaff(data) {
+    if (!data) {
+      this.setData({ staffVal: '负责人', employee_ids: '', page: 1 })
+      this.getData();
+      return false;
+    }
+    if (data.length > 0) {
+      if (data.length > 1) {
+        var str = "";
+        var arr = [];
+        data.forEach((item) => {
+          str += item.name + ','
+          arr.push(item.id);
+        })
+        var employee_ids = arr.join(',');
+        this.setData({ staffVal: str.substring(0, str.length - 1), employee_ids: employee_ids, page: 1 })
+      } else {
+        this.setData({ staffVal: data[0].name, employee_ids: [data[0].id], page: 1 })
+      }
+    } else {
+      this.setData({ staffVal: '负责人', employee_ids: [], page: 1 })
+    }
+    this.getData();
   },
   //关闭弹窗
   onClose() {
     this.setData({
       showZp: false,
+      showStaff: false,
+      popupCx: ''
     })
   },
   //选择筛选
@@ -70,15 +106,6 @@ Page({
     })
     this.getData();
   },
-  //今天完成的任务
-  getToDay() {
-    app.$get('api/integral/work/list', { status: 'running', today: '1', page: '1', page_size: '50', sort: 'publish', source_type: 0, pt_id: 0 }).then((res) => {
-      this.setData({
-        toList: res.data.data.list
-      })
-    })
-  },
-
   getData(is) {
     var parameter = this.data.parameter;
     var data = {
@@ -88,12 +115,18 @@ Page({
       pt_id: parameter.pt_id,//类型
       status: parameter.status,//工作状态 all-全部 running-进行中 complete-工作已完成 refuse-拒绝 reviewed-已审批 revocation-发布者撤回
       sort: parameter.sort,//排序种类 expire-过期时间倒序 publish-指派时间倒序
+      employee_id:this.data.employee_ids,
     }
-    app.$get('api/integral/work/list', data).then((res) => {
+    app.$get('api/integral/work/list/reviewer', data).then((res) => {
       var data = res.data.data.list;
       data.forEach(item => {
         item.isCs = item.expire_time < app.globalData.allDate;
       })
+      if(that.data.page==1){
+        this.setData({
+            list: []
+        })
+      }
       var list = that.data.list;
       data.forEach(element => {
         if (element.pt_id) {
@@ -119,8 +152,15 @@ Page({
       }
     })
   },
+  openDetail2(e){
+    var id = e.target.dataset.item.review_id;
+    dd.navigateTo({
+      url: '../../workbench/approveDetail/approveDetail?id=' + id
+    })
+  },
   activeItem(e) {
-    var index = e.target.dataset.index;
+    var index = Number(e.detail.value)+1;
+    console.log(index)
     var status = "";
     if (index == 1) {
       status = "running"
@@ -130,7 +170,7 @@ Page({
       status = "reviewed"
     }
     this.setData({
-      activeIndex: index,
+      minuteIndex: e.detail.value,
       page: 1,
       list: [],
       sxObj: [],
@@ -152,11 +192,11 @@ Page({
   //过滤List,通常用于删除了某条数据,刷新列表
   filtrationList(index, id) {
     if (index == 1) {
-      this.getToDay()
+
     } else if (index == 2 && this.data.page != 1) {
       var list = this.data.list;
       for (let i in list) {
-        if (list[i].id == id) {
+        if (list[i].review_id == id) {
           list.splice(i, 1)
         }
       }

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

@@ -1,5 +1,6 @@
 {
   "usingComponents": {
+    "select-staff": "/Component/selectStaff/selectStaff",
     "img-box": "/Component/img-box/index",
     "select-zp": "/Component/selectSxZp/selectSxZp",
     "no-data":"/Component/noData/noData"

+ 34 - 23
pages/statistics/workDetail/workDetail.js

@@ -10,7 +10,7 @@ Page({
     process: [],
     array: ['编辑任务', '删除任务'],
     isPublisher: true,//是不是发布者
-    corpId:'',
+    corpId: '',
   },
   onLoad(e) {
     that = this;
@@ -21,27 +21,30 @@ Page({
         userId: app.globalData.userData.id
       })
     }
-    if(e.corpId){
-       that.setData({ corpId:e.corpId });
-       app.globalData.corpId=e.corpId
+    if (e.corpId) {
+      that.setData({ corpId: e.corpId });
+      app.globalData.corpId = e.corpId
     }
   },
   onShow() {
     if (app.globalData.userData) {
-        dd.hideLoading();
-        that.getDetail(that.data.id);
+      dd.hideLoading();
+      that.getDetail(that.data.id);
     } else {
-      let corpId=that.data.corpId?that.data.corpId:app.globalData.corpId
+      let corpId = that.data.corpId ? that.data.corpId : app.globalData.corpId
       app.login(corpId, function (is) {
         if (is) {
-            dd.hideLoading();
-            that.getDetail(that.data.id);
+          dd.hideLoading();
+          that.setData({
+            userId: app.globalData.userData.id
+          })
+          that.getDetail(that.data.id);
         } else {
           dd.reLaunch({
             url: '../noJurisdiction/noJurisdiction'
           })
         }
-      },function(){})
+      }, function () { })
     }
   },
   // 判断当前账号与发布工作者是否同一人;
@@ -61,7 +64,7 @@ Page({
     this.setData({ array: actions })
   },
   bindPickerChange(e) {
-     var page = getCurrentPages()[getCurrentPages().length - 2]//上一个页面的数据
+    var page = getCurrentPages()[getCurrentPages().length - 2]//上一个页面的数据
     if (this.data.array[e.detail.value] == '删除任务') {
       dd.confirm({
         title: '删除任务',
@@ -70,12 +73,20 @@ Page({
         cancelButtonText: '取消',
         success: (result) => {
           if (result.confirm) {
-            app.$get("api/integral/work/delete", { work_id:this.data.id}).then((res) => {
+            app.$get("api/integral/work/delete", { work_id: this.data.id }).then((res) => {
               app.globalData.showToast(res.data.msg);
-              page.filtrationList(2, this.data.id);
-              setTimeout(() => {
-                dd.navigateBack({ delta: 1 })
-              }, 1000);
+              if (page) {
+                page.filtrationList(2, this.data.id);
+                setTimeout(() => {
+                  dd.navigateBack({ delta: 1 })
+                }, 1000);
+              } else {
+                setTimeout(() => {
+                  dd.reLaunch({
+                    url: '/pages/workbench/index/index'
+                  })
+                }, 1000);
+              }
             })
           }
         },
@@ -123,12 +134,12 @@ Page({
             process: this.data.process
           }
           data.process.splice(index, 1)
-          if(data.process.length==0){
-            data.process="[1]"
-          }else{
+          if (data.process.length == 0) {
+            data.process = "[1]"
+          } else {
             data.process = JSON.stringify(data.process);
           }
-          app.$post("api/integral/work",data).then((res) => {
+          app.$post("api/integral/work", data).then((res) => {
             app.globalData.showToast(res.data.msg);
             this.getDetail(this.data.id);
           })
@@ -138,7 +149,7 @@ Page({
   },
   getDetail(id, fun = function () { }) {
     this.setData({
-        total:0
+      total: 0
     })
     app.$get("api/integral/work", { work_id: id }).then((res) => {
       fun();
@@ -162,7 +173,7 @@ Page({
       })
     })
   },
-  openWc(){
+  openWc() {
     dd.navigateTo({
       url: '../../workbench/approve/approve?id=' + this.data.dataDetail.review_id
     })
@@ -170,7 +181,7 @@ Page({
   // 完成任务
   openPerform() {
     dd.navigateTo({
-      url: '../openPerform/openPerform?id=' + this.data.dataDetail.id + '&is=detail' 
+      url: '../openPerform/openPerform?id=' + this.data.dataDetail.id + '&is=detail'
     })
   },
   openSchedule() {

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

@@ -70,6 +70,7 @@ textarea{
   height: 90rpx;
   text-align: center;
   line-height: 90rpx;
+  margin-top: 40rpx
 }
 .showImg{
   width: 160rpx;

+ 49 - 40
pages/workbench/approve/approve.js

@@ -17,24 +17,24 @@ Page({
       reviewer_id: '',//递交者
       remark: '',//备注
       ticket_count: false,//奖票数量
-      disabled:false,
-      defaultRuleId:'',
-      reviewerObj:[],
+      disabled: false,
+      defaultRuleId: '',
+      reviewerObj: [],
     },
     users: {
-      id:'',
-      name:'',
+      id: '',
+      name: '',
     },
     animationInfo: '',
     isShowType: "0",//是显示选择规则还是显示选择分类
     isData: false,
-    isGzType:'',
+    isGzType: '',
     popupCx: ''
   },
   onLoad(e) {
     that = this;
-    if(e.id){
-    that.getData(e.id);
+    if (e.id) {
+      that.getData(e.id);
     }
     dd.setNavigationBar({ title: "审批" });
   },
@@ -60,8 +60,8 @@ Page({
   },
   onSelectUser(item) {
     this.setData({
-      users: item[0]? item[0]:{id:'',name:''},
-      reviewerObj:item
+      users: item[0] ? item[0] : { id: '', name: '' },
+      reviewerObj: item
     })
   },
 
@@ -93,16 +93,16 @@ Page({
         this.showToast("积分不能为0或空")
         return;
       }
-      if(item.selectRule.range_type==1&&item.selectRule.min_point==item.selectRule.max_point){
-          if (point < item.selectRule.min_point || point > item.selectRule.max_point) {
-            this.showToast(`系统发现此条积分规则制度有变动,请驳回后让员工按最新的规则重新申请`);
-            return;
-          }
-      }else{
-          if (point < item.selectRule.min_point || point > item.selectRule.max_point) {
-            this.showToast(`积分超出可输入范围`);
-            return;
-          }
+      if (item.selectRule.range_type == 1 && item.selectRule.min_point == item.selectRule.max_point) {
+        if (point < item.selectRule.min_point || point > item.selectRule.max_point) {
+          this.showToast(`系统发现此条积分规则制度有变动,请驳回后让员工按最新的规则重新申请`);
+          return;
+        }
+      } else {
+        if (point < item.selectRule.min_point || point > item.selectRule.max_point) {
+          this.showToast(`积分超出可输入范围`);
+          return;
+        }
       }
 
 
@@ -132,25 +132,34 @@ Page({
       remark: item.remark,
       ticket_count: item.ticket_count ? 1 : 0,
     }
-    this.setData({disabled:true});
+    this.setData({ disabled: true });
     app.$post("api/integral/review", data).then((res) => {
-      if(res.data.code==1){
+      if (res.data.code == 1) {
         this.showToast("已通过");
-        var pages=getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
-        var active=pages[pages.length-3];
-        if(active.data.page!=1){
+        var pages = getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
+        var active = pages[pages.length - 3];
+        if (active) {
+          if (active.data.page != 1) {
             active.refreshData(item.review_id);
+            active.filtrationList(2, item.review_id);
+          }
+          setTimeout(() => {
+            this.setData({ disabled: false });
+            dd.navigateBack({ delta: 2 })
+          }, 1000);
+        } else {
+            setTimeout(() => {
+              dd.reLaunch({
+                url: '/pages/workbench/index/index'
+              })
+            }, 1000);
         }
-        setTimeout(() => {
-          this.setData({disabled:false});
-          dd.navigateBack({delta: 2})
-        }, 1000);
-      }else{
-        this.setData({disabled:false});
-         this.showToast(res.data.msg);
+      } else {
+        this.setData({ disabled: false });
+        this.showToast(res.data.msg);
       }
-    }).catch(err=>{
-        this.setData({disabled:false});
+    }).catch(err => {
+      this.setData({ disabled: false });
     })
   },
   bindKeyInput(e) {
@@ -209,10 +218,10 @@ Page({
   },
   //显示规则
   openSelect(e) {
-    if(e.target.dataset.ruleId){
-       that.setData({ defaultRuleId:e.target.dataset.ruleId});
+    if (e.target.dataset.ruleId) {
+      that.setData({ defaultRuleId: e.target.dataset.ruleId });
     }
-    that.setData({ activeIndex: '',isShowType:'' });
+    that.setData({ activeIndex: '', isShowType: '' });
     animation.translateY(0).step();
     that.setData({
       isShowType: e.target.dataset.num,
@@ -245,7 +254,7 @@ Page({
           min_point: data.item_min_point,
           max_point: data.item_max_point,
           remark: data.item_name,
-          pt_Obj:app.getTypesItem(data.pt_id),
+          pt_Obj: app.getTypesItem(data.pt_id),
         }
       } else if (data.rule_id && data.point) {
         console.log(2);
@@ -261,9 +270,9 @@ Page({
         selectRule = '';
       }
       that.setData({
-        isGzType:data.pt_code,
+        isGzType: data.pt_code,
         isData: isData,
-        ['item.pid']: data.pid==0 ? false:true,
+        ['item.pid']: data.pid == 0 ? false : true,
         ['item.review_id']: data.id,
         ['item.checked']: checked,
         ['item.selectRule']: selectRule,

+ 8 - 11
pages/workbench/approveDetail/approveDetail.axml

@@ -67,16 +67,16 @@
     </block>
   </view>
   <view class="main">
-        <!-- 调用过程组件 -->
+    <!-- 调用过程组件 -->
     <process process="{{dataDetail.process}}" a:if="{{dataDetail.process.length>0}}"/>
   </view>
-    <!-- 积分任务 -->
+  <!-- 积分任务 -->
   <view class="bottom flex-box flex-flex-center-center" a:if="{{!is&&dataDetail.review_status!=1&&dataDetail.source_type==1}}">
-    <block a:if="{{dataDetail.status==0}}">
+    <block a:if="{{dataDetail.status==0&&dataDetail.reviewer_id==userData.id}}">
       <view class="flex-1 defBtn" catchTap="openBh">驳回</view>
       <view class="flex-3 blueBtn" catchTap="submit">通过</view>
     </block>
-    <block a:if="{{(dataDetail.status==1||dataDetail.status==2)&&dataDetail.review_status==0}}">
+    <block a:if="{{dataDetail.can_refuse == '1'}}">
       <text class="flex-2 fontColorF">撤回后需重新审批</text>
       <view></view>
       <view class="flex-1 blueBtn" catchTap="openCx">撤回</view>
@@ -88,13 +88,13 @@
       <view class="flex-1 defBtn" catchTap="openBh">驳回</view>
       <view class="flex-3 blueBtn" catchTap="submit">通过</view>
     </block>
-    <block a:if="{{(dataDetail.status==1||dataDetail.status==2)&&dataDetail.review_status==0}}">
+    <block a:if="{{dataDetail.can_refuse == '1'}}">
       <text class="flex-2 fontColorF">撤回后需重新审批</text>
       <view></view>
       <view class="flex-1 blueBtn" catchTap="openCx">撤回</view>
     </block>
   </view>
-  <view class="bottom flex-box flex-flex-center-center" a:if="{{dataDetail.applyor_id==userData.id&&dataDetail.status==0&&dataDetail.source_type==2}}">
+  <view class="bottom flex-box flex-flex-center-center" a:if="{{dataDetail.applyor_id==userData.id&&dataDetail.can_refuse == '1'&&dataDetail.source_type==2}}">
     <text class="flex-2 fontColorF">撤销申请后数据将不可恢复</text>
     <view></view>
     <view class="flex-1 blueBtn" catchTap="openCx">撤销申请</view>
@@ -105,20 +105,17 @@
       <view class="flex-1 defBtn" catchTap="openBh">驳回</view>
       <view class="flex-3 blueBtn" catchTap="submit">通过</view>
     </block>
-    <block a:if="{{(dataDetail.status==1||dataDetail.status==2)&&dataDetail.review_status==0}}">
+    <block a:if="{{dataDetail.can_refuse == '1'}}">
       <text class="flex-2 fontColorF">撤回后需重新审批</text>
       <view></view>
       <view class="flex-1 blueBtn" catchTap="openCx">撤回</view>
     </block>
   </view>
-
-  <view class="bottom flex-box flex-flex-center-center" a:if="{{dataDetail.applyor_id==userData.id&&dataDetail.status==0&&dataDetail.source_type==3}}">
+  <view class="bottom flex-box flex-flex-center-center" a:if="{{dataDetail.applyor_id==userData.id&&dataDetail.can_refuse == '1'&&dataDetail.source_type==3}}">
     <text class="flex-2 fontColorF">撤销奖扣后数据将不可恢复</text>
     <view></view>
     <view class="flex-1 blueBtn" catchTap="openCx">撤销奖扣</view>
   </view>
-
-  
   <!-- 弹出框 -->
   <view class="windows" a:if="{{isBh}}">
     <view class="windows-box">

+ 44 - 28
pages/workbench/approveDetail/approveDetail.js

@@ -7,37 +7,39 @@ Page({
     isBh: false,//是否显示驳回弹窗
     textArea: "",
     disabled: false,
-    corpId:'',
+    corpId: '',
   },
   onLoad(e) {
     that = this;
     dd.setNavigationBar({ title: "详情" });
     if (e.id) {
-      that.setData({ review_id: parseInt(e.id),userData:app.globalData.userData });
+      that.setData({ review_id: parseInt(e.id), userData: app.globalData.userData });
     }
     if (e.is) {
       that.setData({ is: e.is });
     }
-    if(e.corpId){
-       that.setData({ corpId:e.corpId });
-       app.globalData.corpId=e.corpId
+    if (e.corpId) {
+      that.setData({ corpId: e.corpId });
+      app.globalData.corpId = e.corpId
     }
   },
   onShow() {
     if (app.globalData.userData) {
-        dd.hideLoading();
-        that.getData();
+      dd.hideLoading();
+      that.getData();
     } else {
-      app.login(that.data.corpId, function (is) {
+      let corpId = that.data.corpId ? that.data.corpId : app.globalData.corpId
+      app.login(corpId, function (is) {
         if (is) {
-            dd.hideLoading();
-            that.getData();
+          dd.hideLoading();
+          that.setData({userData: app.globalData.userData });
+          that.getData();
         } else {
           dd.reLaunch({
             url: '../noJurisdiction/noJurisdiction'
           })
         }
-      },function(){})
+      }, function () { })
     }
   },
   showImg(e) {
@@ -66,18 +68,26 @@ Page({
       app.globalData.showToast("请输入审批意见");
       return;
     }
-     this.setData({disabled:true});
+    this.setData({ disabled: true });
     app.$post("api/integral/review", { review_id: that.data.review_id, remark: that.data.textArea, action: "refuse", ticket_count: 0 }).then((res) => {
       app.globalData.showToast("已驳回");
-      that.setData({disabled:false});
-      var pages=getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
-      var active=pages[pages.length-2];
-      if(active.data.page!=1){
+      that.setData({ disabled: false });
+      var pages = getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
+      var active = pages[pages.length - 2];
+      if (active) {
+        if (active.data.page != 1) {
           active.refreshData(that.data.review_id);
+        }
+        setTimeout(() => {
+          dd.navigateBack({ delta: 1 });
+        }, 1000);
+      } else {
+        setTimeout(() => {
+          dd.reLaunch({
+            url: '/pages/workbench/index/index'
+          })
+        }, 1000);
       }
-      setTimeout(() => {
-        dd.navigateBack({ delta: 1 });
-      }, 1000);
     })
   },
   openCx() {
@@ -90,23 +100,29 @@ Page({
         if (result.confirm) {
           app.$post("api/integral/review/destroy", { review_id: that.data.review_id }).then((res) => {
             app.globalData.showToast("已撤掉");
-            var pages=getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
-            var active=pages[pages.length-2];
-            if(active.data.page!=1){
+            var pages = getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
+            var active = pages[pages.length - 2];
+            if (active) {
+              if (active.data.page != 1) {
                 active.refreshData(that.data.review_id);
+                active.filtrationList(2, item.review_id);
+              }
+              setTimeout(() => {
+                dd.navigateBack({delta: 1})
+              }, 1000);
+            } else {
+              setTimeout(() => {
+                dd.reLaunch({
+                  url: '/pages/workbench/index/index'
+                })
+              }, 1000);
             }
-            setTimeout(() => {
-              dd.navigateBack({
-                delta: 1
-              })
-            }, 1000);
           })
         }
       },
     });
   },
   getData() {
-    // that.data.review_id
     app.$get("api/integral/review", { review_id: that.data.review_id }).then((res) => {
       var data = res.data.data;
       data.typeName = app.getTypesItem(data.pt_id).name;

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

@@ -46,8 +46,9 @@ Page({
     if (app.globalData.userData) {
       that.getUserData();
       that.getGg();
-      that.setData({ isAdministrator: app.globalData.isAdministrator, getRole_four: app.globalData.isCreator })
       that.setData({
+        isAdministrator: app.globalData.isAdministrator,
+        getRole_four: app.globalData.isCreator,
         isSubject:app.globalData.is_personal==1? true:false,
         mainCorpId:app.globalData.main_corp_id
       })
@@ -63,8 +64,9 @@ Page({
           }
           that.getGg();
           that.getUserData();
-          that.setData({ isAdministrator: app.globalData.isAdministrator, getRole_four: app.globalData.isCreator })
-          that.setData({
+          that.setData({ 
+            isAdministrator: app.globalData.isAdministrator,
+            getRole_four: app.globalData.isCreator,
             isSubject:app.globalData.is_personal==1? true:false,
             mainCorpId:app.globalData.main_corp_id
           })

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

@@ -22,7 +22,7 @@
       <no-bata a:if="{{dataList.length==0}}"></no-bata>
       <scroll-view class="scroll" 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}}">
-          <img-box name="{{item.employee_name}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
+          <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" a:if="{{item.source_type == 2}}">{{item.employee_name}}的积分申请</view>
             <view class="name" a:if="{{item.source_type == 1}}">{{item.employee_name}}的积分任务</view>
@@ -43,7 +43,7 @@
       </scroll-view>
       <scroll-view class="scroll" scroll-y="{{true}}" a:if="{{dataList.length>0&&activeIndex==2}}" onScrollToLower="onScrollToLower">
         <view class="flex-box li border-bottom" data-item="{{item}}" catchTap="openDetail" a:for="{{dataList}}">
-          <img-box name="{{item.employee_name}}" height="70rpx" width="70rpx" fSize="24rpx"></img-box>
+          <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="flex-box flex-v-ce">
               <view class="name flex-1" a:if="{{item.source_type == 2}}">{{item.employee_name}}的积分申请</view>