ratio_list.html
2.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<include file="public@header"/>
</head>
<body>
<div style="padding: 100px 100px 10px;">
<form class="bs-example bs-example-form" role="form" method="post" action="{:url('Ratio/ratio_list')}" onsubmit="return checked()">
<div class="input-group" style="width: 100px;">
<span class="input-group-addon">平台订单</span>
</div>
<br>
<div class="input-group">
<span class="input-group-addon">业务员佣金比例:</span>
<input type="text" name="salesman_ratio" class="form-control" value="{$data.salesman_ratio}" >
</div>
<br>
<div class="input-group">
<span class="input-group-addon">老师佣金比例:</span>
<input type="text" name="teacher_ratio" class="form-control" value="{$data.teacher_ratio}">
</div>
<br>
<div class="input-group" style="width: 100px;">
<span class="input-group-addon">业务员订单</span>
</div>
<br>
<div class="input-group">
<span class="input-group-addon">平台抽成比例:</span>
<input type="text" name="platform_ratio" class="form-control" value="{$data.platform_ratio}" >
</div>
<br>
<div class="input-group">
<span class="input-group-addon">业务员订单快递费:</span>
<input type="text" name="courier" class="form-control" value="{$data.courier}" >
</div>
<br>
<button type="submit" class="btn btn-default" >确定</button>
</form>
</div>
</body>
<script>
/**
* 当点击提交时
*/
function checked(){
salesman_ratio = $("input[name='salesman_ratio']").val();
teacher_ratio = $("input[name='teacher_ratio']").val();
$money = Number(salesman_ratio)+Number(teacher_ratio);
console.log($money);
if($money >= 1){
alert('业务员佣金比例和老师佣金比例之和不能大于1');
return false;
}
}
</script>
</html>