增加合伙人提成方式筛选,增加商户最低费率检测

master
yuan 7 years ago
parent c92c11a4d1
commit 41ec087b72

@ -1164,6 +1164,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
checkOrgPermission(manager, client); checkOrgPermission(manager, client);
int clientId = client.getIntValue("client_id"); int clientId = client.getIntValue("client_id");
JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
if (config == null) { if (config == null) {
throw new ForbiddenException(clientId + "费率参数配置不完整,请重新输入===>"); throw new ForbiddenException(clientId + "费率参数配置不完整,请重新输入===>");
} }
@ -1174,15 +1175,22 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
config.put("update_time", new Date()); config.put("update_time", new Date());
config.put("active_time", DateFormatUtils.format(config.getDate("active_time"), "yyyy-MM-dd")); config.put("active_time", DateFormatUtils.format(config.getDate("active_time"), "yyyy-MM-dd"));
config.put("expiry_time", DateFormatUtils.format(config.getDate("expiry_time"), "yyyy-MM-dd")); config.put("expiry_time", DateFormatUtils.format(config.getDate("expiry_time"), "yyyy-MM-dd"));
configNewClientRate(config, clientId, "Alipay", "alipay_rate_value");
configNewClientRate(config, clientId, "AlipayOnline", "alipayonline_rate_value"); checkAddRate(config,"Wechat", "wechat_rate_value",org,"min_wechat_rate");
configNewClientRate(config, clientId, "Wechat", "wechat_rate_value"); checkAddRate(config,"Alipay", "alipay_rate_value",org,"min_alipay_rate");
configNewClientRate(config, clientId, "jd", "jd_rate_value"); checkAddRate(config,"AlipayOnline", "alipayonline_rate_value",org,"min_alipayonline_rate");
configNewClientRate(config, clientId, "Bestpay", "bestpay_rate_value"); checkAddRate(config,"Bestpay", "bestpay_rate_value",org,"min_bestpay_rate");
checkAddRate(config,"jd", "jd_rate_value",org,"min_jd_rate");
configNewClientRate(config, clientId, "Wechat", "wechat_rate_value",org,"min_wechat_rate");
configNewClientRate(config, clientId, "Alipay", "alipay_rate_value",org,"min_alipay_rate");
configNewClientRate(config, clientId, "AlipayOnline", "alipayonline_rate_value",org,"min_alipayonline_rate");
configNewClientRate(config, clientId, "Bestpay", "bestpay_rate_value",org,"min_bestpay_rate");
configNewClientRate(config, clientId, "jd", "jd_rate_value",org,"min_jd_rate");
} }
private void configNewClientRate(JSONObject config, int clientId, String channel, String rateKey) { private void configNewClientRate(JSONObject config, int clientId, String channel, String rateKey,JSONObject org,String rateValueKey) {
if (config.containsKey(rateKey)) { if (config.containsKey(rateKey)) {
JSONObject newConfig = new JSONObject(); JSONObject newConfig = new JSONObject();
newConfig.putAll(config); newConfig.putAll(config);
@ -1210,6 +1218,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
checkOrgPermission(manager, client); checkOrgPermission(manager, client);
JSONObject configJson = config.toJSON(); JSONObject configJson = config.toJSON();
JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
checkModifyRate(org,configJson,"Wechat","min_wechat_rate");
checkModifyRate(org,configJson,"Alipay","min_alipay_rate");
checkModifyRate(org,configJson,"AlipayOnline","min_alipayonline_rate");
checkModifyRate(org,configJson,"jd","min_jd_rate");
checkModifyRate(org,configJson,"Bestpay","min_bestpay_rate");
configJson.put("client_rate_id", rateId); configJson.put("client_rate_id", rateId);
configJson.put("manager_id", manager.getString("manager_id")); configJson.put("manager_id", manager.getString("manager_id"));
configJson.put("manager_name", manager.getString("username")); configJson.put("manager_name", manager.getString("username"));
@ -1223,6 +1237,24 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
// clientMapper.updateCleanDays(clientId, config.getCleanDays()); // clientMapper.updateCleanDays(clientId, config.getCleanDays());
} }
private void checkModifyRate(JSONObject org,JSONObject configJson,String rateName,String rateValueKey){
if(configJson.getString("rate_name").equals(rateName)){
if(org.containsKey(rateValueKey)){
if(configJson.getDouble("rate_value").compareTo(org.getDouble(rateValueKey)) > 0){
throw new ForbiddenException("费率参数大于旗下商户最低"+rateName+"费率,请重新输入===>");
};
}
}
}
private void checkAddRate(JSONObject config,String channel, String rateKey,JSONObject org,String rateValueKey){
if(config.containsKey(rateKey)){
if(org.containsKey(rateValueKey)){
if(config.getBigDecimal(rateKey).compareTo(org.getBigDecimal(rateValueKey)) > 0){
throw new ForbiddenException("费率参数大于旗下商户最低"+channel+"费率,请重新输入===>");
};
}
}
}
@Override @Override
public List<JSONObject> listSubClients(JSONObject manager, String clientMoniker) { public List<JSONObject> listSubClients(JSONObject manager, String clientMoniker) {

@ -34,6 +34,12 @@ public class OrgInfo {
private int limit = 10; private int limit = 10;
private String parent_org_id; private String parent_org_id;
private String org_id; private String org_id;
private String commission_type;
private Double min_wechat_rate;
private Double min_alipay_rate;
private Double min_bestpay_rate;
private Double min_jd_rate;
private Double min_alipayonline_rate;
public JSONObject toJsonParam() { public JSONObject toJsonParam() {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
@ -229,4 +235,52 @@ public class OrgInfo {
public void setOrg_id(String org_id) { public void setOrg_id(String org_id) {
this.org_id = org_id; this.org_id = org_id;
} }
public String getCommission_type() {
return commission_type;
}
public void setCommission_type(String commission_type) {
this.commission_type = commission_type;
}
public Double getMin_wechat_rate() {
return min_wechat_rate;
}
public void setMin_wechat_rate(Double min_wechat_rate) {
this.min_wechat_rate = min_wechat_rate;
}
public Double getMin_alipay_rate() {
return min_alipay_rate;
}
public void setMin_alipay_rate(Double min_alipay_rate) {
this.min_alipay_rate = min_alipay_rate;
}
public Double getMin_bestpay_rate() {
return min_bestpay_rate;
}
public void setMin_bestpay_rate(Double min_bestpay_rate) {
this.min_bestpay_rate = min_bestpay_rate;
}
public Double getMin_jd_rate() {
return min_jd_rate;
}
public void setMin_jd_rate(Double min_jd_rate) {
this.min_jd_rate = min_jd_rate;
}
public Double getMin_alipayonline_rate() {
return min_alipayonline_rate;
}
public void setMin_alipayonline_rate(Double min_alipayonline_rate) {
this.min_alipayonline_rate = min_alipayonline_rate;
}
} }

@ -191,6 +191,8 @@ margin-bottom: 10%;"/>
ng-class="{'text-orange':!('10000000000'|withRole),'text-gray':('10000000000'|withRole)}"></i> ng-class="{'text-orange':!('10000000000'|withRole),'text-gray':('10000000000'|withRole)}"></i>
<i class="fa fa-tripadvisor" title="GUEST" <i class="fa fa-tripadvisor" title="GUEST"
ng-class="{'text-orange':!('100000000000'|withRole),'text-gray':('100000000000'|withRole)}"></i> ng-class="{'text-orange':!('100000000000'|withRole),'text-gray':('100000000000'|withRole)}"></i>
<i class="fa fa-user-plus" title="Org Manager"
ng-class="{'text-orange':!('1000000000000'|withRole),'text-gray':('1000000000000'|withRole)}"></i>
</small> </small>
</p> </p>
</li> </li>

@ -11,6 +11,13 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
"label": "推荐人", "label": "推荐人",
"value": 1 "value": 1
}]; }];
var commission_types = [{
"label": "渠道计算法",
"value": 1
}, {
"label": "收益比例",
"value": 3
}];
var app = angular.module('organizations', ['ui.router', 'ui.bootstrap']); var app = angular.module('organizations', ['ui.router', 'ui.bootstrap']);
app.config(['$stateProvider', function ($stateProvider) { app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('organizations', { $stateProvider.state('organizations', {
@ -43,7 +50,7 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}]); }]);
app.controller('orgsCtrl', ['$scope', '$http','commonDialog', function ($scope, $http,commonDialog ) { app.controller('orgsCtrl', ['$scope', '$http','commonDialog', function ($scope, $http,commonDialog ) {
$scope.params = {}; $scope.params = {};
if($scope.currentUser.org_id !=null && !angular.equals({}, $scope.currentUser.org_id)) { if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id) {
$scope.params.org_id = $scope.currentUser.org_id; $scope.params.org_id = $scope.currentUser.org_id;
} }
$scope.pagination = {}; $scope.pagination = {};
@ -80,8 +87,9 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}]); }]);
app.controller('orgDetailCtrl', ['$scope', '$http', '$state', 'Upload', '$uibModal','commonDialog', 'org', function ($scope, $http, $state, Upload,$uibModal,commonDialog, org) { app.controller('orgDetailCtrl', ['$scope', '$http', '$state', 'Upload', '$uibModal','commonDialog', 'org', function ($scope, $http, $state, Upload,$uibModal,commonDialog, org) {
$scope.types = angular.copy(types); $scope.types = angular.copy(types);
$scope.commission_types = angular.copy(commission_types);
$scope.org = angular.copy(org.data); $scope.org = angular.copy(org.data);
if ($scope.currentUser.org_id != null) { if (($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id) {
$scope.org.type = 0; $scope.org.type = 0;
} }
$scope.uploadLogo = function (file) { $scope.uploadLogo = function (file) {
@ -111,6 +119,9 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}); });
return; return;
} }
if($scope.org.type == 1){
$scope.org.commission_type = 2;
}
$http.put('/sys/orgs/' + $scope.org.org_id, $scope.org).then(function () { $http.put('/sys/orgs/' + $scope.org.org_id, $scope.org).then(function () {
commonDialog.alert({title: 'Succeed', content: 'Organization update succeeded', type: 'success'}); commonDialog.alert({title: 'Succeed', content: 'Organization update succeeded', type: 'success'});
$state.reload(); $state.reload();
@ -177,8 +188,9 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}]); }]);
app.controller('orgDetailParentCtrl', ['$scope', '$http', '$state', 'Upload', '$uibModal','commonDialog', 'org', function ($scope, $http, $state, Upload,$uibModal,commonDialog, org) { app.controller('orgDetailParentCtrl', ['$scope', '$http', '$state', 'Upload', '$uibModal','commonDialog', 'org', function ($scope, $http, $state, Upload,$uibModal,commonDialog, org) {
$scope.types = angular.copy(types); $scope.types = angular.copy(types);
$scope.commission_types = angular.copy(commission_types);
$scope.org = angular.copy(org.data); $scope.org = angular.copy(org.data);
if ($scope.currentUser.org_id != null) { if (($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id) {
$scope.org.type = 0; $scope.org.type = 0;
} }
$scope.uploadLogo = function (file) { $scope.uploadLogo = function (file) {
@ -274,6 +286,7 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}]); }]);
app.controller('newOrgCtrl', ['$scope', '$http', '$state', 'Upload', 'commonDialog', function ($scope, $http, $state, Upload, commonDialog) { app.controller('newOrgCtrl', ['$scope', '$http', '$state', 'Upload', 'commonDialog', function ($scope, $http, $state, Upload, commonDialog) {
$scope.types = angular.copy(types); $scope.types = angular.copy(types);
$scope.commission_types = angular.copy(commission_types);
$scope.uploadLogo = function (file) { $scope.uploadLogo = function (file) {
if (file == null) { if (file == null) {
return; return;
@ -301,7 +314,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}); });
return; return;
} }
if($scope.currentUser.org_id !=null && !angular.equals({}, $scope.currentUser.org_id)) { if($scope.org.type == 1){
$scope.org.commission_type = 2;
}
if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && $scope.currentUser.org_id) {
$scope.org.parent_org_id = angular.copy($scope.currentUser.org.org_id); $scope.org.parent_org_id = angular.copy($scope.currentUser.org.org_id);
$scope.org.type = '0'; $scope.org.type = '0';
} }

@ -65,7 +65,7 @@
</div> </div>
</div> </div>
<div class="form-group" ng-class="{'has-error':org_form.type.$invalid && org_form.type.$dirty}" <div class="form-group" ng-class="{'has-error':org_form.type.$invalid && org_form.type.$dirty}"
ng-show="!currentUser.org_id"> ng-show="!('1000000000000'|withRole)">
<label class="control-label col-sm-2" for="org_type_input">Type *</label> <label class="control-label col-sm-2" for="org_type_input">Type *</label>
<div class="col-sm-8"> <div class="col-sm-8">
<!--<select class="form-control" ng-model="org.type" ng-init="org.type=0" id="org_type_input">--> <!--<select class="form-control" ng-model="org.type" ng-init="org.type=0" id="org_type_input">-->
@ -79,6 +79,17 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group" ng-class="{'has-error':org_form.commission_type_0.$invalid && org_form.commission_type_0.$dirty}"
ng-show="org.type == 0 || ('1000000000000'|withRole)">
<label class="control-label col-sm-2" for="commission_type_0">Commission Type *</label>
<div class="col-sm-8">
<select class="form-control" name="commission_type_0" required ng-model="org.commission_type" id="commission_type_0"
ng-options="commission_type.value as commission_type.label for commission_type in commission_types"
ng-if="org.type == 0 || ('1000000000000'|withRole)">
<option value="">Please Choose</option>
</select>
</div>
</div>
<div ng-if="org.type == 1"> <div ng-if="org.type == 1">
<div class="form-group" <div class="form-group"
ng-class="{'has-error':org_form.rate_value.$invalid && org_form.rate_value.$dirty}"> ng-class="{'has-error':org_form.rate_value.$invalid && org_form.rate_value.$dirty}">
@ -89,7 +100,18 @@
</div> </div>
</div> </div>
</div> </div>
<div ng-if="org.type == 0 || currentUser.org_id !=null"> <div ng-if="org.type == 0 || ('1000000000000'|withRole) ">
<div ng-if="org.commission_type == 3">
<div class="form-group"
ng-class="{'has-error':org_form.rate_value.$invalid && org_form.rate_value.$dirty}">
<label class="control-label col-sm-2" for="rate_value_input_t">Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.rate_value"
id="rate_value_input_t" name="rate_value" max="100">
</div>
</div>
</div>
<div ng-if="org.commission_type == 1">
<div class="form-group" <div class="form-group"
ng-class="{'has-error':org_form.alipay_rate_value.$invalid && org_form.alipay_rate_value.$dirty}"> ng-class="{'has-error':org_form.alipay_rate_value.$invalid && org_form.alipay_rate_value.$dirty}">
<label class="control-label col-sm-2" for="alipay_rate_value_input">Alipay rate *</label> <label class="control-label col-sm-2" for="alipay_rate_value_input">Alipay rate *</label>
@ -128,13 +150,60 @@
<div class="form-group" <div class="form-group"
ng-class="{'has-error':org_form.alipayonline_rate_value.$invalid && org_form.alipayonline_rate_value.$dirty}"> ng-class="{'has-error':org_form.alipayonline_rate_value.$invalid && org_form.alipayonline_rate_value.$dirty}">
<label class="control-label col-sm-2" for="alipayonline_rate_value_input">alipayonline rate *</label> <label class="control-label col-sm-2" for="alipayonline_rate_value_input">Alipayonline Rate *</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.alipayonline_rate_value" <input class="form-control" type="number" ng-model="org.alipayonline_rate_value"
id="alipayonline_rate_value_input" name="alipayonline_rate_value" max="100"> id="alipayonline_rate_value_input" name="alipayonline_rate_value" max="100">
</div> </div>
</div> </div>
<div class="form-group"
ng-class="{'has-error':org_form.min_wechat_rate.$invalid && org_form.min_wechat_rate.$dirty}">
<label class="control-label col-sm-2" for="min_wechat_rate_input">Min Wechat Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_wechat_rate"
id="min_wechat_rate_input" name="min_wechat_rate" max="100">
</div>
</div>
</div>
<div>
<div class="form-group"
ng-class="{'has-error':org_form.min_alipay_rate.$invalid && org_form.min_alipay_rate.$dirty}">
<label class="control-label col-sm-2" for="min_alipay_rate_input">Min Alipay Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_alipay_rate"
id="min_alipay_rate_input" name="min_alipay_rate" max="100" required>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_bestpay_rate.$invalid && org_form.min_bestpay_rate.$dirty}">
<label class="control-label col-sm-2" for="min_bestpay_rate_input">Min Bestpay Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_bestpay_rate"
id="min_bestpay_rate_input" name="min_bestpay_rate" max="100" required>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_jd_rate.$invalid && org_form.min_jd_rate.$dirty}">
<label class="control-label col-sm-2" for="min_jd_rate_input">Min Jd Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_jd_rate"
id="min_jd_rate_input" name="min_jd_rate" max="100" required>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_alipayonline_rate.$invalid && org_form.min_alipayonline_rate.$dirty}">
<label class="control-label col-sm-2" for="min_alipayonline_rate_input">Min Alipayonline Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_alipayonline_rate"
id="min_alipayonline_rate_input" name="min_alipayonline_rate" max="100" required>
</div>
</div>
</div>
</div> </div>

@ -51,7 +51,7 @@
</div> </div>
</div> </div>
<div class="form-group" ng-class="{'has-error':org_form.type.$invalid && org_form.type.$dirty}" <div class="form-group" ng-class="{'has-error':org_form.type.$invalid && org_form.type.$dirty}"
ng-if="!currentUser.org_id"> ng-if="!('1000000000000'|withRole)">
<label class="control-label col-sm-2" for="org_type_input">Type *</label> <label class="control-label col-sm-2" for="org_type_input">Type *</label>
<div class="col-sm-8"> <div class="col-sm-8">
<!--<select class="form-control" ng-model="org.type" ng-init="org.type=0" id="org_type_input">--> <!--<select class="form-control" ng-model="org.type" ng-init="org.type=0" id="org_type_input">-->
@ -65,6 +65,16 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group" ng-class="{'has-error':org_form.commission_type_0.$invalid && org_form.commission_type_0.$dirty}"
ng-show="(org.type == 0) || ('1000000000000'|withRole)">
<label class="control-label col-sm-2" for="commission_type_0">Commission Type *</label>
<div class="col-sm-8">
<select class="form-control" name="commission_type_0" required ng-model="org.commission_type" id="commission_type_0"
ng-options="commission_type.value as commission_type.label for commission_type in commission_types">
<option value="">Please Choose</option>
</select>
</div>
</div>
<div ng-if="org.type == 1"> <div ng-if="org.type == 1">
<div class="form-group" ng-class="{'has-error':org_form.rate_value.$invalid && org_form.rate_value.$dirty}"> <div class="form-group" ng-class="{'has-error':org_form.rate_value.$invalid && org_form.rate_value.$dirty}">
<label class="control-label col-sm-2" for="rate_value_input">Rate *</label> <label class="control-label col-sm-2" for="rate_value_input">Rate *</label>
@ -75,6 +85,16 @@
</div> </div>
</div> </div>
<div ng-if="org.type == 0"> <div ng-if="org.type == 0">
<div ng-if="org.commission_type == 3">
<div class="form-group" ng-class="{'has-error':org_form.rate_value.$invalid && org_form.rate_value.$dirty}">
<label class="control-label col-sm-2" for="rate_value_input_3">Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.rate_value" id="rate_value_input_3" name="rate_value" max="100">
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
</div>
<div ng-if="org.commission_type == 1">
<div class="form-group" ng-class="{'has-error':org_form.alipay_rate_value.$invalid && org_form.alipay_rate_value.$dirty}"> <div class="form-group" ng-class="{'has-error':org_form.alipay_rate_value.$invalid && org_form.alipay_rate_value.$dirty}">
<label class="control-label col-sm-2" for="alipay_rate_value_input">Alipay Rate *</label> <label class="control-label col-sm-2" for="alipay_rate_value_input">Alipay Rate *</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -116,6 +136,93 @@
</div> </div>
</div> </div>
<div>
<div class="form-group"
ng-class="{'has-error':org_form.min_wechat_rate.$invalid && org_form.min_wechat_rate.$dirty}">
<label class="control-label col-sm-2" for="min_wechat_rate_input">Min Wechat Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_wechat_rate"
id="min_wechat_rate_input" name="min_wechat_rate" max="100">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_alipay_rate.$invalid && org_form.min_alipay_rate.$dirty}">
<label class="control-label col-sm-2" for="min_alipay_rate_input">Min Alipay Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_alipay_rate"
id="min_alipay_rate_input" name="min_alipay_rate" max="100">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_bestpay_rate.$invalid && org_form.min_bestpay_rate.$dirty}">
<label class="control-label col-sm-2" for="min_bestpay_rate_input">Min Bestpay Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_bestpay_rate"
id="min_bestpay_rate_input" name="min_bestpay_rate" max="100">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_jd_rate.$invalid && org_form.min_jd_rate.$dirty}">
<label class="control-label col-sm-2" for="min_jd_rate_input">Min Jd Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_jd_rate"
id="min_jd_rate_input" name="min_jd_rate" max="100">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_alipayonline_rate.$invalid && org_form.min_alipayonline_rate.$dirty}">
<label class="control-label col-sm-2" for="min_alipayonline_rate_input">Min Alipayonline Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_alipayonline_rate"
id="min_alipayonline_rate_input" name="min_alipayonline_rate" max="100">
</div>
</div>
</div>
</div>
<!-- <div ng-if="(org.type == 0 || currentUser.org_id !=null)">
<div class="form-group"
ng-class="{'has-error':org_form.min_alipay_rate.$invalid && org_form.min_alipay_rate.$dirty}">
<label class="control-label col-sm-2" for="min_alipay_rate_input">Min Alipay Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_alipay_rate"
id="min_alipay_rate_input" name="min_alipay_rate" max="100">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_bestpay_rate.$invalid && org_form.min_bestpay_rate.$dirty}">
<label class="control-label col-sm-2" for="min_bestpay_rate_input">Min Bestpay Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_bestpay_rate"
id="min_bestpay_rate_input" name="min_bestpay_rate" max="100">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_jd_rate.$invalid && org_form.min_jd_rate.$dirty}">
<label class="control-label col-sm-2" for="min_jd_rate_input">Min Jd Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_jd_rate"
id="min_jd_rate_input" name="min_jd_rate" max="100">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_alipayonline_rate.$invalid && org_form.min_alipayonline_rate.$dirty}">
<label class="control-label col-sm-2" for="min_alipayonline_rate_input">Min Alipayonline Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_alipayonline_rate"
id="min_alipayonline_rate_input" name="min_alipayonline_rate" max="100">
</div>
</div>
</div>-->
<div class="form-group" ng-class="{'has-error':org_form.contact_person.$invalid && org_form.contact_person.$dirty}"> <div class="form-group" ng-class="{'has-error':org_form.contact_person.$invalid && org_form.contact_person.$dirty}">
<label class="control-label col-sm-2" for="org_contact_person_input">Contact Person *</label> <label class="control-label col-sm-2" for="org_contact_person_input">Contact Person *</label>
<div class="col-sm-8"> <div class="col-sm-8">

@ -22,7 +22,7 @@
<div class="box box-warning"> <div class="box box-warning">
<div class="box-body"> <div class="box-body">
<uib-tabset> <uib-tabset>
<uib-tab heading="Basic Info"> <!-- <uib-tab heading="Basic Info">
<form class="form-horizontal margin-top" name="org_form" novalidate> <form class="form-horizontal margin-top" name="org_form" novalidate>
<div class="panel"> <div class="panel">
<div class="form-group" ng-class="{'has-error':org_form.name.$invalid && org_form.name.$dirty}"> <div class="form-group" ng-class="{'has-error':org_form.name.$invalid && org_form.name.$dirty}">
@ -53,6 +53,143 @@
<div class="form-group" ng-class="{'has-error':org_form.type.$invalid && org_form.type.$dirty}" <div class="form-group" ng-class="{'has-error':org_form.type.$invalid && org_form.type.$dirty}"
ng-if="!currentUser.org_id"> ng-if="!currentUser.org_id">
<label class="control-label col-sm-2" for="org_type_input">Type *</label> <label class="control-label col-sm-2" for="org_type_input">Type *</label>
<div class="col-sm-8">
&lt;!&ndash;<select class="form-control" ng-model="org.type" ng-init="org.type=0" id="org_type_input">&ndash;&gt;
&lt;!&ndash;<option value="0">代理人</option>&ndash;&gt;
&lt;!&ndash;<option value="1">推荐人</option>&ndash;&gt;
&lt;!&ndash;</select>&ndash;&gt;
<select class="form-control" name="type" required ng-model="org.type"
id="org_type_input"
ng-options="type.value as type.label for type in types">
&lt;!&ndash;<option value="">Please Choose</option>&ndash;&gt;
</select>
</div>
</div>
<div ng-if="org.type == 1">
<div class="form-group" ng-class="{'has-error':org_form.rate_value.$invalid && org_form.rate_value.$dirty}">
<label class="control-label col-sm-2" for="rate_value_input">Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.rate_value" id="rate_value_input" name="rate_value" max="100">
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
</div>
<div ng-if="org.type == 0">
<div class="form-group" ng-class="{'has-error':org_form.alipay_rate_value.$invalid && org_form.alipay_rate_value.$dirty}">
<label class="control-label col-sm-2" for="alipay_rate_value_input">Alipay Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.alipay_rate_value" id="alipay_rate_value_input" name="alipay_rate_value" max="100" readonly>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.wechat_rate_value.$invalid && org_form.wechat_rate_value.$dirty}">
<label class="control-label col-sm-2" for="wechat_rate_value_input">Wechat Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.wechat_rate_value" id="wechat_rate_value_input" name="wechat_rate_value" max="100" readonly>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.bestpay_rate_value.$invalid && org_form.bestpay_rate_value.$dirty}">
<label class="control-label col-sm-2" for="bestpay_rate_value_input">Bestpay Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.bestpay_rate_value" id="bestpay_rate_value_input" name="bestpay_rate_value" max="100" readonly>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.jd_rate_value.$invalid && org_form.jd_rate_value.$dirty}">
<label class="control-label col-sm-2" for="jd_rate_value_input">JD Pay Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.jd_rate_value" id="jd_rate_value_input" name="jd_rate_value" max="100" readonly>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.alipayonline_rate_value.$invalid && org_form.alipayonline_rate_value.$dirty}">
<label class="control-label col-sm-2" for="alipayonline_rate_value_input">AlipayOnline Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.alipayonline_rate_value" id="alipayonline_rate_value_input" name="alipayonline_rate_value" max="100" readonly>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.contact_person.$invalid && org_form.contact_person.$dirty}">
<label class="control-label col-sm-2" for="org_contact_person_input">Contact Person *</label>
<div class="col-sm-8">
<input class="form-control" ng-model="org.contact_person" id="org_contact_person_input" name="contact_person" required>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.contact_phone.$invalid && org_form.contact_phone.$dirty}">
<label class="control-label col-sm-2" for="org_contact_phone_input">Phone *</label>
<div class="col-sm-8">
<input class="form-control" ng-model="org.contact_phone" id="org_contact_phone_input" name="contact_phone" required>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.contact_mail.$invalid && org_form.contact_mail.$dirty}">
<label class="control-label col-sm-2" for="org_contact_mail_input">Mail *</label>
<div class="col-sm-8">
<input class="form-control" ng-model="org.contact_mail" id="org_contact_mail_input" name="contact_mail" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="commission_checkbox">Enable Commission</label>
<div class="col-sm-8">
<input id="commission_checkbox" type="checkbox" class="checkbox-inline checkbox" ng-model="org.commission" readonly
onclick="return false">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.remark.$invalid && org_form.remark.$dirty}">
<label class="control-label col-sm-2" for="remark-input">Remark</label>
<div class="col-sm-8">
<textarea class="form-control" ng-model="org.remark" name="remark"
id="remark-input" maxlength="500"></textarea>
</div>
</div>
</div>
<div class="btn-group margin-bottom margin-top">
<button class="btn btn-success" type="button" ng-click="update(org_form)">Save
</button>
<a class="btn btn-danger" role="button" ui-sref="^" ui-sref-opts="{reload:true}">Back</a>
</div>
&lt;!&ndash;<button class="btn btn-success col-sm-offset-2" ng-click="update()"><i class="fa fa-save"></i> Update</button>&ndash;&gt;
</form>
</uib-tab>-->
<uib-tab heading="Basic Info">
<form class="form-horizontal margin-top" name="org_form" novalidate>
<div class="panel">
<div class="form-group" ng-class="{'has-error':org_form.name.$invalid && org_form.name.$dirty}">
<label class="control-label col-sm-2" for="org_name_input">Name *</label>
<div class="col-sm-8">
<input class="form-control" ng-model="org.name" id="org_name_input" name="name" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Logo</label>
<div class="col-sm-8">
<p class="form-control-static">
<button class="btn btn-primary" type="button" ngf-select="uploadLogo($file)"
accept="image/*" ngf-max-size="1MB">
<i class="fa fa-upload"></i> Upload
</button>
<uib-progressbar value="logoProgress.value" ng-if="logoProgress"></uib-progressbar>
<img ng-src="{{org.logo}}" class="col-sm-3" ng-if="org.logo">
</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.location.$invalid && org_form.location.$dirty}">
<label class="control-label col-sm-2" for="org_location_input">Location *</label>
<div class="col-sm-8">
<input class="form-control" ng-model="org.location" id="org_location_input" name="location" required>
</div>
</div>
<div class="form-group" ng-class="{'has-error':org_form.type.$invalid && org_form.type.$dirty}"
ng-if="!('1000000000000'|withRole)">
<label class="control-label col-sm-2" for="org_type_input">Type *</label>
<div class="col-sm-8"> <div class="col-sm-8">
<!--<select class="form-control" ng-model="org.type" ng-init="org.type=0" id="org_type_input">--> <!--<select class="form-control" ng-model="org.type" ng-init="org.type=0" id="org_type_input">-->
<!--<option value="0">代理人</option>--> <!--<option value="0">代理人</option>-->
@ -65,6 +202,16 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group" ng-class="{'has-error':org_form.commission_type_0.$invalid && org_form.commission_type_0.$dirty}"
ng-show="(org.type == 0) || ('1000000000000'|withRole)">
<label class="control-label col-sm-2" for="commission_type_0">Commission Type *</label>
<div class="col-sm-8">
<select class="form-control" name="commission_type_0" required ng-model="org.commission_type" id="commission_type_0"
ng-options="commission_type.value as commission_type.label for commission_type in commission_types">
<option value="">Please Choose</option>
</select>
</div>
</div>
<div ng-if="org.type == 1"> <div ng-if="org.type == 1">
<div class="form-group" ng-class="{'has-error':org_form.rate_value.$invalid && org_form.rate_value.$dirty}"> <div class="form-group" ng-class="{'has-error':org_form.rate_value.$invalid && org_form.rate_value.$dirty}">
<label class="control-label col-sm-2" for="rate_value_input">Rate *</label> <label class="control-label col-sm-2" for="rate_value_input">Rate *</label>
@ -75,6 +222,16 @@
</div> </div>
</div> </div>
<div ng-if="org.type == 0"> <div ng-if="org.type == 0">
<div ng-if="org.commission_type == 3">
<div class="form-group" ng-class="{'has-error':org_form.rate_value.$invalid && org_form.rate_value.$dirty}">
<label class="control-label col-sm-2" for="rate_value_input_3">Rate *</label>
<div class="col-sm-8">
<input class="form-control form-control-float" type="number" ng-model="org.rate_value" id="rate_value_input_3" name="rate_value" max="100" readonly>
<span class="input-group-addon form-control-span">%</span>
</div>
</div>
</div>
<div ng-if="org.commission_type == 1">
<div class="form-group" ng-class="{'has-error':org_form.alipay_rate_value.$invalid && org_form.alipay_rate_value.$dirty}"> <div class="form-group" ng-class="{'has-error':org_form.alipay_rate_value.$invalid && org_form.alipay_rate_value.$dirty}">
<label class="control-label col-sm-2" for="alipay_rate_value_input">Alipay Rate *</label> <label class="control-label col-sm-2" for="alipay_rate_value_input">Alipay Rate *</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -116,6 +273,92 @@
</div> </div>
</div> </div>
<div>
<div class="form-group"
ng-class="{'has-error':org_form.min_wechat_rate.$invalid && org_form.min_wechat_rate.$dirty}">
<label class="control-label col-sm-2" for="min_wechat_rate_input">Min Wechat Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_wechat_rate"
id="min_wechat_rate_input" name="min_wechat_rate" max="10" readonly>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_alipay_rate.$invalid && org_form.min_alipay_rate.$dirty}">
<label class="control-label col-sm-2" for="min_alipay_rate_input">Min Alipay Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_alipay_rate"
id="min_alipay_rate_input" name="min_alipay_rate" max="10" readonly>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_bestpay_rate.$invalid && org_form.min_bestpay_rate.$dirty}">
<label class="control-label col-sm-2" for="min_bestpay_rate_input">Min Bestpay Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_bestpay_rate"
id="min_bestpay_rate_input" name="min_bestpay_rate" max="10" readonly>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_jd_rate.$invalid && org_form.min_jd_rate.$dirty}">
<label class="control-label col-sm-2" for="min_jd_rate_input">Min Jd Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_jd_rate"
id="min_jd_rate_input" name="min_jd_rate" max="10" readonly>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_alipayonline_rate.$invalid && org_form.min_alipayonline_rate.$dirty}">
<label class="control-label col-sm-2" for="min_alipayonline_rate_input">Min Alipayonline Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_alipayonline_rate"
id="min_alipayonline_rate_input" name="min_alipayonline_rate" max="10" readonly>
</div>
</div>
</div>
</div>
<!-- <div ng-if="(org.type == 0 || currentUser.org_id !=null)">
<div class="form-group"
ng-class="{'has-error':org_form.min_alipay_rate.$invalid && org_form.min_alipay_rate.$dirty}">
<label class="control-label col-sm-2" for="min_alipay_rate_input">Min Alipay Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_alipay_rate"
id="min_alipay_rate_input" name="min_alipay_rate" max="100">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_bestpay_rate.$invalid && org_form.min_bestpay_rate.$dirty}">
<label class="control-label col-sm-2" for="min_bestpay_rate_input">Min Bestpay Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_bestpay_rate"
id="min_bestpay_rate_input" name="min_bestpay_rate" max="100">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_jd_rate.$invalid && org_form.min_jd_rate.$dirty}">
<label class="control-label col-sm-2" for="min_jd_rate_input">Min Jd Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_jd_rate"
id="min_jd_rate_input" name="min_jd_rate" max="100">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':org_form.min_alipayonline_rate.$invalid && org_form.min_alipayonline_rate.$dirty}">
<label class="control-label col-sm-2" for="min_alipayonline_rate_input">Min Alipayonline Rate *</label>
<div class="col-sm-8">
<input class="form-control" type="number" ng-model="org.min_alipayonline_rate"
id="min_alipayonline_rate_input" name="min_alipayonline_rate" max="100">
</div>
</div>
</div>-->
<div class="form-group" ng-class="{'has-error':org_form.contact_person.$invalid && org_form.contact_person.$dirty}"> <div class="form-group" ng-class="{'has-error':org_form.contact_person.$invalid && org_form.contact_person.$dirty}">
<label class="control-label col-sm-2" for="org_contact_person_input">Contact Person *</label> <label class="control-label col-sm-2" for="org_contact_person_input">Contact Person *</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -137,8 +380,7 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" for="commission_checkbox">Enable Commission</label> <label class="control-label col-sm-2" for="commission_checkbox">Enable Commission</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input id="commission_checkbox" type="checkbox" class="checkbox-inline checkbox" ng-model="org.commission" readonly <input id="commission_checkbox" type="checkbox" class="checkbox-inline checkbox" ng-model="org.commission">
onclick="return false">
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group"
@ -158,16 +400,6 @@
<!--<button class="btn btn-success col-sm-offset-2" ng-click="update()"><i class="fa fa-save"></i> Update</button>--> <!--<button class="btn btn-success col-sm-offset-2" ng-click="update()"><i class="fa fa-save"></i> Update</button>-->
</form> </form>
</uib-tab> </uib-tab>
<!-- <uib-tab heading="Permission" ng-if="org.type == 0">
<form class="form-horizontal margin-top" name="org_permission_form">
<div class="form-group">
<label class="col-xs-4 col-sm-2 control-label">Client Rate Editable</label>
<div class="col-xs-8 col-sm-8">
<input type="checkbox" ng-model="org.rate_editable" bs-switch switch-change="toggleRateEditable()">
</div>
</div>
</form>
</uib-tab>-->
</uib-tabset> </uib-tabset>
</div> </div>
</div> </div>

Loading…
Cancel
Save