| | |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '创建时间', field: 'createtime', 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', |
| | | formatter: function (value, row) { |
| | |
| | | {title: '优惠券码', field: 'couponCode', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券状态', field: 'couponStatus', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponType === 1){ |
| | | if (row.couponStatus === 1){ |
| | | return '<span>未发放</span>' |
| | | }else if (row.couponType === 2){ |
| | | }else if (row.couponStatus === 2){ |
| | | return '<span>未使用</span>' |
| | | }else if (row.couponType === 3){ |
| | | }else if (row.couponStatus === 3){ |
| | | return '<span>已使用</span>' |
| | | }else if (row.couponType === 4){ |
| | | }else if (row.couponStatus === 4){ |
| | | return '<span>已过期</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '服务类型', field: 'couponServiceType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponType === 1){ |
| | | if (row.couponServiceType === 1){ |
| | | return '<span>通用型</span>' |
| | | } |
| | | } |
| | |
| | | {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: 'couponState', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponState === 1){ |
| | | return '<span>正常</span>' |
| | | }else if (row.couponState === 2){ |
| | | return '<span>冻结</span>' |
| | | }else if (row.couponState === 3){ |
| | | return '<span>已删除</span>' |
| | | } |
| | | }}, |
| | | {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>' +' ' + |
| | | if (row.couponState === 1){ |
| | | return '<a href="#" onclick="TCoupon.stop('+row.id+','+row.couponState+')" 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>' +' ' + |
| | | }else if (row.couponState === 2){ |
| | | return '<a href="#" onclick="TCoupon.start('+row.id+','+row.couponState+')" style="color:green">启用</a>' +' ' + |
| | | '<a href="#" onclick="TCoupon.delete('+row.id+')" style="color:red">删除</a>' |
| | | } |
| | | } |
| | |
| | | var queryData = {}; |
| | | queryData['couponType'] = $("#couponType").val(); |
| | | queryData['couponServiceType'] = $("#couponServiceType").val(); |
| | | queryData['createtime'] = $("#createtime").val(); |
| | | queryData['createTime'] = $("#createTime").val(); |
| | | TCoupon.table.refresh({query: queryData}); |
| | | }; |
| | | |