Commit 41abba8a678f9299ced91983accd7952c4c8e7ec

Authored by 徐烜
1 parent 054d9456

iss提交15;

修改排班计划页面,修改状态显示逻辑
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/list.html
... ... @@ -135,14 +135,85 @@
135 135  
136 136 </td>
137 137 <td>
138   - <a href="#" class="btn btn-success btn-sm" ng-if="info.planResult == 'ok'">
  138 + <a sweetalert
  139 + sweet-options="{title: '排班信息',text: '线路:' + info.xl.name +
  140 + '</br>开始时间:' + ctrl.toDateStr(info.scheduleFromTime) +
  141 + '</br>结束时间:' + ctrl.toDateStr(info.scheduleToTime) +
  142 + '</br>事务Id:' + ctrl.getPlanResultXid(info) +
  143 + '</br>事务描述:' + ctrl.getPlanResultDesc(info),
  144 + html: true,
  145 + type: 'info'}"
  146 + sweet-on-confirm=""
  147 + class="btn btn-info btn-sm"
  148 + ng-if="ctrl.isPlanGenerate_PREPARE(info)">
  149 + <span>准备中</span>
  150 + <i class="fa fa-spinner" aria-hidden="true"></i>
  151 + </a>
  152 +
  153 + <a sweetalert
  154 + sweet-options="{title: '排班信息',text: '线路:' + info.xl.name +
  155 + '</br>开始时间:' + ctrl.toDateStr(info.scheduleFromTime) +
  156 + '</br>结束时间:' + ctrl.toDateStr(info.scheduleToTime) +
  157 + '</br>事务Id:' + ctrl.getPlanResultXid(info) +
  158 + '</br>事务描述:' + ctrl.getPlanResultDesc(info),
  159 + html: true,
  160 + type: 'info'}"
  161 + sweet-on-confirm=""
  162 + class="btn btn-primary btn-sm"
  163 + ng-if="ctrl.isPlanGenerate_PROGRESS(info)">
  164 + <span>进行中</span>
  165 + <i class="fa fa-spinner" aria-hidden="true"></i>
  166 + </a>
  167 +
  168 + <a sweetalert
  169 + sweet-options="{title: '排班信息',text: '线路:' + info.xl.name +
  170 + '</br>开始时间:' + ctrl.toDateStr(info.scheduleFromTime) +
  171 + '</br>结束时间:' + ctrl.toDateStr(info.scheduleToTime) +
  172 + '</br>事务Id:' + ctrl.getPlanResultXid(info) +
  173 + '</br>事务描述:' + ctrl.getPlanResultDesc(info),
  174 + html: true,
  175 + type: 'success'}"
  176 + sweet-on-confirm=""
  177 + class="btn btn-success btn-sm"
  178 + ng-if="ctrl.isPlanGenerate_SUCCESS_ALL(info)">
139 179 <span>成功</span>
  180 + <i class="fa fa-check" aria-hidden="true"></i>
140 181 </a>
  182 +
141 183 <a sweetalert
142   - sweet-options="{title: '排班错误信息',text: '线路:' + info.xl.name + '</br>开始时间:' + ctrl.toDateStr(info.scheduleFromTime) + '</br>结束时间:' + ctrl.toDateStr(info.scheduleToTime) + '</br>' + info.planResult, html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}"
  184 + sweet-options="{title: '排班信息',text: '线路:' + info.xl.name +
  185 + '</br>开始时间:' + ctrl.toDateStr(info.scheduleFromTime) +
  186 + '</br>结束时间:' + ctrl.toDateStr(info.scheduleToTime) +
  187 + '</br>事务Id:' + ctrl.getPlanResultXid(info) +
  188 + '</br>事务描述:排班成功,但是排班结果有异常,如下:</br>' + ctrl.getPlanResultDesc(info),
  189 + html: true,
  190 + type: 'warning',
  191 + showCancelButton: true,
  192 + confirmButtonColor: '#DD6B55',
  193 + confirmButtonText: '是',
  194 + cancelButtonText: '取消'}"
  195 + sweet-on-confirm=""
  196 + class="btn btn-warning btn-sm"
  197 + ng-if="ctrl.isPlanGenerate_SUCCESS_NOT_ALL(info)">
  198 + <span>成功</span>
  199 + <i class="fa fa-exclamation" aria-hidden="true"></i>
  200 + </a>
  201 +
  202 + <a sweetalert
  203 + sweet-options="{title: '排班信息',text: '线路:' + info.xl.name +
  204 + '</br>开始时间:' + ctrl.toDateStr(info.scheduleFromTime) +
  205 + '</br>结束时间:' + ctrl.toDateStr(info.scheduleToTime) +
  206 + '</br>事务Id:' + ctrl.getPlanResultXid(info) +
  207 + '</br>事务描述:' + ctrl.getPlanResultDesc(info),
  208 + html: true,
  209 + type: 'error'}"
143 210 sweet-on-confirm=""
144 211 class="btn btn-danger btn-sm"
145   - ng-if="info.planResult != 'ok'">点击查错</a>
  212 + ng-if="ctrl.isPlanGenerate_FAILURE(info)">
  213 + <span>失败</span>
  214 + <i class="fa fa-times" aria-hidden="true"></i>
  215 + </a>
  216 +
146 217 </td>
147 218 <td>
148 219 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>-->
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/module.js
... ... @@ -213,6 +213,68 @@ angular.module(&#39;ScheduleApp&#39;).controller(
213 213  
214 214 self.doPage();
215 215  
  216 + //------------- 判断排班的完成状态及输出(以下)----------------//
  217 + self.getPlanResultXid = function(info) {
  218 + try {
  219 + var result = angular.fromJson(info["planResult"]);
  220 + return result["generateTransactionXID"];
  221 + } catch (err) {
  222 + return "";
  223 + }
  224 + };
  225 + self.getPlanResultDesc = function(info) {
  226 + try {
  227 + var result = angular.fromJson(info["planResult"]);
  228 + return result["generateDesc"];
  229 + } catch (err) {
  230 + return info["planResult"];
  231 + }
  232 + };
  233 + self.isPlanGenerate_PREPARE = function(info) {
  234 + try {
  235 + var result = angular.fromJson(info["planResult"]);
  236 + return result["generateStatus"] === 0 || result["generateStatus"] === 'PREPARE';
  237 + } catch (err) {
  238 + return false;
  239 + }
  240 + };
  241 + self.isPlanGenerate_PROGRESS = function(info) {
  242 + try {
  243 + var result = angular.fromJson(info["planResult"]);
  244 + return result["generateStatus"] === 1 || result["generateStatus"] === 'PROGRESS';
  245 + } catch (err) {
  246 + return false;
  247 + }
  248 + };
  249 + self.isPlanGenerate_SUCCESS_ALL = function(info) {
  250 + try {
  251 + var result = angular.fromJson(info["planResult"]);
  252 + return (result["generateStatus"] === 2 || result["generateStatus"] === 'SUCCESS') && result["generateDesc"] === "ok";
  253 + } catch (err) {
  254 + return info["planResult"] === "ok";
  255 + }
  256 +
  257 + };
  258 + self.isPlanGenerate_SUCCESS_NOT_ALL = function(info) {
  259 + try {
  260 + var result = angular.fromJson(info["planResult"]);
  261 + return (result["generateStatus"] === 2 || result["generateStatus"] === 'SUCCESS') && result["generateDesc"] !== "ok";
  262 + } catch (err) {
  263 + return info["planResult"] !== "ok";
  264 + }
  265 +
  266 + };
  267 + self.isPlanGenerate_FAILURE = function(info) {
  268 + try {
  269 + var result = angular.fromJson(info["planResult"]);
  270 + return result["generateStatus"] === 3 || result["generateStatus"] === 'FAILURE';
  271 + } catch (err) {
  272 + return false;
  273 + }
  274 + };
  275 +
  276 + //------------- 判断排班的完成状态(以上)----------------//
  277 +
216 278 // 转换日期成str
217 279 self.toDateStr = function(time) {
218 280 return $filter('date')(new Date(time), 'yyyy-MM-dd');
... ...