@layout("/common/_container.html"){
|
<div class="row">
|
<div class="col-sm-12">
|
<div class="ibox float-e-margins">
|
<div class="ibox-title">
|
<h5>抽成规则</h5>
|
</div>
|
<div class="ibox-content">
|
<div class="row row-lg">
|
<div class="col-sm-12">
|
|
<input hidden="hidden" id="type" value="${type}">
|
<input hidden="hidden" id="branchOfficeId" value="${branchOfficeId}">
|
|
<div class="initialLevel col-sm-12 control-label form-group" >
|
<div class="initialLevel col-sm-3 control-label form-group" >
|
<label class="control-label" >分公司抽成设置:</label>
|
</div>
|
</div>
|
|
@if(roleType == 1){
|
<div class="initialLevel col-sm-12 control-label form-group" style="text-align: left" >
|
<div class="initialLevel col-sm-3 control-label form-group" >
|
<span class="control-label" >司机订单保险费,每单固定抽取</span>
|
<input class="control-label" id="num1" name="num1" value="${num1}" type="number" min="0" style="height: 30px;width: 80px">
|
<span class="control-label" >元</span>
|
</div>
|
</div>
|
@}
|
|
<div class="switch-container">
|
@if(type == 1){
|
<button class="switch-btn active" value="1" onclick="switchTab(this, '包月')">包月</button>
|
@}
|
@if(type == 2){
|
<button class="switch-btn active" value="2" onclick="switchTab(this, '按单')">按单</button>
|
@}
|
</div>
|
|
@if(type == 1){
|
<div id="month" class="initialLevel col-sm-12 control-label form-group" style="text-align: left" >
|
<div class="initialLevel col-sm-3 control-label form-group" >
|
<span class="control-label" >抽成,每月平台抽取分公司</span>
|
<input class="control-label" id="num2" name="num2" value="${num2}" type="number" min="0" style="height: 30px;width: 80px">
|
<span class="control-label" >元</span>
|
</div>
|
</div>
|
@}
|
@if(type == 2){
|
<div id="monad" class="initialLevel col-sm-12 control-label form-group" style="text-align: left" >
|
<div class="initialLevel col-sm-3 control-label form-group" >
|
<span class="control-label" >抽成,每单平台抽取分公司</span>
|
<input class="control-label" id="num3" name="num3" value="${num3}" type="number" min="0" style="height: 30px;width: 80px">
|
<span class="control-label" >元</span>
|
</div>
|
</div>
|
@}
|
<div class="initialLevel col-sm-12 control-label form-group" >
|
<div class="initialLevel col-sm-3 control-label form-group" >
|
<label class="control-label" >代检车抽成设置:</label>
|
</div>
|
</div>
|
@if(roleType == 1){
|
<div class="initialLevel col-sm-12 control-label form-group" style="text-align: left" >
|
<div class="initialLevel col-sm-3 control-label form-group" >
|
<span class="control-label" >每单抽取分公司</span>
|
<input class="control-label" id="num5" name="num5" value="${num5!}" type="number" min="0" style="height: 30px;width: 80px">
|
<span class="control-label" >元</span>
|
</div>
|
</div>
|
@}
|
<div class="row btn-group-m-t">
|
<div class="col-sm-10" style="text-align: center">
|
<#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TSystemConfig.extractionRulesSubmit()"/>
|
</div>
|
</div>
|
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<script src="${ctxPath}/static/modular/system/tBranchOffice/tSystemConfig.js"></script>
|
<style>
|
.switch-container {
|
display: flex;
|
margin: 20px;
|
border-radius: 4px;
|
overflow: hidden;
|
width: fit-content;
|
}
|
|
.switch-btn {
|
padding: 8px 20px;
|
cursor: pointer;
|
border: none;
|
background: #f0f0f0;
|
color: #666;
|
transition: all 0.3s ease;
|
font-size: 14px;
|
}
|
|
.switch-btn.active {
|
background: #409EFF;
|
color: white;
|
}
|
|
/* 去除按钮之间的边框 */
|
.switch-btn:not(:last-child) {
|
border-right: 1px solid #ddd;
|
}
|
|
/* 鼠标悬停效果 */
|
.switch-btn:hover:not(.active) {
|
background: #e0e0e0;
|
}
|
</style>
|
<script>
|
function switchTab(element, type) {
|
// 切换按钮状态
|
document.querySelectorAll('.switch-btn').forEach(btn => {
|
btn.classList.remove('active');
|
});
|
element.classList.add('active');
|
console.log(element)
|
console.log(type)
|
|
// 根据类型显示或隐藏模块
|
if (type == '包月') {
|
document.getElementById('month').style.display = 'block';
|
document.getElementById('monad').style.display = 'none';
|
$("#type").val(1)
|
} else if (type == '按单') {
|
document.getElementById('month').style.display = 'none';
|
document.getElementById('monad').style.display = 'block';
|
$("#type").val(2)
|
}
|
|
}
|
$("input[name=num1]").bind('input',function(){
|
var value = $(this).val()
|
regexp(value)
|
})
|
$("input[name=num2]").bind('input',function(){
|
var value = $(this).val()
|
regexp(value)
|
})
|
$("input[name=num3]").bind('input',function(){
|
var value = $(this).val()
|
regexp(value)
|
})
|
$("input[name=num4]").bind('input',function(){
|
var value = $(this).val()
|
regexp(value)
|
})
|
// function regexp(value){
|
// var reg=/^[1-9]\d*$/;//由 1-9开头 的正则表达式
|
// //先判断是否为整数 在判断 是否在 1-总页 整数范围之内
|
// if(reg.test(value)){
|
// if(parseInt(value) <= 0){
|
// Feng.error("请输入大于0的正整数");
|
// return;
|
// }
|
// }else{
|
// Feng.error("请输入大于0的正整数");
|
// return;
|
// }
|
// }
|
function regexp(value){
|
var reg=/^(\d+.?)?\d{0,2}$/;//由 1-9开头 的正则表达式 整数
|
var reg1 = /^(([1-9]{1}\d*)|(0{1}))(\.\d{2})$/; // 两位小数
|
//先判断是否为整数 在判断 是否在 1-总页 整数范围之内
|
if(reg.test(value)){
|
if(value == 0){
|
Feng.error("请输入大于0的整数或保留两位小数");
|
return;
|
}
|
}else{
|
Feng.error("请输入整数或保留两位小数");
|
return;
|
}
|
}
|
</script>
|
@}
|