Commit 6112723728a021ac6a3566318c056105cc9405de
1 parent
9227cfcc
添加新增
Showing
3 changed files
with
298 additions
and
88 deletions
bsthLineProfiles/src/main/resources/templates/system/line/add.html
| 1 | 1 | <!DOCTYPE html> |
| 2 | 2 | <html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
| 3 | 3 | <head> |
| 4 | - <th:block th:include="include :: header('新增【请填写功能名称】')" /> | |
| 4 | + <th:block th:include="include :: header('添加线路档案信息')" /> | |
| 5 | 5 | <th:block th:include="include :: datetimepicker-css" /> |
| 6 | 6 | </head> |
| 7 | 7 | <body class="white-bg"> |
| 8 | 8 | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
| 9 | 9 | <form class="form-horizontal m" id="form-line-add"> |
| 10 | 10 | <div class="form-group"> |
| 11 | - <label class="col-sm-3 control-label">夜间停车场(无):</label> | |
| 12 | - <div class="col-sm-8"> | |
| 13 | - <input name="eventId" class="form-control" type="text"> | |
| 14 | - </div> | |
| 15 | - </div> | |
| 16 | - <div class="form-group"> | |
| 17 | - <label class="col-sm-3 control-label">夜间停车场(无):</label> | |
| 18 | - <div class="col-sm-8"> | |
| 19 | - <input name="lineId" class="form-control" type="text"> | |
| 20 | - </div> | |
| 21 | - </div> | |
| 22 | - <div class="form-group"> | |
| 23 | 11 | <label class="col-sm-3 control-label">线路名称:</label> |
| 24 | 12 | <div class="col-sm-8"> |
| 25 | 13 | <input name="lineName" class="form-control" type="text"> |
| ... | ... | @@ -46,76 +34,128 @@ |
| 46 | 34 | <div class="form-group"> |
| 47 | 35 | <label class="col-sm-3 control-label">营运方式 全程/区间/大站/定班/跨线/B线:</label> |
| 48 | 36 | <div class="col-sm-8"> |
| 49 | - <select name="serviceType" class="form-control m-b"> | |
| 50 | - <option value="">所有</option> | |
| 37 | + <select name="serviceType"/> | |
| 38 | + th:with="type=${@dict.getType('serviceType')}" | |
| 39 | + class="form-control m-b"> | |
| 40 | + <option value=""></option> | |
| 41 | + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | |
| 42 | + th:value="${dict.dictValue}"> | |
| 43 | + | |
| 44 | + </option> | |
| 51 | 45 | </select> |
| 52 | - <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span> | |
| 53 | 46 | </div> |
| 54 | 47 | </div> |
| 55 | - <div class="form-group"> | |
| 48 | + | |
| 49 | + <div class="form-group"> | |
| 56 | 50 | <label class="col-sm-3 control-label">线路属性:</label> |
| 57 | 51 | <div class="col-sm-8"> |
| 58 | - <input name="lineLevel" class="form-control" type="text"> | |
| 52 | + <select name="lineLevel" | |
| 53 | + th:with="type=${@dict.getType('lineLevel')}" | |
| 54 | + class="form-control m-b"> | |
| 55 | + <option value=""></option> | |
| 56 | + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | |
| 57 | + th:value="${dict.dictValue}"> | |
| 58 | + </option> | |
| 59 | + </select> | |
| 59 | 60 | </div> |
| 60 | 61 | </div> |
| 61 | 62 | <div class="form-group"> |
| 62 | - <label class="col-sm-3 control-label">线路属性:</label> | |
| 63 | + <label class="col-sm-3 control-label">线路类型:</label> | |
| 63 | 64 | <div class="col-sm-8"> |
| 64 | - <select name="lineType" class="form-control m-b"> | |
| 65 | - <option value="">所有</option> | |
| 65 | + <select name="lineType" th:with="type=${@dict.getType('lineType')}" | |
| 66 | + class="form-control m-b"> | |
| 67 | + <option value=""></option> | |
| 68 | + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | |
| 69 | + th:value="${dict.dictValue}"> | |
| 70 | + </option> | |
| 66 | 71 | </select> |
| 67 | - <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span> | |
| 68 | 72 | </div> |
| 69 | 73 | </div> |
| 70 | 74 | <div class="form-group"> |
| 71 | 75 | <label class="col-sm-3 control-label">区属:</label> |
| 72 | 76 | <div class="col-sm-8"> |
| 73 | - <input name="district" class="form-control" type="text"> | |
| 77 | + <select name="district" th:with="type=${@dict.getType('district')}" | |
| 78 | + class="form-control m-b"> | |
| 79 | + <option value=""></option> | |
| 80 | + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | |
| 81 | + th:value="${dict.dictValue}"> | |
| 82 | + </option> | |
| 83 | + </select> | |
| 74 | 84 | </div> |
| 75 | 85 | </div> |
| 76 | 86 | <div class="form-group"> |
| 77 | 87 | <label class="col-sm-3 control-label">是否区内:</label> |
| 78 | 88 | <div class="col-sm-8"> |
| 79 | - <input name="inoutDistrict" class="form-control" type="text"> | |
| 89 | + <select name="inoutDistrict" | |
| 90 | + th:with="type=${@dict.getType('trueFalse')}" | |
| 91 | + class="form-control m-b"> | |
| 92 | + <option value=""></option> | |
| 93 | + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | |
| 94 | + th:value="${dict.dictValue}"> | |
| 95 | + | |
| 96 | + </option> | |
| 97 | + </select> | |
| 80 | 98 | </div> |
| 81 | 99 | </div> |
| 82 | 100 | <div class="form-group"> |
| 83 | 101 | <label class="col-sm-3 control-label">营运状态 运营中/撤销/暂停:</label> |
| 84 | 102 | <div class="col-sm-8"> |
| 85 | - <input name="serviceState" class="form-control" type="text"> | |
| 103 | + <select name="serviceState" | |
| 104 | + th:with="type=${@dict.getType('serviceState')}" | |
| 105 | + class="form-control m-b"> | |
| 106 | + <option value=""></option> | |
| 107 | + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | |
| 108 | + th:value="${dict.dictValue}"> | |
| 109 | + </option> | |
| 110 | + </select> | |
| 86 | 111 | </div> |
| 87 | 112 | </div> |
| 88 | 113 | <div class="form-group"> |
| 89 | 114 | <label class="col-sm-3 control-label">车辆类型 多选:</label> |
| 90 | - <div class="col-sm-8"> | |
| 91 | - <select name="busType" class="form-control m-b"> | |
| 92 | - <option value="">所有</option> | |
| 93 | - </select> | |
| 94 | - <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span> | |
| 115 | + <div class="col-sm-8" th:with="type=${@dict.getType('busType')}"> | |
| 116 | + <label class="checkbox-inline" th:each="dict : ${type}" | |
| 117 | + style="display: block"> <input type="checkbox" | |
| 118 | + name="busType" | |
| 119 | + th:text="${dict.dictLabel}" th:value="${dict.dictValue}" /></label> | |
| 95 | 120 | </div> |
| 96 | 121 | </div> |
| 97 | 122 | <div class="form-group"> |
| 98 | 123 | <label class="col-sm-3 control-label">是否空调:</label> |
| 99 | 124 | <div class="col-sm-8"> |
| 100 | - <select name="airConditionerType" class="form-control m-b"> | |
| 101 | - <option value="">所有</option> | |
| 125 | + <select name="airConditionerType" | |
| 126 | + th:with="type=${@dict.getType('airConditionerType')}" | |
| 127 | + class="form-control m-b"> | |
| 128 | + <option value=""></option> | |
| 129 | + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | |
| 130 | + th:value="${dict.dictValue}"> | |
| 131 | + </option> | |
| 102 | 132 | </select> |
| 103 | - <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span> | |
| 104 | 133 | </div> |
| 105 | 134 | </div> |
| 106 | 135 | <div class="form-group"> |
| 107 | 136 | <label class="col-sm-3 control-label">售票类型:</label> |
| 108 | 137 | <div class="col-sm-8"> |
| 109 | - <select name="sellTicketType" class="form-control m-b"> | |
| 110 | - <option value="">所有</option> | |
| 138 | + <select name="sellTicketType" | |
| 139 | + th:with="type=${@dict.getType('sellTicketType')}" | |
| 140 | + class="form-control m-b"> | |
| 141 | + <option value=""></option> | |
| 142 | + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | |
| 143 | + th:value="${dict.dictValue}"> | |
| 144 | + </option> | |
| 111 | 145 | </select> |
| 112 | - <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span> | |
| 113 | 146 | </div> |
| 114 | 147 | </div> |
| 115 | 148 | <div class="form-group"> |
| 116 | 149 | <label class="col-sm-3 control-label">运营时间:</label> |
| 117 | 150 | <div class="col-sm-8"> |
| 118 | - <input name="serviceTime" class="form-control" type="text"> | |
| 151 | + <select name="serviceTime" | |
| 152 | + th:with="type=${@dict.getType('serviceTime')}" | |
| 153 | + class="form-control m-b"> | |
| 154 | + <option value=""></option> | |
| 155 | + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | |
| 156 | + th:value="${dict.dictValue}"> | |
| 157 | + </option> | |
| 158 | + </select> | |
| 119 | 159 | </div> |
| 120 | 160 | </div> |
| 121 | 161 | <div class="form-group"> |
| ... | ... | @@ -187,7 +227,14 @@ |
| 187 | 227 | <div class="form-group"> |
| 188 | 228 | <label class="col-sm-3 control-label">是否逻辑删除:</label> |
| 189 | 229 | <div class="col-sm-8"> |
| 190 | - <input name="isLogicDelete" class="form-control" type="text"> | |
| 230 | + <select name="isLogicDelete" | |
| 231 | + th:with="type=${@dict.getType('trueFalse')}" | |
| 232 | + class="form-control m-b"> | |
| 233 | + <option value=""></option> | |
| 234 | + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | |
| 235 | + th:value="${dict.dictValue}"> | |
| 236 | + </option> | |
| 237 | + </select> | |
| 191 | 238 | </div> |
| 192 | 239 | </div> |
| 193 | 240 | <div class="form-group"> |
| ... | ... | @@ -223,16 +270,49 @@ |
| 223 | 270 | <div class="form-group"> |
| 224 | 271 | <label class="col-sm-3 control-label">是否权证:</label> |
| 225 | 272 | <div class="col-sm-8"> |
| 226 | - <input name="isWarrant" class="form-control" type="text"> | |
| 273 | + <select name="isWarrant" id="isWarrant" | |
| 274 | + th:with="type=${@dict.getType('trueFalse')}" | |
| 275 | + class="form-control m-b"> | |
| 276 | + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | |
| 277 | + th:value="${dict.dictValue}" th:selected="${dict.dictValue=='1'}"> | |
| 278 | + </option> | |
| 279 | + </select> | |
| 280 | + </div> | |
| 281 | + </div> | |
| 282 | + <div class="form-group"> | |
| 283 | + <label class="col-sm-3 control-label">权证开通日期:</label> | |
| 284 | + <div class="col-sm-8"> | |
| 285 | + <div class="input-group date"> | |
| 286 | + <input name="isWarrantStartTime" id="isWarrantStartTime" | |
| 287 | + class="form-control" placeholder="yyyy-MM-dd" type="text" | |
| 288 | + autocomplete="off"> <span class="input-group-addon"><i | |
| 289 | + class="fa fa-calendar"></i></span> | |
| 290 | + </div> | |
| 291 | + | |
| 292 | + </div> | |
| 293 | + </div> | |
| 294 | + <div class="form-group"> | |
| 295 | + <label class="col-sm-3 control-label">权证到期日期:</label> | |
| 296 | + <div class="col-sm-8"> | |
| 297 | + <div class="input-group date"> | |
| 298 | + <input name="isWarrantEndTime" id="isWarrantEndTime" | |
| 299 | + class="form-control" placeholder="yyyy-MM-dd" type="text" | |
| 300 | + autocomplete="off"> <span class="input-group-addon"><i | |
| 301 | + class="fa fa-calendar"></i></span> | |
| 302 | + </div> | |
| 303 | + | |
| 227 | 304 | </div> |
| 228 | 305 | </div> |
| 229 | 306 | <div class="form-group"> |
| 230 | 307 | <label class="col-sm-3 control-label">道路类型:</label> |
| 231 | 308 | <div class="col-sm-8"> |
| 232 | - <select name="roadType" class="form-control m-b"> | |
| 233 | - <option value="">所有</option> | |
| 234 | - </select> | |
| 235 | - <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span> | |
| 309 | + <div class="col-sm-8" th:with="type=${@dict.getType('roadType')}"> | |
| 310 | + <label class="checkbox-inline" th:each="dict : ${type}" | |
| 311 | + style="display: block"> <input type="checkbox" | |
| 312 | + name="roadType" | |
| 313 | + th:text="${dict.dictLabel}" th:value="${dict.dictValue}" /> | |
| 314 | + </label> | |
| 315 | + </div> | |
| 236 | 316 | </div> |
| 237 | 317 | </div> |
| 238 | 318 | <div class="form-group"> |
| ... | ... | @@ -326,13 +406,13 @@ |
| 326 | 406 | </div> |
| 327 | 407 | </div> |
| 328 | 408 | <div class="form-group"> |
| 329 | - <label class="col-sm-3 control-label">经营权证:</label> | |
| 409 | + <label class="col-sm-3 control-label">经营权证(大巴):</label> | |
| 330 | 410 | <div class="col-sm-8"> |
| 331 | 411 | <input name="warrantVehiclesLarge" class="form-control" type="text"> |
| 332 | 412 | </div> |
| 333 | 413 | </div> |
| 334 | 414 | <div class="form-group"> |
| 335 | - <label class="col-sm-3 control-label">经营权证:</label> | |
| 415 | + <label class="col-sm-3 control-label">经营权证(中巴):</label> | |
| 336 | 416 | <div class="col-sm-8"> |
| 337 | 417 | <input name="warrantVehiclesMiddle" class="form-control" type="text"> |
| 338 | 418 | </div> |
| ... | ... | @@ -344,13 +424,13 @@ |
| 344 | 424 | </div> |
| 345 | 425 | </div> |
| 346 | 426 | <div class="form-group"> |
| 347 | - <label class="col-sm-3 control-label">实际车辆数:</label> | |
| 427 | + <label class="col-sm-3 control-label">实际车辆数(大):</label> | |
| 348 | 428 | <div class="col-sm-8"> |
| 349 | 429 | <input name="numberVehiclesLarge" class="form-control" type="text"> |
| 350 | 430 | </div> |
| 351 | 431 | </div> |
| 352 | 432 | <div class="form-group"> |
| 353 | - <label class="col-sm-3 control-label">实际车辆数:</label> | |
| 433 | + <label class="col-sm-3 control-label">实际车辆数(中):</label> | |
| 354 | 434 | <div class="col-sm-8"> |
| 355 | 435 | <input name="numberVehiclesMiddle" class="form-control" type="text"> |
| 356 | 436 | </div> |
| ... | ... | @@ -424,14 +504,24 @@ |
| 424 | 504 | <div class="form-group"> |
| 425 | 505 | <label class="col-sm-3 control-label">是否挂牌:</label> |
| 426 | 506 | <div class="col-sm-8"> |
| 427 | - <input name="hasTimelists" class="form-control" type="text"> | |
| 507 | + <select name="hasTimelists" | |
| 508 | + th:with="type=${@dict.getType('trueFalse')}" | |
| 509 | + class="form-control m-b"> | |
| 510 | + <option value=""></option> | |
| 511 | + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | |
| 512 | + th:value="${dict.dictValue}"> | |
| 513 | + </option> | |
| 514 | + </select> | |
| 428 | 515 | </div> |
| 429 | 516 | </div> |
| 430 | 517 | <div class="form-group"> |
| 431 | 518 | <label class="col-sm-3 control-label">是否轨交末班车衔接:</label> |
| 432 | - <div class="col-sm-8"> | |
| 433 | - <input name="isMetro" class="form-control" type="text"> | |
| 434 | - </div> | |
| 519 | + <select name="isMetro" th:with="type=${@dict.getType('trueFalse')}" | |
| 520 | + class="form-control m-b"> | |
| 521 | + <option value=""></option> | |
| 522 | + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | |
| 523 | + th:value="${dict.dictValue}"></option> | |
| 524 | + </select> | |
| 435 | 525 | </div> |
| 436 | 526 | <div class="form-group"> |
| 437 | 527 | <label class="col-sm-3 control-label">轨交时间:</label> |
| ... | ... | @@ -445,10 +535,7 @@ |
| 445 | 535 | <div class="form-group"> |
| 446 | 536 | <label class="col-sm-3 control-label">冷僻线路补贴类型:</label> |
| 447 | 537 | <div class="col-sm-8"> |
| 448 | - <select name="coldBonusType" class="form-control m-b"> | |
| 449 | - <option value="">所有</option> | |
| 450 | - </select> | |
| 451 | - <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span> | |
| 538 | + <input name="coldBonusType" lass="form-control" type="text"> | |
| 452 | 539 | </div> |
| 453 | 540 | </div> |
| 454 | 541 | <div class="form-group"> |
| ... | ... | @@ -508,12 +595,6 @@ |
| 508 | 595 | </div> |
| 509 | 596 | </div> |
| 510 | 597 | </div> |
| 511 | - <div class="form-group"> | |
| 512 | - <label class="col-sm-3 control-label">夜间停车场(无):</label> | |
| 513 | - <div class="col-sm-8"> | |
| 514 | - <input name="nightParking" class="form-control" type="text"> | |
| 515 | - </div> | |
| 516 | - </div> | |
| 517 | 598 | </form> |
| 518 | 599 | </div> |
| 519 | 600 | <th:block th:include="include :: footer" /> |
| ... | ... | @@ -521,7 +602,26 @@ |
| 521 | 602 | <script th:inline="javascript"> |
| 522 | 603 | var prefix = ctx + "system/line" |
| 523 | 604 | $("#form-line-add").validate({ |
| 524 | - focusCleanup: true | |
| 605 | + rules:{ | |
| 606 | + isWarrantStartTime:{ | |
| 607 | + required:function (){ | |
| 608 | + return $('#isWarrant').val()==='1'; | |
| 609 | + }, | |
| 610 | + }, | |
| 611 | + isWarrantEndTime:{ | |
| 612 | + required:function (){ | |
| 613 | + return $('#isWarrant').val()==='1'; | |
| 614 | + }, | |
| 615 | + }, | |
| 616 | + }, | |
| 617 | + messages: { | |
| 618 | + isWarrantStartTime: { | |
| 619 | + required: "请选择日期", | |
| 620 | + }, | |
| 621 | + isWarrantEndTime: { | |
| 622 | + required: "请选择日期", | |
| 623 | + } | |
| 624 | + },focusCleanup: true | |
| 525 | 625 | }); |
| 526 | 626 | |
| 527 | 627 | function submitHandler() { |
| ... | ... | @@ -577,6 +677,18 @@ |
| 577 | 677 | minView: "month", |
| 578 | 678 | autoclose: true |
| 579 | 679 | }); |
| 680 | + | |
| 681 | + $("input[name='isWarrantStartTime']").datetimepicker({ | |
| 682 | + format: "yyyy-mm-dd", | |
| 683 | + minView: "month", | |
| 684 | + autoclose: true | |
| 685 | + }); | |
| 686 | + $("input[name='isWarrantEndTime']").datetimepicker({ | |
| 687 | + format: "yyyy-mm-dd", | |
| 688 | + minView: "month", | |
| 689 | + autoclose: trueg | |
| 690 | + }); | |
| 691 | + | |
| 580 | 692 | </script> |
| 581 | 693 | </body> |
| 582 | 694 | </html> |
| 583 | 695 | \ No newline at end of file | ... | ... |
bsthLineProfiles/src/main/resources/templates/system/line/edit.html
| ... | ... | @@ -283,10 +283,9 @@ |
| 283 | 283 | <div class="form-group"> |
| 284 | 284 | <label class="col-sm-3 control-label">是否权证:</label> |
| 285 | 285 | <div class="col-sm-8"> |
| 286 | - <select name="isWarrant" | |
| 286 | + <select name="isWarrant" id="isWarrant" | |
| 287 | 287 | th:with="type=${@dict.getType('trueFalse')}" |
| 288 | 288 | class="form-control m-b"> |
| 289 | - <option value=""></option> | |
| 290 | 289 | <option th:each="dict : ${type}" th:text="${dict.dictLabel}" |
| 291 | 290 | th:value="${dict.dictValue}" |
| 292 | 291 | th:selected="${#arrays.contains(#strings.toString(bsthTLine.isWarrant== null ? '' : bsthTLine.isWarrant),#strings.toString(dict.dictValue))}"></option> |
| ... | ... | @@ -294,6 +293,32 @@ |
| 294 | 293 | </div> |
| 295 | 294 | </div> |
| 296 | 295 | <div class="form-group"> |
| 296 | + <label class="col-sm-3 control-label">权证开通日期:</label> | |
| 297 | + <div class="col-sm-8"> | |
| 298 | + <div class="input-group date"> | |
| 299 | + <input name="isWarrantStartTime" id="isWarrantStartTime" | |
| 300 | + th:value="${#dates.format(bsthTLine.isWarrantStartTime, 'yyyy-MM-dd')}" | |
| 301 | + class="form-control" placeholder="yyyy-MM-dd" type="text" | |
| 302 | + autocomplete="off"> <span class="input-group-addon"><i | |
| 303 | + class="fa fa-calendar"></i></span> | |
| 304 | + </div> | |
| 305 | + | |
| 306 | + </div> | |
| 307 | + </div> | |
| 308 | + <div class="form-group"> | |
| 309 | + <label class="col-sm-3 control-label">权证到期日期:</label> | |
| 310 | + <div class="col-sm-8"> | |
| 311 | + <div class="input-group date"> | |
| 312 | + <input name="isWarrantEndTime" id="isWarrantEndTime" | |
| 313 | + th:value="${#dates.format(bsthTLine.isWarrantEndTime, 'yyyy-MM-dd')}" | |
| 314 | + class="form-control" placeholder="yyyy-MM-dd" type="text" | |
| 315 | + autocomplete="off"> <span class="input-group-addon"><i | |
| 316 | + class="fa fa-calendar"></i></span> | |
| 317 | + </div> | |
| 318 | + | |
| 319 | + </div> | |
| 320 | + </div> | |
| 321 | + <div class="form-group"> | |
| 297 | 322 | <label class="col-sm-3 control-label">道路类型:</label> |
| 298 | 323 | <div class="col-sm-8"> |
| 299 | 324 | <div class="col-sm-8" th:with="type=${@dict.getType('roadType')}"> |
| ... | ... | @@ -641,7 +666,6 @@ |
| 641 | 666 | <select name="lineUpdateType" |
| 642 | 667 | th:with="type=${@dict.getType('lineUpdateType')}" |
| 643 | 668 | class="form-control m-b"> |
| 644 | - <option value=""></option> | |
| 645 | 669 | <option th:each="dict : ${type}" th:text="${dict.dictLabel}" |
| 646 | 670 | th:value="${dict.dictValue}"></option> |
| 647 | 671 | </select> |
| ... | ... | @@ -774,6 +798,26 @@ |
| 774 | 798 | } |
| 775 | 799 | |
| 776 | 800 | $("#form-line-edit").validate({ |
| 801 | + rules:{ | |
| 802 | + isWarrantStartTime:{ | |
| 803 | + required:function (){ | |
| 804 | + return $('#isWarrant').val()==='1'; | |
| 805 | + }, | |
| 806 | + }, | |
| 807 | + isWarrantEndTime:{ | |
| 808 | + required:function (){ | |
| 809 | + return $('#isWarrant').val()==='1'; | |
| 810 | + }, | |
| 811 | + }, | |
| 812 | + }, | |
| 813 | + messages: { | |
| 814 | + isWarrantStartTime: { | |
| 815 | + required: "请选择日期", | |
| 816 | + }, | |
| 817 | + isWarrantEndTime: { | |
| 818 | + required: "请选择日期", | |
| 819 | + } | |
| 820 | + }, | |
| 777 | 821 | focusCleanup : true |
| 778 | 822 | }); |
| 779 | 823 | |
| ... | ... | @@ -834,6 +878,19 @@ |
| 834 | 878 | minView : "month", |
| 835 | 879 | autoclose : true |
| 836 | 880 | }); |
| 881 | + | |
| 882 | + $("input[name='isWarrantStartTime']").datetimepicker({ | |
| 883 | + format : "yyyy-mm-dd", | |
| 884 | + minView : "month", | |
| 885 | + autoclose : true | |
| 886 | + }); | |
| 887 | + | |
| 888 | + $("input[name='isWarrantEndTime']").datetimepicker({ | |
| 889 | + format : "yyyy-mm-dd", | |
| 890 | + minView : "month", | |
| 891 | + autoclose : true | |
| 892 | + }); | |
| 893 | + | |
| 837 | 894 | </script> |
| 838 | 895 | </body> |
| 839 | 896 | </html> |
| 840 | 897 | \ No newline at end of file | ... | ... |
bsthLineProfiles/src/main/resources/templates/system/line/line.html
| ... | ... | @@ -220,7 +220,9 @@ |
| 220 | 220 | <div class="btn-group-sm" id="toolbar" role="group"> |
| 221 | 221 | |
| 222 | 222 | <el-button plain size="mini" type="success" icon="el-icon-search" onClick="$.table.search();" data-toggle="modal" data-target="#myModal">选择显示的列</el-button> |
| 223 | - | |
| 223 | + | |
| 224 | + <el-button plain size="mini" type="primary" icon="el-icon-plus" onClick="add(this);" shiro:hasPermission="system:line:add">新增</el-button> | |
| 225 | + | |
| 224 | 226 | <el-button plain size="mini" type="primary" icon="el-icon-edit" onClick="edit(this);" class="btn single disabled" shiro:hasPermission="system:line:edit">修改</el-button> |
| 225 | 227 | |
| 226 | 228 | <el-button plain size="mini" type="danger" icon="el-icon-delete" onClick="remove(this);" class="btn multiple disabled" shiro:hasPermission="system:line:remove"> 删除</el-button> |
| ... | ... | @@ -261,7 +263,12 @@ |
| 261 | 263 | |
| 262 | 264 | |
| 263 | 265 | <script th:inline="javascript"> |
| 264 | - | |
| 266 | + | |
| 267 | + function add(obj){ | |
| 268 | + if($(obj)[0].className.indexOf("disabled") == -1) | |
| 269 | + $.operate.add(); | |
| 270 | + | |
| 271 | + } | |
| 265 | 272 | |
| 266 | 273 | function edit(obj){ |
| 267 | 274 | if($(obj)[0].className.indexOf("disabled") == -1) |
| ... | ... | @@ -289,15 +296,15 @@ |
| 289 | 296 | |
| 290 | 297 | function initTable(){ |
| 291 | 298 | var objs = $("#cols div"); |
| 292 | - | |
| 293 | - | |
| 299 | + | |
| 300 | + | |
| 294 | 301 | var data = []; |
| 295 | 302 | |
| 296 | 303 | for(var i = 0;i< objs.length;i++){ |
| 297 | 304 | var name = $(objs[i]).find("input")[0].name; |
| 298 | 305 | var text = $(objs[i]).find("label")[0].innerText; |
| 299 | 306 | var checked = $(objs[i]).find("input")[0].checked; |
| 300 | - | |
| 307 | + | |
| 301 | 308 | data.push({ |
| 302 | 309 | name:name, |
| 303 | 310 | text:text, |
| ... | ... | @@ -306,12 +313,12 @@ |
| 306 | 313 | } |
| 307 | 314 | |
| 308 | 315 | createTable(data); |
| 309 | - | |
| 316 | + | |
| 310 | 317 | $.post("/system/line/updateUserLineInfo",{lineInfo:JSON.stringify(data)},function(data){ |
| 311 | 318 | $.modal.msg(data.msg); |
| 312 | 319 | }); |
| 313 | 320 | } |
| 314 | - | |
| 321 | + | |
| 315 | 322 | function createTable(objs){ |
| 316 | 323 | var options = { |
| 317 | 324 | url: prefix + "/list", |
| ... | ... | @@ -320,7 +327,16 @@ |
| 320 | 327 | removeUrl: prefix + "/remove", |
| 321 | 328 | exportUrl: prefix + "/export", |
| 322 | 329 | modalName: "线路档案信息", |
| 323 | - columns: [] | |
| 330 | + columns: [], | |
| 331 | + rowStyle:function(row,index) { | |
| 332 | + var flag=DateMinus(row.isWarrantEndTime); | |
| 333 | + if(row.isWarrant==='1'&&!flag){ | |
| 334 | + var strClass='danger'; | |
| 335 | + return {classes:strClass}; | |
| 336 | + } | |
| 337 | + return ""; | |
| 338 | + | |
| 339 | + } | |
| 324 | 340 | }; |
| 325 | 341 | |
| 326 | 342 | |
| ... | ... | @@ -337,27 +353,27 @@ |
| 337 | 353 | visible:objs[i].checked, |
| 338 | 354 | align: 'center', |
| 339 | 355 | formatter: function(value, row, index) { |
| 340 | - | |
| 341 | - | |
| 356 | + | |
| 357 | + | |
| 342 | 358 | if(this.field == "roadType" || this.field == "busType"){ |
| 343 | 359 | if(value != null){ |
| 344 | - | |
| 360 | + | |
| 345 | 361 | var arr = value.split(","); |
| 346 | 362 | value = ""; |
| 347 | 363 | for(var i in arr){ |
| 348 | - | |
| 364 | + | |
| 349 | 365 | for(var j in dicts[this.field]){ |
| 350 | 366 | if(dicts[this.field][j].dictValue == arr[i]){ |
| 351 | 367 | value += dicts[this.field][j].dictLabel + "," |
| 352 | 368 | break; |
| 353 | 369 | } |
| 354 | 370 | } |
| 355 | - | |
| 371 | + | |
| 356 | 372 | } |
| 357 | 373 | return $.table.tooltip(value.substring(0,value.length -1), 5); |
| 358 | 374 | } |
| 359 | 375 | } |
| 360 | - | |
| 376 | + | |
| 361 | 377 | if(this.field == "isLogicDelete" || this.field == "inoutDistrict"|| this.field == "isMetro" || this.field == "hasTimelists"){ |
| 362 | 378 | for(var j in dicts["trueFalse"]){ |
| 363 | 379 | if(dicts["trueFalse"][j].dictValue == value){ |
| ... | ... | @@ -366,9 +382,9 @@ |
| 366 | 382 | } |
| 367 | 383 | } |
| 368 | 384 | } |
| 369 | - | |
| 370 | - | |
| 371 | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 372 | 388 | if(dicts[this.field]){ |
| 373 | 389 | for(var j in dicts[this.field]){ |
| 374 | 390 | if(dicts[this.field][j].dictValue == value){ |
| ... | ... | @@ -377,7 +393,7 @@ |
| 377 | 393 | } |
| 378 | 394 | } |
| 379 | 395 | } |
| 380 | - | |
| 396 | + | |
| 381 | 397 | return $.table.tooltip(value, 5); |
| 382 | 398 | } |
| 383 | 399 | } |
| ... | ... | @@ -400,7 +416,7 @@ |
| 400 | 416 | } |
| 401 | 417 | |
| 402 | 418 | options.columns.push(col); |
| 403 | - | |
| 419 | + | |
| 404 | 420 | } |
| 405 | 421 | |
| 406 | 422 | $.table.destroy(); |
| ... | ... | @@ -440,12 +456,12 @@ |
| 440 | 456 | } |
| 441 | 457 | |
| 442 | 458 | dicts = allDicts; |
| 443 | - | |
| 444 | - | |
| 459 | + | |
| 460 | + | |
| 445 | 461 | |
| 446 | 462 | |
| 447 | 463 | |
| 448 | - | |
| 464 | + | |
| 449 | 465 | var cols = [{ |
| 450 | 466 | field: 'lineName', |
| 451 | 467 | title: '线路名称' |
| ... | ... | @@ -562,6 +578,14 @@ |
| 562 | 578 | field: 'isWarrant', |
| 563 | 579 | title: '是否权证' |
| 564 | 580 | }, |
| 581 | + { | |
| 582 | + field: 'isWarrantStartTime', | |
| 583 | + title: '权证开通日期' | |
| 584 | + }, | |
| 585 | + { | |
| 586 | + field: 'isWarrantEndTime', | |
| 587 | + title: '权证到期日期' | |
| 588 | + }, | |
| 565 | 589 | { |
| 566 | 590 | field: 'roadType', |
| 567 | 591 | title: '道路类型' |
| ... | ... | @@ -741,8 +765,25 @@ |
| 741 | 765 | } |
| 742 | 766 | }); |
| 743 | 767 | |
| 744 | - | |
| 768 | + | |
| 745 | 769 | }); |
| 770 | + | |
| 771 | + | |
| 772 | + function DateMinus(date1){ | |
| 773 | + if(date1==null){ | |
| 774 | + return true; | |
| 775 | + } | |
| 776 | + | |
| 777 | + var sdate = new Date(date1); | |
| 778 | + var now = new Date(); | |
| 779 | + var days = sdate.getTime()-now.getTime(); | |
| 780 | + var day = parseInt(days / (1000 * 60 * 60 * 24)); | |
| 781 | + console.log(day); | |
| 782 | + if(day<120){ | |
| 783 | + return false; | |
| 784 | + } | |
| 785 | + return true; | |
| 786 | + } | |
| 746 | 787 | </script> |
| 747 | 788 | |
| 748 | 789 | <style> | ... | ... |