Browse Source

企业示寄售协议操作记录列表展示

huxz 8 years ago
parent
commit
b25b37cd0e

+ 39 - 1
src/main/webapp/resources/js/common/module/store_admin_violations_module.js

@@ -23,9 +23,11 @@ define([ 'ngResource', 'common/query/storeViolations', 'ngTable', 'ngSanitize',
 	/**
 	 * 企业信息记录
 	 */
-	module.controller('EnterpriseInfoCtrl', ['$scope', 'StoreInfo', 'toaster', function ($scope, StoreInfo, toaster) {
+	module.controller('EnterpriseInfoCtrl', ['$scope', 'StoreInfo', 'toaster', 'ConsignmentAgreementRecord', 'ngTableParams', 'BaseService', function ($scope, StoreInfo, toaster, ConsignmentAgreementRecord, ngTableParams, BaseService) {
 		console.log('EnterpriseInfoCtrl');
 
+		$scope.showRecords = true;
+
 		active();
 
 		/**
@@ -42,6 +44,7 @@ define([ 'ngResource', 'common/query/storeViolations', 'ngTable', 'ngSanitize',
 						});
 					}
 					console.log($scope.store);
+					loadRecords($scope.store.enUU);
 				} else {
 					toaster.pop('error', '获取店铺信息失败,请刷新页面');
 				}
@@ -51,6 +54,41 @@ define([ 'ngResource', 'common/query/storeViolations', 'ngTable', 'ngSanitize',
 			})
 		}
 
+		/**
+		 * 加载寄售协议操作记录
+		 *
+		 * @param enUU	企业UU
+		 */
+		function loadRecords(enUU) {
+			$scope.recordsTableParams = new ngTableParams({
+				page : 1,
+				count : 10
+			}, {
+				total : 0,
+				getData : function($defer, params) {
+					// 处理分页参数到URL中
+					var param = BaseService.parseParams(params.url());
+					param.enUU = enUU || 0;
+
+					ConsignmentAgreementRecord.pageRecordWhenAdminQueryInfo(param, {}, function (data) {
+						if (data.content && data.content.length > 0) {
+							$defer.resolve(data.content);
+							$scope.showRecords = true;
+						} else {
+							$defer.resolve([]);
+							$scope.showRecords = false;
+						}
+						console.log(data);
+					}, function (error) {
+						console.log(error);
+						$defer.resolve([]);
+						$scope.showRecords = false;
+						toaster.pop('error', '数据获取失败,请重新刷新页面');
+					});
+				}
+			});
+		}
+
 	}]);
 
 	/**

+ 22 - 0
src/main/webapp/resources/view/admin/store/fragments/enterprise_info.html

@@ -256,6 +256,28 @@
 			</div>
 		</div>
 	</div>
+	<!-- 企业寄售协议操作记录 -->
+	<div ng-if="showRecords" style="width: 98%;margin: 0 auto;">
+		<div class="row">
+			<div class="col-md-12">
+				<div>
+					企业寄售协议操作记录
+				</div>
+				<table class="table" ng-table="recordsTableParams">
+					<tr>
+						<th>序号</th>
+						<th>操作人</th>
+						<th>操作时间</th>
+					</tr>
+					<tr ng-repeat="record in $data">
+						<td style="text-align: center;" ng-bind="(recordsTableParams.page() - 1) * recordsTableParams.count() + $index + 1"></td>
+						<td style="text-align: center;" ng-bind="record.userName"></td>
+						<td style="text-align: center;" ng-bind="record.operateTime | date: 'yyyy-MM-dd HH:mm:ss'"></td>
+					</tr>
+				</table>
+			</div>
+		</div>
+	</div>
 </div>
 <!--推荐相关内容-->
 <div class="recommend">