ghy-all/ghy-admin/src/main/resources/templates/order/master.html

273 lines
11 KiB
HTML
Raw Normal View History

2022-05-15 14:37:20 +08:00
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('订单列表')"/>
<th:block th:include="include :: layout-latest-css"/>
<th:block th:include="include :: ztree-css"/>
2023-05-21 22:14:17 +08:00
<style>
#orderSearchBtnGroup {
margin-top: 10px;
}
</style>
2022-05-15 14:37:20 +08:00
</head>
<body class="gray-bg">
<div class="ui-layout-center">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="order-form">
<input type="hidden" id="deptId" name="deptId">
<input type="hidden" id="parentId" name="parentId">
2023-05-21 22:14:17 +08:00
<input type="hidden" id="orderStatus" name="orderStatus"/>
2022-05-15 14:37:20 +08:00
<div class="select-list">
<ul>
<li>
订单号:<input type="text" name="code"/>
</li>
2023-05-21 22:14:17 +08:00
<!-- <li>-->
<!-- 订单状态:<select name="orderStatus" th:with="type=${@dict.getType('order_status')}">-->
<!-- <option value="">所有</option>-->
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}"-->
<!-- th:value="${dict.dictValue}"></option>-->
<!-- </select>-->
<!-- </li>-->
2022-05-15 14:37:20 +08:00
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
2023-05-21 22:14:17 +08:00
<div class="btn-group-sm" role="group">
<a class="btn btn-warning" onclick="$.table.exportExcel()"
shiro:hasPermission="order:order:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="btn-group-sm" id="orderSearchBtnGroup" role="group">
<a class="btn btn-success btn-outline" onclick="searchByOrderStatus(0)">
新订单
</a>
<a class="btn btn-success btn-outline" onclick="searchByOrderStatus(1)">
未约/未排
</a>
<a class="btn btn-success btn-outline" onclick="searchByOrderStatus(2)">
待上门
</a>
<a class="btn btn-success btn-outline" onclick="searchByOrderStatus(3)">
服务中
</a>
<a class="btn btn-success btn-outline" onclick="searchByOrderStatus(4)">
确认中
</a>
<a class="btn btn-success btn-outline" onclick="searchByOrderStatus(5)">
已完成
</a>
<a class="btn btn-success btn-outline" onclick="searchByOrderStatus(6)">
已取消
</a>
<a class="btn btn-success btn-outline" onclick="">
售后中
</a>
<a class="btn btn-success btn-outline" onclick="">
今日待上门
</a>
<a class="btn btn-success btn-outline" onclick="">
明日待上门
</a>
<a class="btn btn-success btn-outline" onclick="">
超时单
</a>
</div>
2022-05-15 14:37:20 +08:00
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<script th:inline="javascript">
2022-05-19 19:31:08 +08:00
var payTypes = [[${@dict.getType('pay_type')}]];
var orderTypes = [[${@dict.getType('goods_category_type')}]];
var payStatus = [[${@dict.getType('pay_status')}]];
var orderStatus = [[${@dict.getType('order_status')}]];
2022-05-19 19:31:08 +08:00
2022-05-15 14:37:20 +08:00
var editFlag = [[${@permission.hasPermi('order:order:edit')}]];
2023-02-17 21:11:23 +08:00
var prefix = ctx + "order/detail";
2022-05-15 14:37:20 +08:00
$(function () {
var panehHidden = false;
if ($(this).width() < 769) {
panehHidden = true;
}
$('body').layout({initClosed: panehHidden, west__size: 185});
// 回到顶部绑定
if ($.fn.toTop !== undefined) {
var opt = {
win: $('.ui-layout-center'),
doc: $('.ui-layout-center')
};
$('#scroll-up').toTop(opt);
}
queryOrderList();
});
function queryOrderList() {
var options = {
url: prefix + "/list",
exportUrl: prefix + "/export",
sortName: "createTime",
sortOrder: "desc",
modalName: "订单",
columns: [
{
checkbox: true
},
{
field: 'id',
title: '订单ID',
visible: false
},
{
2023-02-17 21:11:23 +08:00
field: 'goods',
title: '订单信息',
formatter: function (value, row) {
2023-05-11 14:45:35 +08:00
return '<div style="display:flex;justify-content: center;align-items: center;">'
+ '<img decoding="async" src="' + value.goodsImgUrl + '" width="100" height="100" />'
2023-02-17 21:11:23 +08:00
+ '<div>'
2023-02-18 01:16:37 +08:00
+ '<small> 订单编号:' + row.code + '<small/> <br>'
+ '<h4> ' + value.goodsName + '<h4/>'
2023-05-11 14:45:35 +08:00
// + '<small> ' + value.goodsDesc + '</small> <br>'
+ '<small> 联系人:' + row.addressName + '</small> <br>'
+ '<small> 联系电话:' + row.addressPhone + '</small> <br>'
+ '<small> 联系地址:' + row.address + '</small> <br>'
+ '<small> 下单时间:' + row.createTime + '</small> <br>'
2023-02-18 01:16:37 +08:00
+ '<small> 预约时间:' + row.expectTimeStart + ' - ' + row.expectTimeEnd + '</small> <br>'
+ '<small> 总金额:' + row.financialMasterMoney + '元 应得金额:' + row.financialDetailMoney + '元</small> <br>'
2023-02-17 21:11:23 +08:00
+ '</div>'
+ '</div>';
}
2022-05-15 14:37:20 +08:00
},
{
2023-02-17 21:11:23 +08:00
field: 'orderStatus',
title: '订单状态',
align: 'center',
formatter: function (value, row, index) {
return $.table.selectDictLabel(orderStatus, value);
}
2022-05-15 14:37:20 +08:00
},
2022-06-01 14:50:58 +08:00
{
2023-02-17 21:11:23 +08:00
field: 'worker',
title: '接单信息',
formatter: function (value, row, index) {
return '<small>' + value.name + value.phone + '</small><br>'
2023-02-18 01:16:37 +08:00
+ '<small>接单时间:' + row.revTime + '</small>';
2023-02-17 21:11:23 +08:00
}
2022-06-01 14:50:58 +08:00
},
2023-05-16 22:48:43 +08:00
{
title: '操作',
align: 'left',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-info"></i>查看</a> ');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="orderDetailReject(\'' + row.id + '\')"><i class="fa fa-remove"></i>师傅退单</a> ');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="orderMasterReject(\'' + row.orderMasterId + '\')"><i class="fa fa-remove"></i>商家退单</a> ');
return actions.join('');
}
},
2022-06-01 14:50:58 +08:00
{
2023-02-18 01:16:37 +08:00
field: 'goodsWorker',
title: '商家信息',
2022-06-01 22:14:02 +08:00
formatter: function (value, row, index) {
2023-02-18 01:16:37 +08:00
return '<small>' + value.name + '</small><br>'
+ '<small>' + value.phone + '</small>';
2022-06-01 22:14:02 +08:00
}
2023-02-18 01:16:37 +08:00
},
{
field: 'changeMoney',
title: '商家追加金额',
align: 'center'
2023-05-11 14:45:35 +08:00
},{
field: 'orderType',
title: '订单类型',
align: 'center',
formatter: function (value, row, index) {
return $.table.selectDictLabel(orderTypes, value);
}
},
{
field: 'payType',
title: '付款类型',
align: 'center',
formatter: function (value, row, index) {
return $.table.selectDictLabel(payTypes, value);
}
},
{
field: 'payStatus',
title: '付款状态',
align: 'center',
formatter: function (value, row, index) {
return $.table.selectDictLabel(payStatus, value);
}
},
{
field: 'payTime',
title: '付款时间'
}]
2022-05-15 14:37:20 +08:00
};
$.table.init(options);
}
2022-05-19 19:31:08 +08:00
function detail(id) {
2022-05-19 21:40:00 +08:00
var url = "order/goods?orderId=" + id;
$.modal.open("商品信息", url);
2022-05-19 19:31:08 +08:00
}
2023-05-16 22:48:43 +08:00
function orderDetailReject(id) {
$.modal.confirm("确定要退单吗?", function() {
const url = "detail/reject";
const data = { "id": id };
$.operate.post(url, data);
});
}
function orderMasterReject(id) {
$.modal.confirm("确定要退单吗?", function() {
const url = "master/reject";
const data = { "id": id };
$.operate.post(url, data);
});
}
2022-05-19 19:31:08 +08:00
2023-05-21 22:14:17 +08:00
function searchByOrderStatus(orderStatus) {
$('#orderStatus').val(orderStatus);
$.table.search();
}
2022-05-15 14:37:20 +08:00
</script>
</body>
2023-05-21 22:14:17 +08:00
</html>