Commit 229e98b836d18c5abb770ffefd57e64cca66f6c9
1 parent
1e35fc06ba
Exists in
master
api hit on send price to contact in view contact
Showing
4 changed files
with
72 additions
and
3 deletions
Show diff stats
app/partials/fuelOrders/fuelOrders.controller.js
... | ... | @@ -62,7 +62,13 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT |
62 | 62 | $scope.deleteAttachment = function() { |
63 | 63 | fuelOrdersService.deleteAttachment($scope.attachmentrowid).then(function(result) { |
64 | 64 | console.log(result, $scope.attachmentrowid) |
65 | - }) | |
65 | + | |
66 | + if(result.success){ | |
67 | + toastr.success(''+result.success+'', { | |
68 | + closeButton: true | |
69 | + }) | |
70 | + } | |
71 | + }) | |
66 | 72 | $('#delete1').css('display', ''); |
67 | 73 | } |
68 | 74 | |
... | ... | @@ -70,8 +76,15 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT |
70 | 76 | $scope.data.media = attachmentData |
71 | 77 | $scope.data.id = $scope.attachmentrowid |
72 | 78 | fuelOrdersService.uploadAttachment($scope.data).then(function(result) { |
79 | + console.log(result) | |
80 | + if(result){ | |
81 | + // console.log(result.success) | |
82 | + toastr.success(''+"Upload Successful"+'', { | |
83 | + closeButton: true | |
84 | + }) | |
85 | + } | |
73 | 86 | |
74 | - }) | |
87 | + }) | |
75 | 88 | $('#demo-modal-6').css('display', 'none'); |
76 | 89 | } |
77 | 90 | ... | ... |
app/partials/viewcontact/viewcontact.controller.js
... | ... | @@ -240,5 +240,25 @@ |
240 | 240 | $scope.cancelDelete = function(){ |
241 | 241 | $('#delete2').css('display', 'none'); |
242 | 242 | } |
243 | + | |
244 | + $scope.confirmMail = function(){ | |
245 | + | |
246 | + $('#confirm1').css('display', 'block'); | |
247 | + | |
248 | + } | |
249 | + | |
250 | + $scope.saveAndCloseConfirm = function(){ | |
251 | + $('#confirm1').css('display', 'none'); | |
252 | + ViewcontactService.sendMailTo(contactId).then(function(result) { | |
253 | + toastr.success(''+result.success+'', { | |
254 | + closeButton: true | |
255 | + }) | |
256 | + }) | |
257 | + } | |
258 | + $scope.cancelAndCloseConfirm = function(){ | |
259 | + $scope.sendEmail = {}; | |
260 | + $scope.sendEmail.pricing = ''; | |
261 | + $('#confirm1').css('display', 'none'); | |
262 | + } | |
243 | 263 | |
244 | 264 | }]); | ... | ... |
app/partials/viewcontact/viewcontact.html
... | ... | @@ -104,7 +104,7 @@ |
104 | 104 | <div> |
105 | 105 | <button ng-click="updateContact(contactDetail)" ng-show="showUpdateBtn" class="btn btn-success pull-left">Update Contact</button> |
106 | 106 | <button ng-click="cancelContact()" style="margin-left: 5px;" ng-show="showUpdateBtn" class="btn btn-default pull-left">Cancel</button> |
107 | - <button type="button" class="btn btn-primary pull-right">Send Price to This Contacts</button> | |
107 | + <button type="button" class="btn btn-primary pull-right" ng-click="confirmMail()">Send Price to This Contacts</button> | |
108 | 108 | <div class="clearfix"></div> |
109 | 109 | </div> |
110 | 110 | </div> |
... | ... | @@ -181,4 +181,25 @@ |
181 | 181 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelDelete()">Cancel</button> |
182 | 182 | </div> |
183 | 183 | </div> |
184 | +</div> | |
185 | + | |
186 | +<div class="customConfirmPopBackdrop" id="confirm1" style="display: none;"> | |
187 | + <div class="customModalInner"> | |
188 | + <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | |
189 | + <table> | |
190 | + <tr> | |
191 | + <td> | |
192 | + <img src="img/info.png" style="width: 50px;"> | |
193 | + </td> | |
194 | + <td> | |
195 | + <p style="padding: 5px 10px; margin-bottom: 0;">Are you sure that you want to email pricing to this contact?</p> | |
196 | + </td> | |
197 | + </tr> | |
198 | + </table> | |
199 | + </div> | |
200 | + <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | |
201 | + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="saveAndCloseConfirm()">Yes</button> | |
202 | + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelAndCloseConfirm()">Cancel</button> | |
203 | + </div> | |
204 | + </div> | |
184 | 205 | </div> |
185 | 206 | \ No newline at end of file | ... | ... |
app/partials/viewcontact/viewcontact.service.js
... | ... | @@ -83,6 +83,21 @@ |
83 | 83 | }) |
84 | 84 | return deferred.promise; |
85 | 85 | } |
86 | + | |
87 | + this.sendMailTo = function(contactid){ | |
88 | + var deferred = $q.defer(); | |
89 | + $http({ | |
90 | + method : 'POST', | |
91 | + url : BASE_URL.url +'/company/contact/mailPriceToContacts/'+contactid, | |
92 | + headers : {'Content-Type': 'application/json'} | |
93 | + }) | |
94 | + .then(function (result){ | |
95 | + deferred.resolve(result.data); | |
96 | + },function (result){ | |
97 | + deferred.resolve(result.data); | |
98 | + }) | |
99 | + return deferred.promise; | |
100 | + } | |
86 | 101 | |
87 | 102 | } |
88 | 103 | ... | ... |