| | |
| | | {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '创建时间', field: 'createtime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券名称', field: 'couponName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券类型', field: 'couponType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券类型', field: 'couponType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponType === 1){ |
| | | return '<span>活动券</span>' |
| | | }else if (row.couponType === 2){ |
| | | return '<span>新人券</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '优惠券码', field: 'couponCode', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券状态', field: 'couponStatus', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '服务类型', field: 'couponServiceType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券状态', field: 'couponStatus', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponType === 1){ |
| | | return '<span>未发放</span>' |
| | | }else if (row.couponType === 2){ |
| | | return '<span>未使用</span>' |
| | | }else if (row.couponType === 3){ |
| | | return '<span>已使用</span>' |
| | | }else if (row.couponType === 4){ |
| | | return '<span>已过期</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '服务类型', field: 'couponServiceType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponType === 1){ |
| | | return '<span>通用型</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '条件金额', field: 'couponConditionalAmount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠金额', field: 'couponPreferentialAmount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '有效期', field: 'couponValidity', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '赠送数量', field: 'couponSendQuantity', visible: true, align: 'center', valign: 'middle'} |
| | | {title: '赠送数量', field: 'couponSendQuantity', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | if (row.state === 1){ |
| | | return '<a href="#" onclick="TCoupon.stop('+row.id+','+row.status+')" style="color:red">停用</a>' +' ' + |
| | | '<a href="#" onclick="TCoupon.delete('+row.id+')" style="color:red">删除</a>' |
| | | }else if (row.state === 2){ |
| | | return '<a href="#" onclick="TCoupon.start('+row.id+','+row.status+')" style="color:green">启用</a>' +' ' + |
| | | '<a href="#" onclick="TCoupon.delete('+row.id+')" style="color:red">删除</a>' |
| | | } |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | |
| | | */ |
| | | TCoupon.search = function () { |
| | | var queryData = {}; |
| | | queryData['condition'] = $("#condition").val(); |
| | | queryData['couponType'] = $("#couponType").val(); |
| | | queryData['couponServiceType'] = $("#couponServiceType").val(); |
| | | queryData['createtime'] = $("#createtime").val(); |
| | | TCoupon.table.refresh({query: queryData}); |
| | | }; |
| | | |