Commit 1926e07b600cfa54b0d82ab33fcf9961f6e24489
1 parent
9fabc0d405
Exists in
master
implement fuel vendor api
Showing
3 changed files
with
558 additions
and
12 deletions
Show diff stats
app/partials/FuelVendors/FuelVendors.controller.js
... | ... | @@ -3,7 +3,9 @@ |
3 | 3 | //Load controller |
4 | 4 | angular.module('acufuel') |
5 | 5 | |
6 | - .controller('FuelVendorsController', ['$scope',function($scope) { | |
6 | + .controller('FuelVendorsController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'FuelVendorsService', 'CustomersService', FuelVendorsController]); | |
7 | + | |
8 | + function FuelVendorsController($scope, $rootScope, $uibModal, $filter, $http, FuelVendorsService, CustomersService) { | |
7 | 9 | |
8 | 10 | $scope.vendorList = [{ |
9 | 11 | "companyName": "Name and inc", |
... | ... | @@ -35,6 +37,126 @@ |
35 | 37 | "status":'Active', |
36 | 38 | "source": "tenant", |
37 | 39 | "allIn" : "$123" |
40 | + },{ | |
41 | + "companyName": "Name and inc", | |
42 | + "phone":"1010101010", | |
43 | + "contact":"kuldeep", | |
44 | + "Base":"Kiad", | |
45 | + "status":'Inactive', | |
46 | + "source": "tenant", | |
47 | + "allIn" : "$123" | |
38 | 48 | }] |
39 | 49 | |
40 | - }]); | |
41 | 50 | \ No newline at end of file |
51 | + | |
52 | + $(document).ready(function() { | |
53 | + $('#example').DataTable(); | |
54 | + }); | |
55 | + $scope.data = {}; | |
56 | + $scope.aircraft = {}; | |
57 | + $scope.data.activate = true; | |
58 | + | |
59 | + // FuelVendorsService.getAllVendor().then(function(result) { | |
60 | + // console.log(result) | |
61 | + // $scope.vendorList = result; | |
62 | + // }) | |
63 | + | |
64 | + $(function() { | |
65 | + $('#vendor-toggle-one2').bootstrapToggle(); | |
66 | + $('#vendor-toggle-one2').change(function() { | |
67 | + $('#console-event').html('Toggle: ' + $(this).prop('checked')); | |
68 | + $scope.data.activate = $(this).prop('checked'); | |
69 | + }) | |
70 | + }) | |
71 | + | |
72 | + getData(); | |
73 | + function getData(){ | |
74 | + CustomersService.getAircraftMake().then(function(result) { | |
75 | + $scope.aircraftMakeList = result; | |
76 | + }) | |
77 | + } | |
78 | + | |
79 | + $scope.addFirstData = function(sel, step){ | |
80 | + // console.log($scope.data) | |
81 | + | |
82 | + var vendorData = "vendorName=" + $scope.data.vendorName + "&masterMargin=" + $scope.data.masterMargin | |
83 | + + "&addressOne=" + $scope.data.addressOne + "&addressTwo=" + $scope.data.addressTwo + "&city=" + $scope.data.city + "&state=" | |
84 | + + $scope.data.state + "&country=" + $scope.data.country + "&zipcode=" + $scope.data.zipcode + "&internalNote=" | |
85 | + + $scope.data.internalNote + "&certificateType=" + $scope.data.certificateType + "&baseTenant=" + $scope.data.baseTenant | |
86 | + + "&fuelerlinxCustomer=" + $scope.data.fuelerlinxCustomer + "&contractFuelVendor=" + $scope.data.contractFuelVendor | |
87 | + + "&activate=" + $scope.data.activate + "&baseIcao=" + $scope.data.baseIcao; | |
88 | + | |
89 | + FuelVendorsService.addVendor(vendorData).then(function(result) { | |
90 | + console.log("result",result) | |
91 | + $scope.vendorId = result; | |
92 | + console.log("$scope.vendorId",$scope.vendorId) | |
93 | + $scope.aircraft.vendorId = $scope.vendorId; | |
94 | + console.log("$scope.aircraft.vendorId",$scope.aircraft.vendorId); | |
95 | + }) | |
96 | + $(sel).trigger('next.m.' + step); | |
97 | + getData(); | |
98 | + } | |
99 | + | |
100 | + $scope.aircraftDetails = [{ | |
101 | + 'tail':'', | |
102 | + 'make': '', | |
103 | + 'model': '', | |
104 | + 'sizeId' : '' | |
105 | + }]; | |
106 | + | |
107 | + $scope.addNew = function(){ | |
108 | + $scope.aircraftDetails.push({ | |
109 | + 'tail':'', | |
110 | + 'make': '', | |
111 | + 'model': '', | |
112 | + 'sizeId' : '' | |
113 | + }); | |
114 | + console.log($scope.aircraftDetails) | |
115 | + }; | |
116 | + | |
117 | + $scope.getModal = function(makeId, index){ | |
118 | + $scope.aircraft.make = makeId; | |
119 | + //var makeId = makeId; | |
120 | + CustomersService.getModal($scope.aircraft.make).then(function(result) { | |
121 | + $scope.aircraftDetails[index].aircraftModalList = result; | |
122 | + //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; | |
123 | + }) | |
124 | + } | |
125 | + | |
126 | + $scope.getSize = function(model, index){ | |
127 | + CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { | |
128 | + console.log("result",result) | |
129 | + $scope.aircraftDetails[index].aircraftSizeList = result; | |
130 | + //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; | |
131 | + console.log($scope.aircraftDetails[index].size) | |
132 | + }) | |
133 | + } | |
134 | + | |
135 | + $scope.aircraftListData = {}; | |
136 | + $scope.addData = []; | |
137 | + $scope.saveVendorData = function(){ | |
138 | + for(var i=0; i<$scope.aircraftDetails.length;i++){ | |
139 | + $scope.addData.push({ | |
140 | + 'tail': $scope.aircraftDetails[i].tail, | |
141 | + 'make': $scope.aircraftDetails[i].make, | |
142 | + 'model': $scope.aircraftDetails[i].model, | |
143 | + 'sizeId' : $scope.aircraftDetails[i].sizeId | |
144 | + }); | |
145 | + } | |
146 | + $scope.aircraftListData.aircraftList = $scope.addData; | |
147 | + $scope.aircraftListData.vendorId = $scope.aircraft.vendorId; | |
148 | + | |
149 | + CustomersService.addAircraft($scope.aircraftListData).then(function(result) { | |
150 | + console.log(result) | |
151 | + if(result != null && result.success){ | |
152 | + toastr.success(''+result.success+'', { | |
153 | + closeButton: true | |
154 | + }) | |
155 | + $('#demo-modal-3').modal('hide'); | |
156 | + }else{ | |
157 | + toastr.error(''+result.statusText+'', { | |
158 | + closeButton: true | |
159 | + }) | |
160 | + } | |
161 | + }); | |
162 | + } | |
163 | + } | |
42 | 164 | \ No newline at end of file | ... | ... |
app/partials/FuelVendors/FuelVendors.html
1 | 1 | <style> |
2 | 2 | .subnavbar .mainnav > li:nth-child(3) > a{ |
3 | - color: #ff9900; | |
3 | + color: #ff9900; | |
4 | 4 | } |
5 | + | |
6 | + .button1 { | |
7 | + display: inline-block; | |
8 | + height: 35px; | |
9 | + line-height: 35px; | |
10 | + padding-right: 15px; | |
11 | + padding-left: 50px; | |
12 | + position: relative; | |
13 | + background-color:rgb(41,127,184); | |
14 | + color:rgb(255,255,255); | |
15 | + text-decoration: none; | |
16 | + text-transform: uppercase; | |
17 | + letter-spacing: 1px; | |
18 | + margin-bottom: 15px; | |
19 | + border: 0; | |
20 | + | |
21 | + | |
22 | + border-radius: 5px; | |
23 | + -moz-border-radius: 5px; | |
24 | + -webkit-border-radius: 5px; | |
25 | + text-shadow:0px 1px 0px rgba(0,0,0,0.5); | |
26 | + -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; | |
27 | + filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); | |
28 | + | |
29 | + -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | |
30 | + -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | |
31 | + box-shadow:0px 2px 2px rgba(0,0,0,0.2); | |
32 | + -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; | |
33 | + filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); | |
34 | + } | |
35 | + | |
36 | + .button1 span { | |
37 | + position: absolute; | |
38 | + left: 0; | |
39 | + top: 0; | |
40 | + width: 35px; | |
41 | + background-color:rgba(0,0,0,0.5); | |
42 | + | |
43 | + -webkit-border-top-left-radius: 5px; | |
44 | + -webkit-border-bottom-left-radius: 5px; | |
45 | + -moz-border-radius-topleft: 5px; | |
46 | + -moz-border-radius-bottomleft: 5px; | |
47 | + border-top-left-radius: 5px; | |
48 | + border-bottom-left-radius: 5px; | |
49 | + border-right: 1px solid rgba(0,0,0,0.15); | |
50 | + } | |
51 | + | |
52 | + .button1:hover span, .button1.active span { | |
53 | + background-color:rgb(0,102,26); | |
54 | + border-right: 1px solid rgba(0,0,0,0.3); | |
55 | + } | |
56 | + | |
57 | + .button1:active { | |
58 | + margin-top: 2px; | |
59 | + margin-bottom: 13px; | |
60 | + | |
61 | + -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | |
62 | + -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | |
63 | + box-shadow:0px 1px 0px rgba(255,255,255,0.5); | |
64 | + -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; | |
65 | + filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); | |
66 | + } | |
67 | + | |
68 | + .button1.turquoise { | |
69 | + background: #449d44; | |
70 | + } | |
71 | + | |
5 | 72 | </style> |
6 | 73 | <div class="main"> |
7 | 74 | <div class="container"> |
... | ... | @@ -28,7 +95,7 @@ |
28 | 95 | </li> |
29 | 96 | <li style="margin: 0px 10px 4px 40px;"><input type="text" style="height:31px;"class="form-control" name="name" id="name" placeholder="Search In Table"></li> |
30 | 97 | <li><button type="button" class="btn btn-default btn-sm">Clear Search And Filters</button></li> |
31 | - <li style="float:right"><button type="submit" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Company</button></li> | |
98 | + <li style="float:right"><button type="submit" data-toggle="modal" data-target="#demo-modal-3" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Vendor</button></li> | |
32 | 99 | </ul> |
33 | 100 | <br> |
34 | 101 | <div class="tab-content customer-table" style="margin:0px"> |
... | ... | @@ -219,4 +286,330 @@ |
219 | 286 | </div> |
220 | 287 | <!-- /container --> |
221 | 288 | </div> |
222 | -<!-- /main --> | |
223 | 289 | \ No newline at end of file |
290 | +<!-- /main --> | |
291 | + | |
292 | +<form class="modal multi-step" id="demo-modal-3" name="vendorForm"> | |
293 | + <div class="modal-dialog modal-lg"> | |
294 | + <div class="modal-content"> | |
295 | + <div class="modal-body step-1" data-step="1" style="padding: 0;"> | |
296 | + <div> | |
297 | + <div class="row" style="margin: 0;"> | |
298 | + <div> | |
299 | + <div class="widget" style="margin-bottom: 0;"> | |
300 | + <div class="widget-header"> | |
301 | + <i class="icon-pencil"></i> | |
302 | + <i class="fa fa-tasks" aria-hidden="true"></i> | |
303 | + <h3>Add a New Vendor</h3> | |
304 | + <div class="pull-right my-toggle-switch" style="margin-right: 30px;"> | |
305 | + <div style="color: #ff9a01;">Activate     | |
306 | + <input id="vendor-toggle-one2" checked type="checkbox" data-size="mini" data-width="55" data-toggle="toggle" data-on="On" data-off="Off"> | |
307 | + </div> | |
308 | + </div> | |
309 | + <div class="clearfix"></div> | |
310 | + </div> | |
311 | + <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | |
312 | + <div class="col-xs-12"> | |
313 | + <div class="col-md-8"> | |
314 | + <div class="pull-left"> | |
315 | + <label class="new-input-label"><b>Vendor Name</b></label> | |
316 | + </div> | |
317 | + <div class="pull-left" style="margin-left: 15px;"> | |
318 | + <input type="text" ng-model="data.vendorName" class="form-control" id="Address" placeholder=""> | |
319 | + </div> | |
320 | + <div class="clearfix"></div> | |
321 | + </div> | |
322 | + <div class="col-md-4"> | |
323 | + | |
324 | + <div class="pull-right"> | |
325 | + <input type="text" ng-model="data.baseIcao" style="width: 100px;" class="form-control" id="Address" placeholder=""> | |
326 | + </div> | |
327 | + <div class="pull-right"> | |
328 | + <label style="margin-right: 15px;" class="new-input-label"><b>Base ICAO</b></label> | |
329 | + </div> | |
330 | + <div class="clearfix"></div> | |
331 | + </div> | |
332 | + </div> | |
333 | + <div class="clearfix"></div><br> | |
334 | + <div class="col-xs-12"> | |
335 | + <div class="col-md-8"> | |
336 | + <div class="pull-left"> | |
337 | + <label class="new-input-label"><b>Relationship </b></label> | |
338 | + </div> | |
339 | + <div class="pull-left" style="margin-left: 32px;"> | |
340 | + <input type="checkbox" ng-model="data.baseTenant" name="vehicle" value="Bike"> Check here if this is a Base Tenant<br> | |
341 | + <input type="checkbox" ng-model="data.fuelerlinxCustomer" name="vehicle" value="Car" checked> Check here if this is a FuelerLinx Customer<br> | |
342 | + <input type="checkbox" ng-model="data.contractFuelVendor" name="vehicle" value="Car" checked> Check here if this is a Contract Fuel Vendor | |
343 | + </div> | |
344 | + <div class="clearfix"></div> | |
345 | + </div> | |
346 | + </div> | |
347 | + <div class="clearfix"></div> | |
348 | + <br/> | |
349 | + <div class="col-xs-12"> | |
350 | + <div class="col-md-6"> | |
351 | + <div class="pull-left" style="width: 110px;"> | |
352 | + <b>Master Margin</b> | |
353 | + </div> | |
354 | + <div class="pull-left"> | |
355 | + <select required class="form-control" style="max-width: 250px;" ng-model="data.masterMargin"> | |
356 | + <option value="" disabled selected hidden>Select </option> | |
357 | + <option value="margin1">Margin1</option> | |
358 | + <option value="margin2">Margin2</option> | |
359 | + <option value="vendorsonly">Vendors Only</option> | |
360 | + <option value="margintenants">Margin Tenants</option> | |
361 | + </select> | |
362 | + </div> | |
363 | + <div class="clearfix"></div> | |
364 | + </div> | |
365 | + | |
366 | + <div class="col-md-3 Airport" style="text-align: right;"> | |
367 | + <b>Certificate Type</b> | |
368 | + </div> | |
369 | + <div class="col-md-3 Airport"> | |
370 | + <select required class="form-control" ng-model="data.certificateType"> | |
371 | + <option value="" disabled selected hidden>Select </option> | |
372 | + <option value="corporate">Part 91 (Corporate)</option> | |
373 | + <option value="charter">Part 135 (Charter)</option> | |
374 | + <option value="scheduled">Part 121 (Scheduled)</option> | |
375 | + <option value="military">Military</option> | |
376 | + <option value="government">Government</option> | |
377 | + </select> | |
378 | + </div> | |
379 | + </div> | |
380 | + <div class="clearfix"></div> | |
381 | + <br/> | |
382 | + <div class="col-xs-12"> | |
383 | + <div class="col-md-12"> | |
384 | + <div class="pull-left" style="width: 110px;"> | |
385 | + <label class="new-input-label"><b>Address</b></label> | |
386 | + </div> | |
387 | + <div class="pull-left" style="width: calc(100% - 110px);"> | |
388 | + <input type="text" class="form-control" ng-model="data.addressOne" id="Address" placeholder=""> | |
389 | + </div> | |
390 | + <div class="clearfix"></div> | |
391 | + </div> | |
392 | + </div> | |
393 | + <div class="clearfix"></div> | |
394 | + <br/> | |
395 | + <div class="col-xs-12"> | |
396 | + <div class="col-md-12"> | |
397 | + <div class="pull-left" style="width: 110px;"> | |
398 | + <label class="new-input-label"><b>Address2</b></label> | |
399 | + </div> | |
400 | + <div class="pull-left" style="width: calc(100% - 110px);"> | |
401 | + <input type="text" ng-model="data.addressTwo" class="form-control" id="Address" placeholder=""> | |
402 | + </div> | |
403 | + <div class="clearfix"></div> | |
404 | + </div> | |
405 | + </div> | |
406 | + <div class="clearfix"></div> | |
407 | + <br/> | |
408 | + <div class="col-xs-12"> | |
409 | + | |
410 | + <div class="col-md-6"> | |
411 | + <div class="pull-left" style="width: 110px;"> | |
412 | + <label class="new-input-label"><b>City</b></label> | |
413 | + </div> | |
414 | + <div class="pull-left" style="width: calc(100% - 110px);"> | |
415 | + <input type="text" ng-model="data.city" class="form-control" id="Address" placeholder=""> | |
416 | + </div> | |
417 | + <div class="clearfix"></div> | |
418 | + </div> | |
419 | + <div class="col-md-3"> | |
420 | + <div class="pull-left" style="width: 40px;"> | |
421 | + <label class="new-input-label"><b>State</b></label> | |
422 | + </div> | |
423 | + <div class="pull-left" style="width: calc(100% - 110px);"> | |
424 | + <input type="text" ng-model="data.state" class="form-control" id="Address" placeholder=""> | |
425 | + </div> | |
426 | + <div class="clearfix"></div> | |
427 | + </div> | |
428 | + <div class="col-md-3"> | |
429 | + <div class="pull-left"> | |
430 | + <label class="new-input-label"><b>Zip Code</b></label> | |
431 | + </div> | |
432 | + <div class="pull-right" style="width: calc(100% - 60px);"> | |
433 | + <input type="tel" ng-model="data.zipcode" class="form-control" id="Address" placeholder=""> | |
434 | + </div> | |
435 | + <div class="clearfix"></div> | |
436 | + </div> | |
437 | + </div> | |
438 | + <div class="clearfix"></div> | |
439 | + <br/> | |
440 | + <div class="col-xs-12"> | |
441 | + | |
442 | + <div class="col-md-6"> | |
443 | + <div class="pull-left" style="width: 110px;"> | |
444 | + <label class="new-input-label"><b>Country</b></label> | |
445 | + </div> | |
446 | + <div class="pull-left" style="width: calc(100% - 110px);"> | |
447 | + <input type="text" ng-model="data.country" class="form-control" id="Address" placeholder=""> | |
448 | + </div> | |
449 | + <div class="clearfix"></div> | |
450 | + </div> | |
451 | + <div class="col-md-6"> | |
452 | + <div class="pull-left" style="width: 110px;"> | |
453 | + <label class="new-input-label"><b>Internal Note</b></label> | |
454 | + </div> | |
455 | + <div class="pull-left" style="width: calc(100% - 110px);"> | |
456 | + <textarea name="message" ng-model="data.internalNote" rows="4" cols="34"></textarea> | |
457 | + </div> | |
458 | + <div class="clearfix"></div> | |
459 | + </div> | |
460 | + </div> | |
461 | + <div class="clearfix"></div> | |
462 | + <!-- <br/> | |
463 | + <div class="col-xs-12"> | |
464 | + <div class="col-md-2 Airport"></div> | |
465 | + <div class="col-md-10 Airport"> | |
466 | + <div class="pull-right"> | |
467 | + <button type="button" class="btn btn-default" ng-click="cancel()">Cancel</button> | |
468 | + <button type="button" class="btn btn-warning" ng-click="addAircraft()">Next: Add Aircraft</button> | |
469 | + </div> | |
470 | + </div> | |
471 | + </div> --> | |
472 | + </div> | |
473 | + </div> | |
474 | + <div class="clearfix"></div> | |
475 | + </div> | |
476 | + </div> | |
477 | + </div> | |
478 | + </div> | |
479 | + <div class="modal-body step-2" data-step="2" style="padding: 0;"> | |
480 | + <div> | |
481 | + <div class="row" style="margin: 0;"> | |
482 | + <div> | |
483 | + <div class="widget" style="margin-bottom: 0;"> | |
484 | + <div class="widget-header"> | |
485 | + <i class="icon-pencil"></i> | |
486 | + <i class="fa fa-tasks" aria-hidden="true"></i> | |
487 | + <h3>Add a New Vendor</h3> | |
488 | + <div class="clearfix"></div> | |
489 | + </div> | |
490 | + <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | |
491 | + <div class="col-xs-12"> | |
492 | + <div class="widget-header"> | |
493 | + <i class="fa fa-list"></i> | |
494 | + <h3>Aircraft List</h3> | |
495 | + </div> | |
496 | + <div class="widget-content" style="padding:0px;border: 0px; "> | |
497 | + <div class="table-responsive"> | |
498 | + <!-- <table class="table table-bordered table-hover table-striped addRow" style="margin-bottom: 0px;"> | |
499 | + <thead> | |
500 | + <tr> | |
501 | + <th>Tail</th> | |
502 | + <th>Make</th> | |
503 | + <th>Model</th> | |
504 | + <th>Size</th> | |
505 | + <th>Margin</th> | |
506 | + </tr> | |
507 | + </thead> | |
508 | + <tbody> | |
509 | + <tr> | |
510 | + <td> | |
511 | + <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> | |
512 | + </td> | |
513 | + <td style="width: 25%;"> | |
514 | + <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> | |
515 | + <option ng-repeat="make in aircraftMakeList">{{make}}</option> | |
516 | + </select> | |
517 | + </td> | |
518 | + <td style="width: 20%;"> | |
519 | + <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> | |
520 | + <option ng-repeat="model in aircraftModalList">{{model}}</option> | |
521 | + </select> | |
522 | + </td> | |
523 | + <td style="width: 25%;"> | |
524 | + <select class="form-control" ng-model="aircraft.size"> | |
525 | + <option ng-repeat="size in aircraftSizeList">{{size}}</option> | |
526 | + </select> | |
527 | + </td> | |
528 | + <td> | |
529 | + <select class="form-control"> | |
530 | + <option>Margin1</option> | |
531 | + <option>Margin2</option> | |
532 | + </select> | |
533 | + </td> | |
534 | + </tr> | |
535 | + </tbody> | |
536 | + | |
537 | + </table> --> | |
538 | + <table class="table table-striped table-bordered"> | |
539 | + <thead> | |
540 | + <tr> | |
541 | + <!-- <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th> --> | |
542 | + <th>Tail</th> | |
543 | + <th>Make</th> | |
544 | + <th>Model</th> | |
545 | + <th>Size</th> | |
546 | + </tr> | |
547 | + </thead> | |
548 | + <tbody> | |
549 | + <tr ng-repeat="aircraftData in aircraftDetails track by $index"> | |
550 | + <!-- <td> | |
551 | + <input type="checkbox" ng-model="aircraftData.selected"/> | |
552 | + </td> --> | |
553 | + <td style="width: 20%"> | |
554 | + <input type="text" class="form-control" ng-model="aircraftData.tail" required/> | |
555 | + </td> | |
556 | + <td style="width: 20%"> | |
557 | + <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> | |
558 | + <option ng-repeat="make in aircraftMakeList">{{make}}</option> | |
559 | + </select> | |
560 | + </td> | |
561 | + <td style="width: 20%"> | |
562 | + <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> | |
563 | + <option ng-repeat="model in aircraftData.aircraftModalList">{{model}}</option> | |
564 | + </select> | |
565 | + </td> | |
566 | + <td style="width: 20%"> | |
567 | + <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"></select> | |
568 | + <!-- <select class="form-control" ng-model="aircraftData.size"> | |
569 | + <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option> | |
570 | + </select> --> | |
571 | + </td> | |
572 | + </tr> | |
573 | + </tbody> | |
574 | + </table> | |
575 | + </div> | |
576 | + <div class="clearfix"></div> | |
577 | + </div> | |
578 | + </div> | |
579 | + <div class="clearfix"></div> | |
580 | + <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> | |
581 | + <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> | |
582 | + </div> | |
583 | + <!-- <div class="col-xs-12" style="margin-bottom: 20px;"> | |
584 | + <div class="pull-right"> | |
585 | + <button type="button" class="btn btn-default" ng-click="cancelCraft()">Cancel</button> | |
586 | + <button type="button" class="btn btn-warning" ng-click="goBack()">Go Back</button> | |
587 | + <button type="button" class="btn btn-success" ng-click="goBack()">Save</button> | |
588 | + </div> | |
589 | + </div> --> | |
590 | + </div> | |
591 | + </div> | |
592 | + <div class="clearfix"></div> | |
593 | + </div> | |
594 | + </div> | |
595 | + </div> | |
596 | + </div> | |
597 | + <!-- <div class="modal-body step-3" data-step="3"> | |
598 | + This is the final step. | |
599 | + </div> --> | |
600 | + <div class="modal-footer" style="border-top: 0;"> | |
601 | + <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> | |
602 | + <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addFirstData('#demo-modal-3', 2)">Next: Add Aircraft</button> | |
603 | + <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 1)">Go Back</button> | |
604 | + <!-- <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 3)">Continue</button> --> | |
605 | + <button type="button" class="btn btn-success step step-2" data-step="2" ng-click="saveVendorData()">Save</button> | |
606 | + </div> | |
607 | + </div> | |
608 | + </div> | |
609 | +</form> | |
610 | + | |
611 | +<script src="js/multi-step-modal.js"></script> | |
612 | +<script> | |
613 | +sendEvent = function(sel, step) { | |
614 | + $(sel).trigger('next.m.' + step); | |
615 | +} | |
616 | +</script> | |
224 | 617 | \ No newline at end of file | ... | ... |
app/partials/FuelVendors/FuelVendors.service.js
1 | 1 | (function(){ |
2 | 2 | 'use strict'; |
3 | 3 | angular.module('acufuel') |
4 | - .service('FuelVendorsService', ['$q', '$http', 'BE', FuelVendorsService]); | |
4 | + .service('FuelVendorsService', ['$q', '$http','BASE_URL', FuelVendorsService]); | |
5 | 5 | |
6 | - function FuelVendorsService($q, $http, BE) { | |
7 | - var temp = {}; | |
6 | + function FuelVendorsService($q, $http, BASE_URL) { | |
7 | + | |
8 | + this.getAllVendor = function() { | |
9 | + | |
10 | + var deferred = $q.defer(); | |
11 | + $http({ | |
12 | + method : 'GET', | |
13 | + url : BASE_URL.url +'/user/allVendors', | |
14 | + headers : {'Content-Type': 'application/json'}, | |
15 | + }) | |
16 | + .then(function (result){ | |
17 | + deferred.resolve(result.data); | |
18 | + },function (result){ | |
19 | + deferred.resolve(result.data); | |
20 | + }) | |
21 | + return deferred.promise; | |
22 | + } | |
23 | + | |
24 | + | |
25 | + this.addVendor = function(data) { | |
26 | + console.log("data",data); | |
27 | + | |
28 | + var deferred = $q.defer(); | |
29 | + $http({ | |
30 | + method : 'POST', | |
31 | + url : BASE_URL.url +'/vendor/add/aircrafts', | |
32 | + headers : {'Content-Type': 'application/json'}, | |
33 | + data: data | |
34 | + }) | |
35 | + .then(function (result){ | |
36 | + deferred.resolve(result.data); | |
37 | + },function (result){ | |
38 | + deferred.resolve(result.data); | |
39 | + }) | |
40 | + return deferred.promise; | |
41 | + } | |
42 | + } | |
8 | 43 | |
9 | - | |
10 | - | |
11 | - } | |
12 | - | |
13 | 44 | })(); |
14 | 45 | \ No newline at end of file | ... | ... |