Просмотр исходного кода

考勤管理添加打卡策略

boomEgg 5 лет назад
Родитель
Сommit
6e4f1d703a

+ 11 - 7
o2web/source/x_component_Attendance/MyIndex.js

@@ -17,7 +17,7 @@ MWF.xApplication.Attendance.MyIndex = new Class({
         //"leaveEarly":"#fe8d03", //橙色,早退
         "noSign":"#ee807f", //粉红色,未签到
         "appealSuccess" : "#2ac497", //黄绿色,申诉通过
-        "lackOfTime" : "#dec674",//工时不足人次
+        //"lackOfTime" : "#dec674",//工时不足人次
         "abNormalDuty" : "#fedcbd"//异常打卡人次
     },
     initialize: function(node, app, actions, options){
@@ -705,7 +705,7 @@ MWF.xApplication.Attendance.MyIndex = new Class({
             late : 0,
             appealSuccess : 0,
             //leaveEarly : 0,
-            lackOfTime : 0,
+            //lackOfTime : 0,
             abNormalDuty : 0,
             normal : 0
         };
@@ -757,9 +757,9 @@ MWF.xApplication.Attendance.MyIndex = new Class({
             }else if( this.isAbsent(d,"pm")){
                     totals.noSign = totals.noSign + 0.5;
                     events.push( {  text: '缺勤', start: d.recordDateString,  backgroundColor :this.statusColor.noSign } )
-            }else if( this.isLackOfTime(d,"pm")){
+           /* }else if( this.isLackOfTime(d,"pm")){
                 events.push( {  text: this.lp.lackOfTime + ',' + this.lp.signTime + ':' + d.offDutyTime, start: d.recordDateString,  backgroundColor :this.statusColor.lackOfTime } );
-                totals.lackOfTime = totals.lackOfTime + 0.5
+                totals.lackOfTime = totals.lackOfTime + 0.5*/
             }else if( this.isAbnormalDuty(d,"pm")){
                 events.push( {  text: this.lp.abNormalDuty + ',' + this.lp.signTime + ':' + d.offDutyTime, start: d.recordDateString,  backgroundColor :this.statusColor.abNormalDuty } );
                 totals.abNormalDuty = totals.abNormalDuty + 0.5
@@ -768,8 +768,12 @@ MWF.xApplication.Attendance.MyIndex = new Class({
             }else if( this.isWeekend(d, "pm") ){
                 return;
             }else{
-                totals.normal = totals.normal + 0.5;
-                events.push( {  text: '出勤,打卡时间:'+ d.offDutyTime, start: d.recordDateString,  backgroundColor :this.statusColor.normal } )
+                console.log("============")
+                if(!!d.offDutyTime){
+                    totals.normal = totals.normal + 0.5;
+                    events.push( {  text: '出勤,打卡时间:'+ d.offDutyTime, start: d.recordDateString,  backgroundColor :this.statusColor.normal } )
+                }
+
             }
         }.bind(this) );
         this.totalData = totals;
@@ -783,7 +787,7 @@ MWF.xApplication.Attendance.MyIndex = new Class({
             noSign : (!totals.noSign || !total) ? 0 : ((totals.noSign/total * 100).toFixed(2)  + "%"),
             late : (!totals.late || !total) ? 0 : ((totals.late/total * 100).toFixed(2) + "%"),
             //leaveEarly : (!totals.leaveEarly || !total) ? 0 : ((totals.leaveEarly/total* 100).toFixed(2)  + "%"),
-            lackOfTime : (!totals.lackOfTime || !total) ? 0 : ((totals.lackOfTime/total * 100).toFixed(2) + "%"),
+            //lackOfTime : (!totals.lackOfTime || !total) ? 0 : ((totals.lackOfTime/total * 100).toFixed(2) + "%"),
             abNormalDuty : (!totals.abNormalDuty || !total) ? 0 : ((totals.abNormalDuty/total* 100).toFixed(2)  + "%"),
             normal : (!totals.normal || !total) ? 0 : ((totals.normal/total* 100).toFixed(2)  + "%"),
             appealSuccess  : (!totals.appealSuccess || !total) ? 0 : ((totals.appealSuccess/total * 100).toFixed(2)  + "%")

+ 16 - 5
o2web/source/x_component_Attendance/ScheduleExplorer.js

@@ -2,8 +2,8 @@ MWF.xDesktop.requireApp("Template", "Explorer", null, false);
 MWF.xDesktop.requireApp("Attendance", "Explorer", null, false);
 MWF.xDesktop.requireApp("Selector", "package", null, false);
 MWF.xApplication.Attendance.ScheduleExplorer = new Class({
-	Extends: MWF.xApplication.Attendance.Explorer,
-	Implements: [Options, Events],
+    Extends: MWF.xApplication.Attendance.Explorer,
+    Implements: [Options, Events],
 
     initialize: function(node, app, actions, options){
         this.setOptions(options);
@@ -54,9 +54,20 @@ MWF.xApplication.Attendance.ScheduleExplorer.View = new Class({
         var schedule = new MWF.xApplication.Attendance.ScheduleExplorer.Schedule(this.explorer);
         schedule.create();
     },
+    copyObject: function(obj){
+        if(typeof obj != 'object'){
+            return obj;
+        }
+        var newobj = new Object(null);
+        for ( var attr in obj) {
+            newobj[attr] = this.copyObject(obj[attr]);
+        }
+        return newobj;
+    },
     _openDocument: function( documentData ){
+        var data =this.copyObject(documentData);
 
-        var schedule = new MWF.xApplication.Attendance.ScheduleExplorer.Schedule(this.explorer, documentData );
+        var schedule = new MWF.xApplication.Attendance.ScheduleExplorer.Schedule(this.explorer, data );
 
         schedule.edit();
     }
@@ -84,7 +95,7 @@ MWF.xApplication.Attendance.ScheduleExplorer.Schedule = new Class({
     _createTableContent: function(){
         var lp = this.app.lp.schedule;
         var signProxy = this.data.signProxy;
-
+console.log(signProxy)
         var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>"+
             "<tr><td colspan='2' styles='formTableHead'>"+lp.setSchedule+"</td></tr>" +
             "<tr><td styles='formTabelTitle' lable='unitName'></td>"+
@@ -124,7 +135,7 @@ MWF.xApplication.Attendance.ScheduleExplorer.Schedule = new Class({
                             "border": "1px solid rgb(153, 153, 153)",
                             "border-radius": "3px",
                             "box-shadow": "rgb(204, 204, 204) 0px 0px 6px",
-                           "min-height": "26px",
+                            "min-height": "26px",
                             "overflow": "hidden"
                         },event :{
                             "change":function(){

+ 3 - 0
o2web/source/x_component_Attendance/lp/zh-cn.js

@@ -88,6 +88,9 @@ MWF.xApplication.Attendance.LP = {
 			"2":["午休开始时间不得早于上班时间","午休结束时间不得早于午休开始时间","下班时间不得早于午休结束时间"],
 			"3":["上午下班时间不得早于上班时间","下午上班时间不得早于上午下班时间","下班时间不得早于下午上班时间"]
 		},
+		"absenceStartTime":"缺勤起算时间",
+		"leaveEarlyStartTimeMorning":"上午早退起算时间",
+		"lateStartTimeAfternoon":"下午上班迟到起算时间",
 		"signProxy":{
 			"name":"打卡策略",
 			"select":{