Commit 7152ff131b80680ee1af00d9a27cbb73469ba043

Authored by Rishav
1 parent 3e51f9b1d4
Exists in master

model handle

app/partials/ContactView/ContactView.controller.js
... ... @@ -10,15 +10,16 @@
10 10 });
11 11  
12 12 ContactViewService.getContacts().then(function(result) {
13   - console.log('==========',result);
14 13 $scope.contactList = result;
15   -
16 14 })
17 15  
  16 + $scope.reset = function(){
  17 + $("input").val("");
  18 + }
  19 +
18 20 $scope.changePriceEmail = function(id, index){
19 21 event.stopPropagation();
20 22 var contactId = id;
21   - console.log($scope.contactList[index].priceEmail)
22 23 var statusData = "status=" + $scope.contactList[index].priceEmail;
23 24 ViewcontactService.changePriceEmail(contactId, statusData).then(function(result) {
24 25 if(result.success){
... ... @@ -30,7 +31,6 @@
30 31 }
31 32  
32 33 ContactViewService.getCompanies().then(function(result) {
33   - console.log('==========',result);
34 34 $scope.companies = result;
35 35  
36 36 })
... ... @@ -38,7 +38,6 @@
38 38 $scope.contactData = {};
39 39 $scope.contactData.contactList = [];
40 40 $scope.addContact = function(){
41   - console.log('==== $scope.data======', $scope.data);
42 41 $scope.contactData.contactList.push($scope.data);
43 42 ViewCompanyService.addContact($scope.contactData).then(function(result) {
44 43 if(result.success){
... ...
app/partials/ContactView/ContactView.html
... ... @@ -304,7 +304,7 @@
304 304 </div>
305 305 </div>
306 306 <div class="modal-footer" style="border-top: 0;">
307   - <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  307 + <button type="button" class="btn btn-default" ng-click="reset()" data-dismiss="modal">Cancel</button>
308 308 <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addContact()">Save</button>
309 309 </div>
310 310 </div>
... ...
app/partials/FuelVendors/FuelVendors.controller.js
... ... @@ -10,6 +10,11 @@
10 10 $(document).ready(function() {
11 11 $('#example').DataTable();
12 12 });
  13 +
  14 + $scope.reset = function(){
  15 + $("input").val("");
  16 + }
  17 +
13 18 $scope.data = {};
14 19 $scope.aircraft = {};
15 20 $scope.data.activate = true;
... ...
app/partials/FuelVendors/FuelVendors.html
... ... @@ -606,7 +606,7 @@
606 606 This is the final step.
607 607 </div> -->
608 608 <div class="modal-footer" style="border-top: 0;">
609   - <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  609 + <button type="button" class="btn btn-default" ng-click="reset()" data-dismiss="modal">Cancel</button>
610 610 <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addFirstData('#vendor-modal-3', 2)">Next: Add Aircraft</button>
611 611 <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#vendor-modal-3', 1)">Go Back</button>
612 612 <!-- <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#vendor-modal-3', 3)">Continue</button> -->
... ...
app/partials/customers/customers.controller.js
... ... @@ -8,6 +8,11 @@
8 8 $(document).ready(function() {
9 9 $('#example').DataTable();
10 10 });
  11 +
  12 + $scope.reset2 = function(){
  13 + $("input").val("");
  14 + }
  15 +
11 16 $scope.data = {};
12 17 $scope.aircraft = {};
13 18 $scope.data.activate = true;
... ... @@ -16,7 +21,6 @@
16 21  
17 22 function getAllCompanies(){
18 23 CustomersService.getAllCompanies().then(function(result) {
19   - console.log(result)
20 24 $scope.companyList = result;
21 25 for(var i=0; i<$scope.companyList.length; i++){
22 26 $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id;
... ... @@ -26,7 +30,6 @@
26 30  
27 31 $scope.editMargin = function(customer){
28 32 event.stopPropagation();
29   - console.log(customer.masterMargin)
30 33  
31 34 var companyMargin = "companyName=" + customer.companyName + "&masterMargin=" + customer.masterMargin
32 35 + "&addressOne=" + customer.addressOne + "&addressTwo=" + customer.addressTwo + "&city=" + customer.city + "&state="
... ... @@ -64,7 +67,6 @@
64 67 $scope.showMarginError = false;
65 68  
66 69 $scope.removeValidation = function(){
67   - console.log('key up');
68 70 $scope.showCompanyError = false;
69 71 $('.companyNameInput').removeClass('customErrorInput');
70 72 }
... ... @@ -75,7 +77,6 @@
75 77 }
76 78  
77 79 $scope.addFirstData = function(sel, step){
78   - // console.log($scope.data)
79 80 if($scope.data.companyName == undefined){
80 81 $scope.showCompanyError = true;
81 82 $('.companyNameInput').addClass('customErrorInput');
... ... @@ -91,7 +92,6 @@
91 92 + "&activate=" + $scope.data.activate + "&baseIcao=" + $scope.data.baseIcao;
92 93  
93 94 CustomersService.addCompany(companyData).then(function(result) {
94   - console.log(result)
95 95 $scope.accountId = result;
96 96 $scope.aircraft.accountId = $scope.accountId;
97 97 })
... ... @@ -116,7 +116,6 @@
116 116 'sizeId' : '',
117 117 'marginId': ''
118 118 });
119   - console.log($scope.aircraftDetails)
120 119 };
121 120  
122 121 $scope.getModal = function(makeId, index){
... ... @@ -134,9 +133,8 @@
134 133 $scope.showLoader = true;
135 134 CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) {
136 135 $scope.showLoader = false;
137   - $scope.aircraftDetails[index].aircraftSizeList = result;
  136 + $scope.aircraftDetails[index].aircraftSizeList = result;
138 137 //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0];
139   - console.log($scope.aircraftDetails[index].size)
140 138 })
141 139 }
142 140  
... ... @@ -156,7 +154,6 @@
156 154 $scope.aircraftListData.accountId = $scope.aircraft.accountId;
157 155  
158 156 CustomersService.addAircraft($scope.aircraftListData).then(function(result) {
159   - console.log(result)
160 157  
161 158 if(result != null && result.success){
162 159 toastr.success(''+result.success+'', {
... ...
app/partials/customers/customers.html
... ... @@ -529,7 +529,7 @@
529 529 This is the final step.
530 530 </div> -->
531 531 <div class="modal-footer" style="border-top: 0;">
532   - <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  532 + <button type="button" class="btn btn-default" ng-click="reset2()" data-dismiss="modal">Cancel</button>
533 533 <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addFirstData('#demo-modal-3', 2)">Next: Add Aircraft</button>
534 534 <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 1)">Go Back</button>
535 535 <!-- <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 3)">Continue</button> -->
... ...
app/partials/viewCompany/viewCompany.controller.js
... ... @@ -14,6 +14,12 @@
14 14 $scope.showUpdateBtn = false;
15 15 $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId'));
16 16  
  17 + $(document).ready(function() {
  18 + $("#reset").click(function() {
  19 + $("input").val("");
  20 + });
  21 + });
  22 +
17 23 CustomersService.getMargin().then(function(result) {
18 24 $scope.marginList = result;
19 25 })
... ... @@ -177,6 +183,10 @@
177 183 $scope.showUpdateBtn = true;
178 184 }
179 185  
  186 + $scope.base = function(){
  187 + $scope.showUpdateBtn = true;
  188 + }
  189 +
180 190 $scope.addressChange = function(){
181 191 $scope.showAddress = false;
182 192 $scope.showUpdateBtn = true;
... ... @@ -220,6 +230,13 @@
220 230  
221 231 }
222 232  
  233 + $scope.cancelData = function(){
  234 + $scope.showNoteData = true;
  235 + $scope.showCompanyName = true;
  236 + $scope.showAddress = true;
  237 + $scope.showUpdateBtn = false;
  238 + }
  239 +
223 240 $scope.sendMail = function(){
224 241 ViewCompanyService.sendMail(companyId).then(function(result) {
225 242 if(result != null && result.success){
... ... @@ -329,13 +346,13 @@
329 346 contactName = value;
330 347 $('#customField').css('display', 'block');
331 348 }
332   -
  349 + $scope.custom = {};
333 350 }
334 351  
335 352 $scope.cancelCustomField = function(){
336 353 $('#customField').css('display', 'none');
337 354 }
338   - $scope.custom = {};
  355 +
339 356 $scope.acceptCustomField = function(){
340 357 if($scope.custom.content == undefined){
341 358 toastr.error('Please add some content', {
... ... @@ -360,11 +377,11 @@
360 377 }
361 378 }
362 379  
363   - updateFuelManagerService.getFuelPricing($scope.userProfileId).then(function(result) {
  380 + updateFuelManagerService.getFuelPricingNew().then(function(result) {
364 381 $scope.fuelPricing = result;
365 382 for (var i = 0; i<$scope.fuelPricing.length; i++) {
366   - if ($scope.fuelPricing[i].expirationDate != null) {
367   - $scope.fuelPricing[i].expirationDate = new Date($scope.fuelPricing[i].expirationDate)
  383 + if ($scope.fuelPricing[i].fuelPricing.expirationDate != null) {
  384 + $scope.fuelPricing[i].fuelPricing.expirationDate = new Date($scope.fuelPricing[i].fuelPricing.expirationDate)
368 385 }
369 386 }
370 387 })
... ...
app/partials/viewCompany/viewCompany.html
... ... @@ -141,7 +141,7 @@
141 141 <i class="fa fa-building-o" aria-hidden="true"></i>
142 142 <h3>Company Details</h3>
143 143 <label>BASE ICAO</label>
144   - <input type="tel" ng-model="companyData.baseIcao" style="line-height: 18px;width: 50px;padding: 0px 9px;" />
  144 + <input type="tel" ng-model="companyData.baseIcao" ng-click="base()" style="line-height: 18px;width: 50px;padding: 0px 9px;" />
145 145  
146 146 <div class="pull-right" style="margin-top: 5px; margin-right: 10px;">
147 147 <toggle ng-model="companyData.activate" ng-change="changeCompanyStatus()" size="customToogle" on="Active" off="Dactive"></toggle>
... ... @@ -157,7 +157,7 @@
157 157 <input type="tel" ng-hide="showCompanyName" ng-model="companyData.companyName" class="form-control"/>
158 158 </div>
159 159 <div class="col-md-5">
160   - <select class="form-control" style="padding: 4px 8px;background: #ebebeb;" ng-model="companyData.certificateType" ng-click="editData()">
  160 + <select class="form-control" style="padding: 4px 8px;background: #ebebeb;" ng-model="companyData.certificateType">
161 161 <option class="optionclass" disabled selected>Certificate Type</option>
162 162 <option class="optionclass" value="corporate">Part 91 (Corporate)</option>
163 163 <option class="optionclass" value="charter">Part 135 (Charter)</option>
... ... @@ -171,7 +171,7 @@
171 171 <p class="new-label">
172 172 <span>Master Margin Setting </span>
173 173 <!-- <select class="form-control" ng-model="companyData.masterMargin" ng-options="margin.id as margin.marginName for margin in marginList"></select> -->
174   - <select class="form-control" style="width: 135px;padding: 4px 8px;" ng-model="companyData.masterMargin" ng-click="editData()">
  174 + <select class="form-control" style="width: 135px;padding: 4px 8px;" ng-model="companyData.masterMargin">
175 175 <option ng-repeat="margin in marginList" value="{{margin.id}}">{{margin.marginName}}</option>
176 176 </select>
177 177 <span>&nbsp;See Aircrart List</span>
... ... @@ -180,14 +180,14 @@
180 180 </div>
181 181 <div class="row" style="margin-left:0px;">
182 182 <div class="col-md-5" style="padding-left: 0;">
183   - <input type="checkbox" name="" ng-click="editData()" ng-model="companyData.baseTenant"> Tenant/Base Customer
  183 + <input type="checkbox" name="" ng-model="companyData.baseTenant"> Tenant/Base Customer
184 184 </div>
185 185 <div class="col-md-5" style="padding-left: 0;">
186   - <input type="checkbox" name="" ng-click="editData()" ng-model="companyData.fuelerlinxCustomer"> FuelerLinx Customer
  186 + <input type="checkbox" name="" ng-model="companyData.fuelerlinxCustomer"> FuelerLinx Customer
187 187 </div>
188 188 </div>
189 189 <div>
190   - <input type="checkbox" name="" ng-click="editData()" ng-model="companyData.contractFuelVendor"> CAA Member
  190 + <input type="checkbox" name="" ng-model="companyData.contractFuelVendor"> CAA Member
191 191 </div>
192 192 </br>
193 193 <div class="new-address">
... ... @@ -238,6 +238,7 @@
238 238 </div>
239 239 <div class="pull-left">
240 240 <button ng-click="editData()" ng-show="showUpdateBtn" class="btn btn-success">Save</button>
  241 + <button ng-click="cancelData()" ng-show="showUpdateBtn" class="btn btn-default">Cancel</button>
241 242 </div>
242 243 <div class="pull-right">
243 244 <button type="button" ng-click="openConfirmMail()" class="btn btn-primary">Distribute Price to Company Contacts</button>
... ... @@ -356,13 +357,13 @@
356 357 </thead>
357 358 <tbody>
358 359 <tr ng-repeat="fuel in fuelPricing">
359   - <td><input type="checkbox"></td>
360   - <td>{{fuel.product.name}}</td>
361   - <td>${{fuel.cost}}</td>
362   - <td>${{fuel.papMargin}}</td>
363   - <td style="color:#55AF8B;">${{fuel.papTotal}}</td>
364   - <td style="color:#F90">{{fuel.expirationDate}}</td>
365   - </tr>
  360 + <td><input type="checkbox" ng-model="fuel.status"></td>
  361 + <td>{{fuel.name}}</td>
  362 + <td>${{fuel.fuelPricing.cost}}</td>
  363 + <td>${{fuel.fuelPricing.papMargin}}</td>
  364 + <td style="color:#55AF8B;">${{fuel.fuelPricing.papTotal}}</td>
  365 + <td style="color:#F90">{{fuel.fuelPricing.expirationDate}}</td>
  366 + </tr>.
366 367 </tbody>
367 368 </table>
368 369 </div>
... ... @@ -532,7 +533,7 @@
532 533 </div>
533 534 </div>
534 535 <div class="modal-footer" style="border-top: 0;">
535   - <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  536 + <button type="button" class="btn btn-default" id="reset" data-dismiss="modal">Cancel</button>
536 537 <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addContact()">Save</button>
537 538 </div>
538 539 </div>
... ... @@ -619,7 +620,7 @@
619 620 </div>
620 621 </div>
621 622 <div class="modal-footer" style="border-top: 0;">
622   - <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  623 + <button type="button" class="btn btn-default" id="reset" data-dismiss="modal">Cancel</button>
623 624 <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="saveCompanyData()">Save</button>
624 625 </div>
625 626 </div>
... ...
app/partials/viewcontact/viewcontact.controller.js
... ... @@ -148,6 +148,17 @@
148 148 })
149 149 }
150 150  
  151 + $scope.cancelContact = function(){
  152 + $scope.editName = true;
  153 + $scope.editCompany = true;
  154 + $scope.editAddress = true;
  155 + $scope.editPhone = true;
  156 + $scope.editMobile = true;
  157 + $scope.editEmail = true;
  158 + $scope.editContactNotes = true;
  159 + $scope.showUpdateBtn = false;
  160 + }
  161 +
151 162 $scope.checkPrimaryContact = function(companyId){
152 163 if($scope.contactDetail.primaryContact == true){
153 164 ViewCompanyService.checkPrimaryContact(companyId).then(function(result) {
... ...
app/partials/viewcontact/viewcontact.html
... ... @@ -95,6 +95,7 @@
95 95  
96 96 <div>
97 97 <button ng-click="updateContact(contactDetail)" ng-show="showUpdateBtn" class="btn btn-success pull-left">Update Contact</button>
  98 + <button ng-click="cancelContact()" style="margin-left: 5px;" ng-show="showUpdateBtn" class="btn btn-default pull-left">Cancel</button>
98 99 <button type="button" class="btn btn-primary pull-right">Send Price to This Contacts</button>
99 100 <div class="clearfix"></div>
100 101 </div>
... ...