|
|
@ -33,7 +33,7 @@ |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -73,6 +73,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
import * as SamplingProcessApi from "@/api/qms/samplingProcess"; |
|
|
|
|
|
|
|
defineOptions({ name: 'ItemSyntheticRelation' }) |
|
|
|
|
|
|
@ -144,11 +145,27 @@ const buttonBaseClick = (val, item) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:itemSyntheticRelation:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:itemSyntheticRelation:delete'}), // 删除 |
|
|
|
] |
|
|
|
const isShowMainButton = (row, val) => { |
|
|
|
if (val.indexOf(row.available) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:itemSyntheticRelation:update'}), // 编辑 |
|
|
|
defaultButtons.mainListEnableBtn({ |
|
|
|
hide: isShowMainButton(row, ['FALSE']), |
|
|
|
hasPermi: 'wms:itemSyntheticRelation:enable' |
|
|
|
}), |
|
|
|
defaultButtons.mainListDisableBtn({ |
|
|
|
hide: isShowMainButton(row, ['TRUE']), |
|
|
|
hasPermi: 'wms:itemSyntheticRelation:disable' |
|
|
|
}), |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
@ -156,6 +173,10 @@ const buttonTableClick = async (val, row) => { |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
}else if (val == 'enable') { |
|
|
|
handleEnable(row.id) |
|
|
|
} else if (val == 'disable') { |
|
|
|
handleDisable(row.id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -208,6 +229,24 @@ const handleDelete = async (id: number) => { |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
const handleEnable = async (id: number) => { |
|
|
|
try { |
|
|
|
await ItemSyntheticRelationApi.enableItemSyntheticRelation(id) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
const handleDisable = async (id: number) => { |
|
|
|
try { |
|
|
|
await ItemSyntheticRelationApi.disableItemSyntheticRelation(id) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
|
const handleExport = async () => { |
|
|
|