<!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}"/>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-6 control-label is-required">类目名称：</label>
                    <div class="col-sm-6">
                        <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-6 control-label is-required">一级分销扣点比例：</label>
                    <div class="col-sm-6">
                        <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-6 control-label is-required">二级分销扣点比例：</label>
                    <div class="col-sm-6">
                        <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-6 control-label is-required">三级分销扣点比例：</label>
                    <div class="col-sm-6">
                        <input name="threeRate" placeholder="请输入三级分销扣点比例" class="form-control" type="text" maxlength="12"
                               th:field="*{threeRate}"
                               required>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-6 control-label is-required">平台扣点比例：</label>
                    <div class="col-sm-6">
                        <input name="deptRate" placeholder="请输入平台扣点比例" class="form-control" type="text"
                               th:field="*{deptRate}"
                               maxlength="12" required>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-6 control-label is-required">平台固定扣金额：</label>
                    <div class="col-sm-6">
                        <input name="deptMoney" placeholder="请输入平台固定扣金额" class="form-control" type="text" maxlength="12"
                               th:field="*{deptMoney}"
                               required>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-6 control-label is-required">截留扣点：</label>
                    <div class="col-sm-6">
                        <input name="retainRate" placeholder="请输入截留扣点" class="form-control" type="text"
                               th:field="*{retainRate}"
                               maxlength="12" required>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-6 control-label is-required">截留金额：</label>
                    <div class="col-sm-6">
                        <input name="retainMoney" placeholder="请输入截留金额" class="form-control" type="text" maxlength="12"
                               th:field="*{retainMoney}"
                               required>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-6 control-label">是否热门类目：</label>
                    <div class="col-sm-6">
                        <select name="isHot" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                            <option th:text="是" th:value="1"/>
                            <option th:text="否" th:value="0"/>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">备注：</label>
                    <div class="col-sm-9">
                        <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>