Bläddra i källkod

机构注册表单未修改不操作数据库

huangct 8 år sedan
förälder
incheckning
c6357ed4b7

+ 101 - 84
donate-console/src/main/webapp/resources/js/index/app.js

@@ -65,6 +65,11 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
             title : '公益机构认证第三步',
             templateUrl : 'static/view/user/charityCertification3.html',
             controller : 'charityCertificationStep3Ctrl'
+        }).state("charityCertificationStep4", {
+            url : '/charityCertificationStep4',
+            title : '公益机构认证完成',
+            templateUrl : 'static/view/user/charityCertification4.html',
+            controller : 'charityCertificationStep4Ctrl'
         });
 	}]);
 
@@ -383,36 +388,40 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
 
 
             //提交
-            $scope.saveStep1 = function (org) {
-                org.type = 2;//机构类别(1:公募 2:非公募)
-                //var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
-                $http({
-                    method : 'POST',
-                    url : '/org/save',
-                    params : {
-                        jsonStr : org
-                    },
-                }).success(function (data) {
-                    if (data.success) {
-                        toaster.pop('success', '提示', data.success);
-                        /*$timeout(function () {
-                            //提交后跳转到下一页,防止重复提交
-                            window.location.href = "#/charityCertification2?orgId=" + data.id;
-                        }, 500);*/
-                        $location.path('charityCertificationStep2');
-                    }
-                    if (data.error) {
-                        toaster.pop('error', '提示', data.error);
-                    }
+            $scope.saveStep1 = function (org,dirty) {
+                if (dirty == false) {
+                    $location.path('charityCertificationStep2');
+                } else {
+                    org.type = 2;//机构类别(1:公募 2:非公募)
+                    //var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
+                    $http({
+                        method : 'POST',
+                        url : '/org/save',
+                        params : {
+                            jsonStr : org
+                        },
+                    }).success(function (data) {
+                        if (data.success) {
+                            toaster.pop('success', '提示', data.success);
+                            /*$timeout(function () {
+                             //提交后跳转到下一页,防止重复提交
+                             window.location.href = "#/charityCertification2?orgId=" + data.id;
+                             }, 500);*/
+                            $location.path('charityCertificationStep2');
+                        }
+                        if (data.error) {
+                            toaster.pop('error', '提示', data.error);
+                        }
 
-                }).error(function (data, status) {
-                    $scope.loadingShow = false;
-                    if (status == 403) {
-                        toaster.pop('error', '操作失败', data);
-                    } else {
-                        toaster.pop('error', '操作失败', data.error);
-                    }
-                });
+                    }).error(function (data, status) {
+                        $scope.loadingShow = false;
+                        if (status == 403) {
+                            toaster.pop('error', '操作失败', data);
+                        } else {
+                            toaster.pop('error', '操作失败', data.error);
+                        }
+                    });
+                }
             };
         }]);
 
@@ -430,29 +439,33 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
             });
 
             //提交
-            $scope.saveStep2 = function (org) {
-                $http({
-                    method : 'POST',
-                    url : '/org/save',
-                    params : {
-                        jsonStr : org
-                    },
-                }).success(function (data) {
-                    if (data.success) {
-                        $location.path('charityCertificationStep3');
-                    }
-                    if (data.error) {
-                        toaster.pop('error', '提示', data.error);
-                    }
+            $scope.saveStep2 = function (org,dirty) {
+                if (dirty == false) {
+                    $location.path('charityCertificationStep3');
+                } else {
+                    $http({
+                        method: 'POST',
+                        url: '/org/save',
+                        params: {
+                            jsonStr: org
+                        },
+                    }).success(function (data) {
+                        if (data.success) {
+                            $location.path('charityCertificationStep3');
+                        }
+                        if (data.error) {
+                            toaster.pop('error', '提示', data.error);
+                        }
 
-                }).error(function (data, status) {
-                    $scope.loadingShow = false;
-                    if (status == 403) {
-                        toaster.pop('error', '操作失败', data);
-                    } else {
-                        toaster.pop('error', '操作失败', data.error);
-                    }
-                });
+                    }).error(function (data, status) {
+                        $scope.loadingShow = false;
+                        if (status == 403) {
+                            toaster.pop('error', '操作失败', data);
+                        } else {
+                            toaster.pop('error', '操作失败', data.error);
+                        }
+                    });
+                }
             };
         }]);
 
@@ -515,40 +528,44 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
                 $scope.$apply();
             }
             //提交
-            $scope.saveStep3 = function (org) {
-                var data = new FormData();      //以下为像后台提交图片数据
-                data.append('logo', $scope.logo);
-                data.append('personCertificate', $scope.personCertificate);
-                data.append('donateCertificate', $scope.donateCertificate);
-                data.append('legalIdCard', $scope.legalIdCard);
-                $http({
-                    headers: {
-                        'Content-Type': undefined
-                    },
-                    method : 'POST',
-                    processData : false,
-                    async: false,
-                    url : '/org/save',
-                    data: data,
-                    params : {
-                        jsonStr : org
-                    },
-                }).success(function (data) {
-                    if (data.success) {
-                        $location.path('charityCertificationStep3');
-                    }
-                    if (data.error) {
-                        toaster.pop('error', '提示', data.error);
-                    }
+            $scope.saveStep3 = function (org,dirty) {
+                if (dirty == false) {
+                    $location.path('charityCertificationStep4');
+                } else {
+                    var data = new FormData();      //以下为像后台提交图片数据
+                    data.append('logo', $scope.logo);
+                    data.append('personCertificate', $scope.personCertificate);
+                    data.append('donateCertificate', $scope.donateCertificate);
+                    data.append('legalIdCard', $scope.legalIdCard);
+                    $http({
+                        headers: {
+                            'Content-Type': undefined
+                        },
+                        method: 'POST',
+                        processData: false,
+                        async: false,
+                        url: '/org/save',
+                        data: data,
+                        params: {
+                            jsonStr: org
+                        },
+                    }).success(function (data) {
+                        if (data.success) {
+                            $location.path('charityCertificationStep4');
+                        }
+                        if (data.error) {
+                            toaster.pop('error', '提示', data.error);
+                        }
 
-                }).error(function (data, status) {
-                    $scope.loadingShow = false;
-                    if (status == 403) {
-                        toaster.pop('error', '操作失败', data);
-                    } else {
-                        toaster.pop('error', '操作失败', data.error);
-                    }
-                });
+                    }).error(function (data, status) {
+                        $scope.loadingShow = false;
+                        if (status == 403) {
+                            toaster.pop('error', '操作失败', data);
+                        } else {
+                            toaster.pop('error', '操作失败', data.error);
+                        }
+                    });
+                }
             };
         }]);
 

+ 2 - 2
donate-console/src/main/webapp/resources/view/user/charityCertification1.html

@@ -487,7 +487,7 @@
 <!--主体内容-->
 <div class="content-wrapper" style="min-height: 924px;; z-index: 50;">
     <!-- Main content -->
-    <form name="charityCertification1">
+    <form name="charityCertification1" novalidate>
         <section class="content">
             <div class="container">
                 <div class="section">
@@ -632,7 +632,7 @@
                                         </div>
                                     </div>
                                     <div class="text-left submitBtn">
-                                        <button type="submit" ng-click="saveStep1(org)" ng-disabled="charityCertification1.$invalid">保存,下一步</button><a href="charityCertification">返回上一页</a></div>
+                                        <button type="submit" ng-click="saveStep1(org,charityCertification1.$dirty)" ng-disabled="charityCertification1.$invalid">保存,下一步</button><a href="charityCertification">返回上一页</a></div>
                                     <!--<div class="text-left submitBtn"><a href="charityCertification2">保存,下一步</a><a href="charityCertification">返回上一页</a></div>-->
                                 </form>
                             </div>

+ 2 - 2
donate-console/src/main/webapp/resources/view/user/charityCertification2.html

@@ -487,7 +487,7 @@
 <!--主体内容-->
 <div class="content-wrapper" style="min-height: 924px;; z-index: 50;">
     <!-- Main content -->
-    <form name="charityCertification1">
+    <form name="charityCertification2" novalidate>
     <section class="content">
         <div class="container">
             <div class="section">
@@ -551,7 +551,7 @@
                                     <span class="control-help fl">(请填写机构当前联系人电子邮箱)</span>
                                 </div>
                                 <div class="text-left submitBtn" style="margin-top: 55px;">
-                                    <button type="submit" ng-click="saveStep2(org)" ng-disabled="charityCertification2.$invalid">保存,下一步</button>
+                                    <button type="submit" ng-click="saveStep2(org,charityCertification2.$dirty)" ng-disabled="charityCertification2.$invalid">保存,下一步</button>
                                     <a ui-sref="charityCertificationStep1">返回上一页</a>
                                 </div>
                             </form>

+ 2 - 2
donate-console/src/main/webapp/resources/view/user/charityCertification3.html

@@ -497,7 +497,7 @@
 <!--主体内容-->
 <div class="content-wrapper" style="min-height: 924px;; z-index: 50;">
     <!-- Main content -->
-    <form name="charityCertification3">
+    <form name="charityCertification3" novalidate>
     <section class="content">
         <div class="container">
             <div class="section">
@@ -571,7 +571,7 @@
                                     <img class="fl lookImg" src="{{org.legalIdCard}}">
                                 </div>
                                 <div class="text-left submitBtn" style="margin-top: 75px;">
-                                    <button type="submit" ng-click="saveStep3(org)" ng-disabled="charityCertification3.$invalid">保存,下一步</button>
+                                    <button type="submit" ng-click="saveStep3(org,charityCertification3.$dirty)" ng-disabled="charityCertification3.$invalid">保存,下一步</button>
                                     <a ui-sref="charityCertificationStep2">返回上一页</a>
                                 </div>
                             </div>

+ 1 - 1
donate-console/src/main/webapp/resources/view/user/charityCertification4.html

@@ -502,7 +502,7 @@
                         <div class="detail">
                             <div class="complete"><img src="static/images/over.png" alt=""/><span>注册完成!</span></div>
                             <!--<div class="look"><a href="launchProject"><button>发布项目</button></a></div>-->
-                            <a href="/" class="return">返回首页&gt;</a>
+                            <a href="/index" class="return">返回首页&gt;</a>
                         </div>
                     </div>
                 </div>