Browse Source

代采订单错误日志

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@8819 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 years ago
parent
commit
d724b72f3e

+ 65 - 1
src/main/webapp/resources/js/index/app.js

@@ -114,6 +114,10 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			url : "/deputy",
 			templateUrl : "static/tpl/index/purc/deputyOrder.html",
 			controller : 'DeputyOrderCtrl'
+		}).state('purc.deputylog', {
+			url : "/deputylog",
+			templateUrl : "static/tpl/index/purc/deputyorders_log.html",
+			controller : 'DeputyOrderLogCtrl'
 		}).state('purc.newdeputy', {
 			url : "/deputy/add",
 			templateUrl : "static/tpl/index/purc/deputyOrder_new.html",
@@ -12471,10 +12475,70 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		
 	}]);
 
+	/**
+	 * 代采错误日志
+	 */
+	app.controller('DeputyOrderLogCtrl', ['$scope', 'DeputyOrder', 'ngTableParams', '$filter', 'BaseService', 'toaster', '$timeout', function($scope, DeputyOrder, ngTableParams, $filter, BaseService, toaster, $timeout) {
+		BaseService.scrollBackToTop();
+		var getService = function() {
+			return DeputyOrder.getRepetitions;
+		};
+		
+		$scope.tableParams = new ngTableParams({
+			page : 1, 
+			count : 5,
+			sorting: {
+            }
+		}, {
+			total : 0, 
+			counts: [5, 10, 25, 50],
+			getData : function($defer, params) {
+				$scope.loading = true;
+				var pageParams = params.url();
+				pageParams.keyword = $scope.keyword;
+				pageParams.searchFilter = $scope.searchFilter;
+				getService().call(null, BaseService.parseParams(pageParams), function(page){
+					$scope.loading = false;
+					if(page) {
+						params.total(page.totalElement);
+						$defer.resolve(page.content);
+						$scope.keywordXls = angular.copy(pageParams.keyword);//保存当前取值的关键词
+						$scope.searchFilterXls = angular.copy(pageParams.searchFilter);
+					}
+				}, function(response) {
+					$scope.loading = false;
+					toaster.pop('error', '数据加载失败', response.data);
+				});
+			}
+		});
+
+		// 搜索框回车
+		$scope.onSearch = function() {
+			$scope.tableParams.page(1);
+			$scope.tableParams.reload();
+		};
+		
+		//删除
+		$scope.deleteById = function(id) {
+			GetProductInfo.deleteById({id: id}, function(data) {
+				if(data.error) {
+					toaster.pop("error", "提示", data.error);
+				} else {
+					toaster.pop("success", "提示", "删除成功");
+					$timeout(function() {
+						$scope.tableParams.reload();
+					}, 500);
+				}
+			}), function(response) {
+				toaster.pop("error", "删除失败", response.data);
+			};
+		}
+		
+	}]);
+	
     /**
      * 招标单
      */
-
     app.controller('PurcTenderCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope) {
     	BaseService.scrollBackToTop();
     	$scope.active = 'done';

+ 4 - 0
src/main/webapp/resources/js/index/services/DeputyOrder.js

@@ -63,6 +63,10 @@ define(['ngResource'], function() {
             hisKeywords: {
             	url: 'deputyOrder/hisKeywords',
             	method: 'GET'
+            },
+            getRepetitions: {
+            	url: 'deputyOrder/repetitions',
+            	method: 'GET'
             }
 		})
 	}]).factory('getDeOrder', ['$resource', function($resource) {

+ 6 - 0
src/main/webapp/resources/tpl/index/purc/deputyOrder.html

@@ -188,6 +188,12 @@
                         <span class="f14" style="color: #5078cb;line-height: 25px;">代采订单</span>
                     </a>
                 </div>
+                 <div class="col-xs-2 pull-right" style="width: 140px;">
+                    <a ui-sref="purc.deputylog" type="button" title="新增代采订单" class="btn btn-tender">
+                        <i class="fa fa-file-text fa-lg"></i>
+                        <span class="f14" style="color: #5078cb;line-height: 25px;">错误日志</span>
+                    </a>
+                </div>
             </div>
             <div class="condition block" style="padding: 10px 15px;">
                 <div class="search-bg condition block"  style="padding: 10px 15px;">

+ 29 - 0
src/main/webapp/resources/tpl/index/purc/deputyorders_log.html

@@ -0,0 +1,29 @@
+<div class="loading in" ng-class="{'in': loading}">
+	<i></i>
+</div>
+<div class="pane base-info" style="max-height: 500px;overflow: auto;">
+	<div class="pane-header">
+		代采订单错误日志
+	</div>
+	<div class="pane-body">
+		<table class="block table table-default table-striped"
+			ng-table="tableParams">
+			<thead>
+				<tr class="header">
+					<th width="130">时间</th>
+					<th width="130">采购单号</th>
+					<th width="80">提示</th>
+					<th width="120">详情</th>
+				</tr>
+			</thead>
+			<tbody>
+				<tr ng-repeat="log in $data">
+					<td class="text-center" ng-bind="::log.date | date:'yyyy-MM-dd HH:mm'"></td>
+					<td class="text-center" ng-bind="::log.code"></td>
+					<td class="text-center" ng-bind="::log.message"></td>
+					<td class="text-center"><a ui-sref="purc.deputydetail({id:log.sourceid})">查看详情>></a></td>
+				</tr>
+			</tbody>
+		</table>
+	</div>
+</div>