Commit 16a877b361f0d8e2970e52f77f5bc841c1d30d7e
1 parent
ec87f635
报表--线路车辆关联公司
Showing
18 changed files
with
635 additions
and
207 deletions
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
| ... | ... | @@ -115,7 +115,7 @@ public class MCY_FormsController { |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | // 营运线路名称统计表 |
| 118 | - @RequestMapping(value = "/daily", method = RequestMethod.POST) | |
| 118 | + @RequestMapping(value = "/daily", method = RequestMethod.GET) | |
| 119 | 119 | public List<Daily> daily(@RequestParam Map<String, Object> map) { |
| 120 | 120 | |
| 121 | 121 | return formsService.daily(map); | ... | ... |
src/main/java/com/bsth/controller/oil/YlbController.java
| ... | ... | @@ -40,7 +40,7 @@ public class YlbController extends BaseController<Ylb, Integer>{ |
| 40 | 40 | // SysUser user = SecurityUtils.getCurrentUser(); |
| 41 | 41 | t.setCreatetime(new Date()); |
| 42 | 42 | // Ylb t=new Ylb(); |
| 43 | - return yblService.save(t); | |
| 43 | + return yblService.saveYlb(t); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | ... | ... |
src/main/java/com/bsth/controller/report/ReportController.java
| ... | ... | @@ -98,4 +98,14 @@ public class ReportController { |
| 98 | 98 | return service.jobLjqk(map); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | + @RequestMapping(value="/lineList",method = RequestMethod.GET) | |
| 102 | + public List<Map<String,Object>> lineList(){ | |
| 103 | + return service.lineList(); | |
| 104 | + } | |
| 105 | + | |
| 106 | + @RequestMapping(value="/carList",method = RequestMethod.GET) | |
| 107 | + public List<Map<String,String>> carList(@RequestParam Map<String, Object> map){ | |
| 108 | + return service.carList(map); | |
| 109 | + } | |
| 110 | + | |
| 101 | 111 | } | ... | ... |
src/main/java/com/bsth/repository/oil/YlbRepository.java
| ... | ... | @@ -42,8 +42,13 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ |
| 42 | 42 | |
| 43 | 43 | @Transactional |
| 44 | 44 | @Modifying |
| 45 | - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3",nativeQuery=true) | |
| 45 | + @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 ",nativeQuery=true) | |
| 46 | 46 | List<Ylb> queryListYlb(String rq,String nbbm,String jgh); |
| 47 | + | |
| 48 | + @Transactional | |
| 49 | + @Modifying | |
| 50 | + @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4 order by ?5 asc",nativeQuery=true) | |
| 51 | + List<Ylb> checkYlb(String rq,String nbbm,String jgh,String xlbm,String px); | |
| 47 | 52 | /** |
| 48 | 53 | * 查询当天总的加注量和总里程 |
| 49 | 54 | * @param rq | ... | ... |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -94,9 +94,12 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 94 | 94 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and s.xlBm=?5 order by realExecDate,fcsj") |
| 95 | 95 | List<ScheduleRealInfo> queryListWaybillXcld(String jGh,String clZbh,String lpName,String date,String line); |
| 96 | 96 | |
| 97 | +// @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | |
| 98 | +// @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh like %?1% and s.clZbh like %?2% and s.scheduleDate = str_to_date(?3,'%Y-%m-%d') and s.gsBm like %?4% and s.fgsBm like %?5% order by realExecDate,fcsj") | |
| 99 | +// List<ScheduleRealInfo> queryListWaybill3(String jName,String clZbh,String date,String gsbm,String fgsbm); | |
| 97 | 100 | |
| 98 | 101 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 99 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlBm,s.adjustExps,s.fcsj") | |
| 102 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlBm,s.clZbh,s.jGh,s.adjustExps,s.fcsj") | |
| 100 | 103 | List<ScheduleRealInfo> scheduleByDateAndLineTjrb(String line,String date); |
| 101 | 104 | |
| 102 | 105 | ... | ... |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| ... | ... | @@ -6,6 +6,7 @@ import java.text.DecimalFormat; |
| 6 | 6 | import java.text.NumberFormat; |
| 7 | 7 | import java.text.ParseException; |
| 8 | 8 | import java.text.SimpleDateFormat; |
| 9 | +import java.util.ArrayList; | |
| 9 | 10 | import java.util.Date; |
| 10 | 11 | import java.util.HashMap; |
| 11 | 12 | import java.util.List; |
| ... | ... | @@ -24,6 +25,8 @@ import com.bsth.entity.mcy_forms.Singledata; |
| 24 | 25 | import com.bsth.entity.mcy_forms.Turnoutrate; |
| 25 | 26 | import com.bsth.entity.mcy_forms.Vehicleloading; |
| 26 | 27 | import com.bsth.entity.mcy_forms.Waybillday; |
| 28 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 29 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | |
| 27 | 30 | import com.bsth.data.BasicData; |
| 28 | 31 | import com.bsth.entity.mcy_forms.Allline; |
| 29 | 32 | import com.bsth.entity.mcy_forms.Changetochange; |
| ... | ... | @@ -32,6 +35,8 @@ import com.bsth.entity.mcy_forms.Executionrate; |
| 32 | 35 | import com.bsth.service.forms.CommonService; |
| 33 | 36 | import com.bsth.service.forms.FormsService; |
| 34 | 37 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 38 | +import com.bsth.service.report.CulateMileageService; | |
| 39 | +import com.bsth.util.Arith; | |
| 35 | 40 | |
| 36 | 41 | @Service |
| 37 | 42 | public class FormsServiceImpl implements FormsService { |
| ... | ... | @@ -44,6 +49,12 @@ public class FormsServiceImpl implements FormsService { |
| 44 | 49 | |
| 45 | 50 | @Autowired |
| 46 | 51 | CommonService commonService; |
| 52 | + | |
| 53 | + @Autowired | |
| 54 | + ScheduleRealInfoRepository scheduleRealInfoRepository; | |
| 55 | + | |
| 56 | + @Autowired | |
| 57 | + CulateMileageService culateMileageService; | |
| 47 | 58 | |
| 48 | 59 | // 行车路单日报表 |
| 49 | 60 | @Override |
| ... | ... | @@ -734,6 +745,8 @@ public class FormsServiceImpl implements FormsService { |
| 734 | 745 | + " and y.fgsdm like '%"+map.get("fgsdmDaily").toString()+"%'" |
| 735 | 746 | + " ) x" |
| 736 | 747 | + " on t.cl_zbh = x.nbbm "; |
| 748 | + | |
| 749 | + System.out.println(new Date()); | |
| 737 | 750 | List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() { |
| 738 | 751 | @Override |
| 739 | 752 | public Daily mapRow(ResultSet arg0, int arg1) throws SQLException { |
| ... | ... | @@ -746,14 +759,28 @@ public class FormsServiceImpl implements FormsService { |
| 746 | 759 | return daily; |
| 747 | 760 | } |
| 748 | 761 | }); |
| 749 | - | |
| 762 | + List<ScheduleRealInfo> sList; | |
| 763 | + List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(map.get("line").toString(), map.get("date").toString()); | |
| 750 | 764 | for(int i=0;i<list.size();i++){ |
| 765 | + sList =new ArrayList<ScheduleRealInfo>(); | |
| 751 | 766 | Daily d=list.get(i); |
| 752 | - Map<String, Object> maps = new HashMap<>(); | |
| 753 | - maps = commonService.findKMBC2(d.getJgh(),d.getZbh(),d.getRq()); | |
| 754 | - d.setJzl1(maps.get("ksgl").toString()); | |
| 755 | - d.setZlc(maps.get("realMileage").toString()); | |
| 756 | - d.setBc(maps.get("sjbc").toString()); | |
| 767 | + for (int j = 0; j < lists.size(); j++) { | |
| 768 | + ScheduleRealInfo s=lists.get(j); | |
| 769 | + if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){ | |
| 770 | + sList.add(s); | |
| 771 | + } | |
| 772 | + } | |
| 773 | + | |
| 774 | + double ksgl=culateMileageService.culateKsgl(sList); | |
| 775 | + double jccgl=culateMileageService.culateJccgl(sList); | |
| 776 | + double zksgl=Arith.add(ksgl, jccgl); | |
| 777 | + double ljgl=culateMileageService.culateLjgl(sList); | |
| 778 | + double sjgl=culateMileageService.culateSjgl(sList); | |
| 779 | + double zyygl=Arith.add(ljgl, sjgl); | |
| 780 | + | |
| 781 | + d.setJzl1(String.valueOf(zksgl));//空驶公里 | |
| 782 | + d.setZlc(String.valueOf(Arith.add(zksgl, zyygl))); | |
| 783 | + d.setBc(String.valueOf(culateMileageService.culateSjbc(sList, "")+culateMileageService.culateLjbc(sList, ""))); | |
| 757 | 784 | } |
| 758 | 785 | return list; |
| 759 | 786 | } | ... | ... |
src/main/java/com/bsth/service/oil/YlbService.java
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -1050,7 +1050,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1050 | 1050 | String rq=map.get("date").toString(); |
| 1051 | 1051 | String nbbm=map.get("nbbm").toString(); |
| 1052 | 1052 | String jsy =map.get("jsy").toString(); |
| 1053 | - List<Ylb> list= repository.queryListYlb(rq, nbbm, jsy); | |
| 1053 | + String xlbm=map.get("xlbm").toString(); | |
| 1054 | + List<Ylb> list= repository.checkYlb(rq, nbbm, jsy,xlbm,"nbbm"); | |
| 1054 | 1055 | String type=""; |
| 1055 | 1056 | if(list.size()>0){ |
| 1056 | 1057 | type="cunzai"; |
| ... | ... | @@ -1060,9 +1061,26 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1060 | 1061 | |
| 1061 | 1062 | @Override |
| 1062 | 1063 | public Map<String, Object> saveYlb(Ylb t) { |
| 1063 | - | |
| 1064 | - String gsbm=""; | |
| 1065 | - String fgsbm=""; | |
| 1064 | + Map<String, Object> map = new HashMap<>(); | |
| 1065 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | |
| 1066 | + String rq=sdf.format(t.getRq()); | |
| 1067 | + String gsdm=t.getSsgsdm(); | |
| 1068 | + String fgsdm=t.getFgsdm(); | |
| 1069 | + String xlbm=t.getXlbm(); | |
| 1070 | + String jhsj=t.getJhsj(); | |
| 1071 | + String jsy=t.getJsy(); | |
| 1072 | + String nbbm=t.getNbbm(); | |
| 1073 | + List<Ylb> list=repository.checkYlb(rq, nbbm, jsy, xlbm,"jhsj"); | |
| 1074 | + if(list.size()>0){ | |
| 1075 | + for (int i = 0; i < list.size(); i++) { | |
| 1076 | + Ylb y=list.get(i); | |
| 1077 | + String jhsj2=y.getJhsj(); | |
| 1078 | + } | |
| 1079 | + }else{ | |
| 1080 | + t.setJcsx(1); | |
| 1081 | + } | |
| 1082 | + map.put("status", ResponseCode.SUCCESS); | |
| 1083 | + map.put("t", t); | |
| 1066 | 1084 | return null; |
| 1067 | 1085 | } |
| 1068 | 1086 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -1652,7 +1652,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1652 | 1652 | Map<String, Object> map = new HashMap<String, Object>(); |
| 1653 | 1653 | map.put("xlName", xlName); |
| 1654 | 1654 | map.put("jhlc", culateService.culateJhgl(lists)); |
| 1655 | - map.put("sjgl", culateService.culateSjgl(lists)); | |
| 1655 | + map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists))); | |
| 1656 | 1656 | map.put("ssgl", culateService.culateLbgl(lists)); |
| 1657 | 1657 | map.put("ssgl_lz", culateService.culateCJLC(lists, "路阻")); |
| 1658 | 1658 | map.put("ssgl_dm", culateService.culateCJLC(lists, "吊慢")); | ... | ... |
src/main/java/com/bsth/service/report/CulateMileageService.java
src/main/java/com/bsth/service/report/ReportService.java
| ... | ... | @@ -34,4 +34,8 @@ public interface ReportService { |
| 34 | 34 | List<Map<String,Object>> jobLjqk(Map<String, Object> map); |
| 35 | 35 | |
| 36 | 36 | Map<String, Object> jobHzxx(Map<String, Object> map); |
| 37 | + | |
| 38 | + List<Map<String, Object>> lineList(); | |
| 39 | + | |
| 40 | + List<Map<String, String>> carList(Map<String, Object> map); | |
| 37 | 41 | } | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -24,12 +24,14 @@ import org.springframework.jdbc.core.RowMapper; |
| 24 | 24 | import org.springframework.stereotype.Service; |
| 25 | 25 | |
| 26 | 26 | import com.bsth.data.BasicData; |
| 27 | +import com.bsth.entity.Line; | |
| 27 | 28 | import com.bsth.entity.StationRoute; |
| 28 | 29 | import com.bsth.entity.excep.ArrivalInfo; |
| 29 | 30 | import com.bsth.entity.oil.Ylb; |
| 30 | 31 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 31 | 32 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 32 | 33 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| 34 | +import com.bsth.repository.LineRepository; | |
| 33 | 35 | import com.bsth.repository.StationRouteRepository; |
| 34 | 36 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 35 | 37 | import com.bsth.service.report.CulateMileageService; |
| ... | ... | @@ -52,6 +54,8 @@ public class ReportServiceImpl implements ReportService{ |
| 52 | 54 | StationRouteRepository stationRoutRepository; |
| 53 | 55 | @Autowired |
| 54 | 56 | CulateMileageService culateService; |
| 57 | + @Autowired | |
| 58 | + LineRepository lineRepository; | |
| 55 | 59 | @Override |
| 56 | 60 | public List<ScheduleRealInfo> queryListBczx(String line, String date,String clzbh) { |
| 57 | 61 | // TODO Auto-generated method stub |
| ... | ... | @@ -1158,9 +1162,11 @@ public class ReportServiceImpl implements ReportService{ |
| 1158 | 1162 | if (childTaskPlans.isEmpty()) { |
| 1159 | 1163 | Map<String, Object> newMap = new HashMap<String, Object>(); |
| 1160 | 1164 | String adjustExps = ""; |
| 1161 | - if (scheduleRealInfo.getAdjustExps() == "" || scheduleRealInfo.getAdjustExps() == null) { | |
| 1165 | + if (scheduleRealInfo.getAdjustExps() == null) { | |
| 1166 | + adjustExps = "其他"; | |
| 1167 | + } else if(scheduleRealInfo.getAdjustExps().equals("")){ | |
| 1162 | 1168 | adjustExps = "其他"; |
| 1163 | - } else { | |
| 1169 | + }else { | |
| 1164 | 1170 | adjustExps = scheduleRealInfo.getAdjustExps(); |
| 1165 | 1171 | } |
| 1166 | 1172 | if (scheduleRealInfo.getStatus() == -1) { |
| ... | ... | @@ -1182,7 +1188,9 @@ public class ReportServiceImpl implements ReportService{ |
| 1182 | 1188 | ChildTaskPlan childTaskPlan = it.next(); |
| 1183 | 1189 | if (childTaskPlan.isDestroy()) { |
| 1184 | 1190 | String destroyReason = ""; |
| 1185 | - if (childTaskPlan.getDestroyReason() == "" || childTaskPlan.getDestroyReason() == null) { | |
| 1191 | + if ( childTaskPlan.getDestroyReason() == null) { | |
| 1192 | + destroyReason = "其他"; | |
| 1193 | + }else if(childTaskPlan.getDestroyReason().equals("")){ | |
| 1186 | 1194 | destroyReason = "其他"; |
| 1187 | 1195 | } else { |
| 1188 | 1196 | destroyReason = childTaskPlan.getDestroyReason(); |
| ... | ... | @@ -1305,4 +1313,75 @@ public class ReportServiceImpl implements ReportService{ |
| 1305 | 1313 | newMap.put("ksgl", culateService.culateKsgl(sList)); |
| 1306 | 1314 | return newMap; |
| 1307 | 1315 | } |
| 1316 | + @Override | |
| 1317 | + public List<Map<String, Object>> lineList() { | |
| 1318 | + // TODO Auto-generated method stub | |
| 1319 | + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); | |
| 1320 | + Iterator<Line> iterator = lineRepository.findAll().iterator(); | |
| 1321 | + Line line; | |
| 1322 | + while (iterator.hasNext()) { | |
| 1323 | + line = iterator.next(); | |
| 1324 | + Map<String, Object> map=new HashMap<String,Object>(); | |
| 1325 | + map.put("gsbm", line.getCompany()); | |
| 1326 | + map.put("fgsbm", line.getBrancheCompany()); | |
| 1327 | + map.put("xlbm", line.getLineCode()); | |
| 1328 | + map.put("xlname", line.getName()); | |
| 1329 | + list.add(map); | |
| 1330 | + } | |
| 1331 | + return list; | |
| 1332 | + } | |
| 1333 | + @Override | |
| 1334 | + public List<Map<String, String>> carList(Map<String, Object> maps) { | |
| 1335 | + // TODO Auto-generated method stub | |
| 1336 | + // 转大写 | |
| 1337 | + String nbbm =maps.get("nbbm").toString().toUpperCase(); | |
| 1338 | + String gsbm=maps.get("gsbm").toString().trim(); | |
| 1339 | +// String fgsbm=maps.get("fgsbm").toString().trim(); | |
| 1340 | + String xlbm=maps.get("xlbm").toString().trim(); | |
| 1341 | + List<Map<String, String>> list = new ArrayList<Map<String, String>>(); | |
| 1342 | + Map<String, String> map; | |
| 1343 | + Set<String> allSet = BasicData.nbbm2CompanyCodeMap.keySet(); | |
| 1344 | + | |
| 1345 | + Line line; | |
| 1346 | + for (String k : allSet) { | |
| 1347 | + if (k.indexOf(nbbm) != -1) { | |
| 1348 | + // 所属线路 | |
| 1349 | + boolean fage=true; | |
| 1350 | + map = new HashMap<>(); | |
| 1351 | + line = BasicData.nbbm2LineMap.get(k); | |
| 1352 | + String clgsdm= BasicData.nbbm2CompanyCodeMap.get(k); | |
| 1353 | + | |
| 1354 | + map.put("id", k); | |
| 1355 | + map.put("text", k); | |
| 1356 | + if (null != line) { | |
| 1357 | + map.put("lineName", line.getName()); | |
| 1358 | + map.put("lineCode", line.getLineCode()); | |
| 1359 | + } | |
| 1360 | + | |
| 1361 | + if(!xlbm.equals("")){ | |
| 1362 | + if(null!=line){ | |
| 1363 | + if(!line.getLineCode().equals(xlbm)){ | |
| 1364 | + fage=false; | |
| 1365 | + } | |
| 1366 | + } | |
| 1367 | + | |
| 1368 | + } | |
| 1369 | + | |
| 1370 | + if(!gsbm.equals("")){ | |
| 1371 | + if(!clgsdm.equals(gsbm)){ | |
| 1372 | + fage=false; | |
| 1373 | + } | |
| 1374 | + } | |
| 1375 | + | |
| 1376 | + if(fage){ | |
| 1377 | + list.add(map); | |
| 1378 | + } | |
| 1379 | + | |
| 1380 | + } | |
| 1381 | + | |
| 1382 | + if (list.size() > 20) | |
| 1383 | + break; | |
| 1384 | + } | |
| 1385 | + return list; | |
| 1386 | + } | |
| 1308 | 1387 | } | ... | ... |
src/main/resources/static/pages/forms/statement/daily.html
| ... | ... | @@ -27,20 +27,21 @@ |
| 27 | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | 28 | <div class="portlet-title"> |
| 29 | 29 | <form class="form-inline" action=""> |
| 30 | - <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_daily"> | |
| 30 | + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_daily"> | |
| 31 | 31 | <span class="item-label" style="width: 80px;">公司: </span> |
| 32 | - <select class="form-control" name="company" id="gsdmDaily" style="width: 140px;"></select> | |
| 32 | + <select class="form-control" name="company" id="gsdmDaily" style="width: 180px;"></select> | |
| 33 | 33 | </div> |
| 34 | 34 | <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_daily"> |
| 35 | 35 | <span class="item-label" style="width: 80px;">分公司: </span> |
| 36 | - <select class="form-control" name="subCompany" id="fgsdmDaily" style="width: 140px;"></select> | |
| 37 | - </div> | |
| 38 | - <div style="display: inline-block;"> | |
| 36 | + <select class="form-control" name="subCompany" id="fgsdmDaily" style="width: 180px;"></select> | |
| 37 | + </div> | |
| 38 | + <div style="margin-top: 2px"></div> | |
| 39 | + <div style="display: inline-block;margin-left: 33px;"> | |
| 39 | 40 | <span class="item-label" style="width: 80px;">线路: </span> |
| 40 | 41 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 41 | 42 | </div> |
| 42 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 43 | - <span class="item-label" style="width: 80px;">时间: </span> | |
| 43 | + <div style="display: inline-block;margin-left: 24px;"> | |
| 44 | + <span class="item-label" style="width: 80px;"> 时间: </span> | |
| 44 | 45 | <input class="form-control" type="text" id="date" style="width: 180px;"/> |
| 45 | 46 | </div> |
| 46 | 47 | <div class="form-group"> |
| ... | ... | @@ -92,7 +93,7 @@ |
| 92 | 93 | <script> |
| 93 | 94 | $(function(){ |
| 94 | 95 | var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'}; |
| 95 | - | |
| 96 | + var fage=false; | |
| 96 | 97 | // 关闭左侧栏 |
| 97 | 98 | if (!$('body').hasClass('page-sidebar-closed')) |
| 98 | 99 | $('.menu-toggler.sidebar-toggler').click(); |
| ... | ... | @@ -101,27 +102,30 @@ |
| 101 | 102 | format : 'YYYY-MM-DD', |
| 102 | 103 | locale : 'zh-cn' |
| 103 | 104 | }); |
| 104 | - | |
| 105 | + var xlList; | |
| 105 | 106 | var obj = []; |
| 106 | - $.get('/user/companyData', function(result){ | |
| 107 | - obj = result; | |
| 108 | - var options = ''; | |
| 109 | - for(var i = 0; i < obj.length; i++){ | |
| 110 | - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 111 | - } | |
| 112 | - | |
| 113 | - if(obj.length ==0){ | |
| 114 | - $("#gsdmDiv_daily").css('display','none'); | |
| 115 | - $('#gsdmDiv_daily').css('display','none'); | |
| 116 | - }else if(obj.length ==1){ | |
| 117 | - $("#fgsdmDiv_daily").css('display','none'); | |
| 118 | - if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 119 | - $('#fgsdmDiv_daily').css('display','none'); | |
| 120 | - } | |
| 121 | - $('#gsdmDaily').html(options); | |
| 122 | - updateCompany(); | |
| 123 | - }); | |
| 124 | - | |
| 107 | + | |
| 108 | + | |
| 109 | + $.get('/report/lineList',function(result){ | |
| 110 | + xlList=result; | |
| 111 | + $.get('/user/companyData', function(result){ | |
| 112 | + obj = result; | |
| 113 | + var options = ''; | |
| 114 | + for(var i = 0; i < obj.length; i++){ | |
| 115 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 116 | + } | |
| 117 | + | |
| 118 | + if(obj.length ==0){ | |
| 119 | + $("#gsdmDiv_daily").css('display','none'); | |
| 120 | + }else if(obj.length ==1){ | |
| 121 | + $("#gsdmDiv_daily").css('display','none'); | |
| 122 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 123 | + $('#fgsdmDiv_daily').css('display','none'); | |
| 124 | + } | |
| 125 | + $('#gsdmDaily').html(options); | |
| 126 | + updateCompany(); | |
| 127 | + }); | |
| 128 | + }) | |
| 125 | 129 | $("#gsdmDaily").on("change",updateCompany); |
| 126 | 130 | function updateCompany(){ |
| 127 | 131 | var company = $('#gsdmDaily').val(); |
| ... | ... | @@ -135,10 +139,10 @@ |
| 135 | 139 | } |
| 136 | 140 | } |
| 137 | 141 | $('#fgsdmDaily').html(options); |
| 142 | + initXl(); | |
| 138 | 143 | } |
| 139 | 144 | |
| 140 | - | |
| 141 | - $.get('/basic/lineCode2Name',function(result){ | |
| 145 | + /* $.get('/basic/lineCode2Name',function(result){ | |
| 142 | 146 | var data=[]; |
| 143 | 147 | |
| 144 | 148 | for(var code in result){ |
| ... | ... | @@ -146,8 +150,33 @@ |
| 146 | 150 | } |
| 147 | 151 | initPinYinSelect2('#line',data,''); |
| 148 | 152 | |
| 149 | - }) | |
| 150 | - | |
| 153 | + }) */ | |
| 154 | + | |
| 155 | + $("#fgsdmDaily").on("change",initXl); | |
| 156 | + function initXl(){ | |
| 157 | + var data=[]; | |
| 158 | + if(fage){ | |
| 159 | + $("#line").select2("destroy").html(''); | |
| 160 | + } | |
| 161 | + var fgs=$('#fgsdmDaily').val(); | |
| 162 | + var gs=$('#gsdmDaily').val(); | |
| 163 | + for(var i=0;i<xlList.length;i++){ | |
| 164 | + if(gs!=""){ | |
| 165 | + if(fgs!=""){ | |
| 166 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | |
| 167 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 168 | + } | |
| 169 | + }else{ | |
| 170 | + if(xlList[i]["gsbm"]==gs){ | |
| 171 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 172 | + } | |
| 173 | + } | |
| 174 | + } | |
| 175 | + } | |
| 176 | + initPinYinSelect2('#line',data,''); | |
| 177 | + fage=true; | |
| 178 | + } | |
| 179 | + | |
| 151 | 180 | var line; |
| 152 | 181 | var date; |
| 153 | 182 | var gsdmDaily; |
| ... | ... | @@ -160,7 +189,7 @@ |
| 160 | 189 | gsdmDaily=$("#gsdmDaily").val(); |
| 161 | 190 | fgsdmDaily = $("#fgsdmDaily").val(); |
| 162 | 191 | |
| 163 | - $post('/mcy_forms/daily',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily, line:line,date:date,type:'query'},function(result){ | |
| 192 | + $get('/mcy_forms/daily',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily, line:line,date:date,type:'query'},function(result){ | |
| 164 | 193 | $("#form_line").text(lineName); |
| 165 | 194 | $("#form_date").text(date); |
| 166 | 195 | // 把数据填充到模版中 |
| ... | ... | @@ -187,7 +216,7 @@ |
| 187 | 216 | $("#total_zgl").text(total_zgl.toFixed(2)); |
| 188 | 217 | $("#total_ks").text(total_ks.toFixed(2)); |
| 189 | 218 | $("#total_yh").text(total_yh.toFixed(2)); |
| 190 | - $("#total_bc").text(total_bc.toFixed(2)); | |
| 219 | + $("#total_bc").text(total_bc.toFixed(0)); | |
| 191 | 220 | |
| 192 | 221 | var temp = {}; |
| 193 | 222 | var today_account = 0; | ... | ... |
src/main/resources/static/pages/forms/statement/jobSummary.html
| ... | ... | @@ -27,12 +27,21 @@ |
| 27 | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | 28 | <div class="portlet-title"> |
| 29 | 29 | <form class="form-inline" action=""> |
| 30 | + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_job"> | |
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | |
| 32 | + <select class="form-control" name="company" id="gsdmJob" style="width: 180px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_job"> | |
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | |
| 36 | + <select class="form-control" name="subCompany" id="fgsdmJob" style="width: 180px;"></select> | |
| 37 | + </div> | |
| 38 | + <div style="margin-top: 2px"></div> | |
| 30 | 39 | <div style="display: inline-block;"> |
| 31 | - <span class="item-label" style="width: 80px;">线路: </span> | |
| 40 | + <span class="item-label" style="width: 80px; margin-left: 33px;">线路: </span> | |
| 32 | 41 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 33 | 42 | </div> |
| 34 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 35 | - <span class="item-label" style="width: 80px;">时间: </span> | |
| 43 | + <div style="display: inline-block;margin-left: 24px;"> | |
| 44 | + <span class="item-label" style="width: 80px;"> 时间: </span> | |
| 36 | 45 | <input class="form-control" type="text" id="date" style="width: 180px;"/> |
| 37 | 46 | </div> |
| 38 | 47 | <div class="form-group"> |
| ... | ... | @@ -184,6 +193,7 @@ |
| 184 | 193 | |
| 185 | 194 | <script> |
| 186 | 195 | $(function(){ |
| 196 | + var fage=false; | |
| 187 | 197 | // 关闭左侧栏 |
| 188 | 198 | if (!$('body').hasClass('page-sidebar-closed')) |
| 189 | 199 | $('.menu-toggler.sidebar-toggler').click(); |
| ... | ... | @@ -193,7 +203,72 @@ |
| 193 | 203 | locale : 'zh-cn' |
| 194 | 204 | }); |
| 195 | 205 | |
| 196 | - $.get('/basic/lineCode2Name',function(result){ | |
| 206 | + var xlList; | |
| 207 | + var obj = []; | |
| 208 | + | |
| 209 | + | |
| 210 | + $.get('/report/lineList',function(result){ | |
| 211 | + xlList=result; | |
| 212 | + $.get('/user/companyData', function(result){ | |
| 213 | + obj = result; | |
| 214 | + var options = ''; | |
| 215 | + for(var i = 0; i < obj.length; i++){ | |
| 216 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 217 | + } | |
| 218 | + | |
| 219 | + if(obj.length ==0){ | |
| 220 | + $("#gsdmDiv_job").css('display','none'); | |
| 221 | + }else if(obj.length ==1){ | |
| 222 | + $("#gsdmDiv_job").css('display','none'); | |
| 223 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 224 | + $('#fgsdmDiv_job').css('display','none'); | |
| 225 | + } | |
| 226 | + $('#gsdmJob').html(options); | |
| 227 | + updateCompany(); | |
| 228 | + }); | |
| 229 | + }) | |
| 230 | + $("#gsdmJob").on("change",updateCompany); | |
| 231 | + function updateCompany(){ | |
| 232 | + var company = $('#gsdmJob').val(); | |
| 233 | + var options = ''; | |
| 234 | + for(var i = 0; i < obj.length; i++){ | |
| 235 | + if(obj[i].companyCode == company){ | |
| 236 | + var children = obj[i].children; | |
| 237 | + for(var j = 0; j < children.length; j++){ | |
| 238 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 239 | + } | |
| 240 | + } | |
| 241 | + } | |
| 242 | + $('#fgsdmJob').html(options); | |
| 243 | + initXl(); | |
| 244 | + } | |
| 245 | + | |
| 246 | + $("#fgsdmJob").on("change",initXl); | |
| 247 | + function initXl(){ | |
| 248 | + var data=[]; | |
| 249 | + if(fage){ | |
| 250 | + $("#line").select2("destroy").html(''); | |
| 251 | + } | |
| 252 | + var fgs=$('#fgsdmJob').val(); | |
| 253 | + var gs=$('#gsdmJob').val(); | |
| 254 | + for(var i=0;i<xlList.length;i++){ | |
| 255 | + if(gs!=""){ | |
| 256 | + if(fgs!=""){ | |
| 257 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | |
| 258 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 259 | + } | |
| 260 | + }else{ | |
| 261 | + if(xlList[i]["gsbm"]==gs){ | |
| 262 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 263 | + } | |
| 264 | + } | |
| 265 | + } | |
| 266 | + } | |
| 267 | + initPinYinSelect2('#line',data,''); | |
| 268 | + fage=true; | |
| 269 | + } | |
| 270 | + | |
| 271 | + /* $.get('/basic/lineCode2Name',function(result){ | |
| 197 | 272 | var data=[]; |
| 198 | 273 | |
| 199 | 274 | for(var code in result){ |
| ... | ... | @@ -201,7 +276,7 @@ |
| 201 | 276 | } |
| 202 | 277 | initPinYinSelect2('#line',data,''); |
| 203 | 278 | |
| 204 | - }) | |
| 279 | + }) */ | |
| 205 | 280 | |
| 206 | 281 | $("#query").on("click",function(){ |
| 207 | 282 | var line=$("#line").val();; | ... | ... |
src/main/resources/static/pages/forms/statement/scheduleDaily.html
| ... | ... | @@ -27,12 +27,21 @@ |
| 27 | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | 28 | <div class="portlet-title"> |
| 29 | 29 | <form class="form-inline" action=""> |
| 30 | + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_ddrb"> | |
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | |
| 32 | + <select class="form-control" name="company" id="gsdmDdrb" style="width: 180px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_ddrb"> | |
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | |
| 36 | + <select class="form-control" name="subCompany" id="fgsdmDdrb" style="width: 180px;"></select> | |
| 37 | + </div> | |
| 38 | + <div style="margin-top: 2px"></div> | |
| 30 | 39 | <div style="display: inline-block;"> |
| 31 | - <span class="item-label" style="width: 80px;">线路: </span> | |
| 40 | + <span class="item-label" style="width: 80px;margin-left: 33px;">线路: </span> | |
| 32 | 41 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 33 | 42 | </div> |
| 34 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 35 | - <span class="item-label" style="width: 80px;">时间: </span> | |
| 43 | + <div style="display: inline-block;margin-left: 24px;"> | |
| 44 | + <span class="item-label" style="width: 80px;"> 时间: </span> | |
| 36 | 45 | <input class="form-control" type="text" id="date" style="width: 180px;"/> |
| 37 | 46 | </div> |
| 38 | 47 | <div class="form-group"> |
| ... | ... | @@ -254,7 +263,7 @@ |
| 254 | 263 | |
| 255 | 264 | <script> |
| 256 | 265 | $(function(){ |
| 257 | - | |
| 266 | + var fage=false; | |
| 258 | 267 | // 关闭左侧栏 |
| 259 | 268 | if (!$('body').hasClass('page-sidebar-closed')) |
| 260 | 269 | $('.menu-toggler.sidebar-toggler').click(); |
| ... | ... | @@ -274,7 +283,7 @@ |
| 274 | 283 | $("#date").val(year + "-" + month + "-" + day); |
| 275 | 284 | |
| 276 | 285 | $("#ddrbBody").height($(window).height()-280); |
| 277 | - $.get('/basic/lineCode2Name',function(result){ | |
| 286 | + /* $.get('/basic/lineCode2Name',function(result){ | |
| 278 | 287 | var data=[]; |
| 279 | 288 | |
| 280 | 289 | for(var code in result){ |
| ... | ... | @@ -282,8 +291,67 @@ |
| 282 | 291 | } |
| 283 | 292 | initPinYinSelect2('#line',data,''); |
| 284 | 293 | |
| 285 | - }) | |
| 294 | + }) */ | |
| 286 | 295 | |
| 296 | + $.get('/report/lineList',function(result){ | |
| 297 | + xlList=result; | |
| 298 | + $.get('/user/companyData', function(result){ | |
| 299 | + obj = result; | |
| 300 | + var options = ''; | |
| 301 | + for(var i = 0; i < obj.length; i++){ | |
| 302 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 303 | + } | |
| 304 | + | |
| 305 | + if(obj.length ==0){ | |
| 306 | + $("#gsdmDiv_ddrb").css('display','none'); | |
| 307 | + }else if(obj.length ==1){ | |
| 308 | + $("#gsdmDiv_ddrb").css('display','none'); | |
| 309 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 310 | + $('#fgsdmDiv_ddrb').css('display','none'); | |
| 311 | + } | |
| 312 | + $('#gsdmDdrb').html(options); | |
| 313 | + updateCompany(); | |
| 314 | + }); | |
| 315 | + }) | |
| 316 | + $("#gsdmDdrb").on("change",updateCompany); | |
| 317 | + function updateCompany(){ | |
| 318 | + var company = $('#gsdmDdrb').val(); | |
| 319 | + var options = ''; | |
| 320 | + for(var i = 0; i < obj.length; i++){ | |
| 321 | + if(obj[i].companyCode == company){ | |
| 322 | + var children = obj[i].children; | |
| 323 | + for(var j = 0; j < children.length; j++){ | |
| 324 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 325 | + } | |
| 326 | + } | |
| 327 | + } | |
| 328 | + $('#fgsdmDdrb').html(options); | |
| 329 | + initXl(); | |
| 330 | + } | |
| 331 | + $("#fgsdmDdrb").on("change",initXl); | |
| 332 | + function initXl(){ | |
| 333 | + var data=[]; | |
| 334 | + if(fage){ | |
| 335 | + $("#line").select2("destroy").html(''); | |
| 336 | + } | |
| 337 | + var fgs=$('#fgsdmDdrb').val(); | |
| 338 | + var gs=$('#gsdmDdrb').val(); | |
| 339 | + for(var i=0;i<xlList.length;i++){ | |
| 340 | + if(gs!=""){ | |
| 341 | + if(fgs!=""){ | |
| 342 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | |
| 343 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 344 | + } | |
| 345 | + }else{ | |
| 346 | + if(xlList[i]["gsbm"]==gs){ | |
| 347 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 348 | + } | |
| 349 | + } | |
| 350 | + } | |
| 351 | + } | |
| 352 | + initPinYinSelect2('#line',data,''); | |
| 353 | + fage=true; | |
| 354 | + } | |
| 287 | 355 | $('#export').attr('disabled', "true"); |
| 288 | 356 | |
| 289 | 357 | var line = $("#line").val(); | ... | ... |
src/main/resources/static/pages/forms/statement/waybill.html
| ... | ... | @@ -27,12 +27,21 @@ |
| 27 | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | 28 | <div class="portlet-title"> |
| 29 | 29 | <form class="form-inline" action=""> |
| 30 | - <div style="display: inline-block;"> | |
| 30 | + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_xcld"> | |
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | |
| 32 | + <select class="form-control" name="company" id="gsdmXcld" style="width: 180px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_xcld"> | |
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | |
| 36 | + <select class="form-control" name="subCompany" id="fgsdmXcld" style="width: 180px;"></select> | |
| 37 | + </div> | |
| 38 | + <div style="margin-top: 2px"></div> | |
| 39 | + <div style="display: inline-block; margin-left: 33px;"> | |
| 31 | 40 | <span class="item-label" style="width: 80px;">线路: </span> |
| 32 | 41 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 33 | 42 | </div> |
| 34 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 35 | - <span class="item-label" style="width: 80px;">时间: </span> | |
| 43 | + <div style="display: inline-block;margin-left: 24px;"> | |
| 44 | + <span class="item-label" style="width: 80px;"> 时间: </span> | |
| 36 | 45 | <input class="form-control" type="text" id="date" style="width: 180px;"/> |
| 37 | 46 | </div> |
| 38 | 47 | <div class="form-group" style="display: inline-block;margin-left: 15px;"> |
| ... | ... | @@ -87,6 +96,7 @@ |
| 87 | 96 | |
| 88 | 97 | <script> |
| 89 | 98 | $(function(){ |
| 99 | + var fage=false; | |
| 90 | 100 | // 关闭左侧栏 |
| 91 | 101 | if (!$('body').hasClass('page-sidebar-closed')) |
| 92 | 102 | $('.menu-toggler.sidebar-toggler').click(); |
| ... | ... | @@ -105,56 +115,76 @@ |
| 105 | 115 | if(day < 10) |
| 106 | 116 | day = "0" + day; |
| 107 | 117 | $("#date").val(year + "-" + month + "-" + day); |
| 108 | - $.get('/basic/lineCode2Name',function(result){ | |
| 109 | - var data=[]; | |
| 118 | + | |
| 119 | + var obj = []; | |
| 120 | + var xlList; | |
| 121 | + $.get('/report/lineList',function(result){ | |
| 122 | + xlList=result; | |
| 110 | 123 | |
| 111 | - for(var code in result){ | |
| 112 | - data.push({id: code, text: result[code]}); | |
| 124 | + $.get('/user/companyData', function(result){ | |
| 125 | + obj = result; | |
| 126 | + console.log(obj); | |
| 127 | + var options = ''; | |
| 128 | + for(var i = 0; i < obj.length; i++){ | |
| 129 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 130 | + } | |
| 131 | + | |
| 132 | + if(obj.length ==0){ | |
| 133 | + $("#gsdmDiv_xcld").css('display','none'); | |
| 134 | + }else if(obj.length ==1){ | |
| 135 | + $("#gsdmDiv_xcld").css('display','none'); | |
| 136 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 137 | + $('#fgsdmDiv_xcld').css('display','none'); | |
| 138 | + } | |
| 139 | + $('#gsdmXcld').html(options); | |
| 140 | + | |
| 141 | + updateCompany(); | |
| 142 | + }); | |
| 143 | + }); | |
| 144 | + | |
| 145 | + $("#gsdmXcld").on("change",updateCompany); | |
| 146 | + function updateCompany(){ | |
| 147 | + var company = $('#gsdmXcld').val(); | |
| 148 | + var options = ''; | |
| 149 | + for(var i = 0; i < obj.length; i++){ | |
| 150 | + if(obj[i].companyCode == company){ | |
| 151 | + var children = obj[i].children; | |
| 152 | + for(var j = 0; j < children.length; j++){ | |
| 153 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 154 | + } | |
| 155 | + } | |
| 113 | 156 | } |
| 114 | - initPinYinSelect2('#line',data,''); | |
| 115 | - | |
| 116 | - }) | |
| 157 | + $('#fgsdmXcld').html(options); | |
| 158 | + initXl(); | |
| 159 | + } | |
| 117 | 160 | |
| 118 | - /* $('#line').select2({ | |
| 119 | - ajax: { | |
| 120 | - url: '/realSchedule/findLine', | |
| 121 | - type: 'post', | |
| 122 | - dataType: 'json', | |
| 123 | - delay: 150, | |
| 124 | - data: function(params){ | |
| 125 | - return{line: params.term}; | |
| 126 | - }, | |
| 127 | - processResults: function (data) { | |
| 128 | - return { | |
| 129 | - results: data | |
| 130 | - }; | |
| 131 | - }, | |
| 132 | - cache: true | |
| 133 | - }, | |
| 134 | - templateResult: function(repo){ | |
| 135 | - if (repo.loading) return repo.text; | |
| 136 | - var h = '<span>'+repo.text+'</span>'; | |
| 137 | - return h; | |
| 138 | - }, | |
| 139 | - escapeMarkup: function (markup) { return markup; }, | |
| 140 | - minimumInputLength: 1, | |
| 141 | - templateSelection: function(repo){ | |
| 142 | - return repo.text; | |
| 143 | - }, | |
| 144 | - language: { | |
| 145 | - noResults: function(){ | |
| 146 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 147 | - }, | |
| 148 | - inputTooShort : function(e) { | |
| 149 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 150 | - }, | |
| 151 | - searching : function() { | |
| 152 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 153 | - } | |
| 154 | - } | |
| 155 | - }); | |
| 156 | - */ | |
| 157 | 161 | |
| 162 | + | |
| 163 | + | |
| 164 | + $("#fgsdmXcld").on("change",initXl); | |
| 165 | + function initXl(){ | |
| 166 | + var data=[]; | |
| 167 | + if(fage){ | |
| 168 | + $("#line").select2("destroy").html(''); | |
| 169 | + } | |
| 170 | + var fgs=$('#fgsdmXcld').val(); | |
| 171 | + var gs=$('#gsdmXcld').val(); | |
| 172 | + for(var i=0;i<xlList.length;i++){ | |
| 173 | + if(gs!=""){ | |
| 174 | + if(fgs!=""){ | |
| 175 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | |
| 176 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 177 | + } | |
| 178 | + }else{ | |
| 179 | + if(xlList[i]["gsbm"]==gs){ | |
| 180 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 181 | + } | |
| 182 | + } | |
| 183 | + } | |
| 184 | + } | |
| 185 | + initPinYinSelect2('#line',data,''); | |
| 186 | + fage=true; | |
| 187 | + } | |
| 158 | 188 | var date = ''; |
| 159 | 189 | var line =''; |
| 160 | 190 | $("#query").on("click",function(){ | ... | ... |
src/main/resources/static/pages/oil/add.html
| ... | ... | @@ -26,6 +26,18 @@ |
| 26 | 26 | </div> |
| 27 | 27 | <div class="form-body"> |
| 28 | 28 | <div class="form-group"> |
| 29 | + <label class="col-md-3 control-label">公司</label> | |
| 30 | + <div class="col-md-4"> | |
| 31 | + <select class="form-control" name="ssgsdm" id="ssgsdm" ></select> | |
| 32 | + </div> | |
| 33 | + </div> | |
| 34 | + <div class="form-group"> | |
| 35 | + <label class="col-md-3 control-label">分公司</label> | |
| 36 | + <div class="col-md-4"> | |
| 37 | + <select class="form-control" name="fgsdm" id="fgsdm" ></select> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + <div class="form-group"> | |
| 29 | 41 | <label class="col-md-3 control-label">线路</label> |
| 30 | 42 | <div class="col-md-4"> |
| 31 | 43 | <select class="form-control" name="xlbm" id="xlbm" ></select> |
| ... | ... | @@ -148,59 +160,80 @@ |
| 148 | 160 | </div> |
| 149 | 161 | <script> |
| 150 | 162 | (function(){ |
| 163 | + var fage=false; | |
| 164 | + var obj = []; | |
| 165 | + var xlList; | |
| 166 | + $.get('/report/lineList',function(result){ | |
| 167 | + xlList=result; | |
| 168 | + | |
| 169 | + $.get('/user/companyData', function(result){ | |
| 170 | + obj = result; | |
| 171 | + console.log(obj); | |
| 172 | + var options = ''; | |
| 173 | + for(var i = 0; i < obj.length; i++){ | |
| 174 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 175 | + } | |
| 176 | + $('#ssgsdm').html(options); | |
| 177 | + | |
| 178 | + updateCompany(); | |
| 179 | + }); | |
| 180 | + }); | |
| 181 | + | |
| 182 | + $("#ssgsdm").on("change",updateCompany); | |
| 183 | + function updateCompany(){ | |
| 184 | + var company = $('#ssgsdm').val(); | |
| 185 | + var options = ''; | |
| 186 | + for(var i = 0; i < obj.length; i++){ | |
| 187 | + if(obj[i].companyCode == company){ | |
| 188 | + var children = obj[i].children; | |
| 189 | + for(var j = 0; j < children.length; j++){ | |
| 190 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 191 | + } | |
| 192 | + } | |
| 193 | + } | |
| 194 | + $('#fgsdm').html(options); | |
| 195 | + initXl(); | |
| 196 | + } | |
| 197 | + $("#fgsdm").on("change",initXl); | |
| 198 | + function initXl(){ | |
| 199 | + var data=[]; | |
| 200 | + if(fage){ | |
| 201 | + $("#xlbm").select2("destroy").html(''); | |
| 202 | + } | |
| 203 | + var fgs=$('#fgsdm').val(); | |
| 204 | + var gs=$('#ssgsdm').val(); | |
| 205 | + for(var i=0;i<xlList.length;i++){ | |
| 206 | + if(gs!=""){ | |
| 207 | + if(fgs!=""){ | |
| 208 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | |
| 209 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 210 | + } | |
| 211 | + }else{ | |
| 212 | + if(xlList[i]["gsbm"]==gs){ | |
| 213 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 214 | + } | |
| 215 | + } | |
| 216 | + } | |
| 217 | + } | |
| 218 | + initPinYinSelect2('#xlbm',data,''); | |
| 219 | + fage=true; | |
| 220 | + } | |
| 151 | 221 | $("#date").datetimepicker({ |
| 152 | 222 | format : 'YYYY-MM-DD', |
| 153 | 223 | locale : 'zh-cn' |
| 154 | 224 | }); |
| 155 | - //搜索线路 | |
| 156 | - $('#xlbm').select2({ | |
| 157 | - placeholder: '搜索线路...', | |
| 158 | - ajax: { | |
| 159 | - url: '/realSchedule/findLine', | |
| 160 | - type: 'post', | |
| 161 | - dataType: 'json', | |
| 162 | - delay: 150, | |
| 163 | - data: function(params){ | |
| 164 | - return{line: params.term}; | |
| 165 | - }, | |
| 166 | - processResults: function (data) { | |
| 167 | - return { | |
| 168 | - results: data | |
| 169 | - }; | |
| 170 | - }, | |
| 171 | - cache: true | |
| 172 | - }, | |
| 173 | - templateResult: function(repo){ | |
| 174 | - if (repo.loading) return repo.text; | |
| 175 | - var h = '<span>'+repo.text+'</span>'; | |
| 176 | - return h; | |
| 177 | - }, | |
| 178 | - escapeMarkup: function (markup) { return markup; }, | |
| 179 | - minimumInputLength: 1, | |
| 180 | - templateSelection: function(repo){ | |
| 181 | - return repo.text; | |
| 182 | - }, | |
| 183 | - language: { | |
| 184 | - noResults: function(){ | |
| 185 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 186 | - }, | |
| 187 | - inputTooShort : function(e) { | |
| 188 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 189 | - }, | |
| 190 | - searching : function() { | |
| 191 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 192 | - } | |
| 193 | - } | |
| 194 | - }); | |
| 195 | 225 | |
| 196 | 226 | $('#nbbm').select2({ |
| 197 | 227 | placeholder: '搜索车辆...', |
| 198 | 228 | ajax: { |
| 199 | - url: '/realSchedule/sreachVehic', | |
| 229 | + url: '/report/carList', | |
| 200 | 230 | dataType: 'json', |
| 201 | 231 | delay: 150, |
| 202 | 232 | data: function(params){ |
| 203 | - return{nbbm: params.term}; | |
| 233 | + return{nbbm: params.term, | |
| 234 | + gsbm:$('#ssgsdm').val(), | |
| 235 | + fgsbm:$('#fgsdm').val(), | |
| 236 | + xlbm:$('#xlbm').val()}; | |
| 204 | 237 | }, |
| 205 | 238 | processResults: function (data) { |
| 206 | 239 | return { |
| ... | ... | @@ -329,10 +362,12 @@ |
| 329 | 362 | var nbbm=$("#nbbm").val(); |
| 330 | 363 | var date=$("#date").val(); |
| 331 | 364 | var jsy=$("#jsy").val(); |
| 365 | + var xlbm=$("#xlbm").val(); | |
| 332 | 366 | var map={}; |
| 333 | 367 | map["nbbm"]=nbbm; |
| 334 | 368 | map["date"]=date; |
| 335 | 369 | map["jsy"]=jsy; |
| 370 | + map["xlbm"]=xlbm; | |
| 336 | 371 | //检查一下用户是否存在 |
| 337 | 372 | $get('/ylb/checkYl', map, function(fage){ |
| 338 | 373 | console.log(fage); | ... | ... |
src/main/resources/static/pages/oil/list_ph.html
| ... | ... | @@ -216,13 +216,13 @@ |
| 216 | 216 | <td> |
| 217 | 217 | |
| 218 | 218 | <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_czyl" |
| 219 | - type="text" value=" {{obj.czyl}}" style=" width:40px" | |
| 219 | + type="text" value=" {{obj.czyl}}" style=" width:45px" | |
| 220 | 220 | onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" |
| 221 | 221 | onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> |
| 222 | 222 | </td> |
| 223 | 223 | <td> |
| 224 | 224 | <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzyl" |
| 225 | - type="text" value=" {{obj.jzyl}}" style=" width:40px" | |
| 225 | + type="text" value=" {{obj.jzyl}}" style=" width:45px" | |
| 226 | 226 | onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" |
| 227 | 227 | onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> |
| 228 | 228 | </td> |
| ... | ... | @@ -284,6 +284,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 284 | 284 | |
| 285 | 285 | <script> |
| 286 | 286 | $(function () { |
| 287 | + var fage=false; | |
| 287 | 288 | //var id = 15; |
| 288 | 289 | //$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list') |
| 289 | 290 | |
| ... | ... | @@ -522,18 +523,22 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 522 | 523 | |
| 523 | 524 | // var gsqxdm=""; |
| 524 | 525 | |
| 525 | - | |
| 526 | - $.get('/user/companyData', function(result){ | |
| 527 | - obj = result; | |
| 528 | - var options=""; | |
| 529 | -// = '<option value="">请选择</option>'; | |
| 530 | - for(var i = 0; i < obj.length; i++){ | |
| 531 | - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 532 | -// setFgsqx(obj[i].companyCode); | |
| 533 | - } | |
| 534 | - $('#ylbListGsdmId').html(options); | |
| 535 | - updateCompany(); | |
| 536 | - }); | |
| 526 | + var xlList; | |
| 527 | + var obj=[]; | |
| 528 | + $.get('/report/lineList',function(result){ | |
| 529 | + xlList=result; | |
| 530 | + $.get('/user/companyData', function(result){ | |
| 531 | + obj = result; | |
| 532 | + var options=""; | |
| 533 | + // = '<option value="">请选择</option>'; | |
| 534 | + for(var i = 0; i < obj.length; i++){ | |
| 535 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 536 | + // setFgsqx(obj[i].companyCode); | |
| 537 | + } | |
| 538 | + $('#ylbListGsdmId').html(options); | |
| 539 | + updateCompany(); | |
| 540 | + }); | |
| 541 | + }) | |
| 537 | 542 | /* function setFgsqx(gs){ |
| 538 | 543 | var company =gs |
| 539 | 544 | var options = ''; |
| ... | ... | @@ -560,6 +565,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 560 | 565 | } |
| 561 | 566 | } |
| 562 | 567 | $('#ylbListFgsdmId').html(options); |
| 568 | + initXl(); | |
| 563 | 569 | } |
| 564 | 570 | /* |
| 565 | 571 | * 获取数据 p: 要提交的参数, pagination: 是否重新分页 |
| ... | ... | @@ -714,7 +720,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 714 | 720 | }); |
| 715 | 721 | |
| 716 | 722 | //搜索线路 |
| 717 | - $.get('/basic/lineCode2Name',function(result){ | |
| 723 | + /* $.get('/basic/lineCode2Name',function(result){ | |
| 718 | 724 | var data=[]; |
| 719 | 725 | data.push({id: " ", text: "全部线路"}); |
| 720 | 726 | for(var code in result){ |
| ... | ... | @@ -722,49 +728,88 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 722 | 728 | } |
| 723 | 729 | initPinYinSelect2('#xlbm',data,''); |
| 724 | 730 | |
| 725 | - }) | |
| 731 | + }) */ | |
| 726 | 732 | |
| 727 | - $('#nbbm').select2({ | |
| 728 | - placeholder: '搜索车辆...', | |
| 729 | - ajax: { | |
| 730 | - url: '/realSchedule/sreachVehic', | |
| 731 | - dataType: 'json', | |
| 732 | - delay: 150, | |
| 733 | - data: function (params) { | |
| 734 | - return {nbbm: params.term}; | |
| 733 | + | |
| 734 | + $("#ylbListFgsdmId").on("change",initXl); | |
| 735 | + function initXl(){ | |
| 736 | + var data=[]; | |
| 737 | + data.push({id: " ", text: "全部线路"}); | |
| 738 | + if(fage){ | |
| 739 | + $("#xlbm").select2("destroy").html(''); | |
| 740 | + } | |
| 741 | + var fgs=$('#ylbListFgsdmId').val(); | |
| 742 | + var gs=$('#ylbListGsdmId').val(); | |
| 743 | + for(var i=0;i<xlList.length;i++){ | |
| 744 | + if(gs!=""){ | |
| 745 | + if(fgs!=""){ | |
| 746 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | |
| 747 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 748 | + } | |
| 749 | + }else{ | |
| 750 | + if(xlList[i]["gsbm"]==gs){ | |
| 751 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | |
| 752 | + } | |
| 753 | + } | |
| 754 | + } | |
| 755 | + } | |
| 756 | + initPinYinSelect2('#xlbm',data,''); | |
| 757 | + fage=true; | |
| 758 | + } | |
| 759 | +// $("#ylbListGsdmId").on("change",initNbbm); | |
| 760 | +// $("#ylbListFgsdmId").on("change",initNbbm); | |
| 761 | +// $("#xlbm").on("change",initNbbm); | |
| 762 | +// function initNbbm(){ | |
| 763 | +// var gsbm=$('#ylbListGsdmId').val(), | |
| 764 | +// var fgsbm=$('#ylbListFgsdmId').val(), | |
| 765 | +// var xlbm=$('#xlbm').val(); | |
| 766 | + | |
| 767 | + $('#nbbm').select2({ | |
| 768 | + placeholder: '搜索车辆...', | |
| 769 | + ajax: { | |
| 770 | + url: '/report/carList', | |
| 771 | + dataType: 'json', | |
| 772 | + delay: 150, | |
| 773 | + data: function (params) { | |
| 774 | + return {nbbm: params.term, | |
| 775 | + gsbm:$('#ylbListGsdmId').val(), | |
| 776 | + fgsbm:$('#ylbListFgsdmId').val(), | |
| 777 | + xlbm:$('#xlbm').val()}; | |
| 778 | + }, | |
| 779 | + processResults: function (data) { | |
| 780 | + return { | |
| 781 | + results: data | |
| 782 | + }; | |
| 783 | + }, | |
| 784 | + cache: true | |
| 735 | 785 | }, |
| 736 | - processResults: function (data) { | |
| 737 | - return { | |
| 738 | - results: data | |
| 739 | - }; | |
| 786 | + templateResult: function (repo) { | |
| 787 | + if (repo.loading) return repo.text; | |
| 788 | + var h = '<span>' + repo.text + '</span>'; | |
| 789 | + h += (repo.lineName ? ' <span class="select2-desc">' + repo.lineName + '</span>' : ''); | |
| 790 | + return h; | |
| 740 | 791 | }, |
| 741 | - cache: true | |
| 742 | - }, | |
| 743 | - templateResult: function (repo) { | |
| 744 | - if (repo.loading) return repo.text; | |
| 745 | - var h = '<span>' + repo.text + '</span>'; | |
| 746 | - h += (repo.lineName ? ' <span class="select2-desc">' + repo.lineName + '</span>' : ''); | |
| 747 | - return h; | |
| 748 | - }, | |
| 749 | - escapeMarkup: function (markup) { | |
| 750 | - return markup; | |
| 751 | - }, | |
| 752 | - minimumInputLength: 1, | |
| 753 | - templateSelection: function (repo) { | |
| 754 | - return repo.text; | |
| 755 | - }, | |
| 756 | - language: { | |
| 757 | - noResults: function () { | |
| 758 | - return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | |
| 792 | + escapeMarkup: function (markup) { | |
| 793 | + return markup; | |
| 759 | 794 | }, |
| 760 | - inputTooShort: function (e) { | |
| 761 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | |
| 795 | + minimumInputLength: 1, | |
| 796 | + templateSelection: function (repo) { | |
| 797 | + return repo.text; | |
| 762 | 798 | }, |
| 763 | - searching: function () { | |
| 764 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | |
| 799 | + language: { | |
| 800 | + noResults: function () { | |
| 801 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | |
| 802 | + }, | |
| 803 | + inputTooShort: function (e) { | |
| 804 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | |
| 805 | + }, | |
| 806 | + searching: function () { | |
| 807 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | |
| 808 | + } | |
| 765 | 809 | } |
| 766 | - } | |
| 767 | - }); | |
| 810 | + }); | |
| 811 | +// } | |
| 812 | + | |
| 768 | 813 | |
| 769 | 814 | //导出 |
| 770 | 815 | ... | ... |