<!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">创建日期:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="creationDate" id="creationDate" 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="theme" id="theme" 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="includedMedicines" id="includedMedicines" 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="maintenanceMode" id="maintenanceMode" 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="servicePeriods" id="servicePeriods" 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="servedPeople" id="servedPeople" 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="isSmsTemplateConfigured" id="isSmsTemplateConfigured" 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="dataSource" id="dataSource" 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 creationDate = $("input[name='creationDate']").val();
           var theme = $("input[name='theme']").val();
           var includedMedicines = $("input[name='includedMedicines']").val();
           var maintenanceMode = $("input[name='maintenanceMode']").val();
           var servicePeriods = $("input[name='servicePeriods']").val();
           var status = $("input[name='status']").val();
           var servedPeople = $("input[name='servedPeople']").val();
           var isSmsTemplateConfigured = $("input[name='isSmsTemplateConfigured']").val();
           var dataSource = $("input[name='dataSource']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "jkgl/sjkglypwxserviceprojectinfo/sJkglYpwxServiceprojectinfoAdd",
            data : {
                "creationDate": creationDate,
                "theme": theme,
                "includedMedicines": includedMedicines,
                "maintenanceMode": maintenanceMode,
                "servicePeriods": servicePeriods,
                "status": status,
                "servedPeople": servedPeople,
                "isSmsTemplateConfigured": isSmsTemplateConfigured,
                "dataSource": dataSource,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
