<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('促销列表新增')" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-add">
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <!--is-required 增加星号 显示为必填-->
                            <label class="col-sm-3 control-label">活动名称:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="activityName" id="activityName" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">活动时间:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="activityTime" id="activityTime" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">促销类型:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="promotionType" id="promotionType" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">促销方式:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="promotionMethod" id="promotionMethod" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">参与人员:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="participants" id="participants" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">适用渠道:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="applicableChannels" id="applicableChannels" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">活动状态:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="activityStatus" id="activityStatus" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">创建时间:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="createTime" id="createTime" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">创建人:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="creator" id="creator" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                </div>
            </div>

        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">

    function submitHandler() {
        if ($.validate.form()) {
            add();
        }
    }

    function add() {
           var activityName = $("input[name='activityName']").val();
           var activityTime = $("input[name='activityTime']").val();
           var promotionType = $("input[name='promotionType']").val();
           var promotionMethod = $("input[name='promotionMethod']").val();
           var participants = $("input[name='participants']").val();
           var applicableChannels = $("input[name='applicableChannels']").val();
           var activityStatus = $("input[name='activityStatus']").val();
           var createTime = $("input[name='createTime']").val();
           var creator = $("input[name='creator']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "yxgl/syxglpromotioninfo/sYxglPromotioninfoAdd",
            data : {
                "activityName": activityName,
                "activityTime": activityTime,
                "promotionType": promotionType,
                "promotionMethod": promotionMethod,
                "participants": participants,
                "applicableChannels": applicableChannels,
                "activityStatus": activityStatus,
                "createTime": createTime,
                "creator": creator,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
