<!doctype html>
<html lang="en">
<head>
    <base href="/systembase/">
    <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" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
</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-form-item">
                    <label class="layui-form-label">案件ID</label>
                    <div class="layui-input-block">
                        <input type="text" id="homicideId" name="homicideId" class="layui-input" value="" placeholder="请输入案件ID"  maxlength="36">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">案件名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="homicideName" name="homicideName" class="layui-input" value="" placeholder="请输入案件名称"  maxlength="100">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">案件编号</label>
                    <div class="layui-input-block">
                        <input type="text" id="homicideCode" name="homicideCode" class="layui-input" value="" placeholder="请输入案件编号"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">证件代码字典表ID</label>
                    <div class="layui-input-block layui-form" id="cardCodeSelectTemplateBox" lay-filter="cardCodeSelectTemplateBox"></div>
                    <script id="cardCodeSelectTemplate" type="text/html">
                        <select id="cardCode" name="cardCode">
                            <option value="">请选择证件代码字典表ID</option>
                            {{# for(var i = 0, item; item = d[i++];) { }}
                            <option value="{{item.selectId}}">{{item.selectName}}</option>
                            {{# } }}
                        </select>
                    </script>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">证件代码名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="cardCodeName" name="cardCodeName" class="layui-input" value="" placeholder="请输入证件代码名称"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">证件代码编码</label>
                    <div class="layui-input-block">
                        <input type="text" id="cardCodeCode" name="cardCodeCode" class="layui-input" value="" placeholder="请输入证件代码编码"  maxlength="3">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">证件号码</label>
                    <div class="layui-input-block">
                        <input type="text" id="cardNum" name="cardNum" class="layui-input" value="" placeholder="请输入证件号码"  maxlength="30">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">姓名</label>
                    <div class="layui-input-block">
                        <input type="text" id="name" name="name" class="layui-input" value="" placeholder="请输入姓名"  maxlength="80">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">曾用名</label>
                    <div class="layui-input-block">
                        <input type="text" id="beforeName" name="beforeName" class="layui-input" value="" placeholder="请输入曾用名"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">性别字典表ID</label>
                    <div class="layui-input-block layui-form" id="sexSelectTemplateBox" lay-filter="sexSelectTemplateBox"></div>
                    <script id="sexSelectTemplate" type="text/html">
                        <select id="sex" name="sex">
                            <option value="">请选择性别字典表ID</option>
                            {{# for(var i = 0, item; item = d[i++];) { }}
                            <option value="{{item.selectId}}">{{item.selectName}}</option>
                            {{# } }}
                        </select>
                    </script>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">性别名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="sexName" name="sexName" class="layui-input" value="" placeholder="请输入性别名称"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">性别编码</label>
                    <div class="layui-input-block">
                        <input type="text" id="sexCode" name="sexCode" class="layui-input" value="" placeholder="请输入性别编码"  maxlength="1">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">出生日期</label>
                    <div class="layui-input-block">
                        <input type="text" id="birthday" name="birthday" class="layui-input" value="" placeholder="请选择出生日期" lay-verify="required" readonly style="cursor: pointer;">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">国籍(地区)字典表ID</label>
                    <div class="layui-input-block layui-form" id="nationalitySelectTemplateBox" lay-filter="nationalitySelectTemplateBox"></div>
                    <script id="nationalitySelectTemplate" type="text/html">
                        <select id="nationality" name="nationality">
                            <option value="">请选择国籍(地区)字典表ID</option>
                            {{# for(var i = 0, item; item = d[i++];) { }}
                            <option value="{{item.selectId}}">{{item.selectName}}</option>
                            {{# } }}
                        </select>
                    </script>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">国籍(地区)名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="nationalityName" name="nationalityName" class="layui-input" value="" placeholder="请输入国籍(地区)名称"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">国籍(地区)编码</label>
                    <div class="layui-input-block">
                        <input type="text" id="nationalityCode" name="nationalityCode" class="layui-input" value="" placeholder="请输入国籍(地区)编码"  maxlength="3">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">民族字典表ID</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">
                            <option value="">请选择民族字典表ID</option>
                            {{# for(var i = 0, item; item = d[i++];) { }}
                            <option value="{{item.selectId}}">{{item.selectName}}</option>
                            {{# } }}
                        </select>
                    </script>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">民族名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="nationName" name="nationName" class="layui-input" value="" placeholder="请输入民族名称"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">民族编码</label>
                    <div class="layui-input-block">
                        <input type="text" id="nationCode" name="nationCode" class="layui-input" value="" placeholder="请输入民族编码"  maxlength="2">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">籍贯字典表ID</label>
                    <div class="layui-input-block layui-form" id="nativeSelectTemplateBox" lay-filter="nativeSelectTemplateBox"></div>
                    <script id="nativeSelectTemplate" type="text/html">
                        <select id="native" name="native">
                            <option value="">请选择籍贯字典表ID</option>
                            {{# for(var i = 0, item; item = d[i++];) { }}
                            <option value="{{item.selectId}}">{{item.selectName}}</option>
                            {{# } }}
                        </select>
                    </script>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">籍贯名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="nativeName" name="nativeName" class="layui-input" value="" placeholder="请输入籍贯名称"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">籍贯编码</label>
                    <div class="layui-input-block">
                        <input type="text" id="nativeCode" name="nativeCode" class="layui-input" value="" placeholder="请输入籍贯编码"  maxlength="12">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">婚姻状况字典表ID</label>
                    <div class="layui-input-block layui-form" id="maritalSelectTemplateBox" lay-filter="maritalSelectTemplateBox"></div>
                    <script id="maritalSelectTemplate" type="text/html">
                        <select id="marital" name="marital">
                            <option value="">请选择婚姻状况字典表ID</option>
                            {{# for(var i = 0, item; item = d[i++];) { }}
                            <option value="{{item.selectId}}">{{item.selectName}}</option>
                            {{# } }}
                        </select>
                    </script>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">婚姻状况名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="maritalName" name="maritalName" class="layui-input" value="" placeholder="请输入婚姻状况名称"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">婚姻状况编码</label>
                    <div class="layui-input-block">
                        <input type="text" id="maritalCode" name="maritalCode" class="layui-input" value="" placeholder="请输入婚姻状况编码"  maxlength="2">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">政治面貌字典表ID</label>
                    <div class="layui-input-block layui-form" id="politicalOutlookSelectTemplateBox" lay-filter="politicalOutlookSelectTemplateBox"></div>
                    <script id="politicalOutlookSelectTemplate" type="text/html">
                        <select id="politicalOutlook" name="politicalOutlook">
                            <option value="">请选择政治面貌字典表ID</option>
                            {{# for(var i = 0, item; item = d[i++];) { }}
                            <option value="{{item.selectId}}">{{item.selectName}}</option>
                            {{# } }}
                        </select>
                    </script>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">政治面貌名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="politicalOutlookName" name="politicalOutlookName" class="layui-input" value="" placeholder="请输入政治面貌名称"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">政治面貌编码</label>
                    <div class="layui-input-block">
                        <input type="text" id="politicalOutlookCode" name="politicalOutlookCode" class="layui-input" value="" placeholder="请输入政治面貌编码"  maxlength="2">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">学历字典表ID</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">
                            <option value="">请选择学历字典表ID</option>
                            {{# for(var i = 0, item; item = d[i++];) { }}
                            <option value="{{item.selectId}}">{{item.selectName}}</option>
                            {{# } }}
                        </select>
                    </script>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">学历名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="educationName" name="educationName" class="layui-input" value="" placeholder="请输入学历名称"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">学历编码</label>
                    <div class="layui-input-block">
                        <input type="text" id="educationCode" name="educationCode" class="layui-input" value="" placeholder="请输入学历编码"  maxlength="2">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">宗教信仰字典表ID</label>
                    <div class="layui-input-block layui-form" id="religiousSelectTemplateBox" lay-filter="religiousSelectTemplateBox"></div>
                    <script id="religiousSelectTemplate" type="text/html">
                        <select id="religious" name="religious">
                            <option value="">请选择宗教信仰字典表ID</option>
                            {{# for(var i = 0, item; item = d[i++];) { }}
                            <option value="{{item.selectId}}">{{item.selectName}}</option>
                            {{# } }}
                        </select>
                    </script>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">宗教信仰名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="religiousName" name="religiousName" class="layui-input" value="" placeholder="请输入宗教信仰名称"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">宗教信仰编码</label>
                    <div class="layui-input-block">
                        <input type="text" id="religiousCode" name="religiousCode" class="layui-input" value="" placeholder="请输入宗教信仰编码"  maxlength="2">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">职业类别字典表ID</label>
                    <div class="layui-input-block layui-form" id="workTypeSelectTemplateBox" lay-filter="workTypeSelectTemplateBox"></div>
                    <script id="workTypeSelectTemplate" type="text/html">
                        <select id="workType" name="workType">
                            <option value="">请选择职业类别字典表ID</option>
                            {{# for(var i = 0, item; item = d[i++];) { }}
                            <option value="{{item.selectId}}">{{item.selectName}}</option>
                            {{# } }}
                        </select>
                    </script>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">字典表名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="workTypeName" name="workTypeName" class="layui-input" value="" placeholder="请输入字典表名称"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">字典表编码</label>
                    <div class="layui-input-block">
                        <input type="text" id="workTypeCode" name="workTypeCode" class="layui-input" value="" placeholder="请输入字典表编码"  maxlength="5">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">职业</label>
                    <div class="layui-input-block">
                        <input type="text" id="work" name="work" class="layui-input" value="" placeholder="请输入职业"  maxlength="30">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">服务处所</label>
                    <div class="layui-input-block">
                        <input type="text" id="servicePremises" name="servicePremises" class="layui-input" value="" placeholder="请输入服务处所"  maxlength="100">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">户籍地字典表ID</label>
                    <div class="layui-input-block layui-form" id="householdRegisterSelectTemplateBox" lay-filter="householdRegisterSelectTemplateBox"></div>
                    <script id="householdRegisterSelectTemplate" type="text/html">
                        <select id="householdRegister" name="householdRegister">
                            <option value="">请选择户籍地字典表ID</option>
                            {{# for(var i = 0, item; item = d[i++];) { }}
                            <option value="{{item.selectId}}">{{item.selectName}}</option>
                            {{# } }}
                        </select>
                    </script>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">户籍地名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="householdRegisterName" name="householdRegisterName" class="layui-input" value="" placeholder="请输入户籍地名称"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">户籍地编码</label>
                    <div class="layui-input-block">
                        <input type="text" id="householdRegisterCode" name="householdRegisterCode" class="layui-input" value="" placeholder="请输入户籍地编码"  maxlength="12">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">户籍门(楼)祥址</label>
                    <div class="layui-input-block">
                        <input type="text" id="householdRegisterAddress" name="householdRegisterAddress" class="layui-input" value="" placeholder="请输入户籍门(楼)祥址"  maxlength="80">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">现住地字典表ID</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">
                            <option value="">请选择现住地字典表ID</option>
                            {{# for(var i = 0, item; item = d[i++];) { }}
                            <option value="{{item.selectId}}">{{item.selectName}}</option>
                            {{# } }}
                        </select>
                    </script>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">现住地名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="currentResidenceName" name="currentResidenceName" class="layui-input" value="" placeholder="请输入现住地名称"  maxlength="50">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">现住地编码</label>
                    <div class="layui-input-block">
                        <input type="text" id="currentResidenceCode" name="currentResidenceCode" class="layui-input" value="" placeholder="请输入现住地编码"  maxlength="12">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">现住门(楼)祥址</label>
                    <div class="layui-input-block">
                        <input type="text" id="currentResidenceAddress" name="currentResidenceAddress" class="layui-input" value="" placeholder="请输入现住门(楼)祥址"  maxlength="80">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否为严重精神障碍患者</label>
                    <div class="layui-input-block">
                        <input type="number" id="isMental" name="isMental" class="layui-input" value="" placeholder="请输入是否为严重精神障碍患者" lay-verify="required">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否为未成年人</label>
                    <div class="layui-input-block">
                        <input type="number" id="isJuveniles" name="isJuveniles" class="layui-input" value="" placeholder="请输入是否为未成年人" lay-verify="required">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否为青少年</label>
                    <div class="layui-input-block">
                        <input type="number" id="isTeenagers" name="isTeenagers" class="layui-input" value="" placeholder="请输入是否为青少年" lay-verify="required">
                    </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/js/vendor/wangEditor/wangEditor.min.js"></script>
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: 'assets/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'laydate', 'laytpl'], function(){
        var $ = layui.$;
        var form = layui.form;
        var laytpl = layui.laytpl;
        var laydate = layui.laydate;
        var homicideSuspectId = top.restAjax.params(window.location.href).homicideSuspectId;

        var wangEditor = window.wangEditor;
        var wangEditorObj = {};
        var viewerObj = {};

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

        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 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 initVideo(fileName, data) {
            for(var i = 0, item; item = data[i++];) {
                var player = new ckplayer({
                    container: '#'+ fileName + i,
                    variable: 'player',
                    flashplayer: false,
                    video: {
                        file: 'route/file/download/true/'+ item.fileId,
                        type: 'video/mp4'
                    }
                });
            }
        }

        // 初始化证件代码字典表ID下拉选择
        function initCardCodeSelect(selectValue) {
            top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('cardCodeSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('cardCodeSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'cardCodeSelectTemplateBox');

                var selectObj = {};
                selectObj['cardCode'] = selectValue;
                form.val('dataForm', selectObj);
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化性别字典表ID下拉选择
        function initSexSelect(selectValue) {
            top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('sexSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('sexSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'sexSelectTemplateBox');

                var selectObj = {};
                selectObj['sex'] = selectValue;
                form.val('dataForm', selectObj);
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化出生日期日期
        function initBirthdayDate() {
            laydate.render({
                elem: '#birthday',
                type: 'date',
                value: new Date(),
                trigger: 'click'
            });
        }

        // 初始化国籍(地区)字典表ID下拉选择
        function initNationalitySelect(selectValue) {
            top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('nationalitySelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('nationalitySelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'nationalitySelectTemplateBox');

                var selectObj = {};
                selectObj['nationality'] = selectValue;
                form.val('dataForm', selectObj);
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化民族字典表ID下拉选择
        function initNationSelect(selectValue) {
            top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('nationSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('nationSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'nationSelectTemplateBox');

                var selectObj = {};
                selectObj['nation'] = selectValue;
                form.val('dataForm', selectObj);
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化籍贯字典表ID下拉选择
        function initNativeSelect(selectValue) {
            top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('nativeSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('nativeSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'nativeSelectTemplateBox');

                var selectObj = {};
                selectObj['native'] = selectValue;
                form.val('dataForm', selectObj);
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化婚姻状况字典表ID下拉选择
        function initMaritalSelect(selectValue) {
            top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('maritalSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('maritalSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'maritalSelectTemplateBox');

                var selectObj = {};
                selectObj['marital'] = selectValue;
                form.val('dataForm', selectObj);
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化政治面貌字典表ID下拉选择
        function initPoliticalOutlookSelect(selectValue) {
            top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('politicalOutlookSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('politicalOutlookSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'politicalOutlookSelectTemplateBox');

                var selectObj = {};
                selectObj['politicalOutlook'] = selectValue;
                form.val('dataForm', selectObj);
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化学历字典表ID下拉选择
        function initEducationSelect(selectValue) {
            top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('educationSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('educationSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'educationSelectTemplateBox');

                var selectObj = {};
                selectObj['education'] = selectValue;
                form.val('dataForm', selectObj);
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化宗教信仰字典表ID下拉选择
        function initReligiousSelect(selectValue) {
            top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('religiousSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('religiousSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'religiousSelectTemplateBox');

                var selectObj = {};
                selectObj['religious'] = selectValue;
                form.val('dataForm', selectObj);
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化职业类别字典表ID下拉选择
        function initWorkTypeSelect(selectValue) {
            top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('workTypeSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('workTypeSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'workTypeSelectTemplateBox');

                var selectObj = {};
                selectObj['workType'] = selectValue;
                form.val('dataForm', selectObj);
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化户籍地字典表ID下拉选择
        function initHouseholdRegisterSelect(selectValue) {
            top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('householdRegisterSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('householdRegisterSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'householdRegisterSelectTemplateBox');

                var selectObj = {};
                selectObj['householdRegister'] = selectValue;
                form.val('dataForm', selectObj);
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }

        // 初始化现住地字典表ID下拉选择
        function initCurrentResidenceSelect(selectValue) {
            top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
                laytpl(document.getElementById('currentResidenceSelectTemplate').innerHTML).render(data, function(html) {
                    document.getElementById('currentResidenceSelectTemplateBox').innerHTML = html;
                });
                form.render('select', 'currentResidenceSelectTemplateBox');

                var selectObj = {};
                selectObj['currentResidence'] = selectValue;
                form.val('dataForm', selectObj);
            }, function(code, data) {
                top.dialog.msg(data.msg);
            });
        }


        // 初始化内容
        function initData() {
            var loadLayerIndex;
            top.restAjax.get(top.restAjax.path('api/homicidesuspect/get/{homicideSuspectId}', [homicideSuspectId]), {}, null, function(code, data) {
                var dataFormData = {};
                for(var i in data) {
                    dataFormData[i] = data[i] +'';
                }
                form.val('dataForm', dataFormData);
                form.render(null, 'dataForm');
                initCardCodeSelect(data['cardCode']);
                initSexSelect(data['sex']);
                initBirthdayDate();
                initNationalitySelect(data['nationality']);
                initNationSelect(data['nation']);
                initNativeSelect(data['native']);
                initMaritalSelect(data['marital']);
                initPoliticalOutlookSelect(data['politicalOutlook']);
                initEducationSelect(data['education']);
                initReligiousSelect(data['religious']);
                initWorkTypeSelect(data['workType']);
                initHouseholdRegisterSelect(data['householdRegister']);
                initCurrentResidenceSelect(data['currentResidence']);
            }, function(code, data) {
                top.dialog.msg(data.msg);
            }, function() {
                loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
            }, function() {
                top.dialog.close(loadLayerIndex);
            });
        }
        initData();
        
        // 提交表单
        form.on('submit(submitForm)', function(formData) {
            top.dialog.confirm(top.dataMessage.commit, function(index) {
                top.dialog.close(index);
                var loadLayerIndex;
                top.restAjax.put(top.restAjax.path('api/homicidesuspect/update/{homicideSuspectId}', [homicideSuspectId]), formData.field, null, function(code, data) {
                    var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
                        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();
        });

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