|
|
@ -28,7 +28,7 @@ |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase |
|
|
|
:Butttondata="butttondata" |
|
|
|
:Butttondata="butttondata(row)" |
|
|
|
@button-base-click="buttonTableClick($event,row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
@ -164,18 +164,32 @@ const buttonBaseClick = (val, item) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const isShowMainButton = (row, val) => { |
|
|
|
if (val.indexOf(row.available) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:itembasic:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:itembasic:delete'}), // 删除 |
|
|
|
] |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:itembasic:update'}), // 编辑 |
|
|
|
defaultButtons.mainListEnableBtn({hide: isShowMainButton(row, ['FALSE']),hasPermi: 'wms:itembasic:enable'}), |
|
|
|
defaultButtons.mainListDisableBtn({hide: isShowMainButton(row, ['TRUE']),hasPermi: 'wms:itembasic:disable'}), |
|
|
|
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:itembasic:delete' }) // 删除 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} else if (val == 'enable') { |
|
|
|
handleEnable(row.id) |
|
|
|
} else if (val == 'disable') { |
|
|
|
handleDisable(row.id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -187,6 +201,23 @@ const handleImport = () => { |
|
|
|
importFormRef.value.open() |
|
|
|
} |
|
|
|
|
|
|
|
const handleEnable = async (id: number) => { |
|
|
|
try { |
|
|
|
await ItembasicApi.enableItembasic(id) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
const handleDisable = async (id: number) => { |
|
|
|
try { |
|
|
|
await ItembasicApi.disableItembasic(id) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
// 导入附件弹窗所需的参数 |
|
|
|
const importTemplateData = reactive({ |
|
|
|
templateUrl: '', |
|
|
|