|
|
|
@ -72,9 +72,15 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
|
|
|
|
|
$scope.disabledArray = new Array(true, false, false, false, false);
|
|
|
|
|
$scope.chooseArray = new Array(true, false, false, false, false);
|
|
|
|
|
$scope.changeChoose = function (index) {
|
|
|
|
|
angular.forEach($scope.partner, function(key, value) {
|
|
|
|
|
if(value.trim()==''){
|
|
|
|
|
$scope.partner.remove(key);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$scope.chooseArray = new Array(false, false, false, false, false);
|
|
|
|
|
$scope.chooseArray[index] = true;
|
|
|
|
|
$scope.disabledArray[index] = true;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
$scope.getRateConfig = function () {
|
|
|
|
|
$http.get('/sys/partners/sys_rates').then(function (resp) {
|
|
|
|
@ -170,13 +176,15 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$scope.partner.codeKey = Math.random().toString(16).substring(2);
|
|
|
|
|
$scope.initParam();
|
|
|
|
|
$http.post('/register/info/update/' + $scope.partner.username +'/step1', $scope.partner).then(function (resp) {
|
|
|
|
|
$scope.changeChoose(index);
|
|
|
|
|
$scope.partner.codeKey = resp.data.codeKey;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
$scope.resError = resp.data.message;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.saveApplyInfo = function (form,index) {
|
|
|
|
|
if (form.$invalid) {
|
|
|
|
|
angular.forEach(form, function (item, key) {
|
|
|
|
@ -186,9 +194,7 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(index == 1){
|
|
|
|
|
$scope.partner.codeKey = Math.random().toString(16).substring(2);
|
|
|
|
|
}
|
|
|
|
|
$scope.initParam();
|
|
|
|
|
$http.post('/register/info/update/' + $scope.partner.username, $scope.partner).then(function (resp) {
|
|
|
|
|
if (index == 3) {
|
|
|
|
|
$scope.getRateConfig();
|
|
|
|
@ -201,4 +207,48 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
|
|
|
|
|
$scope.resError = resp.data.message;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.initParam = function () {
|
|
|
|
|
if(!$scope.partner.company_name){
|
|
|
|
|
$scope.partner.company_name = ' ';
|
|
|
|
|
}
|
|
|
|
|
if(!$scope.partner.short_name){
|
|
|
|
|
$scope.partner.short_name = ' ';
|
|
|
|
|
}
|
|
|
|
|
if(!$scope.partner.company_phone){
|
|
|
|
|
$scope.partner.company_phone = ' ';
|
|
|
|
|
}
|
|
|
|
|
if(!$scope.partner.address){
|
|
|
|
|
$scope.partner.address = ' ';
|
|
|
|
|
}
|
|
|
|
|
if(!$scope.partner.suburb){
|
|
|
|
|
$scope.partner.suburb = ' ';
|
|
|
|
|
}
|
|
|
|
|
if(!$scope.partner.state){
|
|
|
|
|
$scope.partner.state = ' ';
|
|
|
|
|
}
|
|
|
|
|
if(!$scope.partner.postcode){
|
|
|
|
|
$scope.partner.postcode = ' ';
|
|
|
|
|
}
|
|
|
|
|
if(!$scope.partner.industry){
|
|
|
|
|
$scope.partner.industry = ' ';
|
|
|
|
|
}
|
|
|
|
|
if(!$scope.partner.bank_no){
|
|
|
|
|
$scope.partner.bank_no = ' ';
|
|
|
|
|
}
|
|
|
|
|
if(!$scope.partner.bank_name){
|
|
|
|
|
$scope.partner.bank_name = ' ';
|
|
|
|
|
}
|
|
|
|
|
if(!$scope.partner.bsb_no){
|
|
|
|
|
$scope.partner.bsb_no = ' ';
|
|
|
|
|
}
|
|
|
|
|
if(!$scope.partner.clean_days){
|
|
|
|
|
$scope.partner.clean_days = ' ';
|
|
|
|
|
}
|
|
|
|
|
if(!$scope.partner.abn){
|
|
|
|
|
$scope.partner.abn = ' ';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}]);
|