加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
order-list.html 7.60 KB
一键复制 编辑 原始数据 按行查看 历史
chay 提交于 2018-01-03 17:42 . 订单详情
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title></title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 订单管理 <span class="c-gray en">&gt;</span> 订单管理 <a class="btn btn-success radius r btn-refresh" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
<div class="mt-20">
<table class="table table-border table-bordered table-hover table-bg table-sort">
<thead>
<tr class="text-c">
<!-- <th width="25"><input type="checkbox" name="" value=""></th> -->
<th width="10%">订单号</th>
<th width="5%">台号</th>
<th width="5%">数量</th>
<th width="8%">支付方式</th>
<th width="12%">下单时间</th>
<th width="12%">配送时间</th>
<th width="18%">配送地址</th>
<th width="5%">状态</th>
<th width="5%">总计</th>
<th width="10%">备注</th>
<th width="5%">操作</th>
</tr>
</thead>
<tbody id="data">
</tbody>
</table>
</div>
</div>
<div id="detailDiv" class="bringins-content" style="display:none;">
<table class="table table-border table-bordered table-bg table-hover ">
<thead style="background-color:white;">
<tr class="text-c">
<th width="70">订单号</th>
<td width="130" class='order_number'></td>
<th width="70">下单时间</th>
<td width="130" class='order_orderTime'></td>
<th width="70">数量</th>
<td width="" class='order_persons'></td>
</tr>
<tr class="text-c">
<th width="70">配送时间</th>
<td width="130" class='order_deliveryDate'></td>
<th width="70">配送地址</th>
<td width="130" class='order_deliveryAddress'></td>
<th width="70">总计</th>
<td width="" class='order_total'></td>
</tr>
<tr class="text-c">
<th width="70">备注</th>
<td colspan='5' class='order_remarks'>2018-1-3 17:00:00</td>
</tr>
<tr class="text-c">
<th width="" colspan='2'>商品名称</th>
<th width="" colspan='2'>数量</th>
<th width="" colspan='2'>金额</th>
</tr>
</thead>
<tbody id="orderDetail" style="background-color:white;">
</tbody>
</table>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
<script type="text/javascript" src="static/h-ui.admin/js/common.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/utils.js"></script>
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="lib/bringins/js/bringins.js"></script>
<script type="text/javascript">
$(function(){
loadData();
});
function sortDataTable(){
$('.table-sort').dataTable({
"aaSorting": [[ 4, "desc" ]],//默认第几个排序
"bStateSave": true,//状态保存
"aoColumnDefs": [
//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
{"orderable":false,"aTargets":[10]}// 制定列不参与排序
]
});
}
function cleanDataTable(){
if ($('.table-sort').hasClass('dataTable')) {
var dttable = $('.table-sort').dataTable();
dttable.fnClearTable(); //清空一下table
dttable.fnDestroy(); //还原初始化了的datatable
}
}
//加载页面数据
var orders = {};
function loadData(){
var url = "/order/list?pageNum=-1";
common.getData(url,function(data){
cleanDataTable();
var list = data.result.records;
var html="";
for(var i=0;i<list.length;i++){
var obj = list[i];
orders[obj.id] = obj;
html+='<tr class="text-c" attrId="'+obj.id+'">\
<td>'+obj.number+'</td>\
<td>'+obj.tableNo+'</td>\
<td>'+obj.persons+'</td>\
<td>'+obj.payMethod+'</td>\
<td>'+obj.orderTime+'</td>\
<td>'+obj.deliveryDate+'</td>\
<td>'+obj.orderDelivery.deliveryAddress+'</td>\
<td>'+obj.statusDis+'</td>\
<td>'+obj.total+'</td>\
<td>'+obj.remarks+'</td>\
<td class="td-manage">\
<a title="详情" href="javascript:;" onclick="info(\''+obj.id+'\')" class="ml-5" style="text-decoration:none">详情</a>\
'+statusUtils(obj)+'</td>\
</tr>';
}
$("#data").html(html);
$("#count").html(data.result.total);
sortDataTable();
});
}
//状态处理转换
function statusUtils(obj){
var s = "";
if(obj.status==0){
s = '<a title="处理" href="javascript:;" onclick="editStatus(\''+obj.id+'\',\'1\')" class="ml-5" style="text-decoration:none">处理</a>';
}else if(obj.status==1){
s = '<a title="配送" href="javascript:;" onclick="editStatus(\''+obj.id+'\',\'2\')" class="ml-5" style="text-decoration:none">配送</a>';
}else if(obj.status==2){
s = '<a title="完成" href="javascript:;" onclick="editStatus(\''+obj.id+'\',\'3\')" class="ml-5" style="text-decoration:none">完成</a>';
}else if(obj.status==4){
s = '<a title="退款" href="javascript:;" onclick="editStatus(\''+obj.id+'\',\'5\')" class="ml-5" style="text-decoration:none;color:red;">退款</a>';
}
return s;
}
//修改订单状态
function editStatus(id,status){
var url = "/order/editStatusById";
var data={id:id,status:status};
common.postData(url,data,function(data){
common.msg(data.msg);
loadData();
});
}
function info(id){
var obj = orders[id];
var detailDiv = $('#detailDiv');
detailDiv.bringins({
"position":"right",
"color":"#e5e5e5",
"width":"60%",
"closeButton":"white"
});
detailDiv.find('.order_number').html(obj.number);
detailDiv.find('.order_orderTime').html(obj.orderTime);
detailDiv.find('.order_persons').html(obj.persons);
detailDiv.find('.order_total').html(obj.total);
detailDiv.find('.order_deliveryDate').html(obj.deliveryDate);
detailDiv.find('.order_deliveryAddress').html(obj.orderDelivery.deliveryAddress);
detailDiv.find('.order_remarks').html(obj.remarks);
var html="";
debugger;
for(var i=0;i<obj.listOrderDetail.length;i++){
var detail = obj.listOrderDetail[i];
html+='<tr class="text-c" attrId="'+detail.id+'">\
<td colspan="2">'+detail.goods.name+'</td>\
<td colspan="2">'+detail.count+'</td>\
<td colspan="2">'+detail.price+'</td>\
</tr>';
}
$("#orderDetail").html(html);
}
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化