Commit fb26e70bfcd748f6fa5e7bd8c0b9203b01d7f83d

Authored by Swarn Singh
1 parent ea15674c8a
Exists in master

fuel manager done

app/css/custom.css
... ... @@ -390,10 +390,53 @@ font-size: 10px !important;
390 390 float: left;
391 391 }
392 392 .appliesTableBody > div.lastDiv textarea{
393   - width: 100%;
  393 + width: 40%;
394 394 height: 60px;
395 395 margin: 15px 0;
396 396 resize: none;
  397 + float: left;
  398 +}
  399 +.reportedByTag{
  400 + width: 60%;
  401 + height: 80px;
  402 + border-top: 10px solid #393;
  403 + border-left: 10px solid #6c6;
  404 + border-radius: 5px 0 0 5px;
  405 + background-color: #d7d7d7;
  406 + float: right;
  407 + position: relative;
  408 + right: -13px;
  409 + margin-top: 5px;
  410 + font-size: 11px;
  411 +}
  412 +.confirmedTag{
  413 + background-color: #393;
  414 + color: #fff;
  415 + -webkit-transform: rotate(-90deg);
  416 + -moz-transform: rotate(-90deg);
  417 + -o-transform: rotate(-90deg);
  418 + -ms-transform: rotate(-90deg);
  419 + transform: rotate(-90deg);
  420 + position: absolute;
  421 + bottom: 25px;
  422 + left: -24px;
  423 + width: 71px;
  424 + text-align: center;
  425 + font-size: 11px;
  426 +}
  427 +.reportedByTag table{
  428 + margin-left: 27px;
  429 + width: calc(100% - 27px);
  430 +}
  431 +.reportedByTag table td{
  432 + font-size: 11px;
  433 + text-align: center;
  434 + font-weight: bold;
  435 +}
  436 +.reportedByTag table tr:last-child td{
  437 + text-align: left;
  438 + font-weight: normal;
  439 + font-size: 10px;
397 440 }
398 441 .feeManagerRight{
399 442 min-height: 70px;
... ... @@ -513,6 +556,7 @@ font-size: 10px !important;
513 556 left: 0;
514 557 width: 100%;
515 558 height: 100%;
  559 + z-index: 999;
516 560 }
517 561 .customModalInner{
518 562 width: 100%;
... ... @@ -549,4 +593,4 @@ font-size: 10px !important;
549 593 .customModelFooter input[type="submit"]{
550 594 background-color: #6ad46a;
551 595 border: 1px solid #ccc;
552 596 -}
  597 +}
553 598 \ No newline at end of file
... ...
app/partials/fuelManager/fuelManager.controller.js
... ... @@ -44,9 +44,11 @@
44 44 }
45 45 $scope.avoidanceList.rampFeesAndAvoidanceList = $scope.addData;
46 46 $scope.avoidanceList.fboUserId = $scope.currentUserData;
47   - console.log('data', $scope.avoidanceList);
48 47  
49 48 fuelManagerService.updateFullList($scope.avoidanceList).then(function(result) {
  49 + toastr.success(''+result.success+'', {
  50 + closeButton: true
  51 + })
50 52 fuelManagerService.getFullList().then(function(result) {
51 53 $scope.fullJetList = result;
52 54 })
... ... @@ -56,16 +58,141 @@
56 58  
57 59 }
58 60  
  61 + $scope.dropOptions = {};
59 62  
60 63 fuelManagerService.getOptions().then(function(result) {
61 64 $scope.dropOptions = result;
62 65 })
63 66  
  67 + fuelManagerService.getAircrafts().then(function(result) {
  68 + $scope.aircrafts = result;
  69 + })
  70 +
  71 + $scope.openRampFeeModal = false;
  72 + $scope.customRampData = {};
  73 + $scope.customRampData.rampFeesAndAvoidanceList = {};
  74 + $scope.customRampData.rampFeesAndAvoidanceList.aircraftType = null;
  75 +
  76 + $scope.customRampData.rampFeesAndAvoidanceList.aircraftMake = '';
  77 + $scope.customRampData.rampFeesAndAvoidanceList.aircraftSizeId = '';
  78 + $scope.customRampData.rampFeesAndAvoidanceList.tailNumber = '';
  79 + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMin = '';
  80 + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMax = '';
  81 + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMin = '';
  82 + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMax = '';
  83 + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMax = '';
  84 + $scope.customRampData.rampFeesAndAvoidanceList.rampFees = '';
  85 + $scope.customRampData.rampFeesAndAvoidanceList.avoidance = '';
  86 + //$scope.customRampData.fboUserId = '';
  87 +
64 88 //$scope.rampFeeType = '';
65 89  
66   - $scope.openRampModal = function(rampFeeType){
67   - console.log('rampFeeType', rampFeeType);
  90 + $scope.openRampModal = function(){
  91 + //console.log('$scope.dropOptions', $scope.dropOptions)
68 92  
  93 +
  94 + if ($scope.customRampData.rampFeesAndAvoidanceList.aircraftType === 'WEIGHT') {
  95 + $scope.openRampFeeModal = true;
  96 + $scope.showWeight = true;
  97 + $scope.showWingspan = false;
  98 + $scope.showTail = false;
  99 + $scope.showAircraft = false;
  100 + $scope.customRampData.rampFeesAndAvoidanceList.aircraftMake = '';
  101 + $scope.customRampData.rampFeesAndAvoidanceList.tailNumber = '';
  102 + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMin = '';
  103 + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMax = '';
  104 + $scope.customRampData.rampFeesAndAvoidanceList.rampFees = '';
  105 + $scope.customRampData.rampFeesAndAvoidanceList.avoidance = '';
  106 + }else if ($scope.customRampData.rampFeesAndAvoidanceList.aircraftType === 'MAKE_AND_MODEL') {
  107 + $scope.openRampFeeModal = true;
  108 + $scope.showWeight = false;
  109 + $scope.showWingspan = false;
  110 + $scope.showTail = false;
  111 + $scope.showAircraft = true;
  112 + $scope.customRampData.rampFeesAndAvoidanceList.tailNumber = '';
  113 + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMin = '';
  114 + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMax = '';
  115 + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMin = '';
  116 + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMax = '';
  117 + $scope.customRampData.rampFeesAndAvoidanceList.rampFees = '';
  118 + $scope.customRampData.rampFeesAndAvoidanceList.avoidance = '';
  119 + }else if ($scope.customRampData.rampFeesAndAvoidanceList.aircraftType === 'WINGSPAN') {
  120 + $scope.openRampFeeModal = true;
  121 + $scope.showWeight = false;
  122 + $scope.showWingspan = true;
  123 + $scope.showTail = false;
  124 + $scope.showAircraft = false;
  125 + $scope.customRampData.rampFeesAndAvoidanceList.aircraftMake = '';
  126 + $scope.customRampData.rampFeesAndAvoidanceList.tailNumber = '';
  127 + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMin = '';
  128 + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMax = '';
  129 + $scope.customRampData.rampFeesAndAvoidanceList.rampFees = '';
  130 + $scope.customRampData.rampFeesAndAvoidanceList.avoidance = '';
  131 + }else if ($scope.customRampData.rampFeesAndAvoidanceList.aircraftType === 'TAIL') {
  132 + $scope.openRampFeeModal = true;
  133 + $scope.showWeight = false;
  134 + $scope.showWingspan = false;
  135 + $scope.showTail = true;
  136 + $scope.showAircraft = false;
  137 + $scope.customRampData.rampFeesAndAvoidanceList.aircraftMake = '';
  138 + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMin = '';
  139 + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMax = '';
  140 + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMin = '';
  141 + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMax = '';
  142 + $scope.customRampData.rampFeesAndAvoidanceList.rampFees = '';
  143 + $scope.customRampData.rampFeesAndAvoidanceList.avoidance = '';
  144 + }else if ($scope.customRampData.rampFeesAndAvoidanceList.aircraftType = null){
  145 + $scope.openRampFeeModal = false;
  146 + $scope.showWeight = false;
  147 + $scope.showWingspan = false;
  148 + $scope.showTail = false;
  149 + $scope.showAircraft = false;
  150 + }else{
  151 + $scope.openRampFeeModal = false;
  152 + $scope.showWeight = false;
  153 + $scope.showWingspan = false;
  154 + $scope.showTail = false;
  155 + $scope.showAircraft = false;
  156 + }
  157 + for (var i = 0; $scope.dropOptions.length; i++) {
  158 + if ($scope.customRampData.rampFeesAndAvoidanceList.aircraftType === $scope.dropOptions[i].size) {
  159 + $scope.customRampData.rampFeesAndAvoidanceList.aircraftSizeId = $scope.dropOptions[i].id;
  160 + }
  161 + }
  162 + }
  163 +
  164 +
  165 +
  166 + $scope.addCustomRamp = function(){
  167 +
  168 + $scope.newData = {};
  169 + $scope.newData.rampFeesAndAvoidanceList = [];
  170 + $scope.newData.rampFeesAndAvoidanceList.push($scope.customRampData.rampFeesAndAvoidanceList);
  171 + $scope.newData.fboUserId = $scope.currentUserData;
  172 + console.log('$scope.customRampData', $scope.newData)
  173 + fuelManagerService.updateFullList($scope.newData).then(function(result) {
  174 + toastr.success(''+result.success+'', {
  175 + closeButton: true
  176 + });
  177 + $scope.openRampFeeModal = false;
  178 + $scope.customRampData.rampFeesAndAvoidanceList = {};
  179 + $scope.customRampData.rampFeesAndAvoidanceList.aircraftType = null;
  180 + $scope.newData = {};
  181 + $scope.newData.rampFeesAndAvoidanceList = [];
  182 + fuelManagerService.getFullList().then(function(result) {
  183 + $scope.fullJetList = result;
  184 + })
  185 + })
  186 + }
  187 +
  188 + $scope.closeRampFeeModel = function(){
  189 + $scope.openRampFeeModal = false;
  190 + $scope.showWeight = false;
  191 + $scope.showWingspan = false;
  192 + $scope.showTail = false;
  193 + $scope.showAircraft = false;
  194 + $scope.customRampData.rampFeesAndAvoidanceList = {};
  195 + $scope.customRampData.rampFeesAndAvoidanceList.aircraftType = null;
69 196 }
70 197  
71 198 $scope.parentOpen = function(index){
... ...
app/partials/fuelManager/fuelManager.html
... ... @@ -317,9 +317,9 @@
317 317 <div class="widget-header">
318 318 <i class="fa fa-pencil"></i>
319 319 <h3>Ramp Fee Manager</h3>
320   - <select style="float: right; margin: 8px 10px;" ng-model="rampFeeType" ng-change="openRampModal(rampFeeType)">
  320 + <select style="float: right; margin: 8px 10px;" ng-model="customRampData.rampFeesAndAvoidanceList.aircraftType" ng-change="openRampModal()">
321 321 <option disabled selected value="">Ramp Fee By Category</option>
322   - <option ng-repeat="modals in dropOptions" value="{{modals.id}}">{{modals.size}}</option>
  322 + <option ng-repeat="modals in dropOptions" value="{{modals.size}}">{{modals.size}}</option>
323 323 </select>
324 324 </div>
325 325 <!-- /widget-header -->
... ... @@ -400,6 +400,32 @@
400 400 </div>
401 401 <div class="lastDiv">
402 402 <textarea ng-model="jets.rampFeesAndAvoidance.notes"></textarea>
  403 + <div class="reportedByTag">
  404 + <div class="confirmedTag">Confirmed</div>
  405 + <table>
  406 + <tr>
  407 + <td width="50%">
  408 + Reported By:
  409 + </td>
  410 + <td width="50%">
  411 + {{jets.rampFeesAndAvoidance.reportedBy}}
  412 + </td>
  413 + </tr>
  414 + <tr>
  415 + <td width="50%">
  416 + Reported On:
  417 + </td>
  418 + <td width="50%">
  419 + {{jets.rampFeesAndAvoidance.reportedOn}}
  420 + </td>
  421 + </tr>
  422 + <tr>
  423 + <td colspan="2">
  424 + <i>Click the Save Form button to Re-Confirm</i>
  425 + </td>
  426 + </tr>
  427 + </table>
  428 + </div>
403 429 </div>
404 430 <div class="clearfix"></div>
405 431 </div>
... ... @@ -432,7 +458,7 @@
432 458 <!-- /span12 -->
433 459 </div> <!-- /container 2 -->
434 460  
435   -<div>
  461 +<div ng-show="openRampFeeModal">
436 462 <div class="customBackdrop">
437 463 <div class="customModalInner">
438 464 <div class="customModelHead">
... ... @@ -441,26 +467,126 @@
441 467 Add Ramp Fee
442 468 </p>
443 469 <p class="pull-right">
444   - <i class="fa fa-times" aria-hidden="true" style="cursor: pointer;"></i>
  470 + <i class="fa fa-times" aria-hidden="true" style="cursor: pointer;" ng-click="closeRampFeeModel()"></i>
445 471 </p>
446 472 <div class="clearfix"></div>
447 473 </div>
448 474 <div class="customModelBody">
449 475  
450   - <div class="col-xs-12 col-sm-3">
  476 + <div class="col-xs-12 col-sm-4">
451 477 Type:
452 478 </div>
453   - <div class="col-xs-12 col-sm-4">
454   - <select class="form-control" style="border-radius: 0; height: 26px;" ng-model="sampleTpe">
455   - <option ng-repeat="modalsNew in dropOptions" value="{{modalsNew.id}}">{{modalsNew.size}}</option>
  479 + <div class="col-xs-12 col-sm-4" style="padding-right: 0;">
  480 + <select class="form-control" style="border-radius: 0; height: 26px; padding: 0;" ng-model="customRampData.rampFeesAndAvoidanceList.aircraftType" ng-change="openRampModal()">
  481 + <option ng-repeat="modalsNew in dropOptions" value="{{modalsNew.size}}">{{modalsNew.size}}</option>
456 482 </select>
457 483 </div>
458 484 <div class="clearfix"></div>
  485 + <br/>
  486 +
  487 + <div ng-show="showAircraft">
  488 + <div class="col-xs-12 col-sm-4">
  489 + Aircraft Make:
  490 + </div>
  491 + <div class="col-xs-12 col-sm-4" style="padding-right: 0;">
  492 + <select class="form-control" style="border-radius: 0; height: 26px; padding: 0;" ng-model="customRampData.rampFeesAndAvoidanceList.aircraftMake">
  493 + <option ng-repeat="crafts in aircrafts" value="{{crafts}}">{{crafts}}</option>
  494 + </select>
  495 + </div>
  496 + <div class="clearfix"></div>
  497 + <br/>
  498 + </div>
  499 +
  500 + <div ng-show="showTail">
  501 + <div class="col-xs-12 col-sm-4">
  502 + Tail Numbers:
  503 + </div>
  504 + <div class="col-xs-12 col-sm-4" style="padding-right: 0;">
  505 + <select class="form-control" style="border-radius: 0; height: 26px; padding: 0;" ng-model="customRampData.rampFeesAndAvoidanceList.tailNumber">
  506 + <!-- <option ng-repeat="crafts in aircrafts" value="{{crafts}}">{{crafts}}</option> -->
  507 + </select>
  508 + </div>
  509 + <div class="clearfix"></div>
  510 + <br/>
  511 + </div>
  512 +
  513 + <div ng-show="showWingspan">
  514 + <div class="col-xs-12 col-sm-4">
  515 + Wingspan Min:
  516 + </div>
  517 + <div class="col-xs-12 col-sm-4" style="padding-right: 0;">
  518 + <input type="number" value="0.00" ng-model="customRampData.rampFeesAndAvoidanceList.wingspanMin" class="form-control" style="border-radius: 0; height: 26px; padding: 0 5px;" >
  519 + </div>
  520 + <div class="col-xs-12 col-sm-4" style="padding-left: 5px;">
  521 + ft.
  522 + </div>
  523 + <div class="clearfix"></div>
  524 + <br/>
  525 + <div class="col-xs-12 col-sm-4">
  526 + Wingspan Max:
  527 + </div>
  528 + <div class="col-xs-12 col-sm-4" style="padding-right: 0;">
  529 + <input type="number" value="0.00" ng-model="customRampData.rampFeesAndAvoidanceList.wingspanMax" class="form-control" style="border-radius: 0; height: 26px; padding: 0 5px;" >
  530 + </div>
  531 + <div class="col-xs-12 col-sm-4" style="padding-left: 5px;">
  532 + ft.
  533 + </div>
  534 + <div class="clearfix"></div>
  535 + <br/>
  536 + </div>
  537 +
  538 + <div ng-show="showWeight">
  539 + <div class="col-xs-12 col-sm-4">
  540 + Weight Range Min:
  541 + </div>
  542 + <div class="col-xs-12 col-sm-4" style="padding-right: 0;">
  543 + <input type="number" value="0.00" ng-model="customRampData.rampFeesAndAvoidanceList.weightRangeMin" class="form-control" style="border-radius: 0; height: 26px; padding: 0 5px;" >
  544 + </div>
  545 + <div class="col-xs-12 col-sm-4" style="padding-left: 5px;">
  546 + lbs.
  547 + </div>
  548 + <div class="clearfix"></div>
  549 + <br/>
  550 + <div class="col-xs-12 col-sm-4">
  551 + Weight Range Max:
  552 + </div>
  553 + <div class="col-xs-12 col-sm-4" style="padding-right: 0;">
  554 + <input type="number" value="0.00" ng-model="customRampData.rampFeesAndAvoidanceList.weightRangeMax" class="form-control" style="border-radius: 0; height: 26px; padding: 0 5px;" >
  555 + </div>
  556 + <div class="col-xs-12 col-sm-4" style="padding-left: 5px;">
  557 + lbs.
  558 + </div>
  559 + <div class="clearfix"></div>
  560 + <br/>
  561 + </div>
  562 +
  563 + <div>
  564 + <div class="col-xs-12 col-sm-4">
  565 + Ramp/Facil. Fee($):
  566 + </div>
  567 + <div class="col-xs-12 col-sm-4" style="padding-right: 0;">
  568 + <input type="number" value="0" ng-model="customRampData.rampFeesAndAvoidanceList.rampFees" class="form-control" style="border-radius: 0; height: 26px; padding: 0 5px;" >
  569 + </div>
  570 + <div class="clearfix"></div>
  571 + <br/>
  572 + </div>
  573 + <div>
  574 + <div class="col-xs-12 col-sm-4">
  575 + Avoidance:
  576 + </div>
  577 + <div class="col-xs-12 col-sm-4" style="padding-right: 0;">
  578 + <input type="number" value="0" ng-model="customRampData.rampFeesAndAvoidanceList.avoidance" class="form-control" style="border-radius: 0; height: 26px; padding: 0 5px;" >
  579 + </div>
  580 + <div class="col-xs-12 col-sm-4" style="padding-left: 5px;">
  581 + gal.
  582 + </div>
  583 + <div class="clearfix"></div>
  584 + </div>
459 585  
460 586 </div>
461 587 <div class="customModelFooter text-center">
462   - <input type="submit" value="Save" class="btn">
463   - <button class="btn">Cancel</button>
  588 + <input type="submit" value="Save" class="btn" ng-click="addCustomRamp(customRampData)">
  589 + <button class="btn" ng-click="closeRampFeeModel()">Cancel</button>
464 590 </div>
465 591 </div>
466 592 </div>
... ...
app/partials/fuelManager/fuelManager.service.js
... ... @@ -21,6 +21,22 @@
21 21 return deferred.promise;
22 22 }
23 23  
  24 + this.getAircrafts = function() {
  25 +
  26 + var deferred = $q.defer();
  27 + $http({
  28 + method : 'GET',
  29 + url : BASE_URL.url +'/fuelerlinx/acufuel/getAircraftMake',
  30 + headers : {'Content-Type': 'application/json'},
  31 + })
  32 + .then(function (result){
  33 + deferred.resolve(result.data);
  34 + },function (result){
  35 + deferred.resolve(result.data);
  36 + })
  37 + return deferred.promise;
  38 + }
  39 +
24 40 this.getFullList = function() {
25 41  
26 42 var deferred = $q.defer();
... ... @@ -37,9 +53,8 @@
37 53 return deferred.promise;
38 54 }
39 55  
40   - //this.addCompany = function(data) {
41 56 this.updateFullList = function(data){
42   -
  57 + console.log('service data', data);
43 58 var deferred = $q.defer();
44 59 $http({
45 60 method : 'POST',
... ...