|
|
@@ -644,7 +644,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- app.controller('MyCtrl', ['$scope', '$rootScope', function($scope, $rootScope) {
|
|
|
+ app.controller('MyCtrl', ['$scope', '$rootScope', '$modal', function($scope, $rootScope, $modal) {
|
|
|
$rootScope.$on('$locationChangeSuccess', function(evt, newUrl) {
|
|
|
var routeState = newUrl.substr(newUrl.indexOf('#/') + 2);
|
|
|
if (routeState.indexOf('/') > -1)
|
|
|
@@ -660,8 +660,107 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
window.location.hash = '#/search?keyword='+keyword;
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+ $scope.showMessage = function() {
|
|
|
+ var $modalInstance = $modal.open({
|
|
|
+ templateUrl: 'static/tpl/index/home/pagingRelease.html',
|
|
|
+ controller: 'PagingReleaseCtrl'
|
|
|
+ });
|
|
|
+ };
|
|
|
}]);
|
|
|
- // TODO
|
|
|
+
|
|
|
+ app.controller('PagingReleaseCtrl', ['$scope', 'PagingRelease', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', function($scope, PagingRelease, BaseService, ngTableParams, toaster, $modalInstance){
|
|
|
+ $scope.active = "todo";
|
|
|
+ $scope.setActive = function(state) {
|
|
|
+ if($scope.active != state) {
|
|
|
+ $scope.active = state;
|
|
|
+ if($scope.tableParams.page() == 1)
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ else
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.tableParams = new ngTableParams({
|
|
|
+ page : 1,
|
|
|
+ count : 5,
|
|
|
+ sorting: {
|
|
|
+ 'releaseDetail.release.date': 'desc'
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ total : 0,
|
|
|
+ counts: [5, 10, 25, 50],
|
|
|
+ getData : function($defer, params) {
|
|
|
+ $scope.loading = true;
|
|
|
+ var pageParams = params.url();
|
|
|
+ var realActive = {};
|
|
|
+ pageParams.searchFilter = { // 筛选条件
|
|
|
+ keyword: $scope.keyword
|
|
|
+ // fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
+ // endDate: getDateTime($scope.condition.dateTo)
|
|
|
+ };
|
|
|
+ // AccountEnterprise.get({}, function(data){
|
|
|
+ // $scope.loading = false;
|
|
|
+ // $scope.currentEn = data;
|
|
|
+ // });
|
|
|
+ PagingRelease[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
+ $scope.loading = false;
|
|
|
+ if(page) {
|
|
|
+ params.total(page.totalElement);
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ // $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词 做导出时需要的字段
|
|
|
+ }
|
|
|
+ }, function(response){
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $scope.close = function() {
|
|
|
+ $modalInstance.close();
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ $scope.checks = {
|
|
|
+ checked : false
|
|
|
+ };// 全选框
|
|
|
+
|
|
|
+ $scope.checkAll = function() {
|
|
|
+ angular.forEach($scope.tableParams.data, function(message) {
|
|
|
+ message.checked = $scope.checks.checked;
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ // 单选
|
|
|
+ $scope.checkOne = function(message) {
|
|
|
+ message.checked = true;
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ // 标为已读
|
|
|
+ $scope.setRead = function() {
|
|
|
+ var selectedMessages = [];
|
|
|
+ angular.forEach($scope.tableParams.data, function(message) {
|
|
|
+ if(message.checked) {
|
|
|
+ selectedMessages.push(message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log(selectedMessages);
|
|
|
+ PagingRelease.setRead({}, selectedMessages , function(message) {
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ // 搜索框回车
|
|
|
+ $scope.onSearch = function() {
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
+ }]);
|
|
|
+ // TODO
|
|
|
app.controller('TopSearchCtrl', ['$scope', '$rootScope', 'getAccountUserSpace', 'ngTableParams', 'toaster', 'BaseService', 'AddPartner', '$filter', '$stateParams', 'SearchProd', '$sce', function($scope, $rootScope, getAccountUserSpace, ngTableParams, toaster, BaseService, AddPartner, $filter, $stateParams, SearchProd, $sce) {
|
|
|
$scope.active = 'all';
|
|
|
$scope.tip = $rootScope.searchKeyword;
|
|
|
@@ -8978,7 +9077,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
/***
|
|
|
* 代采定单
|
|
|
*/
|
|
|
- app.controller('DeputyOrderCtrl', ['$scope', 'toaster', 'getDeOrder', 'ngTableParams', 'BaseService', function($scope, toaster, getDeOrder, ngTableParams, BaseService) {
|
|
|
+ app.controller('DeputyOrderCtrl', ['$scope', 'toaster', 'getDeOrder', 'ngTableParams', 'BaseService', 'DeputyOrder', 'ReportService', function($scope, toaster, getDeOrder, ngTableParams, BaseService, DeputyOrder, ReportService) {
|
|
|
$scope.active = 'all';
|
|
|
$scope.currency = Symbol.currency;//将币别转化为对应的符号
|
|
|
$scope.total = null;
|
|
|
@@ -9017,6 +9116,15 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ //打印
|
|
|
+ $scope.print = function(deputyOrder) {
|
|
|
+ DeputyOrder.printCount({id: deputyOrder.id},{});//增加打印此次
|
|
|
+ ReportService.print(deputyOrder.deputyuu, 'PURCNOTICE', "where purc$deputyorders.deo_id=" + deputyOrder.id); // 定向采购通知
|
|
|
+ ReportService.print(deputyOrder.deputyuu, 'PURCHASE', "where purc$deputyorders.deo_id=" + deputyOrder.id); // 采购订单
|
|
|
+ ReportService.print(deputyOrder.deputyuu, 'PAYCONFIRM', "where purc$deputyorders.deo_id=" + deputyOrder.id); // 付款确认
|
|
|
+ ReportService.print(deputyOrder.deputyuu, 'TRADECONTRACT', "where purc$deputyorders.deo_id=" + deputyOrder.id); // 买卖合同
|
|
|
+ };
|
|
|
|
|
|
// 搜索框回车
|
|
|
$scope.onSearch = function() {
|