liujie
2023-08-16 db7fa6a91b9534ac90e219b6f554c54c43c83a5a
management/guns-admin/src/main/webapp/static/modular/system/tCoupon/tCoupon.js
@@ -49,7 +49,15 @@
            },
            {title: '条件金额', field: 'couponConditionalAmount', visible: true, align: 'center', valign: 'middle'},
            {title: '优惠金额', field: 'couponPreferentialAmount', visible: true, align: 'center', valign: 'middle'},
        {title: '数量', field: 'couponCount', visible: true, align: 'center', valign: 'middle'},
        {title: '数量', field: 'couponCount', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                if (row.couponCount === 0){
                    return '<span>无限制</span>'
                }else{
                    return row.couponCount
                }
            }
        },
        {title: '有效期', field: 'couponValidity', visible: true, align: 'center', valign: 'middle'},
            {title: '状态', field: 'couponState', visible: true, align: 'center', valign: 'middle',
                formatter: function (value, row) {
@@ -96,7 +104,7 @@
    var index = layer.open({
        type: 2,
        title: '添加',
        area: ['800px', '420px'], //宽高
        area: ['100%', '100%'], //宽高
        fix: false, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/tCoupon/tCoupon_add'
@@ -154,6 +162,28 @@
};
/**
 * 选择新人券或者活动券时
 */
TCoupon.changeCouponType = function (id,couponState) {
    //监听下拉菜单的变动操作
    $("#couponType").change(function(){
        // 如果选择活动券,将赠送数量隐藏
        if(this.value == 1){
            $("#changeCouponSendQuantity").hide()
        }
        if(this.value == ""){
            $("#changeCouponSendQuantity").hide()
        }
        if(this.value == 2){
            $("#changeCouponSendQuantity").show()
        }
    })
};
/**
 * 查询列表
 */
TCoupon.search = function () {
@@ -164,6 +194,16 @@
    TCoupon.table.refresh({query: queryData});
};
/**
 * 重置
 */
TCoupon.resetSearch = function (){
    $("#couponType").val('');
    $("#couponServiceType").val('');
    $("#createTime").val('');
    TCoupon.search();
}
$(function () {
    var defaultColunms = TCoupon.initColumn();
    var table = new BSTable(TCoupon.id, "/tCoupon/list", defaultColunms);