From 7e6bbd05a75b07cb0717812d0b51aad128361012 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Thu, 19 May 2022 18:43:42 +0800 Subject: [PATCH] fix some problem --- src/main/resources/templates/febs/views/modules/order/orderList.html | 178 ++++++++++++++++++++++++++++++++++++---------------------- 1 files changed, 110 insertions(+), 68 deletions(-) diff --git a/src/main/resources/templates/febs/views/modules/order/orderList.html b/src/main/resources/templates/febs/views/modules/order/orderList.html index 00d310e..b95c28e 100644 --- a/src/main/resources/templates/febs/views/modules/order/orderList.html +++ b/src/main/resources/templates/febs/views/modules/order/orderList.html @@ -1,4 +1,4 @@ -<div class="layui-fluid layui-anim febs-anim" id="febs-order" lay-title="商品列表"> +<div class="layui-fluid layui-anim febs-anim" id="febs-order" lay-title="订单列表"> <div class="layui-row febs-container"> <div class="layui-col-md12"> <div class="layui-card"> @@ -54,6 +54,18 @@ </div> </form> <table lay-filter="orderTable" lay-data="{id: 'orderTable'}"></table> + <style type="text/css"> + .layui-table-cell{ + text-align:center; + height: auto; + white-space: nowrap; /*文本不会换行,在同一行显示*/ + overflow: hidden; /*超出隐藏*/ + text-overflow: ellipsis; /*省略号显示*/ + } + .layui-table img{ + max-width:100px + } + </style> </div> </div> </div> @@ -67,14 +79,21 @@ <a lay-event="edit" shiro:hasPermission="user:update"><i class="layui-icon febs-edit-area febs-blue"></i></a> </script> +<script type="text/html" id="tableToolBar"> + <div class="layui-btn-container"> + <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" lay-event="exportDeliver">导出未发货订单</button> + <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" id="importDeliver" lay-event="importDeliver">导入发货</button> + </div> +</script> <!-- 表格操作栏 end --> <script data-th-inline="none" type="text/javascript"> // 引入组件并初始化 - layui.use([ 'jquery', 'form', 'table', 'febs'], function () { + layui.use([ 'jquery', 'form', 'table', 'febs', 'upload'], function () { var $ = layui.jquery, febs = layui.febs, form = layui.form, table = layui.table, + upload = layui.upload, $view = $('#febs-order'), $query = $view.find('#query'), $reset = $view.find('#reset'), @@ -88,52 +107,68 @@ // 表格初始化 initTable(); + table.on('toolbar(orderTable)', function(obj){ + var event = obj.event; + + if (event == 'exportDeliver') { + window.location.href = ctx + "admin/order/exportOrderList?orderType=1&status=2"; + } + }); + + upload.render({ + elem: '#importDeliver' + ,url: 'admin/order/importDeliver' //此处配置你自己的上传接口即可 + ,accept: 'file' //普通文件 + ,done: function(res){ + console.log("123"); + } + }); + // 初始化表格操作栏各个按钮功能 table.on('tool(orderTable)', function (obj) { var data = obj.data, layEvent = obj.event; - if (layEvent === 'downGoods') { - febs.modal.confirm('下架', '确认下架该商品?', function () { - downGoods(data.id); - }); - } - if (layEvent === 'upGoods') { - febs.modal.confirm('上架', '确认上架该商品?', function () { - upGoods(data.id); - }); - } - if (layEvent === 'delGoods') { - febs.modal.confirm('删除', '确认删除该商品?', function () { - delGoods(data.id); - }); - } if (layEvent === 'deliverGoods') { febs.modal.open('发货', 'modules/order/deliverGoods/' + data.id, { btn: ['确认', '取消'], yes: function (index, layero) { - $('#user-update').find('#submit').trigger('click'); + $('#deliver-update').find('#submit').trigger('click'); }, btn2: function () { layer.closeAll(); } }); } + if (layEvent === 'seeOrder') { + febs.modal.open( '订单详情', 'modules/order/orderDetail/' + data.id, { + maxmin: true, + }); + } + if (layEvent === 'cancelOrder') { + febs.modal.confirm('取消订单', '确认取消订单?', function () { + cancelOrder(data.id); + }); + } + if (layEvent === 'seePayImage') { + var t = $view.find('#seePayImage'+data.id+''); + //页面层 + layer.open({ + type: 1, + title: "支付凭证", + skin: 'layui-layer-rim', //加上边框 + area: ['80%', '80%'], //宽高 + shadeClose: true, //开启遮罩关闭 + end: function (index, layero) { + return false; + }, + content: '<div style="text-align:center"><img src="' + $(t).attr('src') + '" /></div>' + }); + } }); - function downGoods(id) { - febs.get(ctx + 'admin/goods/downMallGoods/' + id, null, function () { - febs.alert.success('下架成功'); - $query.click(); - }); - } - function delGoods(id) { - febs.get(ctx + 'admin/goods/delMallGoods/' + id, null, function () { - febs.alert.success('删除成功'); - $query.click(); - }); - } - function upGoods(id) { - febs.get(ctx + 'admin/goods/upMallGoods/' + id, null, function () { - febs.alert.success('上架成功'); + + function cancelOrder(id) { + febs.get(ctx + 'admin/order/cancelOrder/' + id, null, function () { + febs.alert.success('操作成功'); $query.click(); }); } @@ -159,42 +194,49 @@ tableIns = febs.table.init({ elem: $view.find('table'), id: 'orderTable', - url: ctx + 'admin/order/orderList', + url: ctx + 'admin/order/orderList?orderType=1', + defaultToolbar: [], + toolbar: '#tableToolBar', cols: [[ - {field: 'orderNo', title: '商品名称', minWidth: 150,align:'left'}, - // {field: 'accountType', title: '账号类型', - // templet: function (d) { - // if (d.accountType === 2) { - // return '<span style="color:red;">测试账号</span>' - // } else if (d.accountType === 1) { - // return '<span style="color:green;">正常账号</span>' - // }else{ - // return '' - // } - // }, minWidth: 80,align:'center'}, - // {field: 'accountStatus', title: '账号状态', - // templet: function (d) { - // if (d.accountStatus === 1) { - // return '<span style="color:green;">正常</span>' - // } else if (d.accountStatus === 2) { - // return '<span style="color:red;">禁用</span>' - // }else{ - // return '' - // } - // }, minWidth: 80,align:'center'}, - // {field: 'createdTime', title: '注册时间', minWidth: 180,align:'center'}, - {title: '操作', - templet: function (d) { - if (d.status === 2) { - return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>' - } - // else{ - // return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="upGoods" shiro:hasPermission="user:update">上架</button>' - // + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="delGoods" shiro:hasPermission="user:update">删除</button>' - // + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="updateGoods" shiro:hasPermission="user:update">编辑</button>' - // - // } - },minWidth: 300,align:'center'} + {field: 'orderNo', title: '订单编号', minWidth: 200,align:'left'}, + {field: 'memberName', title: '购买人', minWidth: 120,align:'left'}, + {field: 'memberPhone', title: '账号', minWidth: 120,align:'left'}, + {field: 'memberBindPhone', title: '联系方式', minWidth: 120,align:'left'}, + {field: 'amount', title: '订单金额', minWidth: 120,align:'left'}, + {field: 'orderTime', title: '下单时间', minWidth: 200,align:'left'}, + {field: 'status', title: '状态', + templet: function (d) { + if (d.status === 1) { + return '<span style="color:red;">待支付</span>' + } else if (d.status === 2) { + return '<span style="color:green;">待发货</span>' + }else if (d.status === 3) { + return '<span style="color:green;">待收货</span>' + }else if (d.status === 4) { + return '<span style="color:green;">已完成</span>' + }else if (d.status === 5) { + return '<span style="color:green;">退款中</span>' + }else if (d.status === 6) { + return '<span style="color:green;">已退款</span>' + }else if (d.status === 7) { + return '<span style="color:green;">已取消</span>' + }else{ + return '' + } + }, minWidth: 80,align:'center'}, + {field: 'payMethod', title: '支付方式', minWidth: 120,align:'left'}, + {field: 'payTime', title: '支付时间', minWidth: 200,align:'left'}, + {field: 'payOrderNo', title: '支付订单号', minWidth: 200,align:'left'}, + {title: '操作', + templet: function (d) { + if (d.status === 2) { + return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>' + +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' + }else{ + return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' + } + // } + },minWidth: 200,align:'center', fixed:'right'} ]] }); } -- Gitblit v1.9.1