Browse Source

2023.11.11

guojy 1 year ago
parent
commit
8a45bce375

+ 18 - 0
Component/selectRule_two/selectRule_two.js

@@ -82,8 +82,26 @@ Component({
           rule_tree: rule_tree,
           all_rule_list:rule_tree
         })
+        if(this.data.activeId){
+          this.returnItem(rule_tree,this.data.activeId,(item)=>{
+            if(item.id){
+              this.radioChange({target:{dataset:{item:item}}})
+            }
+          })
+        }
       })
     },
+    returnItem(arr,id,fun){
+      if(arr&&arr.length>0){
+        arr.forEach(e=>{
+          if(e.id==id){
+            fun(e)
+          }else{
+            this.returnItem(e.child,id,fun);
+          }
+        })
+      }
+    },
     
     //关闭
     onClose(e) {

+ 19 - 1
Component/selectSection/selectSection.js

@@ -80,7 +80,6 @@ Component({
        }
     },
     radioChange: function(e) {
-      console.log(e.target.dataset.item)
         let ids=[e.target.dataset.item.id];
         if(this.props.isAll&&e.target.dataset.item._child){
           this.returnArr(e.target.dataset.item._child,ids)
@@ -112,8 +111,27 @@ Component({
           rule_tree: list,
           all_rule_list:list,
         })
+        if(this.data.activeId){
+          this.returnItem(list,this.data.activeId,(item)=>{
+            if(item.id){
+              this.radioChange({target:{dataset:{item:item}}})
+            }
+          })
+        }
       })
     },
+    returnItem(arr,id,fun){
+      if(arr&&arr.length>0){
+        arr.forEach(e=>{
+          if(e.id==id){
+            fun(e)
+          }else{
+            this.returnItem(e._child,id,fun);
+          }
+        })
+      }
+    },
+
     //关闭
     onClose(e) {
       this.props.onClose();

+ 1 - 0
Component/selectSectionBottom/selectSectionBottom.axml

@@ -21,6 +21,7 @@
           </label>
           <view class="xia" data-item="{{item}}" catchTap="openDown" a:if="{{item._child.length>0}}">| 下级</view>
         </view>
+        <view style="text-align:center;margin-top:2rem" class="fontColorC" a:if="{{ rule_tree.length==0 }}">暂无部门</view>
       </scroll-view>
     </view>
   </view>

+ 2 - 6
Component/selectSectionStaff/selectSectionStaff.axml

@@ -37,7 +37,6 @@
           <label class="flex-box flex-v-ce flex-1">
             <image a:if="{{item.img_url}}" class="img-url" mode="scaleToFill" src="{{item.img_url}}"/>
             <view class="img-name" a:else>{{item.name}}</view>
-            <!-- <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}}"></checkbox>
           </label>
@@ -46,7 +45,6 @@
           <view class="{{item.checked? 'active':''}} flex-box flex-v-ce flex-1" catchTap="radioChange" data-index="{{index}}" data-item="{{item}}">
             <image a:if="{{item.img_url}}" class="img-url" mode="scaleToFill" src="{{item.img_url}}"/>
             <view class="img-name" a:else>{{item.name}}</view>
-            <!-- <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>
             <view class="radio_"></view>
           </view>
@@ -56,12 +54,10 @@
           <image mode="scaleToFill" src="../../../image/noData.png" style="width: 340rpx;height: 340rpx;margin-bottom:20rpx;"/>
         </view>
         <view class="fontColorB" style="margin-top:0rpx;text-align: center;" a:if="{{isCreator}}">
-          <view  style="font-size:0.28rem">未授权员工进入系统,请前往钉钉电脑端</view>
-          <view  style="font-size:0.28rem">为员工【启用积分管理】</view>
+          <view style="font-size:0.28rem">未授权员工进入系统,请前往钉钉电脑端-工作台-进入“功道云积分制”-设置-组织架构-为员工【启用积分管理】</view>
         </view>
         <view class="fontColorB" style="margin-top:0rpx;text-align: center;" a:else>
-          <view style="font-size:0.28rem">你当前没有可管理人员,请前往钉钉电脑端</view>
-          <view  style="font-size:0.28rem" >设置【管理范围】</view>
+          <view style="font-size:0.28rem">暂无可选人员,请联系系统管理员“{{creatorName}}”或积分管理员设置【管理范围】</view>
         </view>
       </view>
     </scroll-view>

+ 2 - 1
Component/selectSectionStaff/selectSectionStaff.js

@@ -28,6 +28,7 @@ Component({
     isLeadership: false,//数据源是否是自己的管理范围
     isBoss: false,//是否去除系统管理员
     isUser: false,//是否去除自己
+    isFill:true,//是否必选
   },
   didMount() {
     that = this;
@@ -56,7 +57,7 @@ Component({
       })
     },
     onConfirm() {
-      if (this.data.selectUserId.length == 0) {
+      if (this.props.isFill&&this.data.selectUserId.length == 0) {
         app.globalData.showToast("请选择一名员工")
         return
       }

+ 5 - 4
app.js

@@ -3,8 +3,8 @@ import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 import * as socketApi from './utils/websocket'
 import { onSubscribeAppBack} from 'dingtalk-service-window-libs/lib/openSubscribeMiniApp'
 
-// 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;
@@ -15,8 +15,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,//当前年
@@ -264,6 +264,7 @@ App({
             if (res.data.code == 1) {
               var { token, user } = res.data.data;
               var isStart = false;
+              // console.log(JSON.stringify(user.employee_detail.role_list))
               if (user.is_official == 1) {
                 user.employee_detail.role_list.forEach(item => {
                   if (item.name == 'creator') {

+ 5 - 5
pages/deploy/index/index.axml

@@ -21,10 +21,10 @@
           <view class="xusj" data-index="1" onTap="openView">续费升级</view>
         </view>
       </view>
-      <view class="vip margin-bottom" a:if="{{vipData}}" onTap="openView2">
+      <!-- <view class="vip margin-bottom" a:if="{{vipData}}" onTap="openView2">
         <image mode="scaleToFill" src="../../../image/vip.png"></image>
         <view class="btn">立即开通</view>
-      </view>
+      </view> -->
       <!-- 使用指南 -->
 
       <view style="font-size:0.32rem;padding: 0.24rem 0.32rem;padding-top:0" class="flex-box-ce">
@@ -36,9 +36,9 @@
       </view>
       <view class="zn" a:if="{{isShowYy}}">
         <view class="flex-box-ce" style="padding:24rpx 0;overflow-x: scroll;margin:0 24rpx;">
-            <view class="zn-item" a:for="{{announcementList}}" data-index="{{index}}" a:for-index="index" onTap="openaN2">
-                <text class="clamp2">{{item.title}}</text>
-            </view>
+          <view class="zn-item" a:for="{{announcementList}}" data-index="{{index}}" a:for-index="index" onTap="openaN2">
+            <text class="clamp2">{{item.title}}</text>
+          </view>
         </view>
       </view>
       <view a:for="{{list}}" class="flex-box flex-v-ce li" data-index="{{item.id}}" onTap="openView">

+ 7 - 7
pages/deploy/organization/organization.axml

@@ -13,9 +13,8 @@
         <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 a:if="{{ isSuperAdministrator }}" 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>
@@ -25,7 +24,7 @@
       <image mode="scaleToFill" src="../../../image/right.png" style="width:20rpx;height:20rpx;margin:0 6rpx;" a:if="{{index!=0}}"/>{{item.name}}
     </view>
   </view>
-  <scroll-view a:if="{{isItem}}" class="main" scroll-y="{{true}}" style="{{terr.length>1? 'height: calc(100vh - 480rpx)':'height: calc(100vh - 442rpx)'}}">
+  <scroll-view a:if="{{isItem}}" class="main" scroll-y="{{true}}" style="{{terr.length>1? 'height: calc(100vh - 344rpx)':'height: calc(100vh - 280rpx)'}}">
     <view class="flex-box flex-v-ce li" a:for="{{rule_tree}}" catchTap="activeTree" data-item="{{item}}">
       <view class="img-left">
         <image mode="scaleToFill" src="../../../image/BM.png"></image></view>
@@ -71,13 +70,13 @@
         <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>
+    <view style="height:3rem"> </view>
   </scroll-view>
   <!-- 搜索的人员 -->
-  <scroll-view a:else class="main" scroll-y="{{true}}" style="height: calc(100vh - 388rpx)">
+  <scroll-view a:else class="main" scroll-y="{{true}}" style="height: calc(100vh - 280rpx)">
     <view class="flex-box flex-v-ce title2">
       <view class="flex-1 fontColorB">
         <picker onChange="bingIntegralType" value="{{minuteIndex}}" range="{{minuteArray}}" range-key="name">
@@ -118,8 +117,9 @@
     <view a:if="{{searchUser.length==0}}">
       <no-data content="未找到相关人员"/>
     </view>
+    <view style="height:3rem"> </view>
   </scroll-view>
-  <view class="footer flex-box fle-flex-v-ce">
+  <view class="footer flex-box fle-flex-v-ce"  a:if="{{ isSuperAdministrator }}">
     <view class="jin flex-1" catchTap="onOpen" data-index="1">禁用</view>
     <view class="kai flex-1" catchTap="onOpen" data-index="2">开启</view>
   </view>

+ 36 - 10
pages/deploy/organization/organization.js

@@ -29,6 +29,7 @@ Page({
 				name: '已禁用'
 			}
 		],
+    isSuperAdministrator:false,
 	},
 	onLoad() {
 		that = this;
@@ -36,6 +37,7 @@ Page({
 			title: "组织架构"
 		});
 		this.setData({
+      isSuperAdministrator:app.globalData.isSuperAdministrator,
 			terr: [{
 				name: '全公司',
 				id: 0
@@ -47,9 +49,24 @@ Page({
 	},
 	//选择积分分类
 	bingIntegralType(e) {
+    var list = this.data.isItem ? this.data.userList : this.data.searchUser;
+    list.map(item => {
+				item.isChecked = false;
+		})
+		if (this.data.isItem) {
+			this.setData({
+				userList: list,
+			})
+		} else {
+			this.setData({
+				searchUser: list,
+			})
+		}
 		this.setData({
 			minuteIndex: e.detail.value,
+      isAllChecked:false
 		});
+
 	},
 	radioChange(e) {
 		var list = this.data.isItem ? this.data.userList : this.data.searchUser;
@@ -70,9 +87,14 @@ Page({
 						if (item.is_official == 1) {
 							item.isChecked = true;
 						}
-					} else {
-						item.isChecked = true;
-					}
+					}else if(this.data.minuteIndex == 2) {
+            if (item.is_official == 0) {
+							item.isChecked = true;
+						}
+					}else{
+            item.isChecked = true;
+          }
+
 				}
 			})
 		} else {
@@ -82,9 +104,13 @@ Page({
 						if (item.is_official == 1) {
 							item.isChecked = false;
 						}
-					} else {
-						item.isChecked = false;
-					}
+					} else if(this.data.minuteIndex == 2) {
+            if (item.is_official == 0) {
+							item.isChecked = false;
+						}
+					}else{
+            item.isChecked = false;
+          }
 				}
 			})
 		}
@@ -138,10 +164,10 @@ Page({
 		})
 	},
 	tbDd() {
-    // dd.navigateTo({
-    //   url: '../tb/tb'
-    // })
-    // return false;
+    dd.navigateTo({
+      url: '../tb/tb'
+    })
+    return false;
 
 		dd.confirm({
 			title: '温馨提示',

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

@@ -65,7 +65,7 @@
     </view>
   </block>
   <view a:else class="null">
-    <text class="fontColorB">未启动考勤设置,请前往电脑端(PC)钉钉设置</text>
+    <text class="fontColorB">未启用考勤设置,请前往电脑端-【设置】-【考勤积分】-【启用考勤设置】</text>
   </view>
   <!--<view class="flex-box li"><view class="li-left"><view>加班</view><view>每小时加{{data.ot_per_hour}}分</view></view></view><view class="flex-box li"><view class="li-left"><view>请假</view><view>每小时扣{{data.leave_per_hour}}分</view></view></view> -->
 </view>

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

@@ -1,6 +1,9 @@
 .radio {
   margin-bottom: 20rpx;
 }
+.bg{
+  background: #E4E7ED;
+}
 .main{
   padding: 0.24rem 0.32rem;
   font-size: 32rpx;

+ 1 - 1
pages/deploy/tb/tb.axml

@@ -9,7 +9,7 @@
             </view>
           </label>
         </radio-group>
-        <view class="userList"  catchTap="openSelect">
+        <view class="userList {{selectTbIndex!=4? 'bg':''}}"  catchTap="openSelect">
           <text a:if="{{ defaultSection.length==0 }}" class="fontColorC">请选择部门</text>
           <view a:else class="font-flex-word">{{deptNames}}</view>
         </view>

+ 19 - 7
pages/deploy/tb/tb.js

@@ -4,18 +4,18 @@ var animation;
 Page({
   data: {
     tbList: [{
-        id: 1,
+        id: 4,
         name: '仅同步指定部门内的人员信息(可多选)',
         kam: '该选择不会包含子部门人员,请确保选中需要同步的人员的直属部门',
         checked: true
       },
       {
-        id: 2,
+        id: 3,
         name: '仅同步部门信息和上下级关系',
         kam: '仅同步所有部门名称和上下级所属关系,但不同步人员信息'
       },
       {
-        id: 3,
+        id: 1,
         name: '同步全部部门和人员信息 ',
         kam: '同步全部信息所需时间较长,请关注同步成功后推送的工作通知'
       },
@@ -23,7 +23,7 @@ Page({
     defaultSection:[],
     popupCx: '',
     dept_ids:[],
-    selectTbIndex:1,
+    selectTbIndex:4,
   },
   onLoad(e) {
     that = this;
@@ -39,12 +39,21 @@ Page({
   },
     //抢任务
   formSubmit() {
+      
+      let data={
+        type:this.data.selectTbIndex,
+        dept_list:this.data.dept_ids.toString(),
+      }
+      if(this.data.selectTbIndex==4&&this.data.dept_ids.length==0){
+        app.globalData.showToast('请选择指定部门');
+        return false
+      }
       this.setData({ disabled: true })
-      app.$post("api/integral/task", { task_id: this.data.dataDetail.id }).then((res) => {
-        app.globalData.showToast('抢单成功!');
+      app.$post("api/ding/site_sync", data).then((res) => {
+        app.globalData.showToast('同步中,成功后将发送工作通知');
         setTimeout(() => {
           dd.navigateBack({ delta: 1 })
-        }, 1000);
+        }, 500);
       }).finally(() => {
         that.setData({ disabled: false })
       });
@@ -58,6 +67,9 @@ Page({
   },
   //选择弹窗
   openSelect(e) {
+    if(this.data.selectTbIndex!=4){
+      return false
+    }
     animation.translateY(0).step();
     that.setData({
       isShowType: 1,

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

@@ -469,6 +469,10 @@ Page({
         return;
       }
     }
+    items.ahead_award_point=Number(items.ahead_award_point);
+    items.ahead_award_point_limit=Number(items.ahead_award_point_limit);
+    items.timeout_deduction_point=Number(items.timeout_deduction_point);
+    items.timeout_deduction_point_limit=Number(items.timeout_deduction_point_limit);
     if (!items.ahead_award_point && items.ahead_award_point_limit) {
       this.showToast('设置提前奖分时,需同时设置每天奖分及奖分上限');
       return;

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

@@ -417,7 +417,10 @@ Page({
       this.showToast('请选择截止时间')
       return;
     }
-
+    items.ahead_award_point=Number(items.ahead_award_point);
+    items.ahead_award_point_limit=Number(items.ahead_award_point_limit);
+    items.timeout_deduction_point=Number(items.timeout_deduction_point);
+    items.timeout_deduction_point_limit=Number(items.timeout_deduction_point_limit);
     if (!items.ahead_award_point && items.ahead_award_point_limit) {
       this.showToast('设置提前奖分时,需同时设置每天奖分及奖分上限');
       return;

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

@@ -154,6 +154,6 @@
     <select-type defaultId="{{defaultRuleId}}" isGzType="{{isGzType}}" onConfirm="onSelectType" onClose="onClose" a:if="{{isShowType=='4'}}"/>
     <select-section-bottom defaultSection="{{defaultSection}}" onClose="onClose" onConfirm="onSelectSection" a:if="{{isShowType=='1'}}"/>
     <select-section-staff-two islead="{{true}}"  selectUser="{{reviewerObj}}" onClose="onClose" onConfirm="onSelectUser2" a:if="{{isShowType=='2'}}"/>
-    <select-section-staff  selectUser="{{employeeList}}" onClose="onClose" onConfirm="onSelectUser"  a:if="{{isShowType=='5'}}" />
+    <select-section-staff  selectUser="{{employeeList}}" onClose="onClose" isFill="{{false}}" onConfirm="onSelectUser"  a:if="{{isShowType=='5'}}" />
   </view>
 </view>

+ 4 - 0
pages/statistics/offerAreward/offerAreward.js

@@ -537,6 +537,10 @@ Page({
       }
       items.employee_ids=employee_ids.toString()
     }
+    items.ahead_award_point=Number(items.ahead_award_point);
+    items.ahead_award_point_limit=Number(items.ahead_award_point_limit);
+    items.timeout_deduction_point=Number(items.timeout_deduction_point);
+    items.timeout_deduction_point_limit=Number(items.timeout_deduction_point_limit);
     if (!items.ahead_award_point && items.ahead_award_point_limit) {
       this.showToast('设置提前奖分时,需同时设置每天奖分及奖分上限');
       return;

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

@@ -137,6 +137,6 @@
     <select-type defaultId="{{defaultRuleId}}" isGzType="{{isGzType}}" onConfirm="onSelectType" onClose="onClose" a:if="{{isShowType=='4'}}"/>
     <select-section-bottom defaultSection="{{defaultSection}}" onClose="onClose" onConfirm="onSelectSection" a:if="{{isShowType=='1'}}"/>
     <select-section-staff-two islead="{{true}}"  selectUser="{{reviewerObj}}" onClose="onClose" onConfirm="onSelectUser2" a:if="{{isShowType=='2'}}"/>
-    <select-section-staff  selectUser="{{employeeList}}" onClose="onClose" onConfirm="onSelectUser"  a:if="{{isShowType=='5'}}" />
+    <select-section-staff  selectUser="{{employeeList}}"  isFill="{{false}}" onClose="onClose" onConfirm="onSelectUser"  a:if="{{isShowType=='5'}}" />
   </view>
 </view>

+ 5 - 1
pages/statistics/offerAreward_set/offerAreward_set.js

@@ -468,7 +468,10 @@ Page({
       }
       items.employee_ids=employee_ids.toString()
     }
-
+    items.ahead_award_point=Number(items.ahead_award_point);
+    items.ahead_award_point_limit=Number(items.ahead_award_point_limit);
+    items.timeout_deduction_point=Number(items.timeout_deduction_point);
+    items.timeout_deduction_point_limit=Number(items.timeout_deduction_point_limit);
     if (!items.ahead_award_point && items.ahead_award_point_limit) {
       this.showToast('设置提前奖分时,需同时设置每天奖分及奖分上限');
       return;
@@ -483,6 +486,7 @@ Page({
       this.showToast('设置逾期扣分时,需同时设置每天扣分及扣分上限');
       return;
     }
+
     if(!items.task_remark){
       delete items.task_remark
     }

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

@@ -248,6 +248,7 @@ Page({
   },
   //选择部门
   onConfirmTissue(data) {
+    console.log(data)
     this.setData({ dept_id: data.id, page: 1, TissueVal: data.name })
     this.getData();
   },

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

@@ -243,9 +243,9 @@ Page({
           success: (res) => {
             if (res.statusCode == 200) {
               if (files.length > 0) {
-                files.push('http://cdn.intesys.g107.com/' + key)
+                files.push('https://integralsys.oss-cn-shenzhen.aliyuncs.com/' + key)
               } else {
-                files = ['http://cdn.intesys.g107.com/' + key];
+                files = ['https://integralsys.oss-cn-shenzhen.aliyuncs.com/' + key];
               }
               that.setData({
                 [files_box]: files