427 lines
15 KiB
HTML
427 lines
15 KiB
HTML
{extend name="../../base/view/common/base" /}
|
|
{block name="style"}
|
|
<link rel="stylesheet" href="{__LAYUI__}/plugin/dtree/dtree.css">
|
|
<link rel="stylesheet" href="{__LAYUI__}/plugin/dtree/font/dtreefont.css">
|
|
<style>
|
|
.layui-form-pane .layui-form-label{color:#999; width:80px; padding:8px 3px;}
|
|
.layui-form-item .layui-inline{margin-right:3px; margin-bottom:10px;}
|
|
.layui-form-item{margin-bottom:5px;}
|
|
.layui-form-item .layui-btn-danger{display:none; margin-top:-8px}
|
|
.layui-form-item:hover .layui-btn-danger{display:inline-block;}
|
|
.select-1,.select-2{display:none;}
|
|
|
|
.check-items{overflow-x: auto; padding: 10px 0;}
|
|
.flow-flex-row {box-direction: row;
|
|
box-orient: horizontal;
|
|
-webkit-box-orient: horizontal;
|
|
-ms-flex-direction: row;
|
|
flex-direction: row;
|
|
}
|
|
.flow-flexbox { width: 100%;text-align: left;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
display: -webkit-flex;
|
|
box-align: center;
|
|
-webkit-box-align: center;
|
|
-ms-flex-align: center;
|
|
align-items: center;
|
|
}
|
|
|
|
.check-item{width: auto; -ms-flex-negative: 0; flex-shrink: 0;}
|
|
.check-item i{font-size:20px; margin-right:3px; color:#4285f4;}
|
|
.check-item span{color:#999;margin:0 3px;}
|
|
.layui-icon[data-ok]{color:#34a853}
|
|
.layui-icon[data-no]{color:#FF5722;}
|
|
.check-item-status{color:#999; font-size:12px; margin-left:3px;}
|
|
|
|
.flow-tips{padding:6px 10px;}
|
|
.flow-tips li{padding:5px 0;}
|
|
.flow-tips li i{color:#4285f4;}
|
|
.flow-tips li span{color:#999; font-size:12px; margin-left:4px;}
|
|
|
|
.flow-record{padding:10px 10px 0;}
|
|
.flow-record .layui-icon {font-size:20px;}
|
|
.flow-record .layui-timeline-item{padding-bottom:10px;}
|
|
.layui-timeline-content ul{font-size:12px;}
|
|
.check-status{color:#999; margin-left:5px;}
|
|
.check-remark{padding:6px; margin-top:6px; margin-bottom:10px; border-radius:4px; background-color:#f5f5f5;}
|
|
|
|
.layui-table-min th{font-size:13px; text-align:center; background-color:#f8f8f8;}
|
|
.layui-table-min td{font-size:13px; padding:6px;text-align:center;}
|
|
</style>
|
|
{/block}
|
|
<!-- 主体 -->
|
|
{block name="body"}
|
|
<div class="page-content">
|
|
<h3 class="h3-title">报销详情</h3>
|
|
<table class="layui-table">
|
|
<tr>
|
|
<td class="layui-td-gray2">报销凭证编号</td>
|
|
<td>{$detail.code}</td>
|
|
<td class="layui-td-gray">入账月份</td>
|
|
<td>{$detail.income_month}</td>
|
|
<td class="layui-td-gray2">原始单据日期</td>
|
|
<td>{$detail.expense_time}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="layui-td-gray2">报销人</td>
|
|
<td>{$detail.create_user}</td>
|
|
<td class="layui-td-gray">报销部门</td>
|
|
<td>{$detail.department}</td>
|
|
<td class="layui-td-gray">报销总费用(元)</td>
|
|
<td><span style="color:#1E9FFF">{$detail.amount}</span></td>
|
|
</tr>
|
|
{if condition="$detail.pay_admin_id > 0"}
|
|
<tr>
|
|
<td class="layui-td-gray2">打款人</td>
|
|
<td>{$detail.pay_admin}</td>
|
|
<td class="layui-td-gray">打款时间</td>
|
|
<td colspan="3">{$detail.pay_time}</td>
|
|
</tr>
|
|
{/if}
|
|
<tr>
|
|
<td class="layui-td-gray2">费用金额</td>
|
|
<td colspan="5">
|
|
<div>
|
|
<table class="layui-table layui-table-min">
|
|
<tr>
|
|
<th width="100">报销金额(元)</th>
|
|
<th width="150">报销类别</th>
|
|
<th>备注信息</th>
|
|
</tr>
|
|
{volist name="$detail.list" id="vo"}
|
|
<tr>
|
|
<td>{$vo.amount}</td>
|
|
<td>{$vo.cate_title}</td>
|
|
<td style="text-align:left">{$vo.remarks}</td>
|
|
</tr>
|
|
{/volist}
|
|
</table>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="layui-td-gray">审核状态</td>
|
|
<td>{eq name="$detail.check_status" value="0"}<span style="color:#666666">待审批</span>{/eq}
|
|
{eq name="$detail.check_status" value="1"}<span style="color:#4285f4">审批中</span>{/eq}
|
|
{eq name="$detail.check_status" value="2"}<span style="color:#34a853">已通过</span>{/eq}
|
|
{eq name="$detail.check_status" value="3"}<span style="color:#FF5722">已拒绝</span>{/eq}
|
|
{eq name="$detail.check_status" value="4"}<span style="color:#fbbc05">已撤销</span>{/eq}
|
|
<span id="showRecord" class="layui-btn layui-btn-xs layui-btn-radius layui-btn-normal" style="margin-left:10px;">查看审批记录</span>
|
|
</td>
|
|
<td class="layui-td-gray">当前审核人</td>
|
|
<td colspan="3">{$detail.check_user}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="layui-td-gray">审批流程</td>
|
|
<td colspan="5">
|
|
<div class="flow-flexbox check-items flow-flex-row" id="flowList">
|
|
<div class="flow-flexbox check-item flow-flex-row">
|
|
<i class="layui-icon layui-icon-add-circle" data-ok=""></i>
|
|
<div class="check-item-name">{$detail.create_user}</div>
|
|
<div class="check-item-status">创建</div>
|
|
<span class="layui-icon layui-icon-right"></span>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{if ( $detail.check_status lt 2) AND ( $is_check_admin eq 1) }
|
|
{eq name="$flows.flow_type" value="0"}
|
|
<tr>
|
|
<td class="layui-td-gray">审批节点 <font>*</font></td>
|
|
<td colspan="5">
|
|
<form class="layui-form">
|
|
<input type="radio" name="check_node" lay-filter="check_node" value="1" title="审核结束">
|
|
<input type="radio" name="check_node" lay-filter="check_node" value="2" title="下一审批人">
|
|
<div class="layui-inline">
|
|
<input type="hidden" name="check_admin_ids" value=""><input type="text" name="check_admin_name" value="" autocomplete="off" placeholder="请选择下一审批人" lay-verify="required" lay-reqText="请选择下一审批人" class="layui-input">
|
|
</div>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{/eq}
|
|
<tr>
|
|
<td class="layui-td-gray">审批意见 <font>*</font></td>
|
|
<td colspan="5">
|
|
<textarea name="content" placeholder="请输入审批意见" class="layui-textarea"></textarea>
|
|
</td>
|
|
</tr>
|
|
{/if}
|
|
</table>
|
|
<input type="hidden" name="id" value="{$detail.id}">
|
|
<input type="hidden" name="flow_type" value="{$flows.flow_type}">
|
|
<div id="formBtn" style="padding: 10px 0">
|
|
{eq name="$is_check_admin" value='1'}
|
|
<span class="layui-btn layui-btn-normal" data-status="1"><i class="layui-icon layui-icon-ok"></i> 通过</span>
|
|
<span class="layui-btn layui-btn-danger" data-status="2"><i class="layui-icon layui-icon-close"></i> 拒绝</span>
|
|
{/eq}
|
|
{if ( $detail.check_status lt 2) AND ( $is_create_admin eq 1) }
|
|
<span class="layui-btn layui-btn-primary" data-status="3"><i class="layui-icon layui-icon-reduce-circle"></i> 撤回</span>
|
|
{/if}
|
|
{if ( $detail.check_status gt 2) AND ( $is_create_admin eq 1) }
|
|
<a class="layui-btn" href="/finance/expense/add?id={$detail.id}">重新编辑</a>
|
|
{/if}
|
|
</div>
|
|
{/block}
|
|
<!-- /主体 -->
|
|
|
|
<!-- 脚本 -->
|
|
{block name="script"}
|
|
<script>
|
|
function init(layui) {
|
|
|
|
var form = layui.form
|
|
,dropdown = layui.dropdown
|
|
,employeepicker = layui.employeepicker
|
|
,layer = layui.layer;
|
|
|
|
//获取审核信息
|
|
$.ajax({
|
|
url: "/api/index/get_flow_nodes",
|
|
type:'post',
|
|
data:{id:$('[name="id"]').val(),type:2},
|
|
success: function (e) {
|
|
if (e.code == 0) {
|
|
console.log(e);
|
|
let flowHtml='',list = e.data,record_list='';
|
|
for(var f=0;f<list.length;f++){
|
|
//审批流程
|
|
let checkUser = '',
|
|
iconRight ='<span class="layui-icon layui-icon-right"></span>',
|
|
iconStatus ='<i class="layui-icon layui-icon-time"></i>',
|
|
strStatus ='<div class="check-item-status">待审核</div>';
|
|
if(f == list.length-1){
|
|
iconRight ='';
|
|
}
|
|
if(list[f].flow_type == 1 || list[f].flow_type == 2){
|
|
checkUser=list[f].flow_type == 1?'部门负责人':'上级部门负责人';
|
|
if(list[f].check_list.length>0){
|
|
if(list[f].check_list[0].status == 1){
|
|
iconStatus ='<i class="layui-icon layui-icon-ok-circle" data-ok=""></i>';
|
|
strStatus ='<div class="check-item-status">通过</div>';
|
|
}
|
|
else if(list[f].check_list[0].status == 2){
|
|
iconStatus ='<i class="layui-icon layui-icon-close" data-no=""></i>';
|
|
strStatus ='<div class="check-item-status">拒绝</div>';
|
|
}
|
|
}
|
|
}
|
|
else if(list[f].flow_type == 0 ){
|
|
checkUser=list[f].user_id_info[0].name;
|
|
if(list[f].check_list.length>0){
|
|
iconStatus ='<i class="layui-icon layui-icon-close" data-no=""></i>';
|
|
strStatus ='<div class="check-item-status">拒绝</div>';
|
|
for(var m=0;m<list[f].check_list.length;m++){
|
|
if(list[f].check_list[m].status == 1){
|
|
iconStatus ='<i class="layui-icon layui-icon-ok-circle" data-ok=""></i>';
|
|
strStatus ='<div class="check-item-status">通过</div>';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if(list[f].flow_type == 3 ){
|
|
checkUser='多人或签';
|
|
if(list[f].user_id_info.length>0){
|
|
iconStatus ='<i class="layui-icon layui-icon-time"></i>';
|
|
strStatus ='<div class="check-item-status">待审核</div>';
|
|
for(var m=0;m<list[f].user_id_info.length;m++){
|
|
if(list[f].user_id_info[m].status == 1){
|
|
iconStatus ='<i class="layui-icon layui-icon-ok-circle" data-ok=""></i>';
|
|
strStatus ='<div class="check-item-status">通过</div>';
|
|
break;
|
|
}
|
|
if(list[f].user_id_info[m].status == 2){
|
|
iconStatus ='<i class="layui-icon layui-icon-close" data-no=""></i>';
|
|
strStatus ='<div class="check-item-status">拒绝</div>';
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
else if(list[f].flow_type == 4){
|
|
checkUser='多人会签';
|
|
if(list[f].user_id_info.length>0){
|
|
iconStatus ='<i class="layui-icon layui-icon-ok-circle" data-ok=""></i>';
|
|
strStatus ='<div class="check-item-status">通过</div>';
|
|
for(var m=0;m<list[f].user_id_info.length;m++){
|
|
if(list[f].user_id_info[m].status == 2){
|
|
iconStatus ='<i class="layui-icon layui-icon-close" data-no=""></i>';
|
|
strStatus ='<div class="check-item-status">拒绝</div>';
|
|
break;
|
|
}
|
|
if(list[f].user_id_info[m].status == 0){
|
|
iconStatus ='<i class="layui-icon layui-icon-time"></i>';
|
|
strStatus ='<div class="check-item-status">待审核</div>';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
flowHtml+= '<div class="flow-flexbox check-item flow-flex-row" id="flow'+f+'">'+iconStatus+'\
|
|
<div class="check-item-name">'+checkUser+'</div>'+strStatus+iconRight+'\
|
|
</div>';
|
|
|
|
|
|
//审批历史数据
|
|
var sign_type = '',user_check_list='';
|
|
if(list[f].check_list.length>0){
|
|
if(list[f].flow_type==3){
|
|
sign_type= ' <span class="layui-badge layui-bg-blue">或签</span>'
|
|
}
|
|
if(list[f].flow_type==4){
|
|
sign_type= ' <span class="layui-badge layui-bg-blue">会签</span>'
|
|
}
|
|
for(var b=0;b<list[f].check_list.length;b++){
|
|
var status_str = '通过了此申请';
|
|
if(list[f].check_list[b].status == 2){
|
|
status_str = '拒绝了此申请';
|
|
}
|
|
user_check_list+= '<li style="padding:3px 0"><img src="'+list[f].check_list[b].thumb+'" style="width:22px; height:22px; border-radius:50%; margin-right:8px;" />'+list[f].check_list[b].name+'<span class="check-status">'+list[f].check_list[b].check_time_str+status_str+'</span><div class="check-remark">'+list[f].check_list[b].content+'</div></li>';
|
|
}
|
|
|
|
record_list+='<li class="layui-timeline-item">\
|
|
<i class="layui-icon layui-timeline-axis">စ</i>\
|
|
<div class="layui-timeline-content">\
|
|
<p class="layui-timeline-title">第'+(f+1)+'级'+sign_type+'</p>\
|
|
<ul>'+user_check_list+'</ul>\
|
|
</div>\
|
|
</li>';
|
|
}
|
|
}
|
|
|
|
$('#flowList').append(flowHtml);
|
|
if(record_list == ''){
|
|
record_list='<div style="text-align:center; color:#999; padding:10px 10px 20px;">无审批记录</div>';
|
|
}
|
|
dropdown.render({
|
|
elem: '#showRecord'
|
|
,trigger: 'click'
|
|
,content: ['<div class="flow-record">'
|
|
,'<ul>'+record_list+'</ul>'
|
|
,'</div>'].join('')
|
|
});
|
|
|
|
for(var f=0;f<list.length;f++){
|
|
if(list[f].flow_type == 3 || list[f].flow_type == 4){
|
|
var user_list= '';
|
|
for(var a=0;a<list[f].user_id_info.length;a++){
|
|
if(list[f].user_id_info[a].status==0){
|
|
user_list+='<li><i class="layui-icon layui-icon-time"></i> '+list[f].user_id_info[a].name+'<span>待审核此申请</span></li>';
|
|
}
|
|
else if(list[f].user_id_info[a].status==1){
|
|
user_list+='<li><i class="layui-icon layui-icon-ok-circle" data-ok=""></i><span>'+list[f].user_id_info[a].check_time+'</span><br> '+list[f].user_id_info[a].name+'<span>已通过此申请</span></li>';
|
|
}else if(list[f].user_id_info[a].status==2){
|
|
user_list+='<li><i class="layui-icon layui-icon-close" data-no=""></i><span>'+list[f].user_id_info[a].check_time+'</span><br> '+list[f].user_id_info[a].name+'<span>已拒绝此申请</span></li>';
|
|
}
|
|
}
|
|
dropdown.render({
|
|
elem: '#flow'+f
|
|
,trigger: 'hover'
|
|
,content: ['<div class="flow-tips">'
|
|
,'<ul>'+user_list+'</ul>'
|
|
,'</div>'].join('')
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
|
|
//选择人员
|
|
$('.layui-form').on('click','[name="check_admin_name"]',function(){
|
|
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);
|
|
}
|
|
});
|
|
})
|
|
|
|
|
|
//监听提交
|
|
$('#formBtn').on('click','span', function(data){
|
|
let id=$('[name="id"]').val();
|
|
let content=$('[name="content"]').val();
|
|
let check_status=$(this).data('status');
|
|
|
|
let flow_type = $('input[name="flow_type"]').val();
|
|
let check_node=0,check_admin_ids=0;
|
|
if(flow_type == 0 && check_status==1){
|
|
check_node = $('input[name="check_node"]:checked').val();
|
|
check_admin_ids = $('input[name="check_admin_ids"]').val();
|
|
if(!check_node){
|
|
layer.msg('请选择下一审批节点');
|
|
return false;
|
|
}
|
|
if(check_node == 2 && check_admin_ids==''){
|
|
layer.msg('请选择下一审批人');
|
|
return false;
|
|
}
|
|
}
|
|
|
|
if(check_status ==1 || check_status==2){
|
|
if(content==''){
|
|
layer.msg('请输入审批意见');
|
|
return false;
|
|
}
|
|
let confirmTips='确定通过该审核?';
|
|
if(check_status==2){
|
|
confirmTips='确定拒绝该审核?';
|
|
}
|
|
layer.confirm(confirmTips, function(index){
|
|
$.ajax({
|
|
url: "/finance/expense/check",
|
|
type:'post',
|
|
data:{
|
|
id:id,
|
|
check_node:check_node,
|
|
check_admin_ids:check_admin_ids,
|
|
status:check_status,
|
|
content:content
|
|
},
|
|
success: function (e) {
|
|
layer.msg(e.msg);
|
|
if (e.code == 0) {
|
|
parent.tableIns.reload();
|
|
location.reload();
|
|
}
|
|
}
|
|
})
|
|
layer.close(index);
|
|
});
|
|
}
|
|
else if(check_status ==3){
|
|
layer.prompt({
|
|
formType: 2,
|
|
title: '请输入撤回理由',
|
|
area: ['500px', '120px'] //自定义文本域宽高
|
|
}, function(value, index, elem){
|
|
$.ajax({
|
|
url: "/finance/expense/check",
|
|
type:'post',
|
|
data:{
|
|
id:id,
|
|
status:check_status,
|
|
content:value
|
|
},
|
|
success: function (e) {
|
|
layer.msg(e.msg);
|
|
if (e.code == 0) {
|
|
parent.tableIns.reload();
|
|
location.reload();
|
|
}
|
|
}
|
|
})
|
|
layer.close(index);
|
|
});
|
|
}
|
|
return false;
|
|
});
|
|
}
|
|
</script>
|
|
{include file="../../base/view/common/layui" base='base' extend="['employeepicker']" callback="init" /}
|
|
{/block}
|
|
<!-- /脚本 --> |