|
|
|
@ -385,6 +385,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
alert("Logo is necessary!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if($scope.partner.partner_type == 'photo'){
|
|
|
|
|
if (!$scope.partner.company_photo) {
|
|
|
|
|
alert('Shop Photo1 is necessary');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!$scope.partner.store_photo) {
|
|
|
|
|
alert('Shop Photo2 is necessary');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($scope.partner.referrer_id) {
|
|
|
|
|
$scope.referrers.forEach(function (e) {
|
|
|
|
|
if ($scope.partner.referrer_id == e.org_id) {
|
|
|
|
@ -423,18 +434,36 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
|
|
|
|
|
$scope.uploadShopPhoto = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
$scope.photoProgress = {value: 0};
|
|
|
|
|
$scope.shopPhotoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.photoProgress;
|
|
|
|
|
delete $scope.shopPhotoProgress;
|
|
|
|
|
$scope.partner.company_photo = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.photoProgress;
|
|
|
|
|
delete $scope.shopPhotoProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.uploadStorePhoto = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
$scope.storePhotoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.storePhotoProgress;
|
|
|
|
|
$scope.partner.store_photo = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.storePhotoProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.photoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -895,6 +924,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
alert('suburb can not contain two and more continuous space characters');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if($scope.partner.partner_type == 'photo'){
|
|
|
|
|
if (!$scope.partner.company_photo) {
|
|
|
|
|
alert('Shop Photo1 is necessary');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!$scope.partner.store_photo) {
|
|
|
|
|
alert('Shop Photo2 is necessary');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($scope.partner.acn && $scope.partner.business_structure == 'Company') {
|
|
|
|
|
if ($scope.partner.acn.length != 9) {
|
|
|
|
|
alert('Acn is not valid');
|
|
|
|
@ -954,18 +994,36 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
|
|
|
|
|
$scope.uploadShopPhoto = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
$scope.photoProgress = {value: 0};
|
|
|
|
|
$scope.shopPhotoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.photoProgress;
|
|
|
|
|
delete $scope.shopPhotoProgress;
|
|
|
|
|
$scope.partner.company_photo = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.photoProgress;
|
|
|
|
|
delete $scope.shopPhotoProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.photoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.uploadStorePhoto = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
$scope.storePhotoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.storePhotoProgress;
|
|
|
|
|
$scope.partner.store_photo = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.storePhotoProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|