订单操作
This commit is contained in:
parent
1a9ac5d66e
commit
c7d09d07d3
|
|
@ -134,7 +134,7 @@ public class BizOrderController extends BaseController
|
||||||
@Log(title = "订单", businessType = BusinessType.UPDATE)
|
@Log(title = "订单", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/updateAddressOrRemark")
|
@PostMapping("/updateAddressOrRemark")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult updateAddress(Long orderID, String content, Integer type)
|
public AjaxResult updateAddressOrRemark(Long orderID, String content, Integer type)
|
||||||
{
|
{
|
||||||
BizOrder bizOrder = bizOrderService.selectBizOrderById(orderID);
|
BizOrder bizOrder = bizOrderService.selectBizOrderById(orderID);
|
||||||
if (bizOrder == null) return toAjax(0);
|
if (bizOrder == null) return toAjax(0);
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ public class BizOrder extends BaseEntity
|
||||||
@Excel(name = "商品名称")
|
@Excel(name = "商品名称")
|
||||||
private String productName;
|
private String productName;
|
||||||
|
|
||||||
@Excel(name = "商品总额")
|
@Excel(name = "商品单价")
|
||||||
private String productAmount;
|
private String productAmount;
|
||||||
|
|
||||||
@Excel(name = "商品数量")
|
@Excel(name = "商品数量")
|
||||||
|
|
|
||||||
|
|
@ -33,13 +33,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectBizOrderList" parameterType="BizOrder" resultMap="BizOrderResult">
|
<select id="selectBizOrderList" parameterType="BizOrder" resultMap="BizOrderResult">
|
||||||
<include refid="selectBizOrderVo"/>
|
<include refid="selectBizOrderVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="memberName != null and memberName != ''"> and member_name like concat('%', #{memberName}, '%')</if>
|
<if test="memberName != null and memberName != ''"> and a.member_name like concat('%', #{memberName}, '%')</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectBizOrderById" parameterType="Long" resultMap="BizOrderResult">
|
<select id="selectBizOrderById" parameterType="Long" resultMap="BizOrderResult">
|
||||||
<include refid="selectBizOrderVo"/>
|
<include refid="selectBizOrderVo"/>
|
||||||
where id = #{id}
|
where a.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertBizOrder" parameterType="BizOrder" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertBizOrder" parameterType="BizOrder" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<!--
|
||||||
<div class="btn-group-sm" id="toolbar" role="group">
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:order:add">
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:order:add">
|
||||||
<i class="fa fa-plus"></i> 添加
|
<i class="fa fa-plus"></i> 添加
|
||||||
|
|
@ -36,13 +36,16 @@
|
||||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:order:export">
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:order:export">
|
||||||
<i class="fa fa-download"></i> 导出
|
<i class="fa fa-download"></i> 导出
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>-->
|
||||||
<div class="col-sm-12 select-table table-striped">
|
<div class="col-sm-12 select-table table-striped">
|
||||||
<table id="bootstrap-table"></table>
|
<table id="bootstrap-table"></table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<th:block th:include="include :: footer" />
|
<th:block th:include="include :: footer" />
|
||||||
|
<style>
|
||||||
|
.fixed-table-toolbar{height: 0;overflow: hidden}
|
||||||
|
</style>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
var editFlag = [[${@permission.hasPermi('business:order:edit')}]];
|
var editFlag = [[${@permission.hasPermi('business:order:edit')}]];
|
||||||
var removeFlag = [[${@permission.hasPermi('business:order:remove')}]];
|
var removeFlag = [[${@permission.hasPermi('business:order:remove')}]];
|
||||||
|
|
@ -56,9 +59,8 @@
|
||||||
removeUrl: prefix + "/remove",
|
removeUrl: prefix + "/remove",
|
||||||
exportUrl: prefix + "/export",
|
exportUrl: prefix + "/export",
|
||||||
modalName: "订单",
|
modalName: "订单",
|
||||||
columns: [{
|
toolbar: false,
|
||||||
checkbox: true
|
columns: [
|
||||||
},
|
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '订单ID',
|
title: '订单ID',
|
||||||
|
|
@ -68,43 +70,136 @@
|
||||||
field: 'orderSn',
|
field: 'orderSn',
|
||||||
title: '订单编码'
|
title: '订单编码'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'memberName',
|
||||||
|
title: '会员姓名'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'mobile',
|
field: 'mobile',
|
||||||
title: '手机号码'
|
title: '手机号码'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'memberName',
|
field: 'productName',
|
||||||
title: '用户姓名'
|
title: '商品名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'productAmount',
|
||||||
|
title: '商品单价'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'productCount',
|
||||||
|
title: '数量'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'orderAmount',
|
field: 'orderAmount',
|
||||||
title: '订单金额'
|
title: '订单总额'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'addressName',
|
||||||
|
title: '收货人姓名'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'addressMobile',
|
||||||
|
title: '收货人电话'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '收货区域',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
return row.addressProvince + row.addressCity + row.addressArea;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'addressDetail',
|
||||||
|
title: '详细地址'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'orderStatus',
|
field: 'orderStatus',
|
||||||
title: '订单状态:0-待支付,1-已支付,2-已取消'
|
title: '订单状态',
|
||||||
},
|
formatter: function(value, row, index) {
|
||||||
{
|
switch (value){
|
||||||
field: 'addressId',
|
case 0: return "待支付";
|
||||||
title: '收货人地址ID'
|
case 1: return "已支付";
|
||||||
|
case 2: return "已取消";
|
||||||
|
case 3: return "待收货";
|
||||||
|
case 4: return "已完成";
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'createTime',
|
field: 'createTime',
|
||||||
title: '创建时间'
|
title: '下单时间'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: function(value, row, index) {
|
formatter: function(value, row, index) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
if(row.orderStatus == 1){
|
||||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="deliver(\'' + row.id + '\')"><i class="fa fa-edit"></i>设为已发货</a> ');
|
||||||
|
}
|
||||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="updateRemark(\'' + row.id + '\', \'' + row.remark + '\')"><i class="fa fa-edit"></i>修改备注</a> ');
|
||||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="updateAddress(\'' + row.id + '\', \'' + row.addressDetail + '\')"><i class="fa fa-edit"></i>修改收货地址</a> ');
|
||||||
return actions.join('');
|
return actions.join('');
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
$.table.init(options);
|
$.table.init(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//发货
|
||||||
|
function deliver(orderID){
|
||||||
|
$.modal.confirm("此操作设置该订单为已发货吗, 是否继续?", function() {
|
||||||
|
$.operate.post(prefix + "/deliver", {
|
||||||
|
orderID:orderID
|
||||||
|
}, function(response){
|
||||||
|
if(response.code == 0){
|
||||||
|
$.modal.alertSuccess('操作成功!')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改备注
|
||||||
|
function updateRemark(orderID, oldRemark){
|
||||||
|
$.modal.confirm("<div id='anch'>请输入新的备注信息<br/><input class='form-control' id='newRemark' value='" + oldRemark + "' maxlength='30'></div>", function() {
|
||||||
|
let remark = $("#newRemark").val();
|
||||||
|
if(remark.length == 0){
|
||||||
|
$.modal.msgError("请输入备注信息");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$.operate.post(prefix + "/updateAddressOrRemark", {
|
||||||
|
orderID:orderID,
|
||||||
|
content:remark,
|
||||||
|
type:1
|
||||||
|
}, function(response){
|
||||||
|
if(response.code == 0){
|
||||||
|
$.modal.alertSuccess('操作成功!')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$("#anch").parent().css("padding", "10px 20px").children(".layui-layer-ico").hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改备注
|
||||||
|
function updateAddress(orderID, oldAddress){
|
||||||
|
$.modal.confirm("<div id='anch'>请输入新的收货地址<br/><input class='form-control' id='newAddress' value='" + oldAddress + "' maxlength='20'></div>", function() {
|
||||||
|
let address = $("#newAddress").val();
|
||||||
|
if(address.length == 0){
|
||||||
|
$.modal.msgError("请输入收货地址");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$.operate.post(prefix + "/updateAddressOrRemark", {
|
||||||
|
orderID:orderID,
|
||||||
|
content:address,
|
||||||
|
type:0
|
||||||
|
}, function(response){
|
||||||
|
if(response.code == 0){
|
||||||
|
$.modal.alertSuccess('操作成功!')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$("#anch").parent().css("padding", "10px 20px").children(".layui-layer-ico").hide();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
Reference in New Issue