Browse Source

最后一班

347617796@qq.com 4 years ago
parent
commit
72728a3029

+ 1 - 1
Component/img-box/index.acss

@@ -5,7 +5,7 @@
   background: #26A2FF;
   color: #fff;
   text-align: center;
-  line-height: 76rpx;
+  line-height: 80rpx;
   font-size: 24rpx;
 }
 .img-url{

+ 1 - 1
Component/img-box/index.js

@@ -26,7 +26,7 @@ Component({
   methods: {
     setName(){
           var str=this.props.name;
-          var name=str.substring(str.length-2);
+          var name=str.substr(str.length-2);
           this.setData({
             userName:name
           })

+ 0 - 1
Component/selectDate/selectDate.js

@@ -28,7 +28,6 @@ Component({
               isShow:this.props.isShow
           })
     }
-    console.log(this.props.defaultDate)
   },
   didUpdate() { },
   didUnmount() { },

+ 9 - 3
Component/selectDate_two/selectDate_two.axml

@@ -8,18 +8,24 @@
     </view>
     <view class="data-main">
         <block a:if="{{dateIndex=='1'}}">
-            <text class="dateVal" onTap="selectYear">{{year}}</text>
+              <picker onChange="selectYear" value="{{yearIndex}}" range="{{yearArr}}">
+                  <view class="dateVal">{{yearArr[yearIndex]}}</view>
+              </picker>
+            <!-- <text class="dateVal" onTap="selectYear">{{year}}</text> -->
         </block>
         <block a:if="{{dateIndex=='3'}}">
             <text class="dateVal" onTap="selectDate">{{month}}</text>
         </block>
         <block a:if="{{dateIndex=='2'}}">
             <view class="flex-box flex-center-center">
-               <text class="dateVal" onTap="selectDay">{{jdYear}}</text>
+               <picker onChange="selectYear2" value="{{jdYearIndex}}" range="{{yearArr}}">
+                  <view class="dateVal">{{yearArr[jdYearIndex]}}</view>
+              </picker>
+               <!-- <text class="dateVal" onTap="selectDay">{{jdYear}}</text> -->
                <text class="fontColorT" style="margin:0 20rpx;">--</text>
                <picker onChange="setjdji" value="{{jdji}}" range="{{jdArr}}">
                   <view class="dateVal">{{jdArr[jdji]}}</view>
-                </picker>
+               </picker>
                <!-- <text class="dateVal" onTap="selectDay2">{{jdji}}</text> -->
             </view>
         </block>

+ 39 - 19
Component/selectDate_two/selectDate_two.js

@@ -8,7 +8,10 @@ Component({
     month: app.globalData.month,//月
     jdYear: app.globalData.year,//季度年
     jdji: 0,//季度季
-    jdArr: ['一季度', '二季度', '三季度', '四季度']
+    jdArr: ['一季度', '二季度', '三季度', '四季度'],
+    yearIndex:0,
+    yearArr:app.globalData.yearArr,
+    jdYearIndex:0,
   },
   props: {
     onClose: (data) => console.log(data),
@@ -20,20 +23,31 @@ Component({
   },
   didMount() {
     this.setData({
-      isShow: this.props.isShow
+      isShow: this.props.isShow,
     })
     if(this.props.dateObj.type){
       this.setData({
         dateIndex:this.props.dateObj.type,
       })
       if(this.props.dateObj.type==1){
-          this.setData({
-            year:this.props.dateObj.date,
+          this.data.yearArr.forEach((item,index)=>{
+            if(this.props.dateObj.date==item){
+                this.setData({
+                  yearIndex:index,
+                })
+            }
           })
       }else if(this.props.dateObj.type==2){
+          var data=String(this.props.dateObj.date);
+          this.data.yearArr.forEach((item,index)=>{
+            if(data.substr(0,4)==item){
+                this.setData({
+                  jdYearIndex:index,
+                })
+            }
+          })
           this.setData({
-            jdYear:this.props.dateObj.date.substr(0,4),
-            jdji:this.props.dateObj.date.substr(this.props.dateObj.date.length-1,1)-1
+            jdji:data.substr(data.length-1,1)-1
           })
       }else{
           this.setData({
@@ -45,6 +59,16 @@ Component({
   didUpdate() { },
   didUnmount() { },
   methods: {
+    selectYear2(e) {
+      this.setData({
+        jdYearIndex: e.detail.value,
+      });
+    },
+    selectYear(e) {
+      this.setData({
+        yearIndex: e.detail.value,
+      });
+    },
     setjdji(e) {
       this.setData({
         jdji: e.detail.value,
@@ -56,13 +80,20 @@ Component({
         case "1":
           obj = {
             type: this.data.dateIndex,
-            date: this.data.year
+            date: this.data.yearArr[this.data.yearIndex]
           }
           break
         case "2":
+          var year=this.data.yearArr[this.data.jdYearIndex];
+          var num=this.data.jdji;
+          num++;
+          let arrNew=new Array()
+          arrNew.push(year)
+          arrNew.push(num)
+          let strNew=arrNew.join('')
           obj = {
             type: this.data.dateIndex,
-            date: this.data.jdYear+''+(this.data.jdji+1)
+            date:parseInt(strNew)
           }
           break
         case "3":
@@ -104,17 +135,6 @@ Component({
         },
       });
     },
-    selectYear() {
-      dd.datePicker({
-        format: 'yyyy',
-        currentDate: this.data.year,
-        success: (res) => {
-          this.setData({
-            year: res.date
-          })
-        },
-      });
-    },
     activeDate(e) {
       this.setData({ dateIndex: e.target.dataset.index })
     },

+ 2 - 1
Component/selectSection/selectSection.js

@@ -19,7 +19,8 @@ Component({
     that = this;
     this.setData({
       isShow:this.props.isShow,
-      terr:[{name: '全部', id:0}]
+      terr:[{name: '全部', id:0}],
+      selectTissue:{name:'全公司',id:''}
     })
     this.getBmData();
   },

+ 11 - 5
Component/selectSectionStaff/selectSectionStaff.js

@@ -203,10 +203,16 @@ Component({
           all_user_list:[]
       })
       app.$get("api/employee/list", { dept_id: dept_id }).then((res) => {
-        var list = res.data.data.list;
+        var list = res.data.data.list||[];
         var selectUserId = this.data.selectUserId;
         var arr=[];
-        list.map((item) => {
+        var userList=[];
+        list.forEach(item=>{
+          if(item.is_official==1){
+              userList.push(item)
+          }
+        })
+        userList.map((item) => {
           item.checked = false;
           if (selectUserId.length > 0) {
             selectUserId.forEach(item2 => {
@@ -217,15 +223,15 @@ Component({
           }
         })
         that.data.userData.map((item)=>{
-              list.map((item2)=>{
+              userList.map((item2)=>{
                   if(item.id==item2.id){
                       arr.push(item2);
                   }
             })
         })
         this.setData({
-          userList:that.props.isLeadership? arr:list,
-          all_user_list:that.props.isLeadership? arr:list,
+          userList:that.props.isLeadership? arr:userList,
+          all_user_list:that.props.isLeadership? arr:userList,
         })
       })
     },

+ 16 - 7
Component/selectStaff/selectStaff.js

@@ -51,12 +51,21 @@ Component({
       app.$get("api/employee/list", { dept_id: 0, keywords: keywords }).then((res) => {
         var list = res.data.data.list;
         var arr = this.props.defaultUser;
-        var defaultUser=arr.length>1? arr.split(","):arr;
-        var ids=[];
-        list.map(item=>{
+        if(typeof(arr)=='string'){
+          //  arr=arr.substr(1, arr.length-2);
+           arr= arr.split(',');
+        }
+        var ids=[],userList=[];
+        list.forEach(item=>{
+          if(item.is_official==1){
+              userList.push(item)
+          }
+        })
+
+        userList.map(item=>{
           item.checked = false;
-          if (defaultUser.length > 0) {
-            defaultUser.forEach(item2 => {
+          if (arr.length > 0) {
+            arr.forEach(item2 => {
               if (item.id == item2) {
                 item.checked = true;
                 ids.push(item);
@@ -65,8 +74,8 @@ Component({
           }
         })
         this.setData({
-          userList: list,
-          all_user_list: res.data.data.list,
+          userList: userList,
+          all_user_list: userList,
           selectUserId:ids.length>0? ids:[]
         })
       })

+ 10 - 6
app.js

@@ -4,6 +4,11 @@ import { formatTime, arrRemoveObj,getTypeItem } from './utils/util'
 // const baseUrl = "https://test-ding.g107.com/";//测试
 const baseUrl = "https://ding.insys.g107.com/";//正式
 var that;
+var yearArr=[];
+var year=formatTime(new Date()).year;
+for(var i=2018;i<=year;i++){
+  yearArr.push(i);
+}
 App({
   //自定义全局变量
   globalData: {
@@ -14,11 +19,12 @@ App({
     day: formatTime(new Date()).day,//当前日
     types:[],
     userData: '',
-    token:'',
-    // token:' eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC90ZXN0LWRpbmcuZzEwNy5jb21cL2FwaVwvdGVzdCIsImlhdCI6MTU5Nzg4NjUyOSwiZXhwIjoxNTk4NDg2NTI5LCJuYmYiOjE1OTc4ODY1MjksImp0aSI6IktvRmR2bk1VVThaN2poWjkiLCJzdWIiOjEsInBydiI6ImNhNjQ4OWQ1MGYyNDA3YTY3ODMwZTgwOTBkMDE0ODgzNTY4NTk2MmIiLCJyb2xlIjoiZW1wbG95ZWUifQ.1gjqd9WgrK7N_ugz0ljIniScr8fCBucFzNJE3Cjo1sg',
+    // token:'',
+    token:' eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvZGluZy5pbnN5cy5nMTA3LmNvbVwvYXBpXC9kaW5nXC9sb2dpbiIsImlhdCI6MTYwMDMxNDM0NywiZXhwIjoxNjAwOTE0MzQ3LCJuYmYiOjE2MDAzMTQzNDcsImp0aSI6IjgwMFJUS0J4RllIbnU5M3EiLCJzdWIiOjIsInBydiI6ImNhNjQ4OWQ1MGYyNDA3YTY3ODMwZTgwOTBkMDE0ODgzNTY4NTk2MmIiLCJyb2xlIjoiZW1wbG95ZWUifQ.E1RiQ6uMRICoL-2qDTeh5j5y-QLaUsGGs6PYLm-_1m8',
     ALIOSS_URL: 'https://integralsys.oss-cn-shenzhen.aliyuncs.com',
     imgHttpUrl:'https://intesys.cms.g107.com/integral.php/Api/get_signature',
     corpId:'',
+    yearArr:yearArr,
   },
   //获取积分类型
   getTypes() {
@@ -106,11 +112,9 @@ App({
             if(user.is_official==1){
               that.globalData.token = token;
               that.globalData.userData = user;
-              callBack();
+              callBack(true);
             }else{
-              dd.navigateTo({
-                url:'./pages/workbench/noJurisdiction'
-              })
+              callBack(false);
             }
           } else {
             that.globalData.showToast(res.msg)

+ 0 - 2
pages/deploy/integralRule/integralRule.js

@@ -62,9 +62,7 @@ Page({
     },
   //点击一级
   activeTree(e) {
-    console.log(e);
     var item = e.target.dataset.item
-    var item_list = this.data.allItems;
     var terr = this.data.terr;
     terr.push(item)
     this.setData({

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

@@ -10,7 +10,7 @@ Page({
   getData(){
     app.$get("api/ad/info").then((res) => {
       this.setData({
-        data:res.data.data.config
+        data:res.data.data
       })
     })
   }

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

@@ -45,7 +45,6 @@ Page({
   },
     //上啦加载
   onScrollToLower() {
-    console.log(this.data.isData);
     if(!that.data.isData){
       this.setData({ page: ++that.data.page })
       this.getData(true);

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

@@ -10,6 +10,7 @@ Page({
 
     isPx: true,
     id: '',
+    page:1,
   },
   onLoad(e) {
     that = this;

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

@@ -118,7 +118,6 @@ Page({
         id: res.data.data.id,
         isCompile: true
       })
-      console.log(this.data.selectUser)
     })
   }
 });

+ 2 - 2
pages/statistics/integralEvent/integralEvent.js

@@ -166,8 +166,8 @@ Page({
           str += item.name + ','
           arr.push(item.id);
         })
-        // var employee_ids = arr.join(',');
-        this.setData({ staffVal: str.substring(0, str.length - 1), employee_ids:JSON.stringify(arr), page: 1 })
+        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 })
       }

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

@@ -16,7 +16,7 @@
   <view class="fontColorF" style="font-szie:20rpx;padding:10rpx 28rpx;">排名不包含初始分和工龄分</view>
   <view class="main scroll">
     <scroll-view class="scroll" scroll-y="{{true}}" a:if="{{list.length>0}}" onScrollToLower="onScrollToLower">
-      <view a:for="{{list}}" catchTap="openDetail" data-item="{{item}}" class="flex-box flex-v-ce item border-bottom">
+      <view a:for="{{list}}" data-item="{{item}}" class="flex-box flex-v-ce item border-bottom">
         <view a:if="{{index==0}}" class="index">
           <image mode="scaleToFill" src="../../../image/1.png"></image>
         </view>

+ 4 - 6
pages/statistics/sectionRanking/sectionRanking.js

@@ -34,14 +34,12 @@ Page({
     dd.setNavigationBar({ title: "部门排名" });
     this.getData();
   },
-  getData(is) {
+  getData(is) {  
     var data = {
       pt_id:app.getTypesItem('BF').id,
       dept_id:that.data.dept_id,
       page: that.data.page,
       rule_id: that.data.rule_id,
-      // month:that.data.month,
-      // quarter:that.data.quarter,
       sort:that.data.sort,
       position:that.data.position,
       page_size:10
@@ -67,7 +65,7 @@ Page({
           list: list.concat(data)
         })
       } else {
-                this.setData({list:[]});
+        this.setData({list:[]});
         this.setData({
           list: data,
           isData: false
@@ -123,8 +121,8 @@ Page({
       })
     } else if(data.type == '2'){
       this.setData({
-        selectDateVal: data.date+'季度',
-        quarter:data.date,
+        selectDateVal:data.date+'季度',
+        quarter: data.date,
         dateIndex:data.type
       })
     }else{

+ 10 - 4
pages/workbench/index/index.js

@@ -15,10 +15,16 @@ Page({
       that.getIncidentLsit();
       that.getIncidentNum();
     } else {
-      app.login(app.globalData.corpId, function () {
-        that.getUserData();
-        that.getIncidentLsit();
-        that.getIncidentNum();
+      app.login(app.globalData.corpId, function (is) {
+        if(is){
+          that.getUserData();
+          that.getIncidentLsit();
+          that.getIncidentNum();
+        }else{
+          dd.reLaunch({
+            url:'../noJurisdiction/noJurisdiction'
+          })
+        }
       })
     }
   },

+ 6 - 1
pages/workbench/noJurisdiction/noJurisdiction.axml

@@ -1,5 +1,10 @@
 <view>
   <view class="noJ">
-      您当前无权限进入系统,请联系企业管理员授权开通使用
+      <view>
+        您当前无权限进入系统,请联系企业
+      </view>
+      <view>
+        管理员授权开通使用
+      </view>
   </view>
 </view>

+ 3 - 3
pages/workbench/prize_buckle/prize_buckle.axml

@@ -38,7 +38,7 @@
     <view class="headed-box margin-bottom">
       <view class="flex-box flex-v-ce">
         <view class="title flex-1" style="padding-bottom:0rpx">月奖扣执行情况</view>
-        <view class="fontColorT text1">奖</view>
+        <view class="fontColorT text1">奖</view>
         <view class="fontColorT text2">扣分</view>
       </view>
       <view class="f2-chart">
@@ -48,8 +48,8 @@
     <view class="headed-box margin-bottom">
       <view class="flex-box flex-v-ce">
         <view class="title flex-1" style="padding-bottom:0rpx">月奖扣人次</view>
-        <view class="fontColorT text1">奖</view>
-        <view class="fontColorT text2">扣分</view>
+        <view class="fontColorT text1">奖分人次</view>
+        <view class="fontColorT text2">扣分人次</view>
       </view>
       <view class="f2-chart">
         <f2 onInit="onInitChart2"></f2>

+ 8 - 4
pages/workbench/prize_buckle/prize_buckle.js

@@ -89,8 +89,8 @@ Page({
       dd.setNavigationBar({ title: data.name });
       var ratio = task.reward.point === 0 || task.deduction.point === 0 ? '-' : `${task.ratio.ratio}:1`
       var target_ratio = task.ratio.target_ratio <= 0 ? '0:0' : `${task.ratio.target_ratio}:1`
-      if(data.task.reward.point>data.task.reward.target_point&&data.task.deduction.point>data.task.deduction.target_point&&data.task.exec.count>data.task.exec.target_count){
-          if(task.ratio.ratio>task.ratio.target_ratio){
+      if(data.task.reward.point>=data.task.reward.target_point&&data.task.deduction.point>=data.task.deduction.target_point&&data.task.exec.count>=data.task.exec.target_count){
+          if(task.ratio.ratio>=task.ratio.target_ratio){
               this.setData({
                 isDb: true
               }) 
@@ -123,8 +123,12 @@ Page({
       })
       var charData = rewardArr.concat(deductArr);
       var charData2 = rewardArrCount.concat(deductArrCount);
-      chart1.changeData(charData);
-      chart2.changeData(charData2);
+    //  console.log(charData)
+    //   console.log(charData2)
+      setTimeout(() => {
+        chart1.changeData(charData);
+        chart2.changeData(charData2);
+      }, 1000);
       that.setData({
         img_url: img_url,
         name: name