Commit 410452758f4f1ce7e8e582340355f45fd9a8e8a2
1 parent
563a5cbb
update
Showing
20 changed files
with
936 additions
and
36 deletions
src/main/java/com/bsth/controller/realcontrol/OilStationSocietyController.java
0 → 100644
| 1 | +package com.bsth.controller.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.controller.BaseController; | |
| 4 | +import com.bsth.entity.realcontrol.OilStationSociety; | |
| 5 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 6 | +import org.springframework.web.bind.annotation.RestController; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * Created by panzhao on 2017/3/16. | |
| 10 | + */ | |
| 11 | +@RestController | |
| 12 | +@RequestMapping("/oilStation") | |
| 13 | +public class OilStationSocietyController extends BaseController<OilStationSociety, String>{ | |
| 14 | +} | ... | ... |
src/main/java/com/bsth/controller/realcontrol/dto/LpData.java
| ... | ... | @@ -22,7 +22,7 @@ public class LpData { |
| 22 | 22 | this.zdzName = sch.getZdzName(); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - public void appendTo(ScheduleRealInfo sch, int type, boolean changeRealTime) { | |
| 25 | + public void appendTo(ScheduleRealInfo sch, int type) { | |
| 26 | 26 | |
| 27 | 27 | if (type == 0) { |
| 28 | 28 | //只换人 |
| ... | ... | @@ -33,11 +33,11 @@ public class LpData { |
| 33 | 33 | } else if (type == 1) { |
| 34 | 34 | //只换车 |
| 35 | 35 | sch.setClZbh(this.nbbm); |
| 36 | - | |
| 37 | - //换实际时间 | |
| 36 | + changeRealTime(sch); | |
| 37 | + /*//换实际时间 | |
| 38 | 38 | if(changeRealTime){ |
| 39 | 39 | changeRealTime(sch); |
| 40 | - } | |
| 40 | + }*/ | |
| 41 | 41 | |
| 42 | 42 | } else if (type == 2) { |
| 43 | 43 | //换人并换车 |
| ... | ... | @@ -48,9 +48,9 @@ public class LpData { |
| 48 | 48 | sch.setClZbh(this.nbbm); |
| 49 | 49 | |
| 50 | 50 | //换实际时间 |
| 51 | - if(changeRealTime){ | |
| 51 | + //if(changeRealTime){ | |
| 52 | 52 | changeRealTime(sch); |
| 53 | - } | |
| 53 | + //} | |
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | ... | ... |
src/main/java/com/bsth/entity/realcontrol/OilStationSociety.java
0 → 100644
| 1 | +package com.bsth.entity.realcontrol; | |
| 2 | + | |
| 3 | +import javax.persistence.Entity; | |
| 4 | +import javax.persistence.Id; | |
| 5 | +import javax.persistence.Table; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 社会加油站 | |
| 9 | + * Created by panzhao on 2017/3/16. | |
| 10 | + */ | |
| 11 | +@Entity | |
| 12 | +@Table(name = "bsth_c_oil_station") | |
| 13 | +public class OilStationSociety { | |
| 14 | + | |
| 15 | + @Id | |
| 16 | + private String lineCode; | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * 加油站名称 | |
| 20 | + */ | |
| 21 | + private String stationName; | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * 上行进场距离 | |
| 25 | + */ | |
| 26 | + private Double upInMile; | |
| 27 | + /** | |
| 28 | + * 上行出场距离 | |
| 29 | + */ | |
| 30 | + private Double upOutMile; | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 下行进场距离 | |
| 34 | + */ | |
| 35 | + private Double downInMile; | |
| 36 | + /** | |
| 37 | + * 下行出场距离 | |
| 38 | + */ | |
| 39 | + private Double downOutMile; | |
| 40 | + | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 上行进场时间 分钟 | |
| 44 | + */ | |
| 45 | + private int upInTime; | |
| 46 | + /** | |
| 47 | + * 上行出场时间 分钟 | |
| 48 | + */ | |
| 49 | + private int upOutTime; | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * 下行进场时间 分钟 | |
| 53 | + */ | |
| 54 | + private int downInTime; | |
| 55 | + /** | |
| 56 | + * 下行出场时间 分钟 | |
| 57 | + */ | |
| 58 | + private int downOutTime; | |
| 59 | + | |
| 60 | + | |
| 61 | + public String getLineCode() { | |
| 62 | + return lineCode; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public void setLineCode(String lineCode) { | |
| 66 | + this.lineCode = lineCode; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public String getStationName() { | |
| 70 | + return stationName; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public void setStationName(String stationName) { | |
| 74 | + this.stationName = stationName; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public Double getUpInMile() { | |
| 78 | + return upInMile; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public void setUpInMile(Double upInMile) { | |
| 82 | + this.upInMile = upInMile; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public Double getUpOutMile() { | |
| 86 | + return upOutMile; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public void setUpOutMile(Double upOutMile) { | |
| 90 | + this.upOutMile = upOutMile; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public Double getDownInMile() { | |
| 94 | + return downInMile; | |
| 95 | + } | |
| 96 | + | |
| 97 | + public void setDownInMile(Double downInMile) { | |
| 98 | + this.downInMile = downInMile; | |
| 99 | + } | |
| 100 | + | |
| 101 | + public Double getDownOutMile() { | |
| 102 | + return downOutMile; | |
| 103 | + } | |
| 104 | + | |
| 105 | + public void setDownOutMile(Double downOutMile) { | |
| 106 | + this.downOutMile = downOutMile; | |
| 107 | + } | |
| 108 | + | |
| 109 | + public int getUpInTime() { | |
| 110 | + return upInTime; | |
| 111 | + } | |
| 112 | + | |
| 113 | + public void setUpInTime(int upInTime) { | |
| 114 | + this.upInTime = upInTime; | |
| 115 | + } | |
| 116 | + | |
| 117 | + public int getUpOutTime() { | |
| 118 | + return upOutTime; | |
| 119 | + } | |
| 120 | + | |
| 121 | + public void setUpOutTime(int upOutTime) { | |
| 122 | + this.upOutTime = upOutTime; | |
| 123 | + } | |
| 124 | + | |
| 125 | + public int getDownInTime() { | |
| 126 | + return downInTime; | |
| 127 | + } | |
| 128 | + | |
| 129 | + public void setDownInTime(int downInTime) { | |
| 130 | + this.downInTime = downInTime; | |
| 131 | + } | |
| 132 | + | |
| 133 | + public int getDownOutTime() { | |
| 134 | + return downOutTime; | |
| 135 | + } | |
| 136 | + | |
| 137 | + public void setDownOutTime(int downOutTime) { | |
| 138 | + this.downOutTime = downOutTime; | |
| 139 | + } | |
| 140 | +} | ... | ... |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| ... | ... | @@ -626,6 +626,11 @@ public class ScheduleRealInfo { |
| 626 | 626 | } |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | + @Override | |
| 630 | + public int hashCode() { | |
| 631 | + return ("schedule_" + this.id).hashCode(); | |
| 632 | + } | |
| 633 | + | |
| 629 | 634 | public String getQdzArrDateJH() { |
| 630 | 635 | return qdzArrDatejh; |
| 631 | 636 | } |
| ... | ... | @@ -760,6 +765,7 @@ public class ScheduleRealInfo { |
| 760 | 765 | } |
| 761 | 766 | |
| 762 | 767 | public void destroy(){ |
| 768 | + this.jhlc = 0.0; | |
| 763 | 769 | this.status = -1; |
| 764 | 770 | } |
| 765 | 771 | ... | ... |
src/main/java/com/bsth/repository/realcontrol/OilStationSocietyRepository.java
0 → 100644
| 1 | +package com.bsth.repository.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.entity.realcontrol.OilStationSociety; | |
| 4 | +import com.bsth.repository.BaseRepository; | |
| 5 | +import org.springframework.stereotype.Repository; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * Created by panzhao on 2017/3/16. | |
| 9 | + */ | |
| 10 | +@Repository | |
| 11 | +public interface OilStationSocietyRepository extends BaseRepository<OilStationSociety, String>{ | |
| 12 | +} | ... | ... |
src/main/java/com/bsth/service/realcontrol/OilStationSocietyService.java
0 → 100644
| 1 | +package com.bsth.service.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.entity.realcontrol.OilStationSociety; | |
| 4 | +import com.bsth.service.BaseService; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * Created by panzhao on 2017/3/16. | |
| 8 | + */ | |
| 9 | +public interface OilStationSocietyService extends BaseService<OilStationSociety, String> { | |
| 10 | +} | ... | ... |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| ... | ... | @@ -156,7 +156,7 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L |
| 156 | 156 | |
| 157 | 157 | Map<String,Object> lpChangeMulti(String leftIdx, String rightIdx, int type); |
| 158 | 158 | |
| 159 | - void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type, boolean changeRealTime); | |
| 159 | + void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type); | |
| 160 | 160 | |
| 161 | 161 | Map<String,Object> revokeRealArrive(Long id); |
| 162 | 162 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
| ... | ... | @@ -9,6 +9,7 @@ import com.bsth.repository.realcontrol.ChildTaskPlanRepository; |
| 9 | 9 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 10 | 10 | import com.bsth.service.impl.BaseServiceImpl; |
| 11 | 11 | import com.bsth.service.realcontrol.ChildTaskPlanService; |
| 12 | +import org.apache.commons.lang3.StringUtils; | |
| 12 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | 14 | import org.springframework.jdbc.core.JdbcTemplate; |
| 14 | 15 | import org.springframework.stereotype.Service; |
| ... | ... | @@ -45,8 +46,11 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon |
| 45 | 46 | //保存起终点名称 |
| 46 | 47 | String prefix = sch.getXlBm() + "_" + sch.getXlDir() + "_"; |
| 47 | 48 | |
| 48 | - t.setStartStationName(BasicData.getStationNameByCode(t.getStartStation(), prefix)); | |
| 49 | - t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix)); | |
| 49 | + if(StringUtils.isEmpty(t.getStartStationName())) | |
| 50 | + t.setStartStationName(BasicData.getStationNameByCode(t.getStartStation(), prefix)); | |
| 51 | + | |
| 52 | + if(StringUtils.isEmpty(t.getEndStationName())) | |
| 53 | + t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix)); | |
| 50 | 54 | //先持久化子任务 |
| 51 | 55 | rs = super.save(t); |
| 52 | 56 | //再关联主任务 | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/OilStationSocietyServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.realcontrol.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.realcontrol.OilStationSociety; | |
| 4 | +import com.bsth.service.impl.BaseServiceImpl; | |
| 5 | +import com.bsth.service.realcontrol.OilStationSocietyService; | |
| 6 | +import org.springframework.stereotype.Service; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * Created by panzhao on 2017/3/16. | |
| 10 | + */ | |
| 11 | +@Service | |
| 12 | +public class OilStationSocietyServiceImpl extends BaseServiceImpl<OilStationSociety, String> implements OilStationSocietyService { | |
| 13 | +} | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -854,6 +854,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 854 | 854 | } else { |
| 855 | 855 | sch.setStatus(0); |
| 856 | 856 | sch.setRemarks("");//清空备注 |
| 857 | + sch.setJhlc(sch.getJhlcOrig()); | |
| 857 | 858 | rs.put("status", ResponseCode.SUCCESS); |
| 858 | 859 | rs.put("t", sch); |
| 859 | 860 | |
| ... | ... | @@ -1058,9 +1059,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1058 | 1059 | |
| 1059 | 1060 | //修改班次里程 |
| 1060 | 1061 | String jhlc = map.get("jhlc"); |
| 1061 | - if (StringUtils.isNotEmpty(jhlc) | |
| 1062 | - /*&& Double.parseDouble(jhlc) != sch.getJhlc()*/) { | |
| 1063 | - sch.setJhlc(Double.parseDouble(jhlc)); | |
| 1062 | + if (StringUtils.isNotEmpty(jhlc)) { | |
| 1063 | + if(Double.parseDouble(jhlc) == 0) | |
| 1064 | + destroy(sch.getId() + "", "", map.get("adjustExps").toString()); | |
| 1065 | + else | |
| 1066 | + sch.setJhlc(Double.parseDouble(jhlc)); | |
| 1064 | 1067 | } |
| 1065 | 1068 | } |
| 1066 | 1069 | |
| ... | ... | @@ -3609,17 +3612,21 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3609 | 3612 | } |
| 3610 | 3613 | |
| 3611 | 3614 | ScheduleRealInfo leftSch, rightSch = null; |
| 3612 | - boolean changeRealTime = true; | |
| 3613 | 3615 | for (int i = 0; i < largeList.size(); i++) { |
| 3614 | 3616 | leftSch = largeList.get(i); |
| 3615 | 3617 | if (i < smallList.size()) { |
| 3616 | 3618 | rightSch = smallList.get(i); |
| 3617 | 3619 | ts.add(rightSch); |
| 3618 | - } else | |
| 3619 | - changeRealTime = false; | |
| 3620 | + } else{ | |
| 3621 | + //不对称时多出来的 | |
| 3622 | + lpChangeByLeft(leftSch, largeList.get(i - 1), type); | |
| 3623 | + ts.add(leftSch); | |
| 3624 | + cars.add(leftSch.getClZbh()); | |
| 3625 | + continue; | |
| 3626 | + } | |
| 3620 | 3627 | |
| 3621 | 3628 | //调换路牌 |
| 3622 | - lpChange(leftSch, rightSch, type, changeRealTime); | |
| 3629 | + lpChange(leftSch, rightSch, type); | |
| 3623 | 3630 | ts.add(leftSch); |
| 3624 | 3631 | |
| 3625 | 3632 | cars.add(leftSch.getClZbh()); |
| ... | ... | @@ -3655,19 +3662,38 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3655 | 3662 | } |
| 3656 | 3663 | |
| 3657 | 3664 | @Override |
| 3658 | - public void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type, boolean changeRealTime) { | |
| 3665 | + public void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) { | |
| 3659 | 3666 | LpData leftData = new LpData(leftSch); |
| 3660 | 3667 | LpData rightData = new LpData(rightSch); |
| 3661 | 3668 | |
| 3662 | - leftData.appendTo(rightSch, type, changeRealTime); | |
| 3663 | - rightData.appendTo(leftSch, type, changeRealTime); | |
| 3669 | + leftData.appendTo(rightSch, type); | |
| 3670 | + rightData.appendTo(leftSch, type); | |
| 3671 | + | |
| 3672 | + if(type > 0){ | |
| 3673 | + //更新车辆和班次映射信息 | |
| 3674 | + dayOfSchedule.removeNbbm2SchMapp(leftSch, leftData.getNbbm()); | |
| 3675 | + dayOfSchedule.removeNbbm2SchMapp(rightSch, rightData.getNbbm()); | |
| 3676 | + | |
| 3677 | + dayOfSchedule.addNbbm2SchMapp(leftSch, rightData.getNbbm()); | |
| 3678 | + dayOfSchedule.addNbbm2SchMapp(rightSch, leftData.getNbbm()); | |
| 3679 | + } | |
| 3680 | + } | |
| 3681 | + | |
| 3682 | + /** | |
| 3683 | + * 更换左边班次的路牌,右边不变 | |
| 3684 | + * @param leftSch | |
| 3685 | + * @param rightSch | |
| 3686 | + * @param type | |
| 3687 | + */ | |
| 3688 | + public void lpChangeByLeft(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) { | |
| 3689 | + LpData rightData = new LpData(rightSch); | |
| 3664 | 3690 | |
| 3665 | - //更新车辆和班次映射信息 | |
| 3666 | - dayOfSchedule.removeNbbm2SchMapp(leftSch, leftData.getNbbm()); | |
| 3667 | - dayOfSchedule.removeNbbm2SchMapp(rightSch, rightData.getNbbm()); | |
| 3691 | + rightData.appendTo(leftSch, type); | |
| 3668 | 3692 | |
| 3669 | - dayOfSchedule.addNbbm2SchMapp(leftSch, rightData.getNbbm()); | |
| 3670 | - dayOfSchedule.addNbbm2SchMapp(rightSch, leftData.getNbbm()); | |
| 3693 | + if(type > 0){ | |
| 3694 | + //更新车辆和班次映射信息 | |
| 3695 | + dayOfSchedule.addNbbm2SchMapp(leftSch, rightData.getNbbm()); | |
| 3696 | + } | |
| 3671 | 3697 | } |
| 3672 | 3698 | |
| 3673 | 3699 | @Override | ... | ... |
src/main/resources/static/real_control_v2/css/line_schedule.css
| ... | ... | @@ -239,7 +239,7 @@ |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | .schedule-body .ct_table dl:nth-child(even){ |
| 242 | - background: rgba(249, 249, 249, 0.31); | |
| 242 | + background: rgba(101, 204, 220, 0.13); | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | span.fcsj-diff { |
| ... | ... | @@ -532,7 +532,7 @@ div.drop-rail[data-type="car"]:before { |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | dl.relevance-active dd:nth-child(n+2) { |
| 535 | - background: #c1e2f9 !important; | |
| 535 | + background: #d2d2d2 !important; | |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | dl.relevance-active.intimity dd:nth-child(n+2) { | ... | ... |
src/main/resources/static/real_control_v2/css/main.css
| ... | ... | @@ -863,4 +863,40 @@ svg rect.offline{ |
| 863 | 863 | color: white; |
| 864 | 864 | box-shadow: 0px 4px 6px 0 rgba(0, 0, 0, 0.2), 0px 4px 10px 0 rgba(0, 0, 0, 0.19); |
| 865 | 865 | border-radius: 1px 1px 4px 4px; |
| 866 | +} | |
| 867 | + | |
| 868 | +#oil_station-modal.ct-form-modal form.uk-form-horizontal .uk-form-label{ | |
| 869 | + width: 120px; | |
| 870 | +} | |
| 871 | + | |
| 872 | +#oil_station-modal.ct-form-modal form.uk-form-horizontal .uk-form-controls{ | |
| 873 | + margin-left: 125px; | |
| 874 | +} | |
| 875 | + | |
| 876 | +#oil_station-modal .uk-form-icon>[class*=uk-icon-]{ | |
| 877 | + right: 23px; | |
| 878 | +} | |
| 879 | + | |
| 880 | +#oil_station-modal .uk-form-icon:not(.uk-form-icon-flip)>input{ | |
| 881 | + padding-left: 10px !important; | |
| 882 | +} | |
| 883 | + | |
| 884 | +#oil_station-modal .uk-form-icon{ | |
| 885 | + width: calc(100% - 145px); | |
| 886 | +} | |
| 887 | + | |
| 888 | +#oil_station-modal .uk-icon-mile:before{ | |
| 889 | + content: '公里'; | |
| 890 | +} | |
| 891 | + | |
| 892 | +#oil_station-modal .uk-icon-minute:before{ | |
| 893 | + content: '分钟'; | |
| 894 | +} | |
| 895 | + | |
| 896 | +option.oil_station_opt{ | |
| 897 | + color: red; | |
| 898 | +} | |
| 899 | + | |
| 900 | +#oil_station-modal .uk-modal .uk-form.fv-form{ | |
| 901 | + margin-bottom: 0 !important; | |
| 866 | 902 | } |
| 867 | 903 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
| ... | ... | @@ -197,7 +197,7 @@ |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | //里程有修改 |
| 200 | - if(data.jhlc != sch.jhlc){ | |
| 200 | + if(data.jhlc != sch.jhlc && data.jhlc != 0){ | |
| 201 | 201 | var confHtml = '<h4 style="color: #c04c4c;margin-bottom: 9px;">确认要将班次里程由'+sch.jhlc+' 修改为'+data.jhlc+' </h4><small>备注:</small>'; |
| 202 | 202 | UIkit.modal.prompt(confHtml, data.remarks, function(remarks){ |
| 203 | 203 | if(remarks){ | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
| ... | ... | @@ -267,7 +267,7 @@ |
| 267 | 267 | } |
| 268 | 268 | }); |
| 269 | 269 | //公里与主任务不符合 |
| 270 | - if (sum != sch.jhlc) { | |
| 270 | + if (sum != sch.jhlcOrig) { | |
| 271 | 271 | if (i > 1) |
| 272 | 272 | calcs += ('=' + sum); |
| 273 | 273 | calcs += (' ≠ ' + sch.jhlc); |
| ... | ... | @@ -320,6 +320,11 @@ |
| 320 | 320 | var sch = getActiveSch(); |
| 321 | 321 | if (!sch) |
| 322 | 322 | return notify_err('无法获取到主任务信息!'); |
| 323 | + | |
| 324 | + if(sch.bcType == 'out' || sch.bcType == 'in'){ | |
| 325 | + notify_err('暂不能在进出场班次上做回场子任务!'); | |
| 326 | + return; | |
| 327 | + } | |
| 323 | 328 | open_modal(folder + '/sub_task/add_sub_task_inpark.html', { |
| 324 | 329 | sch: sch |
| 325 | 330 | }, modal_opts); |
| ... | ... | @@ -330,6 +335,10 @@ |
| 330 | 335 | var sch = getActiveSch(); |
| 331 | 336 | if (!sch) |
| 332 | 337 | return notify_err('无法获取到主任务信息!'); |
| 338 | + if(sch.bcType == 'out' || sch.bcType == 'in'){ | |
| 339 | + notify_err('暂不能在进出场班次上做出场子任务!'); | |
| 340 | + return; | |
| 341 | + } | |
| 333 | 342 | open_modal(folder + '/sub_task/add_sub_task_outpark.html', { |
| 334 | 343 | sch: sch |
| 335 | 344 | }, modal_opts); |
| ... | ... | @@ -369,6 +378,20 @@ |
| 369 | 378 | }); |
| 370 | 379 | }, '确定删除'); |
| 371 | 380 | }; |
| 381 | + //加油 | |
| 382 | + var add_oil = function () { | |
| 383 | + var sch = getActiveSch(); | |
| 384 | + if (!sch) | |
| 385 | + return notify_err('无法获取到主任务信息!'); | |
| 386 | + | |
| 387 | + if(sch.bcType == 'out' || sch.bcType == 'in'){ | |
| 388 | + notify_err('暂不能在进出场班次上做加油子任务!'); | |
| 389 | + return; | |
| 390 | + } | |
| 391 | + open_modal(folder + '/sub_task/add_sub_task_oil.html', { | |
| 392 | + sch: sch | |
| 393 | + }, modal_opts); | |
| 394 | + }; | |
| 372 | 395 | |
| 373 | 396 | var callbackHandler = { |
| 374 | 397 | add_temp_sch: add_temp_sch, |
| ... | ... | @@ -377,7 +400,8 @@ |
| 377 | 400 | add_sub_task_in: add_sub_task_in, |
| 378 | 401 | remove_sub_task: remove_sub_task, |
| 379 | 402 | add_sub_task_out: add_sub_task_out, |
| 380 | - add_sub_task_range_turn: add_sub_task_range_turn | |
| 403 | + add_sub_task_range_turn: add_sub_task_range_turn, | |
| 404 | + add_oil: add_oil | |
| 381 | 405 | }; |
| 382 | 406 | |
| 383 | 407 | //右键菜单 |
| ... | ... | @@ -394,6 +418,9 @@ |
| 394 | 418 | "add_sub_task": { |
| 395 | 419 | name: "添加子任务", |
| 396 | 420 | items: { |
| 421 | + 'add_oil':{ | |
| 422 | + name: '加油' | |
| 423 | + }, | |
| 397 | 424 | 'add_sub_task_in': { |
| 398 | 425 | name: '回场' |
| 399 | 426 | }, | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_inpark.html
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | </div> |
| 53 | 53 | </div> |
| 54 | 54 | <div class="uk-width-7-10 pl5"> |
| 55 | - <input type="text" name="mileage" required> | |
| 55 | + <input type="number" step="0.01" name="mileage" required> | |
| 56 | 56 | </div> |
| 57 | 57 | </div> |
| 58 | 58 | <div class="uk-grid"> |
| ... | ... | @@ -125,7 +125,7 @@ |
| 125 | 125 | </div> |
| 126 | 126 | </div> |
| 127 | 127 | <div class="uk-width-7-10 pl5"> |
| 128 | - <input type="text" name="mileage" required style="width: calc(100% - 62px);"> | |
| 128 | + <input type="number" step="0.01" name="mileage" required style="width: calc(100% - 62px);"> | |
| 129 | 129 | <a style="font-size: 12px;color: grey;cursor: default;" data-uk-tooltip title="可选择回场路径,设置途径点位。暂不开放" id="inpark_paths_link">路径(<span>0</span>)</a> |
| 130 | 130 | </div> |
| 131 | 131 | </div> |
| ... | ... | @@ -190,7 +190,7 @@ |
| 190 | 190 | </div> |
| 191 | 191 | </div> |
| 192 | 192 | <div class="uk-width-7-10 pl5"> |
| 193 | - <input type="text" name="mileage" required> | |
| 193 | + <input type="number" step="0.01" name="mileage" required> | |
| 194 | 194 | </div> |
| 195 | 195 | </div> |
| 196 | 196 | <div class="uk-grid"> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_oil.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="schedule-addsch_oil-modal"> | |
| 2 | + <div class="uk-modal-dialog" style="width: 1201px;"> | |
| 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 "> | |
| 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"> | |
| 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"> | |
| 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 | + </div> | |
| 153 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 154 | + <span class="bind_gas_station_panel" style="position: absolute;left: 30px;text-decoration: underline;"></span> | |
| 155 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 156 | + <button type="submit" id="submitChildTaskBtn" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 157 | + </div> | |
| 158 | + </div> | |
| 159 | + | |
| 160 | + <script id="schedule-addsch_oil-form-temp" type="text/html"> | |
| 161 | + | |
| 162 | + </script> | |
| 163 | + | |
| 164 | + <script> | |
| 165 | + (function () { | |
| 166 | + var modal = '#schedule-addsch_oil-modal', | |
| 167 | + sch, stationRoutes, parks, oilStation; | |
| 168 | + var yyForm = $('form', modal)[0]; | |
| 169 | + var jcForm = $('form', modal)[1]; | |
| 170 | + var ccForm = $('form', modal)[2]; | |
| 171 | + var oilId; | |
| 172 | + var lineInfo; | |
| 173 | + | |
| 174 | + var folder = '/real_control_v2/fragments/line_schedule/context_menu'; | |
| 175 | + $(modal).on('init', function (e, data) { | |
| 176 | + e.stopPropagation(); | |
| 177 | + sch = data.sch; | |
| 178 | + oilId = sch.xlBm + '_oil_station'; | |
| 179 | + lineInfo = gb_data_basic.codeToLine[sch.xlBm]; | |
| 180 | + | |
| 181 | + //站点路由 | |
| 182 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { | |
| 183 | + return a.stationRouteCode - b.stationRouteCode; | |
| 184 | + }), 'directions'); | |
| 185 | + | |
| 186 | + setDefaultVal(); | |
| 187 | + //停车场 | |
| 188 | + $.get('/basic/parks', function (rs) { | |
| 189 | + parks = rs; | |
| 190 | + var opts = ''; | |
| 191 | + for (var code in parks) { | |
| 192 | + opts += '<option value="' + code + '">' + parks[code] + '</option>'; | |
| 193 | + } | |
| 194 | + $('[name=endStation]', jcForm).html(opts); | |
| 195 | + $('[name=startStation]', ccForm).html(opts); | |
| 196 | + }); | |
| 197 | + | |
| 198 | + //切换空驶起终点 | |
| 199 | + $('[name=endStation]', jcForm).on('change', reCalcIn); | |
| 200 | + $('[name=startStation]', jcForm).on('change', reCalcIn); | |
| 201 | + | |
| 202 | + $('[name=endStation]', ccForm).on('change', reCalcOut); | |
| 203 | + $('[name=startStation]', ccForm).on('change', reCalcOut); | |
| 204 | + //修改开始时间 | |
| 205 | + $('[name=startDate]', jcForm).on('change', reCalcIn); | |
| 206 | + $('[name=startDate]', ccForm).on('change', reCalcOut); | |
| 207 | + | |
| 208 | + //绑定的社会加油站 | |
| 209 | + $.get('/oilStation/'+sch.xlBm, function (rs) { | |
| 210 | + var htmlStr; | |
| 211 | + oilStation = rs; | |
| 212 | + if(oilStation){ | |
| 213 | + htmlStr = '<a><i class="uk-icon-product-hunt"></i> '+oilStation.stationName+'</a>'; | |
| 214 | + | |
| 215 | + var opt = '<option value="'+oilId+'" class="oil_station_opt">'+oilStation.stationName+'</option>'; | |
| 216 | + $('[name=endStation]', jcForm).prepend(opt).val(oilId).change(); | |
| 217 | + $('[name=startStation]', ccForm).prepend(opt).val(oilId).change(); | |
| 218 | + } | |
| 219 | + else | |
| 220 | + htmlStr = '<a>为'+sch.xlName+'绑定一个社会加油站</a>'; | |
| 221 | + | |
| 222 | + $('.bind_gas_station_panel', modal).html(htmlStr); | |
| 223 | + $('.bind_gas_station_panel a', modal).on('click', function () { | |
| 224 | + open_modal(folder + '/sub_task//oil_station.html', { | |
| 225 | + sch: sch | |
| 226 | + }, {center: false, bgclose: false, modal: false}); | |
| 227 | + }); | |
| 228 | + }); | |
| 229 | + }); | |
| 230 | + | |
| 231 | + var dataArray = []; | |
| 232 | + var fs = $('form', modal).formValidation({ | |
| 233 | + framework: 'uikit', | |
| 234 | + locale: 'zh_CN' | |
| 235 | + }); | |
| 236 | + fs.on('success.form.fv', function(e) { | |
| 237 | + e.preventDefault(); | |
| 238 | + if($(this).is(':hidden')) | |
| 239 | + return; | |
| 240 | + dataArray.push($.extend($(this).serializeJSON(), getDisabledVal(this) | |
| 241 | + , {remarks: '加油', 'schedule.id': sch.id})); | |
| 242 | + $(this).data('valid', true); | |
| 243 | + | |
| 244 | + if(allValidSuccess()){ | |
| 245 | + var i = 0; | |
| 246 | + (function () { | |
| 247 | + var f = arguments.callee; | |
| 248 | + if(i >= dataArray.length){ | |
| 249 | + UIkit.modal(modal).hide(); | |
| 250 | + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch}); | |
| 251 | + return; | |
| 252 | + } | |
| 253 | + var data = dataArray[i]; | |
| 254 | + //里程为0的不保存 | |
| 255 | + if(data.mileage==0){ | |
| 256 | + i++; | |
| 257 | + f(); | |
| 258 | + } | |
| 259 | + else{ | |
| 260 | + gb_common.$post('/childTask', data, function (rs) { | |
| 261 | + notify_succ('子任务添加成功'); | |
| 262 | + gb_schedule_table.updateSchedule(rs.t); | |
| 263 | + i++; | |
| 264 | + f(); | |
| 265 | + }); | |
| 266 | + } | |
| 267 | + })(); | |
| 268 | + } | |
| 269 | + }); | |
| 270 | + | |
| 271 | + //校验不过 | |
| 272 | + fs.on('err.field.fv', function () { | |
| 273 | + $('#submitChildTaskBtn', modal).removeClass('disabled').removeAttr('disabled'); | |
| 274 | + }); | |
| 275 | + | |
| 276 | + //submit | |
| 277 | + $('#submitChildTaskBtn', modal).on('click', function () { | |
| 278 | + //空驶的进场终点名称 | |
| 279 | + if(!oilStation || $('[name=endStation]', jcForm).val() != oilId) | |
| 280 | + $('[name=endStationName]', jcForm).val(''); | |
| 281 | + else | |
| 282 | + $('[name=endStationName]', jcForm).val(oilStation.stationName); | |
| 283 | + | |
| 284 | + //空驶的出场起点名称 | |
| 285 | + if(!oilStation || $('[name=startStation]', ccForm).val() != oilId) | |
| 286 | + $('[name=startStationName]', ccForm).val(''); | |
| 287 | + else | |
| 288 | + $('[name=startStationName]', ccForm).val(oilStation.stationName); | |
| 289 | + | |
| 290 | + | |
| 291 | + //提交表单 | |
| 292 | + $(this).addClass('disabled').attr('disabled','disabled'); | |
| 293 | + dataArray = []; | |
| 294 | + fs.data('valid', false); | |
| 295 | + fs.formValidation('validate'); | |
| 296 | + //fs.submit(); | |
| 297 | + }); | |
| 298 | + | |
| 299 | + //获取表单disabled 项的值 | |
| 300 | + function getDisabledVal(f) { | |
| 301 | + var rs = {}; | |
| 302 | + $('input,select', f).each(function () { | |
| 303 | + if($(this).attr('disabled')){ | |
| 304 | + rs[$(this).attr('name')]=$(this).val(); | |
| 305 | + } | |
| 306 | + }); | |
| 307 | + return rs; | |
| 308 | + } | |
| 309 | + | |
| 310 | + function allValidSuccess() { | |
| 311 | + var flag = true; | |
| 312 | + $('form:visible', modal).each(function (i, f) { | |
| 313 | + if(!$(f).data('valid')){ | |
| 314 | + flag = false; | |
| 315 | + return false; | |
| 316 | + } | |
| 317 | + }); | |
| 318 | + return flag; | |
| 319 | + } | |
| 320 | + | |
| 321 | + function setDefaultVal() { | |
| 322 | + //营运班次 | |
| 323 | + $('[name=startStation]', yyForm).val(sch.qdzCode); | |
| 324 | + $('[name=startStationName]', yyForm).val(sch.qdzName); | |
| 325 | + $('[name=endStation]', yyForm).val(sch.zdzCode); | |
| 326 | + $('[name=endStationName]', yyForm).val(sch.zdzName); | |
| 327 | + $('[name=mileage]', yyForm).val(sch.jhlc); | |
| 328 | + $('[name=startDate]', yyForm).val(sch.fcsjActual==null?sch.dfsj:sch.fcsjActual); | |
| 329 | + $('[name=endDate]', yyForm).val(sch.zdsjActual==null?sch.zdsj:sch.zdsjActual); | |
| 330 | + | |
| 331 | + //设置进场默认值 | |
| 332 | + $('[name=startStation]', jcForm).html(createStationOpts(stationRoutes[sch.xlDir])); | |
| 333 | + $('[name=startDate]', jcForm).val(sch.zdsjActual==null?sch.zdsj:sch.zdsjActual); | |
| 334 | + $('[name=startStation]', jcForm).val(sch.zdzCode); | |
| 335 | + | |
| 336 | + //设置出场默认值 | |
| 337 | + $('[name=endStation]', ccForm).html(createStationOpts(stationRoutes[sch.xlDir])); | |
| 338 | + $('[name=endStation]', ccForm).val(sch.zdzCode); | |
| 339 | + } | |
| 340 | + | |
| 341 | + function createStationOpts(list) { | |
| 342 | + var opts = ''; | |
| 343 | + $.each(list, function () { | |
| 344 | + opts += '<option value="'+this.station.stationCod+'">'+this.stationName+'</option>'; | |
| 345 | + }); | |
| 346 | + return opts; | |
| 347 | + } | |
| 348 | + | |
| 349 | + function reCalcIn() { | |
| 350 | + if(!oilStation || $('[name=endStation]', jcForm).val() != oilId) | |
| 351 | + return; | |
| 352 | + | |
| 353 | + var data; | |
| 354 | + var qdz = $('[name=startStation]', jcForm).find("option:selected").text(); | |
| 355 | + if(qdz == lineInfo.startStationName){ | |
| 356 | + //起点进场 | |
| 357 | + data = { | |
| 358 | + mileage: oilStation.upInMile, | |
| 359 | + time: oilStation.upInTime | |
| 360 | + } | |
| 361 | + } | |
| 362 | + else if(qdz == lineInfo.endStationName){ | |
| 363 | + //终点进场 | |
| 364 | + data = { | |
| 365 | + mileage: oilStation.downInMile, | |
| 366 | + time: oilStation.downInTime | |
| 367 | + } | |
| 368 | + } | |
| 369 | + if(!data) | |
| 370 | + return; | |
| 371 | + | |
| 372 | + $('[name=mileage]', jcForm).val(data.mileage); | |
| 373 | + var st = $('[name=startDate]', jcForm).val(); | |
| 374 | + if(!st) | |
| 375 | + return; | |
| 376 | + var ets = moment(st, 'HH:mm').add(data.time, 'minute').format('HH:mm'); | |
| 377 | + $('[name=endDate]', jcForm).val(ets); | |
| 378 | + | |
| 379 | + //出场时间 + 1 分钟 | |
| 380 | + $('[name=startDate]', ccForm).val(moment(ets, 'HH:mm').add(1, 'minute').format('HH:mm')); | |
| 381 | + } | |
| 382 | + | |
| 383 | + function reCalcOut() { | |
| 384 | + if(!oilStation || $('[name=startStation]', ccForm).val() != oilId) | |
| 385 | + return; | |
| 386 | + | |
| 387 | + var data; | |
| 388 | + var zdz = $('[name=endStation]', ccForm).find("option:selected").text(); | |
| 389 | + if(zdz == lineInfo.startStationName){ | |
| 390 | + //出场到起点 | |
| 391 | + data = { | |
| 392 | + mileage: oilStation.upOutMile, | |
| 393 | + time: oilStation.upOutTime | |
| 394 | + } | |
| 395 | + } | |
| 396 | + else if(zdz == lineInfo.endStationName){ | |
| 397 | + //出场到终点 | |
| 398 | + data = { | |
| 399 | + mileage: oilStation.downOutMile, | |
| 400 | + time: oilStation.downOutTime | |
| 401 | + } | |
| 402 | + } | |
| 403 | + if(!data) | |
| 404 | + return; | |
| 405 | + | |
| 406 | + $('[name=mileage]', ccForm).val(data.mileage); | |
| 407 | + var st = $('[name=startDate]', ccForm).val(); | |
| 408 | + if(!st) | |
| 409 | + return; | |
| 410 | + var ets = moment(st, 'HH:mm').add(data.time, 'minute').format('HH:mm'); | |
| 411 | + $('[name=endDate]', ccForm).val(ets); | |
| 412 | + } | |
| 413 | + })(); | |
| 414 | + </script> | |
| 415 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_outpark.html
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | </div> |
| 53 | 53 | </div> |
| 54 | 54 | <div class="uk-width-7-10 pl5"> |
| 55 | - <input type="text" name="mileage" required style="width: calc(100% - 62px);"> | |
| 55 | + <input type="number" step="0.01" name="mileage" required style="width: calc(100% - 62px);"> | |
| 56 | 56 | <a style="font-size: 12px;color: grey;cursor: default;" target="_blank" |
| 57 | 57 | class="linkToLineInfo">线路标准</a> |
| 58 | 58 | </div> |
| ... | ... | @@ -128,7 +128,7 @@ |
| 128 | 128 | </div> |
| 129 | 129 | </div> |
| 130 | 130 | <div class="uk-width-7-10 pl5"> |
| 131 | - <input type="text" name="mileage" disabled> | |
| 131 | + <input type="number" step="0.01" name="mileage" disabled> | |
| 132 | 132 | </div> |
| 133 | 133 | </div> |
| 134 | 134 | <div class="uk-grid"> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_range_turn.html
| ... | ... | @@ -168,7 +168,7 @@ |
| 168 | 168 | </div> |
| 169 | 169 | </div> |
| 170 | 170 | <div class="uk-width-7-10 pl5"> |
| 171 | - <input type="text" name="mileage" value="{{sch.jhlc}}" required> | |
| 171 | + <input type="number" step="0.01" name="mileage" value="{{sch.jhlc}}" required> | |
| 172 | 172 | </div> |
| 173 | 173 | </div> |
| 174 | 174 | <div class="uk-grid"> |
| ... | ... | @@ -237,7 +237,7 @@ |
| 237 | 237 | </div> |
| 238 | 238 | </div> |
| 239 | 239 | <div class="uk-width-7-10 pl5"> |
| 240 | - <input type="text" name="mileage" required> | |
| 240 | + <input type="number" step="0.01" name="mileage" required> | |
| 241 | 241 | </div> |
| 242 | 242 | </div> |
| 243 | 243 | <div class="uk-grid"> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/oil_station.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-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" value="社会加油站" required> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 21 | + <div class="uk-form-row"> | |
| 22 | + <label class="uk-form-label">起点进场里程</label> | |
| 23 | + <div class="uk-form-icon"> | |
| 24 | + <i class="uk-icon-mile"></i> | |
| 25 | + <input type="number" name="upInMile" step="0.01" required> | |
| 26 | + </div> | |
| 27 | + </div> | |
| 28 | + <div class="uk-form-row"> | |
| 29 | + <label class="uk-form-label">终点进场里程</label> | |
| 30 | + <div class="uk-form-icon"> | |
| 31 | + <i class="uk-icon-mile"></i> | |
| 32 | + <input type="number" name="downInMile" step="0.01" required> | |
| 33 | + </div> | |
| 34 | + </div> | |
| 35 | + <div class="uk-form-row"> | |
| 36 | + <label class="uk-form-label">起点进场时间</label> | |
| 37 | + <div class="uk-form-icon"> | |
| 38 | + <i class="uk-icon-minute"></i> | |
| 39 | + <input type="text" name="upInTime" required> | |
| 40 | + </div> | |
| 41 | + </div> | |
| 42 | + <div class="uk-form-row"> | |
| 43 | + <label class="uk-form-label">终点进场时间</label> | |
| 44 | + <div class="uk-form-icon"> | |
| 45 | + <i class="uk-icon-minute"></i> | |
| 46 | + <input type="text" name="downInTime" required> | |
| 47 | + </div> | |
| 48 | + </div> | |
| 49 | + | |
| 50 | + <hr> | |
| 51 | + <div class="uk-form-row"> | |
| 52 | + <label class="uk-form-label">出场到起点里程</label> | |
| 53 | + <div class="uk-form-icon"> | |
| 54 | + <i class="uk-icon-mile"></i> | |
| 55 | + <input type="number" name="upOutMile" step="0.01" required> | |
| 56 | + </div> | |
| 57 | + </div> | |
| 58 | + <div class="uk-form-row"> | |
| 59 | + <label class="uk-form-label">出场到终点里程</label> | |
| 60 | + <div class="uk-form-icon"> | |
| 61 | + <i class="uk-icon-mile"></i> | |
| 62 | + <input type="number" name="downOutMile" step="0.01" required> | |
| 63 | + </div> | |
| 64 | + </div> | |
| 65 | + <div class="uk-form-row"> | |
| 66 | + <label class="uk-form-label">出场到起点时间</label> | |
| 67 | + <div class="uk-form-icon"> | |
| 68 | + <i class="uk-icon-minute"></i> | |
| 69 | + <input type="text" name="upOutTime" required> | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | + <div class="uk-form-row"> | |
| 73 | + <label class="uk-form-label">出场到终点时间</label> | |
| 74 | + <div class="uk-form-icon"> | |
| 75 | + <i class="uk-icon-minute"></i> | |
| 76 | + <input type="text" name="downOutTime" required> | |
| 77 | + </div> | |
| 78 | + </div> | |
| 79 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 80 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 81 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 82 | + </div> | |
| 83 | + </form> | |
| 84 | + </div> | |
| 85 | + | |
| 86 | + <script id="" type="text/html"> | |
| 87 | + | |
| 88 | + </script> | |
| 89 | + | |
| 90 | + <script> | |
| 91 | + (function () { | |
| 92 | + var modal = '#oil_station-modal', | |
| 93 | + sch, oilStation; | |
| 94 | + | |
| 95 | + var cognates = { | |
| 96 | + 'upInMile': 'upOutMile', | |
| 97 | + 'downInMile': 'downOutMile', | |
| 98 | + 'upInTime': 'upOutTime', | |
| 99 | + 'downInTime': 'downOutTime' | |
| 100 | + }; | |
| 101 | + $(modal).on('init', function (e, data) { | |
| 102 | + e.stopPropagation(); | |
| 103 | + sch = data.sch; | |
| 104 | + | |
| 105 | + $.get('/oilStation/'+sch.xlBm, function (rs) { | |
| 106 | + oilStation = rs; | |
| 107 | + setDefaultVal(oilStation); | |
| 108 | + }); | |
| 109 | + | |
| 110 | + $('form [name=qdzName]', modal).val(sch.xlName); | |
| 111 | + $('form [name=lineCode]', modal).val(sch.xlBm); | |
| 112 | + | |
| 113 | + //submit | |
| 114 | + var f = $('form', modal).formValidation(gb_form_validation_opts); | |
| 115 | + f.on('success.form.fv', function(e) { | |
| 116 | + e.preventDefault(); | |
| 117 | + var data = $(this).serializeJSON(); | |
| 118 | + | |
| 119 | + gb_common.$post('/oilStation', data, function (rs) { | |
| 120 | + notify_succ('添加成功!'); | |
| 121 | + UIkit.modal(modal).hide(); | |
| 122 | + $('#schedule-addsch_oil-modal').trigger('init', {sch: sch}); | |
| 123 | + }); | |
| 124 | + }); | |
| 125 | + | |
| 126 | + $('form input', modal).on('input', function () { | |
| 127 | + var name = $(this).attr('name'); | |
| 128 | + if(cognates[name]){ | |
| 129 | + $('form [name='+cognates[name]+']', modal).val($(this).val()); | |
| 130 | + } | |
| 131 | + }); | |
| 132 | + }); | |
| 133 | + | |
| 134 | + function setDefaultVal(obj) { | |
| 135 | + if(!obj) | |
| 136 | + return; | |
| 137 | + $('form input', modal).each(function () { | |
| 138 | + var name = $(this).attr('name'); | |
| 139 | + if(obj[name]) | |
| 140 | + $(this).val(obj[name]); | |
| 141 | + }); | |
| 142 | + } | |
| 143 | + })(); | |
| 144 | + </script> | |
| 145 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
| ... | ... | @@ -144,6 +144,41 @@ var gb_schedule_context_menu = (function () { |
| 144 | 144 | notify_succ('撤销执行成功!'); |
| 145 | 145 | }); |
| 146 | 146 | }, '确认撤销执行'); |
| 147 | + }, | |
| 148 | + | |
| 149 | + add_sub_task_in: function (sch) { | |
| 150 | + if(sch.bcType == 'out' || sch.bcType == 'in'){ | |
| 151 | + notify_err('暂不能在进出场班次上做回场子任务!'); | |
| 152 | + return; | |
| 153 | + } | |
| 154 | + open_modal(folder + '/sub_task/add_sub_task_inpark.html', { | |
| 155 | + sch: sch | |
| 156 | + }, modal_opts); | |
| 157 | + }, | |
| 158 | + add_sub_task_out: function (sch) { | |
| 159 | + if(sch.bcType == 'out' || sch.bcType == 'in'){ | |
| 160 | + notify_err('暂不能在进出场班次上做出场子任务!'); | |
| 161 | + return; | |
| 162 | + } | |
| 163 | + open_modal(folder + '/sub_task/add_sub_task_outpark.html', { | |
| 164 | + sch: sch | |
| 165 | + }, modal_opts); | |
| 166 | + }, | |
| 167 | + add_sub_task_range_turn: function (sch) { | |
| 168 | + if(sch.bcType == 'out' || sch.bcType == 'in') | |
| 169 | + return notify_err('进出场班次不能做区间掉头!'); | |
| 170 | + open_modal(folder + '/sub_task/add_sub_task_range_turn.html', { | |
| 171 | + sch: sch | |
| 172 | + }, modal_opts); | |
| 173 | + }, | |
| 174 | + add_oil: function (sch) { | |
| 175 | + if(sch.bcType == 'out' || sch.bcType == 'in'){ | |
| 176 | + notify_err('暂不能在进出场班次上做加油子任务!'); | |
| 177 | + return; | |
| 178 | + } | |
| 179 | + open_modal(folder + '/sub_task/add_sub_task_oil.html', { | |
| 180 | + sch: sch | |
| 181 | + }, modal_opts); | |
| 147 | 182 | } |
| 148 | 183 | }; |
| 149 | 184 | |
| ... | ... | @@ -185,6 +220,23 @@ var gb_schedule_context_menu = (function () { |
| 185 | 220 | 'lj_zrw': { |
| 186 | 221 | name: '临加/子任务' |
| 187 | 222 | }, |
| 223 | + 'shortcut': { | |
| 224 | + name: '...', | |
| 225 | + items: { | |
| 226 | + 'add_oil': { | |
| 227 | + name: '(子任务)加油' | |
| 228 | + }, | |
| 229 | + 'add_sub_task_in': { | |
| 230 | + name: '(子任务)回场' | |
| 231 | + }, | |
| 232 | + 'add_sub_task_out': { | |
| 233 | + name: '(子任务)出场' | |
| 234 | + }, | |
| 235 | + 'add_sub_task_range_turn': { | |
| 236 | + name: '(子任务)区间调头' | |
| 237 | + } | |
| 238 | + } | |
| 239 | + }, | |
| 188 | 240 | 'sep4': '---------', |
| 189 | 241 | 'tzrc': { |
| 190 | 242 | name: '调整人车' | ... | ... |