element-ui表格数据中的状态值不同控制不同的按钮权限

例如:需求如下

表格数据的状态值为:0-未下发,1-已下发,2-已上报,3-已驳回,4-已审核,5-已代摊完成

1、导出按钮满足4,5启用,0-3禁用

3、获取当期待摊费用,下发待摊费用只有满足0,启用

按钮禁用方法如下:

 // 按钮的禁用
        buttonDisabled() {
            let table = []
            // 部分按钮的禁用
            this.tableData.filter(item => {
                table.push(item.status)
            });
            // 控制导出
            if (!table.includes(0) & !table.includes(1) & !table.includes(2) & !table.includes(3)) {
                this.exportButton = false
            } else {
                this.exportButton = true
            }
            // 控制 获取当前待摊费用,下发待摊费用
            if (!table.includes(5) & !table.includes(1) & !table.includes(2) & !table.includes(3) & !table.includes(4)) {
                this.GetCurrent = false
            } else {
                this.GetCurrent = true
            }


        },

效果图

猜你喜欢

转载自blog.csdn.net/m0_57071129/article/details/125758150