Commit 07328f4420c2e25cbb808ea5de3c58615bef14ac
1 parent
52439a6d77
Exists in
master
new code added for aircrafts
Showing
4 changed files
with
77 additions
and
20 deletions
Show diff stats
app/partials/customers/customers.controller.js
... | ... | @@ -111,17 +111,17 @@ |
111 | 111 | $scope.marginFilterOptions = []; |
112 | 112 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { |
113 | 113 | $scope.showLoader = true; |
114 | - $scope.jetMarginList = result; | |
115 | - $scope.marginFilterOptions.push({ | |
116 | - 'id': '', 'title': 'Show All' | |
117 | - }); | |
118 | - for (var i = 0; i < result.length; i++) { | |
119 | - $scope.marginFilterOptions.push({ | |
120 | - 'id': result[i].id, | |
121 | - 'title': result[i].marginName | |
122 | - }) | |
123 | - } | |
124 | - $scope.showLoader = false; | |
114 | + $scope.jetMarginList = result; | |
115 | + $scope.marginFilterOptions.push({ | |
116 | + 'id': '', 'title': 'Show All' | |
117 | + }); | |
118 | + for (var i = 0; i < result.length; i++) { | |
119 | + $scope.marginFilterOptions.push({ | |
120 | + 'id': result[i].id, | |
121 | + 'title': result[i].marginName | |
122 | + }) | |
123 | + } | |
124 | + $scope.showLoader = false; | |
125 | 125 | }) |
126 | 126 | |
127 | 127 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { | ... | ... |
app/partials/viewCompany/viewCompany.controller.js
... | ... | @@ -13,6 +13,11 @@ |
13 | 13 | $scope.showUpdateBtn = false; |
14 | 14 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')); |
15 | 15 | $scope.selected = []; |
16 | + $scope.jetShow = []; | |
17 | + $scope.marginShow = []; | |
18 | + | |
19 | + $scope.jetShow[0] = true; | |
20 | + $scope.marginShow[0] = true; | |
16 | 21 | |
17 | 22 | $(document).ready(function() { |
18 | 23 | $("#reset").click(function() { |
... | ... | @@ -616,5 +621,21 @@ |
616 | 621 | } |
617 | 622 | }) |
618 | 623 | } |
624 | + | |
625 | + // $scope.aircraftData = {} | |
626 | + $scope.checkJetWithTail = function(tail, index){ | |
627 | + | |
628 | + console.log("tail==============",tail, index) | |
629 | + ViewCompanyService.checkJetType(tail).then(function(result) { | |
630 | + console.log("result",result) | |
631 | + if(result.jetA == "true"){ | |
632 | + $scope.jetShow[index] = false; | |
633 | + $scope.marginShow[index] = true; | |
634 | + }else{ | |
635 | + $scope.jetShow[index] = true; | |
636 | + $scope.marginShow[index] = false; | |
637 | + } | |
638 | + }) | |
639 | + } | |
619 | 640 | |
620 | 641 | }]); |
621 | 642 | \ No newline at end of file | ... | ... |
app/partials/viewCompany/viewCompany.html
... | ... | @@ -661,33 +661,51 @@ |
661 | 661 | <input type="checkbox" ng-model="aircraftData.selected"/> |
662 | 662 | </td> --> |
663 | 663 | <td style="width: 15%"> |
664 | - <input type="tel" class="form-control" ng-model="aircraftData.tail" required/> | |
664 | + <input type="tel" class="form-control" ng-model="aircraftData.tail" ng-blur="checkJetWithTail(aircraftData.tail, $index)" required/> | |
665 | 665 | </td> |
666 | 666 | <td style="width: 17%"> |
667 | 667 | <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> |
668 | + <option value="" disabled>Select</option> | |
668 | 669 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> |
669 | 670 | </select> |
670 | 671 | </td> |
671 | 672 | <td style="width: 17%"> |
672 | 673 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> |
674 | + <option value="" disabled>Select</option> | |
673 | 675 | <option ng-repeat="model in aircraftData.aircraftModalList">{{model}}</option> |
674 | 676 | </select> |
675 | 677 | </td> |
676 | 678 | <td style="width: 17%"> |
677 | - <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"></select> | |
678 | - <!-- <select class="form-control" ng-model="aircraftData.size"> | |
679 | - <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option> | |
680 | - </select> --> | |
679 | + <select class="form-control" ng-model="aircraftData.sizeId"> | |
680 | + <option value="" disabled>Select</option> | |
681 | + <option ng-repeat="size in aircraftData.aircraftSizeList" value="{{size.aircraftSize.id}}">{{size.aircraftSize.size}}</option> | |
682 | + </select> | |
683 | + | |
684 | + <!-- <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"></select> --> | |
685 | + | |
681 | 686 | </td> |
682 | 687 | <td style="width: 17%"> |
683 | - <select class="form-control" ng-model="aircraftData.marginId" ng-options="margin.id as margin.marginName for margin in jetMarginList"> | |
684 | - <option value="" disabled>Select...</option> | |
688 | + | |
689 | + <select class="form-control" ng-model="aircraftData.marginId" ng-disabled="jetShow[$index]"> | |
690 | + <option value="" disabled>Select</option> | |
691 | + <option ng-repeat="margin in jetMarginList" value="{{margin.id}}">{{margin.marginName}}</option> | |
685 | 692 | </select> |
693 | + | |
694 | + <!-- <select class="form-control" ng-model="aircraftData.marginId" ng-options="margin.id as margin.marginName for margin in jetMarginList" ng-disabled="jetShow[$index]"> | |
695 | + | |
696 | + <option value="" disabled>Select...</option> | |
697 | + </select> --> | |
698 | + | |
686 | 699 | </td> |
687 | 700 | <td style="width: 17%"> |
688 | - <select class="form-control marginSelectBox" ng-model="aircraftData.avgasMarginId" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList"> | |
689 | - <option value="" disabled>Select...</option> | |
701 | + <select class="form-control" ng-model="aircraftData.avgasMarginId" ng-disabled="marginShow[$index]"> | |
702 | + <option value="" disabled>Select</option> | |
703 | + <option ng-repeat="avgs in avgsMarginList" value="{{avgs.id}}">{{avgs.marginName}}</option> | |
690 | 704 | </select> |
705 | + | |
706 | + <!-- <select class="form-control marginSelectBox" ng-model="aircraftData.avgasMarginId" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList" ng-disabled="marginShow[$index]"> | |
707 | + <option value="" disabled>Select...</option> | |
708 | + </select> --> | |
691 | 709 | </td> |
692 | 710 | </tr> |
693 | 711 | </tbody> | ... | ... |
app/partials/viewCompany/viewCompany.service.js
... | ... | @@ -212,7 +212,25 @@ |
212 | 212 | }) |
213 | 213 | return deferred.promise; |
214 | 214 | } |
215 | + | |
216 | + this.checkJetType = function(tail) { | |
217 | + | |
218 | + var deferred = $q.defer(); | |
219 | + $http({ | |
220 | + method : 'GET', | |
221 | + url : BASE_URL.url +'/flightDept/getFboData/'+tail+'/aircraft', | |
222 | + headers : {'Content-Type': 'application/json'}, | |
223 | + }) | |
224 | + .then(function (result){ | |
225 | + deferred.resolve(result.data); | |
226 | + },function (result){ | |
227 | + deferred.resolve(result.data); | |
228 | + }) | |
229 | + return deferred.promise; | |
230 | + } | |
215 | 231 | |
216 | 232 | } |
233 | + | |
234 | + | |
217 | 235 | |
218 | 236 | })(); |
219 | 237 | \ No newline at end of file | ... | ... |