|
|
@@ -38,6 +38,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
},
|
|
|
controller: function($scope) {
|
|
|
$scope.truck = [];
|
|
|
+ $scope.dataChanged = false;
|
|
|
}
|
|
|
}).state('sale.index', {
|
|
|
url : "",
|
|
|
@@ -260,7 +261,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
});
|
|
|
});
|
|
|
app.controller('TruckCtrl', function($scope, $rootScope, $modal, SaleTruck){
|
|
|
-
|
|
|
SaleTruck.query({}, function(data){
|
|
|
$rootScope.truck = data;
|
|
|
$scope.truckCount = data ? data.length : 0;
|
|
|
@@ -281,7 +281,10 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
controller: 'TruckModalCtrl',
|
|
|
size: 'lg'
|
|
|
}).result.then(function(s){
|
|
|
- s && ($scope.clearAll());
|
|
|
+ if(s) {
|
|
|
+ $scope.clearAll();
|
|
|
+ $rootScope.dataChanged = true;
|
|
|
+ }
|
|
|
});
|
|
|
};
|
|
|
});
|
|
|
@@ -1296,6 +1299,11 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
}, function(data) {
|
|
|
truck = $rootScope.truck;
|
|
|
}, true);
|
|
|
+ $scope.$watch(function(){
|
|
|
+ return $rootScope.dataChanged;
|
|
|
+ }, function(data) {
|
|
|
+ data && ($scope.tableParams.reload());
|
|
|
+ }, true);
|
|
|
});
|
|
|
app.controller('SaleNoticeSendByBatchCtrl', function($scope, $modalInstance, Symbol, selectedNotices, PurcNotice, toaster){
|
|
|
$scope.notices = angular.copy(selectedNotices);
|