Commit 20a5c6da6ebb0e730d58f609e730b15e99482304

Authored by 徐烜
1 parent a0469a02

Update

src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html
@@ -31,76 +31,160 @@ @@ -31,76 +31,160 @@
31 <div class="portlet-title"> 31 <div class="portlet-title">
32 <div class="caption"> 32 <div class="caption">
33 <i class="icon-equalizer font-red-sunglo"></i> <span 33 <i class="icon-equalizer font-red-sunglo"></i> <span
34 - class="caption-subject font-red-sunglo bold uppercase" >批量信息修改</span> 34 + class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title1"></span>
35 </div> 35 </div>
36 </div> 36 </div>
37 37
38 <div class="portlet-body form"> 38 <div class="portlet-body form">
39 <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> 39 <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
40 <div class="form-body"> 40 <div class="form-body">
41 -  
42 - <div class="form-group">  
43 - <label class="col-md-3 control-label">方向:</label>  
44 - <div class="col-md-5">  
45 - <sa-Radiogroup model="ctrl.tt.xlDir" dicgroup="LineTrend" name="xlDir"></sa-Radiogroup> 41 + <div class="form-group has-success has-feedback">
  42 + <label class="col-md-2 control-label">线路*:</label>
  43 + <div class="col-md-3">
  44 + <input type="text" class="form-control"
  45 + ng-value="ctrl.xlname"
  46 + readonly/>
46 </div> 47 </div>
47 48
48 </div> 49 </div>
49 - <div class="form-group">  
50 - <label class="col-md-3 control-label">起点站:</label>  
51 - <div class="col-md-5">  
52 - <sa-Select5 name="qdz"  
53 - model="ctrl.tt"  
54 - cmaps="{'qdz.id' : 'stationid'}"  
55 - dcname="qdz.id"  
56 - icname="stationid"  
57 - dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}"  
58 - iterobjname="item"  
59 - iterobjexp="item.stationname"  
60 - searchph="请输拼音..."  
61 - searchexp="this.stationname"  
62 - >  
63 - </sa-Select5> 50 + <div class="form-group has-success has-feedback">
  51 + <label class="col-md-2 control-label">时刻表名称*:</label>
  52 + <div class="col-md-3">
  53 + <input type="text" class="form-control"
  54 + ng-value="ctrl.ttname"
  55 + readonly/>
64 </div> 56 </div>
65 </div> 57 </div>
66 - <div class="form-group">  
67 - <label class="col-md-3 control-label">终点站:</label>  
68 - <div class="col-md-5">  
69 - <sa-Select5 name="zdz"  
70 - model="ctrl.tt"  
71 - cmaps="{'zdz.id' : 'stationid'}"  
72 - dcname="zdz.id"  
73 - icname="stationid"  
74 - dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}"  
75 - iterobjname="item"  
76 - iterobjexp="item.stationname"  
77 - searchph="请输拼音..."  
78 - searchexp="this.stationname"  
79 - >  
80 - </sa-Select5> 58 +
  59 + <div class="form-group" ng-if="ctrl.isZdModify == true">
  60 + <label class="col-md-2 control-label">方向:</label>
  61 + <div class="col-md-3">
  62 + <sa-Radiogroup model="ctrl.tt.xlDir" dicgroup="LineTrend" name="xlDir"></sa-Radiogroup>
81 </div> 63 </div>
  64 +
82 </div> 65 </div>
83 - <div class="form-group">  
84 - <label class="col-md-3 control-label">停车场:</label>  
85 - <div class="col-md-5">  
86 - <sa-Select5 name="tcc"  
87 - model="ctrl.tt"  
88 - cmaps="{'tcc.id': 'id'}"  
89 - dcname="tcc.id"  
90 - icname="id"  
91 - dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'tcc' } | json }}"  
92 - iterobjname="item"  
93 - iterobjexp="item.parkName"  
94 - searchph="请输拼音..."  
95 - searchexp="this.parkName"  
96 - >  
97 - </sa-Select5> 66 +
  67 + <div ng-if="ctrl.isZdModify == true">
  68 +
  69 + <!--- 出场班次判定 -->
  70 + <div class="form-group"
  71 + ng-if="ctrl.tt.bcType == 'out'">
  72 + <label class="col-md-2 control-label">停车场:</label>
  73 + <div class="col-md-3">
  74 + <sa-Select5 name="tcc"
  75 + model="ctrl.tt"
  76 + cmaps="{'tcc.id': 'id'}"
  77 + dcname="tcc.id"
  78 + icname="id"
  79 + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'tcc' } | json }}"
  80 + iterobjname="item"
  81 + iterobjexp="item.parkName"
  82 + searchph="请输拼音..."
  83 + searchexp="this.parkName"
  84 + >
  85 + </sa-Select5>
  86 + </div>
  87 + </div>
  88 + <div class="form-group"
  89 + ng-if="ctrl.tt.bcType == 'out'">
  90 + <label class="col-md-2 control-label">终点站:</label>
  91 + <div class="col-md-3">
  92 + <sa-Select5 name="zdz"
  93 + model="ctrl.tt"
  94 + cmaps="{'zdz.id' : 'stationid'}"
  95 + dcname="zdz.id"
  96 + icname="stationid"
  97 + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}"
  98 + iterobjname="item"
  99 + iterobjexp="item.stationname"
  100 + searchph="请输拼音..."
  101 + searchexp="this.stationname"
  102 + >
  103 + </sa-Select5>
  104 + </div>
  105 + </div>
  106 +
  107 + <!--- 进场班次判定 -->
  108 + <div class="form-group"
  109 + ng-if="ctrl.tt.bcType == 'in'">
  110 + <label class="col-md-2 control-label">起点站:</label>
  111 + <div class="col-md-3">
  112 + <sa-Select5 name="qdz"
  113 + model="ctrl.tt"
  114 + cmaps="{'qdz.id' : 'stationid'}"
  115 + dcname="qdz.id"
  116 + icname="stationid"
  117 + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}"
  118 + iterobjname="item"
  119 + iterobjexp="item.stationname"
  120 + searchph="请输拼音..."
  121 + searchexp="this.stationname"
  122 + >
  123 + </sa-Select5>
  124 + </div>
  125 + </div>
  126 + <div class="form-group"
  127 + ng-if="ctrl.tt.bcType == 'in'">
  128 + <label class="col-md-2 control-label">停车场:</label>
  129 + <div class="col-md-3">
  130 + <sa-Select5 name="tcc"
  131 + model="ctrl.tt"
  132 + cmaps="{'tcc.id': 'id'}"
  133 + dcname="tcc.id"
  134 + icname="id"
  135 + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'tcc' } | json }}"
  136 + iterobjname="item"
  137 + iterobjexp="item.parkName"
  138 + searchph="请输拼音..."
  139 + searchexp="this.parkName"
  140 + >
  141 + </sa-Select5>
  142 + </div>
  143 + </div>
  144 +
  145 + <!-- 其他班次类型 -->
  146 + <div class="form-group"
  147 + ng-if="ctrl.tt.bcType != 'in' && ctrl.tt.bcType != 'out'">
  148 + <label class="col-md-2 control-label">起点站:</label>
  149 + <div class="col-md-3">
  150 + <sa-Select5 name="qdz"
  151 + model="ctrl.tt"
  152 + cmaps="{'qdz.id' : 'stationid'}"
  153 + dcname="qdz.id"
  154 + icname="stationid"
  155 + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}"
  156 + iterobjname="item"
  157 + iterobjexp="item.stationname"
  158 + searchph="请输拼音..."
  159 + searchexp="this.stationname"
  160 + >
  161 + </sa-Select5>
  162 + </div>
  163 + </div>
  164 + <div class="form-group"
  165 + ng-if="ctrl.tt.bcType != 'in' && ctrl.tt.bcType != 'out'">
  166 + <label class="col-md-2 control-label">终点站:</label>
  167 + <div class="col-md-3">
  168 + <sa-Select5 name="zdz"
  169 + model="ctrl.tt"
  170 + cmaps="{'zdz.id' : 'stationid'}"
  171 + dcname="zdz.id"
  172 + icname="stationid"
  173 + dsparams="{{ {type: 'ajax', param:{'xlid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd' } | json }}"
  174 + iterobjname="item"
  175 + iterobjexp="item.stationname"
  176 + searchph="请输拼音..."
  177 + searchexp="this.stationname"
  178 + >
  179 + </sa-Select5>
  180 + </div>
98 </div> 181 </div>
  182 +
99 </div> 183 </div>
100 184
101 <div class="form-group"> 185 <div class="form-group">
102 - <label class="col-md-3 control-label">发车时间:</label>  
103 - <div class="col-md-5"> 186 + <label class="col-md-2 control-label">发车时间:</label>
  187 + <div class="col-md-3">
104 <input type="text" class="form-control" name="fcsj" 188 <input type="text" class="form-control" name="fcsj"
105 ng-model="ctrl.tt.fcsj" 189 ng-model="ctrl.tt.fcsj"
106 ng-pattern="ctrl.time_regex" 190 ng-pattern="ctrl.time_regex"
@@ -113,8 +197,8 @@ @@ -113,8 +197,8 @@
113 197
114 </div> 198 </div>
115 <div class="form-group"> 199 <div class="form-group">
116 - <label class="col-md-3 control-label">计划里程:</label>  
117 - <div class="col-md-5"> 200 + <label class="col-md-2 control-label">计划里程:</label>
  201 + <div class="col-md-3">
118 <input type="text" class="form-control" name="jhlc" 202 <input type="text" class="form-control" name="jhlc"
119 ng-model="ctrl.tt.jhlc" 203 ng-model="ctrl.tt.jhlc"
120 ng-pattern="ctrl.float_regex" 204 ng-pattern="ctrl.float_regex"
@@ -127,8 +211,8 @@ @@ -127,8 +211,8 @@
127 211
128 </div> 212 </div>
129 <div class="form-group"> 213 <div class="form-group">
130 - <label class="col-md-3 control-label">班次历时:</label>  
131 - <div class="col-md-5"> 214 + <label class="col-md-2 control-label">班次历时:</label>
  215 + <div class="col-md-3">
132 <input type="text" class="form-control" name="bcsj" 216 <input type="text" class="form-control" name="bcsj"
133 ng-model="ctrl.tt.bcsj" 217 ng-model="ctrl.tt.bcsj"
134 ng-pattern="ctrl.number_regex" 218 ng-pattern="ctrl.number_regex"
@@ -140,9 +224,10 @@ @@ -140,9 +224,10 @@
140 </div> 224 </div>
141 225
142 </div> 226 </div>
143 - <div class="form-group">  
144 - <label class="col-md-3 control-label">班次类型:</label>  
145 - <div class="col-md-5"> 227 + <div class="form-group"
  228 + ng-if="ctrl.isZdModify == true">
  229 + <label class="col-md-2 control-label">班次类型:</label>
  230 + <div class="col-md-3">
146 <sa-Select5 name="bcType" 231 <sa-Select5 name="bcType"
147 model="ctrl.tt" 232 model="ctrl.tt"
148 cmaps="{'bcType': 'code'}" 233 cmaps="{'bcType': 'code'}"
@@ -159,6 +244,14 @@ @@ -159,6 +244,14 @@
159 244
160 </div> 245 </div>
161 246
  247 + <div class="form-group has-success has-feedback">
  248 + <label class="col-md-2 control-label">开始分班:</label>
  249 + <div class="col-md-3">
  250 + <sa-Radiogroup model="ctrl.tt.isFB" dicgroup="truefalseType" name="isFB"></sa-Radiogroup>
  251 + </div>
  252 +
  253 + </div>
  254 +
162 </div> 255 </div>
163 256
164 <div class="form-actions"> 257 <div class="form-actions">
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
@@ -184,6 +184,7 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -184,6 +184,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
184 ttinfodetailIds[index].qdz = value.qdz || undefined; 184 ttinfodetailIds[index].qdz = value.qdz || undefined;
185 ttinfodetailIds[index].zdz = value.zdz || undefined; 185 ttinfodetailIds[index].zdz = value.zdz || undefined;
186 ttinfodetailIds[index].tcc = value.tcc || undefined; 186 ttinfodetailIds[index].tcc = value.tcc || undefined;
  187 + ttinfodetailIds[index].isfb = value.isFB || undefined;
187 188
188 ttinfodetailIds[index].validInfo(); 189 ttinfodetailIds[index].validInfo();
189 190
@@ -585,10 +586,16 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -585,10 +586,16 @@ angular.module(&#39;ScheduleApp&#39;).controller(
585 '$stateParams', 586 '$stateParams',
586 '$state', 587 '$state',
587 function(service, $stateParams, $state) { 588 function(service, $stateParams, $state) {
588 - // TODO:  
589 -  
590 var self = this; 589 var self = this;
591 - var TTInfoDetail = service.getQueryClass(); 590 + // 获取传过来的id,有的话就是修改,获取一遍数据
  591 + self.xlid = $stateParams.xlid; // 获取传过来的线路id
  592 + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id
  593 + self.xlname = $stateParams.xlname; // 获取传过来的线路名字
  594 + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字
  595 +
  596 + self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息 批量修改班次信息";
  597 +
  598 + //var TTInfoDetail = service.getQueryClass();
592 599
593 // 时间正则表达式(格式hh:mm,如:06:39) 600 // 时间正则表达式(格式hh:mm,如:06:39)
594 self.time_regex = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/; 601 self.time_regex = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/;
@@ -599,11 +606,14 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -599,11 +606,14 @@ angular.module(&#39;ScheduleApp&#39;).controller(
599 606
600 // 欲保存的busInfo信息,绑定 607 // 欲保存的busInfo信息,绑定
601 //self.tt = new TTInfoDetail; 608 //self.tt = new TTInfoDetail;
  609 +
602 self.tt = { 610 self.tt = {
603 xlDir: undefined, 611 xlDir: undefined,
604 tcc: {id: undefined}, 612 tcc: {id: undefined},
605 qdz: {id: undefined}, 613 qdz: {id: undefined},
606 zdz: {id: undefined}, 614 zdz: {id: undefined},
  615 + bcType: undefined,
  616 + isFB: undefined,
607 reSetTTinfoDetail: function(value) { 617 reSetTTinfoDetail: function(value) {
608 for (var key in this) { 618 for (var key in this) {
609 if (!angular.isFunction(this[key])) { 619 if (!angular.isFunction(this[key])) {
@@ -611,7 +621,7 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -611,7 +621,7 @@ angular.module(&#39;ScheduleApp&#39;).controller(
611 if (this[key].id) { 621 if (this[key].id) {
612 value[key] = this[key]; 622 value[key] = this[key];
613 } 623 }
614 - } else if (this[key]) { 624 + } else if (this[key] != undefined) {
615 value[key] = this[key]; 625 value[key] = this[key];
616 } 626 }
617 } 627 }
@@ -619,13 +629,32 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -619,13 +629,32 @@ angular.module(&#39;ScheduleApp&#39;).controller(
619 } 629 }
620 }; 630 };
621 631
622 - // 获取传过来的id,有的话就是修改,获取一遍数据  
623 - self.xlid = $stateParams.xlid; // 获取传过来的线路id  
624 - self.ttid = $stateParams.ttid; // 获取传过来的时刻表id  
625 - self.xlname = $stateParams.xlname; // 获取传过来的线路名字  
626 - self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 632 + // 修正self.tt
627 633
628 - self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; 634 + self.isZdModify = false; // 是否可以修改站点(如果不是同一圈的数据是不能修改站点的)
  635 + var colIndexs_maps = {};
  636 + var detailInfos = service.getEditInfo().detailInfos;
  637 + for (var i = 0; i < detailInfos.length; i++) {
  638 + for (var j = 0; j < detailInfos[i].length; j++) {
  639 + if (detailInfos[i][j].canDelete()) {
  640 + colIndexs_maps[j] = j;
  641 + }
  642 + }
  643 + }
  644 + var colIndexs = [];
  645 + for (var kk in colIndexs_maps) {
  646 + colIndexs.push(kk);
  647 + }
  648 + if (colIndexs.length == 1) {
  649 + self.isZdModify = true;
  650 + var columnBcInfo = service.getEditInfo().columnBcInfo[colIndexs[0]];
  651 +
  652 + self.tt.xlDir = columnBcInfo.xldir;
  653 + self.tt.bcType = columnBcInfo.bc_type;
  654 + self.tt.qdz.id = columnBcInfo.qdz;
  655 + self.tt.zdz.id = columnBcInfo.zdz;
  656 + self.tt.tcc.id = columnBcInfo.tcc;
  657 + }
629 658
630 // 提交方法 659 // 提交方法
631 self.submit = function() { 660 self.submit = function() {
@@ -646,6 +675,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -646,6 +675,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
646 // }); 675 // });
647 //}); 676 //});
648 677
  678 + console.log(self.tt);
  679 +
649 service.editInfos(self.tt).then(function() { 680 service.editInfos(self.tt).then(function() {
650 $state.go("ttInfoDetailManage_edit3", { 681 $state.go("ttInfoDetailManage_edit3", {
651 xlid: self.xlid, 682 xlid: self.xlid,