Commit 25e3f274f01cf8c51f84b8c2c67e0bca1a116d90
Merge branch 'pudong' into pudong_jdk8
# Conflicts: # src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java # src/main/java/com/bsth/service/impl/LineVersionsServiceImpl.java
Showing
22 changed files
with
1673 additions
and
1583 deletions
src/main/java/com/bsth/XDApplication.java
src/main/java/com/bsth/data/report_register/ReportRegisterServiceImpl.java
| ... | ... | @@ -83,13 +83,15 @@ public class ReportRegisterServiceImpl extends BaseServiceImpl<ReportRegister, L |
| 83 | 83 | List<Iterator<?>> list4 = new ArrayList<>(); |
| 84 | 84 | List<Iterator<?>> list5 = new ArrayList<>(); |
| 85 | 85 | List<Iterator<?>> list6 = new ArrayList<>(); |
| 86 | + List<Iterator<?>> list7 = new ArrayList<>(); | |
| 86 | 87 | List<Map<String, Object>> resList1 = new ArrayList<Map<String, Object>>(); |
| 87 | 88 | List<Map<String, Object>> resList2 = new ArrayList<Map<String, Object>>(); |
| 88 | 89 | List<Map<String, Object>> resList3 = new ArrayList<Map<String, Object>>(); |
| 89 | 90 | List<Map<String, Object>> resList4 = new ArrayList<Map<String, Object>>(); |
| 90 | 91 | List<Map<String, Object>> resList5 = new ArrayList<Map<String, Object>>(); |
| 91 | 92 | List<Map<String, Object>> resList6 = new ArrayList<Map<String, Object>>(); |
| 92 | - int i1 =0,i2 =0,i3 =0,i4 =0,i5 =0,i6 =0; | |
| 93 | + List<Map<String, Object>> resList7 = new ArrayList<Map<String, Object>>(); | |
| 94 | + int i1 =0,i2 =0,i3 =0,i4 =0,i5 =0,i6 =0,i7 =0; | |
| 93 | 95 | ReportUtils ee = new ReportUtils(); |
| 94 | 96 | for (ReportRegister l : list) { |
| 95 | 97 | Map<String, Object> m = new HashMap<String, Object>(); |
| ... | ... | @@ -152,6 +154,10 @@ public class ReportRegisterServiceImpl extends BaseServiceImpl<ReportRegister, L |
| 152 | 154 | i6++; |
| 153 | 155 | m.put("i", i6); |
| 154 | 156 | resList6.add(m); |
| 157 | + }else if(report_type.equals("7")){ | |
| 158 | + i7++; | |
| 159 | + m.put("i", i7); | |
| 160 | + resList7.add(m); | |
| 155 | 161 | } |
| 156 | 162 | } |
| 157 | 163 | try { |
| ... | ... | @@ -163,6 +169,8 @@ public class ReportRegisterServiceImpl extends BaseServiceImpl<ReportRegister, L |
| 163 | 169 | lists.add(list3); |
| 164 | 170 | list4.add(resList4.iterator()); |
| 165 | 171 | lists.add(list4); |
| 172 | + list7.add(resList7.iterator()); | |
| 173 | + lists.add(list7); | |
| 166 | 174 | list5.add(resList5.iterator()); |
| 167 | 175 | lists.add(list5); |
| 168 | 176 | list6.add(resList6.iterator()); | ... | ... |
src/main/java/com/bsth/repository/LineVersionsRepository.java
| ... | ... | @@ -36,9 +36,9 @@ public interface LineVersionsRepository extends BaseRepository<LineVersions, Int |
| 36 | 36 | @Transactional |
| 37 | 37 | @Modifying |
| 38 | 38 | @Query(value = "UPDATE LineVersions lv set lv.line=?2, lv.lineCode=?3, lv.startDate=?4, lv.endDate=?5, " |
| 39 | - + "lv.versions=?6, lv.status=?7, lv.remark=?8 where lv.id=?1") | |
| 39 | + + "lv.versions=?6, lv.status=?7, lv.remark=?8, lv.name=?9 where lv.id=?1") | |
| 40 | 40 | public int update(Integer id, Line line, String lineCode, Date startDate, Date endDate, Integer versions, Integer status, |
| 41 | - String remark); | |
| 41 | + String remark,String name); | |
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * 查询待更新线路的线路版本 | ... | ... |
src/main/java/com/bsth/repository/calc/CalcWaybillRepository.java
| ... | ... | @@ -74,19 +74,20 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ |
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | //按照时间段统计,公司下线路 (驾驶员) |
| 77 | - @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% order by c.jGh,c.xl,c.rq") | |
| 78 | - List<CalcWaybill> scheduleByJsy2(String line,String date,String date2,String gsdm,String fgsdm); | |
| 77 | + @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) " + | |
| 78 | + "and c.xl in (select l.lineCode from Line l where l.destroy in (?6)) order by c.jGh,c.fgsdm,c.xl,c.rq") | |
| 79 | + List<CalcWaybill> scheduleByJsy2(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy); | |
| 79 | 80 | //按照时间段统计,公司下线路 (售票员) coalesce(c.sGh,'') |
| 80 | - @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% and c.sGh <> null and c.sGh <> '' order by c.sGh,c.xl,c.rq") | |
| 81 | - List<CalcWaybill> scheduleBySpy2(String line,String date,String date2,String gsdm,String fgsdm); | |
| 81 | + @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) and c.sGh <> null and c.sGh <> '' " + | |
| 82 | + "and c.xl in (select l.lineCode from Line l where l.destroy in (?6)) order by c.sGh,c.fgsdm,c.xl,c.rq") | |
| 83 | + List<CalcWaybill> scheduleBySpy2(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy); | |
| 82 | 84 | //按照时间段统计,公司下线路 (车辆自编号) |
| 83 | - @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% order by c.cl,c.xl,c.rq") | |
| 84 | - List<CalcWaybill> scheduleByZbh2(String line,String date,String date2,String gsdm,String fgsdm); | |
| 85 | + @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) " + | |
| 86 | + "and c.xl in (select l.lineCode from Line l where l.destroy in (?6)) order by c.cl,c.fgsdm,c.xl,c.rq") | |
| 87 | + List<CalcWaybill> scheduleByZbh2(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy); | |
| 85 | 88 | //按照时间段统计,公司下线路 排序不同 |
| 86 | - @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% order by c.xl,c.rq") | |
| 87 | - List<CalcWaybill> scheduleByDateAndLineTjPx(String line,String date,String date2,String gsdm,String fgsdm); | |
| 88 | - //按照时间段统计,单条线路 排序不同 | |
| 89 | - @Query(value="select DISTINCT c from CalcWaybill c where c.xl = ?1 and c.rqStr between ?2 and ?3 order by c.xl,c.rq") | |
| 90 | - List<CalcWaybill> scheduleByDateAndLineTjPx2(String line,String date,String date2); | |
| 89 | + @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) " + | |
| 90 | + "and c.xl in (select l.lineCode from Line l where l.destroy in (?6)) order by c.fgsdm,c.xl,c.rq") | |
| 91 | + List<CalcWaybill> scheduleByDateAndLineTjPx(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy); | |
| 91 | 92 | |
| 92 | 93 | } | ... | ... |
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
| 1 | 1 | package com.bsth.service.calc.impl; |
| 2 | 2 | |
| 3 | -import java.sql.ResultSet; | |
| 4 | -import java.sql.SQLException; | |
| 5 | -import java.text.DecimalFormat; | |
| 6 | -import java.text.ParseException; | |
| 7 | -import java.text.SimpleDateFormat; | |
| 8 | -import java.util.*; | |
| 9 | -import java.util.Map.Entry; | |
| 10 | - | |
| 11 | -import javax.transaction.Transactional; | |
| 12 | - | |
| 13 | 3 | import com.alibaba.fastjson.JSON; |
| 14 | 4 | import com.alibaba.fastjson.JSONArray; |
| 15 | 5 | import com.bsth.common.ResponseCode; |
| ... | ... | @@ -21,7 +11,6 @@ import com.bsth.entity.calc.CalcLineMileage; |
| 21 | 11 | import com.bsth.entity.calc.CalcStatistics; |
| 22 | 12 | import com.bsth.entity.calc.CalcWaybill; |
| 23 | 13 | import com.bsth.entity.calc.CalcWaybillDetail; |
| 24 | -import com.bsth.entity.mcy_forms.Singledata; | |
| 25 | 14 | import com.bsth.entity.oil.Dlb; |
| 26 | 15 | import com.bsth.entity.oil.Ylb; |
| 27 | 16 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| ... | ... | @@ -42,12 +31,10 @@ import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 42 | 31 | import com.bsth.service.report.CulateMileageService; |
| 43 | 32 | import com.bsth.service.report.ReportService; |
| 44 | 33 | import com.bsth.util.Arith; |
| 45 | -import com.bsth.util.BatchSaveUtils; | |
| 46 | 34 | import com.bsth.util.ReportUtils; |
| 47 | 35 | import com.github.stuxuhai.jpinyin.PinyinException; |
| 48 | 36 | import com.github.stuxuhai.jpinyin.PinyinFormat; |
| 49 | 37 | import com.github.stuxuhai.jpinyin.PinyinHelper; |
| 50 | - | |
| 51 | 38 | import org.apache.commons.lang3.StringUtils; |
| 52 | 39 | import org.slf4j.Logger; |
| 53 | 40 | import org.slf4j.LoggerFactory; |
| ... | ... | @@ -57,6 +44,14 @@ import org.springframework.jdbc.core.JdbcTemplate; |
| 57 | 44 | import org.springframework.jdbc.core.RowMapper; |
| 58 | 45 | import org.springframework.stereotype.Service; |
| 59 | 46 | |
| 47 | +import javax.transaction.Transactional; | |
| 48 | +import java.sql.ResultSet; | |
| 49 | +import java.sql.SQLException; | |
| 50 | +import java.text.DecimalFormat; | |
| 51 | +import java.text.ParseException; | |
| 52 | +import java.text.SimpleDateFormat; | |
| 53 | +import java.util.*; | |
| 54 | + | |
| 60 | 55 | /** |
| 61 | 56 | * Created by 17/11/16. |
| 62 | 57 | */ |
| ... | ... | @@ -106,12 +101,17 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 106 | 101 | |
| 107 | 102 | public Map<String, Object> autoGenerate(String date, String line) throws Exception { |
| 108 | 103 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 104 | + List<String> dateList = new ArrayList<String>(); | |
| 109 | 105 | if(date == null || date.trim().length() == 0){ |
| 110 | 106 | Date d = new Date(); |
| 111 | - d.setTime(d.getTime() - (4 * 1000 * 60 * 60 * 24)); | |
| 112 | - date = sdf.format(d); | |
| 107 | + d.setTime(d.getTime() - (4l * 1000 * 60 * 60 * 24)); | |
| 108 | + for(long i = 0; i < 3; i++){ | |
| 109 | + d.setTime(d.getTime() + (i * 1000 * 60 * 60 * 24)); | |
| 110 | + dateList.add(sdf.format(d)); | |
| 111 | + } | |
| 113 | 112 | } else { |
| 114 | 113 | date = date.trim(); |
| 114 | + dateList.add(date); | |
| 115 | 115 | } |
| 116 | 116 | if(line == null || line.trim().length() == 0){ |
| 117 | 117 | line = ""; |
| ... | ... | @@ -120,26 +120,28 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | Map<String, Object> m = new HashMap<String, Object>(); |
| 123 | - try { | |
| 124 | - Map<String, Object> generateNew = generateNew(date, line); | |
| 125 | - m.put("generateNew", generateNew); | |
| 126 | - } catch (Exception e) { | |
| 127 | - // TODO: handle exception | |
| 128 | - logger.info("重新统计保存失败!"); | |
| 129 | - } | |
| 130 | - try { | |
| 131 | - Map<String, Object> calcLineMileage = calcLineMileage(date, line); | |
| 132 | - m.put("lineMileage", calcLineMileage); | |
| 133 | - } catch (Exception e) { | |
| 134 | - // TODO: handle exception | |
| 135 | - logger.info("线路公里审计保存失败!"); | |
| 136 | - } | |
| 137 | - try { | |
| 138 | - Map<String, Object> calcBusMileage = calcBusMileage(date, line); | |
| 139 | - m.put("busMileage", calcBusMileage); | |
| 140 | - } catch (Exception e) { | |
| 141 | - // TODO: handle exception | |
| 142 | - logger.info("路单数据审计保存失败!"); | |
| 123 | + for(String d : dateList){ | |
| 124 | + try { | |
| 125 | + Map<String, Object> generateNew = generateNew(d, line); | |
| 126 | + m.put("generateNew", generateNew); | |
| 127 | + } catch (Exception e) { | |
| 128 | + // TODO: handle exception | |
| 129 | + logger.info("重新统计保存失败!"); | |
| 130 | + } | |
| 131 | + try { | |
| 132 | + Map<String, Object> calcLineMileage = calcLineMileage(d, line); | |
| 133 | + m.put("lineMileage", calcLineMileage); | |
| 134 | + } catch (Exception e) { | |
| 135 | + // TODO: handle exception | |
| 136 | + logger.info("线路公里审计保存失败!"); | |
| 137 | + } | |
| 138 | + try { | |
| 139 | + Map<String, Object> calcBusMileage = calcBusMileage(d, line); | |
| 140 | + m.put("busMileage", calcBusMileage); | |
| 141 | + } catch (Exception e) { | |
| 142 | + // TODO: handle exception | |
| 143 | + logger.info("路单数据审计保存失败!"); | |
| 144 | + } | |
| 143 | 145 | } |
| 144 | 146 | |
| 145 | 147 | return m; |
| ... | ... | @@ -1526,7 +1528,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 1526 | 1528 | } |
| 1527 | 1529 | if(resList.size() > 0) |
| 1528 | 1530 | resList.add(temp); |
| 1529 | - | |
| 1531 | + | |
| 1530 | 1532 | for(CalcLineMileage c : resList){ |
| 1531 | 1533 | Map<String, Object> m = new HashMap<String, Object>(); |
| 1532 | 1534 | if(c.getXlName().equals("合计")){ |
| ... | ... | @@ -1810,17 +1812,42 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 1810 | 1812 | |
| 1811 | 1813 | @Override |
| 1812 | 1814 | public List<List<String>> calcDetailMonthly(Map<String, Object> map) { |
| 1813 | - String gsdm=""; | |
| 1815 | + List<Integer> destroy= new ArrayList<>(); | |
| 1816 | + String destroyStr = ""; | |
| 1817 | + if(map.get("destroy")!=null){ | |
| 1818 | + destroyStr = map.get("destroy").toString().trim(); | |
| 1819 | + String[] destroys = destroyStr.split(","); | |
| 1820 | + for (int i = 0; i < destroys.length; i++){ | |
| 1821 | + destroy.add(Integer.parseInt(destroys[i])); | |
| 1822 | + } | |
| 1823 | + } | |
| 1824 | + List<String> gsdm= new ArrayList<>(); | |
| 1825 | + String gsdmStr = ""; | |
| 1814 | 1826 | if(map.get("gsdm")!=null){ |
| 1815 | - gsdm=map.get("gsdm").toString().trim(); | |
| 1827 | + gsdmStr = map.get("gsdm").toString().trim(); | |
| 1828 | + String[] gsdms = gsdmStr.split(","); | |
| 1829 | + for (int i = 0; i < gsdms.length; i++){ | |
| 1830 | + gsdm.add(gsdms[i]); | |
| 1831 | + } | |
| 1816 | 1832 | } |
| 1817 | - String fgsdm=""; | |
| 1833 | + List<String> fgsdm= new ArrayList<>(); | |
| 1834 | + String fgsdmStr = ""; | |
| 1818 | 1835 | if(map.get("fgsdm")!=null){ |
| 1819 | - fgsdm=map.get("fgsdm").toString().trim(); | |
| 1836 | + fgsdmStr = map.get("fgsdm").toString().trim(); | |
| 1837 | + String[] fgsdms = fgsdmStr.split(","); | |
| 1838 | + for (int i = 0; i < fgsdms.length; i++){ | |
| 1839 | + fgsdm.add(fgsdms[i]); | |
| 1840 | + } | |
| 1820 | 1841 | } |
| 1821 | - String line=""; | |
| 1842 | +// String line= null; | |
| 1843 | + List<String> line= new ArrayList<>(); | |
| 1844 | + String lineStr = ""; | |
| 1822 | 1845 | if(map.get("lineCode")!=null){ |
| 1823 | - line=map.get("lineCode").toString().trim(); | |
| 1846 | + lineStr = map.get("lineCode").toString().trim(); | |
| 1847 | + String[] lines = lineStr.split(","); | |
| 1848 | + for (int i = 0; i < lines.length; i++){ | |
| 1849 | + line.add(lines[i]); | |
| 1850 | + } | |
| 1824 | 1851 | } |
| 1825 | 1852 | String startDate=""; |
| 1826 | 1853 | if(map.get("startDate")!=null){ |
| ... | ... | @@ -1830,10 +1857,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 1830 | 1857 | if(map.get("endDate")!=null){ |
| 1831 | 1858 | endDate=map.get("endDate").toString().trim(); |
| 1832 | 1859 | } |
| 1833 | - String xlName=""; | |
| 1834 | - if(map.get("xlName")!=null){ | |
| 1835 | - xlName=map.get("xlName").toString().trim(); | |
| 1836 | - } | |
| 1837 | 1860 | String type=""; |
| 1838 | 1861 | if(map.get("type")!=null){ |
| 1839 | 1862 | type=map.get("type").toString().trim(); |
| ... | ... | @@ -1846,6 +1869,18 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 1846 | 1869 | if(map.get("itemDetails")!=null){ |
| 1847 | 1870 | itemDetails=map.get("itemDetails").toString().trim(); |
| 1848 | 1871 | } |
| 1872 | +// Boolean item=false; | |
| 1873 | + /*String item=""; | |
| 1874 | + if(map.get("item")!=null){ | |
| 1875 | + if("dh".equals(map.get("item").toString().trim())) | |
| 1876 | + item=" where c.sfdc = 1"; | |
| 1877 | +// item=false; | |
| 1878 | + else if ("dh".equals(map.get("item").toString().trim())) | |
| 1879 | + item=" where c.sfdc = 0"; | |
| 1880 | +// item=true; | |
| 1881 | + else | |
| 1882 | + item=""; | |
| 1883 | + }*/ | |
| 1849 | 1884 | String timeType=map.get("timeType").toString().trim(); |
| 1850 | 1885 | |
| 1851 | 1886 | List<List<String>> resList = new ArrayList<>(); |
| ... | ... | @@ -1871,7 +1906,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 1871 | 1906 | day2 = Integer.parseInt(endDate.substring(5,7)); |
| 1872 | 1907 | for(int i=day; i<=day2; i++){ |
| 1873 | 1908 | Map<String, CalcWaybillDetail> daym = new HashMap<>(); |
| 1874 | - daym.put(startDate.substring(0,7),this.initCalcWaybillDetail()); | |
| 1909 | + daym.put(startDate.substring(0,5)+(i<10?"0"+i:i),this.initCalcWaybillDetail()); | |
| 1875 | 1910 | dayList.add(daym); |
| 1876 | 1911 | } |
| 1877 | 1912 | startDate += "-01"; |
| ... | ... | @@ -1881,16 +1916,16 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 1881 | 1916 | int flag = 0; |
| 1882 | 1917 | if("jsy".equals(statisticalObj)){ |
| 1883 | 1918 | flag = 1; |
| 1884 | - list = calcRepository.scheduleByJsy2(line, startDate, endDate, gsdm, fgsdm); | |
| 1919 | + list = calcRepository.scheduleByJsy2(line, startDate, endDate, gsdm, fgsdm, destroy); | |
| 1885 | 1920 | } else if("cwy".equals(statisticalObj)){ |
| 1886 | 1921 | flag = 2; |
| 1887 | - list = calcRepository.scheduleBySpy2(line, startDate, endDate, gsdm, fgsdm); | |
| 1922 | + list = calcRepository.scheduleBySpy2(line, startDate, endDate, gsdm, fgsdm, destroy); | |
| 1888 | 1923 | } else if("cl".equals(statisticalObj)){ |
| 1889 | 1924 | flag = 3; |
| 1890 | - list = calcRepository.scheduleByZbh2(line, startDate, endDate, gsdm, fgsdm); | |
| 1925 | + list = calcRepository.scheduleByZbh2(line, startDate, endDate, gsdm, fgsdm, destroy); | |
| 1891 | 1926 | } else if("xl".equals(statisticalObj)){ |
| 1892 | 1927 | flag = 4; |
| 1893 | - list = calcRepository.scheduleByDateAndLineTjPx(line,startDate,endDate,gsdm,fgsdm); | |
| 1928 | + list = calcRepository.scheduleByDateAndLineTjPx(line,startDate,endDate,gsdm,fgsdm, destroy); | |
| 1894 | 1929 | /*if(line.equals("")){ |
| 1895 | 1930 | //查询所有线路 |
| 1896 | 1931 | }else{ |
| ... | ... | @@ -1917,14 +1952,14 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 1917 | 1952 | // 把油量和电量数据查出来,封装成Map,计算时直接取 |
| 1918 | 1953 | if(flag != 2 ){ |
| 1919 | 1954 | String linesql=""; |
| 1920 | - if(!line.equals("")){ | |
| 1921 | - linesql +=" and xlbm ='"+line+"' "; | |
| 1955 | + if(!lineStr.equals("")){ | |
| 1956 | + linesql +=" and xlbm in("+lineStr+") "; | |
| 1922 | 1957 | } |
| 1923 | - if(!gsdm.equals("")){ | |
| 1924 | - linesql +=" and ssgsdm ='"+gsdm+"' "; | |
| 1958 | + if(!gsdmStr.equals("")){ | |
| 1959 | + linesql +=" and ssgsdm in("+gsdmStr+") "; | |
| 1925 | 1960 | } |
| 1926 | - if(!fgsdm.equals("")){ | |
| 1927 | - linesql +=" and fgsdm ='"+fgsdm+"' "; | |
| 1961 | + if(!fgsdmStr.equals("")){ | |
| 1962 | + linesql +=" and fgsdm in("+fgsdmStr+") "; | |
| 1928 | 1963 | } |
| 1929 | 1964 | String ylsql="SELECT * FROM bsth_c_ylb" |
| 1930 | 1965 | // String ylsql="SELECT id,xlbm,nbbm,jsy,jzl,czyl,jzyl,yh,sh,fgsdm FROM bsth_c_ylb" |
| ... | ... | @@ -2021,11 +2056,11 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2021 | 2056 | // 横向数据的第几天下标 |
| 2022 | 2057 | int dayIndex = 0; |
| 2023 | 2058 | int dayIndexPrev = -1; |
| 2024 | - CalcWaybillDetail cwNext = null; | |
| 2025 | 2059 | // 报表纵向列数据生成 |
| 2026 | 2060 | for (int i = 0; listNew.size() > i; i++) { |
| 2027 | 2061 | CalcWaybillDetail cw = listNew.get(i); |
| 2028 | 2062 | |
| 2063 | + CalcWaybillDetail cwNext = new CalcWaybillDetail(); | |
| 2029 | 2064 | if(i<listNew.size()-1){ |
| 2030 | 2065 | cwNext = listNew.get(i+1); |
| 2031 | 2066 | } |
| ... | ... | @@ -2034,53 +2069,16 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2034 | 2069 | String cwy = cw.getsGh(); |
| 2035 | 2070 | String cl = cw.getCl(); |
| 2036 | 2071 | |
| 2037 | - String key = "",keyNext = ""; | |
| 2038 | - if(flag == 1){ | |
| 2039 | - if(cw.getjGh() != null && cw.getjName() != null) | |
| 2040 | - key += cw.getjGh() + "/" + cw.getjName(); | |
| 2041 | - if(cwNext.getjGh() != null && cwNext.getjName() != null) | |
| 2042 | - keyNext += cwNext.getjGh() + "/" + cwNext.getjName(); | |
| 2043 | - } else if(flag == 2){ | |
| 2044 | - if(cw.getsGh() != null && cw.getsName() != null) | |
| 2045 | - key += cw.getsGh() + "/" + cw.getsName(); | |
| 2046 | - if(cwNext.getsGh() != null && cwNext.getsName() != null) | |
| 2047 | - keyNext += cwNext.getsGh() + "/" + cwNext.getsName(); | |
| 2048 | - } else if(flag == 3){ | |
| 2049 | - if(cw.getCl() != null) | |
| 2050 | - key += cw.getCl(); | |
| 2051 | - if(cwNext.getCl() != null) | |
| 2052 | - keyNext += cwNext.getCl(); | |
| 2053 | - } | |
| 2054 | - key = cw.getXl() + "/" + key; | |
| 2055 | - keyNext = cwNext.getXl() + "/" + keyNext; | |
| 2056 | - CalcWaybillDetail calc = new CalcWaybillDetail(); | |
| 2057 | - List<CalcWaybillDetail> calcList = new ArrayList<>(); | |
| 2058 | - // 是否一行数据的第一个、生成key,calc为刚添加,不去和cw相加 | |
| 2059 | - boolean ifFirst = false; | |
| 2060 | - if(keyMapList.containsKey(key)){ | |
| 2061 | - calc = keyMap.get(key); | |
| 2062 | - calcList = keyMapList.get(key); | |
| 2063 | - } else { | |
| 2064 | -// calc = this.initCalcWaybillDetail(); | |
| 2065 | - // 深度拷贝对象 | |
| 2066 | - BeanUtils.copyProperties(cw,calc); | |
| 2067 | - keyMap.put(key, calc); | |
| 2068 | - dayIndex = 0; | |
| 2069 | - ifFirst = true; | |
| 2070 | - } | |
| 2071 | - | |
| 2072 | - | |
| 2073 | 2072 | Ylb y = new Ylb(); |
| 2074 | 2073 | Dlb d = new Dlb(); |
| 2075 | 2074 | // 统计类型不同统计的左边列不同 |
| 2075 | + // 赋值油、电量 | |
| 2076 | 2076 | if(flag != 2){ |
| 2077 | 2077 | // 取了之后删除,防止重复取,应为添加的时候已经合并了 |
| 2078 | 2078 | y = ylbMap.get(cw.getRq().getTime()+"_"+cw.getXl()+"_"+cw.getjGh()+"_"+cw.getCl()); |
| 2079 | 2079 | ylbMap.remove(cw.getRq().getTime()+"_"+cw.getXl()+"_"+cw.getjGh()+"_"+cw.getCl()); |
| 2080 | 2080 | d = dlbMap.get(cw.getRq().getTime()+"_"+cw.getXl()+"_"+cw.getjGh()+"_"+cw.getCl()); |
| 2081 | 2081 | dlbMap.remove(cw.getRq().getTime()+"_"+cw.getXl()+"_"+cw.getjGh()+"_"+cw.getCl()); |
| 2082 | -// y = ylbMap.get(cw.getRq().getTime()+"_"+cw.getXl()+"_"+cw.getjGh()+"_"+cw.getjName()+"_"+cw.getCl()); | |
| 2083 | -// d = dlbMap.get(cw.getRq().getTime()+"_"+cw.getXl()+"_"+cw.getjGh()+"_"+cw.getjName()+"_"+cw.getCl()); | |
| 2084 | 2082 | if(y != null){ |
| 2085 | 2083 | cw.setZlc(y.getZlc()); |
| 2086 | 2084 | cw.setYh(y.getYh()); |
| ... | ... | @@ -2103,11 +2101,41 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2103 | 2101 | cw.setCdl(d.getCdl()); |
| 2104 | 2102 | cw.setBglyh((d.getZlc()==0? 0:100*d.getHd()/d.getZlc())); |
| 2105 | 2103 | } |
| 2104 | + } | |
| 2106 | 2105 | |
| 2107 | - }/* else if(flag == 3){ | |
| 2108 | - y = ylbCLMap.get(cw.getRq().getTime()+"_"+cw.getXl()+"_"+cw.getCl()); | |
| 2109 | - d = dlbCLMap.get(cw.getRq().getTime()+"_"+cw.getXl()+"_"+cw.getCl()); | |
| 2110 | - }*/ | |
| 2106 | + String key = "",keyNext = ""; | |
| 2107 | + if(flag == 1){ | |
| 2108 | + if(cw.getjGh() != null && cw.getjName() != null) | |
| 2109 | + key += cw.getjGh() + "/" + cw.getjName(); | |
| 2110 | + if(cwNext.getjGh() != null && cwNext.getjName() != null) | |
| 2111 | + keyNext += cwNext.getjGh() + "/" + cwNext.getjName(); | |
| 2112 | + } else if(flag == 2){ | |
| 2113 | + if(cw.getsGh() != null && cw.getsName() != null) | |
| 2114 | + key += cw.getsGh() + "/" + cw.getsName(); | |
| 2115 | + if(cwNext.getsGh() != null && cwNext.getsName() != null) | |
| 2116 | + keyNext += cwNext.getsGh() + "/" + cwNext.getsName(); | |
| 2117 | + } else if(flag == 3){ | |
| 2118 | + if(cw.getCl() != null) | |
| 2119 | + key += cw.getCl(); | |
| 2120 | + if(cwNext.getCl() != null) | |
| 2121 | + keyNext += cwNext.getCl(); | |
| 2122 | + } | |
| 2123 | + key = cw.getFgsdm()+"/"+cw.getXl() + "/" + key; | |
| 2124 | + keyNext = cw.getFgsdm()+"/"+cwNext.getXl() + "/" + keyNext; | |
| 2125 | + CalcWaybillDetail calc = new CalcWaybillDetail(); | |
| 2126 | + List<CalcWaybillDetail> calcList = new ArrayList<>(); | |
| 2127 | + // 是否一行数据的第一个、生成key,calc为刚添加,不去和cw相加 | |
| 2128 | + boolean ifFirst = false; | |
| 2129 | + if(keyMapList.containsKey(key)){ | |
| 2130 | + calc = keyMap.get(key); | |
| 2131 | + calcList = keyMapList.get(key); | |
| 2132 | + } else { | |
| 2133 | + // 深度拷贝对象 | |
| 2134 | + BeanUtils.copyProperties(cw,calc); | |
| 2135 | + keyMap.put(key, calc); | |
| 2136 | + dayIndex = 0; | |
| 2137 | + ifFirst = true; | |
| 2138 | + } | |
| 2111 | 2139 | |
| 2112 | 2140 | CalcWaybillDetail dayc = null; |
| 2113 | 2141 | if("m".equals(timeType)){ |
| ... | ... | @@ -2148,13 +2176,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2148 | 2176 | |
| 2149 | 2177 | // 把下标 |
| 2150 | 2178 | dayIndexPrev = dayIndex; |
| 2151 | - | |
| 2152 | -// if(cw.getjGh().equals("007951") && cw.getXlName().equals("浦东40路")){ | |
| 2153 | -// System.out.println(); | |
| 2154 | -// } | |
| 2155 | - /*if(cw.getCl().equals("W0F-058") || cw.getCl().equals("W2F-051") || cw.getCl().equals("S2E-029") || cw.getCl().equals("W1G-058")){ | |
| 2156 | - System.out.println(); | |
| 2157 | - }*/ | |
| 2158 | 2179 | // timeType 为m 月报表时,日期不一样就换列,为y 年报表是,月份不一样换列 |
| 2159 | 2180 | if("m".equals(timeType) && cwNext != null && key.equals(keyNext) && !cw.getRqStr().equals(cwNext.getRqStr())){ |
| 2160 | 2181 | dayIndex++; |
| ... | ... | @@ -2166,8 +2187,8 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2166 | 2187 | calcList.add(new CalcWaybillDetail()); |
| 2167 | 2188 | dayIndex++; |
| 2168 | 2189 | } |
| 2190 | + // 换列了从头开始,上一个下标赋值为初始 | |
| 2169 | 2191 | dayIndexPrev = -1; |
| 2170 | -// dayIndexPrev = dayIndex = 0; | |
| 2171 | 2192 | } |
| 2172 | 2193 | // 右边可变列添加数据 |
| 2173 | 2194 | keyMapList.put(key,calcList); |
| ... | ... | @@ -2196,14 +2217,17 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2196 | 2217 | for(int i=day; i<=day2; i++){ |
| 2197 | 2218 | list1.add((i<10?"0"+i:i)+("m".equals(timeType)?"日":"月")); |
| 2198 | 2219 | } |
| 2220 | + if("bgldh".equals(itemDetails) || "bglyh".equals(itemDetails)){ | |
| 2221 | + list1.add("平均"); | |
| 2222 | + } else | |
| 2223 | + list1.add("合计"); | |
| 2199 | 2224 | resList.add(list1); |
| 2200 | 2225 | |
| 2201 | 2226 | int i=1; |
| 2202 | 2227 | |
| 2203 | 2228 | DecimalFormat df = new DecimalFormat("0.00");//格式化小数 |
| 2229 | + double allNum = 0.0; | |
| 2204 | 2230 | while (iter.hasNext()) { |
| 2205 | -// List list = new ArrayList(); | |
| 2206 | - | |
| 2207 | 2231 | Map.Entry entry = (Map.Entry) iter.next(); |
| 2208 | 2232 | // 获取key |
| 2209 | 2233 | String key = (String) entry.getKey(); |
| ... | ... | @@ -2236,6 +2260,10 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2236 | 2260 | listStr.add(df.format(c.getLjyylc()+c.getLjfyylc())); |
| 2237 | 2261 | listStr.add(df.format(c.getLblc())); |
| 2238 | 2262 | listStr.add(c.getTs()+""); |
| 2263 | + c.setBglhd(c.getBglhd()/c.getTs()); | |
| 2264 | + c.setBglyh(c.getBglyh()/c.getTs()); | |
| 2265 | + // 把列合计的数添加到最后一个 | |
| 2266 | + cList.add(c); | |
| 2239 | 2267 | // DecimalFormat df = new DecimalFormat("0.00");//格式化小数 |
| 2240 | 2268 | for (CalcWaybillDetail c1:cList) { |
| 2241 | 2269 | if(StringUtils.isEmpty(c1.getXl())) { |
| ... | ... | @@ -2254,7 +2282,8 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2254 | 2282 | } else if("cccy".equals(itemDetails)){ |
| 2255 | 2283 | listStr.add(df.format(c1.getCzyl())); |
| 2256 | 2284 | } else if("bglyh".equals(itemDetails)){ |
| 2257 | - listStr.add(df.format(c1.getBglyh())); | |
| 2285 | +// listStr.add(df.format(c1.getBglyh())); | |
| 2286 | + listStr.add(df.format(c1.getZlc()==0? 0:100*c1.getYh()/c1.getZlc())); | |
| 2258 | 2287 | } else if("dh".equals(itemDetails)){ |
| 2259 | 2288 | listStr.add(df.format(c1.getHd())); |
| 2260 | 2289 | } else if("cdl".equals(itemDetails)){ |
| ... | ... | @@ -2264,7 +2293,8 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2264 | 2293 | } else if("jccd".equals(itemDetails)){ |
| 2265 | 2294 | listStr.add(df.format(c1.getJzcd())); |
| 2266 | 2295 | } else if("bgldh".equals(itemDetails)){ |
| 2267 | - listStr.add(df.format(c1.getBglhd())); | |
| 2296 | + listStr.add(df.format(c1.getZlc()==0? 0:100*c1.getHd()/c1.getZlc())); | |
| 2297 | +// listStr.add(df.format(c1.getBglhd())); | |
| 2268 | 2298 | } else if("zgl".equals(itemDetails)){ |
| 2269 | 2299 | listStr.add(df.format((c1.getSjyylc()+c1.getSjfyylc()+c1.getLjfyylc()+c1.getLjyylc()))); |
| 2270 | 2300 | } else if("jhgl".equals(itemDetails)){ |
| ... | ... | @@ -2276,6 +2306,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2276 | 2306 | } |
| 2277 | 2307 | } |
| 2278 | 2308 | } |
| 2309 | + allNum = allNum + Double.parseDouble(listStr.get(listStr.size()-1)); | |
| 2279 | 2310 | resList.add(listStr); |
| 2280 | 2311 | } |
| 2281 | 2312 | |
| ... | ... | @@ -2289,6 +2320,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2289 | 2320 | listEnd.add(df.format(zjCalc.getLjfyylc()+zjCalc.getLjyylc())); |
| 2290 | 2321 | listEnd.add(df.format(zjCalc.getLblc())); |
| 2291 | 2322 | listEnd.add(zjCalc.getTs()+""); |
| 2323 | + double all = 0.0; | |
| 2292 | 2324 | for (Map<String, CalcWaybillDetail> cmap:dayList) { |
| 2293 | 2325 | for (Map.Entry<String, CalcWaybillDetail> cw : cmap.entrySet()) { |
| 2294 | 2326 | // System.out.println("key = " + cw.getKey() + ", value = " + cw.getValue()); |
| ... | ... | @@ -2306,7 +2338,8 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2306 | 2338 | } else if("cccy".equals(itemDetails)){ |
| 2307 | 2339 | listEnd.add(df.format(c1.getCzyl())); |
| 2308 | 2340 | } else if("bglyh".equals(itemDetails)){ |
| 2309 | - listEnd.add(df.format(c1.getBglyh())); | |
| 2341 | +// listEnd.add(df.format(c1.getBglyh())); | |
| 2342 | + listEnd.add(df.format(c1.getZlc()==0? 0:100*c1.getYh()/c1.getZlc())); | |
| 2310 | 2343 | } else if("dh".equals(itemDetails)){ |
| 2311 | 2344 | listEnd.add(df.format(c1.getHd())); |
| 2312 | 2345 | } else if("cdl".equals(itemDetails)){ |
| ... | ... | @@ -2316,7 +2349,8 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2316 | 2349 | } else if("jccd".equals(itemDetails)){ |
| 2317 | 2350 | listEnd.add(df.format(c1.getJzcd())); |
| 2318 | 2351 | } else if("bgldh".equals(itemDetails)){ |
| 2319 | - listEnd.add(df.format(c1.getBglhd())); | |
| 2352 | +// listEnd.add(df.format(c1.getBglhd())); | |
| 2353 | + listEnd.add(df.format(c1.getZlc()==0? 0:100*c1.getHd()/c1.getZlc())); | |
| 2320 | 2354 | } else if("zgl".equals(itemDetails)){ |
| 2321 | 2355 | listEnd.add((df.format(c1.getSjyylc()+c1.getSjfyylc()+c1.getLjfyylc()+c1.getLjyylc()))); |
| 2322 | 2356 | } else if("jhgl".equals(itemDetails)){ |
| ... | ... | @@ -2325,10 +2359,18 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 2325 | 2359 | listEnd.add(c1.getSjyybc()+c1.getSjfyybc()+""); |
| 2326 | 2360 | } else if("jhbc".equals(itemDetails)){ |
| 2327 | 2361 | listEnd.add((c1.getJhyybc()+c1.getJhfyybc())+""); |
| 2328 | - | |
| 2329 | 2362 | } |
| 2330 | 2363 | } |
| 2364 | + all = all + Double.parseDouble(listEnd.get(listEnd.size()-1)); | |
| 2365 | + } | |
| 2366 | + | |
| 2367 | + // 百公里电油耗时为平均数 | |
| 2368 | + if("bgldh".equals(itemDetails) || "bglyh".equals(itemDetails)){ | |
| 2369 | + allNum = allNum/keyMap.size(); | |
| 2370 | + all = all/dayList.size(); | |
| 2331 | 2371 | } |
| 2372 | +// listEnd.add(df.format(allNum)+"/"+df.format(all)); | |
| 2373 | + listEnd.add(df.format(all)); | |
| 2332 | 2374 | resList.add(listEnd); |
| 2333 | 2375 | |
| 2334 | 2376 | return resList; | ... | ... |
src/main/java/com/bsth/service/impl/LineVersionsServiceImpl.java
| ... | ... | @@ -89,12 +89,13 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ |
| 89 | 89 | String lineCode = map.get("lineCode").toString(); |
| 90 | 90 | Integer versions = Integer.valueOf(map.get("versions").toString()); |
| 91 | 91 | Integer status = Integer.valueOf(map.get("status").toString()); |
| 92 | + String name = map.get("name").toString(); | |
| 92 | 93 | String remark = map.get("remark").toString(); |
| 93 | - | |
| 94 | + | |
| 94 | 95 | Line line = lineRepository.findById(lineid).get(); |
| 95 | 96 | |
| 96 | 97 | int statu = repository.update(id,line,lineCode,new java.sql.Date(startDate.getTime()), |
| 97 | - new java.sql.Date(endDate.getTime()),versions,status,remark); | |
| 98 | + new java.sql.Date(endDate.getTime()),versions,status,remark,name); | |
| 98 | 99 | LineVersions upLineVersions = repository.findBylineIdAndVersions(line.getId(),versions); |
| 99 | 100 | if(upLineVersions != null){ |
| 100 | 101 | upLineVersions.setEndDate(new java.sql.Date(startDate.getTime())); | ... | ... |
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
| ... | ... | @@ -611,7 +611,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 611 | 611 | try { |
| 612 | 612 | |
| 613 | 613 | String sql = "select schedule_date_str,xl_name,bc_type,gs_name,fgs_name,fgs_bm,bcs," |
| 614 | - +"fcno,fcsj,fcsj_actual,zdsj,zdsj_actual,bcsj,qdz_name,sp_id,cc_service" | |
| 614 | + +"fcno,fcsj,fcsj_actual,zdsj,zdsj_actual,bcsj,qdz_name,sp_id,cc_service,lp_name" | |
| 615 | 615 | +" from bsth_c_s_sp_info_real where schedule_date_str >= '"+startDate |
| 616 | 616 | +"' and schedule_date_str <= '"+endDate+"'"; |
| 617 | 617 | if(line.length() != 0){ |
| ... | ... | @@ -650,6 +650,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 650 | 650 | schedule.setQdzName(rs.getString("qdz_name")); |
| 651 | 651 | schedule.setSpId(rs.getLong("sp_id")); |
| 652 | 652 | schedule.setCcService(rs.getBoolean("cc_service")); |
| 653 | + schedule.setLpName(rs.getString("lp_name")); | |
| 653 | 654 | |
| 654 | 655 | if(schedule.getFcsjActual() != null && schedule.getFcsjActual().trim().length() == 0){ |
| 655 | 656 | schedule.setFcsjActual(null); |
| ... | ... | @@ -718,7 +719,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 718 | 719 | continue; |
| 719 | 720 | } |
| 720 | 721 | |
| 721 | - String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj()+"/"+schedule.getFgsBm(); | |
| 722 | + String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj()+"/"+schedule.getFgsBm()+"/"+schedule.getLpName(); | |
| 722 | 723 | if(model.length() != 0){ |
| 723 | 724 | if(ttSet.contains(schedule.getSpId())){ |
| 724 | 725 | if(!keyMap.containsKey(key)) |
| ... | ... | @@ -810,6 +811,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 810 | 811 | tempMap.put("line", split[0]); |
| 811 | 812 | tempMap.put("qdz", split[1]); |
| 812 | 813 | tempMap.put("jhfc", split[2]); |
| 814 | + tempMap.put("lp", split[4]); | |
| 813 | 815 | tempMap.put("jhbc", jhbc); |
| 814 | 816 | tempMap.put("sjbc", sjbc); |
| 815 | 817 | tempList.add(tempMap); |
| ... | ... | @@ -819,27 +821,32 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 819 | 821 | Map<String, List<Map<String, Object>>> listMap = new HashMap<String, List<Map<String, Object>>>(); |
| 820 | 822 | Map<String, List<Map<String, Object>>> listMap2 = new HashMap<String, List<Map<String, Object>>>(); |
| 821 | 823 | for(Map<String, Object> m : tempList){ |
| 822 | - String key = m.get("line").toString() + m.get("qdz") + m.get("subCompany"); | |
| 824 | + String key = m.get("line").toString() + "/" + m.get("qdz") + "/" + m.get("subCompany"); | |
| 823 | 825 | if(!listMap.containsKey(key)) |
| 824 | 826 | listMap.put(key, new ArrayList<Map<String, Object>>()); |
| 825 | 827 | listMap.get(key).add(m); |
| 826 | 828 | } |
| 827 | 829 | for(String key : listMap.keySet()){ |
| 828 | - Map<Integer, Map<String, Object>> tempMap = new HashMap<Integer, Map<String,Object>>(); | |
| 830 | + Map<Integer, List<Map<String, Object>>> tempMap = new HashMap<Integer, List<Map<String,Object>>>(); | |
| 829 | 831 | List<Integer> keyList = new ArrayList<Integer>(); |
| 830 | 832 | for(Map<String, Object> m : listMap.get(key)){ |
| 831 | 833 | String[] split = m.get("jhfc").toString().split(":"); |
| 832 | 834 | int jhfc = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); |
| 833 | - tempMap.put(jhfc, m); | |
| 834 | - keyList.add(jhfc); | |
| 835 | + if(!tempMap.containsKey(jhfc)){ | |
| 836 | + tempMap.put(jhfc, new ArrayList<Map<String, Object>>()); | |
| 837 | + keyList.add(jhfc); | |
| 838 | + } | |
| 839 | + tempMap.get(jhfc).add(m); | |
| 840 | + | |
| 835 | 841 | } |
| 836 | 842 | Collections.sort(keyList); |
| 837 | 843 | for(Integer Int : keyList){ |
| 838 | - Map<String, Object> m = tempMap.get(Int); | |
| 844 | + List<Map<String, Object>> l = tempMap.get(Int); | |
| 845 | + Map<String, Object> m = l.get(0); | |
| 839 | 846 | String str = m.get("line").toString(); |
| 840 | 847 | if(!listMap2.containsKey(str)) |
| 841 | 848 | listMap2.put(str, new ArrayList<Map<String, Object>>()); |
| 842 | - listMap2.get(str).add(m); | |
| 849 | + listMap2.get(str).addAll(l); | |
| 843 | 850 | } |
| 844 | 851 | } |
| 845 | 852 | for(String str : listMap2.keySet()){ | ... | ... |
src/main/java/com/bsth/util/ReportUtils.java
| ... | ... | @@ -603,7 +603,7 @@ public class ReportUtils { |
| 603 | 603 | for (Iterator<Cell> cellIt = fromRow.cellIterator(); cellIt.hasNext();) { |
| 604 | 604 | HSSFCell tmpCell = (HSSFCell) cellIt.next(); |
| 605 | 605 | HSSFCell newCell = toRow.createCell(tmpCell.getColumnIndex(), 0); |
| 606 | - copyCell(wb, tmpCell, newCell, copyValueFlag, style); | |
| 606 | + copyCell(wb, tmpCell, newCell, copyValueFlag, tmpCell.getCellStyle()); | |
| 607 | 607 | } |
| 608 | 608 | } |
| 609 | 609 | ... | ... |
src/main/resources/static/pages/base/lineversions/edit.html
| ... | ... | @@ -47,7 +47,16 @@ |
| 47 | 47 | <input type="hidden" name="status" id="statusInput" /> |
| 48 | 48 | <input type="hidden" name="Id" id="IdInput" /> |
| 49 | 49 | <!-- 表单分组组件 form-group END --> |
| 50 | - | |
| 50 | + | |
| 51 | + <div class="form-group"> | |
| 52 | + <label class="control-label col-md-5"> | |
| 53 | + <span class="required"> * </span>线路版本名称 : | |
| 54 | + </label> | |
| 55 | + <div class="col-md-4"> | |
| 56 | + <input name="name" class="form-control" style="width:100%" id="nameInput" placeholder="请填写更换版本原因,方便排班人员操作!" /> | |
| 57 | + </div> | |
| 58 | + </div> | |
| 59 | + | |
| 51 | 60 | <!-- 表单分组组件 form-group START --> |
| 52 | 61 | <div class="form-group"> |
| 53 | 62 | <label class="control-label col-md-5"> |
| ... | ... | @@ -110,7 +119,7 @@ |
| 110 | 119 | <div class="form-group"> |
| 111 | 120 | <label class="control-label col-md-5"> 描述/说明 : </label> |
| 112 | 121 | <div class="col-md-4"> |
| 113 | - <textarea class="form-control" rows="3" name="remark" id="remarkTextarea" placeholder="请填写更换版本原因,方便排班人员操作!"></textarea> | |
| 122 | + <textarea class="form-control" rows="3" name="remark" id="remarkTextarea" ></textarea> | |
| 114 | 123 | </div> |
| 115 | 124 | </div> |
| 116 | 125 | <!-- 表单分组组件 form-group END --> | ... | ... |
src/main/resources/static/pages/base/lineversions/js/lineversions-edit-from.js
| ... | ... | @@ -90,6 +90,7 @@ |
| 90 | 90 | $("#endDateInput").val(moment(result.endDate).format('YYYY-MM-DD HH:mm:ss')); |
| 91 | 91 | $("#versionsInput").val(result.versions); |
| 92 | 92 | $("#statusInput").val(result.status); |
| 93 | + $("#nameInput").val(result.name); | |
| 93 | 94 | $("#remarkTextarea").val(result.remark); |
| 94 | 95 | } |
| 95 | 96 | |
| ... | ... | @@ -144,6 +145,7 @@ |
| 144 | 145 | 'line' : {required : true,maxlength: 30},// 线路名称 必填项、最大长度. |
| 145 | 146 | 'startDate' : {required : true},// 启用时间 不为空. |
| 146 | 147 | 'endDate' : {required : true},// 结束时间. |
| 148 | + 'name' : {required : true},// 版本名称. | |
| 147 | 149 | 'versions' : {required : true, digits : true, maxlength: 10},// 版本号 必填项、数字、最大长度10. |
| 148 | 150 | 'status' : {required : true, digits : true, maxlength: 10},// 版本状态 必填项、数字、最大长度10. |
| 149 | 151 | }, | ... | ... |
src/main/resources/static/pages/forms/calc/calcDetailMonthly.html
| ... | ... | @@ -73,13 +73,20 @@ |
| 73 | 73 | <span class="item-label" style="width: 80px;">  线路: </span> |
| 74 | 74 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 75 | 75 | </div>--> |
| 76 | - | |
| 76 | + <div style="display: inline-block; margin-left: 33px;"> | |
| 77 | + <span class="item-label" style="width: 80px;">线路性质: </span> | |
| 78 | + <select class="form-control" name="destroy" id="destroy" style="width: 180px;"> | |
| 79 | + <option value="0,1">全部线路</option> | |
| 80 | + <option value="0">营运线路</option> | |
| 81 | + <option value="1">非营运线路</option> | |
| 82 | + </select> | |
| 83 | + </div> | |
| 77 | 84 | <div style="display: inline-block;margin-left: 33px;" class="date-picker"> |
| 78 | 85 | <span class="item-label" style="width: 80px;">  时间: </span> |
| 79 | - <!--<input class="form-control" type="text" id="startDate" style="width: 180px;" /> - --> | |
| 80 | - <!--<input class="form-control" type="text" id="endDate" style="width: 180px;" />--> | |
| 81 | - <input class="form-control" type="text" id="startDate" style="width: 180px;" value="2020-10-01"/> - | |
| 82 | - <input class="form-control" type="text" id="endDate" style="width: 180px;" value="2020-10-10"/> | |
| 86 | + <input class="form-control" type="text" id="startDate" style="width: 180px;" /> - | |
| 87 | + <input class="form-control" type="text" id="endDate" style="width: 180px;" /> | |
| 88 | + <!--<input class="form-control" type="text" id="startDate" style="width: 180px;" value="2020-10-01"/> - --> | |
| 89 | + <!--<input class="form-control" type="text" id="endDate" style="width: 180px;" value="2020-10-10"/>--> | |
| 83 | 90 | </div> |
| 84 | 91 | <div style="margin-top: 2px"></div> |
| 85 | 92 | |
| ... | ... | @@ -130,6 +137,7 @@ |
| 130 | 137 | </div> |
| 131 | 138 | <script > |
| 132 | 139 | $(function(){ |
| 140 | + $('#export').attr('disabled', "true"); | |
| 133 | 141 | // 关闭左侧栏 |
| 134 | 142 | if (!$('body').hasClass('page-sidebar-closed')) |
| 135 | 143 | $('.menu-toggler.sidebar-toggler').click(); |
| ... | ... | @@ -143,79 +151,52 @@ |
| 143 | 151 | var d = new Date(); |
| 144 | 152 | var year = d.getFullYear(); |
| 145 | 153 | var month = d.getMonth() + 1; |
| 146 | - var day = d.getDate()-1;//只能查一天以前的数据 | |
| 154 | + var day = d.getDate()-4;//只能查4天以前的数据 | |
| 147 | 155 | if(month < 10) |
| 148 | 156 | month = "0" + month; |
| 149 | 157 | if(day < 10) |
| 150 | 158 | day = "0" + day; |
| 151 | 159 | //时间 |
| 152 | 160 | var dateTime=year + "-" + month + "-" + day; |
| 153 | - // $("#startDate").val(dateTime); | |
| 154 | - // $("#endDate").val(dateTime); | |
| 161 | + $("#startDate").val(dateTime); | |
| 162 | + $("#endDate").val(dateTime); | |
| 155 | 163 | |
| 156 | - // $("#endDate").datetimepicker({ | |
| 157 | - // format : 'YYYY-MM-DD', | |
| 158 | - // locale : 'zh-cn', | |
| 159 | - // maxDate : dateTime | |
| 160 | - // }); | |
| 161 | - // $("#startDate").datetimepicker({ | |
| 162 | - // format : 'YYYY-MM-DD', | |
| 163 | - // locale : 'zh-cn', | |
| 164 | - // maxDate : dateTime | |
| 165 | - // }); | |
| 164 | + $("#endDate").datetimepicker({ | |
| 165 | + format : 'YYYY-MM-DD', | |
| 166 | + locale : 'zh-cn', | |
| 167 | + maxDate : dateTime | |
| 168 | + }); | |
| 169 | + $("#startDate").datetimepicker({ | |
| 170 | + format : 'YYYY-MM-DD', | |
| 171 | + locale : 'zh-cn', | |
| 172 | + maxDate : dateTime | |
| 173 | + }); | |
| 166 | 174 | |
| 167 | - var fage=false; | |
| 168 | - var xlList; | |
| 169 | - var obj = []; | |
| 175 | + var lineAll=""; | |
| 170 | 176 | var datas = {}; //查询条件 |
| 171 | 177 | |
| 172 | - var tempData = {}; | |
| 173 | - | |
| 174 | - $.get('/report/lineList',function(result){ | |
| 175 | - xlList=result; | |
| 176 | - $.get('/user/companyData', function(result){ | |
| 177 | - obj = result; | |
| 178 | - var options = '<option value="">所有分公司</option>'; | |
| 179 | - for(var i = 0; i < obj.length; i++){ | |
| 180 | - if(obj[i].companyCode == "26"){ | |
| 181 | - var children = obj[i].children; | |
| 182 | - for(var j = 0; j < children.length; j++){ | |
| 183 | - options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 184 | - } | |
| 185 | - } | |
| 186 | - } | |
| 187 | - $('#fgsdm').html(options); | |
| 188 | - }); | |
| 178 | + /**用户分配的线路*/ | |
| 179 | + $.get('/realControAuthority/findByCurrentUser', function (userAuthor) { | |
| 180 | + lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1); | |
| 189 | 181 | }); |
| 190 | 182 | |
| 183 | + var tempData = {}; | |
| 191 | 184 | |
| 192 | - // $("#gsdm").on("change",updateCompany); | |
| 193 | - function updateCompany(){ | |
| 194 | - // var company = $('#gsdm').val(); | |
| 195 | - var options = '<option value="">所有分公司</option>'; | |
| 196 | - for(var i = 0; i < obj.length; i++){ | |
| 197 | - if(obj[i].companyCode == "26"){ | |
| 185 | + $.get('/user/companyData', function(obj) { | |
| 186 | + var option = ''; | |
| 187 | + var allC = ""; | |
| 188 | + for (var i = 0; i < obj.length; i++) { | |
| 189 | + if (obj[i].companyCode == "26") { | |
| 198 | 190 | var children = obj[i].children; |
| 199 | - for(var j = 0; j < children.length; j++){ | |
| 200 | - options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 191 | + for (var j = 0; j < children.length; j++) { | |
| 192 | + allC += children[j].code+","; | |
| 193 | + option += '<option value="' + children[j].code + '">' + children[j].name + '</option>'; | |
| 201 | 194 | } |
| 202 | 195 | } |
| 203 | 196 | } |
| 204 | - $('#fgsdm').html(options); | |
| 205 | - } | |
| 206 | 197 | |
| 207 | - $("#line").on("change", function(){ | |
| 208 | - if($("#line").val() == " "){ | |
| 209 | - $("#gsdm").attr("disabled", false); | |
| 210 | - $("#fgsdm").attr("disabled", false); | |
| 211 | - } else { | |
| 212 | - var temp = tempData[$("#line").val()].split(":"); | |
| 213 | - $("#gsdm").val(temp[0]); | |
| 214 | - updateCompany(); | |
| 215 | - $("#fgsdm").val(temp[1]); | |
| 216 | - $("#gsdm").attr("disabled", true); | |
| 217 | - $("#fgsdm").attr("disabled", true); | |
| 218 | - } | |
| 198 | + var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option; | |
| 199 | + $('#fgsdm').html(options); | |
| 219 | 200 | }); |
| 220 | 201 | |
| 221 | 202 | // 项目明细选项列 |
| ... | ... | @@ -256,11 +237,9 @@ |
| 256 | 237 | $("#query").on("click",function(){ |
| 257 | 238 | var gsdm = "26"; |
| 258 | 239 | var fgsdm = $("#fgsdm").val(); |
| 259 | - var lineCode = $("#line").val(); | |
| 260 | 240 | var startDate = $("#startDate").val(); |
| 261 | 241 | var endDate = $("#endDate").val(); |
| 262 | 242 | var statisticalObj = $("#statisticalObj").val(); |
| 263 | - lineName=$("#line option:selected").text(); | |
| 264 | 243 | //开始和结束时间 |
| 265 | 244 | var startTime = Date.parse(new Date(startDate)); |
| 266 | 245 | var endTime = Date.parse(new Date(endDate)); |
| ... | ... | @@ -268,16 +247,13 @@ |
| 268 | 247 | datas = {}; // 清空之前数据 |
| 269 | 248 | datas.gsdm = gsdm; |
| 270 | 249 | datas.fgsdm = fgsdm; |
| 271 | - datas.lineCode = lineCode; | |
| 272 | - datas.lineName = lineName; | |
| 273 | - datas.startDate = startDate; | |
| 250 | + datas.lineCode = lineAll; | |
| 274 | 251 | datas.timeType = "m"; |
| 275 | - // datas.startDate = "2020-10-01"; | |
| 252 | + datas.startDate = startDate; | |
| 276 | 253 | datas.endDate = endDate; |
| 277 | - // datas.endDate = "2020-10-10"; | |
| 254 | + datas.destroy = $("#destroy").val(); | |
| 278 | 255 | datas.statisticalObj = $("#statisticalObj").val(); |
| 279 | 256 | datas.itemDetails = $("#itemDetails").val(); |
| 280 | - | |
| 281 | 257 | if(startDate==null || startDate =="" ||endDate==null || endDate ==""){ |
| 282 | 258 | layer.msg('请选择时间段!'); |
| 283 | 259 | }else if(endTime<startTime){ |
| ... | ... | @@ -295,8 +271,10 @@ |
| 295 | 271 | title: '提示' |
| 296 | 272 | , content: '没有您要查询的数据,请重新选择参数!' |
| 297 | 273 | }); |
| 274 | + $("#export").attr('disabled',"true"); | |
| 298 | 275 | return; |
| 299 | - } | |
| 276 | + }else | |
| 277 | + $("#export").removeAttr("disabled"); | |
| 300 | 278 | var htmlHead = "", htmlBody = ""; |
| 301 | 279 | var rsLength = rs.length; |
| 302 | 280 | rs.forEach(function (o, i) { |
| ... | ... | @@ -323,7 +301,6 @@ |
| 323 | 301 | }); |
| 324 | 302 | |
| 325 | 303 | $("#export").on("click",function(){ |
| 326 | - datas.timeType = "m"; | |
| 327 | 304 | var itemDetails = datas.itemDetails, |
| 328 | 305 | type = "加注量[全部]"; |
| 329 | 306 | if(itemDetails=="jzl0"){ | ... | ... |
src/main/resources/static/pages/forms/calc/calcDetailYear.html
| ... | ... | @@ -73,7 +73,14 @@ |
| 73 | 73 | <span class="item-label" style="width: 80px;">  线路: </span> |
| 74 | 74 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 75 | 75 | </div>--> |
| 76 | - | |
| 76 | + <div style="display: inline-block; margin-left: 33px;"> | |
| 77 | + <span class="item-label" style="width: 80px;">线路性质: </span> | |
| 78 | + <select class="form-control" name="destroy" id="destroy" style="width: 180px;"> | |
| 79 | + <option value="0,1">全部线路</option> | |
| 80 | + <option value="0">营运线路</option> | |
| 81 | + <option value="1">非营运线路</option> | |
| 82 | + </select> | |
| 83 | + </div> | |
| 77 | 84 | <div style="display: inline-block;margin-left: 33px;" class="date-picker"> |
| 78 | 85 | <span class="item-label" style="width: 80px;">  时间: </span> |
| 79 | 86 | <input class="form-control" type="text" id="startDate" style="width: 180px;" /> - |
| ... | ... | @@ -81,6 +88,7 @@ |
| 81 | 88 | <!--<input class="form-control" type="text" id="startDate" style="width: 180px;" value="2020-10"/> - --> |
| 82 | 89 | <!--<input class="form-control" type="text" id="endDate" style="width: 180px;" value="2020-10"/>--> |
| 83 | 90 | </div> |
| 91 | + | |
| 84 | 92 | <div style="margin-top: 2px"></div> |
| 85 | 93 | |
| 86 | 94 | <div style="display: inline-block;margin-left: 33px;"> |
| ... | ... | @@ -130,6 +138,7 @@ |
| 130 | 138 | </div> |
| 131 | 139 | <script > |
| 132 | 140 | $(function(){ |
| 141 | + $('#export').attr('disabled', "true"); | |
| 133 | 142 | // 关闭左侧栏 |
| 134 | 143 | if (!$('body').hasClass('page-sidebar-closed')) |
| 135 | 144 | $('.menu-toggler.sidebar-toggler').click(); |
| ... | ... | @@ -161,66 +170,48 @@ |
| 161 | 170 | maxDate : dateTime |
| 162 | 171 | }); |
| 163 | 172 | |
| 164 | - var fage=false; | |
| 165 | - var xlList; | |
| 166 | - var obj = []; | |
| 173 | + | |
| 174 | + var lineAll="",lineNoD="",lineD=""; | |
| 167 | 175 | var datas = {}; //查询条件 |
| 168 | 176 | |
| 169 | - var tempData = {}; | |
| 170 | 177 | |
| 171 | - $.get('/report/lineList',function(result){ | |
| 172 | - xlList=result; | |
| 173 | - $.get('/user/companyData', function(result){ | |
| 174 | - obj = result; | |
| 175 | - var options = '<option value="">所有分公司</option>'; | |
| 176 | - for(var i = 0; i < obj.length; i++){ | |
| 177 | - if(obj[i].companyCode == "26"){ | |
| 178 | - var children = obj[i].children; | |
| 179 | - for(var j = 0; j < children.length; j++){ | |
| 180 | - options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 181 | - } | |
| 182 | - } | |
| 183 | - } | |
| 184 | - $('#fgsdm').html(options); | |
| 185 | - }); | |
| 178 | + /**用户分配的线路*/ | |
| 179 | + $.get('/realControAuthority/findByCurrentUser', function (userAuthor) { | |
| 180 | + lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1); | |
| 181 | + /* $.get('/line/all', function (lines) { | |
| 182 | + $.each(lines,function () { | |
| 183 | + | |
| 184 | + }); | |
| 185 | + | |
| 186 | + });*/ | |
| 186 | 187 | }); |
| 187 | 188 | |
| 189 | + var tempData = {}; | |
| 188 | 190 | |
| 189 | - // $("#gsdm").on("change",updateCompany); | |
| 190 | - function updateCompany(){ | |
| 191 | - // var company = $('#gsdm').val(); | |
| 192 | - var options = '<option value="">所有分公司</option>'; | |
| 193 | - for(var i = 0; i < obj.length; i++){ | |
| 194 | - if(obj[i].companyCode == "26"){ | |
| 191 | + $.get('/user/companyData', function(obj) { | |
| 192 | + var option = ''; | |
| 193 | + var allC = ""; | |
| 194 | + for (var i = 0; i < obj.length; i++) { | |
| 195 | + if (obj[i].companyCode == "26") { | |
| 195 | 196 | var children = obj[i].children; |
| 196 | - for(var j = 0; j < children.length; j++){ | |
| 197 | - options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 197 | + for (var j = 0; j < children.length; j++) { | |
| 198 | + allC += children[j].code+","; | |
| 199 | + option += '<option value="' + children[j].code + '">' + children[j].name + '</option>'; | |
| 198 | 200 | } |
| 199 | 201 | } |
| 200 | 202 | } |
| 201 | - $('#fgsdm').html(options); | |
| 202 | - } | |
| 203 | 203 | |
| 204 | - $("#line").on("change", function(){ | |
| 205 | - if($("#line").val() == " "){ | |
| 206 | - $("#gsdm").attr("disabled", false); | |
| 207 | - $("#fgsdm").attr("disabled", false); | |
| 208 | - } else { | |
| 209 | - var temp = tempData[$("#line").val()].split(":"); | |
| 210 | - $("#gsdm").val(temp[0]); | |
| 211 | - updateCompany(); | |
| 212 | - $("#fgsdm").val(temp[1]); | |
| 213 | - $("#gsdm").attr("disabled", true); | |
| 214 | - $("#fgsdm").attr("disabled", true); | |
| 215 | - } | |
| 204 | + var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option; | |
| 205 | + $('#fgsdm').html(options); | |
| 216 | 206 | }); |
| 217 | 207 | |
| 218 | 208 | // 项目明细选项列 |
| 219 | 209 | // 触发默认选项 |
| 220 | 210 | updateItem(); |
| 221 | 211 | $("#statisticalItem").on("change",updateItem); |
| 212 | + var item =""; | |
| 222 | 213 | function updateItem() { |
| 223 | - var item = $('#statisticalItem').val(); | |
| 214 | + item = $('#statisticalItem').val(); | |
| 224 | 215 | var options = ''; |
| 225 | 216 | if(item == "yh"){ |
| 226 | 217 | options += '<option value="jzlAll">加注量[全部]</option>' + |
| ... | ... | @@ -253,11 +244,9 @@ |
| 253 | 244 | $("#query").on("click",function(){ |
| 254 | 245 | var gsdm = "26"; |
| 255 | 246 | var fgsdm = $("#fgsdm").val(); |
| 256 | - var lineCode = $("#line").val(); | |
| 257 | 247 | var startDate = $("#startDate").val(); |
| 258 | 248 | var endDate = $("#endDate").val(); |
| 259 | 249 | var statisticalObj = $("#statisticalObj").val(); |
| 260 | - lineName=$("#line option:selected").text(); | |
| 261 | 250 | //开始和结束时间 |
| 262 | 251 | var startTime = Date.parse(new Date(startDate)); |
| 263 | 252 | var endTime = Date.parse(new Date(endDate)); |
| ... | ... | @@ -266,14 +255,13 @@ |
| 266 | 255 | datas.timeType = "y"; |
| 267 | 256 | datas.gsdm = gsdm; |
| 268 | 257 | datas.fgsdm = fgsdm; |
| 269 | - datas.lineCode = lineCode; | |
| 270 | - datas.lineName = lineName; | |
| 258 | + datas.lineCode = lineAll; | |
| 271 | 259 | datas.startDate = startDate; |
| 272 | - // datas.startDate = "2020-10-01"; | |
| 273 | 260 | datas.endDate = endDate; |
| 274 | - // datas.endDate = "2020-10-10"; | |
| 261 | + datas.destroy = $("#destroy").val(); | |
| 275 | 262 | datas.statisticalObj = $("#statisticalObj").val(); |
| 276 | 263 | datas.itemDetails = $("#itemDetails").val(); |
| 264 | + datas.item = item; | |
| 277 | 265 | |
| 278 | 266 | if(startDate==null || startDate =="" ||endDate==null || endDate ==""){ |
| 279 | 267 | layer.msg('请选择时间段!'); |
| ... | ... | @@ -292,8 +280,10 @@ |
| 292 | 280 | title: '提示' |
| 293 | 281 | , content: '没有您要查询的数据,请重新选择参数!' |
| 294 | 282 | }); |
| 283 | + $("#export").attr('disabled',"true"); | |
| 295 | 284 | return; |
| 296 | - } | |
| 285 | + }else | |
| 286 | + $("#export").removeAttr("disabled"); | |
| 297 | 287 | var htmlHead = "", htmlBody = ""; |
| 298 | 288 | var rsLength = rs.length; |
| 299 | 289 | rs.forEach(function (o, i) { |
| ... | ... | @@ -320,7 +310,6 @@ |
| 320 | 310 | }); |
| 321 | 311 | |
| 322 | 312 | $("#export").on("click",function(){ |
| 323 | - datas.timeType = "y"; | |
| 324 | 313 | var itemDetails = datas.itemDetails, |
| 325 | 314 | type = "加注量[全部]"; |
| 326 | 315 | if(itemDetails=="jzl0"){ | ... | ... |
src/main/resources/static/pages/forms/mould/report_register.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/scheduleAnaly.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
| ... | ... | @@ -79,6 +79,7 @@ |
| 79 | 79 | <th width="8%">分公司</th> |
| 80 | 80 | <th width="8%">线路</th> |
| 81 | 81 | <th width="8%">起点站名</th> |
| 82 | + <th width="6%">路牌</th> | |
| 82 | 83 | <th width="6%">计发时间</th> |
| 83 | 84 | <th width="6%">计划运送时间(分)</th> |
| 84 | 85 | <th width="6%">计划完成次数</th> |
| ... | ... | @@ -424,6 +425,7 @@ |
| 424 | 425 | <td>{{obj.subCompany}}</td> |
| 425 | 426 | <td>{{obj.line}}</td> |
| 426 | 427 | <td>{{obj.qdz}}</td> |
| 428 | + <td>{{obj.lp}}</td> | |
| 427 | 429 | <td>{{obj.jhfc}}</td> |
| 428 | 430 | <td>{{obj.bcsj}}</td> |
| 429 | 431 | <td>{{obj.jhbc}}</td> |
| ... | ... | @@ -438,7 +440,7 @@ |
| 438 | 440 | {{/each}} |
| 439 | 441 | {{if list.length == 0}} |
| 440 | 442 | <tr> |
| 441 | - <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td> | |
| 443 | + <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td> | |
| 442 | 444 | </tr> |
| 443 | 445 | {{/if}} |
| 444 | 446 | </script> |
| 445 | 447 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| 1 | -<div> | |
| 2 | - <script id="line-schedule-table-temp" type="text/html"> | |
| 3 | - <div class="schedule-wrap {{if dir==0}}up{{else}}down{{/if}}"> | |
| 4 | - <h3 class="header-title"> | |
| 5 | - {{if dir==0}} | |
| 6 | - {{line.startStationName}} | |
| 7 | - {{else}} | |
| 8 | - {{line.endStationName}} | |
| 9 | - {{/if}} | |
| 10 | - <i class="uk-icon-question-circle uk-icon-hover"></i> | |
| 11 | - <div class="fixed_legend"> | |
| 12 | - <div> | |
| 13 | - <span class="tl-xxfc">消息发出</span> | |
| 14 | - <span class="tl-xxsd">消息收到</span> | |
| 15 | - <span class="tl-xxrd">消息阅读</span> | |
| 16 | - | |
| 17 | - <span class="tl-wd">误点</span> | |
| 18 | - <span class="tl-zzzx">正在执行</span> | |
| 19 | - <span class="tl-qrlb"></span> | |
| 20 | - <span class="tl-yzx">已执行</span> | |
| 21 | - <a> | |
| 22 | - <i class="uk-icon-angle-double-up fixed_legend_close"></i> | |
| 23 | - </a> | |
| 24 | - </div> | |
| 25 | - </div> | |
| 26 | - <i class="uk-icon-eye uk-icon-hover ct_eye_icon"></i> | |
| 27 | - <i class="uk-icon-qrcode uk-icon-hover ct_calu_icon" data-toggle="tooltip" data-placement="bottom" title="计算应到实到时间对比"></i> | |
| 28 | - | |
| 29 | - <!--<i class="uk-icon-share-alt uk-icon-hover tp_info_icon" ></i>--> | |
| 30 | - | |
| 31 | - <span class="warn_multi_station" data-updown="{{dir}}" data-code="{{line.lineCode}}"></span> | |
| 32 | - <div class="search_sch_panel"> | |
| 33 | - <form class="uk-form" onsubmit="javascript:return false;"> | |
| 34 | - <div class="uk-autocomplete sch-search-autocom"> | |
| 35 | - <div class="uk-form-icon"> | |
| 36 | - <i class="uk-icon-search"></i> | |
| 37 | - <input type="text" placeholder="搜索"> | |
| 38 | - <i class="cancel uk-icon-times-circle" data-uk-tooltip="{pos:'right'}" title="取消过滤"></i> | |
| 39 | - </div> | |
| 40 | - </div> | |
| 41 | - </form> | |
| 42 | - </div> | |
| 43 | - </h3> | |
| 44 | - <div class="schedule-body"> | |
| 45 | - <div class="ct_table_wrap"> | |
| 46 | - <div class="ct_table line-schedule-table"> | |
| 47 | - <div class="ct_table_head"> | |
| 48 | - <dl> | |
| 49 | - <dt>序号</dt> | |
| 50 | - <dt>路牌</dt> | |
| 51 | - <dt>RFID</dt> | |
| 52 | - <dt>车辆</dt> | |
| 53 | - <dt>应到</dt> | |
| 54 | - <dt>实到</dt> | |
| 55 | - <dt sort-field>计发</dt> | |
| 56 | - <dt sort-field>待发</dt> | |
| 57 | - <dt>实发</dt> | |
| 58 | - <dt>原因</dt> | |
| 59 | - </dl> | |
| 60 | - </div> | |
| 61 | - <div class="ct_table_body"> | |
| 62 | - {{each list as sch i}} | |
| 63 | - <dl data-id="{{sch.id}}"> | |
| 64 | - <dd class="seq_no">{{i + 1}}</dd> | |
| 65 | - <dd class="lpName"><a>{{sch.lpName}}</a></dd> | |
| 66 | - <dd class="{{if (sch.bcType == 'in') || (sch.bcType == 'out')}}tl-white{{else if !sch.qdzArrDatesj}}tl-white{{else if (sch.rfidState & 1) == 1 && (sch.rfidState & 2) == 2}}tl-green{{else if (sch.rfidState & 1) == 1}}tl-yellow{{else}}tl-grey{{/if}}"></dd> | |
| 67 | - <dd data-nbbm="{{sch.clZbh}}" | |
| 68 | - class="{{if sch.directiveState == 60}}tl-xxfc{{else if sch.directiveState == 100}}tl-xxsd{{else if sch.directiveState == 200}}tl-xxrd{{/if}}"> | |
| 69 | - {{sch.clZbh}} | |
| 70 | - </dd> | |
| 71 | - <dd>{{sch.qdzArrDatejh}}</dd> | |
| 72 | - <dd class="qdzArrDatesjDD"><span class="qdzArrDatesjSPAN">{{sch.qdzArrDatesj}}</span><span class="arrsj-diff">{{sch.arrsj_diff}}</span></dd> | |
| 73 | - <dd data-sort-val={{sch.fcsjT}}> | |
| 74 | - {{sch.fcsj}} | |
| 75 | - {{if sch.bcType == "out"}} | |
| 76 | - <span class="uk-badge uk-badge-success out">出场</span> | |
| 77 | - {{else if sch.bcType == "in"}} | |
| 78 | - <span class="uk-badge uk-badge-warning in">进场</span> | |
| 79 | - {{else if sch.bcType == "venting"}} | |
| 80 | - <span class="uk-badge uk-badge-danger">直放</span> | |
| 81 | - {{else if sch.bcType == "major"}} | |
| 82 | - <span class="uk-badge uk-badge-danger">放站</span> | |
| 83 | - {{else if sch.bcType == "region"}} | |
| 84 | - <span class="uk-badge sch_region">区间</span> | |
| 85 | - {{else if sch.bcType == "ldks"}} | |
| 86 | - <span class="uk-badge sch_ldks">空驶</span> | |
| 87 | - {{/if}} | |
| 88 | - {{if sch.sflj}} | |
| 89 | - <span class="uk-badge uk-badge-danger">临加</span> | |
| 90 | - {{/if}} | |
| 91 | - {{if sch.cTasks.length > 0}} | |
| 92 | - <span class="uk-badge uk-badge-notification c_task {{if sch.c_t_mileage_status==-1}}c_task_mileage_error{{/if}}">{{sch.cTasks.length}}</span> | |
| 93 | - {{/if}} | |
| 94 | - {{if sch.lpChange==1}} | |
| 95 | - <span class="uk-badge uk-badge-success out">换</span> | |
| 96 | - {{/if}} | |
| 97 | - </dd> | |
| 98 | - <dd data-sort-val={{sch.dfsjT}} dbclick dbclick-type="dfsj" dbclick-val="{{sch.dfsj}}"> | |
| 99 | - {{sch.dfsj}} | |
| 100 | - {{if sch.late2}} | |
| 101 | - <span class="late-badge">?+{{sch.lateMinute}}</span> | |
| 102 | - {{/if}} | |
| 103 | - </dd> | |
| 104 | - <dd data-uk-observe class=" | |
| 105 | - {{if sch.status==-1}} | |
| 106 | - tl-qrlb | |
| 107 | - {{else if sch.status==2}} | |
| 108 | - tl-yzx | |
| 109 | - {{else if sch.status==1}} | |
| 110 | - tl-zzzx | |
| 111 | - {{else if sch.status ==4}} | |
| 112 | - tl-wfyd | |
| 113 | - {{else if sch.status == 0 && sch.late}} | |
| 114 | - tl-wd | |
| 115 | - {{/if}} fcsjActualCell"> | |
| 116 | - {{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span> | |
| 117 | - </dd> | |
| 118 | - <dd data-uk-observe> | |
| 119 | - | |
| 120 | - <span title="{{sch.remarks}}" | |
| 121 | - data-uk-tooltip="{pos:'top-left'}">{{sch.remarks}}</span> | |
| 122 | - </dd> | |
| 123 | - </dl> | |
| 124 | - {{/each}} | |
| 125 | - </div> | |
| 126 | - </div> | |
| 127 | - </div> | |
| 128 | - </div> | |
| 129 | - </div> | |
| 130 | - </script> | |
| 131 | - | |
| 132 | - <script id="line-schedule-fcsj-temp" type="text/html"> | |
| 133 | - <dd data-sort-val={{fcsjT}}> | |
| 134 | - {{fcsj}} | |
| 135 | - {{if bcType == "out"}} | |
| 136 | - <span class="uk-badge uk-badge-success out">出场</span> | |
| 137 | - {{else if bcType == "in"}} | |
| 138 | - <span class="uk-badge uk-badge-warning in">进场</span> | |
| 139 | - {{else if bcType == "venting"}} | |
| 140 | - <span class="uk-badge uk-badge-danger">直放</span> | |
| 141 | - {{else if bcType == "major"}} | |
| 142 | - <span class="uk-badge uk-badge-danger">放站</span> | |
| 143 | - {{else if bcType == "region"}} | |
| 144 | - <span class="uk-badge sch_region">区间</span> | |
| 145 | - {{else if bcType == "ldks"}} | |
| 146 | - <span class="uk-badge sch_ldks">空驶</span> | |
| 147 | - {{/if}} | |
| 148 | - {{if sflj}} | |
| 149 | - <span class="uk-badge uk-badge-danger">临加</span> | |
| 150 | - {{/if}} | |
| 151 | - {{if cTasks.length > 0}} | |
| 152 | - <span class="uk-badge uk-badge-notification c_task {{if c_t_mileage_status==-1}}c_task_mileage_error{{/if}}">{{cTasks.length}}</span> | |
| 153 | - {{/if}} | |
| 154 | - </dd> | |
| 155 | - </script> | |
| 156 | - | |
| 157 | - <script id="line-schedule-sfsj-temp" type="text/html"> | |
| 158 | - <dd data-uk-observe class=" | |
| 159 | - {{if status==-1}} | |
| 160 | - tl-qrlb | |
| 161 | - {{else if status==2}} | |
| 162 | - tl-yzx | |
| 163 | - {{else if status==1}} | |
| 164 | - tl-zzzx | |
| 165 | - {{else if status == 0 && late}} | |
| 166 | - tl-wd | |
| 167 | - {{/if}} fcsjActualCell"> | |
| 168 | - {{fcsjActual}}<span class="fcsj-diff">{{fcsj_diff}}</span> | |
| 169 | - </dd> | |
| 170 | - </script> | |
| 171 | - | |
| 172 | - <script id="line-schedule-nbbm-temp" type="text/html"> | |
| 173 | - <dd data-nbbm="{{clZbh}}" | |
| 174 | - class="{{if directiveState == 60}}tl-xxfc{{else if directiveState == 100}}tl-xxsd{{else if directiveState == 200}}tl-xxrd{{/if}}"> | |
| 175 | - {{clZbh}} | |
| 176 | - </dd> | |
| 177 | - </script> | |
| 178 | - | |
| 179 | - <script id="sfsj_sch-detail-temp" type="text/html"> | |
| 180 | - <ul class="sfsj-sch-detail"> | |
| 181 | - <li><span>路牌:</span>{{lpName}}</li> | |
| 182 | - <li><span>车辆:</span>{{clZbh}}</li> | |
| 183 | - <li><span>计发:</span>{{fcsj}}</li> | |
| 184 | - <li><span>实发:</span>{{fcsjActual}}</li> | |
| 185 | - <li><span>计达:</span>{{zdsj}}</li> | |
| 186 | - <li><span>实达:</span>{{zdsjActual}}</li> | |
| 187 | - <li><span>驾驶员:</span>{{jGh}}/{{jName}}</li> | |
| 188 | - <li><span>售票员:</span>{{sGh}}/{{sName}}</li> | |
| 189 | - <li><span>终点站:</span>{{zdzName}}</li> | |
| 190 | - </ul> | |
| 191 | - </script> | |
| 192 | - | |
| 193 | - <script id="last-sch-sunken-temp" type="text/html"> | |
| 194 | - <div class="last-sch-sunken"> | |
| 195 | - <span class="_badge">{{zdsj}}/{{zdsjActual}}</span> | |
| 196 | - </div> | |
| 197 | - </script> | |
| 198 | - | |
| 199 | - <script id="sch-lp-mileage-tip-temp" type="text/html"> | |
| 200 | - {{each data as obj i}} | |
| 201 | - {{if i > 0}}<hr>{{/if}} | |
| 202 | - | |
| 203 | - <h5 class="_title"> <span class="lp_name">{{lpName}}</span> <a>{{obj.key}}</a></h5> | |
| 204 | - <div class="LD_item"> | |
| 205 | - <span>营运:<a>{{obj.serviceMileage}}</a></span> | |
| 206 | - <span>烂班:<a>{{obj.destroyMileage}}</a></span> | |
| 207 | - <span>空驶:<a>{{obj.emptyMileage}}</a></span> | |
| 208 | - </div> | |
| 209 | - {{/each}} | |
| 210 | - </script> | |
| 211 | -</div> | |
| 1 | +<div> | |
| 2 | + <script id="line-schedule-table-temp" type="text/html"> | |
| 3 | + <div class="schedule-wrap {{if dir==0}}up{{else}}down{{/if}}"> | |
| 4 | + <h3 class="header-title"> | |
| 5 | + {{if dir==0}} | |
| 6 | + {{line.startStationName}} | |
| 7 | + {{else}} | |
| 8 | + {{line.endStationName}} | |
| 9 | + {{/if}} | |
| 10 | + <i class="uk-icon-question-circle uk-icon-hover"></i> | |
| 11 | + <div class="fixed_legend"> | |
| 12 | + <div> | |
| 13 | + <span class="tl-xxfc">消息发出</span> | |
| 14 | + <span class="tl-xxsd">消息收到</span> | |
| 15 | + <span class="tl-xxrd">消息阅读</span> | |
| 16 | + | |
| 17 | + <span class="tl-wd">误点</span> | |
| 18 | + <span class="tl-zzzx">正在执行</span> | |
| 19 | + <span class="tl-qrlb"></span> | |
| 20 | + <span class="tl-yzx">已执行</span> | |
| 21 | + <a> | |
| 22 | + <i class="uk-icon-angle-double-up fixed_legend_close"></i> | |
| 23 | + </a> | |
| 24 | + </div> | |
| 25 | + </div> | |
| 26 | + <i class="uk-icon-eye uk-icon-hover ct_eye_icon"></i> | |
| 27 | + <i class="uk-icon-qrcode uk-icon-hover ct_calu_icon" data-toggle="tooltip" data-placement="bottom" title="计算应到实到时间对比"></i> | |
| 28 | + | |
| 29 | + <!--<i class="uk-icon-share-alt uk-icon-hover tp_info_icon" ></i>--> | |
| 30 | + | |
| 31 | + <span class="warn_multi_station" data-updown="{{dir}}" data-code="{{line.lineCode}}"></span> | |
| 32 | + <div class="search_sch_panel"> | |
| 33 | + <form class="uk-form" onsubmit="javascript:return false;"> | |
| 34 | + <div class="uk-autocomplete sch-search-autocom"> | |
| 35 | + <div class="uk-form-icon"> | |
| 36 | + <i class="uk-icon-search"></i> | |
| 37 | + <input type="text" placeholder="搜索"> | |
| 38 | + <i class="cancel uk-icon-times-circle" data-uk-tooltip="{pos:'right'}" title="取消过滤"></i> | |
| 39 | + </div> | |
| 40 | + </div> | |
| 41 | + </form> | |
| 42 | + </div> | |
| 43 | + </h3> | |
| 44 | + <div class="schedule-body"> | |
| 45 | + <div class="ct_table_wrap"> | |
| 46 | + <div class="ct_table line-schedule-table"> | |
| 47 | + <div class="ct_table_head"> | |
| 48 | + <dl> | |
| 49 | + <dt>序号</dt> | |
| 50 | + <dt>路牌</dt> | |
| 51 | + <dt>RFID</dt> | |
| 52 | + <dt>车辆</dt> | |
| 53 | + <dt>应到</dt> | |
| 54 | + <dt>实到</dt> | |
| 55 | + <dt sort-field>计发</dt> | |
| 56 | + <dt sort-field>待发</dt> | |
| 57 | + <dt>实发</dt> | |
| 58 | + <dt>原因</dt> | |
| 59 | + </dl> | |
| 60 | + </div> | |
| 61 | + <div class="ct_table_body"> | |
| 62 | + {{each list as sch i}} | |
| 63 | + <dl data-id="{{sch.id}}"> | |
| 64 | + <dd class="seq_no">{{i + 1}}</dd> | |
| 65 | + <dd class="lpName"><a>{{sch.lpName}}</a></dd> | |
| 66 | + <dd class="{{if !sch.qdzArrDatesj}}tl-white{{else if (sch.rfidState & 1) == 1 && (sch.rfidState & 2) == 2}}tl-green{{else if (sch.rfidState & 1) == 1}}tl-yellow{{else}}tl-grey{{/if}}"></dd> | |
| 67 | + <dd data-nbbm="{{sch.clZbh}}" | |
| 68 | + class="{{if sch.directiveState == 60}}tl-xxfc{{else if sch.directiveState == 100}}tl-xxsd{{else if sch.directiveState == 200}}tl-xxrd{{/if}}"> | |
| 69 | + {{sch.clZbh}} | |
| 70 | + </dd> | |
| 71 | + <dd>{{sch.qdzArrDatejh}}</dd> | |
| 72 | + <dd class="qdzArrDatesjDD"><span class="qdzArrDatesjSPAN">{{sch.qdzArrDatesj}}</span><span class="arrsj-diff">{{sch.arrsj_diff}}</span></dd> | |
| 73 | + <dd data-sort-val={{sch.fcsjT}}> | |
| 74 | + {{sch.fcsj}} | |
| 75 | + {{if sch.bcType == "out"}} | |
| 76 | + <span class="uk-badge uk-badge-success out">出场</span> | |
| 77 | + {{else if sch.bcType == "in"}} | |
| 78 | + <span class="uk-badge uk-badge-warning in">进场</span> | |
| 79 | + {{else if sch.bcType == "venting"}} | |
| 80 | + <span class="uk-badge uk-badge-danger">直放</span> | |
| 81 | + {{else if sch.bcType == "major"}} | |
| 82 | + <span class="uk-badge uk-badge-danger">放站</span> | |
| 83 | + {{else if sch.bcType == "region"}} | |
| 84 | + <span class="uk-badge sch_region">区间</span> | |
| 85 | + {{else if sch.bcType == "ldks"}} | |
| 86 | + <span class="uk-badge sch_ldks">空驶</span> | |
| 87 | + {{/if}} | |
| 88 | + {{if sch.sflj}} | |
| 89 | + <span class="uk-badge uk-badge-danger">临加</span> | |
| 90 | + {{/if}} | |
| 91 | + {{if sch.cTasks.length > 0}} | |
| 92 | + <span class="uk-badge uk-badge-notification c_task {{if sch.c_t_mileage_status==-1}}c_task_mileage_error{{/if}}">{{sch.cTasks.length}}</span> | |
| 93 | + {{/if}} | |
| 94 | + {{if sch.lpChange==1}} | |
| 95 | + <span class="uk-badge uk-badge-success out">换</span> | |
| 96 | + {{/if}} | |
| 97 | + </dd> | |
| 98 | + <dd data-sort-val={{sch.dfsjT}} dbclick dbclick-type="dfsj" dbclick-val="{{sch.dfsj}}"> | |
| 99 | + {{sch.dfsj}} | |
| 100 | + {{if sch.late2}} | |
| 101 | + <span class="late-badge">?+{{sch.lateMinute}}</span> | |
| 102 | + {{/if}} | |
| 103 | + </dd> | |
| 104 | + <dd data-uk-observe class=" | |
| 105 | + {{if sch.status==-1}} | |
| 106 | + tl-qrlb | |
| 107 | + {{else if sch.status==2}} | |
| 108 | + tl-yzx | |
| 109 | + {{else if sch.status==1}} | |
| 110 | + tl-zzzx | |
| 111 | + {{else if sch.status ==4}} | |
| 112 | + tl-wfyd | |
| 113 | + {{else if sch.status == 0 && sch.late}} | |
| 114 | + tl-wd | |
| 115 | + {{/if}} fcsjActualCell"> | |
| 116 | + {{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span> | |
| 117 | + </dd> | |
| 118 | + <dd data-uk-observe> | |
| 119 | + | |
| 120 | + <span title="{{sch.remarks}}" | |
| 121 | + data-uk-tooltip="{pos:'top-left'}">{{sch.remarks}}</span> | |
| 122 | + </dd> | |
| 123 | + </dl> | |
| 124 | + {{/each}} | |
| 125 | + </div> | |
| 126 | + </div> | |
| 127 | + </div> | |
| 128 | + </div> | |
| 129 | + </div> | |
| 130 | + </script> | |
| 131 | + | |
| 132 | + <script id="line-schedule-fcsj-temp" type="text/html"> | |
| 133 | + <dd data-sort-val={{fcsjT}}> | |
| 134 | + {{fcsj}} | |
| 135 | + {{if bcType == "out"}} | |
| 136 | + <span class="uk-badge uk-badge-success out">出场</span> | |
| 137 | + {{else if bcType == "in"}} | |
| 138 | + <span class="uk-badge uk-badge-warning in">进场</span> | |
| 139 | + {{else if bcType == "venting"}} | |
| 140 | + <span class="uk-badge uk-badge-danger">直放</span> | |
| 141 | + {{else if bcType == "major"}} | |
| 142 | + <span class="uk-badge uk-badge-danger">放站</span> | |
| 143 | + {{else if bcType == "region"}} | |
| 144 | + <span class="uk-badge sch_region">区间</span> | |
| 145 | + {{else if bcType == "ldks"}} | |
| 146 | + <span class="uk-badge sch_ldks">空驶</span> | |
| 147 | + {{/if}} | |
| 148 | + {{if sflj}} | |
| 149 | + <span class="uk-badge uk-badge-danger">临加</span> | |
| 150 | + {{/if}} | |
| 151 | + {{if cTasks.length > 0}} | |
| 152 | + <span class="uk-badge uk-badge-notification c_task {{if c_t_mileage_status==-1}}c_task_mileage_error{{/if}}">{{cTasks.length}}</span> | |
| 153 | + {{/if}} | |
| 154 | + </dd> | |
| 155 | + </script> | |
| 156 | + | |
| 157 | + <script id="line-schedule-sfsj-temp" type="text/html"> | |
| 158 | + <dd data-uk-observe class=" | |
| 159 | + {{if status==-1}} | |
| 160 | + tl-qrlb | |
| 161 | + {{else if status==2}} | |
| 162 | + tl-yzx | |
| 163 | + {{else if status==1}} | |
| 164 | + tl-zzzx | |
| 165 | + {{else if status == 0 && late}} | |
| 166 | + tl-wd | |
| 167 | + {{/if}} fcsjActualCell"> | |
| 168 | + {{fcsjActual}}<span class="fcsj-diff">{{fcsj_diff}}</span> | |
| 169 | + </dd> | |
| 170 | + </script> | |
| 171 | + | |
| 172 | + <script id="line-schedule-nbbm-temp" type="text/html"> | |
| 173 | + <dd data-nbbm="{{clZbh}}" | |
| 174 | + class="{{if directiveState == 60}}tl-xxfc{{else if directiveState == 100}}tl-xxsd{{else if directiveState == 200}}tl-xxrd{{/if}}"> | |
| 175 | + {{clZbh}} | |
| 176 | + </dd> | |
| 177 | + </script> | |
| 178 | + | |
| 179 | + <script id="sfsj_sch-detail-temp" type="text/html"> | |
| 180 | + <ul class="sfsj-sch-detail"> | |
| 181 | + <li><span>路牌:</span>{{lpName}}</li> | |
| 182 | + <li><span>车辆:</span>{{clZbh}}</li> | |
| 183 | + <li><span>计发:</span>{{fcsj}}</li> | |
| 184 | + <li><span>实发:</span>{{fcsjActual}}</li> | |
| 185 | + <li><span>计达:</span>{{zdsj}}</li> | |
| 186 | + <li><span>实达:</span>{{zdsjActual}}</li> | |
| 187 | + <li><span>驾驶员:</span>{{jGh}}/{{jName}}</li> | |
| 188 | + <li><span>售票员:</span>{{sGh}}/{{sName}}</li> | |
| 189 | + <li><span>终点站:</span>{{zdzName}}</li> | |
| 190 | + </ul> | |
| 191 | + </script> | |
| 192 | + | |
| 193 | + <script id="last-sch-sunken-temp" type="text/html"> | |
| 194 | + <div class="last-sch-sunken"> | |
| 195 | + <span class="_badge">{{zdsj}}/{{zdsjActual}}</span> | |
| 196 | + </div> | |
| 197 | + </script> | |
| 198 | + | |
| 199 | + <script id="sch-lp-mileage-tip-temp" type="text/html"> | |
| 200 | + {{each data as obj i}} | |
| 201 | + {{if i > 0}}<hr>{{/if}} | |
| 202 | + | |
| 203 | + <h5 class="_title"> <span class="lp_name">{{lpName}}</span> <a>{{obj.key}}</a></h5> | |
| 204 | + <div class="LD_item"> | |
| 205 | + <span>营运:<a>{{obj.serviceMileage}}</a></span> | |
| 206 | + <span>烂班:<a>{{obj.destroyMileage}}</a></span> | |
| 207 | + <span>空驶:<a>{{obj.emptyMileage}}</a></span> | |
| 208 | + </div> | |
| 209 | + {{/each}} | |
| 210 | + </script> | |
| 211 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/report_register/add.html
| ... | ... | @@ -40,9 +40,10 @@ |
| 40 | 40 | <option value="1">首末班误点</option> |
| 41 | 41 | <option value="2">大间隔</option> |
| 42 | 42 | <option value="3">突发事件</option> |
| 43 | - <option value="4">事故</option> | |
| 43 | +<!-- <option value="7">绕改道</option> --> | |
| 44 | +<!-- <option value="4">事故</option> --> | |
| 44 | 45 | <option value="5">其他</option> |
| 45 | - <option value="6">咨询</option> | |
| 46 | +<!-- <option value="6">咨询</option> --> | |
| 46 | 47 | </select> |
| 47 | 48 | </div> |
| 48 | 49 | </div> |
| ... | ... | @@ -88,25 +89,7 @@ |
| 88 | 89 | 首末班延误原因: |
| 89 | 90 | </label> |
| 90 | 91 | <div class="uk-form-controls"> |
| 91 | - <input type="text" class="form-control" name="REPORT_SMBWD" placeholder="首末班延误原因" required> | |
| 92 | - </div> | |
| 93 | - </div> | |
| 94 | - </div> | |
| 95 | - <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 96 | - <div class="uk-form-row"> | |
| 97 | - <label class="uk-form-label"> | |
| 98 | - 对外上报部门: | |
| 99 | - </label> | |
| 100 | - <div class="uk-form-controls"> | |
| 101 | - <input type="text" class="form-control" name="REPORT_DWSBBM" placeholder="对外上报部门" required> | |
| 102 | - </div> | |
| 103 | - </div> | |
| 104 | - </div> | |
| 105 | - <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 106 | - <div class="uk-form-row"> | |
| 107 | - <label class="uk-form-label">对外上报时间:</label> | |
| 108 | - <div class="uk-form-controls"> | |
| 109 | - <input type="text" class="form-control" name="REPORT_DWSBSJ" placeholder="对外上报时间" required> | |
| 92 | + <input type="text" class="form-control" name="REPORT_SMBWD" placeholder="首末班延误原因" required> | |
| 110 | 93 | </div> |
| 111 | 94 | </div> |
| 112 | 95 | </div> |
| ... | ... | @@ -124,7 +107,7 @@ |
| 124 | 107 | 路段: |
| 125 | 108 | </label> |
| 126 | 109 | <div class="uk-form-controls"> |
| 127 | - <input type="text" class="form-control" name="REPORT_ROAD" placeholder="路段" required> | |
| 110 | + <input type="text" class="form-control" name="REPORT_ROAD" placeholder="路段" > | |
| 128 | 111 | </div> |
| 129 | 112 | </div> |
| 130 | 113 | </div> |
| ... | ... | @@ -134,7 +117,7 @@ |
| 134 | 117 | 行驶方向: |
| 135 | 118 | </label> |
| 136 | 119 | <div class="uk-form-controls"> |
| 137 | - <input type="text" class="form-control" name="REPORT_XSFX" placeholder="行驶方向" required> | |
| 120 | + <input type="text" class="form-control" name="REPORT_XSFX" placeholder="行驶方向" > | |
| 138 | 121 | </div> |
| 139 | 122 | </div> |
| 140 | 123 | </div> |
| ... | ... | @@ -144,7 +127,7 @@ |
| 144 | 127 | 站点: |
| 145 | 128 | </label> |
| 146 | 129 | <div class="uk-form-controls"> |
| 147 | - <input type="text" class="form-control" name="REPORT_STATION" placeholder="站点" required > | |
| 130 | + <input type="text" class="form-control" name="REPORT_STATION" placeholder="站点" > | |
| 148 | 131 | </div> |
| 149 | 132 | </div> |
| 150 | 133 | </div> |
| ... | ... | @@ -168,24 +151,6 @@ |
| 168 | 151 | </div> |
| 169 | 152 | </div> |
| 170 | 153 | </div> |
| 171 | - <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 172 | - <div class="uk-form-row"> | |
| 173 | - <label class="uk-form-label"> | |
| 174 | - 对外上报部门: | |
| 175 | - </label> | |
| 176 | - <div class="uk-form-controls"> | |
| 177 | - <input type="text" class="form-control" name="REPORT_DWSBBM" placeholder="对外上报部门" required> | |
| 178 | - </div> | |
| 179 | - </div> | |
| 180 | - </div> | |
| 181 | - <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 182 | - <div class="uk-form-row"> | |
| 183 | - <label class="uk-form-label">对外上报时间:</label> | |
| 184 | - <div class="uk-form-controls"> | |
| 185 | - <input type="text" class="form-control" name="REPORT_DWSBSJ" placeholder="对外上报时间" required> | |
| 186 | - </div> | |
| 187 | - </div> | |
| 188 | - </div> | |
| 189 | 154 | <div class="uk-modal-footer uk-text-right"> |
| 190 | 155 | <span class="bind_gas_station_panel" style="position: absolute;left: 30px;text-decoration: underline;"></span> |
| 191 | 156 | <button type="button" class="uk-button uk-modal-close">取消</button> |
| ... | ... | @@ -211,7 +176,7 @@ |
| 211 | 176 | 影响时间: |
| 212 | 177 | </label> |
| 213 | 178 | <div class="uk-form-controls"> |
| 214 | - <input type="text" class="form-control" name="REPORT_YXSJ" placeholder="影响时间" required> | |
| 179 | + <input type="text" class="form-control" name="REPORT_YXSJ" placeholder="影响时间" > | |
| 215 | 180 | </div> |
| 216 | 181 | </div> |
| 217 | 182 | </div> |
| ... | ... | @@ -221,7 +186,7 @@ |
| 221 | 186 | 影响班次数: |
| 222 | 187 | </label> |
| 223 | 188 | <div class="uk-form-controls"> |
| 224 | - <input type="text" class="form-control" name="REPORT_YXBC" placeholder="影响班次数" required> | |
| 189 | + <input type="text" class="form-control" name="REPORT_YXBC" placeholder="影响班次数" > | |
| 225 | 190 | </div> |
| 226 | 191 | </div> |
| 227 | 192 | </div> |
| ... | ... | @@ -231,25 +196,7 @@ |
| 231 | 196 | 调整措施: |
| 232 | 197 | </label> |
| 233 | 198 | <div class="uk-form-controls"> |
| 234 | - <input type="text" class="form-control" name="REPORT_TZCS" placeholder="调整措施" required> | |
| 235 | - </div> | |
| 236 | - </div> | |
| 237 | - </div> | |
| 238 | - <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 239 | - <div class="uk-form-row"> | |
| 240 | - <label class="uk-form-label"> | |
| 241 | - 对外上报部门: | |
| 242 | - </label> | |
| 243 | - <div class="uk-form-controls"> | |
| 244 | - <input type="text" class="form-control" name="REPORT_DWSBBM" placeholder="对外上报部门" required> | |
| 245 | - </div> | |
| 246 | - </div> | |
| 247 | - </div> | |
| 248 | - <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 249 | - <div class="uk-form-row"> | |
| 250 | - <label class="uk-form-label">对外上报时间:</label> | |
| 251 | - <div class="uk-form-controls"> | |
| 252 | - <input type="text" class="form-control" name="REPORT_DWSBSJ" placeholder="对外上报时间" required> | |
| 199 | + <input type="text" class="form-control" name="REPORT_TZCS" placeholder="调整措施" > | |
| 253 | 200 | </div> |
| 254 | 201 | </div> |
| 255 | 202 | </div> |
| ... | ... | @@ -395,6 +342,54 @@ |
| 395 | 342 | <button type="submit" class="uk-button uk-button-primary submitBtn"><i class="uk-icon-check"></i> 保存</button> |
| 396 | 343 | </div> |
| 397 | 344 | </form> |
| 345 | + <!-- 绕改道--> | |
| 346 | + <form id="add_detour_table" class="c_register_form" style="display:none; margin-top: 35px;"> | |
| 347 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 348 | + <div class="uk-form-row"> | |
| 349 | + <label class="uk-form-label"> | |
| 350 | + 路段: | |
| 351 | + </label> | |
| 352 | + <div class="uk-form-controls"> | |
| 353 | + <input type="text" class="form-control" name="REPORT_ROAD" placeholder="路段" > | |
| 354 | + </div> | |
| 355 | + </div> | |
| 356 | + </div> | |
| 357 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 358 | + <div class="uk-form-row"> | |
| 359 | + <label class="uk-form-label"> | |
| 360 | + 行驶方向: | |
| 361 | + </label> | |
| 362 | + <div class="uk-form-controls"> | |
| 363 | + <input type="text" class="form-control" name="REPORT_XSFX" placeholder="行驶方向" > | |
| 364 | + </div> | |
| 365 | + </div> | |
| 366 | + </div> | |
| 367 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 368 | + <div class="uk-form-row"> | |
| 369 | + <label class="uk-form-label"> | |
| 370 | + 跳站: | |
| 371 | + </label> | |
| 372 | + <div class="uk-form-controls"> | |
| 373 | + <input type="text" class="form-control" name="REPORT_SGGK" placeholder="跳站" > | |
| 374 | + </div> | |
| 375 | + </div> | |
| 376 | + </div> | |
| 377 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 378 | + <div class="uk-form-row"> | |
| 379 | + <label class="uk-form-label"> | |
| 380 | + 原因: | |
| 381 | + </label> | |
| 382 | + <div class="uk-form-controls"> | |
| 383 | + <textarea type="text" class="form-control" name="REPORT_BZ" placeholder="原因" required></textarea> | |
| 384 | + </div> | |
| 385 | + </div> | |
| 386 | + </div> | |
| 387 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 388 | + <span class="bind_gas_station_panel" style="position: absolute;left: 30px;text-decoration: underline;"></span> | |
| 389 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 390 | + <button type="submit" class="uk-button uk-button-primary submitBtn"><i class="uk-icon-check"></i> 保存</button> | |
| 391 | + </div> | |
| 392 | + </form> | |
| 398 | 393 | <!-- 其他--> |
| 399 | 394 | <form id="add_rests_table" class="c_register_form" style="display:none; margin-top: 35px;"> |
| 400 | 395 | |
| ... | ... | @@ -404,7 +399,7 @@ |
| 404 | 399 | 报备内容: |
| 405 | 400 | </label> |
| 406 | 401 | <div class="uk-form-controls"> |
| 407 | - <input type="text" class="form-control" name="REPORT_BZ" placeholder="报备内容" required> | |
| 402 | + <textarea type="text" class="form-control" name="REPORT_BZ" placeholder="报备内容" required></textarea> | |
| 408 | 403 | </div> |
| 409 | 404 | </div> |
| 410 | 405 | </div> |
| ... | ... | @@ -494,6 +489,8 @@ |
| 494 | 489 | typeInt = 5; |
| 495 | 490 | } else if (tableActive == 'add_consult_table') { |
| 496 | 491 | typeInt = 6; |
| 492 | + } else if (tableActive == 'add_detour_table') { | |
| 493 | + typeInt = 7; | |
| 497 | 494 | } else { |
| 498 | 495 | UIkit.modal(modal).hide(); |
| 499 | 496 | notify_err('您所选的数据有问题,请重新选择!'); |
| ... | ... | @@ -553,6 +550,8 @@ |
| 553 | 550 | tableActive = 'add_rests_table'; |
| 554 | 551 | } else if (REPORT_TYPE == 6) { |
| 555 | 552 | tableActive = 'add_consult_table'; |
| 553 | + } else if (REPORT_TYPE == 7) { | |
| 554 | + tableActive = 'add_detour_table'; | |
| 556 | 555 | } |
| 557 | 556 | document.getElementById(tableActive).style.display = ""; |
| 558 | 557 | changeType(tableActive); | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/report_register/list.html
| ... | ... | @@ -33,9 +33,10 @@ |
| 33 | 33 | <li id="first_last_late" class="uk-active"><a>首末班误点</a></li> |
| 34 | 34 | <li id="large_interval"><a>大间隔</a></li> |
| 35 | 35 | <li id="emergency"><a>突发事件</a></li> |
| 36 | - <li id="accident"><a>事故</a></li> | |
| 36 | +<!-- <li id="detour"><a>绕改道</a></li> --> | |
| 37 | +<!-- <li id="accident"><a>事故</a></li> --> | |
| 37 | 38 | <li id="rests"><a>其他</a></li> |
| 38 | - <li id="consult"><a>咨询</a></li> | |
| 39 | +<!-- <li id="consult"><a>咨询</a></li> --> | |
| 39 | 40 | </ul> |
| 40 | 41 | </div> |
| 41 | 42 | |
| ... | ... | @@ -68,8 +69,6 @@ |
| 68 | 69 | <th width="7%">延误站点</th> |
| 69 | 70 | <th width="5%">延误时间</th> |
| 70 | 71 | <th width="10%">首末班延误原因</th> |
| 71 | - <th width="7%">对外上报部门</th> | |
| 72 | - <th width="7%">对外上报时间</th> | |
| 73 | 72 | </tr> |
| 74 | 73 | </thead> |
| 75 | 74 | <tbody class="table_body"> |
| ... | ... | @@ -90,8 +89,6 @@ |
| 90 | 89 | <th width="7%">站点</th> |
| 91 | 90 | <th width="7%">大间隔时间</th> |
| 92 | 91 | <th width="7%">大间隔原因</th> |
| 93 | - <th width="7%">对外上报部门</th> | |
| 94 | - <th width="7%">对外上报时间</th> | |
| 95 | 92 | </tr> |
| 96 | 93 | </thead> |
| 97 | 94 | <tbody class="table_body"> |
| ... | ... | @@ -111,8 +108,6 @@ |
| 111 | 108 | <th width="7%">影响时间</th> |
| 112 | 109 | <th width="7%">影响班次数</th> |
| 113 | 110 | <th width="7%">调整措施</th> |
| 114 | - <th width="7%">对外上报部门</th> | |
| 115 | - <th width="7%">对外上报时间</th> | |
| 116 | 111 | </tr> |
| 117 | 112 | </thead> |
| 118 | 113 | <tbody class="table_body"> |
| ... | ... | @@ -146,6 +141,25 @@ |
| 146 | 141 | <tbody class="table_body"> |
| 147 | 142 | </tbody> |
| 148 | 143 | </table> |
| 144 | + <!-- 绕改道--> | |
| 145 | + <table class="table table-striped table-bordered table-hover table-checkable report-register-table" style="display:none" id="detour_table"> | |
| 146 | + <thead class=""> | |
| 147 | + <tr role="row"> | |
| 148 | + <th width="2%">序号</th> | |
| 149 | + <th width="5%">报备时间</th> | |
| 150 | + <th width="5%">报备人</th> | |
| 151 | + <th width="5%">公司</th> | |
| 152 | + <th width="5%">分公司</th> | |
| 153 | + <th width="5%">线路</th> | |
| 154 | + <th width="5%">路段</th> | |
| 155 | + <th width="5%">行驶方向</th> | |
| 156 | + <th width="5%">跳站</th> | |
| 157 | + <th width="7%">原因</th> | |
| 158 | + </tr> | |
| 159 | + </thead> | |
| 160 | + <tbody class="table_body"> | |
| 161 | + </tbody> | |
| 162 | + </table> | |
| 149 | 163 | <!-- 其他--> |
| 150 | 164 | <table class="table table-striped table-bordered table-hover table-checkable report-register-table" style="display:none" id="rests_table"> |
| 151 | 165 | <tr role="row"> |
| ... | ... | @@ -202,8 +216,6 @@ |
| 202 | 216 | <td style="vertical-align: middle;">{{obj.report_STATION}}</td> |
| 203 | 217 | <td style="vertical-align: middle;">{{obj.report_YWSJ}}</td> |
| 204 | 218 | <td style="vertical-align: middle;">{{obj.report_SMBWD}}</td> |
| 205 | - <td style="vertical-align: middle;">{{obj.report_DWSBBM}}</td> | |
| 206 | - <td style="vertical-align: middle;">{{obj.report_DWSBSJ}}</td> | |
| 207 | 219 | </tr> |
| 208 | 220 | {{/each}} |
| 209 | 221 | </script> |
| ... | ... | @@ -225,8 +237,6 @@ |
| 225 | 237 | <td style="vertical-align: middle;">{{obj.report_STATION}}</td> |
| 226 | 238 | <td style="vertical-align: middle;">{{obj.report_DJGSNAMEJ}}</td> |
| 227 | 239 | <td style="vertical-align: middle;">{{obj.report_DJGYY}}</td> |
| 228 | - <td style="vertical-align: middle;">{{obj.report_DWSBBM}}</td> | |
| 229 | - <td style="vertical-align: middle;">{{obj.report_DWSBSJ}}</td> | |
| 230 | 240 | </tr> |
| 231 | 241 | {{/each}} |
| 232 | 242 | </script> |
| ... | ... | @@ -247,8 +257,6 @@ |
| 247 | 257 | <td style="vertical-align: middle;">{{obj.report_YXSJ}}</td> |
| 248 | 258 | <td style="vertical-align: middle;">{{obj.report_YXBC}}</td> |
| 249 | 259 | <td style="vertical-align: middle;">{{obj.report_TZCS}}</td> |
| 250 | - <td style="vertical-align: middle;">{{obj.report_DWSBBM}}</td> | |
| 251 | - <td style="vertical-align: middle;">{{obj.report_DWSBSJ}}</td> | |
| 252 | 260 | </tr> |
| 253 | 261 | {{/each}} |
| 254 | 262 | </script> |
| ... | ... | @@ -281,6 +289,26 @@ |
| 281 | 289 | </tr> |
| 282 | 290 | {{/each}} |
| 283 | 291 | </script> |
| 292 | + <script id="detour_table_body_list" type="text/html"> | |
| 293 | + {{each data.list as obj i}} | |
| 294 | + {{if obj.status == 2}} | |
| 295 | + <tr style="background-color: #ff5f78"> | |
| 296 | + {{else}} | |
| 297 | + <tr> | |
| 298 | + {{/if}} | |
| 299 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 300 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 301 | + <td style="vertical-align: middle;">{{obj.report_BBR}}</td> | |
| 302 | + <td style="vertical-align: middle;">{{obj.report_GSNAME}}</td> | |
| 303 | + <td style="vertical-align: middle;">{{obj.report_FGSNAME}}</td> | |
| 304 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 305 | + <td style="vertical-align: middle;">{{obj.report_ROAD}}</td> | |
| 306 | + <td style="vertical-align: middle;">{{obj.report_XSFX}}</td> | |
| 307 | + <td style="vertical-align: middle;">{{obj.report_SGGK}}</td> | |
| 308 | + <td style="vertical-align: middle;">{{obj.report_BZ}}</td> | |
| 309 | + </tr> | |
| 310 | + {{/each}} | |
| 311 | + </script> | |
| 284 | 312 | <script id="rests_table_body_list" type="text/html"> |
| 285 | 313 | {{each data.list as obj i}} |
| 286 | 314 | {{if obj.status == 2}} |
| ... | ... | @@ -410,7 +438,7 @@ |
| 410 | 438 | if (data.status == "SUCCESS") { |
| 411 | 439 | var list = data.list; |
| 412 | 440 | var tableList1 = [], tableList2 = [], tableList3 = [], tableList4 = [], tableList5 = [], |
| 413 | - tableList6 = []; | |
| 441 | + tableList6 = [], tableList7 = []; | |
| 414 | 442 | $.each(list, function (i, rr) { |
| 415 | 443 | rr.report_DATE = formatDate(new Date(rr.report_DATE)); |
| 416 | 444 | if (rr.report_TYPE == 1) { |
| ... | ... | @@ -425,6 +453,8 @@ |
| 425 | 453 | tableList5.push(rr); |
| 426 | 454 | } else if (rr.report_TYPE == 6) { |
| 427 | 455 | tableList6.push(rr); |
| 456 | + } else if (rr.report_TYPE == 7) { | |
| 457 | + tableList7.push(rr); | |
| 428 | 458 | } |
| 429 | 459 | }); |
| 430 | 460 | var htmlStr = template('first_last_late_table_body_list', {'data':{'list': tableList1,'line':lineList}}); |
| ... | ... | @@ -435,6 +465,8 @@ |
| 435 | 465 | $('#emergency_table .table_body', modal).html(htmlStr); |
| 436 | 466 | htmlStr = template('accident_table_body_list', {'data':{'list': tableList4,'line':lineList}}); |
| 437 | 467 | $('#accident_table .table_body', modal).html(htmlStr); |
| 468 | + htmlStr = template('detour_table_body_list', {'data':{'list': tableList7,'line':lineList}}); | |
| 469 | + $('#detour_table .table_body', modal).html(htmlStr); | |
| 438 | 470 | htmlStr = template('rests_table_body_list', {'data':{'list': tableList5,'line':lineList}}); |
| 439 | 471 | $('#rests_table .table_body', modal).html(htmlStr); |
| 440 | 472 | htmlStr = template('consult_table_body_list', {'data':{'list': tableList6,'line':lineList}}); | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/report_register/list2.html
| ... | ... | @@ -43,9 +43,9 @@ |
| 43 | 43 | <option value="1">首末班误点</option> |
| 44 | 44 | <option value="2">大间隔</option> |
| 45 | 45 | <option value="3">突发事件</option> |
| 46 | - <option value="4">事故</option> | |
| 46 | +<!-- <option value="4">事故</option> --> | |
| 47 | 47 | <option value="5">其他</option> |
| 48 | - <option value="6">咨询</option> | |
| 48 | +<!-- <option value="6">咨询</option> --> | |
| 49 | 49 | </select> |
| 50 | 50 | </div> |
| 51 | 51 | <div class="form-group"> |
| ... | ... | @@ -190,8 +190,6 @@ |
| 190 | 190 | <th width="7%">延误站点</th> |
| 191 | 191 | <th width="5%">延误时间</th> |
| 192 | 192 | <th width="10%">首末班延误原因</th> |
| 193 | - <th width="7%">对外上报部门</th> | |
| 194 | - <th width="7%">对外上报时间</th> | |
| 195 | 193 | </tr> |
| 196 | 194 | </thead> |
| 197 | 195 | <tbody> |
| ... | ... | @@ -206,8 +204,6 @@ |
| 206 | 204 | <td style="vertical-align: middle;">{{obj.report_STATION}}</td> |
| 207 | 205 | <td style="vertical-align: middle;">{{obj.report_YWSJ}}</td> |
| 208 | 206 | <td style="vertical-align: middle;">{{obj.report_SMBWD}}</td> |
| 209 | - <td style="vertical-align: middle;">{{obj.report_DWSBBM}}</td> | |
| 210 | - <td style="vertical-align: middle;">{{obj.report_DWSBSJ}}</td> | |
| 211 | 207 | </tr> |
| 212 | 208 | {{/each}} |
| 213 | 209 | {{if list.length == 0}} |
| ... | ... | @@ -228,8 +224,6 @@ |
| 228 | 224 | <th width="7%">站点</th> |
| 229 | 225 | <th width="7%">大间隔时间</th> |
| 230 | 226 | <th width="7%">大间隔原因</th> |
| 231 | - <th width="7%">对外上报部门</th> | |
| 232 | - <th width="7%">对外上报时间</th> | |
| 233 | 227 | </tr> |
| 234 | 228 | </thead> |
| 235 | 229 | <tbody> |
| ... | ... | @@ -246,8 +240,6 @@ |
| 246 | 240 | <td style="vertical-align: middle;">{{obj.report_STATION}}</td> |
| 247 | 241 | <td style="vertical-align: middle;">{{obj.report_DJGSJ}}</td> |
| 248 | 242 | <td style="vertical-align: middle;">{{obj.report_DJGYY}}</td> |
| 249 | - <td style="vertical-align: middle;">{{obj.report_DWSBBM}}</td> | |
| 250 | - <td style="vertical-align: middle;">{{obj.report_DWSBSJ}}</td> | |
| 251 | 243 | </tr> |
| 252 | 244 | {{/each}} |
| 253 | 245 | {{if list.length == 0}} |
| ... | ... | @@ -267,8 +259,6 @@ |
| 267 | 259 | <th width="7%">影响时间</th> |
| 268 | 260 | <th width="7%">影响班次数</th> |
| 269 | 261 | <th width="7%">调整措施</th> |
| 270 | - <th width="7%">对外上报部门</th> | |
| 271 | - <th width="7%">对外上报时间</th> | |
| 272 | 262 | </tr> |
| 273 | 263 | </thead> |
| 274 | 264 | <tbody> |
| ... | ... | @@ -284,8 +274,6 @@ |
| 284 | 274 | <td style="vertical-align: middle;">{{obj.report_YXSJ}}</td> |
| 285 | 275 | <td style="vertical-align: middle;">{{obj.report_YXBC}}</td> |
| 286 | 276 | <td style="vertical-align: middle;">{{obj.report_TZCS}}</td> |
| 287 | - <td style="vertical-align: middle;">{{obj.report_DWSBBM}}</td> | |
| 288 | - <td style="vertical-align: middle;">{{obj.report_DWSBSJ}}</td> | |
| 289 | 277 | </tr> |
| 290 | 278 | {{/each}} |
| 291 | 279 | {{if list.length == 0}} | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/report_register/manage.html
| ... | ... | @@ -36,9 +36,10 @@ |
| 36 | 36 | <li id="first_last_late" class="uk-active"><a>首末班误点</a></li> |
| 37 | 37 | <li id="large_interval"><a>大间隔</a></li> |
| 38 | 38 | <li id="emergency"><a>突发事件</a></li> |
| 39 | - <li id="accident"><a>事故</a></li> | |
| 39 | +<!-- <li id="detour"><a>绕改道</a></li> --> | |
| 40 | +<!-- <li id="accident"><a>事故</a></li> --> | |
| 40 | 41 | <li id="rests"><a>其他</a></li> |
| 41 | - <li id="consult"><a>咨询</a></li> | |
| 42 | +<!-- <li id="consult"><a>咨询</a></li> --> | |
| 42 | 43 | </ul> |
| 43 | 44 | </div> |
| 44 | 45 | |
| ... | ... | @@ -68,8 +69,6 @@ |
| 68 | 69 | <th width="7%">延误站点</th> |
| 69 | 70 | <th width="5%">延误时间</th> |
| 70 | 71 | <th width="10%">首末班延误原因</th> |
| 71 | - <th width="7%">对外上报部门</th> | |
| 72 | - <th width="7%">对外上报时间</th> | |
| 73 | 72 | </tr> |
| 74 | 73 | </thead> |
| 75 | 74 | <tbody class="table_body"> |
| ... | ... | @@ -89,8 +88,6 @@ |
| 89 | 88 | <th width="7%">站点</th> |
| 90 | 89 | <th width="7%">大间隔时间</th> |
| 91 | 90 | <th width="7%">大间隔原因</th> |
| 92 | - <th width="7%">对外上报部门</th> | |
| 93 | - <th width="7%">对外上报时间</th> | |
| 94 | 91 | </tr> |
| 95 | 92 | </thead> |
| 96 | 93 | <tbody class="table_body"> |
| ... | ... | @@ -109,8 +106,6 @@ |
| 109 | 106 | <th width="7%">影响时间</th> |
| 110 | 107 | <th width="7%">影响班次数</th> |
| 111 | 108 | <th width="7%">调整措施</th> |
| 112 | - <th width="7%">对外上报部门</th> | |
| 113 | - <th width="7%">对外上报时间</th> | |
| 114 | 109 | </tr> |
| 115 | 110 | </thead> |
| 116 | 111 | <tbody class="table_body"> |
| ... | ... | @@ -143,6 +138,24 @@ |
| 143 | 138 | <tbody class="table_body"> |
| 144 | 139 | </tbody> |
| 145 | 140 | </table> |
| 141 | + <!-- 绕改道--> | |
| 142 | + <table class="table table-striped table-bordered table-hover table-checkable report-register-table" style="display:none" id="detour_table"> | |
| 143 | + <thead class=""> | |
| 144 | + <tr role="row"> | |
| 145 | + <!--<th width="2%"><input type="radio" name="checkItems"></th>--> | |
| 146 | + <th width="2%">#</th> | |
| 147 | + <th width="2%">序号</th> | |
| 148 | + <th width="5%">报备时间</th> | |
| 149 | + <th width="5%">线路</th> | |
| 150 | + <th width="5%">路段</th> | |
| 151 | + <th width="5%">行驶方向</th> | |
| 152 | + <th width="5%">跳站</th> | |
| 153 | + <th width="7%">原因</th> | |
| 154 | + </tr> | |
| 155 | + </thead> | |
| 156 | + <tbody class="table_body"> | |
| 157 | + </tbody> | |
| 158 | + </table> | |
| 146 | 159 | <!-- 其他--> |
| 147 | 160 | <table class="table table-striped table-bordered table-hover table-checkable report-register-table" style="display:none" id="rests_table"> |
| 148 | 161 | <thead class=""> |
| ... | ... | @@ -204,8 +217,6 @@ |
| 204 | 217 | <td style="vertical-align: middle;">{{obj.report_STATION}}</td> |
| 205 | 218 | <td style="vertical-align: middle;">{{obj.report_YWSJ}}</td> |
| 206 | 219 | <td style="vertical-align: middle;">{{obj.report_SMBWD}}</td> |
| 207 | - <td style="vertical-align: middle;">{{obj.report_DWSBBM}}</td> | |
| 208 | - <td style="vertical-align: middle;">{{obj.report_DWSBSJ}}</td> | |
| 209 | 220 | </tr> |
| 210 | 221 | {{/each}} |
| 211 | 222 | </script> |
| ... | ... | @@ -233,8 +244,6 @@ |
| 233 | 244 | <td style="vertical-align: middle;">{{obj.report_STATION}}</td> |
| 234 | 245 | <td style="vertical-align: middle;">{{obj.report_DJGSJ}}</td> |
| 235 | 246 | <td style="vertical-align: middle;">{{obj.report_DJGYY}}</td> |
| 236 | - <td style="vertical-align: middle;">{{obj.report_DWSBBM}}</td> | |
| 237 | - <td style="vertical-align: middle;">{{obj.report_DWSBSJ}}</td> | |
| 238 | 247 | </tr> |
| 239 | 248 | {{/each}} |
| 240 | 249 | </script> |
| ... | ... | @@ -261,8 +270,6 @@ |
| 261 | 270 | <td style="vertical-align: middle;">{{obj.report_YXSJ}}</td> |
| 262 | 271 | <td style="vertical-align: middle;">{{obj.report_YXBC}}</td> |
| 263 | 272 | <td style="vertical-align: middle;">{{obj.report_TZCS}}</td> |
| 264 | - <td style="vertical-align: middle;">{{obj.report_DWSBBM}}</td> | |
| 265 | - <td style="vertical-align: middle;">{{obj.report_DWSBSJ}}</td> | |
| 266 | 273 | </tr> |
| 267 | 274 | {{/each}} |
| 268 | 275 | </script> |
| ... | ... | @@ -301,6 +308,33 @@ |
| 301 | 308 | </tr> |
| 302 | 309 | {{/each}} |
| 303 | 310 | </script> |
| 311 | + <script id="detour_table_body" type="text/html"> | |
| 312 | + {{each data.list as obj i}} | |
| 313 | + | |
| 314 | + {{if obj.status == 2}} | |
| 315 | + <tr style="background-color: #ff5f78"> | |
| 316 | + <td style="vertical-align: middle;"> | |
| 317 | + <!--<input type="radio" class="group-checkable icheck" name="idRadio" value="{{obj.id}}" data-lineCode="{{obj.report_XL}}">--> | |
| 318 | + </td> | |
| 319 | + {{else}} | |
| 320 | + <tr> | |
| 321 | + <td style="vertical-align: middle;"> | |
| 322 | + <input type="radio" class="group-checkable icheck" name="idRadio" value="{{obj.id}}" data-lineCode="{{obj.report_XL}}"> | |
| 323 | + </td> | |
| 324 | + {{/if}} | |
| 325 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 326 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 327 | + <td style="vertical-align: middle;display:none">{{obj.report_BBR}}</td> | |
| 328 | + <td style="vertical-align: middle;display:none">{{obj.report_GS}}</td> | |
| 329 | + <td style="vertical-align: middle;display:none">{{obj.report_FGS}}</td> | |
| 330 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 331 | + <td style="vertical-align: middle;">{{obj.report_ROAD}}</td> | |
| 332 | + <td style="vertical-align: middle;">{{obj.report_XSFX}}</td> | |
| 333 | + <td style="vertical-align: middle;">{{obj.report_SGGK}}</td> | |
| 334 | + <td style="vertical-align: middle;">{{obj.report_BZ}}</td> | |
| 335 | + </tr> | |
| 336 | + {{/each}} | |
| 337 | + </script> | |
| 304 | 338 | <script id="rests_table_body" type="text/html"> |
| 305 | 339 | {{each data.list as obj i}} |
| 306 | 340 | |
| ... | ... | @@ -434,7 +468,7 @@ |
| 434 | 468 | if (data.status == "SUCCESS") { |
| 435 | 469 | var list = data.list; |
| 436 | 470 | var tableList1 = [], tableList2 = [], tableList3 = [], tableList4 = [], tableList5 = [], |
| 437 | - tableList6 = []; | |
| 471 | + tableList6 = [], tableList7 = []; | |
| 438 | 472 | $.each(list, function (i, rr) { |
| 439 | 473 | rr.report_DATE = formatDate(new Date(rr.report_DATE)); |
| 440 | 474 | if (rr.report_TYPE == 1) { |
| ... | ... | @@ -449,6 +483,8 @@ |
| 449 | 483 | tableList5.push(rr); |
| 450 | 484 | } else if (rr.report_TYPE == 6) { |
| 451 | 485 | tableList6.push(rr); |
| 486 | + } else if (rr.report_TYPE == 7) { | |
| 487 | + tableList7.push(rr); | |
| 452 | 488 | } |
| 453 | 489 | }); |
| 454 | 490 | var htmlStr = template('first_last_late_table_body', {'data':{'list': tableList1,'line':lineList}}); |
| ... | ... | @@ -459,6 +495,8 @@ |
| 459 | 495 | $('#emergency_table .table_body', modal).html(htmlStr); |
| 460 | 496 | htmlStr = template('accident_table_body', {'data':{'list': tableList4,'line':lineList}}); |
| 461 | 497 | $('#accident_table .table_body', modal).html(htmlStr); |
| 498 | + htmlStr = template('detour_table_body', {'data':{'list': tableList7,'line':lineList}}); | |
| 499 | + $('#detour_table .table_body', modal).html(htmlStr); | |
| 462 | 500 | htmlStr = template('rests_table_body', {'data':{'list': tableList5,'line':lineList}}); |
| 463 | 501 | $('#rests_table .table_body', modal).html(htmlStr); |
| 464 | 502 | htmlStr = template('consult_table_body', {'data':{'list': tableList6,'line':lineList}}); | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/report_register/update.html
| ... | ... | @@ -41,9 +41,10 @@ |
| 41 | 41 | <option value="1">首末班误点</option> |
| 42 | 42 | <option value="2">大间隔</option> |
| 43 | 43 | <option value="3">突发事件</option> |
| 44 | - <option value="4">事故</option> | |
| 44 | +<!-- <option value="7">绕改道</option> --> | |
| 45 | +<!-- <option value="4">事故</option> --> | |
| 45 | 46 | <option value="5">其他</option> |
| 46 | - <option value="6">咨询</option> | |
| 47 | +<!-- <option value="6">咨询</option> --> | |
| 47 | 48 | </select> |
| 48 | 49 | </div> |
| 49 | 50 | </div> |
| ... | ... | @@ -93,24 +94,6 @@ |
| 93 | 94 | </div> |
| 94 | 95 | </div> |
| 95 | 96 | </div> |
| 96 | - <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 97 | - <div class="uk-form-row"> | |
| 98 | - <label class="uk-form-label"> | |
| 99 | - 对外上报部门: | |
| 100 | - </label> | |
| 101 | - <div class="uk-form-controls"> | |
| 102 | - <input type="text" class="form-control" name="REPORT_DWSBBM" placeholder="对外上报部门" required> | |
| 103 | - </div> | |
| 104 | - </div> | |
| 105 | - </div> | |
| 106 | - <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 107 | - <div class="uk-form-row"> | |
| 108 | - <label class="uk-form-label">对外上报时间:</label> | |
| 109 | - <div class="uk-form-controls"> | |
| 110 | - <input type="text" class="form-control" name="REPORT_DWSBSJ" placeholder="对外上报时间" required> | |
| 111 | - </div> | |
| 112 | - </div> | |
| 113 | - </div> | |
| 114 | 97 | <div class="uk-modal-footer uk-text-right"> |
| 115 | 98 | <span class="bind_gas_station_panel" style="position: absolute;left: 30px;text-decoration: underline;"></span> |
| 116 | 99 | <button type="button" class="uk-button uk-modal-close">取消</button> |
| ... | ... | @@ -125,7 +108,7 @@ |
| 125 | 108 | 路段: |
| 126 | 109 | </label> |
| 127 | 110 | <div class="uk-form-controls"> |
| 128 | - <input type="text" class="form-control" name="REPORT_ROAD" placeholder="路段" required> | |
| 111 | + <input type="text" class="form-control" name="REPORT_ROAD" placeholder="路段" > | |
| 129 | 112 | </div> |
| 130 | 113 | </div> |
| 131 | 114 | </div> |
| ... | ... | @@ -135,7 +118,7 @@ |
| 135 | 118 | 行驶方向: |
| 136 | 119 | </label> |
| 137 | 120 | <div class="uk-form-controls"> |
| 138 | - <input type="text" class="form-control" name="REPORT_XSFX" placeholder="行驶方向" required> | |
| 121 | + <input type="text" class="form-control" name="REPORT_XSFX" placeholder="行驶方向" > | |
| 139 | 122 | </div> |
| 140 | 123 | </div> |
| 141 | 124 | </div> |
| ... | ... | @@ -145,7 +128,7 @@ |
| 145 | 128 | 站点: |
| 146 | 129 | </label> |
| 147 | 130 | <div class="uk-form-controls"> |
| 148 | - <input type="text" class="form-control" name="REPORT_STATION" placeholder="站点" required > | |
| 131 | + <input type="text" class="form-control" name="REPORT_STATION" placeholder="站点" > | |
| 149 | 132 | </div> |
| 150 | 133 | </div> |
| 151 | 134 | </div> |
| ... | ... | @@ -169,24 +152,6 @@ |
| 169 | 152 | </div> |
| 170 | 153 | </div> |
| 171 | 154 | </div> |
| 172 | - <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 173 | - <div class="uk-form-row"> | |
| 174 | - <label class="uk-form-label"> | |
| 175 | - 对外上报部门: | |
| 176 | - </label> | |
| 177 | - <div class="uk-form-controls"> | |
| 178 | - <input type="text" class="form-control" name="REPORT_DWSBBM" placeholder="对外上报部门" required> | |
| 179 | - </div> | |
| 180 | - </div> | |
| 181 | - </div> | |
| 182 | - <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 183 | - <div class="uk-form-row"> | |
| 184 | - <label class="uk-form-label">对外上报时间:</label> | |
| 185 | - <div class="uk-form-controls"> | |
| 186 | - <input type="text" class="form-control" name="REPORT_DWSBSJ" placeholder="对外上报时间" required> | |
| 187 | - </div> | |
| 188 | - </div> | |
| 189 | - </div> | |
| 190 | 155 | <div class="uk-modal-footer uk-text-right"> |
| 191 | 156 | <span class="bind_gas_station_panel" style="position: absolute;left: 30px;text-decoration: underline;"></span> |
| 192 | 157 | <button type="button" class="uk-button uk-modal-close">取消</button> |
| ... | ... | @@ -212,7 +177,7 @@ |
| 212 | 177 | 影响时间: |
| 213 | 178 | </label> |
| 214 | 179 | <div class="uk-form-controls"> |
| 215 | - <input type="text" class="form-control" name="REPORT_YXSJ" placeholder="影响时间" required> | |
| 180 | + <input type="text" class="form-control" name="REPORT_YXSJ" placeholder="影响时间" > | |
| 216 | 181 | </div> |
| 217 | 182 | </div> |
| 218 | 183 | </div> |
| ... | ... | @@ -222,7 +187,7 @@ |
| 222 | 187 | 影响班次数: |
| 223 | 188 | </label> |
| 224 | 189 | <div class="uk-form-controls"> |
| 225 | - <input type="text" class="form-control" name="REPORT_YXBC" placeholder="影响班次数" required> | |
| 190 | + <input type="text" class="form-control" name="REPORT_YXBC" placeholder="影响班次数" > | |
| 226 | 191 | </div> |
| 227 | 192 | </div> |
| 228 | 193 | </div> |
| ... | ... | @@ -232,25 +197,7 @@ |
| 232 | 197 | 调整措施: |
| 233 | 198 | </label> |
| 234 | 199 | <div class="uk-form-controls"> |
| 235 | - <input type="text" class="form-control" name="REPORT_TZCS" placeholder="调整措施" required> | |
| 236 | - </div> | |
| 237 | - </div> | |
| 238 | - </div> | |
| 239 | - <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 240 | - <div class="uk-form-row"> | |
| 241 | - <label class="uk-form-label"> | |
| 242 | - 对外上报部门: | |
| 243 | - </label> | |
| 244 | - <div class="uk-form-controls"> | |
| 245 | - <input type="text" class="form-control" name="REPORT_DWSBBM" placeholder="对外上报部门" required> | |
| 246 | - </div> | |
| 247 | - </div> | |
| 248 | - </div> | |
| 249 | - <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 250 | - <div class="uk-form-row"> | |
| 251 | - <label class="uk-form-label">对外上报时间:</label> | |
| 252 | - <div class="uk-form-controls"> | |
| 253 | - <input type="text" class="form-control" name="REPORT_DWSBSJ" placeholder="对外上报时间" required> | |
| 200 | + <input type="text" class="form-control" name="REPORT_TZCS" placeholder="调整措施" > | |
| 254 | 201 | </div> |
| 255 | 202 | </div> |
| 256 | 203 | </div> |
| ... | ... | @@ -396,6 +343,54 @@ |
| 396 | 343 | <button type="submit" class="uk-button uk-button-primary submitBtn"><i class="uk-icon-check"></i> 保存</button> |
| 397 | 344 | </div> |
| 398 | 345 | </form> |
| 346 | + <!-- 绕改道--> | |
| 347 | + <form id="add_detour_table" class="c_register_form" style="display:none; margin-top: 35px;"> | |
| 348 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 349 | + <div class="uk-form-row"> | |
| 350 | + <label class="uk-form-label"> | |
| 351 | + 路段: | |
| 352 | + </label> | |
| 353 | + <div class="uk-form-controls"> | |
| 354 | + <input type="text" class="form-control" name="REPORT_ROAD" placeholder="路段" > | |
| 355 | + </div> | |
| 356 | + </div> | |
| 357 | + </div> | |
| 358 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 359 | + <div class="uk-form-row"> | |
| 360 | + <label class="uk-form-label"> | |
| 361 | + 行驶方向: | |
| 362 | + </label> | |
| 363 | + <div class="uk-form-controls"> | |
| 364 | + <input type="text" class="form-control" name="REPORT_XSFX" placeholder="行驶方向" > | |
| 365 | + </div> | |
| 366 | + </div> | |
| 367 | + </div> | |
| 368 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 369 | + <div class="uk-form-row"> | |
| 370 | + <label class="uk-form-label"> | |
| 371 | + 跳站: | |
| 372 | + </label> | |
| 373 | + <div class="uk-form-controls"> | |
| 374 | + <input type="text" class="form-control" name="REPORT_SGGK" placeholder="跳站" > | |
| 375 | + </div> | |
| 376 | + </div> | |
| 377 | + </div> | |
| 378 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 379 | + <div class="uk-form-row"> | |
| 380 | + <label class="uk-form-label"> | |
| 381 | + 原因: | |
| 382 | + </label> | |
| 383 | + <div class="uk-form-controls"> | |
| 384 | + <textarea type="text" class="form-control" name="REPORT_BZ" placeholder="原因" required></textarea> | |
| 385 | + </div> | |
| 386 | + </div> | |
| 387 | + </div> | |
| 388 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 389 | + <span class="bind_gas_station_panel" style="position: absolute;left: 30px;text-decoration: underline;"></span> | |
| 390 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 391 | + <button type="submit" class="uk-button uk-button-primary submitBtn"><i class="uk-icon-check"></i> 保存</button> | |
| 392 | + </div> | |
| 393 | + </form> | |
| 399 | 394 | <!-- 其他--> |
| 400 | 395 | <form id="add_rests_table" class="c_register_form" style="display:none; margin-top: 35px;"> |
| 401 | 396 | |
| ... | ... | @@ -405,7 +400,7 @@ |
| 405 | 400 | 报备内容: |
| 406 | 401 | </label> |
| 407 | 402 | <div class="uk-form-controls"> |
| 408 | - <input type="text" class="form-control" name="REPORT_BZ" placeholder="报备内容" required> | |
| 403 | + <textarea type="text" class="form-control" name="REPORT_BZ" placeholder="报备内容" required></textarea> | |
| 409 | 404 | </div> |
| 410 | 405 | </div> |
| 411 | 406 | </div> |
| ... | ... | @@ -495,6 +490,8 @@ |
| 495 | 490 | typeInt = 5; |
| 496 | 491 | } else if (tableActive == 'add_consult_table') { |
| 497 | 492 | typeInt = 6; |
| 493 | + } else if (tableActive == 'add_detour_table') { | |
| 494 | + typeInt = 7; | |
| 498 | 495 | } |
| 499 | 496 | $('#REPORT_TYPE').val(typeInt); |
| 500 | 497 | if(typeInt != rr.REPORT_TYPE ) { |
| ... | ... | @@ -563,6 +560,8 @@ |
| 563 | 560 | tableActive = 'add_rests_table'; |
| 564 | 561 | } else if (REPORT_TYPE == 6) { |
| 565 | 562 | tableActive = 'add_consult_table'; |
| 563 | + } else if (REPORT_TYPE == 7) { | |
| 564 | + tableActive = 'add_detour_table'; | |
| 566 | 565 | } |
| 567 | 566 | document.getElementById(tableActive).style.display = ""; |
| 568 | 567 | changeType(tableActive); | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| 1 | -/** schedule table */ | |
| 2 | - | |
| 3 | -var gb_schedule_table = (function () { | |
| 4 | - | |
| 5 | - var temps; | |
| 6 | - //线路分组的班次数据 | |
| 7 | - var line2Schedule = {}; | |
| 8 | - //车辆应发未发车辆数 | |
| 9 | - var car_yfwf_map = {}; | |
| 10 | - //班次站点编码和实际不符数据 | |
| 11 | - var errorCodeData = {}; | |
| 12 | - | |
| 13 | - var bcTypeOrderMap = { | |
| 14 | - 'out':0, | |
| 15 | - 'normal':1, | |
| 16 | - 'region':2, | |
| 17 | - 'major':3, | |
| 18 | - 'venting':4, | |
| 19 | - 'ldks':5, | |
| 20 | - 'in':6 | |
| 21 | - }; | |
| 22 | - var typeOrder = function (type) { | |
| 23 | - return bcTypeOrderMap[type]?bcTypeOrderMap[type]:0; | |
| 24 | - }; | |
| 25 | - var schedule_sort = function (s1, s2) { | |
| 26 | - var diff = s1['fcsjT'] - s2['fcsjT']; | |
| 27 | - return diff!=0?diff:typeOrder(s1['bcType'])-typeOrder(s2['bcType']); | |
| 28 | - }; | |
| 29 | - | |
| 30 | - var show = function (cb) { | |
| 31 | - //从服务器获取班次数据 | |
| 32 | - $.get('/realSchedule/lines', { | |
| 33 | - lines: gb_data_basic.line_idx | |
| 34 | - }, function (rs) { | |
| 35 | - for (var lineCode in rs) { | |
| 36 | - line2Schedule[lineCode] = {}; | |
| 37 | - | |
| 38 | - //排序 | |
| 39 | - rs[lineCode].sort(schedule_sort); | |
| 40 | - //calc shift | |
| 41 | - $.each(rs[lineCode], function () { | |
| 42 | - if(this.status==-1) | |
| 43 | - clearActualTime(this); | |
| 44 | - calc_sch_real_shift(this); | |
| 45 | - wfydcolor(this); | |
| 46 | - line2Schedule[lineCode][this.id] = this; | |
| 47 | - //子任务公里是否与计划平 | |
| 48 | - this.c_t_mileage_status = calcCTaskMileageStatus(this); | |
| 49 | - }); | |
| 50 | - //计算应发未发 | |
| 51 | - calc_yfwf_num(lineCode); | |
| 52 | - } | |
| 53 | - ep.emit('data', rs); | |
| 54 | - }); | |
| 55 | - | |
| 56 | - //加载班次表格渲染模板 | |
| 57 | - $.get('/real_control_v2/fragments/line_schedule/sch_table.html', function (dom) { | |
| 58 | - ep.emit('temp', gb_common.compileTempByDom(dom, { | |
| 59 | - compress: true | |
| 60 | - })); | |
| 61 | - }); | |
| 62 | - | |
| 63 | - var ep = EventProxy.create("data", "temp", function (data, temp) { | |
| 64 | - temps = temp; | |
| 65 | - var lineCode, dirData, htmlStr; | |
| 66 | - $('#main-tab-content .line_schedule').each(function () { | |
| 67 | - lineCode = $(this).data('id'); | |
| 68 | - if (arrayIsNull(data[lineCode])) | |
| 69 | - return true; | |
| 70 | - dirData = gb_common.groupBy(data[lineCode], 'xlDir'); | |
| 71 | - for (var upDown in dirData) { | |
| 72 | - htmlStr = temps['line-schedule-table-temp']({ | |
| 73 | - dir: upDown, | |
| 74 | - line: gb_data_basic.codeToLine[lineCode], | |
| 75 | - list: dirData[upDown] | |
| 76 | - }); | |
| 77 | - | |
| 78 | - $('.schedule-wrap .card-panel:eq(' + upDown + ')', this) | |
| 79 | - .html(htmlStr); | |
| 80 | - } | |
| 81 | - | |
| 82 | - //标记路牌最后一个班次 | |
| 83 | - markerLastByLine(lineCode); | |
| 84 | - //初始化图例相关,dbclick 不能代理事件 | |
| 85 | - //gb_sch_legend.init(this); | |
| 86 | - }); | |
| 87 | - //初始化图例 | |
| 88 | - gb_sch_legend.init(); | |
| 89 | - var content = $('.line_schedule .ct_table_wrap'); | |
| 90 | - //初始化滚动条 | |
| 91 | - content.perfectScrollbar({suppressScrollX: true}); | |
| 92 | - //fixed table head | |
| 93 | - gb_ct_table.fixedHead(content); | |
| 94 | - //enable sort | |
| 95 | - gb_ct_table.enableSort($('.ct_table', content), reset_seq_no, gb_schedule_table_dbclick.init); | |
| 96 | - //dbclick event | |
| 97 | - gb_schedule_table_dbclick.init(); | |
| 98 | - //双击实发 | |
| 99 | - gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell')); | |
| 100 | - //双击车辆 | |
| 101 | - gb_schedule_table_dbclick.carCellClick($('.ct_table_body dd[data-nbbm]')); | |
| 102 | - //搜索框初始化 | |
| 103 | - gb_sch_search.init(); | |
| 104 | - | |
| 105 | - //监听gps车辆信息 | |
| 106 | - gb_data_gps.registerCallback(renderCarRemark); | |
| 107 | - gb_sch_legend.showYdSdDb(); | |
| 108 | - cb && cb(); | |
| 109 | - }); | |
| 110 | - | |
| 111 | - }; | |
| 112 | - | |
| 113 | - var renderCarRemark = function () { | |
| 114 | - try{ | |
| 115 | - var $activeTab = $('.north-tabs>ul>li.tab-line.uk-active');//.data('code'); | |
| 116 | - if($activeTab.length==0) | |
| 117 | - return; | |
| 118 | - var lineCode = $activeTab.data('code'); | |
| 119 | - var array = gb_common.get_vals(line2Schedule[lineCode]); | |
| 120 | - var nbbms = {}; | |
| 121 | - for(var i=0,sch;sch=array[i++];){ | |
| 122 | - nbbms[sch.clZbh]=1; | |
| 123 | - } | |
| 124 | - | |
| 125 | - var $activeWrap = $('#main-tab-content .line_schedule.uk-active .schedule-wrap .schedule-body'); | |
| 126 | - var gps, e; | |
| 127 | - for(var nbbm in nbbms){ | |
| 128 | - gps = gb_data_gps.findGpsByNbbm(nbbm); | |
| 129 | - e = $('.ct_table_body dl>dd[data-nbbm='+nbbm+']', $activeWrap); | |
| 130 | - $('i', e).remove(); | |
| 131 | - | |
| 132 | - if(gps && gps['planCode']!=lineCode && gps.remark) | |
| 133 | - $(e).append('<i class="uk-icon-exclamation-circle" data-uk-tooltip title="'+gps.remark+'"></i>'); | |
| 134 | - } | |
| 135 | - }catch (e){ | |
| 136 | - console.log(e); | |
| 137 | - } | |
| 138 | - }; | |
| 139 | - | |
| 140 | - /** | |
| 141 | - * 计算子任务公里是否和计划平 | |
| 142 | - * @param sch | |
| 143 | - */ | |
| 144 | - var calcCTaskMileageStatus = function (sch) { | |
| 145 | - if(!sch.cTasks || sch.cTasks.length==0) | |
| 146 | - return 0; | |
| 147 | - var sum = 0; | |
| 148 | - $.each(sch.cTasks, function () { | |
| 149 | - if (this.mileageType == 'service') { | |
| 150 | - sum = gb_common.accAdd(sum, this.mileage); | |
| 151 | - } | |
| 152 | - }); | |
| 153 | - | |
| 154 | - if (sum != sch.jhlcOrig) { | |
| 155 | - return -1; | |
| 156 | - } | |
| 157 | - return 0; | |
| 158 | - }; | |
| 159 | - | |
| 160 | - | |
| 161 | - //重置序号 | |
| 162 | - var reset_seq_no = function (dls) { | |
| 163 | - dls.each(function (i, dl) { | |
| 164 | - $('dd:eq(0)', dl).text(i + 1); | |
| 165 | - }); | |
| 166 | - }; | |
| 167 | - | |
| 168 | - //计算实发时间差值 | |
| 169 | - var calc_sch_real_shift = function (sch) { | |
| 170 | - if (sch['fcsjActualTime']){ | |
| 171 | - var fs = 'YYYY-MM-DD HH:mm' | |
| 172 | - ,m1 = moment(sch['fcsjActualTime']).format(fs) | |
| 173 | - ,m2 = moment(sch['dfsjT']).format(fs);//去掉秒 | |
| 174 | - console.log(moment(m1, fs).format('X')) | |
| 175 | - console.log(moment(m2, fs).format('X')) | |
| 176 | - var diff = moment(m1, fs).format('X') - moment(m2, fs).format('X') | |
| 177 | - ,fcsj_diff = parseInt(diff / 60, 10);; | |
| 178 | - | |
| 179 | - if(fcsj_diff > 0) | |
| 180 | - sch.fcsj_diff = '( +' + fcsj_diff + ' )'; | |
| 181 | - else if (fcsj_diff < 0) | |
| 182 | - sch.fcsj_diff = '( ' + fcsj_diff + ' )'; | |
| 183 | - else | |
| 184 | - sch.fcsj_diff = ''; | |
| 185 | - } | |
| 186 | - }; | |
| 187 | - //无发有到时间 | |
| 188 | - var wfydcolor=function (sch) { | |
| 189 | - if (sch.fcsjActual==null&&sch.zdsjActual!=null&&sch.zdsjActual!=''&&sch.status!=-1) {//sch.qdzArrDatesj!=''&&sch.qdzArrDatesj!=null&& | |
| 190 | - sch.status=4; | |
| 191 | - } | |
| 192 | - } | |
| 193 | - | |
| 194 | - | |
| 195 | - | |
| 196 | - function arrayIsNull(array) { | |
| 197 | - return !array || array.length == 0; | |
| 198 | - } | |
| 199 | - | |
| 200 | - var findScheduleByLine = function (lineCode) { | |
| 201 | - return line2Schedule[lineCode]; | |
| 202 | - }; | |
| 203 | - | |
| 204 | - //新增一个班次,附带更新的班次 | |
| 205 | - var insertSchedule = function (sch, upArr) { | |
| 206 | - var xls = {}; | |
| 207 | - xls[sch.xlBm] = 1; | |
| 208 | - line2Schedule[sch.xlBm][sch.id] = sch; | |
| 209 | - //update | |
| 210 | - if (isArray(upArr)) { | |
| 211 | - $.each(upArr, function () { | |
| 212 | - line2Schedule[this.xlBm][this.id] = this; | |
| 213 | - xls[this.xlBm] = 1; | |
| 214 | - }); | |
| 215 | - } | |
| 216 | - | |
| 217 | - //重新渲染表格 | |
| 218 | - for(var xlBm in xls){ | |
| 219 | - reRenderTable(sch.xlBm); | |
| 220 | - } | |
| 221 | - //定位到新添加的班次 | |
| 222 | - scroToDl(sch); | |
| 223 | - }; | |
| 224 | - | |
| 225 | - /** | |
| 226 | - * 重新渲染表格 | |
| 227 | - */ | |
| 228 | - var reRenderTable = function (lineCode) { | |
| 229 | - var data = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort), | |
| 230 | - dirData = gb_common.groupBy(data, 'xlDir'), | |
| 231 | - tabCont = $('li.line_schedule[data-id=' + lineCode + ']'), | |
| 232 | - htmlStr; | |
| 233 | - | |
| 234 | - if($.isEmptyObject(dirData)){ | |
| 235 | - $('.schedule-wrap .card-panel', tabCont).html(''); | |
| 236 | - } | |
| 237 | - else { | |
| 238 | - for (var upDown in dirData) { | |
| 239 | - htmlStr = temps['line-schedule-table-temp']({ | |
| 240 | - dir: upDown, | |
| 241 | - line: gb_data_basic.codeToLine[lineCode], | |
| 242 | - list: dirData[upDown] | |
| 243 | - }); | |
| 244 | - $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr); | |
| 245 | - } | |
| 246 | - //图例相关 | |
| 247 | - gb_sch_legend.init(tabCont); | |
| 248 | - //标记末班 | |
| 249 | - markerLastByLine(lineCode); | |
| 250 | - //计算应发未发 | |
| 251 | - calc_yfwf_num(lineCode); | |
| 252 | - //重新固定表头 | |
| 253 | - gb_ct_table.fixedHead($('.schedule-wrap .ct_table_wrap', tabCont)); | |
| 254 | - | |
| 255 | - //重新初始化排序 | |
| 256 | - gb_ct_table.enableSort($('.ct_table', tabCont), reset_seq_no, gb_schedule_table_dbclick.init); | |
| 257 | - //重新初始化双击待发调整 | |
| 258 | - gb_schedule_table_dbclick.init(); | |
| 259 | - //重新初始化双击实发发车信息微调 | |
| 260 | - gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell', tabCont)); | |
| 261 | - //重新初始化双击车辆 | |
| 262 | - gb_schedule_table_dbclick.carCellClick($('.ct_table_body dd[data-nbbm]')); | |
| 263 | - //滚动条 | |
| 264 | - $('.schedule-wrap .ct_table_wrap', tabCont).perfectScrollbar({suppressScrollX: true}); | |
| 265 | - | |
| 266 | - //搜索模板初始化 | |
| 267 | - gb_sch_search.init(); | |
| 268 | - } | |
| 269 | - }; | |
| 270 | - | |
| 271 | - | |
| 272 | - /** | |
| 273 | - * 重新从服务器加载数据,并刷新表格 | |
| 274 | - * @param lineCode | |
| 275 | - */ | |
| 276 | - var reLoadAndRefresh = function (lineCode) { | |
| 277 | - $.get('/realSchedule/lines', { | |
| 278 | - lines: lineCode + ',' | |
| 279 | - }, function (rs) { | |
| 280 | - if(!rs || $.isEmptyObject(rs)){ | |
| 281 | - line2Schedule[lineCode] = {}; | |
| 282 | - } | |
| 283 | - else{ | |
| 284 | - //排序 | |
| 285 | - rs[lineCode].sort(schedule_sort); | |
| 286 | - line2Schedule[lineCode] = {}; | |
| 287 | - //calc shift | |
| 288 | - $.each(rs[lineCode], function () { | |
| 289 | - calc_sch_real_shift(this); | |
| 290 | - line2Schedule[lineCode][this.id] = this; | |
| 291 | - }); | |
| 292 | - } | |
| 293 | - //计算应发未发 | |
| 294 | - calc_yfwf_num(lineCode); | |
| 295 | - //重新渲染 | |
| 296 | - reRenderTable(lineCode); | |
| 297 | - }); | |
| 298 | - }; | |
| 299 | - | |
| 300 | - //删除一个班次 | |
| 301 | - var deheteSchedule = function (sch) { | |
| 302 | - sch = line2Schedule[sch.xlBm][sch.id]; | |
| 303 | - if (sch) { | |
| 304 | - var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'), | |
| 305 | - dls = dl.parent().find('dl'); | |
| 306 | - delete line2Schedule[sch.xlBm][sch.id]; | |
| 307 | - dl.remove(); | |
| 308 | - reset_seq_no(dls); | |
| 309 | - calc_yfwf_num(sch.xlBm); | |
| 310 | - } | |
| 311 | - }; | |
| 312 | - | |
| 313 | - /** | |
| 314 | - * 更新班次 | |
| 315 | - * @param schArr | |
| 316 | - */ | |
| 317 | - var updateSchedule = function (schArr) { | |
| 318 | - | |
| 319 | - if (!isArray(schArr)) | |
| 320 | - schArr = [schArr]; | |
| 321 | - | |
| 322 | - //var tMaps = {}; | |
| 323 | - $.each(schArr, function () { | |
| 324 | - try { | |
| 325 | - if(this.status==-1) | |
| 326 | - clearActualTime(this); | |
| 327 | - //子任务公里是否与计划平 | |
| 328 | - this.c_t_mileage_status = calcCTaskMileageStatus(this); | |
| 329 | - line2Schedule[this.xlBm][this.id] = this; | |
| 330 | - updateDom(this); | |
| 331 | - }catch(e){} | |
| 332 | - }); | |
| 333 | - | |
| 334 | - /* //重新标记末班 | |
| 335 | - var ts=[]; | |
| 336 | - for(var k in tMaps){ | |
| 337 | - ts = k.split('_'); | |
| 338 | - markerLastByNbbm(ts[0], ts[1]); | |
| 339 | - }*/ | |
| 340 | - }; | |
| 341 | - | |
| 342 | - | |
| 343 | - /** | |
| 344 | - * 更新班次 -只更新数据,不更新dom | |
| 345 | - * @param schArr | |
| 346 | - */ | |
| 347 | - var updateData = function (schArr) { | |
| 348 | - if (!isArray(schArr)) | |
| 349 | - schArr = [schArr]; | |
| 350 | - $.each(schArr, function () { | |
| 351 | - if(this.status==-1) | |
| 352 | - clearActualTime(this); | |
| 353 | - line2Schedule[this.xlBm][this.id] = this; | |
| 354 | - }); | |
| 355 | - }; | |
| 356 | - | |
| 357 | - //update dom | |
| 358 | - var updateDom = function (sch) { | |
| 359 | - if (!sch) return; | |
| 360 | - var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'); | |
| 361 | - var dds = $('dd', dl); | |
| 362 | - $(dds[1]).find('a').text(sch.lpName); | |
| 363 | - var light = !sch.qdzArrDatesj ? 'tl-white' : 'tl-grey'; | |
| 364 | - if (sch.rfidState & 1 == 1) { | |
| 365 | - light = 'tl-yellow'; | |
| 366 | - if (sch.rfidState & 2 == 2) { | |
| 367 | - light = 'tl-green'; | |
| 368 | - } | |
| 369 | - } | |
| 370 | - if (!(sch.bcType == 'in' || sch.bcType == 'out')) { | |
| 371 | - $(dds[2]).style('background', light); | |
| 372 | - } | |
| 373 | - //车辆自编号 | |
| 374 | - var $newDds3 = $(temps['line-schedule-nbbm-temp'](sch)); | |
| 375 | - $(dds[3]).replaceWith($newDds3); | |
| 376 | - //车辆双击 | |
| 377 | - gb_schedule_table_dbclick.carCellClick($newDds3); | |
| 378 | - $(dds[4]).text(sch.qdzArrDatejh ? sch.qdzArrDatejh : ''); | |
| 379 | - $(dds[5]).text(sch.qdzArrDatesj ? sch.qdzArrDatesj : ''); | |
| 380 | - | |
| 381 | - //计发时间 | |
| 382 | - var d5html = temps['line-schedule-fcsj-temp'](sch); | |
| 383 | - if (sch.lpChange == 1) { | |
| 384 | - d5html = d5html.replace('</dd>', '') + '<span class="uk-badge uk-badge-success out">换</span>' + '</dd>'; | |
| 385 | - } | |
| 386 | - $(dds[6]).replaceWith(d5html); | |
| 387 | - //待发时间 | |
| 388 | - var dfHtmlStr = sch.dfsj + (sch.late2?'<span class="late-badge">?+'+sch.lateMinute+'</span>':''); | |
| 389 | - $(dds[7]).attr('data-sort-val', sch.dfsjT).attr('dbclick-val', sch.dfsj).html(dfHtmlStr); | |
| 390 | - | |
| 391 | - //实发时间 | |
| 392 | - calc_sch_real_shift(sch); | |
| 393 | - var sfsjDd = $(temps['line-schedule-sfsj-temp'](sch)); | |
| 394 | - //双击 | |
| 395 | - gb_schedule_table_dbclick.sfsjCellClick(sfsjDd); | |
| 396 | - $(dds[8]).replaceWith(sfsjDd); | |
| 397 | - if (sch.remarks) | |
| 398 | - $(dds[9]).html('<span title="' + sch.remarks + '" data-uk-tooltip="{pos:\'top-left\'}">' + sch.remarks + '</span>'); | |
| 399 | - else | |
| 400 | - $(dds[9]).html(''); | |
| 401 | - | |
| 402 | - //信号状态标记 | |
| 403 | - gb_signal_state.marker_sch(sch); | |
| 404 | - //班次是车辆的最后一班 | |
| 405 | - if (dl.hasClass('dl-last-sch')) | |
| 406 | - markerLastSch([sch]); | |
| 407 | - | |
| 408 | - renderCarRemark(); | |
| 409 | - }; | |
| 410 | - | |
| 411 | - //单击实发单元格显示详细信息 | |
| 412 | - $(document).on('click', 'dd.fcsjActualCell', function () { | |
| 413 | - var that = this; | |
| 414 | - $(that).qtip({ | |
| 415 | - show: true, | |
| 416 | - content: { | |
| 417 | - text: function (e) { | |
| 418 | - var lineCode = $(that).parents('li.line_schedule').data('id') | |
| 419 | - , id = $(that).parents('dl').data('id') | |
| 420 | - , sch = line2Schedule[lineCode][id]; | |
| 421 | - return temps['sfsj_sch-detail-temp'](sch); | |
| 422 | - } | |
| 423 | - } | |
| 424 | - , style: { | |
| 425 | - classes: 'qtip-dark qtip-rounded qtip-shadow' | |
| 426 | - }, | |
| 427 | - hide: { | |
| 428 | - fixed: true, | |
| 429 | - delay: 300 | |
| 430 | - }, | |
| 431 | - position: { | |
| 432 | - target: that, | |
| 433 | - my: 'center left', | |
| 434 | - at: 'center right' | |
| 435 | - }, | |
| 436 | - events: { | |
| 437 | - hidden: function (event, api) { | |
| 438 | - $(this).qtip('destroy', true); | |
| 439 | - } | |
| 440 | - } | |
| 441 | - }); | |
| 442 | - | |
| 443 | - //车辆rect 闪烁、 | |
| 444 | - var wrap = $(that).parents('li.line_schedule'); | |
| 445 | - var nbbm = $(that).parents('dl').find('dd:eq(2)').data('nbbm'); | |
| 446 | - var device = gb_data_basic.nbbm2deviceMap()[nbbm]; | |
| 447 | - var $rect = $('svg.line-chart g.gps-wrap rect[_id=rct_' + device + ']', wrap); | |
| 448 | - | |
| 449 | - //merge_hide | |
| 450 | - if ($rect.hasClass('merge_hide') || $rect.attr('y') < 0) | |
| 451 | - return; | |
| 452 | - $rect.attr('class', 'twinkle').one('animationend', function () { | |
| 453 | - $(this).removeAttr('class'); | |
| 454 | - }); | |
| 455 | - }); | |
| 456 | - | |
| 457 | - //拖拽选中... | |
| 458 | - var seq_nos = '.line-schedule-table .ct_table_body>dl>dd.seq_no'; | |
| 459 | - var drag_strat; | |
| 460 | - $(document).on('mousedown', seq_nos, function (e) { | |
| 461 | - if (e.button != 0) return; | |
| 462 | - var dl = $(this).parent(); | |
| 463 | - if (dl.hasClass('drag-active')) | |
| 464 | - dl.removeClass('drag-active'); | |
| 465 | - else | |
| 466 | - dl.addClass('drag-active'); | |
| 467 | - | |
| 468 | - drag_strat = parseInt($(this).text()) - 1; | |
| 469 | - }).on('mouseup', function () { | |
| 470 | - drag_strat = null; | |
| 471 | - }).on('mouseover', seq_nos, function () { | |
| 472 | - if (drag_strat != null) { | |
| 473 | - var e = parseInt($(this).text()), | |
| 474 | - dls = $(this).parents('.ct_table_body').find('dl'); | |
| 475 | - | |
| 476 | - reset_drag_active_all(this); | |
| 477 | - //向上选中 | |
| 478 | - if (e <= drag_strat) { | |
| 479 | - for (var i = drag_strat; i > e - 2; i--) | |
| 480 | - $(dls[i]).addClass('drag-active'); | |
| 481 | - } | |
| 482 | - //向下选中 | |
| 483 | - else { | |
| 484 | - for (var j = drag_strat; j < e; j++) | |
| 485 | - $(dls[j]).addClass('drag-active'); | |
| 486 | - } | |
| 487 | - } | |
| 488 | - }).on('click', seq_nos, function () { | |
| 489 | - reset_relevance_active(this); | |
| 490 | - }); | |
| 491 | - //非seq_no 单元格点击 | |
| 492 | - $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class!=seq_no][class!=lpName]', function () { | |
| 493 | - reset_drag_active_all(this); | |
| 494 | - //选中相关班次 | |
| 495 | - var id = $(this).parent().data('id'), | |
| 496 | - contWrap = $(this).parents('li.line_schedule'), | |
| 497 | - lineCode = contWrap.data('id'), | |
| 498 | - sch = line2Schedule[lineCode][id], | |
| 499 | - schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) { | |
| 500 | - return item.clZbh == sch.clZbh; | |
| 501 | - }).sort(schedule_sort), | |
| 502 | - nextSch, tempDL; | |
| 503 | - | |
| 504 | - getDl(sch).addClass('intimity'); | |
| 505 | - $.each(schArr, function (i) { | |
| 506 | - tempDL = $('dl[data-id=' + this.id + ']', contWrap); | |
| 507 | - tempDL.addClass('relevance-active'); | |
| 508 | - if (i < schArr.length - 1 && this.id == id) { | |
| 509 | - nextSch = schArr[i + 1]; | |
| 510 | - } | |
| 511 | - }); | |
| 512 | - | |
| 513 | - if (nextSch) { | |
| 514 | - $('dl[data-id=' + nextSch.id + ']', contWrap).addClass('intimity'); | |
| 515 | - /*if (nextSch.xlDir == sch.xlDir) | |
| 516 | - return;*/ | |
| 517 | - //滚动到下一个班次 | |
| 518 | - if(nextSch.xlDir != sch.xlDir) | |
| 519 | - scroToDl(nextSch); | |
| 520 | - | |
| 521 | - } | |
| 522 | - | |
| 523 | - //如果有打开轨迹回放 | |
| 524 | - if($('.layui-layer.play_back-layer').is(':visible')){ | |
| 525 | - gb_map_play_back.setParam(sch); | |
| 526 | - } | |
| 527 | - }); | |
| 528 | - | |
| 529 | - //路牌点击 | |
| 530 | - $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class=lpName]', function () { | |
| 531 | - reset_drag_active_all(this); | |
| 532 | - //选中路牌下相关班次 | |
| 533 | - var id = $(this).parent().data('id'), | |
| 534 | - contWrap = $(this).parents('li.line_schedule'), | |
| 535 | - lineCode = contWrap.data('id'), | |
| 536 | - sch = line2Schedule[lineCode][id], | |
| 537 | - schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) { | |
| 538 | - return item.lpName == sch.lpName; | |
| 539 | - }).sort(schedule_sort); | |
| 540 | - $.each(schArr, function (i) { | |
| 541 | - $('dl[data-id=' + this.id + ']', contWrap).addClass('relevance-active intimity'); | |
| 542 | - }); | |
| 543 | - | |
| 544 | - //notify_succ('高亮路牌 ' + sch.lpName); | |
| 545 | - showLpMileageTip(lineCode, sch.lpName, schArr); | |
| 546 | - }); | |
| 547 | - | |
| 548 | - var showLpMileageTipBySch = function (sch) { | |
| 549 | - if(!$('.mileage_elec_panel', $('.line_schedule[data-id='+sch.xlBm+']')).is(':visible')) | |
| 550 | - return; | |
| 551 | - | |
| 552 | - var schArr = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (item) { | |
| 553 | - return item.lpName == sch.lpName; | |
| 554 | - }).sort(schedule_sort); | |
| 555 | - | |
| 556 | - showLpMileageTip(sch.xlBm, sch.lpName, schArr); | |
| 557 | - }; | |
| 558 | - /** | |
| 559 | - * 弹出路牌公里统计tip | |
| 560 | - * @param lineCode | |
| 561 | - * @param lpName | |
| 562 | - * @param array | |
| 563 | - */ | |
| 564 | - var showLpMileageTip = function (lineCode, lpName, array) { | |
| 565 | - var wrap = $('.line_schedule[data-id='+lineCode+']'); | |
| 566 | - //按驾驶员&车辆分组统计 | |
| 567 | - var data=mileageTipGroupData(array); | |
| 568 | - //统计公里 | |
| 569 | - var list=[]; | |
| 570 | - for(var key in data){ | |
| 571 | - list.push({ | |
| 572 | - key : key, | |
| 573 | - serviceMileage: gb_sch_mileage_count.serviceMileage(data[key]), | |
| 574 | - destroyMileage: gb_sch_mileage_count.destroyMileage(data[key]), | |
| 575 | - emptyMileage: gb_sch_mileage_count.emptyMileage(data[key]) | |
| 576 | - }) | |
| 577 | - } | |
| 578 | - var htmlStr = temps['sch-lp-mileage-tip-temp']({data: list, lpName:lpName}); | |
| 579 | - $('.mileage_elec_panel', wrap).html(htmlStr).addClass('uk-animation-slide-bottom').show() | |
| 580 | - .one('animationEnd', function () { | |
| 581 | - $(this).removeClass('uk-animation-slide-bottom'); | |
| 582 | - }); | |
| 583 | - }; | |
| 584 | - | |
| 585 | - /** | |
| 586 | - * 分组数据,处理子任务里的中途换车 | |
| 587 | - * @param array | |
| 588 | - */ | |
| 589 | - var mileageTipGroupData = function (arr) { | |
| 590 | - var list = JSON.parse(JSON.stringify(arr)); | |
| 591 | - var cts; | |
| 592 | - var zthcArray=[]; | |
| 593 | - var sch; | |
| 594 | - for(var i=0,len=list.length;i<len;i++){ | |
| 595 | - sch = list[i]; | |
| 596 | - cts = sch['cTasks']; | |
| 597 | - if(!cts || cts.length==0) | |
| 598 | - continue; | |
| 599 | - | |
| 600 | - sch['cTasks'] = []; | |
| 601 | - //有子任务 | |
| 602 | - for(var j=0,ct;ct=cts[j++];){ | |
| 603 | - if(!ct.nbbm || ct.nbbm==sch.clZbh){ | |
| 604 | - sch['cTasks'].push(ct); | |
| 605 | - continue; | |
| 606 | - } | |
| 607 | - | |
| 608 | - zthcArray.push(cloneByCTask(sch, ct)); | |
| 609 | - } | |
| 610 | - } | |
| 611 | - | |
| 612 | - if(zthcArray.length > 0) | |
| 613 | - list = list.concat(zthcArray); | |
| 614 | - | |
| 615 | - var data={},key; | |
| 616 | - for(var i=0,len=list.length;i<len;i++){ | |
| 617 | - key = list[i].clZbh+'/'+list[i].jGh+'('+list[i].jName+')'; | |
| 618 | - if(!data[key]) | |
| 619 | - data[key] = []; | |
| 620 | - data[key].push(list[i]); | |
| 621 | - } | |
| 622 | - return data; | |
| 623 | - }; | |
| 624 | - | |
| 625 | - var cloneByCTask = function (sch, ct) { | |
| 626 | - var newObj = JSON.parse(JSON.stringify(sch)); | |
| 627 | - newObj['cTasks']=[]; | |
| 628 | - newObj.clZbh = ct.nbbm; | |
| 629 | - newObj.fcsjActual = ct.startDate; | |
| 630 | - newObj.zdsjActual = ct.endDate; | |
| 631 | - newObj.jhlc = ct.mileage; | |
| 632 | - newObj.jhlcOrig = ct.mileage; | |
| 633 | - | |
| 634 | - if(ct.type2=='1') | |
| 635 | - newObj.bcType='normal'; | |
| 636 | - else if(ct.type2=='2'){ | |
| 637 | - newObj.bcType='in'; | |
| 638 | - }else if(ct.type2=='3') | |
| 639 | - newObj.bcType='out'; | |
| 640 | - | |
| 641 | - return newObj; | |
| 642 | - }; | |
| 643 | - | |
| 644 | - //头部点击去掉选中光标 | |
| 645 | - $(document).on('click', '.header-title', function () { | |
| 646 | - reset_drag_active_all(this); | |
| 647 | - }); | |
| 648 | - | |
| 649 | - var scroToDl = function (sch) { | |
| 650 | - var dl = getDl(sch), | |
| 651 | - cont = dl.parents('.ct_table_wrap'), | |
| 652 | - diff = cont.height() / 2; | |
| 653 | - cont.animate({ | |
| 654 | - scrollTop: dl.offset().top - cont.offset().top + cont.scrollTop() - diff | |
| 655 | - }, 500); | |
| 656 | - | |
| 657 | - return dl; | |
| 658 | - }; | |
| 659 | - | |
| 660 | - var getDl = function (sch) { | |
| 661 | - return $('dl[data-id=' + sch.id + ']', $('.line_schedule[data-id=' + sch.xlBm + ']')); | |
| 662 | - }; | |
| 663 | - | |
| 664 | - var reset_drag_active_all = function (dd) { | |
| 665 | - $(dd).parents('.schedule-wrap').find('dl.drag-active').removeClass('drag-active'); | |
| 666 | - reset_relevance_active(dd); | |
| 667 | - | |
| 668 | - $('.mileage_elec_panel', $(dd).parents('.top-container')).hide().remove('uk-animation-slide-bottom'); | |
| 669 | - }; | |
| 670 | - | |
| 671 | - var reset_relevance_active = function (dd) { | |
| 672 | - $(dd).parents('.uk-grid.schedule-wrap').find('.relevance-active').removeClass('relevance-active intimity'); | |
| 673 | - }; | |
| 674 | - | |
| 675 | - | |
| 676 | - //计算应发未发数量 car_yfwf_map | |
| 677 | - var calc_yfwf_num = function (lineCode) { | |
| 678 | - | |
| 679 | - var schArr = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort), | |
| 680 | - yfwf_num = 0, | |
| 681 | - t = new Date().valueOf(); | |
| 682 | - | |
| 683 | - var carYfwfMap = {}, nbbm; | |
| 684 | - $.each(schArr, function () { | |
| 685 | - /*if (this.dfsjT > t) | |
| 686 | - return false;*/ | |
| 687 | - | |
| 688 | - if (this.dfsjT < t && | |
| 689 | - this.fcsjActual == null && this.fcsjActualTime == null && this.status != -1) { | |
| 690 | - yfwf_num++; | |
| 691 | - nbbm = this.clZbh; | |
| 692 | - if (carYfwfMap[nbbm]) | |
| 693 | - carYfwfMap[nbbm]++; | |
| 694 | - else | |
| 695 | - carYfwfMap[nbbm] = 1; | |
| 696 | - } | |
| 697 | - }); | |
| 698 | - car_yfwf_map[lineCode] = carYfwfMap; | |
| 699 | - | |
| 700 | - $('#badge_yfwf_num_' + lineCode).text(yfwf_num); | |
| 701 | - }; | |
| 702 | - | |
| 703 | - //标记终点时间 -线路 | |
| 704 | - var markerLastByLine = function (lineCode) { | |
| 705 | - var data = gb_common.groupBy(gb_common.get_vals(line2Schedule[lineCode]).filter(schDestroyFilter), 'lpName'); | |
| 706 | - | |
| 707 | - var array, lastSch, dl; | |
| 708 | - for (var nbbm in data) { | |
| 709 | - array = data[nbbm].sort(schedule_sort); | |
| 710 | - markerLastSch(array); | |
| 711 | - } | |
| 712 | - }; | |
| 713 | - | |
| 714 | - //标记终点时间 -车辆 | |
| 715 | - var markerLastByNbbm = function (lineCode, nbbm) { | |
| 716 | - var array = gb_common.get_vals(line2Schedule[lineCode]).filter(function (a) { | |
| 717 | - return a.clZbh == nbbm && a.status != -1; | |
| 718 | - }).sort(schedule_sort); | |
| 719 | - | |
| 720 | - removeMarkers(lineCode, array); | |
| 721 | - markerLastSch(array); | |
| 722 | - }; | |
| 723 | - | |
| 724 | - var markerLastSch = function (array) { | |
| 725 | - var lastSch = array[array.length - 1]; | |
| 726 | - | |
| 727 | - if (!lastSch.jhlc) | |
| 728 | - return; | |
| 729 | - | |
| 730 | - var dl = getDl(lastSch); | |
| 731 | - dl.addClass('dl-last-sch'); | |
| 732 | - | |
| 733 | - $('dd.fcsjActualCell', dl).append(temps['last-sch-sunken-temp'](lastSch)); | |
| 734 | - }; | |
| 735 | - | |
| 736 | - //清除线路下指定班次的 末班标记 | |
| 737 | - var removeMarkers = function (lineCode, array) { | |
| 738 | - var idx = []; | |
| 739 | - $.each(array, function () { | |
| 740 | - idx.push(this.id); | |
| 741 | - }); | |
| 742 | - | |
| 743 | - $('dl.dl-last-sch', 'li.line_schedule[data-id=' + lineCode + ']').each(function () { | |
| 744 | - if ($(this).hasClass('dl-last-sch') && idx.indexOf($(this).data('id'))) { | |
| 745 | - $(this).removeClass('dl-last-sch').find('.last-sch-sunken').remove(); | |
| 746 | - } | |
| 747 | - }); | |
| 748 | - }; | |
| 749 | - | |
| 750 | - var schDestroyFilter = function (a) { | |
| 751 | - return a.status != -1; | |
| 752 | - }; | |
| 753 | - | |
| 754 | - /* 下一个班次 */ | |
| 755 | - var getNextSch = function (sch) { | |
| 756 | - var array = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (a) { | |
| 757 | - return a.clZbh == sch.clZbh; | |
| 758 | - }).sort(schedule_sort); | |
| 759 | - | |
| 760 | - for (var i = 0, item; item = array[i++];) { | |
| 761 | - if (array[i].id == sch.id) { | |
| 762 | - return i < array.length ? array[i + 1] : null; | |
| 763 | - } | |
| 764 | - } | |
| 765 | - }; | |
| 766 | - | |
| 767 | - /* 下一个班次普通班次 */ | |
| 768 | - var getNextNormalSch = function (sch) { | |
| 769 | - | |
| 770 | - var array = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (a) { | |
| 771 | - return a.clZbh == sch.clZbh && a.bcType=='normal'; | |
| 772 | - }).sort(schedule_sort); | |
| 773 | - | |
| 774 | - for (var i = 0; i < array.length; i++) { | |
| 775 | - if (array[i].id == sch.id) { | |
| 776 | - return i < array.length ? array[i + 1] : null; | |
| 777 | - } | |
| 778 | - } | |
| 779 | - }; | |
| 780 | - | |
| 781 | - /** 添加备注信息 */ | |
| 782 | - var addRemarks = function (list, remarks) { | |
| 783 | - //if(!list || list) | |
| 784 | - var i = 0, sch; | |
| 785 | - | |
| 786 | - (function () { | |
| 787 | - var f = arguments.callee; | |
| 788 | - if(i >= list.length){ | |
| 789 | - return; | |
| 790 | - } | |
| 791 | - sch = list[i]; | |
| 792 | - gb_common.$post('/realSchedule/addRemarks', {id: sch.id, remarks: remarks}, function (rs) { | |
| 793 | - if(rs.t){ | |
| 794 | - sch = rs.t; | |
| 795 | - line2Schedule[sch.xlBm][sch.id] = sch; | |
| 796 | - updateDom(sch); | |
| 797 | - i++; | |
| 798 | - f(); | |
| 799 | - } | |
| 800 | - }); | |
| 801 | - })(); | |
| 802 | - }; | |
| 803 | - | |
| 804 | - /** | |
| 805 | - * 显示误点停靠时间标记 | |
| 806 | - * @param id | |
| 807 | - * @param minute | |
| 808 | - */ | |
| 809 | - var showLateBadge = function (lineCode, id, minute) { | |
| 810 | - var dfCell = cancelLateBadge(lineCode, id); | |
| 811 | - $(dfCell).append('<span class="late-badge">?+'+minute+'</span>'); | |
| 812 | - }; | |
| 813 | - | |
| 814 | - /** | |
| 815 | - * 取消误点标记 | |
| 816 | - * @param lineCode | |
| 817 | - * @param id | |
| 818 | - */ | |
| 819 | - var cancelLateBadge = function (lineCode, id) { | |
| 820 | - var $dl = getDl({id: id, xlBm: lineCode}); | |
| 821 | - var dfCell = $dl.find('dd')[6]; | |
| 822 | - $('.late-badge',dfCell).remove(); | |
| 823 | - return dfCell; | |
| 824 | - }; | |
| 825 | - | |
| 826 | - | |
| 827 | - /** | |
| 828 | - * 刷新页面的所有线路班次 | |
| 829 | - */ | |
| 830 | - var refreshAll = function () { | |
| 831 | - show(); | |
| 832 | - }; | |
| 833 | - | |
| 834 | - /** | |
| 835 | - * 获取线路下营运的车辆 | |
| 836 | - */ | |
| 837 | - var findNbbmByLineCode = function (lineCode) { | |
| 838 | - try{ | |
| 839 | - return gb_common.get_keys(gb_common.extractNbbm(gb_common.get_vals(line2Schedule[lineCode]))); | |
| 840 | - }catch (e){ | |
| 841 | - return []; | |
| 842 | - } | |
| 843 | - }; | |
| 844 | - | |
| 845 | - var clearActualTime = function (sch) { | |
| 846 | - try{ | |
| 847 | - sch.fcsjActual=null; | |
| 848 | - sch.fcsjActualTime=null; | |
| 849 | - sch.zdsjActual=null; | |
| 850 | - sch.zdsjActualTime=null; | |
| 851 | - }catch (e){ | |
| 852 | - console.log(e); | |
| 853 | - } | |
| 854 | - }; | |
| 855 | - | |
| 856 | - /** | |
| 857 | - * 班次站点编码异常信息 | |
| 858 | - * @param list | |
| 859 | - */ | |
| 860 | - var putSCodeErrorInfo = function (list) { | |
| 861 | - //按线路走向分组 | |
| 862 | - var data = {}; | |
| 863 | - var k; | |
| 864 | - for(var i=0,obj;obj=list[i++];){ | |
| 865 | - k = obj.lineCode+'_'+obj.upDown; | |
| 866 | - | |
| 867 | - if(obj.realStationCode && obj.realStationCode.indexOf('^') != -1) | |
| 868 | - obj.realStationCode = obj.realStationCode.split('^')[0]; | |
| 869 | - | |
| 870 | - if(!data[k]) | |
| 871 | - data[k] = []; | |
| 872 | - data[k].push(obj); | |
| 873 | - } | |
| 874 | - | |
| 875 | - var wrap; | |
| 876 | - for(var k in data){ | |
| 877 | - wrap = $('.line_schedule[data-id=' + (k.split('_')[0]) + ']'); | |
| 878 | - if(wrap.length==0) | |
| 879 | - continue; | |
| 880 | - | |
| 881 | - $(".schedule-wrap span.warn_multi_station[data-updown="+(k.split('_')[1])+"]", wrap) | |
| 882 | - .html('o(* ̄▽ ̄*)o 班次和站点关联有点问题!!').show(); | |
| 883 | - } | |
| 884 | - | |
| 885 | - errorCodeData = data; | |
| 886 | - }; | |
| 887 | - | |
| 888 | - var findSCodeErrorInfo = function (lineCode, upDown) { | |
| 889 | - return errorCodeData[lineCode+'_'+upDown]; | |
| 890 | - }; | |
| 891 | - | |
| 892 | - var refreshRfid = function (sch) { | |
| 893 | - var $dl = getDl({id: sch.id, xlBm: sch.xlBm}); | |
| 894 | - var dfCell = $dl.find('dd')[2]; | |
| 895 | - var light = !sch.qdzArrDatesj ? 'tl-white' : 'tl-grey'; | |
| 896 | - if (sch.rfidState & 1 == 1) { | |
| 897 | - light = 'tl-yellow'; | |
| 898 | - if (sch.rfidState & 2 == 2) { | |
| 899 | - light = 'tl-green'; | |
| 900 | - } | |
| 901 | - } | |
| 902 | - if (!(sch.bcType == 'in' || sch.bcType == 'out')) { | |
| 903 | - $(dfCell).attr('class', light); | |
| 904 | - } | |
| 905 | - }; | |
| 906 | - | |
| 907 | - return { | |
| 908 | - show: show, | |
| 909 | - findScheduleByLine: findScheduleByLine, | |
| 910 | - updateSchedule: updateSchedule, | |
| 911 | - updateData: updateData, | |
| 912 | - deheteSchedule: deheteSchedule, | |
| 913 | - insertSchedule: insertSchedule, | |
| 914 | - schedule_sort: schedule_sort, | |
| 915 | - calc_yfwf_num: calc_yfwf_num, | |
| 916 | - car_yfwf_map: function (lineCode) { | |
| 917 | - return car_yfwf_map[lineCode]; | |
| 918 | - }, | |
| 919 | - scroToDl: scroToDl, | |
| 920 | - reset_drag_active_all: reset_drag_active_all, | |
| 921 | - getDl: getDl, | |
| 922 | - getNextSch: getNextSch, | |
| 923 | - addRemarks: addRemarks, | |
| 924 | - reLoadAndRefresh: reLoadAndRefresh, | |
| 925 | - showLateBadge: showLateBadge, | |
| 926 | - cancelLateBadge: cancelLateBadge, | |
| 927 | - refreshAll: refreshAll, | |
| 928 | - getNextNormalSch: getNextNormalSch, | |
| 929 | - findNbbmByLineCode:findNbbmByLineCode, | |
| 930 | - showLpMileageTipBySch: showLpMileageTipBySch, | |
| 931 | - renderCarRemark: renderCarRemark, | |
| 932 | - putSCodeErrorInfo: putSCodeErrorInfo, | |
| 933 | - findSCodeErrorInfo: findSCodeErrorInfo, | |
| 934 | - refreshRfid: refreshRfid | |
| 935 | - }; | |
| 936 | -})(); | |
| 1 | +/** schedule table */ | |
| 2 | + | |
| 3 | +var gb_schedule_table = (function () { | |
| 4 | + | |
| 5 | + var temps; | |
| 6 | + //线路分组的班次数据 | |
| 7 | + var line2Schedule = {}; | |
| 8 | + //车辆应发未发车辆数 | |
| 9 | + var car_yfwf_map = {}; | |
| 10 | + //班次站点编码和实际不符数据 | |
| 11 | + var errorCodeData = {}; | |
| 12 | + | |
| 13 | + var bcTypeOrderMap = { | |
| 14 | + 'out':0, | |
| 15 | + 'normal':1, | |
| 16 | + 'region':2, | |
| 17 | + 'major':3, | |
| 18 | + 'venting':4, | |
| 19 | + 'ldks':5, | |
| 20 | + 'in':6 | |
| 21 | + }; | |
| 22 | + var typeOrder = function (type) { | |
| 23 | + return bcTypeOrderMap[type]?bcTypeOrderMap[type]:0; | |
| 24 | + }; | |
| 25 | + var schedule_sort = function (s1, s2) { | |
| 26 | + var diff = s1['fcsjT'] - s2['fcsjT']; | |
| 27 | + return diff!=0?diff:typeOrder(s1['bcType'])-typeOrder(s2['bcType']); | |
| 28 | + }; | |
| 29 | + | |
| 30 | + var show = function (cb) { | |
| 31 | + //从服务器获取班次数据 | |
| 32 | + $.get('/realSchedule/lines', { | |
| 33 | + lines: gb_data_basic.line_idx | |
| 34 | + }, function (rs) { | |
| 35 | + for (var lineCode in rs) { | |
| 36 | + line2Schedule[lineCode] = {}; | |
| 37 | + | |
| 38 | + //排序 | |
| 39 | + rs[lineCode].sort(schedule_sort); | |
| 40 | + //calc shift | |
| 41 | + $.each(rs[lineCode], function () { | |
| 42 | + if(this.status==-1) | |
| 43 | + clearActualTime(this); | |
| 44 | + calc_sch_real_shift(this); | |
| 45 | + wfydcolor(this); | |
| 46 | + line2Schedule[lineCode][this.id] = this; | |
| 47 | + //子任务公里是否与计划平 | |
| 48 | + this.c_t_mileage_status = calcCTaskMileageStatus(this); | |
| 49 | + }); | |
| 50 | + //计算应发未发 | |
| 51 | + calc_yfwf_num(lineCode); | |
| 52 | + } | |
| 53 | + ep.emit('data', rs); | |
| 54 | + }); | |
| 55 | + | |
| 56 | + //加载班次表格渲染模板 | |
| 57 | + $.get('/real_control_v2/fragments/line_schedule/sch_table.html', function (dom) { | |
| 58 | + ep.emit('temp', gb_common.compileTempByDom(dom, { | |
| 59 | + compress: true | |
| 60 | + })); | |
| 61 | + }); | |
| 62 | + | |
| 63 | + var ep = EventProxy.create("data", "temp", function (data, temp) { | |
| 64 | + temps = temp; | |
| 65 | + var lineCode, dirData, htmlStr; | |
| 66 | + $('#main-tab-content .line_schedule').each(function () { | |
| 67 | + lineCode = $(this).data('id'); | |
| 68 | + if (arrayIsNull(data[lineCode])) | |
| 69 | + return true; | |
| 70 | + dirData = gb_common.groupBy(data[lineCode], 'xlDir'); | |
| 71 | + for (var upDown in dirData) { | |
| 72 | + htmlStr = temps['line-schedule-table-temp']({ | |
| 73 | + dir: upDown, | |
| 74 | + line: gb_data_basic.codeToLine[lineCode], | |
| 75 | + list: dirData[upDown] | |
| 76 | + }); | |
| 77 | + | |
| 78 | + $('.schedule-wrap .card-panel:eq(' + upDown + ')', this) | |
| 79 | + .html(htmlStr); | |
| 80 | + } | |
| 81 | + | |
| 82 | + //标记路牌最后一个班次 | |
| 83 | + markerLastByLine(lineCode); | |
| 84 | + //初始化图例相关,dbclick 不能代理事件 | |
| 85 | + //gb_sch_legend.init(this); | |
| 86 | + }); | |
| 87 | + //初始化图例 | |
| 88 | + gb_sch_legend.init(); | |
| 89 | + var content = $('.line_schedule .ct_table_wrap'); | |
| 90 | + //初始化滚动条 | |
| 91 | + content.perfectScrollbar({suppressScrollX: true}); | |
| 92 | + //fixed table head | |
| 93 | + gb_ct_table.fixedHead(content); | |
| 94 | + //enable sort | |
| 95 | + gb_ct_table.enableSort($('.ct_table', content), reset_seq_no, gb_schedule_table_dbclick.init); | |
| 96 | + //dbclick event | |
| 97 | + gb_schedule_table_dbclick.init(); | |
| 98 | + //双击实发 | |
| 99 | + gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell')); | |
| 100 | + //双击车辆 | |
| 101 | + gb_schedule_table_dbclick.carCellClick($('.ct_table_body dd[data-nbbm]')); | |
| 102 | + //搜索框初始化 | |
| 103 | + gb_sch_search.init(); | |
| 104 | + | |
| 105 | + //监听gps车辆信息 | |
| 106 | + gb_data_gps.registerCallback(renderCarRemark); | |
| 107 | + gb_sch_legend.showYdSdDb(); | |
| 108 | + cb && cb(); | |
| 109 | + }); | |
| 110 | + | |
| 111 | + }; | |
| 112 | + | |
| 113 | + var renderCarRemark = function () { | |
| 114 | + try{ | |
| 115 | + var $activeTab = $('.north-tabs>ul>li.tab-line.uk-active');//.data('code'); | |
| 116 | + if($activeTab.length==0) | |
| 117 | + return; | |
| 118 | + var lineCode = $activeTab.data('code'); | |
| 119 | + var array = gb_common.get_vals(line2Schedule[lineCode]); | |
| 120 | + var nbbms = {}; | |
| 121 | + for(var i=0,sch;sch=array[i++];){ | |
| 122 | + nbbms[sch.clZbh]=1; | |
| 123 | + } | |
| 124 | + | |
| 125 | + var $activeWrap = $('#main-tab-content .line_schedule.uk-active .schedule-wrap .schedule-body'); | |
| 126 | + var gps, e; | |
| 127 | + for(var nbbm in nbbms){ | |
| 128 | + gps = gb_data_gps.findGpsByNbbm(nbbm); | |
| 129 | + e = $('.ct_table_body dl>dd[data-nbbm='+nbbm+']', $activeWrap); | |
| 130 | + $('i', e).remove(); | |
| 131 | + | |
| 132 | + if(gps && gps['planCode']!=lineCode && gps.remark) | |
| 133 | + $(e).append('<i class="uk-icon-exclamation-circle" data-uk-tooltip title="'+gps.remark+'"></i>'); | |
| 134 | + } | |
| 135 | + }catch (e){ | |
| 136 | + console.log(e); | |
| 137 | + } | |
| 138 | + }; | |
| 139 | + | |
| 140 | + /** | |
| 141 | + * 计算子任务公里是否和计划平 | |
| 142 | + * @param sch | |
| 143 | + */ | |
| 144 | + var calcCTaskMileageStatus = function (sch) { | |
| 145 | + if(!sch.cTasks || sch.cTasks.length==0) | |
| 146 | + return 0; | |
| 147 | + var sum = 0; | |
| 148 | + $.each(sch.cTasks, function () { | |
| 149 | + if (this.mileageType == 'service') { | |
| 150 | + sum = gb_common.accAdd(sum, this.mileage); | |
| 151 | + } | |
| 152 | + }); | |
| 153 | + | |
| 154 | + if (sum != sch.jhlcOrig) { | |
| 155 | + return -1; | |
| 156 | + } | |
| 157 | + return 0; | |
| 158 | + }; | |
| 159 | + | |
| 160 | + | |
| 161 | + //重置序号 | |
| 162 | + var reset_seq_no = function (dls) { | |
| 163 | + dls.each(function (i, dl) { | |
| 164 | + $('dd:eq(0)', dl).text(i + 1); | |
| 165 | + }); | |
| 166 | + }; | |
| 167 | + | |
| 168 | + //计算实发时间差值 | |
| 169 | + var calc_sch_real_shift = function (sch) { | |
| 170 | + if (sch['fcsjActualTime']){ | |
| 171 | + var fs = 'YYYY-MM-DD HH:mm' | |
| 172 | + ,m1 = moment(sch['fcsjActualTime']).format(fs) | |
| 173 | + ,m2 = moment(sch['dfsjT']).format(fs);//去掉秒 | |
| 174 | + console.log(moment(m1, fs).format('X')) | |
| 175 | + console.log(moment(m2, fs).format('X')) | |
| 176 | + var diff = moment(m1, fs).format('X') - moment(m2, fs).format('X') | |
| 177 | + ,fcsj_diff = parseInt(diff / 60, 10);; | |
| 178 | + | |
| 179 | + if(fcsj_diff > 0) | |
| 180 | + sch.fcsj_diff = '( +' + fcsj_diff + ' )'; | |
| 181 | + else if (fcsj_diff < 0) | |
| 182 | + sch.fcsj_diff = '( ' + fcsj_diff + ' )'; | |
| 183 | + else | |
| 184 | + sch.fcsj_diff = ''; | |
| 185 | + } | |
| 186 | + }; | |
| 187 | + //无发有到时间 | |
| 188 | + var wfydcolor=function (sch) { | |
| 189 | + if (sch.fcsjActual==null&&sch.zdsjActual!=null&&sch.zdsjActual!=''&&sch.status!=-1) {//sch.qdzArrDatesj!=''&&sch.qdzArrDatesj!=null&& | |
| 190 | + sch.status=4; | |
| 191 | + } | |
| 192 | + } | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + function arrayIsNull(array) { | |
| 197 | + return !array || array.length == 0; | |
| 198 | + } | |
| 199 | + | |
| 200 | + var findScheduleByLine = function (lineCode) { | |
| 201 | + return line2Schedule[lineCode]; | |
| 202 | + }; | |
| 203 | + | |
| 204 | + //新增一个班次,附带更新的班次 | |
| 205 | + var insertSchedule = function (sch, upArr) { | |
| 206 | + var xls = {}; | |
| 207 | + xls[sch.xlBm] = 1; | |
| 208 | + line2Schedule[sch.xlBm][sch.id] = sch; | |
| 209 | + //update | |
| 210 | + if (isArray(upArr)) { | |
| 211 | + $.each(upArr, function () { | |
| 212 | + line2Schedule[this.xlBm][this.id] = this; | |
| 213 | + xls[this.xlBm] = 1; | |
| 214 | + }); | |
| 215 | + } | |
| 216 | + | |
| 217 | + //重新渲染表格 | |
| 218 | + for(var xlBm in xls){ | |
| 219 | + reRenderTable(sch.xlBm); | |
| 220 | + } | |
| 221 | + //定位到新添加的班次 | |
| 222 | + scroToDl(sch); | |
| 223 | + }; | |
| 224 | + | |
| 225 | + /** | |
| 226 | + * 重新渲染表格 | |
| 227 | + */ | |
| 228 | + var reRenderTable = function (lineCode) { | |
| 229 | + var data = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort), | |
| 230 | + dirData = gb_common.groupBy(data, 'xlDir'), | |
| 231 | + tabCont = $('li.line_schedule[data-id=' + lineCode + ']'), | |
| 232 | + htmlStr; | |
| 233 | + | |
| 234 | + if($.isEmptyObject(dirData)){ | |
| 235 | + $('.schedule-wrap .card-panel', tabCont).html(''); | |
| 236 | + } | |
| 237 | + else { | |
| 238 | + for (var upDown in dirData) { | |
| 239 | + htmlStr = temps['line-schedule-table-temp']({ | |
| 240 | + dir: upDown, | |
| 241 | + line: gb_data_basic.codeToLine[lineCode], | |
| 242 | + list: dirData[upDown] | |
| 243 | + }); | |
| 244 | + $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr); | |
| 245 | + } | |
| 246 | + //图例相关 | |
| 247 | + gb_sch_legend.init(tabCont); | |
| 248 | + //标记末班 | |
| 249 | + markerLastByLine(lineCode); | |
| 250 | + //计算应发未发 | |
| 251 | + calc_yfwf_num(lineCode); | |
| 252 | + //重新固定表头 | |
| 253 | + gb_ct_table.fixedHead($('.schedule-wrap .ct_table_wrap', tabCont)); | |
| 254 | + | |
| 255 | + //重新初始化排序 | |
| 256 | + gb_ct_table.enableSort($('.ct_table', tabCont), reset_seq_no, gb_schedule_table_dbclick.init); | |
| 257 | + //重新初始化双击待发调整 | |
| 258 | + gb_schedule_table_dbclick.init(); | |
| 259 | + //重新初始化双击实发发车信息微调 | |
| 260 | + gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell', tabCont)); | |
| 261 | + //重新初始化双击车辆 | |
| 262 | + gb_schedule_table_dbclick.carCellClick($('.ct_table_body dd[data-nbbm]')); | |
| 263 | + //滚动条 | |
| 264 | + $('.schedule-wrap .ct_table_wrap', tabCont).perfectScrollbar({suppressScrollX: true}); | |
| 265 | + | |
| 266 | + //搜索模板初始化 | |
| 267 | + gb_sch_search.init(); | |
| 268 | + } | |
| 269 | + }; | |
| 270 | + | |
| 271 | + | |
| 272 | + /** | |
| 273 | + * 重新从服务器加载数据,并刷新表格 | |
| 274 | + * @param lineCode | |
| 275 | + */ | |
| 276 | + var reLoadAndRefresh = function (lineCode) { | |
| 277 | + $.get('/realSchedule/lines', { | |
| 278 | + lines: lineCode + ',' | |
| 279 | + }, function (rs) { | |
| 280 | + if(!rs || $.isEmptyObject(rs)){ | |
| 281 | + line2Schedule[lineCode] = {}; | |
| 282 | + } | |
| 283 | + else{ | |
| 284 | + //排序 | |
| 285 | + rs[lineCode].sort(schedule_sort); | |
| 286 | + line2Schedule[lineCode] = {}; | |
| 287 | + //calc shift | |
| 288 | + $.each(rs[lineCode], function () { | |
| 289 | + calc_sch_real_shift(this); | |
| 290 | + line2Schedule[lineCode][this.id] = this; | |
| 291 | + }); | |
| 292 | + } | |
| 293 | + //计算应发未发 | |
| 294 | + calc_yfwf_num(lineCode); | |
| 295 | + //重新渲染 | |
| 296 | + reRenderTable(lineCode); | |
| 297 | + }); | |
| 298 | + }; | |
| 299 | + | |
| 300 | + //删除一个班次 | |
| 301 | + var deheteSchedule = function (sch) { | |
| 302 | + sch = line2Schedule[sch.xlBm][sch.id]; | |
| 303 | + if (sch) { | |
| 304 | + var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'), | |
| 305 | + dls = dl.parent().find('dl'); | |
| 306 | + delete line2Schedule[sch.xlBm][sch.id]; | |
| 307 | + dl.remove(); | |
| 308 | + reset_seq_no(dls); | |
| 309 | + calc_yfwf_num(sch.xlBm); | |
| 310 | + } | |
| 311 | + }; | |
| 312 | + | |
| 313 | + /** | |
| 314 | + * 更新班次 | |
| 315 | + * @param schArr | |
| 316 | + */ | |
| 317 | + var updateSchedule = function (schArr) { | |
| 318 | + | |
| 319 | + if (!isArray(schArr)) | |
| 320 | + schArr = [schArr]; | |
| 321 | + | |
| 322 | + //var tMaps = {}; | |
| 323 | + $.each(schArr, function () { | |
| 324 | + try { | |
| 325 | + if(this.status==-1) | |
| 326 | + clearActualTime(this); | |
| 327 | + //子任务公里是否与计划平 | |
| 328 | + this.c_t_mileage_status = calcCTaskMileageStatus(this); | |
| 329 | + line2Schedule[this.xlBm][this.id] = this; | |
| 330 | + updateDom(this); | |
| 331 | + }catch(e){} | |
| 332 | + }); | |
| 333 | + | |
| 334 | + /* //重新标记末班 | |
| 335 | + var ts=[]; | |
| 336 | + for(var k in tMaps){ | |
| 337 | + ts = k.split('_'); | |
| 338 | + markerLastByNbbm(ts[0], ts[1]); | |
| 339 | + }*/ | |
| 340 | + }; | |
| 341 | + | |
| 342 | + | |
| 343 | + /** | |
| 344 | + * 更新班次 -只更新数据,不更新dom | |
| 345 | + * @param schArr | |
| 346 | + */ | |
| 347 | + var updateData = function (schArr) { | |
| 348 | + if (!isArray(schArr)) | |
| 349 | + schArr = [schArr]; | |
| 350 | + $.each(schArr, function () { | |
| 351 | + if(this.status==-1) | |
| 352 | + clearActualTime(this); | |
| 353 | + line2Schedule[this.xlBm][this.id] = this; | |
| 354 | + }); | |
| 355 | + }; | |
| 356 | + | |
| 357 | + //update dom | |
| 358 | + var updateDom = function (sch) { | |
| 359 | + if (!sch) return; | |
| 360 | + var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'); | |
| 361 | + var dds = $('dd', dl); | |
| 362 | + $(dds[1]).find('a').text(sch.lpName); | |
| 363 | + var light = !sch.qdzArrDatesj ? 'tl-white' : 'tl-grey'; | |
| 364 | + if (sch.rfidState & 1 == 1) { | |
| 365 | + light = 'tl-yellow'; | |
| 366 | + if (sch.rfidState & 2 == 2) { | |
| 367 | + light = 'tl-green'; | |
| 368 | + } | |
| 369 | + } | |
| 370 | + $(dds[2]).style('background', light); | |
| 371 | + | |
| 372 | + //车辆自编号 | |
| 373 | + var $newDds3 = $(temps['line-schedule-nbbm-temp'](sch)); | |
| 374 | + $(dds[3]).replaceWith($newDds3); | |
| 375 | + //车辆双击 | |
| 376 | + gb_schedule_table_dbclick.carCellClick($newDds3); | |
| 377 | + $(dds[4]).text(sch.qdzArrDatejh ? sch.qdzArrDatejh : ''); | |
| 378 | + $(dds[5]).text(sch.qdzArrDatesj ? sch.qdzArrDatesj : ''); | |
| 379 | + | |
| 380 | + //计发时间 | |
| 381 | + var d5html = temps['line-schedule-fcsj-temp'](sch); | |
| 382 | + if (sch.lpChange == 1) { | |
| 383 | + d5html = d5html.replace('</dd>', '') + '<span class="uk-badge uk-badge-success out">换</span>' + '</dd>'; | |
| 384 | + } | |
| 385 | + $(dds[6]).replaceWith(d5html); | |
| 386 | + //待发时间 | |
| 387 | + var dfHtmlStr = sch.dfsj + (sch.late2?'<span class="late-badge">?+'+sch.lateMinute+'</span>':''); | |
| 388 | + $(dds[7]).attr('data-sort-val', sch.dfsjT).attr('dbclick-val', sch.dfsj).html(dfHtmlStr); | |
| 389 | + | |
| 390 | + //实发时间 | |
| 391 | + calc_sch_real_shift(sch); | |
| 392 | + var sfsjDd = $(temps['line-schedule-sfsj-temp'](sch)); | |
| 393 | + //双击 | |
| 394 | + gb_schedule_table_dbclick.sfsjCellClick(sfsjDd); | |
| 395 | + $(dds[8]).replaceWith(sfsjDd); | |
| 396 | + if (sch.remarks) | |
| 397 | + $(dds[9]).html('<span title="' + sch.remarks + '" data-uk-tooltip="{pos:\'top-left\'}">' + sch.remarks + '</span>'); | |
| 398 | + else | |
| 399 | + $(dds[9]).html(''); | |
| 400 | + | |
| 401 | + //信号状态标记 | |
| 402 | + gb_signal_state.marker_sch(sch); | |
| 403 | + //班次是车辆的最后一班 | |
| 404 | + if (dl.hasClass('dl-last-sch')) | |
| 405 | + markerLastSch([sch]); | |
| 406 | + | |
| 407 | + renderCarRemark(); | |
| 408 | + }; | |
| 409 | + | |
| 410 | + //单击实发单元格显示详细信息 | |
| 411 | + $(document).on('click', 'dd.fcsjActualCell', function () { | |
| 412 | + var that = this; | |
| 413 | + $(that).qtip({ | |
| 414 | + show: true, | |
| 415 | + content: { | |
| 416 | + text: function (e) { | |
| 417 | + var lineCode = $(that).parents('li.line_schedule').data('id') | |
| 418 | + , id = $(that).parents('dl').data('id') | |
| 419 | + , sch = line2Schedule[lineCode][id]; | |
| 420 | + return temps['sfsj_sch-detail-temp'](sch); | |
| 421 | + } | |
| 422 | + } | |
| 423 | + , style: { | |
| 424 | + classes: 'qtip-dark qtip-rounded qtip-shadow' | |
| 425 | + }, | |
| 426 | + hide: { | |
| 427 | + fixed: true, | |
| 428 | + delay: 300 | |
| 429 | + }, | |
| 430 | + position: { | |
| 431 | + target: that, | |
| 432 | + my: 'center left', | |
| 433 | + at: 'center right' | |
| 434 | + }, | |
| 435 | + events: { | |
| 436 | + hidden: function (event, api) { | |
| 437 | + $(this).qtip('destroy', true); | |
| 438 | + } | |
| 439 | + } | |
| 440 | + }); | |
| 441 | + | |
| 442 | + //车辆rect 闪烁、 | |
| 443 | + var wrap = $(that).parents('li.line_schedule'); | |
| 444 | + var nbbm = $(that).parents('dl').find('dd:eq(2)').data('nbbm'); | |
| 445 | + var device = gb_data_basic.nbbm2deviceMap()[nbbm]; | |
| 446 | + var $rect = $('svg.line-chart g.gps-wrap rect[_id=rct_' + device + ']', wrap); | |
| 447 | + | |
| 448 | + //merge_hide | |
| 449 | + if ($rect.hasClass('merge_hide') || $rect.attr('y') < 0) | |
| 450 | + return; | |
| 451 | + $rect.attr('class', 'twinkle').one('animationend', function () { | |
| 452 | + $(this).removeAttr('class'); | |
| 453 | + }); | |
| 454 | + }); | |
| 455 | + | |
| 456 | + //拖拽选中... | |
| 457 | + var seq_nos = '.line-schedule-table .ct_table_body>dl>dd.seq_no'; | |
| 458 | + var drag_strat; | |
| 459 | + $(document).on('mousedown', seq_nos, function (e) { | |
| 460 | + if (e.button != 0) return; | |
| 461 | + var dl = $(this).parent(); | |
| 462 | + if (dl.hasClass('drag-active')) | |
| 463 | + dl.removeClass('drag-active'); | |
| 464 | + else | |
| 465 | + dl.addClass('drag-active'); | |
| 466 | + | |
| 467 | + drag_strat = parseInt($(this).text()) - 1; | |
| 468 | + }).on('mouseup', function () { | |
| 469 | + drag_strat = null; | |
| 470 | + }).on('mouseover', seq_nos, function () { | |
| 471 | + if (drag_strat != null) { | |
| 472 | + var e = parseInt($(this).text()), | |
| 473 | + dls = $(this).parents('.ct_table_body').find('dl'); | |
| 474 | + | |
| 475 | + reset_drag_active_all(this); | |
| 476 | + //向上选中 | |
| 477 | + if (e <= drag_strat) { | |
| 478 | + for (var i = drag_strat; i > e - 2; i--) | |
| 479 | + $(dls[i]).addClass('drag-active'); | |
| 480 | + } | |
| 481 | + //向下选中 | |
| 482 | + else { | |
| 483 | + for (var j = drag_strat; j < e; j++) | |
| 484 | + $(dls[j]).addClass('drag-active'); | |
| 485 | + } | |
| 486 | + } | |
| 487 | + }).on('click', seq_nos, function () { | |
| 488 | + reset_relevance_active(this); | |
| 489 | + }); | |
| 490 | + //非seq_no 单元格点击 | |
| 491 | + $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class!=seq_no][class!=lpName]', function () { | |
| 492 | + reset_drag_active_all(this); | |
| 493 | + //选中相关班次 | |
| 494 | + var id = $(this).parent().data('id'), | |
| 495 | + contWrap = $(this).parents('li.line_schedule'), | |
| 496 | + lineCode = contWrap.data('id'), | |
| 497 | + sch = line2Schedule[lineCode][id], | |
| 498 | + schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) { | |
| 499 | + return item.clZbh == sch.clZbh; | |
| 500 | + }).sort(schedule_sort), | |
| 501 | + nextSch, tempDL; | |
| 502 | + | |
| 503 | + getDl(sch).addClass('intimity'); | |
| 504 | + $.each(schArr, function (i) { | |
| 505 | + tempDL = $('dl[data-id=' + this.id + ']', contWrap); | |
| 506 | + tempDL.addClass('relevance-active'); | |
| 507 | + if (i < schArr.length - 1 && this.id == id) { | |
| 508 | + nextSch = schArr[i + 1]; | |
| 509 | + } | |
| 510 | + }); | |
| 511 | + | |
| 512 | + if (nextSch) { | |
| 513 | + $('dl[data-id=' + nextSch.id + ']', contWrap).addClass('intimity'); | |
| 514 | + /*if (nextSch.xlDir == sch.xlDir) | |
| 515 | + return;*/ | |
| 516 | + //滚动到下一个班次 | |
| 517 | + if(nextSch.xlDir != sch.xlDir) | |
| 518 | + scroToDl(nextSch); | |
| 519 | + | |
| 520 | + } | |
| 521 | + | |
| 522 | + //如果有打开轨迹回放 | |
| 523 | + if($('.layui-layer.play_back-layer').is(':visible')){ | |
| 524 | + gb_map_play_back.setParam(sch); | |
| 525 | + } | |
| 526 | + }); | |
| 527 | + | |
| 528 | + //路牌点击 | |
| 529 | + $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class=lpName]', function () { | |
| 530 | + reset_drag_active_all(this); | |
| 531 | + //选中路牌下相关班次 | |
| 532 | + var id = $(this).parent().data('id'), | |
| 533 | + contWrap = $(this).parents('li.line_schedule'), | |
| 534 | + lineCode = contWrap.data('id'), | |
| 535 | + sch = line2Schedule[lineCode][id], | |
| 536 | + schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) { | |
| 537 | + return item.lpName == sch.lpName; | |
| 538 | + }).sort(schedule_sort); | |
| 539 | + $.each(schArr, function (i) { | |
| 540 | + $('dl[data-id=' + this.id + ']', contWrap).addClass('relevance-active intimity'); | |
| 541 | + }); | |
| 542 | + | |
| 543 | + //notify_succ('高亮路牌 ' + sch.lpName); | |
| 544 | + showLpMileageTip(lineCode, sch.lpName, schArr); | |
| 545 | + }); | |
| 546 | + | |
| 547 | + var showLpMileageTipBySch = function (sch) { | |
| 548 | + if(!$('.mileage_elec_panel', $('.line_schedule[data-id='+sch.xlBm+']')).is(':visible')) | |
| 549 | + return; | |
| 550 | + | |
| 551 | + var schArr = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (item) { | |
| 552 | + return item.lpName == sch.lpName; | |
| 553 | + }).sort(schedule_sort); | |
| 554 | + | |
| 555 | + showLpMileageTip(sch.xlBm, sch.lpName, schArr); | |
| 556 | + }; | |
| 557 | + /** | |
| 558 | + * 弹出路牌公里统计tip | |
| 559 | + * @param lineCode | |
| 560 | + * @param lpName | |
| 561 | + * @param array | |
| 562 | + */ | |
| 563 | + var showLpMileageTip = function (lineCode, lpName, array) { | |
| 564 | + var wrap = $('.line_schedule[data-id='+lineCode+']'); | |
| 565 | + //按驾驶员&车辆分组统计 | |
| 566 | + var data=mileageTipGroupData(array); | |
| 567 | + //统计公里 | |
| 568 | + var list=[]; | |
| 569 | + for(var key in data){ | |
| 570 | + list.push({ | |
| 571 | + key : key, | |
| 572 | + serviceMileage: gb_sch_mileage_count.serviceMileage(data[key]), | |
| 573 | + destroyMileage: gb_sch_mileage_count.destroyMileage(data[key]), | |
| 574 | + emptyMileage: gb_sch_mileage_count.emptyMileage(data[key]) | |
| 575 | + }) | |
| 576 | + } | |
| 577 | + var htmlStr = temps['sch-lp-mileage-tip-temp']({data: list, lpName:lpName}); | |
| 578 | + $('.mileage_elec_panel', wrap).html(htmlStr).addClass('uk-animation-slide-bottom').show() | |
| 579 | + .one('animationEnd', function () { | |
| 580 | + $(this).removeClass('uk-animation-slide-bottom'); | |
| 581 | + }); | |
| 582 | + }; | |
| 583 | + | |
| 584 | + /** | |
| 585 | + * 分组数据,处理子任务里的中途换车 | |
| 586 | + * @param array | |
| 587 | + */ | |
| 588 | + var mileageTipGroupData = function (arr) { | |
| 589 | + var list = JSON.parse(JSON.stringify(arr)); | |
| 590 | + var cts; | |
| 591 | + var zthcArray=[]; | |
| 592 | + var sch; | |
| 593 | + for(var i=0,len=list.length;i<len;i++){ | |
| 594 | + sch = list[i]; | |
| 595 | + cts = sch['cTasks']; | |
| 596 | + if(!cts || cts.length==0) | |
| 597 | + continue; | |
| 598 | + | |
| 599 | + sch['cTasks'] = []; | |
| 600 | + //有子任务 | |
| 601 | + for(var j=0,ct;ct=cts[j++];){ | |
| 602 | + if(!ct.nbbm || ct.nbbm==sch.clZbh){ | |
| 603 | + sch['cTasks'].push(ct); | |
| 604 | + continue; | |
| 605 | + } | |
| 606 | + | |
| 607 | + zthcArray.push(cloneByCTask(sch, ct)); | |
| 608 | + } | |
| 609 | + } | |
| 610 | + | |
| 611 | + if(zthcArray.length > 0) | |
| 612 | + list = list.concat(zthcArray); | |
| 613 | + | |
| 614 | + var data={},key; | |
| 615 | + for(var i=0,len=list.length;i<len;i++){ | |
| 616 | + key = list[i].clZbh+'/'+list[i].jGh+'('+list[i].jName+')'; | |
| 617 | + if(!data[key]) | |
| 618 | + data[key] = []; | |
| 619 | + data[key].push(list[i]); | |
| 620 | + } | |
| 621 | + return data; | |
| 622 | + }; | |
| 623 | + | |
| 624 | + var cloneByCTask = function (sch, ct) { | |
| 625 | + var newObj = JSON.parse(JSON.stringify(sch)); | |
| 626 | + newObj['cTasks']=[]; | |
| 627 | + newObj.clZbh = ct.nbbm; | |
| 628 | + newObj.fcsjActual = ct.startDate; | |
| 629 | + newObj.zdsjActual = ct.endDate; | |
| 630 | + newObj.jhlc = ct.mileage; | |
| 631 | + newObj.jhlcOrig = ct.mileage; | |
| 632 | + | |
| 633 | + if(ct.type2=='1') | |
| 634 | + newObj.bcType='normal'; | |
| 635 | + else if(ct.type2=='2'){ | |
| 636 | + newObj.bcType='in'; | |
| 637 | + }else if(ct.type2=='3') | |
| 638 | + newObj.bcType='out'; | |
| 639 | + | |
| 640 | + return newObj; | |
| 641 | + }; | |
| 642 | + | |
| 643 | + //头部点击去掉选中光标 | |
| 644 | + $(document).on('click', '.header-title', function () { | |
| 645 | + reset_drag_active_all(this); | |
| 646 | + }); | |
| 647 | + | |
| 648 | + var scroToDl = function (sch) { | |
| 649 | + var dl = getDl(sch), | |
| 650 | + cont = dl.parents('.ct_table_wrap'), | |
| 651 | + diff = cont.height() / 2; | |
| 652 | + cont.animate({ | |
| 653 | + scrollTop: dl.offset().top - cont.offset().top + cont.scrollTop() - diff | |
| 654 | + }, 500); | |
| 655 | + | |
| 656 | + return dl; | |
| 657 | + }; | |
| 658 | + | |
| 659 | + var getDl = function (sch) { | |
| 660 | + return $('dl[data-id=' + sch.id + ']', $('.line_schedule[data-id=' + sch.xlBm + ']')); | |
| 661 | + }; | |
| 662 | + | |
| 663 | + var reset_drag_active_all = function (dd) { | |
| 664 | + $(dd).parents('.schedule-wrap').find('dl.drag-active').removeClass('drag-active'); | |
| 665 | + reset_relevance_active(dd); | |
| 666 | + | |
| 667 | + $('.mileage_elec_panel', $(dd).parents('.top-container')).hide().remove('uk-animation-slide-bottom'); | |
| 668 | + }; | |
| 669 | + | |
| 670 | + var reset_relevance_active = function (dd) { | |
| 671 | + $(dd).parents('.uk-grid.schedule-wrap').find('.relevance-active').removeClass('relevance-active intimity'); | |
| 672 | + }; | |
| 673 | + | |
| 674 | + | |
| 675 | + //计算应发未发数量 car_yfwf_map | |
| 676 | + var calc_yfwf_num = function (lineCode) { | |
| 677 | + | |
| 678 | + var schArr = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort), | |
| 679 | + yfwf_num = 0, | |
| 680 | + t = new Date().valueOf(); | |
| 681 | + | |
| 682 | + var carYfwfMap = {}, nbbm; | |
| 683 | + $.each(schArr, function () { | |
| 684 | + /*if (this.dfsjT > t) | |
| 685 | + return false;*/ | |
| 686 | + | |
| 687 | + if (this.dfsjT < t && | |
| 688 | + this.fcsjActual == null && this.fcsjActualTime == null && this.status != -1) { | |
| 689 | + yfwf_num++; | |
| 690 | + nbbm = this.clZbh; | |
| 691 | + if (carYfwfMap[nbbm]) | |
| 692 | + carYfwfMap[nbbm]++; | |
| 693 | + else | |
| 694 | + carYfwfMap[nbbm] = 1; | |
| 695 | + } | |
| 696 | + }); | |
| 697 | + car_yfwf_map[lineCode] = carYfwfMap; | |
| 698 | + | |
| 699 | + $('#badge_yfwf_num_' + lineCode).text(yfwf_num); | |
| 700 | + }; | |
| 701 | + | |
| 702 | + //标记终点时间 -线路 | |
| 703 | + var markerLastByLine = function (lineCode) { | |
| 704 | + var data = gb_common.groupBy(gb_common.get_vals(line2Schedule[lineCode]).filter(schDestroyFilter), 'lpName'); | |
| 705 | + | |
| 706 | + var array, lastSch, dl; | |
| 707 | + for (var nbbm in data) { | |
| 708 | + array = data[nbbm].sort(schedule_sort); | |
| 709 | + markerLastSch(array); | |
| 710 | + } | |
| 711 | + }; | |
| 712 | + | |
| 713 | + //标记终点时间 -车辆 | |
| 714 | + var markerLastByNbbm = function (lineCode, nbbm) { | |
| 715 | + var array = gb_common.get_vals(line2Schedule[lineCode]).filter(function (a) { | |
| 716 | + return a.clZbh == nbbm && a.status != -1; | |
| 717 | + }).sort(schedule_sort); | |
| 718 | + | |
| 719 | + removeMarkers(lineCode, array); | |
| 720 | + markerLastSch(array); | |
| 721 | + }; | |
| 722 | + | |
| 723 | + var markerLastSch = function (array) { | |
| 724 | + var lastSch = array[array.length - 1]; | |
| 725 | + | |
| 726 | + if (!lastSch.jhlc) | |
| 727 | + return; | |
| 728 | + | |
| 729 | + var dl = getDl(lastSch); | |
| 730 | + dl.addClass('dl-last-sch'); | |
| 731 | + | |
| 732 | + $('dd.fcsjActualCell', dl).append(temps['last-sch-sunken-temp'](lastSch)); | |
| 733 | + }; | |
| 734 | + | |
| 735 | + //清除线路下指定班次的 末班标记 | |
| 736 | + var removeMarkers = function (lineCode, array) { | |
| 737 | + var idx = []; | |
| 738 | + $.each(array, function () { | |
| 739 | + idx.push(this.id); | |
| 740 | + }); | |
| 741 | + | |
| 742 | + $('dl.dl-last-sch', 'li.line_schedule[data-id=' + lineCode + ']').each(function () { | |
| 743 | + if ($(this).hasClass('dl-last-sch') && idx.indexOf($(this).data('id'))) { | |
| 744 | + $(this).removeClass('dl-last-sch').find('.last-sch-sunken').remove(); | |
| 745 | + } | |
| 746 | + }); | |
| 747 | + }; | |
| 748 | + | |
| 749 | + var schDestroyFilter = function (a) { | |
| 750 | + return a.status != -1; | |
| 751 | + }; | |
| 752 | + | |
| 753 | + /* 下一个班次 */ | |
| 754 | + var getNextSch = function (sch) { | |
| 755 | + var array = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (a) { | |
| 756 | + return a.clZbh == sch.clZbh; | |
| 757 | + }).sort(schedule_sort); | |
| 758 | + | |
| 759 | + for (var i = 0, item; item = array[i++];) { | |
| 760 | + if (array[i].id == sch.id) { | |
| 761 | + return i < array.length ? array[i + 1] : null; | |
| 762 | + } | |
| 763 | + } | |
| 764 | + }; | |
| 765 | + | |
| 766 | + /* 下一个班次普通班次 */ | |
| 767 | + var getNextNormalSch = function (sch) { | |
| 768 | + | |
| 769 | + var array = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (a) { | |
| 770 | + return a.clZbh == sch.clZbh && a.bcType=='normal'; | |
| 771 | + }).sort(schedule_sort); | |
| 772 | + | |
| 773 | + for (var i = 0; i < array.length; i++) { | |
| 774 | + if (array[i].id == sch.id) { | |
| 775 | + return i < array.length ? array[i + 1] : null; | |
| 776 | + } | |
| 777 | + } | |
| 778 | + }; | |
| 779 | + | |
| 780 | + /** 添加备注信息 */ | |
| 781 | + var addRemarks = function (list, remarks) { | |
| 782 | + //if(!list || list) | |
| 783 | + var i = 0, sch; | |
| 784 | + | |
| 785 | + (function () { | |
| 786 | + var f = arguments.callee; | |
| 787 | + if(i >= list.length){ | |
| 788 | + return; | |
| 789 | + } | |
| 790 | + sch = list[i]; | |
| 791 | + gb_common.$post('/realSchedule/addRemarks', {id: sch.id, remarks: remarks}, function (rs) { | |
| 792 | + if(rs.t){ | |
| 793 | + sch = rs.t; | |
| 794 | + line2Schedule[sch.xlBm][sch.id] = sch; | |
| 795 | + updateDom(sch); | |
| 796 | + i++; | |
| 797 | + f(); | |
| 798 | + } | |
| 799 | + }); | |
| 800 | + })(); | |
| 801 | + }; | |
| 802 | + | |
| 803 | + /** | |
| 804 | + * 显示误点停靠时间标记 | |
| 805 | + * @param id | |
| 806 | + * @param minute | |
| 807 | + */ | |
| 808 | + var showLateBadge = function (lineCode, id, minute) { | |
| 809 | + var dfCell = cancelLateBadge(lineCode, id); | |
| 810 | + $(dfCell).append('<span class="late-badge">?+'+minute+'</span>'); | |
| 811 | + }; | |
| 812 | + | |
| 813 | + /** | |
| 814 | + * 取消误点标记 | |
| 815 | + * @param lineCode | |
| 816 | + * @param id | |
| 817 | + */ | |
| 818 | + var cancelLateBadge = function (lineCode, id) { | |
| 819 | + var $dl = getDl({id: id, xlBm: lineCode}); | |
| 820 | + var dfCell = $dl.find('dd')[6]; | |
| 821 | + $('.late-badge',dfCell).remove(); | |
| 822 | + return dfCell; | |
| 823 | + }; | |
| 824 | + | |
| 825 | + | |
| 826 | + /** | |
| 827 | + * 刷新页面的所有线路班次 | |
| 828 | + */ | |
| 829 | + var refreshAll = function () { | |
| 830 | + show(); | |
| 831 | + }; | |
| 832 | + | |
| 833 | + /** | |
| 834 | + * 获取线路下营运的车辆 | |
| 835 | + */ | |
| 836 | + var findNbbmByLineCode = function (lineCode) { | |
| 837 | + try{ | |
| 838 | + return gb_common.get_keys(gb_common.extractNbbm(gb_common.get_vals(line2Schedule[lineCode]))); | |
| 839 | + }catch (e){ | |
| 840 | + return []; | |
| 841 | + } | |
| 842 | + }; | |
| 843 | + | |
| 844 | + var clearActualTime = function (sch) { | |
| 845 | + try{ | |
| 846 | + sch.fcsjActual=null; | |
| 847 | + sch.fcsjActualTime=null; | |
| 848 | + sch.zdsjActual=null; | |
| 849 | + sch.zdsjActualTime=null; | |
| 850 | + }catch (e){ | |
| 851 | + console.log(e); | |
| 852 | + } | |
| 853 | + }; | |
| 854 | + | |
| 855 | + /** | |
| 856 | + * 班次站点编码异常信息 | |
| 857 | + * @param list | |
| 858 | + */ | |
| 859 | + var putSCodeErrorInfo = function (list) { | |
| 860 | + //按线路走向分组 | |
| 861 | + var data = {}; | |
| 862 | + var k; | |
| 863 | + for(var i=0,obj;obj=list[i++];){ | |
| 864 | + k = obj.lineCode+'_'+obj.upDown; | |
| 865 | + | |
| 866 | + if(obj.realStationCode && obj.realStationCode.indexOf('^') != -1) | |
| 867 | + obj.realStationCode = obj.realStationCode.split('^')[0]; | |
| 868 | + | |
| 869 | + if(!data[k]) | |
| 870 | + data[k] = []; | |
| 871 | + data[k].push(obj); | |
| 872 | + } | |
| 873 | + | |
| 874 | + var wrap; | |
| 875 | + for(var k in data){ | |
| 876 | + wrap = $('.line_schedule[data-id=' + (k.split('_')[0]) + ']'); | |
| 877 | + if(wrap.length==0) | |
| 878 | + continue; | |
| 879 | + | |
| 880 | + $(".schedule-wrap span.warn_multi_station[data-updown="+(k.split('_')[1])+"]", wrap) | |
| 881 | + .html('o(* ̄▽ ̄*)o 班次和站点关联有点问题!!').show(); | |
| 882 | + } | |
| 883 | + | |
| 884 | + errorCodeData = data; | |
| 885 | + }; | |
| 886 | + | |
| 887 | + var findSCodeErrorInfo = function (lineCode, upDown) { | |
| 888 | + return errorCodeData[lineCode+'_'+upDown]; | |
| 889 | + }; | |
| 890 | + | |
| 891 | + var refreshRfid = function (sch) { | |
| 892 | + var $dl = getDl({id: sch.id, xlBm: sch.xlBm}); | |
| 893 | + var dfCell = $dl.find('dd')[2]; | |
| 894 | + var light = !sch.qdzArrDatesj ? 'tl-white' : 'tl-grey'; | |
| 895 | + if (sch.rfidState & 1 == 1) { | |
| 896 | + light = 'tl-yellow'; | |
| 897 | + if (sch.rfidState & 2 == 2) { | |
| 898 | + light = 'tl-green'; | |
| 899 | + } | |
| 900 | + } | |
| 901 | + $(dfCell).attr('class', light); | |
| 902 | + }; | |
| 903 | + | |
| 904 | + return { | |
| 905 | + show: show, | |
| 906 | + findScheduleByLine: findScheduleByLine, | |
| 907 | + updateSchedule: updateSchedule, | |
| 908 | + updateData: updateData, | |
| 909 | + deheteSchedule: deheteSchedule, | |
| 910 | + insertSchedule: insertSchedule, | |
| 911 | + schedule_sort: schedule_sort, | |
| 912 | + calc_yfwf_num: calc_yfwf_num, | |
| 913 | + car_yfwf_map: function (lineCode) { | |
| 914 | + return car_yfwf_map[lineCode]; | |
| 915 | + }, | |
| 916 | + scroToDl: scroToDl, | |
| 917 | + reset_drag_active_all: reset_drag_active_all, | |
| 918 | + getDl: getDl, | |
| 919 | + getNextSch: getNextSch, | |
| 920 | + addRemarks: addRemarks, | |
| 921 | + reLoadAndRefresh: reLoadAndRefresh, | |
| 922 | + showLateBadge: showLateBadge, | |
| 923 | + cancelLateBadge: cancelLateBadge, | |
| 924 | + refreshAll: refreshAll, | |
| 925 | + getNextNormalSch: getNextNormalSch, | |
| 926 | + findNbbmByLineCode:findNbbmByLineCode, | |
| 927 | + showLpMileageTipBySch: showLpMileageTipBySch, | |
| 928 | + renderCarRemark: renderCarRemark, | |
| 929 | + putSCodeErrorInfo: putSCodeErrorInfo, | |
| 930 | + findSCodeErrorInfo: findSCodeErrorInfo, | |
| 931 | + refreshRfid: refreshRfid | |
| 932 | + }; | |
| 933 | +})(); | ... | ... |