8b190a738ebe861b5c93f0dcb7c36ad6e4a44967.svn-base
7.8 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<%@ 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() {
//$("#name").focus();
$("#inputForm").validate({
submitHandler: function(form){
loading('正在提交,请稍等...');
form.submit();
},
errorContainer: "#messageBox",
errorPlacement: function(error, element) {
$("#messageBox").text("输入有误,请先更正。");
if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
error.appendTo(element.parent().parent());
} else {
error.insertAfter(element);
}
}
});
//readonly有个问题就是下拉框控制不了;disabled可以满足当前页面要求
views();
});
function addRow(list, idx, tpl, row, isnew){
var ids = "${proid}";
$(list).append(Mustache.render(tpl, {
idx: idx, delBtn: true, row: row,ids:ids
}));
$(list+idx).find("select").each(function(){
$(this).val($(this).attr("data-value"));
});
$(list+idx).find("input[type='text']").each(function(){
if(isnew == '1'){
$(this).val(1);
}
});
for(var i=0;i<150;i++){
$("#ycslSjclList"+i+"_sort").val(i+1);
}
$(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
var ss = $(this).attr("data-value").split(',');
for (var i=0; i<ss.length; i++){
if($(this).val() == ss[i]){
$(this).attr("checked","checked");
}
}
});
}
function delRow(obj, prefix){
var id = $(prefix+"_id");
var delFlag = $(prefix+"_delFlag");
if (id.val() == ""){
$(obj).parent().parent().remove();
}else if(delFlag.val() == "0"){
delFlag.val("1");
$(obj).html("撤销删除").attr("title", "撤销删除");
$(obj).parent().parent().addClass("error");
}else if(delFlag.val() == "1"){
delFlag.val("0");
$(obj).html("删 除").attr("title", "删除");
$(obj).parent().parent().removeClass("error");
}
}
//readonly有个问题就是下拉框控制不了;disabled可以满足当前页面要求
function views(){
var viewid = "${VIEWS}";
if(viewid == undefined || viewid == null || viewid ==""){
return;
}
$("input:not(:button,:submit,:hidden),select,textarea").attr("disabled","disabled");
}
</script>
</head>
<body>
<ul class="nav nav-tabs">
<li class="active"><a href="#">收件信息${not empty ycslSjcl.id?'修改':'添加'}查看</a></li>
</ul><br/>
<form:form id="inputForm" modelAttribute="ycslSj" action="${ctx}/ycsl/ycslSj/save" method="post" class="form-horizontal">
<form:hidden path="id"/>
<form:hidden path="proid" value="${proid}"/>
<sys:message content="${message}"/>
<fieldset>
<table class="table-form">
<tr>
<td class="tit">收件时间</td>
<td>
<!-- 更新 -->
<c:if test="${not empty ycslSj.id}">
<input name="sjsj" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
value="<fmt:formatDate value="${ycslSj.sjsj}" pattern="yyyy-MM-dd"/>"
onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});"/>
</c:if>
<!-- 新增 -->
<c:if test="${empty ycslSj.id}">
<input name="sjsj" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
value="${fns:getDate('yyyy-MM-dd')}"
onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});"/>
</c:if>
<span class="help-inline"><font color="red">*</font> </span>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>收件详细信息</legend>
<div class="">
<table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th class="hide"></th>
<th>序号</th>
<th>收件类型</th>
<th>收件名称</th>
<th>收件数量</th>
<th>页数</th>
<th>附件</th>
<th width="100">操 作 </th>
</tr>
</thead>
<tbody id="ycslSjclList">
</tbody>
<tfoot>
<c:if test="${empty view}">
<tr><td colspan="11"><a href="javascript:void(0);" onclick="addRow('#ycslSjclList', ycslSjclRowIdx, ycslSjclTpl, null,'1');ycslSjclRowIdx = ycslSjclRowIdx + 1;" class="btn">新增</a></td></tr>
</c:if>
</tfoot>
</table>
<script type="text/template" id="ycslSjclTpl">//<!--
<tr id="ycslSjclList{{idx}}">
<td class="hide">
<input id="ycslSjclList{{idx}}_id" name="ycslSjclList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
<input id="ycslSjclList{{idx}}_delFlag" name="ycslSjclList[{{idx}}].delFlag" type="hidden" value="0"/>
</td>
<td width="40">
<input id="ycslSjclList{{idx}}_sort" name="ycslSjclList[{{idx}}].sort" style="width:30px" type="text" value="{{row.sort}}" class="input-small "/>
</td>
<td width="100">
<select id="ycslSjclList{{idx}}_cllx" name="ycslSjclList[{{idx}}].cllx" data-value="{{row.cllx}}" class="input-small ">
<option value="2">${fns:getDictLabel('2', 'reg_bus_sjlxyf', '')}</option>
<c:forEach items="${fns:getDictList('reg_bus_sjlxyf')}" var="dict">
<option value="${dict.value}">${dict.label}</option>
</c:forEach>
</select>
</td>
<td width="470">
<select id="ycslSjclList{{idx}}_clmc" name="ycslSjclList[{{idx}}].clmc" style="width:460px" data-value="{{row.clmc}}" class="input-small ">
<option value="1">${fns:getDictLabel('1', 'reg_bus_fwsjmc_zy', '')}</option>
<c:forEach items="${fns:getDictList('reg_bus_fwsjmc_zy')}" var="dict">
<option value="${dict.value}">${dict.label}</option>
</c:forEach>
</select>
</td>
<td width="50">
<input id="ycslSjclList{{idx}}_fs" name="ycslSjclList[{{idx}}].fs" type="text" style="width:40px" value="{{row.fs}}" maxlength="4" class=""/>
</td>
<td width="40">
<input id="ycslSjclList{{idx}}_ys" name="ycslSjclList[{{idx}}].ys" type="text" style="width:30px" value="{{row.ys}}" maxlength="4" class=""/>
</td>
<c:if test="${empty view}">
<td>
<input id="ycslSjclList{{idx}}_sjcllj" name="ycslSjclList[{{idx}}].sjcllj" type="hidden" value="{{row.sjcllj}}" maxlength="100"/>
<sys:ckfinder input="ycslSjclList{{idx}}_sjcllj" type="files" ywType="sjxx" uploadPath="/reg/bus/ycslSjcl/{{ids}}" selectMultiple="true"/>
</td>
</c:if>
<c:if test="${not empty view}">
<td>
<input id="ycslSjclList{{idx}}_sjcllj" name="ycslSjclList[{{idx}}].sjcllj" type="hidden" value="{{row.sjcllj}}" maxlength="100"/>
<sys:ckfinder input="ycslSjclList{{idx}}_sjcllj" type="files" readonly="true" uploadPath="/reg/bus/ycslSjcl/{{ids}}" selectMultiple="true"/>
</td>
</c:if>
<td class="text-center" width="10">
{{#delBtn}}<a class="btn btn-primary" onclick="delRow(this, '#ycslSjclList{{idx}}')" title="删除">删 除</a>{{/delBtn}}
</td>
</tr>//-->
</script>
<script type="text/javascript">
var ycslSjclRowIdx = 0, ycslSjclTpl = $("#ycslSjclTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
$(document).ready(function() {
var data = ${fns:toJson(ycslSj.ycslSjclList)};
for (var i=0; i<data.length; i++){
addRow('#ycslSjclList', ycslSjclRowIdx, ycslSjclTpl, data[i], '0');
ycslSjclRowIdx = ycslSjclRowIdx + 1;
}
});
</script>
</div>
</fieldset>
<div class="form-actions">
<c:if test="${empty view}">
<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
</c:if>
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="javascript:window.close();"/>
</div>
</form:form>
</body>
</html>