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">用印日期 <span style="color: red">*</span></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<input id="detail_time" name="detail_time" autocomplete="off" readonly class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
|
|
|
</td>
|
|
|
|
<td class="layui-td-gray">印章类型<font>*</font></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<select name="detail_type" lay-verify="required" lay-reqText="请选择">
|
|
|
|
<option value="">--请选择--</option>
|
|
|
|
{volist name=":oa_seal_cate()" 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">文件名称<font>*</font></td>
|
2022-02-11 13:23:31 +08:00
|
|
|
<td colspan="5"><input type="text" name="name" value="" autocomplete="off" placeholder="请输入文件名称" lay-verify="required" lay-reqText="请输入文件名称" class="layui-input"></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2022-06-08 15:13:48 +08:00
|
|
|
<td class="layui-td-gray">文件类型<font>*</font></td>
|
2022-02-11 13:23:31 +08:00
|
|
|
<td colspan="2">
|
|
|
|
<select name="other_type" lay-verify="required" lay-reqText="请选择">
|
|
|
|
<option value="">--请选择--</option>
|
|
|
|
<option value="1">公告类</option>
|
|
|
|
<option value="2">规则制度类</option>
|
|
|
|
<option value="3">合同类</option>
|
|
|
|
<option value="4">资质更新类</option>
|
|
|
|
<option value="5">员工证明</option>
|
|
|
|
<option value="6">其他</option>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
<td class="layui-td-gray">文件份数 <span style="color: red">*</span></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<input name="num" autocomplete="off" class="layui-input" value="" lay-verify="required|number" placeholder="请填写文件份数" lay-reqText="请填写文件份数">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="layui-td-gray">用印事由<font>*</font></td>
|
|
|
|
<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">用印日期 <span style="color: red">*</span></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<input id="detail_time" name="detail_time" autocomplete="off" readonly class="layui-input" value="{$detail.detail_time}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
|
|
|
</td>
|
|
|
|
<td class="layui-td-gray">印章类型<font>*</font></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<select name="detail_type" lay-verify="required" lay-reqText="请选择">
|
|
|
|
<option value="">--请选择--</option>
|
|
|
|
{volist name=":oa_seal_cate()" id="vo"}
|
|
|
|
<option value="{$vo.id}" {eq name="$detail.detail_type" value="$vo.id"}selected=""{/eq}>{$vo.title}</option>
|
|
|
|
{/volist}
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2022-06-08 15:13:48 +08:00
|
|
|
<td class="layui-td-gray">文件名称<font>*</font></td>
|
2022-02-11 13:23:31 +08:00
|
|
|
<td colspan="5"><input type="text" name="name" value="{$detail.name}" autocomplete="off" placeholder="请输入文件名称" lay-verify="required" lay-reqText="请输入文件名称" class="layui-input"></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2022-06-08 15:13:48 +08:00
|
|
|
<td class="layui-td-gray">文件类型<font>*</font></td>
|
2022-02-11 13:23:31 +08:00
|
|
|
<td colspan="2">
|
|
|
|
<select name="other_type" lay-verify="required" lay-reqText="请选择">
|
|
|
|
<option value="">--请选择--</option>
|
|
|
|
<option value="1" {eq name="$detail.other_type" value="1"}selected=""{/eq}>公告类</option>
|
|
|
|
<option value="2" {eq name="$detail.other_type" value="2"}selected=""{/eq}>规则制度类</option>
|
|
|
|
<option value="3" {eq name="$detail.other_type" value="3"}selected=""{/eq}>合同类</option>
|
|
|
|
<option value="4" {eq name="$detail.other_type" value="4"}selected=""{/eq}>资质更新类</option>
|
|
|
|
<option value="5" {eq name="$detail.other_type" value="5"}selected=""{/eq}>员工证明</option>
|
|
|
|
<option value="6" {eq name="$detail.other_type" value="6"}selected=""{/eq}>其他</option>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
<td class="layui-td-gray">文件份数 <span style="color: red">*</span></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<input name="num" autocomplete="off" class="layui-input" value="{$detail.num}" lay-verify="required|number" placeholder="请填写文件份数" lay-reqText="请填写文件份数">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="layui-td-gray">用印事由<font>*</font></td>
|
|
|
|
<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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2022-06-08 15:13:48 +08:00
|
|
|
});
|
2022-02-11 13:23:31 +08:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{/block}
|
|
|
|
<!-- /脚本 -->
|