源码网,源码论坛,源码之家,商业源码,游戏源码下载,discuz插件,棋牌源码下载,精品源码论坛

 找回密码
 立即注册
楼主: ttx9n

[JavaScript] js 通用订单代码

[复制链接]

7万

主题

861

回帖

32万

积分

论坛元老

Rank: 8Rank: 8

积分
329525
发表于 2013-12-23 17:31:40 | 显示全部楼层 |阅读模式
对于订单,想必大家并不陌生吧,下为大家介绍下使用js实现的订单,感兴趣的朋友可以参考下 复制代码 代码如下:
<%@ 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>查询系统</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="预订装修管理" 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">联系方式</th>
<th field="name" width="20">联系人</th>
<th field="nametype" width="30">装修名称</th>
<th field="orderTime" width="50">预订时间</th>
<th field="content" width="50">备注内容</th>
<th field="sex" width="20">性别</th>
<th field="nowTime" width="50">提交时间</th>
<!-- <th field="status" width="10">状态</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()">删除订单</a>
<a href="javascript:void(0)" class="easyui-linkbutton" id="unorder">未成交订单</a> <a
href="javascript:void(0)" class="easyui-linkbutton" id="order">已成交订单</a> <a href="javascript:void(0)"
class="easyui-linkbutton" id="ok">成交</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' : '操作确认提示',
'message' : '您确认要进行此成交操作?',
'buttons' : {
'Yes' : {
'class' : 'blue',
'action' : function() {
elem.slideUp();
$.post(url, {
id : row.id
}, function() {
$('#dg').datagrid('reload');
});
}
},
'No' : {
'class' : 'gray',
'action' : function() {

}
}
}
});
} else {
alert("您未选中任何信息!");
}
});
setInterval(function() {
$('#dg').datagrid('reload');
}, 60000);
});
function destroyUser() {
var row = $('#dg').datagrid('getSelected');
if (row) {
$.messager.confirm('操作提示',
'您确定要删除此条订单?',
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); //指定5秒刷新一次
</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>
回复

使用道具 举报

6

主题

1万

回帖

174

积分

注册会员

Rank: 2

积分
174
发表于 2022-8-14 00:54:19 | 显示全部楼层
需要很久了终于找到了
回复 支持 反对

使用道具 举报

0

主题

2万

回帖

0

积分

中级会员

Rank: 3Rank: 3

积分
0
发表于 2022-10-29 06:42:29 | 显示全部楼层
了乐趣了去了去了去了去了
回复 支持 反对

使用道具 举报

0

主题

2万

回帖

0

积分

中级会员

Rank: 3Rank: 3

积分
0
发表于 2023-9-11 01:28:44 | 显示全部楼层
哈哈哈哈哈哈
回复 支持 反对

使用道具 举报

1

主题

2万

回帖

93

积分

注册会员

Rank: 2

积分
93
发表于 2023-9-12 08:12:44 | 显示全部楼层
谢谢您的分享!
回复 支持 反对

使用道具 举报

3

主题

2万

回帖

301

积分

中级会员

Rank: 3Rank: 3

积分
301
发表于 2023-12-1 22:55:22 | 显示全部楼层
天天源码社区。。。。
回复 支持 反对

使用道具 举报

6

主题

1万

回帖

174

积分

注册会员

Rank: 2

积分
174
发表于 2024-4-3 00:06:31 | 显示全部楼层
哈哈哈哈哈哈
回复 支持 反对

使用道具 举报

3

主题

2万

回帖

172

积分

注册会员

Rank: 2

积分
172
发表于 2024-8-14 13:11:25 | 显示全部楼层
有什么好的服务器
回复 支持 反对

使用道具 举报

1

主题

1万

回帖

51

积分

注册会员

Rank: 2

积分
51
发表于 2024-8-31 02:11:31 | 显示全部楼层
66666666666
回复 支持 反对

使用道具 举报

0

主题

2万

回帖

61

积分

注册会员

Rank: 2

积分
61
发表于 2024-9-16 22:43:06 | 显示全部楼层
撒旦撒旦撒擦擦擦擦
回复 支持 反对

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

手机版|小黑屋|网站地图|源码论坛 ( 海外版 )

GMT+8, 2025-2-5 07:52 , Processed in 0.092819 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表