From fb26e70bfcd748f6fa5e7bd8c0b9203b01d7f83d Mon Sep 17 00:00:00 2001 From: swarn Date: Fri, 19 May 2017 17:27:17 +0530 Subject: [PATCH] fuel manager done --- app/css/custom.css | 48 ++++++- app/partials/fuelManager/fuelManager.controller.js | 133 ++++++++++++++++++- app/partials/fuelManager/fuelManager.html | 146 +++++++++++++++++++-- app/partials/fuelManager/fuelManager.service.js | 19 ++- 4 files changed, 329 insertions(+), 17 deletions(-) diff --git a/app/css/custom.css b/app/css/custom.css index 15263ee..5a315d6 100644 --- a/app/css/custom.css +++ b/app/css/custom.css @@ -390,10 +390,53 @@ font-size: 10px !important; float: left; } .appliesTableBody > div.lastDiv textarea{ - width: 100%; + width: 40%; height: 60px; margin: 15px 0; resize: none; + float: left; +} +.reportedByTag{ + width: 60%; + height: 80px; + border-top: 10px solid #393; + border-left: 10px solid #6c6; + border-radius: 5px 0 0 5px; + background-color: #d7d7d7; + float: right; + position: relative; + right: -13px; + margin-top: 5px; + font-size: 11px; +} +.confirmedTag{ + background-color: #393; + color: #fff; + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + transform: rotate(-90deg); + position: absolute; + bottom: 25px; + left: -24px; + width: 71px; + text-align: center; + font-size: 11px; +} +.reportedByTag table{ + margin-left: 27px; + width: calc(100% - 27px); +} +.reportedByTag table td{ + font-size: 11px; + text-align: center; + font-weight: bold; +} +.reportedByTag table tr:last-child td{ + text-align: left; + font-weight: normal; + font-size: 10px; } .feeManagerRight{ min-height: 70px; @@ -513,6 +556,7 @@ font-size: 10px !important; left: 0; width: 100%; height: 100%; + z-index: 999; } .customModalInner{ width: 100%; @@ -549,4 +593,4 @@ font-size: 10px !important; .customModelFooter input[type="submit"]{ background-color: #6ad46a; border: 1px solid #ccc; -} +} \ No newline at end of file diff --git a/app/partials/fuelManager/fuelManager.controller.js b/app/partials/fuelManager/fuelManager.controller.js index 701c5a4..0de7ef3 100644 --- a/app/partials/fuelManager/fuelManager.controller.js +++ b/app/partials/fuelManager/fuelManager.controller.js @@ -44,9 +44,11 @@ } $scope.avoidanceList.rampFeesAndAvoidanceList = $scope.addData; $scope.avoidanceList.fboUserId = $scope.currentUserData; - console.log('data', $scope.avoidanceList); fuelManagerService.updateFullList($scope.avoidanceList).then(function(result) { + toastr.success(''+result.success+'', { + closeButton: true + }) fuelManagerService.getFullList().then(function(result) { $scope.fullJetList = result; }) @@ -56,16 +58,141 @@ } + $scope.dropOptions = {}; fuelManagerService.getOptions().then(function(result) { $scope.dropOptions = result; }) + fuelManagerService.getAircrafts().then(function(result) { + $scope.aircrafts = result; + }) + + $scope.openRampFeeModal = false; + $scope.customRampData = {}; + $scope.customRampData.rampFeesAndAvoidanceList = {}; + $scope.customRampData.rampFeesAndAvoidanceList.aircraftType = null; + + $scope.customRampData.rampFeesAndAvoidanceList.aircraftMake = ''; + $scope.customRampData.rampFeesAndAvoidanceList.aircraftSizeId = ''; + $scope.customRampData.rampFeesAndAvoidanceList.tailNumber = ''; + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMin = ''; + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMax = ''; + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMin = ''; + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMax = ''; + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMax = ''; + $scope.customRampData.rampFeesAndAvoidanceList.rampFees = ''; + $scope.customRampData.rampFeesAndAvoidanceList.avoidance = ''; + //$scope.customRampData.fboUserId = ''; + //$scope.rampFeeType = ''; - $scope.openRampModal = function(rampFeeType){ - console.log('rampFeeType', rampFeeType); + $scope.openRampModal = function(){ + //console.log('$scope.dropOptions', $scope.dropOptions) + + if ($scope.customRampData.rampFeesAndAvoidanceList.aircraftType === 'WEIGHT') { + $scope.openRampFeeModal = true; + $scope.showWeight = true; + $scope.showWingspan = false; + $scope.showTail = false; + $scope.showAircraft = false; + $scope.customRampData.rampFeesAndAvoidanceList.aircraftMake = ''; + $scope.customRampData.rampFeesAndAvoidanceList.tailNumber = ''; + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMin = ''; + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMax = ''; + $scope.customRampData.rampFeesAndAvoidanceList.rampFees = ''; + $scope.customRampData.rampFeesAndAvoidanceList.avoidance = ''; + }else if ($scope.customRampData.rampFeesAndAvoidanceList.aircraftType === 'MAKE_AND_MODEL') { + $scope.openRampFeeModal = true; + $scope.showWeight = false; + $scope.showWingspan = false; + $scope.showTail = false; + $scope.showAircraft = true; + $scope.customRampData.rampFeesAndAvoidanceList.tailNumber = ''; + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMin = ''; + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMax = ''; + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMin = ''; + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMax = ''; + $scope.customRampData.rampFeesAndAvoidanceList.rampFees = ''; + $scope.customRampData.rampFeesAndAvoidanceList.avoidance = ''; + }else if ($scope.customRampData.rampFeesAndAvoidanceList.aircraftType === 'WINGSPAN') { + $scope.openRampFeeModal = true; + $scope.showWeight = false; + $scope.showWingspan = true; + $scope.showTail = false; + $scope.showAircraft = false; + $scope.customRampData.rampFeesAndAvoidanceList.aircraftMake = ''; + $scope.customRampData.rampFeesAndAvoidanceList.tailNumber = ''; + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMin = ''; + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMax = ''; + $scope.customRampData.rampFeesAndAvoidanceList.rampFees = ''; + $scope.customRampData.rampFeesAndAvoidanceList.avoidance = ''; + }else if ($scope.customRampData.rampFeesAndAvoidanceList.aircraftType === 'TAIL') { + $scope.openRampFeeModal = true; + $scope.showWeight = false; + $scope.showWingspan = false; + $scope.showTail = true; + $scope.showAircraft = false; + $scope.customRampData.rampFeesAndAvoidanceList.aircraftMake = ''; + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMin = ''; + $scope.customRampData.rampFeesAndAvoidanceList.wingspanMax = ''; + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMin = ''; + $scope.customRampData.rampFeesAndAvoidanceList.weightRangeMax = ''; + $scope.customRampData.rampFeesAndAvoidanceList.rampFees = ''; + $scope.customRampData.rampFeesAndAvoidanceList.avoidance = ''; + }else if ($scope.customRampData.rampFeesAndAvoidanceList.aircraftType = null){ + $scope.openRampFeeModal = false; + $scope.showWeight = false; + $scope.showWingspan = false; + $scope.showTail = false; + $scope.showAircraft = false; + }else{ + $scope.openRampFeeModal = false; + $scope.showWeight = false; + $scope.showWingspan = false; + $scope.showTail = false; + $scope.showAircraft = false; + } + for (var i = 0; $scope.dropOptions.length; i++) { + if ($scope.customRampData.rampFeesAndAvoidanceList.aircraftType === $scope.dropOptions[i].size) { + $scope.customRampData.rampFeesAndAvoidanceList.aircraftSizeId = $scope.dropOptions[i].id; + } + } + } + + + + $scope.addCustomRamp = function(){ + + $scope.newData = {}; + $scope.newData.rampFeesAndAvoidanceList = []; + $scope.newData.rampFeesAndAvoidanceList.push($scope.customRampData.rampFeesAndAvoidanceList); + $scope.newData.fboUserId = $scope.currentUserData; + console.log('$scope.customRampData', $scope.newData) + fuelManagerService.updateFullList($scope.newData).then(function(result) { + toastr.success(''+result.success+'', { + closeButton: true + }); + $scope.openRampFeeModal = false; + $scope.customRampData.rampFeesAndAvoidanceList = {}; + $scope.customRampData.rampFeesAndAvoidanceList.aircraftType = null; + $scope.newData = {}; + $scope.newData.rampFeesAndAvoidanceList = []; + fuelManagerService.getFullList().then(function(result) { + $scope.fullJetList = result; + }) + }) + } + + $scope.closeRampFeeModel = function(){ + $scope.openRampFeeModal = false; + $scope.showWeight = false; + $scope.showWingspan = false; + $scope.showTail = false; + $scope.showAircraft = false; + $scope.customRampData.rampFeesAndAvoidanceList = {}; + $scope.customRampData.rampFeesAndAvoidanceList.aircraftType = null; } $scope.parentOpen = function(index){ diff --git a/app/partials/fuelManager/fuelManager.html b/app/partials/fuelManager/fuelManager.html index b8d3b9b..c002f48 100644 --- a/app/partials/fuelManager/fuelManager.html +++ b/app/partials/fuelManager/fuelManager.html @@ -317,9 +317,9 @@

Ramp Fee Manager

- - +
@@ -400,6 +400,32 @@
+
+
Confirmed
+ + + + + + + + + + + + +
+ Reported By: + + {{jets.rampFeesAndAvoidance.reportedBy}} +
+ Reported On: + + {{jets.rampFeesAndAvoidance.reportedOn}} +
+ Click the Save Form button to Re-Confirm +
+
@@ -432,7 +458,7 @@ -
+
@@ -441,26 +467,126 @@ Add Ramp Fee

- +

-
+
Type:
-
- +
+
+ +
+
+ Aircraft Make: +
+
+ +
+
+
+
+ +
+
+ Tail Numbers: +
+
+ +
+
+
+
+ +
+
+ Wingspan Min: +
+
+ +
+
+ ft. +
+
+
+
+ Wingspan Max: +
+
+ +
+
+ ft. +
+
+
+
+ +
+
+ Weight Range Min: +
+
+ +
+
+ lbs. +
+
+
+
+ Weight Range Max: +
+
+ +
+
+ lbs. +
+
+
+
+ +
+
+ Ramp/Facil. Fee($): +
+
+ +
+
+
+
+
+
+ Avoidance: +
+
+ +
+
+ gal. +
+
+
- - + +
diff --git a/app/partials/fuelManager/fuelManager.service.js b/app/partials/fuelManager/fuelManager.service.js index 4948135..dc0e625 100644 --- a/app/partials/fuelManager/fuelManager.service.js +++ b/app/partials/fuelManager/fuelManager.service.js @@ -21,6 +21,22 @@ return deferred.promise; } + this.getAircrafts = function() { + + var deferred = $q.defer(); + $http({ + method : 'GET', + url : BASE_URL.url +'/fuelerlinx/acufuel/getAircraftMake', + headers : {'Content-Type': 'application/json'}, + }) + .then(function (result){ + deferred.resolve(result.data); + },function (result){ + deferred.resolve(result.data); + }) + return deferred.promise; + } + this.getFullList = function() { var deferred = $q.defer(); @@ -37,9 +53,8 @@ return deferred.promise; } - //this.addCompany = function(data) { this.updateFullList = function(data){ - + console.log('service data', data); var deferred = $q.defer(); $http({ method : 'POST', -- 2.0.0