|
|
@@ -412,9 +412,11 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
|
|
|
app.controller('CertificationStep1Ctrl', ['$scope', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization',
|
|
|
function ($scope, $http, $rootScope, $timeout, $location, toaster, Organization) {
|
|
|
|
|
|
+ var orgCopy;
|
|
|
// 获取当前账户注册机构情况
|
|
|
Organization.getByUuid({uuid : 10041166}, {}, function(data) {//10041558
|
|
|
$scope.org = data;
|
|
|
+ orgCopy = angular.copy($scope.org);
|
|
|
}, function() {
|
|
|
toaster.pop('error', '注册情况加载失败');
|
|
|
});
|
|
|
@@ -426,6 +428,10 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
|
|
|
$scope.provinces = response.data;
|
|
|
});
|
|
|
|
|
|
+ $scope.selectMajorArea = function (index) {
|
|
|
+ $scope.org.majorArea = index;
|
|
|
+ }
|
|
|
+
|
|
|
$scope.openDatePicker = function ($event, item, openParam) {
|
|
|
$event.preventDefault();
|
|
|
$event.stopPropagation();
|
|
|
@@ -434,8 +440,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
|
|
|
|
|
|
|
|
|
//提交
|
|
|
- $scope.saveStep1 = function (org,dirty,orgType) {
|
|
|
- if (dirty == false) {
|
|
|
+ $scope.saveStep1 = function (org, orgType) {
|
|
|
+ if (orgCopy == org) {
|
|
|
if (orgType == 1) {
|
|
|
$location.path('publicOfferingCertificationStep2');
|
|
|
} else if (orgType == 2) {
|
|
|
@@ -485,16 +491,18 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
|
|
|
app.controller('CertificationStep2Ctrl', ['$scope', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization',
|
|
|
function ($scope, $http, $rootScope, $timeout, $location, toaster, Organization) {
|
|
|
|
|
|
+ var orgCopy;
|
|
|
// 获取当前账户注册机构情况
|
|
|
Organization.getByUuid({uuid : 10041166}, {}, function(data) {//10041558
|
|
|
$scope.org = data;
|
|
|
+ orgCopy = angular.copy($scope.org);
|
|
|
}, function() {
|
|
|
toaster.pop('error', '注册情况加载失败');
|
|
|
});
|
|
|
|
|
|
//提交
|
|
|
- $scope.saveStep2 = function (org,dirty,orgType) {
|
|
|
- if (dirty == false) {
|
|
|
+ $scope.saveStep2 = function (org, orgType) {
|
|
|
+ if (orgCopy == org) {
|
|
|
if (orgType == 1) {
|
|
|
$location.path('publicOfferingCertificationStep3');
|
|
|
} else if (orgType == 2) {
|
|
|
@@ -537,9 +545,11 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
|
|
|
app.controller('CertificationStep3Ctrl', ['$scope', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization',
|
|
|
function ($scope, $http, $rootScope, $timeout, $location, toaster, Organization) {
|
|
|
|
|
|
+ var orgCopy;
|
|
|
// 获取当前账户注册机构情况
|
|
|
Organization.getByUuid({uuid : 10041166}, {}, function(data) {//10041558
|
|
|
$scope.org = data;
|
|
|
+ orgCopy = angular.copy($scope.org);
|
|
|
}, function() {
|
|
|
toaster.pop('error', '注册情况加载失败');
|
|
|
});
|
|
|
@@ -590,14 +600,21 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
|
|
|
$scope.$apply();
|
|
|
}
|
|
|
//提交
|
|
|
- $scope.saveStep3 = function (org,dirty,orgType) {
|
|
|
- if (dirty == false) {
|
|
|
+ $scope.saveStep3 = function (org, isDraft, orgType) {
|
|
|
+ if (orgCopy == org) {
|
|
|
if (orgType == 1) {
|
|
|
$location.path('publicOfferingCertificationStep4');
|
|
|
} else if (orgType == 2) {
|
|
|
$location.path('charityCertificationStep4');
|
|
|
}
|
|
|
} else {
|
|
|
+ var url;
|
|
|
+ if (isDraft) {
|
|
|
+ url = '/org/save';
|
|
|
+ } else {
|
|
|
+ url = '/org/submit';
|
|
|
+ }
|
|
|
+
|
|
|
var data = new FormData(); //以下为像后台提交图片数据
|
|
|
data.append('logo', $scope.logo);
|
|
|
data.append('personCertificate', $scope.personCertificate);
|
|
|
@@ -610,7 +627,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
|
|
|
method: 'POST',
|
|
|
processData: false,
|
|
|
async: false,
|
|
|
- url: '/org/save',
|
|
|
+ url: url,
|
|
|
data: data,
|
|
|
params: {
|
|
|
jsonStr: org
|
|
|
@@ -645,9 +662,11 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
|
|
|
app.controller('PublicCertificationStep4Ctrl', ['$scope', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization',
|
|
|
function ($scope, $http, $rootScope, $timeout, $location, toaster, Organization) {
|
|
|
|
|
|
+ var orgCopy;
|
|
|
// 获取当前账户注册机构情况
|
|
|
Organization.getByUuid({uuid : 10041166}, {}, function(data) {//10041166 10041558
|
|
|
$scope.org = data;
|
|
|
+ orgCopy = angular.copy($scope.org);
|
|
|
}, function() {
|
|
|
toaster.pop('error', '注册情况加载失败');
|
|
|
});
|
|
|
@@ -663,8 +682,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
|
|
|
$scope.$apply();
|
|
|
}
|
|
|
//提交
|
|
|
- $scope.saveStep4 = function (org, isDirty, isDraft) {
|
|
|
- if (isDirty == false) {
|
|
|
+ $scope.saveStep4 = function (org, isDraft) {
|
|
|
+ if (orgCopy == org) {
|
|
|
$location.path('publicOfferingCertificationStep5');
|
|
|
} else {
|
|
|
var url;
|