|
|
|
@ -30,180 +30,128 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
{code: 2, label: 'Manager'},
|
|
|
|
|
{code: 3, label: 'Cashier'}
|
|
|
|
|
];
|
|
|
|
|
// var wxMerchantIndustries = [
|
|
|
|
|
// {
|
|
|
|
|
// "label": "鞋包服饰|Shoes&Garments",
|
|
|
|
|
// "value": "343"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// "label": "机票行业|Air Ticket",
|
|
|
|
|
// "value": "493"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// "label": "文具/办公用品|Stationery/office supplies",
|
|
|
|
|
// "value": "492"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// "label": "酒店行业|Hotel Industry",
|
|
|
|
|
// "value": "491"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// "label": "教育行业|Education Industry",
|
|
|
|
|
// "value": "490"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// "label": "国际物流|Logistics",
|
|
|
|
|
// "value": "489"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// "label": "数码电器|Digital appliance",
|
|
|
|
|
// "value": "488"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// "label": "母婴|Maternal and infant",
|
|
|
|
|
// "value": "487"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// "label": "化妆品|Cosmetics",
|
|
|
|
|
// "value": "486"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// "label": "食品|Food",
|
|
|
|
|
// "value": "485"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// "label": "综合商城|Comprehensive mall",
|
|
|
|
|
// "value": "484"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// "label": "其它货物贸易行业|Other trade industry",
|
|
|
|
|
// "value": "494"
|
|
|
|
|
// }
|
|
|
|
|
// ];
|
|
|
|
|
|
|
|
|
|
var wxMerchantIndustries = [
|
|
|
|
|
{
|
|
|
|
|
"label": "鞋包服饰|Shoes&Garments",
|
|
|
|
|
"label": "Shoes&Garments",
|
|
|
|
|
"value": "343"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "机票行业|Air Ticket",
|
|
|
|
|
"value": "493"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "文具/办公用品|Stationery/office supplies",
|
|
|
|
|
"value": "492"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "酒店行业|Hotel Industry",
|
|
|
|
|
"value": "491"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "教育行业|Education Industry",
|
|
|
|
|
"value": "490"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "国际物流|Logistics",
|
|
|
|
|
"value": "489"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "数码电器|Digital appliance",
|
|
|
|
|
"value": "488"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "母婴|Maternal and infant",
|
|
|
|
|
"value": "487"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "化妆品|Cosmetics",
|
|
|
|
|
"value": "486"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "食品|Food",
|
|
|
|
|
"value": "485"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "综合商城|Comprehensive mall",
|
|
|
|
|
"label": "Comprehensive mall",
|
|
|
|
|
"value": "484"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "其它货物贸易行业|Other trade industry",
|
|
|
|
|
"value": "494"
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
var newWxMerchantIndustries = [
|
|
|
|
|
{
|
|
|
|
|
"label": "Online shopping",
|
|
|
|
|
"value": "648"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Supermarket",
|
|
|
|
|
"value": "649"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Convenience Store",
|
|
|
|
|
"value": "651"
|
|
|
|
|
"label": "Food",
|
|
|
|
|
"value": "485"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Duty-free Shop",
|
|
|
|
|
"value": "652"
|
|
|
|
|
"label": "Cosmetics",
|
|
|
|
|
"value": "486"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Pharmacy",
|
|
|
|
|
"value": "653"
|
|
|
|
|
"label": "Maternal and infant",
|
|
|
|
|
"value": "487"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Vending Machine",
|
|
|
|
|
"value": "654"
|
|
|
|
|
"label": "Digital appliance",
|
|
|
|
|
"value": "488"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Department Store /Shopping Centre",
|
|
|
|
|
"value": "655"
|
|
|
|
|
"label": "Logistics",
|
|
|
|
|
"value": "489"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Food/Beverages",
|
|
|
|
|
"value": "656"
|
|
|
|
|
"label": "Education Industry",
|
|
|
|
|
"value": "490"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Catering Services",
|
|
|
|
|
"value": "657"
|
|
|
|
|
"label": "Hotel Industry",
|
|
|
|
|
"value": "491"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Furniture/Household Products",
|
|
|
|
|
"value": "658"
|
|
|
|
|
"label": "Stationery/office supplies",
|
|
|
|
|
"value": "492"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Home Appliances/Camera Equipment/Office Equipment",
|
|
|
|
|
"value": "659"
|
|
|
|
|
"label": "Air Ticket",
|
|
|
|
|
"value": "493"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Beauty/Personal Care Products",
|
|
|
|
|
"value": "660"
|
|
|
|
|
"label": "Other trade industry",
|
|
|
|
|
"value": "494"
|
|
|
|
|
},{
|
|
|
|
|
"label": "Flowers/Plants/Interior Decorations/Decorations",
|
|
|
|
|
"value": "661"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Nursery Products/Toys",
|
|
|
|
|
"value": "662"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Clothing/Shoes/Other Accessories",
|
|
|
|
|
"value": "663"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Sports/Fitness Equipment/Security",
|
|
|
|
|
"value": "664"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Watches/Eyewear/Jewellery",
|
|
|
|
|
"value": "665"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Outdoor Products /Travel Products",
|
|
|
|
|
"value": "666"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Books / Records / Stationery / Musical Instruments",
|
|
|
|
|
"value": "667"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Flight ticket/ticketing agent",
|
|
|
|
|
"value": "668"
|
|
|
|
|
"label": "Overseas Education",
|
|
|
|
|
"value": "528"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Sightseeing Passes",
|
|
|
|
|
"value": "669"
|
|
|
|
|
"label": "Travel ticket",
|
|
|
|
|
"value": "529"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Hotel/Resor",
|
|
|
|
|
"value": "670"
|
|
|
|
|
"label": "Car rental",
|
|
|
|
|
"value": "530"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Online Books/Video/Music",
|
|
|
|
|
"value": "671"
|
|
|
|
|
"label": "International Conference",
|
|
|
|
|
"value": "531"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Online games (Download)",
|
|
|
|
|
"value": "672"
|
|
|
|
|
"label": "Software",
|
|
|
|
|
"value": "532"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "University Education",
|
|
|
|
|
"value": "677"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Private hospitals/Clinics/Medical institutions",
|
|
|
|
|
"value": "678"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Public hospitals/Medical Institutions",
|
|
|
|
|
"value": "679"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Public transit",
|
|
|
|
|
"value": "680"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Car Rental",
|
|
|
|
|
"value": "681"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Logistics/ Courier Service",
|
|
|
|
|
"value": "684"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Telecommunication Services",
|
|
|
|
|
"value": "690"
|
|
|
|
|
"label": "Medical Service",
|
|
|
|
|
"value": "533"
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
var removeClientPayDesc = function (items, key) {
|
|
|
|
@ -1018,6 +966,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.isComplianceOfShortName = false;
|
|
|
|
|
$scope.isComplianceOfBusinessStructure = false;
|
|
|
|
|
$scope.cardPromotionaparams = {};
|
|
|
|
|
if($scope.partner.mc_code ){
|
|
|
|
|
$scope.partner.mc_code=parseInt($scope.partner.mc_code);
|
|
|
|
|
}
|
|
|
|
|
var website = partner.data.company_website;
|
|
|
|
|
if (website != null) {
|
|
|
|
|
if (website.indexOf('http') !== 0) {
|
|
|
|
@ -2540,8 +2491,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.paymentInfo.sub_merchant_id
|
|
|
|
|
$http.get('/sys/partners/'+$scope.paymentInfo.client_moniker+'/get_merchant_ids/'+$scope.paymentInfo.sub_merchant_id+'/status').then(function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Wechat Apply Status',
|
|
|
|
|
content: resp.data.apply_status,
|
|
|
|
|
title: 'Wechat Apply Status('+resp.data.apply_status+")",
|
|
|
|
|
content: resp.data.response_str,
|
|
|
|
|
type: 'info'
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
@ -3187,8 +3138,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('partnerNewSubPartnerDialogCtrl', ['$rootScope', '$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone',
|
|
|
|
|
'clientMoniker', 'industryMap', 'businessStructuresMap', 'stateMap', 'countryMap',
|
|
|
|
|
function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, clientMoniker, industryMap, businessStructuresMap, stateMap, countryMap) {
|
|
|
|
|
'clientMoniker', 'industryMap', 'businessStructuresMap', 'stateMap', 'countryMap','wechatGoodMcc',
|
|
|
|
|
function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, clientMoniker, industryMap, businessStructuresMap, stateMap, countryMap,wechatGoodMcc) {
|
|
|
|
|
if ($scope.partner_application) {
|
|
|
|
|
$scope.partner = angular.copy($scope.partner_application);
|
|
|
|
|
delete $rootScope.partner_application;
|
|
|
|
@ -3209,6 +3160,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.partner.client_pay_desc = [];
|
|
|
|
|
$scope.merchantIsValid = false;
|
|
|
|
|
$scope.merchantCodeChecked = false;
|
|
|
|
|
$scope.wechatMccIndustries = wechatGoodMcc.configs();
|
|
|
|
|
|
|
|
|
|
var resetClientPayDescByTpey = function (type) {
|
|
|
|
|
type = parseInt(type);
|
|
|
|
|
if (type == 1) {
|
|
|
|
@ -3395,6 +3348,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$scope.errmsg = null;
|
|
|
|
|
if (!$scope.partner.business_structure||$scope.partner.business_structure == '') {
|
|
|
|
|
alert('Please select the business structure');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($scope.partner.company_name.indexOf("Migration") != -1) {
|
|
|
|
|
alert("Company Name包含敏感词汇,请检查后重新提交!");
|
|
|
|
|
return;
|
|
|
|
@ -3439,10 +3396,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!$scope.partner.logo_url) {
|
|
|
|
|
alert("Logo is necessary!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// if (!$scope.partner.logo_url) {
|
|
|
|
|
// alert("Logo is necessary!");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
if ($scope.partner.client_pay_type.indexOf('2') >= 0) {
|
|
|
|
|
if (!$scope.partner.company_photo) {
|
|
|
|
|
alert('Shop Photo1 is necessary');
|
|
|
|
@ -5555,12 +5512,40 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('newApplyWxSubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog','wechatGoodMcc', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog,wechatGoodMcc) {
|
|
|
|
|
app.controller('newApplyWxSubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog','wechatGoodMcc','businessTypesMap', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog,wechatGoodMcc,businessTypesMap) {
|
|
|
|
|
$scope.wxIndustries = angular.copy(wxMerchantIndustries);
|
|
|
|
|
$scope.subMerchantInfo = angular.copy(subMerchantInfo);
|
|
|
|
|
$scope.subMerchantInfo.company_register_no=subMerchantInfo.abn?subMerchantInfo.abn:subMerchantInfo.acn;
|
|
|
|
|
$scope.wechatMccIndustries = wechatGoodMcc.configs();
|
|
|
|
|
$scope.merchantIds = merchantIds.data;
|
|
|
|
|
$scope.subMerchantInfo.industry = $filter('wxindustries')($scope.subMerchantInfo.industry);
|
|
|
|
|
$scope.businessTypesMap=businessTypesMap.configs();
|
|
|
|
|
if ($scope.subMerchantInfo.client_pay_type) {
|
|
|
|
|
if ($scope.subMerchantInfo.client_pay_type.indexOf('1') >= 0&&$scope.subMerchantInfo.client_pay_type.indexOf('2') >= 0) {
|
|
|
|
|
$scope.subMerchantInfo.business_type='BOTH';
|
|
|
|
|
}
|
|
|
|
|
else if ($scope.subMerchantInfo.client_pay_type.indexOf('1') >= 0) {
|
|
|
|
|
$scope.subMerchantInfo.business_type='ONLINE';
|
|
|
|
|
}
|
|
|
|
|
else if ($scope.subMerchantInfo.client_pay_type.indexOf('2') >= 0) {
|
|
|
|
|
$scope.subMerchantInfo.business_type='OFFLINE';
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
$scope.subMerchantInfo.business_type='BOTH';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($scope.subMerchantInfo.industry) {
|
|
|
|
|
$scope.subMerchantInfo.industry = $filter('newWxMerchantsFilter')($scope.subMerchantInfo.industry);
|
|
|
|
|
}
|
|
|
|
|
if($scope.subMerchantInfo.mc_code) {
|
|
|
|
|
$scope.subMerchantInfo.mcc_code =$scope.subMerchantInfo. mc_code;
|
|
|
|
|
}
|
|
|
|
|
if(subMerchantInfo.certificat_expire_date) {
|
|
|
|
|
var datestr = subMerchantInfo.certificat_expire_date.replace(/-/g, '/');
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date=new Date(datestr);
|
|
|
|
|
}
|
|
|
|
|
if($scope.subMerchantInfo.business_structure ){
|
|
|
|
|
$scope.subMerchantInfo.merchant_type=$scope.subMerchantInfo.business_structure == 'Company'? "ENTERPRISE":"INDIVIDUAL";
|
|
|
|
|
}
|
|
|
|
|
$scope.saveAppliy = function (form) {
|
|
|
|
|
$scope.errmsg = null;
|
|
|
|
|
if (form.$invalid) {
|
|
|
|
@ -5571,11 +5556,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var merchant_type = $scope.subMerchantInfo.business_structure == 'Company'? 1:2;
|
|
|
|
|
// var merchant_type = $scope.subMerchantInfo.business_structure == 'Company'? 1:2;
|
|
|
|
|
var params = {
|
|
|
|
|
company_name : $scope.subMerchantInfo.company_name,
|
|
|
|
|
merchant_id : $scope.subMerchantInfo.merchant_id,
|
|
|
|
|
store_name : $scope.subMerchantInfo.store_name,
|
|
|
|
|
short_name : $scope.subMerchantInfo.short_name,
|
|
|
|
|
office_phone : $scope.subMerchantInfo.office_phone,
|
|
|
|
|
contact_person : $scope.subMerchantInfo.contact_person,
|
|
|
|
|
contact_phone : $scope.subMerchantInfo.contact_phone,
|
|
|
|
@ -5583,18 +5568,29 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
contact_email : $scope.subMerchantInfo.contact_email,
|
|
|
|
|
industry : $scope.subMerchantInfo.industry,
|
|
|
|
|
company_website : $scope.subMerchantInfo.company_website,
|
|
|
|
|
merchant_type: merchant_type,
|
|
|
|
|
merchant_type: $scope.subMerchantInfo.merchant_type,
|
|
|
|
|
mcc_code : $scope.subMerchantInfo.mcc_code,
|
|
|
|
|
address: $scope.subMerchantInfo.address,
|
|
|
|
|
company_register_no: $scope.subMerchantInfo.company_register_no,
|
|
|
|
|
company_register_date: $scope.subMerchantInfo.company_register_date
|
|
|
|
|
business_type:$scope.subMerchantInfo.business_type
|
|
|
|
|
};
|
|
|
|
|
if(merchant_type == 1){
|
|
|
|
|
params.director_name = $scope.subMerchantInfo.representative_person;
|
|
|
|
|
params.director_id_number = $scope.subMerchantInfo.representative_person_id_number;
|
|
|
|
|
if(params.business_type=='ONLINE'){
|
|
|
|
|
params.address=null;
|
|
|
|
|
}
|
|
|
|
|
else if(params.business_type=='OFFLINE'){
|
|
|
|
|
params.company_website=null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(params.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.marketing_person;
|
|
|
|
|
params.principal_id_number = $scope.subMerchantInfo.marketing_person_id_number;
|
|
|
|
|
params.principal_name = $scope.subMerchantInfo.principal_name;
|
|
|
|
|
params.principal_id_number = $scope.subMerchantInfo.principal_id_number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/new_sub_apply', params).then(function (resp) {
|
|
|
|
@ -5630,12 +5626,28 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('updateApplyWxSubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog','wechatGoodMcc','merchantInfo', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog,wechatGoodMcc,merchantInfo) {
|
|
|
|
|
app.controller('updateApplyWxSubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog','wechatGoodMcc','merchantInfo', 'businessTypesMap',function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog,wechatGoodMcc,merchantInfo,businessTypesMap) {
|
|
|
|
|
$scope.wxIndustries = angular.copy(wxMerchantIndustries);
|
|
|
|
|
$scope.subMerchantInfo = angular.copy(subMerchantInfo.data);
|
|
|
|
|
$scope.merchantInfo = angular.copy(merchantInfo);
|
|
|
|
|
$scope.wechatMccIndustries = wechatGoodMcc.configs();
|
|
|
|
|
$scope.merchantIds = merchantIds.data;
|
|
|
|
|
$scope.businessTypesMap=businessTypesMap.configs();
|
|
|
|
|
|
|
|
|
|
if($scope.subMerchantInfo.business_structure ){
|
|
|
|
|
$scope.subMerchantInfo.merchant_type=$scope.subMerchantInfo.business_structure == 'Company'? "ENTERPRISE":"INDIVIDUAL";
|
|
|
|
|
}
|
|
|
|
|
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.certificat_expire_date) {
|
|
|
|
|
// var datestr = subMerchantInfo.certificat_expire_date.replace(/-/g, '/');
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date=new Date($scope.subMerchantInfo.certificat_expire_date);
|
|
|
|
|
}
|
|
|
|
|
$scope.updateApply = function (form) {
|
|
|
|
|
$scope.errmsg = null;
|
|
|
|
|
if (form.$invalid) {
|
|
|
|
@ -5649,7 +5661,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
var params = {
|
|
|
|
|
company_name : $scope.subMerchantInfo.company_name,
|
|
|
|
|
merchant_id : $scope.subMerchantInfo.merchant_id,
|
|
|
|
|
store_name : $scope.subMerchantInfo.store_name,
|
|
|
|
|
short_name : $scope.subMerchantInfo.short_name,
|
|
|
|
|
office_phone : $scope.subMerchantInfo.office_phone,
|
|
|
|
|
contact_person : $scope.subMerchantInfo.contact_person,
|
|
|
|
|
contact_phone : $scope.subMerchantInfo.contact_phone,
|
|
|
|
@ -5660,15 +5672,25 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
merchant_type: $scope.subMerchantInfo.merchant_type,
|
|
|
|
|
mcc_code : $scope.subMerchantInfo.mcc_code,
|
|
|
|
|
address: $scope.subMerchantInfo.address,
|
|
|
|
|
company_register_no: $scope.subMerchantInfo.company_register_no,
|
|
|
|
|
company_register_date: $scope.subMerchantInfo.company_register_date
|
|
|
|
|
business_type:$scope.subMerchantInfo.business_type
|
|
|
|
|
};
|
|
|
|
|
if($scope.subMerchantInfo.merchant_type == 1){
|
|
|
|
|
params.director_name = $scope.subMerchantInfo.representative_person;
|
|
|
|
|
params.director_id_number = $scope.subMerchantInfo.representative_person_id_number;
|
|
|
|
|
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.marketing_person;
|
|
|
|
|
params.principal_id_number = $scope.subMerchantInfo.marketing_person_id_number;
|
|
|
|
|
params.principal_name = $scope.subMerchantInfo.principal_name;
|
|
|
|
|
params.principal_id_number = $scope.subMerchantInfo.principal_id_number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$http.put('/sys/partners/' + $scope.merchantInfo.client_moniker + '/get_merchant_ids/'+$scope.subMerchantInfo.merchant_app_id, params).then(function (resp) {
|
|
|
|
@ -6591,10 +6613,22 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
return industry;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
//将保存的industry 和最新的分类比较,若查不到,返回空
|
|
|
|
|
app.filter('newWxMerchantsFilter', function () {
|
|
|
|
|
return function (values) {
|
|
|
|
|
var industry = null;
|
|
|
|
|
angular.forEach(wxMerchantIndustries, function (wxMerchant) {
|
|
|
|
|
if (wxMerchant.value == values) {
|
|
|
|
|
industry = wxMerchant.value;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return industry;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
app.filter('newWxMerchants', function () {
|
|
|
|
|
return function (values) {
|
|
|
|
|
var industry = '';
|
|
|
|
|
angular.forEach(newWxMerchantIndustries, function (wxMerchant) {
|
|
|
|
|
angular.forEach(wxMerchantIndustries, function (wxMerchant) {
|
|
|
|
|
if (wxMerchant.value == values) {
|
|
|
|
|
industry = wxMerchant.label;
|
|
|
|
|
}
|
|
|
|
@ -6751,5 +6785,22 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
return value + (tail || ' …');
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
app.filter('dateConversionStr',function () {
|
|
|
|
|
|
|
|
|
|
return function (date) {
|
|
|
|
|
var year = date.getFullYear(); //获取完整的年份(4位,1970-????)
|
|
|
|
|
var month =date.getMonth() + 1; //获取当前月份(0-11,0代表1月)
|
|
|
|
|
var day = date.getDate(); //获取当前日(1-31)
|
|
|
|
|
if (month < 10) {
|
|
|
|
|
month = "0" + month;
|
|
|
|
|
}
|
|
|
|
|
if (day < 10) {
|
|
|
|
|
day = "0" + day;
|
|
|
|
|
}
|
|
|
|
|
var dateString = year + "-" + month + "-" + day;
|
|
|
|
|
return dateString;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
return app;
|
|
|
|
|
});
|
|
|
|
|