diff --git a/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue b/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue index dd3f32f3d..f6ccc530c 100644 --- a/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue +++ b/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue @@ -296,6 +296,10 @@ const buttonOperationClick = async (row, label, index,isSave = false)=> { } // 删除明细 const handleDeleteTableBom = (item, index) => { + if(detatableDataBom.tableList.length<=1){ + message.error('至少保留一条数据') + return + } let itemIndex = detatableDataBom.tableList.indexOf(item) if (itemIndex > -1) { detatableDataBom.tableList.splice(itemIndex, 1) @@ -303,6 +307,12 @@ const handleDeleteTableBom = (item, index) => { } const tableSelectionDeleteBom = (selection) => { + if(detatableDataBom.tableList.length<=1||detatableDataBom.tableList.length==selection.length){ + message.error('至少保留一条数据') + return + } + + detatableDataBom.tableList = detatableDataBom.tableList.filter(item => !selection.includes(item)) }