Commit 9bf3ddff6c555064b59c2799e91e1e35e4fe4add

Authored by 徐烜
1 parent c75d6f30

Update

src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -522,78 +522,86 @@ angular.module('ScheduleApp').factory(
522 522 );
523 523  
524 524 // 时刻表明细管理service
525   -angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) {
526   - return {
527   - rest: $resource(
528   - '/tidc/:id',
529   - {order: 'createDate', direction: 'DESC', id: '@id_route'},
530   - {
531   - get: {
532   - method: 'GET'
533   - },
534   - save: {
535   - method: 'POST'
536   - }
537   - }
538   - ),
539   - import: $resource(
540   - '/tidc/importfile',
541   - {},
542   - {
543   - do: {
544   - method: 'POST',
545   - headers: {
546   - 'Content-Type': 'application/x-www-form-urlencoded'
547   - },
548   - transformRequest: function(obj) {
549   - var str = [];
550   - for (var p in obj) {
551   - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  525 +angular.module('ScheduleApp').factory(
  526 + 'TimeTableDetailManageService_g',
  527 + [
  528 + '$resource',
  529 + function($resource) {
  530 + return {
  531 + rest: $resource(
  532 + '/tidc/:id',
  533 + {order: 'createDate', direction: 'DESC', id: '@id'},
  534 + {
  535 + get: {
  536 + method: 'GET'
  537 + },
  538 + save: {
  539 + method: 'POST'
552 540 }
553   - return str.join("&");
554 541 }
555   - }
556   - }
557   - ),
558   - edit: $resource(
559   - '/tidc/edit/:xlid/:ttid',
560   - {},
561   - {
562   - list: {
563   - method: 'GET'
564   - }
565   - }
566   - ),
567   - bcdetails: $resource(
568   - '/tidc/bcdetail',
569   - {},
570   - {
571   - list: {
572   - method: 'GET',
573   - isArray: true
574   - }
575   - }
576   - ),
577   - dataTools: $resource(
578   - '/tidc/:type',
579   - {},
580   - {
581   - dataExport: {
582   - method: 'GET',
583   - responseType: "arraybuffer",
584   - params: {
585   - type: "dataExportExt"
586   - },
587   - transformResponse: function(data, headers){
588   - return {data : data};
  542 + ),
  543 + import: $resource(
  544 + '/tidc/importfile',
  545 + {},
  546 + {
  547 + do: {
  548 + method: 'POST',
  549 + headers: {
  550 + 'Content-Type': 'application/x-www-form-urlencoded'
  551 + },
  552 + transformRequest: function(obj) {
  553 + var str = [];
  554 + for (var p in obj) {
  555 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  556 + }
  557 + return str.join("&");
  558 + }
  559 + }
589 560 }
590   - }
591   - }
592   - )
  561 + ),
  562 + edit: $resource(
  563 + '/tidc/edit/:xlid/:ttid',
  564 + {},
  565 + {
  566 + list: {
  567 + method: 'GET'
  568 + }
  569 + }
  570 + ),
  571 + bcdetails: $resource(
  572 + '/tidc/bcdetail',
  573 + {},
  574 + {
  575 + list: {
  576 + method: 'GET',
  577 + isArray: true
  578 + }
  579 + }
  580 + ),
  581 + dataTools: $resource(
  582 + '/tidc/:type',
  583 + {},
  584 + {
  585 + dataExport: {
  586 + method: 'GET',
  587 + responseType: "arraybuffer",
  588 + params: {
  589 + type: "dataExportExt"
  590 + },
  591 + transformResponse: function(data, headers){
  592 + return {data : data};
  593 + }
  594 + }
  595 + }
  596 + )
593 597  
594   - // TODO:导入数据
595   - };
596   -}]);
  598 + // TODO:导入数据
  599 + };
  600 +
  601 + }
  602 +
  603 + ]
  604 +);
597 605 // 项目通用的全局service服务,供不同的controller使用,自定义指令不使用
598 606  
599 607 // 文件下载服务
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
... ... @@ -1096,7 +1096,7 @@ ScheduleApp.config([
1096 1096 }
1097 1097 })
1098 1098 .state("ttInfoDetailManage_edit", { // 时刻表详细信息编辑
1099   - url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname',
  1099 + url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname/:rflag',
1100 1100 views: {
1101 1101 "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html'}
1102 1102 },
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html
... ... @@ -79,14 +79,14 @@
79 79 <table style="width: 2000px" class="table table-striped table-bordered table-hover table-checkable order-column">
80 80 <thead>
81 81 <tr>
82   - <th ng-repeat="head in ctrl.detailHeads track by $index">
  82 + <th ng-repeat="head in ctrl.getDetailHeads() track by $index">
83 83 <span ng-bind="head"></span>
84 84 </th>
85 85  
86 86 </tr>
87 87 </thead>
88 88 <tbody>
89   - <tr ng-repeat="info in ctrl.detailInfos">
  89 + <tr ng-repeat="info in ctrl.getDetailInfos()">
90 90 <td ng-repeat="cell in info track by $index">
91 91  
92 92 <!--<span ng-bind="cell.fcsj"></span>-->
... ... @@ -100,7 +100,7 @@
100 100 <!-- 班次类型图标(区间班次) -->
101 101 <i ng-if="cell.bc_type == 'region'" class="fa fa-circle-o-notch" aria-hidden="true"></i>
102 102 <!-- 分班班次 -->
103   - <i ng-if="cell.isfb == true" class="fa fa-adjust" aria-hidden="true"></i>
  103 + <i ng-if="cell.isFB == true" class="fa fa-adjust" aria-hidden="true"></i>
104 104  
105 105 <span ng-bind="cell.fcsj"></span>
106 106 <i class="fa fa-angle-down"></i>
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit2.html
... ... @@ -70,8 +70,9 @@
70 70 <!--<div ng-view></div>-->
71 71 <div class="fixDiv">
72 72  
73   - <hot-table col-headers="ctrl.getColHeaders()" datarows="ctrl.getData()">
74   - <hot-column ng-repeat="column in ctrl.columns" data="{{column.data}}"
  73 + <hot-table datarows="ctrl.getData()" settings="ctrl.settings">
  74 + <hot-column ng-repeat="column in ctrl.getColHeaders()"
  75 + data="{{column.data}}"
75 76 title="column.title" read-only="column.readOnly"></hot-column>
76 77 </hot-table>
77 78  
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/module2.js
... ... @@ -7,45 +7,151 @@ angular.module(&#39;ScheduleApp&#39;).factory(
7 7 var editInfo = {}; // 转换好的内部明细数据
8 8 editInfo.colHeaders = [ // 这个要动态生成的
9 9 {
10   - data: 'fcsj',
  10 + data: 'lpName',
11 11 title: '路牌',
12 12 type: 'text',
13 13 readOnly: true
14 14 },
15 15 {
16   - data: ''
  16 + data: 'fcsj1',
  17 + id: 'detailId1',
  18 + title: '出场',
  19 + type: 'text',
  20 + readOnly: true
  21 + },
  22 + {
  23 + data: 'fcsj2',
  24 + id: 'detailId2',
  25 + title: '和静路安亭老街',
  26 + type: 'text',
  27 + readOnly: true
17 28 },
18   - {},
19   -
20   -
21   -
22   -
23   - '路牌',
24   - '出场',
25   - '和静路安亭老街',
26   - '福泉路天山西路',
27   - '和静路安亭老街',
28   - '福泉路天山西路',
29   - '和静路安亭老街',
30   - '福泉路天山西路',
31   - '和静路安亭老街',
32   - '福泉路天山西路',
33   - '和静路安亭老街',
34   - '福泉路天山西路',
35   - '和静路安亭老街',
36   - '福泉路天山西路',
37   - '和静路安亭老街',
38   - '进场'
  29 + {
  30 + data: 'fcsj3',
  31 + id: 'detailId3',
  32 + title: '福泉路天山西路',
  33 + type: 'text',
  34 + readOnly: true
  35 + },
  36 + {
  37 + data: 'fcsj4',
  38 + id: 'detailId4',
  39 + title: '和静路安亭老街',
  40 + type: 'text',
  41 + readOnly: true
  42 + },
  43 + {
  44 + data: 'fcsj5',
  45 + id: 'detailId5',
  46 + title: '福泉路天山西路',
  47 + type: 'text',
  48 + readOnly: true
  49 + },
  50 + {
  51 + data: 'fcsj6',
  52 + id: 'detailId6',
  53 + title: '进场',
  54 + type: 'text',
  55 + readOnly: true
  56 + }
  57 +
  58 +
39 59 ];
40   - editInfo.items = [
41   - ['1', '0615', '2', '', '0630', '0755', '0935', '1055', '1305', '1425', '1640', '1805', '', '', '1915', '1925'],
42   - ['1', '0615', '', '2', '0630', '0755', '0935', '1055', '1305', '1425', '1640', '1805', '2', '', '1915', '1925'],
43   - ['1', '0615', '', '', '0630', '0755', '0935', '1055', '1305', '1425', '1640', '1805', '2', '', '1915', '1925'],
44   - ['1', '0615', '', '2', '0630', '0755', '0935', '1055', '1305', '1425', '1640', '1805', '', '2', '1915', '1925'],
45   - ['1', '0615', '2', '', '0630', '0755', '0935', '1055', '1305', '1425', '1640', '1805', '', '2', '1915', '1925'],
46   - ['1', '0615', '', '2', '0630', '0755', '0935', '1055', '1305', '1425', '1640', '1805', '', '', '1915', '1925']
  60 + editInfo.items= [
  61 + {
  62 + lpName: '1',
  63 + fcsj1: '0615',
  64 + detailId1: 1,
  65 + fcsj2: '0615',
  66 + detailId2: 1,
  67 + fcsj3: '0615',
  68 + detailId3: 1,
  69 + fcsj4: '0615',
  70 + detailId4: 1,
  71 + fcsj5: '0615',
  72 + detailId5: 1,
  73 + fcsj6: '0615',
  74 + detailId6: 1,
  75 + },
  76 + {
  77 + lpName: '2',
  78 + fcsj1: '0615',
  79 + detailId1: 1,
  80 + fcsj2: '0615',
  81 + detailId2: 1,
  82 + fcsj3: '0615',
  83 + detailId3: 1,
  84 + fcsj4: '0615',
  85 + detailId4: 1,
  86 + fcsj5: '0615',
  87 + detailId5: 1,
  88 + fcsj6: '0615',
  89 + detailId6: 1,
  90 + },
  91 + {
  92 + lpName: '3',
  93 + fcsj1: '0615',
  94 + detailId1: 1,
  95 + fcsj2: '0615',
  96 + detailId2: 1,
  97 + fcsj3: '0615',
  98 + detailId3: 1,
  99 + fcsj4: '0615',
  100 + detailId4: 1,
  101 + fcsj5: '0615',
  102 + detailId5: 1,
  103 + fcsj6: '0615',
  104 + detailId6: 1,
  105 + },
  106 + {
  107 + lpName: '4',
  108 + fcsj1: '0615',
  109 + detailId1: 1,
  110 + fcsj2: '0615',
  111 + detailId2: 1,
  112 + fcsj3: '0615',
  113 + detailId3: 1,
  114 + fcsj4: '0615',
  115 + detailId4: 1,
  116 + fcsj5: '0615',
  117 + detailId5: 1,
  118 + fcsj6: '0615',
  119 + detailId6: 1,
  120 + },
  121 + {
  122 + lpName: '5',
  123 + fcsj1: '0615',
  124 + detailId1: 1,
  125 + fcsj2: '0615',
  126 + detailId2: 1,
  127 + fcsj3: '0615',
  128 + detailId3: 1,
  129 + fcsj4: '0615',
  130 + detailId4: 1,
  131 + fcsj5: '0615',
  132 + detailId5: 1,
  133 + fcsj6: '0615',
  134 + detailId6: 1,
  135 + },
  136 + {
  137 + lpName: '6',
  138 + fcsj1: '0615',
  139 + detailId1: 1,
  140 + fcsj2: '0615',
  141 + detailId2: 1,
  142 + fcsj3: '0615',
  143 + detailId3: 1,
  144 + fcsj4: '0615',
  145 + detailId4: 1,
  146 + fcsj5: '0615',
  147 + detailId5: 1,
  148 + fcsj6: '0615',
  149 + detailId6: 1,
  150 + }
  151 +
47 152 ];
48 153  
  154 +
49 155 //this.columns = [
50 156 // {
51 157 // data: 'id',
... ... @@ -98,6 +204,17 @@ angular.module(&#39;ScheduleApp&#39;).controller(
98 204 self.getData = function() {
99 205 return detailService.getEditDetailInfo().items;
100 206 };
  207 + self.test = function() {
  208 + alert("test");
  209 + };
  210 +
  211 + var m1 = '<a href="javascript:" class="tool-action" ng-click="ctrl.test()">m1</a>';
  212 +
  213 + self.settings = {
  214 + contextMenu: [
  215 + m1
  216 + ]
  217 + };
101 218  
102 219 // TODO:判定是否刷新数据
103 220 detailService.refreshEditDetail();
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/route.js
... ... @@ -30,7 +30,7 @@ ScheduleApp.config([
30 30 }
31 31 })
32 32 .state("ttInfoDetailManage_edit", { // 时刻表详细信息编辑
33   - url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname',
  33 + url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname/:rflag',
34 34 views: {
35 35 "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html'}
36 36 },
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
1   -
2   -angular.module('ScheduleApp').factory('TimeTableDetailManageService_old', ['TimeTableDetailManageService_g', function(service) {
3   -
4   - return {
5   - /**
6   - * 获取明细信息。
7   - * @param id 车辆id
8   - * @return 返回一个 promise
9   - */
10   - getDetail: function(id) {
11   - var params = {id: id};
12   - return service.rest.get(params).$promise;
13   - },
14   - /**
15   - * 保存信息。
16   - * @param obj 车辆详细信息
17   - * @return 返回一个 promise
18   - */
19   - saveDetail: function(obj) {
20   - return service.rest.save(obj).$promise;
21   - },
22   - /**
23   - * 获取编辑用的时刻表明细数据。
24   - * @param ttid 时刻表id
25   - */
26   - getEditInfo: function(xlid, ttid) {
27   - var params = {xlid : xlid, ttid : ttid};
28   - return service.edit.list(params).$promise;
29   - }
30   - };
31   -
32   -}]);
33   -
34   -angular.module('ScheduleApp').controller('TimeTableDetailManageCtrl_old', ['TimeTableDetailManageService_old', '$stateParams', '$uibModal', function(service, $stateParams, $uibModal) {
35   - var self = this;
36   - self.xlid = $stateParams.xlid; // 获取传过来的线路id
37   - self.ttid = $stateParams.ttid; // 获取传过来的时刻表id
38   - self.xlname = $stateParams.xlname; // 获取传过来的线路名字
39   - self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字
40   -
41   - self.title = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息";
42   -
43   - // 载入待编辑的时刻表明细数据
44   - service.getEditInfo(self.xlid, self.ttid).then(
45   - function(result) {
46   - // TODO;获取数据待展示
47   - self.detailHeads = result.header;
48   - self.detailInfos = result.contents;
49   - },
50   - function(result) {
51   - alert("出错啦!");
  1 +// 时刻表明晰编辑信息service
  2 +angular.module('ScheduleApp').factory(
  3 + 'TimeTableDetailManageService_old',
  4 + [
  5 + 'TimeTableDetailManageService_g',
  6 + function(service) {
  7 +
  8 + // 查询对象类
  9 + var queryClass = service.rest;
  10 +
  11 + // 时刻表信息
  12 + var editInfo = {
  13 + detailHeads: [], // 时刻表头信息
  14 + detailInfos: [] // 时刻表明细信息
  15 + };
  16 +
  17 + return {
  18 + getQueryClass: function() {
  19 + return queryClass;
  20 + },
  21 + getEditInfo: function() {
  22 + return editInfo;
  23 + },
  24 +
  25 + /**
  26 + * 获取编辑用的时刻表明细数据。
  27 + * @param xlid 线路id
  28 + * @param ttid 时刻表id
  29 + */
  30 + refreshEditInfo: function(xlid, ttid) {
  31 + editInfo = {
  32 + detailHeads: [], // 时刻表头信息
  33 + detailInfos: [] // 时刻表明细信息
  34 + };
  35 +
  36 + service.edit.list({xlid: xlid, ttid: ttid}, function(result) {
  37 + editInfo.detailHeads = result.header;
  38 + editInfo.detailInfos = result.contents;
  39 + });
  40 + }
  41 + };
52 42 }
53   - );
54   -
55   - // 刷新数据
56   - self.refresh = function() {
57   - service.getEditInfo(self.xlid, self.ttid).then(
58   - function(result) {
59   - // TODO;获取数据待展示
60   - self.detailHeads = result.header;
61   - self.detailInfos = result.contents;
62   - },
63   - function(result) {
64   - alert("出错啦!");
65   - }
66   - );
67   - };
68   -
69   - /**
70   - * 反向操作。
71   - * @param cell 明细信息
72   - */
73   - self.changeDirect = function(detailInfo, xldir) {
74   - service.getDetail(detailInfo.ttdid).then(
75   - function(result) {
76   - result.xlDir = xldir;
77   - service.saveDetail(result).then(
78   - function(result) {
  43 +
  44 + ]
  45 +);
  46 +
  47 +// edit.html 时刻表编辑界面
  48 +angular.module('ScheduleApp').controller(
  49 + 'TimeTableDetailManageCtrl_old',
  50 + [
  51 + 'TimeTableDetailManageService_old',
  52 + '$stateParams',
  53 + '$uibModal',
  54 + function(service, $stateParams, $uibModal) {
  55 + var self = this;
  56 + self.xlid = $stateParams.xlid; // 获取传过来的线路id
  57 + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id
  58 + self.xlname = $stateParams.xlname; // 获取传过来的线路名字
  59 + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字
  60 + self.rflag = $stateParams.rflag; // 刷新标志
  61 +
  62 + self.title = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息";
  63 +
  64 + // 获取时刻表明细数据(内部保存)
  65 + self.getDetailHeads = function() {
  66 + return service.getEditInfo().detailHeads;
  67 + };
  68 + self.getDetailInfos = function() {
  69 + return service.getEditInfo().detailInfos;
  70 + };
  71 +
  72 + // 刷新时刻表数据
  73 + self.refresh = function() {
  74 + service.refreshEditInfo(self.xlid, self.ttid);
  75 + };
  76 +
  77 + // 查询对象类
  78 + var TTInfoDetail = service.getQueryClass();
  79 +
  80 + /**
  81 + * 反向操作。
  82 + * @param cell 明细信息
  83 + */
  84 + self.changeDirect = function(detailInfo, xldir) {
  85 + TTInfoDetail.get({id: detailInfo.ttdid}, function(value) {
  86 + value.xlDir = xldir;
  87 + value.$save(function() {
79 88 detailInfo.xldir = xldir;
80   - },
81   - function(result) {
82   - alert("出错啦!");
83   - }
84   - );
85   - },
86   - function(result) {
87   - alert("出错啦!");
88   - }
89   - );
90   - };
91   -
92   - /**
93   - * 更新分班。
94   - * @param detailInfo 明细信息
95   - * @param flag 分班标识
96   - */
97   - self.changeFB = function(detailInfo, flag) {
98   - service.getDetail(detailInfo.ttdid).then(
99   - function(result) {
100   - result.isFB = flag;
101   - service.saveDetail(result).then(
102   - function(result) {
103   - detailInfo.isfb = flag;
104   - },
105   - function(result) {
106   - alert("出错啦!");
107   - }
108   - );
109   - },
110   - function(result) {
111   - alert("出错啦!");
112   - }
113   - );
114   - };
115   -
116   - /**
117   - * 改变便次类型。
118   - * @param detailInfo 明细信息
119   - * @param type 班次类型
120   - */
121   - self.changeBCType = function(detailInfo, type) {
122   - service.getDetail(detailInfo.ttdid).then(
123   - function(result) {
124   - result.bcType = type;
125   - service.saveDetail(result).then(
126   - function(result) {
  89 + });
  90 + });
  91 + };
  92 +
  93 + /**
  94 + * 更新分班。
  95 + * @param detailInfo 明细信息
  96 + * @param flag 分班标识
  97 + */
  98 + self.changeFB = function(detailInfo, flag) {
  99 + TTInfoDetail.get({id: detailInfo.ttdid}, function(value) {
  100 + value.isFB = flag;
  101 + value.$save(function() {
  102 + detailInfo.isFB = flag;
  103 + });
  104 + });
  105 +
  106 + };
  107 +
  108 + /**
  109 + * 改变便次类型。
  110 + * @param detailInfo 明细信息
  111 + * @param type 班次类型
  112 + */
  113 + self.changeBCType = function(detailInfo, type) {
  114 + TTInfoDetail.get({id: detailInfo.ttdid}, function(value) {
  115 + value.bcType = type;
  116 + value.$save(function() {
127 117 detailInfo.bc_type = type;
128   - },
129   - function(result) {
130   - alert("出错啦!");
131   - }
132   - );
133   - },
134   - function(result) {
135   - alert("出错啦!");
136   - }
137   - );
138   - };
  118 + });
  119 + });
139 120  
140   -}]);
  121 + };
141 122  
142   -angular.module('ScheduleApp').controller('TimeTableDetailManageFormCtrl_old', ['TimeTableDetailManageService_old', '$stateParams', '$state', function(service, $stateParams, $state) {
143   - var self = this;
  123 + if (self.rflag) { // 是否刷新
  124 + self.refresh(); // 刷新数据
  125 + }
144 126  
145   - // 欲保存的busInfo信息,绑定
146   - self.TimeTableDetailForSave = {};
147 127  
148   - // 获取传过来的id,有的话就是修改,获取一遍数据
149   - var id = $stateParams.id; // 时刻明细班次id
150   - self.xlid = $stateParams.xlid; // 获取传过来的线路id
151   - self.ttid = $stateParams.ttid; // 获取传过来的时刻表id
152   - self.xlname = $stateParams.xlname; // 获取传过来的线路名字
153   - self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字
  128 + }
154 129  
155   - self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息";
  130 + ]
  131 +);
  132 +
  133 +// edit-detail.html 具体班次明细修改页面
  134 +angular.module('ScheduleApp').controller(
  135 + 'TimeTableDetailManageFormCtrl_old',
  136 + [
  137 + 'TimeTableDetailManageService_old',
  138 + '$stateParams',
  139 + '$state',
  140 + function(service, $stateParams, $state) {
  141 + var self = this;
  142 + var TTInfoDetail = service.getQueryClass();
  143 +
  144 + // 欲保存的busInfo信息,绑定
  145 + self.TimeTableDetailForSave = new TTInfoDetail;
  146 +
  147 + // 获取传过来的id,有的话就是修改,获取一遍数据
  148 + var id = $stateParams.id; // 时刻明细班次id
  149 + self.xlid = $stateParams.xlid; // 获取传过来的线路id
  150 + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id
  151 + self.xlname = $stateParams.xlname; // 获取传过来的线路名字
  152 + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字
  153 +
  154 + self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息";
  155 +
  156 + if (id) {
  157 + TTInfoDetail.get({id: id}, function(value) {
  158 + self.TimeTableDetailForSave = value;
  159 + self.title2 =
  160 + self.xlname + "(" + self.ttname + ")" + "时刻表明细信息" +
  161 + "->路牌" + self.TimeTableDetailForSave.lp.lpName +
  162 + "->发车顺序号" + self.TimeTableDetailForSave.fcno +
  163 + "->班次详细信息";
  164 + });
156 165  
157   - if (id) {
158   - self.TimeTableDetailForSave.id = id;
159   - service.getDetail(id).then(
160   - function(result) {
161   - var key;
162   - for (key in result) {
163   - self.TimeTableDetailForSave[key] = result[key];
164   - }
  166 + }
  167 +
  168 + // 提交方法
  169 + self.submit = function() {
  170 + console.log(self.TimeTableDetailForSave);
  171 + //if (self.busInfoForSave) {
  172 + // delete $stateParams.id;
  173 + //}
  174 + self.TimeTableDetailForSave.$save(function() {
  175 + // TODO:需要修正内部edit的值
165 176  
166   - self.title2 =
167   - self.xlname + "(" + self.ttname + ")" + "时刻表明细信息" +
168   - "->路牌" + self.TimeTableDetailForSave.lp.lpName +
169   - "->发车顺序号" + self.TimeTableDetailForSave.fcno +
170   - "->班次详细信息";
171 177  
172   - },
173   - function(result) {
174   - alert("出错啦!");
175   - }
176   - );
177   - }
178   -
179   - // 提交方法
180   - self.submit = function() {
181   - console.log(self.TimeTableDetailForSave);
182   - //if (self.busInfoForSave) {
183   - // delete $stateParams.id;
184   - //}
185   - service.saveDetail(self.TimeTableDetailForSave).then(
186   - function(result) {
187   - // TODO:弹出框方式以后改
188   - if (result.status == 'SUCCESS') {
189   - //alert("保存成功!");
190 178 $state.go("ttInfoDetailManage_edit", {
191 179 xlid: self.xlid,
192 180 ttid: self.ttid,
193 181 xlname: self.xlname,
194 182 ttname: self.ttname
195 183 });
196   - } else {
197   - alert("保存异常!");
198   - }
199   - },
200   - function(result) {
201   - // TODO:弹出框方式以后改
202   - alert("出错啦!");
203   - }
204   - );
205   - };
  184 + });
206 185  
207   -}]);
  186 + };
  187 +
  188 + }
  189 + ]
  190 +);
208 191  
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/list.html
... ... @@ -79,10 +79,10 @@
79 79 <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span>
80 80 </td>
81 81 <td>
82   - <a ui-sref="ttInfoDetailManage_edit({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})"
  82 + <a ui-sref="ttInfoDetailManage_edit({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name, rflag : true})"
83 83 class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑 </a>
84   - <a ui-sref="ttInfoDetailManage_edit2({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})"
85   - class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑2 </a>
  84 + <!--<a ui-sref="ttInfoDetailManage_edit2({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})"-->
  85 + <!--class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑2 </a>-->
86 86 <a ng-click="ctrl.toTtInfoDetailAuto()"
87 87 class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 生成 </a>
88 88 <a ui-sref="ttInfoDetailManage_form({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})"
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/service.js
... ... @@ -43,75 +43,83 @@ angular.module(&#39;ScheduleApp&#39;).factory(
43 43 );
44 44  
45 45 // 时刻表明细管理service
46   -angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) {
47   - return {
48   - rest: $resource(
49   - '/tidc/:id',
50   - {order: 'createDate', direction: 'DESC', id: '@id_route'},
51   - {
52   - get: {
53   - method: 'GET'
54   - },
55   - save: {
56   - method: 'POST'
57   - }
58   - }
59   - ),
60   - import: $resource(
61   - '/tidc/importfile',
62   - {},
63   - {
64   - do: {
65   - method: 'POST',
66   - headers: {
67   - 'Content-Type': 'application/x-www-form-urlencoded'
68   - },
69   - transformRequest: function(obj) {
70   - var str = [];
71   - for (var p in obj) {
72   - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  46 +angular.module('ScheduleApp').factory(
  47 + 'TimeTableDetailManageService_g',
  48 + [
  49 + '$resource',
  50 + function($resource) {
  51 + return {
  52 + rest: $resource(
  53 + '/tidc/:id',
  54 + {order: 'createDate', direction: 'DESC', id: '@id'},
  55 + {
  56 + get: {
  57 + method: 'GET'
  58 + },
  59 + save: {
  60 + method: 'POST'
  61 + }
  62 + }
  63 + ),
  64 + import: $resource(
  65 + '/tidc/importfile',
  66 + {},
  67 + {
  68 + do: {
  69 + method: 'POST',
  70 + headers: {
  71 + 'Content-Type': 'application/x-www-form-urlencoded'
  72 + },
  73 + transformRequest: function(obj) {
  74 + var str = [];
  75 + for (var p in obj) {
  76 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  77 + }
  78 + return str.join("&");
  79 + }
  80 + }
  81 + }
  82 + ),
  83 + edit: $resource(
  84 + '/tidc/edit/:xlid/:ttid',
  85 + {},
  86 + {
  87 + list: {
  88 + method: 'GET'
73 89 }
74   - return str.join("&");
75 90 }
76   - }
77   - }
78   - ),
79   - edit: $resource(
80   - '/tidc/edit/:xlid/:ttid',
81   - {},
82   - {
83   - list: {
84   - method: 'GET'
85   - }
86   - }
87   - ),
88   - bcdetails: $resource(
89   - '/tidc/bcdetail',
90   - {},
91   - {
92   - list: {
93   - method: 'GET',
94   - isArray: true
95   - }
96   - }
97   - ),
98   - dataTools: $resource(
99   - '/tidc/:type',
100   - {},
101   - {
102   - dataExport: {
103   - method: 'GET',
104   - responseType: "arraybuffer",
105   - params: {
106   - type: "dataExportExt"
107   - },
108   - transformResponse: function(data, headers){
109   - return {data : data};
  91 + ),
  92 + bcdetails: $resource(
  93 + '/tidc/bcdetail',
  94 + {},
  95 + {
  96 + list: {
  97 + method: 'GET',
  98 + isArray: true
  99 + }
  100 + }
  101 + ),
  102 + dataTools: $resource(
  103 + '/tidc/:type',
  104 + {},
  105 + {
  106 + dataExport: {
  107 + method: 'GET',
  108 + responseType: "arraybuffer",
  109 + params: {
  110 + type: "dataExportExt"
  111 + },
  112 + transformResponse: function(data, headers){
  113 + return {data : data};
  114 + }
  115 + }
110 116 }
111   - }
112   - }
113   - )
  117 + )
114 118  
115   - // TODO:导入数据
116   - };
117   -}]);
118 119 \ No newline at end of file
  120 + // TODO:导入数据
  121 + };
  122 +
  123 + }
  124 +
  125 + ]
  126 +);
119 127 \ No newline at end of file
... ...