diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index ec660dd6c..c1bfab7d5 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -3402,6 +3402,22 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.loadSubMerchantInfos(); }) }; + $scope.updateYeepaySubMerchantId = function (sub_merchant_id) { + $uibModal.open({ + templateUrl: '/static/payment/partner/templates/update_yeepay_sub_merchant_id.html', + controller: 'updateYeepaySubMerchantIdCtrl', + resolve: { + subMerchantInfo: function () { + return $scope.partner; + }, + yeepaySubMerchantId: function () { + return sub_merchant_id; + } + } + }).result.then(function () { + $scope.loadSubMerchantInfos(); + }) + }; $scope.loadSubMerchantInfos(); }]); app.controller('applyWxSubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog) { @@ -3807,6 +3823,315 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }]); + app.controller('updateYeepaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state','subMerchantInfo','yeepayIndustryMap','yeepayBusinessContentMap','$filter', 'commonDialog','Upload', function ($scope, $http, $uibModal, $state,subMerchantInfo,yeepayIndustryMap,yeepayBusinessContentMap,$filter, commonDialog,Upload) { + $scope.yeepay_industries = yeepayIndustryMap.configs(); + $scope.yeepay_business_contents = yeepayBusinessContentMap.configs(); + $scope.subMerchantInfo = angular.copy(subMerchantInfo); + var vouchers={}; + + $scope.directors={}; + $scope.executives={}; + $scope.industry = ''; + $scope.business_content = ''; + var merchantInfo = {}; + + var merchantId = ''; + + + $scope.uploadLegalIDcardFront = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.legalIDcardFrontProgress = {value: 0}; + Upload.upload({ + url: '/attachment/yeepayFiles', + data: {file: file} + }).then(function (resp) { + delete $scope.legalIDcardFrontProgress; + $scope.legalIDcardFront = resp.data.path; + vouchers['legalIDcardFront'] = resp.data.path; + merchantId = resp.data.merchantId; + commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) + }, function (resp) { + delete $scope.legalIDcardFrontProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.legalIDcardFrontProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadLegalIDcardBack = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.legalIDcardBackProgress = {value: 0}; + Upload.upload({ + url: '/attachment/yeepayFiles', + data: {file: file} + }).then(function (resp) { + delete $scope.legalIDcardBackProgress; + $scope.legalIDcardBack = resp.data.path; + vouchers['legalIDcardBack'] = resp.data.path; + merchantId = resp.data.merchantId; + commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) + }, function (resp) { + delete $scope.legalIDcardBackProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.legalIDcardBackProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadBusinessLicence = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.businessLicenceProgress = {value: 0}; + Upload.upload({ + url: '/attachment/yeepayFiles', + data: {file: file} + }).then(function (resp) { + delete $scope.businessLicenceProgress; + $scope.businessLicence = resp.data.path; + merchantInfo['business_licence'] = resp.data.path; + merchantId = resp.data.merchantId; + commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) + }, function (resp) { + delete $scope.businessLicenceProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.businessLicenceProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadTaxLevel = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.taxLevelProgress = {value: 0}; + Upload.upload({ + url: '/attachment/yeepayFiles', + data: {file: file} + }).then(function (resp) { + delete $scope.taxLevelProgress; + $scope.taxLevel = resp.data.path; + vouchers['taxLevel'] = resp.data.path; + merchantId = resp.data.merchantId; + commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) + }, function (resp) { + delete $scope.taxLevelProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.taxLevelProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadBankAccountOpen = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.bankAccountOpenProgress = {value: 0}; + Upload.upload({ + url: '/attachment/yeepayFiles', + data: {file: file} + }).then(function (resp) { + delete $scope.bankAccountOpenProgress; + $scope.bankAccountOpen = resp.data.path; + vouchers['bankAccountOpen'] = resp.data.path; + merchantId = resp.data.merchantId; + commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) + }, function (resp) { + delete $scope.bankAccountOpenProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.bankAccountOpenProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadOrgCode = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.orgCodeProgress = {value: 0}; + Upload.upload({ + url: '/attachment/yeepayFiles', + data: {file: file} + }).then(function (resp) { + delete $scope.orgCodeProgress; + $scope.orgCode = resp.data.path; + vouchers['orgCode'] = resp.data.path; + merchantId = resp.data.merchantId; + commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) + }, function (resp) { + delete $scope.orgCodeProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.orgCodeProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadNonStanProtocol = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.nonStanProtocolProgress = {value: 0}; + Upload.upload({ + url: '/attachment/yeepayFiles', + data: {file: file} + }).then(function (resp) { + delete $scope.nonStanProtocolProgress; + $scope.nonStanProtocol = resp.data.path; + vouchers['nonStanProtocol'] = resp.data.path; + merchantId = resp.data.merchantId; + commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) + }, function (resp) { + delete $scope.nonStanProtocolProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.nonStanProtocolProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadZipPath = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.zipPathProgress = {value: 0}; + Upload.upload({ + url: '/attachment/yeepayFiles', + data: {file: file} + }).then(function (resp) { + delete $scope.zipPathProgress; + $scope.zipPath = resp.data.path; + vouchers['zipPath'] = resp.data.path; + merchantId = resp.data.merchantId; + commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) + }, function (resp) { + delete $scope.zipPathProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.zipPathProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadDirectorPassport = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.directorPassportProgress = {value: 0}; + Upload.upload({ + url: '/attachment/yeepayFiles', + data: {file: file} + }).then(function (resp) { + delete $scope.directorPassportProgress; + $scope.directorPassport = resp.data.path; + $scope.directors.filePath = resp.data.path; + merchantId = resp.data.merchantId; + commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) + }, function (resp) { + delete $scope.directorPassportProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.directorPassportProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadExecutivePassport = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.executivePassportProgress = {value: 0}; + Upload.upload({ + url: '/attachment/yeepayFiles', + data: {file: file} + }).then(function (resp) { + delete $scope.executivePassportProgress; + $scope.executivePassport = resp.data.path; + $scope.executives.filePath = resp.data.path; + merchantId = resp.data.merchantId; + commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) + }, function (resp) { + delete $scope.executivePassportProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.executivePassportProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.saveYeepayApply = function (form) { + $scope.errmsg = null; + if (form.$invalid) { + angular.forEach(form, function (item, key) { + if (key.indexOf('$') < 0) { + item.$dirty = true; + } + }); + return; + } + // angular.forEach(form, function (item, key) { + // if(item !=null) { + // if(item.$name !=null) { + // merchantInfo[key] = item.$modelValue; + // } + // } + // }); + merchantInfo['executives'] = $scope.executives; + merchantInfo['directors'] = $scope.directors; + merchantInfo['business_content'] = $scope.business_content; + merchantInfo['industry'] = $scope.industry; + merchantInfo['merchantId'] = merchantId; + $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registYeepaySubMerchantId', merchantInfo).then(function (resp) { + $scope.apply_sub_merchant_id = resp.data; + $scope.$close(); + if (subMerchantInfo.yeepay_sub_merchant_id != null) { + commonDialog.alert({ + title: 'Success', + content: 'Modify Yeepay Sub Merchant ID successfully', + type: 'success' + }); + $state.reload(); + } + }, function (resp) { + commonDialog.alert({ + title: 'Error', + content: resp.data.message, + type: 'error' + }); + }) + } + }]); + + app.controller('permissionClientCtrl', ['$scope', '$http', '$uibModal', '$state', '$filter', 'commonDialog', function ($scope, $http, $uibModal, $state, $filter, commonDialog) { $scope.clientPermission = {client_moniker:$scope.partner.client_moniker}; $scope.loadPermissionList = function () { diff --git a/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html b/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html index 835b5b5dc..b5da35571 100644 --- a/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html +++ b/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html @@ -201,6 +201,10 @@ ng-click="useYeepaySubMerchantId(id_apply.sub_merchant_id)"> USE + + + + diff --git a/src/main/ui/static/payment/partner/templates/update_yeepay_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/update_yeepay_sub_merchant_id.html new file mode 100644 index 000000000..8d656df06 --- /dev/null +++ b/src/main/ui/static/payment/partner/templates/update_yeepay_sub_merchant_id.html @@ -0,0 +1,310 @@ +
+
+
+
+
+
Update Yeepay Sub Merchant Id
+
+
+
+ +
+ +
+

Required Field

+
+
+
+ + +
+ +
+ +
+

Required Field

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +
Url:{{businessLicence}}
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+

Required Field

+

Length is more than 50

+
+
+
+ +
+ +
+ +
+

Required Field

+

Length is more than 50

+
+
+
+ +
+ +
+
+ +
+ +
Url:{{directorPassport}}
+
+
+ +
+ +
+ +
+

Required Field

+

Length is more than 50

+
+
+
+ +
+ +
+ +
+

Required Field

+

Length is more than 50

+
+
+
+ +
+ +
+ +
+

Required Field

+

Length is more than 50

+
+
+
+ +
+ +
+ +
+

Required Field

+
+
+
+ +
+ +
+
+ +
+ +
Url:{{executivePassport}}
+
+
+ +
+ +
+ +
+

Required Field

+

Length is more than 50

+
+
+
+
+
+
+
+ +
+
+
+
+