You've already forked guangan
OA审核
This commit is contained in:
133
plugs/think-plugs-ticket/src/view/approval/form.html
Normal file
133
plugs/think-plugs-ticket/src/view/approval/form.html
Normal file
@ -0,0 +1,133 @@
|
||||
<form class="layui-form layui-card" action="{:sysuri()}" data-auto="true" method="post" autocomplete="off" data-table-id="ticketTable">
|
||||
<div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">流程名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="name" lay-verify="required" value="{$vo.name|default=''}" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">流程类型</label>
|
||||
<div class="layui-input-block">
|
||||
<select class="layui-select" name="type" required>
|
||||
<option value="GDSH" {if isset($vo.type) && $vo.type == 'GDSH'}selected{/if}>工单审核</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">审批步骤</label>
|
||||
<div class="layui-input-block" id="approval-steps">
|
||||
<table class="layui-hide" id="processStepTable" lay-filter="processStepTable"></table>
|
||||
<button type="button" class="layui-btn layui-btn-normal add-step">添加步骤</button>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="steps" value='{$vo.steps|default=[]|raw|json_encode}'>
|
||||
{notempty name='vo.id'}<input type="hidden" name="id" value="{$vo.id}">{/notempty}
|
||||
</div>
|
||||
<div class="layui-form-item text-center">
|
||||
<button class="layui-btn layui-btn-normal" type='submit'>保存数据</button>
|
||||
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/html" id="editToolbar">
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs remove-step">删除</a>
|
||||
</script>
|
||||
<script type="text/html" id="approverType">
|
||||
<select class="layui-select" lay-filter="approverType" required>
|
||||
<option value="0" {{# if (d.approver_type == 0) {}} selected {{# } }}>固定审批人</option>
|
||||
<option value="3" {{# if (d.approver_type == 3) {}} selected {{# } }}>自由指定审批人</option>
|
||||
</select>
|
||||
</script>
|
||||
<script type="text/html" id="approverId">
|
||||
{{# if (d.approver_type == 0) { }}
|
||||
<select class="layui-select" lay-filter="approverId" required lay-search>
|
||||
<option value="">请选择审批人</option>
|
||||
{foreach $users as $user}
|
||||
<option value="{$user.id}" {{# if (d.approver_id == {$user.id}) {}} selected {{# } }}>{$user.username}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{{# } else { }}
|
||||
用户自行选择
|
||||
{{# } }}
|
||||
</script>
|
||||
<style>
|
||||
.layui-table-cell {
|
||||
overflow: visible !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(function () {
|
||||
layui.use(['table', 'form'], function () {
|
||||
var table = layui.table,
|
||||
form = layui.form;
|
||||
// 回显步骤数据
|
||||
var stepsData = JSON.parse($('input[name="steps"]').val());
|
||||
table.render({
|
||||
height: '400',
|
||||
title: '步骤列表',
|
||||
cols: [[
|
||||
{field:'title', title:'步骤名称', width:160, edit: true},
|
||||
{field:'approver_type', title:'审批人类型', width:160, templet: '#approverType'},
|
||||
{field:'approver_id', title:'审批人类型', width:160, templet: '#approverId'},
|
||||
{align: 'center', toolbar: '#editToolbar', title: '操作', width: 200}
|
||||
]],
|
||||
data: stepsData,
|
||||
page: false,
|
||||
id: 'processStepTable',
|
||||
elem: '#processStepTable',
|
||||
})
|
||||
form.on('select(approverType)', function (data, item) {
|
||||
var index = $(this).closest('tr').data('index');
|
||||
const currData = table.cache['processStepTable'] || [];
|
||||
currData[index].approver_type = data.value;
|
||||
$('input[name="steps"]').val(JSON.stringify(currData))
|
||||
table.reload('processStepTable', {
|
||||
data: currData
|
||||
});
|
||||
});
|
||||
form.on('select(approverId)', function (data, item) {
|
||||
var index = $(this).closest('tr').data('index');
|
||||
const currData = table.cache['processStepTable'] || [];
|
||||
currData[index].approver_id = data.value;
|
||||
$('input[name="steps"]').val(JSON.stringify(currData))
|
||||
table.reload('processStepTable', {
|
||||
data: currData
|
||||
});
|
||||
});
|
||||
table.on('tool(processStepTable)', function (obj) {
|
||||
if (obj.event === 'remove') {
|
||||
obj.del();
|
||||
}
|
||||
});
|
||||
table.on('edit(processStepTable)', function (obj) {
|
||||
const currData = table.cache['processStepTable'] || [];
|
||||
$('input[name="steps"]').val(JSON.stringify(currData))
|
||||
|
||||
})
|
||||
// 添加步骤
|
||||
$('.add-step').on('click', function () {
|
||||
const currData = table.cache['processStepTable'] || [];
|
||||
currData.push({
|
||||
title: '',
|
||||
approver_type: 0,
|
||||
})
|
||||
table.reload('processStepTable', {
|
||||
data: currData
|
||||
});
|
||||
});
|
||||
|
||||
// 删除步骤
|
||||
$('#approval-steps').on('click', '.remove-step', function () {
|
||||
var index = $(this).closest('tr').data('index');
|
||||
const currData = table.cache['processStepTable'] || [];
|
||||
currData.splice(index, 1);
|
||||
table.reload('processStepTable', {
|
||||
data: currData
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
51
plugs/think-plugs-ticket/src/view/approval/index.html
Normal file
51
plugs/think-plugs-ticket/src/view/approval/index.html
Normal file
@ -0,0 +1,51 @@
|
||||
{extend name="table"}
|
||||
|
||||
{block name="button"}
|
||||
<!--{if auth("add")}-->
|
||||
<a data-modal="{:url('add')}" data-height="80%" data-width="80%" class="layui-btn layui-btn-xs">添加流程</a>
|
||||
<!--{/if}-->
|
||||
{/block}
|
||||
|
||||
{block name="content"}
|
||||
<div class="layui-row">
|
||||
<div class="layui-col">
|
||||
<div class="article_list think-bg-white">
|
||||
{include file='approval/index_search'}
|
||||
<table class="layui-hide" data-url="{$request->url()}" data-target-search="form.form-search" id="processTable" lay-filter="processTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="toolbar">
|
||||
<!--{if auth("edit")}-->
|
||||
<a data-modal="{:url('edit')}?id={{ d.id }}" data-width="50%" class="layui-btn layui-btn-xs">编辑</a>
|
||||
<!--{/if}-->
|
||||
<!--{if auth("remove")}-->
|
||||
<a data-confirm="确定删除该流程?" data-action="{:url('remove')}" data-value="id#{{d.id}}" class="layui-btn layui-btn-danger layui-btn-xs">删除</a>
|
||||
<!--{/if}-->
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
|
||||
{block name='style'}
|
||||
<style>
|
||||
</style>
|
||||
{/block}
|
||||
|
||||
{block name='script'}
|
||||
<script>
|
||||
$(function () {
|
||||
$('#processTable').layTable({
|
||||
height: 'full-250',
|
||||
toolbar: true,
|
||||
sort: {field: 'create_time', type: 'desc'},
|
||||
title: '流程列表',
|
||||
cols: [[
|
||||
{field:'create_time', title: '创建时间', width: 160, sort: true},
|
||||
{field:'name', title:'流程名称', width:160},
|
||||
{align: 'center', toolbar: '#toolbar', title: '操作', width: 200}
|
||||
]]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
16
plugs/think-plugs-ticket/src/view/approval/index_search.html
Normal file
16
plugs/think-plugs-ticket/src/view/approval/index_search.html
Normal file
@ -0,0 +1,16 @@
|
||||
<fieldset>
|
||||
<legend>条件搜索</legend>
|
||||
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
|
||||
<div class="layui-form-item layui-inline">
|
||||
<label class="layui-form-label">流程名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="name" value="{:input('get.name')}" placeholder="请输入流程名称" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-inline">
|
||||
<button class="layui-btn layui-btn-primary" lay-submit lay-filter="searchData"><i class="layui-icon"></i> 搜 索</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</fieldset>
|
104
plugs/think-plugs-ticket/src/view/ticket/approve.html
Normal file
104
plugs/think-plugs-ticket/src/view/ticket/approve.html
Normal file
@ -0,0 +1,104 @@
|
||||
<div class="layui-collapse">
|
||||
<div class="layui-colla-item">
|
||||
<div class="layui-colla-title">审核流程</div>
|
||||
<div class="layui-colla-content">
|
||||
<div class="layui-timeline">
|
||||
<div class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h3 class="layui-timeline-title">提交审核</h3>
|
||||
</div>
|
||||
</div>
|
||||
{foreach $process.steps as $index=>$step}
|
||||
<div class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h3 class="layui-timeline-title">第{$index+1}步{if $step_index == $index}(当前步骤){/if}</h3>
|
||||
<p>
|
||||
{$step.title}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{if $instance->isEmpty()}
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">创建审核单</div>
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form" data-table-id="formDemo" action="{:url('create_approval')}" data-auto="true" method="post">
|
||||
<input type="hidden" name="id" value="{$vo.id}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">审核说明</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" placeholder="请输入审核说明" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
{if $current_step.approver_type == 3}
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">请指定下一步审核人</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="approver_id" lay-verify="required" lay-search>
|
||||
<option value="">请选择审核人</option>
|
||||
{foreach $users as $user}
|
||||
<option value="{$user.id}">{$user.username}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" type='submit'>立即提交</button>
|
||||
<button class="layui-btn layui-btn-primary" type="reset">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">工单审核</div>
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form" data-table-id="formDemo" action="{:url('do_approve')}" data-auto="true" method="post">
|
||||
<input type="hidden" name="id" value="{$vo.id}">
|
||||
<input type="hidden" name="instance_id" value="{$instance->id}">
|
||||
<input type="hidden" name="step_index" value="{$step_index}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">审核结果</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="status" value="1" title="通过" checked>
|
||||
<input type="radio" name="status" value="2" title="不通过">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">审核意见</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" placeholder="请输入审核意见" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
{if $current_step.approver_type == 3}
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">请指定下一步审核人</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="approver_id" lay-verify="required" lay-search>
|
||||
<option value="">请选择审核人</option>
|
||||
{foreach $users as $user}
|
||||
<option value="{$user.id}">{$user.username}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" type='submit'>立即提交</button>
|
||||
<button class="layui-btn layui-btn-primary" type="reset">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
@ -22,12 +22,25 @@
|
||||
<!--{if auth("detail")}-->
|
||||
<a data-modal="{:url('detail')}?id={{ d.id }}" data-height="90%" data-width="60%" class="layui-btn layui-btn-xs layui-btn-normal" title="详情">详情</a>
|
||||
<!--{/if}-->
|
||||
{{# if (d.status == 0) { }}
|
||||
<!--{if auth("move")}-->
|
||||
<a data-modal="{:url('move')}?id={{ d.id }}" data-height="80%" data-width="80%" class="layui-btn layui-btn-xs" title="分配">分配</a>
|
||||
<!--{/if}-->
|
||||
{{# } }}
|
||||
{{# if (d.status == -1) { }}
|
||||
<!--{if auth("approve")}-->
|
||||
{{# if (d.approval == null) { }}
|
||||
<a data-modal="{:url('approve')}?id={{ d.id }}" data-height="90%" data-width="50%" class="layui-btn layui-btn-xs" title="审核">审核</a>
|
||||
{{# } else if (d.approval.status == 0 && d.approval.current.approver_id == {$user_id}) { }}
|
||||
<a data-modal="{:url('approve')}?id={{ d.id }}" data-height="90%" data-width="50%" class="layui-btn layui-btn-xs" title="去审核">去审核</a>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
<!--{/if}-->
|
||||
{{# if (d.approval == null || d.approval.status != 1) { }}
|
||||
<!--{if auth("edit")}-->
|
||||
<a data-modal="{:url('edit')}?id={{ d.id }}" data-height="80%" data-width="80%" class="layui-btn layui-btn-xs layui-btn-danger" title="修改工单">修改</a>
|
||||
<!--{/if}-->
|
||||
{{# } }}
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
@ -66,11 +79,18 @@
|
||||
}
|
||||
}},
|
||||
{field:'status', title:'状态', width:80, templet:function(item){
|
||||
if(item.status == 0){
|
||||
return '<span style="color:red;">正在处理</span>';
|
||||
if (item.approval != null) {
|
||||
if (item.approval.status != 1) {
|
||||
return item.approval.status == 2 ? '<span style="color:red;">审核不通过</span>' : '<span style="color:gray;">审核中</span>';
|
||||
}
|
||||
}
|
||||
if(item.status < 0){
|
||||
return '<span style="color:red;">待提交审核</span>';
|
||||
}else if(item.status == 0){
|
||||
return '<span style="color:red;">待分配</span>';
|
||||
}else if(item.status == 1){
|
||||
return '<span style="color:green;">已处理</span>';
|
||||
}else{
|
||||
}else if(item.status == 2){
|
||||
return '<span style="color:gray;">已关闭</span>';
|
||||
}
|
||||
}},
|
||||
|
Reference in New Issue
Block a user