Commit d12477e89d52933157f89b01217494104f78fde3
1 parent
52b3c052
Update
Showing
9 changed files
with
463 additions
and
14 deletions
src/main/resources/static/pages/scheduleApp/Gruntfile.js
| ... | ... | @@ -83,6 +83,7 @@ module.exports = function (grunt) { |
| 83 | 83 | 'module/common/dts1/radioButton/saRadiogroup.js', // 单选框组整合指令 |
| 84 | 84 | 'module/common/dts1/checkbox/saCheckboxgroup.js', // 多选框组整合指令 |
| 85 | 85 | 'module/common/dts2/dateGroup/saDategroup.js', // 特殊日期选择指令 |
| 86 | + 'module/common/dts2/fbgsGroup/saFbgsgroup.js', // 翻班格式选择指令 | |
| 86 | 87 | 'module/common/dts2/guideboardGroup/saGuideboardgroup.js', // 路牌选择整合指令 |
| 87 | 88 | 'module/common/dts2/employeeGroup/saEmployeegroup.js', // 人员选饿整合指令 |
| 88 | 89 | 'module/common/dts2/bcGroup/saBcgroup.js', // 班次选择整合指令 | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/dts2/employeeGroup/saEmployeegroupTemplate.html
src/main/resources/static/pages/scheduleApp/module/common/dts2/fbgsGroup/saFbgsgroup.js
0 → 100644
| 1 | +/** | |
| 2 | + * saFbgsgroup指令 | |
| 3 | + * 属性如下: | |
| 4 | + * name(必须):控件的名字 | |
| 5 | + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave | |
| 6 | + * fbgsvalue(必须):绑定的model翻班格式值,如:fbgsvalue={{ctrl.employeeInfoForSave.fbgs}} | |
| 7 | + * fbgsname(必须):绑定的model翻班格式字段名,如:fbgsname=fbgs | |
| 8 | + * | |
| 9 | + * required(可选):是否要用required验证 | |
| 10 | + * | |
| 11 | + */ | |
| 12 | +angular.module('ScheduleApp').directive( | |
| 13 | + 'saFbgsgroup', | |
| 14 | + [ | |
| 15 | + function() { | |
| 16 | + return { | |
| 17 | + restrict: 'E', | |
| 18 | + templateUrl: '/pages/scheduleApp/module/common/dts2/fbgsGroup/saFbgsgroupTemplate.html', | |
| 19 | + scope: { | |
| 20 | + model: "=" // 独立作用域,关联外部的模型object | |
| 21 | + }, | |
| 22 | + controllerAs: '$saFbgsgroupCtrl', | |
| 23 | + bindToController: true, | |
| 24 | + controller: function() { | |
| 25 | + var self = this; | |
| 26 | + | |
| 27 | + self.$$dataSelected = []; // 选中的路牌列表 | |
| 28 | + | |
| 29 | + // saFbgsgroup组件的ng-model,用于外部绑定等操作 | |
| 30 | + self.$$internalmodel = undefined; | |
| 31 | + }, | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * 此阶段可以改dom结构,此时angular还没扫描指令, | |
| 35 | + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。 | |
| 36 | + * @param tElem | |
| 37 | + * @param tAttrs | |
| 38 | + * @returns {{pre: Function, post: Function}} | |
| 39 | + */ | |
| 40 | + compile: function(tElem, tAttrs) { | |
| 41 | + // 获取所有属性 | |
| 42 | + var $name_attr = tAttrs["name"]; // 控件的名字 | |
| 43 | + var $required_attr = tAttrs["required"]; // 是否需要required验证 | |
| 44 | + var $fbgsname_attr = tAttrs["fbgsname"]; // 绑定的model翻班格式字段名 | |
| 45 | + | |
| 46 | + // controlAs名字 | |
| 47 | + var ctrlAs = '$saFbgsgroupCtrl'; | |
| 48 | + | |
| 49 | + // 如果有required属性,添加angularjs required验证 | |
| 50 | + if ($required_attr != undefined) { | |
| 51 | + //console.log(tElem.html()); | |
| 52 | + tElem.find("div").attr("required", ""); | |
| 53 | + } | |
| 54 | + | |
| 55 | + return { | |
| 56 | + pre: function(scope, element, attr) { | |
| 57 | + | |
| 58 | + }, | |
| 59 | + | |
| 60 | + /** | |
| 61 | + * 相当于link函数。 | |
| 62 | + * @param scope | |
| 63 | + * @param element | |
| 64 | + * @param attr | |
| 65 | + */ | |
| 66 | + post: function(scope, element, attr) { | |
| 67 | + // name属性 | |
| 68 | + if ($name_attr) { | |
| 69 | + scope[ctrlAs]["$name_attr"] = $name_attr; | |
| 70 | + } | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * 路牌列表点击(路牌列表中选中路牌) | |
| 74 | + * @param fbcode | |
| 75 | + */ | |
| 76 | + scope[ctrlAs].$$internal_fb_click = function(fbcode) { | |
| 77 | + scope[ctrlAs].$$dataSelected.push(fbcode); | |
| 78 | + }; | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * 选中的路牌双击(删除选中的路牌) | |
| 82 | + * @param $index | |
| 83 | + */ | |
| 84 | + scope[ctrlAs].$$internal_sellplist_dbclick = function($index) { | |
| 85 | + scope[ctrlAs].$$dataSelected.splice($index, 1); | |
| 86 | + }; | |
| 87 | + | |
| 88 | + /** | |
| 89 | + * 验证内部数据,更新外部model | |
| 90 | + */ | |
| 91 | + scope[ctrlAs].$$internal_validate_model = function() { | |
| 92 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 93 | + | |
| 94 | + if (data_temp && | |
| 95 | + data_temp.length > 0) { | |
| 96 | + | |
| 97 | + // 更新内部model,用于外部验证 | |
| 98 | + // 内部model的值暂时随意,以后再改 | |
| 99 | + scope[ctrlAs].$$internalmodel = {desc: "ok"}; | |
| 100 | + | |
| 101 | + // 更新外部model字段 | |
| 102 | + if ($fbgsname_attr) { | |
| 103 | + console.log("$fbgsname=" + data_temp.join(',')); | |
| 104 | + eval("scope[ctrlAs].model" + "." + $fbgsname_attr + " = data_temp.join(',');"); | |
| 105 | + } | |
| 106 | + | |
| 107 | + } else { | |
| 108 | + scope[ctrlAs].$$internalmodel = undefined; | |
| 109 | + } | |
| 110 | + }; | |
| 111 | + | |
| 112 | + // 监控内部数据,$$data_selected 变化 | |
| 113 | + scope.$watch( | |
| 114 | + function() { | |
| 115 | + return scope[ctrlAs].$$dataSelected; | |
| 116 | + }, | |
| 117 | + function(newValue, oldValue) { | |
| 118 | + scope[ctrlAs].$$internal_validate_model(); | |
| 119 | + }, | |
| 120 | + true | |
| 121 | + ); | |
| 122 | + | |
| 123 | + // 监控路牌名称范围值的变化,处理初始化赋值 | |
| 124 | + attr.$observe("fbgsvalue", function(value) { | |
| 125 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 126 | + | |
| 127 | + if (value && value != "" && data_temp && data_temp.length == 0) { // 初始创建 | |
| 128 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 129 | + var fbgses = []; | |
| 130 | + var i = 0; | |
| 131 | + | |
| 132 | + // 分隔翻班格式 | |
| 133 | + if (value.indexOf(",") >= 0) { // 以逗号分隔,如 1,1,0,1 | |
| 134 | + fbgses = value.split(","); | |
| 135 | + } else { | |
| 136 | + for (i = 0; i < value.length; i++) { // 字符串形式,如 1101 | |
| 137 | + fbgses.push(value.substr(i, 1)); | |
| 138 | + } | |
| 139 | + } | |
| 140 | + | |
| 141 | + for (i = 0; i < fbgses.length; i++) { | |
| 142 | + if (fbgses[i] == "1" || fbgses[i] == "0") { | |
| 143 | + data_temp.push(fbgses[i]); | |
| 144 | + } | |
| 145 | + } | |
| 146 | + } | |
| 147 | + }); | |
| 148 | + } | |
| 149 | + }; | |
| 150 | + } | |
| 151 | + } | |
| 152 | + } | |
| 153 | + ]); | |
| 0 | 154 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/dts2/fbgsGroup/saFbgsgroupTemplate.html
0 → 100644
| 1 | +<div name="{{$saFbgsgroupCtrl.$name_attr}}" | |
| 2 | + ng-model="$saFbgsgroupCtrl.$$internalmodel"> | |
| 3 | + | |
| 4 | + <style> | |
| 5 | + .fbgs-select { | |
| 6 | + min-height: 180px; | |
| 7 | + border: 1px solid #ddd; | |
| 8 | + } | |
| 9 | + .fbgs-select .fbgs-input { | |
| 10 | + margin: 5px 5px 0px 5px; | |
| 11 | + padding-left: 0; | |
| 12 | + } | |
| 13 | + .fbgs-select .fbgs-select-cont { | |
| 14 | + text-align: left; | |
| 15 | + min-height: 60px; | |
| 16 | + padding-right: 0px; | |
| 17 | + } | |
| 18 | + .fbgs-select .fbgs-select-body { | |
| 19 | + margin-top: 5px; | |
| 20 | + margin-bottom: 5px; | |
| 21 | + overflow: auto; | |
| 22 | + width: auto; | |
| 23 | + min-height: 5px; | |
| 24 | + } | |
| 25 | + .fbgs-select .fbgs { | |
| 26 | + display: inline-block; | |
| 27 | + padding: 8px; | |
| 28 | + min-width: 50px; | |
| 29 | + text-align: center; | |
| 30 | + border: 1px solid #C1C1C1; | |
| 31 | + color: #666; | |
| 32 | + border-radius: 5px !important; | |
| 33 | + margin: 5px; | |
| 34 | + } | |
| 35 | + .fbgs-select .fbgs.active { | |
| 36 | + color: white; | |
| 37 | + background: #4095E8; | |
| 38 | + border: 1px solid #4095E8; | |
| 39 | + } | |
| 40 | + | |
| 41 | + </style> | |
| 42 | + | |
| 43 | + <div class="col-md-12 fbgs-select"> | |
| 44 | + <div class="col-md-12 fbgs-input"> | |
| 45 | + <div class="col-md-7" style="padding-right: 0px;"> | |
| 46 | + <small> | |
| 47 | + 翻班格式描述,1代表翻路牌。0代表休息跳过 | |
| 48 | + </small> | |
| 49 | + </div> | |
| 50 | + </div> | |
| 51 | + <div class="col-md-12 fbgs-select-cont"> | |
| 52 | + <div class="fbgs-select-body"> | |
| 53 | + <div class="fbgs active" | |
| 54 | + ng-click="$saFbgsgroupCtrl.$$internal_fb_click(1)"> | |
| 55 | + 1 | |
| 56 | + </div> | |
| 57 | + <div class="fbgs active" | |
| 58 | + ng-click="$saFbgsgroupCtrl.$$internal_fb_click(0)"> | |
| 59 | + 0 | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + </div> | |
| 63 | + <div class="col-md-12 fbgs-input"> | |
| 64 | + <div class="col-md-12"> | |
| 65 | + <small> | |
| 66 | + 已经选中的翻班,共{{$saFbgsgroupCtrl.$$dataSelected.length}}个, | |
| 67 | + </small> | |
| 68 | + </div> | |
| 69 | + </div> | |
| 70 | + <div class="col-md-12 fbgs-select-cont"> | |
| 71 | + <div class="fbgs-select-body"> | |
| 72 | + <div class="fbgs active" | |
| 73 | + ng-repeat="$d in $saFbgsgroupCtrl.$$dataSelected track by $index" | |
| 74 | + ng-dblclick="$saFbgsgroupCtrl.$$internal_sellplist_dbclick($index)"> | |
| 75 | + {{$d}} | |
| 76 | + </div> | |
| 77 | + </div> | |
| 78 | + </div> | |
| 79 | + </div> | |
| 80 | + | |
| 81 | +</div> | |
| 0 | 82 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/dts2/guideboardGroup/saGuideboardgroupTemplate.html
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
| ... | ... | @@ -2409,6 +2409,160 @@ angular.module('ScheduleApp').directive('saDategroup', [ |
| 2409 | 2409 | ]); |
| 2410 | 2410 | |
| 2411 | 2411 | |
| 2412 | +/** | |
| 2413 | + * saFbgsgroup指令 | |
| 2414 | + * 属性如下: | |
| 2415 | + * name(必须):控件的名字 | |
| 2416 | + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave | |
| 2417 | + * fbgsvalue(必须):绑定的model翻班格式值,如:fbgsvalue={{ctrl.employeeInfoForSave.fbgs}} | |
| 2418 | + * fbgsname(必须):绑定的model翻班格式字段名,如:fbgsname=fbgs | |
| 2419 | + * | |
| 2420 | + * required(可选):是否要用required验证 | |
| 2421 | + * | |
| 2422 | + */ | |
| 2423 | +angular.module('ScheduleApp').directive( | |
| 2424 | + 'saFbgsgroup', | |
| 2425 | + [ | |
| 2426 | + function() { | |
| 2427 | + return { | |
| 2428 | + restrict: 'E', | |
| 2429 | + templateUrl: '/pages/scheduleApp/module/common/dts2/fbgsGroup/saFbgsgroupTemplate.html', | |
| 2430 | + scope: { | |
| 2431 | + model: "=" // 独立作用域,关联外部的模型object | |
| 2432 | + }, | |
| 2433 | + controllerAs: '$saFbgsgroupCtrl', | |
| 2434 | + bindToController: true, | |
| 2435 | + controller: function() { | |
| 2436 | + var self = this; | |
| 2437 | + | |
| 2438 | + self.$$dataSelected = []; // 选中的路牌列表 | |
| 2439 | + | |
| 2440 | + // saFbgsgroup组件的ng-model,用于外部绑定等操作 | |
| 2441 | + self.$$internalmodel = undefined; | |
| 2442 | + }, | |
| 2443 | + | |
| 2444 | + /** | |
| 2445 | + * 此阶段可以改dom结构,此时angular还没扫描指令, | |
| 2446 | + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。 | |
| 2447 | + * @param tElem | |
| 2448 | + * @param tAttrs | |
| 2449 | + * @returns {{pre: Function, post: Function}} | |
| 2450 | + */ | |
| 2451 | + compile: function(tElem, tAttrs) { | |
| 2452 | + // 获取所有属性 | |
| 2453 | + var $name_attr = tAttrs["name"]; // 控件的名字 | |
| 2454 | + var $required_attr = tAttrs["required"]; // 是否需要required验证 | |
| 2455 | + var $fbgsname_attr = tAttrs["fbgsname"]; // 绑定的model翻班格式字段名 | |
| 2456 | + | |
| 2457 | + // controlAs名字 | |
| 2458 | + var ctrlAs = '$saFbgsgroupCtrl'; | |
| 2459 | + | |
| 2460 | + // 如果有required属性,添加angularjs required验证 | |
| 2461 | + if ($required_attr != undefined) { | |
| 2462 | + //console.log(tElem.html()); | |
| 2463 | + tElem.find("div").attr("required", ""); | |
| 2464 | + } | |
| 2465 | + | |
| 2466 | + return { | |
| 2467 | + pre: function(scope, element, attr) { | |
| 2468 | + | |
| 2469 | + }, | |
| 2470 | + | |
| 2471 | + /** | |
| 2472 | + * 相当于link函数。 | |
| 2473 | + * @param scope | |
| 2474 | + * @param element | |
| 2475 | + * @param attr | |
| 2476 | + */ | |
| 2477 | + post: function(scope, element, attr) { | |
| 2478 | + // name属性 | |
| 2479 | + if ($name_attr) { | |
| 2480 | + scope[ctrlAs]["$name_attr"] = $name_attr; | |
| 2481 | + } | |
| 2482 | + | |
| 2483 | + /** | |
| 2484 | + * 路牌列表点击(路牌列表中选中路牌) | |
| 2485 | + * @param fbcode | |
| 2486 | + */ | |
| 2487 | + scope[ctrlAs].$$internal_fb_click = function(fbcode) { | |
| 2488 | + scope[ctrlAs].$$dataSelected.push(fbcode); | |
| 2489 | + }; | |
| 2490 | + | |
| 2491 | + /** | |
| 2492 | + * 选中的路牌双击(删除选中的路牌) | |
| 2493 | + * @param $index | |
| 2494 | + */ | |
| 2495 | + scope[ctrlAs].$$internal_sellplist_dbclick = function($index) { | |
| 2496 | + scope[ctrlAs].$$dataSelected.splice($index, 1); | |
| 2497 | + }; | |
| 2498 | + | |
| 2499 | + /** | |
| 2500 | + * 验证内部数据,更新外部model | |
| 2501 | + */ | |
| 2502 | + scope[ctrlAs].$$internal_validate_model = function() { | |
| 2503 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 2504 | + | |
| 2505 | + if (data_temp && | |
| 2506 | + data_temp.length > 0) { | |
| 2507 | + | |
| 2508 | + // 更新内部model,用于外部验证 | |
| 2509 | + // 内部model的值暂时随意,以后再改 | |
| 2510 | + scope[ctrlAs].$$internalmodel = {desc: "ok"}; | |
| 2511 | + | |
| 2512 | + // 更新外部model字段 | |
| 2513 | + if ($fbgsname_attr) { | |
| 2514 | + console.log("$fbgsname=" + data_temp.join(',')); | |
| 2515 | + eval("scope[ctrlAs].model" + "." + $fbgsname_attr + " = data_temp.join(',');"); | |
| 2516 | + } | |
| 2517 | + | |
| 2518 | + } else { | |
| 2519 | + scope[ctrlAs].$$internalmodel = undefined; | |
| 2520 | + } | |
| 2521 | + }; | |
| 2522 | + | |
| 2523 | + // 监控内部数据,$$data_selected 变化 | |
| 2524 | + scope.$watch( | |
| 2525 | + function() { | |
| 2526 | + return scope[ctrlAs].$$dataSelected; | |
| 2527 | + }, | |
| 2528 | + function(newValue, oldValue) { | |
| 2529 | + scope[ctrlAs].$$internal_validate_model(); | |
| 2530 | + }, | |
| 2531 | + true | |
| 2532 | + ); | |
| 2533 | + | |
| 2534 | + // 监控路牌名称范围值的变化,处理初始化赋值 | |
| 2535 | + attr.$observe("fbgsvalue", function(value) { | |
| 2536 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 2537 | + | |
| 2538 | + if (value && value != "" && data_temp && data_temp.length == 0) { | |
| 2539 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 2540 | + var fbgses = []; | |
| 2541 | + var i = 0; | |
| 2542 | + | |
| 2543 | + if (value.indexOf(",") >= 0) { | |
| 2544 | + fbgses = value.split(","); | |
| 2545 | + } else { | |
| 2546 | + for (i = 0; i < value.length; i++) { | |
| 2547 | + fbgses.push(value.substr(i, 1)); | |
| 2548 | + } | |
| 2549 | + } | |
| 2550 | + | |
| 2551 | + if (data_temp && data_temp.length == 0) { // 初始创建 | |
| 2552 | + for (i = 0; i < fbgses.length; i++) { | |
| 2553 | + if (fbgses[i] == "1" || fbgses[i] == "0") { | |
| 2554 | + data_temp.push(fbgses[i]); | |
| 2555 | + } | |
| 2556 | + } | |
| 2557 | + } | |
| 2558 | + } | |
| 2559 | + }); | |
| 2560 | + } | |
| 2561 | + }; | |
| 2562 | + } | |
| 2563 | + } | |
| 2564 | + } | |
| 2565 | + ]); | |
| 2412 | 2566 | |
| 2413 | 2567 | |
| 2414 | 2568 | /** |
| ... | ... | @@ -4084,6 +4238,7 @@ angular.module('ScheduleApp').factory( |
| 4084 | 4238 | formobj.fcno = cellinfo.fcno; |
| 4085 | 4239 | formobj.bcs = cellinfo.bcs; |
| 4086 | 4240 | formobj.isFB = cellinfo.isfb; |
| 4241 | + formobj.isTS = 0; | |
| 4087 | 4242 | |
| 4088 | 4243 | formobj.bcType = colinfo.bc_type; |
| 4089 | 4244 | formobj.xlDir = colinfo.xldir; | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/edit.html
| ... | ... | @@ -150,17 +150,41 @@ |
| 150 | 150 | </div> |
| 151 | 151 | |
| 152 | 152 | <div class="form-group has-success has-feedback"> |
| 153 | + <label class="col-md-2 control-label">翻班类型*:</label> | |
| 154 | + <div class="col-md-3"> | |
| 155 | + <sa-Select5 name="fbtype" | |
| 156 | + model="ctrl.scheduleRuleManageForSave" | |
| 157 | + cmaps="{'fbtype': 'code'}" | |
| 158 | + dcname="fbtype" | |
| 159 | + icname="code" | |
| 160 | + dsparams="{{ {type: 'dic', param: 'FbType' } | json }}" | |
| 161 | + iterobjname="item" | |
| 162 | + iterobjexp="item.name" | |
| 163 | + searchph="翻班类型..." | |
| 164 | + searchexp="this.name" | |
| 165 | + required > | |
| 166 | + </sa-Select5> | |
| 167 | + </div> | |
| 168 | + <!-- 隐藏快,显示验证信息 --> | |
| 169 | + <div class="alert alert-danger well-sm" ng-show="myForm.fbtype.$error.required"> | |
| 170 | + 翻班类型必须选择 | |
| 171 | + </div> | |
| 172 | + </div> | |
| 173 | + | |
| 174 | + | |
| 175 | + <div class="form-group has-success has-feedback" ng-if="ctrl.scheduleRuleManageForSave.fbtype == 'FBGSMODE'"> | |
| 153 | 176 | <label class="col-md-2 control-label">翻班格式*:</label> |
| 154 | 177 | <div class="col-md-6"> |
| 155 | - <sa-Checkboxgroup model="ctrl.scheduleRuleManageForSave" | |
| 156 | - name="fbgs" | |
| 157 | - dcvalue="{{ctrl.scheduleRuleManageForSave.fbgs}}" | |
| 158 | - dcname="fbgs" | |
| 159 | - required > | |
| 160 | - </sa-Checkboxgroup> | |
| 178 | + <sa-Fbgsgroup model="ctrl.scheduleRuleManageForSave" | |
| 179 | + name="fbgs" | |
| 180 | + fbgsvalue="{{ctrl.scheduleRuleManageForSave.fbgs}}" | |
| 181 | + fbgsname="fbgs" | |
| 182 | + required | |
| 183 | + > | |
| 184 | + </sa-Fbgsgroup> | |
| 161 | 185 | </div> |
| 162 | 186 | <div class="alert alert-danger well-sm" ng-show="myForm.fbgs.$error.required"> |
| 163 | - 请操作一下1 | |
| 187 | + 翻班格式不能为空 | |
| 164 | 188 | </div> |
| 165 | 189 | </div> |
| 166 | 190 | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/form.html
| ... | ... | @@ -148,13 +148,44 @@ |
| 148 | 148 | </div> |
| 149 | 149 | </div> |
| 150 | 150 | |
| 151 | - <!--<div class="form-group">--> | |
| 152 | - <!--<label class="col-md-2 control-label">翻班格式:</label>--> | |
| 153 | - <!--<div class="col-md-4">--> | |
| 154 | - <!--<input type="text" class="form-control" name="fbgs" ng-model="ctrl.scheduleRuleManageForSave.fbgs"--> | |
| 155 | - <!--placeholder="车辆翻班格式"/>--> | |
| 156 | - <!--</div>--> | |
| 157 | - <!--</div>--> | |
| 151 | + <div class="form-group has-success has-feedback"> | |
| 152 | + <label class="col-md-2 control-label">翻班类型*:</label> | |
| 153 | + <div class="col-md-3"> | |
| 154 | + <sa-Select5 name="fbtype" | |
| 155 | + model="ctrl.scheduleRuleManageForSave" | |
| 156 | + cmaps="{'fbtype': 'code'}" | |
| 157 | + dcname="fbtype" | |
| 158 | + icname="code" | |
| 159 | + dsparams="{{ {type: 'dic', param: 'FbType' } | json }}" | |
| 160 | + iterobjname="item" | |
| 161 | + iterobjexp="item.name" | |
| 162 | + searchph="翻班类型..." | |
| 163 | + searchexp="this.name" | |
| 164 | + required > | |
| 165 | + </sa-Select5> | |
| 166 | + </div> | |
| 167 | + <!-- 隐藏快,显示验证信息 --> | |
| 168 | + <div class="alert alert-danger well-sm" ng-show="myForm.fbtype.$error.required"> | |
| 169 | + 翻班类型必须选择 | |
| 170 | + </div> | |
| 171 | + </div> | |
| 172 | + | |
| 173 | + | |
| 174 | + <div class="form-group has-success has-feedback" ng-if="ctrl.scheduleRuleManageForSave.fbtype == 'FBGSMODE'"> | |
| 175 | + <label class="col-md-2 control-label">翻班格式*:</label> | |
| 176 | + <div class="col-md-6"> | |
| 177 | + <sa-Fbgsgroup model="ctrl.scheduleRuleManageForSave" | |
| 178 | + name="fbgs" | |
| 179 | + fbgsvalue="{{ctrl.scheduleRuleManageForSave.fbgs}}" | |
| 180 | + fbgsname="fbgs" | |
| 181 | + required | |
| 182 | + > | |
| 183 | + </sa-Fbgsgroup> | |
| 184 | + </div> | |
| 185 | + <div class="alert alert-danger well-sm" ng-show="myForm.fbgs.$error.required"> | |
| 186 | + 翻班格式不能为空 | |
| 187 | + </div> | |
| 188 | + </div> | |
| 158 | 189 | |
| 159 | 190 | |
| 160 | 191 | <!-- 其他form-group --> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/module.js
| ... | ... | @@ -277,10 +277,12 @@ angular.module('ScheduleApp').controller( |
| 277 | 277 | if (id) { |
| 278 | 278 | ScheduleRuleManage.get({id: id}, function(value) { |
| 279 | 279 | self.scheduleRuleManageForSave = value; |
| 280 | + self.scheduleRuleManageForSave.fbtype = self.scheduleRuleManageForSave.fbtype || "TIMETABLEMODE"; | |
| 280 | 281 | }); |
| 281 | 282 | } else { |
| 282 | 283 | // 初始表单,从查询条件中获取线路id |
| 283 | 284 | self.scheduleRuleManageForSave.xl.id = service.getSearchCondition()['xl.id_eq']; |
| 285 | + self.scheduleRuleManageForSave.fbtype = self.scheduleRuleManageForSave.fbtype || "TIMETABLEMODE"; | |
| 284 | 286 | } |
| 285 | 287 | |
| 286 | 288 | // 提交方法 | ... | ... |