| | |
| | | TCoupon.initColumn = function () { |
| | | 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: 'id', visible: false, 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: '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: 'couponServiceType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponServiceType === 1){ |
| | | return '<span>通用型</span>' |
| | | } |
| | | } |
| | | }, |
| | | {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: false, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券状态', field: 'couponStatus', visible: false, align: 'center', valign: 'middle'}, |
| | | {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: 'couponValidity', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '赠送数量', field: 'couponSendQuantity', visible: false, align: 'center', valign: 'middle'} |
| | | ]; |
| | | }; |
| | | |
| | |
| | | }); |
| | | ajax.setData({ |
| | | userIds:$("#userIds").val(), |
| | | couponId:this.seItem.id, |
| | | couponName:this.seItem.couponName |
| | | }) |
| | | ajax.start(); |
| | |
| | | */ |
| | | TCoupon.search = function () { |
| | | var queryData = {}; |
| | | queryData['condition'] = $("#condition").val(); |
| | | queryData['couponName'] = $("#couponName").val(); |
| | | TCoupon.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCoupon.initColumn(); |
| | | var table = new BSTable(TCoupon.id, "/tCoupon/list", defaultColunms); |
| | | var table = new BSTable(TCoupon.id, "/tCoupon/activityCouponList", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TCoupon.table = table.init(); |
| | | }); |