Commit 4f1de64cdb37fdb65a7ac175911bd7221cf2f75c

Authored by Kuldeep Arora
1 parent 169fc146e9
Exists in master

final phase task

app/partials/customers/customers.controller.js
... ... @@ -109,6 +109,16 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
109 109  
110 110 getAllCompanies();
111 111  
  112 + $scope.getAircraftMakeAndModel=function (data) {
  113 + for(var i = 0; i < $scope.aircraftList.length; i++){
  114 + if($scope.aircraftList[i].tail === data){
  115 + $scope.order.aircraftMake = $scope.aircraftList[i].make;
  116 + $scope.order.aircraftModel = $scope.aircraftList[i].model;
  117 + }
  118 +
  119 + }
  120 + }
  121 +
112 122 $scope.editMargin = function(customer) {
113 123 //console.log('customer', customer);
114 124 $scope.showLoader = true;
... ... @@ -434,10 +444,10 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
434 444 $scope.fuelData = {};
435 445 $scope.fuelData.companyId = $scope.selectedCompanyId;
436 446 $scope.fuelData.companyName =$scope.order.defaultCompanyName;
437   - var aircraftObj =JSON.parse($scope.order.aircraftName);
438   - $scope.fuelData.aircraftName = aircraftObj.tail;
439   - $scope.fuelData.make = aircraftObj.make;
440   - $scope.fuelData.model = aircraftObj.model;
  447 + // var aircraftObj =JSON.parse($scope.order.aircraftName);
  448 + $scope.fuelData.aircraftName = $scope.order.aircraftName;
  449 + $scope.fuelData.make = $scope.order.aircraftMake;
  450 + $scope.fuelData.model = $scope.order.aircraftModel;
441 451 //$scope.fuelData.fuelOn = $scope.order.fuelOn;
442 452 $scope.fuelData.invoiced = $scope.order.invoiced;
443 453 $scope.fuelData.volume = $scope.order.volume;
... ... @@ -495,7 +505,6 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
495 505 }
496 506  
497 507 $scope.dispatchOrder.fuelOrderList.push($scope.fuelData);
498   - //console.log("=====$scope.fueldata======",$scope.fuelData)
499 508 fuelOrdersService.dispathFuelOrder($scope.dispatchOrder).then(function(result) {
500 509 $scope.showLoader = false;
501 510 $scope.order = {};
... ...
app/partials/customers/customers.html
... ... @@ -617,16 +617,49 @@
617 617 <br/>
618 618  
619 619  
620   - <div class="col-xs-12">
  620 + <div class="col-xs-12">
621 621  
622 622 <div class="col-md-6">
623 623 <div class="pull-left" style="width: 110px;">
624 624 <label class="new-input-label"><b>Aircraft</b></label>
625 625 </div>
626 626 <div class="pull-left" style="width: calc(100% - 110px);">
627   - <select class="form-control" ng-model="order.aircraftName" required>
  627 + <select class="form-control" ng-model="order.aircraftName" ng-change="getAircraftMakeAndModel(order.aircraftName)" required>
628 628 <option selected disabled value="">Select Aircraft</option>
629   - <option ng-repeat="list in aircraftList" value="{{list}}">{{list.tail}}</option>
  629 + <option ng-repeat="list in aircraftList">{{list.tail}}</option>
  630 + </select>
  631 + </div>
  632 + <div class="clearfix"></div>
  633 + </div>
  634 + <div class="col-md-6">
  635 + <div class="pull-left" style="width: 110px;">
  636 + <label class="new-input-label"><b>Make</b></label>
  637 + </div>
  638 + <div class="pull-left" style="width: calc(100% - 110px);">
  639 + <select class="form-control" ng-model="order.aircraftMake" disabled required>
  640 + <option selected disabled value="">Select Make</option>
  641 + <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.make}}</option> -->
  642 + <option ng-repeat="list in aircraftList">{{list.make}}</option>
  643 + </select>
  644 + </div>
  645 + <div class="clearfix"></div>
  646 + </div>
  647 +
  648 + </div>
  649 + <div class="clearfix"></div>
  650 + <br/>
  651 +
  652 + <div class="col-xs-12">
  653 +
  654 + <div class="col-md-6">
  655 + <div class="pull-left" style="width: 110px;">
  656 + <label class="new-input-label"><b>Model</b></label>
  657 + </div>
  658 + <div class="pull-left" style="width: calc(100% - 110px);">
  659 + <select class="form-control" ng-model="order.aircraftModel" disabled required>
  660 + <option selected disabled value="">Select Model</option>
  661 + <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.model}}</option> -->
  662 + <option ng-repeat="list in aircraftList">{{list.model}}</option>
630 663 </select>
631 664 </div>
632 665 <div class="clearfix"></div>
... ...
app/partials/enterFuelOrder/enterFuelOrder.controller.js
... ... @@ -12,7 +12,7 @@ function enterFuelOrderController($scope, $rootScope, $uibModal, $filter, $http,
12 12 enterFuelOrderService.getAllCompanies().then(function(result) {
13 13 $scope.showLoader = false;
14 14 $scope.companyList = result;
15   - //console.log("===company====",result)
  15 + console.log("===company====",result)
16 16 })
17 17  
18 18 $scope.order = {};
... ... @@ -24,11 +24,14 @@ function enterFuelOrderController($scope, $rootScope, $uibModal, $filter, $http,
24 24 $scope.selectedCompanyId = '';
25 25 $scope.marginId = '';
26 26 $scope.selectedTier = '';
  27 + $scope.order.aircraftMake = '';
  28 + $scope.order.aircraftModel = '';
27 29  
28 30 $scope.getAircraft = function(company){
29 31 $scope.selectedCompanyName = company;
30   -
31   -
  32 + $scope.order.aircraftMake = '';
  33 + $scope.order.aircraftModel = '';
  34 + //console.log("===company====",company)
32 35 $scope.showLoader = true;
33 36 for (var i = 0; i < $scope.companyList.length; i++) {
34 37 if ($scope.companyList[i].companyName == company) {
... ... @@ -84,6 +87,18 @@ function enterFuelOrderController($scope, $rootScope, $uibModal, $filter, $http,
84 87  
85 88 }
86 89  
  90 + $scope.getAircraftMakeAndModel=function (data) {
  91 + for(var i = 0; i < $scope.aircraftList.length; i++){
  92 + if($scope.aircraftList[i].tail === data){
  93 + $scope.order.aircraftMake = $scope.aircraftList[i].make;
  94 + $scope.order.aircraftModel = $scope.aircraftList[i].model;
  95 + }
  96 +
  97 + }
  98 + }
  99 +
  100 +
  101 +
87 102 $scope.tiervalue=function(){
88 103 $scope.order.tierBreak=$scope.selectedTier.minTierBreak+'-'+$scope.selectedTier.maxTierBreak;
89 104 }
... ... @@ -116,10 +131,10 @@ function enterFuelOrderController($scope, $rootScope, $uibModal, $filter, $http,
116 131  
117 132 $scope.order.companyId = $scope.selectedCompanyId;
118 133 $scope.order.companyName = $scope.order.companyName;
119   - var aircraftObj =JSON.parse($scope.order.aircraftName);
120   - $scope.order.aircraftName = aircraftObj.tail;
121   - $scope.order.make = aircraftObj.make;
122   - $scope.order.model = aircraftObj.model;
  134 + //var aircraftObj =JSON.parse($scope.order.aircraftName);
  135 + $scope.order.aircraftName = $scope.order.aircraftName;
  136 + $scope.order.make = $scope.order.aircraftMake;
  137 + $scope.order.model = $scope.order.aircraftModel;
123 138 //$scope.order.fuelOn = $scope.order.fuelOn;
124 139  
125 140 $scope.order.invoiced = $scope.order.invoiced;
... ... @@ -177,7 +192,7 @@ function enterFuelOrderController($scope, $rootScope, $uibModal, $filter, $http,
177 192 }
178 193  
179 194 $scope.dispatchOrder.fuelOrderList.push($scope.order);
180   -
  195 + //console.log("==$scope.order==",$scope.order)
181 196 enterFuelOrderService.dispathFuelOrder($scope.dispatchOrder).then(function(result) {
182 197 $scope.showLoader = false;
183 198 $scope.order = {};
... ...
app/partials/enterFuelOrder/enterFuelOrder.html
... ... @@ -26,7 +26,7 @@
26 26 <form name="orderform" novalidate>
27 27  
28 28 <div class="customInputWrap">
29   - <div class="col-xs-12">
  29 + <div class="col-xs-12">
30 30  
31 31 <div class="col-md-6">
32 32 <div class="pull-left" style="width: 110px;">
... ... @@ -65,15 +65,48 @@
65 65 <label class="new-input-label"><b>Aircraft</b></label>
66 66 </div>
67 67 <div class="pull-left" style="width: calc(100% - 110px);">
68   - <select class="form-control" ng-model="order.aircraftName" required>
  68 + <select class="form-control" ng-model="order.aircraftName" ng-change="getAircraftMakeAndModel(order.aircraftName)" required>
69 69 <option selected disabled value="">Select Aircraft</option>
70   - <option ng-repeat="list in aircraftList" value="{{list}}">{{list.tail}}</option>
  70 + <option ng-repeat="list in aircraftList">{{list.tail}}</option>
71 71 </select>
72 72 </div>
73 73 <div class="clearfix"></div>
74 74 </div>
75 75 <div class="col-md-6">
76 76 <div class="pull-left" style="width: 110px;">
  77 + <label class="new-input-label"><b>Make</b></label>
  78 + </div>
  79 + <div class="pull-left" style="width: calc(100% - 110px);">
  80 + <select class="form-control" ng-model="order.aircraftMake" disabled required>
  81 + <option selected disabled value="">Select Make</option>
  82 + <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.make}}</option> -->
  83 + <option ng-repeat="list in aircraftList">{{list.make}}</option>
  84 + </select>
  85 + </div>
  86 + <div class="clearfix"></div>
  87 + </div>
  88 +
  89 + </div>
  90 + <div class="clearfix"></div>
  91 + <br/>
  92 +
  93 + <div class="col-xs-12">
  94 +
  95 + <div class="col-md-6">
  96 + <div class="pull-left" style="width: 110px;">
  97 + <label class="new-input-label"><b>Model</b></label>
  98 + </div>
  99 + <div class="pull-left" style="width: calc(100% - 110px);">
  100 + <select class="form-control" ng-model="order.aircraftModel" disabled required>
  101 + <option selected disabled value="">Select Model</option>
  102 + <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.model}}</option> -->
  103 + <option ng-repeat="list in aircraftList">{{list.model}}</option>
  104 + </select>
  105 + </div>
  106 + <div class="clearfix"></div>
  107 + </div>
  108 + <div class="col-md-6">
  109 + <div class="pull-left" style="width: 110px;">
77 110 <label class="new-input-label"><b>Volume</b></label>
78 111 </div>
79 112 <div class="pull-left" style="width: calc(100% - 110px);">
... ... @@ -84,7 +117,7 @@
84 117  
85 118 </div>
86 119 <div class="clearfix"></div>
87   - <br/>
  120 + <br/>
88 121  
89 122 <div class="col-xs-12">
90 123  
... ...
app/partials/fuelOrders/fuelOrders.controller.js
... ... @@ -127,7 +127,7 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT
127 127  
128 128  
129 129 }
130   - // console.log("==result===",$scope.orderdata)
  130 + // console.log("==result===",$scope.orderdata)
131 131  
132 132 $scope.displayFuelOrderList = new NgTableParams({
133 133 page: 1,
... ... @@ -169,28 +169,41 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT
169 169  
170 170 $scope.getOrders();
171 171 $scope.optionSelected='';
  172 + var checkFlag = 0;
172 173 $scope.onFWSelect = function() {
173   - if($scope.optionSelected == 'dt'){
174   - $('#demo-modal-4').css('display', 'block');
175   - $scope.optionSelected='';
176   -
177   - }
178   - if($scope.optionSelected == 'efo'){
179   - $scope.showLoader = true;
180   - var fileName = "orders.csv";
181   - var a = document.createElement("a");
182   - document.body.appendChild(a);
183   - fuelOrdersService.exportCompany().then(function(result) {
184   - var file = new Blob([result], {type: 'application/csv'});
185   - var fileURL = URL.createObjectURL(file);
186   - a.href = fileURL;
187   - a.download = fileName;
188   - a.click();
189   - $scope.showLoader = false;
190   - $scope.optionSelected='';
191   - })
192   - }
193   - }
  174 + if (checkFlag != 0) {
  175 + $(document).ready(function(){
  176 + $('body').css('position', 'fixed');
  177 + })
  178 + if($scope.optionSelected == 'dt'){
  179 + $('#demo-modal-4').css('display', 'block');
  180 + $scope.optionSelected='';
  181 +
  182 + }
  183 + if($scope.optionSelected == 'efo'){
  184 + $scope.showLoader = true;
  185 + var fileName = "orders.csv";
  186 + var a = document.createElement("a");
  187 + document.body.appendChild(a);
  188 + fuelOrdersService.exportCompany().then(function(result) {
  189 + var file = new Blob([result], {type: 'application/csv'});
  190 + var fileURL = URL.createObjectURL(file);
  191 + a.href = fileURL;
  192 + a.download = fileName;
  193 + a.click();
  194 + $scope.showLoader = false;
  195 + $scope.optionSelected='';
  196 + $(document).ready(function(){
  197 + $('body').css('position', 'initial');
  198 + })
  199 + })
  200 + }
  201 + checkFlag += 1;
  202 + }else{
  203 + checkFlag += 1;
  204 + }
  205 +
  206 + }
194 207 $scope.attachmentrowid = ""
195 208  
196 209  
... ... @@ -249,6 +262,9 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT
249 262  
250 263 $scope.editTableRow = function(rowData){
251 264 //console.log('row data', rowData);
  265 + $(document).ready(function(){
  266 + $('body').css('position', 'fixed');
  267 + })
252 268 $scope.editdata = rowData;
253 269 $('#demo-modal-5').css('display', 'block');
254 270 }
... ... @@ -282,10 +298,10 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT
282 298 $scope.fuelData.companyId = $scope.selectedCompanyId;
283 299  
284 300 $scope.fuelData.companyName = $scope.order.companyName;
285   - var aircraftObj =JSON.parse($scope.order.aircraftName);
286   - $scope.fuelData.aircraftName = aircraftObj.tail;
287   - $scope.fuelData.make = aircraftObj.make;
288   - $scope.fuelData.model = aircraftObj.model;
  301 + //var aircraftObj =JSON.parse($scope.order.aircraftName);
  302 + $scope.fuelData.aircraftName = $scope.order.aircraftName;
  303 + $scope.fuelData.make = $scope.order.aircraftMake;
  304 + $scope.fuelData.model = $scope.order.aircraftModel;
289 305 // $scope.fuelData.fuelOn = $scope.order.fuelOn;
290 306 $scope.fuelData.invoiced = $scope.order.invoiced;
291 307 $scope.fuelData.volume = $scope.order.volume;
... ... @@ -345,7 +361,6 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT
345 361 }
346 362  
347 363 $scope.dispatchOrder.fuelOrderList.push($scope.fuelData);
348   - // console.log("=====$scope.fueldata======",$scope.fuelData)
349 364 fuelOrdersService.dispathFuelOrder($scope.dispatchOrder).then(function(result) {
350 365 $scope.showLoader = false;
351 366 $scope.order = {};
... ... @@ -358,6 +373,10 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT
358 373 toastr.success('Fuel Order Dispatched Successfully', {
359 374 closeButton: true
360 375 })
  376 + /*for datepicker position */
  377 + $(document).ready(function(){
  378 + $('body').css('position', 'initial');
  379 + })
361 380 })
362 381  
363 382  
... ... @@ -439,17 +458,18 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT
439 458 }
440 459 $scope.dispatchOrder.fuelOrderList.push($scope.fuelData);
441 460 fuelOrdersService.updateFuelOrder($scope.dispatchOrder).then(function(result) {
442   - $scope.showLoader = false;
443   - $scope.editdata = {};
444   - $('#demo-modal-5').css('display', '');
445   - $scope.getOrders();
446   - toastr.success('Fuel Order Updated Successfully', {
447   - closeButton: true
448   - })
  461 + $scope.showLoader = false;
  462 + $scope.editdata = {};
  463 + $('#demo-modal-5').css('display', '');
  464 + $scope.getOrders();
  465 + toastr.success('Fuel Order Updated Successfully', {
  466 + closeButton: true
  467 + })
  468 + /*for datepicker position */
  469 + $(document).ready(function(){
  470 + $('body').css('position', 'initial');
  471 + })
449 472 })
450   -
451   -
452   -
453 473  
454 474 }else
455 475 {
... ... @@ -504,12 +524,27 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT
504 524  
505 525 }
506 526  
  527 + $scope.getAircraftMakeAndModel=function (data) {
  528 + for(var i = 0; i < $scope.aircraftList.length; i++){
  529 + if($scope.aircraftList[i].tail === data){
  530 + $scope.order.aircraftMake = $scope.aircraftList[i].make;
  531 + $scope.order.aircraftModel = $scope.aircraftList[i].model;
  532 + }
  533 +
  534 + }
  535 + }
507 536  
508 537  
509 538 $scope.cancelData = function() {
  539 + $(document).ready(function(){
  540 + $('body').css('position', 'initial');
  541 + })
510 542 $('#demo-modal-4').css('display', '');
511 543 }
512 544 $scope.canceleditdata = function() {
  545 + $(document).ready(function(){
  546 + $('body').css('position', 'initial');
  547 + })
513 548 $('#demo-modal-5').css('display', '');
514 549 }
515 550  
... ...
app/partials/fuelOrders/fuelOrders.html
... ... @@ -144,7 +144,7 @@
144 144  
145 145 <select class="btn btn-primary exportBtn" ng-model="optionSelected" ng-change="onFWSelect()">
146 146 <option value="" disabled selected="selected">Fuel Widget</option>
147   - <option value="dt" >Direct Transaction</option>
  147 + <option value="dt" >Direct Fuel Order</option>
148 148 <option value="efo" >Export Fuel Orders</option>
149 149 </select>
150 150  
... ... @@ -582,9 +582,42 @@
582 582 <label class="new-input-label"><b>Aircraft</b></label>
583 583 </div>
584 584 <div class="pull-left" style="width: calc(100% - 110px);">
585   - <select class="form-control" ng-model="order.aircraftName" required>
  585 + <select class="form-control" ng-model="order.aircraftName" ng-change="getAircraftMakeAndModel(order.aircraftName)" required>
586 586 <option selected disabled value="">Select Aircraft</option>
587   - <option ng-repeat="list in aircraftList" value="{{list}}">{{list.tail}}</option>
  587 + <option ng-repeat="list in aircraftList">{{list.tail}}</option>
  588 + </select>
  589 + </div>
  590 + <div class="clearfix"></div>
  591 + </div>
  592 + <div class="col-md-6">
  593 + <div class="pull-left" style="width: 110px;">
  594 + <label class="new-input-label"><b>Make</b></label>
  595 + </div>
  596 + <div class="pull-left" style="width: calc(100% - 110px);">
  597 + <select class="form-control" ng-model="order.aircraftMake" disabled required>
  598 + <option selected disabled value="">Select Make</option>
  599 + <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.make}}</option> -->
  600 + <option ng-repeat="list in aircraftList">{{list.make}}</option>
  601 + </select>
  602 + </div>
  603 + <div class="clearfix"></div>
  604 + </div>
  605 +
  606 + </div>
  607 + <div class="clearfix"></div>
  608 + <br/>
  609 +
  610 + <div class="col-xs-12">
  611 +
  612 + <div class="col-md-6">
  613 + <div class="pull-left" style="width: 110px;">
  614 + <label class="new-input-label"><b>Model</b></label>
  615 + </div>
  616 + <div class="pull-left" style="width: calc(100% - 110px);">
  617 + <select class="form-control" ng-model="order.aircraftModel" disabled required>
  618 + <option selected disabled value="">Select Model</option>
  619 + <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.model}}</option> -->
  620 + <option ng-repeat="list in aircraftList">{{list.model}}</option>
588 621 </select>
589 622 </div>
590 623 <div class="clearfix"></div>
... ... @@ -1097,4 +1130,9 @@ sendEvent = function(sel, step) {
1097 1130 return x instanceof Date;
1098 1131 };
1099 1132 })
1100   -</script>
1101 1133 \ No newline at end of file
  1134 +</script>
  1135 +<style type="text/css">
  1136 + .ui-datepicker-div{
  1137 + border-bottom: 2px solid #000;
  1138 + }
  1139 +</style>
1102 1140 \ No newline at end of file
... ...