<!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="channelName" id="channelName" 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="channelCode" id="channelCode" 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="channelType" id="channelType" 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="contactPerson" id="contactPerson" 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="contactPhone" id="contactPhone" 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="email" id="email" 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="address" id="address" 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="status" id="status" 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="createdAt" id="createdAt" 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="createdBy" id="createdBy" 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="updatedAt" id="updatedAt" 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="updatedBy" id="updatedBy" 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="remarks" id="remarks" 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 channelName = $("input[name='channelName']").val();
           var channelCode = $("input[name='channelCode']").val();
           var channelType = $("input[name='channelType']").val();
           var contactPerson = $("input[name='contactPerson']").val();
           var contactPhone = $("input[name='contactPhone']").val();
           var email = $("input[name='email']").val();
           var address = $("input[name='address']").val();
           var status = $("input[name='status']").val();
           var createdAt = $("input[name='createdAt']").val();
           var createdBy = $("input[name='createdBy']").val();
           var updatedAt = $("input[name='updatedAt']").val();
           var updatedBy = $("input[name='updatedBy']").val();
           var remarks = $("input[name='remarks']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "daas/sdaaschannelmanagement/sDaasChannelManagementAdd",
            data : {
                "channelName": channelName,
                "channelCode": channelCode,
                "channelType": channelType,
                "contactPerson": contactPerson,
                "contactPhone": contactPhone,
                "email": email,
                "address": address,
                "status": status,
                "createdAt": createdAt,
                "createdBy": createdBy,
                "updatedAt": updatedAt,
                "updatedBy": updatedBy,
                "remarks": remarks,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
