<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" 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">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<form class="layui-form" action="" lay-filter="formDemo">
    <div class="layui-tab layui-tab-card">
        <ul class="layui-tab-title">
            <li>报账信息</li>
            <li class="layui-this">审核</li>
        </ul>
        <div class="layui-tab-content">
            <!-- 基本信息（开始） -->
            <div class="layui-tab-item" style="min-height: 550px">
                <form class="layui-form" action="" lay-filter="formDemo">
                    <div class="layui-form layuimini-form" style="padding-bottom: 100px">
                        <div class="layui-form-item layui-inline" style="width: 100%">
                            <label class="layui-form-label" style="width: 90px">报账名称</label>
                            <div class="layui-input-inline" style="width: 800px">
                                <input type="hidden" id="id" name="id" class="layui-input" th:value="${reimbursement.id}">
                                <input type="text" id="mc" name="mc" class="layui-input" th:value="${reimbursement.mc}" readonly>
                            </div>
                        </div>
                        <div class="layui-form-item layui-inline" style="width: 100%">
                            <input type="hidden" id="fysq" name="fysq" class="layui-input" th:value="${reimbursement.fysq}">
                            <label class="layui-form-label" style="width: 90px">费用类别</label>
                            <div class="layui-input-inline" style="width: 380px">
                                <input type="hidden" id="fylb" name="fylb" class="layui-input" th:value="${reimbursement.fylb}">
                                <input type="text" id="fylbmc" name="fylbmc" class="layui-input" th:value="${reimbursement.fylbmc}"
                                       readonly>
                            </div>
                            <label class="layui-form-label" style="width: 80px">申请金额(元)</label>
                            <div class="layui-input-inline" style="width: 300px">
                                <input type="number" id="sqje" name="sqje" class="layui-input" th:value="${reimbursement.sqje}"
                                       readonly>
                            </div>
                        </div>
                        <div class="layui-form-item layui-inline" style="width: 100%">
                            <label class="layui-form-label" style="width: 90px">报账金额(元)</label>
                            <div class="layui-input-inline" style="width: 380px">
                                <input type="text" id="bzjes" name="bzjes" class="layui-input" autocomplete="off"
                                       th:value="${reimbursement.bzje}" readonly>
                            </div>
                            <label class="layui-form-label" style="width: 80px">税率(%)</label>
                            <div class="layui-input-inline" style="width: 300px">
                                <input type="number" id="sl" name="sl" class="layui-input" th:value="${reimbursement.sl}" readonly>
                            </div>
                        </div>
                        <div class="layui-form-item layui-inline" style="width: 100%">
                            <label class="layui-form-label" style="width: 100px; margin-left: -10px">不含税金额(元)</label>
                            <div class="layui-input-inline" style="width: 380px">
                                <input type="number" id="bhsje" name="bhsje" class="layui-input" th:value="${reimbursement.bhsje}"
                                       readonly>
                            </div>
                            <label class="layui-form-label" style="width: 80px">税费(元)</label>
                            <div class="layui-input-inline" style="width: 300px">
                                <input type="number" id="sf" name="sf" class="layui-input" th:value="${reimbursement.sf}" readonly>
                            </div>
                        </div>
                        <div id="cl">
                            <div class="layui-form-item" style="margin-bottom: -20px">
                                <label class="layui-form-label" style="width: 110px">实际花费差旅费</label>
                            </div>
                            <div class="layui-form-item" style="margin-left: 20px; margin-right: 20px; margin-top: -20px">
                                <table class="layui-hide" id="currentTableId1" name="currentTableId1" lay-filter="currentTableFilter1"
                                       style="padding-top: 0px;margin-top: 0px"></table>
                            </div>

                        </div>
                        <div class="layui-row" style="margin-bottom: -20px">
                            <div class="layui-col-md6">
                                <div class="layui-form-label" style="width: 70px">报销凭证</div>
                            </div>
                        </div>
                        <div class="layui-form-item" style="margin-left: 20px; margin-right: 20px; margin-top: -20px">
                            <input type="hidden" id="bxpz" name="bxpz" class="layui-input" th:value="${reimbursement.bxpz}">
                            <table class="layui-hide" id="currentTableId2" name="currentTableId2" lay-filter="currentTableFilter2"
                                   style="padding-top: 0px;margin-top: 0px"></table>
                        </div>

                        <!-- 右侧悬浮按钮 -->
                        <div class="right-bottom-btn">
                            <button type="button" class="layui-btn" lay-on="test-tips-photos" id="ckwj">
                                <i class="layui-icon layui-icon-up">批量查看报销凭证</i>
                            </button>
                            <button type="button" class="layui-btn" lay-filter="viewFysqBtn">
                                <i class="layui-icon layui-icon-ok"></i>查看费用申请
                            </button>
                            <button type="button" class="layui-btn" lay-filter="cancleBtn">
                                <i class="layui-icon layui-icon-close"></i>关闭
                            </button>
                        </div>
                    </div>
                </form>
            </div>
            <!-- 基本信息(结束） -->
            <!-- 审核开始 -->
            <div class="layui-tab-item layui-show" style="min-height: 550px">
                <form class="layui-form" action="" lay-filter="formDemo">
                    <div class="layui-form layuimini-form" style="padding-bottom: 100px">
                        <div class="layui-form-item layui-inline" style="width: 100%">
                            <label class="layui-form-label" style="width: 10%">费用报账</label>
                            <div class="layui-input-inline" style="width: 80%">
                                <input type="hidden" id="id" name="id" class="layui-input" th:value="${approveInfo.id}">
                                <input type="hidden" id="xmid" name="xmid" class="layui-input" th:value="${approveInfo.xmid}">
                                <input type="hidden" id="tablename" name="tablename" class="layui-input"
                                       th:value="${approveInfo.tablename}">
                                <input type="text" id="xm" name="xm" class="layui-input" readonly th:value="${approveInfo.xm}">
                            </div>
                        </div>
                        <div class="layui-form-item layui-inline" style="width: 100%">
                            <label class="layui-form-label" style="width: 10%">状态</label>
                            <div class="layui-input-inline" style="width: 50%">
                                <input type="hidden" id="spzt" name="spzt" class="layui-input" th:value="${approveInfo.zt}">
                                <input type="text" id="zt" name="zt" class="layui-input" readonly th:value="${approveInfo.zt}">
                            </div>
                            <div class="layui-input-inline" style="width: 29%">
                                <input type="hidden" id="bzje" name="bzje" class="layui-input" readonly>
                                <input type="text" th:value="费用报账" class="layui-input" readonly>
                            </div>
                        </div>
                        <div class="layui-form-item layui-inline" style="width: 100%">
                            <label class="layui-form-label" style="width: 10%">审批操作</label>
                            <div class="layui-input-inline" style="width: 80%">
                                <select id="spcz" name="spcz" class="layui-input" lay-filter="spcz">
                                    <option value="审批通过">审批通过</option>
                                    <option value="返回修改">返回修改</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item layui-inline" style="width: 100%">
                            <label class="layui-form-label" style="width: 10%">意见</label>
                            <div class="layui-input-inline" style="width: 80%" id="jyDiv1">
                <textarea id="yj" name="yj" class="layui-textarea" th:text="同意"
                          style="height: 100px"></textarea>
                            </div>
                            <!--            <div class="layui-input-inline" style="width: 80%; display: none" id="jyDiv2">-->
                            <!--                <textarea id="yj2" name="yj2" class="layui-textarea" style="width: 80%;height: 100px"></textarea>-->
                            <!--            </div>-->
                        </div>

                        <div class="layui-form-item layui-inline" style="width: 100%">
                            <label class="layui-form-label" style="width: 95px">选择常用语</label>
                            <div class="layui-input-inline" style="width: 65%">
                                <select name="xmlx" id="xmlx" lay-filter="xmlx">
                                    <option value="">-- 请选择 --</option>
                                    <!--<option th:each="cyyList:${cyyList}" th:text="${cyyList.cyy}"
                                            th:value="${cyyList. id}"></option>-->
                                </select>
                            </div>
                            <button type="button" class="layui-btn" lay-filter="cyySaveBtn" style="width: 10%">常用语</button>
                        </div>
                        <!--        <div class="layui-form-item layui-inline" style="width: 100%">-->
                        <!--            <label class="layui-form-label" style="width: 95px">选择常用语</label>-->
                        <!--            <div class="layui-input-inline" style="width: 750px">-->
                        <!--                <input type="text" id="cyy" name="cyy" class="layui-input" readonly>-->
                        <!--            </div>-->
                        <!--            <button type="button" class="layui-btn" lay-filter="cyySaveBtn" style="width: 80px">常用语</button>-->
                        <!--        </div>-->
                        <div class="layui-form-item layui-inline" style="width: 100%">
                            <label class="layui-form-label" style="width: 10%">提交人</label>
                            <div class="layui-input-inline" style="width: 35%">
                                <input type="hidden" id="tjr" name="tjr" class="layui-input" th:value="${approveInfo.tjr}">
                                <input type="text" id="tjrxm" name="tjrxm" class="layui-input" readonly th:value="${approveInfo.tjrxm}">
                            </div>
                            <label class="layui-form-label" style="width: 11%">提交时间</label>
                            <div class="layui-input-inline" style="width: 30%">
                                <input type="text" id="tjsj" name="tjsj" class="layui-input" readonly th:value="${approveInfo.tjsj}">
                            </div>
                        </div>
                        <div class="layui-form-item layui-inline" style="width: 100%">
                            <label class="layui-form-label" style="width: 10%">审核人</label>
                            <div class="layui-input-inline" style="width: 35%">
                                <input type="hidden" id="userId" name="userId" class="layui-input" th:value="${userInfo.userId}">
                                <input type="hidden" id="shr" name="shr" class="layui-input" th:value="${approveInfo.shr}">
                                <input type="text" id="shrxm" name="shrxm" class="layui-input" th:value="${approveInfo.shrxm}" readonly>
                            </div>
                            <label class="layui-form-label" style="width: 11%">审核时间</label>
                            <div class="layui-input-inline" style="width: 30%">
                                <input type="text" id="shsj" name="shsj" class="layui-input">
                            </div>
                        </div>

                        <!-- 右侧悬浮按钮 -->
                        <div class="right-bottom-btn">
                            <!--<button type="button" class="layui-btn" lay-filter="viewFybzBtn">
                                <i class="layui-icon layui-icon-file"></i>查看费用报账
                            </button>-->
                            <button type="button" class="layui-btn" lay-filter="viewSplistBtn">
                                <i class="layui-icon layui-icon-file"></i>审批列表
                            </button>
                            <button type="button" class="layui-btn" lay-submit lay-filter="saveBtn">
                                <i class="layui-icon layui-icon-ok"></i>提交
                            </button>
                            <button class="layui-btn" lay-filter="cancleBtn">
                                <i class="layui-icon layui-icon-close"></i>取消
                            </button>
                        </div>
                    </div>
                    <input type="hidden" th:value="${xmid}" style="display: none">
                </form>
            </div>
            <!-- 审核结束 -->
        </div>
    </div>
</form>



<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="@{/lib/xm-select-v1.2.2/xm-select.js}" charset="utf-8"></script>
<script th:src="@{/js/lay-config.js}" charset="utf-8"></script>

<script type="text/javascript" th:inline="javascript">
    function getInit() {
        var userId = document.getElementById('userId').value;
        //初始化常用语
        $.ajax({
            type: "get",
            url: AjaxUtil.ctx + "prjProject/init_cyy/" + userId,
            async: true,
            success: function (data) {
                var cyyList = [];
                for (var item in data) {
                    cyyList.push(data[item]);
                }

                for (var i = 0; i < cyyList.length; i++) {
                    $("#xmlx").append("<option value = '" + cyyList[i].id + "'>" + cyyList[i].cyy + "</option>");
                    //重新渲染
                    layui.form.render("select");
                }
            }
        })
    }

    AjaxUtil.ctx = /*[[@{/}]]*/'';
    var travelExpense = [];//差旅费
    layui.use(['form','table','treeTable','layCascader','util', 'tableSelect', 'laydate', 'element'], function () {
        var form = layui.form,
            layer = layui.layer,
            laydate = layui.laydate,
            element = layui.element,
        table = layui.table;

        // 查看数据
        var fysq = [[${reimbursement.fysq}]];
        var fylbmc = [[${reimbursement.fylbmc}]];
        var baozhangid = [[${reimbursement.id}]];

        var dataExpense = new Array();
        $.ajax({
            url: AjaxUtil.ctx + 'staActualexpenses/list/' + fysq,
            type: "post",
            async: false,
            dataType: "json",
            success: function (result) {
                dataExpense = result.data.rows;
            }
        });
        setTimeout(function() {
            // 在这里可以进行您的加载操作
            layer.msg('加载完成！', { icon: 1 });
            var fylbmc = document.getElementById('fylbmc').value;
            var clDiv = document.getElementById('cl'); // 获取 div
            console.log(fylbmc);
            /*            if ( fylbmc == '（1）外委研究支出费' || fylbmc == '（3）外协测试试验与加工费'){
                            hiddenDiv.style.display = 'block';
                        }else {
                            hiddenDiv.style.display = 'none';
                        }*/
            if (fylbmc == '（3）会议、差旅及国际合作交流费'){
                clDiv.style.display = 'block';
            }else {
                console.log('进来了')
                clDiv.style.display = 'none';
            }
            return  false;
            // 隐藏加载信息

        }, 100);
        //差旅费
        var currTable1 = table.render({
            elem: '#currentTableId1',
            data: dataExpense,
            cols: [
                [
                    {field: 'xh', title: '序号', width: '8%'},
                    {field: 'ccrxm', title: '出差人', width: '10%'},
                    {field: 'ccdd', title: '出差地点', width: '8%'},
                    {field: 'qsrq', title: '起始日期', width: '13%'},
                    {field: 'jsrq', title: '结束日期(含)', width: '14%'},
                    {field: 'ccts', title: '出差天数', width: '12%'},
                    {field: 'zj', title: '总计(元)', width: '12%'},
                    {field: 'rpj', title: '日平均(元)', width: '12%'},
                    {field: 'ccsy',title: '出差事由',width: '10%'}
                ]
            ],
            autoSort: false,
            limits: [10, 15, 20, 25, 50, 100],
            limit: 10,
            page: true,
            skin: 'grid',
            initSort: {
                field: 'xh', //排序字段
                type: 'asc' //排序方式:desc 降序,asc 升序
            }
        });
        //双击（差旅费）
        table.on('rowDouble(currentTableFilter1)', function (obj) {
            var data = obj.data;
            travelExpense = {
                "xh": data.xh,
                "ccr": data.ccr,
                "ccrxm": data.ccrxm,
                "ccdd": data.ccdd,
                "ccts": data.ccts,
                "qsrq": data.qsrq,
                "jsrq": data.jsrq,
                "jtf": data.jtf,
                "zsf": data.zsf,
                "cb": data.cb,
                "zj": data.zj,
                "rpj": data.rpj
            };
            var index = layer.open({
                title: '浏览差旅费',
                type: 2,
                maxmin: true,
                shade: 0.2,
                area: [layerwidth + 'px', layerheight + 'px'],
                content: AjaxUtil.ctx + 'staTravelexpenses/forView',
                end: function () {
                    layer.close(index);
                }
            });
        });

        // 用于存放表格数据
        var dataBxpz = new Array();
        if ([[${reimbursement.bxpz}]] != null && [[${reimbursement.bxpz}]] != "") {
            dataBxpz = eval('(' + [[${reimbursement.bxpz}]] + ')');
        }
        //报销凭证
        var currTable2 = table.render({
            elem: '#currentTableId2',
            data: dataBxpz,
            cols: [
                [
                    {type: 'numbers', align: 'center'},
                    {field: 'wjm', title: '文件名', width: '30%'},
                    {field: 'scrq', title: '上传日期', width: '15%', align: 'center'},
                    {field: 'sm', title: '说明'}
                ]
            ],
            autoSort: false,
            limits: [10, 15, 20, 25, 50, 100],
            limit: Number.MAX_VALUE,
            page: true,
            skin: 'grid',
            done: function (res, curr, count) { // done为数据渲染完的回调
            }
        });

        //双击（报销凭证）
        table.on('rowDouble(currentTableFilter2)', function (obj) {
            /*window.open(obj.data.Url);*/

            var bzId = {
                "bzId": baozhangid
            }
            AjaxUtil.post({
                url: AjaxUtil.ctx + 'staReimbursement/viewFile',
                contentType: "application/json",
                data: JSON.stringify(bzId),
                success: function (res) {
                    console.log(res)
                    layer.tab({
                        area: ['100%', '100%'],
                        tab: res.data,
                        maxmin: true,
                        shadeClose: true,
                        success: function (index, layero) {//打开tab后的执行的内容
                            //你的代码
                            $(".layui-layer-title").attr("style", "width: 100%; height: 10%;background-color: #f0f0f0; overflow-y: scroll;  white-space: nowrap; border: 1px solid #ccc;");
                            $("div>span").attr("style", "width:10px;  display: inline-block;");
                        }
                    })
                },
                fail: function (res) {
                    layer.close(index);
                    Message.error(res.message, 1500);
                },
                error: function (error) {
                    layer.close(index);
                    Message.error("服务器异常！", 1000);
                }
            });
        });

        // 监听查看费用申请按钮
        $("button[lay-filter='viewFysqBtn']").click(function () {
            var index = parent.layer.open({
                title: '查看费用申请',
                type: 2,
                shade: 0.3,
                // maxmin: true,
                shadeClose: true,
                area: ['1030px', '700px'],
                content: AjaxUtil.ctx + 'staBudgetapproval/forApplyView/' + fysq + '?fylbmc=' + fylbmc,
                end: function () {
                    layer.close(index);
                }
            });
        });
        // 监听取消按钮
        $("button[lay-filter='cancleBtn']").click(function () {
            var iframeIndex = parent.layer.getFrameIndex(window.name);
            parent.layer.close(iframeIndex);
        });

        $("#ckwj").click(function () {
            var bzId = {
                "bzId": baozhangid
            }
            AjaxUtil.post({
                url: AjaxUtil.ctx + 'staReimbursement/viewFile',
                contentType: "application/json",
                data: JSON.stringify(bzId),
                success: function (res) {
                    console.log(res)
                    layer.tab({
                        area: ['100%', '100%'],
                        tab: res.data,
                        maxmin: true,
                        shadeClose: true,
                        success: function (index, layero) {//打开tab后的执行的内容
                            //你的代码
                            $(".layui-layer-title").attr("style", "width: 100%; height: 10%;background-color: #f0f0f0; overflow-y: scroll;  white-space: nowrap; border: 1px solid #ccc;");
                            $("div>span").attr("style", "width:10px;  display: inline-block;");
                        }
                    })
                },
                fail: function (res) {
                    layer.close(index);
                    Message.error(res.message, 1500);
                },
                error: function (error) {
                    layer.close(index);
                    Message.error("服务器异常！", 1000);
                }
            });

        })

        // 结束


        var updateflag = 0;
        var xmApproval = parent.getXmApproval();
        $("#bzje").val(xmApproval.bzje);

        //提交时间
        laydate.render({
            elem: '#shsj',
            type: 'datetime',
            value: new Date()
        });

        // element.render('checkbox');
        // form.on('select(spcz)', function (data) {
        //     if (data.value == "审批通过") {
        //         document.getElementById('jyDiv1').style.display = 'block';
        //         document.getElementById('jyDiv2').style.display = 'none';
        //     } else {
        //         document.getElementById('jyDiv1').style.display = 'none';
        //         document.getElementById('jyDiv2').style.display = 'block';
        //     }
        // });
        element.render('checkbox');
        form.on('select(xmlx)', function () {
            // //监听常用语下拉
            // document.getElementById('yj2').innerText = document.getElementById('xmlx').options[document.getElementById('xmlx').selectedIndex].text
            // document.getElementById('yj').innerText = document.getElementById('xmlx').options[document.getElementById('xmlx').selectedIndex].text
            // document.getElementById('yj2').value = document.getElementById('yj').value;
            // document.getElementById('yj').value = document.getElementById('yj2').value;
            // 获取选中的选项
            var selectedOption = document.getElementById('xmlx').options[document.getElementById('xmlx').selectedIndex];
            var newValue = selectedOption.text; // 获取选项文本

            // 更新元素内容和值
            // var yj2 = document.getElementById('yj2');
            var yj = document.getElementById('yj');

            // yj2.innerText = newValue;
            yj.innerText = newValue;
            // yj2.value = newValue;
            yj.value = newValue;

            // 修改意见内容
            var modifiedValue = prompt("请输入修改后的意见内容：", newValue); // 提示用户输入修改后的内容

            // 更新元素值
            // yj2.value = modifiedValue;
            yj.value = modifiedValue;

            // 最后展示修改后的意见
            console.log("修改后的意见是" + modifiedValue);

        });

        //初始化
        getInit();
        //gst ccy 监听常用语按钮
        $("button[lay-filter='cyySaveBtn']").click(function () {
            parent.layer.open({
                title: '查看常用',
                type: 2,
                shade: 0.3,
                maxmin: true,
                shadeClose: true,
                area: ['1080px', layerheight + 'px'],
                // content: AjaxUtil.ctx + '/prjProject/forCyy/' + $("#userId").val(),
                content: AjaxUtil.ctx + 'prjProject/forCyyy',
                end: function (index) {
                    $("#xmlx").empty();
                    $("#xmlx").append("<option>[无]</option>");
                    getInit();
                }
            });
        });

        // 监听查看可研报告按钮
        $("button[lay-filter='viewFybzBtn']").click(function () {
            var xmid = document.getElementById('xmid').value;
            console.log(xmid)
            parent.layer.open({
                title: '查看报账',
                type: 2,
                shade: 0.3,
                // maxmin: true,
                shadeClose: true,
                area: ['1250px', '750px'],
                content: AjaxUtil.ctx + "staReimbursement/forView/" +xmid,
                end: function () {
                    layer.close(index);
                }
            });
        });

        // 监听审批列表按钮
        $("button[lay-filter='viewSplistBtn']").click(function () {
            parent.layer.open({
                title: '审批列表',
                type: 2,
                shade: 0.3,
                maxmin: true,
                shadeClose: true,
                area: ['1300px', '750px'],
                content: AjaxUtil.ctx + 'staReimbursement/forApproveList',
                end: function (index) {
                    layer.close(index);
                }
            });
        });

        // 监听提交按钮
        form.on('submit(saveBtn)', function (data) {
            var zt = $("#zt").val();
            var shr = $("#shr").val();
            var userId = $("#userId").val();
            if (userId != shr)
                Message.error("您不是指定的审核人！", 1500);
            else if (zt == '数据不匹配')
                Message.error("数据不匹配，请联系管理员处理！", 1500);
            else {
                //基本信息
                layer.load(0, {shade: 0.1});
                AjaxUtil.post({
                    url: AjaxUtil.ctx + "prjApproverecord/doUpdateApprove",
                    data: data.field,
                    success: function (res) {
                        //更新审批状态
                        var project = {
                            "id": xmApproval.xmid,
                            "spzt": '审批结束'
                        }
                        var spcz = $("#spcz").val();
                        if (spcz === '返回修改') {
                            project.spzt = '未提交(返回)';
                        }

                        layer.load(0, {shade: 0.1});
                        AjaxUtil.post({
                            url: AjaxUtil.ctx + "staReimbursement/updateSpzt",
                            contentType: "application/json",
                            data: JSON.stringify(project),
                            success: function (res) {
                                parent.setUpdateFlag();

                                var iframeIndex = parent.layer.getFrameIndex(window.name);
                                parent.layer.close(iframeIndex);
                            },
                            error: function (error) {
                                Message.error('服务器睡着了',2000);
                            }
                        });
                    },
                    error: function (error) {
                    }
                });
            }
        });

        // 监听取消按钮
        $("button[lay-filter='cancleBtn']").click(function () {
            var iframeIndex = parent.layer.getFrameIndex(window.name);
            parent.layer.close(iframeIndex);
        });
    });


    function setTravelExpense(expense) {
        travelExpense = expense;
    }

    function getTravelExpense() {
        return travelExpense;
    }

</script>
</body>
</html>