|
@@ -256,6 +256,12 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.todo = data;
|
|
$scope.todo = data;
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
+ app.controller('TruckCtrl', function($scope, $rootScope, SaleTruck){
|
|
|
|
|
+ SaleTruck.query({}, function(data){
|
|
|
|
|
+ $rootScope.truck = data;
|
|
|
|
|
+ $scope.truckCount = data ? data.length : 0;
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
app.controller('PersonalSaleStatCtrl', function($scope, SaleStat) {
|
|
app.controller('PersonalSaleStatCtrl', function($scope, SaleStat) {
|
|
|
SaleStat.cust({}, function(data){
|
|
SaleStat.cust({}, function(data){
|
|
|
var p = [], q = [];
|
|
var p = [], q = [];
|
|
@@ -1038,7 +1044,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
- app.controller('SaleNoticeCtrl', function($scope, $filter, PurcNotice, ngTableParams, toaster, BaseService, PurcNoticeHis, $modal){
|
|
|
|
|
|
|
+ app.controller('SaleNoticeCtrl', function($scope, $rootScope, $filter, PurcNotice, ngTableParams, toaster, BaseService, PurcNoticeHis, $modal, SaleTruck){
|
|
|
$scope.active = 'todo';
|
|
$scope.active = 'todo';
|
|
|
$scope.dateZoneText = '一个月内';
|
|
$scope.dateZoneText = '一个月内';
|
|
|
$scope.condition = {dateZone: 1};
|
|
$scope.condition = {dateZone: 1};
|
|
@@ -1195,6 +1201,28 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.onSearch = function() {
|
|
$scope.onSearch = function() {
|
|
|
$scope.tableParams.reload();
|
|
$scope.tableParams.reload();
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ //货车功能
|
|
|
|
|
+ var truck = $rootScope.truck;
|
|
|
|
|
+ if(!truck) {
|
|
|
|
|
+ SaleTruck.query({}, function(data){
|
|
|
|
|
+ truck = $rootScope.truck = data;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ $scope.isInTruck = function(noticeId) {
|
|
|
|
|
+ return truck.indexOf(noticeId) > -1;
|
|
|
|
|
+ };
|
|
|
|
|
+ $scope.addtoTruck = function(noticeId) {
|
|
|
|
|
+ SaleTruck.save({}, {noticeId: noticeId}, function(){
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ $scope.delFromTruck = function(noticeId) {
|
|
|
|
|
+ SaleTruck.remove({}, {noticeId: noticeId}, function(){
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
app.controller('SaleNoticeSendByBatchCtrl', function($scope, $modalInstance, Symbol, selectedNotices, PurcNotice, toaster){
|
|
app.controller('SaleNoticeSendByBatchCtrl', function($scope, $modalInstance, Symbol, selectedNotices, PurcNotice, toaster){
|
|
|
$scope.notices = angular.copy(selectedNotices);
|
|
$scope.notices = angular.copy(selectedNotices);
|