| | |
| | | {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>' |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | 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(); |
| | | }; |
| | | |
| | | /** |