Commit b954c7642a388560ca8539096916e79d0c7f02b8

Authored by sgz
1 parent 52b38105

统计日报表,月报表

src/main/java/com/bsth/controller/forms/ExportController.java
... ... @@ -82,7 +82,7 @@ public class ExportController {
82 82 }
83 83  
84 84 // 班次车辆人员日统计
85   - @RequestMapping(value = "/shifdayExport", method = RequestMethod.POST)
  85 + @RequestMapping(value = "/shifdayExport", method = RequestMethod.GET)
86 86 public List<Map<String, Object>> shifdayExport(@RequestParam Map<String, Object> map) {
87 87 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
88 88 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -122,7 +122,7 @@ public class ExportController {
122 122 }
123 123  
124 124 // 班次车辆人员月统计
125   - @RequestMapping(value = "/shiftuehiclemanthExport", method = RequestMethod.POST)
  125 + @RequestMapping(value = "/shiftuehiclemanthExport", method = RequestMethod.GET)
126 126 public List<Map<String, Object>> shiftuehiclemanthExport(@RequestParam Map<String, Object> map) {
127 127 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
128 128 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -147,12 +147,18 @@ public class ExportController {
147 147 }
148 148  
149 149 try {
  150 + String mouldurl = null;
  151 + if(map.get("empnames").equals("驾驶员")){
  152 + mouldurl="mould/shiftuehiclemanth.xls";
  153 + }else if(map.get("empnames").equals("售票员")){
  154 + mouldurl="mould/shiftuehiclemanthspy.xls";
  155 + }else if(map.get("empnames").equals("路牌")){
  156 + mouldurl="mould/shiftuehiclemanthlp.xls";
  157 + }
150 158 listI.add(resList.iterator());
151   -
152 159 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
153   - ee.excelReplace(listI, new Object[] { map }, path + "mould/shiftuehiclemanth.xls", path
154   - + "export/班次车辆人员月报表" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
155   -
  160 + ee.excelReplace(listI, new Object[] { map }, path +mouldurl,
  161 + path + "export/班次车辆人员月报表" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
156 162 } catch (Exception e) {
157 163 e.printStackTrace();
158 164 }
... ...
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
... ... @@ -52,14 +52,14 @@ public class MCY_FormsController {
52 52 }
53 53  
54 54 // 班次车辆人员月报表
55   - @RequestMapping(value = "/shiftuehiclemanth", method = RequestMethod.POST)
  55 + @RequestMapping(value = "/shiftuehiclemanth", method = RequestMethod.GET)
56 56 public List<Shiftuehiclemanth> shiftuehiclemanth(@RequestParam Map<String, Object> map) {
57 57  
58 58 return formsService.shiftuehiclemanth(map);
59 59 }
60 60  
61 61 // 班次车辆人员日统计
62   - @RequestMapping(value = "/shifday", method = RequestMethod.POST)
  62 + @RequestMapping(value = "/shifday", method = RequestMethod.GET)
63 63 public List<Shifday> shifday(@RequestParam Map<String, Object> map) {
64 64  
65 65 return formsService.shifday(map);
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -147,59 +147,95 @@ public class FormsServiceImpl implements FormsService {
147 147  
148 148 @Override
149 149 public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map) {
150   - String sql = "select r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
  150 + final String empnames=map.get("empnames").toString();
  151 + String gsdmManth="";
  152 + String fgsdmManth="";
  153 + if(map.containsKey("gsdmManth")){
  154 + gsdmManth=map.get("gsdmManth").toString();
  155 + }
  156 + if(map.containsKey("fgsdmManth")){
  157 + fgsdmManth=map.get("fgsdmManth").toString();
  158 + }
  159 + String sql = "select r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type,r.s_name,r.lp_name "
151 160 + " from bsth_c_s_sp_info_real r "
152 161 + " where 1=1 ";
153   - if(map.get("startDate").toString()!=""){
  162 + if(map.get("startDate")!=null&&!map.get("startDate").equals("")){
154 163 sql+=" and to_days(r.schedule_date_str) BETWEEN to_days('" + map.get("startDate").toString() + "') ";
155 164 }
156 165  
157   - if(map.get("endDate").toString()!=""){
  166 + if(map.get("endDate")!=null&&!map.get("endDate").equals("")){
158 167 sql+=" and to_days('" + map.get("endDate").toString() + "') ";
159 168 }
160   - if( map.get("line").toString()!=""){
  169 + if(map.get("line")!=null&&!map.get("line").equals("")){
161 170 sql+=" and r.xl_bm='"+ map.get("line").toString() + "' ";
162 171 }
163 172 sql+= " AND r.gs_bm is not null and r.bc_type not in('in','out')";
164   - if(map.get("gsdmManth").toString()!=""){
  173 + if(map.get("gsdmManth")!=null&&!map.get("gsdmManth").equals("")){
165 174 sql+=" and r.gs_bm='"+map.get("gsdmManth").toString()+"' ";
166 175 }
167   - if(map.get("fgsdmManth").toString()!=""){
  176 + if(map.get("fgsdmManth")!=null&&!map.get("fgsdmManth").equals("")){
168 177 sql+=" and r.fgs_bm='"+map.get("fgsdmManth").toString()+"' ";
169 178 }
  179 + if(empnames.equals("售票员")){
  180 + sql+="and r.s_name is not null AND r.s_name !=''";
  181 + }
170 182 sql += " GROUP BY r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type ";
171 183  
172   - startDate = map.get("startDate").toString();
173   - endDate = map.get("endDate").toString();
  184 +
174 185 List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() {
175   -
  186 +
176 187 @Override
177 188 public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException {
178 189 Shiftuehiclemanth shif = new Shiftuehiclemanth();
179   - shif.setjName(arg0.getString("j_name"));
  190 + if(empnames.equals("驾驶员")){
  191 + shif.setjName(arg0.getString("j_name"));
  192 + }else if(empnames.equals("售票员")){
  193 + shif.setjName(arg0.getString("s_name")==null ? "":arg0.getString("s_name"));
  194 + }else if(empnames.equals("路牌")){
  195 + shif.setjName(arg0.getString("lp_name"));
  196 + }
  197 +
180 198 shif.setJgh(arg0.getString("j_gh"));
181 199 shif.setZbh(arg0.getString("cl_zbh"));
182 200 return shif;
183 201 }
184 202 });
185 203  
  204 + List<ScheduleRealInfo> sList;
  205 + List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineTj(map.get("line").toString(), map.get("startDate").toString(), map.get("endDate").toString(),
  206 + gsdmManth,fgsdmManth);
186 207 for(int i=0;i<list.size();i++){
187   - Shiftuehiclemanth s=list.get(i);
188   - Map<String, Object> maps = new HashMap<>();
189   -
190   - maps = commonService.findKMBC1(s.getjName(),s.getZbh(), startDate,
191   - endDate);
192   -
193   - s.setJhlc(maps.get("jhlc").toString());
194   - s.setEmptMileage(maps.get("ksgl").toString());
195   - s.setRemMileage(maps.get("remMileage").toString());
196   - s.setAddMileage(maps.get("addMileage").toString());
197   - s.setTotalm(maps.get("realMileage").toString());
198   - s.setCjbc(maps.get("cjbc").toString());
199   - s.setLjbc(maps.get("ljbc").toString());
200   - s.setSjbc(maps.get("sjbc").toString());
201   -
  208 + sList =new ArrayList<ScheduleRealInfo>();
  209 + Shiftuehiclemanth d=list.get(i);
  210 + for (int j = 0; j < lists.size(); j++) {
  211 + ScheduleRealInfo s=lists.get(j);
  212 + if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){
  213 + sList.add(s);
  214 + }
  215 + }
  216 +
  217 + double ksgl=culateMileageService.culateKsgl(sList);
  218 + double jccgl=culateMileageService.culateJccgl(sList);
  219 + double zksgl=Arith.add(ksgl, jccgl);
  220 + double ljgl=culateMileageService.culateLjgl(sList);
  221 + double sjgl=culateMileageService.culateSjgl(sList);
  222 + double zyygl=Arith.add(ljgl, sjgl);
  223 + double cjbc=culateMileageService.culateLbbc(sList);
  224 + double Ljbc=culateMileageService.culateLjbc(sList,"");
  225 + double cjgl=culateMileageService.culateLbgl(sList);
  226 + double zjgl=culateMileageService.culateLjgl(sList);
  227 + d.setEmptMileage(String.valueOf(zksgl));//空驶公里
  228 + d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里
  229 + d.setSjbc(String.valueOf(culateMileageService.culateSjbc(sList, "")+culateMileageService.culateLjbc(sList, "")));
  230 + d.setJhlc(String.valueOf(zyygl));//运营里程
  231 + d.setCjbc(String.valueOf(cjbc));//抽检班次
  232 + d.setLjbc(String.valueOf(Ljbc));//增加班次
  233 + d.setRemMileage(String.valueOf(cjgl));//抽检里程
  234 + d.setAddMileage(String.valueOf(zjgl));//增加里程
  235 +
202 236 }
  237 +
  238 +
203 239 return list;
204 240 }
205 241  
... ... @@ -207,32 +243,30 @@ public class FormsServiceImpl implements FormsService {
207 243 @Override
208 244 public List<Shifday> shifday(Map<String, Object> map) {
209 245  
210   - String sql ="select t.* from (select r.schedule_date,r.j_name,IFNULL(r.s_name,'')as s_name,"
211   - + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm FROM bsth_c_s_sp_info_real r where 1=1 "
212   - + " and to_days(r.schedule_date)=to_days('"+ map.get("date").toString() + "') "
213   - + " and r.xl_bm like '%"+map.get("line").toString()+"%' "
214   - + " and r.gs_bm='"+map.get("gsdmShif").toString()+"' "
215   - + " and r.fgs_bm='"+map.get("fgsdmShif").toString()+"' ) t"
216   - + " GROUP BY t.schedule_date,t.j_name,t.s_name, t.cl_zbh,t.xl_bm,t.j_gh,t.gs_bm,t.fgs_bm ";
217   - /*String sql = " select r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,"
218   - + " r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
219   - + " FROM bsth_c_s_sp_info_real r "
220   - + " where 1=1 ";
221   - if(map.get("date").toString()!=""){
222   - sql+=" and to_days(r.schedule_date)=to_days('"+ map.get("date").toString() + "') ";
  246 + String line="";
  247 + String date="";
  248 + String gsdmShif="";
  249 + String fgsdmShif="";
  250 + if(map.get("line")!=null&&!map.get("line").equals("")){
  251 + line =map.get("line").toString();
223 252 }
224   - if( map.get("line").toString()!=""){
225   - sql+=" and r.xl_bm=" + map.get("line").toString();
  253 + if(map.get("date")!=null&&!map.get("date").equals("")){
  254 + date =map.get("date").toString();
226 255 }
227   - sql+= " and r.bc_type not in('in','out')";
228   - if(map.get("gsdmShif").toString()!=""){
229   - sql+=" and r.gs_bm='"+map.get("gsdmShif").toString()+"'";
  256 + if(map.get("gsdmShif")!=null&&!map.get("gsdmShif").equals("")){
  257 + gsdmShif =map.get("gsdmShif").toString();
230 258 }
231   - if(map.get("fgsdmShif").toString()!=""){
232   - sql+=" and r.fgs_bm='"+map.get("fgsdmShif").toString()+"'";
233   - }
234   - sql += " GROUP BY r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
235   - + " ORDER BY r.lp_name asc";*/
  259 + if(map.get("fgsdmShif")!=null&&!map.get("fgsdmShif").equals("")){
  260 + fgsdmShif =map.get("fgsdmShif").toString();
  261 + }
  262 + String sql ="select t.* from (select r.schedule_date,r.j_name,IFNULL(r.s_name,'')as s_name,"
  263 + + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name FROM bsth_c_s_sp_info_real r where 1=1 "
  264 + + " and to_days(r.schedule_date)=to_days('"+date + "') "
  265 + + " and r.xl_bm like '%"+line+"%' "
  266 + + " and r.gs_bm like '%"+gsdmShif+"%' "
  267 + + " and r.fgs_bm like '%"+fgsdmShif+"%' ) t"
  268 + + " GROUP BY t.schedule_date,t.j_name,t.s_name, t.cl_zbh,t.xl_bm,t.j_gh,t.gs_bm,t.fgs_bm ";
  269 +
236 270  
237 271 List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() {
238 272  
... ... @@ -244,31 +278,48 @@ public class FormsServiceImpl implements FormsService {
244 278 shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString());
245 279 shifday.setCarPlate(arg0.getString("cl_zbh").toString());
246 280 shifday.setJgh(arg0.getString("j_gh"));
  281 + shifday.setLpName(arg0.getString("lp_name")== null ? "" : arg0.getString("lp_name").toString());
247 282 return shifday;
248 283 }
249 284  
250 285 });
251   -
  286 + List<ScheduleRealInfo> sList;
  287 + List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(map.get("line").toString(), map.get("date").toString());
252 288 for(int i=0;i<list.size();i++){
253   - Shifday shi=list.get(i);
254   - Map<String, Object> maps = new HashMap<>();
255   - maps = commonService.findKMBC2(shi.getJgh(), shi.getCarPlate(),
256   - shi.getRq());
257   - shi.setJhlc(maps.get("jhlc").toString());// 计划里程
258   - //shifday.setSjjhlc(map.get("remMileage").toString());//实际计划里程
259   - shi.setYygl(maps.get("yygl").toString());// 营运里程
260   - shi.setEmptMileage(maps.get("ksgl").toString());// 空驶里程
261   - shi.setRemMileage(maps.get("remMileage").toString());// 抽减里程
262   - shi.setAddMileage(maps.get("addMileage").toString());// 增加里程
263   - shi.setTotalm(maps.get("realMileage").toString());// 总里程
264   - shi.setJhbc(maps.get("jhbc").toString());// 计划班次
265   - //shifday.setSjjhbc(map.get("sjjhbc").toString());//实际计划班次
266   - shi.setCjbc(maps.get("cjbc").toString());// 抽减班次
267   - shi.setLjbc(maps.get("ljbc").toString());// 增加班次
268   - shi.setSjbc(maps.get("sjbc").toString());// 实际班次
269   -
270   - }
271   -
  289 + sList =new ArrayList<ScheduleRealInfo>();
  290 + Shifday d=list.get(i);
  291 + for (int j = 0; j < lists.size(); j++) {
  292 + ScheduleRealInfo s=lists.get(j);
  293 + if(d.getJgh().equals(s.getjGh()) && d.getCarPlate().equals(s.getClZbh())){
  294 + sList.add(s);
  295 + }
  296 + }
  297 +
  298 + double ksgl=culateMileageService.culateKsgl(sList);
  299 + double jccgl=culateMileageService.culateJccgl(sList);
  300 + double zksgl=Arith.add(ksgl, jccgl);
  301 + double ljgl=culateMileageService.culateLjgl(sList);
  302 + double sjgl=culateMileageService.culateSjgl(sList);
  303 + double zyygl=Arith.add(ljgl, sjgl);
  304 + double jhgl=culateMileageService.culateJhgl(sList);
  305 + double cjgl=culateMileageService.culateLbgl(sList);
  306 + double jhbc =culateMileageService.culateJhbc(sList,"");
  307 + double cjbc=culateMileageService.culateLbbc(sList);
  308 + double Ljbc=culateMileageService.culateLjbc(sList,"");
  309 + double zjgl=culateMileageService.culateLjgl(sList);
  310 + d.setEmptMileage(String.valueOf(zksgl));//空驶公里
  311 + d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里
  312 + d.setSjbc(String.valueOf(culateMileageService.culateSjbc(sList, "")+culateMileageService.culateLjbc(sList, "")));
  313 + d.setJhlc(String.valueOf(jhgl));//计划里程
  314 + d.setYygl(String.valueOf(zyygl));//运营公里
  315 + d.setSjjhlc(String.valueOf(sjgl));//实际计划里程
  316 + d.setRemMileage(String.valueOf(cjgl));//抽减里程
  317 + d.setJhbc(String.valueOf(jhbc));//计划班次
  318 + d.setCjbc(String.valueOf(cjbc));//抽检班次
  319 + d.setLjbc(String.valueOf(Ljbc));//增加班次
  320 + d.setAddMileage(String.valueOf(zjgl));//增加公里
  321 + d.setSjjhbc(String.valueOf(culateMileageService.culateSjbc(sList, "")));//实际计划班次
  322 + }
272 323 return list;
273 324 }
274 325  
... ...
src/main/resources/static/pages/forms/mould/shiftuehiclemanthlp.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/shiftuehiclemanthspy.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/mforms/shifdays/shifday.html
... ... @@ -27,7 +27,7 @@
27 27 <div class="col-md-12">
28 28 <div class="portlet light porttlet-fit bordered">
29 29 <div class="portlet-title">
30   - <form class="form-inline" action="" method="post">
  30 + <form class="form-inline" action="" method="get">
31 31 <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_shif">
32 32 <span class="item-label" style="width: 80px;">公司: </span>
33 33 <select class="form-control" name="company" id="gsdmShif" style="width: 140px;"></select>
... ... @@ -104,8 +104,12 @@ $(function(){
104 104 format : 'YYYY-MM-DD',
105 105 locale : 'zh-cn'
106 106 });
107   -
  107 + var fage=false;
108 108 var obj = [];
  109 + var xlList;
  110 +
  111 + $.get('/report/lineList',function(result){
  112 + xlList=result;
109 113 $.get('/user/companyData', function(result){
110 114 obj = result;
111 115 var options = '';
... ... @@ -124,7 +128,7 @@ $(function(){
124 128 $('#gsdmShif').html(options);
125 129 updateCompany();
126 130 });
127   -
  131 + })
128 132 $("#gsdmShif").on("change",updateCompany);
129 133 function updateCompany(){
130 134 var company = $('#gsdmShif').val();
... ... @@ -138,28 +142,60 @@ $(function(){
138 142 }
139 143 }
140 144 $('#fgsdmShif').html(options);
  145 + initXl();
141 146 }
142 147  
143 148  
144   - $.get('/basic/lineCode2Name',function(result){
145   - var data=[];
  149 +// $.get('/basic/lineCode2Name',function(result){
  150 +// var data=[];
  151 +
  152 +// for(var code in result){
  153 +// data.push({id: code, text: result[code]});
  154 +// }
  155 +// initPinYinSelect2('#line',data,'');
146 156  
147   - for(var code in result){
148   - data.push({id: code, text: result[code]});
  157 +// })
  158 +
  159 + $("#fgsdmShif").on("change",initXl);
  160 + function initXl(){
  161 + var data=[];
  162 + if(fage){
  163 + $("#line").select2("destroy").html('');
  164 + }
  165 + var fgs=$('#fgsdmShif').val();
  166 + var gs=$('#gsdmShif').val();
  167 + for(var i=0;i<xlList.length;i++){
  168 + if(gs!=""){
  169 + if(fgs!=""){
  170 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  171 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  172 + }
  173 + }else{
  174 + if(xlList[i]["gsbm"]==gs){
  175 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  176 + }
  177 + }
  178 + }
149 179 }
150 180 initPinYinSelect2('#line',data,'');
151   -
152   - })
  181 + fage=true;
  182 + }
  183 +
153 184  
154 185 $("#query").on("click",function(){
155 186 var line = $("#line").val();
156 187 var date = $("#date").val();
157 188 var gsdmShif = $("#gsdmShif").val();
158 189 var fgsdmShif = $("#fgsdmShif").val();
  190 + var params = {};
  191 + params.fgsdmShif =fgsdmShif;
  192 + params.date =date;
  193 + params.gsdmShif =gsdmShif;
  194 + params.line =line;
159 195 if(date=="" || date ==null){
160 196 layer.msg('请选择日期.');
161 197 }else{
162   - $post('/mcy_forms/shifday',{gsdmShif:gsdmShif,fgsdmShif:fgsdmShif, line:line,date:date},function(result){
  198 + $get('/mcy_forms/shifday',params,function(result){
163 199 $.each(result, function(i, obj) {
164 200 obj.requestType = reqCodeMap[obj.requestType];
165 201 });
... ... @@ -175,8 +211,14 @@ $(function(){
175 211 var line = $("#line").val();
176 212 var date = $("#date").val();
177 213 var gsdmShif = $("#gsdmShif").val();
178   - var fgsdmShif = $("#fgsdmShif").val();
179   - $post('/mcy_export/shifdayExport',{gsdmShif:gsdmShif,fgsdmShif:fgsdmShif,line:line,date:date,type:'export'},function(result){
  214 + var fgsdmShif = $("#fgsdmShif").val();
  215 + var params = {};
  216 + params.fgsdmShif =fgsdmShif;
  217 + params.date =date;
  218 + params.gsdmShif =gsdmShif;
  219 + params.line =line;
  220 + params.type='export';
  221 + $get('/mcy_export/shifdayExport',params,function(result){
180 222 window.open("/downloadFile/download?fileName=班次车辆人员日报表"+moment(date).format("YYYYMMDD"));
181 223 });
182 224 });
... ...
src/main/resources/static/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html
... ... @@ -53,6 +53,11 @@
53 53 </div>
54 54 <div style="display: inline-block;margin-left: 15px">
55 55 <span class="item-label" style="width: 150px;">统计: </span>
  56 + <select class="form-control" style="width: 136px;" id='empnames'>
  57 + <option value="驾驶员">驾驶员</option>
  58 + <option value="售票员">售票员</option>
  59 + <option value="路牌">路牌</option>
  60 + </select>
56 61 </div>
57 62 <div class="form-group">
58 63 <input class="btn btn-default" type="button" id="query" value="筛选"/>
... ... @@ -66,7 +71,7 @@
66 71 <thead>
67 72 <tr>
68 73 <th>序号</th>
69   - <th>驾驶员</th>
  74 + <th id='empname'>驾驶员</th>
70 75 <th>运营里程</th>
71 76 <th>空驶里程</th>
72 77 <th>抽减里程</th>
... ... @@ -97,8 +102,11 @@
97 102 format : 'YYYY-MM-DD',
98 103 locale : 'zh-cn'
99 104 });
100   -
  105 + var fage=false;
101 106 var obj = [];
  107 + var xlList;
  108 + $.get('/report/lineList',function(result){
  109 + xlList=result;
102 110 $.get('/user/companyData', function(result){
103 111 obj = result;
104 112 var options = '';
... ... @@ -117,7 +125,7 @@
117 125 $('#gsdmManth').html(options);
118 126 updateCompany();
119 127 });
120   -
  128 + })
121 129 $("#gsdmManth").on("change",updateCompany);
122 130 function updateCompany(){
123 131 var company = $('#gsdmManth').val();
... ... @@ -131,64 +139,43 @@
131 139 }
132 140 }
133 141 $('#fgsdmManth').html(options);
  142 + initXl();
134 143 }
135   -
136   -
137   - $.get('/basic/lineCode2Name',function(result){
  144 + $("#fgsdmManth").on("change",initXl);
  145 + function initXl(){
138 146 var data=[];
139   -
140   - for(var code in result){
141   - data.push({id: code, text: result[code]});
  147 + if(fage){
  148 + $("#line").select2("destroy").html('');
  149 + }
  150 + var fgs=$('#fgsdmManth').val();
  151 + var gs=$('#gsdmManth').val();
  152 + for(var i=0;i<xlList.length;i++){
  153 + if(gs!=""){
  154 + if(fgs!=""){
  155 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  156 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  157 + }
  158 + }else{
  159 + if(xlList[i]["gsbm"]==gs){
  160 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  161 + }
  162 + }
  163 + }
142 164 }
143 165 initPinYinSelect2('#line',data,'');
144   -
145   - })
146   - $('#lpName').select2({
147   - ajax: {
148   - url: '/realSchedule/findLpName',
149   - type: 'post',
150   - dataType: 'json',
151   - delay: 150,
152   - data: function(params){
153   - return{lpName: params.term};
154   - },
155   - processResults: function (data) {
156   - return {
157   - results: data
158   - };
159   - },
160   - cache: true
161   - },
162   - templateResult: function(repo){
163   - if (repo.loading) return repo.text;
164   - var h = '<span>'+repo.text+'</span>';
165   - return h;
166   - },
167   - escapeMarkup: function (markup) { return markup; },
168   - minimumInputLength: 1,
169   - templateSelection: function(repo){
170   - return repo.text;
171   - },
172   - language: {
173   - noResults: function(){
174   - return '<span style="color:red;font-size: 12px;">没有搜索到路牌!</span>';
175   - },
176   - inputTooShort : function(e) {
177   - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入路牌搜索路牌</span>';
178   - },
179   - searching : function() {
180   - return '<span style="color:gray;font-size: 12px;"> 正在搜索路牌...</span>';
181   - }
182   - }
183   - });
  166 + fage=true;
  167 + }
184 168 $("#query").on("click",function(){
185   - var line = $("#line").val();
186   - var startDate = $("#startDate").val();
187   - var endDate = $("#endDate").val();
188   - var lpName = $("#lpName").val();
189   - var gsdmManth= $("#gsdmManth").val();
190   - var fgsdmManth= $("#fgsdmManth").val();
191   - $post("/mcy_forms/shiftuehiclemanth",{gsdmManth:gsdmManth,fgsdmManth:fgsdmManth, line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){
  169 + $("#empname").html($("#empnames").val())
  170 + var params={};
  171 + params.empnames=$("#empnames").val();
  172 + params.line = $("#line").val();
  173 + params.startDate = $("#startDate").val();
  174 + params.endDate = $("#endDate").val();
  175 + params.lpName = $("#lpName").val();
  176 + params.gsdmManth= $("#gsdmManth").val();
  177 + params.fgsdmManth= $("#fgsdmManth").val();
  178 + $get("/mcy_forms/shiftuehiclemanth",params,function(result){
192 179 $("#sDate").text(startDate);
193 180 $("#eDate").text(endDate);
194 181 var temp = {};
... ... @@ -209,18 +196,28 @@
209 196 });
210 197  
211 198 $("#export").on("click",function(){
212   - var line = $("#line").val();
213   - var startDate = $("#startDate").val();
214   - var endDate = $("#endDate").val();
215   - var lpName = $("#lpName").val();
216   - var gsdmManth= $("#gsdmManth").val();
217   - var fgsdmManth= $("#fgsdmManth").val();
218   - $post('/mcy_export/shiftuehiclemanthExport',{gsdmManth:gsdmManth,fgsdmManth:fgsdmManth,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
219   - window.open("/downloadFile/download?fileName=班次车辆人员月报表"+moment(startDate).format("YYYYMMDD"));
  199 + var params={};
  200 + params.empnames=$("#empnames").val();
  201 + params.line = $("#line").val();
  202 + params.startDate = $("#startDate").val();
  203 + params.endDate = $("#endDate").val();
  204 + params.lpName = $("#lpName").val();
  205 + params.gsdmManth= $("#gsdmManth").val();
  206 + params.fgsdmManth= $("#fgsdmManth").val();
  207 + params.type='export';
  208 + $get('/mcy_export/shiftuehiclemanthExport',params,function(result){
  209 + window.open("/downloadFile/download?fileName=班次车辆人员月报表"+moment($("#startDate").val()).format("YYYYMMDD"));
220 210 });
221 211 });
222 212  
223   - });
  213 + });
  214 +
  215 +// $("#empnames").change(function(){
  216 +// $("#empname").html($("#empnames").val())
  217 +// // $("#query").click();
  218 +
  219 +// });
  220 +
224 221 </script>
225 222 <script type="text/html" id="list_shiftuehiclemanth">
226 223 {{each list as obj i}}
... ...