sknRebateEdit.html
3.5 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<div id="sknRebateEditDiv">
<form id="sknRebateEditForm" name="sknRebateEditForm" method="post">
<table cellspacing="0" border="0" align="center" style="width:90%;margin-top:0px;line-height:10px;height:200px;" id="sknRebateEditTable">
<tr>
<td width="30%" align="left">SKN :</span></td>
<td width="70%" align="left" colspan="3">
<input class="inputParam easyui-textbox" style="width:200px" id="skn" name="skn" />
</td>
</tr>
<tr>
<td width="30%" align="left">返佣比例:</span></td>
<td width="35%" align="left" colspan="2">
<input type="radio" value="1" name="type" style="width:20px" checked >品牌比例</input>
<input type="radio" value="2" name="type" style="width:20px">自定义</input>
</td>
<td width="35%" align="left">
<input class="inputParam easyui-textbox" id="rebateStr" style="width: 100px;" data-options="prompt:'0.0 ~ 25.0'" hidden>
<span style="margin-left:-15px">%</span>
</td>
</tr>
<tr>
<td width="30%" align="left">返佣状态:</span></td>
<td width="70%" align="left" colspan="3">
<input type="radio" value="1" name="state" style="width:20px" checked >品牌状态</input>
<input type="radio" value="2" name="state" style="width:20px">开启</input>
<input type="radio" value="3" name="state" style="width:20px">关闭</input>
</td>
</tr>
</table>
</form>
</div>
<script>
$(function(){
var sknTextBox = $("#sknRebateEditDiv #skn");
sknTextBox.textbox('textbox').bind('keyup', function () {
sknTextBox.textbox('setValue', $(this).val().replace(/[^\d]/g, ""));
});
var rebatTextBox = $("#rebateStr");
rebatTextBox.textbox('textbox').bind('keyup', function() {
var tempValue = $(this).val();
var value = tempValue.replace(/[^\d.]/g,"")
.replace(/^(\-)*(\d+)\.(\d).*$/,'$1$2.$3');
rebatTextBox.textbox('setValue',value);
});
rebatTextBox.textbox('readonly',true);
$('input[type=radio][name=type]').change(function() {
if (this.value == '1') {
rebatTextBox.textbox("setValue", "");
rebatTextBox.textbox('readonly',true);
} else {
rebatTextBox.textbox('readonly',false);
}
});
var data = window.self.paramObject.sknRebateData;
if (data){
sknTextBox.textbox('readonly',true);
sknTextBox.textbox("setValue", data.skn);
if(data.type == 1){
$(":radio[name='type'][value='1']").prop("checked",true);
}else if(data.type == 2){
rebatTextBox.textbox('readonly',false);
$(":radio[name='type'][value='2']").prop("checked",true);
}
if(data.state == 1){
$(":radio[name='state'][value='1']").prop("checked",true);
}else if(data.state == 2){
$(":radio[name='state'][value='2']").prop("checked",true);
}else {
$(":radio[name='state'][value='3']").prop("checked",true);
}
if(data.rebate != 0) {
rebatTextBox.textbox("setValue", data.rebate / 100);
}
}
})
</script>