347617796@qq.com 3 年之前
父节点
当前提交
7f0a4bd2bc

+ 2 - 2
Component/selectSxZp/selectSxZp.js

@@ -10,7 +10,7 @@ Component({
         name: '积分类型',
         child: [
           { name: "全部", code: 0, checked: true },
-          { name: "绩效分", code: 1, checked: false },
+          // { name: "绩效分", code: 1, checked: false },
           { name: "A分", code: 2, checked: false },
           { name: "B分", code: 3, checked: false },
         ],
@@ -36,7 +36,7 @@ Component({
         name: '积分类型',
         child: [
           { name: "全部", code: 0, checked: false },
-          { name: "绩效分", code: 1, checked: false },
+          // { name: "绩效分", code: 1, checked: false },
           { name: "A分", code: 2, checked: false },
           { name: "B分", code: 3, checked: false },
         ],

+ 4 - 3
app.js

@@ -1,8 +1,8 @@
 import { showToast } from './utils/feedback'
 import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 
-// 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;
@@ -255,6 +255,7 @@ App({
               that.globalData.showToast(res.msg)
             }
           }).catch(err => {
+            console.log(err)
             // errBack(err.data.code);
             // return
             if (err.data.code == 2001) {
@@ -275,7 +276,7 @@ App({
           })
         },
         fail: function (err) {
-          console.log(err)
+          that.globalData.showToast("错误"+JSON.stringify(err))
         }
       });
     }

+ 2 - 1
app.json

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

二进制
image/logo.png


二进制
image/tb.png


+ 94 - 32
pages/deploy/organization/organization.acss

@@ -1,27 +1,32 @@
-.header{
+.header {
   background: #fff;
   padding: 24rpx;
   position: sticky;
   top: 0;
 }
-.search{
-    background-color: #f1f1f1;
-    border-radius: 10rpx;
-    padding:8rpx 10rpx;
+
+.search {
+  background-color: #f1f1f1;
+  border-radius: 10rpx;
+  padding: 8rpx 10rpx;
 }
-.search input{
-    background-color: #f1f1f1;
-    font-size: 26rpx;
+
+.search input {
+  background-color: #f1f1f1;
+  font-size: 26rpx;
 }
-.search image{
+
+.search image {
   width: 30rpx;
   height: 30rpx;
   margin-left: 10rpx;
 }
-.li{
+
+.li {
   background-color: #fff;
 }
-.img-left{
+
+.img-left {
   margin: 0 28rpx;
   background-color: rgba(38, 162, 255, 0.1);
   padding: 10rpx;
@@ -31,50 +36,60 @@
   text-align: center;
   box-sizing: border-box;
 }
-.img-tx{
- margin: 0 28rpx;
+
+.img-tx {
+  margin: 0 28rpx;
 }
-.img-left image{
+
+.img-left image {
   width: 50rpx;
   height: 50rpx;
   position: relative;
   top: 5rpx;
 }
-.img-right{
+
+.img-right {
   width: 24rpx;
   height: 24rpx;
   margin-right: 28rpx;
 }
-.li-right{
+
+.li-right {
   padding: 32rpx 0;
 }
-.logo{
+
+.logo {
   width: 100rpx;
   height: 100rpx;
   border-radius: 6rpx;
   margin-right: 20rpx;
 }
-.name{
-    overflow: hidden;
-	  text-overflow: ellipsis;
-	  white-space: nowrap;
-    padding-right: 20rpx;
-    font-size: 36rpx;
+
+.name {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  padding-right: 20rpx;
+  font-size: 36rpx;
 }
-.title2{
+
+.title2 {
   font-size: 28rpx;
-  padding: 20rpx 28rpx; 
+  padding: 20rpx 28rpx;
 }
-.shu{
-  padding:24rpx 28rpx;
+
+.shu {
+  padding: 24rpx 28rpx;
   font-size: 28rpx;
   color: #26A2FF;
   padding-top: 0rpx;
 }
-.shu view:last-child{
+
+.shu view:last-child {
   color: #ccc;
 }
-.footer{
+
+.footer {
   position: fixed;
   left: 0;
   right: 0;
@@ -84,12 +99,59 @@
   padding-bottom: 30rpx;
   /* border-top: 1px solid #f1f1f1; */
 }
-.footer view{
+
+.footer .jin {
   border-radius: 6rpx;
   background: #fff;
-  color: #26A2FF;
+  color: #F56C6C;
+  height: 88rpx;
+  text-align: center;
+  line-height: 88rpx;
+  border: 1px solid #F56C6C;
+  margin-right: 28rpx
+}
+
+.footer .kai {
+  border-radius: 6rpx;
+  background: #26A2FF;
+  color: #fff;
   height: 88rpx;
   text-align: center;
   line-height: 88rpx;
-  border:1px solid #f1f1f1;
+  border: 1px solid #26A2FF;
+}
+
+.tbImg {
+  width: 50rpx;
+  height: 50rpx;
+}
+
+.tbText {
+  font-size: 24rpx;
+  color: #26A2FF;
+}
+
+.userItem {
+  padding: 14rpx 24rpx;
+  border-bottom: 1px solid #f1f1f1;
+}
+
+.state {
+  font-size: 24rpx;
+}
+.selectText{
+  position: relative
+}
+.selectText::after {
+  position: absolute;
+  top:50%;
+  right: -0.2rem;
+  margin-top: -0.1rem;
+  border-width: 0.06rem;
+  border-style: solid;
+  border-image: initial;
+  border-color: transparent transparent rgb(192, 196, 204) rgb(192, 196, 204);
+  transform: rotate(-45deg);
+  opacity: 0.8;
+  content: "";
 }

+ 96 - 27
pages/deploy/organization/organization.axml

@@ -1,16 +1,23 @@
 <view>
   <view class="header margin-bottom">
-  <form onReset="onReset">
-    <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>
-  </form>
+    <form onReset="onReset">
+      <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>
+    </form>
     <view class="flex-box flex-v-ce" style="margin-top:28rpx;">
-      <image a:if="{{gsData.logo_ur}}" mode="scaleToFill" src="{{gsData.logo_url}}" class="logo"/>
-      <image a:else mode="scaleToFill" src="../../../image/gs_logo.png" class="logo"/>
-      <view class="flex-1 name">{{gsData.name}}</view>
+      <view class="flex-1 flex-box flex-v-ce">
+        <image a:if="{{gsData.logo_ur}}" mode="scaleToFill" src="{{gsData.logo_url}}" class="logo"/>
+        <image a:else mode="scaleToFill" src="../../../image/gs_logo.png" class="logo"/>
+        <view class="name flex-1">{{gsData.name}}</view>
+      </view>
+      <view class="flex-box-v flex-center-center" style="border-left:1px solid #f1f1f1;padding-left:28rpx" catchTap="tbDd">
+        <view>
+          <image mode="scaleToFill" src="../../../image/tb.png" class="tbImg"/></view>
+        <view class="tbText">同步钉钉</view>
+      </view>
     </view>
   </view>
   <view class="flex-box flex-v-ce shu" a:if="{{terr.length>1}}">
@@ -27,30 +34,92 @@
         <image mode="scaleToFill" src="../../../image/right.png" class="img-right"></image>
       </view>
     </view>
-    <view class="title2 fontColorF">全部人员</view>
-    <view class="flex-box flex-v-ce li" a:for="{{userList}}">
-      <view class="img-tx">
-        <img-box imgUrl="{{item.img_url}}" name="{{item.name}}" height="90rpx" width="90rpx" fSize="24rpx"></img-box>
+    <view class="flex-box flex-v-ce title2">
+      <view class="flex-1 fontColorF">
+        <picker onChange="bingIntegralType" value="{{minuteIndex}}" range="{{minuteArray}}" range-key="name">
+          <text class="selectText">{{minuteArray[minuteIndex].name}}</text>
+        </picker>
       </view>
-      <view class="{{(index+1)!=rule_tree.lenght? 'border-bottom':'' }}  flex-box flex-v-ce flex-1 li-right">
-        <view class="title flex-1">{{item.name}}</view>
+      <view class="flex-box">
+        <label>
+          <text class="fontColorZ" style="padding-right:20rpx">全选</text>
+          <checkbox onChange="ruleActiveAll"  checked="{{isAllChecked}}"></checkbox>
+        </label>
       </view>
     </view>
-    <view a:if="{{userList.length==0}}"><no-data  content="未找到相关人员"/></view>
-  </scroll-view>
-  <scroll-view a:else class="main"  scroll-y="{{true}}" style="height: calc(100vh - 388rpx)">
-    <view class="title2 fontColorF">全部人员</view>
-    <view class="flex-box flex-v-ce li" a:for="{{searchUser}}">
-      <view class="img-tx">
+    <block a:if="{{minuteIndex==1}}">
+        <view class="flex-box flex-v-ce li" a:for="{{userList}}" a:if="{{item.is_official==1}}">
+          <label class="flex-box flex-v-ce flex-1 userItem">
+            <img-box imgUrl="{{item.img_url}}" name="{{item.name}}" height="90rpx" width="90rpx" fSize="24rpx"></img-box>
+            <view class="flex-box-v flex-1" style="margin-left:20rpx;">
+              <text class="flex-1">{{item.name}}</text>
+              <text class="state blue" a:if="{{item.is_creator==1||item.is_official==1}}">已开启</text>
+              <text class="state red" a:else>关闭</text>
+            </view>
+            <checkbox onChange="radioChange" data-id="{{item.id}}" checked="{{item.isChecked}}" disabled="{{item.is_creator}}" name="{{item.id}}"></checkbox>
+          </label>
+        </view>
+    </block>
+    <view class="flex-box flex-v-ce li" a:for="{{userList}}" a:else>
+      <label class="flex-box flex-v-ce flex-1 userItem">
         <img-box imgUrl="{{item.img_url}}" name="{{item.name}}" height="90rpx" width="90rpx" fSize="24rpx"></img-box>
+        <view class="flex-box-v flex-1" style="margin-left:20rpx;">
+          <text class="flex-1">{{item.name}}</text>
+          <text class="state blue" a:if="{{item.is_creator==1||item.is_official==1}}">已开启</text>
+          <text class="state red" a:else>关闭</text>
+        </view>
+        <checkbox onChange="radioChange" data-id="{{item.id}}" checked="{{item.isChecked}}" disabled="{{item.is_creator}}" name="{{item.id}}"></checkbox>
+      </label>
+    </view>
+
+    <view a:if="{{userList.length==0}}">
+      <no-data content="未找到相关人员"/>
+    </view>
+  </scroll-view>
+  <scroll-view a:else class="main" scroll-y="{{true}}" style="height: calc(100vh - 388rpx)">
+    <view class="flex-box flex-v-ce title2">
+      <view class="flex-1 fontColorF">
+        <picker onChange="bingIntegralType" value="{{minuteIndex}}" range="{{minuteArray}}" range-key="name">
+          <text class="selectText">{{minuteArray[minuteIndex].name}}</text>
+        </picker>
       </view>
-      <view class="{{(index+1)!=rule_tree.lenght? 'border-bottom':'' }}  flex-box flex-v-ce flex-1 li-right">
-        <view class="title flex-1">{{item.name}}</view>
+      <view class="flex-box">
+        <label>
+          <text class="fontColorZ" style="padding-right:20rpx">全选</text>
+          <checkbox onChange="ruleActiveAll"  checked="{{isAllChecked2}}"></checkbox>
+        </label>
       </view>
     </view>
-    <view a:if="{{searchUser.length==0}}"><no-data  content="未找到相关人员"/></view>
+    <block a:if="{{minuteIndex==1}}">
+        <view class="flex-box flex-v-ce li" a:for="{{searchUser}}" a:if="{{item.is_official==1}}">
+          <label class="flex-box flex-v-ce flex-1 userItem">
+            <img-box imgUrl="{{item.img_url}}" name="{{item.name}}" height="90rpx" width="90rpx" fSize="24rpx"></img-box>
+            <view class="flex-box-v flex-1" style="margin-left:20rpx;">
+              <text class="flex-1">{{item.name}}</text>
+              <text class="state blue" a:if="{{item.is_creator==1||item.is_official==1}}">已开启</text>
+              <text class="state red" a:else>关闭</text>
+            </view>
+            <checkbox onChange="radioChange" data-id="{{item.id}}" checked="{{item.isChecked}}" disabled="{{item.is_creator}}" name="{{item.id}}"></checkbox>
+          </label>
+        </view>
+    </block>
+    <view class="flex-box flex-v-ce li" a:for="{{searchUser}}" a:else>
+      <label class="flex-box flex-v-ce flex-1 userItem">
+        <img-box imgUrl="{{item.img_url}}" name="{{item.name}}" height="90rpx" width="90rpx" fSize="24rpx"></img-box>
+        <view class="flex-box-v flex-1" style="margin-left:20rpx;">
+          <text class="flex-1">{{item.name}}</text>
+          <text class="state blue" a:if="{{item.is_creator==1||item.is_official==1}}">已开启</text>
+          <text class="state red" a:else>关闭</text>
+        </view>
+        <checkbox onChange="radioChange" data-id="{{item.id}}" checked="{{item.isChecked}}" disabled="{{item.is_creator}}" name="{{item.id}}"></checkbox>
+      </label>
+    </view>
+    <view a:if="{{searchUser.length==0}}">
+      <no-data content="未找到相关人员"/>
+    </view>
   </scroll-view>
-  <view class="footer" catchTap="tbDd">
-    <view>同步钉钉</view>
+  <view class="footer flex-box fle-flex-v-ce">
+    <view class="jin flex-1" catchTap="onOpen" data-index="1">禁用</view>
+    <view class="kai flex-1" catchTap="onOpen" data-index="2">开启</view>
   </view>
 </view>

+ 127 - 8
pages/deploy/organization/organization.js

@@ -7,9 +7,18 @@ Page({
     rule_tree: [],
     terr: [{ name: '全公司', id: 0 }],
     searchUser: [],//搜索
-    isItem: true//是否为搜索的值
+    searchName:'',
+    isItem: true,//是否为搜索的值
+    isAllChecked: false,
+    isAllChecked2: false,
+    dept_id:0,
+    minuteIndex: 0,//条件选择
+    minuteArray: [
+      { id: 0, name: '全部人员' },
+      { id: 1, name: '仅显示已开启人员' }
+    ],
   },
-  onLoad(query) {
+  onLoad() {
     that = this;
     dd.setNavigationBar({ title: "部门/员工" });
     this.setData({
@@ -18,6 +27,96 @@ Page({
     this.getMessage();
     this.getBmData();
     this.getUserData(0);
+  },
+    //选择积分分类
+  bingIntegralType(e) {
+    this.setData({
+      minuteIndex: e.detail.value,
+    });
+  },
+  radioChange(e){
+    var list = this.data.isItem? this.data.userList:this.data.searchUser;
+    let id = e.target.dataset.id;
+    list.map(item => {
+        if(item.id==id){
+          item.isChecked = e.detail.value;
+        }
+    })
+  },
+  //全选择
+  ruleActiveAll(e) {
+    var list = this.data.isItem? this.data.userList:this.data.searchUser;
+    if (e.detail.value) {
+      list.map(item => {
+        if(item.is_creator!=1){
+          if(this.data.minuteIndex==1){
+            if(item.is_official==1){
+                item.isChecked = true;
+            }
+          }else{
+            item.isChecked = true;
+          }
+        }
+      })
+    } else {
+      list.map(item => {
+        if(item.is_creator!=1){
+          if(this.data.minuteIndex==1){
+            if(item.is_official==1){
+                item.isChecked = false;
+            }
+          }else{
+            item.isChecked = false;
+          }
+        }
+      })
+    }
+    if(this.data.isItem){
+      this.setData({
+        userList:list,
+        isAllChecked:e.detail.value
+      })
+    }else{
+      this.setData({
+        searchUser:list,
+        isAllChecked2:e.detail.value
+      })
+    }
+  },
+  // 开启||禁用
+  onOpen(e){
+    var index = e.target.dataset.index;
+    let employeeId=[];
+    var list = this.data.isItem? this.data.userList:this.data.searchUser;
+    list.map(item => {
+      if(item.isChecked){
+          if(this.data.minuteIndex==1){
+            if(item.is_official==1){
+                employeeId.push(item.id)
+            }
+          }else{
+            employeeId.push(item.id)
+          }
+      }
+    })
+    if (employeeId.length == 0) {
+				app.globalData.showToast("请选择一名员工")
+				return;
+		}
+    let url=index==1? 'api/employee/disable':'api/employee/enable'
+    app.$post(url, { employee_id: JSON.stringify(employeeId) }).then((res) => {
+        app.globalData.showToast("设置成功")
+        if(this.data.isItem){
+          this.getUserData(this.data.dept_id);
+        }else{
+          let data={
+            detail:{
+              value:this.data.searchName
+            }
+          }
+          this.bindKeyInput(data);
+        }
+    })
   },
   tbDd() {
     dd.confirm({
@@ -43,15 +142,23 @@ Page({
     })
   },
   bindKeyInput(e) {
-    app.$get("api/employee/list", { dept_id: 0 }).then((res) => {
+    app.$get("api/employee/index", { dept_id: 0 }).then((res) => {
       var list = res.data.data.list;
+      list.forEach(item=>{
+        item.isChecked=false
+        if(item.id==app.globalData.userData.id){
+          item.is_creator=1
+        }
+      })
       var items = list.filter((item) => {
         return item.name.indexOf(e.detail.value) >= 0
       });
       this.setData({
         searchUser: items,
         isItem: e.detail.value ? false : true,
-        isVal: e.detail.value ? true : false
+        isVal: e.detail.value ? true : false,
+        searchName: e.detail.value? e.detail.value:'',
+        isAllChecked2: false,
       })
     })
   },
@@ -66,25 +173,27 @@ Page({
       this.setData({
         terr: [{ name: '全公司', id: 0 }],
         rule_tree: this.data.all_rule_list,
+        dept_id:0
       })
     } else {
       var arr = terr.slice(0, index + 1);
       this.setData({
         rule_tree: item._child,
-        terr: arr
+        terr: arr,
+        dept_id:item.id
       })
     }
     this.getUserData(item.id);
   },
   //点击一级
   activeTree(e) {
-    console.log(e);
     var item = e.target.dataset.item
     var terr = this.data.terr;
     terr.push(item)
     this.setData({
       rule_tree: item._child,
-      terr: terr
+      terr: terr,
+      dept_id:item.id
     });
     this.getUserData(item.id);
   },
@@ -100,9 +209,19 @@ Page({
   },
   //获取员工信息
   getUserData(dept_id) {
-    app.$get("api/employee/list", { dept_id: dept_id }).then((res) => {
+    this.setData({
+        userList: []
+    })
+    app.$get("api/employee/index", { dept_id: dept_id }).then((res) => {
       var list = res.data.data.list;
+      list.forEach(item=>{
+        item.isChecked=false
+        if(item.id==app.globalData.userData.id){
+          item.is_creator=1
+        }
+      })
       this.setData({
+        isAllChecked: false,
         userList: list
       })
     })

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

@@ -17,10 +17,26 @@ Page({
     })
   },
   onShow() {
-    if (this.data.page == 1) {
-      dd.hideLoading();
-      that.getData();
+    if (app.globalData.userData) {
+      if (that.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(){})
     }
+
   },
   getData(is) {
     var data = {

+ 85 - 0
pages/statistics/my_sp/my_sp.acss

@@ -0,0 +1,85 @@
+.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 - 115rpx);
+}
+
+.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;
+}
+
+.li-top .flex-1 {
+  padding-right: 50rpx;
+}
+
+.task {
+  background: #f5f7fa;
+  color: #909399;
+  font-size: .28rem;
+  padding: .05rem .32rem .15rem;
+}

+ 67 - 0
pages/statistics/my_sp/my_sp.axml

@@ -0,0 +1,67 @@
+<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">
+        <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>
+      <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>
+      </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">
+      <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>
+      </view>
+      <view class="noDatas" a:if="{{isData}}">没有更多咯</view>
+    </scroll-view>
+    <no-data a:if="{{list.length==0}}"></no-data>
+  </view>
+  <select-zp defaultSx="{{sxObj}}" typeIndex="2" a:if="{{showZp==true}}" isShow="{{showZp}}" onClose="onClose" onConfirm="onConfirmSx"></select-zp>
+</view>

+ 179 - 0
pages/statistics/my_sp/my_sp.js

@@ -0,0 +1,179 @@
+
+var app = getApp()
+var that;
+Page({
+  data: {
+    date: app.globalData.month,
+    activeIndex: 1,
+    page: 1,
+    toList: [], // 放今天待完成
+    list: [],
+    showZp: false,//显示sx选择
+    parameter: { //我指派的参数
+      pt_id: 0,//类型
+      status: 'running',//状态
+      sort: 'publish',//排序
+    },
+  },
+  onLoad(e) {
+    that = this;
+    if (e.index) {
+      this.setData({
+        activeIndex: e.index,
+      })
+    }
+    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();
+          }
+        } else {
+          dd.reLaunch({
+            url: '../noJurisdiction/noJurisdiction'
+          })
+        }
+      },function(){})
+    }
+  },
+  //显示选择员工
+  selectSx() {
+    this.setData({ showZp: true })
+  },
+  //关闭弹窗
+  onClose() {
+    this.setData({
+      showZp: false,
+    })
+  },
+  //选择筛选
+  onConfirmSx(data) {
+    this.setData({
+      sxObj: data,
+      page: 1,
+      parameter: { //我指派的参数
+        pt_id: data[0],//类型
+        status: this.data.parameter.status,
+        sort: data[2]
+      }
+    })
+    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 = {
+      page: that.data.page,
+      page_size: 20,
+      source_type: 0,//作来源种类 0-全部 1-直接指派(任务池领取以外的类型) 2-任务池领取 3-任务模板指派 4-每月绩效任务包
+      pt_id: parameter.pt_id,//类型
+      status: parameter.status,//工作状态 all-全部 running-进行中 complete-工作已完成 refuse-拒绝 reviewed-已审批 revocation-发布者撤回
+      sort: parameter.sort,//排序种类 expire-过期时间倒序 publish-指派时间倒序
+    }
+    app.$get('api/integral/work/list', data).then((res) => {
+      var data = res.data.data.list;
+      data.forEach(item => {
+        item.isCs = item.expire_time < app.globalData.allDate;
+      })
+      var list = that.data.list;
+      data.forEach(element => {
+        if (element.pt_id) {
+          element.pt_name = app.getTypesItem(element.pt_id).name
+        }
+      });
+      if (is) {
+        if (data.length < 20) {
+          this.setData({
+            list: list.concat(data),
+            isData: true
+          })
+        } else {
+          this.setData({
+            list: list.concat(data)
+          })
+        }
+      } else {
+        this.setData({
+          list: data,
+          isData: false
+        })
+      }
+    })
+  },
+  activeItem(e) {
+    var index = e.target.dataset.index;
+    var status = "";
+    if (index == 1) {
+      status = "running"
+    } else if (index == 2) {
+      status = "complete"
+    } else {
+      status = "reviewed"
+    }
+    this.setData({
+      activeIndex: index,
+      page: 1,
+      list: [],
+      sxObj: [],
+      parameter: {
+        pt_id: 0,//类型
+        status: status,//状态
+        sort: 'publish',//排序
+      }
+    })
+    this.getData();
+  },
+  openPerform(e) {
+    var id = e.target.dataset.item.id;
+    var is = e.target.dataset.is ? true : false
+    dd.navigateTo({
+      url: '../openPerform/openPerform?id=' + id + '&is=' + is
+    })
+  },
+  //过滤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) {
+          list.splice(i, 1)
+        }
+      }
+      this.setData({ list: list })
+    }
+  },
+  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);
+    }
+  },
+});

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

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

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

@@ -10,16 +10,38 @@ Page({
     process: [],
     array: ['编辑任务', '删除任务'],
     isPublisher: true,//是不是发布者
+    corpId:'',
   },
   onLoad(e) {
     that = this;
     dd.setNavigationBar({ title: "工作详情" });
     if (e.id) {
       this.setData({
-        id: e.id,
+        id: parseInt(e.id),
         userId: app.globalData.userData.id
       })
-      that.getDetail(e.id);
+    }
+    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);
+    } else {
+      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);
+        } else {
+          dd.reLaunch({
+            url: '../noJurisdiction/noJurisdiction'
+          })
+        }
+      },function(){})
     }
   },
   // 判断当前账号与发布工作者是否同一人;
@@ -48,7 +70,7 @@ 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(() => {

+ 23 - 2
pages/workbench/approveDetail/approveDetail.js

@@ -7,17 +7,38 @@ Page({
     isBh: false,//是否显示驳回弹窗
     textArea: "",
     disabled: false,
+    corpId:'',
   },
   onLoad(e) {
     that = this;
     dd.setNavigationBar({ title: "详情" });
     if (e.id) {
-      that.setData({ review_id: e.id,userData:app.globalData.userData });
-      that.getData();
+      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
+    }
+  },
+  onShow() {
+    if (app.globalData.userData) {
+        dd.hideLoading();
+        that.getData();
+    } else {
+      app.login(that.data.corpId, function (is) {
+        if (is) {
+            dd.hideLoading();
+            that.getData();
+        } else {
+          dd.reLaunch({
+            url: '../noJurisdiction/noJurisdiction'
+          })
+        }
+      },function(){})
+    }
   },
   showImg(e) {
     var index = e.target.dataset.index;