自定义人

This commit is contained in:
ly19960718 2021-05-15 20:23:24 +08:00
parent 5b4b0c841a
commit 7f6ba953ab
2 changed files with 270 additions and 145 deletions

View File

@ -41,6 +41,18 @@ public class ApplyController extends DefaultBaseController {
@ApiOperation(value = "自定义新增报名信息", notes = "自定义新增报名信息")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("save-relation")
@CheckRequestBodyAnnotation
public SuccessResult saveRelation(@RequestBody ApplyVO applyVO) {
applyService.saveRelationReturnId(applyVO);
return new SuccessResult();
}
@ApiOperation(value = "报名信息撤回", notes = "报名信息撤回接口") @ApiOperation(value = "报名信息撤回", notes = "报名信息撤回接口")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"), @ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),

View File

@ -22,126 +22,168 @@
</div> </div>
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-form-item"> <div class="layui-form-item layui-form-text">
<label class="layui-form-label">报名班级ID</label>
<div class="layui-input-block">
<input type="text" id="applyClassId" name="applyClassId" 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="applyName" name="applyName" class="layui-input" value="" placeholder="请输入报名人姓名" maxlength="50">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">报名人性别 1男 2女【数据字典】</label>
<div class="layui-input-block layui-form" id="applySexSelectTemplateBox" lay-filter="applySexSelectTemplateBox"></div>
<script id="applySexSelectTemplate" type="text/html">
<select id="applySex" name="applySex">
<option value="">请选择报名人性别 1男 2女【数据字典】</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="applyDataBirth" name="applyDataBirth" class="layui-input" value="" placeholder="请选择报名人出生日期" readonly style="cursor: pointer;" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">报名人证件类型【数据字典】</label>
<div class="layui-input-block layui-form" id="applyCardTypeSelectTemplateBox" lay-filter="applyCardTypeSelectTemplateBox"></div>
<script id="applyCardTypeSelectTemplate" type="text/html">
<select id="applyCardType" name="applyCardType">
<option value="">请选择报名人证件类型【数据字典】</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="applyCardNumber" name="applyCardNumber" 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="number" id="applyPhone" name="applyPhone" 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="text" id="applyAddress" name="applyAddress" class="layui-input" value="" placeholder="请输入报名人通讯地址" maxlength="500">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">报名人文化程度【数据字典】</label>
<div class="layui-input-block layui-form" id="applyCultureLevelSelectTemplateBox" lay-filter="applyCultureLevelSelectTemplateBox"></div>
<script id="applyCultureLevelSelectTemplate" type="text/html">
<select id="applyCultureLevel" name="applyCultureLevel">
<option value="">请选择报名人文化程度【数据字典】</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="applyPostcode" name="applyPostcode" 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 layui-form" id="applyPhysicalStateSelectTemplateBox" lay-filter="applyPhysicalStateSelectTemplateBox"></div>
<script id="applyPhysicalStateSelectTemplate" type="text/html">
<select id="applyPhysicalState" name="applyPhysicalState">
<option value="">请选择报名人身体状态【数据字典】</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="applyUnitName" name="applyUnitName" 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="number" id="applyUnitPhone" name="applyUnitPhone" 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="text" id="applyUnitAddress" name="applyUnitAddress" class="layui-input" value="" placeholder="请输入报名人单位地址" maxlength="500">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">证件照片</label> <label class="layui-form-label">证件照片</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="applyUserCardPhoto" name="applyUserCardPhoto" class="layui-input" value="" placeholder="请输入证件照片" maxlength="36"> <input type="hidden" id="applyUserCardPhoto" name="applyUserCardPhoto">
<div class="layui-btn-container" id="applyUserCardPhotoFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="applyUserCardPhotoFileDownload" type="text/html">
{{# var fileName = 'applyUserCardPhoto'; }}
{{# 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="applyUserCardPhotoRemoveFile">
<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="applyUserCardPhoto" lay-filter="applyUserCardPhotoUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
</a>
</div>
{{# } }}
</script>
</div>
</div>
<div class="layui-form-item layui-col-space10">
<div class="layui-col-md4">
<label class="layui-form-label">姓名</label>
<div class="layui-input-block">
<input type="text" id="applyName" name="applyName" class="layui-input" value=""maxlength="50" placeholder="请输入姓名" lay-verify="required" >
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label">性别</label>
<div class="layui-input-block layui-form" id="applySexSelectTemplateBox" lay-filter="applySexSelectTemplateBox"></div>
<script id="applySexSelectTemplate" type="text/html">
<select id="applySex" name="applySex" lay-verify="required" >
<option value="">请选择性别</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
</div>
<div class="layui-col-md4">
<label class="layui-form-label">出生日期</label>
<div class="layui-input-block">
<input type="text" id="applyDataBirth" name="applyDataBirth" class="layui-input" value="" placeholder="请输入出生日期" lay-verify="required" readonly style="cursor: pointer;">
</div>
</div>
</div>
<div class="layui-form-item layui-col-space10">
<div class="layui-col-md4">
<label class="layui-form-label">职务</label>
<div class="layui-input-block">
<input type="text" id="applyPosition" name="applyPosition" class="layui-input" value="" placeholder="请输入职务" lay-verify="required" style="cursor: pointer;">
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label">从业年限</label>
<div class="layui-input-block">
<input type="number" id="applyMajorYear" name="applyMajorYear" class="layui-input" value="" placeholder="请输入从业年限" maxlength="50" lay-verify="required" >
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label">技术职称</label>
<div class="layui-input-block">
<input type="text" id="applyTechnicalTitles" name="applyTechnicalTitles" class="layui-input" value="" placeholder="请输入技术职称" lay-verify="required" >
</div>
</div>
</div>
<div class="layui-form-item layui-col-space10">
<div class="layui-col-md4">
<label class="layui-form-label">证件类型</label>
<div class="layui-input-block layui-form" id="applyCardTypeSelectTemplateBox" lay-filter="applyCardTypeSelectTemplateBox"></div>
<script id="applyCardTypeSelectTemplate" type="text/html">
<select id="applyCardType" name="applyCardType" lay-verify="required" >
<option value="">请选择证件类型</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
</div>
<div class="layui-col-md4">
<label class="layui-form-label">证件号码</label>
<div class="layui-input-block">
<input type="text" id="applyCardNumber" name="applyCardNumber" class="layui-input" value="" placeholder="请输入证件号码" maxlength="50" lay-verify="required" >
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label">手机号码</label>
<div class="layui-input-block">
<input type="text" id="applyPhone" name="applyPhone" class="layui-input" value="" placeholder="请输入手机号码" lay-verify="required" >
</div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">报名状态 0 待审核 1用户撤回 2审核通过 3未报到 4报名完成-1审核不通过</label> <label class="layui-form-label">通讯地址</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="number" id="applyAuditState" name="applyAuditState" class="layui-input" value="" placeholder="请输入报名状态 0 待审核 1用户撤回 2审核通过 3未报到 4报名完成-1审核不通过" lay-verify="required"> <input type="text" id="applyAddress" name="applyAddress" class="layui-input" value="" placeholder="请输入通讯地址" maxlength="500" >
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-space10">
<div class="layui-col-md4">
<label class="layui-form-label">文化程度</label>
<div class="layui-input-block layui-form" id="applyCultureLevelSelectTemplateBox" lay-filter="applyCultureLevelSelectTemplateBox"></div>
<script id="applyCultureLevelSelectTemplate" type="text/html">
<select id="applyCultureLevel" name="applyCultureLevel" lay-verify="required" >
<option value="">请选择文化程度</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
</div>
<div class="layui-col-md4">
<label class="layui-form-label">身体状态</label>
<div class="layui-input-block layui-form" id="applyPhysicalStateSelectTemplateBox" lay-filter="applyPhysicalStateSelectTemplateBox"></div>
<script id="applyPhysicalStateSelectTemplate" type="text/html">
<select id="applyPhysicalState" name="applyPhysicalState" lay-verify="required" >
<option value="">请选择身体状态</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
</div>
<div class="layui-col-md4">
<label class="layui-form-label">邮编</label>
<div class="layui-input-block">
<input type="text" id="applyPostcode" name="applyPostcode" class="layui-input" value="" placeholder="请输入邮编" maxlength="50" >
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md6">
<label class="layui-form-label">单位名称</label>
<div class="layui-input-block">
<input type="text" id="applyUnitName" name="applyUnitName" class="layui-input" value="" placeholder="请输入单位名称" maxlength="100" >
</div>
</div>
<div class="layui-col-md6">
<label class="layui-form-label">单位电话</label>
<div class="layui-input-block">
<input type="text" id="applyUnitPhone" name="applyUnitPhone" class="layui-input" value="" placeholder="请输入单位电话" >
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">单位地址</label>
<div class="layui-input-block">
<input type="text" id="applyUnitAddress" name="applyUnitAddress" class="layui-input" value="" placeholder="请输入地址" maxlength="500" >
</div>
</div>
<div class="layui-form-item layui-layout-admin"> <div class="layui-form-item layui-layout-admin">
<div class="layui-input-block"> <div class="layui-input-block">
<div class="layui-footer" style="left: 0;"> <div class="layui-footer" style="left: 0;">
@ -171,6 +213,9 @@
var wangEditor = window.wangEditor; var wangEditor = window.wangEditor;
var wangEditorObj = {}; var wangEditorObj = {};
var viewerObj = {}; var viewerObj = {};
var applyWorkTypeId = top.restAjax.params(window.location.href).applyWorkTypeId;
var applyInstitutionId = top.restAjax.params(window.location.href).applyInstitutionId;
function closeBox() { function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name)); parent.layer.close(parent.layer.getFrameIndex(window.name));
@ -226,9 +271,9 @@
} }
} }
// 初始化报名人性别 1男 2女【数据字典】下拉选择 // 初始化报名人性别
function initApplySexSelect() { function initApplySexSelect() {
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) { top.restAjax.get(top.restAjax.path('api/data/listbyparentid/4ef46940-76ab-4758-b5f0-0cbc93ffc660', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('applySexSelectTemplate').innerHTML).render(data, function(html) { laytpl(document.getElementById('applySexSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('applySexSelectTemplateBox').innerHTML = html; document.getElementById('applySexSelectTemplateBox').innerHTML = html;
}); });
@ -238,6 +283,45 @@
}); });
} }
// 初始化报名人证件类型
function initApplyCardTypeSelect() {
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/76c5044f-805a-4313-b1e8-79e966b97c0d', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('applyCardTypeSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('applyCardTypeSelectTemplateBox').innerHTML = html;
});
form.render('select', 'applyCardTypeSelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化报名人文化程度
function initApplyCultureLevelSelect() {
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/d6b9f026-6ea9-456a-b48b-0c18d502523b', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('applyCultureLevelSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('applyCultureLevelSelectTemplateBox').innerHTML = html;
});
form.render('select', 'applyCultureLevelSelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化报名人身体状态
function initApplyPhysicalStateSelect() {
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/e4680c90-7a1f-4f09-96c8-0c583d8031ba', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('applyPhysicalStateSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('applyPhysicalStateSelectTemplateBox').innerHTML = html;
});
form.render('select', 'applyPhysicalStateSelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化报名人出生日期日期 // 初始化报名人出生日期日期
function initApplyDataBirthDate() { function initApplyDataBirthDate() {
laydate.render({ laydate.render({
@ -248,59 +332,88 @@
}); });
} }
// 初始化报名人证件类型【数据字典】下拉选择
function initApplyCardTypeSelect() { // 初始化头像图片上传
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) { function initApplyUserCardPhotoUploadFile() {
laytpl(document.getElementById('applyCardTypeSelectTemplate').innerHTML).render(data, function(html) { var files = $('#applyUserCardPhoto').val();
document.getElementById('applyCardTypeSelectTemplateBox').innerHTML = html; initFileList('applyUserCardPhoto', files, function(fileName) {
var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false});
viewerObj[fileName] = viewer;
});
form.on('button(applyUserCardPhotoUploadFile)', 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(applyUserCardPhotoRemoveFile)', 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();
}); });
form.render('select', 'applyCardTypeSelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
}); });
} }
// 初始化报名人文化程度【数据字典】下拉选择
function initApplyCultureLevelSelect() {
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('applyCultureLevelSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('applyCultureLevelSelectTemplateBox').innerHTML = html;
});
form.render('select', 'applyCultureLevelSelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化报名人身体状态【数据字典】下拉选择
function initApplyPhysicalStateSelect() {
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('applyPhysicalStateSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('applyPhysicalStateSelectTemplateBox').innerHTML = html;
});
form.render('select', 'applyPhysicalStateSelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化内容 // 初始化内容
function initData() { function initData() {
if(applyWorkTypeId == '' || applyInstitutionId==''){
top.dialog.msg('参数错误');
return;
}
initApplySexSelect(); initApplySexSelect();
initApplyDataBirthDate(); initApplyDataBirthDate();
initApplyCardTypeSelect(); initApplyCardTypeSelect();
initApplyCultureLevelSelect(); initApplyCultureLevelSelect();
initApplyPhysicalStateSelect(); initApplyPhysicalStateSelect();
initApplyUserCardPhotoUploadFile();
} }
initData(); initData();
// 提交表单 // 提交表单
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
formData.field.applyWorkTypeId = applyWorkTypeId;
formData.field.applyInstitutionId = applyInstitutionId;
top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index); top.dialog.close(index);
var loadLayerIndex; var loadLayerIndex;
top.restAjax.post(top.restAjax.path('api/apply/save', []), formData.field, null, function(code, data) { top.restAjax.post(top.restAjax.path('api/apply/save-relation', []), formData.field, null, function(code, data) {
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
time: 0, time: 0,
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], btn: [top.dataMessage.button.yes, top.dataMessage.button.no],