<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>付款申请</title>
    <link rel="stylesheet" th:href="@{/lib/layui/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/css/public.css}" media="all">
    <link rel="stylesheet" th:href="@{/lib/font-awesome-4.7.0/css/font-awesome.min.css}" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <fieldset class="table-search-fieldset">
            <legend>搜索信息(<b>收起-展开</b>)</legend>
            <div id="search-div" style="margin: 5px 10px -10px 0px">
                <form class="layui-form" action="" lay-filter="search-form">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 60px">项目名称</label>
                            <div class="layui-input-inline" style="width: 450px">
                                <input type="text" id="xmmc" name="xmmc" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 60px">审批状态</label>
                            <div class="layui-input-inline" style="width: 150px">
                                <select name="spzt" id="spzt" lay-filter="status">
                                    <option value="">全部</option>
                                    <option th:each="item:${approveList}" th:text="${item.name}"
                                            th:value="${item.name}"></option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 60px">ERP编号</label>
                            <div class="layui-input-inline" style="width: 150px">
                                <input type="text" id="erpbh" name="erpbh" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 35px">编号</label>
                            <div class="layui-input-inline" style="width: 150px">
                                <input type="text" id="bh" name="bh" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 70px">是否备用金</label>
                            <div class="layui-input-inline" style="width: 150px">
                                <select name="sfbyj" id="sfbyj" lay-filter="status">
                                    <option value="">全部</option>
                                    <option value="1">是</option>
                                    <option value="0">否</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 30px">年份</label>
                            <div class="layui-input-inline" style="width: 150px">
                                <select name="nf" id="nf" lay-filter="status">
                                    <option value="">全部</option>
                                    <option th:each="item:${yearList}" th:text="${item.nf}"
                                            th:value="${item.nf}"></option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 60px">不含税金额(元)</label>
                            <div class="layui-input-inline" style="width: 150px">
                                <input type="number" id="bhsje" name="bhsje" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline" style="margin-left: 15px">
                            <button type="submit" class="layui-btn" lay-submit lay-filter="data-search-btn"><i
                                    class="layui-icon"></i> 搜 索
                            </button>
                            <button type="submit" class="layui-btn layui-btn-primary" lay-submit
                                    lay-filter="data-reset-btn"><i class="layui-icon layui-icon-refresh"></i> 重 置
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </fieldset>

        <script type="text/html" id="toolbarDemo">
            <div class="layui-btn-container">
                <button class="layui-btn layui-btn-sm data-add-btn" lay-event="add">
                    <i class="layui-icon layui-icon-addition" style="font-size: 10px;"></i>新建
                </button>
                <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="edit">
                    <i class="layui-icon layui-icon-edit" style="font-size: 10px;"></i>编辑
                </button>
                <button class="layui-btn layui-btn-sm layui-btn-warm" lay-event="view">
                    <i class="layui-icon layui-icon-file" style="font-size: 10px;"></i>查看
                </button>
                <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="delete">
                    <i class="layui-icon layui-icon-delete" style="font-size: 10px;"></i>删除
                </button>
                <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="reimburse">
                    <i class="layui-icon layui-icon-dollar" style="font-size: 10px;"></i>报账
                </button>
                <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="editAccout">
                    <i class="layui-icon layui-icon-edit" style="font-size: 10px;"></i>修改报账金额
                </button>
                <!--                <button class="layui-btn layui-btn-sm" lay-event="exportExcel">-->
                <!--                    <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>导出列表-->
                <!--                </button>-->
            </div>
        </script>
        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
    </div>
</div>
<script th:src="@{/lib/jquery-3.4.1/jquery-3.4.1.min.js}" charset="utf-8"></script>
<script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
<script th:src="@{/lib/coco-message/coco-message.js}" charset="utf-8"></script>
<script th:src="@{/js/lay-config.js}" charset="utf-8"></script>
<script th:src="@{/lib/xm-select-v1.2.2/xm-select.js}" charset="utf-8"></script>
<script th:inline="javascript" type="text/javascript">
    AjaxUtil.ctx = /*[[@{/}]]*/'';
    var updateflag = 0;
    var updateflag = 0;
    var xmApproval = {};

    layui.use(['form', 'table'], function () {
        var form = layui.form,
            table = layui.table;

        var currTable = table.render({
            elem: '#currentTableId',
            url: AjaxUtil.ctx + 'staPayapproval/list',
            method: 'post',
            toolbar: '#toolbarDemo',
            // defaultToolbar: ['filter', 'print'],
            cols: [
                [
                    {type: "checkbox", fixed: 'left'},
                    {type: 'numbers', align: 'center', fixed: 'left'},
                    {field: 'spzt', width: '9%', title: '审批状态', sort: true},
                    {field: 'sqmc', width: '25%', title: '申请名称', fixed: 'left'},
                    {field: 'erpbh', width: '8%', title: 'ERP编号'},
                    // {field: 'xmmc', width: '20%', title: '项目名称'},
                    {
                        field: 'sfbyj', width: '7%', title: '是否备用金', align: 'center', templet: function (d) {
                            if (1 == d.sfbyj) {
                                return '<span class="layui-badge layui-bg-blue">是</span>';
                            } else {
                                return '<span class="layui-badge layui-bg-orange">否</span>';
                            }
                        }
                    },
                    {field: 'fylbmc', width: '7%', title: '费用类别'},
                    {field: 'sqje', width: '7%', title: '申请金额(元)'},
                    {
                        field: 'sfbz', width: '6%', title: '是否报账', align: 'center', templet: function (d) {
                            if (1 == d.sfbz) {
                                return '<span class="layui-badge layui-bg-blue">是</span>';
                            } else {
                                return '<span class="layui-badge layui-bg-orange">否</span>';
                            }
                        }
                    },
                    {field: 'bzje', width: '7%', title: '报账金额(元)'},
                    {field: 'bh', width: '8%', title: '编号'},
                    {field: 'sqrxm', width: '5%', title: '申请人', align: 'center'},
                    {field: 'sqsj', width: '8%', title: '申请时间', align: 'center'},
                    {field: 'xmlxmc', width: '10%', title: '项目类型'},
                    {field: 'dkyfzrxm', width: '8%', title: '电科院负责人'},
                    {field: 'ssbmmc', width: '8%', title: '所属部门'},
                    {field: 'nf', width: '5%', title: '年份', align: 'center'}
                    // {field: 'fj', width: '6%', title: '附件'},
                    // {title: '操作', toolbar: '#currentTableBar', width: '15%', align: 'center', fixed: 'right'}
                ]
            ],
            autoSort: false,
            limits: [10, 15, 20, 25, 50, 100],
            limit: 10,
            page: true,
            skin: 'grid',
            parseData: function (res) { //res 即为原始返回的数据
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.message, //解析提示文本
                    "count": res.data.total, //解析数据长度
                    "data": res.data.rows //解析数据列表
                };
            },
            done: function (res, curr, count) { // done为数据渲染完的回调
                // 测试打印出后端返回的权限列表
                // let permissionSet = [[${permissionSet}]];
                // console.log(JSON.stringify(permissionSet));
            }
        });

        // 监听搜索操作
        form.on('submit(data-search-btn)', function (data) {
            // 执行搜索重载
            currTable.reload({
                page: {
                    curr: 1 // 页码从1开始
                },
                where: form.val("search-form")
            });
            return false;
        });

        // 监听重置操作
        form.on('submit(data-reset-btn)', function (data) {
            form.val("search-form", {
                "sqmc": '',
                "erpbh": '',
                "spzt": '',
                "bh": '',
                "xmlx": '',
                "dkyfzr": '',
                "ssbmmc": '',
                "nf": ''
            });
            // 执行搜索重载
            currTable.reload({
                page: {
                    curr: 1
                },
                where: form.val("search-form")
            });
            return false;
        });

        // 监听排序事件
        table.on('sort(currentTableFilter)', function (obj) { //注：sort 是工具条事件名，test 是 table 原始容器的属性 lay-filter="对应的值"
            // console.log(obj.field); //当前排序的字段名
            // console.log(obj.type); //当前排序类型：desc（降序）、asc（升序）、null（空对象，默认排序）
            // console.log(this); //当前排序的 th 对象
            //尽管我们的 table 自带排序功能，但并没有请求服务端。
            //有些时候，你可能需要根据当前排序的字段，重新向服务端发送请求，从而实现服务端排序，如：
            currTable.reload({
                initSort: obj, //记录初始排序，如果不设的话，将无法标记表头的排序状态。
                where: { //请求参数（注意：这里面的参数可任意定义，并非下面固定的格式）
                    sortName: toLine(obj.field), //排序字段
                    sortOrder: toLine(obj.type) //排序方式
                }
            });
        });

        // 监听工具栏事件
        table.on('toolbar(currentTableFilter)', function (obj) {
            if (obj.event === 'add') {  // 监听添加操作
                layer.open({
                    title: '新建费用申请',
                    type: 2,
                    shade: 0.3,
                    maxmin: true,
                    area: ['1020px', layerheight + 'px'],
                    content: AjaxUtil.ctx + 'staBudgetapproval/forApplyAdd',
                    end: function (index) {
                        // 重载表格
                        if (updateflag == 1)
                            currTable.reload();
                        updateflag = 0;
                    }
                });
            } else if (obj.event == 'edit') {
                var dataApproval = table.cache["currentTableId"];
                if (dataApproval.length == 0)
                    return;

                var checkStatus = table.checkStatus('currentTableId')
                    , data = checkStatus.data;
                if (data == null || data.length === 0) {
                    Message.warning("请选择要编辑的费用申请！", 1500);
                } else if (data.length > 1) {
                    Message.warning("请选择一条记录进行编辑！", 1500);
                } else if (data[0].spzt == "审批结束") {
                    Message.warning("该费用申请已审批结束，不能修改！", 1500);
                } else if (data[0].spzt.indexOf("未提交") < 0) {
                    Message.warning("该费用申请审批中，不能修改！", 1500);
                } else {
                    xmApproval = {
                        "id": data[0].id,
                        "bh": data[0].bh,
                        "sqmc": data[0].sqmc,
                        "xmid": data[0].xmid,
                        "xmmc": data[0].xmmc,
                        "nf": data[0].nf,
                        "fylb": data[0].fylb,
                        "fylbmc": data[0].fylbmc,
                        "sqje": data[0].sqje,
                        "sqsm": data[0].sqsm,
                        "sqr": data[0].sqr,
                        "sqrxm": data[0].sqrxm,
                        "sqsj": data[0].sqsj,
                        "sfbyj": data[0].sfbyj,
                        "erpbh": data[0].erpbh,
                        "xmlxmc": data[0].xmlxmc,
                        "xmfzr": data[0].xmfzr,
                        "xmfzrxm": data[0].xmfzrxm,
                        "dkyfzr": data[0].dkyfzr,
                        "dkyfzrxm": data[0].dkyfzrxm,
                        "ssbmmc": data[0].ssbmmc
                    }

                    layer.open({
                        title: '编辑费用申请',
                        type: 2,
                        shade: 0.3,
                        maxmin: true,
                        shadeClose: true,
                        area: ['1020px', layerheight + 'px'],
                        content: AjaxUtil.ctx + 'staBudgetapproval/forApplyUpdate',
                        end: function (index) {
                            if (updateflag == 1)
                                currTable.reload();
                            updateflag = 0;
                        }
                    });
                    // layer.full(index);
                }
            } else if (obj.event == 'view') {
                var dataApproval = table.cache["currentTableId"];
                if (dataApproval.length == 0)
                    return;

                var checkStatus = table.checkStatus('currentTableId')
                    , data = checkStatus.data;
                if (data == null || data.length === 0) {
                    Message.warning("请选择要查看的费用申请！", 1500);
                } else if (data.length > 1) {
                    Message.warning("请选择一条记录进行查看！", 1500);
                } else {
                    xmApproval = {
                        "id": data[0].id,
                        "sqmc": data[0].sqmc,
                        "xmid": data[0].xmid,
                        "xmmc": data[0].xmmc,
                    }

                    layer.open({
                        title: '浏览费用申请',
                        type: 2,
                        shade: 0.3,
                        maxmin: true,
                        shadeClose: true,
                        area: ['1020px', layerheight + 'px'],
                        content: AjaxUtil.ctx + 'staBudgetapproval/forApplyView/' + data[0].id,
                        end: function (index) {
                            layer.close(index);
                        }
                    });
                    // layer.full(index);
                }
            } else if (obj.event === 'delete') {  // 监听删除操作
                var dataApproval = table.cache["currentTableId"];
                if (dataApproval.length == 0)
                    return;

                var checkStatus = table.checkStatus('currentTableId')
                    , data = checkStatus.data;
                if (data == null || data.length === 0) {
                    Message.warning("请选择要删除的费用申请！", 1500);
                    return;
                } else {
                    for (let item of data) {
                        if (item.spzt != "未提交") {
                            if (item.spzt != "审批结束")
                                Message.warning("存在已提交审批的费用申请，不能直接删除！", 2000);
                            else
                                Message.warning("存在已审批结束的费用申请，不能直接删除！", 2000);
                            return;
                        }
                    }
                }
                layer.confirm('确定批量删除费用申请吗？', function (index) {
                    layer.close(index);
                    AjaxUtil.post({
                        url: AjaxUtil.ctx + "staBudgetapproval/batchDeleteApply",
                        contentType: "application/json",
                        data: JSON.stringify(data),
                        success: function (res) {
                            if (res.code === 0) {
                                Message.success(1500, res.message, function () {
                                    // 重载表格
                                    currTable.reload();
                                });
                            } else {
                                Message.error(res.message, 1000);
                            }
                        },
                        error: function (error) {
                        }
                    });
                });
            } else if (obj.event === 'exportExcel') {
                var dataApproval = table.cache["currentTableId"];
                if (dataApproval.length == 0)
                    return;

                let a = document.createElement('a');
                a.href = AjaxUtil.ctx + 'staBudgetapproval/exportExcel';
                a.click();
                a.parentNode.removeChild(a);
            } else if (obj.event === 'tjApprove') {
                var projects = table.cache["currentTableId"];
                if (projects.length == 0)
                    return;

                var checkStatus = table.checkStatus('currentTableId')
                    , data = checkStatus.data;
                if (data == null || data.length === 0) {
                    Message.warning("请选择要提交审批的费用申请！", 2000);
                } else if (data.length > 1) {
                    Message.warning("请选择一条记录进行提交！", 1500);
                } else if (data[0].spzt == "审批结束") {
                    Message.warning("该费用申请已审批结束！", 1500);
                } else if (data[0].spzt.indexOf("未提交") < 0) {
                    Message.warning("该费用申请正在审批中……", 1500);
                } else {
                    xmApproval = {
                        "xmid": data[0].id,
                        "xm": data[0].sqmc,
                        "zt": data[0].spzt,
                        "sqje": data[0].sqje
                    };

                    var content = AjaxUtil.ctx + 'staBudgetapproval/forApproveAdd';
                    if (data[0].spzt != "未提交")
                        content = AjaxUtil.ctx + 'staBudgetapproval/forApproveUpdate/' + data[0].id + '/' + data[0].sqje + '?spzt=' + data[0].spzt;

                    layer.open({
                        title: '提交审批',
                        type: 2,
                        shade: 0.3,
                        maxmin: true,
                        shadeClose: true,
                        area: ['1025px', layerheight + 'px'],
                        content: content,
                        end: function (index) {
                            if (updateflag == 1)
                                currTable.reload();
                            updateflag = 0;
                        }
                    });
                }
            } else if (obj.event === 'spOption') {
                var projects = table.cache["currentTableId"];
                if (projects.length == 0)
                    return;

                var checkStatus = table.checkStatus('currentTableId')
                    , data = checkStatus.data;
                if (data == null || data.length === 0) {
                    Message.warning("请选择要审批的费用申请！", 2000);
                } else if (data.length > 1) {
                    Message.warning("请选择一条记录进行审批！", 1500);
                } else if (data[0].spzt.indexOf("未提交") >= 0) {
                    Message.warning("该费用申请尚未提交审批！", 1500);
                } else if (data[0].spzt == "审批结束") {
                    Message.warning("该费用申请已审批结束！", 2000);
                } else {
                    xmApproval = {
                        "xmid": data[0].id,
                        "xm": data[0].sqmc,
                        "zt": data[0].spzt,
                        "sqje": data[0].sqje
                    };

                    var content = AjaxUtil.ctx + 'staBudgetapproval/forApproveAdd';
                    if (data[0].spzt != "未提交")
                        content = AjaxUtil.ctx + 'staBudgetapproval/forApproveUpdate/' + data[0].id + '/' + data[0].sqje + '?spzt=' + data[0].spzt;

                    layer.open({
                        title: '审批意见',
                        type: 2,
                        shade: 0.3,
                        maxmin: true,
                        shadeClose: true,
                        area: ['1025px', layerheight + 'px'],
                        content: content,
                        end: function (index) {
                            if (updateflag == 1)
                                currTable.reload();
                            updateflag = 0;
                        }
                    });
                }
            } else if (obj.event === 'spList') {
                var projects = table.cache["currentTableId"];
                if (projects.length == 0)
                    return;

                var checkStatus = table.checkStatus('currentTableId')
                    , data = checkStatus.data;
                if (data == null || data.length === 0) {
                    Message.warning("请选择要查看审批列表的费用申请！", 1500);
                } else if (data.length > 1) {
                    Message.warning("请选择一条记录进行查看！", 1500);
                } else if (data[0].spzt == "未提交") {
                    Message.warning("该费用申请尚未提交审批！", 1500);
                } else {
                    xmApproval = {
                        "xmid": data[0].id,
                        "xm": data[0].sqmc,
                        "zt": data[0].spzt,
                        "sqje": data[0].sqje
                    };

                    var index = layer.open({
                        title: '审批列表',
                        type: 2,
                        shade: 0.3,
                        maxmin: true,
                        shadeClose: true,
                        area: ['1300px', layerheight + 'px'],
                        content: AjaxUtil.ctx + 'staBudgetapproval/forApproveList?mc=' + data[0].sqmc,
                        end: function () {
                            if (updateflag == 1)
                                currTable.reload();
                            updateflag = 0;
                            layer.close(index);
                        }
                    });
                }
            } else if (obj.event === 'reimburse') {
                var projects = table.cache["currentTableId"];
                if (projects.length == 0)
                    return;

                var checkStatus = table.checkStatus('currentTableId')
                    , data = checkStatus.data;
                if (data == null || data.length === 0) {
                    Message.warning("请选择要报账的费用申请！", 1500);
                } else if (data.length > 1) {
                    Message.warning("请选择一条记录进行报账！", 1500);
                } else if (data[0].spzt == "未提交") {
                    Message.warning("该费用申请尚未提交审批！", 1500);
                } else if (data[0].spzt != "审批结束") {
                    Message.warning("该费用申请正在审批中……", 1500);
                } else {
                    xmApproval = {
                        "xmid": data[0].id,
                        "xm": data[0].sqmc,
                        "zt": data[0].spzt,
                        "sqje": data[0].sqje
                    };
                    AjaxUtil.post({
                        url: AjaxUtil.ctx + "staBudgetapproval/",
                        contentType: "application/json",
                        data: JSON.stringify(data),
                        success: function (res) {
                            if (res.code === 0) {
                                Message.success(1500, res.message, function () {
                                    // 重载表格
                                    currTable.reload();
                                });
                            } else {
                                Message.error(res.message, 1000);
                            }
                        },
                        error: function (error) {
                        }
                    });
                }
            }
        });

        // 监听行工具事件
        table.on('tool(currentTableFilter)', function (obj) {
            var data = obj.data;
            if (obj.event === 'view') {
                xmApproval = {
                    "id": data.id,
                    "sqmc": data.sqmc,
                    "xmid": data.xmid,
                    "xmmc": data.xmmc,
                    "sqje": data.sqje
                }

                layer.open({
                    title: '浏览费用申请',
                    type: 2,
                    shade: 0.3,
                    maxmin: true,
                    shadeClose: true,
                    area: ['1020px', layerheight + 'px'],
                    content: AjaxUtil.ctx + 'staBudgetapproval/forApplyView/' + data[0].id,
                    end: function (index) {
                        layer.close(index);
                    }
                });
                // layer.full(index);
            } else if (obj.event === 'update') {
                if (data.spzt != "未提交") {
                    if (data.spzt != "审批结束")
                        Message.warning("该费用申请已提交审批，不能修改！", 2000);
                    else
                        Message.warning("该费用申请已审批结束，不能修改！", 2000);
                } else {
                    xmApproval = {
                        "id": data.id,
                        "bh": data.bh,
                        "sqmc": data.sqmc,
                        "xmid": data.xmid,
                        "xmmc": data.xmmc,
                        "nf": data.nf,
                        "fylb": data.fylb,
                        "fylbmc": data.fylbmc,
                        "sqje": data.sqje,
                        "sqsm": data.sqsm,
                        "sqr": data.sqr,
                        "sqrxm": data.sqrxm,
                        "sqsj": data.sqsj,
                        "sfbyj": data.sfbyj,
                        "erpbh": data.erpbh,
                        "xmlxmc": data.xmlxmc,
                        "xmfzr": data.xmfzr,
                        "xmfzrxm": data.xmfzrxm,
                        "dkyfzr": data.dkyfzr,
                        "dkyfzrxm": data.dkyfzrxm,
                        "ssbmmc": data.ssbmmc
                    }

                    layer.open({
                        title: '编辑费用申请',
                        type: 2,
                        shade: 0.3,
                        maxmin: true,
                        shadeClose: true,
                        area: ['1020px', layerheight + 'px'],
                        content: AjaxUtil.ctx + 'staBudgetapproval/forApplyUpdate',
                        end: function (index) {
                            if (updateflag == 1)
                                currTable.reload();
                            updateflag = 0;
                        }
                    });
                    // layer.full(index);
                }
            } else if (obj.event === 'delFlag') {
                if (data.spzt != "未提交") {
                    if (data.spzt != "审批结束")
                        Message.warning("该费用申请已提交审批，不能删除！", 2000);
                    else
                        Message.warning("该费用申请已审批结束，不能删除！", 2000);
                } else {
                    layer.confirm('确定删除该费用申请吗？', function (index) {
                        layer.close(index);
                        AjaxUtil.get({
                            url: AjaxUtil.ctx + "staBudgetapproval/deleteApply/" + data.id,
                            success: function (res) {
                                if (res.code === 0) {
                                    Message.success(1500, res.message, function () {
                                        // 重载表格
                                        currTable.reload();
                                    });
                                } else {
                                    Message.error(res.message, 1000);
                                }
                            },
                            error: function (error) {
                            }
                        });
                    });
                }
            }
            return false;
        });

        //双击
        table.on('rowDouble(currentTableFilter)', function (obj) {
            var data = obj.data;
            xmApproval = {
                "id": data.id,
                "bh": data.bh,
                "sqmc": data.sqmc,
                "xmid": data.xmid,
                "xmmc": data.xmmc,
                "nf": data.nf,
                "fylbmc": data.fylbmc,
                "sqje": data.sqje,
                "sqsm": data.sqsm,
                "sqr": data.sqr,
                "sqrxm": data.sqrxm,
                "sqsj": data.sqsj,
                "sfbyj": data.sfbyj,
                "erpbh": data.erpbh,
                "xmlxmc": data.xmlxmc,
                "xmfzr": data.xmfzr,
                "xmfzrxm": data.xmfzrxm,
                "dkyfzrxm": data.dkyfzrxm,
                "ssbmmc": data.ssbmmc
            }

            layer.open({
                title: '浏览费用申请',
                type: 2,
                shade: 0.3,
                maxmin: true,
                shadeClose: true,
                area: ['1020px', layerheight + 'px'],
                content: AjaxUtil.ctx + 'staBudgetapproval/forApplyView/' + data.id,
                end: function (index) {
                    layer.close(index);
                }
            });
            // layer.full(index);
        });
    });

    function setUpdateFlag() {
        updateflag = 1;
    }

    function getXmApproval() {
        return xmApproval;
    }
</script>
</body>
</html>