Browse Source

物料组合关系启用、停用

intex_online20241111
zhaoyiran 4 months ago
parent
commit
4fd529893f
  1. 10
      src/api/wms/itemSyntheticRelation/index.ts
  2. 51
      src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue
  3. 17
      src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts

10
src/api/wms/itemSyntheticRelation/index.ts

@ -51,4 +51,12 @@ export const exportItemSyntheticRelation = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/item-synthetic-relation/get-import-template' }) return request.download({ url: '/wms/item-synthetic-relation/get-import-template' })
} }
export async function enableItemSyntheticRelation(id: number) {
return await request.enable({ url: `/wms/item-synthetic-relation/enable?id=` + id })
}
export async function disableItemSyntheticRelation(id: number) {
return await request.disable({ url: `/wms/item-synthetic-relation/disable?id=` + id })
}

51
src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/index.vue

@ -33,7 +33,7 @@
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -73,6 +73,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import * as SamplingProcessApi from "@/api/qms/samplingProcess";
defineOptions({ name: 'ItemSyntheticRelation' }) defineOptions({ name: 'ItemSyntheticRelation' })
@ -144,11 +145,27 @@ const buttonBaseClick = (val, item) => {
} }
} }
// - const isShowMainButton = (row, val) => {
const butttondata = [ if (val.indexOf(row.available) > -1) {
defaultButtons.mainListEditBtn({hasPermi:'wms:itemSyntheticRelation:update'}), // return false
defaultButtons.mainListDeleteBtn({hasPermi:'wms:itemSyntheticRelation:delete'}), // } 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) => { const buttonTableClick = async (val, row) => {
@ -156,6 +173,10 @@ const buttonTableClick = async (val, row) => {
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) 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 {} } 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 exportLoading = ref(false) //
const handleExport = async () => { const handleExport = async () => {

17
src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts

@ -92,14 +92,15 @@ export const ItemSyntheticRelation = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 120 width: 120
}, },
form: { isForm:false,
component: 'Switch', // form: {
value: 'TRUE', // component: 'Switch',
componentProps: { // value: 'TRUE',
inactiveValue: 'FALSE', // componentProps: {
activeValue: 'TRUE' // inactiveValue: 'FALSE',
} // activeValue: 'TRUE'
} // }
// }
}, },
{ {
label: '操作', label: '操作',

Loading…
Cancel
Save