Commit 435da63ee49d8bea204b17f2c0ee7b1be8d700cc
1 parent
c4e419a2
'调度日报汇总表'与'审计公里汇总表'改成查询日期范围;油电平衡南汇公司限制修改日期下调至1天内
Showing
13 changed files
with
999 additions
and
772 deletions
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| @@ -415,6 +415,10 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -415,6 +415,10 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 415 | if(map.get("date")!=null){ | 415 | if(map.get("date")!=null){ |
| 416 | date=map.get("date").toString(); | 416 | date=map.get("date").toString(); |
| 417 | } | 417 | } |
| 418 | + String date2=""; | ||
| 419 | + if(map.get("date2")!=null){ | ||
| 420 | + date2=map.get("date2").toString(); | ||
| 421 | + } | ||
| 418 | String nature="0"; | 422 | String nature="0"; |
| 419 | if(map.get("nature")!=null){ | 423 | if(map.get("nature")!=null){ |
| 420 | nature=map.get("nature").toString(); | 424 | nature=map.get("nature").toString(); |
| @@ -423,7 +427,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -423,7 +427,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 423 | if(map.get("type")!=null){ | 427 | if(map.get("type")!=null){ |
| 424 | type=map.get("type").toString(); | 428 | type=map.get("type").toString(); |
| 425 | } | 429 | } |
| 426 | - return scheduleRealInfoService.dispatchDailySum(date, nature, type); | 430 | + return scheduleRealInfoService.dispatchDailySum(date, date2, nature, type); |
| 427 | } | 431 | } |
| 428 | 432 | ||
| 429 | @RequestMapping(value="/statisticsDailyTj") | 433 | @RequestMapping(value="/statisticsDailyTj") |
src/main/java/com/bsth/repository/calc/CalcLineMileageRepository.java
| @@ -25,6 +25,10 @@ public interface CalcLineMileageRepository extends BaseRepository<CalcLineMileag | @@ -25,6 +25,10 @@ public interface CalcLineMileageRepository extends BaseRepository<CalcLineMileag | ||
| 25 | @Query(value="select DISTINCT c from CalcLineMileage c where c.xl = ?1 and c.dateStr between ?2 and ?3 order by c.id") | 25 | @Query(value="select DISTINCT c from CalcLineMileage c where c.xl = ?1 and c.dateStr between ?2 and ?3 order by c.id") |
| 26 | List<CalcLineMileage> selectByDateAndLineTj2(String line,String date,String date2); | 26 | List<CalcLineMileage> selectByDateAndLineTj2(String line,String date,String date2); |
| 27 | 27 | ||
| 28 | + //按照时间段统计,全部线路 | ||
| 29 | + @Query(value="select DISTINCT c from CalcLineMileage c where c.dateStr between ?1 and ?2 order by c.id") | ||
| 30 | + List<CalcLineMileage> selectByDateAndLineTj3(String date,String date2); | ||
| 31 | + | ||
| 28 | //按照日期和线路删除数据 | 32 | //按照日期和线路删除数据 |
| 29 | @Modifying | 33 | @Modifying |
| 30 | @Transactional | 34 | @Transactional |
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
| @@ -1572,7 +1572,11 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -1572,7 +1572,11 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 1572 | List<String> keyList = new ArrayList<String>(); | 1572 | List<String> keyList = new ArrayList<String>(); |
| 1573 | Map<String, List<CalcLineMileage>> keyMap = new HashMap<String, List<CalcLineMileage>>(); | 1573 | Map<String, List<CalcLineMileage>> keyMap = new HashMap<String, List<CalcLineMileage>>(); |
| 1574 | 1574 | ||
| 1575 | - if(line == null || line.trim().length() == 0){ | 1575 | + if((line == null || line.trim().length() == 0) |
| 1576 | + && (gsdm == null || gsdm.trim().length() == 0) | ||
| 1577 | + && (fgsdm == null || fgsdm.trim().length() == 0)){ | ||
| 1578 | + list = calcLineMileageRepository.selectByDateAndLineTj3(date, date2); | ||
| 1579 | + } else if(line == null || line.trim().length() == 0){ | ||
| 1576 | list = calcLineMileageRepository.selectByDateAndLineTj(line, date, date2, gsdm, fgsdm); | 1580 | list = calcLineMileageRepository.selectByDateAndLineTj(line, date, date2, gsdm, fgsdm); |
| 1577 | } else { | 1581 | } else { |
| 1578 | list = calcLineMileageRepository.selectByDateAndLineTj2(line, date, date2); | 1582 | list = calcLineMileageRepository.selectByDateAndLineTj2(line, date, date2); |
| @@ -1618,6 +1622,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -1618,6 +1622,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 1618 | m.put("fgsdm", c.getFgsdm()); | 1622 | m.put("fgsdm", c.getFgsdm()); |
| 1619 | m.put("fgs", c.getFgsName()); | 1623 | m.put("fgs", c.getFgsName()); |
| 1620 | } | 1624 | } |
| 1625 | + m.put("xl", c.getXl()); | ||
| 1621 | m.put("xlName", c.getXlName()); | 1626 | m.put("xlName", c.getXlName()); |
| 1622 | m.put("jhzlc", c.getJhzlc()); | 1627 | m.put("jhzlc", c.getJhzlc()); |
| 1623 | m.put("jhlc", c.getJhlc()); | 1628 | m.put("jhlc", c.getJhlc()); |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| @@ -118,7 +118,7 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | @@ -118,7 +118,7 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | ||
| 118 | 118 | ||
| 119 | List<Map<String,Object>> statisticsDaily(String line, String date, String xlName, String type); | 119 | List<Map<String,Object>> statisticsDaily(String line, String date, String xlName, String type); |
| 120 | 120 | ||
| 121 | - List<Map<String,Object>> dispatchDailySum(String date, String nature, String type); | 121 | + List<Map<String,Object>> dispatchDailySum(String date, String date2, String nature, String type); |
| 122 | 122 | ||
| 123 | List<Map<String,Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2, String xlName, String type,String nature); | 123 | List<Map<String,Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2, String xlName, String type,String nature); |
| 124 | 124 |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| 1 | package com.bsth.service.realcontrol.impl; | 1 | package com.bsth.service.realcontrol.impl; |
| 2 | 2 | ||
| 3 | import java.io.*; | 3 | import java.io.*; |
| 4 | +import java.lang.reflect.Field; | ||
| 4 | import java.math.BigDecimal; | 5 | import java.math.BigDecimal; |
| 5 | import java.net.HttpURLConnection; | 6 | import java.net.HttpURLConnection; |
| 6 | import java.net.MalformedURLException; | 7 | import java.net.MalformedURLException; |
| @@ -70,6 +71,7 @@ import com.bsth.entity.Cars; | @@ -70,6 +71,7 @@ import com.bsth.entity.Cars; | ||
| 70 | import com.bsth.entity.Line; | 71 | import com.bsth.entity.Line; |
| 71 | import com.bsth.entity.Personnel; | 72 | import com.bsth.entity.Personnel; |
| 72 | import com.bsth.entity.calc.CalcInterval; | 73 | import com.bsth.entity.calc.CalcInterval; |
| 74 | +import com.bsth.entity.calc.CalcStatistics; | ||
| 73 | import com.bsth.entity.oil.Dlb; | 75 | import com.bsth.entity.oil.Dlb; |
| 74 | import com.bsth.entity.oil.Ylb; | 76 | import com.bsth.entity.oil.Ylb; |
| 75 | import com.bsth.entity.oil.Ylxxb; | 77 | import com.bsth.entity.oil.Ylxxb; |
| @@ -104,6 +106,7 @@ import com.bsth.repository.schedule.GuideboardInfoRepository; | @@ -104,6 +106,7 @@ import com.bsth.repository.schedule.GuideboardInfoRepository; | ||
| 104 | import com.bsth.security.util.SecurityUtils; | 106 | import com.bsth.security.util.SecurityUtils; |
| 105 | import com.bsth.service.LineService; | 107 | import com.bsth.service.LineService; |
| 106 | import com.bsth.service.SectionRouteService; | 108 | import com.bsth.service.SectionRouteService; |
| 109 | +import com.bsth.service.calc.CalcWaybillService; | ||
| 107 | import com.bsth.service.directive.DirectiveService; | 110 | import com.bsth.service.directive.DirectiveService; |
| 108 | import com.bsth.service.impl.BaseServiceImpl; | 111 | import com.bsth.service.impl.BaseServiceImpl; |
| 109 | import com.bsth.service.realcontrol.ScheduleRealInfoService; | 112 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| @@ -156,6 +159,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -156,6 +159,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 156 | DictionaryService dictionaryService; | 159 | DictionaryService dictionaryService; |
| 157 | 160 | ||
| 158 | @Autowired | 161 | @Autowired |
| 162 | + CalcWaybillService calcWaybillService; | ||
| 163 | + | ||
| 164 | + @Autowired | ||
| 159 | CalcIntervalRepository calcIntervalRepository; | 165 | CalcIntervalRepository calcIntervalRepository; |
| 160 | /*@Autowired | 166 | /*@Autowired |
| 161 | BorrowCenter borrowCenter;*/ | 167 | BorrowCenter borrowCenter;*/ |
| @@ -2954,10 +2960,29 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2954,10 +2960,29 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2954 | } | 2960 | } |
| 2955 | 2961 | ||
| 2956 | @Override | 2962 | @Override |
| 2957 | - public List<Map<String, Object>> dispatchDailySum(String date, String nature, String type) { | 2963 | + public List<Map<String, Object>> dispatchDailySum(String date, String date2, String nature, String type) { |
| 2958 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | 2964 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 2959 | 2965 | ||
| 2960 | - List<Map<String, Object>> list = statisticsDailyTj("", "", "", date, date, "", "query", nature); | 2966 | +// List<Map<String, Object>> list = statisticsDailyTj("", "", "", date, date2, "", "query", nature); |
| 2967 | + List<CalcStatistics> calc = calcWaybillService.calcStatisticsDaily("", "", "", date, date2, "", "query", nature); | ||
| 2968 | + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); | ||
| 2969 | + try { | ||
| 2970 | + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); | ||
| 2971 | + for(CalcStatistics c : calc){ | ||
| 2972 | + Map<String, Object> m = new HashMap<>(); | ||
| 2973 | + Field[] fields = c.getClass().getDeclaredFields(); | ||
| 2974 | + for(Field f : fields){ | ||
| 2975 | + f.setAccessible(true); | ||
| 2976 | + String key = new String(f.getName()); | ||
| 2977 | + m.put(key, f.get(c)); | ||
| 2978 | + } | ||
| 2979 | + tempList.add(m); | ||
| 2980 | + } | ||
| 2981 | + list = tempList; | ||
| 2982 | + } catch (Exception e) { | ||
| 2983 | + // TODO: handle exception | ||
| 2984 | + e.printStackTrace(); | ||
| 2985 | + } | ||
| 2961 | 2986 | ||
| 2962 | Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>(); | 2987 | Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>(); |
| 2963 | Map<String, Object> temp = new HashMap<String, Object>(); | 2988 | Map<String, Object> temp = new HashMap<String, Object>(); |
| @@ -3029,6 +3054,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3029,6 +3054,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3029 | resList.add(temp);keyMap.put("88", temp); | 3054 | resList.add(temp);keyMap.put("88", temp); |
| 3030 | 3055 | ||
| 3031 | for(Map<String, Object> m : list){ | 3056 | for(Map<String, Object> m : list){ |
| 3057 | + m.put("gsBm", m.get("gsdm")); | ||
| 3058 | + m.put("fgsBm", m.get("fgsdm")); | ||
| 3032 | if(m.get("gsBm") != null && m.get("fgsBm") != null | 3059 | if(m.get("gsBm") != null && m.get("fgsBm") != null |
| 3033 | && m.get("gsBm").toString().trim().length() > 0 | 3060 | && m.get("gsBm").toString().trim().length() > 0 |
| 3034 | && m.get("fgsBm").toString().trim().length() > 0){ | 3061 | && m.get("fgsBm").toString().trim().length() > 0){ |
| @@ -3099,6 +3126,46 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3099,6 +3126,46 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3099 | 3126 | ||
| 3100 | for(Map<String, Object> m : resList){ | 3127 | for(Map<String, Object> m : resList){ |
| 3101 | try { | 3128 | try { |
| 3129 | + m.put("jhzlc", m.get("jhzlc")); | ||
| 3130 | + m.put("jhlc", m.get("jhyylc")); | ||
| 3131 | + m.put("jcclc", m.get("jhkslc")); | ||
| 3132 | + m.put("sjzgl", m.get("sjzlc")); | ||
| 3133 | + m.put("sjgl", m.get("sjyylc")); | ||
| 3134 | + m.put("sjksgl", m.get("sjkslc")); | ||
| 3135 | + m.put("ssbc", m.get("ssbc")); | ||
| 3136 | + m.put("ssgl", m.get("sslc")); | ||
| 3137 | + m.put("ssgl_lz", m.get("lzlc")); | ||
| 3138 | + m.put("ssgl_dm", m.get("dmlc")); | ||
| 3139 | + m.put("ssgl_gz", m.get("gzlc")); | ||
| 3140 | + m.put("ssgl_jf", m.get("jflc")); | ||
| 3141 | + m.put("ssgl_zs", m.get("zslc")); | ||
| 3142 | + m.put("ssgl_qr", m.get("qrlc")); | ||
| 3143 | + m.put("ssgl_qc", m.get("qclc")); | ||
| 3144 | + m.put("ssgl_kx", m.get("kxlc")); | ||
| 3145 | + m.put("ssgl_qh", m.get("qhlc")); | ||
| 3146 | + m.put("ssgl_yw", m.get("ywlc")); | ||
| 3147 | + m.put("ssgl_other", m.get("qtlc")); | ||
| 3148 | + m.put("ljgl", m.get("ljlc")); | ||
| 3149 | + m.put("ljks", m.get("ljkslc")); | ||
| 3150 | + m.put("jhbc", m.get("jhbcq")); | ||
| 3151 | + m.put("jhbc_m", m.get("jhbcz")); | ||
| 3152 | + m.put("jhbc_a", m.get("jhbcw")); | ||
| 3153 | + m.put("sjbc", m.get("sjbcq")); | ||
| 3154 | + m.put("sjbc_m", m.get("sjbcz")); | ||
| 3155 | + m.put("sjbc_a", m.get("sjbcw")); | ||
| 3156 | + m.put("ljbc", m.get("ljbcq")); | ||
| 3157 | + m.put("ljbc_m", m.get("ljbcz")); | ||
| 3158 | + m.put("ljbc_a", m.get("ljbcw")); | ||
| 3159 | + m.put("fzbc", m.get("fzbcq")); | ||
| 3160 | + m.put("fzbc_m", m.get("fzbcz")); | ||
| 3161 | + m.put("fzbc_a", m.get("fzbcw")); | ||
| 3162 | + m.put("dtbc", m.get("dtbcq")); | ||
| 3163 | + m.put("dtbc_m", m.get("dtbcz")); | ||
| 3164 | + m.put("dtbc_a", m.get("dtbcw")); | ||
| 3165 | + m.put("djg", m.get("djgq")); | ||
| 3166 | + m.put("djg_m", m.get("djgz")); | ||
| 3167 | + m.put("djg_a", m.get("djgw")); | ||
| 3168 | + m.put("djg_time", m.get("djgsj")); | ||
| 3102 | m.put("ljzgl", new BigDecimal(m.get("ljgl").toString()).add(new BigDecimal(m.get("ljks").toString()))); | 3169 | m.put("ljzgl", new BigDecimal(m.get("ljgl").toString()).add(new BigDecimal(m.get("ljks").toString()))); |
| 3103 | } catch (Exception e) { | 3170 | } catch (Exception e) { |
| 3104 | // TODO: handle exception | 3171 | // TODO: handle exception |
| @@ -3116,12 +3183,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3116,12 +3183,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3116 | ReportUtils ee = new ReportUtils(); | 3183 | ReportUtils ee = new ReportUtils(); |
| 3117 | try { | 3184 | try { |
| 3118 | String dateTime = ""; | 3185 | String dateTime = ""; |
| 3119 | -// if (date.equals(date2)) { | 3186 | + if (date.equals(date2)) { |
| 3120 | dateTime = sdfSimple.format(sdfMonth.parse(date)); | 3187 | dateTime = sdfSimple.format(sdfMonth.parse(date)); |
| 3121 | -// } else { | ||
| 3122 | -// dateTime = sdfSimple.format(sdfMonth.parse(date)) | ||
| 3123 | -// + "-" + sdfSimple.format(sdfMonth.parse(date2)); | ||
| 3124 | -// } | 3188 | + } else { |
| 3189 | + dateTime = sdfSimple.format(sdfMonth.parse(date)) | ||
| 3190 | + + "-" + sdfSimple.format(sdfMonth.parse(date2)); | ||
| 3191 | + } | ||
| 3125 | listI.add(resList.iterator()); | 3192 | listI.add(resList.iterator()); |
| 3126 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 3193 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 3127 | ee.excelReplace(listI, new Object[]{m}, path + "mould/dispatchDailySum.xls", | 3194 | ee.excelReplace(listI, new Object[]{m}, path + "mould/dispatchDailySum.xls", |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| 1 | package com.bsth.service.report.impl; | 1 | package com.bsth.service.report.impl; |
| 2 | import com.bsth.common.ResponseCode; | 2 | import com.bsth.common.ResponseCode; |
| 3 | import com.bsth.data.BasicData; | 3 | import com.bsth.data.BasicData; |
| 4 | -import com.bsth.entity.CarDevice; | ||
| 5 | import com.bsth.entity.Line; | 4 | import com.bsth.entity.Line; |
| 6 | import com.bsth.entity.Personnel; | 5 | import com.bsth.entity.Personnel; |
| 7 | import com.bsth.entity.StationRoute; | 6 | import com.bsth.entity.StationRoute; |
| 7 | +import com.bsth.entity.calc.CalcStatistics; | ||
| 8 | import com.bsth.entity.excep.ArrivalInfo; | 8 | import com.bsth.entity.excep.ArrivalInfo; |
| 9 | -import com.bsth.entity.mcy_forms.Daily; | ||
| 10 | import com.bsth.entity.mcy_forms.Singledata; | 9 | import com.bsth.entity.mcy_forms.Singledata; |
| 11 | import com.bsth.entity.oil.Dlb; | 10 | import com.bsth.entity.oil.Dlb; |
| 12 | import com.bsth.entity.oil.Ylb; | 11 | import com.bsth.entity.oil.Ylb; |
| @@ -27,10 +26,8 @@ import com.bsth.util.ComparableChild; | @@ -27,10 +26,8 @@ import com.bsth.util.ComparableChild; | ||
| 27 | import com.bsth.util.ComparableJob; | 26 | import com.bsth.util.ComparableJob; |
| 28 | import com.bsth.util.ReportUtils; | 27 | import com.bsth.util.ReportUtils; |
| 29 | import com.bsth.util.db.DBUtils_MS; | 28 | import com.bsth.util.db.DBUtils_MS; |
| 30 | -import com.google.protobuf.StringValue; | ||
| 31 | 29 | ||
| 32 | import org.apache.commons.lang.StringUtils; | 30 | import org.apache.commons.lang.StringUtils; |
| 33 | -import org.apache.poi.hssf.usermodel.HSSFWorkbook; | ||
| 34 | import org.slf4j.Logger; | 31 | import org.slf4j.Logger; |
| 35 | import org.slf4j.LoggerFactory; | 32 | import org.slf4j.LoggerFactory; |
| 36 | import org.springframework.beans.factory.annotation.Autowired; | 33 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -38,7 +35,6 @@ import org.springframework.jdbc.core.JdbcTemplate; | @@ -38,7 +35,6 @@ import org.springframework.jdbc.core.JdbcTemplate; | ||
| 38 | import org.springframework.jdbc.core.RowMapper; | 35 | import org.springframework.jdbc.core.RowMapper; |
| 39 | import org.springframework.stereotype.Service; | 36 | import org.springframework.stereotype.Service; |
| 40 | 37 | ||
| 41 | -import java.io.FileOutputStream; | ||
| 42 | import java.math.BigDecimal; | 38 | import java.math.BigDecimal; |
| 43 | import java.sql.Connection; | 39 | import java.sql.Connection; |
| 44 | import java.sql.PreparedStatement; | 40 | import java.sql.PreparedStatement; |
| @@ -49,8 +45,6 @@ import java.text.ParseException; | @@ -49,8 +45,6 @@ import java.text.ParseException; | ||
| 49 | import java.text.SimpleDateFormat; | 45 | import java.text.SimpleDateFormat; |
| 50 | import java.util.*; | 46 | import java.util.*; |
| 51 | 47 | ||
| 52 | -import javax.persistence.criteria.CriteriaBuilder.In; | ||
| 53 | - | ||
| 54 | @Service | 48 | @Service |
| 55 | public class ReportServiceImpl implements ReportService{ | 49 | public class ReportServiceImpl implements ReportService{ |
| 56 | 50 | ||
| @@ -2518,10 +2512,13 @@ public class ReportServiceImpl implements ReportService{ | @@ -2518,10 +2512,13 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2518 | public List<Map<String, Object>> countMileageSum(Map<String, Object> map) { | 2512 | public List<Map<String, Object>> countMileageSum(Map<String, Object> map) { |
| 2519 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | 2513 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 2520 | 2514 | ||
| 2521 | - String date=""; | 2515 | + String date="", date2=""; |
| 2522 | if(map.get("date")!=null){ | 2516 | if(map.get("date")!=null){ |
| 2523 | date=map.get("date").toString(); | 2517 | date=map.get("date").toString(); |
| 2524 | } | 2518 | } |
| 2519 | + if(map.get("date2")!=null){ | ||
| 2520 | + date2=map.get("date2").toString(); | ||
| 2521 | + } | ||
| 2525 | String nature="0"; | 2522 | String nature="0"; |
| 2526 | if(map.get("nature")!=null){ | 2523 | if(map.get("nature")!=null){ |
| 2527 | nature=map.get("nature").toString(); | 2524 | nature=map.get("nature").toString(); |
| @@ -2530,12 +2527,32 @@ public class ReportServiceImpl implements ReportService{ | @@ -2530,12 +2527,32 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2530 | if(map.get("type")!=null){ | 2527 | if(map.get("type")!=null){ |
| 2531 | type=map.get("type").toString(); | 2528 | type=map.get("type").toString(); |
| 2532 | } | 2529 | } |
| 2533 | - Map<String, Object> param = new HashMap<String, Object>(); | ||
| 2534 | - param.put("date", date); | ||
| 2535 | - param.put("date2", date); | ||
| 2536 | - param.put("nature", nature); | ||
| 2537 | - param.put("type", "query"); | ||
| 2538 | - List<Map<String, Object>> list = countByList(param); | 2530 | +// Map<String, Object> param = new HashMap<String, Object>(); |
| 2531 | +// param.put("date", date); | ||
| 2532 | +// param.put("date2", date2); | ||
| 2533 | +// param.put("nature", nature); | ||
| 2534 | +// param.put("type", "query"); | ||
| 2535 | +// List<Map<String, Object>> list = countByList(param); | ||
| 2536 | + List<Map<String, Object>> listAll = calcWaybillService.getLineMileage("", "", "", date, date2, "", "", "", "query"); | ||
| 2537 | + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); | ||
| 2538 | + Map<String, Boolean> lineMap=lineService.lineNature(); | ||
| 2539 | + if(nature.equals("0")){ | ||
| 2540 | + list=listAll; | ||
| 2541 | + }else{ | ||
| 2542 | + for (Map<String, Object> m : listAll) { | ||
| 2543 | + if(m.get("xl") != null && m.get("xl").toString().trim().length() > 0){ | ||
| 2544 | + if(nature.equals("1")){ | ||
| 2545 | + if(lineMap.get(m.get("xl").toString())){ | ||
| 2546 | + list.add(m); | ||
| 2547 | + } | ||
| 2548 | + }else{ | ||
| 2549 | + if(!lineMap.get(m.get("xl").toString())){ | ||
| 2550 | + list.add(m); | ||
| 2551 | + } | ||
| 2552 | + } | ||
| 2553 | + } | ||
| 2554 | + } | ||
| 2555 | + } | ||
| 2539 | 2556 | ||
| 2540 | Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>(); | 2557 | Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>(); |
| 2541 | Map<String, Object> temp = new HashMap<String, Object>(); | 2558 | Map<String, Object> temp = new HashMap<String, Object>(); |
| @@ -2607,6 +2624,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -2607,6 +2624,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2607 | resList.add(temp);keyMap.put("88", temp); | 2624 | resList.add(temp);keyMap.put("88", temp); |
| 2608 | 2625 | ||
| 2609 | for(Map<String, Object> m : list){ | 2626 | for(Map<String, Object> m : list){ |
| 2627 | + m.put("gsBm", m.get("gsdm")); | ||
| 2628 | + m.put("fgsBm", m.get("fgsdm")); | ||
| 2610 | if(m.get("gsBm") != null && m.get("fgsBm") != null | 2629 | if(m.get("gsBm") != null && m.get("fgsBm") != null |
| 2611 | && m.get("gsBm").toString().trim().length() > 0 | 2630 | && m.get("gsBm").toString().trim().length() > 0 |
| 2612 | && m.get("fgsBm").toString().trim().length() > 0){ | 2631 | && m.get("fgsBm").toString().trim().length() > 0){ |
| @@ -2685,12 +2704,12 @@ public class ReportServiceImpl implements ReportService{ | @@ -2685,12 +2704,12 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2685 | ReportUtils ee = new ReportUtils(); | 2704 | ReportUtils ee = new ReportUtils(); |
| 2686 | try { | 2705 | try { |
| 2687 | String dateTime = ""; | 2706 | String dateTime = ""; |
| 2688 | -// if(date.equals(date2)){ | 2707 | + if(date.equals(date2)){ |
| 2689 | dateTime = sdfSimple.format(sdfMonth.parse(date)); | 2708 | dateTime = sdfSimple.format(sdfMonth.parse(date)); |
| 2690 | -// } else { | ||
| 2691 | -// dateTime = sdfSimple.format(sdfMonth.parse(date)) | ||
| 2692 | -// +"-"+sdfSimple.format(sdfMonth.parse(date2)); | ||
| 2693 | -// } | 2709 | + } else { |
| 2710 | + dateTime = sdfSimple.format(sdfMonth.parse(date)) | ||
| 2711 | + +"-"+sdfSimple.format(sdfMonth.parse(date2)); | ||
| 2712 | + } | ||
| 2694 | listI.add(resList.iterator()); | 2713 | listI.add(resList.iterator()); |
| 2695 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 2714 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 2696 | ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls, | 2715 | ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls, |
src/main/resources/static/pages/electricity/list/list.html
| @@ -280,7 +280,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -280,7 +280,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 280 | $("#checkDl").on('click', function () { | 280 | $("#checkDl").on('click', function () { |
| 281 | if ($("#rq").val() != "") { | 281 | if ($("#rq").val() != "") { |
| 282 | var params=getParamsList(); | 282 | var params=getParamsList(); |
| 283 | - $get('/ylb/checkDate',params,function(status){ | 283 | + var par={}; |
| 284 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 285 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 286 | + $get('/ylb/checkDate',par,function(status){ | ||
| 284 | if(status=='2'){ | 287 | if(status=='2'){ |
| 285 | layer.msg('只能操作三天内数据.'); | 288 | layer.msg('只能操作三天内数据.'); |
| 286 | }else{ | 289 | }else{ |
| @@ -301,7 +304,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -301,7 +304,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 301 | console.log("进场油量等于出场油量"); | 304 | console.log("进场油量等于出场油量"); |
| 302 | if ($("#rq").val() != "") { | 305 | if ($("#rq").val() != "") { |
| 303 | var params=getParamsList(); | 306 | var params=getParamsList(); |
| 304 | - $get('/ylb/checkDate',params,function(status){ | 307 | + var par={}; |
| 308 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 309 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 310 | + $get('/ylb/checkDate',par,function(status){ | ||
| 305 | if(status=='2'){ | 311 | if(status=='2'){ |
| 306 | layer.msg('只能操作三天内数据.'); | 312 | layer.msg('只能操作三天内数据.'); |
| 307 | }else{ | 313 | }else{ |
| @@ -321,7 +327,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -321,7 +327,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 321 | //保存 | 327 | //保存 |
| 322 | $("#saveButton").on('click',function(){ | 328 | $("#saveButton").on('click',function(){ |
| 323 | var params_=getParamsList(); | 329 | var params_=getParamsList(); |
| 324 | - $get('/ylb/checkDate',params_,function(status){ | 330 | + var par={}; |
| 331 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 332 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 333 | + $get('/ylb/checkDate',par,function(status){ | ||
| 325 | if(status=='2'){ | 334 | if(status=='2'){ |
| 326 | layer.msg('只能操作三天内数据.'); | 335 | layer.msg('只能操作三天内数据.'); |
| 327 | }else{ | 336 | }else{ |
| @@ -433,7 +442,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -433,7 +442,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 433 | $("#obtain").on('click', function () { | 442 | $("#obtain").on('click', function () { |
| 434 | if ($("#rq").val() != "") { | 443 | if ($("#rq").val() != "") { |
| 435 | var params=getParamsList(); | 444 | var params=getParamsList(); |
| 436 | - $get('/ylb/checkDate',params,function(status){ | 445 | + var par={}; |
| 446 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 447 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 448 | + $get('/ylb/checkDate',par,function(status){ | ||
| 437 | if(status=='2'){ | 449 | if(status=='2'){ |
| 438 | layer.msg('只能操作三天内数据.'); | 450 | layer.msg('只能操作三天内数据.'); |
| 439 | }else{ | 451 | }else{ |
| @@ -598,7 +610,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -598,7 +610,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 598 | function jsyUpdate(){ | 610 | function jsyUpdate(){ |
| 599 | var params=getParamsList(); | 611 | var params=getParamsList(); |
| 600 | var id = $(this).data('id'); | 612 | var id = $(this).data('id'); |
| 601 | - $get('/ylb/checkDate',params,function(status){ | 613 | + var par={}; |
| 614 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 615 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 616 | + $get('/ylb/checkDate',par,function(status){ | ||
| 602 | if(status=='2'){ | 617 | if(status=='2'){ |
| 603 | layer.msg('只能操作三天内数据.'); | 618 | layer.msg('只能操作三天内数据.'); |
| 604 | }else{ | 619 | }else{ |
| @@ -742,7 +757,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -742,7 +757,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 742 | //删除 | 757 | //删除 |
| 743 | $('#removeButton').on('click', function () { | 758 | $('#removeButton').on('click', function () { |
| 744 | var params_=getParamsList(); | 759 | var params_=getParamsList(); |
| 745 | - $get('/ylb/checkDate',params_,function(status){ | 760 | + var par={}; |
| 761 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 762 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 763 | + $get('/ylb/checkDate',par,function(status){ | ||
| 746 | if(status=='2'){ | 764 | if(status=='2'){ |
| 747 | layer.msg('只能操作三天内数据.'); | 765 | layer.msg('只能操作三天内数据.'); |
| 748 | }else{ | 766 | }else{ |
src/main/resources/static/pages/forms/calc/calcDetailMonthly.html
| 1 | -<style type="text/css"> | ||
| 2 | - .table-bordered { | ||
| 3 | - border: 1px solid; } | ||
| 4 | - .table-bordered > thead > tr > th, | ||
| 5 | - .table-bordered > thead > tr > td, | ||
| 6 | - .table-bordered > tbody > tr > th, | ||
| 7 | - .table-bordered > tbody > tr > td, | ||
| 8 | - .table-bordered > tfoot > tr > th, | ||
| 9 | - .table-bordered > tfoot > tr > td { | ||
| 10 | - border: 1px solid; | ||
| 11 | - text-align: center; } | ||
| 12 | - .table-bordered > thead > tr > th, | ||
| 13 | - .table-bordered > thead > tr > td { | ||
| 14 | - border-bottom-width: 2px; } | ||
| 15 | - | ||
| 16 | - .table > tbody + tbody { | ||
| 17 | - border-top: 1px solid; } | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - #analy_body tr> td >span{ | ||
| 21 | - word-break: keep-all;white-space:nowrap; | ||
| 22 | - } | ||
| 23 | - | ||
| 24 | - #analy_body td{ | ||
| 25 | - min-width: 100px; | ||
| 26 | - max-width: 100px; | ||
| 27 | - width: 100px; | ||
| 28 | - } | ||
| 29 | - | ||
| 30 | - #analy_body{ | ||
| 31 | - margin-top: 20px; | ||
| 32 | - height: 620px; | ||
| 33 | - width: 100% | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | - | ||
| 37 | - .table_head::-webkit-scrollbar { | ||
| 38 | - display:none | ||
| 39 | - } | ||
| 40 | - | ||
| 41 | - .table_head{ | ||
| 42 | - min-width: 906px; | ||
| 43 | - width: 100%; | ||
| 44 | - overflow: hidden; | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - .table_body{ | ||
| 48 | - width:101%; | ||
| 49 | - height:580px; | ||
| 50 | - overflow: auto; | ||
| 51 | - margin-top: -20px; | ||
| 52 | - } | ||
| 53 | -</style> | ||
| 54 | -<div class="page-head"> | ||
| 55 | - <div class="page-title"> | ||
| 56 | - <h1>路单线路明细月报表</h1> | ||
| 57 | - </div> | ||
| 58 | -</div> | ||
| 59 | - | ||
| 60 | -<!--<div class="row">--> | ||
| 61 | -<div class=" row col-md-12 portlet light bordered" style="height:calc(100% - 38px)"> | ||
| 62 | - <div class=""> | ||
| 63 | - <form class="form-inline" > | ||
| 64 | - <!--<div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_daily"> | ||
| 65 | - <span class="item-label" style="width: 80px;">  公司: </span> | ||
| 66 | - <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select> | ||
| 67 | - </div>--> | ||
| 68 | - <div style="display: inline-block; margin-left: 33px;" id="fgsdmDiv_daily"> | ||
| 69 | - <span class="item-label" style="width: 80px;"> 分公司: </span> | ||
| 70 | - <select class="form-control" name="fgsdm" id="fgsdm" style="width: 180px;"></select> | ||
| 71 | - </div> | ||
| 72 | - <!--<div style="display: inline-block;margin-left: 33px;"> | ||
| 73 | - <span class="item-label" style="width: 80px;">  线路: </span> | ||
| 74 | - <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 75 | - </div>--> | ||
| 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> | ||
| 84 | - <div style="display: inline-block;margin-left: 33px;" class="date-picker"> | ||
| 85 | - <span class="item-label" style="width: 80px;">  时间: </span> | ||
| 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"/>--> | ||
| 90 | - </div> | ||
| 91 | - <div style="margin-top: 2px"></div> | ||
| 92 | - | ||
| 93 | - <div style="display: inline-block;margin-left: 33px;"> | ||
| 94 | - <span class="item-label" style="width: 80px;">统计对象: </span> | ||
| 95 | - <select class="form-control" name="statisticalObj" id="statisticalObj" style="width: 180px;"> | ||
| 96 | - <option value="cl">车辆</option> | ||
| 97 | - <option value="jsy">驾驶员</option> | ||
| 98 | - <option value="cwy">乘务员</option> | ||
| 99 | - <option value="xl">线路</option> | ||
| 100 | - </select> | ||
| 101 | - </div> | ||
| 102 | - | ||
| 103 | - <div style="display: inline-block; margin-left: 33px;" > | ||
| 104 | - <span class="item-label" style="width: 80px;">统计项目: </span> | ||
| 105 | - <select class="form-control" name="statisticalItem" id="statisticalItem" style="width: 180px;"> | ||
| 106 | - <option value="yh">油耗</option> | ||
| 107 | - <option value="dh">电耗</option> | ||
| 108 | - <option value="gl">公里</option> | ||
| 109 | - <option value="bc">班次</option> | ||
| 110 | - </select> | ||
| 111 | - </div> | ||
| 112 | - <div style="display: inline-block; margin-left: 33px;" > | ||
| 113 | - <span class="item-label" style="width: 80px;">项目明细: </span> | ||
| 114 | - <select class="form-control" name="itemDetails" id="itemDetails" style="width: 180px;"></select> | ||
| 115 | - </div> | ||
| 116 | - <div class="form-group" style="display: inline-block;margin-left: 62px;"> | ||
| 117 | - <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 118 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 119 | - </div> | ||
| 120 | - </form> | ||
| 121 | - </div> | ||
| 122 | - | ||
| 123 | - <div id="analy_body"> | ||
| 124 | - <div class="table_head" id="table_head"> | ||
| 125 | - <table class="table table-bordered table-hover table-checkable " id="forms_head"> | ||
| 126 | - <thead> | ||
| 127 | - </thead> | ||
| 128 | - </table> | ||
| 129 | - </div> | ||
| 130 | - <div class="table_body" id="table_body"> | ||
| 131 | - <table class="table table-bordered table-hover table-checkable" id="forms_body"> | ||
| 132 | - <tbody> | ||
| 133 | - </tbody> | ||
| 134 | - </table> | ||
| 135 | - </div> | ||
| 136 | - </div> | ||
| 137 | -</div> | ||
| 138 | -<script > | ||
| 139 | - $(function(){ | ||
| 140 | - $('#export').attr('disabled', "true"); | ||
| 141 | - // 关闭左侧栏 | ||
| 142 | - if (!$('body').hasClass('page-sidebar-closed')) | ||
| 143 | - $('.menu-toggler.sidebar-toggler').click(); | ||
| 144 | - | ||
| 145 | - var table_body1 = document.getElementById("table_body"); | ||
| 146 | - table_body1.onscroll = function(){ | ||
| 147 | - var table_body1_left = this.scrollLeft; | ||
| 148 | - document.getElementById("table_head").scrollLeft = table_body1_left; | ||
| 149 | - }; | ||
| 150 | - | ||
| 151 | - var d = new Date(); | ||
| 152 | - d.setTime(d.getTime() - 4*1000*60*60*24);//只能查4天以前的数据 | ||
| 153 | - var year = d.getFullYear(); | ||
| 154 | - var month = d.getMonth() + 1; | ||
| 155 | - var day = d.getDate(); | ||
| 156 | - if(month < 10) | ||
| 157 | - month = "0" + month; | ||
| 158 | - if(day < 10) | ||
| 159 | - day = "0" + day; | ||
| 160 | - //时间 | ||
| 161 | - var dateTime=year + "-" + month + "-" + day; | ||
| 162 | - $("#startDate").val(dateTime); | ||
| 163 | - $("#endDate").val(dateTime); | ||
| 164 | - | ||
| 165 | - $("#endDate").datetimepicker({ | ||
| 166 | - format : 'YYYY-MM-DD', | ||
| 167 | - locale : 'zh-cn', | ||
| 168 | - maxDate : dateTime | ||
| 169 | - }); | ||
| 170 | - $("#startDate").datetimepicker({ | ||
| 171 | - format : 'YYYY-MM-DD', | ||
| 172 | - locale : 'zh-cn', | ||
| 173 | - maxDate : dateTime | ||
| 174 | - }); | ||
| 175 | - | ||
| 176 | - var lineAll=""; | ||
| 177 | - var datas = {}; //查询条件 | ||
| 178 | - | ||
| 179 | - /**用户分配的线路*/ | ||
| 180 | - $.get('/realControAuthority/findByCurrentUser', function (userAuthor) { | ||
| 181 | - lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1); | ||
| 182 | - }); | ||
| 183 | - | ||
| 184 | - var tempData = {}; | ||
| 185 | - | ||
| 186 | - $.get('/user/companyData', function(obj) { | ||
| 187 | - var option = ''; | ||
| 188 | - var allC = ""; | ||
| 189 | - for (var i = 0; i < obj.length; i++) { | ||
| 190 | - if (obj[i].companyCode == "26") { | ||
| 191 | - var children = obj[i].children; | ||
| 192 | - for (var j = 0; j < children.length; j++) { | ||
| 193 | - allC += children[j].code+","; | ||
| 194 | - option += '<option value="' + children[j].code + '">' + children[j].name + '</option>'; | ||
| 195 | - } | ||
| 196 | - } | ||
| 197 | - } | ||
| 198 | - | ||
| 199 | - var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option; | ||
| 200 | - $('#fgsdm').html(options); | ||
| 201 | - }); | ||
| 202 | - | ||
| 203 | - // 项目明细选项列 | ||
| 204 | - // 触发默认选项 | ||
| 205 | - updateItem(); | ||
| 206 | - $("#statisticalItem").on("change",updateItem); | ||
| 207 | - function updateItem() { | ||
| 208 | - var item = $('#statisticalItem').val(); | ||
| 209 | - var options = ''; | ||
| 210 | - if(item == "yh"){ | ||
| 211 | - options += '<option value="jzlAll">加注量[全部]</option>' + | ||
| 212 | - '<option value="jzl0">加注量[0#]</option>'+ | ||
| 213 | - '<option value="jzl-10">加注量[-10#]</option>'+ | ||
| 214 | - '<option value="yhl">油耗量</option>'+ | ||
| 215 | - '<option value="cccy">出场存油</option>'+ | ||
| 216 | - '<option value="jccy">进场存油</option>'+ | ||
| 217 | - '<option value="bglyh">百公里油耗</option>'; | ||
| 218 | - } else if(item == "gl"){ | ||
| 219 | - options += '<option value="zgl">总公里</option>' + | ||
| 220 | - '<option value="jhgl">计划公里</option>'; | ||
| 221 | - /*'<option value="jclm">进场路码</option>'+ | ||
| 222 | - '<option value="cclm">出场路码</option>'*/ | ||
| 223 | - } else if(item == "bc"){ | ||
| 224 | - options += '<option value="sjbc">实际班次</option>' + | ||
| 225 | - '<option value="jhbc">计划班次</option>'; | ||
| 226 | - } else if(item == "dh"){ | ||
| 227 | - options += '<option value="dh">耗电量</option>'; | ||
| 228 | - options += '<option value="cdl">充电量</option>'; | ||
| 229 | - options += '<option value="cccd">出场存电</option>'; | ||
| 230 | - options += '<option value="jccd">进场存电</option>'; | ||
| 231 | - options += '<option value="bgldh">百公里电耗</option>'; | ||
| 232 | - } | ||
| 233 | - $('#itemDetails').html(options); | ||
| 234 | - } | ||
| 235 | - | ||
| 236 | - //线路名称 | ||
| 237 | - var lineName = ''; | ||
| 238 | - $("#query").on("click",function(){ | ||
| 239 | - var gsdm = "26"; | ||
| 240 | - var fgsdm = $("#fgsdm").val(); | ||
| 241 | - var startDate = $("#startDate").val(); | ||
| 242 | - var endDate = $("#endDate").val(); | ||
| 243 | - var statisticalObj = $("#statisticalObj").val(); | ||
| 244 | - //开始和结束时间 | ||
| 245 | - var startTime = Date.parse(new Date(startDate)); | ||
| 246 | - var endTime = Date.parse(new Date(endDate)); | ||
| 247 | - | ||
| 248 | - datas = {}; // 清空之前数据 | ||
| 249 | - datas.gsdm = gsdm; | ||
| 250 | - datas.fgsdm = fgsdm; | ||
| 251 | - datas.lineCode = lineAll; | ||
| 252 | - datas.timeType = "m"; | ||
| 253 | - datas.startDate = startDate; | ||
| 254 | - datas.endDate = endDate; | ||
| 255 | - datas.destroy = $("#destroy").val(); | ||
| 256 | - datas.statisticalObj = $("#statisticalObj").val(); | ||
| 257 | - datas.itemDetails = $("#itemDetails").val(); | ||
| 258 | - var itemDetails = datas.itemDetails, | ||
| 259 | - type = "加注量[全部]"; | ||
| 260 | - if(itemDetails=="jzl0"){ | ||
| 261 | - type = "加注量[0#]" | ||
| 262 | - } else if(itemDetails=="jzl-10"){ | ||
| 263 | - type = "加注量[-10#]" | ||
| 264 | - } else if(itemDetails=="yhl"){ | ||
| 265 | - type = "油耗量" | ||
| 266 | - } else if(itemDetails=="cccy"){ | ||
| 267 | - type = "出场存油" | ||
| 268 | - } else if(itemDetails=="jccy"){ | ||
| 269 | - type = "进场存油" | ||
| 270 | - } else if(itemDetails=="bglyh"){ | ||
| 271 | - type = "百公里油耗" | ||
| 272 | - } else if(itemDetails=="zgl"){ | ||
| 273 | - type = "总公里" | ||
| 274 | - } else if(itemDetails=="jhgl"){ | ||
| 275 | - type = "计划公里" | ||
| 276 | - } else if(itemDetails=="jclm"){ | ||
| 277 | - type = "进场路码" | ||
| 278 | - } else if(itemDetails=="cclm"){ | ||
| 279 | - type = "出场路码" | ||
| 280 | - } else if(itemDetails=="sjbc"){ | ||
| 281 | - type = "实际班次" | ||
| 282 | - } else if(itemDetails=="jhbc"){ | ||
| 283 | - type = "计划班次" | ||
| 284 | - } else if(itemDetails=="dh"){ | ||
| 285 | - type = "耗电量" | ||
| 286 | - } else if(itemDetails=="cdl"){ | ||
| 287 | - type = "充电量" | ||
| 288 | - } else if(itemDetails=="cccd"){ | ||
| 289 | - type = "出场存电" | ||
| 290 | - } else if(itemDetails=="jccd"){ | ||
| 291 | - type = "进场存电" | ||
| 292 | - } else if(itemDetails=="bgldh"){ | ||
| 293 | - type = "百公里电耗" | ||
| 294 | - } | ||
| 295 | - datas.name = datas.startDate+"-"+datas.endDate+"-路单线路明细月报表("+type+")"; | ||
| 296 | - if(startDate==null || startDate =="" ||endDate==null || endDate ==""){ | ||
| 297 | - layer.msg('请选择时间段!'); | ||
| 298 | - }else if(endTime<startTime){ | ||
| 299 | - layer.msg('结束日期不能小于开始日期!'); | ||
| 300 | - }else { | ||
| 301 | - if (endDate.substring(0, 7) != startDate.substring(0, 7)) { | ||
| 302 | - layer.msg("请查询同月份数据!"); | ||
| 303 | - return; | ||
| 304 | - } else { | ||
| 305 | - var lodingI = layer.load(2); | ||
| 306 | - $get('/calcWaybill/calcDetailMonthly', datas, function (rs) { | ||
| 307 | - if (rs.length <=0) { | ||
| 308 | - layer.close(lodingI); | ||
| 309 | - layer.open({ | ||
| 310 | - title: '提示' | ||
| 311 | - , content: '没有您要查询的数据,请重新选择参数!' | ||
| 312 | - }); | ||
| 313 | - $("#export").attr('disabled',"true"); | ||
| 314 | - return; | ||
| 315 | - }else | ||
| 316 | - $("#export").removeAttr("disabled"); | ||
| 317 | - var htmlHead = "<tr><td colspan='"+rs[0].length+"'>"+datas.name+"</td></tr>", htmlBody = ""; | ||
| 318 | - var rsLength = rs.length; | ||
| 319 | - rs.forEach(function (o, i) { | ||
| 320 | - var html = "<tr>" | ||
| 321 | - o.forEach(function (td, j) { | ||
| 322 | - var colspan; | ||
| 323 | - if (i == rsLength - 1 && j == 0) { | ||
| 324 | - colspan = (statisticalObj == "xl" ? "colspan='3'" : "colspan='5'"); | ||
| 325 | - if(statisticalObj == "cl") | ||
| 326 | - colspan = "colspan='6'"; | ||
| 327 | - } | ||
| 328 | - html += "<td " + colspan + ">" + td + "</td>" | ||
| 329 | - }); | ||
| 330 | - html += "</tr>" | ||
| 331 | - if (i == 0) { | ||
| 332 | - htmlHead += html; | ||
| 333 | - } else | ||
| 334 | - htmlBody += html; | ||
| 335 | - }); | ||
| 336 | - $('#forms_head thead').html(htmlHead); | ||
| 337 | - $('#forms_body tbody').html(htmlBody); | ||
| 338 | - layer.close(lodingI); | ||
| 339 | - }); | ||
| 340 | - } | ||
| 341 | - } | ||
| 342 | - }); | ||
| 343 | - | ||
| 344 | - $("#export").on("click",function(){ | ||
| 345 | - $post("/report/calcDetailMonthlyE",datas,function(result){ | ||
| 346 | - window.open("/downloadFile/download?fileName="+datas.name); | ||
| 347 | - }); | ||
| 348 | - }); | ||
| 349 | - }); | ||
| 350 | -</script> | ||
| 351 | -<!--<script type="application/javascript" src="/pages/forms/calc/calcDetailMonthly.js"></script>--> | 1 | +<style type="text/css"> |
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; | ||
| 11 | + text-align: center; } | ||
| 12 | + .table-bordered > thead > tr > th, | ||
| 13 | + .table-bordered > thead > tr > td { | ||
| 14 | + border-bottom-width: 2px; } | ||
| 15 | + | ||
| 16 | + .table > tbody + tbody { | ||
| 17 | + border-top: 1px solid; } | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + #analy_body tr> td >span{ | ||
| 21 | + word-break: keep-all;white-space:nowrap; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + #analy_body td{ | ||
| 25 | + min-width: 100px; | ||
| 26 | + max-width: 100px; | ||
| 27 | + width: 100px; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + #analy_body{ | ||
| 31 | + margin-top: 20px; | ||
| 32 | + height: 620px; | ||
| 33 | + width: 100% | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + .table_head::-webkit-scrollbar { | ||
| 38 | + display:none | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + .table_head{ | ||
| 42 | + min-width: 906px; | ||
| 43 | + width: 100%; | ||
| 44 | + overflow: hidden; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + .table_body{ | ||
| 48 | + width:101%; | ||
| 49 | + height:580px; | ||
| 50 | + overflow: auto; | ||
| 51 | + margin-top: -20px; | ||
| 52 | + } | ||
| 53 | +</style> | ||
| 54 | +<div class="page-head"> | ||
| 55 | + <div class="page-title"> | ||
| 56 | + <h1>路单线路明细月报表</h1> | ||
| 57 | + </div> | ||
| 58 | +</div> | ||
| 59 | + | ||
| 60 | +<!--<div class="row">--> | ||
| 61 | +<div class=" row col-md-12 portlet light bordered" style="height:calc(100% - 38px)"> | ||
| 62 | + <div class=""> | ||
| 63 | + <form class="form-inline" > | ||
| 64 | + <div style="display: inline-block; margin-left: 13px;" id="gsdmDiv_daily"> | ||
| 65 | + <span class="item-label" style="width: 80px;">  公司: </span> | ||
| 66 | + <select class="form-control" name="company" id="gsdm" style="width: 150px;"></select> | ||
| 67 | + </div> | ||
| 68 | + <div style="display: inline-block; margin-left: 13px;" id="fgsdmDiv_daily"> | ||
| 69 | + <span class="item-label" style="width: 80px;"> 分公司: </span> | ||
| 70 | + <select class="form-control" name="fgsdm" id="fgsdm" style="width: 150px;"></select> | ||
| 71 | + </div> | ||
| 72 | + <!--<div style="display: inline-block;margin-left: 33px;"> | ||
| 73 | + <span class="item-label" style="width: 80px;">  线路: </span> | ||
| 74 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 75 | + </div>--> | ||
| 76 | + <div style="display: inline-block;margin-left: 13px;" class="date-picker"> | ||
| 77 | + <span class="item-label" style="width: 80px;">  时间: </span> | ||
| 78 | + <input class="form-control" type="text" id="startDate" style="width: 150px;" /> - | ||
| 79 | + <input class="form-control" type="text" id="endDate" style="width: 150px;" /> | ||
| 80 | + <!--<input class="form-control" type="text" id="startDate" style="width: 180px;" value="2020-10-01"/> - --> | ||
| 81 | + <!--<input class="form-control" type="text" id="endDate" style="width: 180px;" value="2020-10-10"/>--> | ||
| 82 | + </div> | ||
| 83 | + | ||
| 84 | + <div style="margin-top: 2px"></div> | ||
| 85 | + | ||
| 86 | + <div style="display: inline-block; margin-left: 13px;"> | ||
| 87 | + <span class="item-label" style="width: 80px;">线路性质: </span> | ||
| 88 | + <select class="form-control" name="destroy" id="destroy" style="width: 150px;"> | ||
| 89 | + <option value="0,1">全部线路</option> | ||
| 90 | + <option value="0">营运线路</option> | ||
| 91 | + <option value="1">非营运线路</option> | ||
| 92 | + </select> | ||
| 93 | + </div> | ||
| 94 | + <div style="display: inline-block;margin-left: 13px;"> | ||
| 95 | + <span class="item-label" style="width: 80px;">统计对象: </span> | ||
| 96 | + <select class="form-control" name="statisticalObj" id="statisticalObj" style="width: 150px;"> | ||
| 97 | + <option value="cl">车辆</option> | ||
| 98 | + <option value="jsy">驾驶员</option> | ||
| 99 | + <option value="cwy">乘务员</option> | ||
| 100 | + <option value="xl">线路</option> | ||
| 101 | + </select> | ||
| 102 | + </div> | ||
| 103 | + | ||
| 104 | + <div style="display: inline-block; margin-left: 13px;" > | ||
| 105 | + <span class="item-label" style="width: 80px;">统计项目: </span> | ||
| 106 | + <select class="form-control" name="statisticalItem" id="statisticalItem" style="width: 150px;"> | ||
| 107 | + <option value="yh">油耗</option> | ||
| 108 | + <option value="dh">电耗</option> | ||
| 109 | + <option value="gl">公里</option> | ||
| 110 | + <option value="bc">班次</option> | ||
| 111 | + </select> | ||
| 112 | + </div> | ||
| 113 | + <div style="display: inline-block; margin-left: 13px;" > | ||
| 114 | + <span class="item-label" style="width: 80px;">项目明细: </span> | ||
| 115 | + <select class="form-control" name="itemDetails" id="itemDetails" style="width: 150px;"></select> | ||
| 116 | + </div> | ||
| 117 | + <div class="form-group" style="display: inline-block;margin-left: 22px;"> | ||
| 118 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 119 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 120 | + </div> | ||
| 121 | + </form> | ||
| 122 | + </div> | ||
| 123 | + | ||
| 124 | + <div id="analy_body"> | ||
| 125 | + <div class="table_head" id="table_head"> | ||
| 126 | + <table class="table table-bordered table-hover table-checkable " id="forms_head"> | ||
| 127 | + <thead> | ||
| 128 | + </thead> | ||
| 129 | + </table> | ||
| 130 | + </div> | ||
| 131 | + <div class="table_body" id="table_body"> | ||
| 132 | + <table class="table table-bordered table-hover table-checkable" id="forms_body" style="background-color: white;"> | ||
| 133 | + <tbody> | ||
| 134 | + </tbody> | ||
| 135 | + </table> | ||
| 136 | + </div> | ||
| 137 | + </div> | ||
| 138 | +</div> | ||
| 139 | +<script > | ||
| 140 | + $(function(){ | ||
| 141 | + $('#export').attr('disabled', "true"); | ||
| 142 | + // 关闭左侧栏 | ||
| 143 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 144 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 145 | + | ||
| 146 | + var table_body1 = document.getElementById("table_body"); | ||
| 147 | + table_body1.onscroll = function(){ | ||
| 148 | + var table_body1_left = this.scrollLeft; | ||
| 149 | + document.getElementById("table_head").scrollLeft = table_body1_left; | ||
| 150 | + }; | ||
| 151 | + | ||
| 152 | + var d = new Date(); | ||
| 153 | + d.setTime(d.getTime() - 4*1000*60*60*24);//只能查4天以前的数据 | ||
| 154 | + var year = d.getFullYear(); | ||
| 155 | + var month = d.getMonth() + 1; | ||
| 156 | + var day = d.getDate(); | ||
| 157 | + if(month < 10) | ||
| 158 | + month = "0" + month; | ||
| 159 | + if(day < 10) | ||
| 160 | + day = "0" + day; | ||
| 161 | + //时间 | ||
| 162 | + var dateTime=year + "-" + month + "-" + day; | ||
| 163 | + $("#startDate").val(dateTime); | ||
| 164 | + $("#endDate").val(dateTime); | ||
| 165 | + | ||
| 166 | + $("#endDate").datetimepicker({ | ||
| 167 | + format : 'YYYY-MM-DD', | ||
| 168 | + locale : 'zh-cn', | ||
| 169 | + maxDate : dateTime | ||
| 170 | + }); | ||
| 171 | + $("#startDate").datetimepicker({ | ||
| 172 | + format : 'YYYY-MM-DD', | ||
| 173 | + locale : 'zh-cn', | ||
| 174 | + maxDate : dateTime | ||
| 175 | + }); | ||
| 176 | + | ||
| 177 | + var lineAll=""; | ||
| 178 | + var datas = {}; //查询条件 | ||
| 179 | + | ||
| 180 | + /**用户分配的线路*/ | ||
| 181 | + $.get('/realControAuthority/findByCurrentUser', function (userAuthor) { | ||
| 182 | + lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1); | ||
| 183 | + }); | ||
| 184 | + | ||
| 185 | + var tempData = {}; | ||
| 186 | + | ||
| 187 | + $.get('/user/companyData', function(result){ | ||
| 188 | + var obj = result; | ||
| 189 | + var options = ''; | ||
| 190 | + for(var i = 0; i < obj.length; i++){ | ||
| 191 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + if(obj.length ==0){ | ||
| 195 | + $("#gsdmDiv_daily").css('display','none'); | ||
| 196 | + }else if(obj.length ==1){ | ||
| 197 | + $("#gsdmDiv_daily").css('display','none'); | ||
| 198 | + if(obj[0].children.length == 1 || obj[0].children.length == 0){ | ||
| 199 | + fage=false; | ||
| 200 | + $('#gsdmDiv_daily').css('display','none'); | ||
| 201 | + } | ||
| 202 | + } | ||
| 203 | + $('#gsdm').html(options); | ||
| 204 | + updateCompany(); | ||
| 205 | + }); | ||
| 206 | + $("#gsdm").on("change",updateCompany); | ||
| 207 | + | ||
| 208 | + function updateCompany(){ | ||
| 209 | + var company = $('#gsdm').val(); | ||
| 210 | + $.get('/user/companyData', function(obj) { | ||
| 211 | + var option = ''; | ||
| 212 | + var allC = ""; | ||
| 213 | + for (var i = 0; i < obj.length; i++) { | ||
| 214 | + if (obj[i].companyCode == company) { | ||
| 215 | + var children = obj[i].children; | ||
| 216 | + for (var j = 0; j < children.length; j++) { | ||
| 217 | + allC += children[j].code+","; | ||
| 218 | + option += '<option value="' + children[j].code + '">' + children[j].name + '</option>'; | ||
| 219 | + } | ||
| 220 | + } | ||
| 221 | + } | ||
| 222 | + | ||
| 223 | + var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option; | ||
| 224 | + $('#fgsdm').html(options); | ||
| 225 | + }); | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + // 项目明细选项列 | ||
| 229 | + // 触发默认选项 | ||
| 230 | + updateItem(); | ||
| 231 | + $("#statisticalItem").on("change",updateItem); | ||
| 232 | + function updateItem() { | ||
| 233 | + var item = $('#statisticalItem').val(); | ||
| 234 | + var options = ''; | ||
| 235 | + if(item == "yh"){ | ||
| 236 | + options += '<option value="jzlAll">加注量[全部]</option>' + | ||
| 237 | + '<option value="jzl0">加注量[0#]</option>'+ | ||
| 238 | + '<option value="jzl-10">加注量[-10#]</option>'+ | ||
| 239 | + '<option value="yhl">油耗量</option>'+ | ||
| 240 | + '<option value="cccy">出场存油</option>'+ | ||
| 241 | + '<option value="jccy">进场存油</option>'+ | ||
| 242 | + '<option value="bglyh">百公里油耗</option>'; | ||
| 243 | + } else if(item == "gl"){ | ||
| 244 | + options += '<option value="zgl">总公里</option>' + | ||
| 245 | + '<option value="jhgl">计划公里</option>'; | ||
| 246 | + /*'<option value="jclm">进场路码</option>'+ | ||
| 247 | + '<option value="cclm">出场路码</option>'*/ | ||
| 248 | + } else if(item == "bc"){ | ||
| 249 | + options += '<option value="sjbc">实际班次</option>' + | ||
| 250 | + '<option value="jhbc">计划班次</option>'; | ||
| 251 | + } else if(item == "dh"){ | ||
| 252 | + options += '<option value="dh">耗电量</option>'; | ||
| 253 | + options += '<option value="cdl">充电量</option>'; | ||
| 254 | + options += '<option value="cccd">出场存电</option>'; | ||
| 255 | + options += '<option value="jccd">进场存电</option>'; | ||
| 256 | + options += '<option value="bgldh">百公里电耗</option>'; | ||
| 257 | + } | ||
| 258 | + $('#itemDetails').html(options); | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + //线路名称 | ||
| 262 | + var lineName = ''; | ||
| 263 | + $("#query").on("click",function(){ | ||
| 264 | + var gsdm = $("#gsdm").val(); | ||
| 265 | + var fgsdm = $("#fgsdm").val(); | ||
| 266 | + var startDate = $("#startDate").val(); | ||
| 267 | + var endDate = $("#endDate").val(); | ||
| 268 | + var statisticalObj = $("#statisticalObj").val(); | ||
| 269 | + //开始和结束时间 | ||
| 270 | + var startTime = Date.parse(new Date(startDate)); | ||
| 271 | + var endTime = Date.parse(new Date(endDate)); | ||
| 272 | + | ||
| 273 | + datas = {}; // 清空之前数据 | ||
| 274 | + datas.gsdm = gsdm; | ||
| 275 | + datas.fgsdm = fgsdm; | ||
| 276 | + datas.lineCode = lineAll; | ||
| 277 | + datas.timeType = "m"; | ||
| 278 | + datas.startDate = startDate; | ||
| 279 | + datas.endDate = endDate; | ||
| 280 | + datas.destroy = $("#destroy").val(); | ||
| 281 | + datas.statisticalObj = $("#statisticalObj").val(); | ||
| 282 | + datas.itemDetails = $("#itemDetails").val(); | ||
| 283 | + var itemDetails = datas.itemDetails, | ||
| 284 | + type = "加注量[全部]"; | ||
| 285 | + if(itemDetails=="jzl0"){ | ||
| 286 | + type = "加注量[0#]" | ||
| 287 | + } else if(itemDetails=="jzl-10"){ | ||
| 288 | + type = "加注量[-10#]" | ||
| 289 | + } else if(itemDetails=="yhl"){ | ||
| 290 | + type = "油耗量" | ||
| 291 | + } else if(itemDetails=="cccy"){ | ||
| 292 | + type = "出场存油" | ||
| 293 | + } else if(itemDetails=="jccy"){ | ||
| 294 | + type = "进场存油" | ||
| 295 | + } else if(itemDetails=="bglyh"){ | ||
| 296 | + type = "百公里油耗" | ||
| 297 | + } else if(itemDetails=="zgl"){ | ||
| 298 | + type = "总公里" | ||
| 299 | + } else if(itemDetails=="jhgl"){ | ||
| 300 | + type = "计划公里" | ||
| 301 | + } else if(itemDetails=="jclm"){ | ||
| 302 | + type = "进场路码" | ||
| 303 | + } else if(itemDetails=="cclm"){ | ||
| 304 | + type = "出场路码" | ||
| 305 | + } else if(itemDetails=="sjbc"){ | ||
| 306 | + type = "实际班次" | ||
| 307 | + } else if(itemDetails=="jhbc"){ | ||
| 308 | + type = "计划班次" | ||
| 309 | + } else if(itemDetails=="dh"){ | ||
| 310 | + type = "耗电量" | ||
| 311 | + } else if(itemDetails=="cdl"){ | ||
| 312 | + type = "充电量" | ||
| 313 | + } else if(itemDetails=="cccd"){ | ||
| 314 | + type = "出场存电" | ||
| 315 | + } else if(itemDetails=="jccd"){ | ||
| 316 | + type = "进场存电" | ||
| 317 | + } else if(itemDetails=="bgldh"){ | ||
| 318 | + type = "百公里电耗" | ||
| 319 | + } | ||
| 320 | + datas.name = datas.startDate+"-"+datas.endDate+"-路单线路明细月报表("+type+")"; | ||
| 321 | + if(startDate==null || startDate =="" ||endDate==null || endDate ==""){ | ||
| 322 | + layer.msg('请选择时间段!'); | ||
| 323 | + }else if(endTime<startTime){ | ||
| 324 | + layer.msg('结束日期不能小于开始日期!'); | ||
| 325 | + }else { | ||
| 326 | + if (endDate.substring(0, 7) != startDate.substring(0, 7)) { | ||
| 327 | + layer.msg("请查询同月份数据!"); | ||
| 328 | + return; | ||
| 329 | + } else { | ||
| 330 | + var lodingI = layer.load(2); | ||
| 331 | + $get('/calcWaybill/calcDetailMonthly', datas, function (rs) { | ||
| 332 | + if (rs.length <=0) { | ||
| 333 | + layer.close(lodingI); | ||
| 334 | + layer.open({ | ||
| 335 | + title: '提示' | ||
| 336 | + , content: '没有您要查询的数据,请重新选择参数!' | ||
| 337 | + }); | ||
| 338 | + $("#export").attr('disabled',"true"); | ||
| 339 | + return; | ||
| 340 | + }else | ||
| 341 | + $("#export").removeAttr("disabled"); | ||
| 342 | + var htmlHead = "<tr><td colspan='"+rs[0].length+"'>"+datas.name+"</td></tr>", htmlBody = ""; | ||
| 343 | + var rsLength = rs.length; | ||
| 344 | + rs.forEach(function (o, i) { | ||
| 345 | + var html = "<tr>" | ||
| 346 | + o.forEach(function (td, j) { | ||
| 347 | + var colspan; | ||
| 348 | + if (i == rsLength - 1 && j == 0) { | ||
| 349 | + colspan = (statisticalObj == "xl" ? "colspan='3'" : "colspan='5'"); | ||
| 350 | + if(statisticalObj == "cl") | ||
| 351 | + colspan = "colspan='6'"; | ||
| 352 | + } | ||
| 353 | + html += "<td " + colspan + ">" + td + "</td>" | ||
| 354 | + }); | ||
| 355 | + html += "</tr>" | ||
| 356 | + if (i == 0) { | ||
| 357 | + htmlHead += html; | ||
| 358 | + } else | ||
| 359 | + htmlBody += html; | ||
| 360 | + }); | ||
| 361 | + $('#forms_head thead').html(htmlHead); | ||
| 362 | + $('#forms_body tbody').html(htmlBody); | ||
| 363 | + layer.close(lodingI); | ||
| 364 | + }); | ||
| 365 | + } | ||
| 366 | + } | ||
| 367 | + }); | ||
| 368 | + | ||
| 369 | + $("#export").on("click",function(){ | ||
| 370 | + $post("/report/calcDetailMonthlyE",datas,function(result){ | ||
| 371 | + window.open("/downloadFile/download?fileName="+datas.name); | ||
| 372 | + }); | ||
| 373 | + }); | ||
| 374 | + }); | ||
| 375 | +</script> | ||
| 376 | +<!--<script type="application/javascript" src="/pages/forms/calc/calcDetailMonthly.js"></script>--> |
src/main/resources/static/pages/forms/calc/calcDetailYear.html
| 1 | -<style type="text/css"> | ||
| 2 | - .table-bordered { | ||
| 3 | - border: 1px solid; } | ||
| 4 | - .table-bordered > thead > tr > th, | ||
| 5 | - .table-bordered > thead > tr > td, | ||
| 6 | - .table-bordered > tbody > tr > th, | ||
| 7 | - .table-bordered > tbody > tr > td, | ||
| 8 | - .table-bordered > tfoot > tr > th, | ||
| 9 | - .table-bordered > tfoot > tr > td { | ||
| 10 | - border: 1px solid; | ||
| 11 | - text-align: center; } | ||
| 12 | - .table-bordered > thead > tr > th, | ||
| 13 | - .table-bordered > thead > tr > td { | ||
| 14 | - border-bottom-width: 2px; } | ||
| 15 | - | ||
| 16 | - .table > tbody + tbody { | ||
| 17 | - border-top: 1px solid; } | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - #analy_body tr> td >span{ | ||
| 21 | - word-break: keep-all;white-space:nowrap; | ||
| 22 | - } | ||
| 23 | - | ||
| 24 | - #analy_body td{ | ||
| 25 | - min-width: 100px; | ||
| 26 | - max-width: 100px; | ||
| 27 | - width: 100px; | ||
| 28 | - } | ||
| 29 | - | ||
| 30 | - #analy_body{ | ||
| 31 | - margin-top: 20px; | ||
| 32 | - height: 620px; | ||
| 33 | - width: 100% | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | - | ||
| 37 | - .table_head::-webkit-scrollbar { | ||
| 38 | - display:none | ||
| 39 | - } | ||
| 40 | - | ||
| 41 | - .table_head{ | ||
| 42 | - min-width: 906px; | ||
| 43 | - width: 100%; | ||
| 44 | - overflow: hidden; | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - .table_body{ | ||
| 48 | - width:101%; | ||
| 49 | - height:580px; | ||
| 50 | - overflow: auto; | ||
| 51 | - margin-top: -20px; | ||
| 52 | - } | ||
| 53 | -</style> | ||
| 54 | -<div class="page-head"> | ||
| 55 | - <div class="page-title"> | ||
| 56 | - <h1>路单线路明细年报表</h1> | ||
| 57 | - </div> | ||
| 58 | -</div> | ||
| 59 | - | ||
| 60 | -<!--<div class="row">--> | ||
| 61 | -<div class=" row col-md-12 portlet light bordered" style="height:calc(100% - 38px)"> | ||
| 62 | - <div class=""> | ||
| 63 | - <form class="form-inline" > | ||
| 64 | - <!--<div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_daily"> | ||
| 65 | - <span class="item-label" style="width: 80px;">  公司: </span> | ||
| 66 | - <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select> | ||
| 67 | - </div>--> | ||
| 68 | - <div style="display: inline-block; margin-left: 33px;" id="fgsdmDiv_daily"> | ||
| 69 | - <span class="item-label" style="width: 80px;"> 分公司: </span> | ||
| 70 | - <select class="form-control" name="fgsdm" id="fgsdm" style="width: 180px;"></select> | ||
| 71 | - </div> | ||
| 72 | - <!--<div style="display: inline-block;margin-left: 33px;"> | ||
| 73 | - <span class="item-label" style="width: 80px;">  线路: </span> | ||
| 74 | - <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 75 | - </div>--> | ||
| 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> | ||
| 84 | - <div style="display: inline-block;margin-left: 33px;" class="date-picker"> | ||
| 85 | - <span class="item-label" style="width: 80px;">  时间: </span> | ||
| 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"/> - --> | ||
| 89 | - <!--<input class="form-control" type="text" id="endDate" style="width: 180px;" value="2020-10"/>--> | ||
| 90 | - </div> | ||
| 91 | - | ||
| 92 | - <div style="margin-top: 2px"></div> | ||
| 93 | - | ||
| 94 | - <div style="display: inline-block;margin-left: 33px;"> | ||
| 95 | - <span class="item-label" style="width: 80px;">统计对象: </span> | ||
| 96 | - <select class="form-control" name="statisticalObj" id="statisticalObj" style="width: 180px;"> | ||
| 97 | - <option value="cl">车辆</option> | ||
| 98 | - <option value="jsy">驾驶员</option> | ||
| 99 | - <option value="cwy">乘务员</option> | ||
| 100 | - <option value="xl">线路</option> | ||
| 101 | - </select> | ||
| 102 | - </div> | ||
| 103 | - | ||
| 104 | - <div style="display: inline-block; margin-left: 33px;" > | ||
| 105 | - <span class="item-label" style="width: 80px;">统计项目: </span> | ||
| 106 | - <select class="form-control" name="statisticalItem" id="statisticalItem" style="width: 180px;"> | ||
| 107 | - <option value="yh">油耗</option> | ||
| 108 | - <option value="dh">电耗</option> | ||
| 109 | - <option value="gl">公里</option> | ||
| 110 | - <option value="bc">班次</option> | ||
| 111 | - </select> | ||
| 112 | - </div> | ||
| 113 | - <div style="display: inline-block; margin-left: 33px;" > | ||
| 114 | - <span class="item-label" style="width: 80px;">项目明细: </span> | ||
| 115 | - <select class="form-control" name="itemDetails" id="itemDetails" style="width: 180px;"></select> | ||
| 116 | - </div> | ||
| 117 | - <div class="form-group" style="display: inline-block;margin-left: 62px;"> | ||
| 118 | - <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 119 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 120 | - </div> | ||
| 121 | - </form> | ||
| 122 | - </div> | ||
| 123 | - | ||
| 124 | - <div id="analy_body"> | ||
| 125 | - <div class="table_head" id="table_head"> | ||
| 126 | - <table class="table table-bordered table-hover table-checkable " id="forms_head"> | ||
| 127 | - <thead> | ||
| 128 | - </thead> | ||
| 129 | - </table> | ||
| 130 | - </div> | ||
| 131 | - <div class="table_body" id="table_body"> | ||
| 132 | - <table class="table table-bordered table-hover table-checkable" id="forms_body"> | ||
| 133 | - <tbody> | ||
| 134 | - </tbody> | ||
| 135 | - </table> | ||
| 136 | - </div> | ||
| 137 | - </div> | ||
| 138 | -</div> | ||
| 139 | -<script > | ||
| 140 | - $(function(){ | ||
| 141 | - $('#export').attr('disabled', "true"); | ||
| 142 | - // 关闭左侧栏 | ||
| 143 | - if (!$('body').hasClass('page-sidebar-closed')) | ||
| 144 | - $('.menu-toggler.sidebar-toggler').click(); | ||
| 145 | - | ||
| 146 | - var table_body1 = document.getElementById("table_body"); | ||
| 147 | - table_body1.onscroll = function(){ | ||
| 148 | - var table_body1_left = this.scrollLeft; | ||
| 149 | - document.getElementById("table_head").scrollLeft = table_body1_left; | ||
| 150 | - }; | ||
| 151 | - | ||
| 152 | - var d = new Date(); | ||
| 153 | - var year = d.getFullYear(); | ||
| 154 | - var month = d.getMonth() + 1; | ||
| 155 | - if(month < 10) | ||
| 156 | - month = "0" + month; | ||
| 157 | - //时间 | ||
| 158 | - var dateTime=year + "-" + month; | ||
| 159 | - $("#startDate").val(dateTime); | ||
| 160 | - $("#endDate").val(dateTime); | ||
| 161 | - | ||
| 162 | - $("#endDate").datetimepicker({ | ||
| 163 | - format : 'YYYY-MM', | ||
| 164 | - locale : 'zh-cn', | ||
| 165 | - maxDate : dateTime | ||
| 166 | - }); | ||
| 167 | - $("#startDate").datetimepicker({ | ||
| 168 | - format : 'YYYY-MM', | ||
| 169 | - locale : 'zh-cn', | ||
| 170 | - maxDate : dateTime | ||
| 171 | - }); | ||
| 172 | - | ||
| 173 | - | ||
| 174 | - var lineAll="",lineNoD="",lineD=""; | ||
| 175 | - var datas = {}; //查询条件 | ||
| 176 | - | ||
| 177 | - | ||
| 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 | - });*/ | ||
| 187 | - }); | ||
| 188 | - | ||
| 189 | - var tempData = {}; | ||
| 190 | - | ||
| 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") { | ||
| 196 | - var children = obj[i].children; | ||
| 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>'; | ||
| 200 | - } | ||
| 201 | - } | ||
| 202 | - } | ||
| 203 | - | ||
| 204 | - var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option; | ||
| 205 | - $('#fgsdm').html(options); | ||
| 206 | - }); | ||
| 207 | - | ||
| 208 | - // 项目明细选项列 | ||
| 209 | - // 触发默认选项 | ||
| 210 | - updateItem(); | ||
| 211 | - $("#statisticalItem").on("change",updateItem); | ||
| 212 | - var item =""; | ||
| 213 | - function updateItem() { | ||
| 214 | - item = $('#statisticalItem').val(); | ||
| 215 | - var options = ''; | ||
| 216 | - if(item == "yh"){ | ||
| 217 | - options += '<option value="jzlAll">加注量[全部]</option>' + | ||
| 218 | - '<option value="jzl0">加注量[0#]</option>'+ | ||
| 219 | - '<option value="jzl-10">加注量[-10#]</option>'+ | ||
| 220 | - '<option value="yhl">油耗量</option>'+ | ||
| 221 | - '<option value="cccy">出场存油</option>'+ | ||
| 222 | - '<option value="jccy">进场存油</option>'+ | ||
| 223 | - '<option value="bglyh">百公里油耗</option>'; | ||
| 224 | - } else if(item == "gl"){ | ||
| 225 | - options += '<option value="zgl">总公里</option>' + | ||
| 226 | - '<option value="jhgl">计划公里</option>'; | ||
| 227 | - /*'<option value="jclm">进场路码</option>'+ | ||
| 228 | - '<option value="cclm">出场路码</option>'*/ | ||
| 229 | - } else if(item == "bc"){ | ||
| 230 | - options += '<option value="sjbc">实际班次</option>' + | ||
| 231 | - '<option value="jhbc">计划班次</option>'; | ||
| 232 | - } else if(item == "dh"){ | ||
| 233 | - options += '<option value="dh">耗电量</option>'; | ||
| 234 | - options += '<option value="cdl">充电量</option>'; | ||
| 235 | - options += '<option value="cccd">出场存电</option>'; | ||
| 236 | - options += '<option value="jccd">进场存电</option>'; | ||
| 237 | - options += '<option value="bgldh">百公里电耗</option>'; | ||
| 238 | - } | ||
| 239 | - $('#itemDetails').html(options); | ||
| 240 | - } | ||
| 241 | - | ||
| 242 | - //线路名称 | ||
| 243 | - var lineName = ''; | ||
| 244 | - $("#query").on("click",function(){ | ||
| 245 | - var gsdm = "26"; | ||
| 246 | - var fgsdm = $("#fgsdm").val(); | ||
| 247 | - var startDate = $("#startDate").val(); | ||
| 248 | - var endDate = $("#endDate").val(); | ||
| 249 | - var statisticalObj = $("#statisticalObj").val(); | ||
| 250 | - //开始和结束时间 | ||
| 251 | - var startTime = Date.parse(new Date(startDate)); | ||
| 252 | - var endTime = Date.parse(new Date(endDate)); | ||
| 253 | - | ||
| 254 | - datas = {}; // 清空之前数据 | ||
| 255 | - datas.timeType = "y"; | ||
| 256 | - datas.gsdm = gsdm; | ||
| 257 | - datas.fgsdm = fgsdm; | ||
| 258 | - datas.lineCode = lineAll; | ||
| 259 | - datas.startDate = startDate; | ||
| 260 | - datas.endDate = endDate; | ||
| 261 | - datas.destroy = $("#destroy").val(); | ||
| 262 | - datas.statisticalObj = $("#statisticalObj").val(); | ||
| 263 | - datas.itemDetails = $("#itemDetails").val(); | ||
| 264 | - datas.item = item; | ||
| 265 | - | ||
| 266 | - var itemDetails = datas.itemDetails, | ||
| 267 | - type = "加注量[全部]"; | ||
| 268 | - if(itemDetails=="jzl0"){ | ||
| 269 | - type = "加注量[0#]" | ||
| 270 | - } else if(itemDetails=="jzl-10"){ | ||
| 271 | - type = "加注量[-10#]" | ||
| 272 | - } else if(itemDetails=="yhl"){ | ||
| 273 | - type = "油耗量" | ||
| 274 | - } else if(itemDetails=="cccy"){ | ||
| 275 | - type = "出场存油" | ||
| 276 | - } else if(itemDetails=="jccy"){ | ||
| 277 | - type = "进场存油" | ||
| 278 | - } else if(itemDetails=="bglyh"){ | ||
| 279 | - type = "百公里油耗" | ||
| 280 | - } else if(itemDetails=="zgl"){ | ||
| 281 | - type = "总公里" | ||
| 282 | - } else if(itemDetails=="jhgl"){ | ||
| 283 | - type = "计划公里" | ||
| 284 | - } else if(itemDetails=="jclm"){ | ||
| 285 | - type = "进场路码" | ||
| 286 | - } else if(itemDetails=="cclm"){ | ||
| 287 | - type = "出场路码" | ||
| 288 | - } else if(itemDetails=="sjbc"){ | ||
| 289 | - type = "实际班次" | ||
| 290 | - } else if(itemDetails=="jhbc"){ | ||
| 291 | - type = "计划班次" | ||
| 292 | - } else if(itemDetails=="dh"){ | ||
| 293 | - type = "耗电量" | ||
| 294 | - } else if(itemDetails=="cdl"){ | ||
| 295 | - type = "充电量" | ||
| 296 | - } else if(itemDetails=="cccd"){ | ||
| 297 | - type = "出场存电" | ||
| 298 | - } else if(itemDetails=="jccd"){ | ||
| 299 | - type = "进场存电" | ||
| 300 | - } else if(itemDetails=="bgldh"){ | ||
| 301 | - type = "百公里电耗" | ||
| 302 | - } | ||
| 303 | - datas.name = datas.startDate+"-"+datas.endDate+"-路单线路明细年报表("+type+")"; | ||
| 304 | - if(startDate==null || startDate =="" ||endDate==null || endDate ==""){ | ||
| 305 | - layer.msg('请选择时间段!'); | ||
| 306 | - }else if(endTime<startTime){ | ||
| 307 | - layer.msg('结束日期不能小于开始日期!'); | ||
| 308 | - }else { | ||
| 309 | - if (endDate.substring(0, 4) != startDate.substring(0, 4)) { | ||
| 310 | - layer.msg("请查询同年份数据!"); | ||
| 311 | - return; | ||
| 312 | - } else { | ||
| 313 | - var lodingI = layer.load(2); | ||
| 314 | - $get('/calcWaybill/calcDetailMonthly', datas, function (rs) { | ||
| 315 | - if (rs.length <=0) { | ||
| 316 | - layer.close(lodingI); | ||
| 317 | - layer.open({ | ||
| 318 | - title: '提示' | ||
| 319 | - , content: '没有您要查询的数据,请重新选择参数!' | ||
| 320 | - }); | ||
| 321 | - $("#export").attr('disabled',"true"); | ||
| 322 | - return; | ||
| 323 | - }else | ||
| 324 | - $("#export").removeAttr("disabled"); | ||
| 325 | - var htmlHead = "<tr><td colspan='"+rs[0].length+"'>"+datas.name+"</td></tr>", htmlBody = ""; | ||
| 326 | - var rsLength = rs.length; | ||
| 327 | - rs.forEach(function (o, i) { | ||
| 328 | - var html = "<tr>" | ||
| 329 | - o.forEach(function (td, j) { | ||
| 330 | - var colspan; | ||
| 331 | - if (i == rsLength - 1 && j == 0) { | ||
| 332 | - colspan = (statisticalObj == "xl" ? "colspan='3'" : "colspan='5'"); | ||
| 333 | - if(statisticalObj == "cl") | ||
| 334 | - colspan = "colspan='6'"; | ||
| 335 | - } | ||
| 336 | - html += "<td " + colspan + ">" + td + "</td>" | ||
| 337 | - }); | ||
| 338 | - html += "</tr>" | ||
| 339 | - if (i == 0) { | ||
| 340 | - htmlHead += html; | ||
| 341 | - } else | ||
| 342 | - htmlBody += html; | ||
| 343 | - }); | ||
| 344 | - $('#forms_head thead').html(htmlHead); | ||
| 345 | - $('#forms_body tbody').html(htmlBody); | ||
| 346 | - layer.close(lodingI); | ||
| 347 | - }); | ||
| 348 | - } | ||
| 349 | - } | ||
| 350 | - }); | ||
| 351 | - | ||
| 352 | - $("#export").on("click",function(){ | ||
| 353 | - $post("/report/calcDetailMonthlyE",datas,function(result){ | ||
| 354 | - window.open("/downloadFile/download?fileName="+datas.name); | ||
| 355 | - }); | ||
| 356 | - }); | ||
| 357 | - }); | ||
| 358 | -</script> | ||
| 359 | -<!--<script type="application/javascript" src="/pages/forms/calc/calcDetailMonthly.js"></script>--> | 1 | +<style type="text/css"> |
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; | ||
| 11 | + text-align: center; } | ||
| 12 | + .table-bordered > thead > tr > th, | ||
| 13 | + .table-bordered > thead > tr > td { | ||
| 14 | + border-bottom-width: 2px; } | ||
| 15 | + | ||
| 16 | + .table > tbody + tbody { | ||
| 17 | + border-top: 1px solid; } | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + #analy_body tr> td >span{ | ||
| 21 | + word-break: keep-all;white-space:nowrap; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + #analy_body td{ | ||
| 25 | + min-width: 100px; | ||
| 26 | + max-width: 100px; | ||
| 27 | + width: 100px; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + #analy_body{ | ||
| 31 | + margin-top: 20px; | ||
| 32 | + height: 620px; | ||
| 33 | + width: 100% | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + .table_head::-webkit-scrollbar { | ||
| 38 | + display:none | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + .table_head{ | ||
| 42 | + min-width: 906px; | ||
| 43 | + width: 100%; | ||
| 44 | + overflow: hidden; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + .table_body{ | ||
| 48 | + width:101%; | ||
| 49 | + height:580px; | ||
| 50 | + overflow: auto; | ||
| 51 | + margin-top: -20px; | ||
| 52 | + } | ||
| 53 | +</style> | ||
| 54 | +<div class="page-head"> | ||
| 55 | + <div class="page-title"> | ||
| 56 | + <h1>路单线路明细年报表</h1> | ||
| 57 | + </div> | ||
| 58 | +</div> | ||
| 59 | + | ||
| 60 | +<!--<div class="row">--> | ||
| 61 | +<div class=" row col-md-12 portlet light bordered" style="height:calc(100% - 38px)"> | ||
| 62 | + <div class=""> | ||
| 63 | + <form class="form-inline" > | ||
| 64 | + <div style="display: inline-block; margin-left: 13px;" id="gsdmDiv_daily"> | ||
| 65 | + <span class="item-label" style="width: 80px;">  公司: </span> | ||
| 66 | + <select class="form-control" name="company" id="gsdm" style="width: 150px;"></select> | ||
| 67 | + </div> | ||
| 68 | + <div style="display: inline-block; margin-left: 13px;" id="fgsdmDiv_daily"> | ||
| 69 | + <span class="item-label" style="width: 80px;"> 分公司: </span> | ||
| 70 | + <select class="form-control" name="fgsdm" id="fgsdm" style="width: 150px;"></select> | ||
| 71 | + </div> | ||
| 72 | + <!--<div style="display: inline-block;margin-left: 33px;"> | ||
| 73 | + <span class="item-label" style="width: 80px;">  线路: </span> | ||
| 74 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 75 | + </div>--> | ||
| 76 | + <div style="display: inline-block;margin-left: 13px;" class="date-picker"> | ||
| 77 | + <span class="item-label" style="width: 80px;">  时间: </span> | ||
| 78 | + <input class="form-control" type="text" id="startDate" style="width: 150px;" /> - | ||
| 79 | + <input class="form-control" type="text" id="endDate" style="width: 150px;" /> | ||
| 80 | + <!--<input class="form-control" type="text" id="startDate" style="width: 180px;" value="2020-10-01"/> - --> | ||
| 81 | + <!--<input class="form-control" type="text" id="endDate" style="width: 180px;" value="2020-10-10"/>--> | ||
| 82 | + </div> | ||
| 83 | + | ||
| 84 | + <div style="margin-top: 2px"></div> | ||
| 85 | + | ||
| 86 | + <div style="display: inline-block; margin-left: 13px;"> | ||
| 87 | + <span class="item-label" style="width: 80px;">线路性质: </span> | ||
| 88 | + <select class="form-control" name="destroy" id="destroy" style="width: 150px;"> | ||
| 89 | + <option value="0,1">全部线路</option> | ||
| 90 | + <option value="0">营运线路</option> | ||
| 91 | + <option value="1">非营运线路</option> | ||
| 92 | + </select> | ||
| 93 | + </div> | ||
| 94 | + <div style="display: inline-block;margin-left: 13px;"> | ||
| 95 | + <span class="item-label" style="width: 80px;">统计对象: </span> | ||
| 96 | + <select class="form-control" name="statisticalObj" id="statisticalObj" style="width: 150px;"> | ||
| 97 | + <option value="cl">车辆</option> | ||
| 98 | + <option value="jsy">驾驶员</option> | ||
| 99 | + <option value="cwy">乘务员</option> | ||
| 100 | + <option value="xl">线路</option> | ||
| 101 | + </select> | ||
| 102 | + </div> | ||
| 103 | + | ||
| 104 | + <div style="display: inline-block; margin-left: 13px;" > | ||
| 105 | + <span class="item-label" style="width: 80px;">统计项目: </span> | ||
| 106 | + <select class="form-control" name="statisticalItem" id="statisticalItem" style="width: 150px;"> | ||
| 107 | + <option value="yh">油耗</option> | ||
| 108 | + <option value="dh">电耗</option> | ||
| 109 | + <option value="gl">公里</option> | ||
| 110 | + <option value="bc">班次</option> | ||
| 111 | + </select> | ||
| 112 | + </div> | ||
| 113 | + <div style="display: inline-block; margin-left: 13px;" > | ||
| 114 | + <span class="item-label" style="width: 80px;">项目明细: </span> | ||
| 115 | + <select class="form-control" name="itemDetails" id="itemDetails" style="width: 150px;"></select> | ||
| 116 | + </div> | ||
| 117 | + <div class="form-group" style="display: inline-block;margin-left: 22px;"> | ||
| 118 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 119 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 120 | + </div> | ||
| 121 | + </form> | ||
| 122 | + </div> | ||
| 123 | + | ||
| 124 | + <div id="analy_body"> | ||
| 125 | + <div class="table_head" id="table_head"> | ||
| 126 | + <table class="table table-bordered table-hover table-checkable " id="forms_head"> | ||
| 127 | + <thead> | ||
| 128 | + </thead> | ||
| 129 | + </table> | ||
| 130 | + </div> | ||
| 131 | + <div class="table_body" id="table_body"> | ||
| 132 | + <table class="table table-bordered table-hover table-checkable" id="forms_body" style="background-color: white;"> | ||
| 133 | + <tbody> | ||
| 134 | + </tbody> | ||
| 135 | + </table> | ||
| 136 | + </div> | ||
| 137 | + </div> | ||
| 138 | +</div> | ||
| 139 | +<script > | ||
| 140 | + $(function(){ | ||
| 141 | + $('#export').attr('disabled', "true"); | ||
| 142 | + // 关闭左侧栏 | ||
| 143 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 144 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 145 | + | ||
| 146 | + var table_body1 = document.getElementById("table_body"); | ||
| 147 | + table_body1.onscroll = function(){ | ||
| 148 | + var table_body1_left = this.scrollLeft; | ||
| 149 | + document.getElementById("table_head").scrollLeft = table_body1_left; | ||
| 150 | + }; | ||
| 151 | + | ||
| 152 | + var d = new Date(); | ||
| 153 | + var year = d.getFullYear(); | ||
| 154 | + var month = d.getMonth() + 1; | ||
| 155 | + if(month < 10) | ||
| 156 | + month = "0" + month; | ||
| 157 | + //时间 | ||
| 158 | + var dateTime=year + "-" + month; | ||
| 159 | + $("#startDate").val(dateTime); | ||
| 160 | + $("#endDate").val(dateTime); | ||
| 161 | + | ||
| 162 | + $("#endDate").datetimepicker({ | ||
| 163 | + format : 'YYYY-MM', | ||
| 164 | + locale : 'zh-cn', | ||
| 165 | + maxDate : dateTime | ||
| 166 | + }); | ||
| 167 | + $("#startDate").datetimepicker({ | ||
| 168 | + format : 'YYYY-MM', | ||
| 169 | + locale : 'zh-cn', | ||
| 170 | + maxDate : dateTime | ||
| 171 | + }); | ||
| 172 | + | ||
| 173 | + | ||
| 174 | + var lineAll="",lineNoD="",lineD=""; | ||
| 175 | + var datas = {}; //查询条件 | ||
| 176 | + | ||
| 177 | + | ||
| 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 | + });*/ | ||
| 187 | + }); | ||
| 188 | + | ||
| 189 | + var tempData = {}; | ||
| 190 | + | ||
| 191 | + $.get('/user/companyData', function(result){ | ||
| 192 | + var obj = result; | ||
| 193 | + var options = ''; | ||
| 194 | + for(var i = 0; i < obj.length; i++){ | ||
| 195 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + if(obj.length ==0){ | ||
| 199 | + $("#gsdmDiv_daily").css('display','none'); | ||
| 200 | + }else if(obj.length ==1){ | ||
| 201 | + $("#gsdmDiv_daily").css('display','none'); | ||
| 202 | + if(obj[0].children.length == 1 || obj[0].children.length == 0){ | ||
| 203 | + fage=false; | ||
| 204 | + $('#gsdmDiv_daily').css('display','none'); | ||
| 205 | + } | ||
| 206 | + } | ||
| 207 | + $('#gsdm').html(options); | ||
| 208 | + updateCompany(); | ||
| 209 | + }); | ||
| 210 | + $("#gsdm").on("change",updateCompany); | ||
| 211 | + | ||
| 212 | + function updateCompany(){ | ||
| 213 | + var company = $('#gsdm').val(); | ||
| 214 | + $.get('/user/companyData', function(obj) { | ||
| 215 | + var option = ''; | ||
| 216 | + var allC = ""; | ||
| 217 | + for (var i = 0; i < obj.length; i++) { | ||
| 218 | + if (obj[i].companyCode == company) { | ||
| 219 | + var children = obj[i].children; | ||
| 220 | + for (var j = 0; j < children.length; j++) { | ||
| 221 | + allC += children[j].code+","; | ||
| 222 | + option += '<option value="' + children[j].code + '">' + children[j].name + '</option>'; | ||
| 223 | + } | ||
| 224 | + } | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option; | ||
| 228 | + $('#fgsdm').html(options); | ||
| 229 | + }); | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + // 项目明细选项列 | ||
| 233 | + // 触发默认选项 | ||
| 234 | + updateItem(); | ||
| 235 | + $("#statisticalItem").on("change",updateItem); | ||
| 236 | + var item =""; | ||
| 237 | + function updateItem() { | ||
| 238 | + item = $('#statisticalItem').val(); | ||
| 239 | + var options = ''; | ||
| 240 | + if(item == "yh"){ | ||
| 241 | + options += '<option value="jzlAll">加注量[全部]</option>' + | ||
| 242 | + '<option value="jzl0">加注量[0#]</option>'+ | ||
| 243 | + '<option value="jzl-10">加注量[-10#]</option>'+ | ||
| 244 | + '<option value="yhl">油耗量</option>'+ | ||
| 245 | + '<option value="cccy">出场存油</option>'+ | ||
| 246 | + '<option value="jccy">进场存油</option>'+ | ||
| 247 | + '<option value="bglyh">百公里油耗</option>'; | ||
| 248 | + } else if(item == "gl"){ | ||
| 249 | + options += '<option value="zgl">总公里</option>' + | ||
| 250 | + '<option value="jhgl">计划公里</option>'; | ||
| 251 | + /*'<option value="jclm">进场路码</option>'+ | ||
| 252 | + '<option value="cclm">出场路码</option>'*/ | ||
| 253 | + } else if(item == "bc"){ | ||
| 254 | + options += '<option value="sjbc">实际班次</option>' + | ||
| 255 | + '<option value="jhbc">计划班次</option>'; | ||
| 256 | + } else if(item == "dh"){ | ||
| 257 | + options += '<option value="dh">耗电量</option>'; | ||
| 258 | + options += '<option value="cdl">充电量</option>'; | ||
| 259 | + options += '<option value="cccd">出场存电</option>'; | ||
| 260 | + options += '<option value="jccd">进场存电</option>'; | ||
| 261 | + options += '<option value="bgldh">百公里电耗</option>'; | ||
| 262 | + } | ||
| 263 | + $('#itemDetails').html(options); | ||
| 264 | + } | ||
| 265 | + | ||
| 266 | + //线路名称 | ||
| 267 | + var lineName = ''; | ||
| 268 | + $("#query").on("click",function(){ | ||
| 269 | + var gsdm = $("#gsdm").val(); | ||
| 270 | + var fgsdm = $("#fgsdm").val(); | ||
| 271 | + var startDate = $("#startDate").val(); | ||
| 272 | + var endDate = $("#endDate").val(); | ||
| 273 | + var statisticalObj = $("#statisticalObj").val(); | ||
| 274 | + //开始和结束时间 | ||
| 275 | + var startTime = Date.parse(new Date(startDate)); | ||
| 276 | + var endTime = Date.parse(new Date(endDate)); | ||
| 277 | + | ||
| 278 | + datas = {}; // 清空之前数据 | ||
| 279 | + datas.timeType = "y"; | ||
| 280 | + datas.gsdm = gsdm; | ||
| 281 | + datas.fgsdm = fgsdm; | ||
| 282 | + datas.lineCode = lineAll; | ||
| 283 | + datas.startDate = startDate; | ||
| 284 | + datas.endDate = endDate; | ||
| 285 | + datas.destroy = $("#destroy").val(); | ||
| 286 | + datas.statisticalObj = $("#statisticalObj").val(); | ||
| 287 | + datas.itemDetails = $("#itemDetails").val(); | ||
| 288 | + datas.item = item; | ||
| 289 | + | ||
| 290 | + var itemDetails = datas.itemDetails, | ||
| 291 | + type = "加注量[全部]"; | ||
| 292 | + if(itemDetails=="jzl0"){ | ||
| 293 | + type = "加注量[0#]" | ||
| 294 | + } else if(itemDetails=="jzl-10"){ | ||
| 295 | + type = "加注量[-10#]" | ||
| 296 | + } else if(itemDetails=="yhl"){ | ||
| 297 | + type = "油耗量" | ||
| 298 | + } else if(itemDetails=="cccy"){ | ||
| 299 | + type = "出场存油" | ||
| 300 | + } else if(itemDetails=="jccy"){ | ||
| 301 | + type = "进场存油" | ||
| 302 | + } else if(itemDetails=="bglyh"){ | ||
| 303 | + type = "百公里油耗" | ||
| 304 | + } else if(itemDetails=="zgl"){ | ||
| 305 | + type = "总公里" | ||
| 306 | + } else if(itemDetails=="jhgl"){ | ||
| 307 | + type = "计划公里" | ||
| 308 | + } else if(itemDetails=="jclm"){ | ||
| 309 | + type = "进场路码" | ||
| 310 | + } else if(itemDetails=="cclm"){ | ||
| 311 | + type = "出场路码" | ||
| 312 | + } else if(itemDetails=="sjbc"){ | ||
| 313 | + type = "实际班次" | ||
| 314 | + } else if(itemDetails=="jhbc"){ | ||
| 315 | + type = "计划班次" | ||
| 316 | + } else if(itemDetails=="dh"){ | ||
| 317 | + type = "耗电量" | ||
| 318 | + } else if(itemDetails=="cdl"){ | ||
| 319 | + type = "充电量" | ||
| 320 | + } else if(itemDetails=="cccd"){ | ||
| 321 | + type = "出场存电" | ||
| 322 | + } else if(itemDetails=="jccd"){ | ||
| 323 | + type = "进场存电" | ||
| 324 | + } else if(itemDetails=="bgldh"){ | ||
| 325 | + type = "百公里电耗" | ||
| 326 | + } | ||
| 327 | + datas.name = datas.startDate+"-"+datas.endDate+"-路单线路明细年报表("+type+")"; | ||
| 328 | + if(startDate==null || startDate =="" ||endDate==null || endDate ==""){ | ||
| 329 | + layer.msg('请选择时间段!'); | ||
| 330 | + }else if(endTime<startTime){ | ||
| 331 | + layer.msg('结束日期不能小于开始日期!'); | ||
| 332 | + }else { | ||
| 333 | + if (endDate.substring(0, 4) != startDate.substring(0, 4)) { | ||
| 334 | + layer.msg("请查询同年份数据!"); | ||
| 335 | + return; | ||
| 336 | + } else { | ||
| 337 | + var lodingI = layer.load(2); | ||
| 338 | + $get('/calcWaybill/calcDetailMonthly', datas, function (rs) { | ||
| 339 | + if (rs.length <=0) { | ||
| 340 | + layer.close(lodingI); | ||
| 341 | + layer.open({ | ||
| 342 | + title: '提示' | ||
| 343 | + , content: '没有您要查询的数据,请重新选择参数!' | ||
| 344 | + }); | ||
| 345 | + $("#export").attr('disabled',"true"); | ||
| 346 | + return; | ||
| 347 | + }else | ||
| 348 | + $("#export").removeAttr("disabled"); | ||
| 349 | + var htmlHead = "<tr><td colspan='"+rs[0].length+"'>"+datas.name+"</td></tr>", htmlBody = ""; | ||
| 350 | + var rsLength = rs.length; | ||
| 351 | + rs.forEach(function (o, i) { | ||
| 352 | + var html = "<tr>" | ||
| 353 | + o.forEach(function (td, j) { | ||
| 354 | + var colspan; | ||
| 355 | + if (i == rsLength - 1 && j == 0) { | ||
| 356 | + colspan = (statisticalObj == "xl" ? "colspan='3'" : "colspan='5'"); | ||
| 357 | + if(statisticalObj == "cl") | ||
| 358 | + colspan = "colspan='6'"; | ||
| 359 | + } | ||
| 360 | + html += "<td " + colspan + ">" + td + "</td>" | ||
| 361 | + }); | ||
| 362 | + html += "</tr>" | ||
| 363 | + if (i == 0) { | ||
| 364 | + htmlHead += html; | ||
| 365 | + } else | ||
| 366 | + htmlBody += html; | ||
| 367 | + }); | ||
| 368 | + $('#forms_head thead').html(htmlHead); | ||
| 369 | + $('#forms_body tbody').html(htmlBody); | ||
| 370 | + layer.close(lodingI); | ||
| 371 | + }); | ||
| 372 | + } | ||
| 373 | + } | ||
| 374 | + }); | ||
| 375 | + | ||
| 376 | + $("#export").on("click",function(){ | ||
| 377 | + $post("/report/calcDetailMonthlyE",datas,function(result){ | ||
| 378 | + window.open("/downloadFile/download?fileName="+datas.name); | ||
| 379 | + }); | ||
| 380 | + }); | ||
| 381 | + }); | ||
| 382 | +</script> | ||
| 383 | +<!--<script type="application/javascript" src="/pages/forms/calc/calcDetailMonthly.js"></script>--> |
src/main/resources/static/pages/forms/mould/countMileageSum.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/dispatchDailySum.html
| @@ -48,9 +48,13 @@ | @@ -48,9 +48,13 @@ | ||
| 48 | </select> | 48 | </select> |
| 49 | </div> | 49 | </div> |
| 50 | <div style="display: inline-block;margin-left: 15px;"> | 50 | <div style="display: inline-block;margin-left: 15px;"> |
| 51 | - <span class="item-label" style="width: 80px;">营运日期: </span> | 51 | + <span class="item-label" style="width: 80px;">开始日期: </span> |
| 52 | <input class="form-control" type="text" id="date" style="width: 180px;"/> | 52 | <input class="form-control" type="text" id="date" style="width: 180px;"/> |
| 53 | </div> | 53 | </div> |
| 54 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 55 | + <span class="item-label" style="width: 80px;">结束日期: </span> | ||
| 56 | + <input class="form-control" type="text" id="date2" style="width: 180px;"/> | ||
| 57 | + </div> | ||
| 54 | <div class="form-group"> | 58 | <div class="form-group"> |
| 55 | <input class="btn btn-default" type="button" id="query" value="查询"/> | 59 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| 56 | <input class="btn btn-default" type="button" id="export" value="导出"/> | 60 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| @@ -152,14 +156,20 @@ | @@ -152,14 +156,20 @@ | ||
| 152 | 156 | ||
| 153 | var dateTime=year + "-" + month + "-" + day; | 157 | var dateTime=year + "-" + month + "-" + day; |
| 154 | $("#date").val(dateTime); | 158 | $("#date").val(dateTime); |
| 155 | -// $("#date2").val(dateTime); | 159 | + $("#date2").val(dateTime); |
| 156 | $("#date").datetimepicker({ | 160 | $("#date").datetimepicker({ |
| 157 | format : 'YYYY-MM-DD', | 161 | format : 'YYYY-MM-DD', |
| 158 | locale : 'zh-cn', | 162 | locale : 'zh-cn', |
| 159 | maxDate : dateTime | 163 | maxDate : dateTime |
| 160 | }); | 164 | }); |
| 165 | + $("#date2").datetimepicker({ | ||
| 166 | + format : 'YYYY-MM-DD', | ||
| 167 | + locale : 'zh-cn', | ||
| 168 | + maxDate : dateTime | ||
| 169 | + }); | ||
| 161 | 170 | ||
| 162 | var date = ""; | 171 | var date = ""; |
| 172 | + var date2 = ""; | ||
| 163 | var nature=""; | 173 | var nature=""; |
| 164 | var time1=""; | 174 | var time1=""; |
| 165 | var time2=""; | 175 | var time2=""; |
| @@ -168,7 +178,12 @@ | @@ -168,7 +178,12 @@ | ||
| 168 | layer.msg("请选择日期!"); | 178 | layer.msg("请选择日期!"); |
| 169 | return; | 179 | return; |
| 170 | } | 180 | } |
| 181 | + if($("#date2").val() == null || $("#date2").val().trim().length == 0){ | ||
| 182 | + layer.msg("请选择日期!"); | ||
| 183 | + return; | ||
| 184 | + } | ||
| 171 | date = $("#date").val(); | 185 | date = $("#date").val(); |
| 186 | + date2 = $("#date2").val(); | ||
| 172 | nature=$("#nature").val(); | 187 | nature=$("#nature").val(); |
| 173 | // time1 = Date.parse(new Date(date)); | 188 | // time1 = Date.parse(new Date(date)); |
| 174 | // time2 = Date.parse(new Date(date2)); | 189 | // time2 = Date.parse(new Date(date2)); |
| @@ -182,10 +197,11 @@ | @@ -182,10 +197,11 @@ | ||
| 182 | // }else{ | 197 | // }else{ |
| 183 | $("#tjrq").html(date); | 198 | $("#tjrq").html(date); |
| 184 | $("#rqxs").html(date); | 199 | $("#rqxs").html(date); |
| 185 | - var params = {}; | ||
| 186 | - params['date'] = date; | ||
| 187 | - params['nature'] = nature; | ||
| 188 | - params['type'] = "query"; | 200 | + var params = {}; |
| 201 | + params['date'] = date; | ||
| 202 | + params['date2'] = date2; | ||
| 203 | + params['nature'] = nature; | ||
| 204 | + params['type'] = "query"; | ||
| 189 | var i = layer.load(2); | 205 | var i = layer.load(2); |
| 190 | $get('/realSchedule/dispatchDailySum',params,function(result){ | 206 | $get('/realSchedule/dispatchDailySum',params,function(result){ |
| 191 | // 把数据填充到模版中 | 207 | // 把数据填充到模版中 |
| @@ -211,9 +227,11 @@ | @@ -211,9 +227,11 @@ | ||
| 211 | return; | 227 | return; |
| 212 | } | 228 | } |
| 213 | date = $("#date").val(); | 229 | date = $("#date").val(); |
| 230 | + date2 = $("#date2").val(); | ||
| 214 | nature=$("#nature").val(); | 231 | nature=$("#nature").val(); |
| 215 | var params = {}; | 232 | var params = {}; |
| 216 | params['date'] = date; | 233 | params['date'] = date; |
| 234 | + params['date2'] = date2; | ||
| 217 | params['nature'] = nature; | 235 | params['nature'] = nature; |
| 218 | params['type'] = "export"; | 236 | params['type'] = "export"; |
| 219 | // if((time2-time1)>2678400000){ | 237 | // if((time2-time1)>2678400000){ |
| @@ -222,12 +240,12 @@ | @@ -222,12 +240,12 @@ | ||
| 222 | var i = layer.load(2); | 240 | var i = layer.load(2); |
| 223 | $get('/realSchedule/dispatchDailySum',params,function(result){ | 241 | $get('/realSchedule/dispatchDailySum',params,function(result){ |
| 224 | var dateTime = ""; | 242 | var dateTime = ""; |
| 225 | -// if(date == date2){ | 243 | + if(date == date2){ |
| 226 | dateTime = moment(date).format("YYYYMMDD"); | 244 | dateTime = moment(date).format("YYYYMMDD"); |
| 227 | -// } else { | ||
| 228 | -// dateTime = moment(date).format("YYYYMMDD") | ||
| 229 | -// +"-"+moment(date2).format("YYYYMMDD"); | ||
| 230 | -// } | 245 | + } else { |
| 246 | + dateTime = moment(date).format("YYYYMMDD") | ||
| 247 | + +"-"+moment(date2).format("YYYYMMDD"); | ||
| 248 | + } | ||
| 231 | window.open("/downloadFile/download?fileName=" | 249 | window.open("/downloadFile/download?fileName=" |
| 232 | +dateTime+"-调度日报汇总表"); | 250 | +dateTime+"-调度日报汇总表"); |
| 233 | layer.close(i); | 251 | layer.close(i); |
| @@ -240,7 +258,8 @@ | @@ -240,7 +258,8 @@ | ||
| 240 | </script> | 258 | </script> |
| 241 | <script type="text/html" id="dispatch_daily_sum"> | 259 | <script type="text/html" id="dispatch_daily_sum"> |
| 242 | {{each list as obj i}} | 260 | {{each list as obj i}} |
| 243 | - <tr {{if obj.zt==1}}style='color: red'{{/if}}> | 261 | + <tr style='{{if obj.zt==1}}color: red;{{/if}} |
| 262 | + {{if obj.fgsName=='小计' || obj.gsName=='浦交'}}background-color: #b9d6fb;{{/if}}'> | ||
| 244 | <td>{{obj.gsName}}</td> | 263 | <td>{{obj.gsName}}</td> |
| 245 | <td>{{obj.fgsName}}</td> | 264 | <td>{{obj.fgsName}}</td> |
| 246 | <td>{{obj.jhzlc}}</td> | 265 | <td>{{obj.jhzlc}}</td> |
src/main/resources/static/pages/oil/list_ph.html
| @@ -358,7 +358,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -358,7 +358,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 358 | //console.log("核对加注量"); | 358 | //console.log("核对加注量"); |
| 359 | if ($("#rq").val() != "") { | 359 | if ($("#rq").val() != "") { |
| 360 | var params=getParamsList(); | 360 | var params=getParamsList(); |
| 361 | - $get('/ylb/checkDate',params,function(status){ | 361 | + var par={}; |
| 362 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 363 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 364 | + $get('/ylb/checkDate',par,function(status){ | ||
| 362 | if(status=='2'){ | 365 | if(status=='2'){ |
| 363 | layer.msg('只能操作三天内数据.'); | 366 | layer.msg('只能操作三天内数据.'); |
| 364 | }else{ | 367 | }else{ |
| @@ -380,7 +383,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -380,7 +383,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 380 | // console.log("进场油量等于出场油量"); | 383 | // console.log("进场油量等于出场油量"); |
| 381 | if ($("#rq").val() != "") { | 384 | if ($("#rq").val() != "") { |
| 382 | var params=getParamsList(); | 385 | var params=getParamsList(); |
| 383 | - $get('/ylb/checkDate',params,function(status){ | 386 | + var par={}; |
| 387 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 388 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 389 | + $get('/ylb/checkDate',par,function(status){ | ||
| 384 | if(status=='2'){ | 390 | if(status=='2'){ |
| 385 | layer.msg('只能操作三天内数据.'); | 391 | layer.msg('只能操作三天内数据.'); |
| 386 | }else{ | 392 | }else{ |
| @@ -400,7 +406,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -400,7 +406,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 400 | $(".saveButton").on('click',function(){ | 406 | $(".saveButton").on('click',function(){ |
| 401 | 407 | ||
| 402 | var params_=getParamsList(); | 408 | var params_=getParamsList(); |
| 403 | - $get('/ylb/checkDate',params_,function(status){ | 409 | + var par={}; |
| 410 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 411 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 412 | + $get('/ylb/checkDate',par,function(status){ | ||
| 404 | if(status=='2'){ | 413 | if(status=='2'){ |
| 405 | layer.msg('只能操作三天内数据.'); | 414 | layer.msg('只能操作三天内数据.'); |
| 406 | }else{ | 415 | }else{ |
| @@ -464,7 +473,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -464,7 +473,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 464 | $(".sortButton").on('click', function () { | 473 | $(".sortButton").on('click', function () { |
| 465 | if ($("#rq").val() != "") { | 474 | if ($("#rq").val() != "") { |
| 466 | var params_=getParamsList(); | 475 | var params_=getParamsList(); |
| 467 | - $get('/ylb/checkDate',params_,function(status){ | 476 | + var par={}; |
| 477 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 478 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 479 | + $get('/ylb/checkDate',par,function(status){ | ||
| 468 | if(status=='2'){ | 480 | if(status=='2'){ |
| 469 | layer.msg('只能操作三天内数据.'); | 481 | layer.msg('只能操作三天内数据.'); |
| 470 | }else{ | 482 | }else{ |
| @@ -632,7 +644,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -632,7 +644,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 632 | //console.log("获取加存"); | 644 | //console.log("获取加存"); |
| 633 | if ($("#rq").val() != "") { | 645 | if ($("#rq").val() != "") { |
| 634 | var params=getParamsList(); | 646 | var params=getParamsList(); |
| 635 | - $get('/ylb/checkDate',params,function(status){ | 647 | + var par={}; |
| 648 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 649 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 650 | + $get('/ylb/checkDate',par,function(status){ | ||
| 636 | if(status=='2'){ | 651 | if(status=='2'){ |
| 637 | layer.msg('只能操作三天内数据.'); | 652 | layer.msg('只能操作三天内数据.'); |
| 638 | }else{ | 653 | }else{ |
| @@ -788,7 +803,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -788,7 +803,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 788 | 803 | ||
| 789 | function jsyUpdate(){ | 804 | function jsyUpdate(){ |
| 790 | var params=getParamsList(); | 805 | var params=getParamsList(); |
| 791 | - $get('/ylb/checkDate',params,function(status){ | 806 | + var par={}; |
| 807 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 808 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 809 | + $get('/ylb/checkDate',par,function(status){ | ||
| 792 | var id = $(this).data('id'); | 810 | var id = $(this).data('id'); |
| 793 | if(status=='2'){ | 811 | if(status=='2'){ |
| 794 | layer.msg('只能操作三天内数据.'); | 812 | layer.msg('只能操作三天内数据.'); |
| @@ -926,7 +944,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -926,7 +944,10 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 926 | //删除 | 944 | //删除 |
| 927 | $('.removeButton').on('click', function () { | 945 | $('.removeButton').on('click', function () { |
| 928 | var params_=getParamsList(); | 946 | var params_=getParamsList(); |
| 929 | - $get('/ylb/checkDate',params_,function(status){ | 947 | + var par={}; |
| 948 | + par["rq"] = moment($("#rq").val()).subtract(2, 'days').format("YYYY-MM-DD"); | ||
| 949 | + par["ssgsdm_like"] = $("#ylbListGsdmId").val(); | ||
| 950 | + $get('/ylb/checkDate',par,function(status){ | ||
| 930 | if(status=='2'){ | 951 | if(status=='2'){ |
| 931 | layer.msg('只能操作三天内数据.'); | 952 | layer.msg('只能操作三天内数据.'); |
| 932 | }else{ | 953 | }else{ |
src/main/resources/static/pages/report/countMileage/countLine/countMileageSum.html
| @@ -48,9 +48,13 @@ | @@ -48,9 +48,13 @@ | ||
| 48 | </select> | 48 | </select> |
| 49 | </div> | 49 | </div> |
| 50 | <div style="display: inline-block;margin-left: 15px;"> | 50 | <div style="display: inline-block;margin-left: 15px;"> |
| 51 | - <span class="item-label" style="width: 80px;">营运日期: </span> | 51 | + <span class="item-label" style="width: 80px;">开始日期: </span> |
| 52 | <input class="form-control" type="text" id="date" style="width: 180px;"/> | 52 | <input class="form-control" type="text" id="date" style="width: 180px;"/> |
| 53 | </div> | 53 | </div> |
| 54 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 55 | + <span class="item-label" style="width: 80px;">结束日期: </span> | ||
| 56 | + <input class="form-control" type="text" id="date2" style="width: 180px;"/> | ||
| 57 | + </div> | ||
| 54 | <div class="form-group"> | 58 | <div class="form-group"> |
| 55 | <input class="btn btn-default" type="button" id="query" value="查询"/> | 59 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| 56 | <input class="btn btn-default" type="button" id="export" value="导出"/> | 60 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| @@ -125,6 +129,10 @@ | @@ -125,6 +129,10 @@ | ||
| 125 | format : 'YYYY-MM-DD', | 129 | format : 'YYYY-MM-DD', |
| 126 | locale : 'zh-cn' | 130 | locale : 'zh-cn' |
| 127 | }); | 131 | }); |
| 132 | + $("#date2").datetimepicker({ | ||
| 133 | + format : 'YYYY-MM-DD', | ||
| 134 | + locale : 'zh-cn' | ||
| 135 | + }); | ||
| 128 | 136 | ||
| 129 | var d = new Date(); | 137 | var d = new Date(); |
| 130 | var year = d.getFullYear(); | 138 | var year = d.getFullYear(); |
| @@ -135,22 +143,30 @@ | @@ -135,22 +143,30 @@ | ||
| 135 | if(day < 10) | 143 | if(day < 10) |
| 136 | day = "0" + day; | 144 | day = "0" + day; |
| 137 | $("#date").val(year + "-" + month + "-" + day); | 145 | $("#date").val(year + "-" + month + "-" + day); |
| 146 | + $("#date2").val(year + "-" + month + "-" + day); | ||
| 138 | 147 | ||
| 139 | var date = ""; | 148 | var date = ""; |
| 140 | - var nature=""; | 149 | + var date2 = ""; |
| 150 | + var nature = ""; | ||
| 141 | $("#query").on("click",function(){ | 151 | $("#query").on("click",function(){ |
| 142 | $("#countLine").height($(window).height()-280); | 152 | $("#countLine").height($(window).height()-280); |
| 143 | if($("#date").val() == null || $("#date").val().trim().length == 0){ | 153 | if($("#date").val() == null || $("#date").val().trim().length == 0){ |
| 144 | layer.msg("请选择日期!"); | 154 | layer.msg("请选择日期!"); |
| 145 | return; | 155 | return; |
| 146 | } | 156 | } |
| 157 | + if($("#date2").val() == null || $("#date2").val().trim().length == 0){ | ||
| 158 | + layer.msg("请选择日期!"); | ||
| 159 | + return; | ||
| 160 | + } | ||
| 147 | date = $("#date").val(); | 161 | date = $("#date").val(); |
| 162 | + date2 = $("#date2").val(); | ||
| 148 | // if(date==null || date =="" ||date2==null || date2 ==""){ | 163 | // if(date==null || date =="" ||date2==null || date2 ==""){ |
| 149 | // layer.msg('请选择时间段.'); | 164 | // layer.msg('请选择时间段.'); |
| 150 | // }else{ | 165 | // }else{ |
| 151 | nature = $("#nature").val(); | 166 | nature = $("#nature").val(); |
| 152 | var params = {}; | 167 | var params = {}; |
| 153 | params['date'] = date; | 168 | params['date'] = date; |
| 169 | + params['date2'] = date2; | ||
| 154 | params['nature'] = nature; | 170 | params['nature'] = nature; |
| 155 | params['type'] = "query"; | 171 | params['type'] = "query"; |
| 156 | var i = layer.load(2); | 172 | var i = layer.load(2); |
| @@ -176,23 +192,28 @@ | @@ -176,23 +192,28 @@ | ||
| 176 | if($("#date").val() == null || $("#date").val().trim().length == 0){ | 192 | if($("#date").val() == null || $("#date").val().trim().length == 0){ |
| 177 | layer.msg("请选择日期!"); | 193 | layer.msg("请选择日期!"); |
| 178 | return; | 194 | return; |
| 195 | + }if($("#date2").val() == null || $("#date2").val().trim().length == 0){ | ||
| 196 | + layer.msg("请选择日期!"); | ||
| 197 | + return; | ||
| 179 | } | 198 | } |
| 180 | date = $("#date").val(); | 199 | date = $("#date").val(); |
| 200 | + date2 = $("#date2").val(); | ||
| 181 | nature = $("#nature").val(); | 201 | nature = $("#nature").val(); |
| 182 | var params = {}; | 202 | var params = {}; |
| 183 | params['date'] = date; | 203 | params['date'] = date; |
| 204 | + params['date2'] = date2; | ||
| 184 | params['nature'] = nature; | 205 | params['nature'] = nature; |
| 185 | params['type'] = "export"; | 206 | params['type'] = "export"; |
| 186 | params['by']='sj'; | 207 | params['by']='sj'; |
| 187 | var i = layer.load(2); | 208 | var i = layer.load(2); |
| 188 | $get('/report/countMileageSum',params,function(result){ | 209 | $get('/report/countMileageSum',params,function(result){ |
| 189 | var dateTime = ""; | 210 | var dateTime = ""; |
| 190 | -// if(date == date2){ | 211 | + if(date == date2){ |
| 191 | dateTime = moment(date).format("YYYYMMDD"); | 212 | dateTime = moment(date).format("YYYYMMDD"); |
| 192 | -// } else { | ||
| 193 | -// dateTime = moment(date).format("YYYYMMDD") | ||
| 194 | -// +"-"+moment(date2).format("YYYYMMDD"); | ||
| 195 | -// } | 213 | + } else { |
| 214 | + dateTime = moment(date).format("YYYYMMDD") | ||
| 215 | + +"-"+moment(date2).format("YYYYMMDD"); | ||
| 216 | + } | ||
| 196 | window.open("/downloadFile/download?fileName=" | 217 | window.open("/downloadFile/download?fileName=" |
| 197 | +dateTime+"-审计公里汇总表"); | 218 | +dateTime+"-审计公里汇总表"); |
| 198 | layer.close(i); | 219 | layer.close(i); |
| @@ -202,7 +223,7 @@ | @@ -202,7 +223,7 @@ | ||
| 202 | </script> | 223 | </script> |
| 203 | <script type="text/html" id="count_mileage_sum"> | 224 | <script type="text/html" id="count_mileage_sum"> |
| 204 | {{each list as obj i}} | 225 | {{each list as obj i}} |
| 205 | - <tr> | 226 | + <tr style='{{if obj.fgsName=='小计' || obj.gsName=='浦交'}}background-color: #b9d6fb;{{/if}}'> |
| 206 | <td>{{obj.gsName}}</td> | 227 | <td>{{obj.gsName}}</td> |
| 207 | <td>{{obj.fgsName}}</td> | 228 | <td>{{obj.fgsName}}</td> |
| 208 | <td>{{obj.jhzlc}}</td> | 229 | <td>{{obj.jhzlc}}</td> |