<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">

<head>
    <th:block th:include="include :: header('修改商品类目')"/>
    <th:block th:include="include :: select2-css"/>
</head>

<body>

<div class="main-content">
    <form class="form-horizontal" id="form-deptGoodsCategory-edit" th:object="${deptGoodsCategory}">
        <input id="deptGoodsCategoryId" name="deptGoodsCategoryId" type="hidden" th:field="*{deptGoodsCategoryId}"/>
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">类目名称：</label>
                    <div class="col-sm-8">
                        <input name="goodsCategoryName" placeholder="请输入商品名称" class="form-control" type="text" maxlength="30"
                               th:field="*{goodsCategoryName}"
                               disabled>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">一级分销扣点比例：</label>
                    <div class="col-sm-8">
                        <input name="oneRate" placeholder="请输入一级分销扣点比例" class="form-control" type="text" maxlength="12"
                               th:field="*{oneRate}"
                               required>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">二级分销扣点比例：</label>
                    <div class="col-sm-8">
                        <input name="twoRate" placeholder="请输入二级分销扣点比例" class="form-control" type="text"
                               th:field="*{twoRate}"
                               maxlength="12" required>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">三级分销扣点比例：</label>
                    <div class="col-sm-8">
                        <input name="threeRate" placeholder="请输入三级分销扣点比例" class="form-control" type="text" maxlength="12"
                               th:field="*{threeRate}"
                               required>
                    </div>
                </div>
            </div>
        </div>

        <h4 class="form-header h4">其他信息</h4>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">备注：</label>
                    <div class="col-xs-10">
                        <textarea name="remark" maxlength="500" class="form-control" rows="3"
                                  th:field="*{remark}"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>

<script type="text/javascript">
    var prefix = ctx + "goods/deptcategory";

    $("#form-deptGoodsCategory-edit").validate({
        onkeyup: false,
        rules: {},
        messages: {},
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-deptGoodsCategory-edit").serializeArray();
            $.operate.saveTab(prefix + "/edit", data);
            $.modal.close();
        }
    }

</script>
</body>
</html>