闫增涛
2025-04-14 4a0006c0b8df5befabf7403c0702f4429cf244e3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{extend name="../../base/view/common/base" /}
{block name="style"}
<style>
.body-card{background-color:#fff; border:1px solid #eee;}
.card-header{height:44px; line-height:44px; text-indent:12px}
.square .layui-col-md2{border: 1px solid #f5f5f5; border-left:0; cursor:pointer;}
.square .layui-col-md2 div{padding:12px 0; height:50px; text-align:center; background-color:#fff; color:#666}
.square .layui-col-md2 i{font-size:28px; font-weight:800; display:block; padding-bottom:3px; color:#4285f4}
.square .layui-col-md2:nth-child(6n){border-right:0;}
.square .layui-col-md2:nth-child(n+7){margin-top: -1px;}
.square .layui-col-md2 div:hover{color:#4285f4; background-color:#fafafa}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<div class="p-page">
    <div class="body-card">
        <div class="card-header" style="border-bottom:1px solid #eee;"><h3 class="h3-title">审批新申请</h3></div>
        {volist name="module" id="v" offset="0"}
        {notempty name="$v.list"}
        <div class="card-header"><strong>{$v.title}</strong></div>
        <div class="square">
            <div class="layui-row">
                {volist name="$v.list" id="vo"}
                    <div class="layui-col-md2 side-a" data-href="{$vo.add_url}" title="{$vo.title}"><div><i class="iconfont {$vo.icon}"></i>{$vo.title}</div></div>    
                {/volist}
            </div>
        </div>
        {/notempty}
        {/volist}
        <div style="padding:16px 0; text-align:center; color:#ffb800">
            如果是【日常办公数据管理员】,可查看全体员工的审批申请记录,去查<a href="javascript:;" data-href="/home/approve/all" class="side-a">『全部审批』</a>
        </div>
    </div>
</div>
<script type="text/html" id="toolbarDemo">
<h3 class="h3-title" style="height:28px;">审批列表</h3>
</script>                        
{/block}
<!-- /主体 -->
 
<!-- 脚本 -->
{block name="script"}
    <script>
    const moduleInit = ['tool'];
    function gouguInit() {
        var table = layui.table, tool = layui.tool ,element=layui.element;
            
        element.on('tab(tab)', function(data){
            layui.pageTable.reload({where:{status:data.index},page:{curr:1}});
            return false;
        });            
            
        layui.pageTable = table.render({
            elem: '#test'
            ,toolbar: '#toolbarDemo'
            ,defaultToolbar: false
            ,title:'审批列表'
            ,url: "/oa/approve/index"
            ,page: true //开启分页
            ,limit: 20
            ,cellMinWidth: 80
            ,cols: [[
                    {field:'id',width:80, title: 'ID号', align:'center'}
                    ,{field:'types_name',title: '审批类型',width:100, align:'center'}
                    ,{field:'check_status',title: '审核状态',width:110, align:'center',templet: function(d){
                        var html = '<span class="check-status-color-'+d.check_status+'">『'+d.check_status_str+'』</span>';
                        return html;
                    }}
                    ,{field:'admin_name',title: '申请人',width:90,align:'center'}
                    ,{field:'create_time',title: '申请时间',width:150,align:'center'}
                    ,{field:'department',title: '所属部门',width:120,align:'center'}
                    ,{field:'check_users',title: '当前审批人'}
                    ,{width:60,title: '操作', align:'center',templet: function(d){
                        var btn='<a class="layui-btn layui-btn-xs" lay-event="view">详情</a>';
                        return btn;
                    }}
                ]]
            });
            
            table.on('tool(test)',function (obj) {
                if(obj.event === 'view'){        
                    tool.side('/adm/'+obj.data.table_name+'/view?id='+obj.data.id);
                }
            });
        }
    </script>
{/block}
<!-- /脚本 -->