|
|
@@ -73,6 +73,10 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
url : "/notice",
|
|
|
templateUrl : "static/tpl/index/sale/notice.html",
|
|
|
controller: 'SaleNoticeCtrl'
|
|
|
+ }).state('sale.customer', {
|
|
|
+ url : "/customer",
|
|
|
+ templateUrl : "static/tpl/index/sale/customer.html",
|
|
|
+ controller: 'CustomerCtrl'
|
|
|
}).state('sale.inquiry', {
|
|
|
url : "/inquiry",
|
|
|
templateUrl : "static/tpl/index/sale/inquiry.html",
|
|
|
@@ -227,7 +231,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.routeState = routeState || 'home';
|
|
|
});
|
|
|
});
|
|
|
- app.controller('AuthCtrl', function($scope, $window, AuthenticationService) {
|
|
|
+ app.controller('AuthCtrl', function($scope, $window, AuthenticationService, toaster) {
|
|
|
$scope.isAuthed = AuthenticationService.isAuthed();
|
|
|
$scope.userInfo = {};
|
|
|
AuthenticationService.getAuthentication().success(function(data) {
|
|
|
@@ -240,6 +244,22 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$window.location.reload();
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+ $scope.addFavorite = function(){
|
|
|
+ var url = encodeURI(window.location.href);
|
|
|
+ try{
|
|
|
+ //ie浏览器收藏方式
|
|
|
+ window.external.addFavorite(url, "优软商务平台");
|
|
|
+ }catch(e) {
|
|
|
+ try{
|
|
|
+ //火狐浏览器收藏方式
|
|
|
+ window.sidebar.addPanel("优软商务平台", url);
|
|
|
+ }catch (e) {
|
|
|
+ toaster.pop('warning', '提示', "您的浏览器不支持自动添加收藏夹,请使用Ctrl+D进行添加,"+
|
|
|
+ "或手动在浏览器里进行设置。");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
});
|
|
|
app.controller('TodoCtrl', function($scope, SnapshotService){
|
|
|
SnapshotService.getTodo(function(data){
|
|
|
@@ -392,6 +412,41 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
SnapshotService.getNotice(5, function(data){
|
|
|
$scope.notices = data;
|
|
|
});
|
|
|
+
|
|
|
+ $scope.dateTime = new Date();
|
|
|
+ });
|
|
|
+ app.controller('VendCountCtrl', function($scope, VendorService){
|
|
|
+ VendorService.getCount(function(date){
|
|
|
+ $scope.count = date;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ app.controller('CustomerCtrl', function($scope, $rootScope, VendorService, BaseService, ngTableParams){
|
|
|
+ $rootScope.active = 'customer';
|
|
|
+
|
|
|
+ $scope.customerParams = new ngTableParams({
|
|
|
+ page : 1,
|
|
|
+ count : 10,
|
|
|
+ sorting: {
|
|
|
+// time: 'desc'
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ total : 0,
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
+ getData : function($defer, params) {
|
|
|
+ $scope.loading = true;
|
|
|
+ VendorService.customer.get(BaseService.parseParams(params.url()), function(page){
|
|
|
+ $scope.loading = false;
|
|
|
+ if(page) {
|
|
|
+ params.total(page.totalElements);
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ }
|
|
|
+ $scope.totalCount = page.totalElements;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ app.controller('VendorCtrl', function($scope, $rootScope, VendorService){
|
|
|
+ $rootScope.active = 'customer';
|
|
|
});
|
|
|
var getState = function(active) {
|
|
|
var fn = 'get';
|
|
|
@@ -494,7 +549,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
};
|
|
|
|
|
|
$scope.print = function(order) {
|
|
|
- ReportService.print(order.vendUU, 'purchase', '{purc_orders.pu_id}=' + order.id, '销售订单-' + order.code);
|
|
|
+ ReportService.print(order.enUU, 'purchase', '{purc_orders.pu_id}=' + order.id, '销售订单-' + order.code);
|
|
|
};
|
|
|
|
|
|
$scope.getReply = function(item) {
|