<!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 id="form-SMdyyglMdygxxStoreemployeeinfo-add" class="customize-search-form">
        <div class="customize-form-group-container">
            <div class="customize-form-group">
                <label>序号:</label>
                <input name="sequenceNumber" placeholder="序号"  id="sequenceNumber" class="styled-input" type="number">
            </div>
            <div class="customize-form-group">
                <label>门店名称:</label>
                <input name="storeName" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择门店" class="styled-input" required>
            </div>
<!--            <div class="customize-form-group select-time">-->
<!--                <label>建档日期:</label>-->
<!--                <input name="jdDate" placeholder="建档日期"  id="jdDate" class="time-input time-input2" type="text">-->
<!--            </div>-->
<!--            <div class="customize-form-group">-->
<!--                <label>员工编码:</label>-->
<!--                <input name="employeeCode" placeholder="员工编码"  id="employeeCode" class="styled-input" type="text">-->
<!--            </div>-->
            <div class="customize-form-group">
                <label>员工姓名:</label>
                <input name="employeeName" placeholder="员工姓名"  id="employeeName" class="styled-input" type="text" required>
            </div>
            <div class="customize-form-group">
                <label>部门编号:</label>
                <input name="departmentId" placeholder="部门编号"  id="departmentId" class="styled-input" type="text">
            </div>
            <div class="customize-form-group">
                <label>门店编码:</label>
                <input name="storeCode" placeholder="门店编码"  id="storeCode" class="styled-input" type="text">
            </div>
            <div class="customize-form-group select-time">
                <label>出生日期:</label>
                <input name="birthDate" placeholder="出生日期"  id="birthDate" class="time-input time-input2" type="text">
            </div>
            <div class="customize-form-group">
                <label>联系电话:</label>
                <input name="contactNumber" placeholder="联系电话"  id="contactNumber" class="styled-input" type="number" maxlength="11" required>
            </div>
            <div class="customize-form-group">
                <label>民族:</label>
                <input name="nationality" placeholder="民族"  id="nationality" class="styled-input" type="text">
            </div>
            <div class="customize-form-group">
                <label>执证书编号:</label>
                <input name="certificateNumber" placeholder="执证书编号"  id="certificateNumber" class="styled-input" type="text">
            </div>
            <div class="customize-form-group">
                <label>资格证书:</label>
                <input name="qualificationCertificate" placeholder="资格证书"  id="qualificationCertificate" class="styled-input" type="text">
            </div>
            <div class="customize-form-group">
                <label>职务:</label>
                <input name="position" placeholder="职务"  id="position" class="styled-input" type="text">
            </div>
            <div class="customize-form-group">
                <label>毕业院校:</label>
                <input name="graduationInstitution" placeholder="毕业院校"  id="graduationInstitution" class="styled-input" type="text">
            </div>
            <div class="customize-form-group">
                <label>专业:</label>
                <input name="major" placeholder="专业"  id="major" class="styled-input" type="text">
            </div>
            <div class="customize-form-group">
                <label>文化专业:</label>
                <input name="educationalSpecialty" placeholder="文化专业"  id="educationalSpecialty" class="styled-input" type="text">
            </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 data = $("#form-SMdyyglMdygxxStoreemployeeinfo-add").serializeArray();
        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "mdyygl/smdyyglmdygxxstoreemployeeinfo/sMdyyglMdygxxStoreemployeeinfoAdd",
            data : data,
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
    /* 用户管理-新增-选择门店树 */
    function selectDeptTree() {
        var treeId = $("#treeId").val();
        var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
        var url = ctx + "system/user/selectDeptTree/" + deptId;
        var options = {
            title: '选择门店',
            width: "380",
            url: url,
            callBack: doSubmit
        };
        $.modal.openOptions(options);
    }

    function doSubmit(index, layero){
        var body = $.modal.getChildFrame(index);
        $("#treeId").val(body.find('#treeId').val());
        $("#treeName").val(body.find('#treeName').val());
        $.modal.close(index);
    }

</script>
</body>
</html>
