複製程式碼如下:
<%@ 頁面語言=“java” contentType=“text/html; 字元集=utf-8”
頁面編碼=“utf-8”%>
<%
字串路徑 = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+路徑+“/”;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<頭>
<title>查詢系統</title>
<link rel="stylesheet" type="text/css"
href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
href="http://www.jeasyui.com/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css"
href="http://www.jeasyui.com/easyui/demo/demo.css">
<腳本類型=“文字/javascript”
src =“http://code.jquery.com/jquery-1.6.min.js”></腳本>
<腳本類型=“文字/javascript”
src =“http://www.jeasyui.com/easyui/jquery.easyui.min.js”></腳本>
<腳本類型=“文字/javascript”
src="http://www.jeasyui.com/easyui/datagrid-detailview.js"></script>
<script src="<%=basePath %>js/jquery.confirm.js"></script>
<link rel="stylesheet" href="<%=basePath %>css/jquery.confirm.css">
<樣式類型=“文字/css”>
形式 {
保證金:0;
填充:0;
}
.dv-表 td {
邊框:0;
}
.dv-表輸入{
邊框:1px實心#ccc;
}
</風格>
</頭>
<正文>
<表id=“dg”
樣式=“寬度:1200px;高度:590px”url=“<%=basePath%>findSubsByPage.action”
工具列=“#toolbar”分頁=“true”rownumbers=“true”
fitColumns="true" singleSelect="true">
<標題>
<tr>
<th field="tel">聯絡方式</th>
<th field="name">心肌</th>
<th field="nametype">裝潢名稱</th>
<th field="orderTime">預訂時間</th>
<th field="content">備註內容</th>
<th field="sex">性別</th>
<th field="nowTime">提交時間</th>
<!-- <th field="status">狀態</th> -->
</tr>
</標題>
</表>
<div id="工具列">
<div id="工具列">
<a href="javascript:void(0)" iconCls="icon-remove" plain="true" onclick="destroyUser()">刪除訂單</a>
<a href="javascript:void(0)" id="unorder">未成交訂單</a> <a
href="javascript:void(0)" id="order">已成交訂單</a> <a href="javascript:void(0)"
class="easyui-linkbutton" id="ok">成交</a>
</div>
</div>
<表>
<tr>
<td colspan="1"></td>
</tr>
</表>
<腳本類型=“文字/javascript”>
$(函數() {
$("#unorder").click(function() {
var url = "../findSubsByPage.action";
$.post(網址, {
狀態:0
}, 功能() {
$('#dg').datagrid('重新載入');
});
});
$("#order").click(function() {
var url = "../findSubsByPage.action";
$.post(網址, {
狀態:1
}, 功能() {
$('#dg').datagrid('重新載入');
});
});
$("#ok").click(function() {
var url = "../updateSub.action";
var row = $('#dg').datagrid('getSelected');
var elem = $(this).closest('.item');
如果(行!=空){
$.確認({
'title' : '操作確認提示',
'message' : '您確認要進行此成交操作嗎?
「按鈕」:{
'是的' : {
'類':'藍色',
'動作':函數(){
elem.slideUp();
$.post(網址, {
id : 行.id
}, 功能() {
$('#dg').datagrid('重新載入');
});
}
},
'不' : {
'類':'灰色',
'動作':函數(){
}
}
}
});
} 別的 {
Alert("您未選取任何資訊!");
}
});
設定間隔(函數(){
$('#dg').datagrid('重新載入');
}, 60000);
});
函數 destroyUser() {
var row = $('#dg').datagrid('getSelected');
如果(行){
$.messager.confirm('操作提示',
'您確定要刪除此訂單嗎?
函數(r){
如果(r){
$.post('../deleteSub.action', {
id : 行.id
}, 函數(結果) {
if (結果.成功) {
$('#dg').datagrid('重新載入'); // 重新載入使用者數據
} 別的 {
$.messager.show({ // 顯示錯誤訊息
標題:'錯誤',
msg : 結果.errorMsg
});
}
}, 'json');
}
});
}
}
</腳本>
<腳本語言=“JavaScript”>
函數 myrefresh()
{
window.location.reload();
}
setTimeout('myrefresh()',3000000); //指定5秒刷新一次
</腳本>
<樣式類型=“文字/css”>
#fm{
保證金:0;
內邊距:10px 30px;
}
.f標題{
字體大小:14px;
字體粗細:粗體;
內邊距:5px 0;
底部邊距:10px;
邊框底部:1px 實線#ccc;
}
.fitem {
下邊距:5px;
}
.fitem標籤{
顯示:內聯塊;
寬度:80px;
}
</風格>
</正文>
</html>