|
|
|
@ -404,6 +404,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if(!window.frames['merchant_detail'].merchant_location){
|
|
|
|
|
alert("Please Locate Merchant's Location");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$http.post('/sys/partners', $scope.partner).then(function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Success', content: 'Register new partner successfully', type: 'success'});
|
|
|
|
|
$scope.updateMerchantLocation();
|
|
|
|
@ -473,8 +477,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
if (params) {
|
|
|
|
|
$http.put('/sys/partners/modify/' + $scope.partner.client_moniker + '/location', params).then(function () {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
alert("Please Locate Merchant's Location");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
@ -954,11 +956,14 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
$scope.updateMerchantLocation();
|
|
|
|
|
var content = '';
|
|
|
|
|
if (!origin_referrer_id && $scope.partner.referrer_id) {
|
|
|
|
|
content = 'Update partner info successfully,But You Had add new Referrer,Please Change the BD Commission Proportion!';
|
|
|
|
|
}
|
|
|
|
|
if(!window.frames['merchant_detail'].merchant_location){
|
|
|
|
|
alert("Please Locate Merchant Location!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker, $scope.partner).then(function () {
|
|
|
|
|
if (content != '') {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
@ -973,6 +978,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
$scope.updateMerchantLocation();
|
|
|
|
|
$scope.loadPartners();
|
|
|
|
|
$state.go('^.detail', {clientMoniker: $scope.partner.client_moniker}, {reload: true});
|
|
|
|
|
}, function (resp) {
|
|
|
|
@ -1046,12 +1052,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
if (params) {
|
|
|
|
|
$http.put('/sys/partners/modify/' + $scope.partner.client_moniker + '/location', params).then(function () {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Warning',
|
|
|
|
|
content: 'Please Locate Merchant Location',
|
|
|
|
|
type: 'error'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
@ -1823,6 +1823,24 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!$scope.partner.logo_url) {
|
|
|
|
|
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(!window.frames['merchant_detail'].merchant_location){
|
|
|
|
|
alert("Please Locate Merchant Location!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$http.post('/sys/partners/' + clientMoniker + '/sub_clients', $scope.partner).then(function () {
|
|
|
|
|
$scope.updateMerchantLocation();
|
|
|
|
|
$scope.$close();
|
|
|
|
@ -1851,18 +1869,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);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -1871,12 +1907,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
if (params) {
|
|
|
|
|
$http.put('/sys/partners/modify/' + $scope.partner.client_moniker + '/location', params).then(function () {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Warning',
|
|
|
|
|
content: 'Please Locate Merchant Location',
|
|
|
|
|
type: 'error'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|