Browse Source

删除物料基础信息增加禁用启用,去掉删除。

syhx
liuchen864 2 months ago
parent
commit
6b1b6b5fd6
  1. 9
      src/api/wms/itembasic/index.ts
  2. 45
      src/views/wms/basicDataManage/itemManage/itembasic/index.vue

9
src/api/wms/itembasic/index.ts

@ -125,3 +125,12 @@ export const selectContainermanageItemCode = async (params) => {
console.log(2344,code)
return await request.get({ url: `/wms/itembasic/selectContainermanageItemCode?code=${code}`})
}
// 启用
export const enableItembasic = async (id: number) => {
return await request.enable({ url: `/wms/itembasic/enable?id=` + id })
}
// 禁用
export const disableItembasic = async (id: number) => {
return await request.disable({ url: `/wms/itembasic/disable?id=` + id })
}

45
src/views/wms/basicDataManage/itemManage/itembasic/index.vue

@ -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: '',

Loading…
Cancel
Save