735 lines
38 KiB
HTML
735 lines
38 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<base href="/partybuilding/">
|
|
<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">
|
|
<style>
|
|
.layui-form-select dl {
|
|
max-height: 500%;
|
|
}
|
|
</style>
|
|
</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" id="dataForm">
|
|
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;margin-bottom: 30px;">
|
|
<legend style="font-weight: 900;">党组织信息</legend>
|
|
</fieldset>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">所属党组织</label>
|
|
<div class="layui-input-block layui-form" id="belongPartyOrganizeSelectTemplateBox" lay-filter="belongPartyOrganizeSelectTemplateBox"></div>
|
|
<input type="hidden" name="belongPartyOrganizeName" id="belongPartyOrganizeName">
|
|
<script id="belongPartyOrganizeSelectTemplate" type="text/html">
|
|
<select id="belongPartyOrganize" name="belongPartyOrganize" lay-search lay-verify="required">
|
|
<option value="">请选择所属党组织</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.partyOrganizeId}}">{{item.name}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<span style="color: red;font-size: 14px;margin-left: 9%;">*您可以在下拉框上进行关键词搜索,以便您快速的找到需要的党组织。</span>
|
|
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;margin-bottom: 30px;">
|
|
<legend style="font-weight: 900;">党员个人信息</legend>
|
|
</fieldset>
|
|
<div class="layui-form-item layui-form-text">
|
|
<label class="layui-form-label">照片</label>
|
|
<div class="layui-input-block">
|
|
<input type="hidden" id="photo" name="photo">
|
|
<div class="layui-btn-container" id="photoFileBox" style="border: 1px solid #e6e6e6;"></div>
|
|
<script id="photoFileDownload" type="text/html">
|
|
{{# var fileName = 'photo'; }}
|
|
{{# 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/downloadfile/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="photoRemoveFile">
|
|
<i class="fa fa-trash-o"></i>
|
|
</a>
|
|
</div>
|
|
{{# } }}
|
|
{{# } }}
|
|
{{# if(d[fileName].length < 1) { }}
|
|
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
|
|
<a href="javascript:void(0);" lay-form-button data-explain="照片" data-name="photo" lay-filter="photoUploadFile">
|
|
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
|
|
</a>
|
|
</div>
|
|
{{# } }}
|
|
</script>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-row">
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">用户名</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="userName" name="userName" class="layui-input" value="" placeholder="请输入用户名" >
|
|
<input type="hidden" id="userId" name="userId" class="layui-input" value="">
|
|
</div>
|
|
</div>
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">姓名</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="name" name="name" class="layui-input" value="" placeholder="请输入姓名" >
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-row">
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">性别</label>
|
|
<div class="layui-input-block layui-form" id="sexSelectTemplateBox" lay-filter="sexSelectTemplateBox"></div>
|
|
<input type="hidden" name="sexName" id="sexName">
|
|
<script id="sexSelectTemplate" type="text/html">
|
|
<select id="sex" name="sex">
|
|
<option value="">请选择性别</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">出生日期</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="birthday" name="birthday" class="layui-input" value="" placeholder="请选择出生日期" readonly style="cursor: pointer;" lay-verify="required">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-row">
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">民族</label>
|
|
<div class="layui-input-block layui-form" id="nationSelectTemplateBox" lay-filter="nationSelectTemplateBox"></div>
|
|
<input type="hidden" name="nationName" id="nationName">
|
|
<script id="nationSelectTemplate" type="text/html">
|
|
<select id="nation" name="nation">
|
|
<option value="">请选择民族</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">学历</label>
|
|
<div class="layui-input-block layui-form" id="educationSelectTemplateBox" lay-filter="educationSelectTemplateBox"></div>
|
|
<input type="hidden" name="educationName" id="educationName">
|
|
<script id="educationSelectTemplate" type="text/html">
|
|
<select id="education" name="education">
|
|
<option value="">请选择学历</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-row">
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">身份证</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="idCard" name="idCard" class="layui-input" value="" placeholder="请输入身份证" lay-verify="identity">
|
|
</div>
|
|
</div>
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">户籍地址</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="registeredResidence" name="registeredResidence" class="layui-input" value="" placeholder="请输入户籍地址" >
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-row">
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">现居地址</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="currentAddress" name="currentAddress" class="layui-input" value="" placeholder="请输入现居地址" >
|
|
</div>
|
|
</div>
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">邮箱</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="email" name="email" class="layui-input" value="" placeholder="请输入邮箱" >
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-row">
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">人员职业</label>
|
|
<div class="layui-input-block layui-form" id="occupationSelectTemplateBox" lay-filter="occupationSelectTemplateBox"></div>
|
|
<input type="hidden" name="occupationName" id="occupationName">
|
|
<script id="occupationSelectTemplate" type="text/html">
|
|
<select id="occupation" name="occupation">
|
|
<option value="">请选择人员职业</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">月工资</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="monthlySalary" name="monthlySalary" class="layui-input" value="" placeholder="请输入月工资" >
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-row">
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">健康状况</label>
|
|
<div class="layui-input-block layui-form" id="healthyStatusSelectTemplateBox" lay-filter="healthyStatusSelectTemplateBox"></div>
|
|
<input type="hidden" name="healthyStatusName" id="healthyStatusName">
|
|
<script id="healthyStatusSelectTemplate" type="text/html">
|
|
<select id="healthyStatus" name="healthyStatus">
|
|
<option value="">请选择健康状况</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">婚姻状况</label>
|
|
<div class="layui-input-block layui-form" id="maritalStatusSelectTemplateBox" lay-filter="maritalStatusSelectTemplateBox"></div>
|
|
<input type="hidden" name="maritalStatusName" id="maritalStatusName">
|
|
<script id="maritalStatusSelectTemplate" type="text/html">
|
|
<select id="maritalStatus" name="maritalStatus">
|
|
<option value="">请选择健康状况</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-row">
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">个人座机</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="landline" name="landline" class="layui-input" value="" placeholder="请输入个人座机" >
|
|
</div>
|
|
</div>
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">个人手机</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="phone" name="phone" class="layui-input" value="" placeholder="请输入个人手机" >
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;margin-bottom: 30px;">
|
|
<legend style="font-weight: 900;">党员信息</legend>
|
|
</fieldset>
|
|
<div class="layui-form-item layui-row">
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">党籍状态</label>
|
|
<div class="layui-input-block layui-form" id="partyMembershipStatusSelectTemplateBox" lay-filter="partyMembershipStatusSelectTemplateBox"></div>
|
|
<input type="hidden" name="partyMembershipStatusName" id="partyMembershipStatusName">
|
|
<script id="partyMembershipStatusSelectTemplate" type="text/html">
|
|
<select id="partyMembershipStatus" name="partyMembershipStatus">
|
|
<option value="">请选择党籍状态</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">党员类型</label>
|
|
<div class="layui-input-block layui-form" id="partyMemberTypeSelectTemplateBox" lay-filter="partyMemberTypeSelectTemplateBox"></div>
|
|
<input type="hidden" name="partyMemberTypeName" id="partyMemberTypeName">
|
|
<script id="partyMemberTypeSelectTemplate" type="text/html">
|
|
<select id="partyMemberType" name="partyMemberType">
|
|
<option value="">请选择党员类型</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-row" pane>
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">是否流动</label>
|
|
<div class="layui-input-block layui-form">
|
|
<input type="radio" name="isFlow" value="0" title="否" checked>
|
|
<input type="radio" name="isFlow" value="1" title="是">
|
|
</div>
|
|
</div>
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">入党时间</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="joinTime" name="joinTime" class="layui-input" value="" placeholder="请选择入党时间" readonly style="cursor: pointer;" lay-verify="required">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-row" pane>
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">转正时间</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="regularTime" name="regularTime" class="layui-input" value="" placeholder="请选择转正时间" readonly style="cursor: pointer;" lay-verify="required">
|
|
</div>
|
|
</div>
|
|
<div class="layui-col-lg6">
|
|
<label class="layui-form-label">是否失联</label>
|
|
<div class="layui-input-block layui-form">
|
|
<input type="radio" name="isOutofcontact" value="0" title="否" checked>
|
|
<input type="radio" name="isOutofcontact" value="1" title="是">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;margin-bottom: 30px;">
|
|
<legend style="font-weight: 900;">其他信息</legend>
|
|
</fieldset>
|
|
<div class="layui-form-item layui-form-text">
|
|
<label class="layui-form-label">备注</label>
|
|
<div class="layui-input-block">
|
|
<div id="remake"></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" id="submitBtn">提交编辑</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 partyMemberOrganizeId = top.restAjax.params(window.location.href).partyMemberOrganizeId;
|
|
var isView = top.restAjax.params(window.location.href).isView;
|
|
|
|
var wangEditor = window.wangEditor;
|
|
var wangEditorObj = {};
|
|
var viewerObj = {};
|
|
|
|
// 点击单位类型选择输入框,弹出层方法
|
|
$(document).on('click', '#userName', function() {
|
|
top.dialog.dialogData.oldSelectedUserList = [{userId:''}];
|
|
top.dialog.open({
|
|
url: 'route/common/listselectuser?selectType=radio',
|
|
title: '选择用户',
|
|
width: '1000px',
|
|
height: '500px',
|
|
onClose: function() {
|
|
var newSelectedUserList = top.dialog.dialogData.newSelectedUserList;
|
|
if(newSelectedUserList.length != 0) {
|
|
$('#userName').val(newSelectedUserList[0].userName);
|
|
$('#userId').val(newSelectedUserList[0].userId);
|
|
}
|
|
top.dialog.dialogData.oldSelectedUserList = [];
|
|
}
|
|
});
|
|
});
|
|
|
|
if(isView) {
|
|
$('#submitBtn').hide();
|
|
}
|
|
|
|
function valueFun(formData) {
|
|
$("#dataForm").find('select').each(function(){
|
|
var value;
|
|
var selId;
|
|
value = $(this).find('option:selected').text();
|
|
selId = $(this).attr('id');
|
|
selId = selId + 'Name';
|
|
$('#' + selId).val(value);
|
|
formData.field['' + selId] = $('#' + selId).val();
|
|
});
|
|
}
|
|
|
|
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/listfilebyfileid', []), {
|
|
ids: ids
|
|
}, null, function(code, data) {
|
|
refreshDownloadTemplet(fileName, data);
|
|
if(callback) {
|
|
callback(fileName, data);
|
|
}
|
|
}, function(code, data) {
|
|
top.dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化学历下拉选择
|
|
function initEducationSelect(selectValue) {
|
|
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/019c08f9-ce66-419c-b81d-fe53ebd5cec2', []), {}, 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);
|
|
});
|
|
}
|
|
|
|
// 初始化所属党组织下拉选择
|
|
function initBelongPartyOrganizeSelect(selectValue) {
|
|
top.restAjax.get(top.restAjax.path('api/partyorganize/listpartyorganize', []), {}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('belongPartyOrganizeSelectTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('belongPartyOrganizeSelectTemplateBox').innerHTML = html;
|
|
});
|
|
form.render('select', 'belongPartyOrganizeSelectTemplateBox');
|
|
|
|
var selectObj = {};
|
|
selectObj['belongPartyOrganize'] = selectValue;
|
|
form.val('dataForm', selectObj);
|
|
}, function(code, data) {
|
|
top.dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化性别下拉选择
|
|
function initSexSelect(selectValue) {
|
|
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/7af608bf-fad9-423d-b980-a0276ed02540', []), {}, 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 initOccupationSelect(selectValue) {
|
|
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/04ee4871-665a-47d2-b4a5-742f45dac7ed', []), {}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('occupationSelectTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('occupationSelectTemplateBox').innerHTML = html;
|
|
});
|
|
form.render('select', 'occupationSelectTemplateBox');
|
|
|
|
var selectObj = {};
|
|
selectObj['occupation'] = selectValue;
|
|
form.val('dataForm', selectObj);
|
|
}, function(code, data) {
|
|
top.dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化健康状况下拉选择
|
|
function initHealthyStatusSelect(selectValue) {
|
|
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/7dee969c-af7d-4c9e-839c-01e1d374b82b', []), {}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('healthyStatusSelectTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('healthyStatusSelectTemplateBox').innerHTML = html;
|
|
});
|
|
form.render('select', 'healthyStatusSelectTemplateBox');
|
|
|
|
var selectObj = {};
|
|
selectObj['healthyStatus'] = selectValue;
|
|
form.val('dataForm', selectObj);
|
|
}, function(code, data) {
|
|
top.dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化婚姻状况下拉选择
|
|
function initMaritalStatusSelect(selectValue) {
|
|
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/cfd3a1cf-2b69-42cb-927c-3ef0e408938a', []), {}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('maritalStatusSelectTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('maritalStatusSelectTemplateBox').innerHTML = html;
|
|
});
|
|
form.render('select', 'maritalStatusSelectTemplateBox');
|
|
|
|
var selectObj = {};
|
|
selectObj['maritalStatus'] = selectValue;
|
|
form.val('dataForm', selectObj);
|
|
}, function(code, data) {
|
|
top.dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化党籍状态下拉选择
|
|
function initPartyMembershipStatusSelect(selectValue) {
|
|
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/9dd716d4-8f8b-4643-abec-9dae52f1e765', []), {}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('partyMembershipStatusSelectTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('partyMembershipStatusSelectTemplateBox').innerHTML = html;
|
|
});
|
|
form.render('select', 'partyMembershipStatusSelectTemplateBox');
|
|
|
|
var selectObj = {};
|
|
selectObj['partyMembershipStatus'] = selectValue;
|
|
form.val('dataForm', selectObj);
|
|
}, function(code, data) {
|
|
top.dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化党员类型下拉选择
|
|
function initPartyMemberTypeSelect(selectValue) {
|
|
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/3401c65b-b4bb-4a4d-9c12-f3c55f6bc0c0', []), {}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('partyMemberTypeSelectTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('partyMemberTypeSelectTemplateBox').innerHTML = html;
|
|
});
|
|
form.render('select', 'partyMemberTypeSelectTemplateBox');
|
|
|
|
var selectObj = {};
|
|
selectObj['partyMemberType'] = selectValue;
|
|
form.val('dataForm', selectObj);
|
|
}, function(code, data) {
|
|
top.dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化出生日期日期
|
|
function initBirthdayDate() {
|
|
laydate.render({
|
|
elem: '#birthday',
|
|
type: 'date',
|
|
trigger: 'click'
|
|
});
|
|
}
|
|
|
|
// 初始化民族下拉选择
|
|
function initNationSelect(selectValue) {
|
|
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/7a0e423b-30e6-4e7b-b02b-d5457a690e96', []), {}, 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);
|
|
});
|
|
}
|
|
|
|
// 初始化照片图片上传
|
|
function initPhotoUploadFile() {
|
|
var files = $('#photo').val();
|
|
initFileList('photo', files, function(fileName) {
|
|
var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false});
|
|
viewerObj[fileName] = viewer;
|
|
});
|
|
|
|
form.on('button(photoUploadFile)', 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(photoRemoveFile)', 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 initRegularTimeDate() {
|
|
laydate.render({
|
|
elem: '#regularTime',
|
|
type: 'date',
|
|
trigger: 'click'
|
|
});
|
|
}
|
|
|
|
// 初始化入党时间日期
|
|
function initJoinTimeDate() {
|
|
laydate.render({
|
|
elem: '#joinTime',
|
|
type: 'date',
|
|
trigger: 'click'
|
|
});
|
|
}
|
|
|
|
// 初始化备注富文本
|
|
function initRemakeRichText(value) {
|
|
var editor = new wangEditor('#remake');
|
|
editor.customConfig.zIndex = 1000;
|
|
editor.customConfig.uploadImgMaxSize = 5 * 1024 * 1024;
|
|
editor.customConfig.uploadImgMaxLength = 1;
|
|
editor.customConfig.uploadFileName = 'image';
|
|
editor.customConfig.uploadImgServer = 'api/file/wangeditorimage';
|
|
editor.customConfig.uploadImgHooks = {
|
|
fail: function (xhr, editor, result) {
|
|
top.dialog.msg('系统错误,图片上传失败');
|
|
},
|
|
error: function (xhr, editor) {
|
|
top.dialog.msg('网络异常');
|
|
},
|
|
timeout: function (xhr, editor) {
|
|
top.dialog.msg('网络请求超时');
|
|
}
|
|
};
|
|
editor.create();
|
|
editor.txt.html(value);
|
|
wangEditorObj['remake'] = editor;
|
|
}
|
|
|
|
|
|
// 初始化内容
|
|
function initData() {
|
|
var loadLayerIndex;
|
|
top.restAjax.get(top.restAjax.path('api/partymemberorganize/getpartymemberorganizebyid/{partyMemberOrganizeId}', [partyMemberOrganizeId]), {}, null, function(code, data) {
|
|
var dataFormData = {};
|
|
for(var i in data) {
|
|
dataFormData[i] = data[i] +'';
|
|
}
|
|
form.val('dataForm', dataFormData);
|
|
form.render(null, 'dataForm');
|
|
initEducationSelect(data['education']);
|
|
initBelongPartyOrganizeSelect(data['belongPartyOrganize']);
|
|
initBirthdayDate();
|
|
initNationSelect(data['nation']);
|
|
initPhotoUploadFile();
|
|
initRegularTimeDate();
|
|
initJoinTimeDate();
|
|
initRemakeRichText(data['remake']);
|
|
initSexSelect(data['sex']);
|
|
initOccupationSelect(data['occupation']);
|
|
initHealthyStatusSelect(data['healthyStatus']);
|
|
initMaritalStatusSelect(data['maritalStatus']);
|
|
initPartyMembershipStatusSelect(data['partyMembershipStatus']);
|
|
initPartyMemberTypeSelect(data['partyMemberType']);
|
|
}, 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) {
|
|
valueFun(formData);
|
|
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
|
top.dialog.close(index);
|
|
var loadLayerIndex;
|
|
formData.field['remake'] = wangEditorObj['remake'].txt.html();
|
|
top.restAjax.put(top.restAjax.path('api/partymemberorganize/updatepartymemberorganize/{partyMemberOrganizeId}', [partyMemberOrganizeId]), 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> |