|
|
@@ -0,0 +1,384 @@
|
|
|
+<!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('订单列表')" />
|
|
|
+</head>
|
|
|
+<body class="gray-bg">
|
|
|
+ <div class="container-div">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-sm-12 search-collapse">
|
|
|
+ <form id="formId">
|
|
|
+ <div class="select-list">
|
|
|
+ <ul>
|
|
|
+ <li>
|
|
|
+ 订单编号:<input type="text" name="orderNo" placeholder="订单编号"/>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ 商品名称:<input type="text" name="prodName" placeholder="商品名称"/>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ 收件人姓名:<input type="text" name="recName" placeholder="收件人姓名"/>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ 收件人手机:<input type="text" name="recMobile" placeholder="收件人手机"/>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ 快递编号:<input type="text" name="expressNo" placeholder="快递编号"/>
|
|
|
+ </li>
|
|
|
+ <li shiro:hasPermission="platform:order:show">
|
|
|
+ 商品分类:
|
|
|
+ <select name="prodClass" style="width: 200px;" th:with="prodClasses=${@product.getProdClasses()}" >
|
|
|
+ <option value="">所有</option>
|
|
|
+ <option th:each="prodClass : ${prodClasses}" th:text="${prodClass.className}" th:value="${prodClass.prodClassId}"></option>
|
|
|
+ </select>
|
|
|
+ </li>
|
|
|
+ <li class="select-time">
|
|
|
+ <label>订单时间: </label>
|
|
|
+ <input type="text" class="time-input" placeholder="开始时间" id="orderTimeFrom" name="params[orderTimeFrom]"/>
|
|
|
+ <span>-</span>
|
|
|
+ <input type="text" class="time-input" placeholder="结束时间" id="orderTimeTo" name="params[orderTimeTo]"/>
|
|
|
+ </li>
|
|
|
+ <li class="select-time">
|
|
|
+ <label>取消时间: </label>
|
|
|
+ <input type="text" class="time-input" placeholder="开始时间" id="cancel TimeFrom" name="params[cancelTimeFrom]"/>
|
|
|
+ <span>-</span>
|
|
|
+ <input type="text" class="time-input" placeholder="结束时间" id="cancelTimeTo" name="params[cancelTimeTo]"/>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ 订单状态:
|
|
|
+ <select name="orderDetailStatus" th:with="type=${@dict.getType('order_detail_status')}">
|
|
|
+ <option value="">所有</option>
|
|
|
+ <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
|
|
+ </select>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <ul>
|
|
|
+ <li>
|
|
|
+ <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
|
|
+ <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="btn-group-sm" id="toolbar" role="group">
|
|
|
+ <a class="btn btn-warning multiple" id="btnPrintPickForm" onclick="printPickForm()">
|
|
|
+ <i class="glyphicon glyphicon-baby-formula"></i> 打印拣货单
|
|
|
+ </a>
|
|
|
+ <a class="btn btn-info multiple" id="btnExportOrderDetail" onclick="exportOrderDetail()">
|
|
|
+ <i class="glyphicon glyphicon-check"></i> 导出订单明细
|
|
|
+ </a>
|
|
|
+ <a class="btn btn-success multiple" id="btnImportOrderDetail" onclick="importOrderDetail()">
|
|
|
+ <i class="glyphicon glyphicon-check"></i> 导入物流单号
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-12 select-table table-striped">
|
|
|
+ <table id="bootstrap-table" data-mobile-responsive="true"></table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 设置更换单号区域 -->
|
|
|
+ <script id="divInputExpressNo" type="text/template">
|
|
|
+ <div class="col-xs-offset-2">
|
|
|
+ <form id="frmInputExpressNo">
|
|
|
+ <div class="form-group" style="margin-top: 15px;">
|
|
|
+ <label th:for="expressNo">快递单号: </label>
|
|
|
+ <input type="text" id="expressNo" placeholder="快递单号">
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </script>
|
|
|
+ <!-- 设置更换单号区域 -->
|
|
|
+ <script id="divChangeExpressNo" type="text/template">
|
|
|
+ <div class="col-xs-offset-2">
|
|
|
+ <form id="frmChangeExpressNo">
|
|
|
+ <div class="form-group" style="margin-top: 15px;">
|
|
|
+ <label th:for="newExpressNo">新快递单号: </label>
|
|
|
+ <input type="text" id="newExpressNo" placeholder="新快递单号">
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </script>
|
|
|
+ <script th:src="@{/js/datatimeTool.js}"></script>
|
|
|
+ <script th:src="@{/ruoyi/js/currency.js}"></script>
|
|
|
+ <th:block th:include="include :: footer" />
|
|
|
+ <script th:inline="javascript">
|
|
|
+ var editFlag = [[${@permission.hasPermi('platform:order:edit')}]];
|
|
|
+ var prefix = ctx + "business/vendorOrder";
|
|
|
+ var orderDetailStatusDatas = [[${@dict.getType('order_detail_status')}]];
|
|
|
+ var orderDeliveryStatusDatas = [[${@dict.getType('order_delivery_status')}]];
|
|
|
+
|
|
|
+ var dateFrom = DateAdd("m ", -1, new Date());
|
|
|
+ var dateTo = new Date();
|
|
|
+ $("#orderTimeFrom").val(dateFrom.Format("yyyy-MM-dd"));
|
|
|
+ $("#orderTimeTo").val(dateTo.Format("yyyy-MM-dd"));
|
|
|
+
|
|
|
+ $(function() {
|
|
|
+ var options = {
|
|
|
+ url: prefix + "/list",
|
|
|
+ createUrl: prefix + "/add",
|
|
|
+ updateUrl: prefix + "/edit/{id}",
|
|
|
+ removeUrl: prefix + "/remove",
|
|
|
+ exportUrl: prefix + "/export",
|
|
|
+ modalName: "订单明细选择",
|
|
|
+ showSearch: false,
|
|
|
+ showColumns: false,
|
|
|
+ pageSize: 25,
|
|
|
+ onUncheck: onUncheck,
|
|
|
+ onUncheckAll: onUncheckAll,
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ checkbox: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'orderNo',
|
|
|
+ title : '订单编号',
|
|
|
+ visible: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'orderNo',
|
|
|
+ title : '订单编号',
|
|
|
+ sortable: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'orderDetailStatus',
|
|
|
+ title : '订单状态',
|
|
|
+ sortable: false,
|
|
|
+ formatter: function(value, row, index) {
|
|
|
+ return $.table.selectDictLabel(orderDetailStatusDatas, value);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'orderDeliveryStatus',
|
|
|
+ title : '订单发货状态',
|
|
|
+ sortable: false,
|
|
|
+ formatter: function(value, row, index) {
|
|
|
+ return $.table.selectDictLabel(orderDeliveryStatusDatas, value);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'prodName',
|
|
|
+ title : '商品名称',
|
|
|
+ sortable: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'prodAttrName',
|
|
|
+ title : '属性名称',
|
|
|
+ sortable: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'payAmount',
|
|
|
+ title : '支付金额',
|
|
|
+ sortable: false,
|
|
|
+ align : "right",
|
|
|
+ formatter: function(value, row, index) {
|
|
|
+ return formatCurrency(value / 100, 2);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'quantity',
|
|
|
+ title : '商品数量',
|
|
|
+ sortable: false,
|
|
|
+ align : "right"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'recName',
|
|
|
+ title : '收件人姓名',
|
|
|
+ sortable: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'recMobile',
|
|
|
+ title : '收件人手机',
|
|
|
+ sortable: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'orderTime',
|
|
|
+ title : '下单时间',
|
|
|
+ sortable: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'deliveryTime',
|
|
|
+ title : '发货时间',
|
|
|
+ sortable: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'confirmTime',
|
|
|
+ title : '确认收货时间',
|
|
|
+ sortable: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field : 'cancelTime',
|
|
|
+ title : '取消时间',
|
|
|
+ sortable: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ align: 'left',
|
|
|
+ formatter: function(value, row, index) {
|
|
|
+ var actions = [];
|
|
|
+ actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="$.modal.openTab(\'订单详情\', \'' + prefix + '/detail/' + row.orderId + '\')"><i class="fa fa-edit"></i>查看</a> ');
|
|
|
+ if (row.orderDeliveryStatus === 'PENDING') {
|
|
|
+ actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="deliverProd(\'' + row.orderDetailId + '\', \'' + row.orderDeliveryId + '\')"><i class="fa fa-edit"></i>发货</a> ');
|
|
|
+ }
|
|
|
+ if (row.orderDeliveryStatus === 'DELIVERED') {
|
|
|
+ actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="cancelDeliverProd(\'' + row.orderDetailId + '\', \'' + row.orderDeliveryId + '\')"><i class="fa fa-edit"></i>取消发货</a> ');
|
|
|
+ actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="changeExpressNo(\'' + row.orderDetailId + '\', \'' + row.orderDeliveryId + '\')"><i class="fa fa-edit"></i>更换单号</a> ');
|
|
|
+ actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="showExpressNo(\'' + row.orderDetailId + '\', \'' + row.orderDeliveryId + '\')"><i class="fa fa-edit"></i>显示快递单号</a> ');
|
|
|
+ }
|
|
|
+ return actions.join('');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ $.table.init(options);
|
|
|
+ });
|
|
|
+
|
|
|
+ function printPickForm() {
|
|
|
+ var confirmMsg = "确认打印拣货单吗?";
|
|
|
+
|
|
|
+ $.modal.confirm(confirmMsg, function() {
|
|
|
+ var exportUrl = prefix + "/export";
|
|
|
+ var data = {
|
|
|
+ "detailIds" : $.table.selectColumns("id").join()
|
|
|
+ };
|
|
|
+ // $.post(exportUrl, data, function(result) {
|
|
|
+ // if (result.code === web_status.SUCCESS) {
|
|
|
+ // window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
|
|
|
+ // } else if (result.code === web_status.WARNING) {
|
|
|
+ // $.modal.alertWarning(result.msg)
|
|
|
+ // } else {
|
|
|
+ // $.modal.alertError(result.msg);
|
|
|
+ // }
|
|
|
+ // $.modal.closeLoading();
|
|
|
+ // });
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function onUncheck() {
|
|
|
+
|
|
|
+ }
|
|
|
+ function onUncheckAll() {
|
|
|
+ }
|
|
|
+
|
|
|
+ function deliverProd(orderDetailId, orderDeliveryId) {
|
|
|
+ var content = $('#divInputExpressNo').html();
|
|
|
+ layer.open({
|
|
|
+ type: 1,
|
|
|
+ fix: false,
|
|
|
+ maxmin: false,
|
|
|
+ shade: 0.3,
|
|
|
+ area: ['340px', '215px'],
|
|
|
+ title: '输入快递单号',
|
|
|
+ // 弹层外区域关闭
|
|
|
+ shadeClose: true,
|
|
|
+ content: content, //捕获的元素,注意:最好该指定的元素要存放在body最外层,否则可能被其它的相对元素所影响
|
|
|
+ btn: ['<i class="fa fa-check"></i> 确定', '<i class="fa fa-remove"></i> 关闭'],
|
|
|
+ btn1: function() {
|
|
|
+ var expressNo = $("#expressNo").val();
|
|
|
+ if (expressNo === "") {
|
|
|
+ $.modal.alertError("请输入快递单号");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var url = prefix + "/deliverProd";
|
|
|
+ var data = {
|
|
|
+ "orderDetailId": orderDetailId,
|
|
|
+ "orderDeliveryId": orderDeliveryId,
|
|
|
+ "expressNo": expressNo
|
|
|
+ };
|
|
|
+ $.post(url, data, function(result) {
|
|
|
+ if (result.code === web_status.SUCCESS) {
|
|
|
+ $.modal.closeAll();
|
|
|
+ $.modal.enable();
|
|
|
+ $.modal.alertSuccess(result.msg);
|
|
|
+ $.table.search();
|
|
|
+ } else if (result.code === web_status.WARNING) {
|
|
|
+ $.modal.closeAll();
|
|
|
+ $.modal.enable();
|
|
|
+ $.modal.alertWarning(result.msg)
|
|
|
+ } else {
|
|
|
+ $.modal.closeAll();
|
|
|
+ $.modal.enable();
|
|
|
+ $.modal.alertError(result.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ layer.closeAll();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function cancelDeliverProd(orderDetailId, orderDeliveryId) {
|
|
|
+ var url = prefix + "/cancelDeliverProd";
|
|
|
+ var data = {
|
|
|
+ "orderDetailId": orderDetailId,
|
|
|
+ "orderDeliveryId": orderDeliveryId,
|
|
|
+ };
|
|
|
+ $.post(url, data, function(result) {
|
|
|
+ if (result.code === web_status.SUCCESS) {
|
|
|
+ $.modal.closeAll();
|
|
|
+ $.modal.alertSuccess(result.msg);
|
|
|
+ $.table.search();
|
|
|
+ } else if (result.code === web_status.WARNING) {
|
|
|
+ $.modal.closeAll();
|
|
|
+ $.modal.enable();
|
|
|
+ $.modal.alertWarning(result.msg)
|
|
|
+ } else {
|
|
|
+ $.modal.closeAll();
|
|
|
+ $.modal.enable();
|
|
|
+ $.modal.alertError(result.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function changeExpressNo(orderDetailId, orderDeliveryId) {
|
|
|
+ var content = $('#divChangeExpressNo').html();
|
|
|
+ layer.open({
|
|
|
+ type: 1,
|
|
|
+ fix: false,
|
|
|
+ maxmin: false,
|
|
|
+ shade: 0.3,
|
|
|
+ area: ['340px', '215px'],
|
|
|
+ title: '更换单号',
|
|
|
+ // 弹层外区域关闭
|
|
|
+ shadeClose: true,
|
|
|
+ content: content, //捕获的元素,注意:最好该指定的元素要存放在body最外层,否则可能被其它的相对元素所影响
|
|
|
+ btn: ['<i class="fa fa-check"></i> 确定', '<i class="fa fa-remove"></i> 关闭'],
|
|
|
+ btn1: function() {
|
|
|
+ var newExpressNo = $("#newExpressNo").val();
|
|
|
+ if (newExpressNo === "") {
|
|
|
+ $.modal.alertError("请输入新单号");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var data = {};
|
|
|
+ var url = prefix + "/changeExpressNo";
|
|
|
+
|
|
|
+ data = {
|
|
|
+ "orderDetailId": orderDetailId,
|
|
|
+ "orderDeliveryId": orderDeliveryId,
|
|
|
+ "expressNo": newExpressNo
|
|
|
+ };
|
|
|
+ $.post(url, data, function(result) {
|
|
|
+ if (result.code === web_status.SUCCESS) {
|
|
|
+ $.modal.closeAll();
|
|
|
+ $.modal.alertSuccess("更新单号成功。");
|
|
|
+ $.table.search();
|
|
|
+ } else if (result.code === web_status.WARNING) {
|
|
|
+ $.modal.enable();
|
|
|
+ $.modal.alertWarning(result.msg);
|
|
|
+ } else {
|
|
|
+ $.modal.enable();
|
|
|
+ $.modal.alertError(result.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ layer.closeAll();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function showExpressNo(orderDeliveryId) {
|
|
|
+ $.modal.open('显示快递单号', prefix + '/showExpress/' + orderDeliveryId);
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+</body>
|
|
|
+</html>
|