Przeglądaj źródła

添加寄售协议签订时间排序

huxz 8 lat temu
rodzic
commit
77a8306931

+ 19 - 7
src/main/webapp/resources/js/admin/controllers/store/StoreCompanyDetailCtrl.js

@@ -9,8 +9,7 @@ define([ 'app/app' ], function(app) {
 
 		$scope.enUU = $stateParams.enUU || 0;
 
-		$scope.keyword = "";
-		$scope.refreshTableData = refreshTableData;
+		$scope.isShow = 'ALL';
 
 		// 执行初始化操作
 		active();
@@ -35,7 +34,6 @@ define([ 'app/app' ], function(app) {
 					ConsignmentAgreementRecord.pageRecordWhenAdminQueryInfo(param, {}, function (data) {
 						$defer.resolve(data.content || []);
 						params.total(data.numberOfElements);
-						console.log(data);
 					}, function (error) {
 						console.log(error);
 						$defer.resolve([]);
@@ -47,10 +45,24 @@ define([ 'app/app' ], function(app) {
 		}
 
 		/**
-		 * 触发根据搜索关键字进行搜索
+		 * 改变创建时间排序
 		 */
-		function refreshTableData() {
-			console.log($scope.keyword);
-		}
+		$scope.changeShorting = function () {
+			if ($scope.isShow === 'ALL') {
+				$scope.isShow = 'DOWN';
+
+				$scope.recordsTableParams.sorting({operateTime : 'DESC'});
+			} else if ($scope.isShow === 'DOWN') {
+				$scope.isShow = 'UP';
+
+				$scope.recordsTableParams.sorting({operateTime : 'ASC'});
+			} else if ($scope.isShow === 'UP') {
+				$scope.isShow = 'ALL';
+
+				$scope.recordsTableParams.sorting({operateTime : 'DESC'});
+			}
+			$scope.recordsTableParams.page(1);
+			$scope.recordsTableParams.reload();
+		};
 	}]);
 });

+ 2 - 2
src/main/webapp/resources/view/admin/store/store_company_detail.html

@@ -182,8 +182,8 @@
                     <th width="310">用户名</th>
                     <th width="250">
                         <p ng-click="changeShorting()" style="margin: 0;">签约时间
-                            <i class="fa fa-long-arrow-up"></i>
-                            <i class="fa fa-long-arrow-down"></i>
+                            <i class="fa fa-long-arrow-up" ng-if="isShow === 'ALL' || isShow == 'UP'"></i>
+                            <i class="fa fa-long-arrow-down" ng-if="isShow === 'ALL' || isShow == 'DOWN'"></i>
                         </p>
                     </th>
                 </tr>