Commit a49ef536103f08b085b1b43632493c70935163f9

Authored by Kuldeep Arora
1 parent 562610b62d
Exists in master

dashboard & Scheduler live

app/partials/dashboard/dashboard.controller.js
... ... @@ -19,7 +19,7 @@
19 19 $state.reload();
20 20 }
21 21  
22   - $scope.marginList = {}
  22 + $scope.marginList = {};
23 23 dashboardService.getMargin().then(function(result) {
24 24 $scope.marginList = result;
25 25 console.log("Margin result", result)
... ... @@ -193,5 +193,36 @@
193 193 // }
194 194 // })*/
195 195 // }
  196 +
  197 + $scope.completeOrderCount = '';
  198 + $scope.pendingOrderCount= '';
  199 +
  200 + dashboardService.getFuelordercount().then(function(result) {
  201 + if(result[0].label=='Completed' && result[1].label=='Pending'){
  202 + $scope.completeOrderCount=result[0].value;
  203 + $scope.pendingOrderCount=result[1].value;
  204 + }
  205 +
  206 + console.log("=========Order counts========", result[0].label);
  207 + console.log("=========Order counts========", result[0].value);
  208 + console.log("=========Order counts========", result[1].label);
  209 + console.log("=========Order counts========", result[1].value);
  210 + })
  211 +
  212 +
  213 + $scope.pendingMessageRecord=[];
  214 + dashboardService.getPendingMessage().then(function(result) {
  215 + $scope.pendingMessageRecord=result;
  216 +
  217 + console.log('=======message====',result);
  218 + })
  219 +
  220 +
  221 +
  222 +
  223 +
  224 +
  225 +
  226 +
196 227 }
197 228 })();
... ...
app/partials/dashboard/dashboard.html
... ... @@ -3,7 +3,19 @@
3 3 color: #ff9900;
4 4 }
5 5 </style>
6   -
  6 +<!-- <style>
  7 +table, th , td {
  8 + border: 1px solid grey;
  9 + border-collapse: collapse;
  10 + padding: 5px;
  11 +}
  12 +table tr:nth-child(odd) {
  13 + background-color: #f1f1f1;
  14 +}
  15 +table tr:nth-child(even) {
  16 + background-color: #ffffff;
  17 +}
  18 +</style> -->
7 19  
8 20 <div class="main">
9 21 <div class="container" ng-if="isAuthenticated">
... ... @@ -19,7 +31,7 @@
19 31 <div>
20 32 <div class="col-xs-12">
21 33 <span class="pull-left">Completed</span>
22   - <button class="btn btn-success btn-xs pull-right">
  34 + <button class="btn btn-success btn-xs pull-right" style="cursor: default">
23 35 <span style="font-size:9px;">Monthly</span>
24 36 </button>
25 37 <div class="clearfix"></div>
... ... @@ -28,7 +40,7 @@
28 40 </div>
29 41 <hr class="hr">
30 42 <div class="col-xs-12">
31   - <h2 style="margin-bottom: 0px;">280</h2>
  43 + <h2 style="margin-bottom: 0px;">{{completeOrderCount}}</h2>
32 44 <span>Fuel Orders</span>
33 45 </div>
34 46 <div class="clearfix"></div>
... ... @@ -42,7 +54,7 @@
42 54 <div>
43 55 <div class="col-xs-12">
44 56 <span class="pull-left">Pending</span>
45   - <button class="btn btn-success btn-xs pull-right pull-right-color ">
  57 + <button class="btn btn-success btn-xs pull-right pull-right-color " style="cursor: default">
46 58 <span style="font-size:9px;">Monthly</span>
47 59 </button>
48 60 <div class="clearfix"></div>
... ... @@ -51,7 +63,7 @@
51 63 </div>
52 64 <hr class="hr">
53 65 <div class="col-xs-12">
54   - <h2 style="margin-bottom: 0px;">280</h2>
  66 + <h2 style="margin-bottom: 0px;">{{pendingOrderCount}}</h2>
55 67 <span>Fuel Orders</span>
56 68 </div>
57 69 <div class="clearfix"></div>
... ... @@ -66,7 +78,7 @@
66 78 <div>
67 79 <div class="col-xs-12">
68 80 <span class="pull-left">Activity: Airport Operations</span>
69   - <button class="btn btn-primary btn-xs pull-right">
  81 + <button class="btn btn-primary btn-xs pull-right" style="cursor: default">
70 82 <span style="font-size:9px;">Monthly</span>
71 83 </button>
72 84 <div class="clearfix"></div>
... ... @@ -198,7 +210,13 @@
198 210 <div class="widget-content">
199 211 <h4 style="padding:10px">Messages</h4>
200 212 <hr class="hr">
201   - <ul class="news-items">
  213 + <table>
  214 + <tr ng-repeat="msg in pendingMessageRecord">
  215 +
  216 + <td>Fuel Order is Pending for the company {{ msg[5] }} </td>
  217 + </tr>
  218 + </table>
  219 + <!-- <ul class="news-items">
202 220 <li>
203 221 <div class="news-item-detail">
204 222 <a href="javascript:;" class="news-item-title">Duis aute irure dolor in reprehenderit</a>
... ... @@ -219,7 +237,7 @@
219 237 <span class="news-item-month">Mar</span>
220 238 </div>
221 239 </li>
222   - </ul>
  240 + </ul> -->
223 241 </div>
224 242 <!-- /widget-content -->
225 243 </div>
... ...
app/partials/dashboard/dashboard.service.js
... ... @@ -54,6 +54,38 @@
54 54 return deferred.promise;
55 55 }
56 56  
57   - }
  57 + this.getFuelordercount = function() {
  58 + var deferred = $q.defer();
  59 + $http({
  60 + method : 'GET',
  61 + url : BASE_URL.url +'/fuelOrder/dashboardstatics',
  62 + headers : {'Content-Type': 'application/json'},
  63 + })
  64 + .then(function (result){
  65 + deferred.resolve(result.data);
  66 + },function (result){
  67 + deferred.resolve(result.data);
  68 + })
  69 + return deferred.promise;
  70 + }
  71 +
  72 + this.getPendingMessage = function() {
  73 + var deferred = $q.defer();
  74 + $http({
  75 + method : 'GET',
  76 + url : BASE_URL.url +'/fuelOrder/dashboardmessages',
  77 + headers : {'Content-Type': 'application/json'},
  78 + })
  79 + .then(function (result){
  80 + deferred.resolve(result.data);
  81 + },function (result){
  82 + deferred.resolve(result.data);
  83 + })
  84 + return deferred.promise;
  85 + }
  86 +
  87 +
  88 +
  89 + }
58 90  
59 91 })();
60 92 \ No newline at end of file
... ...
app/partials/scheduler/scheduler.controller.js
... ... @@ -4,12 +4,16 @@ angular.module(&#39;acufuel&#39;)
4 4  
5 5 .controller('schedulerController', ['$scope','$compile', 'uiCalendarConfig', 'schedulerService', function($scope, $compile, uiCalendarConfig, schedulerService) {
6 6  
  7 +
7 8 $scope.showLoader = true;
8   - getEventsList();
9   -
  9 + getEventsList();
  10 +
  11 + /*---get events on calendar---*/
10 12 $scope.events = [];
11 13 function getEventsList(){
12 14 schedulerService.getEvents().then(function(result) {
  15 + //console.log('----kd events-------',result);
  16 +
13 17 for (var i = 0; i < result.length; i++) {
14 18 var newTime = new Date(result[i].deployDate);
15 19 var dmonth = newTime.getUTCMonth() + 1; //months from 1-12
... ... @@ -18,15 +22,24 @@ angular.module(&#39;acufuel&#39;)
18 22  
19 23 $scope.events.push({
20 24 'id': result[i].id,
21   - 'title': result[i].aircraft,
  25 + 'title': result[i].aircraft +',\n' + result[i].make +'/' + result[i].model +',\n' + result[i].requestedVolume +',' +result[i].priceQuote,
22 26 'start': dyear+'-'+dmonth+'-'+dday
23 27 })
24   - $scope.showLoader = false;
25   - }
  28 + // $scope.showEventsList();
  29 + console.log('==kd events after push===', $scope.events)
  30 + $scope.showLoader = false;
  31 +
  32 + }
  33 + $('#my-calendar').fullCalendar('removeEvents');
  34 + $('#my-calendar').fullCalendar('addEventSource',$scope.events);
  35 + // $scope.eventSources = [$scope.events, $scope.eventSource, $scope.eventsF];
  36 +
  37 + // console.log('==eventSource are====',$scope.eventSources);
  38 + // $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear;
  39 + })
  40 +}
  41 +
26 42  
27   - // $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear;
28   - })
29   - }
30 43  
31 44 $scope.newEvent = {};
32 45 $scope.addNewEvent = function(){
... ... @@ -210,11 +223,15 @@ $scope.alertOnDrop = function(event, delta, revertFunc, jsEvent, ui, view){
210 223 $scope.addEvent = function(index) {
211 224 //console.log('INDEX', index);
212 225 //console.log('EVENTS', $scope.eventSources);
213   - //$scope.events.push($scope.eventList[index]);
  226 + // $scope.events.push($scope.eventList[index]);
214 227 }
215   -
216   - $scope.eventSources = [$scope.events, $scope.eventSource, $scope.eventsF];
217   - $scope.eventSources2 = [$scope.calEventsExt, $scope.eventsF, $scope.events];
218   -
  228 +
  229 + /*$scope.showEventsList = function(){
  230 + console.log('testing', $scope.eventsF);
  231 +
  232 + };*/
  233 + $scope.eventSources = [$scope.events, $scope.eventSource, $scope.eventsF];
  234 +
  235 + $scope.eventSources2 = [$scope.calEventsExt, $scope.eventsF, $scope.events];
219 236 }]);
220 237  
... ...
app/partials/scheduler/scheduler.html
... ... @@ -79,44 +79,48 @@
79 79 <div class="container">
80 80 <div class="row">
81 81 <div class="col-xs-12">
82   - <div class="col-xs-12 col-md-3">
83   - <div class="widget stacked">
  82 + <div class="col-xs-12 col-md-1">
  83 + <!--<div class="widget stacked">
84 84 <div class="widget-header">
85 85 <i class="fa fa-plane" aria-hidden="true"></i>
86 86 <h3>Enter Support Service</h3>
87 87 </div>
88 88 <div class="widget-content">
89 89 <label ng-repeat="item in events" ng-click="editEvent(item)" style="width: 100%;">
90   - <!-- <div class="fc-event" data-drag="true" data-jqyoui-options="{revert: 'invalid'}" jqyoui-draggable="{index: {{$index}},placeholder:true,animate:true}">
  90 + <div class="fc-event" data-drag="true" data-jqyoui-options="{revert: 'invalid'}" jqyoui-draggable="{index: {{$index}},placeholder:true,animate:true}">
91 91 {{item.title}}
92   - </div> -->
  92 + </div>
93 93 <div class="fc-event">
94 94 {{item.title}}
95 95 </div>
96 96 </label>
97   - <!-- <p>
  97 + <p>
98 98 <input type='checkbox' id='drop-remove' />
99 99 <label for='drop-remove'>remove after drop</label>
100   - </p> -->
  100 + </p>
101 101 </div>
102 102 </div>
103 103 <div class="text-right">
104 104 <button class="btn btn-default btn-white" data-toggle="modal" data-target="#addEvent">Add Event</button>
105   - </div>
  105 + </div> -->
106 106 </div>
107 107  
108   - <div class="col-xs-12 col-md-9">
  108 + <div class="col-xs-12 col-md-10">
109 109 <div class="widget stacked">
110 110 <div class="widget-header">
111 111 <i class="fa fa-calendar" aria-hidden="true"></i>
112   - <h3>Schedule</h3>
  112 + <h3>Schedule kd</h3>
113 113 </div>
114 114 <div class="widget-content">
115   - <div ui-calendar="uiConfig.calendar" ng-model="eventSources" data-drop="true"></div>
  115 + <div id="my-calendar" ui-calendar="uiConfig.calendar" ng-model="eventSources" data-drop="true"></div>
  116 +
  117 +
116 118 </div>
117 119 </div>
118 120 </div>
119 121 <div style='clear:both'></div>
  122 + <div class="col-xs-12 col-md-1">
  123 + </div>
120 124  
121 125 <!-- <div ui-calendar="uiConfig.calendar" ng-model="eventSources" class="col-xs-12 col-md-9" data-drop="true" jqyoui-droppable="{multiple:true, onDrop: 'addEvent($index)'}"></div> -->
122 126  
... ...