<!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-edit" th:object="${salarySubject}">
            <input name="salarySubjectId" th:field="*{salarySubjectId}" type="hidden">
            <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}" th:field="*{subjectType}"></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" th:field="*{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:field="*{baseFlag}">
                            <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" th:field="*{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">[[*{formula}]]</textarea>
                    </div>
                </div>
            </div>

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

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