<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增工资科目')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-subject-add">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">科目种类：</label>
                    <div class="col-sm-8">
                        <select name="subjectType" class="form-control" th:with="type=${@dict.getType('subject_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">科目名：</label>
                    <div class="col-sm-8">
                        <input name="subjectName" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">基准标记：</label>
                    <div class="col-sm-8">
                        <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
                            <input type="radio" th:id="${'baseFlag_' + dict.dictCode}" name="baseFlag" th:value="${dict.dictValue}" th:checked="${dict.default}">
                            <label th:for="${'baseFlag_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">占比：</label>
                    <div class="col-sm-8">
                        <input name="percent" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">公式：</label>
                    <div class="col-sm-8">
                        <textarea name="formula" class="form-control"></textarea>
                    </div>
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "business/subject"
        $("#form-subject-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-subject-add').serialize());
            }
        }
    </script>
</body>
</html>