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

Merge branch 'fix/attendance_js' into 'wrdp'

考勤,前端新增导出按钮,前端新增服务地址配置,前端新增时间选择框

See merge request o2oa/o2oa!2591
胡起 5 лет назад
Родитель
Сommit
9e0b0f831f

+ 25 - 7
o2web/source/o2_core/o2/xAction/services/x_attendance_assemble_control.js

@@ -3,9 +3,9 @@ MWF.xAction.RestActions.Action["x_attendance_assemble_control"] = new Class({
     getUUID: function(success){
         var id = "";
         this.action.invoke({"name": "getId","async": false, "parameter": {"count": "1"}, "success": function(ids){
-            id = ids.data[0];
-            if (success) success(id);
-        },	"failure": null});
+                id = ids.data[0];
+                if (success) success(id);
+            },	"failure": null});
         return id;
     },
     exportSelfHoliday: function(startdate, enddate, success, failure){
@@ -13,7 +13,7 @@ MWF.xAction.RestActions.Action["x_attendance_assemble_control"] = new Class({
             var url = this.action.actions.exportSelfHoliday.uri;
             url = url.replace("{startdate}", startdate);
             url = url.replace("{enddate}", enddate);
-            window.open(o2.filterUrl(this.action.address+url , "_blank"));
+            window.open(this.action.address+url , "_blank");
         }.bind(this));
     },
     uploadAttachment: function(success, failure, formData, file){
@@ -23,18 +23,36 @@ MWF.xAction.RestActions.Action["x_attendance_assemble_control"] = new Class({
         this.action.getActions(function(){
             var url = this.action.actions.getAttachmentStream.uri;
             url = url.replace("{id}", encodeURIComponent(id));
-            window.open(o2.filterUrl(this.action.address+url));
+            window.open(this.action.address+url);
         }.bind(this));
     },
-    exportAbnormalAttachment: function(year, month, success, failure){
+    exportAbnormalAttachment: function(year, month, stream){
         this.action.getActions(function(){
             var url = this.action.actions.exportAbnormalAttachment.uri;
             url = url.replace("{year}", year);
             url = url.replace("{month}", month);
-            window.open(o2.filterUrl(this.action.address+url , "_blank"));
+            url = url.replace("{stream}", stream);
+            window.open(this.action.address+url , "_blank");
         }.bind(this));
         //this.action.invoke({"name": "exportAbnormalAttachment", "parameter": {"year": year, "month": month },"success": success,"failure": failure});
     },
+    //统计导出
+    detailsExportStream: function(q_topUnitName, q_unitName,q_empName,cycleYear,cycleMonth,q_date,isAbsent,isLackOfTime,isLate, stream){
+        this.action.getActions(function(){
+            var url = this.action.actions.detailsExportStream.uri;
+            url = url.replace("{q_topUnitName}", q_topUnitName);
+            url = url.replace("{q_unitName}", q_unitName);
+            url = url.replace("{q_empName}", q_empName);
+            url = url.replace("{cycleYear}", cycleYear);
+            url = url.replace("{cycleMonth}", cycleMonth);
+            url = url.replace("{q_date}", q_date);
+            url = url.replace("{isAbsent}", isAbsent);
+            url = url.replace("{isLackOfTime}", isLackOfTime);
+            url = url.replace("{isLate}", isLate);
+            url = url.replace("{stream}", stream);
+            window.open(this.action.address+url , "_blank");
+        }.bind(this));
+    },
     listHolidayByYearAndName: function(year,name,success, failure, async){
         this.action.invoke({"name": "listHolidayFilter","data": {"q_Year": year, "q_Name" : name },"async": async, "success": success,	"failure": failure});
     },

+ 6 - 3
o2web/source/o2_core/o2/xAction/services/x_attendance_assemble_control.json

@@ -44,13 +44,13 @@
   "listAttachmentInfo" : {"uri" : "/jaxrs/attendanceimportfileinfo/list/all"},
   "deleteAttachment" : {"uri":"/jaxrs/attendanceimportfileinfo/{id}","method": "DELETE"},
   "getAttachmentInfo" : {"uri":"/jaxrs/attendanceimportfileinfo/{id}"},
-//  "importAttachment" : {"uri":"/jaxrs/fileimport/import/{file_id}"},
-//  "checkAttachment" : {"uri":"/jaxrs/fileimport/check/{file_id}"},
+  //  "importAttachment" : {"uri":"/jaxrs/fileimport/import/{file_id}"},
+  //  "checkAttachment" : {"uri":"/jaxrs/fileimport/check/{file_id}"},
   "getImportStatus" : {"uri":"/jaxrs/fileimport/getStatus/{file_id}"},
   "getImportStatusAll" : {"uri":"/jaxrs/fileimport/getStatus/all"},
   "getImportStatusDetail" : {"uri":"/jaxrs/fileimport/getStatus/{file_id}/detail"},
 
-  "exportAbnormalAttachment" : {"uri":"/jaxrs/file/export/abnormaldetails/year/{year}/month/{month}/stream/true", "method": "GET"},
+  "exportAbnormalAttachment" : {"uri":"/jaxrs/file/export/abnormaldetails/year/{year}/month/{month}/stream/{stream}", "method": "GET"},
 
   "listDetail" : {"uri":"/jaxrs/attendancedetail/list/all"},
   "getDetail" : {"uri":"/jaxrs/attendancedetail/{id}"},
@@ -176,5 +176,8 @@ URL:x_attendance_assemble_control/jaxrs/attendancedetail/filter/list/{id}/prev
   "saveWorkplace" : {"uri":"/jaxrs/workplace", "method": "POST"},
   "deleteWorkplace" : {"uri":"/jaxrs/workplace/{id}","method": "DELETE"},
 
+  //统计导出
+  "detailsExportStream" : {"uri" : "/jaxrs/file/export/filter/{q_topUnitName}/{q_unitName}/{q_empName}/{cycleYear}/{cycleMonth}/{q_date}/{isAbsent}/{isLackOfTime}/{isLate}/stream/{stream}", "method": "GET"},
+
   "clazz": "x_attendance_assemble_control"
 }

+ 27 - 3
o2web/source/x_component_Attendance/PeopleDetail.js

@@ -10,8 +10,8 @@ MWF.xApplication.Attendance.PeopleDetail = new Class({
     initialize: function(node, app, actions, options){
         this.setOptions(options);
         this.app = app;
-        this.path = "../x_component_Attendance/$PeopleDetail/";
-        this.cssPath = "../x_component_Attendance/$PeopleDetail/"+this.options.style+"/css.wcss";
+        this.path = "/x_component_Attendance/$PeopleDetail/";
+        this.cssPath = "/x_component_Attendance/$PeopleDetail/"+this.options.style+"/css.wcss";
         this._loadCss();
 
         this.actions = actions;
@@ -126,6 +126,7 @@ MWF.xApplication.Attendance.PeopleDetail.Explorer = new Class({
             "    <td styles='filterTableTitle' lable='isLackOfTime'></td>"+
             "    <td styles='filterTableValue' item='isLackOfTime'></td>" +
             "    <td styles='filterTableValue' item='action'></td>" +
+            "    <td styles='filterTableValue' item='export'></td>" +
             "</tr>" +
             "</table>";
         this.fileterNode.set("html",html);
@@ -185,7 +186,30 @@ MWF.xApplication.Attendance.PeopleDetail.Explorer = new Class({
                             }
                             this.loadView( result );
                         }.bind(this)
-                    }}
+                    }},
+                    export : { "value" : "导出", type : "button", className : "filterButton", event : {
+                            click : function(){
+                                var result = this.form.getResult(true,",",true,true,false);
+                                if( !result )return;
+                                debugger;
+                                if( !result.q_topUnitName )result.q_topUnitName = "0";
+                                if( !result.q_unitName)result.q_unitName = "0";
+                                if( !result.q_empName)result.q_empName = "0";
+                                if( !result.cycleYear )result.cycleYear = "0";
+                                if( !result.cycleMonth )result.cycleMonth = "0";
+                                if( result.date && result.date !="" ){
+                                    result.q_date =  result.cycleYear + "-" + result.cycleMonth + "-" + result.date;
+                                }else{
+                                    result.q_date ="0";
+                                }
+                                //111
+                                if( !result.isAbsent )result.isAbsent = "0";
+                                if( !result.isLackOfTime  )result.isLackOfTime = "0";
+                                if( !result.isLate )result.isLate = "0";
+                                debugger;
+                                this.actions.detailsExportStream(result.q_topUnitName,result.q_unitName,result.q_empName,result.cycleYear,result.cycleMonth,result.q_date,result.isAbsent,result.isLackOfTime,result.isLate,true);
+                            }.bind(this)
+                        }}
                 }
             }, this.app, this.css);
             this.form.load();

+ 9 - 3
o2web/source/x_component_Attendance/SelfHoliday.js

@@ -8,8 +8,8 @@ MWF.xApplication.Attendance.SelfHoliday = new Class({
     initialize: function(node, app, actions, options){
         this.setOptions(options);
         this.app = app;
-        this.path = "../x_component_Attendance/$SelfHoliday/";
-        this.cssPath = "../x_component_Attendance/$SelfHoliday/"+this.options.style+"/css.wcss";
+        this.path = "/x_component_Attendance/$SelfHoliday/";
+        this.cssPath = "/x_component_Attendance/$SelfHoliday/"+this.options.style+"/css.wcss";
         this._loadCss();
 
         this.actions = actions;
@@ -40,7 +40,7 @@ MWF.xApplication.Attendance.SelfHoliday = new Class({
     },
     _loadFilterContent : function(){
         var _self = this;
-        var html = "<table bordr='0' cellpadding='5' cellspacing='0' styles='formTable' width='950'>"+
+        var html = "<table bordr='0' cellpadding='5' cellspacing='0' styles='formTable' width='1350'>"+
             "<tr>" +
             "    <td styles='formTableTitle' lable='q_topUnitName'></td>"+
             "    <td styles='formTableValue' item='q_topUnitName'></td>"+
@@ -48,6 +48,10 @@ MWF.xApplication.Attendance.SelfHoliday = new Class({
             "    <td styles='formTableValue' item='q_unitName'></td>"+
             "    <td styles='formTableTitle' lable='q_empName'></td>"+
             "    <td styles='formTableValue' item='q_empName'></td>"+
+            "    <td styles='formTableTitle' lable='startdateString'></td>"+
+            "    <td styles='formTableValue' item='startdateString'></td>"+
+            "    <td styles='formTableTitle' lable='enddateString'></td>"+
+            "    <td styles='formTableValue' item='enddateString'></td>"+
             "    <td styles='formTableValue' item='action'></td>"+
             "</tr>" +
             "</table>";
@@ -61,6 +65,8 @@ MWF.xApplication.Attendance.SelfHoliday = new Class({
                     q_topUnitName : { "text" : "选择公司", "type" : "org", "orgType" : "unit", style : {"min-width" : "200px"} },
                     q_unitName : { "text" : "选择部门", "type" : "org", "orgType" : "unit", style : {"min-width" : "250px"} },
                     q_empName : {  "text" : "选择人员", "type" : "org", "orgType" : "person", style : {"min-width" : "100px"} },
+                    startdateString : {  "text" : "开始日期", "tType" : "date",style : {"border" : "1px solid rgb(153, 153, 153)","background":'url("../x_component_Template/$MForm/default/icon/calendar.png") 98% center no-repeat',"border-radius":"3px","box-shadow":"rgb(204, 204, 204) 0px 0px 6px","height":"26px","width":"100px"} },
+                    enddateString : { "text" : "结束日期", "tType" : "date" ,style : {"border" : "1px solid rgb(153, 153, 153)","background":'url("../x_component_Template/$MForm/default/icon/calendar.png") 98% center no-repeat',"border-radius":"3px","box-shadow":"rgb(204, 204, 204) 0px 0px 6px","height":"26px","width":"100px"}},
                     action : {
                         "type" : "button",
                         "value" : "查询",

+ 26 - 3
o2web/source/x_component_Attendance/TopUnitDetail.js

@@ -11,8 +11,8 @@ MWF.xApplication.Attendance.TopUnitDetail = new Class({
         this.setOptions(options);
         this.app = app;
         this.lp = app.lp;
-        this.path = "../x_component_Attendance/$TopUnitDetail/";
-        this.cssPath = "../x_component_Attendance/$TopUnitDetail/"+this.options.style+"/css.wcss";
+        this.path = "/x_component_Attendance/$TopUnitDetail/";
+        this.cssPath = "/x_component_Attendance/$TopUnitDetail/"+this.options.style+"/css.wcss";
         this._loadCss();
 
         this.actions = actions;
@@ -111,6 +111,7 @@ MWF.xApplication.Attendance.TopUnitDetail.Explorer = new Class({
             "    <td styles='filterTableTitle' lable='isLackOfTime'></td>"+
             "    <td styles='filterTableValue' item='isLackOfTime'></td>" +
             "    <td styles='filterTableValue' item='action'></td>" +
+            "    <td styles='filterTableValue' item='export'></td>" +
             "</tr>" +
             "</table>";
         this.fileterNode.set("html",html);
@@ -170,7 +171,29 @@ MWF.xApplication.Attendance.TopUnitDetail.Explorer = new Class({
                             }
                             this.loadView( result );
                         }.bind(this)
-                    }}
+                    }},
+                    export : { "value" : "导出", type : "button", className : "filterButton", event : {
+                            click : function(){
+                                var result = this.form.getResult(true,",",true,true,false);
+                                if( !result )return;
+                                debugger;
+                                if( !result.q_topUnitName )result.q_topUnitName = "0";
+                                if( !result.q_unitName)result.q_unitName = "0";
+                                if( !result.q_empName)result.q_empName = "0";
+                                if( !result.cycleYear )result.cycleYear = "0";
+                                if( !result.cycleMonth )result.cycleMonth = "0";
+                                if( result.date && result.date !="" ){
+                                    result.q_date =  result.cycleYear + "-" + result.cycleMonth + "-" + result.date;
+                                }else{
+                                    result.q_date ="0";
+                                }
+                                if( !result.isAbsent )result.isAbsent = "0";
+                                if( !result.isLackOfTime  )result.isLackOfTime = "0";
+                                if( !result.isLate )result.isLate = "0";
+                                debugger;
+                                this.actions.detailsExportStream(result.q_topUnitName,result.q_unitName,result.q_empName,result.cycleYear,result.cycleMonth,result.q_date,result.isAbsent,result.isLackOfTime,result.isLate,true);
+                            }.bind(this)
+                        }}
                 }
             }, this.app, this.css);
             this.form.load();

+ 26 - 3
o2web/source/x_component_Attendance/UnitDetail.js

@@ -10,8 +10,8 @@ MWF.xApplication.Attendance.UnitDetail = new Class({
     initialize: function(node, app, actions, options){
         this.setOptions(options);
         this.app = app;
-        this.path = "../x_component_Attendance/$UnitDetail/";
-        this.cssPath = "../x_component_Attendance/$UnitDetail/"+this.options.style+"/css.wcss";
+        this.path = "/x_component_Attendance/$UnitDetail/";
+        this.cssPath = "/x_component_Attendance/$UnitDetail/"+this.options.style+"/css.wcss";
         this._loadCss();
 
         this.actions = actions;
@@ -109,6 +109,7 @@ MWF.xApplication.Attendance.UnitDetail.Explorer = new Class({
             "    <td styles='filterTableTitle' lable='isLackOfTime'></td>"+
             "    <td styles='filterTableValue' item='isLackOfTime'></td>" +
             "    <td styles='filterTableValue' item='action'></td>" +
+            "    <td styles='filterTableValue' item='export'></td>" +
             "</tr>" +
             "</table>";
         this.fileterNode.set("html",html);
@@ -168,7 +169,29 @@ MWF.xApplication.Attendance.UnitDetail.Explorer = new Class({
                             }
                             this.loadView( result );
                         }.bind(this)
-                    }}
+                    }},
+                    export : { "value" : "导出", type : "button", className : "filterButton", event : {
+                            click : function(){
+                                var result = this.form.getResult(true,",",true,true,false);
+                                if( !result )return;
+                                debugger;
+                                if( !result.q_topUnitName )result.q_topUnitName = "0";
+                                if( !result.q_unitName)result.q_unitName = "0";
+                                if( !result.q_empName)result.q_empName = "0";
+                                if( !result.cycleYear )result.cycleYear = "0";
+                                if( !result.cycleMonth )result.cycleMonth = "0";
+                                if( result.date && result.date !="" ){
+                                    result.q_date =  result.cycleYear + "-" + result.cycleMonth + "-" + result.date;
+                                }else{
+                                    result.q_date ="0";
+                                }
+                                if( !result.isAbsent )result.isAbsent = "0";
+                                if( !result.isLackOfTime  )result.isLackOfTime = "0";
+                                if( !result.isLate )result.isLate = "0";
+                                debugger;
+                                this.actions.detailsExportStream(result.q_topUnitName,result.q_unitName,result.q_empName,result.cycleYear,result.cycleMonth,result.q_date,result.isAbsent,result.isLackOfTime,result.isLate,true);
+                            }.bind(this)
+                        }}
                 }
             }, this.app, this.css);
             this.form.load();