|
|
@@ -1,4 +1,4 @@
|
|
|
- define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ui-form', 'ngLocal', 'ngTable', 'ngSanitize', 'ngDraggable', 'common/services', 'common/directives', 'common/query/brand', 'common/query/address', 'common/query/return' , 'common/query/change' ,'common/query/component', 'common/query/order', 'common/query/purchase', 'common/query/invoice', 'common/query/property', 'common/query/kind', 'common/query/property', 'common/query/commodity', 'common/query/receipt', 'common/query/logistics' ,'angular-toaster', 'ui-jquery', 'jquery-uploadify','common/query/dateParse' , 'common/query/bankTransfer' ,'common/query/bankInfo', 'common/query/urlencryption', 'common/query/bill', 'common/query/makerDemand', 'common/query/goods', 'common/query/validtime', 'file-upload','file-upload-shim', 'common/query/slideImage', 'common/query/kindAdvice', 'common/query/responseLogistics', 'common/query/search','common/directives/dynamicInput', 'common/query/auditorMail', 'common/query/tradeBasicProperties', 'common/query/exchangeRate', 'common/query/tradeDeliveryDelayTime', 'common/query/payment', 'common/query/kindContrast', 'common/query/crawlTask', 'common/query/afterSale', 'common/query/refund', 'common/query/messageBoard', 'common/query/logisticsPort', 'common/query/storeInfo', 'common/query/cms', 'common/query/help', 'common/query/commonCount', 'common/module/store_admin_violations_module', 'common/query/internalMessage','common/query/user','common/query/secQuestion','common/query/keyWord','common/query/logUsage','common/query/seekQualityBuyer','common/query/loanApply', 'common/query/supplier', 'common/query/seekSalesman', 'common/query/b2bManage'], function(angularAMD) {
|
|
|
+ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ui-form', 'ngLocal', 'ngTable', 'ngSanitize', 'ngDraggable', 'common/services', 'common/directives', 'common/query/brand', 'common/query/address', 'common/query/return' , 'common/query/change' ,'common/query/component', 'common/query/order', 'common/query/purchase', 'common/query/invoice', 'common/query/property', 'common/query/kind', 'common/query/property', 'common/query/commodity', 'common/query/receipt', 'common/query/logistics' ,'angular-toaster', 'ui-jquery', 'jquery-uploadify','common/query/dateParse' , 'common/query/bankTransfer' ,'common/query/bankInfo', 'common/query/urlencryption', 'common/query/bill', 'common/query/makerDemand', 'common/query/goods', 'common/query/validtime', 'file-upload','file-upload-shim', 'common/query/slideImage', 'common/query/kindAdvice', 'common/query/responseLogistics', 'common/query/search','common/directives/dynamicInput', 'common/query/auditorMail', 'common/query/tradeBasicProperties', 'common/query/exchangeRate', 'common/query/tradeDeliveryDelayTime', 'common/query/payment', 'common/query/kindContrast', 'common/query/crawlTask', 'common/query/afterSale', 'common/query/refund', 'common/query/messageBoard', 'common/query/logisticsPort', 'common/query/storeInfo', 'common/query/cms', 'common/query/help', 'common/query/commonCount', 'common/module/store_admin_violations_module', 'common/query/internalMessage','common/query/user','common/query/secQuestion','common/query/keyWord','common/query/logUsage','common/query/seekQualityBuyer','common/query/loanApply', 'common/query/supplier', 'common/query/seekSalesman', 'common/query/b2bManage', 'common/query/adminNews'], function(angularAMD) {
|
|
|
'use strict';
|
|
|
|
|
|
/**
|
|
|
@@ -8,7 +8,7 @@
|
|
|
return this.length > 0 ? this[this.length - 1] : null;
|
|
|
};
|
|
|
|
|
|
- var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ui.form', 'ng.local', 'ngTable', 'ngSanitize', 'ngDraggable', 'common.services', 'common.directives', 'brandServices', 'addressServices', 'returnServices', 'changeServices', 'componentServices', 'orderServices', 'purchaseServices', 'invoiceServices', 'propertyServices', 'receiptServices', 'logisticsServices', 'common.query.kind', 'toaster','ui.jquery', 'commodityServices', 'dateparseServices', 'bankInfo' , 'bankTransfer', 'urlencryptionServices', 'billServices', 'makerDemand', 'goodsServices', 'validtimeServices', 'angularFileUpload', 'slideImageService', 'common.query.kindAdvice', 'responseLogisticsService', 'searchService', 'ngDynamicInput', 'ReviewerEmailInfoService', 'tradeBasicPropertiesServices', 'exchangeRateModule', 'tradeDeliveryDelayTimeModule', 'PaymentService', 'kindContrastServices', 'crawlTaskServices', 'afterSaleService', 'refundModule', 'messageBoardServices', 'logisticsPortService', 'storeInfoServices', 'cmsService', 'helpServices', 'commonCountServices', 'tool.directives', 'StoreAdminViolationsModule', 'internalMessageServices','common.query.user','secQuestionServices','keyWordServices','logUsageServices','seekQualityBuyerServices', 'loanApplyService', 'supplierServices', 'seekSalesmanServices', 'b2bManageService']);
|
|
|
+ var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ui.form', 'ng.local', 'ngTable', 'ngSanitize', 'ngDraggable', 'common.services', 'common.directives', 'brandServices', 'addressServices', 'returnServices', 'changeServices', 'componentServices', 'orderServices', 'purchaseServices', 'invoiceServices', 'propertyServices', 'receiptServices', 'logisticsServices', 'common.query.kind', 'toaster','ui.jquery', 'commodityServices', 'dateparseServices', 'bankInfo' , 'bankTransfer', 'urlencryptionServices', 'billServices', 'makerDemand', 'goodsServices', 'validtimeServices', 'angularFileUpload', 'slideImageService', 'common.query.kindAdvice', 'responseLogisticsService', 'searchService', 'ngDynamicInput', 'ReviewerEmailInfoService', 'tradeBasicPropertiesServices', 'exchangeRateModule', 'tradeDeliveryDelayTimeModule', 'PaymentService', 'kindContrastServices', 'crawlTaskServices', 'afterSaleService', 'refundModule', 'messageBoardServices', 'logisticsPortService', 'storeInfoServices', 'cmsService', 'helpServices', 'commonCountServices', 'tool.directives', 'StoreAdminViolationsModule', 'internalMessageServices','common.query.user','secQuestionServices','keyWordServices','logUsageServices','seekQualityBuyerServices', 'loanApplyService', 'supplierServices', 'seekSalesmanServices', 'b2bManageService','adminNewsService']);
|
|
|
app.init = function() {
|
|
|
angularAMD.bootstrap(app);
|
|
|
};
|
|
|
@@ -16,13 +16,13 @@
|
|
|
// ui-router 路由配置
|
|
|
app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', function($stateProvider, $urlRouterProvider, $httpProvider){
|
|
|
$urlRouterProvider.otherwise("/index");
|
|
|
- $stateProvider.state('index', {
|
|
|
+ $stateProvider.state('index', angularAMD.route({
|
|
|
// 管理首页
|
|
|
url: '/index',
|
|
|
templateUrl : 'static/view/admin/index.html',
|
|
|
controller : '',
|
|
|
controllerUrl : ''
|
|
|
- }).state('trade_purchase', angularAMD.route({
|
|
|
+ })).state('trade_purchase', angularAMD.route({
|
|
|
// 采购单管理
|
|
|
url: '/trade/purchase',
|
|
|
templateUrl : 'static/view/admin/trade/trade_purchase.html',
|
|
|
@@ -850,10 +850,26 @@
|
|
|
}]);
|
|
|
}]);
|
|
|
|
|
|
- app.run(['$rootScope', 'BaseService', function($rootScope, BaseService) {
|
|
|
+ app.run(['$rootScope', 'BaseService', '$location', function($rootScope, BaseService, $location) {
|
|
|
$rootScope.rootPath = BaseService.getRootPath();
|
|
|
$rootScope.page = 'vendor';// 导航栏状态,'个人中心'状态激活
|
|
|
- }]);
|
|
|
+ $rootScope.$on('$stateChangeSuccess', function(evt, current, previous) {
|
|
|
+ var _url = $location.absUrl().toString()
|
|
|
+ if (_url.indexOf('/admin#/index') > -1) {
|
|
|
+ $rootScope.newShow = true
|
|
|
+ } else {
|
|
|
+ $rootScope.newShow = false
|
|
|
+ }
|
|
|
+ // window.onmouseup = function() {
|
|
|
+ // var _url = $location.absUrl().toString()
|
|
|
+ // if (_url.indexOf('/admin#/index') > -1) {
|
|
|
+ // $rootScope.newShow = true
|
|
|
+ // } else {
|
|
|
+ // $rootScope.newShow = false
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ });
|
|
|
+ }]);
|
|
|
|
|
|
// 状态码 -> 描述
|
|
|
app.filter('status', function(){
|
|
|
@@ -951,6 +967,92 @@
|
|
|
});
|
|
|
}]);
|
|
|
|
|
|
+ // 消息
|
|
|
+ app.controller('adminNewsCtrl', ['$rootScope', '$location', '$scope', 'ngTableParams', 'adminNews', 'toaster', 'BaseService', '$filter', function ($rootScope, $location, $scope, ngTableParams, adminNews, toaster, BaseService, $filter) {
|
|
|
+ /**
|
|
|
+ * 分页获取消息
|
|
|
+ */
|
|
|
+ var _url = $location.absUrl().toString()
|
|
|
+ if (_url.indexOf('/admin#/index') > -1) {
|
|
|
+ $rootScope.newShow = true
|
|
|
+ }
|
|
|
+
|
|
|
+ $scope.newsTableParams = new ngTableParams({
|
|
|
+ page : 1,
|
|
|
+ count : 5
|
|
|
+ }, {
|
|
|
+ total : 0,
|
|
|
+ getData : function ($defer, params) {
|
|
|
+ var param = BaseService.parseParams(params.url());
|
|
|
+ param.keyword = $scope.keyword;
|
|
|
+ adminNews.getNewsList(param, function (data) {
|
|
|
+ params.total(data.totalElements);
|
|
|
+ $defer.resolve(data.content);
|
|
|
+ $scope.totalElements = data.totalElements
|
|
|
+ data.content.forEach(function (item) {
|
|
|
+ if (item.type == "APPLY_PAID_TYPE" || item.type == "CONFIRM_PAID_TYPE" || item.type == "FINANCIAL_SETTLEMENT_TYPE"){
|
|
|
+ var _arr = item.content.split(' ')[1];
|
|
|
+ item.OrderNumber = _arr
|
|
|
+ }
|
|
|
+ if (item.type == "APPLY_PAID_TYPE") {
|
|
|
+ item.newsType = '付款申请'
|
|
|
+ }
|
|
|
+ if (item.type == "CONFIRM_PAID_TYPE") {
|
|
|
+ item.newsType = '确认收款'
|
|
|
+ }
|
|
|
+ if (item.type == "FINANCIAL_SETTLEMENT_TYPE") {
|
|
|
+ item.newsType = '财务结算'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, function (response) {
|
|
|
+ toaster.pop('error', '获取消息列表失败');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // /**
|
|
|
+ // * 获取未读消息数量
|
|
|
+ // */
|
|
|
+ // adminNews.unreadCount({}, function(data){
|
|
|
+ // $scope.unreadCount = data.count;
|
|
|
+ // }, function(res){
|
|
|
+ // toaster.pop('error', '系统错误', '获取未读消息数量失败' + res.data);
|
|
|
+ // });
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 跳转消息详情页
|
|
|
+ */
|
|
|
+ var enIdFilter = $filter('EncryptionFilter');
|
|
|
+ $scope.jumpNewsDetail = function(data) {
|
|
|
+ if (data.type == "APPLY_PAID_TYPE") {
|
|
|
+ window.location.href = 'admin#/check/request_pay/' + data.remark
|
|
|
+ }
|
|
|
+ if (data.type == "CONFIRM_PAID_TYPE") {
|
|
|
+ window.location.href = '/admin#/trade/order/' + enIdFilter(data.OrderNumber)
|
|
|
+ }
|
|
|
+ if (data.type == "FINANCIAL_SETTLEMENT_TYPE") {
|
|
|
+ window.location.href = 'admin#/check/settlement'
|
|
|
+ }
|
|
|
+ adminNews.read({messageId: data.id, type: data.type}, null, function () {
|
|
|
+ // adminNews.unreadCount({}, function(data){
|
|
|
+ // $scope.unreadCount = data.count;
|
|
|
+ // }, function(res){
|
|
|
+ // toaster.pop('error', '系统错误', '获取未读消息数量失败' + res.data);
|
|
|
+ // });
|
|
|
+ }, function(res){
|
|
|
+ toaster.pop('error' + res.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 点击
|
|
|
+ */
|
|
|
+ // $scope.newShow = false
|
|
|
+ $rootScope.lookNews = function() {
|
|
|
+ $rootScope.newShow = !$rootScope.newShow
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
//币别的过滤器
|
|
|
app.filter('currencySysmbol', function() {
|
|
|
return function(moneyParam, currency, add) {
|