ソースを参照

增加再次添加功能

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@8633 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 年 前
コミット
37216750ff
1 ファイル変更11 行追加9 行削除
  1. 11 9
      src/main/webapp/resources/js/index/app.js

+ 11 - 9
src/main/webapp/resources/js/index/app.js

@@ -10984,9 +10984,15 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		});
 		
 		// 再次申请
-		$scope.reapply = function(id) {
-			AddPartner.reapply({id: id}, {}, function(data) {
-				toaster.pop('success', '提示', '操作成功');
+		$scope.addAgain = function(name, businessCode) {
+			AddPartner.addPartner({name: name, businessCode: businessCode}, {}, function(data) {
+				if(data.success) {
+					toaster.pop("success", '添加成功', data.success);
+					$scope.tableParams.reload();
+				}
+				if(data.error) {
+					toaster.pop("error", '添加失败', data.error);
+				}
 			}, function(response) {
 				toaster.pop('error','失败',response.data);
 			});
@@ -11030,9 +11036,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		$scope.agree = function(id) {
 			AddPartner.agreeRequest({id: id}, {}, function(data) {
 				toaster.pop('success', '提示', '操作成功');
-				$timeout(function() {
-					window.location.reload();
-				}, 500);
+				$scope.tableParams.reload();
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
 			});
@@ -11042,9 +11046,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		$scope.refuse = function(id, reason) {
 			AddPartner.refuseRequest({id: id, reason: reason}, {}, function(data) {
 				toaster.pop('success', '提示', '操作成功');
-				$timeout(function() {
-					window.location.reload();
-				}, 500);
+				$scope.tableParams.reload();
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
 			});