<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <base th:href="${#request.getContextPath() + '/'}">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
    <link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="assets/js/vendor/viewer/viewer.min.css" media="all">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
    <div class="layui-card">
        <div class="layui-card-header">
            <span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
              <a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
              <a href="javascript:void(0);"><cite>新增内容</cite></a>
            </span>
        </div>
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form layui-form-pane" lay-filter="dataForm">
                <div class="layui-row">
                    <div class="layui-col-md1">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">上传头像</label>
                            <div class="layui-input-block">
                                <input type="hidden" id="userPhotoId" name="userPhotoId">
                                <div class="layui-btn-container" id="userPhotoIdFileBox" style="border: 1px solid #e6e6e6; height: 118px;"></div>
                                <script id="userPhotoIdFileDownload" type="text/html">
                                    {{# var fileName = 'userPhotoId'; }}
                                    {{# if(d[fileName].length > 0) { }}
                                    {{#    var files = d[fileName];}}
                                    {{#    for(var i = 0, item = files[i]; item = files[i++];) { }}
                                    <div class="upload-image-box">
                                        <span class="upload-image-span">
                                            <img src="route/file/download/false/{{item.fileId}}" align="加载失败">
                                        </span>
                                        <a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-image" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="userPhotoIdRemoveFile">
                                            <i class="fa fa-trash-o"></i>
                                        </a>
                                    </div>
                                    {{#    } }}
                                    {{# } }}
                                    {{# if(d[fileName].length == 0) { }}
                                    <div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
                                        <a href="javascript:void(0);" lay-form-button data-explain="上传头像" data-name="userPhotoId" lay-filter="userPhotoIdUploadFile">
                                            <i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
                                        </a>
                                    </div>
                                    {{# } }}
                                </script>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md2">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">身份证(正面)</label>
                            <div class="layui-input-block">
                                <input type="hidden" id="idCardFront" name="idCardFront">
                                <div class="layui-btn-container" id="idCardFrontFileBox" style="border: 1px solid #e6e6e6; height: 118px;"></div>
                                <script id="idCardFrontFileDownload" type="text/html">
                                    {{# var fileName = 'idCardFront'; }}
                                    {{# if(d[fileName].length > 0) { }}
                                    {{#    var files = d[fileName];}}
                                    {{#    for(var i = 0, item = files[i]; item = files[i++];) { }}
                                    <div class="upload-image-box">
                                        <span class="upload-image-span">
                                            <img src="route/file/download/false/{{item.fileId}}" align="加载失败">
                                        </span>
                                        <a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-image" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="idCardFrontRemoveFile">
                                            <i class="fa fa-trash-o"></i>
                                        </a>
                                    </div>
                                    {{#    } }}
                                    {{# } }}
                                    {{# if(d[fileName].length == 0) { }}
                                    <div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
                                        <a href="javascript:void(0);" lay-form-button data-explain="身份证(正面)" data-name="idCardFront" lay-filter="idCardFrontUploadFile">
                                            <i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
                                        </a>
                                    </div>
                                    {{# } }}
                                </script>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md2">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">身份证(反面)</label>
                            <div class="layui-input-block">
                                <input type="hidden" id="idCardBack" name="idCardBack">
                                <div class="layui-btn-container" id="idCardBackFileBox" style="border: 1px solid #e6e6e6; height: 118px;"></div>
                                <script id="idCardBackFileDownload" type="text/html">
                                    {{# var fileName = 'idCardBack'; }}
                                    {{# if(d[fileName].length > 0) { }}
                                    {{#    var files = d[fileName];}}
                                    {{#    for(var i = 0, item = files[i]; item = files[i++];) { }}
                                    <div class="upload-image-box">
                                        <span class="upload-image-span">
                                            <img src="route/file/download/false/{{item.fileId}}" align="加载失败">
                                        </span>
                                        <a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-image" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="idCardBackRemoveFile">
                                            <i class="fa fa-trash-o"></i>
                                        </a>
                                    </div>
                                    {{#    } }}
                                    {{# } }}
                                    {{# if(d[fileName].length == 0) { }}
                                    <div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
                                        <a href="javascript:void(0);" lay-form-button data-explain="身份证(反面)" data-name="idCardBack" lay-filter="idCardBackUploadFile">
                                            <i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
                                        </a>
                                    </div>
                                    {{# } }}
                                </script>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md2">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">学历证书</label>
                            <div class="layui-input-block">
                                <input type="hidden" id="educationPhoto" name="educationPhoto">
                                <div class="layui-btn-container" id="educationPhotoFileBox" style="border: 1px solid #e6e6e6; height: 118px;"></div>
                                <script id="educationPhotoFileDownload" type="text/html">
                                    {{# var fileName = 'educationPhoto'; }}
                                    {{# if(d[fileName].length > 0) { }}
                                    {{#    var files = d[fileName];}}
                                    {{#    for(var i = 0, item = files[i]; item = files[i++];) { }}
                                    <div class="upload-image-box">
                                        <span class="upload-image-span">
                                            <img src="route/file/download/false/{{item.fileId}}" align="加载失败">
                                        </span>
                                        <a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-image" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="educationPhotoRemoveFile">
                                            <i class="fa fa-trash-o"></i>
                                        </a>
                                    </div>
                                    {{#    } }}
                                    {{# } }}
                                    {{# if(d[fileName].length < 2) { }}
                                    <div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
                                        <a href="javascript:void(0);" lay-form-button data-explain="学历证书" data-name="educationPhoto" lay-filter="educationPhotoUploadFile">
                                            <i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
                                        </a>
                                    </div>
                                    {{# } }}
                                </script>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md2">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">体检表</label>
                            <div class="layui-input-block">
                                <input type="hidden" id="bodyExamPhoto" name="bodyExamPhoto">
                                <div class="layui-btn-container" id="bodyExamPhotoFileBox" style="border: 1px solid #e6e6e6; height: 118px;"></div>
                                <script id="bodyExamPhotoFileDownload" type="text/html">
                                    {{# var fileName = 'bodyExamPhoto'; }}
                                    {{# if(d[fileName].length > 0) { }}
                                    {{#    var files = d[fileName];}}
                                    {{#    for(var i = 0, item = files[i]; item = files[i++];) { }}
                                    <div class="upload-image-box">
                                        <span class="upload-image-span">
                                            <img src="route/file/download/false/{{item.fileId}}" align="加载失败">
                                        </span>
                                        <a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-image" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="bodyExamPhotoRemoveFile">
                                            <i class="fa fa-trash-o"></i>
                                        </a>
                                    </div>
                                    {{#    } }}
                                    {{# } }}
                                    {{# if(d[fileName].length < 2) { }}
                                    <div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
                                        <a href="javascript:void(0);" lay-form-button data-explain="体检表" data-name="bodyExamPhoto" lay-filter="bodyExamPhotoUploadFile">
                                            <i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
                                        </a>
                                    </div>
                                    {{# } }}
                                </script>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md3">
                        <div class="layui-form-item">
                            <label class="layui-form-label"><span style="color: red">*</span>姓名</label>
                            <div class="layui-input-block">
                                <input type="text" id="fullName" name="fullName" class="layui-input" value="" autocomplete="off" placeholder="请输入全名" lay-verify="required">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-form-item">
                            <label class="layui-form-label"><span style="color: red">*</span>联系方式</label>
                            <div class="layui-input-block">
                                <input type="text" id="telephone" name="telephone" class="layui-input" autocomplete="off" value="" placeholder="请输入联系方式(手机号码或固话)" lay-verify="phone">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-form-item">
                            <label class="layui-form-label">曾用名</label>
                            <div class="layui-input-block">
                                <input type="text" id="nameUsedBefore" name="nameUsedBefore" class="layui-input" value="" autocomplete="off" placeholder="请输入曾用名(非必填)">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-form-item">
                            <label class="layui-form-label">性别</label>
                            <div class="layui-input-block layui-form" id="genderSelectTemplateBox" lay-filter="genderSelectTemplateBox"></div>
                            <script id="genderSelectTemplate" type="text/html">
                                <select id="gender" name="gender">
                                    <option value="">请选择性别</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.dataId}}">{{item.dataName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md3">
                        <div class="layui-form-item">
                            <label class="layui-form-label">证件类型</label>
                            <div class="layui-input-block layui-form" id="cardTypeSelectTemplateBox" lay-filter="cardTypeSelectTemplateBox"></div>
                            <script id="cardTypeSelectTemplate" type="text/html">
                                <select id="cardType" name="cardType" lay-search>
                                    <option value="">请选择证件类型(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.dataId}}">{{item.dataName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-form-item">
                            <label class="layui-form-label">证件证号</label>
                            <div class="layui-input-block">
                                <input type="text" id="idCardNumber" name="idCardNumber" class="layui-input" value="" autocomplete="off" placeholder="请输入公民身份证号">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md2">
                        <div class="layui-form-item">
                            <label class="layui-form-label">出生日期</label>
                            <div class="layui-input-block">
                                <input type="text" id="birthDate" name="birthDate" class="layui-input" value="" placeholder="请选择出生日期" readonly style="cursor: pointer;">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md2">
                        <div class="layui-form-item">
                            <label class="layui-form-label">民族</label>
                            <div class="layui-input-block layui-form" id="nationSelectTemplateBox" lay-filter="nationSelectTemplateBox"></div>
                            <script id="nationSelectTemplate" type="text/html">
                                <select id="nation" name="nation" lay-search>
                                    <option value="">请选择民族(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.dataId}}">{{item.dataName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                    <div class="layui-col-md2">
                        <div class="layui-form-item">
                            <label class="layui-form-label">宗教信仰</label>
                            <div class="layui-input-block layui-form" id="religionSelectTemplateBox" lay-filter="religionSelectTemplateBox"></div>
                            <script id="religionSelectTemplate" type="text/html">
                                <select id="religion" name="religion" lay-search>
                                    <option value="">请选择宗教信仰</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.dataId}}">{{item.dataName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md3">
                        <div class="layui-form-item">
                            <label class="layui-form-label">学历</label>
                            <div class="layui-input-block layui-form" id="educationSelectTemplateBox" lay-filter="educationSelectTemplateBox"></div>
                            <script id="educationSelectTemplate" type="text/html">
                                <select id="education" name="education" lay-search>
                                    <option value="">请选择学历(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.dataId}}">{{item.dataName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-form-item">
                            <label class="layui-form-label">政治面貌</label>
                            <div class="layui-input-block layui-form" id="politicalStatusSelectTemplateBox" lay-filter="politicalStatusSelectTemplateBox"></div>
                            <script id="politicalStatusSelectTemplate" type="text/html">
                                <select id="politicalStatus" name="politicalStatus" lay-search>
                                    <option value="">请选择政治面貌(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.dataId}}">{{item.dataName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-form-item">
                            <label class="layui-form-label">婚姻情况</label>
                            <div class="layui-input-block layui-form" id="maritalStatusSelectTemplateBox" lay-filter="maritalStatusSelectTemplateBox"></div>
                            <script id="maritalStatusSelectTemplate" type="text/html">
                                <select id="maritalStatus" name="maritalStatus" lay-search>
                                    <option value="">请选择婚姻情况</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.dataId}}">{{item.dataName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md3">
                        <div class="layui-form-item">
                            <label class="layui-form-label">职业类别</label>
                            <div class="layui-input-block layui-form" id="occupationCategorySelectTemplateBox" lay-filter="occupationCategorySelectTemplateBox"></div>
                            <script id="occupationCategorySelectTemplate" type="text/html">
                                <select id="occupationCategory" name="occupationCategory" lay-search>
                                    <option value="">请选择职业类别(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.dataId}}">{{item.dataName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-form-item">
                            <label class="layui-form-label">职业</label>
                            <div class="layui-input-block">
                                <input type="text" id="occupation" name="occupation" class="layui-input" value="" autocomplete="off" placeholder="请输入职业">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <div class="layui-form-item">
                            <label class="layui-form-label">工作单位</label>
                            <div class="layui-input-block">
                                <input type="text" id="serviceSpace" name="serviceSpace" class="layui-input" autocomplete="off" value="" placeholder="例如公司名称、工作地点" >
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <label class="layui-form-label">籍贯</label>
                            <div class="layui-input-block layui-form" id="nativePlaceSelectTemplateBox" lay-filter="nativePlaceSelectTemplateBox"></div>
                            <script id="nativePlaceSelectTemplate" type="text/html">
                                <select id="nativePlace" name="nativePlace" lay-filter="nativePlace" lay-search>
                                    <option value="">请选择籍贯(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.areaId}}" data-areaid="{{item.areaId}}">{{item.areaName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <div class="layui-input-block layui-form" style="margin-left: 1px;" id="nativePlace1SelectTemplateBox" lay-filter="nativePlace1SelectTemplateBox"></div>
                            <script id="nativePlace1SelectTemplate" type="text/html">
                                <select id="nativePlace1" name="nativePlace1" lay-filter="nativePlace1" lay-search>
                                    <option value="">请选择(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.areaId}}" data-areaid="{{item.areaId}}">{{item.areaName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <div class="layui-input-block layui-form" style="margin-left: 1px;" id="nativePlace2SelectTemplateBox" lay-filter="nativePlace2SelectTemplateBox"></div>
                            <script id="nativePlace2SelectTemplate" type="text/html">
                                <select id="nativePlace2" name="nativePlace2" lay-search>
                                    <option value="">请选择(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.areaId}}">{{item.areaName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md12">
                        <div class="layui-form-item">
                            <label class="layui-form-label">籍贯地址</label>
                            <div class="layui-input-block">
                                <input type="text" id="nativePlaceAddr" name="nativePlaceAddr" class="layui-input" autocomplete="off" value="" placeholder="请输入籍贯详细地址">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <label class="layui-form-label">户籍地</label>
                            <div class="layui-input-block layui-form" id="registeredResidenceSelectTemplateBox" lay-filter="registeredResidenceSelectTemplateBox"></div>
                            <script id="registeredResidenceSelectTemplate" type="text/html">
                                <select id="registeredResidence" name="registeredResidence" lay-filter="registeredResidence" lay-search>
                                    <option value="">请选择户籍地(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.areaId}}" data-areaid="{{item.areaId}}">{{item.areaName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <div class="layui-input-block layui-form" style="margin-left: 1px;" id="registeredResidence1SelectTemplateBox" lay-filter="registeredResidence1SelectTemplateBox"></div>
                            <script id="registeredResidence1SelectTemplate" type="text/html">
                                <select id="registeredResidence1" name="registeredResidence1" lay-filter="registeredResidence1" lay-search>
                                    <option value="">请选择(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.areaId}}" data-areaid="{{item.areaId}}">{{item.areaName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <div class="layui-input-block layui-form" style="margin-left: 1px;" id="registeredResidence2SelectTemplateBox" lay-filter="registeredResidence2SelectTemplateBox"></div>
                            <script id="registeredResidence2SelectTemplate" type="text/html">
                                <select id="registeredResidence2" name="registeredResidence2" lay-search>
                                    <option value="">请选择(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.areaId}}">{{item.areaName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md12">
                        <div class="layui-form-item">
                            <label class="layui-form-label">详细地址</label>
                            <div class="layui-input-block">
                                <input type="text" id="registeredResidenceAddr" name="registeredResidenceAddr" class="layui-input" autocomplete="off" value="" placeholder="请输入户籍详细地址">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <label class="layui-form-label">现住地</label>
                            <div class="layui-input-block layui-form" id="currentResidenceSelectTemplateBox" lay-filter="currentResidenceSelectTemplateBox"></div>
                            <script id="currentResidenceSelectTemplate" type="text/html">
                                <select id="currentResidence" name="currentResidence" lay-filter="currentResidence" lay-search>
                                    <option value="">请选择现住地(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.areaId}}" data-areaid="{{item.areaId}}">{{item.areaName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <div class="layui-input-block layui-form" style="margin-left: 1px" id="currentResidence1SelectTemplateBox" lay-filter="currentResidence1SelectTemplateBox"></div>
                            <script id="currentResidence1SelectTemplate" type="text/html">
                                <select id="currentResidence1" name="currentResidence1" lay-filter="currentResidence1" lay-search>
                                    <option value="">请选择现住地(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.areaId}}" data-areaid="{{item.areaId}}">{{item.areaName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <div class="layui-input-block layui-form" style="margin-left: 1px" id="currentResidence2SelectTemplateBox" lay-filter="currentResidence2SelectTemplateBox"></div>
                            <script id="currentResidence2SelectTemplate" type="text/html">
                                <select id="currentResidence2" name="currentResidence2" lay-search>
                                    <option value="">请选择现住地(支持搜索)</option>
                                    {{# for(var i = 0, item; item = d[i++];) { }}
                                    <option value="{{item.areaId}}">{{item.areaName}}</option>
                                    {{# } }}
                                </select>
                            </script>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md12">
                        <div class="layui-form-item">
                            <label class="layui-form-label">详细地址</label>
                            <div class="layui-input-block">
                                <input type="text" id="currentResidenceAddr" name="currentResidenceAddr" class="layui-input" value="" autocomplete="off" placeholder="请输入现住地详细地址">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交新增</button>
                            <button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
    layui.config({
        base: 'assets/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'laydate', 'laytpl', 'upload'], function(){
        var $ = layui.$;
        var $win = $(window);
        var form = layui.form;
        var laytpl = layui.laytpl;
        var laydate = layui.laydate;
        var viewerObj = {};

        // 初始化内容
        function initData() {
            initBirthDateDate();
            initGenderSelect()
            initCardTypeSelect();
            initNationSelect();
            initPoliticalStatusSelect();
            initMaritalStatusSelect();
            initEducationSelect();
            initReligionSelect();
            initOccupationCategorySelect();
            initNativePlaceSelect();
            initNativePlace1Select();
            initNativePlace2Select();
            initRegisteredResidenceSelect();
            initRegisteredResidence1Select('');
            initRegisteredResidence2Select('');
            initCurrentResidenceSelect();
            initCurrentResidence1Select('');
            initCurrentResidence2Select('');
            initUserPhotoIdUploadFile();
            initIdCardFrontUploadFile();
            initIdCardBackUploadFile();
            initEducationPhotoUploadFile();
            initBodyExamPhotoUploadFile();
        }
        initData();

        function initUserPhotoIdUploadFile() {
            var files = $('#userPhotoId').val();
            initFileList('userPhotoId', files, function(fileName) {
                var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false});
                viewerObj[fileName] = viewer;
            });
            form.on('button(userPhotoIdUploadFile)', function(obj) {
                var name = this.dataset.name;
                var explain = this.dataset.explain;
                top.dialog.file({
                    type: 'image',
                    title: '上传'+ explain,
                    width: '400px',
                    height: '420px',
                    maxFileCount: '1',
                    onClose: function() {
                        var uploadFileArray = top.dialog.dialogData.uploadFileArray;
                        if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
                            var files = $('#'+ name).val();
                            for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
                                if(files.length > 0) {
                                    files += ',';
                                }
                                files += file.data;
                            }
                            initFileList(name, files, function(fileName) {
                                viewerObj[fileName].update();
                            });
                        }
                    }
                });
            });
            form.on('button(userPhotoIdRemoveFile)', function(obj) {
                var name = this.dataset.name;
                var id = this.dataset.id;
                var files = $('#'+ name).val().replace(id, '');
                files = files.replace(/\,+/g, ',');
                if(files.charAt(0) == ',') {
                    files = files.substring(1);
                }
                if(files.charAt(files.length - 1) == ',') {
                    files = files.substring(0, files.length - 1);
                }
                initFileList(name, files, function(fileName) {
                    viewerObj[fileName].update();
                });
            });
        }

        function initIdCardFrontUploadFile() {
            var files = $('#idCardFront').val();
            initFileList('idCardFront', files, function(fileName) {
                var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false});
                viewerObj[fileName] = viewer;
            });
            form.on('button(idCardFrontUploadFile)', function(obj) {
                var name = this.dataset.name;
                var explain = this.dataset.explain;
                top.dialog.file({
                    type: 'image',
                    title: '上传'+ explain,
                    width: '400px',
                    height: '420px',
                    maxFileCount: '1',
                    onClose: function() {
                        var uploadFileArray = top.dialog.dialogData.uploadFileArray;
                        if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
                            var files = $('#'+ name).val();
                            for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
                                if(files.length > 0) {
                                    files += ',';
                                }
                                files += file.data;
                            }
                            initFileList(name, files, function(fileName) {
                                viewerObj[fileName].update();
                            });
                        }
                    }
                });
            });
            form.on('button(idCardFrontRemoveFile)', function(obj) {
                var name = this.dataset.name;
                var id = this.dataset.id;
                var files = $('#'+ name).val().replace(id, '');
                files = files.replace(/\,+/g, ',');
                if(files.charAt(0) == ',') {
                    files = files.substring(1);
                }
                if(files.charAt(files.length - 1) == ',') {
                    files = files.substring(0, files.length - 1);
                }
                initFileList(name, files, function(fileName) {
                    viewerObj[fileName].update();
                });
            });
        }

        function initIdCardBackUploadFile() {
            var files = $('#idCardBack').val();
            initFileList('idCardBack', files, function(fileName) {
                var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false});
                viewerObj[fileName] = viewer;
            });
            form.on('button(idCardBackUploadFile)', function(obj) {
                var name = this.dataset.name;
                var explain = this.dataset.explain;
                top.dialog.file({
                    type: 'image',
                    title: '上传'+ explain,
                    width: '400px',
                    height: '420px',
                    maxFileCount: '1',
                    onClose: function() {
                        var uploadFileArray = top.dialog.dialogData.uploadFileArray;
                        if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
                            var files = $('#'+ name).val();
                            for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
                                if(files.length > 0) {
                                    files += ',';
                                }
                                files += file.data;
                            }
                            initFileList(name, files, function(fileName) {
                                viewerObj[fileName].update();
                            });
                        }
                    }
                });
            });
            form.on('button(idCardBackRemoveFile)', function(obj) {
                var name = this.dataset.name;
                var id = this.dataset.id;
                var files = $('#'+ name).val().replace(id, '');
                files = files.replace(/\,+/g, ',');
                if(files.charAt(0) == ',') {
                    files = files.substring(1);
                }
                if(files.charAt(files.length - 1) == ',') {
                    files = files.substring(0, files.length - 1);
                }
                initFileList(name, files, function(fileName) {
                    viewerObj[fileName].update();
                });
            });
        }

        function initEducationPhotoUploadFile() {
            var files = $('#educationPhoto').val();
            initFileList('educationPhoto', files, function(fileName) {
                var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false});
                viewerObj[fileName] = viewer;
            });
            form.on('button(educationPhotoUploadFile)', function(obj) {
                var name = this.dataset.name;
                var explain = this.dataset.explain;
                top.dialog.file({
                    type: 'image',
                    title: '上传'+ explain,
                    width: '400px',
                    height: '420px',
                    maxFileCount: '1',
                    onClose: function() {
                        var uploadFileArray = top.dialog.dialogData.uploadFileArray;
                        if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
                            var files = $('#'+ name).val();
                            for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
                                if(files.length > 0) {
                                    files += ',';
                                }
                                files += file.data;
                            }
                            initFileList(name, files, function(fileName) {
                                viewerObj[fileName].update();
                            });
                        }
                    }
                });
            });
            form.on('button(educationPhotoRemoveFile)', function(obj) {
                var name = this.dataset.name;
                var id = this.dataset.id;
                var files = $('#'+ name).val().replace(id, '');
                files = files.replace(/\,+/g, ',');
                if(files.charAt(0) == ',') {
                    files = files.substring(1);
                }
                if(files.charAt(files.length - 1) == ',') {
                    files = files.substring(0, files.length - 1);
                }
                initFileList(name, files, function(fileName) {
                    viewerObj[fileName].update();
                });
            });
        }

        function initBodyExamPhotoUploadFile() {
            var files = $('#bodyExamPhoto').val();
            initFileList('bodyExamPhoto', files, function(fileName) {
                var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false});
                viewerObj[fileName] = viewer;
            });
            form.on('button(bodyExamPhotoUploadFile)', function(obj) {
                var name = this.dataset.name;
                var explain = this.dataset.explain;
                top.dialog.file({
                    type: 'image',
                    title: '上传'+ explain,
                    width: '400px',
                    height: '420px',
                    maxFileCount: '1',
                    onClose: function() {
                        var uploadFileArray = top.dialog.dialogData.uploadFileArray;
                        if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
                            var files = $('#'+ name).val();
                            for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
                                if(files.length > 0) {
                                    files += ',';
                                }
                                files += file.data;
                            }
                            initFileList(name, files, function(fileName) {
                                viewerObj[fileName].update();
                            });
                        }
                    }
                });
            });
            form.on('button(bodyExamPhotoRemoveFile)', function(obj) {
                var name = this.dataset.name;
                var id = this.dataset.id;
                var files = $('#'+ name).val().replace(id, '');
                files = files.replace(/\,+/g, ',');
                if(files.charAt(0) == ',') {
                    files = files.substring(1);
                }
                if(files.charAt(files.length - 1) == ',') {
                    files = files.substring(0, files.length - 1);
                }
                initFileList(name, files, function(fileName) {
                    viewerObj[fileName].update();
                });
            });
        }

        // 初始化出生日期日期
        function initBirthDateDate() {
            laydate.render({
                elem: '#birthDate',
                format: 'yyyy-MM-dd',
                type: 'date',
                trigger: 'click'
            });
        }

        // 初始化性别下拉选择
        function initGenderSelect() {
            top.restAjax.get(top.restAjax.path('api/data/listbyparentid/4ef46940-76ab-4758-b5f0-0cbc93ffc660', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('genderSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('genderSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'genderSelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化证件类别下拉选择
        function initCardTypeSelect() {
            top.restAjax.get(top.restAjax.path('api/data/listbyparentid/76c5044f-805a-4313-b1e8-79e966b97c0d', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('cardTypeSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('cardTypeSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'cardTypeSelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化民族下拉选择
        function initNationSelect() {
            top.restAjax.get(top.restAjax.path('api/data/listbyparentid/a981579c-572b-4fd1-8e76-5d17df97f6a4', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('nationSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('nationSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'nationSelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化籍贯下拉选择
        function initNativePlaceSelect() {
            top.restAjax.get(top.restAjax.path('api/area/listbyparentid/0', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('nativePlaceSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('nativePlaceSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'nativePlaceSelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        form.on('select(nativePlace)',function(data){
            if(data.value == ''){
                initNativePlace1Select('');
                initNativePlace2Select('');
                return;
            }
            var areaId = $(data.elem).find("option:selected").attr("data-areaid");
            initNativePlace1Select(areaId);
            initNativePlace2Select('');
        });

        function initNativePlace1Select(parentId) {
            if(typeof (parentId) == 'undefined' || parentId == ''){
                var data = [];
                laytpl(document.getElementById('nativePlace1SelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('nativePlace1SelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'nativePlace1SelectTemplateBox');
                return;
            }
            top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{parentId}', [parentId]), {}, null, function(code, data, args) {
                laytpl(document.getElementById('nativePlace1SelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('nativePlace1SelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'nativePlace1SelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        form.on('select(nativePlace1)',function(data){
            if(data.value == ''){
                initNativePlace2Select('');
                return;
            }
            var areaId = $(data.elem).find("option:selected").attr("data-areaid");
            initNativePlace2Select(areaId);
        });

        function initNativePlace2Select(parentId) {
            if(typeof (parentId) == 'undefined' || parentId == ''){
                var data = [];
                laytpl(document.getElementById('nativePlace2SelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('nativePlace2SelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'nativePlace2SelectTemplateBox');
                return;
            }
            top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{parentId}', [parentId]), {}, null, function(code, data, args) {
                laytpl(document.getElementById('nativePlace2SelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('nativePlace2SelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'nativePlace2SelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化政治面貌下拉选择
        function initPoliticalStatusSelect() {
            top.restAjax.get(top.restAjax.path('api/data/listbyparentid/b2c96de0-3df8-41db-99b1-bc4e24ac6c24', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('politicalStatusSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('politicalStatusSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'politicalStatusSelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化婚姻情况下拉选择
        function initMaritalStatusSelect() {
            top.restAjax.get(top.restAjax.path('api/data/listbyparentid/91bdd01b-e9d2-4a2b-98b5-45e25d3cd8ae', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('maritalStatusSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('maritalStatusSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'maritalStatusSelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化学历下拉选择
        function initEducationSelect() {
            top.restAjax.get(top.restAjax.path('api/data/listbyparentid/d6b9f026-6ea9-456a-b48b-0c18d502523b', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('educationSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('educationSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'educationSelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化宗教信仰下拉选择
        function initReligionSelect() {
            top.restAjax.get(top.restAjax.path('api/data/listbyparentid/792e5742-d302-4943-b04c-161f406ea7ca', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('religionSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('religionSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'religionSelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化职业类别下拉选择
        function initOccupationCategorySelect() {
            top.restAjax.get(top.restAjax.path('api/data/listbyparentid/5867642c-2b79-4bea-adc9-477a5b784159', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('occupationCategorySelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('occupationCategorySelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'occupationCategorySelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化户籍地下拉选择
        function initRegisteredResidenceSelect() {
            top.restAjax.get(top.restAjax.path('api/area/listbyparentid/0', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('registeredResidenceSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('registeredResidenceSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'registeredResidenceSelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        form.on('select(registeredResidence)',function(data){
            if(data.value == ''){
                initRegisteredResidence1Select('');
                initRegisteredResidence2Select('');
                return;
            }
            var areaId = $(data.elem).find("option:selected").attr("data-areaid");
            initRegisteredResidence1Select(areaId);
            initRegisteredResidence2Select('');
        });

        // 初始化户籍地一级
        function initRegisteredResidence1Select(parentId) {
            if(typeof (parentId) == 'undefined' || parentId == ''){
                var data = [];
                laytpl(document.getElementById('registeredResidence1SelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('registeredResidence1SelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'registeredResidence1SelectTemplateBox');
                return;
            }
            top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{parentId}', [parentId]), {}, null, function(code, data, args) {
                laytpl(document.getElementById('registeredResidence1SelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('registeredResidence1SelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'registeredResidence1SelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        form.on('select(registeredResidence1)',function(data){
            if(data.value == ''){
                initRegisteredResidence2Select('');
                return;
            }
            var areaId = $(data.elem).find("option:selected").attr("data-areaid");
            initRegisteredResidence2Select(areaId);
        });

        // 初始化户籍地二级
        function initRegisteredResidence2Select(parentId) {
            if(typeof (parentId) == 'undefined' || parentId == ''){
                var data = [];
                laytpl(document.getElementById('registeredResidence2SelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('registeredResidence2SelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'registeredResidence2SelectTemplateBox');
                return;
            }
            top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{parentId}', [parentId]), {}, null, function(code, data, args) {
                laytpl(document.getElementById('registeredResidence2SelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('registeredResidence2SelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'registeredResidence2SelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化现住地下拉选择
        function initCurrentResidenceSelect() {
            top.restAjax.get(top.restAjax.path('api/area/listbyparentid/0', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('currentResidenceSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('currentResidenceSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'currentResidenceSelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        form.on('select(currentResidence)',function(data){
            if(data.value == ''){
                initCurrentResidence1Select('');
                initCurrentResidence2Select('');
                return;
            }
            var areaId = $(data.elem).find("option:selected").attr("data-areaid");
            initCurrentResidence1Select(areaId);
            initCurrentResidence2Select('');
        });

        // 初始化现住地一级
        function initCurrentResidence1Select(parentId) {
            if(typeof (parentId) == 'undefined' || parentId == ''){
                var data = [];
                laytpl(document.getElementById('currentResidence1SelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('currentResidence1SelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'currentResidence1SelectTemplateBox');
                return;
            }
            top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{parentId}', [parentId]), {}, null, function(code, data, args) {
                laytpl(document.getElementById('currentResidence1SelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('currentResidence1SelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'currentResidence1SelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        form.on('select(currentResidence1)',function(data){
            if(data.value == ''){
                initCurrentResidence2Select('');
                return;
            }
            var areaId = $(data.elem).find("option:selected").attr("data-areaid");
            initCurrentResidence2Select(areaId);
        });

        // 初始化现住地二级
        function initCurrentResidence2Select(parentId) {
            if(typeof (parentId) == 'undefined' || parentId == ''){
                var data = [];
                laytpl(document.getElementById('currentResidence2SelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('currentResidence2SelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'currentResidence2SelectTemplateBox');
                return;
            }
            top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{parentId}', [parentId]), {}, null, function(code, data, args) {
                laytpl(document.getElementById('currentResidence2SelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('currentResidence2SelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'currentResidence2SelectTemplateBox');
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        function initFileList(fileName, ids, callback) {
            var dataForm = {};
            dataForm[fileName] = ids;
            form.val('dataForm', dataForm);
            if(!ids) {
                refreshDownloadTemplet(fileName, []);
                if(callback) {
                    callback(fileName, []);
                }
                return;
            }
            top.restAjax.get(top.restAjax.path('api/file/list', []), {
                ids: ids
            }, null, function(code, data) {
                refreshDownloadTemplet(fileName, data);
                if(callback) {
                    callback(fileName, data);
                }
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        function refreshDownloadTemplet(fileName, file) {
            var dataRander = {};
            dataRander[fileName] = file;
            laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) {
                document.getElementById(fileName +'FileBox').innerHTML = html;
            });
        }

        function closeBox() {
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        }

        // 提交表单
        form.on('submit(submitForm)', function(formData) {
            var nativePlace = formData.field['nativePlace'];
            nativePlace += '&' + formData.field['nativePlace1'];
            nativePlace += '&' + formData.field['nativePlace2'];
            formData.field['nativePlace'] = nativePlace;
            var registeredResidence = formData.field['registeredResidence'];
            registeredResidence += '&' + formData.field['registeredResidence1'];
            registeredResidence += '&' + formData.field['registeredResidence2'];
            formData.field['registeredResidence'] = registeredResidence;
            var currentResidence = formData.field['currentResidence'];
            currentResidence += '&' + formData.field['currentResidence1'];
            currentResidence += '&' + formData.field['currentResidence2'];
            formData.field['currentResidence'] = currentResidence;
            top.dialog.confirm(top.dataMessage.commit, function(index) {
                top.dialog.close(index);
                var loadLayerIndex;
                top.restAjax.post(top.restAjax.path('api/basic-staff-info/save', []), formData.field, null, function(code, data) {
                    var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
                        time: 0,
                        btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
                        shade: 0.3,
                        yes: function(index) {
                            top.dialog.close(index);
                            window.location.reload();
                        },
                        btn2: function() {
                            closeBox();
                        }
                    });
                }, function(code, data) {
                    top.dialog.msg(data.msg);
                }, function() {
                    loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
                }, function() {
                    top.dialog.close(loadLayerIndex);
                });
            });
            return false;
        });

        $('.close').on('click', function() {
            closeBox();
        });

        $('.layui-card').css('min-height',$win.height() - 90);

        // 校验
        form.verify({
        });
    });
</script>
</body>
</html>