dictOfDjxlList.jsp
5.32 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>机构所属登记小类管理</title>
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(document).ready(function() {
$("tbody > tr").bind("click",function(){
if($(this).find('input:checkbox').is(':checked')){
$(this).removeClass("trBgcolor");
$(this).find('input:checkbox').prop('checked', false);
}else{
$(this).find('input:checkbox').prop('checked', true);
$(this).addClass("trBgcolor");
}
});
var djxlStrList = "${djxlStrList}";
djxlStrList = djxlStrList.substring(1, djxlStrList.length-1);
var djxlStrListArr = [];
djxlStrListArr = djxlStrList.split(",");
var currentViewDjxlArr = [];
$("tbody > tr").each(function(i){
currentViewDjxlArr.push($(this).find('input:checkbox').val());
});
//alert("currentViewDjxlArr: "+currentViewDjxlArr+" ; djxlStrListArr: "+djxlStrListArr);
for(var i=0;i<currentViewDjxlArr.length;i++){
for(var j=0;j<djxlStrListArr.length;j++){
if(currentViewDjxlArr[i] == djxlStrListArr[j].replace(" ","")){
$("#"+currentViewDjxlArr[i]).attr("checked",true);
$("#"+currentViewDjxlArr[i]).parent().parent().addClass("trBgcolor");
}
}
}
});
//CheckBox 全选 |注意:当checkbox disabled时不能进行操作
function selectAll(){
var a = document.getElementsByTagName("input");
for(var i = 0;i<a.length;i++){
if(a[i].type == "checkbox" && a[i].disabled != true){
a[i].checked = true;
}
}
$("tbody > tr").each(function(i){
$(this).addClass("trBgcolor");
});
}
//全不选择 |注意:当checkbox disabled时不能进行操作
function unselectAll(){
var a = document.getElementsByTagName("input");
for(var i = 0;i<a.length;i++){
if(a[i].type == "checkbox" && a[i].disabled != true){
a[i].checked = false;
}
}
$("tbody > tr").each(function(i){
$(this).removeClass("trBgcolor");
});
}
function djxlOfficeSubmit(){
var chk_value =[];
$('input[name="djxl"]:checked').each(function(){
chk_value.push($(this).val());
});
if(chk_value.length == 0){
alert('你还没有选择任何登记小类!');
chk_value =[];
return;
}
var chk_value_str = chk_value.join("-");
$.ajax({
type:"POST",
url:"${ctx}/sys/setdjxl/sysDjxlOffice/savebat",
cache: false,
data:"chk_value_str="+ chk_value_str +"&officeid=${officeid}",
async : false,
success:function(modelmap){
if(modelmap.issucess == 1){
//预留给父页面写上或者弹出提示的话语,比如当前您选择了****的业务
alert("您当前选择了登记业务小类:"+chk_value_str);
//然后关闭当前弹出的子页面
window.close();
}
}
});
//alert(chk_value_str);
//document.inputForms.action = "${ctx}/sys/setdjxl/sysDjxlOffice/savebat?chk_value_str="+ chk_value_str +"&officeid=${officeid}";
//document.inputForms.submit();
}
</script>
</head>
<body>
<!-- <div> -->
<%-- <form:form id="inputForms" name="inputForms" modelAttribute="sysDjxlOffice" action="${ctx}/sys/setdjxl/sysDjxlOffice/listofdjxlquery" class="breadcrumb form-search"> --%>
<!-- <li><label>标签内容:</label> -->
<%-- <form:input path="label" id = "labelid" htmlEscape="false" maxlength="28" class="input-medium"/> --%>
<!-- </li> -->
<!-- <li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="选择"/></li> -->
<%-- </form:form> --%>
<!-- </div> -->
<form:form id="inputForms" name="inputForms" modelAttribute="sysDjxlOffice" action="${ctx}/sys/setdjxl/sysDjxlOffice/save" method="post" class="breadcrumb form-search">
<input id="btnSubmit" class="btn btn-primary" type="button" value="保 存" onclick="javascript:djxlOfficeSubmit();"/>
<input id="btnSelectAll" class="btn btn-primary" type="button" value="全 选" onclick="javascript:selectAll();"/>
<input id="btnunSelectAll" class="btn btn-primary" type="button" value="全不选" onclick="javascript:unselectAll();"/>
<span class="help-inline">当前机构:;选择下面列表中的业务登记小类,作为本机构用户在初审可以办理的业务小类;可全选或者单个选;</span>
<br><br>
<table id="contentTable" class="table table-bordered table-condensed">
<thead><tr><th>键值</th><th>标签</th><th>选择该机构所属小类</th></tr></thead>
<tbody>
<c:forEach items="${djxlList}" var="djxlDict">
<tr>
<td><label>${djxlDict.value}</label></td>
<td><label>${djxlDict.label}</label></td>
<td><input id="${djxlDict.value}" name="djxl" value="${djxlDict.value}" class="" type="checkbox"/></td>
</tr>
</c:forEach>
</tbody>
</table>
<input id="btnSubmit" class="btn btn-primary" type="button" value="保 存" onclick="javascript:djxlOfficeSubmit();"/>
<input id="btnSelectAll" class="btn btn-primary" type="button" value="全 选" onclick="javascript:selectAll();"/>
<input id="btnunSelectAll" class="btn btn-primary" type="button" value="全不选" onclick="javascript:unselectAll();"/>
</form:form>
</body>
</html>