|
|
@ -33,9 +33,9 @@ |
|
|
|
<span>{{ row.number }}</span> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<!-- <template #action="{ row,$index }"> |
|
|
|
<template #action="{ row,$index }"> |
|
|
|
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> --> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
@ -138,16 +138,34 @@ const buttonBaseClick = (val, item) => { |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:packageover-job-main:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:packageover-job-main:delete'}), // 删除 |
|
|
|
] |
|
|
|
|
|
|
|
const butttondata = (row,$index) => { |
|
|
|
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|
|
|
if(findIndex>-1&&findIndex<$index){ |
|
|
|
return [] |
|
|
|
} |
|
|
|
return [ |
|
|
|
// defaultButtons.mainListEditBtn({hasPermi:'wms:packageover-job-main:update'}), // 编辑 |
|
|
|
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:packageover-job-main:close'}), // 关闭 |
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:packageover-job-main:delete'}), // 删除 |
|
|
|
] |
|
|
|
} |
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isShowMainButton = (row, val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
if (val == 'mainClose') { // 关闭 |
|
|
|
// 发起关闭 |
|
|
|
await message.confirm('确认要关闭吗?') |
|
|
|
await PackageoverJobMainApi.closePackageoverJobMain(row.masterId) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
}else if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.masterId) |
|
|
|