Commit fba71acd83e9b6f9301fa2d203332b86c9607ca9

Authored by 潘钊
2 parents c1e6e780 e52331ef

update

Showing 34 changed files with 1238 additions and 1119 deletions
src/main/java/com/bsth/controller/schedule/core/CarConfigInfoController.java
... ... @@ -44,6 +44,7 @@ public class CarConfigInfoController extends BController<CarConfigInfo, Long> {
44 44 try {
45 45 // 车辆重复配置验证
46 46 CarConfigInfo carConfigInfo = new CarConfigInfo(
  47 + param.get("id_eq"),
47 48 param.get("xl.id_eq"),
48 49 param.get("xl.name_eq"),
49 50 param.get("cl.id_eq")
... ...
src/main/java/com/bsth/controller/schedule/core/EmployeeConfigInfoController.java
... ... @@ -44,6 +44,7 @@ public class EmployeeConfigInfoController extends BController<EmployeeConfigInfo
44 44 Map<String, Object> rtn = new HashMap<>();
45 45 try {
46 46 EmployeeConfigInfo employeeConfigInfo = new EmployeeConfigInfo(
  47 + param.get("id_eq"),
47 48 param.get("xl.id_eq"),
48 49 param.get("xl.name_eq"),
49 50 param.get("jsy.id_eq"),
... ... @@ -64,6 +65,7 @@ public class EmployeeConfigInfoController extends BController&lt;EmployeeConfigInfo
64 65 Map<String, Object> rtn = new HashMap<>();
65 66 try {
66 67 EmployeeConfigInfo employeeConfigInfo = new EmployeeConfigInfo(
  68 + param.get("id_eq"),
67 69 param.get("xl.id_eq"),
68 70 param.get("xl.name_eq"),
69 71 null,
... ...
src/main/java/com/bsth/controller/schedule/core/GuideboardInfoController.java
... ... @@ -54,6 +54,7 @@ public class GuideboardInfoController extends BController&lt;GuideboardInfo, Long&gt;
54 54 try {
55 55 // 路牌编号验证
56 56 GuideboardInfo guideboardInfo = new GuideboardInfo(
  57 + param.get("id_eq"),
57 58 param.get("xl.id_eq"),
58 59 param.get("lpNo_eq"),
59 60 null
... ... @@ -73,6 +74,7 @@ public class GuideboardInfoController extends BController&lt;GuideboardInfo, Long&gt;
73 74 try {
74 75 // 路牌名称验证
75 76 GuideboardInfo guideboardInfo = new GuideboardInfo(
  77 + param.get("id_eq"),
76 78 param.get("xl.id_eq"),
77 79 null,
78 80 param.get("lpName_eq")
... ...
src/main/java/com/bsth/entity/schedule/CarConfigInfo.java
... ... @@ -74,7 +74,10 @@ public class CarConfigInfo implements Serializable {
74 74 private Date updateDate;
75 75  
76 76 public CarConfigInfo() {}
77   - public CarConfigInfo(Object xlid, Object xlname, Object clid) {
  77 + public CarConfigInfo(Object id, Object xlid, Object xlname, Object clid) {
  78 + if (id != null) {
  79 + this.id = Long.parseLong(id.toString());
  80 + }
78 81 if (xlid != null && xlname != null) {
79 82 Line line = new Line();
80 83 line.setId(Integer.valueOf(xlid.toString()));
... ...
src/main/java/com/bsth/entity/schedule/EmployeeConfigInfo.java
... ... @@ -71,7 +71,10 @@ public class EmployeeConfigInfo {
71 71  
72 72 public EmployeeConfigInfo() {}
73 73  
74   - public EmployeeConfigInfo(Object xlid, Object xlname, Object jsyid, Object spyid) {
  74 + public EmployeeConfigInfo(Object id, Object xlid, Object xlname, Object jsyid, Object spyid) {
  75 + if (id != null) {
  76 + this.id = Long.parseLong(id.toString());
  77 + }
75 78 if (xlid != null && xlname != null) {
76 79 Line line = new Line();
77 80 line.setId(Integer.valueOf(xlid.toString()));
... ...
src/main/java/com/bsth/entity/schedule/GuideboardInfo.java
... ... @@ -60,7 +60,11 @@ public class GuideboardInfo {
60 60  
61 61 public GuideboardInfo() {}
62 62  
63   - public GuideboardInfo(Object xlid, Object lpNo, Object lpName) {
  63 + public GuideboardInfo(Object id, Object xlid, Object lpNo, Object lpName) {
  64 + if (id != null) {
  65 + this.id = Long.parseLong(id.toString());
  66 + }
  67 +
64 68 Integer xlid_ = xlid == null ? null : Integer.valueOf(xlid.toString());
65 69 Integer lpNo_ = lpNo == null ? null : Integer.valueOf(lpNo.toString());
66 70 String lpName_ = lpName == null ? null : String.valueOf(lpName);
... ... @@ -75,11 +79,11 @@ public class GuideboardInfo {
75 79 this.lpName = lpName_;
76 80 }
77 81  
78   - public GuideboardInfo(Integer xlid, Integer lpNo) {
79   - this(xlid, lpNo, null);
  82 + public GuideboardInfo(Object id, Integer xlid, Integer lpNo) {
  83 + this(id, xlid, lpNo, null);
80 84 }
81   - public GuideboardInfo(Integer xlid, String lpName) {
82   - this(xlid, null, lpName);
  85 + public GuideboardInfo(Object id, Integer xlid, String lpName) {
  86 + this(id, xlid, null, lpName);
83 87 }
84 88  
85 89 public Long getId() {
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -300,13 +300,13 @@ public class FormsServiceImpl implements FormsService {
300 300 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
301 301 Singledata sin = new Singledata();
302 302 sin.setrQ(rq);
303   - sin.setgS(arg0.getString("gs_name").toString());
304   - sin.setxL(arg0.getString("xl_bm").toString());
305   - sin.setClzbh(arg0.getString("cl_zbh").toString());
306   - sin.setJsy(arg0.getString("j_gh").toString());
307   - sin.setjName(arg0.getString("j_name").toString());
308   - sin.setHyl(arg0.getString("YH").toString());
309   - sin.setJzl(arg0.getString("JZL").toString());
  303 + sin.setgS(arg0.getString("gs_name"));
  304 + sin.setxL(arg0.getString("xl_bm"));
  305 + sin.setClzbh(arg0.getString("cl_zbh"));
  306 + sin.setJsy(arg0.getString("j_gh"));
  307 + sin.setjName(arg0.getString("j_name"));
  308 + sin.setHyl(arg0.getString("YH"));
  309 + sin.setJzl(arg0.getString("JZL"));
310 310 // sin.setJzl(arg0.getString(""));//非营业性用油
311 311 sin.setJhjl(arg0.getString("JZL"));
312 312 Map<String, Object> maps = new HashMap<>();
... ... @@ -351,18 +351,25 @@ public class FormsServiceImpl implements FormsService {
351 351 @Override
352 352 public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException {
353 353 Operationservice op = new Operationservice();
354   - op.setXlName(arg0.getString("xl_name").toString());
355   - op.setJzl(arg0.getString("JZL").toString());
356   - op.setXhl(arg0.getString("YH").toString());
357   - Map<String, Object> maps = new HashMap<>();
358   - maps = scheduleRealInfoService.findKMBC1(arg0.getString("j_name"), arg0.getString("cl_zbh"), startDate,
359   - endDate);
360   - op.setXsgl(maps.get("yygl").toString() == null ? "" : maps.get("yygl").toString());
361   - op.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString());
362   - op.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());
  354 + op.setXlName(arg0.getString("xl_name"));
  355 + op.setJzl(arg0.getString("JZL"));
  356 + op.setXhl(arg0.getString("YH"));
  357 + op.setClzbh(arg0.getString("cl_zbh"));
  358 + op.setJname(arg0.getString("j_name"));
  359 +
363 360 return op;
364 361 }
365 362 });
  363 +
  364 + for(int i=0;i<list.size();i++){
  365 + Operationservice o=list.get(i);
  366 + Map<String, Object> maps = new HashMap<>();
  367 + maps = scheduleRealInfoService.findKMBC1(o.getJname(), o.getClzbh(), startDate,
  368 + endDate);
  369 + o.setXsgl(maps.get("yygl").toString() == null ? "" : maps.get("yygl").toString());
  370 + o.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString());
  371 + o.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());
  372 + }
366 373 return list;
367 374 }
368 375  
... ... @@ -388,12 +395,12 @@ public class FormsServiceImpl implements FormsService {
388 395 @Override
389 396 public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException {
390 397 Vehicleloading ve = new Vehicleloading();
391   - ve.setrQ(arg0.getString("schedule_date_str").toString());
392   - ve.setgS(arg0.getString("gs_name").toString());
393   - ve.setxL(arg0.getString("xl_name").toString());
394   - ve.setClzbh(arg0.getString("cl_zbh").toString());
395   - ve.setHyl(arg0.getString("YH").toString());
396   - ve.setJzl(arg0.getString("JZL").toString());
  398 + ve.setrQ(arg0.getString("schedule_date_str"));
  399 + ve.setgS(arg0.getString("gs_name"));
  400 + ve.setxL(arg0.getString("xl_name"));
  401 + ve.setClzbh(arg0.getString("cl_zbh"));
  402 + ve.setHyl(arg0.getString("YH"));
  403 + ve.setJzl(arg0.getString("JZL"));
397 404 // ve.setLs(arg0.getString("").toString());//尿素
398 405 Map<String, Object> maps = new HashMap<>();
399 406 maps = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"),
... ... @@ -613,4 +620,4 @@ public class FormsServiceImpl implements FormsService {
613 620  
614 621 return list;
615 622 }
616   -}
  623 +}
617 624 \ No newline at end of file
... ...
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
... ... @@ -52,14 +52,14 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
52 52 // TODO Auto-generated catch block
53 53 e.printStackTrace();
54 54 }
55   - /*if(map.get("gsdm_in")!=null){
  55 + if(map.get("gsdm_in")!=null){
56 56 map.put("ssgsdm_in", map.get("gsdm_in"));
57 57 map.remove("gsdm_in");
58 58  
59 59 }else{
60 60 map.put("ssgsdm_like", map.get("gsdm_like"));
61 61 map.remove("gsdm_like");
62   - }*/
  62 + }
63 63  
64 64 //根具条件查询指定日期Ylb的数据
65 65 List<Ylb> ylbIterator=(List<Ylb>) ylbRepository.findAll(new CustomerSpecs<Ylb>(map));
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -1115,7 +1115,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1115 1115 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
1116 1116 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
1117 1117 int jhbc = 0,cjbc = 0,ljbc = 0;
1118   - double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0;
  1118 + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0,jcclc=0;
1119 1119 float addMileage = 0l,remMileage = 0l;
1120 1120 Map<String,Object> map = new HashMap<String, Object>();
1121 1121 for(ScheduleRealInfo scheduleRealInfo : list){
... ... @@ -1141,8 +1141,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1141 1141 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
1142 1142 //计算营运里程,空驶里程
1143 1143 if(childTaskPlans.isEmpty()){
1144   - if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
1145   - || scheduleRealInfo.getBcType().equals("venting")){
  1144 + if(scheduleRealInfo.getBcType().equals("in") ||
  1145 + scheduleRealInfo.getBcType().equals("out")){
  1146 + ksgl += tempJhlc;
  1147 + jcclc +=tempJhlc;
  1148 + }else if(scheduleRealInfo.getBcType().equals("venting")){
1146 1149 ksgl += tempJhlc;
1147 1150 }else{
1148 1151 if(scheduleRealInfo.getStatus() != -1){
... ... @@ -1177,6 +1180,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1177 1180 map.put("cjbc", cjbc);
1178 1181 map.put("ljbc", ljbc);
1179 1182 map.put("sjbc", jhbc-cjbc+ljbc);
  1183 + map.put("jcclc", jcclc);
1180 1184 return map;
1181 1185 }
1182 1186  
... ...
src/main/resources/application-dev.properties
... ... @@ -6,7 +6,7 @@ spring.jpa.hibernate.ddl-auto= update
6 6 spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
7 7 #DATABASE
8 8 spring.jpa.database= MYSQL
9   -spring.jpa.show-sql= false
  9 +spring.jpa.show-sql= true
10 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11 11 spring.datasource.url= jdbc:mysql://192.168.168.201/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 12 spring.datasource.username= root
... ...
src/main/resources/static/pages/base/line/js/line-add-form.js
... ... @@ -94,7 +94,7 @@ $(function(){
94 94 $('#endStationEndTimeInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
95 95  
96 96 /** get请求获取公司表数据并填充公司下拉框选择值 */
97   - $get('/business/all', {upCode_eq: '77'}, function(array){
  97 + $get('/business/all', {upCode_eq: '88'}, function(array){
98 98  
99 99 /** 公司下拉options属性值 */
100 100 var options = '<option value="">-- 请选择公司 --</option>';
... ...
src/main/resources/static/pages/base/line/js/line-details-info.js
... ... @@ -47,7 +47,7 @@ $(function(){
47 47 function selectTemp(callback) {
48 48  
49 49 // 填充公司下拉框选择值
50   - $.get('/business/all', {upCode_eq: '77'}, function(array){
  50 + $.get('/business/all', {upCode_eq: '88'}, function(array){
51 51  
52 52 // 公司下拉options属性值
53 53 var options = '<option value="">-- 请选择公司 --</option>';
... ...
src/main/resources/static/pages/base/line/js/line-edit-form.js
... ... @@ -42,7 +42,7 @@
42 42 function selectTemp(callback) {
43 43  
44 44 // 填充公司下拉框选择值
45   - $.get('/business/all', {upCode_eq: '77'}, function(array){
  45 + $.get('/business/all', {upCode_eq: '88'}, function(array){
46 46  
47 47 // 公司下拉options属性值
48 48 var options = '<option value="">-- 请选择公司 --</option>';
... ...
src/main/resources/static/pages/base/line/js/line-list-table.js
... ... @@ -202,7 +202,7 @@
202 202 }
203 203  
204 204 /** 填充公司下拉框选择值 */
205   - $get('/business/all', {upCode_eq: '77'}, function(array){
  205 + $get('/business/all', {upCode_eq: '88'}, function(array){
206 206  
207 207 // 公司下拉options属性值
208 208 var options = '<option value="">请选择...</option>';
... ...
src/main/resources/static/pages/forms/statement/operationservice.html
... ... @@ -112,7 +112,6 @@
112 112 text : result[code]
113 113 });
114 114 }
115   - console.log(data);
116 115 initPinYinSelect2('#line', data, '');
117 116  
118 117 })
... ... @@ -199,7 +198,6 @@
199 198 obj.updateDate = moment(obj.startDate).format(
200 199 "YYYY-MM-DD HH:mm:ss");
201 200 });
202   - console.log(result);
203 201 var operationservice = template('operationservice', {
204 202 list : result
205 203 });
... ...
src/main/resources/static/pages/forms/statement/waybill.html
... ... @@ -338,8 +338,8 @@
338 338 <td>{{remMileage}}</td>
339 339 <td colspan="2">临加公里</td>
340 340 <td>{{addMileage}}</td>
341   - <td colspan="2">营运公里</td>
342   - <td colspan="3">{{yygl}}</td>
  341 + <td colspan="3">营运公里</td>
  342 + <td colspan="2">{{yygl}}</td>
343 343 </tr>
344 344 <tr>
345 345 <td colspan="2">空驶公里</td>
... ... @@ -348,8 +348,8 @@
348 348 <td>{{realMileage}}</td>
349 349 <td colspan="2">计划班次</td>
350 350 <td>{{jhbc}}</td>
351   - <td colspan="2">烂班班次</td>
352   - <td colspan="3">{{cjbc}}</td>
  351 + <td colspan="3">烂班班次</td>
  352 + <td colspan="2">{{cjbc}}</td>
353 353 </tr>
354 354 <tr>
355 355 <td colspan="2">增加班次</td>
... ... @@ -358,8 +358,8 @@
358 358 <td>{{sjbc}}</td>
359 359 <td colspan="2"></td>
360 360 <td></td>
361   - <td colspan="2"></td>
362 361 <td colspan="3"></td>
  362 + <td colspan="2"></td>
363 363 </tr>
364 364 </script>
365 365 <script type="text/html" id="ludan_4">
... ...
src/main/resources/static/pages/forms/statement/waybillQp.html
... ... @@ -334,32 +334,38 @@
334 334 <tr>
335 335 <td colspan="2">计划公里</td>
336 336 <td>{{jhlc}}</td>
  337 + <td colspan="2">营运公里</td>
  338 + <td >{{yygl}}</td>
337 339 <td colspan="2">烂班公里</td>
338 340 <td>{{remMileage}}</td>
339   - <td colspan="2">临加公里</td>
340   - <td>{{addMileage}}</td>
341   - <td colspan="2">营运公里</td>
342   - <td colspan="3">{{yygl}}</td>
  341 + <td colspan="3">空驶公里</td>
  342 + <td colspan="2">{{ksgl}}</td>
  343 +
  344 +
343 345 </tr>
344 346 <tr>
345   - <td colspan="2">空驶公里</td>
346   - <td>{{ksgl}}</td>
347   - <td colspan="2">总公里</td>
348   - <td>{{realMileage}}</td>
349 347 <td colspan="2">计划班次</td>
350 348 <td>{{jhbc}}</td>
351   - <td colspan="2">烂班班次</td>
352   - <td colspan="3">{{cjbc}}</td>
  349 +
  350 + <td colspan="2">进出场公里</td>
  351 + <td>{{jcclc}}</td>
  352 + <td colspan="2">临加公里</td>
  353 + <td>{{addMileage}}</td>
  354 + <td colspan="3">烂班班次</td>
  355 + <td colspan="2">{{cjbc}}</td>
  356 +
353 357 </tr>
354 358 <tr>
355   - <td colspan="2">增加班次</td>
356   - <td>{{ljbc}}</td>
  359 +
357 360 <td colspan="2">实际班次</td>
358 361 <td>{{sjbc}}</td>
359   - <td colspan="2"></td>
360   - <td></td>
361   - <td colspan="2"></td>
  362 + <td colspan="2">总公里</td>
  363 + <td>{{realMileage}}</td>
  364 + <td colspan="2">临加班次</td>
  365 + <td>{{ljbc}}</td>
  366 +
362 367 <td colspan="3"></td>
  368 + <td colspan="2"></td>
363 369 </tr>
364 370 </script>
365 371 <script type="text/html" id="ludan_4">
... ...
src/main/resources/static/pages/oil/checkJyryList.html
... ... @@ -75,10 +75,10 @@
75 75 <input type="text" id="yyrq" class="form-control form-filter input-sm" name="yyrq">
76 76 </td>
77 77 <td>
78   -<!-- <select class="form-control" name="gsdm_like" id="jyryListGsdmId" ></select> -->
  78 + <select class="form-control" name="gsdm_like" id="jyryListGsdmId" ></select>
79 79 </td>
80 80 <td>
81   -<!-- <select class="form-control" name="fgsdm_like" id="jyryListFgsdmId" ></select> -->
  81 + <select class="form-control" name="fgsdm_like" id="jyryListFgsdmId" ></select>
82 82 </td>
83 83 <td>
84 84 </td>
... ... @@ -166,7 +166,19 @@ $(function(){
166 166 params['jsy']=jsy;
167 167 params['id']=id;
168 168 $get('/ylxxb/check', params, function(){
169   - jsDoQuery(null,true);
  169 + var cells = $('tr.filter')[0].cells
  170 + ,params1 = {}
  171 + ,name;
  172 + $.each(cells, function(i, cell){
  173 + var items = $('input,select', cell);
  174 + for(var j = 0, item; item = items[j++];){
  175 + name = $(item).attr('name');
  176 + if(name){
  177 + params1[name] = $(item).val();
  178 + }
  179 + }
  180 + });
  181 + jsDoQuery(params1,true);
170 182 });
171 183 }
172 184 })
... ... @@ -186,21 +198,22 @@ $(function(){
186 198 // jsDoQuery(null, true);
187 199 });
188 200  
189   - var gsqx="";
190   - var fgsqx="";
  201 +// var gsqx="";
  202 +// var fgsqx="";
191 203  
192 204 $.get('/user/companyData', function(result){
193 205 obj = result;
194   - var options = '<option value="">请选择</option>';
  206 + var options = '';
  207 +// '<option value="">请选择</option>';
195 208 for(var i = 0; i < obj.length; i++){
196 209 options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
197   - setFgsqx(obj[i].companyCode);
198   - gsqx +=obj[i].companyCode+",";
  210 +// setFgsqx(obj[i].companyCode);
  211 +// gsqx +=obj[i].companyCode+",";
199 212 }
200 213 $('#jyryListGsdmId').html(options);
201 214 updateCompany();
202 215 });
203   - function setFgsqx(gs){
  216 + /* function setFgsqx(gs){
204 217 var company =gs
205 218 var options = '';
206 219 for(var i = 0; i < obj.length; i++){
... ... @@ -211,11 +224,12 @@ $(function(){
211 224 }
212 225 }
213 226 }
214   - }
  227 + } */
215 228 $("#jyryListGsdmId").on("change",updateCompany);
216 229 function updateCompany(){
217 230 var company = $('#jyryListGsdmId').val();
218   - var options = '<option value="">请选择</option>';
  231 + var options = '';
  232 +// '<option value="">请选择</option>';
219 233 for(var i = 0; i < obj.length; i++){
220 234 if(obj[i].companyCode == company){
221 235 var children = obj[i].children;
... ... @@ -230,7 +244,13 @@ $(function(){
230 244  
231 245 //提交
232 246 $('tr.filter .filter-submit').on('click', function(){
233   - if($("#yyrq").val()!=""){
  247 + var jyryGsdm=$("#jyryListGsdmId").val();
  248 + var jyryFgsdm=$("#jyryListFgsdmId").val();
  249 + if($("#yyrq").val()==""||$("#yyrq").val()==null ){
  250 + layer.msg('请选择日期.');
  251 + }else if(jyryGsdm=="" || jyryGsdm==null ||jyryFgsdm==""||jyryFgsdm==null){
  252 + layer.msg('请选择公司和分公司.');
  253 + }else{
234 254 var cells = $('tr.filter')[0].cells
235 255 ,params = {}
236 256 ,name;
... ... @@ -245,8 +265,6 @@ $(function(){
245 265 });
246 266 page = 0;
247 267 jsDoQuery(params, true);
248   - }else{
249   - layer.msg('请选择日期.');
250 268 }
251 269 });
252 270  
... ... @@ -283,7 +301,7 @@ $(function(){
283 301 }
284 302 params['fgsdm_in']=fgsqx1;
285 303 }
286   - } */
  304 + } */
287 305  
288 306 $get('/ylxxb/pagequery' ,params, function(data){
289 307 $.each(data.dataList, function(i, obj) {
... ... @@ -296,7 +314,7 @@ $(function(){
296 314 if(pagination && data.dataList.length > 0){
297 315 //重新分页
298 316 initPagination = true;
299   - showPagination(data);
  317 + //showPagination(data);
300 318 }
301 319 layer.close(i);
302 320 });
... ... @@ -355,54 +373,49 @@ $(function(){
355 373 });
356 374  
357 375  
358   -});
359   -//改变状态
360   -function changeEnabled(id,enabled){
361   - debugger
362   - $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){
363   - jsDoQuery(null, true);
364   - })
365   -}
366 376  
367   -//改变状态
368   -function startOptJsy(id){
369   - $('#jsy'+id).select2({
370   - placeholder: '搜索驾驶员...',
371   - ajax: {
372   - url: '/personnel/sreachPersonnel',
373   - dataType: 'json',
374   - delay: 150,
375   - data: function(params){
376   - return{jobCode: params.term};
  377 + //改变状态
  378 + function startOptJsy(id){
  379 + $('#jsy'+id).select2({
  380 + placeholder: '搜索驾驶员...',
  381 + ajax: {
  382 + url: '/personnel/sreachPersonnel',
  383 + dataType: 'json',
  384 + delay: 150,
  385 + data: function(params){
  386 + return{jobCode: params.term};
  387 + },
  388 + processResults: function (data) {
  389 + return {
  390 + results: data
  391 + };
  392 + },
  393 + cache: true
377 394 },
378   - processResults: function (data) {
379   - return {
380   - results: data
381   - };
382   - },
383   - cache: true
384   - },
385   - templateResult: function(repo){
386   - if (repo.loading) return repo.text;
387   - var h = '<span>'+repo.text+'</span>';
388   - return h;
389   - },
390   - escapeMarkup: function (markup) { return markup; },
391   - minimumInputLength: 1,
392   - templateSelection: function(repo){
393   - return repo.text;
394   - },
395   - language: {
396   - noResults: function(){
397   - return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>';
398   - },
399   - inputTooShort : function(e) {
400   - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>';
401   - },
402   - searching : function() {
403   - return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>';
404   - }
405   - }
406   - })
407   -}
  395 + templateResult: function(repo){
  396 + if (repo.loading) return repo.text;
  397 + var h = '<span>'+repo.text+'</span>';
  398 + return h;
  399 + },
  400 + escapeMarkup: function (markup) { return markup; },
  401 + minimumInputLength: 1,
  402 + templateSelection: function(repo){
  403 + return repo.text;
  404 + },
  405 + language: {
  406 + noResults: function(){
  407 + return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>';
  408 + },
  409 + inputTooShort : function(e) {
  410 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>';
  411 + },
  412 + searching : function() {
  413 + return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>';
  414 + }
  415 + }
  416 + })
  417 + }
  418 +
  419 +});
  420 +
408 421 </script>
409 422 \ No newline at end of file
... ...
src/main/resources/static/pages/oil/cylList.html
... ... @@ -141,23 +141,24 @@ $(function(){
141 141 increaseArea: '20%'
142 142 }
143 143  
144   - var gsqx="";
145   - var fgsqx="";
  144 +// var gsqx="";
  145 +// var fgsqx="";
146 146  
147 147 $.get('/user/companyData', function(result){
148 148 obj = result;
149   - var options = '<option value="">请选择</option>';
  149 + var options = '';
  150 +// '<option value="">请选择</option>';
150 151 for(var i = 0; i < obj.length; i++){
151 152 options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
152   - setFgsqx(obj[i].companyCode);
153   - gsqx +=obj[i].companyCode+",";
  153 +// setFgsqx(obj[i].companyCode);
  154 +// gsqx +=obj[i].companyCode+",";
154 155 }
155 156 $('#cylListGsdmId').html(options);
156 157 updateCompany();
157   - jsDoQuery(null,true);
  158 +// jsDoQuery(null,true);
158 159 });
159 160  
160   - function setFgsqx(gs){
  161 + /* function setFgsqx(gs){
161 162 var company =gs
162 163 var options = '';
163 164 for(var i = 0; i < obj.length; i++){
... ... @@ -168,12 +169,13 @@ $(function(){
168 169 }
169 170 }
170 171 }
171   - }
  172 + } */
172 173  
173 174 $("#cylListGsdmId").on("change",updateCompany);
174 175 function updateCompany(){
175 176 var company = $('#cylListGsdmId').val();
176   - var options = '<option value="">请选择</option>';
  177 + var options = '';
  178 +// '<option value="">请选择</option>';
177 179 for(var i = 0; i < obj.length; i++){
178 180 if(obj[i].companyCode == company){
179 181 var children = obj[i].children;
... ... @@ -188,25 +190,31 @@ $(function(){
188 190 //重置
189 191 $('tr.filter .filter-cancel').on('click', function(){
190 192 $('tr.filter input, select').val('').change();
191   - jsDoQuery(null, true);
  193 +// jsDoQuery(null, true);
192 194 });
193 195  
194 196 //提交
195 197 $('tr.filter .filter-submit').on('click', function(){
196   - var cells = $('tr.filter')[0].cells
197   - ,params = {}
198   - ,name;
199   - $.each(cells, function(i, cell){
200   - var items = $('input,select', cell);
201   - for(var j = 0, item; item = items[j++];){
202   - name = $(item).attr('name');
203   - if(name){
204   - params[name] = $(item).val();
  198 + var cylGsdm=$("#cylListGsdmId").val();
  199 + var cylFgsdm=$("#cylListFgsdmId").val();
  200 + if(cylGsdm=="" ||cylGsdm ==null ||cylFgsdm=="" ||cylFgsdm ==null){
  201 + layer.msg("请选择公司和分公司");
  202 + }else{
  203 + var cells = $('tr.filter')[0].cells
  204 + ,params = {}
  205 + ,name;
  206 + $.each(cells, function(i, cell){
  207 + var items = $('input,select', cell);
  208 + for(var j = 0, item; item = items[j++];){
  209 + name = $(item).attr('name');
  210 + if(name){
  211 + params[name] = $(item).val();
  212 + }
205 213 }
206   - }
207   - });
208   - page = 0;
209   - jsDoQuery(params, true);
  214 + });
  215 + page = 0;
  216 + jsDoQuery(params, true);
  217 + }
210 218 });
211 219  
212 220  
... ... @@ -222,7 +230,7 @@ $(function(){
222 230 params['order'] = 'nbbm';
223 231 params['page'] = page;
224 232 var i = 2;
225   - var cylGsdm=$("#cylListGsdmId").val();
  233 + /* var cylGsdm=$("#cylListGsdmId").val();
226 234 var cylFgsdm=$("#cylListFgsdmId").val();
227 235 if(cylGsdm==''|| cylGsdm==null){
228 236 params['gsdm_in']=gsqx;
... ... @@ -240,8 +248,7 @@ $(function(){
240 248 }
241 249 params['fgsdm_in']=fgsqx1;
242 250 }
243   - }
244   - console.log(params);
  251 + } */
245 252 $get('/cyl' ,params, function(data){
246 253 $.each(data.content, function(i, obj) {
247 254 obj.updatetime = moment(obj.updatetime).format("YYYY-MM-DD");
... ...
src/main/resources/static/pages/oil/jyglList.html
... ... @@ -202,39 +202,25 @@ $(function(){
202 202 //重置
203 203 $('tr.filter .filter-cancel').on('click', function(){
204 204 $('tr.filter input, select').val('').change();
205   - if($("#rq").val()!=""){
206   - var cells = $('tr.filter')[0].cells
207   - ,params = {}
208   - ,name;
209   - $.each(cells, function(i, cell){
210   - var items = $('input,select', cell);
211   - for(var j = 0, item; item = items[j++];){
212   - name = $(item).attr('name');
213   - if(name){
214   - params[name] = $(item).val();
215   - }
216   - }
217   - });
218   - jsDoQuery(params, true);
219   - }
220 205 });
221 206  
222 207  
223   - var gsqx="";
224   - var fgsqx="";
  208 +// var gsqx="";
  209 +// var fgsqx="";
225 210  
226 211 $.get('/user/companyData', function(result){
227 212 obj = result;
228   - var options = '<option value="">请选择</option>';
  213 + var options = '';
  214 +// '<option value="">请选择</option>';
229 215 for(var i = 0; i < obj.length; i++){
230 216 options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
231   - setFgsqx(obj[i].companyCode);
232   - gsqx +=obj[i].companyCode+",";
  217 +// setFgsqx(obj[i].companyCode);
  218 +// gsqx +=obj[i].companyCode+",";
233 219 }
234 220 $('#jyglListGsdmId').html(options);
235 221 updateCompany();
236 222 });
237   - function setFgsqx(gs){
  223 + /* function setFgsqx(gs){
238 224 var company =gs
239 225 var options = '';
240 226 for(var i = 0; i < obj.length; i++){
... ... @@ -245,11 +231,12 @@ $(function(){
245 231 }
246 232 }
247 233 }
248   - }
  234 + } */
249 235 $("#jyglListGsdmId").on("change",updateCompany);
250 236 function updateCompany(){
251 237 var company = $('#jyglListGsdmId').val();
252   - var options = '<option value="">请选择</option>';
  238 + var options = '';
  239 +// '<option value="">请选择</option>';
253 240 for(var i = 0; i < obj.length; i++){
254 241 if(obj[i].companyCode == company){
255 242 var children = obj[i].children;
... ... @@ -262,7 +249,13 @@ $(function(){
262 249 }
263 250 //提交
264 251 $('tr.filter .filter-submit').on('click', function(){
265   - if($("#rq").val()!=""){
  252 + var jyglGsdm=$("#jyglListGsdmId").val();
  253 + var jyglFgsdm=$("#jyglListFgsdmId").val();
  254 + if($("#rq").val()==""||$("#rq").val()==null){
  255 + layer.msg('请选择日期.');
  256 + }else if(jyglGsdm=="" || jyglGsdm==null || jyglFgsdm=="" || jyglFgsdm==null){
  257 + layer.msg('请选择公司和分公司.');
  258 + }else{
266 259 var cells = $('tr.filter')[0].cells
267 260 ,params = {}
268 261 ,name;
... ... @@ -277,8 +270,6 @@ $(function(){
277 270 });
278 271 page = 0;
279 272 jsDoQuery(params, true);
280   - }else{
281   - layer.msg('请选择日期.');
282 273 }
283 274 });
284 275  
... ... @@ -296,7 +287,7 @@ $(function(){
296 287 params['rq']=$("#rq").val();
297 288  
298 289 var i = 2;
299   - var jyglGsdm=$("#jyglListGsdmId").val();
  290 + /* var jyglGsdm=$("#jyglListGsdmId").val();
300 291 var jyglFgsdm=$("#jyglListFgsdmId").val();
301 292 if(jyglGsdm=="" || jyglGsdm==null){
302 293 params['gsdm_in']=gsqx;
... ... @@ -314,7 +305,7 @@ $(function(){
314 305 }
315 306 params['fgsdm_in']=fgsqx1;
316 307 }
317   - }
  308 + } */
318 309 $get('/cwjy/pagequery' ,params, function(data){
319 310 $.each(data.dataList, function(i, obj) {
320 311 obj.yyrq = $("#rq").val();
... ...
src/main/resources/static/pages/oil/jyszList.html
... ... @@ -127,22 +127,23 @@ $(function(){
127 127 checkboxClass: 'icheckbox_flat-blue',
128 128 increaseArea: '20%'
129 129 }
130   - var gsqx="";
131   - var fgsqx="";
  130 +// var gsqx="";
  131 +// var fgsqx="";
132 132 $.get('/user/companyData', function(result){
133 133 obj = result;
134   - var options = '<option value="">请选择</option>';
  134 + var options = '';
  135 +// '<option value="">请选择</option>';
135 136 for(var i = 0; i < obj.length; i++){
136 137 options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
137   - setFgsqx(obj[i].companyCode);
138   - gsqx +=obj[i].companyCode+",";
  138 +// setFgsqx(obj[i].companyCode);
  139 +// gsqx +=obj[i].companyCode+",";
139 140 }
140 141 $('#jyszListGsdmId').html(options);
141 142 updateCompany();
142   - jsDoQuery(null,true);
  143 +// jsDoQuery(null,true);
143 144 });
144 145  
145   - function setFgsqx(gs){
  146 + /* function setFgsqx(gs){
146 147 var company =gs
147 148 for(var i = 0; i < obj.length; i++){
148 149 if(obj[i].companyCode == company){
... ... @@ -152,7 +153,7 @@ $(function(){
152 153 }
153 154 }
154 155 }
155   - }
  156 + } */
156 157 $("#jyszListGsdmId").on("change",updateCompany);
157 158 function updateCompany(){
158 159 var company = $('#jyszListGsdmId').val();
... ... @@ -160,7 +161,7 @@ $(function(){
160 161 for(var i = 0; i < obj.length; i++){
161 162 if(obj[i].companyCode == company){
162 163 var children = obj[i].children;
163   - options += '<option value="">请选择</option>';
  164 +// options += '<option value="">请选择</option>';
164 165 for(var j = 0; j < children.length; j++){
165 166 options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
166 167 }
... ... @@ -173,25 +174,31 @@ $(function(){
173 174 //重置
174 175 $('tr.filter .filter-cancel').on('click', function(){
175 176 $('tr.filter input, select').val('').change();
176   - jsDoQuery(null, true);
  177 + //jsDoQuery(null, true);
177 178 });
178 179  
179 180 //提交
180 181 $('tr.filter .filter-submit').on('click', function(){
181   - var cells = $('tr.filter')[0].cells
182   - ,params = {}
183   - ,name;
184   - $.each(cells, function(i, cell){
185   - var items = $('input,select', cell);
186   - for(var j = 0, item; item = items[j++];){
187   - name = $(item).attr('name');
188   - if(name){
189   - params[name] = $(item).val();
  182 + var jyszGsdm=$("#jyszListGsdmId").val();
  183 + var jyszFgsdm=$("#jyszListFgsdmId").val();
  184 + if(jyszGsdm=="" || jyszGsdm==null ||jyszFgsdm==""||jyszFgsdm==null){
  185 + layer.msg('请选择公司和分公司.');
  186 + }else{
  187 + var cells = $('tr.filter')[0].cells
  188 + ,params = {}
  189 + ,name;
  190 + $.each(cells, function(i, cell){
  191 + var items = $('input,select', cell);
  192 + for(var j = 0, item; item = items[j++];){
  193 + name = $(item).attr('name');
  194 + if(name){
  195 + params[name] = $(item).val();
  196 + }
190 197 }
191   - }
192   - });
193   - page = 0;
194   - jsDoQuery(params, true);
  198 + });
  199 + page = 0;
  200 + jsDoQuery(params, true);
  201 + }
195 202 });
196 203  
197 204 /*
... ... @@ -205,8 +212,8 @@ $(function(){
205 212 //更新时间排序
206 213 params['order'] = 'nbbm';
207 214 params['page'] = page;
208   - var i = layer.load(2);
209   - var jyszGsdm=$("#jyszListGsdmId").val();
  215 + var i = 2;
  216 + /* var jyszGsdm=$("#jyszListGsdmId").val();
210 217 var jyszFgsdm=$("#jyszListFgsdmId").val();
211 218 if(jyszGsdm==''|| jyszGsdm==null){
212 219 params['gsdm_in']=gsqx;
... ... @@ -224,7 +231,7 @@ $(function(){
224 231 }
225 232 params['fgsdm_in']=fgsqx1;
226 233 }
227   - }
  234 + } */
228 235 $get('/cwjy' ,params, function(data){
229 236 $.each(data.content, function(i, obj) {
230 237 obj.createDate = moment(obj.createDate).format("YYYY-MM-DD");
... ...
src/main/resources/static/pages/oil/list.html
... ... @@ -58,45 +58,45 @@
58 58 id="datatable_ylb">
59 59 <thead>
60 60 <tr role="row" class="filter">
61   - <td colspan="3">
62   - <!-- 公司:
63   - <select name="ssgsdm" id="ssgsdm">
64   - <option value="">请选择...</option>
65   - <option value="1">可用</option>
66   - <option value="0">禁用</option>
67   - </select> -->
  61 + <td> 公司:</td>
  62 + <td colspan="2">
  63 +
  64 + <select class="form-control" name="ssgsdm_like" id="ylbListGsdmId" ></select>
  65 +
68 66 </td>
69 67 <td>
70   - <!-- <select name="fgsdm"> -->
71   - <!-- <option value="">请选择...</option> -->
72   - <!-- <option value="1">可用</option> -->
73   - <!-- <option value="0">禁用</option> -->
74   - <!-- </select> -->
75   -
76   - 日期:
  68 + 分公司:
77 69 </td>
78 70 <td colspan="2">
  71 +
  72 + <select class="form-control" name="fgsdm_like" id="ylbListFgsdmId" ></select>
  73 + </td>
  74 +
  75 + <td>
  76 + 日期:
  77 + </td>
  78 + <td>
79 79 <input type="text" style="width: 80px" name="rq" id="rq"/>
80 80 </td>
81   - <td colspan="2">
82   - 线路:
  81 + <td >
  82 + 线路:
83 83 </td>
84 84 <td colspan="3">
85 85 <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select>
86 86 &nbsp;
87 87 </td>
88   - <td colspan="2">
89   - 内部编码:
  88 + <td >
  89 + 内部编码:
90 90 </td>
91 91 <td colspan="3">
92 92 <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;"></select>
93 93 </td>
94 94 <td colspan="4">
95   - <button class="btn btn-sm green btn-outline filter-submit margin-bottom">
  95 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px">
96 96 <i class="fa fa-search"></i> 搜索
97 97 </button>
98 98  
99   - <button class="btn btn-sm red btn-outline filter-cancel">
  99 + <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px">
100 100 <i class="fa fa-times"></i> 重置
101 101 </button>
102 102  
... ... @@ -315,9 +315,6 @@
315 315 locale: 'zh-cn'
316 316 });
317 317  
318   - if ($("#rq").val() != "") {
319   - jsDoQuery(null, true);
320   - }
321 318 var page = 0, initPagination;
322 319 var icheckOptions = {
323 320 radioClass: 'iradio_square-blue icheck',
... ... @@ -331,7 +328,14 @@
331 328  
332 329 //提交
333 330 $('tr.filter .filter-submit').on('click', function () {
334   - if ($("#rq").val() != "") {
  331 + var ylbGsdm=$("#ylbListGsdmId").val();
  332 + var ylbFgsdm=$("#ylbListFgsdmId").val();
  333 + console.log();
  334 + if ($("#rq").val() == "" || $("#rq").val() ==null){
  335 + layer.msg('请选择日期.');
  336 + }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){
  337 + layer.msg('请选择公司和分公司.');
  338 + }else {
335 339 var cells = $('tr.filter')[0].cells
336 340 , params = {}
337 341 , name;
... ... @@ -346,11 +350,51 @@
346 350 });
347 351 page = 0;
348 352 jsDoQuery(params, true);
349   - } else {
350   - layer.msg('请选择日期.');
351   - }
  353 + }
352 354 });
353 355  
  356 +
  357 +// var gsqxdm="";
  358 +
  359 +
  360 + $.get('/user/companyData', function(result){
  361 + obj = result;
  362 + var options="";
  363 +// = '<option value="">请选择</option>';
  364 + for(var i = 0; i < obj.length; i++){
  365 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  366 +// setFgsqx(obj[i].companyCode);
  367 + }
  368 + $('#ylbListGsdmId').html(options);
  369 + updateCompany();
  370 + });
  371 + /* function setFgsqx(gs){
  372 + var company =gs
  373 + var options = '';
  374 + for(var i = 0; i < obj.length; i++){
  375 + if(obj[i].companyCode == company){
  376 + var children = obj[i].children;
  377 + for(var j = 0; j < children.length; j++){
  378 + gsqxdm +=company+""+children[j].code+",";
  379 + }
  380 + }
  381 + }
  382 + } */
  383 + $("#ylbListGsdmId").on("change",updateCompany);
  384 + function updateCompany(){
  385 + var company = $('#ylbListGsdmId').val();
  386 + var options ="";
  387 +// = '<option value="">请选择</option>';
  388 + for(var i = 0; i < obj.length; i++){
  389 + if(obj[i].companyCode == company){
  390 + var children = obj[i].children;
  391 + for(var j = 0; j < children.length; j++){
  392 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  393 + }
  394 + }
  395 + }
  396 + $('#ylbListFgsdmId').html(options);
  397 + }
354 398 /*
355 399 * 获取数据 p: 要提交的参数, pagination: 是否重新分页
356 400 */
... ... @@ -362,6 +406,25 @@
362 406 params['order'] = 'nbbm';
363 407 params['page'] = page;
364 408 params['rq'] = $("#rq").val();
  409 +
  410 + /* var ylbGsdm=$("#ylbListGsdmId").val();
  411 + var ylbFgsdm=$("#ylbListFgsdmId").val();
  412 + if(ylbGsdm==''|| ylbGsdm==null){
  413 + params['concat(ssgsdm,fgsdm)_in']=gsqxdm;
  414 + }else{
  415 + if(ylbFgsdm==''||ylbFgsdm==null){
  416 + var fgsqx1='';
  417 + for(var i = 0; i < obj.length; i++){
  418 + if(obj[i].companyCode == ylbGsdm){
  419 + var children = obj[i].children;
  420 + for(var j = 0; j < children.length; j++){
  421 + fgsqx1 +=children[j].code+",";
  422 + }
  423 + }
  424 + }
  425 + params['fgsdm_in']=fgsqx1;
  426 + }
  427 + } */
365 428 var i = layer.load(2);
366 429 $get('/ylb', params, function (data) {
367 430 $.each(data.content, function (i, obj) {
... ...
src/main/resources/static/pages/report/inoutstation.html
... ... @@ -36,7 +36,7 @@
36 36 </div>
37 37 <div style="display: inline-block;margin-left: 15px;">
38 38 <span class="item-label" style="width: 80px;">线路: </span>
39   - <select class="form-control" name="line" id="line" onchange="sreachZd()" style="width: 180px;"></select>
  39 + <select class="form-control sreach-zd" name="line" id="line" style="width: 180px;"></select>
40 40 </div>
41 41 </div>
42 42 <br/>
... ... @@ -58,7 +58,7 @@
58 58 <span class="item-label" style="width: 60px;">至: </span>
59 59 <input class="form-control" type="text" id="date2" style="width: 180px;"/>
60 60 <span class="item-label" style="width: 80px;">站点: </span>
61   - <select id="zdlx" onchange="sreachZd()">
  61 + <select id="zdlx" class="sreach-zd" >
62 62 <option value="">请选择</option>
63 63 <option value="0">上行</option>
64 64 <option value="1">下行</option>
... ... @@ -68,7 +68,7 @@
68 68 </div>
69 69 <div class="form-group" style="display: inline-block;margin-left: 15px;">
70 70 <input class="btn btn-default" type="button" id="query" value="查询"/>
71   - <input class="btn btn-default" type="button" style="display: none;" onclick="clzd()" id="query2" value="查询"/>
  71 + <input class="btn btn-default" type="button" style="display: none;" id="query2" value="查询"/>
72 72 <input class="btn btn-default" type="button" id="export" value="导出"/>
73 73 <input class="btn btn-default" type="button" id="print" value="打印"/>
74 74 <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/>
... ... @@ -176,7 +176,6 @@
176 176 for(var code in result){
177 177 data.push({id: code, text: result[code]});
178 178 }
179   - console.log(data);
180 179 initPinYinSelect2('#line',data,'');
181 180  
182 181 })
... ... @@ -195,7 +194,6 @@
195 194 }else{
196 195 $post('/report/queryListBczx',{clzbh:clzbh,date:date,line:line},function(result){
197 196 getTime(result);
198   - console.log(result);
199 197 var ludan_ll_2 = template('ludan_ll_2',{list:result});
200 198 // 把渲染好的模版html文本追加到表格中
201 199 $('#forms .ludan_ll_2').html(ludan_ll_2);
... ... @@ -279,111 +277,119 @@
279 277 return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
280 278 }
281 279 }
282   - })
283   -
284   - });
285   -
286   -
287   - function zdxx(fcsj,ddsj){
288   - var rq=$("#date").val();
289   - var line=$("#line").val();
290   - var nbbm=$("#nbbm").val();
  280 + });
291 281  
292   - $post('/report/queryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){
293   - var xlmc="线路: "+$("#select2-line-container").html();
294   - var clmc="车辆: "+nbbm;
295   - var rqmc="日期: "+rq;
296   - var bcmc="班次: "+fcsj+"-"+ddsj;
297   - $("#dlzmx").html("到离站详细 "+xlmc+" "+clmc+" "+rqmc+" "+bcmc);
298   - console.log(result);
299   - var ludan_ll_1 = template('ludan_ll_1',{list:result});
300   - // 把渲染好的模版html文本追加到表格中
301   - $('#forms1 .ludan_ll_1').html(ludan_ll_1);
  282 + $("#forms tbody").on("click","tr",function(){
  283 + var rq=$("#date").val();
  284 + var line=$("#line").val();
  285 + var nbbm=$("#nbbm").val();
  286 + var params = new Array();
  287 + if($(this).children().size() < 2){
  288 + return;
  289 + }
  290 +
  291 + $(this).children().each(function(index){
  292 + params[index] = $(this).text();
302 293 });
  294 + var id=params[0].split("\\")[0];
  295 + var fcsj = $('.in_carpark_fcsj[data-id='+id+']', '#forms').html();
  296 + var ddsj= $('.in_carpark_zdsj[data-id='+id+']', '#forms').html();
  297 +
  298 + $post('/report/queryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){
  299 + var xlmc="线路: "+$("#select2-line-container").html();
  300 + var clmc="车辆: "+nbbm;
  301 + var rqmc="日期: "+rq;
  302 + var bcmc="班次: "+fcsj+"-"+ddsj;
  303 + $("#dlzmx").html("到离站详细 "+xlmc+" "+clmc+" "+rqmc+" "+bcmc);
  304 + var ludan_ll_1 = template('ludan_ll_1',{list:result});
  305 + // 把渲染好的模版html文本追加到表格中
  306 + $('#forms1 .ludan_ll_1').html(ludan_ll_1);
  307 + });
  308 + })
303 309  
304   - }
305   -
306   - function clzd(){
307   - var date1=$("#date1").val();
308   - var date2=$("#date2").val();
309   - var line=$("#line").val();
310   - var zdlx=$("#zdlx").val();
311   - var zd=$("#zd").val();
312   - console.log(nbbm);
313   - if(date1=="" || date1==null){
314   - layer.msg("请选择时间");
315   - }else if( line=="" || line==null){
316   - layer.msg("请选择线路");
317   - }else if(date2 ==null || date2==""){
318   - layer.msg("请选择时间");
319   - }else if(zdlx=="" || zdlx==null){
320   - layer.msg("请选择方向");
321   - }else{
322   - var xlmc="线路: "+$("#select2-line-container").html();
323   - var rqmc="日期: "+date1+"-"+date2;
324   - var sxmc="上下行: "+ zdlx;
325   - var zdmc="";
326   - if(zd==null || zd==""){
327   - zdmc="站点: "
328   - }else{
329   - zdmc="站点: "+$("#select2-zd-container").html();
330   - }
331   - $("#dlzmx").html("到离站详细 "+xlmc+" "+rqmc+" "+sxmc+" "+zdmc);
332   - $post('/report/queryListClzd',{zd:zd,zdlx:zdlx,line:line,fcsj:date1,ddsj:date2},function(result){
333   - console.log(result);
334   - var ludan_ll_1 = template('ludan_ll_1',{list:result});
335   - // 把渲染好的模版html文本追加到表格中
336   - $('#forms1 .ludan_ll_1').html(ludan_ll_1);
337   - });
338   - }
339   - }
340   -
341   - function sreachZd(){
342   - var line = $("#line").val();
343   - var zdlx = $("#zdlx").val();
344   - if(line==null|| line =="" || zdlx ==null || zdlx==""){
345   -
346   - }else{
347   - $('#zd').select2({
348   - placeholder: '搜索站点...',
349   - ajax: {
350   - url: '/report/sreachZd',
351   - dataType: 'json',
352   - delay: 150,
353   - data: function(params){
354   - return{line: line,zdlx:zdlx,zd:params.term};
  310 + $("#query2").click(function(){
  311 + var date1=$("#date1").val();
  312 + var date2=$("#date2").val();
  313 + var line=$("#line").val();
  314 + var zdlx=$("#zdlx").val();
  315 + var zd=$("#zd").val();
  316 + if(date1=="" || date1==null){
  317 + layer.msg("请选择时间");
  318 + }else if( line=="" || line==null){
  319 + layer.msg("请选择线路");
  320 + }else if(date2 ==null || date2==""){
  321 + layer.msg("请选择时间");
  322 + }else if(zdlx=="" || zdlx==null){
  323 + layer.msg("请选择方向");
  324 + }else{
  325 + var xlmc="线路: "+$("#select2-line-container").html();
  326 + var rqmc="日期: "+date1+"-"+date2;
  327 + var sxmc="上下行: "+ zdlx;
  328 + var zdmc="";
  329 + if(zd==null || zd==""){
  330 + zdmc="站点: "
  331 + }else{
  332 + zdmc="站点: "+$("#select2-zd-container").html();
  333 + }
  334 + $("#dlzmx").html("到离站详细 "+xlmc+" "+rqmc+" "+sxmc+" "+zdmc);
  335 + $post('/report/queryListClzd',{zd:zd,zdlx:zdlx,line:line,fcsj:date1,ddsj:date2},function(result){
  336 + var ludan_ll_1 = template('ludan_ll_1',{list:result});
  337 + // 把渲染好的模版html文本追加到表格中
  338 + $('#forms1 .ludan_ll_1').html(ludan_ll_1);
  339 + });
  340 + }
  341 + })
  342 +
  343 + $(".sreach-zd").click(function(){
  344 + var line = $("#line").val();
  345 + var zdlx = $("#zdlx").val();
  346 + if(line==null|| line =="" || zdlx ==null || zdlx==""){
  347 +
  348 + }else{
  349 + $('#zd').select2({
  350 + placeholder: '搜索站点...',
  351 + ajax: {
  352 + url: '/report/sreachZd',
  353 + dataType: 'json',
  354 + delay: 150,
  355 + data: function(params){
  356 + return{line: line,zdlx:zdlx,zd:params.term};
  357 + },
  358 + processResults: function (data) {
  359 + return {
  360 + results: data
  361 + };
  362 + },
  363 + cache: true
355 364 },
356   - processResults: function (data) {
357   - return {
358   - results: data
359   - };
360   - },
361   - cache: true
362   - },
363   - templateResult: function(repo){
364   - if (repo.loading) return repo.text;
365   - var h = '<span>'+repo.text+'</span>';
366   - return h;
367   - },
368   - escapeMarkup: function (markup) { return markup; },
369   - minimumInputLength: 1,
370   - templateSelection: function(repo){
371   - return repo.text;
372   - },
373   - language: {
374   - noResults: function(){
375   - return '<span style="color:red;font-size: 12px;">没有搜索到站点!</span>';
376   - },
377   - inputTooShort : function(e) {
378   - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入站点名称</span>';
379   - },
380   - searching : function() {
381   - return '<span style="color:gray;font-size: 12px;"> 正在搜索站点...</span>';
382   - }
383   - }
384   - });
385   - }
386   - }
  365 + templateResult: function(repo){
  366 + if (repo.loading) return repo.text;
  367 + var h = '<span>'+repo.text+'</span>';
  368 + return h;
  369 + },
  370 + escapeMarkup: function (markup) { return markup; },
  371 + minimumInputLength: 1,
  372 + templateSelection: function(repo){
  373 + return repo.text;
  374 + },
  375 + language: {
  376 + noResults: function(){
  377 + return '<span style="color:red;font-size: 12px;">没有搜索到站点!</span>';
  378 + },
  379 + inputTooShort : function(e) {
  380 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入站点名称</span>';
  381 + },
  382 + searching : function() {
  383 + return '<span style="color:gray;font-size: 12px;"> 正在搜索站点...</span>';
  384 + }
  385 + }
  386 + });
  387 + }
  388 + })
  389 +
  390 +
  391 + });
  392 +
387 393 </script>
388 394 <script type="text/html" id="ludan_ll_1">
389 395 {{each list as obj i}}
... ... @@ -426,7 +432,7 @@
426 432 {{else if obj.status==-1}}
427 433 (已烂班 )
428 434 {{else}}
429   - <a onclick='zdxx("{{obj.fcsjActual}}","{{obj.zdsjActual}}")'>
  435 + <a >
430 436 ({{obj.fcsjActual}}
431 437 {{if obj.fast>0}}
432 438 早点 {{obj.fast}}分钟
... ... @@ -436,6 +442,8 @@
436 442 整点
437 443 {{/if}}
438 444 )
  445 + <span class="in_carpark_fcsj" data-id="{{i+1}}" style="display:none">{{obj.fcsjActual}}</span>
  446 + <span class="in_carpark_zdsj" data-id="{{i+1}}" style="display:none">{{obj.zdsjActual}}</span>
439 447 </a>
440 448 {{/if}}
441 449  
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts1/validation/remoteValidation.js
... ... @@ -37,7 +37,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
37 37 // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证
38 38 var isParamAll = true;
39 39 for (var key in paramTemplate) {
40   - if (!$watch_rvparam_obj[key]) {
  40 + if (key != "id" && !$watch_rvparam_obj[key]) { // id去掉
41 41 isParamAll = false;
42 42 break;
43 43 }
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice-legacy.js
1   -// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用
2   -
3   -// 文件下载服务
4   -angular.module('ScheduleApp').factory('FileDownload_g', function() {
5   - return {
6   - downloadFile: function (data, mimeType, fileName) {
7   - var success = false;
8   - var blob = new Blob([data], { type: mimeType });
9   - try {
10   - if (navigator.msSaveBlob)
11   - navigator.msSaveBlob(blob, fileName);
12   - else {
13   - // Try using other saveBlob implementations, if available
14   - var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
15   - if (saveBlob === undefined) throw "Not supported";
16   - saveBlob(blob, fileName);
17   - }
18   - success = true;
19   - } catch (ex) {
20   - console.log("saveBlob method failed with the following exception:");
21   - console.log(ex);
22   - }
23   -
24   - if (!success) {
25   - // Get the blob url creator
26   - var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
27   - if (urlCreator) {
28   - // Try to use a download link
29   - var link = document.createElement('a');
30   - if ('download' in link) {
31   - // Try to simulate a click
32   - try {
33   - // Prepare a blob URL
34   - var url = urlCreator.createObjectURL(blob);
35   - link.setAttribute('href', url);
36   -
37   - // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
38   - link.setAttribute("download", fileName);
39   -
40   - // Simulate clicking the download link
41   - var event = document.createEvent('MouseEvents');
42   - event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
43   - link.dispatchEvent(event);
44   - success = true;
45   -
46   - } catch (ex) {
47   - console.log("Download link method with simulated click failed with the following exception:");
48   - console.log(ex);
49   - }
50   - }
51   -
52   - if (!success) {
53   - // Fallback to window.location method
54   - try {
55   - // Prepare a blob URL
56   - // Use application/octet-stream when using window.location to force download
57   - var url = urlCreator.createObjectURL(blob);
58   - window.location = url;
59   - console.log("Download link method with window.location succeeded");
60   - success = true;
61   - } catch (ex) {
62   - console.log("Download link method with window.location failed with the following exception:");
63   - console.log(ex);
64   - }
65   - }
66   - }
67   - }
68   -
69   - if (!success) {
70   - // Fallback to window.open method
71   - console.log("No methods worked for saving the arraybuffer, using last resort window.open");
72   - window.open("", '_blank', '');
73   - }
74   - }
75   - };
76   -});
77   -
78   -
79   -/**
80   - * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。
81   - * 1、compile阶段使用的属性如下:
82   - * required:用于和表单验证连接,指定成required="true"才有效。
83   - * 2、link阶段使用的属性如下
84   - * model:关联的模型对象
85   - * name:表单验证时需要的名字
86   - * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加
87   - * modelcolname1:关联的模型字段名字1(一般应该是编码字段)
88   - * modelcolname2:关联的模型字段名字2(一般应该是名字字段)
89   - * datacolname1;内部数据对应的字段名字1(与模型字段1对应)
90   - * datacolname2:内部数据对应的字段名字2(与模型字段2对应)
91   - * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用
92   - * placeholder:select placeholder字符串描述
93   - *
94   - * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。
95   - * $$SearchInfoService_g,内部使用的数据服务
96   - */
97   -// saSelect2指令使用的内部信service
98   -angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) {
99   - return {
100   - xl: $resource(
101   - '/line/:type',
102   - {order: 'name', direction: 'ASC'},
103   - {
104   - list: {
105   - method: 'GET',
106   - isArray: true
107   - }
108   - }
109   - ),
110   - xlinfo: $resource(
111   - '/lineInformation/:type',
112   - {order: 'line.name', direction: 'ASC'},
113   - {
114   - list: {
115   - method: 'GET',
116   - isArray: true
117   - }
118   - }
119   - ),
120   - zd: $resource(
121   - '/stationroute/stations',
122   - {order: 'stationCode', direction: 'ASC'},
123   - {
124   - list: {
125   - method: 'GET',
126   - isArray: true
127   - }
128   - }
129   - ),
130   - tcc: $resource(
131   - '/carpark/:type',
132   - {order: 'parkCode', direction: 'ASC'},
133   - {
134   - list: {
135   - method: 'GET',
136   - isArray: true
137   - }
138   - }
139   - ),
140   - ry: $resource(
141   - '/personnel/:type',
142   - {order: 'personnelName', direction: 'ASC'},
143   - {
144   - list: {
145   - method: 'GET',
146   - isArray: true
147   - }
148   - }
149   - ),
150   - cl: $resource(
151   - '/cars/:type',
152   - {order: "insideCode", direction: 'ASC'},
153   - {
154   - list: {
155   - method: 'GET',
156   - isArray: true
157   - }
158   - }
159   - ),
160   - ttInfo: $resource(
161   - '/tic/:type',
162   - {order: "name", direction: 'ASC'},
163   - {
164   - list: {
165   - method: 'GET',
166   - isArray: true
167   - }
168   - }
169   - ),
170   - lpInfo: $resource(
171   - '/gic/ttlpnames',
172   - {order: "lpName", direction: 'ASC'},
173   - {
174   - list: {
175   - method: 'GET',
176   - isArray: true
177   - }
178   - }
179   - ),
180   - lpInfo2: $resource(
181   - '/gic/:type',
182   - {order: "lpName", direction: 'ASC'},
183   - {
184   - list: {
185   - method: 'GET',
186   - isArray: true
187   - }
188   - }
189   - ),
190   - cci: $resource(
191   - '/cci/cars',
192   - {},
193   - {
194   - list: {
195   - method: 'GET',
196   - isArray: true
197   - }
198   - }
199   -
200   - ),
201   - cci2: $resource(
202   - '/cci/:type',
203   - {},
204   - {
205   - list: {
206   - method: 'GET',
207   - isArray: true,
208   - transformResponse: function(rs) {
209   - var dst = angular.fromJson(rs);
210   - if (dst.status == 'SUCCESS') {
211   - return dst.data;
212   - } else {
213   - return dst; // 业务错误留给控制器处理
214   - }
215   - }
216   - }
217   - }
218   - ),
219   - cci3: $resource(
220   - '/cci/cars2',
221   - {},
222   - {
223   - list: {
224   - method: 'GET',
225   - isArray: true
226   - }
227   - }
228   -
229   - ),
230   - eci: $resource(
231   - '/eci/jsy',
232   - {},
233   - {
234   - list: {
235   - method: 'GET',
236   - isArray: true
237   - }
238   - }
239   - ),
240   - eci2: $resource(
241   - '/eci/spy',
242   - {},
243   - {
244   - list: {
245   - method: 'GET',
246   - isArray: true
247   - }
248   - }
249   - ),
250   - eci3: $resource(
251   - '/eci/:type',
252   - {},
253   - {
254   - list: {
255   - method: 'GET',
256   - isArray: true
257   - }
258   - }
259   - ),
260   -
261   -
262   - validate: { // remoteValidation指令用到的resource
263   - gbv1: { // 路牌序号验证
264   - template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'},
265   - remote: $resource(
266   - '/gic/validate1',
267   - {},
268   - {
269   - do: {
270   - method: 'GET'
271   - }
272   - }
273   - )
274   - },
275   - gbv2: { // 路牌名称验证
276   - template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'},
277   - remote: $resource(
278   - '/gic/validate2',
279   - {},
280   - {
281   - do: {
282   - method: 'GET'
283   - }
284   - }
285   - )
286   - },
287   -
288   - cars_zbh: { // 自编号验证
289   - template: {'insideCode_eq': '-1'}, // 查询参数模版
290   - remote: $resource( // $resource封装对象
291   - '/cars_sc/validate_zbh',
292   - {},
293   - {
294   - do: {
295   - method: 'GET'
296   - }
297   - }
298   - )
299   - },
300   -
301   - cars_sbbh: { // 验证设备编号
302   - template: {'equipmentCode_eq': '-1'}, // 查询参数模版
303   - remote: $resource( // $resource封装对象
304   - '/cars_sc/validate_sbbh',
305   - {},
306   - {
307   - do: {
308   - method: 'GET'
309   - }
310   - }
311   - )
312   - },
313   -
314   - cars_clbh: { // 车辆编号验证
315   - template: {'carCode_eq': '-1'}, // 查询参数模版
316   - remote: $resource( // $resource封装对象
317   - '/cars_sc/validate_clbh',
318   - {},
319   - {
320   - do: {
321   - method: 'GET'
322   - }
323   - }
324   - )
325   - },
326   -
327   - cars_cph: { // 车牌号验证
328   - template: {'carPlate_eq': '-1'}, // 查询参数模版
329   - remote: $resource( // $resource封装对象
330   - '/cars_sc/validate_cph',
331   - {},
332   - {
333   - do: {
334   - method: 'GET'
335   - }
336   - }
337   - )
338   - },
339   - cc_cars: { // 车辆不能重复配置
340   - template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版
341   - remote: $resource( // $resource封装对象
342   - '/cci/validate_cars',
343   - {},
344   - {
345   - do: {
346   - method: 'GET'
347   - }
348   - }
349   - )
350   - },
351   - ec_jsy: { // 驾驶员不能重复配置
352   - template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版
353   - remote: $resource( // $resource封装对象
354   - '/eci/validate_jsy',
355   - {},
356   - {
357   - do: {
358   - method: 'GET'
359   - }
360   - }
361   - )
362   - },
363   - ec_spy: { // 售票员不能重复配置
364   - template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
365   - remote: $resource( // $resource封装对象
366   - '/eci/validate_spy',
367   - {},
368   - {
369   - do: {
370   - method: 'GET'
371   - }
372   - }
373   - )
374   - },
375   -
376   - cde1: { // 车辆设备启用日期验证
377   - template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒
378   - remote: $resource( // $resource封装对象
379   - '/cde//validate/qyrq',
380   - {},
381   - {
382   - do: {
383   - method: 'GET'
384   - }
385   - }
386   - )
387   - },
388   - ttc1: { // 时刻表名字验证
389   - template: {'xl.id_eq': -1, 'name_eq': 'ddd'},
390   - remote: $resource( // $resource封装对象
391   - '/tic/validate/equale',
392   - {},
393   - {
394   - do: {
395   - method: 'GET'
396   - }
397   - }
398   - )
399   - },
400   - sheet: { // 时刻表sheet工作区验证
401   - template: {'filename': '', 'sheetname': '', 'lineid': -1, 'linename': ''},
402   - remote: $resource( // $resource封装对象
403   - '/tidc/validate/sheet',
404   - {},
405   - {
406   - do: {
407   - method: 'POST',
408   - headers: {
409   - 'Content-Type': 'application/x-www-form-urlencoded'
410   - },
411   - transformRequest: function(obj) {
412   - var str = [];
413   - for (var p in obj) {
414   - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
415   - }
416   - return str.join("&");
417   - }
418   - }
419   - }
420   - )
421   - },
422   - sheetli: { // 时刻表线路标准验证
423   - template: {'lineinfoid': -1},
424   - remote: $resource( // $resource封装对象
425   - '/tidc/validate/lineinfo',
426   - {},
427   - {
428   - do: {
429   - method: 'GET'
430   - }
431   - }
432   - )
433   - }
434   - }
435   -
436   - //validate: $resource(
437   - // '/cars/validate/:type',
438   - // {},
439   - // {
440   - // insideCode: {
441   - // method: 'GET'
442   - // }
443   - // }
444   - //)
445   -
446   -
447   -
448   - }
449   -}]);
450   -
451   -
  1 +// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用
  2 +
  3 +// 文件下载服务
  4 +angular.module('ScheduleApp').factory('FileDownload_g', function() {
  5 + return {
  6 + downloadFile: function (data, mimeType, fileName) {
  7 + var success = false;
  8 + var blob = new Blob([data], { type: mimeType });
  9 + try {
  10 + if (navigator.msSaveBlob)
  11 + navigator.msSaveBlob(blob, fileName);
  12 + else {
  13 + // Try using other saveBlob implementations, if available
  14 + var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
  15 + if (saveBlob === undefined) throw "Not supported";
  16 + saveBlob(blob, fileName);
  17 + }
  18 + success = true;
  19 + } catch (ex) {
  20 + console.log("saveBlob method failed with the following exception:");
  21 + console.log(ex);
  22 + }
  23 +
  24 + if (!success) {
  25 + // Get the blob url creator
  26 + var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
  27 + if (urlCreator) {
  28 + // Try to use a download link
  29 + var link = document.createElement('a');
  30 + if ('download' in link) {
  31 + // Try to simulate a click
  32 + try {
  33 + // Prepare a blob URL
  34 + var url = urlCreator.createObjectURL(blob);
  35 + link.setAttribute('href', url);
  36 +
  37 + // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
  38 + link.setAttribute("download", fileName);
  39 +
  40 + // Simulate clicking the download link
  41 + var event = document.createEvent('MouseEvents');
  42 + event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
  43 + link.dispatchEvent(event);
  44 + success = true;
  45 +
  46 + } catch (ex) {
  47 + console.log("Download link method with simulated click failed with the following exception:");
  48 + console.log(ex);
  49 + }
  50 + }
  51 +
  52 + if (!success) {
  53 + // Fallback to window.location method
  54 + try {
  55 + // Prepare a blob URL
  56 + // Use application/octet-stream when using window.location to force download
  57 + var url = urlCreator.createObjectURL(blob);
  58 + window.location = url;
  59 + console.log("Download link method with window.location succeeded");
  60 + success = true;
  61 + } catch (ex) {
  62 + console.log("Download link method with window.location failed with the following exception:");
  63 + console.log(ex);
  64 + }
  65 + }
  66 + }
  67 + }
  68 +
  69 + if (!success) {
  70 + // Fallback to window.open method
  71 + console.log("No methods worked for saving the arraybuffer, using last resort window.open");
  72 + window.open("", '_blank', '');
  73 + }
  74 + }
  75 + };
  76 +});
  77 +
  78 +
  79 +/**
  80 + * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。
  81 + * 1、compile阶段使用的属性如下:
  82 + * required:用于和表单验证连接,指定成required="true"才有效。
  83 + * 2、link阶段使用的属性如下
  84 + * model:关联的模型对象
  85 + * name:表单验证时需要的名字
  86 + * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加
  87 + * modelcolname1:关联的模型字段名字1(一般应该是编码字段)
  88 + * modelcolname2:关联的模型字段名字2(一般应该是名字字段)
  89 + * datacolname1;内部数据对应的字段名字1(与模型字段1对应)
  90 + * datacolname2:内部数据对应的字段名字2(与模型字段2对应)
  91 + * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用
  92 + * placeholder:select placeholder字符串描述
  93 + *
  94 + * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。
  95 + * $$SearchInfoService_g,内部使用的数据服务
  96 + */
  97 +// saSelect2指令使用的内部信service
  98 +angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) {
  99 + return {
  100 + xl: $resource(
  101 + '/line/:type',
  102 + {order: 'name', direction: 'ASC'},
  103 + {
  104 + list: {
  105 + method: 'GET',
  106 + isArray: true
  107 + }
  108 + }
  109 + ),
  110 + xlinfo: $resource(
  111 + '/lineInformation/:type',
  112 + {order: 'line.name', direction: 'ASC'},
  113 + {
  114 + list: {
  115 + method: 'GET',
  116 + isArray: true
  117 + }
  118 + }
  119 + ),
  120 + zd: $resource(
  121 + '/stationroute/stations',
  122 + {order: 'stationCode', direction: 'ASC'},
  123 + {
  124 + list: {
  125 + method: 'GET',
  126 + isArray: true
  127 + }
  128 + }
  129 + ),
  130 + tcc: $resource(
  131 + '/carpark/:type',
  132 + {order: 'parkCode', direction: 'ASC'},
  133 + {
  134 + list: {
  135 + method: 'GET',
  136 + isArray: true
  137 + }
  138 + }
  139 + ),
  140 + ry: $resource(
  141 + '/personnel/:type',
  142 + {order: 'personnelName', direction: 'ASC'},
  143 + {
  144 + list: {
  145 + method: 'GET',
  146 + isArray: true
  147 + }
  148 + }
  149 + ),
  150 + cl: $resource(
  151 + '/cars/:type',
  152 + {order: "insideCode", direction: 'ASC'},
  153 + {
  154 + list: {
  155 + method: 'GET',
  156 + isArray: true
  157 + }
  158 + }
  159 + ),
  160 + ttInfo: $resource(
  161 + '/tic/:type',
  162 + {order: "name", direction: 'ASC'},
  163 + {
  164 + list: {
  165 + method: 'GET',
  166 + isArray: true
  167 + }
  168 + }
  169 + ),
  170 + lpInfo: $resource(
  171 + '/gic/ttlpnames',
  172 + {order: "lpName", direction: 'ASC'},
  173 + {
  174 + list: {
  175 + method: 'GET',
  176 + isArray: true
  177 + }
  178 + }
  179 + ),
  180 + lpInfo2: $resource(
  181 + '/gic/:type',
  182 + {order: "lpName", direction: 'ASC'},
  183 + {
  184 + list: {
  185 + method: 'GET',
  186 + isArray: true
  187 + }
  188 + }
  189 + ),
  190 + cci: $resource(
  191 + '/cci/cars',
  192 + {},
  193 + {
  194 + list: {
  195 + method: 'GET',
  196 + isArray: true
  197 + }
  198 + }
  199 +
  200 + ),
  201 + cci2: $resource(
  202 + '/cci/:type',
  203 + {},
  204 + {
  205 + list: {
  206 + method: 'GET',
  207 + isArray: true,
  208 + transformResponse: function(rs) {
  209 + var dst = angular.fromJson(rs);
  210 + if (dst.status == 'SUCCESS') {
  211 + return dst.data;
  212 + } else {
  213 + return dst; // 业务错误留给控制器处理
  214 + }
  215 + }
  216 + }
  217 + }
  218 + ),
  219 + cci3: $resource(
  220 + '/cci/cars2',
  221 + {},
  222 + {
  223 + list: {
  224 + method: 'GET',
  225 + isArray: true
  226 + }
  227 + }
  228 +
  229 + ),
  230 + eci: $resource(
  231 + '/eci/jsy',
  232 + {},
  233 + {
  234 + list: {
  235 + method: 'GET',
  236 + isArray: true
  237 + }
  238 + }
  239 + ),
  240 + eci2: $resource(
  241 + '/eci/spy',
  242 + {},
  243 + {
  244 + list: {
  245 + method: 'GET',
  246 + isArray: true
  247 + }
  248 + }
  249 + ),
  250 + eci3: $resource(
  251 + '/eci/:type',
  252 + {},
  253 + {
  254 + list: {
  255 + method: 'GET',
  256 + isArray: true
  257 + }
  258 + }
  259 + ),
  260 +
  261 +
  262 + validate: { // remoteValidation指令用到的resource
  263 + gbv1: { // 路牌序号验证
  264 + template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'},
  265 + remote: $resource(
  266 + '/gic/validate1',
  267 + {},
  268 + {
  269 + do: {
  270 + method: 'GET'
  271 + }
  272 + }
  273 + )
  274 + },
  275 + gbv2: { // 路牌名称验证
  276 + template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'},
  277 + remote: $resource(
  278 + '/gic/validate2',
  279 + {},
  280 + {
  281 + do: {
  282 + method: 'GET'
  283 + }
  284 + }
  285 + )
  286 + },
  287 +
  288 + cars_zbh: { // 自编号验证
  289 + template: {'insideCode_eq': '-1'}, // 查询参数模版
  290 + remote: $resource( // $resource封装对象
  291 + '/cars_sc/validate_zbh',
  292 + {},
  293 + {
  294 + do: {
  295 + method: 'GET'
  296 + }
  297 + }
  298 + )
  299 + },
  300 +
  301 + cars_sbbh: { // 验证设备编号
  302 + template: {'equipmentCode_eq': '-1'}, // 查询参数模版
  303 + remote: $resource( // $resource封装对象
  304 + '/cars_sc/validate_sbbh',
  305 + {},
  306 + {
  307 + do: {
  308 + method: 'GET'
  309 + }
  310 + }
  311 + )
  312 + },
  313 +
  314 + cars_clbh: { // 车辆编号验证
  315 + template: {'carCode_eq': '-1'}, // 查询参数模版
  316 + remote: $resource( // $resource封装对象
  317 + '/cars_sc/validate_clbh',
  318 + {},
  319 + {
  320 + do: {
  321 + method: 'GET'
  322 + }
  323 + }
  324 + )
  325 + },
  326 +
  327 + cars_cph: { // 车牌号验证
  328 + template: {'carPlate_eq': '-1'}, // 查询参数模版
  329 + remote: $resource( // $resource封装对象
  330 + '/cars_sc/validate_cph',
  331 + {},
  332 + {
  333 + do: {
  334 + method: 'GET'
  335 + }
  336 + }
  337 + )
  338 + },
  339 + cc_cars: { // 车辆不能重复配置
  340 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版
  341 + remote: $resource( // $resource封装对象
  342 + '/cci/validate_cars',
  343 + {},
  344 + {
  345 + do: {
  346 + method: 'GET'
  347 + }
  348 + }
  349 + )
  350 + },
  351 + ec_jsy: { // 驾驶员不能重复配置
  352 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版
  353 + remote: $resource( // $resource封装对象
  354 + '/eci/validate_jsy',
  355 + {},
  356 + {
  357 + do: {
  358 + method: 'GET'
  359 + }
  360 + }
  361 + )
  362 + },
  363 + ec_spy: { // 售票员不能重复配置
  364 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
  365 + remote: $resource( // $resource封装对象
  366 + '/eci/validate_spy',
  367 + {},
  368 + {
  369 + do: {
  370 + method: 'GET'
  371 + }
  372 + }
  373 + )
  374 + },
  375 +
  376 + cde1: { // 车辆设备启用日期验证
  377 + template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒
  378 + remote: $resource( // $resource封装对象
  379 + '/cde//validate/qyrq',
  380 + {},
  381 + {
  382 + do: {
  383 + method: 'GET'
  384 + }
  385 + }
  386 + )
  387 + },
  388 + ttc1: { // 时刻表名字验证
  389 + template: {'xl.id_eq': -1, 'name_eq': 'ddd'},
  390 + remote: $resource( // $resource封装对象
  391 + '/tic/validate/equale',
  392 + {},
  393 + {
  394 + do: {
  395 + method: 'GET'
  396 + }
  397 + }
  398 + )
  399 + },
  400 + sheet: { // 时刻表sheet工作区验证
  401 + template: {'filename': '', 'sheetname': '', 'lineid': -1, 'linename': ''},
  402 + remote: $resource( // $resource封装对象
  403 + '/tidc/validate/sheet',
  404 + {},
  405 + {
  406 + do: {
  407 + method: 'POST',
  408 + headers: {
  409 + 'Content-Type': 'application/x-www-form-urlencoded'
  410 + },
  411 + transformRequest: function(obj) {
  412 + var str = [];
  413 + for (var p in obj) {
  414 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  415 + }
  416 + return str.join("&");
  417 + }
  418 + }
  419 + }
  420 + )
  421 + },
  422 + sheetli: { // 时刻表线路标准验证
  423 + template: {'lineinfoid': -1},
  424 + remote: $resource( // $resource封装对象
  425 + '/tidc/validate/lineinfo',
  426 + {},
  427 + {
  428 + do: {
  429 + method: 'GET'
  430 + }
  431 + }
  432 + )
  433 + }
  434 + }
  435 +
  436 + //validate: $resource(
  437 + // '/cars/validate/:type',
  438 + // {},
  439 + // {
  440 + // insideCode: {
  441 + // method: 'GET'
  442 + // }
  443 + // }
  444 + //)
  445 +
  446 +
  447 +
  448 + }
  449 +}]);
  450 +
  451 +
... ...
src/main/resources/static/pages/scheduleApp/module/core/busConfig/edit.html
... ... @@ -79,7 +79,7 @@
79 79 <input type="hidden" name="cl_h" ng-model="ctrl.busConfigForSave.cl.id"
80 80 remote-Validation
81 81 remotevtype="cc_cars"
82   - remotevparam="{{ {'xl.id_eq': ctrl.busConfigForSave.xl.id, 'xl.name_eq': ctrl.busConfigForSave.xl.name, 'cl.id_eq': ctrl.busConfigForSave.cl.id} | json}}"
  82 + remotevparam="{{ {'id_eq': ctrl.busConfigForSave.id, 'xl.id_eq': ctrl.busConfigForSave.xl.id, 'xl.name_eq': ctrl.busConfigForSave.xl.name, 'cl.id_eq': ctrl.busConfigForSave.cl.id} | json}}"
83 83 />
84 84 </div>
85 85 <!-- 隐藏块,显示验证信息 -->
... ...
src/main/resources/static/pages/scheduleApp/module/core/busConfig/form.html
... ... @@ -79,7 +79,7 @@
79 79 <input type="hidden" name="cl_h" ng-model="ctrl.busConfigForSave.cl.id"
80 80 remote-Validation
81 81 remotevtype="cc_cars"
82   - remotevparam="{{ {'xl.id_eq': ctrl.busConfigForSave.xl.id, 'xl.name_eq': ctrl.busConfigForSave.xl.name, 'cl.id_eq': ctrl.busConfigForSave.cl.id} | json}}"
  82 + remotevparam="{{ {'id_eq': ctrl.busConfigForSave.id, 'xl.id_eq': ctrl.busConfigForSave.xl.id, 'xl.name_eq': ctrl.busConfigForSave.xl.name, 'cl.id_eq': ctrl.busConfigForSave.cl.id} | json}}"
83 83 />
84 84 </div>
85 85 <!-- 隐藏块,显示验证信息 -->
... ...
src/main/resources/static/pages/scheduleApp/module/core/busConfig/service.js
1   -// 车辆配置service
2   -angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {
3   - return {
4   - rest : $resource(
5   - '/cci/:id',
6   - {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id_route'},
7   - {
8   - list: {
9   - method: 'GET',
10   - params: {
11   - page: 0
12   - },
13   - transformResponse: function(rs) {
14   - var dst = angular.fromJson(rs);
15   - if (dst.status == 'SUCCESS') {
16   - return dst.data;
17   - } else {
18   - return dst; // 业务错误留给控制器处理
19   - }
20   - }
21   - },
22   - get: {
23   - method: 'GET',
24   - transformResponse: function(rs) {
25   - var dst = angular.fromJson(rs);
26   - if (dst.status == 'SUCCESS') {
27   - return dst.data;
28   - } else {
29   - return dst;
30   - }
31   - }
32   - },
33   - save: {
34   - method: 'POST'
35   - }
36   - }
37   - )
38   - };
  1 +// 车辆配置service
  2 +angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {
  3 + return {
  4 + rest : $resource(
  5 + '/cci/:id',
  6 + {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id_route'},
  7 + {
  8 + list: {
  9 + method: 'GET',
  10 + params: {
  11 + page: 0
  12 + },
  13 + transformResponse: function(rs) {
  14 + var dst = angular.fromJson(rs);
  15 + if (dst.status == 'SUCCESS') {
  16 + return dst.data;
  17 + } else {
  18 + return dst; // 业务错误留给控制器处理
  19 + }
  20 + }
  21 + },
  22 + get: {
  23 + method: 'GET',
  24 + transformResponse: function(rs) {
  25 + var dst = angular.fromJson(rs);
  26 + if (dst.status == 'SUCCESS') {
  27 + return dst.data;
  28 + } else {
  29 + return dst;
  30 + }
  31 + }
  32 + },
  33 + save: {
  34 + method: 'POST'
  35 + }
  36 + }
  37 + )
  38 + };
39 39 }]);
40 40 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/edit.html
... ... @@ -92,7 +92,7 @@
92 92 <input type="hidden" name="jsy_h" ng-model="ctrl.employeeConfigForSave.jsy.id"
93 93 remote-Validation
94 94 remotevtype="ec_jsy"
95   - remotevparam="{{ {'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'jsy.id_eq': ctrl.employeeConfigForSave.jsy.id} | json}}"
  95 + remotevparam="{{ {'id_eq': ctrl.employeeConfigForSave.id, 'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'jsy.id_eq': ctrl.employeeConfigForSave.jsy.id} | json}}"
96 96 />
97 97 </div>
98 98 <!-- 隐藏块,显示验证信息 -->
... ... @@ -122,7 +122,7 @@
122 122 <input type="hidden" name="spy_h" ng-model="ctrl.employeeConfigForSave.spy.id"
123 123 remote-Validation
124 124 remotevtype="ec_jsy"
125   - remotevparam="{{ {'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'jsy.id_eq': ctrl.employeeConfigForSave.spy.id} | json}}"
  125 + remotevparam="{{ {'id_eq': ctrl.employeeConfigForSave.id, 'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'jsy.id_eq': ctrl.employeeConfigForSave.spy.id} | json}}"
126 126 />
127 127 </div>
128 128 <!-- 隐藏块,显示验证信息 -->
... ...
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/form.html
... ... @@ -92,7 +92,7 @@
92 92 <input type="hidden" name="jsy_h" ng-model="ctrl.employeeConfigForSave.jsy.id"
93 93 remote-Validation
94 94 remotevtype="ec_jsy"
95   - remotevparam="{{ {'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'jsy.id_eq': ctrl.employeeConfigForSave.jsy.id} | json}}"
  95 + remotevparam="{{ {'id_eq': ctrl.employeeConfigForSave.id, 'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'jsy.id_eq': ctrl.employeeConfigForSave.jsy.id} | json}}"
96 96 />
97 97 </div>
98 98 <!-- 隐藏块,显示验证信息 -->
... ... @@ -122,7 +122,7 @@
122 122 <input type="hidden" name="spy_h" ng-model="ctrl.employeeConfigForSave.spy.id"
123 123 remote-Validation
124 124 remotevtype="ec_spy"
125   - remotevparam="{{ {'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'spy.id_eq': ctrl.employeeConfigForSave.spy.id} | json}}"
  125 + remotevparam="{{ {'id_eq': ctrl.employeeConfigForSave.id, 'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'spy.id_eq': ctrl.employeeConfigForSave.spy.id} | json}}"
126 126 />
127 127 </div>
128 128 <!-- 隐藏块,显示验证信息 -->
... ...
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/service.js
1   -// 人员配置service
2   -angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) {
3   - return {
4   - rest : $resource(
5   - '/eci/:id',
6   - {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id_route'},
7   - {
8   - list: {
9   - method: 'GET',
10   - params: {
11   - page: 0
12   - },
13   - transformResponse: function(rs) {
14   - var dst = angular.fromJson(rs);
15   - if (dst.status == 'SUCCESS') {
16   - return dst.data;
17   - } else {
18   - return dst; // 业务错误留给控制器处理
19   - }
20   - }
21   - },
22   - get: {
23   - method: 'GET',
24   - transformResponse: function(rs) {
25   - var dst = angular.fromJson(rs);
26   - if (dst.status == 'SUCCESS') {
27   - return dst.data;
28   - } else {
29   - return dst;
30   - }
31   - }
32   - },
33   - save: {
34   - method: 'POST'
35   - },
36   - delete: {
37   - method: 'DELETE'
38   - }
39   - }
40   - ),
41   - validate: $resource( // TODO:
42   - '/personnel/validate/:type',
43   - {},
44   - {
45   - jobCode: {
46   - method: 'GET'
47   - }
48   - }
49   - )
50   - };
  1 +// 人员配置service
  2 +angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) {
  3 + return {
  4 + rest : $resource(
  5 + '/eci/:id',
  6 + {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id_route'},
  7 + {
  8 + list: {
  9 + method: 'GET',
  10 + params: {
  11 + page: 0
  12 + },
  13 + transformResponse: function(rs) {
  14 + var dst = angular.fromJson(rs);
  15 + if (dst.status == 'SUCCESS') {
  16 + return dst.data;
  17 + } else {
  18 + return dst; // 业务错误留给控制器处理
  19 + }
  20 + }
  21 + },
  22 + get: {
  23 + method: 'GET',
  24 + transformResponse: function(rs) {
  25 + var dst = angular.fromJson(rs);
  26 + if (dst.status == 'SUCCESS') {
  27 + return dst.data;
  28 + } else {
  29 + return dst;
  30 + }
  31 + }
  32 + },
  33 + save: {
  34 + method: 'POST'
  35 + },
  36 + delete: {
  37 + method: 'DELETE'
  38 + }
  39 + }
  40 + ),
  41 + validate: $resource( // TODO:
  42 + '/personnel/validate/:type',
  43 + {},
  44 + {
  45 + jobCode: {
  46 + method: 'GET'
  47 + }
  48 + }
  49 + )
  50 + };
51 51 }]);
52 52 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/edit.html
... ... @@ -63,7 +63,7 @@
63 63 name="lpNo" placeholder="请输入路牌编号..." min="1" required
64 64 remote-Validation
65 65 remotevtype="gbv1"
66   - remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}"
  66 + remotevparam="{{ {'id_eq': ctrl.guideboardManageForForm.id, 'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}"
67 67  
68 68 />
69 69 </div>
... ... @@ -85,7 +85,7 @@
85 85 name="lpName" placeholder="请输入路牌名字..." required
86 86 remote-Validation
87 87 remotevtype="gbv2"
88   - remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}"
  88 + remotevparam="{{ {'id_eq': ctrl.guideboardManageForForm.id, 'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}"
89 89  
90 90 />
91 91 </div>
... ...
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/form.html
... ... @@ -63,7 +63,7 @@
63 63 name="lpNo" placeholder="请输入路牌编号..." min="1" required
64 64 remote-Validation
65 65 remotevtype="gbv1"
66   - remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}"
  66 + remotevparam="{{ {'id_eq': ctrl.guideboardManageForForm.id, 'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}"
67 67  
68 68 />
69 69 </div>
... ... @@ -85,7 +85,7 @@
85 85 name="lpName" placeholder="请输入路牌名字..." required
86 86 remote-Validation
87 87 remotevtype="gbv2"
88   - remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}"
  88 + remotevparam="{{ {'id_eq': ctrl.guideboardManageForForm.id, 'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}"
89 89  
90 90 />
91 91 </div>
... ...
src/main/resources/static/real_control_v2/fragments/geo/calc_station_space.html
1   -<!-- 嵌入下抽屉 -->
2   -<div id="cal_station_space_drawer" style="width: 100%;height: 100%;">
3   -
4   - <div style="text-align: center;padding-top: 30px;" class="calcBeforePanel">
5   - <p style="margin: 9px 0 9px 0;">当前站点间里程数据取自 <a target="_blank" id="stationRouteLink">基础信息->线路信息->站点详细</a>
6   - 你可以手动编辑。</p>
7   - <p style="margin: 9px 0 9px 0;">此外,我们提供另一种选择,根据路段和站点空间坐标计算站间距。计算后的数据将存储在本地。
8   - </p>
9   - <p style="margin: 0px 0 9px 0;">
10   - <span style="color: grey;font-size: 12px;">该操作会借用本地计算能力进行,如果你同意,请点击下方按钮!</span>
11   - </p>
12   - <p style="margin: 9px 0 9px 0;">
13   - <button class="uk-button uk-button-large uk-button-primary" type="button" id="startCalcBtn">开始计算</button>
14   - </p>
15   - </div>
16   -
17   - <div class="pace pace-active" style="display: none;">
18   - <div class="pace-progress" data-progress="50" data-progress-text="50%"
19   - style="-webkit-transform: translate3d(50%, 0px, 0px); -ms-transform: translate3d(50%, 0px, 0px); transform: translate3d(50%, 0px, 0px);">
20   - <div class="pace-progress-inner"></div>
21   - </div>
22   - <div class="pace-activity"></div>
23   - <span class="text"></span>
24   - </div>
25   -
26   - <script>
27   -
28   - (function () {
29   - var drawer = '#cal_station_space_drawer'
30   - , sch, line;
31   -
32   - $(drawer).on('drawer-init', function (e, data) {
33   - sch = data.sch;
34   - line = gb_data_basic.codeToLine[sch.xlBm];
35   - //线路路由信息调整链接
36   - $('#stationRouteLink', drawer).attr('href', '/pages/base/stationroute/list.html?no=' + line.id);
37   -
38   - $('#startCalcBtn', drawer).on('click', startCalc);
39   - });
40   -
41   -
42   - function startCalc() {
43   - $(this).attr('disabled', 'disabled');
44   -
45   - gb_common.$get('/realMap/findRouteAndStationByLine', {lineCode: line.lineCode}, function (spatialData) {
46   - $('.calcBeforePanel', drawer).hide();
47   - $('.pace', drawer).show();
48   -
49   - startGeoCalc(spatialData);
50   - });
51   - }
52   -
53   - function startGeoCalc(spatialData) {
54   - setCalcText('初始化数据');
55   - //console.log('spatialData', spatialData);
56   - //路段上下行分组排序
57   - var sections = gb_common.groupBy(spatialData.section, 'DIRECTIONS');
58   - sections[0].sort(sectionArrSort);
59   - sections[1].sort(sectionArrSort);
60   -
61   - //站点上下行分组排序
62   - var stations = gb_common.groupBy(spatialData.station, 'DIRECTIONS');
63   - stations[0].sort(stationArrSort);
64   - stations[1].sort(stationArrSort);
65   -
66   - setCalcText('拼接路段,计算重叠区域');
67   - var fullSections = [
68   - connectSections(sections[0]),
69   - connectSections(sections[1])
70   - ];
71   -
72   - setCalcText('计算上行数据');
73   - var upCalcRs = calcStationSpace(stations[0], fullSections[0]);
74   -
75   - setCalcText('计算下行数据');
76   - var downCalcRs = calcStationSpace(stations[1], fullSections[1]);
77   -
78   - var locData = {
79   - stations: {up: upCalcRs, down: downCalcRs},
80   - sections: {up: fullSections[0], down: fullSections[1]}
81   - };
82   -
83   - window.localStorage.setItem('control_route_distance_' + sch.xlBm, JSON.stringify(locData));
84   - //console.log('结果', locData);
85   - }
86   -
87   - function sectionArrSort(s1, s2) {
88   - return s1.SECTIONROUTE_CODE - s2.SECTIONROUTE_CODE;
89   - }
90   -
91   - function stationArrSort(s1, s2) {
92   - return s1.STATION_ROUTE_CODE - s2.STATION_ROUTE_CODE;
93   - }
94   -
95   - function setCalcText(t) {
96   - $('.pace .text', drawer).text(t);
97   - }
98   -
99   - //连接路段数组
100   - function connectSections(sectionArray) {
101   - var coords = [];
102   -
103   - var vs, temps;
104   - for (var i = 0, section; section = sectionArray[i++];) {
105   - vs = section.GSECTION_VECTOR;
106   - temps = vs.substr(11, vs.length - 2).split(',');
107   -
108   - connectCoords(coords, temps);
109   - }
110   - return coords;
111   - }
112   -
113   - function connectCoords(all, subArr) {
114   -
115   - var point, ts, len = all.length, inLine, sIndex = 0;
116   - if (len > 0) {
117   - $.each(subArr, function (i, p) {
118   - ts = p.split(' ');
119   - point = {latitude: parseFloat(ts[1]), longitude: parseFloat(ts[0])};
120   - //找到起始点
121   - sIndex = 0;
122   - for (var j = 1; j < len; j++) {
123   - inLine = geolib.isPointInLine(point, all[j - 1], all[j]);
124   -
125   - if (inLine)
126   - break;
127   - else
128   - sIndex = i;
129   - }
130   - });
131   - }
132   -
133   - //拼接
134   - for (var i = sIndex; i < subArr.length; i++) {
135   - ts = subArr[i].split(' ');
136   - all.push({
137   - latitude: parseFloat(ts[1]), longitude: parseFloat(ts[0])
138   - });
139   - }
140   - }
141   -
142   - //计算站点间距
143   - function calcStationSpace(stations, coords) {
144   -
145   - var nearArray = [];
146   - for (var i = 1; i < stations.length; i++) {
147   -
148   - //点到线的最短距离 并计算交点坐标
149   - var rs = calcPointToLineNearPoint({
150   - latitude: stations[i].G_LATY,
151   - longitude: stations[i].G_LONX
152   - }, coords);
153   - rs.station = stations[i];
154   -
155   - //将交点插入线路中
156   - coords.splice(rs.index, 0, rs.intersection);
157   -
158   - nearArray.push(rs);
159   - //console.log('站点' + i + '计算结果', rs.intersection, rs);
160   - }
161   -
162   - //根据交点截断line,并计算距离
163   - var s = 0, e, distance;
164   - $.each(nearArray, function (i) {
165   - e = this.index;
166   - distance = 0;
167   - for (; s < e; s++) {
168   - distance += geolib.getDistance(coords[s], coords[s + 1]);
169   - }
170   -
171   - this.toDistance = distance;
172   - s = e;
173   - });
174   -
175   - //首站
176   - nearArray.splice(0, 0, {
177   - distance: 0,
178   - station: stations[0],
179   - toDistance: 0
180   - });
181   - return nearArray;
182   - }
183   -
184   - function calcPointToLineNearPoint(point, coords) {
185   - var minRs, rs;
186   - for (var i = 1; i < coords.length; i++) {
187   -
188   - var start = coords[i - 1], end = coords[i];
189   - var d1 = geolib.getDistance(start, point, 1, 3);
190   - var d2 = geolib.getDistance(point, end, 1, 3);
191   - var d3 = geolib.getDistance(start, end, 1, 3);
192   -
193   - var alpha = Math.acos((d1 * d1 + d3 * d3 - d2 * d2) / (2 * d1 * d3));
194   - var beta = Math.acos((d2 * d2 + d3 * d3 - d1 * d1) / (2 * d2 * d3));
195   -
196   - if (d3 < 0.5 || isNaN(alpha) || isNaN(beta))
197   - continue;
198   -
199   - rs = {index: i};
200   - if (alpha > Math.PI / 2) {
201   - rs.distance = d1;
202   - rs.intersection = start;
203   - }
204   - else if (beta > Math.PI / 2) {
205   - rs.distance = d2;
206   - rs.intersection = end;
207   - }
208   - else {
209   - rs.distance = Math.sin(alpha) * d1;
210   - rs.intersection = perpendularPoint(start, end, point);
211   - }
212   -
213   - if (!minRs || minRs.distance > rs.distance)
214   - minRs = rs
215   - }
216   -
217   - return minRs;
218   - }
219   -
220   - //获取点 到 线的垂直交点
221   - function perpendularPoint(lp1, lp2, p) {
222   - var a = lp1.latitude - lp2.latitude, b = lp2.longitude - lp1.longitude, c = lp1.longitude * lp2.latitude - lp2.longitude * lp1.latitude;
223   - var lon = (Math.pow(b, 2) * p.longitude - a * b * p.latitude - a * c) / (Math.pow(a, 2) + Math.pow(b, 2));
224   - var lat = (Math.pow(a, 2) * p.latitude - a * b * p.longitude - b * c) / (Math.pow(a, 2) + Math.pow(b, 2));
225   - return {longitude: lon, latitude: lat};
226   - }
227   -
228   - })();
229   - </script>
  1 +<!-- 嵌入下抽屉 -->
  2 +<div id="cal_station_space_drawer" style="width: 100%;height: 100%;">
  3 +
  4 + <div style="text-align: center;padding-top: 30px;" class="calcBeforePanel">
  5 + <p style="margin: 9px 0 9px 0;">当前站点间里程数据取自 <a target="_blank" id="stationRouteLink">基础信息->线路信息->站点详细</a>
  6 + 你可以手动编辑。</p>
  7 + <p style="margin: 9px 0 9px 0;">此外,我们提供另一种选择,根据路段和站点空间坐标计算站间距。计算后的数据将存储在本地。
  8 + </p>
  9 + <p style="margin: 0px 0 9px 0;">
  10 + <span style="color: grey;font-size: 12px;">该操作会借用本地计算能力进行,如果你同意,请点击下方按钮!</span>
  11 + </p>
  12 + <p style="margin: 9px 0 9px 0;">
  13 + <button class="uk-button uk-button-large uk-button-primary" type="button" id="startCalcBtn">开始计算</button>
  14 + </p>
  15 + </div>
  16 +
  17 + <div class="pace pace-active" style="display: none;">
  18 + <div class="pace-progress" data-progress="50" data-progress-text="50%"
  19 + style="-webkit-transform: translate3d(50%, 0px, 0px); -ms-transform: translate3d(50%, 0px, 0px); transform: translate3d(50%, 0px, 0px);">
  20 + <div class="pace-progress-inner"></div>
  21 + </div>
  22 + <div class="pace-activity"></div>
  23 + <span class="text"></span>
  24 + </div>
  25 +
  26 + <script>
  27 +
  28 + (function () {
  29 + var drawer = '#cal_station_space_drawer'
  30 + , sch, line;
  31 +
  32 + $(drawer).on('drawer-init', function (e, data) {
  33 + sch = data.sch;
  34 + line = gb_data_basic.codeToLine[sch.xlBm];
  35 + //线路路由信息调整链接
  36 + $('#stationRouteLink', drawer).attr('href', '/pages/base/stationroute/list.html?no=' + line.id);
  37 +
  38 + $('#startCalcBtn', drawer).on('click', startCalc);
  39 + });
  40 +
  41 +
  42 + function startCalc() {
  43 + $(this).attr('disabled', 'disabled');
  44 +
  45 + gb_common.$get('/realMap/findRouteAndStationByLine', {lineCode: line.lineCode}, function (spatialData) {
  46 + $('.calcBeforePanel', drawer).hide();
  47 + $('.pace', drawer).show();
  48 +
  49 + startGeoCalc(spatialData);
  50 + });
  51 + }
  52 +
  53 + function startGeoCalc(spatialData) {
  54 + setCalcText('初始化数据');
  55 + //console.log('spatialData', spatialData);
  56 + //路段上下行分组排序
  57 + var sections = gb_common.groupBy(spatialData.section, 'DIRECTIONS');
  58 + sections[0].sort(sectionArrSort);
  59 + sections[1].sort(sectionArrSort);
  60 +
  61 + //站点上下行分组排序
  62 + var stations = gb_common.groupBy(spatialData.station, 'DIRECTIONS');
  63 + stations[0].sort(stationArrSort);
  64 + stations[1].sort(stationArrSort);
  65 +
  66 + setCalcText('拼接路段,计算重叠区域');
  67 + var fullSections = [
  68 + connectSections(sections[0]),
  69 + connectSections(sections[1])
  70 + ];
  71 +
  72 + setCalcText('计算上行数据');
  73 + var upCalcRs = calcStationSpace(stations[0], fullSections[0]);
  74 +
  75 + setCalcText('计算下行数据');
  76 + var downCalcRs = calcStationSpace(stations[1], fullSections[1]);
  77 +
  78 + var locData = {
  79 + stations: {up: upCalcRs, down: downCalcRs},
  80 + sections: {up: fullSections[0], down: fullSections[1]}
  81 + };
  82 +
  83 + window.localStorage.setItem('control_route_distance_' + sch.xlBm, JSON.stringify(locData));
  84 + //console.log('结果', locData);
  85 + }
  86 +
  87 + function sectionArrSort(s1, s2) {
  88 + return s1.SECTIONROUTE_CODE - s2.SECTIONROUTE_CODE;
  89 + }
  90 +
  91 + function stationArrSort(s1, s2) {
  92 + return s1.STATION_ROUTE_CODE - s2.STATION_ROUTE_CODE;
  93 + }
  94 +
  95 + function setCalcText(t) {
  96 + $('.pace .text', drawer).text(t);
  97 + }
  98 +
  99 + //连接路段数组
  100 + function connectSections(sectionArray) {
  101 + var coords = [];
  102 +
  103 + var vs, temps;
  104 + for (var i = 0, section; section = sectionArray[i++];) {
  105 + vs = section.GSECTION_VECTOR;
  106 + temps = vs.substr(11, vs.length - 2).split(',');
  107 +
  108 + connectCoords(coords, temps);
  109 + }
  110 + return coords;
  111 + }
  112 +
  113 + function connectCoords(all, subArr) {
  114 +
  115 + var point, ts, len = all.length, inLine, sIndex = 0;
  116 + if (len > 0) {
  117 + $.each(subArr, function (i, p) {
  118 + ts = p.split(' ');
  119 + point = {latitude: parseFloat(ts[1]), longitude: parseFloat(ts[0])};
  120 + //找到起始点
  121 + sIndex = 0;
  122 + for (var j = 1; j < len; j++) {
  123 + inLine = geolib.isPointInLine(point, all[j - 1], all[j]);
  124 +
  125 + if (inLine)
  126 + break;
  127 + else
  128 + sIndex = i;
  129 + }
  130 + });
  131 + }
  132 +
  133 + //拼接
  134 + for (var i = sIndex; i < subArr.length; i++) {
  135 + ts = subArr[i].split(' ');
  136 + all.push({
  137 + latitude: parseFloat(ts[1]), longitude: parseFloat(ts[0])
  138 + });
  139 + }
  140 + }
  141 +
  142 + //计算站点间距
  143 + function calcStationSpace(stations, coords) {
  144 +
  145 + var nearArray = [];
  146 + for (var i = 1; i < stations.length; i++) {
  147 +
  148 + //点到线的最短距离 并计算交点坐标
  149 + var rs = calcPointToLineNearPoint({
  150 + latitude: stations[i].G_LATY,
  151 + longitude: stations[i].G_LONX
  152 + }, coords);
  153 + rs.station = stations[i];
  154 +
  155 + //将交点插入线路中
  156 + coords.splice(rs.index, 0, rs.intersection);
  157 +
  158 + nearArray.push(rs);
  159 + //console.log('站点' + i + '计算结果', rs.intersection, rs);
  160 + }
  161 +
  162 + //根据交点截断line,并计算距离
  163 + var s = 0, e, distance;
  164 + $.each(nearArray, function (i) {
  165 + e = this.index;
  166 + distance = 0;
  167 + for (; s < e; s++) {
  168 + distance += geolib.getDistance(coords[s], coords[s + 1]);
  169 + }
  170 +
  171 + this.toDistance = distance;
  172 + s = e;
  173 + });
  174 +
  175 + //首站
  176 + nearArray.splice(0, 0, {
  177 + distance: 0,
  178 + station: stations[0],
  179 + toDistance: 0
  180 + });
  181 + return nearArray;
  182 + }
  183 +
  184 + function calcPointToLineNearPoint(point, coords) {
  185 + var minRs, rs;
  186 + for (var i = 1; i < coords.length; i++) {
  187 +
  188 + var start = coords[i - 1], end = coords[i];
  189 + var d1 = geolib.getDistance(start, point, 1, 3);
  190 + var d2 = geolib.getDistance(point, end, 1, 3);
  191 + var d3 = geolib.getDistance(start, end, 1, 3);
  192 +
  193 + var alpha = Math.acos((d1 * d1 + d3 * d3 - d2 * d2) / (2 * d1 * d3));
  194 + var beta = Math.acos((d2 * d2 + d3 * d3 - d1 * d1) / (2 * d2 * d3));
  195 +
  196 + if (d3 < 0.5 || isNaN(alpha) || isNaN(beta))
  197 + continue;
  198 +
  199 + rs = {index: i};
  200 + if (alpha > Math.PI / 2) {
  201 + rs.distance = d1;
  202 + rs.intersection = start;
  203 + }
  204 + else if (beta > Math.PI / 2) {
  205 + rs.distance = d2;
  206 + rs.intersection = end;
  207 + }
  208 + else {
  209 + rs.distance = Math.sin(alpha) * d1;
  210 + rs.intersection = perpendularPoint(start, end, point);
  211 + }
  212 +
  213 + if (!minRs || minRs.distance > rs.distance)
  214 + minRs = rs
  215 + }
  216 +
  217 + return minRs;
  218 + }
  219 +
  220 + //获取点 到 线的垂直交点
  221 + function perpendularPoint(lp1, lp2, p) {
  222 + var a = lp1.latitude - lp2.latitude, b = lp2.longitude - lp1.longitude, c = lp1.longitude * lp2.latitude - lp2.longitude * lp1.latitude;
  223 + var lon = (Math.pow(b, 2) * p.longitude - a * b * p.latitude - a * c) / (Math.pow(a, 2) + Math.pow(b, 2));
  224 + var lat = (Math.pow(a, 2) * p.latitude - a * b * p.longitude - b * c) / (Math.pow(a, 2) + Math.pow(b, 2));
  225 + return {longitude: lon, latitude: lat};
  226 + }
  227 +
  228 + })();
  229 + </script>
230 230 </div>
231 231 \ No newline at end of file
... ...