list.vm
16.9 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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
#set($page_title="服务管理")
#set($crumbs="首页:/home")
##详情
#set($url_show = "/diliService/show.do")
##查询地址
#set($url_list = "/diliService/list.do")
##添加
#set($url_save = "/diliService/preSave.do")
##删除
#set($url_del = "/diliService/del.do")
##上下架
#set($url_updateStatus = "/diliService/updateStatus.do")
<div class="row">
<div class="col-xs-12">
<div class="table-header">
服务列表
</div>
<div class="table-responsive">
<div id="sample-table-2_wrapper" class="dataTables_wrapper" role="grid">
<form action="$url_list" id="form" method="post">
<div class="row">
<div class="col-sm-6" style="width:100%">
<div id="sample-table-2_length" class="dataTables_length">
<input type="hidden" name="currPage" value="" />
<div class="row">
## <div class="col-xs-4">
## <div class="form-group">
## <label class="col-xs-3 control-label text-right">显示数量: </label>
## <div class="col-xs-9">
## #selectCount($!{model.query.pageSize})
## </div>
## </div>
## </div>
<div class="col-xs-4">
<div class="form-group">
<label class="col-xs-3 control-label text-right">服务名称: </label>
<div class="col-xs-9">
<input type="text" name="param[name]" value="$!{model.query.param.name}" class="form-control"/>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="form-group">
<label class="col-xs-3 control-label text-right">服务编码: </label>
<div class="col-xs-9">
<input type="text" name="param[code]" value="$!{model.query.param.code}" class="form-control"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-4">
<div class="form-group">
<label class="col-xs-3 control-label text-right">服务类型: </label>
<div class="col-xs-9">
<input type="radio" name="param[type]" value="" checked defaultItem="true">全部
<input type="radio" name="param[type]" value="1" #if($!{model.query.param.type} == 1) checked #end>独立服务
<input type="radio" name="param[type]" value="2" #if($!{model.query.param.type} == 2) checked #end>订单服务
<input type="radio" name="param[type]" value="3" #if($!{model.query.param.type} == 3) checked #end>通用服务
</div>
</div>
</div>
<div class="col-xs-4">
<div class="form-group">
<label class="col-xs-3 control-label text-right">服务类别: </label>
<div class="col-xs-9">
<input type="radio" name="param[cate]" value="" checked defaultItem="true">全部
<input type="radio" name="param[cate]" value="1" #if($!{model.query.param.cate} == 1) checked #end>采购服务
<input type="radio" name="param[cate]" value="2" #if($!{model.query.param.cate} == 2) checked #end>销售服务
<input type="radio" name="param[cate]" value="3" #if($!{model.query.param.cate} == 3) checked #end>通用服务
</div>
</div>
</div>
<div class="col-xs-4">
<div class="form-group">
<label class="col-xs-3 control-label text-right">上架状态: </label>
<div class="col-xs-9">
<input type="radio" name="param[status]" value="" checked defaultItem="true">全部
<input type="radio" name="param[status]" value="0" #if($!{model.query.param.status} == 0) checked #end>上架
<input type="radio" name="param[status]" value="1" #if($!{model.query.param.status} == 1) checked #end>下架
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-2 control-label text-right">上架时间: </label>
<div class="col-xs-10">
<input type="text" value="$!{model.query.param.startDate}" readonly onfocus="var d5222=$dp.$('d5222');WdatePicker({onpicked:function(){d5222.focus();},readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'d5222\')}'})" class="text-time" name="param[startDate]" id="d5221">
<input type="text" value="$!{model.query.param.endDate}" readonly onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true,minDate:'#F{$dp.$D(\'d5221\')}'})" class="text-time" name="param[endDate]" id="d5222">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-2 control-label text-right">下架时间: </label>
<div class="col-xs-10">
<input type="text" readonly value="$!{model.query.param.downStartDate}" onfocus="var d5322=$dp.$('d5322');WdatePicker({onpicked:function(){d5322.focus();},readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'d5322\')}'})" class="text-time" name="param[downStartDate]" id="d5321">
<input type="text" readonly value="$!{model.query.param.downEndDate}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true,minDate:'#F{$dp.$D(\'d5321\')}'})" class="text-time" name="param[downEndDate]" id="d5322">
</div>
</div>
</div>
</div>
</div>
<div class="clearfix">
<span class="pull-right">
<input type="submit" value="查询结果">
<input type="reset" value="重置条件" class="cleanForm">
</span>
</div>
</div>
</div>
</form>
</div>
<table id="sample-table-2" class="table table-striped table-bordered table-hover dataTable" aria-describedby="sample-table-2_info">
<thead>
<tr role="row">
## <th>id</th>
<th>服务名称</th>
<th>服务编码</th>
<th>服务类型</th>
<th>服务类别</th>
<th>在架日期</th>
<th>上架状态</th>
<th><i class="icon-time bigger-110 hidden-480"></i>操作</th>
</tr>
</thead>
<tbody role="alert" aria-live="polite" aria-relevant="all">
#foreach($obj in $!{model.list})
<tr>
## <td>
## $!{obj.id}
## </td>
<td>
<a href="$url_show?id=${obj.id}">
$!{obj.name}
</a>
</td>
<td>
<a href="$url_show?id=${obj.id}">
$!{obj.code}
</a>
</td>
<td>
#if($!{obj.type} == 1)
独立服务
#end
#if($!{obj.type} == 2)
订单服务
#end
#if($!{obj.type} == 3)
通用服务
#end
</td>
<td>
#if($!{obj.category} == 1)
采购服务
#end
#if($!{obj.category} == 2)
销售服务
#end
#if($!{obj.category} == 3)
通用服务
#end
</td>
<td>
$!{obj.dateScope}
</td>
<td>
#if(${obj.status} && $!{obj.status} == 1)
下架
#else
上架
#end
</td>
<td>
<div class="action-buttons">
<a href="$url_show?id=${obj.id}">
查看
</a>
<a class="green" href="${url_save}?id=${obj.id}">
<i class="fa fa-pencil "></i>修改
</a>
#if($!{obj.status} != 1)
<a class="green" href="javascript:;" onclick="serviceDown(${obj.id})">
<i class="fa fa-pencil "></i>下架
</a>
#else
<a class="green" href="javascript:;" onclick="serviceUp(${obj.id})">
<i class="fa fa-pencil "></i>上架
</a>
#end
## <a class="red" href="${url_del}?id=${obj.id}" onclick="return confirm('确定要删除!');">
## <i class="fa fa-trash "></i>删除
## </a>
</div>
</td>
</tr>
#end
</tbody>
</table>
<!-- Modal -->
<div class="modal fade" id="downModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form action="$url_updateStatus" method="post">
<div class="modal-body">
<div class="">
<label class="col-xs-3 control-label text-right" id="modelTxt"></label>
<div class="col-xs-9">
<input type="hidden" name="id" id="updateStaticId" value="$!{obj.id}">
<input type="hidden" name="status" value="0" id="modelStatus">
<input type="radio" name="type" value="0" checked><span id="now"></span>
<input type="radio" name="type" value="1" id="selfRadio">自定义
<input type="text" readonly name="date" onfocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false, minDate:'%y-%M-%d %H:%m:%s'});$('[type=radio][name=type]').get(1).checked=true" value="${newDate}" >
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">确定</button>
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
</div>
</div><!-- /.modal-content -->
</form>
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="row">
<div class="col-sm-6">
## <a href="$url_save" class="btn btn-success btn-sm ">添加</a>
</div>
<div class="col-sm-6">
<div class="dataTables_paginate paging_bootstrap">
<div class="pull-right">
#page($!{model.totalPage},$!{model.currPage})
</div>
<span class="pull-right" style="line-height: 33px;">
#set($tmpPage = $model.currPage + 1)
查询出$!{model.totalSize}条数据,共$!{model.totalPage}页,当前第$!{tmpPage}页
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script language="javascript" type="text/javascript" src="$!{webUtils.getCommonAssetsPath("common/date/WdatePicker.js")}"></script>
<script type="text/javascript">
jQuery(function($) {
$('table th input:checkbox').on('click' , function(){
var that = this;
$(this).closest('table').find('tr > td:first-child input:checkbox')
.each(function(){
this.checked = that.checked;
$(this).closest('tr').toggleClass('selected');
});
});
})
</script>
<script type="text/javascript">
function cleanForm(form) {
form.find("input[type=text]").each(function () {
var obj = $(this);
console.log(obj.val());
obj.attr("value", "");
});
form.find("input[type=radio],input[type=checkbox]").each(function () {
$(this).get(0).checked = false;
$(this).removeAttr("checked")
var di = $(this).attr("defaultItem");
if (di) {
$(this).attr("checked", "checked");
}
})
}
$(".cleanForm").click(function () {
cleanForm($("#form"));
})
function serviceUp(id){
$('#modelTxt').html('上架日期: ');
$('#modelStatus').attr("value", 0);
$('#updateStaticId').attr("value", id);
$("#now").html("立即上架");
$('#downModal').modal()
}
function serviceDown(id){
// var id = $(this).data("id");
$('#modelTxt').html('下架日期: ');
$('#modelStatus').attr("value", 1);
$('#updateStaticId').attr("value", id);
$("#now").html("立即下架");
$('#downModal').modal()
}
</script>
<script src="$!{webUtils.getAssetsPath("/js/diligrp.form.js")}"></script>