fix subpartner 同步商户编码

master
luoyang 5 years ago
parent 793cbbf02d
commit cd0f90d3ad

@ -2784,10 +2784,20 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} else {
$scope.partner = {timezone: 'Australia/Melbourne'};
}
$scope.initMerchantCode = function () {
$http.get('/sys/partners/init/merchant_code').then(function (response) {
$scope.partner.client_moniker = response.data;
$scope.merchantCodeChecked = true;
$scope.merchantIsValid = true;
});
};
$scope.initMerchantCode();
$scope.partner.company_phone_c = 61;
$scope.partner.contact_phone_c = 61;
$scope.partner.client_pay_type = [];
$scope.partner.client_pay_desc = [];
$scope.merchantIsValid = false;
$scope.merchantCodeChecked = false;
var resetClientPayDescByTpey = function (type) {
type = parseInt(type);
if (type == 1) {
@ -2914,6 +2924,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.timezones = timezone.configs();
$scope.states = stateMap.configs();
$scope.countries = countryMap.configs();
$scope.checkMerchantCodeIsValid = function (code) {
if (code.length != 4) {
$scope.merchantCodeChecked = false;
$scope.merchantIsValid = false;
return;
}
$http.get('/sys/partners/init/check_code_isvalid',{params:{clientMoniker:code}}).then(function (response) {
$scope.merchantIsValid = response.data;
$scope.merchantCodeChecked = true;
});
};
$scope.saveSubPartner = function (form) {
if (form.$invalid) {
angular.forEach(form, function (item, key) {

@ -25,8 +25,14 @@
<div class="col-sm-8">
<input class="form-control text-uppercase" ng-model="partner.client_moniker"
type="text"
style="display:inline;width:20%"
name="client_moniker"
id="short-id-input" required maxlength="4" ng-pattern="/^[a-zA-Z0-9]+$/">
id="short-id-input" required maxlength="4" ng-pattern="/^[a-zA-Z0-9]+$/" ng-change="checkMerchantCodeIsValid(partner.client_moniker)">
<a style="display: inline-block" role="button" ng-click="initMerchantCode()"><i class="fa fa-refresh" title="Refreshes the partner code"></i></a>
<span ng-if="merchantCodeChecked">
<i ng-if="merchantIsValid" class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none;padding-left: 20px"></i>
<i ng-if="!merchantIsValid" class="text-danger fa fa-close" style="float: none;padding-left: 20px"></i>
</span>
<p class="small text-info">No further changeable!</p>
<div ng-messages="partnerForm.client_moniker.$error"
ng-if="partnerForm.client_moniker.$dirty">

Loading…
Cancel
Save