puzhibing
2023-07-31 c743f4413a00fc063bbbd9d851b6d0c3fff10581
cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js
@@ -37,13 +37,13 @@
 * 关闭此对话框
 */
couponInfoDlg.close = function () {
    parent.layer.close(window.parent.CouponServer.layerIndex);
    parent.layer.close(window.parent.TCoupon.layerIndex);
}
function ajax(serverCouponId, value, remark) {
    var ajax = new $ax(Feng.ctxPath + "/couponServer/examine", function (data) {
        Feng.success("审核成功!");
        window.parent.CouponServer.table.refresh();
        window.parent.TCoupon.table.refresh();
        couponInfoDlg.close();
    }, function (data) {
        Feng.error("审核失败!" + data.responseJSON.message + "!");
@@ -56,43 +56,195 @@
    ajax.start();
}
function refush() {
    $("#detailBox").show()
}
function agree() {
    $("#detailBox").hide()
}
function checkCompany() {
/**
 * 发放方式1
 */
function distributionMethod1() {
    $("#demo2").hide()
}
function checkCompany2() {
/**
 * 发放方式2
 */
function distributionMethod2() {
    $("#demo2").hide()
}
/**
 * 发放方式3
 */
function distributionMethod3() {
    $("#demo2").hide()
}
/**
 * 兑换方式1
 */
function exchangeMethod1() {
    $("#demo2").show()
}
/**
 * 兑换方式2
 */
function exchangeMethod2() {
    $("#demo2").show()
}
/**
 * 兑换方式3
 */
function exchangeMethod3() {
    $("#demo2").show()
}
/**
 * 全部用户
 */
function userGroup1() {
    $("#demo2").show()
}
/**
 * 年度会员
 */
function userGroup2() {
    $("#demo2").show()
}
/**
 * 已有学员用户
 */
function userGroup3() {
    $("#demo2").show()
}
/**
 * 全国通用
 */
function scopeOfApplication1() {
    $("#storeSelect").hide()
    $("#citySelect").hide()
}
/**
 * 指定城市
 */
function scopeOfApplication2() {
    $("#demo2").show()
}
/**
 * 指定门店
 */
function scopeOfApplication3() {
    $("#demo2").show()
}
/**
 * 满减券
 */
function radio1() {
    $("#time").val('')
    // document.getElementById("time").readOnly = true;
    $("#time").attr('disabled', 'disabled');
    $("#createTime").removeAttr("disabled");
    $("#conditionalAmount").removeAttr("disabled");
    $("#deductionAmount").removeAttr("disabled");
    $("#voucherAmount").val('')
    $("#voucherAmount").attr('disabled', 'disabled');
    $("#experienceName").val('')
    $("#experienceName").attr('disabled', 'disabled');
}
/**
 * 代金券
 */
function radio2() {
    $("#createTime").val('')
    // document.getElementById("time").readOnly = false;
    $("#time").removeAttr("disabled");
    $("#createTime").attr('disabled', 'disabled');
    $("#voucherAmount").removeAttr("disabled");
    $("#conditionalAmount").val('')
    $("#deductionAmount").val('')
    $("#deductionAmount").attr('disabled', 'disabled');
    $("#conditionalAmount").attr('disabled', 'disabled');
    $("#experienceName").val('')
    $("#experienceName").attr('disabled', 'disabled');
}
/**
 * 体验券
 */
function radio3() {
    $("#time").val('')
    $("#createTime").val('')
    //document.getElementById("createTime").readOnly = true;
    // document.getElementById("time").readOnly = true;
    $("#createTime").attr('disabled', 'disbled');
    $("#time").attr('disabled', 'disabled');
    $("#experienceName").removeAttr("disabled");
    $("#conditionalAmount").val('')
    $("#deductionAmount").val('')
    $("#deductionAmount").attr('disabled', 'disabled');
    $("#conditionalAmount").attr('disabled', 'disabled');
    $("#voucherAmount").val('')
    $("#voucherAmount").attr('disabled', 'disabled');
}
couponInfoDlg.addBranch = function () {
    let companies = [];
    let brands = [];
    $.ajax({
        url : Feng.ctxPath + "/tbMemberTag/getCompanyAndBranch",
        method:'POST',
        success:function (res) {
            companies = res.companies;
            brands = res.brands;
            var str = "                            <div class=\"col-sm-12\">\n" +
                "                                <label class=\"col-sm-1\">公司</label>\n" +
                "                                <select class=\"col-sm-2\" id=\"brandCompany\" name='brandCompany' style=\"width: 88px\">\n" +
                "                                    <option value=\"\">全部公司</option>\n";
            if (companies.length > 0) {
                for (let i = 0; i < companies.length; i++) {
                    str += '<option value="'+companies[i].id+'">'+companies[i].name+'</option>'
                }
            }
            str+= "                                </select>\n" +
                "                                <label class=\"col-sm-1\">品牌</label>\n" +
                "                                <select class=\"col-sm-2\" id=\"brandName\" name='brandName' style=\"width: 88px\">\n" +
                "                                    <option value=\"\">全部品牌</option>\n";
            if (brands.length > 0) {
                for (let i = 0; i < brands.length; i++) {
                    str += '<option value="' + brands[i].id + '">' + brands[i].name + '</option>';
                }
            }
            str += "                                </select>\n" +
                "                                <div class=\"col-sm-2\">\n" +
                "                                    <input class=\"form-control\" id=\"brandDays\" name='brandDays' placeholder=\"近30天\" type=\"number\" min=\"1\"\n" +
                "                                           max=\"31\">\n" +
                "                                </div>\n" +
                "                                <select class=\"col-sm-2\" id=\"brandSymbol\" name='brandSymbol' style=\"width: 88px\">\n" +
                "                                    <option value=\"1\"> =</option>\n" +
                "                                    <option value=\"2\"> ></option>\n" +
                "                                    <option value=\"3\"> <</option>\n" +
                "                                </select>\n" +
                "                                <div class=\"col-sm-2\">\n" +
                "                                    <input class=\"form-control\" id=\"brandCount\" name='brandCount' placeholder=\"次\">\n" +
                "                                </div>\n" +
                "                                <div class=\"col-sm-1\">\n" +
                "                                    <label id=\"addBranch\" onclick='TbMemberTagInfoDlg.addBranch()' class=\"form-control\" style=\"border: 0px;cursor: pointer\"><i class=\"fa fa-plus\"></i></label>\n" +
                "                                </div>\n" +
                "                                <div class=\"col-sm-1\">\n" +
                "                                    <label id=\"addBranch\" onclick='TbMemberTagInfoDlg.subtract(this)' class=\"form-control\" style=\"border: 0px;cursor: pointer\"><i class=\"fa fa-minus\"></i></label>\n" +
                "                                </div>\n" +
                "                            </div>";
            $("#branch").append($(str));
        }
    })
}
couponInfoDlg.delete = function () {
}
/**