appeal.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. $(function(){
  2. // 当前月份初始化
  3. $("#sel_month").val(getM()-1);
  4. $("#month_name").html( $("#sel_month").find("option:selected").text());
  5. // 导管中心选择
  6. $("#center_manage").change(function(){
  7. var center_manage_id = GV(this);
  8. if(center_manage_id == ''){
  9. $("#fs_station,#fs_employee").html('');
  10. }else{
  11. getFsStationList(center_manage_id,function(obj){
  12. $("#fs_station").html(obj);
  13. });
  14. }
  15. })
  16. // 查询
  17. $("#searchBtn").click(function(){
  18. $("#month_name").html( $("#sel_month").find("option:selected").text() )
  19. getFsWorkInfo();
  20. })
  21. // 导出excel
  22. $("#exportExcel").click(function(){
  23. var param = '';
  24. if( GV("#fs_station") != '' && GV("#fs_station")!=null ){
  25. param = "&deptId="+ GV("#fs_station");
  26. }else if(GV("#center_manage")!='' ){
  27. param = "&centerId=" + GV("#center_manage");
  28. }
  29. window.location.href = getserveraddr() +"/file/appeal/info?month="+GV("#sel_month")+param;
  30. })
  31. // 初始化查询
  32. getFsWorkInfo();
  33. // end
  34. })
  35. /**
  36. * 检索出勤明细数据
  37. * @param {*} param
  38. */
  39. function getFsWorkInfo(){
  40. var param = {
  41. "start_time": "2017-"+(GV("#sel_month")-1)+"-25 23:00:00" ,
  42. "end_time": "2017-"+GV("#sel_month")+"-25 23:00:00"
  43. }
  44. if(GV("#fs_station")!=''){
  45. param[ 'dept_id' ] = GV("#fs_station");
  46. }else if(GV("#center_manage") != ''){
  47. param[ 'parent_dept_id' ] = GV("#center_manage");
  48. }
  49. post_common_service("statistics/check/appeal",param,function(data){
  50. $(".table-tbody").empty();
  51. if(data.length >0){
  52. for(var i=0;i< data.length;i++){
  53. $(".table-tbody").append( getTableContent(data[i],i+1));
  54. }
  55. }
  56. },function(error){
  57. });
  58. }
  59. /**
  60. * 拼接表格内容
  61. * @param {*} obj
  62. * @param {*} seq
  63. */
  64. function getTableContent(obj,seq){
  65. var content = "<tr><td>"+seq+"</td> <td >"+obj.fee_station_name+"</td> <td >"+GDV(obj.appeal_num,0)+
  66. "</td> <td >"+GDV(obj.appeal_success_num,0)+"</td><td>"+ GDV(obj.appeal_fail_num,0) +"</td><td>"+ GDV(obj.appeal_other_num,0) +"</td> </tr>";
  67. return content;
  68. }