提交 6b9dd779 编写于 作者: doc_wei's avatar doc_wei

面试者管理编辑功能完成

上级 ab15507c
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'textool', 'tagEditor', 'form'], function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
textool = layui.textool,
form = layui.form;
var chargePerson = [];
showGrid({
id: "showForm",
url: reqBasePath + "bossInterviewee004",
params: {id: parent.rowId},
pagination: false,
method: "GET",
template: $("#beanTemplate").html(),
ajaxSendAfter: function (json) {
$("input:radio[name=userSex][value=" + json.bean.sex + "]").attr("checked", true);
bossUtil.bossIntervieweeFromChooseMation = {
id: json.bean.fromId,
title: json.bean.fromName
};
var userNames = [];
chargePerson = [].concat(json.bean.chargePerson);
$.each(chargePerson, function(i, item){
userNames.push(item.name);
});
$('#chargePersonId').tagEditor({
initialTags: userNames,
placeholder: '请选择负责人',
editorTag: false,
beforeTagDelete: function(field, editor, tags, val) {
var inArray = -1;
$.each(chargePerson, function(i, item) {
if(val === item.name) {
inArray = i;
return false;
}
});
if(inArray != -1) { //如果该元素在集合中存在
chargePerson.splice(inArray, 1);
}
}
});
textool.init({
eleId: 'basicResume',
maxlength: 1000,
tools: ['count', 'copy', 'reset', 'clear']
});
skyeyeEnclosure.initTypeISData({'enclosureUpload': json.bean.enclosureInfo});
matchingLanguage();
form.render();
form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
name: $("#name").val(),
sex: $("input[name='userSex']:checked").val(),
idcard: $("#idcard").val(),
phone: $("#phone").val(),
fromId: bossUtil.bossIntervieweeFromChooseMation.id,
favoriteJob: $("#favoriteJob").val(),
basicResume: $("#basicResume").val(),
workYears: $("#workYears").val(),
chargePersonId: chargePerson[0].id,
enclosureResume: skyeyeEnclosure.getEnclosureIdsByBoxId('enclosureUpload'),
id: parent.rowId
};
AjaxPostUtil.request({url: reqBasePath + "bossInterviewee005", params: params, type: 'json', method: "PUT", callback: function(json){
if(json.returnCode == 0){
parent.layer.close(index);
parent.refreshCode = '0';
}else{
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
}
return false;
});
}
});
// 人员选择
$("body").on("click", "#toHandsPersonSelPeople", function(e){
systemCommonUtil.userReturnList = [].concat(chargePerson);
systemCommonUtil.chooseOrNotMy = "1"; // 人员列表中是否包含自己--1.包含;其他参数不包含
systemCommonUtil.chooseOrNotEmail = "2"; // 人员列表中是否必须绑定邮箱--1.必须;其他参数没必要
systemCommonUtil.checkType = "2"; // 人员选择类型,1.多选;其他。单选
systemCommonUtil.openSysUserStaffChoosePage(function (staffChooseList){
// 移除所有tag
var tags = $('#chargePersonId').tagEditor('getTags')[0].tags;
for (i = 0; i < tags.length; i++) {
$('#chargePersonId').tagEditor('removeTag', tags[i]);
}
chargePerson = [].concat(staffChooseList);
// 添加新的tag
$.each(chargePerson, function(i, item){
$('#chargePersonId').tagEditor('addTag', item.name);
});
});
});
// 选择来源
$("body").on("click", "#toChooseFromId", function(e){
var _this = $(this);
bossUtil.openBossIntervieweeFromChoosePage(function (bossIntervieweeFromMation){
_this.parent().find("input").val(bossIntervieweeFromMation.title);
});
});
$("body").on("click", "#cancle", function(){
parent.layer.close(index);
});
});
\ No newline at end of file
......@@ -38,7 +38,7 @@
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">来源<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="fromId" name="fromId" win-verify="required" placeholder="请选择来源" class="layui-input" style="padding-right: 30px;"/>
<input type="text" id="fromId" name="fromId" win-verify="required" placeholder="请选择来源" class="layui-input" style="padding-right: 30px;" disabled/>
<i class="fa fa-user-plus input-icon" id="toChooseFromId"></i>
</div>
</div>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
</form>
</div>
<script type="text/x-handlebars-template" id="beanTemplate">
{{#bean}}
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">姓名<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="name" name="name" win-verify="required" placeholder="请输入姓名" class="layui-input" maxlength="60" value="{{name}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">性别<i class="red">*</i></label>
<div class="layui-input-block winui-radio">
<input type="radio" name="userSex" value="0" title="保密" />
<input type="radio" name="userSex" value="1" title="" />
<input type="radio" name="userSex" value="2" title="" />
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">身份证</label>
<div class="layui-input-block">
<input type="text" id="idcard" name="idcard" win-verify="identity" placeholder="请输入身份证" class="layui-input" maxlength="18" value="{{idcard}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">联系方式<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="phone" name="phone" win-verify="required|phone" placeholder="请输入联系方式" class="layui-input" value="{{phone}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">来源<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="fromId" name="fromId" win-verify="required" placeholder="请选择来源" class="layui-input" style="padding-right: 30px;" disabled value="{{fromName}}"/>
<i class="fa fa-user-plus input-icon" id="toChooseFromId"></i>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">工作年限<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="workYears" name="workYears" win-verify="required" placeholder="请输入工作年限" class="layui-input" value="{{workYears}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">负责人<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="chargePersonId" name="chargePersonId" win-verify="required" placeholder="请选择负责人" class="layui-input" style="padding-right: 30px;"/>
<i class="fa fa-user-plus input-icon" id="toHandsPersonSelPeople"></i>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">心仪岗位<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="favoriteJob" name="favoriteJob" win-verify="required" placeholder="请输入心仪岗位" class="layui-input" value="{{favoriteJob}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">基本简历<i class="red">*</i></label>
<div class="layui-input-block">
<textarea id="basicResume" name="basicResume" class="layui-textarea" win-verify="required" style="height: 100px;">{{basicResume}}</textarea>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">附件资料</label>
<div class="layui-input-block" id="enclosureUpload">
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formEditBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
{{/bean}}
</script>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/bossInterviewee/'}).use('bossIntervieweeEdit');
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册