|
@ -28,12 +28,12 @@ |
|
|
v-model:sort="tableObject.sort" |
|
|
v-model:sort="tableObject.sort" |
|
|
> |
|
|
> |
|
|
<template #code="{row}"> |
|
|
<template #code="{row}"> |
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|
|
<span>{{ row.code }}</span> |
|
|
<span>{{ row.code }}</span> |
|
|
</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> |
|
@ -131,11 +131,22 @@ const buttonBaseClick = (val, item) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const isShowMainButton = (row, val) => { |
|
|
|
|
|
if (val.indexOf(row.available) > -1) { |
|
|
|
|
|
return false |
|
|
|
|
|
} else { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = [ |
|
|
const butttondata = (row) => { |
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:customerdock:update'}), // 编辑 |
|
|
return[ |
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerdock:delete'}), // 删除 |
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:customerdock:update'}), // 编辑 |
|
|
] |
|
|
defaultButtons.mainListEnableBtn({hide: isShowMainButton(row, ['FALSE']),hasPermi: 'wms:customerdock:enable'}), |
|
|
|
|
|
defaultButtons.mainListDisableBtn({hide: isShowMainButton(row, ['TRUE']),hasPermi: 'wms:customerdock:disable'}), |
|
|
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerdock:delete'}), // 删除 |
|
|
|
|
|
]} |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
@ -144,9 +155,33 @@ 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) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const handleEnable = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await CustomerdockApi.enableOption(id) |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleDisable = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await CustomerdockApi.disableOption(id) |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const basicFormRef = ref() |
|
|
const basicFormRef = ref() |
|
|
const openForm = (type: string, row?: any) => { |
|
|
const openForm = (type: string, row?: any) => { |
|
@ -282,6 +317,9 @@ const searchFormClick = (searchData) => { |
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async() => { |
|
|
onMounted(async() => { |
|
|
|
|
|
tableObject.params = { |
|
|
|
|
|
available: 'TRUE' |
|
|
|
|
|
} |
|
|
getList() |
|
|
getList() |
|
|
importTemplateData.templateUrl = await CustomerdockApi.importTemplate() |
|
|
importTemplateData.templateUrl = await CustomerdockApi.importTemplate() |
|
|
}) |
|
|
}) |
|
|