中扬CRM客户关系管理系统
LSH
2023-08-22 688ab515b1eadad9fc4cd3be5578833ef418a59b
src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
@@ -4,6 +4,7 @@
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).extend({
    steps: 'steps/steps',
    cascader: 'cascader/cascader',
}).use(['table','laydate', 'form', 'admin', 'xmSelect', 'element', 'cascader', 'tree', 'dropdown'], function(){
    var table = layui.table;
@@ -86,7 +87,7 @@
            {field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80,hide: true}
            ,{field: 'templateName', align: 'center',title: '报销类型',hide: false}
            ,{field: 'checkData', align: 'center',title: '是否冲账',hide: false}
            ,{field: 'orderNum', align: 'center',title: '报销单号',width: 320, hide:false}
            ,{field: 'orderNum', align: 'center',title: '报销单号',width: 320, style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false}
            ,{field: 'planId$', align: 'center',title: '项目号',hide: false}
            ,{field: 'createTime$', align: 'center',title: '创建时间',hide: false}
            ,{field: 'updateTime$', align: 'center',title: '更新时间',hide: false}
@@ -235,20 +236,34 @@
    table.on('tool(reimburseOnline)', function(obj){
        var data = obj.data;
        switch (obj.event) {
            // 核价
            case 'check':
                layer.open({
                    type: 2,
                    title: '核价',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
                    content: 'reimburseOnline_detail.html?id=' + data.id,
                    success: function(layero, index){
                        // layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
            case 'more':
                top.reimburseOnlineByMore=data.id;
                console.log(top.reimburseOnlineByMore)
                admin.popupRight({
                    type: 1,
                    window: "top",
                    area: "1250px",
                    url: "reimburseOnline_more.html",
                    end: function () {
                        // $(".layui-laypage-btn")[0].click();
                    }
                });
                })
                break;
            // // 核价
            // case 'check':
            //     layer.open({
            //         type: 2,
            //         title: '核价',
            //         maxmin: true,
            //         area: [top.detailWidth, top.detailHeight],
            //         shadeClose: false,
            //         content: 'reimburseOnline_detail.html?id=' + data.id,
            //         success: function(layero, index){
            //             // layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
            //         }
            //     });
            //     break;
            case 'del':
                layer.confirm('确定删除这条数据吗', function(){
                    $.ajax({
@@ -370,13 +385,13 @@
            case "look":
                var $a = $(obj.tr).find('a[lay-event="look"]');
                var offset = $a.offset();
                var top = offset.top;
                var top2 = offset.top;
                var left = offset.left;
                layer.open({
                    type: 1,
                    title: false,
                    area: '2100px',
                    offset: [top + 'px', (left - 1730 + $a.outerWidth()) + 'px'],
                    offset: [top2 + 'px', (left - 1730 + $a.outerWidth()) + 'px'],
                    shade: .01,
                    shadeClose: true,
                    fixed: false,
@@ -697,6 +712,33 @@
        });
    }
    function approval(planId, plannerId, dIdx) {
        let loadIndex = layer.load(2);
        $.ajax({
            url: baseUrl+"/reimburseOnline/approval/auth",
            headers: {'token': localStorage.getItem('token')},
            data: {
                planId: planId,
                plannerId: plannerId
            },
            method: 'POST',
            success: function (res) {
                if (dIdx) {
                    layer.close(dIdx);
                }
                layer.close(loadIndex);
                if (res.code === 200){
                    layer.msg(res.msg, {icon: 1});
                    tableReload();
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                } else {
                    layer.msg(res.msg, {icon: 2});
                }
            }
        })
    }
    /* 弹窗 - 新增、修改 */
    // function showEditModel(mData) {
    //     admin.open({