| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- $(function(){
- // 初始化部门下的收费站
- getFsStationList(GV("#center_manage"),function(obj){
- $("#fs_station").html(obj);
- // 初始化收费站下的人数
- getFsEmployee(GV("#fs_station"),function(obj){
- $("#fs_employee").html(obj);
- // 检索
- getFsWorkInfo();
- });
- });
- // 当前月份初始化
- $("#sel_month").val(getM()-1);
- // 根据月份确定天数
- monthChange();
- $("#month_name").html( $("#sel_month").find("option:selected").text());
- // 收费站中心选择
- $("#fs_station").change(function(){
- var fee_station_id = GV(this);
- if(fee_station_id == ''){
- $("#fs_employee").html('');
- }else{
- getFsEmployee(fee_station_id,function(obj){
- $("#fs_employee").html(obj);
- });
- }
- })
- // 导管中心选择
- $("#center_manage").change(function(){
- var center_manage_id = GV(this);
- if(center_manage_id == ''){
- $("#fs_station,#fs_employee").html('');
- }else{
- getFsStationList(center_manage_id,function(obj){
- $("#fs_station").html(obj);
- });
- }
- })
- // 查询
- $("#searchBtn").click(function(){
- $("#month_name").html( $("#sel_month").find("option:selected").text() )
- 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/unregular/work/info",param,function(data){
- // 月份变化
- monthChange();
- $("#ca-a-table").empty();
- if(data.length >0){
- for(var i=0;i< data.length;i++){
- if(data[i].userName != undefined){
- $("#ca-a-table").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 = {};
- for(var z=0; z < obj.subStatisticsFsWork.length ;z++){
- if(obj.subStatisticsFsWork[z].check_id !=undefined){
- map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 2;
- }else{
- map_class[getD(obj.subStatisticsFsWork[z].work_date)+"-"+obj.subStatisticsFsWork[z].class_type] = 1;
- }
- }
- var class_html = [];
- for(var d=0;d<3;d++){
- var class_type = 3;
- if(d != 0){
- class_type = d ;
- }
- for(var i=26; i<=days; i++){
- if( map_class[i+"-"+class_type] !=undefined ){
- if( map_class[i+"-"+class_type]==1){
- class_html[d] += '<td>/</td>' ;
- }else{
- class_html[d] += '<td class="b-grey">/</td>' ;
- }
- }else{
- class_html[d] += '<td></td>' ;
- }
- }
- for(var i=1; i<=25; i++){
- if( map_class[i+"-"+class_type] !=undefined ){
- if( map_class[i+"-"+class_type]==1){
- class_html[d] += '<td>/</td>' ;
- }else{
- class_html[d] += '<td class="b-grey">/</td>' ;
- }
- }else{
- class_html[d] += '<td></td>' ;
- }
- }
- }
- 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'>"+ 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>" ;
- return content;
- }
- /**
- * 月份变化 , 天数变化
- */
- function monthChange(){
- $(".m28").show();
- $(".m"+getDays(GV("#sel_month")-1)).hide();
- }
|