lis1t.jsp
4.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
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
<%@page import="com.framework.util.PropertiesLoader"%>
<%@page import="com.google.common.base.Objects"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>统计分析列表</title>
<jsp:include page="../../template/head.jsp"></jsp:include>
<style>
.datagrid-cell{
height: auto;
}
#pf-hd{
height:70px;
position:relative;
z-index:2;
background-color:#321752;
}
#pf-hd .pf-logo{
float:left;
height:100%;
width:230px;
line-height:70px;
}
#pf-hd .pf-logo img{
margin-left:-10px;
}
</style>
</head>
<body>
<div class="container">
<form id="searchForm">
<div id="tt" class="easyui-tabs" style="width: 100%;">
<table id="dg" style="width:100%;height:554px"
title="经营范围列表" data-options="
rownumbers:true,
singleSelect:false,
autoRowHeight:false,
pagination:true,
fitColumns:true,
striped:true,
collapsible:true,
toolbar:'#tb',
pageSize:10">
<thead>
<tr>
<th field="id" checkbox="true"></th>
<th field="." formatter="editFormat" width="16">编辑</th>
<th field="parName" width="50">统计分析</th>
<th field="parCode" width="50">进出标识</th>
</tr>
</thead>
</table>
<div id="tb" style="padding:0 30px;" ms-controller="container">
<label>统计分析:</label>
<!-- <input class="easyui-textbox" type="text" name="parName" id="parName"
style="width:160px;height:35px;line-height:35px;"/> -->
<!-- <a href="javascript:doSearch()" class="easyui-linkbutton" iconCls="icon-search"
data-options="selected:true">查询</a> -->
<a id="add" href="<%=request.getContextPath()%>/goods/edit" class="easyui-linkbutton add"
iconCls="icon-add">新增</a>
<a href="javascript:doDelete()" class="easyui-linkbutton delete" iconCls="icon-remove">删除</a>
<!-- <a id="" href="javascript:doSend()" class="easyui-linkbutton" iconCls="icon-redo">发送海关</a> -->
</div>
</div>
</form>
</div>
<script>
//定义 avalon
var datavm = avalon.define({
$id: "container"
});
function pagerFilter(data) {
if (data.data) {
data = data.data;
}
return data;
}
function doDelete() {
var rows = $('#dg').datagrid('getChecked');
if (rows.length == 0) {
$.messager.alert("提示", "请先选中要删除的行!");
return false;
}
$.messager.confirm("提示", "确定要删除么?", function (r) {
if (r) {
var ids = '';
for (var i = 0; i < rows.length; i++) {
if (ids == '') {
ids = rows[i].id;
} else {
ids += ',' + rows[i].id;
}
}
var par = {};
par.ids = ids;
$.post("<%=request.getContextPath()%>/rest/goods/delete", par, function (data) {
if (data.status == 200) {
window.location.href="<%=request.getContextPath()%>/goods/list";
} else {
$.messager.alert("提示", data.msg);
}
});
}
});
}
function editFormat(val, row, index) {
var html = '<a href="javascript:void(0)" style="text-decoration:none;" onclick="editRow(' + row.id + ')"><i class="iconfont"></i></a>';
return html;
}
function editRow(id) {
window.location.href = '<%=request.getContextPath() %>/goods/edit?id=' + id;
}
function doSearch() {
$('#dg').datagrid("options").queryParams = clearJson($("#searchForm").serializeJson());
$('#dg').datagrid("reload");
}
$(function () {
$('#dg').datagrid({
url: '<%=request.getContextPath()%>/rest/goods/findByType',
queryParams: {parType:5},
pagination: true,
rownumbers: true,
loadFilter: pagerFilter
});
});
</script>
</body>
</html>