<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('渠道管理表修改')" />
</head>
<body>
<div class="ui-layout-center">
    <form id="form-SDaasChannelManagement-edit" class="customize-search-form">

        <div class="customize-form-group-container">
            <input type="hidden" id="id" name="id" th:value="${id}">
            <div class="customize-form-group">
                <label>渠道名称:</label>
                <input name="channelName" placeholder="渠道名称" th:value="${channelName}" class="styled-input" type="text">
            </div>
            <div class="customize-form-group">
                <label>渠道代码:</label>
                <input name="channelCode" placeholder="渠道代码" th:value="${channelCode}" class="styled-input" type="text" disabled="true">
            </div>
            <div class="customize-form-group">
                <label>渠道类型:</label>
                <select name="channelType"  class="styled-input"  th:with="type=${@dict.getType('sys_select_qdgl_qdlx')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
                            th:selected="${dict.dictLabel}==${channelType}"></option>
                </select>
            </div>
            <div class="customize-form-group">
                <label>联系人:</label>
                <input name="contactPerson" placeholder="联系人" th:value="${contactPerson}" class="styled-input" type="text">
            </div>
            <div class="customize-form-group">
                <label>联系电话:</label>
                <input name="contactPhone" placeholder="联系电话" th:value="${contactPhone}" class="styled-input" type="number" maxlength="11">
            </div>
            <div class="customize-form-group">
                <label>电子邮件:</label>
                <input name="email" placeholder="电子邮件" th:value="${email}" class="styled-input" type="text">
            </div>
            <div class="customize-form-group">
                <label>地址:</label>
                <input name="address" placeholder="地址" th:value="${address}" class="styled-input" type="text">
            </div>
            <div class="customize-form-group">
                <label>渠道状态</label>
                <select name="status"  class="styled-input"  th:with="type=${@dict.getType('sys_select_qdgl_qdzt')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
                            th:selected="${dict.dictLabel}==${status}"></option>
                </select>
            </div>
            <div class="customize-form-group">
                <label>创建时间:</label>
                <input name="createdAt" placeholder="创建时间" th:value="${createdAt}" class="styled-input" type="text" disabled="true">
            </div>
            <div class="customize-form-group">
                <label>创建人:</label>
                <input name="createdBy" placeholder="创建人" th:value="${createdBy}" class="styled-input" type="text" disabled="true">
            </div>
            <div class="customize-form-group">
                <label>更新时间:</label>
                <input name="updatedAt" placeholder="更新时间" th:value="${updatedAt}" class="styled-input" type="text" disabled="true">
            </div>
            <div class="customize-form-group">
                <label>更新人:</label>
                <input name="updatedBy" placeholder="更新人" th:value="${updatedBy}" class="styled-input" type="text" disabled="true">
            </div>
            <div class="customize-form-group">
                <label>备注:</label>
                <input name="remarks" placeholder="备注" th:value="${remarks}" class="styled-input" type="text">
            </div>
        </div>
    </form>
</div>
<div class="main-content">
    <div class="col-sm-offset-5 col-sm-10">
    </div>
</div>
<th:block th:include="include :: footer" />
</body>
</html>
<script>
    function edit() {
        var data = $("#form-SDaasChannelManagement-edit").serializeArray();
        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "daas/sdaaschannelmanagement/sDaasChannelManagementEdit",
            data : data,
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }

    function submitHandler() {
        if ($.validate.form()) {
            edit();
        }
    }
</script>
