#
luxiaotao1123
2021-04-13 cf943cb90fde999773267cbc14bf51a70881481a
src/main/webapp/static/js/order/order.js
@@ -147,7 +147,7 @@
        page: true,
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
        toolbar: '#toolbar',
        toolbar: '#orderToolbar',
        height: 'full-100',
        cols: [[
            {type: 'checkbox'}
@@ -156,7 +156,7 @@
            ,{field: 'orderNo', align: 'center',title: '订单编号'}
            ,{field: 'orderTime', align: 'center',title: '单据日期'}
            ,{field: 'docType$', align: 'center',title: '单据类型'}
            ,{field: 'itemId$', align: 'center',title: '项目编号'}
            ,{field: 'itemName', align: 'center',title: '项目'}
            ,{field: 'allotItemId$', align: 'center',title: '调拨项目编号', hide: true}
            ,{field: 'defNumber', align: 'center',title: '初始票据号', hide: true}
            ,{field: 'number', align: 'center',title: '票据号'}
@@ -202,6 +202,7 @@
        response: {
            statusCode: 200
        },
        size: 'lg',
        done: function(res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
@@ -223,30 +224,38 @@
        insTb2.reload({where: data.field, page: {curr: 1}});
        return false;
    });
    /* 表格2重置 */
    form.on('submit(orderTbReset)', function (data) {
        insTb2.reload({page: {curr: 1}});
        return false;
    });
    /* 表格2工具条点击事件 */
    table.on('tool(orderTable)', function (obj) {
        if (obj.event === 'edit') { // 修改
            showEditModel2(obj.data);
        } else if (obj.event === 'del') { // 删除
            doDel2(obj);
            var ids = [];
            ids.push(obj.id)
            doDelOrder({ids: ids});
        }
    });
    /* 表格2头工具栏点击事件 */
    table.on('toolbar(orderTable)', function (obj) {
        if (obj.event === 'add') { // 添加
            showEditModel2();
            // showEditModel2();
            right();
        } else if (obj.event === 'del') { // 删除
            var checkRows = table.checkStatus('dictDataTable');
            var checkRows = table.checkStatus('orderTable');
            if (checkRows.data.length === 0) {
                layer.msg('请选择要删除的数据', {icon: 2});
                return;
            }
            var ids = checkRows.data.map(function (d) {
                return d.dictDataId;
                return d.id;
            });
            doDel2({ids: ids});
            doDelOrder({ids: ids});
        }
    });
@@ -279,26 +288,32 @@
        });
    }
    /* 删除2 */
    function doDel2(obj) {
    /* 删除订单 */
    function doDelOrder(obj) {
        layer.confirm('确定要删除选中数据吗?', {
            skin: 'layui-layer-admin',
            shade: .1
        }, function (i) {
            layer.close(i);
            var loadIndex = layer.load(2);
            $.get('../../json/ok.json', {
                id: obj.data ? obj.data.dictDataId : '',
                ids: obj.ids ? obj.ids.join(',') : ''
            }, function (res) {
                layer.close(loadIndex);
                if (200 === res.code) {
                    layer.msg(res.msg, {icon: 1});
                    insTb2.reload({page: {curr: 1}});
                } else {
                    layer.msg(res.msg, {icon: 2});
            $.ajax({
                url: baseUrl+"/orders/delete/auth",
                headers: {'token': localStorage.getItem('token')},
                data: {ids: obj.ids},
                method: 'POST',
                success: function (res) {
                    layer.close(loadIndex);
                    if (res.code === 200){
                        layer.msg(res.msg, {icon: 1});
                        $(".layui-laypage-btn")[0].click();
                    } else if (res.code === 403){
                        top.location.href = baseUrl+"/";
                    }else {
                        layer.msg(res.msg, {icon: 2});
                    }
                }
            }, 'json');
            })
        });
    }
@@ -594,6 +609,23 @@
});
function right(){
    top.popupRight = top.layui.admin.popupRight({
        id: 'LAY_adminPopupLayerTest'
        , area: '750px'
        , type: 2
        , shade: [0.5,'#000']
        , content:'order/matQuery.html'
        , success: function(){
            // $('#'+ this.id).html('<div style="padding: 20px;">放入内容</div>');
            //admin.view(this.id).render('system/xxx')
        }
        , end: function () {
            $(".layui-laypage-btn")[0].click();
        }
    });
}
// 关闭动作
$(document).on('click','#data-detail-close', function () {
    parent.layer.closeAll();