2022-02-11 13:23:31 +08:00
|
|
|
{extend name="../../base/view/common/base" /}
|
|
|
|
{block name="style"}
|
|
|
|
{include file="/approve/add_style" /}
|
|
|
|
{/block}
|
|
|
|
<!-- 主体 -->
|
|
|
|
{block name="body"}
|
2022-06-08 15:13:48 +08:00
|
|
|
<form class="layui-form p-4">
|
|
|
|
<h3 class="pb-3">转正申请审批</h3>
|
2022-02-11 13:23:31 +08:00
|
|
|
{eq name="$id" value="0"}
|
|
|
|
<table class="layui-table layui-table-form">
|
|
|
|
<tr>
|
|
|
|
<td class="layui-td-gray">员工姓名<font>*</font></td>
|
|
|
|
<td colspan="2"><input type="text" name="name" value="" autocomplete="off" placeholder="请输入员工姓名" lay-verify="required" lay-reqText="请输入员工姓名" class="layui-input"></td>
|
|
|
|
<td class="layui-td-gray">转正日期 <span style="color: red">*</span></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<input id="detail_time" name="detail_time" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="layui-td-gray">所在部门<font>*</font></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<select name="department_type" lay-verify="required" lay-reqText="请选择所在部门">
|
|
|
|
<option value="">--请选择--</option>
|
|
|
|
{volist name=":get_department()" id="vo"}
|
|
|
|
<option value="{$vo.id}">{$vo.title}</option>
|
|
|
|
{/volist}
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
<td class="layui-td-gray">担任职务<font>*</font></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<select name="position_type" lay-verify="required" lay-reqText="请选择担任职务">
|
|
|
|
<option value="">--请选择--</option>
|
|
|
|
{volist name=":get_position()" id="vo"}
|
|
|
|
<option value="{$vo.id}">{$vo.title}</option>
|
|
|
|
{/volist}
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2022-06-08 15:13:48 +08:00
|
|
|
<td class="layui-td-gray-2">试用期评价<font>*</font></td>
|
2022-02-11 13:23:31 +08:00
|
|
|
<td colspan="5">
|
|
|
|
<textarea name="content" placeholder="请输入备注" class="layui-textarea" lay-verify="required" lay-reqText="请输入试用期评价"></textarea>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="layui-td-gray">审批流程<font>*</font></td>
|
|
|
|
<td colspan="5">
|
|
|
|
<select name="flow_id" lay-verify="required" lay-filter="flowtype" lay-reqText="请选择审批流程">
|
|
|
|
<option value="">--请选择--</option>
|
|
|
|
{volist name="flows" id="vo"}
|
|
|
|
<option value="{$vo.id}" title="{$vo.check_type}">{$vo.name}</option>
|
|
|
|
{/volist}
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr id="flow_tr">
|
|
|
|
<td class="layui-td-gray">审核人<font>*</font></td>
|
|
|
|
<td colspan="5">
|
|
|
|
<input type="hidden" name="check_admin_ids" value="" readonly><input type="text" name="check_admin_name" value="" autocomplete="off" placeholder="请选择审核人" lay-verify="required" lay-reqText="请选择审核人" class="layui-input" readonly>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
{else/}
|
|
|
|
<table class="layui-table layui-table-form">
|
|
|
|
<tr>
|
|
|
|
<td class="layui-td-gray">员工姓名<font>*</font></td>
|
|
|
|
<td colspan="2"><input type="text" name="name" value="{$detail.name}" autocomplete="off" placeholder="请输入员工姓名" lay-verify="required" lay-reqText="请输入员工姓名" class="layui-input"></td>
|
|
|
|
<td class="layui-td-gray">转正日期 <span style="color: red">*</span></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<input id="detail_time" name="detail_time" autocomplete="off" class="layui-input" value="{$detail.detail_time}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="layui-td-gray">所在部门<font>*</font></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<select name="department_type" lay-verify="required" lay-reqText="请选择所在部门">
|
|
|
|
<option value="">--请选择--</option>
|
|
|
|
{volist name=":get_department()" id="vo"}
|
|
|
|
<option value="{$vo.id}" {eq name="$vo.id" value="$detail.department_type"}selected=""{/eq}>{$vo.title}</option>
|
|
|
|
{/volist}
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
<td class="layui-td-gray">担任职务<font>*</font></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<select name="position_type" lay-verify="required" lay-reqText="请选择担任职务">
|
|
|
|
<option value="">--请选择--</option>
|
|
|
|
{volist name=":get_position()" id="vo"}
|
|
|
|
<option value="{$vo.id}" {eq name="$vo.id" value="$detail.position_type"}selected=""{/eq}>{$vo.title}</option>
|
|
|
|
{/volist}
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2022-06-08 15:13:48 +08:00
|
|
|
<td class="layui-td-gray-2">试用期评价<font>*</font></td>
|
2022-02-11 13:23:31 +08:00
|
|
|
<td colspan="5">
|
|
|
|
<textarea name="content" placeholder="请输入备注" class="layui-textarea" lay-verify="required" lay-reqText="请输入试用期评价">{$detail.content}</textarea>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="layui-td-gray">审批流程<font>*</font></td>
|
|
|
|
<td colspan="5">
|
|
|
|
<select name="flow_id" lay-verify="required" lay-filter="flowtype" lay-reqText="请选择审批流程">
|
|
|
|
<option value="">--请选择--</option>
|
|
|
|
{volist name="flows" id="vo"}
|
|
|
|
<option value="{$vo.id}" title="{$vo.check_type}">{$vo.name}</option>
|
|
|
|
{/volist}
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr id="flow_tr">
|
|
|
|
<td class="layui-td-gray">审核人<font>*</font></td>
|
|
|
|
<td colspan="5">
|
|
|
|
<input type="hidden" name="check_admin_ids" value="" readonly><input type="text" name="check_admin_name" value="" autocomplete="off" placeholder="请选择审核人" lay-verify="required" lay-reqText="请选择审核人" class="layui-input" readonly>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
{/eq}
|
|
|
|
<div style="padding: 10px 0">
|
|
|
|
<input type="hidden" name="id" value="{$id}">
|
|
|
|
<input type="hidden" name="type" value="{$type}">
|
|
|
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
|
|
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{/block}
|
|
|
|
<!-- /主体 -->
|
|
|
|
|
|
|
|
<!-- 脚本 -->
|
|
|
|
{block name="script"}
|
|
|
|
<script>
|
2022-06-08 15:13:48 +08:00
|
|
|
const moduleInit = ['tool','employeepicker'];
|
|
|
|
function gouguInit() {
|
|
|
|
var form = layui.form,tool=layui.tool, employeepicker = layui.employeepicker,laydate = layui.laydate;
|
2022-02-11 13:23:31 +08:00
|
|
|
|
|
|
|
//日期时间范围
|
|
|
|
laydate.render({
|
|
|
|
elem: '#detail_time',
|
|
|
|
type: 'date',
|
|
|
|
format: 'yyyy-MM-dd',
|
|
|
|
showBottom: false
|
|
|
|
});
|
|
|
|
|
|
|
|
//选择人员
|
|
|
|
$('.layui-form').on('click','[name="check_admin_name"]',function(){
|
|
|
|
if($('[name="flow_id"]').val()==''){
|
|
|
|
layer.msg('请先选择审批流程');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
employeepicker.init({
|
|
|
|
department_url: "/api/index/get_department_tree",
|
|
|
|
employee_url: "/api/index/get_employee",
|
|
|
|
type:0,
|
|
|
|
callback:function(ids,names){
|
|
|
|
$('[name="check_admin_ids"]').val(ids),
|
|
|
|
$('[name="check_admin_name"]').val(names);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
//监听提交
|
|
|
|
form.on('submit(webform)', function(data){
|
|
|
|
$.ajax({
|
|
|
|
url: "/oa/approve/add",
|
|
|
|
type:'post',
|
|
|
|
data:data.field,
|
|
|
|
success: function (e) {
|
|
|
|
layer.msg(e.msg);
|
|
|
|
if (e.code == 0) {
|
2022-06-08 21:22:26 +08:00
|
|
|
setTimeout(function(){
|
2022-06-08 15:13:48 +08:00
|
|
|
parent.layui.tool.close();
|
2022-06-08 21:22:26 +08:00
|
|
|
parent.layui.pageTable.reload();
|
2022-02-11 13:23:31 +08:00
|
|
|
},1000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
form.on('select(flowtype)', function(data){
|
|
|
|
var check_type = data.elem[data.elem.selectedIndex].title;
|
|
|
|
var formHtml='<td class="layui-td-gray">审核人<font>*</font></td>\
|
|
|
|
<td colspan="5">\
|
|
|
|
<input type="hidden" name="check_admin_ids" value="" readonly><input type="text" name="check_admin_name" value="" autocomplete="off" placeholder="请选择审核人" lay-verify="required" lay-reqText="请选择审核人" class="layui-input" readonly>\
|
|
|
|
</td>';
|
|
|
|
if(check_type == 2){
|
|
|
|
$('#flow_tr').html(formHtml);
|
|
|
|
form.render();
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
$.ajax({
|
|
|
|
url: "/api/index/get_flow_users",
|
|
|
|
type:'post',
|
|
|
|
data:{id:data.value},
|
|
|
|
success: function (e) {
|
|
|
|
if (e.code == 0) {
|
|
|
|
var flowLi='';
|
|
|
|
for(var a=0;a<e.data.length;a++){
|
|
|
|
var userList='',sign_type = '';
|
|
|
|
if(e.data[a].flow_type==1){
|
|
|
|
userList+= '<li style="padding:3px 0">当前部门负责人</li>';
|
|
|
|
}
|
|
|
|
else if(e.data[a].flow_type==2){
|
|
|
|
userList+= '<li style="padding:3px 0">上级部门负责人</li>';
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
if(e.data[a].flow_type==3){
|
|
|
|
sign_type= ' <span class="layui-badge layui-bg-blue">或签</span>'
|
|
|
|
}
|
|
|
|
if(e.data[a].flow_type==4){
|
|
|
|
sign_type= ' <span class="layui-badge layui-bg-blue">会签</span>'
|
|
|
|
}
|
|
|
|
for(var b=0;b<e.data[a].user_id_info.length;b++){
|
|
|
|
userList+= '<li style="padding:3px 0"><img src="'+e.data[a].user_id_info[b].thumb+'" style="width:24px; height:24px; border-radius:50%; margin-right:8px;" />'+e.data[a].user_id_info[b].name+'</li>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
flowLi+='<li class="layui-timeline-item">\
|
|
|
|
<i class="layui-icon layui-timeline-axis"></i>\
|
|
|
|
<div class="layui-timeline-content">\
|
|
|
|
<p class="layui-timeline-title"><strong>第'+(a+1)+'级审批</strong>'+sign_type+'</p>\
|
|
|
|
<ul>'+userList+'</ul>\
|
|
|
|
</div>\
|
|
|
|
</li>';
|
|
|
|
}
|
|
|
|
|
|
|
|
formHtml = '<td class="layui-td-gray">审批流程</td>\
|
|
|
|
<td colspan="5">\
|
|
|
|
<ul id="flowList" class="layui-timeline">'+flowLi+'</ul>\
|
|
|
|
</td>';
|
|
|
|
$('#flow_tr').html(formHtml);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{/block}
|
|
|
|
<!-- /脚本 -->
|