44323
2023-11-09 4f47865c3b8132f097cc32fe9bd8e0fa12469786
cloud-server-management/src/main/webapp/static/modular/system/tCouponExamine/TCouponExamine.js
@@ -15,18 +15,20 @@
    return [
        {field: 'selectItem', radio: true},
        {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'},
        {title: '发布省', field: 'province', visible: true, align: 'center', valign: 'middle'},
        {title: '发布城市', field: 'city', visible: true, align: 'center', valign: 'middle'},
        {title: '所属账号', field: 'account', visible: true, align: 'center', valign: 'middle'},
        {title: '优惠券名称', field: 'name', visible: true, align: 'center', valign: 'middle'},
        {title: '适用范围', field: 'useScope', visible: true, align: 'center', valign: 'middle'},
        {title: '适用范围', field: 'useScope', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row, index) {
                return {1: "全国", 2: "指定城市", 3: "指定门店"}[value]
            }
        },
        {title: '优惠券类型', field: 'type', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row, index) {
                return {1: "满减券", 2: "代金券", 3: "体验券"}[value]
            }},
        {title: '发放方式', field: 'distributionMethod', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row, index) {
                return {1: "积分购买", 2: "注册赠送", 3: "自动发券"}[value]
                return {1: "积分购买", 2: "注册赠送", 3: "自动发券",4:"课包赠送"}[value]
            }},
        {title: '有效期', field: 'timeValue', visible: true, align: 'center', valign: 'middle'},
        {title: '用户人群', field: 'userPopulation', visible: true, align: 'center', valign: 'middle',
@@ -74,24 +76,81 @@
    }
};
/**
 * 打开审核页面
 */
TCouponExamine.openExamine = function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '详情',
            area: ['800px', '420px'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tCouponExamine/couponExaminePage/' + TCouponExamine.seItem.id
        var index = layer.load(1,{
            type: 1
            , title: '优惠券审核'
            , area: ['50%', '50%']
            , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
            , id: 'layerDemo' //防止重复弹出cge
            , content: '<div class="form-horizontal">' +
                '                    <div class="col-sm-11" >' +
                '                    <div class="col-sm-11">' +
                '                        <div class="form-group">\n' +
                '                            <label class="col-sm-3 control-label">审核状态:</label>\n' +
                '                            <div class="col-sm-9">\n' +
                '                     <input type="radio" name="r1" value="2" checked> 通过   <input type="radio" name="r1" value="3" > 拒绝     '+
                '                            </div>\n' +
                '                        </div>\n' +
                '                        <div class="form-group">\n' +
                '                            <label class="col-sm-3 control-label">拒绝理由:</label>\n' +
                '                            <div class="col-sm-9">\n' +
                '                     <textarea id="text" style="width: 460px; height: 138px;"></textarea>  '+
                '                            </div>\n' +
                '                        </div>\n' +
                '                       </div>' +
                '                   </div>' +
                '</div>'
            , btn: ['关闭', '保存']
            , btnAlign: 'c' //按钮居中
            , shade:  0.5 //不显示遮罩
            ,load:1
            , yes: function () {
                layer.closeAll();
            },
            btn2:function () {
                var id = TCouponExamine.seItem.id;
                let audit = document.querySelector('input[name="r1"]:checked').value;
                let text = $("#text").val()
                if(audit==3){
                    if(text==''){
                        Feng.info("请输入拒绝理由")
                        return false;
                    }
                }
                var ajax = new $ax(Feng.ctxPath + "/tCouponExamine/examine", function (data) {
                    if (data.code == 200) {
                        Feng.success("操作成功!");
                        window.location.reload();
                        window.parent.layer.closeAll();
                    } else if(data=="repeat"){
                        window.location.reload();
                        window.parent.layer.closeAll();
                        Feng.error("请勿重复操作");
                    }else {
                        return  Feng.error(data.msg);
                    }
                }, function (data) {
                    Feng.error("操作失败!")
                    window.location.reload();
                    window.parent.layer.closeAll();
                    return   Feng.error("操作失败!");
                });
                ajax.set("id", id);
                ajax.set("state", audit);
                ajax.set("remark", text);
                ajax.start();
                layer.closeAll();
            }
        });
        this.layerIndex = index;
    }
};
/**