From 2fa574ff399acc86528ebe8dd916e6866a3b7df7 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期三, 01 三月 2023 18:01:24 +0800 Subject: [PATCH] 订单管理详情,优推管理 --- management/guns-admin/src/main/webapp/static/modular/system/tCoupon/tCoupon.js | 40 ++++++++++++++++++++++++++++------------ 1 files changed, 28 insertions(+), 12 deletions(-) diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tCoupon/tCoupon.js b/management/guns-admin/src/main/webapp/static/modular/system/tCoupon/tCoupon.js index 01dae4c..3b17e48 100644 --- a/management/guns-admin/src/main/webapp/static/modular/system/tCoupon/tCoupon.js +++ b/management/guns-admin/src/main/webapp/static/modular/system/tCoupon/tCoupon.js @@ -64,10 +64,10 @@ {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, formatter: function (value, row) { if (row.couponState === 1){ - return '<a href="#" onclick="TCoupon.stop('+row.id+','+row.couponState+')" style="color:red">停用</a>' +' ' + + return '<a href="#" onclick="TCoupon.updateStatus('+row.id+','+row.couponState+')" style="color:red">停用</a>' +' ' + '<a href="#" onclick="TCoupon.delete('+row.id+')" style="color:red">删除</a>' }else if (row.couponState === 2){ - return '<a href="#" onclick="TCoupon.start('+row.id+','+row.couponState+')" style="color:green">启用</a>' +' ' + + return '<a href="#" onclick="TCoupon.updateStatus('+row.id+','+row.couponState+')" style="color:green">启用</a>' +' ' + '<a href="#" onclick="TCoupon.delete('+row.id+')" style="color:red">删除</a>' } } @@ -124,17 +124,33 @@ /** * 删除 */ -TCoupon.delete = function () { - if (this.check()) { - var ajax = new $ax(Feng.ctxPath + "/tCoupon/delete", function (data) { - Feng.success("删除成功!"); +TCoupon.delete = function (id) { + var ajax = new $ax(Feng.ctxPath + "/tCoupon/delete", function (data) { + Feng.success("删除成功!"); + TCoupon.table.refresh(); + }, function (data) { + Feng.error("删除失败!" + data.responseJSON.message + "!"); + }); + ajax.set("tCouponId",id); + ajax.start(); +}; + +/** + * 提交启用冻结 + */ +TCoupon.updateStatus = function (id,couponState) { + var ajax = new $ax(Feng.ctxPath + "/tCoupon/update-status?id="+id+'&status='+couponState, function (data) { + if(500 == data.code){ + Feng.error(data.message); + return; + }else { + Feng.success("修改成功!"); TCoupon.table.refresh(); - }, function (data) { - Feng.error("删除失败!" + data.responseJSON.message + "!"); - }); - ajax.set("tCouponId",this.seItem.id); - ajax.start(); - } + } + }, function (data) { + Feng.error("修改失败!" + data.message + "!"); + }); + ajax.start(); }; /** -- Gitblit v1.7.1