Browse Source

至少保留一条数据

hella_online_20240816
wangyufei 3 months ago
parent
commit
7044799b76
  1. 10
      src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue

10
src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue

@ -296,6 +296,10 @@ const buttonOperationClick = async (row, label, index,isSave = false)=> {
} }
// //
const handleDeleteTableBom = (item, index) => { const handleDeleteTableBom = (item, index) => {
if(detatableDataBom.tableList.length<=1){
message.error('至少保留一条数据')
return
}
let itemIndex = detatableDataBom.tableList.indexOf(item) let itemIndex = detatableDataBom.tableList.indexOf(item)
if (itemIndex > -1) { if (itemIndex > -1) {
detatableDataBom.tableList.splice(itemIndex, 1) detatableDataBom.tableList.splice(itemIndex, 1)
@ -303,6 +307,12 @@ const handleDeleteTableBom = (item, index) => {
} }
const tableSelectionDeleteBom = (selection) => { 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)) detatableDataBom.tableList = detatableDataBom.tableList.filter(item => !selection.includes(item))
} }

Loading…
Cancel
Save