Js universal order code

  • 2020-03-30 01:02:11
  • OfStack

 
<%@ page language="java" contentType="text/html; charset=utf-8" 
pageEncoding="utf-8"%> 
<% 
String path = request.getContextPath(); 
String basePath = request.getScheme() + "://" 
+ request.getServerName() + ":" + request.getServerPort() 
+ path + "/"; 
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<title> Query system </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"> 
<script type="text/javascript" 
src="http://code.jquery.com/jquery-1.6.min.js"></script> 
<script type="text/javascript" 
src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script> 
<script type="text/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"> 

<style type="text/css"> 
form { 
margin: 0; 
padding: 0; 
} 

.dv-table td { 
border: 0; 
} 

.dv-table input { 
border: 1px solid #ccc; 
} 
</style> 
</head> 
<body> 
<table id="dg" title=" Reservation decoration management " class="easyui-datagrid" 
style="width: 1200px; height: 590px" url="<%=basePath%>findSubsByPage.action" 
toolbar="#toolbar" pagination="true" rownumbers="true" 
fitColumns="true" singleSelect="true"> 
<thead> 
<tr> 
<th field="tel" width="40"> contact </th> 
<th field="name" width="20"> The contact </th> 
<th field="nametype" width="30"> Decorate a name </th> 
<th field="orderTime" width="50"> Reservation time </th> 
<th field="content" width="50"> Note the content </th> 
<th field="sex" width="20"> gender </th> 
<th field="nowTime" width="50"> Submit time </th> 
<!-- <th field="status" width="10"> state </th> --> 

</tr> 
</thead> 
</table> 
<div id="toolbar"> 
<div id="toolbar"> 
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="destroyUser()"> Delete the order </a> 
<a href="javascript:void(0)" class="easyui-linkbutton" id="unorder"> Outstanding order </a> <a 
href="javascript:void(0)" class="easyui-linkbutton" id="order"> Completed order </a> <a href="javascript:void(0)" 
class="easyui-linkbutton" id="ok"> Clinch a deal </a> 
</div> 
</div> 
<table> 
<tr> 
<td colspan="1"></td> 
</tr> 
</table> 
<script type="text/javascript"> 
$(function() { 
$("#unorder").click(function() { 
var url = "../findSubsByPage.action"; 
$.post(url, { 
status : 0 
}, function() { 
$('#dg').datagrid('reload'); 
}); 
}); 
$("#order").click(function() { 
var url = "../findSubsByPage.action"; 
$.post(url, { 
status : 1 
}, function() { 
$('#dg').datagrid('reload'); 
}); 
}); 
$("#ok").click(function() { 
var url = "../updateSub.action"; 
var row = $('#dg').datagrid('getSelected'); 
var elem = $(this).closest('.item'); 
if (row != null) { 
$.confirm({ 
'title' : ' Operation confirmation prompt ', 
'message' : ' You confirm that you want to proceed with this transaction ?', 
'buttons' : { 
'Yes' : { 
'class' : 'blue', 
'action' : function() { 
elem.slideUp(); 
$.post(url, { 
id : row.id 
}, function() { 
$('#dg').datagrid('reload'); 
}); 
} 
}, 
'No' : { 
'class' : 'gray', 
'action' : function() { 

} 
} 
} 
}); 
} else { 
alert(" You did not select any information !"); 
} 
}); 
setInterval(function() { 
$('#dg').datagrid('reload'); 
}, 60000); 
}); 
function destroyUser() { 
var row = $('#dg').datagrid('getSelected'); 
if (row) { 
$.messager.confirm(' Operating hints ', 
' You are sure to delete this order ?', 
function(r) { 
if (r) { 
$.post('../deleteSub.action', { 
id : row.id 
}, function(result) { 
if (result.success) { 
$('#dg').datagrid('reload'); // reload the user data 
} else { 
$.messager.show({ // show error message 
title : 'Error', 
msg : result.errorMsg 
}); 
} 
}, 'json'); 
} 
}); 
} 
} 
</script> 
<script language="JavaScript"> 
function myrefresh() 
{ 
window.location.reload(); 
} 
setTimeout('myrefresh()',3000000); //Specifies a 5 second refresh
</script> 
<style type="text/css"> 
#fm { 
margin: 0; 
padding: 10px 30px; 
} 

.ftitle { 
font-size: 14px; 
font-weight: bold; 
padding: 5px 0; 
margin-bottom: 10px; 
border-bottom: 1px solid #ccc; 
} 

.fitem { 
margin-bottom: 5px; 
} 

.fitem label { 
display: inline-block; 
width: 80px; 
} 
</style> 
</body> 
</html> 

Related articles: