style;配方配置-导出

main
黄伟杰 3 weeks ago
parent ea588c4657
commit 1560f8ee93

@ -68,7 +68,7 @@
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<!-- <el-table-column type="selection" width="55" reserve-selection /> -->
<el-table-column type="selection" width="55" reserve-selection />
<el-table-column
:label="t('RecipeManagement.RecipeConfig.tableRecipeCodeColumn')"
align="center"
@ -337,6 +337,17 @@ const handleSelectionChange = (rows: any[]) => {
const list = ref<RecipeConfigVO[]>([])
const total = ref(0)
const buildExportParams = () => {
const recipeCode = queryParams.recipeCode?.trim()
const name = queryParams.name?.trim()
const productName = queryParams.productName?.trim()
return {
recipeCode: recipeCode ? recipeCode : undefined,
name: name ? name : undefined,
productName: productName ? productName : undefined
}
}
const buildQueryParams = () => {
const recipeCode = queryParams.recipeCode?.trim()
const name = queryParams.name?.trim()
@ -376,14 +387,16 @@ const handlePagination = () => {
}
const handleExport = async () => {
if (!selectedIds.value.length) {
message.error(t('RecipeManagement.RecipeConfig.exportNoSelectionMessage'))
return
}
try {
await message.exportConfirm()
exportLoading.value = true
const data = await RecipeConfigApi.exportRecipeConfig({ ids: selectedIds.value.join(',') })
const exportParams: any = {
...buildExportParams()
}
if (selectedIds.value.length) {
exportParams.ids = selectedIds.value.join(',')
}
const data = await RecipeConfigApi.exportRecipeConfig(exportParams)
download.excel(data, t('RecipeManagement.RecipeConfig.exportFileName'))
} catch {
} finally {

Loading…
Cancel
Save