|
|
|
@ -439,56 +439,68 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
};
|
|
|
|
|
$scope.uploadLogo = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
$scope.logoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
$scope.partner.logo_id = resp.data.fileid;
|
|
|
|
|
$scope.partner.logo_url = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
if (file.size > 1 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$scope.logoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
$scope.partner.logo_id = resp.data.fileid;
|
|
|
|
|
$scope.partner.logo_url = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.uploadShopPhoto = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
$scope.shopPhotoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.shopPhotoProgress;
|
|
|
|
|
$scope.partner.company_photo = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
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);
|
|
|
|
|
})
|
|
|
|
|
if (file.size > 2 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$scope.shopPhotoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.shopPhotoProgress;
|
|
|
|
|
$scope.partner.company_photo = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
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.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
if (file.size > 2 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$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);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -677,24 +689,28 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
};
|
|
|
|
|
$scope.uploadAgreeFile = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
$scope.agree_file_import = resp.data.url;
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/import/agreepdf', {source_agree_file: $scope.agree_file_import}).then(function () {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
content: 'Succeed Imported! Please notify BD',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
$state.reload();
|
|
|
|
|
if (file.size > 2 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
$scope.agree_file_import = resp.data.url;
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/import/agreepdf', {source_agree_file: $scope.agree_file_import}).then(function () {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
content: 'Succeed Imported! Please notify BD',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
$state.reload();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
|
|
|
|
|
})
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
})
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
$scope.notifyBD = function () {
|
|
|
|
@ -1093,56 +1109,68 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
};
|
|
|
|
|
$scope.uploadLogo = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
$scope.logoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
$scope.partner.logo_id = resp.data.fileid;
|
|
|
|
|
$scope.partner.logo_url = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
if (file.size > 1 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$scope.logoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
$scope.partner.logo_id = resp.data.fileid;
|
|
|
|
|
$scope.partner.logo_url = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.uploadShopPhoto = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
$scope.shopPhotoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.shopPhotoProgress;
|
|
|
|
|
$scope.partner.company_photo = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
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);
|
|
|
|
|
})
|
|
|
|
|
if (file.size > 2 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$scope.shopPhotoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.shopPhotoProgress;
|
|
|
|
|
$scope.partner.company_photo = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
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.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
if (file.size > 2 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$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);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -2108,56 +2136,68 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
}
|
|
|
|
|
$scope.uploadLogo = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
$scope.logoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
$scope.partner.logo_id = resp.data.fileid;
|
|
|
|
|
$scope.partner.logo_url = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
if (file.size > 1 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$scope.logoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
$scope.partner.logo_id = resp.data.fileid;
|
|
|
|
|
$scope.partner.logo_url = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.uploadShopPhoto = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
$scope.shopPhotoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.shopPhotoProgress;
|
|
|
|
|
$scope.partner.company_photo = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
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);
|
|
|
|
|
})
|
|
|
|
|
if (file.size > 2 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$scope.shopPhotoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.shopPhotoProgress;
|
|
|
|
|
$scope.partner.company_photo = resp.data.url;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
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.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
if (file.size > 2 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$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);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
$scope.updateMerchantLocation = function () {
|
|
|
|
|