|
|
|
@ -5689,23 +5689,23 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
// $scope.hideMerchantInfo = function () {
|
|
|
|
|
// $scope.showMoreMerchantInfo = !$scope.showMoreMerchantInfo;
|
|
|
|
|
// };
|
|
|
|
|
// $scope.updateSubMerchantId = function (merchant_app_id) {
|
|
|
|
|
// $uibModal.open({
|
|
|
|
|
// templateUrl: '/static/payment/partner/templates/update_apply_wx_sub_merchant_id.html',
|
|
|
|
|
// controller: 'updateApplyWxSubMerchantIdCtrl',
|
|
|
|
|
// resolve: {
|
|
|
|
|
// merchantInfo: $scope.partner,
|
|
|
|
|
// merchantIds: ['$http', '$stateParams', function ($http) {
|
|
|
|
|
// return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids');
|
|
|
|
|
// }],
|
|
|
|
|
// subMerchantInfo: ['$http', '$stateParams', function ($http) {
|
|
|
|
|
// return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids/' + merchant_app_id);
|
|
|
|
|
// }]
|
|
|
|
|
// }
|
|
|
|
|
// }).result.then(function () {
|
|
|
|
|
// $scope.loadSubMerchantInfos();
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
$scope.updateSubMerchantId = function (merchant_app_id) {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/payment/partner/templates/update_apply_wx_sub_merchant_id.html',
|
|
|
|
|
controller: 'updateApplyWxSubMerchantIdCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
|
merchantInfo: $scope.partner,
|
|
|
|
|
merchantIds: ['$http', '$stateParams', function ($http) {
|
|
|
|
|
return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids');
|
|
|
|
|
}],
|
|
|
|
|
subMerchantInfo: ['$http', '$stateParams', function ($http) {
|
|
|
|
|
return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids/' + merchant_app_id);
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
}).result.then(function () {
|
|
|
|
|
$scope.loadSubMerchantInfos();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// $scope.useRpaySubMerchantId = function (sub_merchant_id) {
|
|
|
|
|
// $http.put('/sys/partners/' + $scope.partner.client_moniker + '/rpay_payment_config', { rpay_enterprise_id: sub_merchant_id }).then(function (resp) {
|
|
|
|
|
// commonDialog.alert({
|
|
|
|
@ -6037,21 +6037,50 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.merchantInfo = angular.copy(merchantInfo);
|
|
|
|
|
$scope.wechatMccIndustries = wechatGoodMcc.configs();
|
|
|
|
|
$scope.merchantIds = merchantIds.data;
|
|
|
|
|
$scope.businessTypesMap = businessTypesMap.configs();
|
|
|
|
|
$scope.businessTypesMap=businessTypesMap.configs();
|
|
|
|
|
|
|
|
|
|
if ($scope.subMerchantInfo.business_structure) {
|
|
|
|
|
$scope.subMerchantInfo.merchant_type = $scope.subMerchantInfo.business_structure != 'Registered body(Sole Trader)' ? "ENTERPRISE" : "INDIVIDUAL";
|
|
|
|
|
if($scope.subMerchantInfo.extra_merchant_type ){
|
|
|
|
|
$scope.subMerchantInfo.merchant_type=$scope.subMerchantInfo.extra_merchant_type;
|
|
|
|
|
}
|
|
|
|
|
if ($scope.subMerchantInfo.industry) {
|
|
|
|
|
if($scope.subMerchantInfo.industry) {
|
|
|
|
|
$scope.subMerchantInfo.industry = $filter('newWxMerchantsFilter')($scope.subMerchantInfo.industry);
|
|
|
|
|
}
|
|
|
|
|
if ($scope.subMerchantInfo.mcc_code) {
|
|
|
|
|
$scope.subMerchantInfo.mcc_code = parseInt($scope.subMerchantInfo.mcc_code);
|
|
|
|
|
if($scope.subMerchantInfo.mcc_code ){
|
|
|
|
|
$scope.subMerchantInfo.mcc_code=parseInt($scope.subMerchantInfo.mcc_code);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($scope.subMerchantInfo.certificat_expire_date) {
|
|
|
|
|
// var datestr = subMerchantInfo.certificat_expire_date.replace(/-/g, '/');
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date = new Date($scope.subMerchantInfo.certificat_expire_date);
|
|
|
|
|
// if($scope.subMerchantInfo.certificat_expire_date) {
|
|
|
|
|
// // var datestr = subMerchantInfo.certificat_expire_date.replace(/-/g, '/');
|
|
|
|
|
// $scope.subMerchantInfo.certificat_expire_date=new Date($scope.subMerchantInfo.certificat_expire_date);
|
|
|
|
|
// }
|
|
|
|
|
if($scope.subMerchantInfo.certificat_expire_date) {
|
|
|
|
|
if( $scope.subMerchantInfo.certificat_expire_date=="PERMANENT"){
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_premanent=true;
|
|
|
|
|
}else if( $scope.subMerchantInfo.certificat_expire_date=="N/A"){
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_NA=true;
|
|
|
|
|
}else {
|
|
|
|
|
var datestr = $scope.subMerchantInfo.certificat_expire_date.replace(/-/g, '/');
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_d = new Date(datestr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$scope.checkExpriedate=function (value) {
|
|
|
|
|
if(value){
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_premanent=false;
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_NA=false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$scope.checkExpriedateOther=function (value) {
|
|
|
|
|
if(value=='PERMANENT'){
|
|
|
|
|
if($scope.subMerchantInfo.certificat_expire_date_premanent){
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_NA=false;
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_d=null;
|
|
|
|
|
}
|
|
|
|
|
}else if(value=='N/A'){
|
|
|
|
|
if($scope.subMerchantInfo.certificat_expire_date_NA){
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_premanent=false;
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_d=null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$scope.updateApply = function (form) {
|
|
|
|
|
$scope.errmsg = null;
|
|
|
|
@ -6064,44 +6093,61 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var params = {
|
|
|
|
|
company_name: $scope.subMerchantInfo.company_name,
|
|
|
|
|
merchant_id: $scope.subMerchantInfo.merchant_id,
|
|
|
|
|
short_name: $scope.subMerchantInfo.short_name,
|
|
|
|
|
office_phone: $scope.subMerchantInfo.office_phone,
|
|
|
|
|
contact_person: $scope.subMerchantInfo.contact_person,
|
|
|
|
|
contact_phone: $scope.subMerchantInfo.contact_phone,
|
|
|
|
|
company_phone: $scope.subMerchantInfo.company_phone,
|
|
|
|
|
contact_email: $scope.subMerchantInfo.contact_email,
|
|
|
|
|
industry: $scope.subMerchantInfo.industry,
|
|
|
|
|
company_website: $scope.subMerchantInfo.company_website,
|
|
|
|
|
company_name : $scope.subMerchantInfo.company_name,
|
|
|
|
|
merchant_id : $scope.subMerchantInfo.merchant_id,
|
|
|
|
|
short_name : $scope.subMerchantInfo.short_name,
|
|
|
|
|
office_phone : $scope.subMerchantInfo.office_phone,
|
|
|
|
|
contact_person : $scope.subMerchantInfo.contact_person,
|
|
|
|
|
contact_phone : $scope.subMerchantInfo.contact_phone,
|
|
|
|
|
company_phone : $scope.subMerchantInfo.company_phone,
|
|
|
|
|
contact_email : $scope.subMerchantInfo.contact_email,
|
|
|
|
|
industry : $scope.subMerchantInfo.industry,
|
|
|
|
|
company_website : $scope.subMerchantInfo.company_website,
|
|
|
|
|
merchant_type: $scope.subMerchantInfo.merchant_type,
|
|
|
|
|
mcc_code: $scope.subMerchantInfo.mcc_code,
|
|
|
|
|
mcc_code : $scope.subMerchantInfo.mcc_code,
|
|
|
|
|
address: $scope.subMerchantInfo.address,
|
|
|
|
|
business_type: $scope.subMerchantInfo.business_type
|
|
|
|
|
};
|
|
|
|
|
if (params.business_type == 'ONLINE') {
|
|
|
|
|
params.address = null;
|
|
|
|
|
}
|
|
|
|
|
else if (params.business_type == 'OFFLINE') {
|
|
|
|
|
params.company_website = null;
|
|
|
|
|
}
|
|
|
|
|
if ($scope.subMerchantInfo.merchant_type == 'ENTERPRISE') {
|
|
|
|
|
params.director_name = $scope.subMerchantInfo.director_name;
|
|
|
|
|
params.director_id_number = $scope.subMerchantInfo.director_id_number;
|
|
|
|
|
business_type:$scope.subMerchantInfo.business_type,
|
|
|
|
|
sub_mch_id:$scope.subMerchantInfo.sub_merchant_id,
|
|
|
|
|
};
|
|
|
|
|
if(params.business_type=='ONLINE'){
|
|
|
|
|
params.address=null;
|
|
|
|
|
}
|
|
|
|
|
else if(params.business_type=='OFFLINE'){
|
|
|
|
|
params.company_website=null;
|
|
|
|
|
}
|
|
|
|
|
// if($scope.subMerchantInfo.merchant_type == 'ENTERPRISE'){
|
|
|
|
|
// params.director_name = $scope.subMerchantInfo.director_name;
|
|
|
|
|
// params.director_id_number = $scope.subMerchantInfo.director_id_number;
|
|
|
|
|
// params.company_register_no = $scope.subMerchantInfo.company_register_no;
|
|
|
|
|
// params.certificat_expire_date = $scope.subMerchantInfo.certificat_expire_date;
|
|
|
|
|
// if($scope.subMerchantInfo.certificat_expire_date) {
|
|
|
|
|
// params.certificat_expire_date = $filter('dateConversionStr')($scope.subMerchantInfo.certificat_expire_date)
|
|
|
|
|
// }
|
|
|
|
|
// }else{
|
|
|
|
|
// params.principal_name = $scope.subMerchantInfo.principal_name;
|
|
|
|
|
// params.principal_id_number = $scope.subMerchantInfo.principal_id_number;
|
|
|
|
|
// }
|
|
|
|
|
if(params.merchant_type == 'ENTERPRISE'){
|
|
|
|
|
params.company_register_no = $scope.subMerchantInfo.company_register_no;
|
|
|
|
|
params.certificat_expire_date = $scope.subMerchantInfo.certificat_expire_date;
|
|
|
|
|
if ($scope.subMerchantInfo.certificat_expire_date) {
|
|
|
|
|
params.certificat_expire_date = $filter('dateConversionStr')($scope.subMerchantInfo.certificat_expire_date)
|
|
|
|
|
if($scope.subMerchantInfo.certificat_expire_date_d) {
|
|
|
|
|
params.certificat_expire_date = $filter('dateConversionStr')($scope.subMerchantInfo.certificat_expire_date_d)
|
|
|
|
|
}else if($scope.subMerchantInfo.certificat_expire_date_premanent){
|
|
|
|
|
params.certificat_expire_date="PERMANENT";
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
params.principal_name = $scope.subMerchantInfo.principal_name;
|
|
|
|
|
params.principal_id_number = $scope.subMerchantInfo.principal_id_number;
|
|
|
|
|
else if($scope.subMerchantInfo.certificat_expire_date_NA){
|
|
|
|
|
params.certificat_expire_date="N/A";
|
|
|
|
|
}else{
|
|
|
|
|
alert("Certificate expiration time is required");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$http.put('/sys/partners/' + $scope.merchantInfo.client_moniker + '/get_merchant_ids/' + $scope.subMerchantInfo.merchant_app_id, params).then(function (resp) {
|
|
|
|
|
}
|
|
|
|
|
$http.put('/sys/partners/' + $scope.merchantInfo.client_moniker + '/get_merchant_ids/'+$scope.subMerchantInfo.merchant_app_id, params).then(function (resp) {
|
|
|
|
|
$scope.apply_sub_merchant_id = resp.data;
|
|
|
|
|
$scope.$close();
|
|
|
|
|
commonDialog.confirm({ title: 'Confirm', content: '微信商户进件已修改成功!' })
|
|
|
|
|
commonDialog.confirm({title: 'Confirm', content: 'Successfully modified!'})
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|