master
luoyang 6 years ago
parent 49548f0137
commit 8c5e51982d

@ -3130,24 +3130,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}; };
$scope.applyRpaySubMerchantId = function () { $scope.applyRpaySubMerchantId = function () {
$uibModal.open({ $uibModal.open({
templateUrl: '/static/payment/partner/templates/apply_rpay_sub_merchant_id', templateUrl: '/static/payment/partner/templates/apply_rpay_sub_merchant_id.html',
controller: 'applyRpaySubMerchantIdCtrl', controller: 'applyRpaySubMerchantIdCtrl',
resolve: { resolve: {
subMerchantInfo: function () { subMerchantInfo: function () {
return $scope.partner; return $scope.partner;
}, }
merchantIds: ['$http', '$stateParams', function ($http) {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/registRpaySubMerchantId').then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Modify Rpay+ Sub Merchant ID successfully',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
}]
} }
}).result.then(function () { }).result.then(function () {
$scope.loadSubMerchantInfos(); $scope.loadSubMerchantInfos();
@ -3199,17 +3187,18 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}); });
} }
}, function (resp) { }, function (resp) {
$scope.errmsg = resp.data.message; commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}) })
} }
}]); }]);
app.controller('applyRpaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog) { app.controller('applyRpaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', 'businessStructuresMap','$filter', 'commonDialog','timezone', function ($scope, $http, $uibModal, $state, subMerchantInfo, businessStructuresMap,$filter, commonDialog,timezone) {
$scope.wxIndustries = angular.copy(wxMerchantIndustries); $scope.wxIndustries = angular.copy(wxMerchantIndustries);
$scope.subMerchantInfo = angular.copy(subMerchantInfo); $scope.subMerchantInfo = angular.copy(subMerchantInfo);
$scope.merchantIds = merchantIds.data;
$scope.subMerchantInfo.industry = $filter('wxindustries')($scope.subMerchantInfo.industry); $scope.subMerchantInfo.industry = $filter('wxindustries')($scope.subMerchantInfo.industry);
$scope.saveAppliy = function (form) { $scope.business_structures = businessStructuresMap.configs();
$scope.saveRpayAppliy = function (form) {
$scope.errmsg = null; $scope.errmsg = null;
if (form.$invalid) { if (form.$invalid) {
angular.forEach(form, function (item, key) { angular.forEach(form, function (item, key) {
@ -3223,29 +3212,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.apply_sub_merchant_id = resp.data; $scope.apply_sub_merchant_id = resp.data;
$scope.$close(); $scope.$close();
if (subMerchantInfo.sub_merchant_id != null) { if (subMerchantInfo.sub_merchant_id != null) {
commonDialog.confirm({title: 'Confirm', content: '已申请成功,是否确认使用'}).then(function () { commonDialog.alert({
$http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) { title: 'Success',
commonDialog.alert({ content: 'Modify Rpay+ Sub Merchant ID successfully',
title: 'Success', type: 'success'
content: 'Modify Wechat Sub Merchant ID successfully',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
})
} else {
$http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Apply Success And Modify Wechat Sub Merchant ID successfully',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}); });
$state.reload();
} }
}, function (resp) { }, function (resp) {
$scope.errmsg = resp.data.message; $scope.errmsg = resp.data.message;

@ -8,7 +8,7 @@
<div class="form-horizontal"> <div class="form-horizontal">
<div class="form-group" <div class="form-group"
ng-class="{'has-error':subForm.merchant_name.$invalid && subForm.merchant_name.$dirty}"> ng-class="{'has-error':subForm.merchant_name.$invalid && subForm.merchant_name.$dirty}">
<label class="control-label col-sm-3" for="merchant_name_input">* Merchant Name</label> <label class="control-label col-sm-3" for="merchant_name_input">* Company Name</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_name" <input class="form-control" ng-model="subMerchantInfo.company_name"
type="text" name="merchant_name" id="merchant_name_input" required maxlength="50"> type="text" name="merchant_name" id="merchant_name_input" required maxlength="50">
@ -21,30 +21,24 @@
<div class="form-group" <div class="form-group"
ng-class="{'has-error':subForm.merchant_id.$invalid && subForm.merchant_id.$dirty}"> ng-class="{'has-error':subForm.merchant_id.$invalid && subForm.merchant_id.$dirty}">
<label class="control-label col-sm-3" for="business_category_input">* Merchant ID</label> <label class="control-label col-sm-3" for="business_name_input">* Business Name</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" name="merchant_id" <input class="form-control" ng-model="subMerchantInfo.business_name"
ng-model="subMerchantInfo.merchant_id" type="text" name="business_name" id="business_name_input" required maxlength="50">
id="merchant_id_input" required <div ng-messages="subForm.business_name.$error" ng-if="subForm.business_name.$dirty">
ng-options="merchant_id.merchant_id as merchant_id.merchant_id for merchant_id in merchantIds">
<option value="">Please Choose</option>
</select>
<div ng-messages="subForm.merchant_id.$error" ng-if="subForm.merchant_id.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div> </div>
</div> </div>
<div ng-messages="subForm.business_category.$error" ng-if="subForm.business_category.$dirty">
<p class="small text-danger" ng-message="maxLength">More than 50</p>
</div>
</div> </div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error':subForm.merchant_shortname.$invalid && subForm.merchant_shortname.$dirty}"> ng-class="{'has-error':subForm.company_shortname.$invalid && subForm.company_shortname.$dirty}">
<label class="control-label col-sm-3" for="merchant_shortname_input">* Merchant Short Name</label> <label class="control-label col-sm-3" for="company_shortname_input">* Company Short Name</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.short_name" <input class="form-control" ng-model="subMerchantInfo.short_name"
type="text" name="merchant_shortname" id="merchant_shortname_input" required maxlength="50"> type="text" name="company_shortname" id="company_shortname_input" required maxlength="50">
<div ng-messages="subForm.merchant_shortname.$error" ng-if="subForm.merchant_shortname.$dirty"> <div ng-messages="subForm.company_shortname.$error" ng-if="subForm.company_shortname.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p> <p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div> </div>
@ -78,70 +72,167 @@
</div> </div>
</div> </div>
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div> <div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error':subForm.merchant_remark.$invalid && subForm.merchant_remark.$dirty}"> ng-class="{'has-error':subForm.description.$invalid && subForm.description.$dirty}">
<label class="control-label col-sm-3" for="merchant_remark_input">* Merchant Remark</label> <label class="control-label col-sm-3" for="description_input">* Company description</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.remark" <input class="form-control" ng-model="subMerchantInfo.description"
type="text" name="merchant_remark" id="merchant_remark_input" maxlength="20" required> type="text" name="description" id="description_input" required maxlength="256" MINLENGTH="10">
<div ng-messages="subForm.merchant_remark.$error" ng-if="subForm.merchant_remark.$dirty"> <div ng-messages="subForm.description.$error" ng-if="subForm.description.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 20</p> <p class="small text-danger" ng-message="maxlength">Length is more than 256</p>
<p class="small text-danger" ng-message="minlength">Length is less than 10</p>
</div> </div>
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group" ng-class="{'has-error':subForm.abn.$invalid && subForm.abn.$dirty}">
ng-class="{'has-error':subForm.merchant_introduction.$invalid && subForm.merchant_introduction.$dirty}"> <label class="control-label col-sm-3" for="abn_input">abn</label>
<label class="control-label col-sm-3" for="merchant_introduction_input">* Merchant Introduction</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.description" <input class="form-control" ng-model="subMerchantInfo.abn"
type="text" name="merchant_introduction" id="merchant_introduction_input" required maxlength="256" MINLENGTH="10"> type="text" name="abn" id="abn_input">
<div ng-messages="subForm.merchant_introduction.$error" ng-if="subForm.merchant_introduction.$dirty"> <div ng-messages="subForm.abn.$error" ng-if="subForm.abn.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 256</p> <p class="small text-danger" ng-message="maxlength">Length is more than 10</p>
<p class="small text-danger" ng-message="minlength">Length is less than 10</p> </div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.acn.$invalid && subForm.acn.$dirty}">
<label class="control-label col-sm-3" for="acn_input">acn</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.acn"
type="text" name="acn" id="acn_input">
<div ng-messages="subForm.acn.$error" ng-if="subForm.acn.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 10</p>
</div> </div>
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error':subForm.office_phone.$invalid && subForm.office_phone.$dirty}"> ng-class="{'has-error':subForm.business_structure.$invalid && subForm.business_structure.$dirty}">
<label class="control-label col-sm-3" for="office_phone_input">* Office Phone</label> <label class="control-label col-sm-2" for="business-structure-input">Business Structure</label>
<div class="col-sm-8">
<select class="form-control" name="business_structure" ng-model="subMerchantInfo.business_structure"
id="business-structure-input"
ng-options="structure.value as structure.label for structure in business_structures">
<option value="">Please Choose</option>
</select>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.company_phone.$invalid && subForm.company_phone.$dirty}">
<label class="control-label col-sm-3" for="company_phone_input">* Company Phone</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_phone" <input class="form-control" ng-model="subMerchantInfo.company_phone"
type="tel" name="office_phone" id="office_phone_input" required> type="tel" name="company_phone" id="company_phone_input" required>
<div ng-messages="subForm.office_phone.$error" ng-if="subForm.office_phone.$dirty"> <div ng-messages="subForm.company_phone.$error" ng-if="subForm.company_phone.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
</div> </div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group" ng-class="{'has-error':subForm.contact_name.$invalid && subForm.contact_name.$dirty}">
<label class="control-label col-sm-3" for="contact_name_input">Contact Name</label> <label class="control-label col-sm-3" for="contact_name_input">Contact Name</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.contact_person" <input class="form-control" ng-model="subMerchantInfo.contact_person"
type="text" name="contact_name" id="contact_name_input"> type="text" name="contact_name" id="contact_name_input">
<div ng-messages="subForm.contact_name.$error" ng-if="subForm.contact_name.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group" ng-class="{'has-error':subForm.contact_phone.$invalid && subForm.contact_phone.$dirty}">
<label class="control-label col-sm-3" for="contact_phone_input">Contact Phone</label> <label class="control-label col-sm-3" for="contact_phone_input">Contact Phone</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.contact_phone" <input class="form-control" ng-model="subMerchantInfo.contact_phone"
type="text" name="contact_phone" id="contact_phone_input"> type="text" name="contact_phone" id="contact_phone_input">
<div ng-messages="subForm.contact_phone.$error" ng-if="subForm.contact_phone.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group" ng-class="{'has-error':subForm.contact_email.$invalid && subForm.contact_email.$dirty}">
<label class="control-label col-sm-3" for="contact_email_input">Contact Email</label> <label class="control-label col-sm-3" for="contact_email_input">Contact Email</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.contact_email" <input class="form-control" ng-model="subMerchantInfo.contact_email"
type="text" name="contact_email" id="contact_email_input"> type="text" name="contact_email" id="contact_email_input">
<div ng-messages="subForm.contact_email.$error" ng-if="subForm.contact_email.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.company_country.$invalid && subForm.company_country.$dirty}">
<label class="control-label col-sm-3" for="company_country_input">Company country</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.country"
type="text" name="company_country" id="company_country_input">
<div ng-messages="subForm.company_country.$error" ng-if="subForm.company_country.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.company_address.$invalid && subForm.company_address.$dirty}">
<label class="control-label col-sm-3" for="company_address_input">Company address</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.address"
type="text" name="company_address" id="company_address_input">
<div ng-messages="subForm.company_address.$error" ng-if="subForm.company_address.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div>
</div> </div>
</div> </div>
<div class="form-group" ng-class="{'has-error':subForm.suburb.$invalid && subForm.suburb.$dirty}">
<label class="control-label col-sm-3" for="company_suburb_input">suburb</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.suburb"
type="text" name="suburb" id="company_suburb_input">
<div ng-messages="subForm.suburb.$error" ng-if="subForm.suburb.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 10</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.postcode.$invalid && subForm.postcode.$dirty}">
<label class="control-label col-sm-3" for="company_postcode_input">postCode</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.postcode"
type="text" name="postcode" id="company_postcode_input">
<div ng-messages="subForm.postcode.$error" ng-if="subForm.postcode.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 10</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.state.$invalid && subForm.state.$dirty}">
<label class="control-label col-sm-3" for="state_input">state</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.state"
type="text" name="state" id="state_input">
<div ng-messages="subForm.state.$error" ng-if="subForm.state.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 10</p>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -155,7 +246,7 @@
<!--end 商品二维码--> <!--end 商品二维码-->
<div class="btn-group margin-bottom margin-top"> <div class="btn-group margin-bottom margin-top">
<button class="btn btn-success" type="button" <button class="btn btn-success" type="button"
ng-click="saveAppliy(subForm)">Submit ng-click="saveRpayAppliy(subForm)">Submit
</button> </button>
</div> </div>
</div> </div>

Loading…
Cancel
Save