Commit 0edfd795d574ca68f2208f3a942b74bc9f083eac
1 parent
45776ffe
update...
Showing
31 changed files
with
3942 additions
and
107 deletions
src/main/java/com/bsth/WebAppConfiguration.java
| 1 | package com.bsth; | 1 | package com.bsth; |
| 2 | 2 | ||
| 3 | -import javax.servlet.Filter; | ||
| 4 | - | ||
| 5 | -import org.springframework.beans.factory.annotation.Autowired; | 3 | +import com.bsth.filter.ResourceFilter; |
| 4 | +import com.bsth.websocket.WebSocketHandshakeInterceptor; | ||
| 5 | +import com.bsth.websocket.handler.RealControlSocketHandler; | ||
| 6 | +import org.slf4j.Logger; | ||
| 7 | +import org.slf4j.LoggerFactory; | ||
| 6 | import org.springframework.boot.context.embedded.FilterRegistrationBean; | 8 | import org.springframework.boot.context.embedded.FilterRegistrationBean; |
| 7 | import org.springframework.context.annotation.Bean; | 9 | import org.springframework.context.annotation.Bean; |
| 8 | import org.springframework.context.annotation.ComponentScan; | 10 | import org.springframework.context.annotation.ComponentScan; |
| 9 | import org.springframework.context.annotation.Configuration; | 11 | import org.springframework.context.annotation.Configuration; |
| 10 | import org.springframework.web.filter.CharacterEncodingFilter; | 12 | import org.springframework.web.filter.CharacterEncodingFilter; |
| 11 | import org.springframework.web.filter.HttpPutFormContentFilter; | 13 | import org.springframework.web.filter.HttpPutFormContentFilter; |
| 12 | -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; | ||
| 13 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; | 14 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; |
| 14 | import org.springframework.web.socket.config.annotation.EnableWebSocket; | 15 | import org.springframework.web.socket.config.annotation.EnableWebSocket; |
| 15 | import org.springframework.web.socket.config.annotation.WebSocketConfigurer; | 16 | import org.springframework.web.socket.config.annotation.WebSocketConfigurer; |
| 16 | import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; | 17 | import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; |
| 18 | +import org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean; | ||
| 17 | 19 | ||
| 18 | -import com.bsth.filter.ResourceFilter; | ||
| 19 | -import com.bsth.oplog.http.HttpOpLogInterceptor; | ||
| 20 | -import com.bsth.websocket.WebSocketHandshakeInterceptor; | ||
| 21 | -import com.bsth.websocket.handler.RealControlSocketHandler; | 20 | +import javax.servlet.Filter; |
| 22 | 21 | ||
| 23 | @Configuration | 22 | @Configuration |
| 24 | @EnableWebSocket | 23 | @EnableWebSocket |
| @@ -27,6 +26,8 @@ public class WebAppConfiguration extends WebMvcConfigurerAdapter implements WebS | @@ -27,6 +26,8 @@ public class WebAppConfiguration extends WebMvcConfigurerAdapter implements WebS | ||
| 27 | 26 | ||
| 28 | // @Autowired | 27 | // @Autowired |
| 29 | // HttpOpLogInterceptor httpOpLogInterceptor; | 28 | // HttpOpLogInterceptor httpOpLogInterceptor; |
| 29 | + | ||
| 30 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 30 | 31 | ||
| 31 | /** | 32 | /** |
| 32 | * @Title: httpPutFormContentFilter | 33 | * @Title: httpPutFormContentFilter |
| @@ -75,4 +76,17 @@ public class WebAppConfiguration extends WebMvcConfigurerAdapter implements WebS | @@ -75,4 +76,17 @@ public class WebAppConfiguration extends WebMvcConfigurerAdapter implements WebS | ||
| 75 | registry.addHandler(new RealControlSocketHandler(), "/sockjs/realcontrol").addInterceptors(new WebSocketHandshakeInterceptor()) | 76 | registry.addHandler(new RealControlSocketHandler(), "/sockjs/realcontrol").addInterceptors(new WebSocketHandshakeInterceptor()) |
| 76 | .withSockJS(); | 77 | .withSockJS(); |
| 77 | } | 78 | } |
| 79 | + | ||
| 80 | + /** | ||
| 81 | + * 增加websocket的输出缓冲区 | ||
| 82 | + * @return | ||
| 83 | + */ | ||
| 84 | + @Bean | ||
| 85 | + public ServletServerContainerFactoryBean createServletServerContainerFactoryBean() { | ||
| 86 | + ServletServerContainerFactoryBean container = new ServletServerContainerFactoryBean(); | ||
| 87 | + container.setMaxTextMessageBufferSize(52768); | ||
| 88 | + container.setMaxBinaryMessageBufferSize(52768); | ||
| 89 | + logger.info("Websocket factory returned"); | ||
| 90 | + return container; | ||
| 91 | + } | ||
| 78 | } | 92 | } |
src/main/java/com/bsth/controller/realcontrol/ChildTaskPlanController.java
| 1 | package com.bsth.controller.realcontrol; | 1 | package com.bsth.controller.realcontrol; |
| 2 | 2 | ||
| 3 | +import com.bsth.controller.BaseController; | ||
| 4 | +import com.bsth.entity.realcontrol.ChildTaskPlan; | ||
| 5 | +import com.bsth.service.realcontrol.ChildTaskPlanService; | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.web.bind.annotation.PathVariable; | ||
| 3 | import org.springframework.web.bind.annotation.RequestMapping; | 8 | import org.springframework.web.bind.annotation.RequestMapping; |
| 9 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 4 | import org.springframework.web.bind.annotation.RestController; | 10 | import org.springframework.web.bind.annotation.RestController; |
| 5 | 11 | ||
| 6 | -import com.bsth.controller.BaseController; | ||
| 7 | -import com.bsth.entity.realcontrol.ChildTaskPlan; | 12 | +import java.util.Map; |
| 8 | 13 | ||
| 9 | @RestController | 14 | @RestController |
| 10 | @RequestMapping("/childTask") | 15 | @RequestMapping("/childTask") |
| 11 | public class ChildTaskPlanController extends BaseController<ChildTaskPlan, Long>{ | 16 | public class ChildTaskPlanController extends BaseController<ChildTaskPlan, Long>{ |
| 12 | 17 | ||
| 18 | + @Autowired | ||
| 19 | + ChildTaskPlanService childTaskPlanService; | ||
| 20 | + | ||
| 21 | + @RequestMapping(value = "history", method = RequestMethod.POST) | ||
| 22 | + public Map<String, Object> saveHistory(ChildTaskPlan childTask){ | ||
| 23 | + return childTaskPlanService.saveHistory(childTask); | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + @RequestMapping(value = "history/{id}", method = RequestMethod.DELETE) | ||
| 27 | + public Map<String, Object> delHistory(@PathVariable("id") Long id){ | ||
| 28 | + return childTaskPlanService.delHistory(id); | ||
| 29 | + } | ||
| 13 | } | 30 | } |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| @@ -419,10 +419,10 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -419,10 +419,10 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 419 | return scheduleRealInfoService.changeBcType(id, bcType, remarks); | 419 | return scheduleRealInfoService.changeBcType(id, bcType, remarks); |
| 420 | } | 420 | } |
| 421 | 421 | ||
| 422 | -/* @RequestMapping(value="/history", method=RequestMethod.POST) | 422 | + @RequestMapping(value="/history", method=RequestMethod.POST) |
| 423 | public Map<String,Object> historySave(ScheduleRealInfo sch){ | 423 | public Map<String,Object> historySave(ScheduleRealInfo sch){ |
| 424 | return scheduleRealInfoService.historySave(sch); | 424 | return scheduleRealInfoService.historySave(sch); |
| 425 | - }*/ | 425 | + } |
| 426 | 426 | ||
| 427 | 427 | ||
| 428 | private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); | 428 | private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); |
| @@ -435,7 +435,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -435,7 +435,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 435 | public List<String> dateArray(){ | 435 | public List<String> dateArray(){ |
| 436 | List<String> rs = new ArrayList<>(); | 436 | List<String> rs = new ArrayList<>(); |
| 437 | 437 | ||
| 438 | - long t = new Date().getTime() - ONE_DAY; | 438 | + long t = new Date().getTime() - ONE_DAY - (1000 * 60 * 60 * 2); |
| 439 | for(int i = 0; i < 5; i ++){ | 439 | for(int i = 0; i < 5; i ++){ |
| 440 | rs.add(fmtyyyyMMdd.print(t)); | 440 | rs.add(fmtyyyyMMdd.print(t)); |
| 441 | t -= ONE_DAY; | 441 | t -= ONE_DAY; |
| @@ -536,4 +536,24 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -536,4 +536,24 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 536 | public List<ScheduleRealInfo> allLate2(@RequestParam String idx){ | 536 | public List<ScheduleRealInfo> allLate2(@RequestParam String idx){ |
| 537 | return scheduleRealInfoService.allLate2(idx); | 537 | return scheduleRealInfoService.allLate2(idx); |
| 538 | } | 538 | } |
| 539 | + | ||
| 540 | + /** | ||
| 541 | + * 添加一个临加到历史库 | ||
| 542 | + * @param sch | ||
| 543 | + * @return | ||
| 544 | + */ | ||
| 545 | + @RequestMapping(value = "history/add", method = RequestMethod.POST) | ||
| 546 | + public Map<String, Object> addToHistory(ScheduleRealInfo sch){ | ||
| 547 | + return scheduleRealInfoService.addToHistory(sch); | ||
| 548 | + } | ||
| 549 | + | ||
| 550 | + /** | ||
| 551 | + * 从历史库里删除临加班次 | ||
| 552 | + * @param sch | ||
| 553 | + * @return | ||
| 554 | + */ | ||
| 555 | + @RequestMapping(value = "history/{id}", method = RequestMethod.DELETE) | ||
| 556 | + public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){ | ||
| 557 | + return scheduleRealInfoService.deleteToHistory(id); | ||
| 558 | + } | ||
| 539 | } | 559 | } |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| @@ -270,7 +270,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -270,7 +270,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 270 | 270 | ||
| 271 | //通知客户端 | 271 | //通知客户端 |
| 272 | sendUtils.sendZdsj(sch, lpNext, doneSum); | 272 | sendUtils.sendZdsj(sch, lpNext, doneSum); |
| 273 | - | 273 | + logger.info("车辆:" + sch.getClZbh() + " 班次:" + sch.getDfsj() + "到终点, 时间:" + sch.getZdsjActual()); |
| 274 | //准备执行下一个班次 | 274 | //准备执行下一个班次 |
| 275 | if (next != null) { | 275 | if (next != null) { |
| 276 | //将gps转换为下一个班次走向的站内信号 | 276 | //将gps转换为下一个班次走向的站内信号 |
src/main/java/com/bsth/data/gpsdata/arrival/utils/GeoUtils.java
| @@ -96,7 +96,10 @@ public class GeoUtils { | @@ -96,7 +96,10 @@ public class GeoUtils { | ||
| 96 | public static double getDistanceFromLine(LineString line, Point p){ | 96 | public static double getDistanceFromLine(LineString line, Point p){ |
| 97 | Point s = line.getStartPoint(); | 97 | Point s = line.getStartPoint(); |
| 98 | Point e = line.getEndPoint(); | 98 | Point e = line.getEndPoint(); |
| 99 | + return getDistanceFromLine(s, e, p); | ||
| 100 | + } | ||
| 99 | 101 | ||
| 102 | + public static double getDistanceFromLine(Point s, Point e, Point p){ | ||
| 100 | double d1 = getDistance(s, p); | 103 | double d1 = getDistance(s, p); |
| 101 | double d2 = getDistance(p, e); | 104 | double d2 = getDistance(p, e); |
| 102 | double d3 = getDistance(s, e); | 105 | double d3 = getDistance(s, e); |
| @@ -147,4 +150,92 @@ public class GeoUtils { | @@ -147,4 +150,92 @@ public class GeoUtils { | ||
| 147 | public static boolean overdue(GpsEntity prevGps, GpsEntity gps) { | 150 | public static boolean overdue(GpsEntity prevGps, GpsEntity gps) { |
| 148 | return gps.getTimestamp() - prevGps.getTimestamp() < 120000; | 151 | return gps.getTimestamp() - prevGps.getTimestamp() < 120000; |
| 149 | } | 152 | } |
| 153 | + | ||
| 154 | + /** | ||
| 155 | + * 计算2条直线的最短距离 | ||
| 156 | + * @param p1 | ||
| 157 | + * @param p2 | ||
| 158 | + * @param p3 | ||
| 159 | + * @param p4 | ||
| 160 | + * @return | ||
| 161 | + */ | ||
| 162 | + public static double getDistanceLineToLine(Point p1, Point p2, Point p3, Point p4){ | ||
| 163 | + double distance; | ||
| 164 | + double x1 = p1.getX(); //A点坐标(x1,y1,z1) | ||
| 165 | + double y1 = p1.getY(); | ||
| 166 | + double z1 = 0; | ||
| 167 | + double x2 = p2.getX(); //B点坐标(x2,y2,z2) | ||
| 168 | + double y2 = p2.getY(); | ||
| 169 | + double z2 = 0; | ||
| 170 | + double x3 = p3.getX(); //C点坐标(x3,y3,z3) | ||
| 171 | + double y3 = p3.getY(); | ||
| 172 | + double z3 = 0; | ||
| 173 | + double x4 = p4.getX(); //D点坐标(x4,y4,z4) | ||
| 174 | + double y4 = p4.getY(); | ||
| 175 | + double z4 = 0; | ||
| 176 | + | ||
| 177 | + double a = (x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)+(z2-z1)*(z2-z1); | ||
| 178 | + double b = -((x2-x1)*(x4-x3)+(y2-y1)*(y4-y3)+(z2-z1)*(z4-z3)); | ||
| 179 | + double c = -((x1-x2)*(x1-x3)+(y1-y2)*(y1-y3)+(z1-z2)*(z1-z3)); | ||
| 180 | + | ||
| 181 | + double d = -((x2-x1)*(x4-x3)+(y2-y1)*(y4-y3)+(z2-z1)*(z4-z3)); | ||
| 182 | + double e = (x4-x3)*(x4-x3)+(y4-y3)*(y4-y3)+(z4-z3)*(z4-z3); | ||
| 183 | + double f = -((x1-x3)*(x4-x3)+(y1-y3)*(y4-y3)+(z1-z3)*(z4-z3)); | ||
| 184 | + | ||
| 185 | + //平行 | ||
| 186 | + if ((a*e-b*d)==0&&(b*d-a*e)==0) | ||
| 187 | + { | ||
| 188 | + double d1 = getDistance(p1, p3); | ||
| 189 | + double d2 = getDistance(p1, p4); | ||
| 190 | + distance = (d1<d2)?d1:d2; | ||
| 191 | + return distance; | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + double s = (b*f-e*c)/(a*e-b*d); | ||
| 195 | + double t = (a*f-d*c)/(b*d-a*e); | ||
| 196 | + | ||
| 197 | + //说明P点落在线段AB上,Q点落在线段CD上 | ||
| 198 | + if(0<=s&&s<=1&&0<=t&&t<=1) | ||
| 199 | + { | ||
| 200 | + //2条线段的公垂线段PQ; | ||
| 201 | + //P点坐标 | ||
| 202 | + double X = x1+s*(x2-x1); | ||
| 203 | + double Y = y1+s*(y2-y1); | ||
| 204 | + double Z = z1+s*(z2-z1); | ||
| 205 | + //Q点坐标 | ||
| 206 | + double U = x3+t*(x4-x3); | ||
| 207 | + double V = y3+t*(y4-y3); | ||
| 208 | + double W = z3+t*(z4-z3); | ||
| 209 | + Point p = geometryFactory.createPoint(new Coordinate(X, Y, Z)); | ||
| 210 | + Point q = geometryFactory.createPoint(new Coordinate(U, V, W)); | ||
| 211 | + distance = getDistance(p, q); | ||
| 212 | + } | ||
| 213 | + else | ||
| 214 | + { | ||
| 215 | + double d1 = getDistanceFromLine(p3,p4,p1); | ||
| 216 | + double d2 = getDistanceFromLine(p3,p4,p2); | ||
| 217 | + double d3 = getDistanceFromLine(p1,p2,p3); | ||
| 218 | + double d4 = getDistanceFromLine(p1,p2,p4); | ||
| 219 | + distance = (d1<d2)?d1:d2; | ||
| 220 | + distance = (distance<d3)?distance:d3; | ||
| 221 | + distance = (distance<d4)?distance:d4; | ||
| 222 | + } | ||
| 223 | + | ||
| 224 | + return distance; | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + /** | ||
| 228 | + * 计算点 到 线的垂直交点 | ||
| 229 | + * @param lp1 | ||
| 230 | + * @param lp2 | ||
| 231 | + * @param p | ||
| 232 | + * @return | ||
| 233 | + */ | ||
| 234 | + public static Point perpendularPoint(Point lp1, Point lp2, Point p){ | ||
| 235 | + double a = lp1.getX() - lp2.getX(), b = lp2.getY() - lp1.getY(), c = lp1.getY() * lp2.getX() - lp2.getY() * lp1.getX(); | ||
| 236 | + double lon = (Math.pow(b, 2) * p.getY() - a * b * p.getX() - a * c) / (Math.pow(a, 2) + Math.pow(b, 2)); | ||
| 237 | + double lat = (Math.pow(a, 2) * p.getX() - a * b * p.getY() - b * c) / (Math.pow(a, 2) + Math.pow(b, 2)); | ||
| 238 | + | ||
| 239 | + return geometryFactory.createPoint(new Coordinate(lat, lon)); | ||
| 240 | + } | ||
| 150 | } | 241 | } |
src/main/java/com/bsth/data/gpsdata/arrival/utils/ScheduleSignalState.java
| @@ -72,7 +72,7 @@ public class ScheduleSignalState { | @@ -72,7 +72,7 @@ public class ScheduleSignalState { | ||
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | ScheduleRealInfo next = dayOfSchedule.next(sch); | 74 | ScheduleRealInfo next = dayOfSchedule.next(sch); |
| 75 | - if (next.getXlDir().equals(sch.getXlDir())) | 75 | + if (next != null && next.getXlDir().equals(sch.getXlDir())) |
| 76 | return; | 76 | return; |
| 77 | 77 | ||
| 78 | //时间足够下一个班次待发时间运行到当前站 | 78 | //时间足够下一个班次待发时间运行到当前站 |
src/main/java/com/bsth/data/gpsdata/thread/GpsDataLoaderThread.java
| @@ -113,8 +113,8 @@ public class GpsDataLoaderThread extends Thread { | @@ -113,8 +113,8 @@ public class GpsDataLoaderThread extends Thread { | ||
| 113 | gps.setNbbm(nbbm); | 113 | gps.setNbbm(nbbm); |
| 114 | //有更新的点位 | 114 | //有更新的点位 |
| 115 | updateList.add(gps); | 115 | updateList.add(gps); |
| 116 | - logger.info("全量点:"+ list.size() +",更新点" + updateList.size()); | ||
| 117 | } | 116 | } |
| 117 | + logger.info("全量点:"+ list.size() +",更新点" + updateList.size()); | ||
| 118 | //分析数据 | 118 | //分析数据 |
| 119 | gpsRealAnalyse.analyse(updateList); | 119 | gpsRealAnalyse.analyse(updateList); |
| 120 | } else | 120 | } else |
src/main/java/com/bsth/service/realcontrol/ChildTaskPlanService.java
| @@ -3,6 +3,11 @@ package com.bsth.service.realcontrol; | @@ -3,6 +3,11 @@ package com.bsth.service.realcontrol; | ||
| 3 | import com.bsth.entity.realcontrol.ChildTaskPlan; | 3 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 4 | import com.bsth.service.BaseService; | 4 | import com.bsth.service.BaseService; |
| 5 | 5 | ||
| 6 | +import java.util.Map; | ||
| 7 | + | ||
| 6 | public interface ChildTaskPlanService extends BaseService<ChildTaskPlan, Long>{ | 8 | public interface ChildTaskPlanService extends BaseService<ChildTaskPlan, Long>{ |
| 7 | 9 | ||
| 10 | + Map<String,Object> saveHistory(ChildTaskPlan childTask); | ||
| 11 | + | ||
| 12 | + Map<String,Object> delHistory(Long id); | ||
| 8 | } | 13 | } |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| @@ -138,7 +138,7 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | @@ -138,7 +138,7 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | ||
| 138 | 138 | ||
| 139 | Map<String,Object> changeBcType(Long id, String bcType, String remarks); | 139 | Map<String,Object> changeBcType(Long id, String bcType, String remarks); |
| 140 | 140 | ||
| 141 | - //Map<String,Object> historySave(ScheduleRealInfo sch); | 141 | + Map<String,Object> historySave(ScheduleRealInfo sch); |
| 142 | 142 | ||
| 143 | Map<String, Object> MapById(Long id) ; | 143 | Map<String, Object> MapById(Long id) ; |
| 144 | 144 | ||
| @@ -165,4 +165,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | @@ -165,4 +165,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L | ||
| 165 | Map<String,Object> lateAdjust(String idx, float minute); | 165 | Map<String,Object> lateAdjust(String idx, float minute); |
| 166 | 166 | ||
| 167 | List<ScheduleRealInfo> allLate2(String idx); | 167 | List<ScheduleRealInfo> allLate2(String idx); |
| 168 | + | ||
| 169 | + Map<String,Object> addToHistory(ScheduleRealInfo sch); | ||
| 170 | + | ||
| 171 | + Map<String, Object> deleteToHistory(Long id); | ||
| 168 | } | 172 | } |
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
| @@ -86,4 +86,33 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | @@ -86,4 +86,33 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | ||
| 86 | rs.put("t", sch); | 86 | rs.put("t", sch); |
| 87 | return rs; | 87 | return rs; |
| 88 | } | 88 | } |
| 89 | + | ||
| 90 | + @Override | ||
| 91 | + public Map<String, Object> saveHistory(ChildTaskPlan t) { | ||
| 92 | + Map<String, Object> rs = new HashMap(); | ||
| 93 | + try { | ||
| 94 | + ScheduleRealInfo sch = t.getSchedule(); | ||
| 95 | + //保存起终点名称 | ||
| 96 | + String prefix = sch.getXlBm() + "_" + sch.getXlDir() + "_"; | ||
| 97 | + if(StringUtils.isEmpty(t.getStartStationName())) | ||
| 98 | + t.setStartStationName(BasicData.getStationNameByCode(t.getStartStation(), prefix)); | ||
| 99 | + | ||
| 100 | + if(StringUtils.isEmpty(t.getEndStationName())) | ||
| 101 | + t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix)); | ||
| 102 | + //先持久化子任务 | ||
| 103 | + rs = super.save(t); | ||
| 104 | + | ||
| 105 | + rs.put("status", ResponseCode.SUCCESS); | ||
| 106 | + }catch (Exception e){ | ||
| 107 | + logger.error("", e); | ||
| 108 | + rs.put("status", ResponseCode.ERROR); | ||
| 109 | + rs.put("msg", e.getMessage()); | ||
| 110 | + } | ||
| 111 | + return rs; | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + @Override | ||
| 115 | + public Map<String, Object> delHistory(Long id) { | ||
| 116 | + return super.delete(id); | ||
| 117 | + } | ||
| 89 | } | 118 | } |
src/main/java/com/bsth/service/realcontrol/impl/RealMapServiceImpl.java
| @@ -7,6 +7,7 @@ import com.bsth.entity.CarPark; | @@ -7,6 +7,7 @@ import com.bsth.entity.CarPark; | ||
| 7 | import com.bsth.service.realcontrol.RealMapService; | 7 | import com.bsth.service.realcontrol.RealMapService; |
| 8 | import com.bsth.service.realcontrol.dto.SectionRouteCoords; | 8 | import com.bsth.service.realcontrol.dto.SectionRouteCoords; |
| 9 | import com.bsth.util.TransGPS; | 9 | import com.bsth.util.TransGPS; |
| 10 | +import com.google.common.base.Joiner; | ||
| 10 | import com.google.common.base.Splitter; | 11 | import com.google.common.base.Splitter; |
| 11 | import com.google.common.collect.ArrayListMultimap; | 12 | import com.google.common.collect.ArrayListMultimap; |
| 12 | import com.vividsolutions.jts.geom.*; | 13 | import com.vividsolutions.jts.geom.*; |
| @@ -262,18 +263,18 @@ public class RealMapServiceImpl implements RealMapService { | @@ -262,18 +263,18 @@ public class RealMapServiceImpl implements RealMapService { | ||
| 262 | if(len == 0) | 263 | if(len == 0) |
| 263 | return rs; | 264 | return rs; |
| 264 | 265 | ||
| 265 | - StringBuilder joinstr = new StringBuilder(list.get(0)); | 266 | + String joinstr = list.get(0); |
| 266 | String str; | 267 | String str; |
| 267 | for(int i = 1; i < len; i ++){ | 268 | for(int i = 1; i < len; i ++){ |
| 268 | str = jointCoords(joinstr.toString(), list.get(i)); | 269 | str = jointCoords(joinstr.toString(), list.get(i)); |
| 269 | if(str != null) | 270 | if(str != null) |
| 270 | - joinstr.append("," + str); | 271 | + joinstr = str; |
| 271 | else{ | 272 | else{ |
| 272 | rs.add(joinstr.toString()); | 273 | rs.add(joinstr.toString()); |
| 273 | - joinstr = new StringBuilder(list.get(i)); | 274 | + joinstr = list.get(i); |
| 274 | } | 275 | } |
| 275 | } | 276 | } |
| 276 | - rs.add(joinstr.toString()); | 277 | + rs.add(joinstr); |
| 277 | return rs; | 278 | return rs; |
| 278 | } | 279 | } |
| 279 | 280 | ||
| @@ -283,18 +284,57 @@ public class RealMapServiceImpl implements RealMapService { | @@ -283,18 +284,57 @@ public class RealMapServiceImpl implements RealMapService { | ||
| 283 | LineString s1 = createLineString(c1); | 284 | LineString s1 = createLineString(c1); |
| 284 | LineString s2 = createLineString(c2); | 285 | LineString s2 = createLineString(c2); |
| 285 | 286 | ||
| 286 | - if(s1.intersects(s2)){ | ||
| 287 | - Geometry g = s1.intersection(s2); | ||
| 288 | - Point inPoint = geometryFactory.createPoint(g.getCoordinates()[0]);//第一个交点 | ||
| 289 | 287 | ||
| 290 | - //第一条线截断至交点 | ||
| 291 | - rs = truncationEnd(s1, inPoint); | ||
| 292 | - //第二条线从交点开始 | ||
| 293 | - rs += ("," + truncationStart(s2, inPoint)); | 288 | + /*if(s1.intersects(s2)){ |
| 289 | + //2条线相交 | ||
| 290 | + Geometry g = s1.intersection(s2); | ||
| 291 | + Point inPoint = geometryFactory.createPoint(g.getCoordinates()[0]); | ||
| 292 | + //s1 = replacePoint(s1, s1.getCoordinates().length - 1, inPoint); | ||
| 293 | + //s2 = replacePoint(s2, 0, inPoint); | ||
| 294 | + | ||
| 295 | + //rs = toString(s1); | ||
| 296 | + //rs += ("," + toString(s2)); | ||
| 297 | + rs = replacePoint(c1, s1.getCoordinates().length - 1, inPoint); | ||
| 298 | + rs += ("," + replacePoint(c2, 0, null)); | ||
| 294 | } | 299 | } |
| 300 | + else {*/ | ||
| 301 | + //距离10米内的点直接连起来 | ||
| 302 | + double distance = GeoUtils.getDistanceLineToLine(s1.getStartPoint(), s1.getEndPoint(), s2.getStartPoint(), s2.getEndPoint()); | ||
| 303 | + if(distance < 10){ | ||
| 304 | + //s2 = replacePoint(s2, 0, s1.getEndPoint()); | ||
| 305 | + rs = c1; | ||
| 306 | + | ||
| 307 | + //获取c1终点到 c2 的垂直交点 | ||
| 308 | + //s1.getEndPoint() | ||
| 309 | + //rs += ("," + replacePoint(c2, 0, null)); | ||
| 310 | + //rs = toString(s1); | ||
| 311 | + //rs += ("," + toString(s2)); | ||
| 312 | + } | ||
| 313 | + //} | ||
| 295 | return rs; | 314 | return rs; |
| 296 | } | 315 | } |
| 297 | 316 | ||
| 317 | + /** | ||
| 318 | + * 替换线段中指定的一个点位 | ||
| 319 | + * @param index | ||
| 320 | + * @param p | ||
| 321 | + | ||
| 322 | + private LineString replacePoint(LineString line, int index, Point p){ | ||
| 323 | + Coordinate[] array = line.getCoordinates(); | ||
| 324 | + array[index] = p.getCoordinate(); | ||
| 325 | + | ||
| 326 | + return geometryFactory.createLineString(array); | ||
| 327 | + }*/ | ||
| 328 | + | ||
| 329 | + private String replacePoint(String lineStr, int index, Point p){ | ||
| 330 | + List<String> list = new ArrayList<>(Splitter.on(",").splitToList(lineStr)); | ||
| 331 | + list.remove(index); | ||
| 332 | + if(p != null){ | ||
| 333 | + list.add(index, p.getX() + " " + p.getY()); | ||
| 334 | + } | ||
| 335 | + return Joiner.on(",").join(list); | ||
| 336 | + } | ||
| 337 | + | ||
| 298 | private LineString createLineString(String c){ | 338 | private LineString createLineString(String c){ |
| 299 | List<String> list = Splitter.on(",").splitToList(c); | 339 | List<String> list = Splitter.on(",").splitToList(c); |
| 300 | 340 | ||
| @@ -307,7 +347,24 @@ public class RealMapServiceImpl implements RealMapService { | @@ -307,7 +347,24 @@ public class RealMapServiceImpl implements RealMapService { | ||
| 307 | return geometryFactory.createLineString(cds); | 347 | return geometryFactory.createLineString(cds); |
| 308 | } | 348 | } |
| 309 | 349 | ||
| 310 | - private String truncationEnd(LineString lineString, Point p){ | 350 | + private String toString(LineString line){ |
| 351 | + Coordinate[] all = line.getCoordinates(); | ||
| 352 | + | ||
| 353 | + Coordinate[] cs; | ||
| 354 | + StringBuilder sb = new StringBuilder(""); | ||
| 355 | + for(int i = 0; i < all.length - 1; i ++){ | ||
| 356 | + cs = new Coordinate[2]; | ||
| 357 | + cs[0] = all[i]; | ||
| 358 | + cs[1] = all[i + 1]; | ||
| 359 | + | ||
| 360 | + sb.append("," + cs[0].y + " " + cs[0].x); | ||
| 361 | + sb.append("," + cs[1].y + " " + cs[1].x); | ||
| 362 | + } | ||
| 363 | + sb.deleteCharAt(0); | ||
| 364 | + return sb.toString(); | ||
| 365 | + } | ||
| 366 | + | ||
| 367 | +/* private String truncationEnd(LineString lineString, Point p){ | ||
| 311 | Coordinate[] all = lineString.getCoordinates(); | 368 | Coordinate[] all = lineString.getCoordinates(); |
| 312 | LineString sl; | 369 | LineString sl; |
| 313 | 370 | ||
| @@ -359,5 +416,5 @@ public class RealMapServiceImpl implements RealMapService { | @@ -359,5 +416,5 @@ public class RealMapServiceImpl implements RealMapService { | ||
| 359 | } | 416 | } |
| 360 | sb.deleteCharAt(0); | 417 | sb.deleteCharAt(0); |
| 361 | return sb.toString(); | 418 | return sb.toString(); |
| 362 | - } | 419 | + }*/ |
| 363 | } | 420 | } |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -49,7 +49,6 @@ import com.bsth.service.sys.DutyEmployeeService; | @@ -49,7 +49,6 @@ import com.bsth.service.sys.DutyEmployeeService; | ||
| 49 | import com.bsth.util.*; | 49 | import com.bsth.util.*; |
| 50 | import com.bsth.websocket.handler.SendUtils; | 50 | import com.bsth.websocket.handler.SendUtils; |
| 51 | import com.google.common.base.Splitter; | 51 | import com.google.common.base.Splitter; |
| 52 | -import com.google.common.collect.BiMap; | ||
| 53 | import com.google.common.collect.Lists; | 52 | import com.google.common.collect.Lists; |
| 54 | import org.apache.commons.lang3.StringEscapeUtils; | 53 | import org.apache.commons.lang3.StringEscapeUtils; |
| 55 | import org.apache.commons.lang3.StringUtils; | 54 | import org.apache.commons.lang3.StringUtils; |
| @@ -135,9 +134,50 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -135,9 +134,50 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 135 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 134 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 136 | 135 | ||
| 137 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 136 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 138 | - sdfMinute = new SimpleDateFormat("yyyy-MM-dd HH:mm"), sdfShort = new SimpleDateFormat("HH:mm"), | ||
| 139 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 137 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 140 | 138 | ||
| 139 | + | ||
| 140 | + /** | ||
| 141 | + * 车辆是否存在 | ||
| 142 | + * @param gsbm 公司编码 | ||
| 143 | + * @param nbbm 车辆自编号 | ||
| 144 | + * @return | ||
| 145 | + */ | ||
| 146 | + private boolean carExist(String gsbm, String nbbm){ | ||
| 147 | + return BasicData.deviceId2NbbmMap.inverse().containsKey(nbbm); | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + /** | ||
| 151 | + * 获取人员姓名 | ||
| 152 | + * @param gsbm 公司编码 | ||
| 153 | + * @param gh 人员工号 | ||
| 154 | + * @return | ||
| 155 | + */ | ||
| 156 | + private String getPersonName(String gsbm, String gh){ | ||
| 157 | + return BasicData.allPerson.get(gsbm + '-' + gh); | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + @Override | ||
| 161 | + public Iterable<ScheduleRealInfo> list(Map<String, Object> map) { | ||
| 162 | + Iterator<ScheduleRealInfo> iterator = super.list(map).iterator(); | ||
| 163 | + Set<ScheduleRealInfo> set = new HashSet<>(100); | ||
| 164 | + | ||
| 165 | + DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm"); | ||
| 166 | + //计算时间戳 | ||
| 167 | + ScheduleRealInfo sch; | ||
| 168 | + while(iterator.hasNext()){ | ||
| 169 | + sch = iterator.next(); | ||
| 170 | + //待发时间戳 | ||
| 171 | + sch.setDfsjT(fmtyyyyMMddHHmm.parseMillis(sch.getRealExecDate() + sch.getDfsj())); | ||
| 172 | + //实发时间戳 | ||
| 173 | + if(StringUtils.isNotEmpty(sch.getFcsjActual())){ | ||
| 174 | + sch.setFcsjActualTime(fmtyyyyMMddHHmm.parseMillis(sch.getRealExecDate() + sch.getFcsjActual())); | ||
| 175 | + } | ||
| 176 | + set.add(sch); | ||
| 177 | + } | ||
| 178 | + return set; | ||
| 179 | + } | ||
| 180 | + | ||
| 141 | @Override | 181 | @Override |
| 142 | public Map<String, Collection<ScheduleRealInfo>> findByLines(String lines) { | 182 | public Map<String, Collection<ScheduleRealInfo>> findByLines(String lines) { |
| 143 | List<String> lineList = Lists.newArrayList(Splitter.on(',').trimResults().omitEmptyStrings().split(lines)); | 183 | List<String> lineList = Lists.newArrayList(Splitter.on(',').trimResults().omitEmptyStrings().split(lines)); |
| @@ -315,6 +355,97 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -315,6 +355,97 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 315 | return rsList; | 355 | return rsList; |
| 316 | } | 356 | } |
| 317 | 357 | ||
| 358 | + /** | ||
| 359 | + * 添加到历史库 | ||
| 360 | + * @param t | ||
| 361 | + * @return | ||
| 362 | + */ | ||
| 363 | + @Override | ||
| 364 | + public Map<String, Object> addToHistory(ScheduleRealInfo t) { | ||
| 365 | + Map<String, Object> rs = new HashMap<>(); | ||
| 366 | + try { | ||
| 367 | + if (!carExist(t.getGsBm(), t.getClZbh())) { | ||
| 368 | + rs.put("msg", "车辆 " + t.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!"); | ||
| 369 | + rs.put("status", ResponseCode.ERROR); | ||
| 370 | + return rs; | ||
| 371 | + } | ||
| 372 | + | ||
| 373 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 374 | + //String schDate = DayOfSchedule.currSchDateMap.get(t.getXlBm()); | ||
| 375 | + | ||
| 376 | + SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd"), sdfyyyyMMddHHmm = new SimpleDateFormat("yyyy-MM-ddHH:mm"); | ||
| 377 | + | ||
| 378 | + if (StringUtils.isEmpty(t.getjGh())) { | ||
| 379 | + rs.put("status", ResponseCode.ERROR); | ||
| 380 | + rs.put("msg", "驾驶员工号不能为空!"); | ||
| 381 | + return rs; | ||
| 382 | + } | ||
| 383 | + //截取驾驶员工号 | ||
| 384 | + if (t.getjGh().indexOf("-") != -1) { | ||
| 385 | + t.setjGh(t.getjGh().split("-")[1]); | ||
| 386 | + } | ||
| 387 | + //检查驾驶员工号 | ||
| 388 | + String jName = getPersonName(t.getGsBm() ,t.getjGh()); | ||
| 389 | + if(StringUtils.isEmpty(jName)){ | ||
| 390 | + rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的驾驶员"); | ||
| 391 | + rs.put("status", ResponseCode.ERROR); | ||
| 392 | + return rs; | ||
| 393 | + } | ||
| 394 | + else if(StringUtils.isEmpty(t.getjName())){ | ||
| 395 | + t.setjName(jName);//补上驾驶员名称 | ||
| 396 | + } | ||
| 397 | + | ||
| 398 | + //有售票员 | ||
| 399 | + if(StringUtils.isNotEmpty(t.getsGh())){ | ||
| 400 | + String sName = getPersonName(t.getGsBm() , t.getsGh()); | ||
| 401 | + if(StringUtils.isEmpty(sName)){ | ||
| 402 | + rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的售票员"); | ||
| 403 | + rs.put("status", ResponseCode.ERROR); | ||
| 404 | + return rs; | ||
| 405 | + }else if(StringUtils.isEmpty(t.getsName())){ | ||
| 406 | + t.setsName(sName);//补上售票员名称 | ||
| 407 | + } | ||
| 408 | + } | ||
| 409 | + | ||
| 410 | + //公司 和 分公司名称 | ||
| 411 | + t.setGsName(BasicData.businessCodeNameMap.get(t.getGsBm())); | ||
| 412 | + t.setFgsName(BasicData.businessFgsCodeNameMap.get(t.getGsBm() + "_" + t.getFgsBm())); | ||
| 413 | + | ||
| 414 | + //t.setScheduleDateStr(schDate); | ||
| 415 | + t.setScheduleDate(sdfyyyyMMdd.parse(t.getScheduleDateStr())); | ||
| 416 | + t.setRealExecDate(t.getScheduleDateStr()); | ||
| 417 | + t.setCreateBy(user); | ||
| 418 | + t.setSflj(true); | ||
| 419 | + t.setLate(false); | ||
| 420 | + t.setDfsj(t.getFcsj()); | ||
| 421 | + t.setZdsjT(sdfyyyyMMddHHmm.parse(t.getScheduleDateStr() + t.getZdsj()).getTime()); | ||
| 422 | + t.setJhlcOrig(t.getJhlc()); | ||
| 423 | + | ||
| 424 | + //班次历时 | ||
| 425 | + t.setBcsj(DateUtils.calcHHmmDiff(t.getFcsj(), t.getZdsj()) / 1000 / 60); | ||
| 426 | + | ||
| 427 | + //起终点名称 | ||
| 428 | + String prefix = t.getXlBm() + "_" + t.getXlDir() + "_"; | ||
| 429 | + t.setQdzName(BasicData.getStationNameByCode(t.getQdzCode(), prefix)); | ||
| 430 | + t.setZdzName(BasicData.getStationNameByCode(t.getZdzCode(), prefix)); | ||
| 431 | + | ||
| 432 | + //计算班次实际执行时间 | ||
| 433 | + schAttrCalculator.calcRealDate(t).calcAllTimeByFcsj(t); | ||
| 434 | + if (t.getZdsjT() < t.getFcsjT()) { | ||
| 435 | + rs.put("status", ResponseCode.ERROR); | ||
| 436 | + rs.put("msg", "起终点时间异常!"); | ||
| 437 | + return rs; | ||
| 438 | + } | ||
| 439 | + | ||
| 440 | + //实时入库 | ||
| 441 | + rs = super.save(t); | ||
| 442 | + } catch (Exception e) { | ||
| 443 | + logger.error("", e); | ||
| 444 | + rs.put("status", ResponseCode.ERROR); | ||
| 445 | + } | ||
| 446 | + return rs; | ||
| 447 | + } | ||
| 448 | + | ||
| 318 | 449 | ||
| 319 | /** | 450 | /** |
| 320 | * 临加班次 | 451 | * 临加班次 |
| @@ -323,7 +454,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -323,7 +454,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 323 | public Map<String, Object> save(ScheduleRealInfo t) { | 454 | public Map<String, Object> save(ScheduleRealInfo t) { |
| 324 | Map<String, Object> rs = new HashMap<>(); | 455 | Map<String, Object> rs = new HashMap<>(); |
| 325 | try { | 456 | try { |
| 326 | - if (BasicData.deviceId2NbbmMap.inverse().get(t.getClZbh()) == null) { | 457 | + if (!carExist(t.getGsBm(), t.getClZbh())) { |
| 327 | rs.put("msg", "车辆 " + t.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!"); | 458 | rs.put("msg", "车辆 " + t.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!"); |
| 328 | rs.put("status", ResponseCode.ERROR); | 459 | rs.put("status", ResponseCode.ERROR); |
| 329 | return rs; | 460 | return rs; |
| @@ -344,7 +475,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -344,7 +475,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 344 | t.setjGh(t.getjGh().split("-")[1]); | 475 | t.setjGh(t.getjGh().split("-")[1]); |
| 345 | } | 476 | } |
| 346 | //检查驾驶员工号 | 477 | //检查驾驶员工号 |
| 347 | - String jName = BasicData.allPerson.get(t.getGsBm() + '-' + t.getjGh()); | 478 | + String jName = getPersonName(t.getGsBm() ,t.getjGh()); |
| 348 | if(StringUtils.isEmpty(jName)){ | 479 | if(StringUtils.isEmpty(jName)){ |
| 349 | rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的驾驶员"); | 480 | rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的驾驶员"); |
| 350 | rs.put("status", ResponseCode.ERROR); | 481 | rs.put("status", ResponseCode.ERROR); |
| @@ -356,7 +487,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -356,7 +487,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 356 | 487 | ||
| 357 | //有售票员 | 488 | //有售票员 |
| 358 | if(StringUtils.isNotEmpty(t.getsGh())){ | 489 | if(StringUtils.isNotEmpty(t.getsGh())){ |
| 359 | - String sName = BasicData.allPerson.get(t.getGsBm() + '-' + t.getsGh()); | 490 | + String sName = getPersonName(t.getGsBm() , t.getsGh()); |
| 360 | if(StringUtils.isEmpty(sName)){ | 491 | if(StringUtils.isEmpty(sName)){ |
| 361 | rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的售票员"); | 492 | rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的售票员"); |
| 362 | rs.put("status", ResponseCode.ERROR); | 493 | rs.put("status", ResponseCode.ERROR); |
| @@ -409,7 +540,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -409,7 +540,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 409 | dayOfSchedule.reCalcExecPlan(t.getClZbh()); | 540 | dayOfSchedule.reCalcExecPlan(t.getClZbh()); |
| 410 | 541 | ||
| 411 | 542 | ||
| 412 | - rs.put("ts", ts); | 543 | + rs.put("ts", ts); |
| 413 | rs.put("t", t); | 544 | rs.put("t", t); |
| 414 | } catch (Exception e) { | 545 | } catch (Exception e) { |
| 415 | logger.error("", e); | 546 | logger.error("", e); |
| @@ -418,6 +549,41 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -418,6 +549,41 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 418 | return rs; | 549 | return rs; |
| 419 | } | 550 | } |
| 420 | 551 | ||
| 552 | + /** | ||
| 553 | + * 删除历史表临加班次 | ||
| 554 | + * @param id | ||
| 555 | + * @return | ||
| 556 | + */ | ||
| 557 | + @Override | ||
| 558 | + public Map<String, Object> deleteToHistory(Long id) { | ||
| 559 | + Map<String, Object> rs = new HashMap<>(); | ||
| 560 | + rs.put("status", ResponseCode.ERROR); | ||
| 561 | + | ||
| 562 | + try { | ||
| 563 | + ScheduleRealInfo sch = super.findById(id); | ||
| 564 | + if (sch == null) { | ||
| 565 | + rs.put("msg", "无效的id号"); | ||
| 566 | + return rs; | ||
| 567 | + } | ||
| 568 | + | ||
| 569 | + if (!sch.isSflj()) { | ||
| 570 | + rs.put("msg", "你只能删除临加班次"); | ||
| 571 | + return rs; | ||
| 572 | + } | ||
| 573 | + | ||
| 574 | + //解除和调度指令的外键约束 | ||
| 575 | + jdbcTemplate.update(Constants.REMOVE_DIRECTIVE_SCH_FK, id); | ||
| 576 | + | ||
| 577 | + //数据库删除 | ||
| 578 | + rs = super.delete(id); | ||
| 579 | + }catch (Exception e){ | ||
| 580 | + logger.error("", e); | ||
| 581 | + rs.put("msg", e.getMessage()); | ||
| 582 | + } | ||
| 583 | + | ||
| 584 | + return rs; | ||
| 585 | + } | ||
| 586 | + | ||
| 421 | @Override | 587 | @Override |
| 422 | public Map<String, Object> delete(Long id) { | 588 | public Map<String, Object> delete(Long id) { |
| 423 | Map<String, Object> rs = new HashMap<>(); | 589 | Map<String, Object> rs = new HashMap<>(); |
| @@ -999,7 +1165,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -999,7 +1165,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 999 | String clZbh = map.get("clZbh"); | 1165 | String clZbh = map.get("clZbh"); |
| 1000 | if (StringUtils.isNotEmpty(clZbh)) { | 1166 | if (StringUtils.isNotEmpty(clZbh)) { |
| 1001 | //换车 | 1167 | //换车 |
| 1002 | - if (!BasicData.deviceId2NbbmMap.inverse().containsKey(clZbh)) { | 1168 | + if (!carExist(sch.getGsBm(), clZbh)) { |
| 1003 | rs.put("status", ResponseCode.ERROR); | 1169 | rs.put("status", ResponseCode.ERROR); |
| 1004 | rs.put("msg", "车辆 " + clZbh + " 不存在!"); | 1170 | rs.put("msg", "车辆 " + clZbh + " 不存在!"); |
| 1005 | return rs; | 1171 | return rs; |
| @@ -1013,7 +1179,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1013,7 +1179,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1013 | */ | 1179 | */ |
| 1014 | String jsy = map.get("jsy"); | 1180 | String jsy = map.get("jsy"); |
| 1015 | if (StringUtils.isNotEmpty(jsy) && jsy.indexOf("/") != -1) { | 1181 | if (StringUtils.isNotEmpty(jsy) && jsy.indexOf("/") != -1) { |
| 1016 | - persoChange(sch, jsy.split("/")[0]); | 1182 | + String jGh = jsy.split("/")[0]; |
| 1183 | + String jName = getPersonName(sch.getGsBm(), jGh); | ||
| 1184 | + if(StringUtils.isEmpty(jName)){ | ||
| 1185 | + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + jGh + "】的驾驶员"); | ||
| 1186 | + rs.put("status", ResponseCode.ERROR); | ||
| 1187 | + return rs; | ||
| 1188 | + } | ||
| 1189 | + persoChange(sch, jGh); | ||
| 1017 | } | 1190 | } |
| 1018 | 1191 | ||
| 1019 | /** | 1192 | /** |
| @@ -1021,7 +1194,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1021,7 +1194,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1021 | */ | 1194 | */ |
| 1022 | String spy = map.get("spy"); | 1195 | String spy = map.get("spy"); |
| 1023 | if (StringUtils.isNotEmpty(spy) && spy.indexOf("/") != -1 && !spy.equals("/")) { | 1196 | if (StringUtils.isNotEmpty(spy) && spy.indexOf("/") != -1 && !spy.equals("/")) { |
| 1024 | - persoChangeSPY(sch, spy.split("/")[0]); | 1197 | + String sGh = spy.split("/")[0]; |
| 1198 | + String sName = getPersonName(sch.getGsBm(), sGh); | ||
| 1199 | + if(StringUtils.isEmpty(sName)){ | ||
| 1200 | + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sGh + "】的售票员"); | ||
| 1201 | + rs.put("status", ResponseCode.ERROR); | ||
| 1202 | + return rs; | ||
| 1203 | + } | ||
| 1204 | + persoChangeSPY(sch, sGh); | ||
| 1025 | } | 1205 | } |
| 1026 | else{ | 1206 | else{ |
| 1027 | sch.setsGh(""); | 1207 | sch.setsGh(""); |
| @@ -2852,23 +3032,25 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2852,23 +3032,25 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2852 | Set<ScheduleRealInfo> set = new HashSet<>(); | 3032 | Set<ScheduleRealInfo> set = new HashSet<>(); |
| 2853 | 3033 | ||
| 2854 | ScheduleRealInfo sch; | 3034 | ScheduleRealInfo sch; |
| 2855 | - BiMap<String, String> map = BasicData.deviceId2NbbmMap.inverse(); | 3035 | + //BiMap<String, String> map = BasicData.deviceId2NbbmMap.inverse(); |
| 2856 | 3036 | ||
| 3037 | + String jGh,jName,sGh,sName; | ||
| 2857 | for (ChangePersonCar cpc : cpcs) { | 3038 | for (ChangePersonCar cpc : cpcs) { |
| 2858 | 3039 | ||
| 2859 | - if (cpc.getClZbh() != null && map.get(cpc.getClZbh()) == null) { | 3040 | + sch = dayOfSchedule.get(cpc.getSchId()); |
| 3041 | + if (sch == null) | ||
| 3042 | + continue; | ||
| 3043 | + | ||
| 3044 | + if (cpc.getClZbh() != null && !carExist(sch.getGsBm(), cpc.getClZbh())) { | ||
| 2860 | rs.put("msg", "车辆 " + cpc.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!"); | 3045 | rs.put("msg", "车辆 " + cpc.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!"); |
| 2861 | rs.put("status", ResponseCode.ERROR); | 3046 | rs.put("status", ResponseCode.ERROR); |
| 2862 | return rs; | 3047 | return rs; |
| 2863 | } | 3048 | } |
| 2864 | 3049 | ||
| 2865 | - sch = dayOfSchedule.get(cpc.getSchId()); | ||
| 2866 | - if (sch == null) | ||
| 2867 | - continue; | ||
| 2868 | - | ||
| 2869 | if (StringUtils.isNotEmpty(cpc.getJsy())) { | 3050 | if (StringUtils.isNotEmpty(cpc.getJsy())) { |
| 2870 | - String jGh = cpc.getJsy().split("/")[0]; | ||
| 2871 | - if(!BasicData.allPerson.containsKey(sch.getGsBm()+"-"+jGh)){ | 3051 | + jGh = cpc.getJsy().split("/")[0]; |
| 3052 | + jName = getPersonName(sch.getGsBm(), jGh); | ||
| 3053 | + if(StringUtils.isEmpty(jName)){ | ||
| 2872 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + jGh + "】的驾驶员"); | 3054 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + jGh + "】的驾驶员"); |
| 2873 | rs.put("status", ResponseCode.ERROR); | 3055 | rs.put("status", ResponseCode.ERROR); |
| 2874 | return rs; | 3056 | return rs; |
| @@ -2880,9 +3062,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2880,9 +3062,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2880 | 3062 | ||
| 2881 | //换售票员 | 3063 | //换售票员 |
| 2882 | if (StringUtils.isNotEmpty(cpc.getSpy())) { | 3064 | if (StringUtils.isNotEmpty(cpc.getSpy())) { |
| 2883 | - persoChangeSPY(sch, cpc.getSpy().split("/")[0]); | 3065 | + sGh = cpc.getSpy().split("/")[0]; |
| 3066 | + sName = getPersonName(sch.getGsBm(), sGh); | ||
| 3067 | + if(StringUtils.isEmpty(sName)){ | ||
| 3068 | + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sGh + "】的售票员"); | ||
| 3069 | + rs.put("status", ResponseCode.ERROR); | ||
| 3070 | + return rs; | ||
| 3071 | + } | ||
| 3072 | + persoChangeSPY(sch, sGh); | ||
| 2884 | set.add(sch); | 3073 | set.add(sch); |
| 2885 | } | 3074 | } |
| 3075 | + else if(StringUtils.isNotEmpty(sch.getsGh())){ | ||
| 3076 | + sch.setsGh(""); | ||
| 3077 | + sch.setsName(""); | ||
| 3078 | + } | ||
| 2886 | 3079 | ||
| 2887 | //换车 | 3080 | //换车 |
| 2888 | if (StringUtils.isNotEmpty(cpc.getClZbh())) { | 3081 | if (StringUtils.isNotEmpty(cpc.getClZbh())) { |
| @@ -2905,7 +3098,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2905,7 +3098,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2905 | public void persoChange(ScheduleRealInfo sch, String jGh) { | 3098 | public void persoChange(ScheduleRealInfo sch, String jGh) { |
| 2906 | if (sch.getjGh().equals(jGh)) | 3099 | if (sch.getjGh().equals(jGh)) |
| 2907 | return; | 3100 | return; |
| 2908 | - String jName = BasicData.allPerson.get(sch.getGsBm() + "-"+ jGh); | 3101 | + String jName = getPersonName(sch.getGsBm() , jGh); |
| 2909 | if (StringUtils.isNotEmpty(jName)) { | 3102 | if (StringUtils.isNotEmpty(jName)) { |
| 2910 | 3103 | ||
| 2911 | if (jGh.indexOf("-") != -1) | 3104 | if (jGh.indexOf("-") != -1) |
| @@ -2924,7 +3117,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2924,7 +3117,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2924 | public void persoChangeSPY(ScheduleRealInfo sch, String sGh) { | 3117 | public void persoChangeSPY(ScheduleRealInfo sch, String sGh) { |
| 2925 | if (sch.getsGh().equals(sGh)) | 3118 | if (sch.getsGh().equals(sGh)) |
| 2926 | return; | 3119 | return; |
| 2927 | - String sName = BasicData.allPerson.get(sGh); | 3120 | + String sName = getPersonName(sch.getGsBm() , sGh); |
| 2928 | if (StringUtils.isNotEmpty(sName)) { | 3121 | if (StringUtils.isNotEmpty(sName)) { |
| 2929 | if (sGh.indexOf("-") != -1) | 3122 | if (sGh.indexOf("-") != -1) |
| 2930 | sch.setsGh(sGh.substring(sGh.indexOf("-") + 1)); | 3123 | sch.setsGh(sGh.substring(sGh.indexOf("-") + 1)); |
| @@ -3051,31 +3244,69 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3051,31 +3244,69 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3051 | return rs; | 3244 | return rs; |
| 3052 | } | 3245 | } |
| 3053 | 3246 | ||
| 3054 | - /* @Override | 3247 | + @Override |
| 3055 | public Map<String, Object> historySave(ScheduleRealInfo sch) { | 3248 | public Map<String, Object> historySave(ScheduleRealInfo sch) { |
| 3056 | Map<String, Object> rs = new HashMap<>(); | 3249 | Map<String, Object> rs = new HashMap<>(); |
| 3057 | rs.put("status", ResponseCode.ERROR); | 3250 | rs.put("status", ResponseCode.ERROR); |
| 3058 | 3251 | ||
| 3059 | ScheduleRealInfo oldSch = super.findById(sch.getId()); | 3252 | ScheduleRealInfo oldSch = super.findById(sch.getId()); |
| 3060 | - //修改车辆 | ||
| 3061 | - if (!oldSch.getClZbh().equals(sch.getClZbh())) { | ||
| 3062 | - Set<String> allCar = BasicData.deviceId2NbbmMap.values(); | ||
| 3063 | - if (!allCar.contains(sch.getClZbh())) { | ||
| 3064 | - rs.put("msg", "无效的车辆自编号"); | 3253 | + |
| 3254 | + //换车 | ||
| 3255 | + if (StringUtils.isNotEmpty(sch.getClZbh()) && !oldSch.getClZbh().equals(sch.getClZbh())) { | ||
| 3256 | + if (!carExist(oldSch.getGsBm(),sch.getClZbh())) { | ||
| 3257 | + rs.put("msg", "车辆 " + sch.getClZbh() + " 不存在!"); | ||
| 3065 | return rs; | 3258 | return rs; |
| 3066 | } else | 3259 | } else |
| 3067 | oldSch.setClZbh(sch.getClZbh()); | 3260 | oldSch.setClZbh(sch.getClZbh()); |
| 3068 | } | 3261 | } |
| 3069 | 3262 | ||
| 3070 | - //修改驾驶员 | ||
| 3071 | - if (!oldSch.getjGh().equals(sch.getjGh())) { | ||
| 3072 | - Map<String, String> allPer = BasicData.allPerson; | ||
| 3073 | - if (!allPer.containsKey(sch.getjGh())) { | ||
| 3074 | - rs.put("msg", "无效的驾驶员"); | 3263 | + //换驾驶员 |
| 3264 | + if (StringUtils.isNotEmpty(sch.getjGh()) && !oldSch.getjGh().equals(sch.getjGh())) { | ||
| 3265 | + String jName = getPersonName(oldSch.getGsBm(), sch.getjGh()); | ||
| 3266 | + if(StringUtils.isEmpty(jName)){ | ||
| 3267 | + rs.put("msg", oldSch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员"); | ||
| 3075 | return rs; | 3268 | return rs; |
| 3076 | - } else { | ||
| 3077 | - oldSch.setjGh(sch.getjGh()); | ||
| 3078 | - oldSch.setjName(allPer.get(oldSch.getjGh())); | 3269 | + } |
| 3270 | + persoChange(oldSch, sch.getjGh()); | ||
| 3271 | + } | ||
| 3272 | + | ||
| 3273 | + //换售票员 | ||
| 3274 | + if (StringUtils.isNotEmpty(sch.getsGh()) && !oldSch.getsGh().equals(sch.getsGh())) { | ||
| 3275 | + String sName = getPersonName(oldSch.getGsBm(), sch.getsGh()); | ||
| 3276 | + if(StringUtils.isEmpty(sName)){ | ||
| 3277 | + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getsGh() + "】的售票员"); | ||
| 3278 | + return rs; | ||
| 3279 | + } | ||
| 3280 | + persoChangeSPY(oldSch, sch.getsGh()); | ||
| 3281 | + } | ||
| 3282 | + | ||
| 3283 | + //烂班 | ||
| 3284 | + boolean dest1 = oldSch.getStatus() == -1; | ||
| 3285 | + boolean dest2 = sch.getStatus() == -1; | ||
| 3286 | + if (!dest1 && dest2) { | ||
| 3287 | + oldSch.destroy(); | ||
| 3288 | + } | ||
| 3289 | + else if(dest1 && !dest2){ | ||
| 3290 | + //撤销烂班 | ||
| 3291 | + oldSch.setJhlc(oldSch.getJhlcOrig()); | ||
| 3292 | + oldSch.setStatus(0); | ||
| 3293 | + oldSch.calcStatus(); | ||
| 3294 | + } | ||
| 3295 | + | ||
| 3296 | + | ||
| 3297 | + /** | ||
| 3298 | + * 修改班次里程 | ||
| 3299 | + */ | ||
| 3300 | + if (!oldSch.getJhlc().equals(sch.getJhlc())) { | ||
| 3301 | + double jhlcNum = sch.getJhlc(); | ||
| 3302 | + //烂班 | ||
| 3303 | + if(jhlcNum == 0 && oldSch.getJhlcOrig() != 0) | ||
| 3304 | + oldSch.destroy(); | ||
| 3305 | + else { | ||
| 3306 | + oldSch.setJhlc(jhlcNum); | ||
| 3307 | + //临加班次,实际计划一起改 | ||
| 3308 | + if(oldSch.isSflj()) | ||
| 3309 | + oldSch.setJhlcOrig(jhlcNum); | ||
| 3079 | } | 3310 | } |
| 3080 | } | 3311 | } |
| 3081 | 3312 | ||
| @@ -3091,7 +3322,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3091,7 +3322,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3091 | scheduleRealInfoRepository.save(oldSch); | 3322 | scheduleRealInfoRepository.save(oldSch); |
| 3092 | rs.put("status", ResponseCode.SUCCESS); | 3323 | rs.put("status", ResponseCode.SUCCESS); |
| 3093 | return rs; | 3324 | return rs; |
| 3094 | - }*/ | 3325 | + } |
| 3095 | 3326 | ||
| 3096 | @Autowired | 3327 | @Autowired |
| 3097 | SvgAttributeRepository svgAttributeRepository; | 3328 | SvgAttributeRepository svgAttributeRepository; |
src/main/java/com/bsth/websocket/handler/RealControlSocketHandler.java
| @@ -47,7 +47,7 @@ public class RealControlSocketHandler implements WebSocketHandler { | @@ -47,7 +47,7 @@ public class RealControlSocketHandler implements WebSocketHandler { | ||
| 47 | listenMap.remove(k, remMap.get(k)); | 47 | listenMap.remove(k, remMap.get(k)); |
| 48 | logger.info("web socket close, remove listen K: "+ k); | 48 | logger.info("web socket close, remove listen K: "+ k); |
| 49 | } | 49 | } |
| 50 | - logger.info("listen values size: " + listenMap.values().size()); | 50 | + logger.info("listen values size: " + listenMap.values().size() + " -CloseStatus:" + arg1); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | @Override | 53 | @Override |
src/main/resources/logback.xml
| @@ -161,7 +161,7 @@ | @@ -161,7 +161,7 @@ | ||
| 161 | class="ch.qos.logback.core.rolling.RollingFileAppender"> | 161 | class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 162 | <file>${LOG_BASE}/gps/count.log</file> | 162 | <file>${LOG_BASE}/gps/count.log</file> |
| 163 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | 163 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 164 | - <fileNamePattern>${LOG_BASE}/gps_count/gateway-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | 164 | + <fileNamePattern>${LOG_BASE}/gps/count-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| 165 | <timeBasedFileNamingAndTriggeringPolicy | 165 | <timeBasedFileNamingAndTriggeringPolicy |
| 166 | class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | 166 | class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| 167 | <maxFileSize>100MB</maxFileSize> | 167 | <maxFileSize>100MB</maxFileSize> |
src/main/resources/static/real_control_v2/css/north.css
| @@ -140,39 +140,53 @@ | @@ -140,39 +140,53 @@ | ||
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | .history-sch-table dl dt:nth-of-type(1), .history-sch-table dl dd:nth-of-type(1) { | 142 | .history-sch-table dl dt:nth-of-type(1), .history-sch-table dl dd:nth-of-type(1) { |
| 143 | - width: 10%; | 143 | + width: 4%; |
| 144 | +} | ||
| 145 | +.history-sch-table dl dd:nth-of-type(1){ | ||
| 146 | + background: #eae8e8; | ||
| 147 | + border-right: 1px solid #b3b3b3; | ||
| 148 | + text-align: center; | ||
| 149 | + text-indent: -3px; | ||
| 150 | + color: #000; | ||
| 144 | } | 151 | } |
| 145 | - | ||
| 146 | .history-sch-table dl dt:nth-of-type(2), .history-sch-table dl dd:nth-of-type(2) { | 152 | .history-sch-table dl dt:nth-of-type(2), .history-sch-table dl dd:nth-of-type(2) { |
| 147 | - width: 12%; | 153 | + width: 5%; |
| 148 | } | 154 | } |
| 149 | 155 | ||
| 150 | .history-sch-table dl dt:nth-of-type(3), .history-sch-table dl dd:nth-of-type(3) { | 156 | .history-sch-table dl dt:nth-of-type(3), .history-sch-table dl dd:nth-of-type(3) { |
| 151 | - width: 14%; | 157 | + width: 9%; |
| 152 | } | 158 | } |
| 153 | 159 | ||
| 154 | .history-sch-table dl dt:nth-of-type(4), .history-sch-table dl dd:nth-of-type(4) { | 160 | .history-sch-table dl dt:nth-of-type(4), .history-sch-table dl dd:nth-of-type(4) { |
| 155 | - width: 14%; | 161 | + width: 12%; |
| 156 | } | 162 | } |
| 157 | 163 | ||
| 158 | .history-sch-table dl dt:nth-of-type(5), .history-sch-table dl dd:nth-of-type(5) { | 164 | .history-sch-table dl dt:nth-of-type(5), .history-sch-table dl dd:nth-of-type(5) { |
| 159 | - width: 12%; | 165 | + width: 13%; |
| 160 | } | 166 | } |
| 161 | 167 | ||
| 162 | .history-sch-table dl dt:nth-of-type(6), .history-sch-table dl dd:nth-of-type(6) { | 168 | .history-sch-table dl dt:nth-of-type(6), .history-sch-table dl dd:nth-of-type(6) { |
| 163 | - width: 10%; | 169 | + width: 13%; |
| 164 | } | 170 | } |
| 165 | 171 | ||
| 166 | .history-sch-table dl dt:nth-of-type(7), .history-sch-table dl dd:nth-of-type(7) { | 172 | .history-sch-table dl dt:nth-of-type(7), .history-sch-table dl dd:nth-of-type(7) { |
| 167 | - width: 12%; | 173 | + width: 11%; |
| 168 | } | 174 | } |
| 169 | 175 | ||
| 170 | .history-sch-table dl dt:nth-of-type(8), .history-sch-table dl dd:nth-of-type(8) { | 176 | .history-sch-table dl dt:nth-of-type(8), .history-sch-table dl dd:nth-of-type(8) { |
| 171 | - width: 10%; | 177 | + width: 8%; |
| 172 | } | 178 | } |
| 173 | 179 | ||
| 174 | .history-sch-table dl dt:nth-of-type(9), .history-sch-table dl dd:nth-of-type(9) { | 180 | .history-sch-table dl dt:nth-of-type(9), .history-sch-table dl dd:nth-of-type(9) { |
| 175 | - width: 6%; | 181 | + width: 10%; |
| 182 | +} | ||
| 183 | + | ||
| 184 | +.history-sch-table dl dt:nth-of-type(10), .history-sch-table dl dd:nth-of-type(10) { | ||
| 185 | + width: 8%; | ||
| 186 | +} | ||
| 187 | + | ||
| 188 | +.history-sch-table dl dt:nth-of-type(11), .history-sch-table dl dd:nth-of-type(11) { | ||
| 189 | + width: 7%; | ||
| 176 | } | 190 | } |
| 177 | 191 | ||
| 178 | #history-sch-maintain-modal ul.h-s-time, | 192 | #history-sch-maintain-modal ul.h-s-time, |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/add_temp_sch.html
| @@ -669,7 +669,7 @@ | @@ -669,7 +669,7 @@ | ||
| 669 | } | 669 | } |
| 670 | else { | 670 | else { |
| 671 | var type = $('[name=bcType]', f).val(); | 671 | var type = $('[name=bcType]', f).val(); |
| 672 | - if(type=='in' || type=='out') | 672 | + if(type!='normal') |
| 673 | return; | 673 | return; |
| 674 | $('[name=bcType]', f).val('region'); | 674 | $('[name=bcType]', f).val('region'); |
| 675 | //计算区间站点间公里 | 675 | //计算区间站点间公里 |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
| @@ -394,7 +394,7 @@ | @@ -394,7 +394,7 @@ | ||
| 394 | return notify_err('无法获取到主任务信息!'); | 394 | return notify_err('无法获取到主任务信息!'); |
| 395 | 395 | ||
| 396 | if(sch.bcType == 'out' || sch.bcType == 'in'){ | 396 | if(sch.bcType == 'out' || sch.bcType == 'in'){ |
| 397 | - notify_err('暂不能在进出场班次上做加油子任务!'); | 397 | + notify_err('暂不能在进出场班次上执行该操作!'); |
| 398 | return; | 398 | return; |
| 399 | } | 399 | } |
| 400 | open_modal(folder + '/sub_task/add_sub_task_oil.html', { | 400 | open_modal(folder + '/sub_task/add_sub_task_oil.html', { |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_oil.html
| @@ -279,7 +279,7 @@ | @@ -279,7 +279,7 @@ | ||
| 279 | } | 279 | } |
| 280 | else{ | 280 | else{ |
| 281 | //营运子任务不写备注 | 281 | //营运子任务不写备注 |
| 282 | - if(data.mileageType == 'service') | 282 | + if(data.mileageType == 'service' && !data.destroy) |
| 283 | data.remarks = ''; | 283 | data.remarks = ''; |
| 284 | gb_common.$post('/childTask', data, function (rs) { | 284 | gb_common.$post('/childTask', data, function (rs) { |
| 285 | notify_succ('子任务添加成功'); | 285 | notify_succ('子任务添加成功'); |
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/edit.html
| 1 | -<div class="uk-modal ct-form-modal" id="history-sch-edit-modal"> | 1 | +<div class="uk-modal ct-form-modal ct_move_modal" id="history-sch-edit-modal"> |
| 2 | <div class="uk-modal-dialog" style="width: 900px;"> | 2 | <div class="uk-modal-dialog" style="width: 900px;"> |
| 3 | <a href="" class="uk-modal-close uk-close"></a> | 3 | <a href="" class="uk-modal-close uk-close"></a> |
| 4 | <div class="uk-modal-header"> | 4 | <div class="uk-modal-header"> |
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/editor.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal ct_move_modal" id="history-sch-edit-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 900px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>历史路单编辑</h2></div> | ||
| 6 | + <form class="uk-form uk-form-horizontal sch_form"> | ||
| 7 | + </form> | ||
| 8 | + | ||
| 9 | + <div class="uk-panel uk-panel-box uk-panel-box-secondary" style="padding-bottom: 0;"> | ||
| 10 | + <h3 class="uk-panel-title" id="childTaskTitle"> | ||
| 11 | + 子任务列表 | ||
| 12 | + <a id="addChildTaskBtn" data-uk-tooltip title="添加子任务"><i | ||
| 13 | + class="uk-icon-plus"></i> </a> | ||
| 14 | + </h3> | ||
| 15 | + <div class="ct_table_wrap ct_table_no_border sub_task_table_wrap" style="height: 142px;"> | ||
| 16 | + <div class="ct_table sub-task-table"> | ||
| 17 | + <div class="ct_table_head"> | ||
| 18 | + <dl> | ||
| 19 | + <dt>序号</dt> | ||
| 20 | + <dt>类型</dt> | ||
| 21 | + <dt>起点</dt> | ||
| 22 | + <dt>终点</dt> | ||
| 23 | + <dt>开始时间</dt> | ||
| 24 | + <dt>结束时间</dt> | ||
| 25 | + <dt>里程</dt> | ||
| 26 | + <dt>备注</dt> | ||
| 27 | + </dl> | ||
| 28 | + </div> | ||
| 29 | + <div class="ct_table_body"> | ||
| 30 | + </div> | ||
| 31 | + </div> | ||
| 32 | + </div> | ||
| 33 | + </div> | ||
| 34 | + </div> | ||
| 35 | + | ||
| 36 | + <script id="history-sch-edit-form-temp" type="text/html"> | ||
| 37 | + <input type="hidden" name="id" value="{{id}}"/> | ||
| 38 | + | ||
| 39 | + <div class="uk-grid"> | ||
| 40 | + <div class="uk-width-1-3"> | ||
| 41 | + <div class="uk-form-row"> | ||
| 42 | + <label class="uk-form-label" >班次类型</label> | ||
| 43 | + <div class="uk-form-controls"> | ||
| 44 | + <select class="form-control nt-dictionary" data-code="{{bcType}}" name="bcType" data-group=ScheduleType></select> | ||
| 45 | + </div> | ||
| 46 | + </div> | ||
| 47 | + </div> | ||
| 48 | + <div class="uk-width-1-3"> | ||
| 49 | + <div class="uk-form-row"> | ||
| 50 | + <label class="uk-form-label" >起点</label> | ||
| 51 | + <div class="uk-form-controls"> | ||
| 52 | + <select type="text" name="qdzCode" ></select> | ||
| 53 | + </div> | ||
| 54 | + </div> | ||
| 55 | + </div> | ||
| 56 | + <div class="uk-width-1-3"> | ||
| 57 | + <div class="uk-form-row"> | ||
| 58 | + <label class="uk-form-label" >终点</label> | ||
| 59 | + <div class="uk-form-controls"> | ||
| 60 | + <select type="text" name="zdzCode" ></select> | ||
| 61 | + </div> | ||
| 62 | + </div> | ||
| 63 | + </div> | ||
| 64 | + </div> | ||
| 65 | + | ||
| 66 | + <div class="uk-grid"> | ||
| 67 | + <div class="uk-width-1-3"> | ||
| 68 | + <div class="uk-form-row"> | ||
| 69 | + <label class="uk-form-label" >车辆</label> | ||
| 70 | + <div class="uk-form-controls"> | ||
| 71 | + <div class="uk-autocomplete uk-form car-autocom"> | ||
| 72 | + <input type="text" value="{{clZbh}}" name="clZbh" required> | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + </div> | ||
| 76 | + </div> | ||
| 77 | + <div class="uk-width-1-3"> | ||
| 78 | + <div class="uk-form-row"> | ||
| 79 | + <label class="uk-form-label" >驾驶员</label> | ||
| 80 | + <div class="uk-form-controls"> | ||
| 81 | + <div class="uk-autocomplete uk-form jsy-autocom"> | ||
| 82 | + <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> | ||
| 83 | + </div> | ||
| 84 | + </div> | ||
| 85 | + </div> | ||
| 86 | + </div> | ||
| 87 | + <div class="uk-width-1-3"> | ||
| 88 | + <div class="uk-form-row"> | ||
| 89 | + <label class="uk-form-label" >售票员</label> | ||
| 90 | + <div class="uk-form-controls"> | ||
| 91 | + <div class="uk-autocomplete uk-form spy-autocom"> | ||
| 92 | + <input type="text" value="{{sGh}}/{{sName}}" name="spy"> | ||
| 93 | + </div> | ||
| 94 | + </div> | ||
| 95 | + </div> | ||
| 96 | + </div> | ||
| 97 | + </div> | ||
| 98 | + | ||
| 99 | + <div class="uk-grid"> | ||
| 100 | + <div class="uk-width-1-3"> | ||
| 101 | + <div class="uk-form-row"> | ||
| 102 | + <label class="uk-form-label" >计发</label> | ||
| 103 | + <div class="uk-form-controls"> | ||
| 104 | + <input type="time" value="{{fcsj}}" disabled> | ||
| 105 | + </div> | ||
| 106 | + </div> | ||
| 107 | + </div> | ||
| 108 | + <div class="uk-width-1-3"> | ||
| 109 | + <div class="uk-form-row"> | ||
| 110 | + <label class="uk-form-label" >待发</label> | ||
| 111 | + <div class="uk-form-controls"> | ||
| 112 | + <input type="time" name="dfsj" value="{{dfsj}}" required> | ||
| 113 | + </div> | ||
| 114 | + </div> | ||
| 115 | + </div> | ||
| 116 | + <div class="uk-width-1-3"> | ||
| 117 | + <div class="uk-form-row"> | ||
| 118 | + <label class="uk-form-label" >实发</label> | ||
| 119 | + <div class="uk-form-controls"> | ||
| 120 | + <input type="time" name="fcsjActual" value="{{fcsjActual}}" > | ||
| 121 | + </div> | ||
| 122 | + </div> | ||
| 123 | + </div> | ||
| 124 | + </div> | ||
| 125 | + | ||
| 126 | + <div class="uk-grid"> | ||
| 127 | + <div class="uk-width-1-3"> | ||
| 128 | + <div class="uk-form-row"> | ||
| 129 | + <label class="uk-form-label" >里程</label> | ||
| 130 | + <div class="uk-form-controls"> | ||
| 131 | + <input type="text" name="jhlc" value="{{jhlc}}" max=222 data-fv-lessthan-inclusive="false" | ||
| 132 | + required> | ||
| 133 | + </div> | ||
| 134 | + </div> | ||
| 135 | + </div> | ||
| 136 | + <div class="uk-width-1-3"> | ||
| 137 | + <div class="uk-form-row"> | ||
| 138 | + <label class="uk-form-label" >计达</label> | ||
| 139 | + <div class="uk-form-controls"> | ||
| 140 | + <input type="time" value="{{zdsj}}" disabled> | ||
| 141 | + </div> | ||
| 142 | + </div> | ||
| 143 | + </div> | ||
| 144 | + <div class="uk-width-1-3"> | ||
| 145 | + <div class="uk-form-row"> | ||
| 146 | + <label class="uk-form-label" >实达</label> | ||
| 147 | + <div class="uk-form-controls"> | ||
| 148 | + <input type="time" name="zdsjActual" value="{{zdsjActual}}" > | ||
| 149 | + </div> | ||
| 150 | + </div> | ||
| 151 | + </div> | ||
| 152 | + </div> | ||
| 153 | + <div class="uk-grid"> | ||
| 154 | + <div class="uk-width-1-3"> | ||
| 155 | + <div class="uk-form-row"> | ||
| 156 | + <label class="uk-form-label" ></label> | ||
| 157 | + <label> | ||
| 158 | + <input class="i-cbox destroy-box" type="checkbox" name="status" value="-1" {{if status==-1}}checked{{/if}}> | ||
| 159 | + 是否烂班 | ||
| 160 | + </label> | ||
| 161 | + </div> | ||
| 162 | + </div> | ||
| 163 | + | ||
| 164 | + <div class="uk-width-2-3"> | ||
| 165 | + <div class="uk-form-row ct-stacked"> | ||
| 166 | + <label class="uk-form-label" >备注</label> | ||
| 167 | + <div class="uk-form-controls" style="margin-top: 5px;"> | ||
| 168 | + <textarea id="form-s-t" cols="20" rows="3" name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="100" placeholder="备注">{{remarks}}</textarea> | ||
| 169 | + </div> | ||
| 170 | + </div> | ||
| 171 | + </div> | ||
| 172 | + </div> | ||
| 173 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: 20px;"> | ||
| 174 | + <div class="uk-button-dropdown" data-uk-dropdown> | ||
| 175 | + <a class="uk-button uk-button-success"><i class="uk-icon-pencil-square-o"></i> 添加子任务 <i class="uk-icon-caret-down"></i></a> | ||
| 176 | + <div class="uk-dropdown" style="text-align: left;"> | ||
| 177 | + <ul class="uk-nav uk-nav-dropdown child_task_list"> | ||
| 178 | + <li data-method="add_oil"><a>空驶进出场</a></li> | ||
| 179 | + <li data-method="in_park"><a>进场</a></li> | ||
| 180 | + <li data-method="out_park"><a>出场</a></li> | ||
| 181 | + <li data-method="other"><a>自定义</a></li> | ||
| 182 | + </ul> | ||
| 183 | + </div> | ||
| 184 | + </div> | ||
| 185 | + | ||
| 186 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存主任务信息</button> | ||
| 187 | + </div> | ||
| 188 | + </script> | ||
| 189 | + | ||
| 190 | + <script id="h-sub_task-table-temp" type="text/html"> | ||
| 191 | + {{each list as task i}} | ||
| 192 | + <dl data-id="{{task.id}}"> | ||
| 193 | + <dd>{{i+1}}</dd> | ||
| 194 | + <dd><span class="nt-dictionary" data-group="ChildTaskType">{{task.type2}}</span></dd> | ||
| 195 | + <dd>{{task.startStationName}}</dd> | ||
| 196 | + <dd>{{task.endStationName}}</dd> | ||
| 197 | + <dd>{{task.startDate}}</dd> | ||
| 198 | + <dd>{{task.endDate}}</dd> | ||
| 199 | + <dd> | ||
| 200 | + {{task.mileage}} | ||
| 201 | + (<span class="nt-dictionary" data-group="MileageType">{{task.mileageType}}</span> | ||
| 202 | + {{if task.destroy}} | ||
| 203 | + <small style="color:red;">烂班</small> | ||
| 204 | + {{/if}} | ||
| 205 | + ) | ||
| 206 | + </dd> | ||
| 207 | + <dd title="{{task.remarks}}">{{task.remarks}}</dd> | ||
| 208 | + </dl> | ||
| 209 | + {{/each}} | ||
| 210 | + </script> | ||
| 211 | + | ||
| 212 | + <script> | ||
| 213 | + (function() { | ||
| 214 | + var modal = '#history-sch-edit-modal' | ||
| 215 | + ,gb_sch,parentModal; | ||
| 216 | + var stationRoutes, parks, information; | ||
| 217 | + | ||
| 218 | + $(modal).on('init', function(e, data) { | ||
| 219 | + e.stopPropagation(); | ||
| 220 | + var id = data.id; | ||
| 221 | + parentModal=data.parentModal; | ||
| 222 | + | ||
| 223 | + $.get('/realSchedule/'+id, function (sch) { | ||
| 224 | + gb_sch = sch; | ||
| 225 | + | ||
| 226 | + var htmlStr = template('history-sch-edit-form-temp', sch); | ||
| 227 | + $('form.sch_form', modal).html(htmlStr); | ||
| 228 | + //子任务列表 | ||
| 229 | + sch.cTasks.sort(sub_task_sort); | ||
| 230 | + htmlStr = template('h-sub_task-table-temp', {list: sch.cTasks}); | ||
| 231 | + $('.sub-task-table .ct_table_body', modal).html(htmlStr); | ||
| 232 | + | ||
| 233 | + //字典转换 | ||
| 234 | + dictionaryUtils.transformDom($('.nt-dictionary', modal)); | ||
| 235 | + //渲染表格,自动补全和下拉框等 | ||
| 236 | + renderForm(); | ||
| 237 | + | ||
| 238 | + //submit | ||
| 239 | + var f = $('form.sch_form', modal).formValidation(gb_form_validation_opts); | ||
| 240 | + //是否烂班 | ||
| 241 | + $('[name=status]', f).on('click', function () { | ||
| 242 | + if(this.checked) | ||
| 243 | + $('[name=jhlc]', f).val(0); | ||
| 244 | + else | ||
| 245 | + $('[name=jhlc]', f).val(gb_sch.jhlcOrig); | ||
| 246 | + }); | ||
| 247 | + f.on('success.form.fv', function(e) { | ||
| 248 | + e.preventDefault(); | ||
| 249 | + var data = $(this).serializeJSON(); | ||
| 250 | + | ||
| 251 | + //拆分驾驶员工号和姓名 | ||
| 252 | + data.jGh = data.jsy.split('/')[0]; | ||
| 253 | + data.jName = data.jsy.split('/')[1]; | ||
| 254 | + delete data.jsy; | ||
| 255 | + //拆分售票员工号和姓名 | ||
| 256 | + if(data.sGh != null){ | ||
| 257 | + data.sGh = data.spy.split('/')[0]; | ||
| 258 | + data.sName = data.spy.split('/')[1]; | ||
| 259 | + delete data.spy; | ||
| 260 | + } | ||
| 261 | + | ||
| 262 | + gb_common.$post('/realSchedule/history', data, function (rs) { | ||
| 263 | + //console.log(rs); | ||
| 264 | + UIkit.modal(modal).hide(); | ||
| 265 | + $(parentModal).trigger('refresh'); | ||
| 266 | + }); | ||
| 267 | + }); | ||
| 268 | + }); | ||
| 269 | + }); | ||
| 270 | + | ||
| 271 | + /** | ||
| 272 | + * 添加子任务 | ||
| 273 | + */ | ||
| 274 | + $(modal).on('click','.child_task_list>li', function () { | ||
| 275 | + var method = $(this).data('method'); | ||
| 276 | + addChildTaskObj[method](); | ||
| 277 | + }); | ||
| 278 | + var modal_opts = {center: false, bgclose: false, modal: false} | ||
| 279 | + ,folder = '/real_control_v2/fragments/north/nav/history_sch'; | ||
| 280 | + var addChildTaskObj = { | ||
| 281 | + add_oil: function () { | ||
| 282 | + open_modal(folder + '/h_add_sub_task_oil.html', { | ||
| 283 | + sch: gb_sch | ||
| 284 | + }, modal_opts); | ||
| 285 | + }, | ||
| 286 | + in_park: function () { | ||
| 287 | + open_modal(folder + '/h_add_sub_task_inpark.html', { | ||
| 288 | + sch: gb_sch | ||
| 289 | + }, modal_opts); | ||
| 290 | + }, | ||
| 291 | + out_park: function () { | ||
| 292 | + open_modal(folder + '/h_add_sub_task_outpark.html', { | ||
| 293 | + sch: gb_sch | ||
| 294 | + }, modal_opts); | ||
| 295 | + }, | ||
| 296 | + other: function () { | ||
| 297 | + open_modal(folder + '/h_add_sub_task_other.html', { | ||
| 298 | + sch: gb_sch | ||
| 299 | + }, modal_opts); | ||
| 300 | + } | ||
| 301 | + }; | ||
| 302 | + | ||
| 303 | + $('#addChildTaskBtn', modal).on('click', addChildTaskObj.other); | ||
| 304 | + | ||
| 305 | + | ||
| 306 | + var callbackHandler = { | ||
| 307 | + remove_sub_task: function () { | ||
| 308 | + var activeDl = $('.sub-task-table .ct_table_body', modal).find('dl.context-menu-active'); | ||
| 309 | + if (activeDl.length == 0) | ||
| 310 | + return; | ||
| 311 | + var dds = activeDl.find('dd'); | ||
| 312 | + var id = activeDl.data('id') | ||
| 313 | + , str = '<h3>确定要删除子任务<span style="color:red;margin: 0 5px;">' + $(dds[4]).text() + ',' + $(dds[6]).text() + ' </span>?</h3>'; | ||
| 314 | + alt_confirm(str, function () { | ||
| 315 | + gb_common.$del('/childTask/history/' + id, function (rs) { | ||
| 316 | + notify_succ('删除子任务成功!'); | ||
| 317 | + //刷新界面数据 | ||
| 318 | + $(modal).trigger('init', {id: gb_sch.id}); | ||
| 319 | + }); | ||
| 320 | + }, '确定删除'); | ||
| 321 | + } | ||
| 322 | + }; | ||
| 323 | + //右键菜单 | ||
| 324 | + $.contextMenu({ | ||
| 325 | + selector: modal + ' .sub-task-table .ct_table_body dl', | ||
| 326 | + className: 'schedule-ct-menu', | ||
| 327 | + callback: function (key, options) { | ||
| 328 | + callbackHandler[key] && callbackHandler[key](); | ||
| 329 | + }, | ||
| 330 | + items: { | ||
| 331 | + "remove_sub_task": { | ||
| 332 | + name: "删除子任务" | ||
| 333 | + , icon: "delete" | ||
| 334 | + } | ||
| 335 | + } | ||
| 336 | + }); | ||
| 337 | + | ||
| 338 | + function renderForm() { | ||
| 339 | + //站点路由 | ||
| 340 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(gb_sch.xlBm).sort(function (a, b) { | ||
| 341 | + return a.stationRouteCode - b.stationRouteCode; | ||
| 342 | + }), 'directions'); | ||
| 343 | + //停车场 | ||
| 344 | + parks = gb_data_basic.simpleParksArray(); | ||
| 345 | + //线路标准 | ||
| 346 | + information = gb_data_basic.getLineInformation(gb_sch.xlBm); | ||
| 347 | + | ||
| 348 | + //----------- Autocomplete -------------- | ||
| 349 | + //车辆 | ||
| 350 | + gb_common.carAutocomplete($('.car-autocom', modal), gb_data_basic.carsArray()); | ||
| 351 | + //驾驶员 | ||
| 352 | + gb_common.personAutocomplete($('.jsy-autocom', modal)); | ||
| 353 | + //售票员 | ||
| 354 | + gb_common.personAutocomplete($('.spy-autocom', modal)); | ||
| 355 | + | ||
| 356 | + //班次类型切换 | ||
| 357 | + var f = $('form.sch_form', modal); | ||
| 358 | + initScheduleTypeChange(f); | ||
| 359 | + $('[name=bcType]', f).trigger('change'); | ||
| 360 | + } | ||
| 361 | + | ||
| 362 | + | ||
| 363 | + function initScheduleTypeChange(f, cb) { | ||
| 364 | + (function (f, cb) { | ||
| 365 | + $('[name=bcType]', f).on('change', function () { | ||
| 366 | + var bcType_e = $('[name=bcType]', f) | ||
| 367 | + , updown = gb_sch.xlDir; | ||
| 368 | + | ||
| 369 | + var routes = stationRoutes[updown] | ||
| 370 | + , lastCode = routes[routes.length - 1].stationCode | ||
| 371 | + , opts = '', park_opts = ''; | ||
| 372 | + //station options | ||
| 373 | + $.each(routes, function () { | ||
| 374 | + opts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>' | ||
| 375 | + }); | ||
| 376 | + //park options | ||
| 377 | + for (var code in parks) | ||
| 378 | + park_opts += '<option value="' + code + '">' + parks[code] + '</option>'; | ||
| 379 | + | ||
| 380 | + var qdz = $('[name=qdzCode]', f), zdz = $('[name=zdzCode]', f); | ||
| 381 | + var time, mileage; | ||
| 382 | + switch (bcType_e.val()) { | ||
| 383 | + case 'out': | ||
| 384 | + qdz.html(park_opts).val(information.carPark); | ||
| 385 | + zdz.html(opts); | ||
| 386 | + //出场结束时间 | ||
| 387 | + time = updown == 0 ? information.upOutTimer : information.downOutTimer; | ||
| 388 | + mileage = updown == 0 ? information.upOutMileage : information.downOutMileage; | ||
| 389 | + break; | ||
| 390 | + case 'in': | ||
| 391 | + qdz.html(opts); | ||
| 392 | + zdz.html(park_opts).val(information.carPark); | ||
| 393 | + //进场结束时间 | ||
| 394 | + time = updown == 0 ? information.upInTimer : information.downInTimer; | ||
| 395 | + mileage = updown == 0 ? information.upInMileage : information.downInMileage; | ||
| 396 | + break; | ||
| 397 | + default: | ||
| 398 | + qdz.html(opts); | ||
| 399 | + zdz.html(opts).val(lastCode); | ||
| 400 | + time = updown == 0?information.upTravelTime:information.downTravelTime; | ||
| 401 | + mileage = updown == 0?information.upMileage:information.downMileage; | ||
| 402 | + } | ||
| 403 | + | ||
| 404 | + cb && cb(); | ||
| 405 | + }).trigger('change'); | ||
| 406 | + })(f, cb); | ||
| 407 | + } | ||
| 408 | + | ||
| 409 | + function sub_task_sort(a, b) { | ||
| 410 | + return a.id - b.id; | ||
| 411 | + } | ||
| 412 | + })(); | ||
| 413 | + </script> | ||
| 414 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/h_add_sub_task_inpark.html
0 → 100644
| 1 | +<div class="uk-modal ct_move_modal" id="add-sub-task-inpark-modal"> | ||
| 2 | + <div class="uk-modal-dialog"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>回场子任务</h2></div> | ||
| 6 | + | ||
| 7 | + <div style="width: 100%;padding-left: 1%;"> | ||
| 8 | + <div class="sub-task-card"> | ||
| 9 | + <div class="uk-panel uk-panel-box uk-panel-box-primary twins_task_panel"> | ||
| 10 | + <div class="uk-panel-badge uk-badge">营运</div> | ||
| 11 | + <h3 class="uk-panel-title">线路上站点间</h3> | ||
| 12 | + <form class="uk-form uk-form-horizontal inpark_form" service_form> | ||
| 13 | + <input type="hidden" name="type2" value="1"> | ||
| 14 | + <input type="hidden" name="mileageType" value="service"> | ||
| 15 | + <div class="uk-grid"> | ||
| 16 | + <div class="uk-width-3-10"> | ||
| 17 | + <div class="uk-form-row"> | ||
| 18 | + <label class="uk-form-label">班次类型 </label> | ||
| 19 | + </div> | ||
| 20 | + </div> | ||
| 21 | + <div class="uk-width-7-10 pl5"> | ||
| 22 | + <select name="type1" class="ct_focus" disabled> | ||
| 23 | + <option value="正常">正常</option> | ||
| 24 | + <option value="临加">临加</option> | ||
| 25 | + </select> | ||
| 26 | + </div> | ||
| 27 | + </div> | ||
| 28 | + <div class="uk-grid"> | ||
| 29 | + <div class="uk-width-3-10"> | ||
| 30 | + <div class="uk-form-row"> | ||
| 31 | + <label class="uk-form-label">起点 </label> | ||
| 32 | + </div> | ||
| 33 | + </div> | ||
| 34 | + <div class="uk-width-7-10 pl5"> | ||
| 35 | + <select name="startStation" disabled></select> | ||
| 36 | + </div> | ||
| 37 | + </div> | ||
| 38 | + <div class="uk-grid"> | ||
| 39 | + <div class="uk-width-3-10"> | ||
| 40 | + <div class="uk-form-row"> | ||
| 41 | + <label class="uk-form-label">终点 </label> | ||
| 42 | + </div> | ||
| 43 | + </div> | ||
| 44 | + <div class="uk-width-7-10 pl5"> | ||
| 45 | + <select name="endStation" class="ct_focus"></select> | ||
| 46 | + </div> | ||
| 47 | + </div> | ||
| 48 | + <div class="uk-grid"> | ||
| 49 | + <div class="uk-width-3-10"> | ||
| 50 | + <div class="uk-form-row"> | ||
| 51 | + <label class="uk-form-label">营运里程</label> | ||
| 52 | + </div> | ||
| 53 | + </div> | ||
| 54 | + <div class="uk-width-7-10 pl5"> | ||
| 55 | + <input type="number" step="0.01" name="mileage" required> | ||
| 56 | + </div> | ||
| 57 | + </div> | ||
| 58 | + <div class="uk-grid"> | ||
| 59 | + <div class="uk-width-3-10"> | ||
| 60 | + <div class="uk-form-row"> | ||
| 61 | + <label class="uk-form-label">开始时间</label> | ||
| 62 | + </div> | ||
| 63 | + </div> | ||
| 64 | + <div class="uk-width-7-10 pl5"> | ||
| 65 | + <input type="time" name="startDate" required> | ||
| 66 | + </div> | ||
| 67 | + </div> | ||
| 68 | + <div class="uk-grid"> | ||
| 69 | + <div class="uk-width-3-10"> | ||
| 70 | + <div class="uk-form-row"> | ||
| 71 | + <label class="uk-form-label">结束时间</label> | ||
| 72 | + </div> | ||
| 73 | + </div> | ||
| 74 | + <div class="uk-width-7-10 pl5"> | ||
| 75 | + <input type="time" name="endDate" required> | ||
| 76 | + </div> | ||
| 77 | + </div> | ||
| 78 | + </form> | ||
| 79 | + </div> | ||
| 80 | + </div> | ||
| 81 | + <div class="sub-task-card"> | ||
| 82 | + <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | ||
| 83 | + <div class="uk-panel-badge uk-badge uk-badge-default">空驶</div> | ||
| 84 | + <h3 class="uk-panel-title">进场</h3> | ||
| 85 | + <form class="uk-form uk-form-horizontal inpark_form" empty_form> | ||
| 86 | + <input type="hidden" name="type2" value="2"> | ||
| 87 | + <input type="hidden" name="mileageType" value="empty"> | ||
| 88 | + <div class="uk-grid"> | ||
| 89 | + <div class="uk-width-3-10"> | ||
| 90 | + <div class="uk-form-row"> | ||
| 91 | + <label class="uk-form-label">班次类型 </label> | ||
| 92 | + </div> | ||
| 93 | + </div> | ||
| 94 | + <div class="uk-width-7-10 pl5"> | ||
| 95 | + <select name="type1" class="ct_focus"> | ||
| 96 | + <option value="正常">正常</option> | ||
| 97 | + <option value="临加">临加</option> | ||
| 98 | + </select> | ||
| 99 | + </div> | ||
| 100 | + </div> | ||
| 101 | + <div class="uk-grid"> | ||
| 102 | + <div class="uk-width-3-10"> | ||
| 103 | + <div class="uk-form-row"> | ||
| 104 | + <label class="uk-form-label">起点 </label> | ||
| 105 | + </div> | ||
| 106 | + </div> | ||
| 107 | + <div class="uk-width-7-10 pl5"> | ||
| 108 | + <select name="startStation" ></select> | ||
| 109 | + </div> | ||
| 110 | + </div> | ||
| 111 | + <div class="uk-grid"> | ||
| 112 | + <div class="uk-width-3-10"> | ||
| 113 | + <div class="uk-form-row"> | ||
| 114 | + <label class="uk-form-label">终点 </label> | ||
| 115 | + </div> | ||
| 116 | + </div> | ||
| 117 | + <div class="uk-width-7-10 pl5"> | ||
| 118 | + <select name="endStation" class="ct_focus"></select> | ||
| 119 | + </div> | ||
| 120 | + </div> | ||
| 121 | + <div class="uk-grid"> | ||
| 122 | + <div class="uk-width-3-10"> | ||
| 123 | + <div class="uk-form-row"> | ||
| 124 | + <label class="uk-form-label">空驶里程</label> | ||
| 125 | + </div> | ||
| 126 | + </div> | ||
| 127 | + <div class="uk-width-7-10 pl5"> | ||
| 128 | + <input type="number" step="0.01" name="mileage" required style="width: calc(100% - 62px);"> | ||
| 129 | + <a style="font-size: 12px;color: grey;cursor: default;" data-uk-tooltip title="可选择回场路径,设置途径点位。暂不开放" id="inpark_paths_link">路径(<span>0</span>)</a> | ||
| 130 | + </div> | ||
| 131 | + </div> | ||
| 132 | + <div class="uk-grid"> | ||
| 133 | + <div class="uk-width-3-10"> | ||
| 134 | + <div class="uk-form-row"> | ||
| 135 | + <label class="uk-form-label">开始时间</label> | ||
| 136 | + </div> | ||
| 137 | + </div> | ||
| 138 | + <div class="uk-width-7-10 pl5"> | ||
| 139 | + <input type="time" name="startDate" required> | ||
| 140 | + </div> | ||
| 141 | + </div> | ||
| 142 | + <div class="uk-grid"> | ||
| 143 | + <div class="uk-width-3-10"> | ||
| 144 | + <div class="uk-form-row"> | ||
| 145 | + <label class="uk-form-label">结束时间</label> | ||
| 146 | + </div> | ||
| 147 | + </div> | ||
| 148 | + <div class="uk-width-7-10 pl5"> | ||
| 149 | + <input type="time" name="endDate" required> | ||
| 150 | + </div> | ||
| 151 | + </div> | ||
| 152 | + </form> | ||
| 153 | + </div> | ||
| 154 | + </div> | ||
| 155 | + <div class="sub-task-card destroy-card uk-animation-scale"> | ||
| 156 | + <div class="uk-panel uk-panel-box uk-panel-box-danger"> | ||
| 157 | + <div class="uk-panel-badge uk-badge uk-badge-danger">烂班</div> | ||
| 158 | + <h3 class="uk-panel-title">线路上站点间</h3> | ||
| 159 | + <form class="uk-form uk-form-horizontal inpark_form" destroy_form> | ||
| 160 | + <input type="hidden" value="正常" name="type1"> | ||
| 161 | + <input type="hidden" value="1" name="type2"> | ||
| 162 | + <input type="hidden" name="mileageType" value="service"> | ||
| 163 | + <input type="hidden" name="destroy" value="true"> | ||
| 164 | + <div class="uk-grid" style="height: 30px;"> | ||
| 165 | + </div> | ||
| 166 | + <div class="uk-grid"> | ||
| 167 | + <div class="uk-width-3-10"> | ||
| 168 | + <div class="uk-form-row"> | ||
| 169 | + <label class="uk-form-label">起点 </label> | ||
| 170 | + </div> | ||
| 171 | + </div> | ||
| 172 | + <div class="uk-width-7-10 pl5"> | ||
| 173 | + <select name="startStation" disabled></select> | ||
| 174 | + </div> | ||
| 175 | + </div> | ||
| 176 | + <div class="uk-grid"> | ||
| 177 | + <div class="uk-width-3-10"> | ||
| 178 | + <div class="uk-form-row"> | ||
| 179 | + <label class="uk-form-label">终点 </label> | ||
| 180 | + </div> | ||
| 181 | + </div> | ||
| 182 | + <div class="uk-width-7-10 pl5"> | ||
| 183 | + <select name="endStation" class="ct_focus" disabled></select> | ||
| 184 | + </div> | ||
| 185 | + </div> | ||
| 186 | + <div class="uk-grid"> | ||
| 187 | + <div class="uk-width-3-10"> | ||
| 188 | + <div class="uk-form-row"> | ||
| 189 | + <label class="uk-form-label">烂班里程</label> | ||
| 190 | + </div> | ||
| 191 | + </div> | ||
| 192 | + <div class="uk-width-7-10 pl5"> | ||
| 193 | + <input type="number" step="0.01" name="mileage" required> | ||
| 194 | + </div> | ||
| 195 | + </div> | ||
| 196 | + <div class="uk-grid"> | ||
| 197 | + <div class="uk-width-3-10"> | ||
| 198 | + <div class="uk-form-row"> | ||
| 199 | + <label class="uk-form-label">开始时间</label> | ||
| 200 | + </div> | ||
| 201 | + </div> | ||
| 202 | + <div class="uk-width-7-10 pl5"> | ||
| 203 | + <input type="time" name="startDate" required> | ||
| 204 | + </div> | ||
| 205 | + </div> | ||
| 206 | + <div class="uk-grid"> | ||
| 207 | + <div class="uk-width-3-10"> | ||
| 208 | + <div class="uk-form-row"> | ||
| 209 | + <label class="uk-form-label">烂班原因</label> | ||
| 210 | + </div> | ||
| 211 | + </div> | ||
| 212 | + <div class="uk-width-7-10 pl5"> | ||
| 213 | + <select name="destroyReason" required></select> | ||
| 214 | + </div> | ||
| 215 | + </div> | ||
| 216 | + </form> | ||
| 217 | + </div> | ||
| 218 | + </div> | ||
| 219 | + | ||
| 220 | + <form class="uk-form" style="margin-top: 15px; padding: 0 10px 0 0;"> | ||
| 221 | + <textarea placeholder="备注" style="width: 100%;height: 70px;" id="globalRemarks"></textarea> | ||
| 222 | + </form> | ||
| 223 | + </div> | ||
| 224 | + | ||
| 225 | + <div class="uk-modal-footer uk-text-right"> | ||
| 226 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 227 | + <button type="button" class="uk-button uk-button-primary" id="submitChildTaskBtn">提交子任务</button> | ||
| 228 | + | ||
| 229 | + <div class="ct-footer-left"> | ||
| 230 | + <a id="betweenStationRangeCalc" data-drawer-id="station_route_spacing_chart_drawer">站点间公里不准?</a> | ||
| 231 | + </div> | ||
| 232 | + </div> | ||
| 233 | + </div> | ||
| 234 | + | ||
| 235 | + <div class="ct-bottom-drawer"> | ||
| 236 | + <div class="ct-bottom-drawer-body"></div> | ||
| 237 | + </div> | ||
| 238 | + | ||
| 239 | + <script id="sub-task-inpark-form-temp" type="text/html"> | ||
| 240 | + </script> | ||
| 241 | + | ||
| 242 | + <script> | ||
| 243 | + (function () { | ||
| 244 | + var modal = '#add-sub-task-inpark-modal', | ||
| 245 | + serviceForm = $('form[service_form]', modal), | ||
| 246 | + emptyForm = $('form[empty_form]', modal), | ||
| 247 | + destroyForm = $('form[destroy_form]', modal), | ||
| 248 | + sch, stationRoutes, parks, information, esCode, timeLocStations; | ||
| 249 | + var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; | ||
| 250 | + $(modal).on('init', function (e, data) { | ||
| 251 | + e.stopPropagation(); | ||
| 252 | + sch = data.sch; | ||
| 253 | + | ||
| 254 | + //站点路由 | ||
| 255 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { | ||
| 256 | + return a.stationRouteCode - b.stationRouteCode; | ||
| 257 | + }), 'directions')[sch.xlDir]; | ||
| 258 | + //空驶终点(停车场) | ||
| 259 | + //切换进场终点 | ||
| 260 | + $('select[name=endStation]', emptyForm).on('change', inparkNavigation); | ||
| 261 | + $.get('/basic/parks', function (rs) { | ||
| 262 | + parks = rs; | ||
| 263 | + var opts = ''; | ||
| 264 | + for (var code in parks) { | ||
| 265 | + opts += '<option value="' + code + '">' + parks[code] + '</option>'; | ||
| 266 | + } | ||
| 267 | + $('select[name=endStation]', emptyForm).html(opts).val(information.carPark).trigger('change'); | ||
| 268 | + }); | ||
| 269 | + //线路标准 | ||
| 270 | + information = gb_data_basic.getLineInformation(sch.xlBm); | ||
| 271 | + //本地存储的站点耗时 | ||
| 272 | + getLocStationsSpace(); | ||
| 273 | + | ||
| 274 | + //设置默认值 | ||
| 275 | + setDefaultVal(); | ||
| 276 | + | ||
| 277 | + //切换营运终点 | ||
| 278 | + $('select[name=endStation]', serviceForm).val(esCode).on('change', function () { | ||
| 279 | + var val = $(this).val(); | ||
| 280 | + if (val == esCode) { | ||
| 281 | + $('.uk-modal-dialog', modal).removeClass('three-children'); | ||
| 282 | + $('.sub-task-card.destroy-card').css("display", "none"); | ||
| 283 | + } | ||
| 284 | + else { | ||
| 285 | + $('.uk-modal-dialog', modal).addClass('three-children'); | ||
| 286 | + $('.sub-task-card.destroy-card').css("display", "inline-block"); | ||
| 287 | + } | ||
| 288 | + | ||
| 289 | + reClac(); | ||
| 290 | + }).trigger('change'); | ||
| 291 | + | ||
| 292 | + | ||
| 293 | + var dataArray = []; | ||
| 294 | + var fs = $('form.inpark_form', modal).formValidation({ | ||
| 295 | + framework: 'uikit', | ||
| 296 | + locale: 'zh_CN' | ||
| 297 | + }); | ||
| 298 | + fs.on('success.form.fv', function(e) { | ||
| 299 | + e.preventDefault(); | ||
| 300 | + if($(this).is(':hidden')) | ||
| 301 | + return; | ||
| 302 | + dataArray.push($.extend($(this).serializeJSON(), getDisabledVal(this) | ||
| 303 | + , {remarks: $('#globalRemarks',modal).val(), 'schedule.id': sch.id})); | ||
| 304 | + $(this).data('valid', true); | ||
| 305 | + | ||
| 306 | + if(allValidSuccess()){ | ||
| 307 | + var i = 0, rst; | ||
| 308 | + (function () { | ||
| 309 | + var f = arguments.callee; | ||
| 310 | + if(i >= dataArray.length){ | ||
| 311 | + UIkit.modal(modal).hide(); | ||
| 312 | + $('#history-sch-edit-modal').trigger('init', {id: sch.id}); | ||
| 313 | + return; | ||
| 314 | + } | ||
| 315 | + var data = dataArray[i]; | ||
| 316 | + //里程为0的不保存 | ||
| 317 | + if(data.mileage==0){ | ||
| 318 | + i++; | ||
| 319 | + f(); | ||
| 320 | + } | ||
| 321 | + else{ | ||
| 322 | + //营运子任务不写备注 | ||
| 323 | + if(data.mileageType == 'service' && !data.destroy) | ||
| 324 | + data.remarks = ''; | ||
| 325 | + //需要关联的部分主任务属性 | ||
| 326 | + data['schedule.xlBm'] = sch.xlBm; | ||
| 327 | + data['schedule.xlDir'] = sch.xlDir; | ||
| 328 | + gb_common.$post('/childTask/history', data, function (rs) { | ||
| 329 | + notify_succ('子任务添加成功'); | ||
| 330 | + rst = rs.t; | ||
| 331 | + i++; | ||
| 332 | + f(); | ||
| 333 | + }); | ||
| 334 | + } | ||
| 335 | + })(); | ||
| 336 | + } | ||
| 337 | + }); | ||
| 338 | + | ||
| 339 | + //校验不过 | ||
| 340 | + fs.on('err.field.fv', function () { | ||
| 341 | + $('#submitChildTaskBtn', modal).removeClass('disabled').removeAttr('disabled'); | ||
| 342 | + }); | ||
| 343 | + | ||
| 344 | + //submit | ||
| 345 | + $('#submitChildTaskBtn', modal).on('click', function () { | ||
| 346 | + $(this).addClass('disabled').attr('disabled','disabled'); | ||
| 347 | + dataArray = []; | ||
| 348 | + fs.data('valid', false); | ||
| 349 | + fs.formValidation('validate'); | ||
| 350 | + //fs.submit(); | ||
| 351 | + }); | ||
| 352 | + | ||
| 353 | + //选择烂班原因 | ||
| 354 | + $('select[name=destroyReason]', destroyForm).on('change', function () { | ||
| 355 | + var e =$('#globalRemarks', modal); | ||
| 356 | + e.val(e.val() + $(this).val() + ','); | ||
| 357 | + }); | ||
| 358 | + | ||
| 359 | + //根据主任务状态,复子任务 | ||
| 360 | + updateTwinsTaskBySch(sch); | ||
| 361 | + }); | ||
| 362 | + | ||
| 363 | + function allValidSuccess() { | ||
| 364 | + var flag = true; | ||
| 365 | + $('form.inpark_form:visible', modal).each(function (i, f) { | ||
| 366 | + if(!$(f).data('valid')){ | ||
| 367 | + flag = false; | ||
| 368 | + return false; | ||
| 369 | + } | ||
| 370 | + }); | ||
| 371 | + return flag; | ||
| 372 | + } | ||
| 373 | + | ||
| 374 | + //获取表单disabled 项的值 | ||
| 375 | + function getDisabledVal(f) { | ||
| 376 | + var rs = {}; | ||
| 377 | + $('input,select', f).each(function () { | ||
| 378 | + if($(this).attr('disabled')){ | ||
| 379 | + rs[$(this).attr('name')]=$(this).val(); | ||
| 380 | + } | ||
| 381 | + }); | ||
| 382 | + return rs; | ||
| 383 | + } | ||
| 384 | + | ||
| 385 | + function setDefaultVal() { | ||
| 386 | + var routeOpts = ''; | ||
| 387 | + $.each(stationRoutes, function () { | ||
| 388 | + routeOpts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>'; | ||
| 389 | + }); | ||
| 390 | + esCode = stationRoutes[stationRoutes.length - 1].stationCode; | ||
| 391 | + | ||
| 392 | + //营运起终点 | ||
| 393 | + $('select[name=startStation],select[name=endStation]', serviceForm).html(routeOpts); | ||
| 394 | + //空驶起点 | ||
| 395 | + $('select[name=startStation]', emptyForm).html(routeOpts).val(esCode); | ||
| 396 | + //烂班起终点 | ||
| 397 | + $('select[name=startStation],select[name=endStation]', destroyForm).html(routeOpts).val(esCode); | ||
| 398 | + | ||
| 399 | + //烂班原因 | ||
| 400 | + var adjustExpsOpts = '<option value="">请选择...</option>'; | ||
| 401 | + $.each(adjustExps, function (i, str) { | ||
| 402 | + adjustExpsOpts += '<option value="' + str + '">' + str + '</option>'; | ||
| 403 | + }); | ||
| 404 | + $('select[name=destroyReason]', destroyForm).html(adjustExpsOpts); | ||
| 405 | + | ||
| 406 | + //营运开始时间 | ||
| 407 | + $('input[name=startDate]', serviceForm).val(sch.fcsjActual?sch.fcsjActual:sch.dfsj); | ||
| 408 | + | ||
| 409 | + //营运班次类型 | ||
| 410 | + $('select[name=type1]', serviceForm).val(sch['sflj']?'临加':'正常'); | ||
| 411 | + } | ||
| 412 | + | ||
| 413 | + //点击 路径 | ||
| 414 | + $('#inpark_paths_link', modal).on('click', function () { | ||
| 415 | + | ||
| 416 | + }); | ||
| 417 | + | ||
| 418 | + //进场导航 | ||
| 419 | + var drivingRouteResult; | ||
| 420 | + function inparkNavigation() { | ||
| 421 | + var start = $('select[name=startStation]', emptyForm).val() | ||
| 422 | + ,end = $('select[name=endStation]', emptyForm).val(); | ||
| 423 | + | ||
| 424 | + if(!end) return; | ||
| 425 | + | ||
| 426 | + var station = getStationByCode(start).station | ||
| 427 | + ,park = gb_data_basic.getCarparkByCode(end); | ||
| 428 | + | ||
| 429 | + if(!park){ | ||
| 430 | + notify_err('无法找到停车场的坐标对照!!!'); | ||
| 431 | + return; | ||
| 432 | + } | ||
| 433 | + var tArray = park['gCenterPoint'].split(' '); | ||
| 434 | + var sCoord = TransGPS.wgsToBD(station['gLaty'], station['gLonx']) | ||
| 435 | + ,eCoord = TransGPS.wgsToBD(parseFloat(tArray[1]), parseFloat(tArray[0])); | ||
| 436 | + | ||
| 437 | + var sp = new BMap.Point(sCoord.lng,sCoord.lat); | ||
| 438 | + var ep = new BMap.Point(eCoord.lng,eCoord.lat); | ||
| 439 | + | ||
| 440 | + var driving = new BMap.DrivingRoute('上海', { | ||
| 441 | + onSearchComplete: function (rs) { | ||
| 442 | + drivingRouteResult = rs; | ||
| 443 | + calcInparkMileage(0); | ||
| 444 | + } | ||
| 445 | + }); | ||
| 446 | + driving.search(sp,ep); | ||
| 447 | + } | ||
| 448 | + | ||
| 449 | + function calcInparkMileage(index) { | ||
| 450 | + var count = drivingRouteResult.getNumPlans(); | ||
| 451 | + | ||
| 452 | + //选择方案 | ||
| 453 | + var routePlan = drivingRouteResult.getPlan(index); | ||
| 454 | + //里程 | ||
| 455 | + var mileage = routePlan.getDistance(false); | ||
| 456 | + $('input[name=mileage]', emptyForm).val(mileage / 1000); | ||
| 457 | + //结束时间 | ||
| 458 | + var duratio = routePlan.getDuration(false); | ||
| 459 | + var st = $('input[name=startDate]', emptyForm).val(); | ||
| 460 | + var ets = moment(st, 'HH:mm').add(duratio, 'seconds').format('HH:mm'); | ||
| 461 | + $('input[name=endDate]', emptyForm).val(ets); | ||
| 462 | + | ||
| 463 | + | ||
| 464 | + $('#inpark_paths_link span', modal).text(count); | ||
| 465 | + } | ||
| 466 | + | ||
| 467 | + function getStationByCode(code) { | ||
| 468 | + for(var i = 0; i < stationRoutes.length; i++){ | ||
| 469 | + if(stationRoutes[i]['stationCode']==code) | ||
| 470 | + return stationRoutes[i]; | ||
| 471 | + } | ||
| 472 | + return null; | ||
| 473 | + } | ||
| 474 | + | ||
| 475 | + function reClac() { | ||
| 476 | + var serviceEnd = $('select[name=endStation]', serviceForm).val(); | ||
| 477 | + //空驶起点 == 营运终点 | ||
| 478 | + $('select[name=startStation]', emptyForm).val(serviceEnd); | ||
| 479 | + | ||
| 480 | + //计算营运里程 | ||
| 481 | + var s = $('select[name=startStation]', serviceForm).val(), | ||
| 482 | + e = $('select[name=endStation]', serviceForm).val(); | ||
| 483 | + var sMileage = calcMileage(s, e); | ||
| 484 | + if(sMileage >= 0) | ||
| 485 | + $('input[name=mileage]', serviceForm).val(sMileage); | ||
| 486 | + | ||
| 487 | + //营运结束时间 | ||
| 488 | + var et = sch.dfsjT + (parseInt(sMileage / sch.jhlcOrig * sch.bcsj) * 60 * 1000) | ||
| 489 | + ,ets = et > sch.zdsjT?sch.zdsj:moment(et).format('HH:mm'); | ||
| 490 | + $('input[name=endDate]', serviceForm).val(ets); | ||
| 491 | + | ||
| 492 | + //有烂班 | ||
| 493 | + if (serviceEnd != esCode) { | ||
| 494 | + //烂班起点 == 营运终点 | ||
| 495 | + $('select[name=startStation]', destroyForm).val(serviceEnd); | ||
| 496 | + //计算烂班公里 | ||
| 497 | + s = $('select[name=startStation]', destroyForm).val(); | ||
| 498 | + e = $('select[name=endStation]', destroyForm).val(); | ||
| 499 | + var dMileage = calcMileage(s, e); | ||
| 500 | + $('input[name=mileage]', destroyForm).val(dMileage); | ||
| 501 | + //烂班开始时间 | ||
| 502 | + $('input[name=startDate]', destroyForm).val(ets); | ||
| 503 | + } | ||
| 504 | + | ||
| 505 | + //进场开始时间 | ||
| 506 | + $('input[name=startDate]', emptyForm).val(ets); | ||
| 507 | + | ||
| 508 | + //重新导航 | ||
| 509 | + inparkNavigation(); | ||
| 510 | + } | ||
| 511 | + | ||
| 512 | + function calcMileage(s, e) { | ||
| 513 | + var mileage = 0, flag, code; | ||
| 514 | + if (timeLocStations) { | ||
| 515 | + //空间坐标计算的站距 | ||
| 516 | + $.each(timeLocStations, function () { | ||
| 517 | + code = this.station['STATION_CODE']; | ||
| 518 | + if (flag) | ||
| 519 | + mileage = gb_common.accAdd(mileage, this.toDistanceGl); | ||
| 520 | + if (code == s) | ||
| 521 | + flag = true; | ||
| 522 | + if (code == e) | ||
| 523 | + return false; | ||
| 524 | + }); | ||
| 525 | + } | ||
| 526 | + else{ | ||
| 527 | + //从原始站点路由字段里取值 | ||
| 528 | + $.each(stationRoutes, function () { | ||
| 529 | + code = this['stationCode']; | ||
| 530 | + if (flag) | ||
| 531 | + mileage = gb_common.accAdd(mileage, this.distances); | ||
| 532 | + if (code == s) | ||
| 533 | + flag = true; | ||
| 534 | + if (code == e) | ||
| 535 | + return false; | ||
| 536 | + }); | ||
| 537 | + } | ||
| 538 | + return mileage; | ||
| 539 | + } | ||
| 540 | + | ||
| 541 | + //从本地localStorage获取站间距数据 | ||
| 542 | + function getLocStationsSpace() { | ||
| 543 | + try { | ||
| 544 | + timeLocStations = window.localStorage.getItem('control_route_distance_' + sch.xlBm); | ||
| 545 | + if (timeLocStations) | ||
| 546 | + timeLocStations = JSON.parse(timeLocStations).stations[sch.xlDir == 0 ? 'up' : 'down']; | ||
| 547 | + } catch (e) { | ||
| 548 | + console.log(e); | ||
| 549 | + } | ||
| 550 | + } | ||
| 551 | + | ||
| 552 | + //站间距计算后刷新 | ||
| 553 | + $(modal).on('refresh_station_space', function () { | ||
| 554 | + getLocStationsSpace(); | ||
| 555 | + reClac(); | ||
| 556 | + }); | ||
| 557 | + | ||
| 558 | + //------ 下抽屉 ------ | ||
| 559 | + $('#betweenStationRangeCalc', modal).on('click', function () { | ||
| 560 | + var id = $(this).data('drawer-id'); | ||
| 561 | + switchBtmDrawer(id, '/real_control_v2/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html'); | ||
| 562 | + }); | ||
| 563 | + | ||
| 564 | + var btmDrawer = $('.ct-bottom-drawer', modal); | ||
| 565 | + //打开事件 | ||
| 566 | + btmDrawer.on('drawer_show', function () { | ||
| 567 | + var url = $(this).data('url'); | ||
| 568 | + if (!url) { | ||
| 569 | + alert('无效的地址'); | ||
| 570 | + } | ||
| 571 | + | ||
| 572 | + var drawerPanel = $(this).data('name'); | ||
| 573 | + $('.ct-bottom-drawer-body', btmDrawer).load(url, function () { | ||
| 574 | + $('#' + drawerPanel).trigger('drawer-init', {sch: sch}); | ||
| 575 | + }); | ||
| 576 | + }); | ||
| 577 | + | ||
| 578 | + function switchBtmDrawer(id, url) { | ||
| 579 | + if (btmDrawer.hasClass('open') && btmDrawer.data('name') == id) { | ||
| 580 | + btmDrawer.removeClass('open'); | ||
| 581 | + btmDrawer.removeData('name').removeData('url'); | ||
| 582 | + } | ||
| 583 | + else { | ||
| 584 | + btmDrawer.addClass('open'); | ||
| 585 | + btmDrawer.data('name', id).data('url', url).trigger('drawer_show'); | ||
| 586 | + } | ||
| 587 | + } | ||
| 588 | + | ||
| 589 | + | ||
| 590 | + function updateTwinsTaskBySch(sch) { | ||
| 591 | + //主任务是烂班 | ||
| 592 | + if(sch.destroy){ | ||
| 593 | + serviceForm.prepend('<input type="hidden" name="destroy" value="true">'); | ||
| 594 | + $('[name=mileage]', serviceForm).val(sch.jhlcOrig).attr('disabled', 'disabled'); | ||
| 595 | + $('.twins_task_panel .uk-badge', modal).addClass('uk-badge-danger').text('烂班'); | ||
| 596 | + //终点禁选 | ||
| 597 | + $('select[name=endStation]', serviceForm).attr('disabled', 'disabled'); | ||
| 598 | + //开始结束时间禁选 | ||
| 599 | + | ||
| 600 | + //空驶起点 | ||
| 601 | + $('select[name=startStation]', emptyForm).val(sch.qdzCode); | ||
| 602 | + } | ||
| 603 | + } | ||
| 604 | + })(); | ||
| 605 | + </script> | ||
| 606 | +</div> | ||
| 0 | \ No newline at end of file | 607 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/h_add_sub_task_oil.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal ct_move_modal" id="schedule-addsch_oil-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 1101px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>空驶进出场</h2></div> | ||
| 6 | + | ||
| 7 | + <div class="uk-grid"> | ||
| 8 | + <div class="uk-width-1-3"> | ||
| 9 | + <form class="uk-form uk-form-horizontal c_task_form twins_task_form"> | ||
| 10 | + <input type="hidden" name="type1" value="正常"> | ||
| 11 | + <input type="hidden" name="type2" value="1"> | ||
| 12 | + <input type="hidden" name="mileageType" value="service"> | ||
| 13 | + | ||
| 14 | + <div class="uk-panel uk-panel-box uk-panel-box-primary"> | ||
| 15 | + <div class="uk-panel-badge uk-badge ">营运</div> | ||
| 16 | + <h3 class="uk-panel-title">线路上站点间</h3> | ||
| 17 | + <div class="uk-form-row"> | ||
| 18 | + <label class="uk-form-label">起点站</label> | ||
| 19 | + <div class="uk-form-controls"> | ||
| 20 | + <input type="hidden" name="startStation"> | ||
| 21 | + <input type="text" name="startStationName" disabled> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + <div class="uk-form-row"> | ||
| 25 | + <label class="uk-form-label">终点站</label> | ||
| 26 | + <div class="uk-form-controls"> | ||
| 27 | + <input type="hidden" name="endStation"> | ||
| 28 | + <input type="text" name="endStationName" disabled> | ||
| 29 | + </div> | ||
| 30 | + </div> | ||
| 31 | + <div class="uk-form-row"> | ||
| 32 | + <label class="uk-form-label">里程</label> | ||
| 33 | + <div class="uk-form-controls"> | ||
| 34 | + <input type="number" step="0.01" name="mileage" max=222 | ||
| 35 | + data-fv-lessthan-inclusive="false" | ||
| 36 | + disabled> | ||
| 37 | + </div> | ||
| 38 | + </div> | ||
| 39 | + <div class="uk-form-row"> | ||
| 40 | + <label class="uk-form-label">开始时间</label> | ||
| 41 | + <div class="uk-form-controls"> | ||
| 42 | + <input type="time" name="startDate" required> | ||
| 43 | + </div> | ||
| 44 | + </div> | ||
| 45 | + <div class="uk-form-row"> | ||
| 46 | + <label class="uk-form-label">结束时间</label> | ||
| 47 | + <div class="uk-form-controls"> | ||
| 48 | + <input type="time" name="endDate" required> | ||
| 49 | + </div> | ||
| 50 | + </div> | ||
| 51 | + </div> | ||
| 52 | + </form> | ||
| 53 | + </div> | ||
| 54 | + | ||
| 55 | + <div class="uk-width-1-3"> | ||
| 56 | + <form class="uk-form uk-form-horizontal c_task_form"> | ||
| 57 | + <input type="hidden" name="type1" value="临加"> | ||
| 58 | + <input type="hidden" name="type2" value="2"> | ||
| 59 | + <input type="hidden" name="mileageType" value="empty"> | ||
| 60 | + | ||
| 61 | + <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | ||
| 62 | + <div class="uk-panel-badge uk-badge uk-badge-default">空驶</div> | ||
| 63 | + <h3 class="uk-panel-title">进场</h3> | ||
| 64 | + <div class="uk-form-row"> | ||
| 65 | + <label class="uk-form-label">起点站</label> | ||
| 66 | + <div class="uk-form-controls"> | ||
| 67 | + <select name="startStation" required> | ||
| 68 | + </select> | ||
| 69 | + <input type="hidden" name="startStationName" disabled> | ||
| 70 | + </div> | ||
| 71 | + </div> | ||
| 72 | + <div class="uk-form-row"> | ||
| 73 | + <label class="uk-form-label">终点站</label> | ||
| 74 | + <div class="uk-form-controls"> | ||
| 75 | + <select name="endStation" required> | ||
| 76 | + </select> | ||
| 77 | + <input type="hidden" name="endStationName" disabled> | ||
| 78 | + </div> | ||
| 79 | + </div> | ||
| 80 | + <div class="uk-form-row"> | ||
| 81 | + <label class="uk-form-label">里程</label> | ||
| 82 | + <div class="uk-form-controls"> | ||
| 83 | + <input type="number" step="0.01" name="mileage" max=222 | ||
| 84 | + data-fv-lessthan-inclusive="false" | ||
| 85 | + required> | ||
| 86 | + </div> | ||
| 87 | + </div> | ||
| 88 | + <div class="uk-form-row"> | ||
| 89 | + <label class="uk-form-label">开始时间</label> | ||
| 90 | + <div class="uk-form-controls"> | ||
| 91 | + <input type="time" name="startDate" required> | ||
| 92 | + </div> | ||
| 93 | + </div> | ||
| 94 | + <div class="uk-form-row"> | ||
| 95 | + <label class="uk-form-label">结束时间</label> | ||
| 96 | + <div class="uk-form-controls"> | ||
| 97 | + <input type="time" name="endDate" required> | ||
| 98 | + </div> | ||
| 99 | + </div> | ||
| 100 | + </div> | ||
| 101 | + </form> | ||
| 102 | + </div> | ||
| 103 | + | ||
| 104 | + <div class="uk-width-1-3"> | ||
| 105 | + <form class="uk-form uk-form-horizontal c_task_form"> | ||
| 106 | + <input type="hidden" name="type1" value="临加"> | ||
| 107 | + <input type="hidden" name="type2" value="3"> | ||
| 108 | + <input type="hidden" name="mileageType" value="empty"> | ||
| 109 | + | ||
| 110 | + <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | ||
| 111 | + <div class="uk-panel-badge uk-badge uk-badge-default">空驶</div> | ||
| 112 | + <h3 class="uk-panel-title">出场</h3> | ||
| 113 | + <div class="uk-form-row"> | ||
| 114 | + <label class="uk-form-label">起点站</label> | ||
| 115 | + <div class="uk-form-controls"> | ||
| 116 | + <select name="startStation" required> | ||
| 117 | + </select> | ||
| 118 | + <input type="hidden" name="startStationName" disabled> | ||
| 119 | + </div> | ||
| 120 | + </div> | ||
| 121 | + <div class="uk-form-row"> | ||
| 122 | + <label class="uk-form-label">终点站</label> | ||
| 123 | + <div class="uk-form-controls"> | ||
| 124 | + <select name="endStation" required> | ||
| 125 | + </select> | ||
| 126 | + <input type="hidden" name="endStationName" disabled> | ||
| 127 | + </div> | ||
| 128 | + </div> | ||
| 129 | + <div class="uk-form-row"> | ||
| 130 | + <label class="uk-form-label">里程</label> | ||
| 131 | + <div class="uk-form-controls"> | ||
| 132 | + <input type="number" step="0.01" name="mileage" max=222 | ||
| 133 | + data-fv-lessthan-inclusive="false" | ||
| 134 | + required> | ||
| 135 | + </div> | ||
| 136 | + </div> | ||
| 137 | + <div class="uk-form-row"> | ||
| 138 | + <label class="uk-form-label">开始时间</label> | ||
| 139 | + <div class="uk-form-controls"> | ||
| 140 | + <input type="time" name="startDate" required> | ||
| 141 | + </div> | ||
| 142 | + </div> | ||
| 143 | + <div class="uk-form-row"> | ||
| 144 | + <label class="uk-form-label">结束时间</label> | ||
| 145 | + <div class="uk-form-controls"> | ||
| 146 | + <input type="time" name="endDate" required> | ||
| 147 | + </div> | ||
| 148 | + </div> | ||
| 149 | + </div> | ||
| 150 | + </form> | ||
| 151 | + </div> | ||
| 152 | + | ||
| 153 | + <div class="uk-width-1-1" style="margin-top: 20px;"> | ||
| 154 | + <hr style="border-top: 1px dashed #ddd;"> | ||
| 155 | + </div> | ||
| 156 | + <div class="uk-width-2-3 uk-push-1-3" style="margin-top: 10px;"> | ||
| 157 | + | ||
| 158 | + <div class="ct_tags inout_reason_tags"> | ||
| 159 | + <span>加油</span> | ||
| 160 | + <span>维修</span> | ||
| 161 | + </div> | ||
| 162 | + <form class="uk-form"> | ||
| 163 | + <textarea placeholder="备注,必填" style="width: 100%;height: 70px;" id="globalRemarks"></textarea> | ||
| 164 | + </form> | ||
| 165 | + </div> | ||
| 166 | + </div> | ||
| 167 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | ||
| 168 | + <span class="bind_gas_station_panel" style="position: absolute;left: 30px;text-decoration: underline;"></span> | ||
| 169 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 170 | + <button type="submit" id="submitChildTaskBtn" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | ||
| 171 | + </div> | ||
| 172 | + </div> | ||
| 173 | + | ||
| 174 | + <script id="schedule-addsch_oil-form-temp" type="text/html"> | ||
| 175 | + | ||
| 176 | + </script> | ||
| 177 | + | ||
| 178 | + <script> | ||
| 179 | + (function () { | ||
| 180 | + var modal = '#schedule-addsch_oil-modal', | ||
| 181 | + sch, stationRoutes, parks, oilStation; | ||
| 182 | + var yyForm = $('form', modal)[0]; | ||
| 183 | + var jcForm = $('form', modal)[1]; | ||
| 184 | + var ccForm = $('form', modal)[2]; | ||
| 185 | + var oilId; | ||
| 186 | + var lineInfo; | ||
| 187 | + | ||
| 188 | + var folder = '/real_control_v2/fragments/north/nav/history_sch'; | ||
| 189 | + $(modal).on('init', function (e, data) { | ||
| 190 | + e.stopPropagation(); | ||
| 191 | + sch = data.sch; | ||
| 192 | + | ||
| 193 | + oilId = sch.xlBm + '_oil_station'; | ||
| 194 | + lineInfo = gb_data_basic.codeToLine[sch.xlBm]; | ||
| 195 | + | ||
| 196 | + //站点路由 | ||
| 197 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { | ||
| 198 | + return a.stationRouteCode - b.stationRouteCode; | ||
| 199 | + }), 'directions'); | ||
| 200 | + | ||
| 201 | + setDefaultVal(); | ||
| 202 | + //停车场 | ||
| 203 | + $.get('/basic/parks', function (rs) { | ||
| 204 | + parks = rs; | ||
| 205 | + var opts = ''; | ||
| 206 | + for (var code in parks) { | ||
| 207 | + opts += '<option value="' + code + '">' + parks[code] + '</option>'; | ||
| 208 | + } | ||
| 209 | + $('[name=endStation]', jcForm).html(opts); | ||
| 210 | + $('[name=startStation]', ccForm).html(opts); | ||
| 211 | + }); | ||
| 212 | + | ||
| 213 | + //切换空驶起终点 | ||
| 214 | + $('[name=endStation]', jcForm).on('change', reCalcIn); | ||
| 215 | + $('[name=startStation]', jcForm).on('change', reCalcIn); | ||
| 216 | + | ||
| 217 | + $('[name=endStation]', ccForm).on('change', reCalcOut); | ||
| 218 | + $('[name=startStation]', ccForm).on('change', reCalcOut); | ||
| 219 | + //修改开始时间 | ||
| 220 | + $('[name=startDate]', jcForm).on('change', reCalcIn); | ||
| 221 | + $('[name=startDate]', ccForm).on('change', reCalcOut); | ||
| 222 | + | ||
| 223 | + //绑定的社会加油站 | ||
| 224 | + $.get('/oilStation/'+sch.xlBm, function (rs) { | ||
| 225 | + var htmlStr; | ||
| 226 | + oilStation = rs; | ||
| 227 | + if(oilStation){ | ||
| 228 | + htmlStr = '<a><i class="uk-icon-product-hunt"></i> '+oilStation.stationName+'</a>'; | ||
| 229 | + if(oilStation.stationCode) | ||
| 230 | + oilId = oilStation.stationCode; | ||
| 231 | + | ||
| 232 | + var opt = '<option value="'+oilId+'" class="oil_station_opt">'+oilStation.stationName+'</option>'; | ||
| 233 | + $('[name=endStation]', jcForm).prepend(opt).val(oilId).change(); | ||
| 234 | + $('[name=startStation]', ccForm).prepend(opt).val(oilId).change(); | ||
| 235 | + } | ||
| 236 | + else | ||
| 237 | + htmlStr = '<a>为'+sch.xlName+'绑定一个停车场</a>'; | ||
| 238 | + | ||
| 239 | + $('.bind_gas_station_panel', modal).html(htmlStr); | ||
| 240 | + $('.bind_gas_station_panel a', modal).on('click', function () { | ||
| 241 | + open_modal(folder + '/h_oil_station.html', { | ||
| 242 | + sch: sch | ||
| 243 | + }, {center: false, bgclose: false, modal: false}); | ||
| 244 | + }); | ||
| 245 | + }); | ||
| 246 | + | ||
| 247 | + //根据主任务状态,复子任务 | ||
| 248 | + updateTwinsTaskBySch(sch); | ||
| 249 | + }); | ||
| 250 | + | ||
| 251 | + var dataArray = []; | ||
| 252 | + var fs = $('form.c_task_form', modal).formValidation({ | ||
| 253 | + framework: 'uikit', | ||
| 254 | + locale: 'zh_CN' | ||
| 255 | + }); | ||
| 256 | + fs.on('success.form.fv', function(e) { | ||
| 257 | + e.preventDefault(); | ||
| 258 | + if($(this).is(':hidden')) | ||
| 259 | + return; | ||
| 260 | + dataArray.push($.extend($(this).serializeJSON(), getDisabledVal(this) | ||
| 261 | + , {remarks: $('#globalRemarks', modal).val(), 'schedule.id': sch.id})); | ||
| 262 | + $(this).data('valid', true); | ||
| 263 | + | ||
| 264 | + if(allValidSuccess()){ | ||
| 265 | + var i = 0, rst; | ||
| 266 | + (function () { | ||
| 267 | + var f = arguments.callee; | ||
| 268 | + if(i >= dataArray.length){ | ||
| 269 | + UIkit.modal(modal).hide(); | ||
| 270 | + $('#history-sch-edit-modal').trigger('init', {id: sch.id}); | ||
| 271 | + return; | ||
| 272 | + } | ||
| 273 | + var data = dataArray[i]; | ||
| 274 | + //里程为0的不保存 | ||
| 275 | + if(data.mileage==0){ | ||
| 276 | + i++; | ||
| 277 | + f(); | ||
| 278 | + } | ||
| 279 | + else{ | ||
| 280 | + //营运子任务不写备注 | ||
| 281 | + if(data.mileageType == 'service' && !data.destroy) | ||
| 282 | + data.remarks = ''; | ||
| 283 | + //需要关联的部分主任务属性 | ||
| 284 | + data['schedule.xlBm'] = sch.xlBm; | ||
| 285 | + data['schedule.xlDir'] = sch.xlDir; | ||
| 286 | + gb_common.$post('/childTask/history', data, function (rs) { | ||
| 287 | + notify_succ('子任务添加成功'); | ||
| 288 | + rst = rs.t; | ||
| 289 | + i++; | ||
| 290 | + f(); | ||
| 291 | + }); | ||
| 292 | + } | ||
| 293 | + })(); | ||
| 294 | + } | ||
| 295 | + }); | ||
| 296 | + | ||
| 297 | + //校验不过 | ||
| 298 | + fs.on('err.field.fv', function () { | ||
| 299 | + $('#submitChildTaskBtn', modal).removeClass('disabled').removeAttr('disabled'); | ||
| 300 | + }); | ||
| 301 | + | ||
| 302 | + //submit | ||
| 303 | + $('#submitChildTaskBtn', modal).on('click', function () { | ||
| 304 | + //备注 | ||
| 305 | + var rems = $('#globalRemarks', modal).val(); | ||
| 306 | + if($.trim(rems) == ''){ | ||
| 307 | + notify_err('你必须填写备注!'); | ||
| 308 | + return; | ||
| 309 | + } | ||
| 310 | + | ||
| 311 | + //空驶的进场终点名称 | ||
| 312 | + if(!oilStation || $('[name=endStation]', jcForm).val() != oilId) | ||
| 313 | + $('[name=endStationName]', jcForm).val(''); | ||
| 314 | + else | ||
| 315 | + $('[name=endStationName]', jcForm).val(oilStation.stationName); | ||
| 316 | + | ||
| 317 | + //空驶的出场起点名称 | ||
| 318 | + if(!oilStation || $('[name=startStation]', ccForm).val() != oilId) | ||
| 319 | + $('[name=startStationName]', ccForm).val(''); | ||
| 320 | + else | ||
| 321 | + $('[name=startStationName]', ccForm).val(oilStation.stationName); | ||
| 322 | + | ||
| 323 | + | ||
| 324 | + //提交表单 | ||
| 325 | + $(this).addClass('disabled').attr('disabled','disabled'); | ||
| 326 | + dataArray = []; | ||
| 327 | + fs.data('valid', false); | ||
| 328 | + fs.formValidation('validate'); | ||
| 329 | + //fs.submit(); | ||
| 330 | + }); | ||
| 331 | + | ||
| 332 | + //获取表单disabled 项的值 | ||
| 333 | + function getDisabledVal(f) { | ||
| 334 | + var rs = {}; | ||
| 335 | + $('input,select', f).each(function () { | ||
| 336 | + if($(this).attr('disabled')){ | ||
| 337 | + rs[$(this).attr('name')]=$(this).val(); | ||
| 338 | + } | ||
| 339 | + }); | ||
| 340 | + return rs; | ||
| 341 | + } | ||
| 342 | + | ||
| 343 | + function allValidSuccess() { | ||
| 344 | + var flag = true; | ||
| 345 | + $('form.c_task_form:visible', modal).each(function (i, f) { | ||
| 346 | + if(!$(f).data('valid')){ | ||
| 347 | + flag = false; | ||
| 348 | + return false; | ||
| 349 | + } | ||
| 350 | + }); | ||
| 351 | + return flag; | ||
| 352 | + } | ||
| 353 | + | ||
| 354 | + function setDefaultVal() { | ||
| 355 | + //营运班次 | ||
| 356 | + $('[name=startStation]', yyForm).val(sch.qdzCode); | ||
| 357 | + $('[name=startStationName]', yyForm).val(sch.qdzName); | ||
| 358 | + $('[name=endStation]', yyForm).val(sch.zdzCode); | ||
| 359 | + $('[name=endStationName]', yyForm).val(sch.zdzName); | ||
| 360 | + $('[name=mileage]', yyForm).val(sch.jhlc); | ||
| 361 | + $('[name=startDate]', yyForm).val(sch.fcsjActual==null?sch.dfsj:sch.fcsjActual); | ||
| 362 | + $('[name=endDate]', yyForm).val(sch.zdsjActual==null?sch.zdsj:sch.zdsjActual); | ||
| 363 | + | ||
| 364 | + //设置进场默认值 | ||
| 365 | + $('[name=startStation]', jcForm).html(createStationOpts(stationRoutes[sch.xlDir])); | ||
| 366 | + $('[name=startDate]', jcForm).val(sch.zdsjActual==null?sch.zdsj:sch.zdsjActual); | ||
| 367 | + $('[name=startStation]', jcForm).val(sch.zdzCode); | ||
| 368 | + | ||
| 369 | + //设置出场默认值 | ||
| 370 | + $('[name=endStation]', ccForm).html(createStationOpts(stationRoutes[sch.xlDir])); | ||
| 371 | + $('[name=endStation]', ccForm).val(sch.zdzCode); | ||
| 372 | + } | ||
| 373 | + | ||
| 374 | + function createStationOpts(list) { | ||
| 375 | + var opts = ''; | ||
| 376 | + $.each(list, function () { | ||
| 377 | + opts += '<option value="'+this.station.stationCod+'">'+this.stationName+'</option>'; | ||
| 378 | + }); | ||
| 379 | + return opts; | ||
| 380 | + } | ||
| 381 | + | ||
| 382 | + function reCalcIn() { | ||
| 383 | + if(!oilStation || $('[name=endStation]', jcForm).val() != oilId) | ||
| 384 | + return; | ||
| 385 | + | ||
| 386 | + var data; | ||
| 387 | + var qdz = $('[name=startStation]', jcForm).find("option:selected").text(); | ||
| 388 | + if(qdz == lineInfo.startStationName){ | ||
| 389 | + //起点进场 | ||
| 390 | + data = { | ||
| 391 | + mileage: oilStation.upInMile, | ||
| 392 | + time: oilStation.upInTime | ||
| 393 | + } | ||
| 394 | + } | ||
| 395 | + else if(qdz == lineInfo.endStationName){ | ||
| 396 | + //终点进场 | ||
| 397 | + data = { | ||
| 398 | + mileage: oilStation.downInMile, | ||
| 399 | + time: oilStation.downInTime | ||
| 400 | + } | ||
| 401 | + } | ||
| 402 | + if(!data) | ||
| 403 | + return; | ||
| 404 | + | ||
| 405 | + $('[name=mileage]', jcForm).val(data.mileage); | ||
| 406 | + var st = $('[name=startDate]', jcForm).val(); | ||
| 407 | + if(!st) | ||
| 408 | + return; | ||
| 409 | + var ets = moment(st, 'HH:mm').add(data.time, 'minute').format('HH:mm'); | ||
| 410 | + $('[name=endDate]', jcForm).val(ets); | ||
| 411 | + | ||
| 412 | + //出场时间 + 1 分钟 | ||
| 413 | + $('[name=startDate]', ccForm).val(moment(ets, 'HH:mm').add(1, 'minute').format('HH:mm')); | ||
| 414 | + } | ||
| 415 | + | ||
| 416 | + function reCalcOut() { | ||
| 417 | + if(!oilStation || $('[name=startStation]', ccForm).val() != oilId) | ||
| 418 | + return; | ||
| 419 | + | ||
| 420 | + var data; | ||
| 421 | + var zdz = $('[name=endStation]', ccForm).find("option:selected").text(); | ||
| 422 | + if(zdz == lineInfo.startStationName){ | ||
| 423 | + //出场到起点 | ||
| 424 | + data = { | ||
| 425 | + mileage: oilStation.upOutMile, | ||
| 426 | + time: oilStation.upOutTime | ||
| 427 | + } | ||
| 428 | + } | ||
| 429 | + else if(zdz == lineInfo.endStationName){ | ||
| 430 | + //出场到终点 | ||
| 431 | + data = { | ||
| 432 | + mileage: oilStation.downOutMile, | ||
| 433 | + time: oilStation.downOutTime | ||
| 434 | + } | ||
| 435 | + } | ||
| 436 | + if(!data) | ||
| 437 | + return; | ||
| 438 | + | ||
| 439 | + $('[name=mileage]', ccForm).val(data.mileage); | ||
| 440 | + var st = $('[name=startDate]', ccForm).val(); | ||
| 441 | + if(!st) | ||
| 442 | + return; | ||
| 443 | + var ets = moment(st, 'HH:mm').add(data.time, 'minute').format('HH:mm'); | ||
| 444 | + $('[name=endDate]', ccForm).val(ets); | ||
| 445 | + } | ||
| 446 | + | ||
| 447 | + //tags 点击 | ||
| 448 | + $('.inout_reason_tags>span', modal).on('click', function () { | ||
| 449 | + if($(this).hasClass('active')){ | ||
| 450 | + $(this).removeClass('active'); | ||
| 451 | + return; | ||
| 452 | + } | ||
| 453 | + | ||
| 454 | + var e = $('#globalRemarks', modal); | ||
| 455 | + e.val(e.val() + $(this).text() + ','); | ||
| 456 | + | ||
| 457 | + $('.inout_reason_tags>span.active', modal).removeClass('active'); | ||
| 458 | + $(this).addClass('active'); | ||
| 459 | + }); | ||
| 460 | + | ||
| 461 | + | ||
| 462 | + function updateTwinsTaskBySch(sch) { | ||
| 463 | + //主任务是烂班 | ||
| 464 | + if(sch.destroy){ | ||
| 465 | + var f = $('.twins_task_form', modal); | ||
| 466 | + $('.uk-badge', f).addClass('uk-badge-danger').text('烂班'); | ||
| 467 | + $('.uk-panel-box', f).removeClass('uk-panel-box-primary'); | ||
| 468 | + f.prepend('<input type="hidden" name="destroy" value="true">'); | ||
| 469 | + $('[name=mileage]', f).val(sch.jhlcOrig); | ||
| 470 | + | ||
| 471 | + //进场起点 | ||
| 472 | + $('[name=startStation]', jcForm).val(sch.qdzCode); | ||
| 473 | + //出场终点 | ||
| 474 | + $('[name=endStation]', ccForm).val(sch.qdzCode); | ||
| 475 | + } | ||
| 476 | + } | ||
| 477 | + })(); | ||
| 478 | + </script> | ||
| 479 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/h_add_sub_task_other.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal ct_move_modal" id="add-sub-task-other-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 635px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>自定义子任务</h2></div> | ||
| 6 | + <form class="uk-form uk-form-horizontal"> | ||
| 7 | + </form> | ||
| 8 | + </div> | ||
| 9 | + | ||
| 10 | + <script id="sub-task-other-form-temp" type="text/html"> | ||
| 11 | + <input type="hidden" value="{{sch.id}}" name="schedule.id"> | ||
| 12 | + <div class="uk-grid"> | ||
| 13 | + <div class="uk-width-1-1"> | ||
| 14 | + <div class="uk-form-row"> | ||
| 15 | + <label class="uk-form-label">班次类型</label> | ||
| 16 | + <div class="uk-form-controls"> | ||
| 17 | + <select class="form-control" name="type1" style="width: 65px;"> | ||
| 18 | + <option>正常</option> | ||
| 19 | + <option>临加</option> | ||
| 20 | + </select> | ||
| 21 | + <select class="form-control nt-dictionary" name="type2" data-group=ChildTaskType | ||
| 22 | + style="width: 126px;;"></select> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + </div> | ||
| 26 | + </div> | ||
| 27 | + <div class="uk-grid"> | ||
| 28 | + <div class="uk-width-1-2"> | ||
| 29 | + <div class="uk-form-row"> | ||
| 30 | + <label class="uk-form-label">起点 </label> | ||
| 31 | + <div class="uk-form-controls"> | ||
| 32 | + <select name="startStation" required></select> | ||
| 33 | + </div> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + <div class="uk-width-1-2"> | ||
| 37 | + <div class="uk-form-row"> | ||
| 38 | + <label class="uk-form-label">终点</label> | ||
| 39 | + <div class="uk-form-controls"> | ||
| 40 | + <select name="endStation" required></select> | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | + </div> | ||
| 44 | + </div> | ||
| 45 | + | ||
| 46 | + <div class="uk-grid"> | ||
| 47 | + <div class="uk-width-1-2"> | ||
| 48 | + <div class="uk-form-row"> | ||
| 49 | + <label class="uk-form-label">里程类型</label> | ||
| 50 | + <div class="uk-form-controls"> | ||
| 51 | + <select class="form-control nt-dictionary" required name="mileageType" | ||
| 52 | + data-group="MileageType"></select> | ||
| 53 | + </div> | ||
| 54 | + </div> | ||
| 55 | + </div> | ||
| 56 | + <div class="uk-width-1-2"> | ||
| 57 | + <div class="uk-form-row"> | ||
| 58 | + <label class="uk-form-label">公里数</label> | ||
| 59 | + <div class="uk-form-controls"> | ||
| 60 | + <input class="form-control" name="mileage" max=222 data-fv-lessthan-inclusive="false" required> | ||
| 61 | + </div> | ||
| 62 | + </div> | ||
| 63 | + </div> | ||
| 64 | + </div> | ||
| 65 | + | ||
| 66 | + <div class="uk-grid"> | ||
| 67 | + <div class="uk-width-1-2"> | ||
| 68 | + <div class="uk-form-row"> | ||
| 69 | + <label class="uk-form-label">开始时间</label> | ||
| 70 | + <div class="uk-form-controls"> | ||
| 71 | + <input name="startDate" value="{{sch.fcsj}}" type="time" required> | ||
| 72 | + </div> | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + <div class="uk-width-1-2"> | ||
| 76 | + <div class="uk-form-row"> | ||
| 77 | + <label class="uk-form-label">结束时间</label> | ||
| 78 | + <div class="uk-form-controls"> | ||
| 79 | + <input name="endDate" value="{{sch.zdsj}}" type="time" required> | ||
| 80 | + </div> | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + </div> | ||
| 84 | + | ||
| 85 | + <div class="uk-grid"> | ||
| 86 | + <div class="uk-width-1-2"> | ||
| 87 | + <div class="uk-form-row" style="padding-top: 5px;"> | ||
| 88 | + <label class="uk-form-label"></label> | ||
| 89 | + <div class="uk-form-controls"> | ||
| 90 | + <label> | ||
| 91 | + <input type="checkbox" value=1 name="destroy" class="i-cbox"> 是否烂班 | ||
| 92 | + </label> | ||
| 93 | + </div> | ||
| 94 | + </div> | ||
| 95 | + </div> | ||
| 96 | + <div class="uk-width-1-2 destroy_reason_wrap" style="display: none;"> | ||
| 97 | + <div class="uk-form-row"> | ||
| 98 | + <label class="uk-form-label">烂班原因</label> | ||
| 99 | + <div class="uk-form-controls"> | ||
| 100 | + <select class="form-control" name="destroyReason"> | ||
| 101 | + <option value="">请选择...</option> | ||
| 102 | + {{each adjustExps as exp i}} | ||
| 103 | + <option value="{{exp}}">{{exp}}</option> | ||
| 104 | + {{/each}} | ||
| 105 | + </select> | ||
| 106 | + </div> | ||
| 107 | + </div> | ||
| 108 | + </div> | ||
| 109 | + </div> | ||
| 110 | + | ||
| 111 | + <div class="uk-grid"> | ||
| 112 | + <div class="uk-width-1-1"> | ||
| 113 | + <div class="uk-form-row ct-stacked"> | ||
| 114 | + <div class="uk-form-controls" style="margin-top: 5px;"> | ||
| 115 | + <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-stringlength="true" | ||
| 116 | + data-fv-stringlength-max="50" placeholder="备注,不超过50个字符"></textarea> | ||
| 117 | + </div> | ||
| 118 | + </div> | ||
| 119 | + </div> | ||
| 120 | + </div> | ||
| 121 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | ||
| 122 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 123 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | ||
| 124 | + </div> | ||
| 125 | + </script> | ||
| 126 | + | ||
| 127 | + <script> | ||
| 128 | + (function () { | ||
| 129 | + var modal = '#add-sub-task-other-modal', | ||
| 130 | + sch, stationRoutes, parks, information; | ||
| 131 | + var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; | ||
| 132 | + $(modal).on('init', function (e, data) { | ||
| 133 | + e.stopPropagation(); | ||
| 134 | + sch = data.sch; | ||
| 135 | + var formHtml = template('sub-task-other-form-temp', {sch: sch, adjustExps: adjustExps}); | ||
| 136 | + $('form', modal).html(formHtml); | ||
| 137 | + //字典转换 | ||
| 138 | + dictionaryUtils.transformDom($('.nt-dictionary', modal)); | ||
| 139 | + | ||
| 140 | + //站点路由 | ||
| 141 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { | ||
| 142 | + return a.stationRouteCode - b.stationRouteCode; | ||
| 143 | + }), 'directions'); | ||
| 144 | + //停车场 | ||
| 145 | + $.get('/basic/parks', function (rs) { | ||
| 146 | + parks = rs; | ||
| 147 | + }); | ||
| 148 | + //线路标准 | ||
| 149 | + information = gb_data_basic.getLineInformation(sch.xlBm); | ||
| 150 | + | ||
| 151 | + //submit | ||
| 152 | + var f = $('form', modal).formValidation(gb_form_validation_opts); | ||
| 153 | + f.on('success.form.fv', function (e) { | ||
| 154 | + disabled_submit_btn(this); | ||
| 155 | + e.preventDefault(); | ||
| 156 | + var data = $(this).serializeJSON(); | ||
| 157 | + | ||
| 158 | + //需要关联的部分主任务属性 | ||
| 159 | + data['schedule.xlBm'] = sch.xlBm; | ||
| 160 | + data['schedule.xlDir'] = sch.xlDir; | ||
| 161 | + gb_common.$post('/childTask/history', data, function (rs) { | ||
| 162 | + notify_succ('子任务添加成功'); | ||
| 163 | + $('#history-sch-edit-modal').trigger('init', {id: sch.id}); | ||
| 164 | + UIkit.modal(modal).hide(); | ||
| 165 | + }); | ||
| 166 | + }); | ||
| 167 | + | ||
| 168 | + //班次类型 | ||
| 169 | + $('[name=type2]', f).on('change', function () { | ||
| 170 | + var routes = stationRoutes[sch.xlDir] | ||
| 171 | + , lastCode = routes[routes.length - 1].stationCode | ||
| 172 | + , opts = '', park_opts = ''; | ||
| 173 | + //station options | ||
| 174 | + $.each(routes, function () { | ||
| 175 | + opts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>' | ||
| 176 | + }); | ||
| 177 | + //park options | ||
| 178 | + for (var code in parks) | ||
| 179 | + park_opts += '<option value="' + code + '">' + parks[code] + '</option>'; | ||
| 180 | + | ||
| 181 | + var qdz = $('[name=startStation]', f), zdz = $('[name=endStation]', f), mType = $('[name=mileageType]', f); | ||
| 182 | + switch ($(this).val()) { | ||
| 183 | + case '3'://出场 | ||
| 184 | + qdz.html(park_opts).val(information.carPark); | ||
| 185 | + zdz.html(opts); | ||
| 186 | + mType.val('empty'); | ||
| 187 | + break; | ||
| 188 | + case '2'://进场 | ||
| 189 | + qdz.html(opts); | ||
| 190 | + zdz.html(park_opts).val(information.carPark); | ||
| 191 | + mType.val('empty'); | ||
| 192 | + break; | ||
| 193 | + default: | ||
| 194 | + qdz.html(opts); | ||
| 195 | + zdz.html(opts).val(lastCode); | ||
| 196 | + mType.val('service'); | ||
| 197 | + | ||
| 198 | + } | ||
| 199 | + }); | ||
| 200 | + | ||
| 201 | + //是否烂班 | ||
| 202 | + $('[name=destroy]', f).on('click', function () { | ||
| 203 | + console.log(this, this.checked); | ||
| 204 | + if (this.checked) { | ||
| 205 | + $('.destroy_reason_wrap', modal).show(); | ||
| 206 | + } | ||
| 207 | + else { | ||
| 208 | + $('.destroy_reason_wrap', modal).hide(); | ||
| 209 | + } | ||
| 210 | + }); | ||
| 211 | + | ||
| 212 | + $('[name=destroyReason]', f).on('change', function () { | ||
| 213 | + var rem = $('[name=remarks]', f); | ||
| 214 | + rem.val(rem.val() + $(this).val() + ','); | ||
| 215 | + }); | ||
| 216 | + }); | ||
| 217 | + })(); | ||
| 218 | + </script> | ||
| 219 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/h_add_sub_task_outpark.html
0 → 100644
| 1 | +<div class="uk-modal ct_move_modal" id="add-sub-task-inpark-modal"> | ||
| 2 | + <div class="uk-modal-dialog"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>出场子任务</h2></div> | ||
| 6 | + | ||
| 7 | + <div style="width: 100%;padding-left: 1%;"> | ||
| 8 | + <div class="sub-task-card"> | ||
| 9 | + <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | ||
| 10 | + <div class="uk-panel-badge uk-badge uk-badge-default">空驶</div> | ||
| 11 | + <h3 class="uk-panel-title">出场</h3> | ||
| 12 | + <form class="uk-form uk-form-horizontal inpark_form" empty_form> | ||
| 13 | + <input type="hidden" name="type2" value="3"> | ||
| 14 | + <input type="hidden" name="mileageType" value="empty"> | ||
| 15 | + <div class="uk-grid"> | ||
| 16 | + <div class="uk-width-3-10"> | ||
| 17 | + <div class="uk-form-row"> | ||
| 18 | + <label class="uk-form-label">班次类型 </label> | ||
| 19 | + </div> | ||
| 20 | + </div> | ||
| 21 | + <div class="uk-width-7-10 pl5"> | ||
| 22 | + <select name="type1" class="ct_focus"> | ||
| 23 | + <option value="正常">正常</option> | ||
| 24 | + <option value="临加">临加</option> | ||
| 25 | + </select> | ||
| 26 | + </div> | ||
| 27 | + </div> | ||
| 28 | + <div class="uk-grid"> | ||
| 29 | + <div class="uk-width-3-10"> | ||
| 30 | + <div class="uk-form-row"> | ||
| 31 | + <label class="uk-form-label">起点 </label> | ||
| 32 | + </div> | ||
| 33 | + </div> | ||
| 34 | + <div class="uk-width-7-10 pl5"> | ||
| 35 | + <select name="startStation"></select> | ||
| 36 | + </div> | ||
| 37 | + </div> | ||
| 38 | + <div class="uk-grid"> | ||
| 39 | + <div class="uk-width-3-10"> | ||
| 40 | + <div class="uk-form-row"> | ||
| 41 | + <label class="uk-form-label" disabled>终点 </label> | ||
| 42 | + </div> | ||
| 43 | + </div> | ||
| 44 | + <div class="uk-width-7-10 pl5"> | ||
| 45 | + <select name="endStation" class="ct_focus"></select> | ||
| 46 | + </div> | ||
| 47 | + </div> | ||
| 48 | + <div class="uk-grid"> | ||
| 49 | + <div class="uk-width-3-10"> | ||
| 50 | + <div class="uk-form-row"> | ||
| 51 | + <label class="uk-form-label">空驶里程</label> | ||
| 52 | + </div> | ||
| 53 | + </div> | ||
| 54 | + <div class="uk-width-7-10 pl5"> | ||
| 55 | + <input type="number" step="0.01" name="mileage" required style="width: calc(100% - 62px);"> | ||
| 56 | + <a style="font-size: 12px;color: grey;cursor: default;" target="_blank" | ||
| 57 | + class="linkToLineInfo">线路标准</a> | ||
| 58 | + </div> | ||
| 59 | + </div> | ||
| 60 | + <div class="uk-grid"> | ||
| 61 | + <div class="uk-width-3-10"> | ||
| 62 | + <div class="uk-form-row"> | ||
| 63 | + <label class="uk-form-label">开始时间</label> | ||
| 64 | + </div> | ||
| 65 | + </div> | ||
| 66 | + <div class="uk-width-7-10 pl5"> | ||
| 67 | + <input type="time" name="startDate" required> | ||
| 68 | + </div> | ||
| 69 | + </div> | ||
| 70 | + <div class="uk-grid"> | ||
| 71 | + <div class="uk-width-3-10"> | ||
| 72 | + <div class="uk-form-row"> | ||
| 73 | + <label class="uk-form-label">结束时间</label> | ||
| 74 | + </div> | ||
| 75 | + </div> | ||
| 76 | + <div class="uk-width-7-10 pl5"> | ||
| 77 | + <input type="time" name="endDate" required> | ||
| 78 | + </div> | ||
| 79 | + </div> | ||
| 80 | + </form> | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + | ||
| 84 | + <div class="sub-task-card"> | ||
| 85 | + <div class="uk-panel uk-panel-box uk-panel-box-primary twins_task_panel"> | ||
| 86 | + <div class="uk-panel-badge uk-badge">营运</div> | ||
| 87 | + <h3 class="uk-panel-title">线路上站点间</h3> | ||
| 88 | + <form class="uk-form uk-form-horizontal inpark_form" service_form> | ||
| 89 | + <input type="hidden" name="type2" value="1"> | ||
| 90 | + <input type="hidden" name="mileageType" value="service"> | ||
| 91 | + <div class="uk-grid"> | ||
| 92 | + <div class="uk-width-3-10"> | ||
| 93 | + <div class="uk-form-row"> | ||
| 94 | + <label class="uk-form-label">班次类型 </label> | ||
| 95 | + </div> | ||
| 96 | + </div> | ||
| 97 | + <div class="uk-width-7-10 pl5"> | ||
| 98 | + <select name="type1" class="ct_focus" disabled> | ||
| 99 | + <option value="正常">正常</option> | ||
| 100 | + <option value="临加">临加</option> | ||
| 101 | + </select> | ||
| 102 | + </div> | ||
| 103 | + </div> | ||
| 104 | + <div class="uk-grid"> | ||
| 105 | + <div class="uk-width-3-10"> | ||
| 106 | + <div class="uk-form-row"> | ||
| 107 | + <label class="uk-form-label">起点 </label> | ||
| 108 | + </div> | ||
| 109 | + </div> | ||
| 110 | + <div class="uk-width-7-10 pl5"> | ||
| 111 | + <select name="startStation" disabled></select> | ||
| 112 | + </div> | ||
| 113 | + </div> | ||
| 114 | + <div class="uk-grid"> | ||
| 115 | + <div class="uk-width-3-10"> | ||
| 116 | + <div class="uk-form-row"> | ||
| 117 | + <label class="uk-form-label">终点 </label> | ||
| 118 | + </div> | ||
| 119 | + </div> | ||
| 120 | + <div class="uk-width-7-10 pl5"> | ||
| 121 | + <select name="endStation" class="ct_focus" disabled></select> | ||
| 122 | + </div> | ||
| 123 | + </div> | ||
| 124 | + <div class="uk-grid"> | ||
| 125 | + <div class="uk-width-3-10"> | ||
| 126 | + <div class="uk-form-row"> | ||
| 127 | + <label class="uk-form-label">营运里程</label> | ||
| 128 | + </div> | ||
| 129 | + </div> | ||
| 130 | + <div class="uk-width-7-10 pl5"> | ||
| 131 | + <input type="number" step="0.01" name="mileage" disabled> | ||
| 132 | + </div> | ||
| 133 | + </div> | ||
| 134 | + <div class="uk-grid"> | ||
| 135 | + <div class="uk-width-3-10"> | ||
| 136 | + <div class="uk-form-row"> | ||
| 137 | + <label class="uk-form-label">开始时间</label> | ||
| 138 | + </div> | ||
| 139 | + </div> | ||
| 140 | + <div class="uk-width-7-10 pl5"> | ||
| 141 | + <input type="time" name="startDate" disabled> | ||
| 142 | + </div> | ||
| 143 | + </div> | ||
| 144 | + <div class="uk-grid"> | ||
| 145 | + <div class="uk-width-3-10"> | ||
| 146 | + <div class="uk-form-row"> | ||
| 147 | + <label class="uk-form-label">结束时间</label> | ||
| 148 | + </div> | ||
| 149 | + </div> | ||
| 150 | + <div class="uk-width-7-10 pl5"> | ||
| 151 | + <input type="time" name="endDate" disabled> | ||
| 152 | + </div> | ||
| 153 | + </div> | ||
| 154 | + </form> | ||
| 155 | + </div> | ||
| 156 | + </div> | ||
| 157 | + | ||
| 158 | + <form class="uk-form" style="margin-top: 15px; padding: 0 10px 0 0;"> | ||
| 159 | + <textarea placeholder="备注" style="width: 100%;height: 70px;" id="globalRemarks"></textarea> | ||
| 160 | + </form> | ||
| 161 | + </div> | ||
| 162 | + | ||
| 163 | + <div class="uk-modal-footer uk-text-right"> | ||
| 164 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 165 | + <button type="button" class="uk-button uk-button-primary" id="submitChildTaskBtn">提交子任务</button> | ||
| 166 | + </div> | ||
| 167 | + </div> | ||
| 168 | + | ||
| 169 | + <div class="ct-bottom-drawer"> | ||
| 170 | + <div class="ct-bottom-drawer-body"></div> | ||
| 171 | + </div> | ||
| 172 | + | ||
| 173 | + <script id="sub-task-inpark-form-temp" type="text/html"> | ||
| 174 | + </script> | ||
| 175 | + | ||
| 176 | + <script> | ||
| 177 | + (function () { | ||
| 178 | + var modal = '#add-sub-task-inpark-modal', | ||
| 179 | + serviceForm = $('form[service_form]', modal), | ||
| 180 | + emptyForm = $('form[empty_form]', modal), | ||
| 181 | + sch, stationRoutes, parks, information, esCode; | ||
| 182 | + $(modal).on('init', function (e, data) { | ||
| 183 | + e.stopPropagation(); | ||
| 184 | + sch = data.sch; | ||
| 185 | + $('.linkToLineInfo', modal).attr('href', '/pages/base/lineinformation/list.html?no=' + gb_data_basic.codeToLine[sch.xlBm].id); | ||
| 186 | + | ||
| 187 | + //站点路由 | ||
| 188 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { | ||
| 189 | + return a.stationRouteCode - b.stationRouteCode; | ||
| 190 | + }), 'directions')[sch.xlDir]; | ||
| 191 | + //空驶起点(停车场) | ||
| 192 | + $.get('/basic/parks', function (rs) { | ||
| 193 | + parks = rs; | ||
| 194 | + var opts = ''; | ||
| 195 | + for (var code in parks) { | ||
| 196 | + opts += '<option value="' + code + '">' + parks[code] + '</option>'; | ||
| 197 | + } | ||
| 198 | + $('select[name=startStation]', emptyForm).html(opts).val(information.carPark); | ||
| 199 | + | ||
| 200 | + //设置默认值 | ||
| 201 | + setDefaultVal(); | ||
| 202 | + | ||
| 203 | + //根据主任务状态,复子任务 | ||
| 204 | + updateTwinsTaskBySch(sch); | ||
| 205 | + }); | ||
| 206 | + //线路标准 | ||
| 207 | + information = gb_data_basic.getLineInformation(sch.xlBm); | ||
| 208 | + | ||
| 209 | + //出场开始时间改变 | ||
| 210 | + $('input[name=startDate]', emptyForm).on('change input', function () { | ||
| 211 | + var st = moment($(this).val(), 'HH:mm') | ||
| 212 | + , time = getOutTime(); | ||
| 213 | + if (!time) | ||
| 214 | + return; | ||
| 215 | + | ||
| 216 | + var ets = st.add(time, 'minute').format('HH:mm'); | ||
| 217 | + $('input[name=endDate]', emptyForm).val(ets); | ||
| 218 | + }); | ||
| 219 | + //出场结束时间改变 | ||
| 220 | + $('input[name=endDate]', emptyForm).on('change input', function () { | ||
| 221 | + var et = moment($(this).val(), 'HH:mm'), time = getOutTime(); | ||
| 222 | + if (!time) | ||
| 223 | + return; | ||
| 224 | + | ||
| 225 | + var ets = et.subtract(time, 'minute').format('HH:mm'); | ||
| 226 | + $('input[name=startDate]', emptyForm).val(ets); | ||
| 227 | + }); | ||
| 228 | + | ||
| 229 | + var dataArray = []; | ||
| 230 | + var fs = $('form.inpark_form', modal).formValidation({ | ||
| 231 | + framework: 'uikit', | ||
| 232 | + locale: 'zh_CN' | ||
| 233 | + }); | ||
| 234 | + fs.on('success.form.fv', function (e) { | ||
| 235 | + e.preventDefault(); | ||
| 236 | + if ($(this).is(':hidden')) | ||
| 237 | + return; | ||
| 238 | + dataArray.push($.extend($(this).serializeJSON(), getDisabledVal(this) | ||
| 239 | + , {remarks: $('#globalRemarks', modal).val(), 'schedule.id': sch.id})); | ||
| 240 | + $(this).data('valid', true); | ||
| 241 | + | ||
| 242 | + if (allValidSuccess()) { | ||
| 243 | + var i = 0,rst; | ||
| 244 | + (function () { | ||
| 245 | + var f = arguments.callee; | ||
| 246 | + if (i >= dataArray.length) { | ||
| 247 | + UIkit.modal(modal).hide(); | ||
| 248 | + $('#history-sch-edit-modal').trigger('init', {id: sch.id}); | ||
| 249 | + return; | ||
| 250 | + } | ||
| 251 | + var data = dataArray[i]; | ||
| 252 | + //营运子任务不写备注 | ||
| 253 | + if(data.mileageType == 'service' && !data.destroy) | ||
| 254 | + data.remarks = ''; | ||
| 255 | + //需要关联的部分主任务属性 | ||
| 256 | + data['schedule.xlBm'] = sch.xlBm; | ||
| 257 | + data['schedule.xlDir'] = sch.xlDir; | ||
| 258 | + gb_common.$post('/childTask/history', data, function (rs) { | ||
| 259 | + notify_succ('子任务添加成功'); | ||
| 260 | + rst = rs.t; | ||
| 261 | + i++; | ||
| 262 | + f(); | ||
| 263 | + }); | ||
| 264 | + })(); | ||
| 265 | + } | ||
| 266 | + }); | ||
| 267 | + | ||
| 268 | + //校验不过 | ||
| 269 | + fs.on('err.field.fv', function () { | ||
| 270 | + $('#submitChildTaskBtn', modal).removeClass('disabled').removeAttr('disabled'); | ||
| 271 | + }); | ||
| 272 | + | ||
| 273 | + //submit | ||
| 274 | + $('#submitChildTaskBtn', modal).on('click', function () { | ||
| 275 | + $(this).addClass('disabled').attr('disabled', 'disabled'); | ||
| 276 | + dataArray = []; | ||
| 277 | + fs.data('valid', false); | ||
| 278 | + fs.formValidation('validate'); | ||
| 279 | + //fs.submit(); | ||
| 280 | + }); | ||
| 281 | + }); | ||
| 282 | + | ||
| 283 | + function getOutTime() { | ||
| 284 | + if (information.carPark != $('select[name=startStation]', emptyForm).val()) | ||
| 285 | + return null; | ||
| 286 | + | ||
| 287 | + if (sch.xlDir == 0) | ||
| 288 | + return information.upOutTimer; | ||
| 289 | + else if (sch.xlDir == 1) | ||
| 290 | + return information.downOutTimer; | ||
| 291 | + } | ||
| 292 | + | ||
| 293 | + function allValidSuccess() { | ||
| 294 | + var flag = true; | ||
| 295 | + $('form.inpark_form:visible', modal).each(function (i, f) { | ||
| 296 | + if (!$(f).data('valid')) { | ||
| 297 | + flag = false; | ||
| 298 | + return false; | ||
| 299 | + } | ||
| 300 | + }); | ||
| 301 | + return flag; | ||
| 302 | + } | ||
| 303 | + | ||
| 304 | + //获取表单disabled 项的值 | ||
| 305 | + function getDisabledVal(f) { | ||
| 306 | + var rs = {}; | ||
| 307 | + $('input,select', f).each(function () { | ||
| 308 | + if ($(this).attr('disabled')) { | ||
| 309 | + rs[$(this).attr('name')] = $(this).val(); | ||
| 310 | + } | ||
| 311 | + }); | ||
| 312 | + return rs; | ||
| 313 | + } | ||
| 314 | + | ||
| 315 | + function setDefaultVal() { | ||
| 316 | + var routeOpts = ''; | ||
| 317 | + $.each(stationRoutes, function () { | ||
| 318 | + routeOpts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>'; | ||
| 319 | + }); | ||
| 320 | + esCode = stationRoutes[stationRoutes.length - 1].stationCode; | ||
| 321 | + | ||
| 322 | + //营运起终点 | ||
| 323 | + $('select[name=startStation]', serviceForm).html(routeOpts).val(sch.qdzCode); | ||
| 324 | + $('select[name=endStation]', serviceForm).html(routeOpts).val(sch.zdzCode); | ||
| 325 | + //营运开始结束时间 | ||
| 326 | + $('input[name=startDate]', serviceForm).val(sch.dfsj); | ||
| 327 | + $('input[name=endDate]', serviceForm).val(sch.zdsj); | ||
| 328 | + //营运里程 | ||
| 329 | + $('input[name=mileage]', serviceForm).val(sch.jhlc); | ||
| 330 | + //营运班次类型 | ||
| 331 | + $('select[name=type1]', serviceForm).val(sch['sflj'] ? '临加' : '正常'); | ||
| 332 | + | ||
| 333 | + | ||
| 334 | + //空驶终点 | ||
| 335 | + $('select[name=endStation]', emptyForm).html(routeOpts).val(sch.qdzCode); | ||
| 336 | + //出场结束时间 | ||
| 337 | + var eDate = moment(sch.dfsj, 'HH:mm').subtract(5, 'minute').format('HH:mm'); | ||
| 338 | + $('input[name=endDate]', emptyForm).val(eDate).trigger('change'); | ||
| 339 | + //空驶里程 | ||
| 340 | + $('input[name=mileage]', emptyForm).val(sch.xlDir == 0 ? information.upOutMileage : information.downOutMileage); | ||
| 341 | + } | ||
| 342 | + | ||
| 343 | + | ||
| 344 | + function updateTwinsTaskBySch(sch) { | ||
| 345 | + //主任务是烂班 | ||
| 346 | + if(sch.destroy){ | ||
| 347 | + serviceForm.prepend('<input type="hidden" name="destroy" value="true">'); | ||
| 348 | + $('.twins_task_panel .uk-badge', modal).addClass('uk-badge-danger').text('烂班'); | ||
| 349 | + $('[name=mileage]', serviceForm).val(sch.jhlcOrig).attr('disabled', 'disabled'); | ||
| 350 | + } | ||
| 351 | + } | ||
| 352 | + })(); | ||
| 353 | + </script> | ||
| 354 | +</div> | ||
| 0 | \ No newline at end of file | 355 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/h_add_temp_sch.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal ct_move_modal" id="schedule-addsch-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 800px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>新增临加班次</h2></div> | ||
| 6 | + | ||
| 7 | + <div class="uk-grid"> | ||
| 8 | + <div class="uk-width-1-4"> | ||
| 9 | + <ul data-uk-switcher="{connect:'#tempScheduleContent'}" class="uk-nav uk-nav-side left_tabs_lg" > | ||
| 10 | + <li data-handle="normal"><a>1、临加班次</a></li> | ||
| 11 | + <li data-handle="toAndFro"><a>2、往返</a></li> | ||
| 12 | + <li data-handle="parkToPark"><a>3、场到场</a></li> | ||
| 13 | + </ul> | ||
| 14 | + </div> | ||
| 15 | + <div class="uk-width-3-4"> | ||
| 16 | + <ul id="tempScheduleContent" class="uk-switcher"> | ||
| 17 | + <li class="normalCont"></li> | ||
| 18 | + <li class="toAndFroCont"></li> | ||
| 19 | + <li class="parkToParkCont"></li> | ||
| 20 | + </ul> | ||
| 21 | + </div> | ||
| 22 | + </div> | ||
| 23 | + </div> | ||
| 24 | + | ||
| 25 | + <!-- 普通单程临加班次 --> | ||
| 26 | + <script id="add_normal_sch-form-temp" type="text/html"> | ||
| 27 | + <form class="uk-form uk-form-horizontal"> | ||
| 28 | + <div class="uk-grid"> | ||
| 29 | + <div class="uk-width-1-2"> | ||
| 30 | + <div class="uk-form-row"> | ||
| 31 | + <label class="uk-form-label">班次类型</label> | ||
| 32 | + <div class="uk-form-controls"> | ||
| 33 | + <select class="form-control nt-dictionary" name="bcType" data-code="{{bcType}}" | ||
| 34 | + data-group=ScheduleType></select> | ||
| 35 | + </div> | ||
| 36 | + </div> | ||
| 37 | + </div> | ||
| 38 | + <div class="uk-width-1-2"> | ||
| 39 | + <div class="uk-form-row"> | ||
| 40 | + <label class="uk-form-label">上下行</label> | ||
| 41 | + <div class="uk-form-controls"> | ||
| 42 | + <select name="xlDir"> | ||
| 43 | + <option value="0">上行</option> | ||
| 44 | + <option value="1">下行</option> | ||
| 45 | + </select> | ||
| 46 | + </div> | ||
| 47 | + </div> | ||
| 48 | + </div> | ||
| 49 | + </div> | ||
| 50 | + <div class="uk-grid"> | ||
| 51 | + <div class="uk-width-1-2"> | ||
| 52 | + <div class="uk-form-row"> | ||
| 53 | + <label class="uk-form-label">起点站</label> | ||
| 54 | + <div class="uk-form-controls"> | ||
| 55 | + <select name="qdzCode" required> | ||
| 56 | + </select> | ||
| 57 | + </div> | ||
| 58 | + </div> | ||
| 59 | + </div> | ||
| 60 | + <div class="uk-width-1-2"> | ||
| 61 | + <div class="uk-form-row"> | ||
| 62 | + <label class="uk-form-label">终点站</label> | ||
| 63 | + <div class="uk-form-controls"> | ||
| 64 | + <select name="zdzCode" required> | ||
| 65 | + </select> | ||
| 66 | + </div> | ||
| 67 | + </div> | ||
| 68 | + </div> | ||
| 69 | + </div> | ||
| 70 | + <div class="uk-grid"> | ||
| 71 | + <div class="uk-width-1-2"> | ||
| 72 | + <div class="uk-form-row"> | ||
| 73 | + <label class="uk-form-label">开始时间</label> | ||
| 74 | + <div class="uk-form-controls"> | ||
| 75 | + <input type="time" value="{{zdsj}}" name="fcsj" required> | ||
| 76 | + </div> | ||
| 77 | + </div> | ||
| 78 | + </div> | ||
| 79 | + <div class="uk-width-1-2"> | ||
| 80 | + <div class="uk-form-row"> | ||
| 81 | + <label class="uk-form-label">结束时间</label> | ||
| 82 | + <div class="uk-form-controls"> | ||
| 83 | + <input type="time" name="zdsj" required> | ||
| 84 | + </div> | ||
| 85 | + </div> | ||
| 86 | + </div> | ||
| 87 | + </div> | ||
| 88 | + <div class="uk-grid"> | ||
| 89 | + <div class="uk-width-1-2"> | ||
| 90 | + <div class="uk-form-row"> | ||
| 91 | + <label class="uk-form-label">车辆</label> | ||
| 92 | + <div class="uk-form-controls"> | ||
| 93 | + <div class="uk-autocomplete uk-form car-autocom"> | ||
| 94 | + <input type="text" value="{{clZbh}}" name="clZbh" required> | ||
| 95 | + </div> | ||
| 96 | + </div> | ||
| 97 | + </div> | ||
| 98 | + </div> | ||
| 99 | + <div class="uk-width-1-2"> | ||
| 100 | + <div class="uk-form-row"> | ||
| 101 | + <label class="uk-form-label">里程</label> | ||
| 102 | + <div class="uk-form-controls"> | ||
| 103 | + <input type="text" name="jhlc" value="{{jhlc}}" max=222 data-fv-lessthan-inclusive="false" | ||
| 104 | + required> | ||
| 105 | + </div> | ||
| 106 | + </div> | ||
| 107 | + </div> | ||
| 108 | + </div> | ||
| 109 | + <div class="uk-grid"> | ||
| 110 | + <div class="uk-width-1-2"> | ||
| 111 | + <div class="uk-form-row"> | ||
| 112 | + <label class="uk-form-label">驾驶员</label> | ||
| 113 | + <div class="uk-form-controls"> | ||
| 114 | + <div class="uk-autocomplete uk-form jsy-autocom"> | ||
| 115 | + <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> | ||
| 116 | + </div> | ||
| 117 | + </div> | ||
| 118 | + </div> | ||
| 119 | + </div> | ||
| 120 | + <div class="uk-width-1-2"> | ||
| 121 | + <div class="uk-form-row"> | ||
| 122 | + <label class="uk-form-label">售票员</label> | ||
| 123 | + <div class="uk-form-controls"> | ||
| 124 | + <div class="uk-autocomplete uk-form spy-autocom"> | ||
| 125 | + <input type="text" name="spy" value="{{sGh}}/{{sName}}"> | ||
| 126 | + </div> | ||
| 127 | + </div> | ||
| 128 | + </div> | ||
| 129 | + </div> | ||
| 130 | + </div> | ||
| 131 | + <div class="uk-grid"> | ||
| 132 | + <div class="uk-width-1-1"> | ||
| 133 | + <div class="uk-form-row"> | ||
| 134 | + <label class="uk-form-label">备注</label> | ||
| 135 | + <div class="uk-form-controls"> | ||
| 136 | + <div class="uk-autocomplete uk-form remarks-autocom"> | ||
| 137 | + <input type="text" name="remarks"> | ||
| 138 | + </div> | ||
| 139 | + </div> | ||
| 140 | + </div> | ||
| 141 | + </div> | ||
| 142 | + </div> | ||
| 143 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | ||
| 144 | + <span class="ct_line_lp_badge" ></span> | ||
| 145 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 146 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | ||
| 147 | + </div> | ||
| 148 | + </form> | ||
| 149 | + </script> | ||
| 150 | + | ||
| 151 | + <!-- 线路上往返临加班次 --> | ||
| 152 | + <script id="add_toAndFro_sch-form-temp" type="text/html"> | ||
| 153 | + <form class="uk-form uk-form-horizontal one_form"> | ||
| 154 | + <div class="uk-grid"> | ||
| 155 | + <div class="uk-width-1-2"> | ||
| 156 | + <div class="uk-form-row"> | ||
| 157 | + <label class="uk-form-label">班次类型</label> | ||
| 158 | + <div class="uk-form-controls"> | ||
| 159 | + <select class="form-control nt-dictionary" name="bcType" data-code="{{bcType}}" | ||
| 160 | + data-group=ScheduleType></select> | ||
| 161 | + </div> | ||
| 162 | + </div> | ||
| 163 | + </div> | ||
| 164 | + <div class="uk-width-1-2"> | ||
| 165 | + <div class="uk-form-row"> | ||
| 166 | + <label class="uk-form-label">上下行</label> | ||
| 167 | + <div class="uk-form-controls"> | ||
| 168 | + <select name="xlDir"> | ||
| 169 | + <option value="0">上行</option> | ||
| 170 | + <option value="1">下行</option> | ||
| 171 | + </select> | ||
| 172 | + </div> | ||
| 173 | + </div> | ||
| 174 | + </div> | ||
| 175 | + </div> | ||
| 176 | + <div class="uk-grid"> | ||
| 177 | + <div class="uk-width-1-2"> | ||
| 178 | + <div class="uk-form-row"> | ||
| 179 | + <label class="uk-form-label">起点站</label> | ||
| 180 | + <div class="uk-form-controls"> | ||
| 181 | + <select name="qdzCode" required> | ||
| 182 | + </select> | ||
| 183 | + </div> | ||
| 184 | + </div> | ||
| 185 | + </div> | ||
| 186 | + <div class="uk-width-1-2"> | ||
| 187 | + <div class="uk-form-row"> | ||
| 188 | + <label class="uk-form-label">终点站</label> | ||
| 189 | + <div class="uk-form-controls"> | ||
| 190 | + <select name="zdzCode" required> | ||
| 191 | + </select> | ||
| 192 | + </div> | ||
| 193 | + </div> | ||
| 194 | + </div> | ||
| 195 | + </div> | ||
| 196 | + <div class="uk-grid"> | ||
| 197 | + <div class="uk-width-1-2"> | ||
| 198 | + <div class="uk-form-row"> | ||
| 199 | + <label class="uk-form-label">开始时间</label> | ||
| 200 | + <div class="uk-form-controls"> | ||
| 201 | + <input type="time" value="{{zdsj}}" name="fcsj" required> | ||
| 202 | + </div> | ||
| 203 | + </div> | ||
| 204 | + </div> | ||
| 205 | + <div class="uk-width-1-2"> | ||
| 206 | + <div class="uk-form-row"> | ||
| 207 | + <label class="uk-form-label">结束时间</label> | ||
| 208 | + <div class="uk-form-controls"> | ||
| 209 | + <input type="time" name="zdsj" required> | ||
| 210 | + </div> | ||
| 211 | + </div> | ||
| 212 | + </div> | ||
| 213 | + </div> | ||
| 214 | + <div class="uk-grid"> | ||
| 215 | + <div class="uk-width-1-2"> | ||
| 216 | + <div class="uk-form-row"> | ||
| 217 | + <label class="uk-form-label">车辆</label> | ||
| 218 | + <div class="uk-form-controls"> | ||
| 219 | + <div class="uk-autocomplete uk-form car-autocom"> | ||
| 220 | + <input type="text" value="{{clZbh}}" name="clZbh" required> | ||
| 221 | + </div> | ||
| 222 | + </div> | ||
| 223 | + </div> | ||
| 224 | + </div> | ||
| 225 | + <div class="uk-width-1-2"> | ||
| 226 | + <div class="uk-form-row"> | ||
| 227 | + <label class="uk-form-label">里程</label> | ||
| 228 | + <div class="uk-form-controls"> | ||
| 229 | + <input type="text" name="jhlc" value="{{jhlc}}" max=222 data-fv-lessthan-inclusive="false" | ||
| 230 | + required> | ||
| 231 | + </div> | ||
| 232 | + </div> | ||
| 233 | + </div> | ||
| 234 | + </div> | ||
| 235 | + <div class="uk-grid"> | ||
| 236 | + <div class="uk-width-1-2"> | ||
| 237 | + <div class="uk-form-row"> | ||
| 238 | + <label class="uk-form-label">驾驶员</label> | ||
| 239 | + <div class="uk-form-controls"> | ||
| 240 | + <div class="uk-autocomplete uk-form jsy-autocom"> | ||
| 241 | + <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> | ||
| 242 | + </div> | ||
| 243 | + </div> | ||
| 244 | + </div> | ||
| 245 | + </div> | ||
| 246 | + <div class="uk-width-1-2"> | ||
| 247 | + <div class="uk-form-row"> | ||
| 248 | + <label class="uk-form-label">售票员</label> | ||
| 249 | + <div class="uk-form-controls"> | ||
| 250 | + <div class="uk-autocomplete uk-form spy-autocom"> | ||
| 251 | + <input type="text" name="spy" value="{{sGh}}/{{sName}}"> | ||
| 252 | + </div> | ||
| 253 | + </div> | ||
| 254 | + </div> | ||
| 255 | + </div> | ||
| 256 | + </div> | ||
| 257 | + <div class="uk-grid"> | ||
| 258 | + <div class="uk-width-1-1"> | ||
| 259 | + <div class="uk-form-row"> | ||
| 260 | + <label class="uk-form-label">备注</label> | ||
| 261 | + <div class="uk-form-controls"> | ||
| 262 | + <div class="uk-autocomplete uk-form remarks-autocom"> | ||
| 263 | + <input type="text" name="remarks"> | ||
| 264 | + </div> | ||
| 265 | + </div> | ||
| 266 | + </div> | ||
| 267 | + </div> | ||
| 268 | + </div> | ||
| 269 | + </form> | ||
| 270 | + <hr style="margin-top: 35px;"> | ||
| 271 | + <form class="uk-form uk-form-horizontal two_form"> | ||
| 272 | + <div class="uk-grid"> | ||
| 273 | + <div class="uk-width-1-2"> | ||
| 274 | + <div class="uk-form-row"> | ||
| 275 | + <label class="uk-form-label">班次类型</label> | ||
| 276 | + <div class="uk-form-controls"> | ||
| 277 | + <select class="form-control nt-dictionary" name="bcType" data-code="{{bcType}}" | ||
| 278 | + data-group=ScheduleType></select> | ||
| 279 | + </div> | ||
| 280 | + </div> | ||
| 281 | + </div> | ||
| 282 | + <div class="uk-width-1-2"> | ||
| 283 | + <div class="uk-form-row"> | ||
| 284 | + <label class="uk-form-label">上下行</label> | ||
| 285 | + <div class="uk-form-controls"> | ||
| 286 | + <select name="xlDir"> | ||
| 287 | + <option value="0">上行</option> | ||
| 288 | + <option value="1">下行</option> | ||
| 289 | + </select> | ||
| 290 | + </div> | ||
| 291 | + </div> | ||
| 292 | + </div> | ||
| 293 | + </div> | ||
| 294 | + <div class="uk-grid"> | ||
| 295 | + <div class="uk-width-1-2"> | ||
| 296 | + <div class="uk-form-row"> | ||
| 297 | + <label class="uk-form-label">起点站</label> | ||
| 298 | + <div class="uk-form-controls"> | ||
| 299 | + <select name="qdzCode" required> | ||
| 300 | + </select> | ||
| 301 | + </div> | ||
| 302 | + </div> | ||
| 303 | + </div> | ||
| 304 | + <div class="uk-width-1-2"> | ||
| 305 | + <div class="uk-form-row"> | ||
| 306 | + <label class="uk-form-label">终点站</label> | ||
| 307 | + <div class="uk-form-controls"> | ||
| 308 | + <select name="zdzCode" required> | ||
| 309 | + </select> | ||
| 310 | + </div> | ||
| 311 | + </div> | ||
| 312 | + </div> | ||
| 313 | + </div> | ||
| 314 | + <div class="uk-grid"> | ||
| 315 | + <div class="uk-width-1-2"> | ||
| 316 | + <div class="uk-form-row"> | ||
| 317 | + <label class="uk-form-label">开始时间</label> | ||
| 318 | + <div class="uk-form-controls"> | ||
| 319 | + <input type="time" value="{{zdsj}}" name="fcsj" required> | ||
| 320 | + </div> | ||
| 321 | + </div> | ||
| 322 | + </div> | ||
| 323 | + <div class="uk-width-1-2"> | ||
| 324 | + <div class="uk-form-row"> | ||
| 325 | + <label class="uk-form-label">结束时间</label> | ||
| 326 | + <div class="uk-form-controls"> | ||
| 327 | + <input type="time" name="zdsj" required> | ||
| 328 | + </div> | ||
| 329 | + </div> | ||
| 330 | + </div> | ||
| 331 | + </div> | ||
| 332 | + <div class="uk-grid"> | ||
| 333 | + <div class="uk-width-1-2"> | ||
| 334 | + <div class="uk-form-row"> | ||
| 335 | + <label class="uk-form-label">车辆</label> | ||
| 336 | + <div class="uk-form-controls"> | ||
| 337 | + <div class="uk-autocomplete uk-form car-autocom"> | ||
| 338 | + <input type="text" value="{{clZbh}}" name="clZbh" required> | ||
| 339 | + </div> | ||
| 340 | + </div> | ||
| 341 | + </div> | ||
| 342 | + </div> | ||
| 343 | + <div class="uk-width-1-2"> | ||
| 344 | + <div class="uk-form-row"> | ||
| 345 | + <label class="uk-form-label">里程</label> | ||
| 346 | + <div class="uk-form-controls"> | ||
| 347 | + <input type="text" name="jhlc" value="{{jhlc}}" max=222 data-fv-lessthan-inclusive="false" | ||
| 348 | + required> | ||
| 349 | + </div> | ||
| 350 | + </div> | ||
| 351 | + </div> | ||
| 352 | + </div> | ||
| 353 | + <div class="uk-grid"> | ||
| 354 | + <div class="uk-width-1-2"> | ||
| 355 | + <div class="uk-form-row"> | ||
| 356 | + <label class="uk-form-label">驾驶员</label> | ||
| 357 | + <div class="uk-form-controls"> | ||
| 358 | + <div class="uk-autocomplete uk-form jsy-autocom"> | ||
| 359 | + <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> | ||
| 360 | + </div> | ||
| 361 | + </div> | ||
| 362 | + </div> | ||
| 363 | + </div> | ||
| 364 | + <div class="uk-width-1-2"> | ||
| 365 | + <div class="uk-form-row"> | ||
| 366 | + <label class="uk-form-label">售票员</label> | ||
| 367 | + <div class="uk-form-controls"> | ||
| 368 | + <div class="uk-autocomplete uk-form spy-autocom"> | ||
| 369 | + <input type="text" name="spy" value="{{sGh}}/{{sName}}"> | ||
| 370 | + </div> | ||
| 371 | + </div> | ||
| 372 | + </div> | ||
| 373 | + </div> | ||
| 374 | + </div> | ||
| 375 | + <div class="uk-grid"> | ||
| 376 | + <div class="uk-width-1-1"> | ||
| 377 | + <div class="uk-form-row"> | ||
| 378 | + <label class="uk-form-label">备注</label> | ||
| 379 | + <div class="uk-form-controls"> | ||
| 380 | + <div class="uk-autocomplete uk-form remarks-autocom"> | ||
| 381 | + <input type="text" name="remarks"> | ||
| 382 | + </div> | ||
| 383 | + </div> | ||
| 384 | + </div> | ||
| 385 | + </div> | ||
| 386 | + </div> | ||
| 387 | + </form> | ||
| 388 | + | ||
| 389 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | ||
| 390 | + <span class="ct_line_lp_badge" ></span> | ||
| 391 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 392 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | ||
| 393 | + </div> | ||
| 394 | + </script> | ||
| 395 | + | ||
| 396 | + | ||
| 397 | + <!-- 场到场临加班次 --> | ||
| 398 | + <script id="add_park2park_sch-form-temp" type="text/html"> | ||
| 399 | + <form class="uk-form uk-form-horizontal"> | ||
| 400 | + <div class="uk-grid"> | ||
| 401 | + <div class="uk-width-1-2"> | ||
| 402 | + <div class="uk-form-row"> | ||
| 403 | + <label class="uk-form-label">班次类型</label> | ||
| 404 | + <div class="uk-form-controls"> | ||
| 405 | + <select class="form-control" name="bcType"> | ||
| 406 | + <option value="in">进场</option> | ||
| 407 | + </select> | ||
| 408 | + </div> | ||
| 409 | + </div> | ||
| 410 | + </div> | ||
| 411 | + <div class="uk-width-1-2"> | ||
| 412 | + <div class="uk-form-row"> | ||
| 413 | + <label class="uk-form-label">上下行</label> | ||
| 414 | + <div class="uk-form-controls"> | ||
| 415 | + <select name="xlDir"> | ||
| 416 | + <option value="0">上行</option> | ||
| 417 | + <option value="1">下行</option> | ||
| 418 | + </select> | ||
| 419 | + </div> | ||
| 420 | + </div> | ||
| 421 | + </div> | ||
| 422 | + </div> | ||
| 423 | + <div class="uk-grid"> | ||
| 424 | + <div class="uk-width-1-2"> | ||
| 425 | + <div class="uk-form-row"> | ||
| 426 | + <label class="uk-form-label">起点站</label> | ||
| 427 | + <div class="uk-form-controls"> | ||
| 428 | + <select name="qdzCode" required> | ||
| 429 | + </select> | ||
| 430 | + </div> | ||
| 431 | + </div> | ||
| 432 | + </div> | ||
| 433 | + <div class="uk-width-1-2"> | ||
| 434 | + <div class="uk-form-row"> | ||
| 435 | + <label class="uk-form-label">终点站</label> | ||
| 436 | + <div class="uk-form-controls"> | ||
| 437 | + <select name="zdzCode" required> | ||
| 438 | + </select> | ||
| 439 | + </div> | ||
| 440 | + </div> | ||
| 441 | + </div> | ||
| 442 | + </div> | ||
| 443 | + <div class="uk-grid"> | ||
| 444 | + <div class="uk-width-1-2"> | ||
| 445 | + <div class="uk-form-row"> | ||
| 446 | + <label class="uk-form-label">开始时间</label> | ||
| 447 | + <div class="uk-form-controls"> | ||
| 448 | + <input type="time" value="{{zdsj}}" name="fcsj" required> | ||
| 449 | + </div> | ||
| 450 | + </div> | ||
| 451 | + </div> | ||
| 452 | + <div class="uk-width-1-2"> | ||
| 453 | + <div class="uk-form-row"> | ||
| 454 | + <label class="uk-form-label">结束时间</label> | ||
| 455 | + <div class="uk-form-controls"> | ||
| 456 | + <input type="time" name="zdsj" value="{{zdsj}}" required> | ||
| 457 | + </div> | ||
| 458 | + </div> | ||
| 459 | + </div> | ||
| 460 | + </div> | ||
| 461 | + <div class="uk-grid"> | ||
| 462 | + <div class="uk-width-1-2"> | ||
| 463 | + <div class="uk-form-row"> | ||
| 464 | + <label class="uk-form-label">车辆</label> | ||
| 465 | + <div class="uk-form-controls"> | ||
| 466 | + <div class="uk-autocomplete uk-form car-autocom"> | ||
| 467 | + <input type="text" value="{{clZbh}}" name="clZbh" required> | ||
| 468 | + </div> | ||
| 469 | + </div> | ||
| 470 | + </div> | ||
| 471 | + </div> | ||
| 472 | + <div class="uk-width-1-2"> | ||
| 473 | + <div class="uk-form-row"> | ||
| 474 | + <label class="uk-form-label">里程</label> | ||
| 475 | + <div class="uk-form-controls"> | ||
| 476 | + <input type="text" name="jhlc" value="{{jhlc}}" max=222 data-fv-lessthan-inclusive="false" | ||
| 477 | + required> | ||
| 478 | + </div> | ||
| 479 | + </div> | ||
| 480 | + </div> | ||
| 481 | + </div> | ||
| 482 | + <div class="uk-grid"> | ||
| 483 | + <div class="uk-width-1-2"> | ||
| 484 | + <div class="uk-form-row"> | ||
| 485 | + <label class="uk-form-label">驾驶员</label> | ||
| 486 | + <div class="uk-form-controls"> | ||
| 487 | + <div class="uk-autocomplete uk-form jsy-autocom"> | ||
| 488 | + <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> | ||
| 489 | + </div> | ||
| 490 | + </div> | ||
| 491 | + </div> | ||
| 492 | + </div> | ||
| 493 | + <div class="uk-width-1-2"> | ||
| 494 | + <div class="uk-form-row"> | ||
| 495 | + <label class="uk-form-label">售票员</label> | ||
| 496 | + <div class="uk-form-controls"> | ||
| 497 | + <div class="uk-autocomplete uk-form spy-autocom"> | ||
| 498 | + <input type="text" name="spy" value="{{sGh}}/{{sName}}"> | ||
| 499 | + </div> | ||
| 500 | + </div> | ||
| 501 | + </div> | ||
| 502 | + </div> | ||
| 503 | + </div> | ||
| 504 | + <div class="uk-grid"> | ||
| 505 | + <div class="uk-width-1-1"> | ||
| 506 | + <div class="uk-form-row"> | ||
| 507 | + <label class="uk-form-label">备注</label> | ||
| 508 | + <div class="uk-form-controls"> | ||
| 509 | + <div class="uk-autocomplete uk-form remarks-autocom"> | ||
| 510 | + <input type="text" name="remarks"> | ||
| 511 | + </div> | ||
| 512 | + </div> | ||
| 513 | + </div> | ||
| 514 | + </div> | ||
| 515 | + </div> | ||
| 516 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | ||
| 517 | + <span class="ct_line_lp_badge" ></span> | ||
| 518 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 519 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | ||
| 520 | + </div> | ||
| 521 | + </form> | ||
| 522 | + </script> | ||
| 523 | + | ||
| 524 | + <script> | ||
| 525 | + (function () { | ||
| 526 | + var modal = '#schedule-addsch-modal', | ||
| 527 | + sch, stationRoutes, parks, information,carsArray; | ||
| 528 | + | ||
| 529 | + $(modal).on('init', function (e, data) { | ||
| 530 | + e.stopPropagation(); | ||
| 531 | + sch = data.sch; | ||
| 532 | + //站点路由 | ||
| 533 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { | ||
| 534 | + return a.stationRouteCode - b.stationRouteCode; | ||
| 535 | + }), 'directions'); | ||
| 536 | + //停车场 | ||
| 537 | + parks = gb_data_basic.simpleParksArray(); | ||
| 538 | + //线路标准 | ||
| 539 | + information = gb_data_basic.getLineInformation(sch.xlBm); | ||
| 540 | + //车辆信息 | ||
| 541 | + carsArray = gb_data_basic.carsArray(); | ||
| 542 | + | ||
| 543 | + //监听tab切换事件 | ||
| 544 | + $('.left_tabs_lg[data-uk-switcher]', modal).on('show.uk.switcher', function (event, area) { | ||
| 545 | + var handle = area.data('handle'); | ||
| 546 | + $('#tempScheduleContent>li').empty(); | ||
| 547 | + leftTabsHandles[handle](); | ||
| 548 | + }); | ||
| 549 | + }); | ||
| 550 | + | ||
| 551 | + function setEndTime(diff, f) { | ||
| 552 | + var et = moment($('[name=fcsj]', f).val(), 'HH:mm').add(diff, 'minutes').format('HH:mm'); | ||
| 553 | + $('[name=zdsj]', f).val(et); | ||
| 554 | + } | ||
| 555 | + | ||
| 556 | + function initAutoCom(f) { | ||
| 557 | + //车辆 | ||
| 558 | + if(carsArray) | ||
| 559 | + gb_common.carAutocomplete($('.car-autocom', f), carsArray); | ||
| 560 | + //驾驶员 | ||
| 561 | + gb_common.personAutocomplete($('.jsy-autocom', f)); | ||
| 562 | + //售票员 | ||
| 563 | + gb_common.personAutocomplete($('.spy-autocom', f)); | ||
| 564 | + //备注补全 | ||
| 565 | + gb_common.remarksAutocomplete($('.remarks-autocom', f)); | ||
| 566 | + } | ||
| 567 | + | ||
| 568 | + function initScheduleTypeChange(f, cb) { | ||
| 569 | + (function (f, cb) { | ||
| 570 | + $('[name=bcType],[name=xlDir]', f).on('change', function () { | ||
| 571 | + var bcType_e = $('[name=bcType]', f) | ||
| 572 | + , xlDir_e = $('[name=xlDir]', f); | ||
| 573 | + | ||
| 574 | + var routes = stationRoutes[xlDir_e.val()] | ||
| 575 | + , lastCode = routes[routes.length - 1].stationCode | ||
| 576 | + , opts = '', park_opts = ''; | ||
| 577 | + //station options | ||
| 578 | + $.each(routes, function () { | ||
| 579 | + opts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>' | ||
| 580 | + }); | ||
| 581 | + //park options | ||
| 582 | + for (var code in parks) | ||
| 583 | + park_opts += '<option value="' + code + '">' + parks[code] + '</option>'; | ||
| 584 | + | ||
| 585 | + var qdz = $('[name=qdzCode]', f), zdz = $('[name=zdzCode]', f); | ||
| 586 | + var time, mileage; | ||
| 587 | + switch (bcType_e.val()) { | ||
| 588 | + case 'out': | ||
| 589 | + qdz.html(park_opts).val(information.carPark); | ||
| 590 | + zdz.html(opts); | ||
| 591 | + //出场结束时间 | ||
| 592 | + time = xlDir_e.val() == 0 ? information.upOutTimer : information.downOutTimer; | ||
| 593 | + mileage = xlDir_e.val() == 0 ? information.upOutMileage : information.downOutMileage; | ||
| 594 | + break; | ||
| 595 | + case 'in': | ||
| 596 | + qdz.html(opts); | ||
| 597 | + zdz.html(park_opts).val(information.carPark); | ||
| 598 | + //进场结束时间 | ||
| 599 | + time = xlDir_e.val() == 0 ? information.upInTimer : information.downInTimer; | ||
| 600 | + mileage = xlDir_e.val() == 0 ? information.upInMileage : information.downInMileage; | ||
| 601 | + break; | ||
| 602 | + default: | ||
| 603 | + qdz.html(opts); | ||
| 604 | + zdz.html(opts).val(lastCode); | ||
| 605 | + time = xlDir_e.val() == 0?information.upTravelTime:information.downTravelTime; | ||
| 606 | + mileage = xlDir_e.val() == 0?information.upMileage:information.downMileage; | ||
| 607 | + } | ||
| 608 | + | ||
| 609 | + setEndTime(time, f); | ||
| 610 | + $('[name=jhlc]', f).val(mileage); | ||
| 611 | + | ||
| 612 | + cb && cb(); | ||
| 613 | + }).trigger('change'); | ||
| 614 | + })(f, cb); | ||
| 615 | + } | ||
| 616 | + | ||
| 617 | + function initStationChange(f, cb) { | ||
| 618 | + (function (f, cb) { | ||
| 619 | + //起点站改变 | ||
| 620 | + $('[name=qdzCode]', f).on('change', function () { | ||
| 621 | + var bcType = $('[name=bcType]', f).val(); | ||
| 622 | + if(bcType!='in' && bcType!='out'){ | ||
| 623 | + var ops = $('[name=zdzCode]', f).find('option'); | ||
| 624 | + var flag, code = $(this).val(); | ||
| 625 | + $.each(ops, function () { | ||
| 626 | + if (!flag) | ||
| 627 | + $(this).attr('disabled', 'disabled'); | ||
| 628 | + else | ||
| 629 | + $(this).removeAttr('disabled'); | ||
| 630 | + if (this.value == code) | ||
| 631 | + flag = true; | ||
| 632 | + }); | ||
| 633 | + setBcType(f); | ||
| 634 | + } | ||
| 635 | + cb && cb(); | ||
| 636 | + }); | ||
| 637 | + //终点站改变 | ||
| 638 | + $('[name=zdzCode]', f).on('change', function () { | ||
| 639 | + var bcType = $('[name=bcType]', f).val(); | ||
| 640 | + if(bcType!='in' && bcType!='out'){ | ||
| 641 | + var ops = $('[name=qdzCode]', f).find('option'); | ||
| 642 | + var flag, code = $(this).val(); | ||
| 643 | + $.each(ops, function () { | ||
| 644 | + if (this.value == code) | ||
| 645 | + flag = true; | ||
| 646 | + | ||
| 647 | + if (flag) | ||
| 648 | + $(this).attr('disabled', 'disabled'); | ||
| 649 | + else | ||
| 650 | + $(this).removeAttr('disabled'); | ||
| 651 | + }); | ||
| 652 | + setBcType(f); | ||
| 653 | + } | ||
| 654 | + | ||
| 655 | + cb && cb(); | ||
| 656 | + }); | ||
| 657 | + })(f, cb); | ||
| 658 | + } | ||
| 659 | + | ||
| 660 | + function setBcType(f) { | ||
| 661 | + var qdzCode = $('[name=qdzCode]', f).val(), | ||
| 662 | + zdzCode =$('[name=zdzCode]', f).val(), | ||
| 663 | + updown = $('[name=xlDir]', f).val(); | ||
| 664 | + var rts = stationRoutes[updown]; | ||
| 665 | + if(rts[0].stationCode == qdzCode | ||
| 666 | + && rts[rts.length - 1].stationCode == zdzCode){ | ||
| 667 | + $('[name=bcType]', f).val('normal'); | ||
| 668 | + $('[name=jhlc]', f).val(updown == 0?information.upMileage:information.downMileage); | ||
| 669 | + } | ||
| 670 | + else { | ||
| 671 | + var type = $('[name=bcType]', f).val(); | ||
| 672 | + if(type!='normal') | ||
| 673 | + return; | ||
| 674 | + $('[name=bcType]', f).val('region'); | ||
| 675 | + //计算区间站点间公里 | ||
| 676 | + var mileage = calcMileage(qdzCode, zdzCode, rts); | ||
| 677 | + $('[name=jhlc]', f).val(mileage); | ||
| 678 | + } | ||
| 679 | + } | ||
| 680 | + | ||
| 681 | + function calcMileage(s, e, rts) { | ||
| 682 | + var mileage = 0, flag, code; | ||
| 683 | + //从原始站点路由字段里取值 | ||
| 684 | + $.each(rts, function () { | ||
| 685 | + code = this['stationCode']; | ||
| 686 | + if (flag) | ||
| 687 | + mileage = gb_common.accAdd(mileage, this.distances); | ||
| 688 | + if (code == s) | ||
| 689 | + flag = true; | ||
| 690 | + if (code == e) | ||
| 691 | + return false; | ||
| 692 | + }); | ||
| 693 | + return mileage; | ||
| 694 | + } | ||
| 695 | + | ||
| 696 | + /** | ||
| 697 | + * 提交表单 | ||
| 698 | + */ | ||
| 699 | + var submitScheduleForm = function (data, cb) { | ||
| 700 | + //班次日期 | ||
| 701 | + data.scheduleDateStr = sch.scheduleDateStr; | ||
| 702 | + data.xlBm = sch.xlBm; | ||
| 703 | + data.xlName = sch.xlName; | ||
| 704 | + data.lpName = sch.lpName; | ||
| 705 | + //拆分驾驶员工号和姓名 | ||
| 706 | + data.jGh = data.jsy.split('/')[0]; | ||
| 707 | + data.jName = data.jsy.split('/')[1]; | ||
| 708 | + delete data.jsy; | ||
| 709 | + //拆分售票员工号和姓名 | ||
| 710 | + if (data.sGh != null) { | ||
| 711 | + data.sGh = data.spy.split('/')[0]; | ||
| 712 | + data.sName = data.spy.split('/')[1]; | ||
| 713 | + delete data.spy; | ||
| 714 | + } | ||
| 715 | + | ||
| 716 | + //公司信息 | ||
| 717 | + var line = gb_data_basic.findLineByCodes([data.xlBm]); | ||
| 718 | + if(line && line.length > 0){ | ||
| 719 | + line = line[0]; | ||
| 720 | + data.gsBm = line.company; | ||
| 721 | + data.fgsBm = line.brancheCompany; | ||
| 722 | + } | ||
| 723 | + | ||
| 724 | + //直接给实发实达时间 | ||
| 725 | + data.fcsjActual = data.fcsj; | ||
| 726 | + data.zdsjActual = data.zdsj; | ||
| 727 | + gb_common.$post('/realSchedule/history/add', data, function (rs) { | ||
| 728 | + notify_succ('新增临加班次成功'); | ||
| 729 | + cb && cb(rs); | ||
| 730 | + }); | ||
| 731 | + }; | ||
| 732 | + | ||
| 733 | + /** | ||
| 734 | + * 普通单程临加班次 | ||
| 735 | + * @type {{show}} | ||
| 736 | + */ | ||
| 737 | + var normalObj = (function () { | ||
| 738 | + var cont = $('.normalCont', modal); | ||
| 739 | + var show = function () { | ||
| 740 | + var formHtml = template('add_normal_sch-form-temp', sch); | ||
| 741 | + cont.html(formHtml); | ||
| 742 | + var f = $('form', cont); | ||
| 743 | + | ||
| 744 | + initAutoCom(f); | ||
| 745 | + //字典转换 | ||
| 746 | + dictionaryUtils.transformDom($('.nt-dictionary', f)); | ||
| 747 | + //站点切换 | ||
| 748 | + initStationChange(f); | ||
| 749 | + //类型、走向切换 | ||
| 750 | + initScheduleTypeChange(f); | ||
| 751 | + | ||
| 752 | + //校验 | ||
| 753 | + f.formValidation({framework: 'uikit', locale: 'zh_CN'}); | ||
| 754 | + //提交 | ||
| 755 | + f.on('success.form.fv', function (e) { | ||
| 756 | + e.preventDefault(); | ||
| 757 | + | ||
| 758 | + disabled_submit_btn(f); | ||
| 759 | + var data = $(f).serializeJSON(); | ||
| 760 | + submitScheduleForm(data, function (rs) { | ||
| 761 | + $('#history-sch-maintain-modal').trigger('refresh'); | ||
| 762 | + UIkit.modal(modal).hide(); | ||
| 763 | + }); | ||
| 764 | + }); | ||
| 765 | + $('.ct_line_lp_badge', f).html(sch.xlName + ', '+sch.lpName); | ||
| 766 | + }; | ||
| 767 | + | ||
| 768 | + return { | ||
| 769 | + show: show | ||
| 770 | + } | ||
| 771 | + })(); | ||
| 772 | + | ||
| 773 | + /** | ||
| 774 | + * 线路上往返 | ||
| 775 | + */ | ||
| 776 | + var toAndFroObj = (function () { | ||
| 777 | + var cont = $('.toAndFroCont', modal); | ||
| 778 | + var show = function () { | ||
| 779 | + var formHtml = template('add_toAndFro_sch-form-temp', sch); | ||
| 780 | + cont.html(formHtml); | ||
| 781 | + //字典转换 | ||
| 782 | + dictionaryUtils.transformDom($('.nt-dictionary', cont)); | ||
| 783 | + var f1 = $('.one_form', cont); | ||
| 784 | + var f2 = $('.two_form', cont); | ||
| 785 | + //第1个表单事件 | ||
| 786 | + initStationChange(f1, synchroFormData); | ||
| 787 | + initScheduleTypeChange(f1, synchroFormData); | ||
| 788 | + //第2个表单事件 | ||
| 789 | + initStationChange(f2); | ||
| 790 | + initScheduleTypeChange(f2); | ||
| 791 | + //第一个结束时间改变 | ||
| 792 | + $('[name=zdsj]', f1).on('input', synchroTimes).trigger('input'); | ||
| 793 | + //默认1备注同步到2 | ||
| 794 | + $('.remarks-autocom', f1).on('selectitem.uk.autocomplete', function (e, data, acobject) { | ||
| 795 | + $('[name=remarks]', f2).val(data.value); | ||
| 796 | + }); | ||
| 797 | + //自动补全 | ||
| 798 | + initAutoCom(f1); | ||
| 799 | + initAutoCom(f2); | ||
| 800 | + | ||
| 801 | + //表单校验提交相关 | ||
| 802 | + var dataArray; | ||
| 803 | + var fs = $('form', cont); | ||
| 804 | + fs.formValidation({framework: 'uikit', locale: 'zh_CN'}); | ||
| 805 | + fs.on('success.form.fv', function (e) { | ||
| 806 | + e.preventDefault(); | ||
| 807 | + dataArray.push($(this).serializeJSON()); | ||
| 808 | + $(this).data('valid', true); | ||
| 809 | + if (allValidSuccess()) { | ||
| 810 | + //开始post | ||
| 811 | + var i = 0; | ||
| 812 | + (function () { | ||
| 813 | + var f = arguments.callee; | ||
| 814 | + if (i >= dataArray.length) { | ||
| 815 | + $('#history-sch-maintain-modal').trigger('refresh'); | ||
| 816 | + UIkit.modal(modal).hide(); | ||
| 817 | + return; | ||
| 818 | + } | ||
| 819 | + submitScheduleForm(dataArray[i], function (rs) { | ||
| 820 | + i++; | ||
| 821 | + f(); | ||
| 822 | + }); | ||
| 823 | + })(); | ||
| 824 | + } | ||
| 825 | + }); | ||
| 826 | + //提交 | ||
| 827 | + $('[type=submit]', cont).on('click', function () { | ||
| 828 | + $(this).addClass('disabled').attr('disabled', 'disabled'); | ||
| 829 | + dataArray = []; | ||
| 830 | + fs.data('valid', false); | ||
| 831 | + fs.formValidation('validate'); | ||
| 832 | + }); | ||
| 833 | + $('.ct_line_lp_badge', cont).html(sch.xlName + ', '+sch.lpName); | ||
| 834 | + }; | ||
| 835 | + | ||
| 836 | + function allValidSuccess() { | ||
| 837 | + var flag = true; | ||
| 838 | + $('form:visible', cont).each(function (i, f) { | ||
| 839 | + if (!$(f).data('valid')) { | ||
| 840 | + flag = false; | ||
| 841 | + return false; | ||
| 842 | + } | ||
| 843 | + }); | ||
| 844 | + return flag; | ||
| 845 | + } | ||
| 846 | + | ||
| 847 | + /** | ||
| 848 | + * 同步2个表单的数据 | ||
| 849 | + */ | ||
| 850 | + var bcTypes = {'normal': 'normal', 'region': 'region', 'out': 'in', 'in': 'out'}; | ||
| 851 | + var synchroFormData = function () { | ||
| 852 | + var f1 = $('.one_form', cont); | ||
| 853 | + var f2 = $('.two_form', cont); | ||
| 854 | + | ||
| 855 | + //同步班次类型 | ||
| 856 | + var type = $('[name=bcType]', f1).val(); | ||
| 857 | + if (bcTypes[type]) | ||
| 858 | + $('[name=bcType]', f2).val(bcTypes[type]).trigger('change'); | ||
| 859 | + var updown = $('[name=xlDir]', f1).val(); | ||
| 860 | + | ||
| 861 | + if (type != 'out' && type != 'in') { | ||
| 862 | + //走向 | ||
| 863 | + $('[name=xlDir]', f2).val(updown == 0 ? 1 : 0).trigger('change'); | ||
| 864 | + | ||
| 865 | + //第一个表单终点 = 第二个起点 | ||
| 866 | + var oneZdName = $('[name=zdzCode] option:selected', f1).text(); | ||
| 867 | + $('[name=qdzCode]', f2).val(searchParallelStation(oneZdName, updown == 0 ? 1 : 0)).trigger('change'); | ||
| 868 | + //第一个表单起点 = 第二个终点 | ||
| 869 | + var oneQdName = $('[name=qdzCode] option:selected', f1).text(); | ||
| 870 | + $('[name=zdzCode]', f2).val(searchParallelStation(oneQdName, updown == 0 ? 1 : 0)).trigger('change'); | ||
| 871 | + } | ||
| 872 | + else { | ||
| 873 | + //进出场走向相同 | ||
| 874 | + $('[name=xlDir]', f2).val(updown).trigger('change'); | ||
| 875 | + //第一个表单终点 = 第二个起点 | ||
| 876 | + $('[name=qdzCode]', f2).val($('[name=zdzCode]', f1).val()); | ||
| 877 | + //第一个表单起点 = 第二个终点 | ||
| 878 | + $('[name=zdzCode]', f2).val($('[name=qdzCode]', f1).val()); | ||
| 879 | + } | ||
| 880 | + }; | ||
| 881 | + | ||
| 882 | + /** | ||
| 883 | + * 同步时间 | ||
| 884 | + */ | ||
| 885 | + var synchroTimes = function () { | ||
| 886 | + var f1 = $('.one_form', cont); | ||
| 887 | + var f2 = $('.two_form', cont); | ||
| 888 | + var updown = $('[name=xlDir]', f2).val(); | ||
| 889 | + var oneZdsj = $('[name=zdsj]', f1).val(); | ||
| 890 | + | ||
| 891 | + //全程班次历时 | ||
| 892 | + var diff = updown==0?information.upTravelTime:information.downTravelTime; | ||
| 893 | + //设置第二个表单开始时间 | ||
| 894 | + $('[name=fcsj]', f2).val(oneZdsj); | ||
| 895 | + setEndTime(diff, f2); | ||
| 896 | + }; | ||
| 897 | + | ||
| 898 | + return { | ||
| 899 | + show : show | ||
| 900 | + } | ||
| 901 | + })(); | ||
| 902 | + | ||
| 903 | + /** | ||
| 904 | + * 场到场 | ||
| 905 | + */ | ||
| 906 | + var parkToParkObj = (function () { | ||
| 907 | + | ||
| 908 | + var cont = $('.parkToParkCont', modal); | ||
| 909 | + var show = function () { | ||
| 910 | + var formHtml = template('add_park2park_sch-form-temp', sch); | ||
| 911 | + cont.html(formHtml); | ||
| 912 | + var f = $('form', cont); | ||
| 913 | + | ||
| 914 | + initAutoCom(f); | ||
| 915 | + //字典转换 | ||
| 916 | + dictionaryUtils.transformDom($('.nt-dictionary', f)); | ||
| 917 | + | ||
| 918 | + //park options | ||
| 919 | + var park_opts; | ||
| 920 | + for (var code in parks) | ||
| 921 | + park_opts += '<option value="' + code + '">' + parks[code] + '</option>'; | ||
| 922 | + $('[name=qdzCode]', f).html(park_opts); | ||
| 923 | + $('[name=zdzCode]', f).html(park_opts); | ||
| 924 | + if(sch.bcType=='in'){ | ||
| 925 | + $('[name=qdzCode]', f).val(sch.zdzCode); | ||
| 926 | + //选中的也是场到场班次 | ||
| 927 | + if(gb_data_basic.getCarparkByCode(sch.qdzCode) != null){ | ||
| 928 | + //默认做返程 | ||
| 929 | + $('[name=zdzCode]', f).val(sch.qdzCode); | ||
| 930 | + $('[name=remarks]', f).val(sch.remarks); | ||
| 931 | + $('[name=jhlc]', f).val(sch.jhlc); | ||
| 932 | + //时间 | ||
| 933 | + var zdsj = moment(sch.zdsj, 'HH:mm').add('minutes', sch.bcsj).format('HH:mm'); | ||
| 934 | + $('[name=zdsj]', f).val(zdsj); | ||
| 935 | + } | ||
| 936 | + } | ||
| 937 | + | ||
| 938 | + //校验 | ||
| 939 | + f.formValidation({framework: 'uikit', locale: 'zh_CN'}); | ||
| 940 | + //提交 | ||
| 941 | + f.on('success.form.fv', function (e) { | ||
| 942 | + e.preventDefault(); | ||
| 943 | + | ||
| 944 | + disabled_submit_btn(f); | ||
| 945 | + var data = $(f).serializeJSON(); | ||
| 946 | + submitScheduleForm(data, function (rs) { | ||
| 947 | + $('#history-sch-maintain-modal').trigger('refresh'); | ||
| 948 | + UIkit.modal(modal).hide(); | ||
| 949 | + }); | ||
| 950 | + }); | ||
| 951 | + $('.ct_line_lp_badge', f).html(sch.xlName + ', '+sch.lpName); | ||
| 952 | + }; | ||
| 953 | + | ||
| 954 | + return { | ||
| 955 | + show: show | ||
| 956 | + } | ||
| 957 | + })(); | ||
| 958 | + | ||
| 959 | + /** 左 tabs 切换处理*/ | ||
| 960 | + var leftTabsHandles = { | ||
| 961 | + normal: normalObj.show, | ||
| 962 | + toAndFro: toAndFroObj.show, | ||
| 963 | + parkToPark: parkToParkObj.show | ||
| 964 | + }; | ||
| 965 | + | ||
| 966 | + //返回另一个走向对应的站点 | ||
| 967 | + function searchParallelStation(stationName, updown) { | ||
| 968 | + var routes = stationRoutes[updown] | ||
| 969 | + , len = routes.length; | ||
| 970 | + | ||
| 971 | + for (var i = 0; i < len; i++) { | ||
| 972 | + if (routes[i].stationName == stationName) | ||
| 973 | + return routes[i].stationCode; | ||
| 974 | + } | ||
| 975 | + } | ||
| 976 | + | ||
| 977 | + })(); | ||
| 978 | + </script> | ||
| 979 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/h_oil_station.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal ct_move_modal" id="oil_station-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 450px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>绑定停车场(里程/历时)</h2></div> | ||
| 6 | + | ||
| 7 | + <form class="uk-form uk-form-horizontal " style="margin-bottom: 0 !important;"> | ||
| 8 | + <div class="uk-form-row"> | ||
| 9 | + <label class="uk-form-label">线路</label> | ||
| 10 | + <div class="uk-form-icon"> | ||
| 11 | + <input type="hidden" name="lineCode"> | ||
| 12 | + <input type="text" name="qdzName" disabled> | ||
| 13 | + </div> | ||
| 14 | + </div> | ||
| 15 | + <div class="uk-form-row"> | ||
| 16 | + <label class="uk-form-label">停车场名称</label> | ||
| 17 | + <div class="uk-form-icon"> | ||
| 18 | + <input type="text" name="stationName" required style="width: calc(100% - 99px);margin-right: 5px;"> | ||
| 19 | + <span class="input_clear_icon"></span> | ||
| 20 | + <div class="uk-button-dropdown" data-uk-dropdown> | ||
| 21 | + <a>选择停车场 <i class="uk-icon-angle-down"></i></a> | ||
| 22 | + <div class="uk-dropdown uk-dropdown-scrollable" style="max-height: 300px;"> | ||
| 23 | + <ul class="uk-nav uk-nav-dropdown parks_list"> | ||
| 24 | + </ul> | ||
| 25 | + </div> | ||
| 26 | + </div> | ||
| 27 | + | ||
| 28 | + </div> | ||
| 29 | + </div> | ||
| 30 | + <div class="uk-form-row"> | ||
| 31 | + <label class="uk-form-label">起点进场里程</label> | ||
| 32 | + <div class="uk-form-icon"> | ||
| 33 | + <i class="uk-icon-mile"></i> | ||
| 34 | + <input type="number" name="upInMile" step="0.01" required> | ||
| 35 | + </div> | ||
| 36 | + </div> | ||
| 37 | + <div class="uk-form-row"> | ||
| 38 | + <label class="uk-form-label">终点进场里程</label> | ||
| 39 | + <div class="uk-form-icon"> | ||
| 40 | + <i class="uk-icon-mile"></i> | ||
| 41 | + <input type="number" name="downInMile" step="0.01" required> | ||
| 42 | + </div> | ||
| 43 | + </div> | ||
| 44 | + <div class="uk-form-row"> | ||
| 45 | + <label class="uk-form-label">起点进场时间</label> | ||
| 46 | + <div class="uk-form-icon"> | ||
| 47 | + <i class="uk-icon-minute"></i> | ||
| 48 | + <input type="text" name="upInTime" required> | ||
| 49 | + </div> | ||
| 50 | + </div> | ||
| 51 | + <div class="uk-form-row"> | ||
| 52 | + <label class="uk-form-label">终点进场时间</label> | ||
| 53 | + <div class="uk-form-icon"> | ||
| 54 | + <i class="uk-icon-minute"></i> | ||
| 55 | + <input type="text" name="downInTime" required> | ||
| 56 | + </div> | ||
| 57 | + </div> | ||
| 58 | + | ||
| 59 | + <hr> | ||
| 60 | + <div class="uk-form-row"> | ||
| 61 | + <label class="uk-form-label">出场到起点里程</label> | ||
| 62 | + <div class="uk-form-icon"> | ||
| 63 | + <i class="uk-icon-mile"></i> | ||
| 64 | + <input type="number" name="upOutMile" step="0.01" required> | ||
| 65 | + </div> | ||
| 66 | + </div> | ||
| 67 | + <div class="uk-form-row"> | ||
| 68 | + <label class="uk-form-label">出场到终点里程</label> | ||
| 69 | + <div class="uk-form-icon"> | ||
| 70 | + <i class="uk-icon-mile"></i> | ||
| 71 | + <input type="number" name="downOutMile" step="0.01" required> | ||
| 72 | + </div> | ||
| 73 | + </div> | ||
| 74 | + <div class="uk-form-row"> | ||
| 75 | + <label class="uk-form-label">出场到起点时间</label> | ||
| 76 | + <div class="uk-form-icon"> | ||
| 77 | + <i class="uk-icon-minute"></i> | ||
| 78 | + <input type="text" name="upOutTime" required> | ||
| 79 | + </div> | ||
| 80 | + </div> | ||
| 81 | + <div class="uk-form-row"> | ||
| 82 | + <label class="uk-form-label">出场到终点时间</label> | ||
| 83 | + <div class="uk-form-icon"> | ||
| 84 | + <i class="uk-icon-minute"></i> | ||
| 85 | + <input type="text" name="downOutTime" required> | ||
| 86 | + </div> | ||
| 87 | + </div> | ||
| 88 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | ||
| 89 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 90 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | ||
| 91 | + </div> | ||
| 92 | + </form> | ||
| 93 | + </div> | ||
| 94 | + | ||
| 95 | + <script id="park_list_dropdown-temp" type="text/html"> | ||
| 96 | + {{each list as p i}} | ||
| 97 | + <li data-code="{{p.code}}" data-name="{{p.name}}"><a>{{p.name}}</a></li> | ||
| 98 | + {{if i == 0}} | ||
| 99 | + <li class="uk-nav-divider"></li> | ||
| 100 | + {{/if}} | ||
| 101 | + {{/each}} | ||
| 102 | + </script> | ||
| 103 | + | ||
| 104 | + <script> | ||
| 105 | + (function () { | ||
| 106 | + var modal = '#oil_station-modal', | ||
| 107 | + sch, oilStation, information; | ||
| 108 | + | ||
| 109 | + var cognates = { | ||
| 110 | + 'upInMile': 'upOutMile', | ||
| 111 | + 'downInMile': 'downOutMile', | ||
| 112 | + 'upInTime': 'upOutTime', | ||
| 113 | + 'downInTime': 'downOutTime' | ||
| 114 | + }; | ||
| 115 | + $(modal).on('init', function (e, data) { | ||
| 116 | + e.stopPropagation(); | ||
| 117 | + sch = data.sch; | ||
| 118 | + | ||
| 119 | + $.get('/oilStation/'+sch.xlBm, function (rs) { | ||
| 120 | + oilStation = rs; | ||
| 121 | + setDefaultVal(oilStation); | ||
| 122 | + }); | ||
| 123 | + | ||
| 124 | + $('form [name=qdzName]', modal).val(sch.xlName); | ||
| 125 | + $('form [name=lineCode]', modal).val(sch.xlBm); | ||
| 126 | + | ||
| 127 | + //submit | ||
| 128 | + var f = $('form', modal).formValidation({framework: 'uikit', locale: 'zh_CN'}); | ||
| 129 | + f.on('success.form.fv', function(e) { | ||
| 130 | + e.preventDefault(); | ||
| 131 | + var data = $(this).serializeJSON(); | ||
| 132 | + if(parkCode) | ||
| 133 | + data.stationCode = parkCode; | ||
| 134 | + | ||
| 135 | + gb_common.$post('/oilStation', data, function (rs) { | ||
| 136 | + notify_succ('添加成功!'); | ||
| 137 | + UIkit.modal(modal).hide(); | ||
| 138 | + $('#schedule-addsch_oil-modal').trigger('init', {sch: sch}); | ||
| 139 | + }); | ||
| 140 | + }); | ||
| 141 | + | ||
| 142 | + $('form input', modal).on('input', function () { | ||
| 143 | + var name = $(this).attr('name'); | ||
| 144 | + if(cognates[name]){ | ||
| 145 | + $('form [name='+cognates[name]+']', modal).val($(this).val()).trigger('input'); | ||
| 146 | + } | ||
| 147 | + }); | ||
| 148 | + | ||
| 149 | + //线路标准 | ||
| 150 | + information = gb_data_basic.getLineInformation(sch.xlBm); | ||
| 151 | + //查询停车场 | ||
| 152 | + $.get('/basic/parks', function (rs) { | ||
| 153 | + var parks = [], index; | ||
| 154 | + for(var code in rs){ | ||
| 155 | + parks.push({code: code, name: rs[code]}); | ||
| 156 | + if(code == information.carPark) | ||
| 157 | + index = parks.length - 1; | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + //将线路标准停车场排在第一个 | ||
| 161 | + parks[index] = parks.splice(0, 1 , parks[index])[0]; | ||
| 162 | + var htmlStr = template('park_list_dropdown-temp', {list: parks}); | ||
| 163 | + $('.parks_list', modal).html(htmlStr); | ||
| 164 | + //选择停车场 | ||
| 165 | + $('.parks_list>li', modal).on('click', selectPark); | ||
| 166 | + }); | ||
| 167 | + }); | ||
| 168 | + | ||
| 169 | + function setDefaultVal(obj) { | ||
| 170 | + if(!obj) | ||
| 171 | + return; | ||
| 172 | + $('form input', modal).each(function () { | ||
| 173 | + var name = $(this).attr('name'); | ||
| 174 | + if(obj[name] != null) | ||
| 175 | + $(this).val(obj[name]); | ||
| 176 | + }); | ||
| 177 | + } | ||
| 178 | + | ||
| 179 | + var parkCode; | ||
| 180 | + function selectPark() { | ||
| 181 | + var code = $(this).data('code'); | ||
| 182 | + var name = $(this).data('name'); | ||
| 183 | + | ||
| 184 | + //选择的是线路标准停车场 | ||
| 185 | + if(code == information.carPark){ | ||
| 186 | + //起点进场里程 | ||
| 187 | + $('[name=upInMile]', modal).val(information.upInMileage).trigger('input'); | ||
| 188 | + //起点进场时间 | ||
| 189 | + $('[name=upInTime]', modal).val(information.upInTimer).trigger('input'); | ||
| 190 | + //终点进场里程 | ||
| 191 | + $('[name=downInMile]', modal).val(information.downOutMileage).trigger('input'); | ||
| 192 | + //终点进场时间 | ||
| 193 | + $('[name=downInTime]', modal).val(information.downInTimer).trigger('input'); | ||
| 194 | + | ||
| 195 | + //起点出场里程 | ||
| 196 | + $('[name=upOutMile]', modal).val(information.upOutMileage).trigger('input'); | ||
| 197 | + //起点出场时间 | ||
| 198 | + $('[name=upOutTime]', modal).val(information.upOutTimer).trigger('input'); | ||
| 199 | + //终点出场里程 | ||
| 200 | + $('[name=downOutMile]', modal).val(information.downOutMileage).trigger('input'); | ||
| 201 | + //终点出场时间 | ||
| 202 | + $('[name=downOutTime]', modal).val(information.downOutTimer).trigger('input'); | ||
| 203 | + } | ||
| 204 | + else | ||
| 205 | + clearInputs(); | ||
| 206 | + | ||
| 207 | + $('[name=stationName]', modal).val(name).addClass('readonly').attr('readonly', 'readonly'); | ||
| 208 | + $('.input_clear_icon', modal).show(); | ||
| 209 | + //记录停车场编码 | ||
| 210 | + parkCode = code; | ||
| 211 | + } | ||
| 212 | + | ||
| 213 | + $('.input_clear_icon', modal).on('click', function () { | ||
| 214 | + $(this).hide(); | ||
| 215 | + parkCode = null; | ||
| 216 | + $('[name=stationName]', modal).val('').removeClass('readonly').removeAttr('readonly'); | ||
| 217 | + | ||
| 218 | + clearInputs(); | ||
| 219 | + }); | ||
| 220 | + | ||
| 221 | + function clearInputs() { | ||
| 222 | + $('[name=upInMile]', modal).val('').trigger('input'); | ||
| 223 | + $('[name=upInTime]', modal).val('').trigger('input'); | ||
| 224 | + $('[name=downInMile]', modal).val('').trigger('input'); | ||
| 225 | + $('[name=downInTime]', modal).val('').trigger('input'); | ||
| 226 | + $('[name=upOutMile]', modal).val('').trigger('input'); | ||
| 227 | + $('[name=upOutTime]', modal).val('').trigger('input'); | ||
| 228 | + $('[name=downOutMile]', modal).val('').trigger('input'); | ||
| 229 | + $('[name=downOutTime]', modal).val('').trigger('input'); | ||
| 230 | + } | ||
| 231 | + })(); | ||
| 232 | + </script> | ||
| 233 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch_maintain.html
| 1 | -<div class="uk-modal" id="history-sch-maintain-modal"> | 1 | +<div class="uk-modal ct_move_modal" id="history-sch-maintain-modal"> |
| 2 | <div class="uk-modal-dialog" style="width: 1180px;"> | 2 | <div class="uk-modal-dialog" style="width: 1180px;"> |
| 3 | <a href="" class="uk-modal-close uk-close"></a> | 3 | <a href="" class="uk-modal-close uk-close"></a> |
| 4 | - <h2>历史班次维护</h2> | 4 | + <h2>历史路单维护</h2> |
| 5 | 5 | ||
| 6 | <div style="padding-left: 12px;margin: 20px 0"> | 6 | <div style="padding-left: 12px;margin: 20px 0"> |
| 7 | <ul class="uk-subnav uk-subnav-pill h-s-time"> | 7 | <ul class="uk-subnav uk-subnav-pill h-s-time"> |
| @@ -16,6 +16,8 @@ | @@ -16,6 +16,8 @@ | ||
| 16 | <div class="uk-panel uk-panel-box uk-panel-box-primary"> | 16 | <div class="uk-panel uk-panel-box uk-panel-box-primary"> |
| 17 | <form class="uk-form search-form"> | 17 | <form class="uk-form search-form"> |
| 18 | <fieldset data-uk-margin> | 18 | <fieldset data-uk-margin> |
| 19 | + <span class="horizontal-field">路牌</span> | ||
| 20 | + <select name="lpName_eq" style="width: 80px;"></select> | ||
| 19 | <span class="horizontal-field">上下行</span> | 21 | <span class="horizontal-field">上下行</span> |
| 20 | <select name="xlDir_eq"> | 22 | <select name="xlDir_eq"> |
| 21 | <option value="">全部</option> | 23 | <option value="">全部</option> |
| @@ -40,6 +42,8 @@ | @@ -40,6 +42,8 @@ | ||
| 40 | <div class="ct_table history-sch-table"> | 42 | <div class="ct_table history-sch-table"> |
| 41 | <div class="ct_table_head"> | 43 | <div class="ct_table_head"> |
| 42 | <dl> | 44 | <dl> |
| 45 | + <dt>序号</dt> | ||
| 46 | + <dt>路牌</dt> | ||
| 43 | <dt>车辆</dt> | 47 | <dt>车辆</dt> |
| 44 | <dt>驾驶员</dt> | 48 | <dt>驾驶员</dt> |
| 45 | <dt>起点</dt> | 49 | <dt>起点</dt> |
| @@ -47,7 +51,7 @@ | @@ -47,7 +51,7 @@ | ||
| 47 | <dt>计发</dt> | 51 | <dt>计发</dt> |
| 48 | <dt>待发</dt> | 52 | <dt>待发</dt> |
| 49 | <dt>实发</dt> | 53 | <dt>实发</dt> |
| 50 | - <dt>终点时间</dt> | 54 | + <dt>终点实达</dt> |
| 51 | <dt>备注</dt> | 55 | <dt>备注</dt> |
| 52 | </dl> | 56 | </dl> |
| 53 | </div> | 57 | </div> |
| @@ -55,8 +59,6 @@ | @@ -55,8 +59,6 @@ | ||
| 55 | </div> | 59 | </div> |
| 56 | </div> | 60 | </div> |
| 57 | </div> | 61 | </div> |
| 58 | - <div class="uk-modal-footer uk-text-right pagination-wrap"> | ||
| 59 | - </div> | ||
| 60 | 62 | ||
| 61 | <div class="load-panel"> | 63 | <div class="load-panel"> |
| 62 | <i class="uk-icon-spinner uk-icon-spin"></i> | 64 | <i class="uk-icon-spinner uk-icon-spin"></i> |
| @@ -67,6 +69,8 @@ | @@ -67,6 +69,8 @@ | ||
| 67 | <script id="history-sch-maintain-table-temp" type="text/html"> | 69 | <script id="history-sch-maintain-table-temp" type="text/html"> |
| 68 | {{each list as sch i}} | 70 | {{each list as sch i}} |
| 69 | <dl data-id="{{sch.id}}"> | 71 | <dl data-id="{{sch.id}}"> |
| 72 | + <dd>{{i + 1}}</dd> | ||
| 73 | + <dd>{{sch.lpName}}</dd> | ||
| 70 | <dd>{{sch.clZbh}}</dd> | 74 | <dd>{{sch.clZbh}}</dd> |
| 71 | <dd>{{sch.jGh}}/{{sch.jName}}</dd> | 75 | <dd>{{sch.jGh}}/{{sch.jName}}</dd> |
| 72 | <dd title="{{sch.qdzName}}">{{sch.qdzName}}</dd> | 76 | <dd title="{{sch.qdzName}}">{{sch.qdzName}}</dd> |
| @@ -80,6 +84,8 @@ | @@ -80,6 +84,8 @@ | ||
| 80 | <span class="uk-badge uk-badge-danger">直放</span> | 84 | <span class="uk-badge uk-badge-danger">直放</span> |
| 81 | {{else if sch.bcType == "major"}} | 85 | {{else if sch.bcType == "major"}} |
| 82 | <span class="uk-badge uk-badge-danger">放站</span> | 86 | <span class="uk-badge uk-badge-danger">放站</span> |
| 87 | + {{else if sch.bcType == "region"}} | ||
| 88 | + <span class="uk-badge sch_region">区间</span> | ||
| 83 | {{/if}} | 89 | {{/if}} |
| 84 | {{if sch.sflj}} | 90 | {{if sch.sflj}} |
| 85 | <span class="uk-badge uk-badge-danger">临加</span> | 91 | <span class="uk-badge uk-badge-danger">临加</span> |
| @@ -93,7 +99,7 @@ | @@ -93,7 +99,7 @@ | ||
| 93 | <span class="uk-badge uk-badge-danger">烂班</span> | 99 | <span class="uk-badge uk-badge-danger">烂班</span> |
| 94 | {{/if}} | 100 | {{/if}} |
| 95 | </dd> | 101 | </dd> |
| 96 | - <dd>{{sch.fcsjActual}}</dd> | 102 | + <dd>{{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span></dd> |
| 97 | <dd>{{sch.zdsjActual}}</dd> | 103 | <dd>{{sch.zdsjActual}}</dd> |
| 98 | <dd title="{{sch.remarks}}">{{sch.remarks}}</dd> | 104 | <dd title="{{sch.remarks}}">{{sch.remarks}}</dd> |
| 99 | </dl> | 105 | </dl> |
| @@ -103,6 +109,10 @@ | @@ -103,6 +109,10 @@ | ||
| 103 | <script> | 109 | <script> |
| 104 | (function () { | 110 | (function () { |
| 105 | var modal = '#history-sch-maintain-modal'; | 111 | var modal = '#history-sch-maintain-modal'; |
| 112 | + | ||
| 113 | + //滚动条 | ||
| 114 | + $('.history-sch-wrap', modal).perfectScrollbar({suppressScrollX: true}); | ||
| 115 | + //history-sch-wrap | ||
| 106 | $(modal).on('init', function (e, data) { | 116 | $(modal).on('init', function (e, data) { |
| 107 | e.stopPropagation(); | 117 | e.stopPropagation(); |
| 108 | $.get('/realSchedule/dateArray', function (rs) { | 118 | $.get('/realSchedule/dateArray', function (rs) { |
| @@ -120,7 +130,8 @@ | @@ -120,7 +130,8 @@ | ||
| 120 | }); | 130 | }); |
| 121 | $('.h-s-line', modal).html(xlStr); | 131 | $('.h-s-line', modal).html(xlStr); |
| 122 | 132 | ||
| 123 | - | 133 | + clearLpSelect(); |
| 134 | + //reLoadLp=true; | ||
| 124 | jsQuery(); | 135 | jsQuery(); |
| 125 | }); | 136 | }); |
| 126 | }); | 137 | }); |
| @@ -132,11 +143,16 @@ | @@ -132,11 +143,16 @@ | ||
| 132 | return; | 143 | return; |
| 133 | $(this).parent().find('li.uk-active').removeClass('uk-active'); | 144 | $(this).parent().find('li.uk-active').removeClass('uk-active'); |
| 134 | $(this).addClass('uk-active'); | 145 | $(this).addClass('uk-active'); |
| 146 | + clearLpSelect(); | ||
| 147 | + //检索之前将滚动条置顶 | ||
| 148 | + $('.history-sch-wrap', modal)[0].scrollTop = 0; | ||
| 135 | jsQuery(); | 149 | jsQuery(); |
| 136 | }); | 150 | }); |
| 137 | 151 | ||
| 138 | $('.search-form', modal).on('submit', function (e) { | 152 | $('.search-form', modal).on('submit', function (e) { |
| 139 | try { | 153 | try { |
| 154 | + //检索之前将滚动条置顶 | ||
| 155 | + $('.history-sch-wrap', modal)[0].scrollTop = 0; | ||
| 140 | jsQuery(); | 156 | jsQuery(); |
| 141 | }catch(e){ | 157 | }catch(e){ |
| 142 | console.log(e); | 158 | console.log(e); |
| @@ -144,7 +160,9 @@ | @@ -144,7 +160,9 @@ | ||
| 144 | return false; | 160 | return false; |
| 145 | }); | 161 | }); |
| 146 | 162 | ||
| 147 | - var nbbmArray=[],jsyArray=[],loading; | 163 | + var reLoadLp; |
| 164 | + var nbbmArray,jsyArray,lpArray,loading; | ||
| 165 | + var schArray;//主键映射 | ||
| 148 | function jsQuery() { | 166 | function jsQuery() { |
| 149 | var data = $('.search-form', modal).serializeJSON(); | 167 | var data = $('.search-form', modal).serializeJSON(); |
| 150 | var rq = $('.h-s-time li.uk-active', modal).text(), | 168 | var rq = $('.h-s-time li.uk-active', modal).text(), |
| @@ -161,27 +179,52 @@ | @@ -161,27 +179,52 @@ | ||
| 161 | loading=true; | 179 | loading=true; |
| 162 | $.get('/realSchedule/all', data, function (rs) { | 180 | $.get('/realSchedule/all', data, function (rs) { |
| 163 | rs.sort(schedule_sort); | 181 | rs.sort(schedule_sort); |
| 164 | - var tbodyStr = template('history-sch-maintain-table-temp', {list: rs}); | ||
| 165 | - $('.history-sch-table .ct_table_body', modal).html(tbodyStr); | ||
| 166 | - | ||
| 167 | //可搜索的车辆自编号和驾驶员 | 182 | //可搜索的车辆自编号和驾驶员 |
| 168 | nbbmArray=[]; | 183 | nbbmArray=[]; |
| 169 | jsyArray=[]; | 184 | jsyArray=[]; |
| 185 | + lpArray = []; | ||
| 186 | + schArray = {}; | ||
| 170 | $.each(rs, function () { | 187 | $.each(rs, function () { |
| 171 | nbbmArray.push({value: this.clZbh}); | 188 | nbbmArray.push({value: this.clZbh}); |
| 172 | jsyArray.push({value: this.jGh+'/'+this.jName, | 189 | jsyArray.push({value: this.jGh+'/'+this.jName, |
| 173 | fullChars: pinyin.getFullChars(this.jName).toUpperCase(), | 190 | fullChars: pinyin.getFullChars(this.jName).toUpperCase(), |
| 174 | camelChars: pinyin.getCamelChars(this.jName)}); | 191 | camelChars: pinyin.getCamelChars(this.jName)}); |
| 192 | + lpArray.push({value: this.lpName}); | ||
| 193 | + calc_sch_real_shift(this); | ||
| 194 | + schArray[this.id] = this; | ||
| 175 | }); | 195 | }); |
| 196 | + | ||
| 197 | + var tbodyStr = template('history-sch-maintain-table-temp', {list: rs}); | ||
| 198 | + $('.history-sch-table .ct_table_body', modal).html(tbodyStr); | ||
| 176 | //value | 199 | //value |
| 177 | nbbmArray=distinctByField(nbbmArray); | 200 | nbbmArray=distinctByField(nbbmArray); |
| 178 | jsyArray=distinctByField(jsyArray); | 201 | jsyArray=distinctByField(jsyArray); |
| 202 | + lpArray=distinctByField(lpArray); | ||
| 203 | + | ||
| 204 | + if(reLoadLp){ | ||
| 205 | + //路牌下拉框 | ||
| 206 | + var ops = '<option value="">全部</option>'; | ||
| 207 | + $.each(lpArray, function () { | ||
| 208 | + ops += '<option value="'+this.value+'">'+this.value+'</option>'; | ||
| 209 | + }); | ||
| 210 | + $('[name=lpName_eq]', modal).html(ops); | ||
| 211 | + reLoadLp = false; | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + //lpName_eq | ||
| 179 | $('.load-panel', modal).hide(); | 215 | $('.load-panel', modal).hide(); |
| 180 | loading=false; | 216 | loading=false; |
| 181 | 217 | ||
| 218 | + //更新滚动条高度 | ||
| 219 | + $('.history-sch-wrap', modal).perfectScrollbar('update'); | ||
| 182 | }); | 220 | }); |
| 183 | } | 221 | } |
| 184 | 222 | ||
| 223 | + function clearLpSelect() { | ||
| 224 | + $('[name=lpName_eq]', modal).val('').html(''); | ||
| 225 | + reLoadLp = true; | ||
| 226 | + } | ||
| 227 | + | ||
| 185 | //nbbm autocomplete | 228 | //nbbm autocomplete |
| 186 | var carAutoCom=$('.autocomplete-cars', modal); | 229 | var carAutoCom=$('.autocomplete-cars', modal); |
| 187 | UIkit.autocomplete(carAutoCom, { | 230 | UIkit.autocomplete(carAutoCom, { |
| @@ -196,6 +239,8 @@ | @@ -196,6 +239,8 @@ | ||
| 196 | rs.push(this); | 239 | rs.push(this); |
| 197 | count++; | 240 | count++; |
| 198 | } | 241 | } |
| 242 | + if (count >= 15) | ||
| 243 | + return false; | ||
| 199 | }); | 244 | }); |
| 200 | release && release(rs); | 245 | release && release(rs); |
| 201 | } | 246 | } |
| @@ -225,7 +270,7 @@ | @@ -225,7 +270,7 @@ | ||
| 225 | }); | 270 | }); |
| 226 | 271 | ||
| 227 | function schedule_sort(s1, s2) { | 272 | function schedule_sort(s1, s2) { |
| 228 | - return (s1.realExecDate+s1.dfsj).localeCompare(s2.realExecDate+s2.dfsj); | 273 | + return (s1.realExecDate+s1.fcsj).localeCompare(s2.realExecDate+s2.fcsj); |
| 229 | } | 274 | } |
| 230 | 275 | ||
| 231 | function distinctByField(arr, f){ | 276 | function distinctByField(arr, f){ |
| @@ -246,11 +291,42 @@ | @@ -246,11 +291,42 @@ | ||
| 246 | $(this).addClass('active'); | 291 | $(this).addClass('active'); |
| 247 | }); | 292 | }); |
| 248 | 293 | ||
| 294 | + var modal_opts = {center: false,bgclose: false, modal: false}; | ||
| 295 | + var folder = '/real_control_v2/fragments/north/nav/history_sch'; | ||
| 249 | var callbackHandler={ | 296 | var callbackHandler={ |
| 250 | edit: function(id){ | 297 | edit: function(id){ |
| 251 | - open_modal('/real_control_v2/fragments/north/nav/history_sch/edit.html', {id: id, parentModal: modal}, {center: false,bgclose: false, modal: false}); | 298 | + open_modal(folder + '/editor.html', {id: id, parentModal: modal}, modal_opts); |
| 299 | + }, | ||
| 300 | + add: function (id) { | ||
| 301 | + open_modal(folder + '/h_add_temp_sch.html', { | ||
| 302 | + sch: schArray[id] | ||
| 303 | + }, modal_opts); | ||
| 304 | + }, | ||
| 305 | + delete: function (id) { | ||
| 306 | + var sch = schArray[id]; | ||
| 307 | + if (!sch || !sch.sflj) | ||
| 308 | + return notify_err('只能删除临加班次!'); | ||
| 309 | + var str = '<h3>确定要删除临加班次<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>?</h3><h5 style="color: #6c6c6c;font-size: 12px;">班次删除后,调度指令会保留</h5>'; | ||
| 310 | + alt_confirm(str, function () { | ||
| 311 | + gb_common.$del('/realSchedule/history/' + sch.id, function (rs) { | ||
| 312 | + jsQuery(); | ||
| 313 | + }); | ||
| 314 | + }, '确定删除'); | ||
| 252 | } | 315 | } |
| 253 | - } | 316 | + }; |
| 317 | + | ||
| 318 | + //计算实发时间差值 | ||
| 319 | + var calc_sch_real_shift = function (sch) { | ||
| 320 | + if (sch.fcsjActualTime) { | ||
| 321 | + var diff = parseInt((sch.fcsjActualTime - sch.dfsjT) / 1000 / 60); | ||
| 322 | + if (diff > 0) | ||
| 323 | + sch.fcsj_diff = '( +' + diff + ' )'; | ||
| 324 | + else if (diff < 0) | ||
| 325 | + sch.fcsj_diff = '( ' + diff + ' )'; | ||
| 326 | + else | ||
| 327 | + sch.fcsj_diff = ''; | ||
| 328 | + } | ||
| 329 | + }; | ||
| 254 | 330 | ||
| 255 | //右键菜单 | 331 | //右键菜单 |
| 256 | $.contextMenu({ | 332 | $.contextMenu({ |
| @@ -264,17 +340,11 @@ | @@ -264,17 +340,11 @@ | ||
| 264 | 'edit': { | 340 | 'edit': { |
| 265 | name: '编辑' | 341 | name: '编辑' |
| 266 | }, | 342 | }, |
| 267 | - 'child_task':{ | ||
| 268 | - name: '子任务', | ||
| 269 | - disabled: true | ||
| 270 | - }, | ||
| 271 | 'add': { | 343 | 'add': { |
| 272 | - name: '新增', | ||
| 273 | - disabled: true | 344 | + name: '新增临加班次' |
| 274 | }, | 345 | }, |
| 275 | 'delete':{ | 346 | 'delete':{ |
| 276 | - name: '删除', | ||
| 277 | - disabled: true | 347 | + name: '删除' |
| 278 | } | 348 | } |
| 279 | } | 349 | } |
| 280 | }); | 350 | }); |
src/main/resources/static/real_control_v2/js/data/json/north_toolbar.json
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| @@ -102,6 +102,8 @@ var gb_schedule_table = (function () { | @@ -102,6 +102,8 @@ var gb_schedule_table = (function () { | ||
| 102 | gb_schedule_table_dbclick.init(); | 102 | gb_schedule_table_dbclick.init(); |
| 103 | //双击实发 | 103 | //双击实发 |
| 104 | gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell')); | 104 | gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell')); |
| 105 | + //搜索框初始化 | ||
| 106 | + gb_sch_search.init(); | ||
| 105 | cb && cb(); | 107 | cb && cb(); |
| 106 | }); | 108 | }); |
| 107 | }; | 109 | }; |
src/main/resources/static/real_control_v2/js/main.js
| @@ -35,8 +35,6 @@ var gb_main_ep = new EventProxy(), | @@ -35,8 +35,6 @@ var gb_main_ep = new EventProxy(), | ||
| 35 | //render schedule table | 35 | //render schedule table |
| 36 | eq.once('render-sch-table', function () { | 36 | eq.once('render-sch-table', function () { |
| 37 | gb_schedule_table.show(function () { | 37 | gb_schedule_table.show(function () { |
| 38 | - //搜索框 | ||
| 39 | - gb_sch_search.init(); | ||
| 40 | //加载信号状态 | 38 | //加载信号状态 |
| 41 | gb_signal_state.init(); | 39 | gb_signal_state.init(); |
| 42 | }); | 40 | }); |
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js