|
|
@@ -7,6 +7,8 @@ $(function(){
|
|
|
// 初始化收费站下的人数
|
|
|
getFsEmployee(GV("#fs_station"),function(obj){
|
|
|
$("#fs_employee").html(obj);
|
|
|
+ // 检索
|
|
|
+ getFsWorkInfo();
|
|
|
});
|
|
|
});
|
|
|
|
|
|
@@ -43,38 +45,50 @@ $(function(){
|
|
|
})
|
|
|
|
|
|
// 查询
|
|
|
- $("#searchBtn").click(function(){
|
|
|
-
|
|
|
+ $("#searchBtn").click(function(){
|
|
|
$("#month_name").html( $("#sel_month").find("option:selected").text() )
|
|
|
-
|
|
|
- var param = {
|
|
|
- "start_time": "2017-"+(GV("#sel_month")-1)+"-25 23:00:00" ,
|
|
|
- "end_time": "2017-"+GV("#sel_month")+"-25 23:00:00"
|
|
|
- }
|
|
|
-
|
|
|
- if(GV("#fs_employee")!=''){
|
|
|
- param[ 'user_id'] = GV("#fs_employee");
|
|
|
- }else if(GV("#fs_station")!=''){
|
|
|
- param[ 'dept_id' ] = GV("#fs_station");
|
|
|
- }else if(GV("#center_manage") != ''){
|
|
|
- param[ 'parent_dept_id' ] = GV("#center_manage");
|
|
|
- }
|
|
|
-
|
|
|
- post_common_service("statistics/fs/work/info",param,function(data){
|
|
|
- // 月份变化
|
|
|
- monthChange();
|
|
|
- $(".table-tbody").empty();
|
|
|
- if(data.length >0){
|
|
|
- for(var i=0;i< data.length;i++){
|
|
|
- $(".table-tbody").append( getTableContent(data[i],i+1));
|
|
|
- }
|
|
|
- }
|
|
|
- },function(error){
|
|
|
- });
|
|
|
+ getFsWorkInfo();
|
|
|
})
|
|
|
// end
|
|
|
})
|
|
|
|
|
|
+/**
|
|
|
+ * 检索出勤明细数据
|
|
|
+ * @param {*} param
|
|
|
+ */
|
|
|
+function getFsWorkInfo(){
|
|
|
+
|
|
|
+ var param = {
|
|
|
+ "start_time": "2017-"+(GV("#sel_month")-1)+"-25 23:00:00" ,
|
|
|
+ "end_time": "2017-"+GV("#sel_month")+"-25 23:00:00"
|
|
|
+ }
|
|
|
+
|
|
|
+ if(GV("#fs_employee")!=''){
|
|
|
+ param[ 'user_id'] = GV("#fs_employee");
|
|
|
+ }else if(GV("#fs_station")!=''){
|
|
|
+ param[ 'dept_id' ] = GV("#fs_station");
|
|
|
+ }else if(GV("#center_manage") != ''){
|
|
|
+ param[ 'parent_dept_id' ] = GV("#center_manage");
|
|
|
+ }
|
|
|
+
|
|
|
+ post_common_service("statistics/fs/work/info",param,function(data){
|
|
|
+ // 月份变化
|
|
|
+ monthChange();
|
|
|
+ $(".table-tbody").empty();
|
|
|
+ if(data.length >0){
|
|
|
+ for(var i=0;i< data.length;i++){
|
|
|
+ $(".table-tbody").append( getTableContent(data[i],i+1));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },function(error){
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 拼接表格内容
|
|
|
+ * @param {*} obj
|
|
|
+ * @param {*} seq
|
|
|
+ */
|
|
|
function getTableContent(obj,seq){
|
|
|
var days = getDays(GV("#sel_month")-1);
|
|
|
var map_class = {};
|
|
|
@@ -117,7 +131,7 @@ function getTableContent(obj,seq){
|
|
|
}
|
|
|
|
|
|
var content = "<tr><td rowspan='3'>"+seq+"</td> <td rowspan='3'>"+obj.feeStationName+"</td> <td rowspan='3'>"+obj.userName+
|
|
|
- "</td> <td rowspan='3'>"+obj.positionName+"</td><td rowspan='3'>"+ "workno" +"</td><td>夜班</td> "+class_html[0]+"<td rowspan='3'>"+
|
|
|
+ "</td> <td rowspan='3'>"+obj.positionName+"</td><td rowspan='3'>"+ obj.workno +"</td><td>夜班</td> "+class_html[0]+"<td rowspan='3'>"+
|
|
|
obj.work_days+"</td><td rowspan='3'>"+convertT(obj.work_minutes)+"</td><td rowspan='3'></td> </tr>\
|
|
|
<tr><td>早班</td> "+class_html[1]+" </tr>\
|
|
|
<tr><td>中班</td> "+ class_html[2] +" </tr>" ;
|
|
|
@@ -131,123 +145,4 @@ function getTableContent(obj,seq){
|
|
|
function monthChange(){
|
|
|
$(".m28").show();
|
|
|
$(".m"+getDays(GV("#sel_month")-1)).hide();
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * xxx分钟 转化 xx时xx分
|
|
|
- */
|
|
|
-function convertT(minute){
|
|
|
- return minute/60 +"时"+minute%60+"分";
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * 获取当前月份值
|
|
|
- */
|
|
|
-function getM(datet){
|
|
|
- var date = new Date();
|
|
|
- if(date!=undefined && datet instanceof Date){
|
|
|
- date = datet ;
|
|
|
- }
|
|
|
- return date.getMonth() +1 ;
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * 根据Date 获取天数值
|
|
|
- * parm: string date
|
|
|
- * return int
|
|
|
- */
|
|
|
-function getD(date){
|
|
|
- var datev = new Date(date) ;
|
|
|
- return datev.getDate() ;
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * 根据收费站id获取该收费站下的人员列表
|
|
|
- * param: fs_station_id , func 异步回调
|
|
|
- * return: String , List Option
|
|
|
- */
|
|
|
-function getFsEmployee(fs_station_id , func){
|
|
|
- var param = {
|
|
|
- "organid":fs_station_id
|
|
|
- }
|
|
|
- post_common_service("user/getFsUserList",param,function(data){
|
|
|
- var resultStr = ''
|
|
|
- if(data.length > 0){
|
|
|
- resultStr = "<option value=''>全部</option>";
|
|
|
- for(var i=0;i<data.length;i++){
|
|
|
- resultStr += "<option value="+data[i].id+">"+data[i].truename+"</option>";
|
|
|
- }
|
|
|
- }
|
|
|
- func(resultStr);
|
|
|
- },function(error){
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * 根据道管中心id 获取收费站select 列表
|
|
|
- * param: center_manage_id , func 异步回调方法
|
|
|
- * return: String select 下 List<Option>
|
|
|
- */
|
|
|
-function getFsStationList(center_manage_id,func){
|
|
|
- var param = {
|
|
|
- "parentid":center_manage_id
|
|
|
- }
|
|
|
- post_common_service("dept/getDeptInfosByDeptId",param,function(data){
|
|
|
- var str = '';
|
|
|
- if(data.length > 0){
|
|
|
- str = "<option value=''>全部</option>";
|
|
|
- for(var i=0;i<data.length;i++){
|
|
|
- str += "<option value="+data[i].id+">"+data[i].organname+"</option>";
|
|
|
- }
|
|
|
- }
|
|
|
- func(str);
|
|
|
- },function(error){
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * 根据选择器 回去value值
|
|
|
- * param: id 选择器
|
|
|
- * return value
|
|
|
- */
|
|
|
-function GV(selector){
|
|
|
- return $(selector).val();
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * 根据选择器,获取html值
|
|
|
- * param:selector 选择器
|
|
|
- * return: html value
|
|
|
- */
|
|
|
-function GH(selector){
|
|
|
- return $(selector).html();
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * 根据月份,判断当前月份天数
|
|
|
- * param: month String 月份 ,datet Date 年份
|
|
|
- * return:days( 28,29,30,31 )
|
|
|
- */
|
|
|
-function getDays(mouth,datet){
|
|
|
- //构造当前日期对象
|
|
|
- var date = new Date();
|
|
|
- if(date!=undefined && datet instanceof Date){
|
|
|
- date = datet ;
|
|
|
- }
|
|
|
- //获取年份
|
|
|
- var year = date.getFullYear();
|
|
|
- //定义当月的天数;
|
|
|
- var days ;
|
|
|
- //当月份为二月时,根据闰年还是非闰年判断天数
|
|
|
- if(mouth == 2){
|
|
|
- days= year % 4 == 0 ? 29 : 28;
|
|
|
- }
|
|
|
- else if(mouth == 1 || mouth == 3 || mouth == 5 || mouth == 7 || mouth == 8 || mouth == 10 || mouth == 12){
|
|
|
- //月份为:1,3,5,7,8,10,12 时,为大月.则天数为31;
|
|
|
- days= 31;
|
|
|
- }
|
|
|
- else{
|
|
|
- days= 30;
|
|
|
- }
|
|
|
- return days ;
|
|
|
}
|