guojy 1 年之前
父節點
當前提交
6df8c78875

+ 3 - 3
Component/selectStaff/selectStaff.acss

@@ -65,18 +65,18 @@
   color: #ccc;
 }
 
-.search {
+.search2 {
   background-color: #f1f1f1;
   border-radius: 10rpx;
   margin: 0 32rpx;
   padding: 8rpx 10rpx;
 }
 
-.search input {
+.search2 input {
   background-color: #f1f1f1;
 }
 
-.search image {
+.search2 image {
   width: 30rpx;
   height: 30rpx;
   margin-left: 10rpx;

+ 1 - 1
Component/selectStaff/selectStaff.axml

@@ -2,7 +2,7 @@
   <view class="data-tier" catchTap="onClose"></view>
   <view class="staff-header {{isShow?'showPop':''}}">
     <form onReset="onReset">
-      <view class="search flex-box flex-v-ce">
+      <view class="search2 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>

+ 20 - 16
app.js

@@ -2,8 +2,8 @@ import { showToast } from './utils/feedback'
 import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 import * as socketApi from './utils/websocket'
 
-// const baseUrl = "https://test-ding.g107.com/";//测试
-const baseUrl = "https://app55493.eapps.dingtalkcloud.com/";//正式
+const baseUrl = "https://test-ding.g107.com/";//测试
+// const baseUrl = "https://app55493.eapps.dingtalkcloud.com/";//正式
 var that;
 var yearArr = [];
 var year = formatTime(new Date()).year;
@@ -14,8 +14,8 @@ App({
   //自定义全局变量
   globalData: {
     baseUrl:baseUrl,
-    // webScoketUrl: "test-ding.g107.com",//webScoket测试
-    webScoketUrl: "app55493.eapps.dingtalkcloud.com",//webScoket正式
+    webScoketUrl: "test-ding.g107.com",//webScoket测试
+    // webScoketUrl: "app55493.eapps.dingtalkcloud.com",//webScoket正式
     showToast: showToast,//提示框
     arrRemoveObj: arrRemoveObj,//删除数组的某一项
     year: formatTime(new Date()).year,//当前年
@@ -39,14 +39,14 @@ App({
   },
   //获取积分类型
   getTypes(callBack) {
-    this.$get("api/integral/types", {}).then((res) => {
+    this.$get2("api/integral/types", {}).then((res) => {
       this.globalData.types = res.data.data.list;
       callBack();
     })
   },
   //获取套餐信息
   getCorp(corpId) {
-    this.$get("api/order/corp", { corp_id: corpId }).then((res) => {
+    this.$get2("api/order/corp", { corp_id: corpId }).then((res) => {
       this.globalData.corpMessage = res.data.data;
     })
   },
@@ -123,6 +123,7 @@ App({
         data: data,
         dataType: 'json',
         success: function (res) {
+		      dd.hideLoading();
           if (res.data.code == 1) {
             if (res.data.refresh_token && res.data.refresh_token != that.globalData.token) {
               that.globalData.token = res.data.refresh_token
@@ -137,6 +138,7 @@ App({
           }
         },
         fail: function (res) {
+		     dd.hideLoading();
           if (res.errorMessage == 'NETWORK ERROR') {
             dd.alert({
               title: '网络异常',
@@ -274,14 +276,15 @@ App({
                 that.globalData.userData = user;
                 var getIsStart = dd.getStorageSync({ key: 'isStart' });//判断是否需要打开引导页
                 console.log(JSON.stringify(user));
-                that.getUserList();//缓存人员列表
-                if (isStart && !getIsStart.data&&isShowStart) {//判断是否需要打开引导
-                  dd.reLaunch({
-                    url: '../start/start'
-                  })
-                } else {
-                  callBack(true);
-                }
+                that.getUserList(()=>{
+                  if (isStart && !getIsStart.data&&isShowStart) {//判断是否需要打开引导
+                    dd.reLaunch({
+                      url: '../start/start'
+                    })
+                  } else {
+                    callBack(true);
+                  }
+                });//缓存人员列表
               } else {
                 callBack(false);
               }
@@ -317,9 +320,10 @@ App({
       });
     }
   },
-  getUserList() {
-    this.$get("api/employee/list",{ dept_id: 0 }).then((res) => {
+  getUserList(fun) {
+    this.$get2("api/employee/list",{ dept_id: 0 }).then((res) => {
       that.globalData.usersList = res.data.data.list;
+      fun()
     })
   },
   getTypesItem(id) {

+ 10 - 10
pages/begin/begin.js

@@ -10,16 +10,16 @@ Page({
    that.loginAll();
   },
   loginAll(){
-      app.login(app.globalData.corpId, function (is) {
-        if(is){
-          dd.reLaunch({
-            url: '../workbench/index/index'
-          })
-        } else {
-          dd.reLaunch({
-            url: '../noJurisdiction/noJurisdiction'
-          })
-        }
+      app.login(app.globalData.corpId, function (is,is2) {
+          if(is){
+            dd.reLaunch({
+              url: '../workbench/index/index'
+            })
+          } else {
+            dd.reLaunch({
+              url: '../noJurisdiction/noJurisdiction'
+            })
+          }
       },function(data){
         if(data.code==3000||data.code==2001){
           if(that.data.num==3){ return false}

+ 2 - 2
pages/deploy/organization/organization.js

@@ -33,7 +33,7 @@ Page({
 	onLoad() {
 		that = this;
 		dd.setNavigationBar({
-			title: "部门/员工"
+			title: "组织架构"
 		});
 		this.setData({
 			terr: [{
@@ -140,7 +140,7 @@ Page({
 	tbDd() {
 		dd.confirm({
 			title: '温馨提示',
-			content: '下次同步时间需在10分钟之后,是否同步',
+			content: '即将同步钉钉通讯录的人员名单,确定同步吗',
 			confirmButtonText: '确定',
 			cancelButtonText: '取消',
 			success: (result) => {

+ 3 - 4
pages/exchange/prizeDetail/prizeDetail.js

@@ -23,13 +23,12 @@ Page({
     if (e.corpId) {
       this.setData({ corpId: e.corpId })
     }
-    console.log(e)
   },
-  onShow(e) {
+  onShow() {
     if (app.globalData.userData) {
       app.globalData.userData.employee_detail.role_list.forEach(item=>{
         if(item.name=='admin'||item.name=='creator'|| item.name == 'point_manager'){
-          this.setData({ isShowYy: true })
+          that.setData({ isShowYy: true })
         }
       })
       that.getData();
@@ -38,7 +37,7 @@ Page({
         if (is) {
           app.globalData.userData.employee_detail.role_list.forEach(item=>{
             if(item.name=='admin'||item.name=='creator'|| item.name == 'point_manager'){
-              this.setData({ isShowYy: true })
+              that.setData({ isShowYy: true })
             }
           })
           that.getData();

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

@@ -88,7 +88,8 @@ Page({
       month: that.data.month,
       type: 3,
       items:that.data.items,
-      date_interval: this.data.parameter.date_interval
+      date_interval: this.data.parameter.date_interval,
+      is:true
     }
     if (data.date_interval == '2') {
       let date = { type: 2, year: that.data.month.slice(0, 4), season: that.data.month.slice(4) }

+ 7 - 5
pages/statistics/integralEvent/integralEvent.js

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

+ 4 - 5
pages/statistics/jfDetail/jfDetail.axml

@@ -6,10 +6,10 @@
           <view class="name2">{{userInfo.employee_name}}</view>
           <view class="name2 dept_name font-flex-word" style="width:400rpx; overflow: hidden;">{{userInfo.deptName}}</view>
       </view>
-      <view class="blue" style="font-size:0.24rem" catchTap="open2">看TA的积分统计<text style="font-size:0.18rem;position: relative;right:-8rpx;top:-2rpx">〉</text></view>
+      <view class="blue" style="font-size:0.24rem" catchTap="open2" a:if="{{!is}}">看TA的积分统计<text style="font-size:0.18rem;position: relative;right:-8rpx;top:-2rpx">〉</text></view>
     </view>
-    <view class="fontColorB" style="font-size:28rpx;padding:10rpx 28rpx;" a:if="{{type==2}}">总分:<text class="blue">{{userInfo.point}}</text> (包含基础分<text class="blue">{{base_point}}</text>,工龄分<text class="blue">{{service_point}}</text>)</view>
-    <view class="fontColorB" style="font-size:28rpx;padding:10rpx 28rpx;" a:else>分值:<text class="blue">{{userInfo.point}}</text> (当前明细不包含基础分和工龄分)</view>
+    <view class="fontColorB" style="font-size:28rpx;padding:10rpx 28rpx;" a:if="{{type==2}}">总分:<text class="blue">{{userInfo.point}} B分</text> (包含基础分<text class="blue">{{base_point}}</text>,工龄分<text class="blue">{{service_point}}</text>)</view>
+    <view class="fontColorB" style="font-size:28rpx;padding:10rpx 28rpx;" a:else>分值:<text class="blue">{{userInfo.point}} {{formData.pt_id==3? 'B分':'A分'}}</text> (当前明细不包含基础分和工龄分)</view>
     <!-- <view class="flex-box flex-v-ce tab" style="border-bottom:1px solid #f1f1f1">
       <view class="flex-1">
         <picker onChange="bingIntegralType" value="{{typesIndex}}" range="{{types}}" range-key="name">
@@ -20,8 +20,7 @@
     <view class="main scroll">
       <scroll-view class="scroll" a:if="{{list.length>0}}" scroll-y="{{true}}" onScrollToLower="onScrollToLower">
         <view class="flex-box li border-bottom" a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" key="{{item.id}}">
-          <img-box name="{{item.employee_name}}" key="{{item.id}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx" 
-            fSize="24rpx"></img-box>
+          <img-box name="{{item.employee_name}}" key="{{item.id}}" imgUrl="{{item.employee_img_url}}" height="80rpx" width="80rpx"  fSize="24rpx"></img-box>
           <view class="flex-1 main-right">
             <view class="flex-box flex-v-ce">
               <view class="name flex-1">{{item.employee_name}}</view>

+ 44 - 4
pages/statistics/jfDetail/jfDetail.js

@@ -22,19 +22,20 @@ Page({
       { id: 1, name: '按积分由高到低排序' },
       { id: 2, name: '按积分由低到高排序' },
     ],
+    is:false,
   },
   onLoad(e) {
-    console.log(JSON.parse(e.data))
     that = this;
     dd.setNavigationBar({ title: "积分明细" });
     let data = JSON.parse(e.data);
+    console.log(data);
     let newObj = {};
     this.setData({type:data.type})
     if (data.type == 1) {
       let formData = this.data.formData;
       let parameter = {
         pt_id: data.pt_id || 0,
-        dept_ids: data.dept_id || 0,
+        // dept_ids: data.dept_id || 0,
         rule_id: data.rule || 0,
         employee_ids: data.item.employee_id,
       };
@@ -61,6 +62,7 @@ Page({
     } else {
       if (data.date_interval == '1') {//统计时间区间只有type为custom时有值 1-月度 2-季度 3-年度
         this.setData({
+          is:true,
           userInfo: data.item,
           'formData.month': data.month.slice(0, 4)+'-'+data.month.slice(4),
           'formData.employee_ids': data.item.employee_id,
@@ -68,6 +70,7 @@ Page({
         })
       }else if(data.date_interval == '3'){
         this.setData({
+          is:true,
           userInfo: data.item,
           'formData.year': data.month,
           'formData.employee_ids': data.item.employee_id,
@@ -75,6 +78,7 @@ Page({
         })
       }else{
         this.setData({
+          is:true,
           userInfo: data.item,
           'formData.start_day': data.start_day,
           'formData.end_day': data.end_day,
@@ -83,10 +87,46 @@ Page({
         })
       }
     }
-    console.log(this.data.userInfo)
     this.getData();
+    let role_list=this.supremeAuthority();
+    if(role_list=='dept_manager'&&data.item.employee_id!=app.globalData.userData.id){
+      let manage_scope=app.globalData.userData.employee_detail.manage_scope;
+      manage_scope.push(app.globalData.userData)
+      let is=true;
+      manage_scope.forEach(item=>{
+        if(data.item.employee_id==item.id){
+          is=false;
+        }
+      })
+      this.setData({is:is})
+    }
+    if(role_list=='employee'&&data.item.employee_id!=app.globalData.userData.id){
+      this.setData({is:true})
+    }
   },
-  getUserInfo(id){
+ supremeAuthority() { //获取当前角色最高权限     判断是否为某项权限:this.$authoritys('dept_manager') 或 this.$supremeAuthority() == 'dept_manager'
+	if (this.getIsCreator('creator')) {
+		return 'creator'
+	} else if (this.getIsCreator('admin')) {
+		return 'admin'
+	} else if (this.getIsCreator('point_manager')) {
+		return 'point_manager'
+	} else if (this.getIsCreator('dept_manager')) {
+		return 'dept_manager'
+	} else if (this.getIsCreator('employee')) {
+		return 'employee'
+	}
+},
+getIsCreator(key) {
+	let is = false;
+	app.globalData.userData.employee_detail.role_list.forEach(item => {
+		if (key == item.name) {
+			is = true;
+		}
+	})
+	return is
+},
+getUserInfo(id){
 			app.$get('/api/employee/detail',{target:id}).then(res => {
           this.setData({
             	base_point:res.data.data.user.site_config.base_point,//基础分

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

@@ -158,7 +158,7 @@ Page({
   showQrcode() {
     if (this.data.qrcodeId) {
       if (app.globalData.isCreator) {
-        app.globalData.showToast("你当前身份为系统管理员,不需要申请分功能");
+        app.globalData.showToast("你当前身份为系统管理员,不需要申请分功能");
         setTimeout(() => {
           dd.switchTab({
             url: '../index/index'

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

@@ -192,7 +192,7 @@ Page({
         that.setData({islog:true})
         setCache('init_rule_check',true)
         if (e.type == 'init_rule') {
-          if(e.code==1&&e.result.done){
+          if(e.code==1&&e.msg=='done'){
             that.setData({ isGz:false})
             app.globalData.showToast('已导入');
             app.globalData.socketApi.closewebsocket();
@@ -200,7 +200,7 @@ Page({
             // app.globalData.showToast(e.msg);
           }
         }
-    });
+    },true);
   },
   openWs2(){
     app.$post("api/integral/employee/init_rule_notice").then((res) => {
@@ -524,7 +524,7 @@ Page({
         that.setData({
           rankingList: list,
           rankingTotal: values[2].data.data.total
-        })
+        }) 
         if(that.data.selectPlItem.group_name){
           list.some(item=>{
             if(item.target_id==0&&that.data.selectPlItem.group_name==item.group_name){
@@ -533,7 +533,7 @@ Page({
               })
               return true
             }
-            if(item.target_id==that.data.selectPlItem.target_id){
+            if(item.target_id!=0&&item.target_id==that.data.selectPlItem.target_id){
               that.setData({
                 selectPlItem:item
               })
@@ -636,7 +636,7 @@ Page({
     }
     app.$get('api/integral/statistics/ranking',data,'application/vnd.test.v2+json').then((res) => {
       let list=res.data.data.list
-      if(list[0].employee_id!=app.globalData.userData.id){
+      if(list[0]&&list[0].employee_id!=app.globalData.userData.id){
         let data={
           employee_id: app.globalData.userData.id,
           employee_img_url:  app.globalData.userData.img_url,

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

@@ -596,7 +596,6 @@ Page({
     }, 1000);
   },
   returnResult(id) {
-    console.log(id)
     return app.globalData.usersList.filter(item => {
       return item.id == id;
     })