<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('常用问答管理表新增')" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-add">
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <!--is-required 增加星号 显示为必填-->
                            <label class="col-sm-3 control-label">问答ID:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="questionAnswerId" id="questionAnswerId" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">问答类型:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="questionAnswerType" id="questionAnswerType" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">问答摘要:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="summary" id="summary" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">问题内容:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="questionContent" id="questionContent" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">回答内容:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="answerContent" id="answerContent" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">适用药品，可以存储多个药品，用逗号分隔:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="applicableDrugs" id="applicableDrugs" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">排序权重:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="sortWeight" id="sortWeight" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">状态：启用，禁用:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="status" id="status" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">最后编辑时间:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="lastEditTime" id="lastEditTime" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">最后编辑人:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="lastEditor" id="lastEditor" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                </div>
            </div>

        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">

    function submitHandler() {
        if ($.validate.form()) {
            add();
        }
    }

    function add() {
           var questionAnswerId = $("input[name='questionAnswerId']").val();
           var questionAnswerType = $("input[name='questionAnswerType']").val();
           var summary = $("input[name='summary']").val();
           var questionContent = $("input[name='questionContent']").val();
           var answerContent = $("input[name='answerContent']").val();
           var applicableDrugs = $("input[name='applicableDrugs']").val();
           var sortWeight = $("input[name='sortWeight']").val();
           var status = $("input[name='status']").val();
           var lastEditTime = $("input[name='lastEditTime']").val();
           var lastEditor = $("input[name='lastEditor']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "dtp/sdtpyypzfaqmanagement/sDtpYypzFaqManagementAdd",
            data : {
                "questionAnswerId": questionAnswerId,
                "questionAnswerType": questionAnswerType,
                "summary": summary,
                "questionContent": questionContent,
                "answerContent": answerContent,
                "applicableDrugs": applicableDrugs,
                "sortWeight": sortWeight,
                "status": status,
                "lastEditTime": lastEditTime,
                "lastEditor": lastEditor,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
