Explorar el Código

机构注册第二步

huangct hace 8 años
padre
commit
c84d1e1364

+ 9 - 9
donate-console/src/main/java/com/uas/console/donate/model/Org.java

@@ -35,7 +35,7 @@ public class Org implements Serializable{
      *优软云账号
      */
     @Column(name="org_uuid")
-    private String uuid;
+    private Long uuid;
 
     /**
      * 提交人姓名
@@ -178,7 +178,7 @@ public class Org implements Serializable{
      * 负责人个人手机
      */
     @Column(name="org_manager_mobile")
-    private Long managerMobile;
+    private String managerMobile;
 
     /**
      * 联系人姓名
@@ -196,7 +196,7 @@ public class Org implements Serializable{
      * 联系人电话
      */
     @Column(name="org_contact_tel")
-    private Long contactTel;
+    private String contactTel;
 
 
     /**
@@ -301,11 +301,11 @@ public class Org implements Serializable{
         this.code = code;
     }
 
-    public String getUuid() {
+    public Long getUuid() {
         return uuid;
     }
 
-    public void setUuid(String uuid) {
+    public void setUuid(Long uuid) {
         this.uuid = uuid;
     }
 
@@ -510,11 +510,11 @@ public class Org implements Serializable{
         this.managerOph = managerOph;
     }
 
-    public Long getManagerMobile() {
+    public String getManagerMobile() {
         return managerMobile;
     }
 
-    public void setManagerMobile(Long managerMobile) {
+    public void setManagerMobile(String managerMobile) {
         this.managerMobile = managerMobile;
     }
 
@@ -534,11 +534,11 @@ public class Org implements Serializable{
         this.contactIdcard = contactIdcard;
     }
 
-    public Long getContactTel() {
+    public String getContactTel() {
         return contactTel;
     }
 
-    public void setContactTel(Long contactTel) {
+    public void setContactTel(String contactTel) {
         this.contactTel = contactTel;
     }
 

+ 52 - 7
donate-console/src/main/webapp/resources/js/index/app.js

@@ -55,6 +55,11 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
             title : '公益机构认证第一步',
             templateUrl : 'static/view/user/charityCertification1.html',
             controller : 'charityCertificationStep1Ctrl'
+        }).state("charityCertificationStep2", {
+            url : '/charityCertificationStep2',
+            title : '公益机构认证第二步',
+            templateUrl : 'static/view/user/charityCertification2.html',
+            controller : 'charityCertificationStep2Ctrl'
         });
 	}]);
 
@@ -348,11 +353,11 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
     /**
      * 公益机构认证第一步
      */
-    app.controller('charityCertificationStep1Ctrl', ['$scope', '$http', '$rootScope', '$timeout', 'toaster', 'Organization',
-        function ($scope, $http, $rootScope, $timeout, toaster, Organization) {
+    app.controller('charityCertificationStep1Ctrl', ['$scope', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization',
+        function ($scope, $http, $rootScope, $timeout, $location, toaster, Organization) {
 
             // 获取当前账户注册机构情况
-            Organization.getByUuid({uuid : "10041166"}, {}, function(data) {//154534654
+            Organization.getByUuid({uuid : 10041166}, {}, function(data) {//154534654
                 $scope.org = data;
             }, function() {
                 toaster.pop('error', '注册情况加载失败');
@@ -373,7 +378,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
 
 
             //提交
-            $scope.register = function (org) {
+            $scope.saveStep1 = function (org) {
                 org.type = 2;//机构类别(1:公募 2:非公募)
                 //var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
                 $http({
@@ -384,11 +389,12 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
                     },
                 }).success(function (data) {
                     if (data.success) {
-                        toaster.pop('success', '提示', '保存成功');
-                        $timeout(function () {
+                        toaster.pop('success', '提示', data.success);
+                        /*$timeout(function () {
                             //提交后跳转到下一页,防止重复提交
                             window.location.href = "#/charityCertification2?orgId=" + data.id;
-                        }, 500);
+                        }, 500);*/
+                        $location.path('charityCertificationStep2');
                     }
                     if (data.error) {
                         toaster.pop('error', '提示', data.error);
@@ -405,6 +411,45 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
             };
         }]);
 
+    /**
+     * 公益机构认证第二步
+     */
+    app.controller('charityCertificationStep2Ctrl', ['$scope', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization',
+        function ($scope, $http, $rootScope, $timeout, $location, toaster, Organization) {
+
+            // 获取当前账户注册机构情况
+            Organization.getByUuid({uuid : 10041166}, {}, function(data) {//154534654
+                $scope.org = data;
+            }, function() {
+                toaster.pop('error', '注册情况加载失败');
+            });
+
+            //提交
+            $scope.saveStep2 = function (org) {
+                $http({
+                    method : 'POST',
+                    url : '/org/save',
+                    params : {
+                        jsonStr : org
+                    },
+                }).success(function (data) {
+                    if (data.success) {
+                        $location.path('charityCertificationStep1');
+                    }
+                    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);
+                    }
+                });
+            };
+        }]);
 
 
     return app;

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

@@ -632,7 +632,7 @@
                                         </div>
                                     </div>
                                     <div class="text-left submitBtn">
-                                        <button type="submit" ng-click="register(org)" ng-disabled="charityCertification1.$invalid">保存,下一步</button><a href="charityCertification">返回上一页</a></div>
+                                        <button type="submit" ng-click="saveStep1(org)" 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>

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

@@ -487,10 +487,11 @@
 <!--主体内容-->
 <div class="content-wrapper" style="min-height: 924px;; z-index: 50;">
     <!-- Main content -->
+    <form name="charityCertification1">
     <section class="content">
         <div class="container">
             <div class="section">
-                <div class="instruction"><span>公益机构认证</span><span>(以下所有信息均为必填项)</span></div>
+                <div class="instruction"><span>公益2机构认证</span><span>(以下所有信息均为必填项)</span></div>
                 <div class="choose">
                     <div class="chooseNav">
                         <span class="step1 active">1、注册信息</span><span class="step2 active">2、机构信息</span><span
@@ -506,22 +507,22 @@
                             <form action="">
                                 <div class="form-group clearfix">
                                     <label for="" class="fl control-label">负责人姓名</label>
-                                    <input type="text" class="fl form-control" ng-model="org.managerName">
+                                    <input type="text" class="fl form-control" ng-model="org.managerName" required="true" ng-pattern="/^[\u4e00-\u9fa5]{1,6}$|^[\dA-Za-z]{1,12}$/">
                                     <span class="control-help fl">(请填写机构当前负责人姓名)</span>
                                 </div>
                                 <div class="form-group clearfix">
                                     <label for="" class="fl control-label">身份证号</label>
-                                    <input type="text" class="fl form-control" ng-model="org.managerIdcard">
+                                    <input type="text" class="fl form-control" ng-model="org.managerIdcard" required="true">
                                     <span class="control-help fl">(请填写机构当前负责人身份证号码)</span>
                                 </div>
                                 <div class="form-group clearfix">
                                     <label for="" class="fl control-label">办公电话</label>
-                                    <input type="text" class="fl form-control" ng-model="org.managerOph">
+                                    <input type="text" class="fl form-control" ng-model="org.managerOph" ng-pattern="/^0\d{2,3}-?\d{7,8}$/">
                                     <span class="control-help fl">(请填写机构当前负责人有效联系电话)</span>
                                 </div>
                                 <div class="form-group clearfix">
                                     <label for="" class="fl control-label">个人手机</label>
-                                    <input type="text" class="fl form-control" ng-model="org.managerMobile">
+                                    <input type="text" class="fl form-control" ng-model="org.managerMobile" required="true" ng-pattern="/^1(3|4|5|7|8)\d{9}$/">
                                     <span class="control-help fl">(请填写机构当前负责人常用联系手机号码)</span>
                                 </div>
                             </form>
@@ -531,26 +532,27 @@
                             <form action="">
                                 <div class="form-group clearfix">
                                     <label for="" class="fl control-label">负责人姓名</label>
-                                    <input type="text" class="fl form-control" ng-model="org.contactName">
+                                    <input type="text" class="fl form-control" ng-model="org.contactName" required="true" ng-pattern="/^[\u4e00-\u9fa5]{1,6}$|^[\dA-Za-z]{1,12}$/">
                                     <span class="control-help fl">(请填写机构当前联系人姓名)</span>
                                 </div>
                                 <div class="form-group clearfix">
                                     <label for="" class="fl control-label">身份证号</label>
-                                    <input type="text" class="fl form-control" ng-model="org.contactIdcard">
+                                    <input type="text" class="fl form-control" ng-model="org.contactIdcard" required="true">
                                     <span class="control-help fl">(请填写机构当前联系人身份证号码)</span>
                                 </div>
                                 <div class="form-group clearfix">
-                                    <label for="" class="fl control-label">办公电话</label>
-                                    <input type="text" class="fl form-control" ng-model="org.contactTel">
-                                    <span class="control-help fl">(请填写机构当前联系人有效联系电话)</span>
+                                    <label for="" class="fl control-label">个人手机</label>
+                                    <input type="text" class="fl form-control" ng-model="org.contactTel" ng-pattern="/^1(3|4|5|7|8)\d{9}$/">
+                                    <span class="control-help fl">(请填写机构当前联系人有效联系手机号码)</span>
                                 </div>
                                 <div class="form-group clearfix">
-                                    <label for="" class="fl control-label">个人手机</label>
-                                    <input type="text" class="fl form-control" ng-model="org.contactEmail">
+                                    <label for="" class="fl control-label">个人邮箱</label>
+                                    <input type="text" class="fl form-control" ng-model="org.contactEmail" required="true" ng-pattern="/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/">
                                     <span class="control-help fl">(请填写机构当前联系人电子邮箱)</span>
                                 </div>
-                                <div class="text-left submitBtn" style="margin-top: 55px;"><a
-                                        href="charityCertification3">保存,下一步</a><a href="charityCertification1">返回上一页</a>
+                                <div class="text-left submitBtn" style="margin-top: 55px;">
+                                    <button type="submit" ng-click="saveStep2(org)" ng-disabled="charityCertification2.$invalid">保存,下一步</button>
+                                    <a ui-sref="charityCertificationStep1">返回上一页</a>
                                 </div>
                             </form>
                         </div>
@@ -559,6 +561,7 @@
             </div>
         </div>
     </section>
+    </form>
 </div>
 
 <script>