Commit ff2b0fb30306f8f2257742346ca8ba7457e75d35
1 parent
d1711123
到离站加牌照 准点率时间区间查询 修正添加修改人
Showing
12 changed files
with
263 additions
and
40 deletions
src/main/java/com/bsth/controller/report/ReportController.java
| ... | ... | @@ -110,6 +110,7 @@ public class ReportController { |
| 110 | 110 | Map<String, Object> m = new HashMap<String, Object>(); |
| 111 | 111 | m.put("i", i); |
| 112 | 112 | m.put("nbbm", a.getNbbm()); |
| 113 | + m.put("pzh", a.getPzh()); | |
| 113 | 114 | m.put("stopName", a.getStopName()); |
| 114 | 115 | m.put("jzsj", a.getJzsj()); |
| 115 | 116 | m.put("czsj", a.getCzsj()); | ... | ... |
src/main/java/com/bsth/controller/report/SheetController.java
| ... | ... | @@ -36,9 +36,21 @@ public class SheetController extends BaseController<Sheet, Integer>{ |
| 36 | 36 | List<Sheet> list=sheetService.sheetList(id); |
| 37 | 37 | return list; |
| 38 | 38 | } |
| 39 | + @RequestMapping(value = "/exportList",method = RequestMethod.GET) | |
| 40 | + public List<Sheet> exportList(@RequestParam Integer id){ | |
| 41 | + List<Sheet> list=sheetService.exportList(id); | |
| 42 | + return list; | |
| 43 | + } | |
| 44 | + | |
| 39 | 45 | @RequestMapping(value = "/countList",method = RequestMethod.GET) |
| 40 | 46 | public List<Map<String, Object>> countList(@RequestParam Map<String, Object> map){ |
| 41 | 47 | List<Map<String, Object>> list=sheetService.countList(map); |
| 42 | 48 | return list; |
| 43 | 49 | } |
| 50 | + | |
| 51 | + @RequestMapping(value = "/listSheet",method = RequestMethod.GET) | |
| 52 | + public List<Map<String, Object>> listSheet(@RequestParam Map<String, Object> map){ | |
| 53 | + List<Map<String, Object>> list=sheetService.listSheet(map); | |
| 54 | + return list; | |
| 55 | + } | |
| 44 | 56 | } | ... | ... |
src/main/java/com/bsth/entity/excep/ArrivalInfo.java
| ... | ... | @@ -20,6 +20,8 @@ public class ArrivalInfo { |
| 20 | 20 | |
| 21 | 21 | private String nbbm; |
| 22 | 22 | |
| 23 | + | |
| 24 | + private String pzh; | |
| 23 | 25 | /** 站点名称 */ |
| 24 | 26 | private String stopName; |
| 25 | 27 | |
| ... | ... | @@ -243,6 +245,14 @@ public class ArrivalInfo { |
| 243 | 245 | public void setJzsj(String jzsj) { |
| 244 | 246 | this.jzsj = jzsj; |
| 245 | 247 | } |
| 248 | + | |
| 249 | + public String getPzh() { | |
| 250 | + return pzh; | |
| 251 | + } | |
| 252 | + | |
| 253 | + public void setPzh(String pzh) { | |
| 254 | + this.pzh = pzh; | |
| 255 | + } | |
| 246 | 256 | |
| 247 | 257 | |
| 248 | 258 | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -2001,7 +2001,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2001 | 2001 | for (int i = 0; i < list.size(); i++) { |
| 2002 | 2002 | SchEditInfoDto t=list.get(i); |
| 2003 | 2003 | if(map.get(t.getType())!=null){ |
| 2004 | - t.setType2(t.getTimeStr()+":"+map.get(t.getType()).toString()); | |
| 2004 | + t.setType2(t.getUser()+"于"+t.getTimeStr()+"进行"+map.get(t.getType()).toString()+";"); | |
| 2005 | 2005 | }else{ |
| 2006 | 2006 | t.setType2(""); |
| 2007 | 2007 | } |
| ... | ... | @@ -2013,6 +2013,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2013 | 2013 | fage=false; |
| 2014 | 2014 | } |
| 2015 | 2015 | } |
| 2016 | + | |
| 2016 | 2017 | if(fage){ |
| 2017 | 2018 | lists.add(t); |
| 2018 | 2019 | } | ... | ... |
src/main/java/com/bsth/service/report/SheetService.java
| ... | ... | @@ -10,6 +10,7 @@ public interface SheetService extends BaseService<Sheet, Integer>{ |
| 10 | 10 | public List<Map<String, Object>> bcPunctual(Map<String, Object> map); |
| 11 | 11 | public String saveSheetList(String date) throws Exception; |
| 12 | 12 | public List<Map<String, Object>> countList(Map<String, Object> map); |
| 13 | - | |
| 13 | + public List<Map<String, Object>> listSheet(Map<String, Object> map); | |
| 14 | 14 | public List<Sheet> sheetList(Integer id); |
| 15 | + public List<Sheet> exportList(Integer id); | |
| 15 | 16 | } | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -156,7 +156,9 @@ public class ReportServiceImpl implements ReportService{ |
| 156 | 156 | while(rs.next()){ |
| 157 | 157 | arr = new ArrivalInfo(); |
| 158 | 158 | arr.setDeviceId(rs.getString("device_id")); |
| 159 | - arr.setNbbm(BasicData.deviceId2NbbmMap.get(arr.getDeviceId())); | |
| 159 | + String nbbm=BasicData.deviceId2NbbmMap.get(arr.getDeviceId()); | |
| 160 | + arr.setNbbm(nbbm); | |
| 161 | + arr.setPzh(BasicData.nbbmCompanyPlateMap.get(nbbm)); | |
| 160 | 162 | if(null == arr.getNbbm()){ |
| 161 | 163 | logger.warn("未注册的设备号," + arr.getDeviceId()); |
| 162 | 164 | continue; | ... | ... |
src/main/java/com/bsth/service/report/impl/SheetServiceImpl.java
| 1 | 1 | package com.bsth.service.report.impl; |
| 2 | 2 | |
| 3 | +import java.lang.reflect.InvocationTargetException; | |
| 3 | 4 | import java.sql.ResultSet; |
| 4 | 5 | import java.sql.SQLException; |
| 5 | 6 | import java.text.DecimalFormat; |
| ... | ... | @@ -42,6 +43,7 @@ import com.bsth.service.report.SheetService; |
| 42 | 43 | import com.bsth.util.BatchSaveUtils; |
| 43 | 44 | import com.bsth.util.ComparableChild; |
| 44 | 45 | import com.bsth.util.ComparableReal; |
| 46 | +import com.bsth.util.ReportRelatedUtils; | |
| 45 | 47 | import com.google.common.util.concurrent.AbstractScheduledService.Scheduler; |
| 46 | 48 | |
| 47 | 49 | @Service |
| ... | ... | @@ -658,7 +660,8 @@ public class SheetServiceImpl extends BaseServiceImpl<Sheet, Integer> implements |
| 658 | 660 | fgs=map.get("fgs").toString(); |
| 659 | 661 | } |
| 660 | 662 | String date=map.get("date").toString(); |
| 661 | - String sql="select * from bsth_c_sheet where date='"+date+"'"; | |
| 663 | + String endDate=map.get("endDate").toString(); | |
| 664 | + String sql="select * from bsth_c_sheet where date BETWEEN '"+date+"' and '"+endDate+"'"; | |
| 662 | 665 | if(line.trim().equals("")){ |
| 663 | 666 | sql +=" and gs like '%"+gs+"%' and fgs like '%"+fgs+"%'"; |
| 664 | 667 | }else{ |
| ... | ... | @@ -721,6 +724,7 @@ public class SheetServiceImpl extends BaseServiceImpl<Sheet, Integer> implements |
| 721 | 724 | String gs=BasicData.businessCodeNameMap.get(list.get(0).getGs()); |
| 722 | 725 | String fgs=BasicData.businessFgsCodeNameMap.get(list.get(0).getFgs()+"_"+list.get(0).getGs()); |
| 723 | 726 | String line=BasicData.lineCode2NameMap.get(list.get(0).getLine()); |
| 727 | + String date=list.get(0).getDate(); | |
| 724 | 728 | Integer id=list.get(0).getId(); |
| 725 | 729 | int bcs=list.size(); |
| 726 | 730 | int zdbcs=0; |
| ... | ... | @@ -740,6 +744,7 @@ public class SheetServiceImpl extends BaseServiceImpl<Sheet, Integer> implements |
| 740 | 744 | map.put("zdbcs", zdbcs); |
| 741 | 745 | map.put("zdlv", df.format(zdlv)+"%"); |
| 742 | 746 | map.put("id", id); |
| 747 | + map.put("date", date); | |
| 743 | 748 | return map; |
| 744 | 749 | } |
| 745 | 750 | @Override |
| ... | ... | @@ -781,6 +786,128 @@ public class SheetServiceImpl extends BaseServiceImpl<Sheet, Integer> implements |
| 781 | 786 | return list; |
| 782 | 787 | } |
| 783 | 788 | |
| 789 | + @Override | |
| 790 | + public List<Sheet> exportList(Integer id) { | |
| 791 | + // TODO Auto-generated method stub | |
| 792 | + ReportRelatedUtils rru = new ReportRelatedUtils(); | |
| 793 | + Sheet sheet=sheetRepository.findOne(id); | |
| 794 | + String sql="select * from bsth_c_sheet where date='"+sheet.getDate()+"' and line = '"+sheet.getLine()+"'" | |
| 795 | + + " order by xl_dir,jhsj"; | |
| 796 | + | |
| 797 | + List<Sheet> list=jdbcTemplate.query(sql, | |
| 798 | + new RowMapper<Sheet>(){ | |
| 799 | + @Override | |
| 800 | + public Sheet mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 801 | + Sheet s=new Sheet(); | |
| 802 | + s.setId(rs.getInt("id")); | |
| 803 | + s.setGs(rs.getString("gs")); | |
| 804 | + s.setFgs(rs.getString("fgs")); | |
| 805 | + s.setLine(rs.getString("line")); | |
| 806 | + s.setDate(rs.getString("date")); | |
| 807 | + s.setJhsj(rs.getString("jhsj")); | |
| 808 | + s.setJhsjt(rs.getLong("jhsjt")); | |
| 809 | + s.setSjsj(rs.getString("sjsj")); | |
| 810 | + s.setSjsjt(rs.getLong("sjsjt")); | |
| 811 | + s.setZdname(rs.getString("zdname")); | |
| 812 | + return s; | |
| 813 | + } | |
| 814 | + }); | |
| 815 | + | |
| 816 | + List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); | |
| 817 | + for (int i = 0; i < list.size(); i++) { | |
| 818 | + Sheet t=list.get(i); | |
| 819 | + t.setLine(BasicData.lineCode2NameMap.get(t.getLine())); | |
| 820 | + Long sjc=t.getJhsjt()-t.getSjsjt(); | |
| 821 | + if(sjc>= 3*60*1000*-1 && sjc <=1*60*1000){ | |
| 822 | + t.setSfzd("准点"); | |
| 823 | + }else{ | |
| 824 | + t.setSfzd("不准点"); | |
| 825 | + } | |
| 826 | + | |
| 827 | + try { | |
| 828 | + Map<String, Object> map = rru.getMapValue(t); | |
| 829 | + listMap.add(map); | |
| 830 | + } catch (ClassNotFoundException e) { | |
| 831 | + // TODO Auto-generated catch block | |
| 832 | + e.printStackTrace(); | |
| 833 | + } catch (IllegalAccessException e) { | |
| 834 | + // TODO Auto-generated catch block | |
| 835 | + e.printStackTrace(); | |
| 836 | + } catch (InvocationTargetException e) { | |
| 837 | + // TODO Auto-generated catch block | |
| 838 | + e.printStackTrace(); | |
| 839 | + } catch (NoSuchMethodException e) { | |
| 840 | + // TODO Auto-generated catch block | |
| 841 | + e.printStackTrace(); | |
| 842 | + } catch (NoSuchFieldException e) { | |
| 843 | + // TODO Auto-generated catch block | |
| 844 | + e.printStackTrace(); | |
| 845 | + } | |
| 846 | + | |
| 847 | + } | |
| 848 | + | |
| 849 | + return list; | |
| 850 | + } | |
| 851 | + @Override | |
| 852 | + public List<Map<String, Object>> listSheet(Map<String, Object> map) { | |
| 853 | + // TODO Auto-generated method stub | |
| 854 | + List<Map<String, Object>> listmap=new ArrayList<Map<String,Object>>(); | |
| 855 | + Integer id=Integer.parseInt(map.get("id").toString()); | |
| 856 | + Sheet sheet=sheetRepository.findOne(id); | |
| 857 | + String date=map.get("date").toString(); | |
| 858 | + String endDate=map.get("endDate").toString(); | |
| 859 | + | |
| 860 | + String sqlByDate="select date from bsth_c_sheet where date BETWEEN '"+date+"' and '"+endDate+"'" | |
| 861 | + + "and line = '"+sheet.getLine()+"' group by date order by date"; | |
| 862 | + | |
| 863 | + List<String> dateList=jdbcTemplate.query(sqlByDate, | |
| 864 | + new RowMapper<String>(){ | |
| 865 | + @Override | |
| 866 | + public String mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 867 | + String date=rs.getString("date"); | |
| 868 | + | |
| 869 | + return date; | |
| 870 | + } | |
| 871 | + }); | |
| 872 | + | |
| 873 | + String sql="select * from bsth_c_sheet where date BETWEEN '"+date+"' and '"+endDate+"'" | |
| 874 | + + " and line ='"+sheet.getLine()+"' order by date"; | |
| 875 | + | |
| 876 | + List<Sheet> list=jdbcTemplate.query(sql, | |
| 877 | + new RowMapper<Sheet>(){ | |
| 878 | + @Override | |
| 879 | + public Sheet mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 880 | + Sheet s=new Sheet(); | |
| 881 | + s.setGs(rs.getString("gs")); | |
| 882 | + s.setFgs(rs.getString("fgs")); | |
| 883 | + s.setLine(rs.getString("line")); | |
| 884 | + s.setDate(rs.getString("date")); | |
| 885 | + s.setJhsj(rs.getString("jhsj")); | |
| 886 | + s.setJhsjt(rs.getLong("jhsjt")); | |
| 887 | + s.setSjsj(rs.getString("sjsj")); | |
| 888 | + s.setSjsjt(rs.getLong("sjsjt")); | |
| 889 | + s.setId(rs.getInt("id")); | |
| 890 | + return s; | |
| 891 | + } | |
| 892 | + }); | |
| 893 | + for (int i = 0; i < dateList.size(); i++) { | |
| 894 | + String s=dateList.get(i); | |
| 895 | + List<Sheet> newList=new ArrayList<Sheet>(); | |
| 896 | + for (int j = 0; j < list.size(); j++) { | |
| 897 | + Sheet t=list.get(j); | |
| 898 | + if(t.getDate().equals(s)){ | |
| 899 | + newList.add(t); | |
| 900 | + } | |
| 901 | + } | |
| 902 | + | |
| 903 | + if(newList.size()>0){ | |
| 904 | + Map<String, Object> newmap=culateByLine(newList); | |
| 905 | + listmap.add(newmap); | |
| 906 | + } | |
| 907 | + } | |
| 908 | + return listmap; | |
| 909 | + } | |
| 910 | + | |
| 784 | 911 | |
| 785 | 912 | } |
| 786 | 913 | class ComparableAcual implements Comparator<ScheduleRealInfo>{ | ... | ... |
src/main/resources/static/pages/forms/mould/inoutstation.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/correctForm.html
src/main/resources/static/pages/report/inoutstation.html
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | <div style="display: inline-block;margin-left: 15px;"> |
| 32 | 32 | <input class="item-label" type="radio" name="typeLx" checked="checked" value="1" /> |
| 33 | 33 | 班次执行情况 |
| 34 | - <input class="item-label" type="radio" name="typeLX" value="2" /> | |
| 34 | + <input class="item-label" type="radio" name="typeLx" value="2" /> | |
| 35 | 35 | 车辆/站点 |
| 36 | 36 | </div> |
| 37 | 37 | <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv"> |
| ... | ... | @@ -116,16 +116,17 @@ |
| 116 | 116 | <thead> |
| 117 | 117 | <tr> |
| 118 | 118 | <td width="3%"></td> |
| 119 | - <td width="9%">内部编码</td> | |
| 120 | - <td width="8%">到站名称</td> | |
| 121 | - <td width="8%">到站时刻</td> | |
| 122 | - <td width="8%">离站时刻</td> | |
| 123 | - <td width="8%">是否开关门</td> | |
| 124 | - <td width="8%">上下行</td> | |
| 119 | + <td width="8%">内部编码</td> | |
| 120 | + <td width="8%">牌照号</td> | |
| 121 | + <td width="7%">到站名称</td> | |
| 122 | + <td width="7%">到站时刻</td> | |
| 123 | + <td width="7%">离站时刻</td> | |
| 124 | + <td width="7%">是否开关门</td> | |
| 125 | + <td width="7%">上下行</td> | |
| 125 | 126 | <td width="8%">开门速度(公里/小时)</td> |
| 126 | - <td width="8%">补发</td> | |
| 127 | - <td width="8%">刷卡次数</td> | |
| 128 | - <td width="8%">刷卡金额</td> | |
| 127 | + <td width="7%">补发</td> | |
| 128 | + <td width="7%">刷卡次数</td> | |
| 129 | + <td width="7%">刷卡金额</td> | |
| 129 | 130 | <td width="8%">免费刷卡次数</td> |
| 130 | 131 | <td width="8%">免费刷卡金额</td> |
| 131 | 132 | </tr> |
| ... | ... | @@ -497,6 +498,7 @@ |
| 497 | 498 | <tr> |
| 498 | 499 | <td>{{i+1}}</td> |
| 499 | 500 | <td>{{obj.nbbm}}</td> |
| 501 | + <td>{{obj.pzh}}</td> | |
| 500 | 502 | <td>{{obj.stopName}}</td> |
| 501 | 503 | <td>{{obj.jzsj}}</td> |
| 502 | 504 | <td>{{obj.czsj}}</td> | ... | ... |
src/main/resources/static/pages/report/sheet/list.html
| ... | ... | @@ -18,7 +18,7 @@ |
| 18 | 18 | |
| 19 | 19 | <div class="page-head"> |
| 20 | 20 | <div class="page-title" style="margin-left: 20px"> |
| 21 | - <button>数据导出</button> | |
| 21 | + <button id="exportList">数据导出</button> | |
| 22 | 22 | </div> |
| 23 | 23 | </div> |
| 24 | 24 | |
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | 28 | <div class="portlet-body"> |
| 29 | 29 | <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 600px"> |
| 30 | - <table class="table table-bordered table-hover table-checkable" id="forms_1"> | |
| 30 | + <table class="table table-bordered table-hover table-checkable" id="forms_2"> | |
| 31 | 31 | <thead> |
| 32 | 32 | <tr> |
| 33 | 33 | <td></td> |
| ... | ... | @@ -40,7 +40,7 @@ |
| 40 | 40 | </tr> |
| 41 | 41 | </thead> |
| 42 | 42 | |
| 43 | - <tbody > | |
| 43 | + <tbody> | |
| 44 | 44 | |
| 45 | 45 | </tbody> |
| 46 | 46 | </table> |
| ... | ... | @@ -55,32 +55,28 @@ |
| 55 | 55 | // 关闭左侧栏 |
| 56 | 56 | if (!$('body').hasClass('page-sidebar-closed')) |
| 57 | 57 | $('.menu-toggler.sidebar-toggler').click(); |
| 58 | - | |
| 58 | + var no=""; | |
| 59 | 59 | $("#sheetList").on('init', function (e, id) { |
| 60 | + no=id; | |
| 60 | 61 | $get('/sheet/sheetList',{id:id},function(result){ |
| 61 | - var sheetList_1 = template('sheetList_1',{list:result}); | |
| 62 | - $('#forms_1 tbody').html(sheetList_1); | |
| 62 | + var sheetList_2 = template('sheetList_2',{list:result}); | |
| 63 | + $('#forms_2 tbody').html(sheetList_2); | |
| 63 | 64 | }); |
| 64 | 65 | }) |
| 65 | - /* $("#query").on('click',function(){ | |
| 66 | - var line = $("#line").val(); | |
| 67 | - var date = $("#date").val(); | |
| 68 | - var fgs=$('#fgsdm').val(); | |
| 69 | - var gs=$('#gsdm').val(); | |
| 70 | - $get('/sheet/countList',{line:line,date:date,gs:gs,fgs:fgs},function(result){ | |
| 71 | - var sheetList = template('sheetList',{list:result}); | |
| 72 | - $('#forms tbody').html(sheetList); | |
| 73 | - $('.btn-sheetList').on('click', openSheetList); | |
| 74 | - }); | |
| 75 | - }); */ | |
| 66 | + $("#exportList").on('click',function(){ | |
| 67 | + | |
| 68 | + $get('/sheet/exportList',params,function(result){ | |
| 69 | + window.open("/downloadFile/download?fileName=班次车辆人员月报表"+moment($("#startDate").val()).format("YYYYMMDD")); | |
| 70 | + }); | |
| 71 | + }); | |
| 76 | 72 | |
| 77 | 73 | |
| 78 | 74 | }); |
| 79 | 75 | </script> |
| 80 | -<script type="text/html" id="sheetList_1"> | |
| 76 | +<script type="text/html" id="sheetList_2"> | |
| 81 | 77 | {{each list as obj i}} |
| 82 | 78 | <tr {{if obj.sfzd!="Y"}}style="color: red" {{/if}}> |
| 83 | - <td>{{i}}</td> | |
| 79 | + <td>{{i+1}}</td> | |
| 84 | 80 | <td>{{obj.date}}</td> |
| 85 | 81 | <td>{{obj.line}}</td> |
| 86 | 82 | <td>{{obj.zdname}}</td> | ... | ... |
src/main/resources/static/pages/report/sheet/sheetList.html
| ... | ... | @@ -35,14 +35,20 @@ |
| 35 | 35 | <span class="item-label" style="width: 80px;">分公司: </span> |
| 36 | 36 | <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select> |
| 37 | 37 | </div> |
| 38 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 38 | + <div style="margin-top: 10px"> | |
| 39 | + </div> | |
| 40 | + <div style="display: inline-block;margin-left: 33px;"> | |
| 39 | 41 | <span class="item-label" style="width: 80px;">线路: </span> |
| 40 | 42 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 41 | 43 | </div> |
| 42 | 44 | <div style="display: inline-block;"> |
| 43 | - <span class="item-label" style="width: 80px;">时间: </span> | |
| 45 | + <span class="item-label" style="width: 80px;margin-left: 24px;">开始时间: </span> | |
| 44 | 46 | <input class="form-control" type="text" id="date" style="width: 180px;"/> |
| 45 | 47 | </div> |
| 48 | + <div style="display: inline-block;"> | |
| 49 | + <span class="item-label" style="width: 80px;margin-left: 24px;">结束时间: </span> | |
| 50 | + <input class="form-control" type="text" id="endDate" style="width: 180px;"/> | |
| 51 | + </div> | |
| 46 | 52 | |
| 47 | 53 | <div class="form-group"> |
| 48 | 54 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| ... | ... | @@ -65,7 +71,28 @@ |
| 65 | 71 | </tr> |
| 66 | 72 | </thead> |
| 67 | 73 | |
| 68 | - <tbody > | |
| 74 | + <tbody> | |
| 75 | + | |
| 76 | + </tbody> | |
| 77 | + </table> | |
| 78 | + </div> | |
| 79 | + | |
| 80 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 81 | + <table class="table table-bordered table-hover table-checkable" id="forms_1"> | |
| 82 | + <thead> | |
| 83 | + <tr class="hidden"> | |
| 84 | + <td>公司</td> | |
| 85 | + <td>分公司</td> | |
| 86 | + <td>日期</td> | |
| 87 | + <td>线路</td> | |
| 88 | + <td>班次数</td> | |
| 89 | + <td>准点班次数</td> | |
| 90 | + <td>准点率</td> | |
| 91 | + <td>查看</td> | |
| 92 | + </tr> | |
| 93 | + </thead> | |
| 94 | + | |
| 95 | + <tbody> | |
| 69 | 96 | |
| 70 | 97 | </tbody> |
| 71 | 98 | </table> |
| ... | ... | @@ -85,6 +112,10 @@ |
| 85 | 112 | format : 'YYYY-MM-DD', |
| 86 | 113 | locale : 'zh-cn' |
| 87 | 114 | }); |
| 115 | + $("#endDate").datetimepicker({ | |
| 116 | + format : 'YYYY-MM-DD', | |
| 117 | + locale : 'zh-cn' | |
| 118 | + }); | |
| 88 | 119 | var d = new Date(); |
| 89 | 120 | var year = d.getFullYear(); |
| 90 | 121 | var month = d.getMonth() + 1; |
| ... | ... | @@ -93,8 +124,10 @@ |
| 93 | 124 | day = "0"+day; |
| 94 | 125 | if(month > 9){ |
| 95 | 126 | $("#date").val(year + "-" + month + "-" + day); |
| 127 | + $("#endDate").val(year + "-" + month + "-" + day); | |
| 96 | 128 | } else { |
| 97 | 129 | $("#date").val(year + "-0" + month + "-" + day); |
| 130 | + $("#endDate").val(year + "-" + month + "-" + day); | |
| 98 | 131 | } |
| 99 | 132 | |
| 100 | 133 | var fage=false; |
| ... | ... | @@ -172,19 +205,34 @@ |
| 172 | 205 | $("#query").on('click',function(){ |
| 173 | 206 | var line = $("#line").val(); |
| 174 | 207 | var date = $("#date").val(); |
| 208 | + var endDate = $("#endDate").val(); | |
| 175 | 209 | var fgs=$('#fgsdm').val(); |
| 176 | 210 | var gs=$('#gsdm').val(); |
| 177 | - $get('/sheet/countList',{line:line,date:date,gs:gs,fgs:fgs},function(result){ | |
| 211 | + $get('/sheet/countList',{line:line,date:date,endDate:endDate,gs:gs,fgs:fgs},function(result){ | |
| 178 | 212 | var sheetList = template('sheetList',{list:result}); |
| 179 | 213 | $('#forms tbody').html(sheetList); |
| 180 | - $('.btn-sheetList').on('click', openSheetList); | |
| 214 | + $('.btn-sheetList').on('click', showSheetList); | |
| 181 | 215 | }); |
| 182 | 216 | // $post('/sheet/saveListSheet',function(result){ |
| 183 | 217 | // }); |
| 184 | 218 | }); |
| 185 | - | |
| 219 | + function showSheetList(){ | |
| 220 | + var id = $(this).data('id'); | |
| 221 | + var date = $("#date").val(); | |
| 222 | + var endDate = $("#endDate").val(); | |
| 223 | + $get('/sheet/listSheet',{id:id,date:date,endDate:endDate},function(result){ | |
| 224 | + var sheetList = template('sheetList_1',{list:result}); | |
| 225 | + | |
| 226 | + $('#forms_1 tbody').html(sheetList); | |
| 227 | + $('.btn-sheetList_1').on('click', openSheetList); | |
| 228 | + $("#forms_1 .hidden").removeClass("hidden"); | |
| 229 | + $("html,body").animate({scrollTop:$("#forms_1").offset().top},1000); | |
| 230 | + | |
| 231 | + }); | |
| 232 | + } | |
| 186 | 233 | function openSheetList(){ |
| 187 | 234 | var id = $(this).data('id'); |
| 235 | + console.log(id); | |
| 188 | 236 | $.get('/pages/report/sheet/list.html', function (content) { |
| 189 | 237 | layer.open({ |
| 190 | 238 | type: 1, |
| ... | ... | @@ -221,4 +269,27 @@ |
| 221 | 269 | <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> |
| 222 | 270 | </tr> |
| 223 | 271 | {{/if}} |
| 272 | +</script> | |
| 273 | + | |
| 274 | +<script type="text/html" id="sheetList_1"> | |
| 275 | + {{each list as obj i}} | |
| 276 | + <tr> | |
| 277 | + <td>{{obj.gs}}</td> | |
| 278 | + <td>{{obj.fgs}}</td> | |
| 279 | + <td>{{obj.date}}</td> | |
| 280 | + <td>{{obj.line}}</td> | |
| 281 | + <td>{{obj.bcs}}</td> | |
| 282 | + <td>{{obj.zdbcs}}</td> | |
| 283 | + <td>{{obj.zdlv}}</td> | |
| 284 | + <td> | |
| 285 | + <button type="button" class="btn btn-sm blue btn-sheetList_1" | |
| 286 | + data-id="{{obj.id}}">详细</button> | |
| 287 | + </td> | |
| 288 | + </tr> | |
| 289 | + {{/each}} | |
| 290 | + {{if list.length == 0}} | |
| 291 | + <tr> | |
| 292 | + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | |
| 293 | + </tr> | |
| 294 | + {{/if}} | |
| 224 | 295 | </script> |
| 225 | 296 | \ No newline at end of file | ... | ... |