feat(mes): 添加条码清单导出功能

实现条码清单的 Excel 导出功能,用户可以通过点击导出按钮下载条码清单。此功能增强了用户体验,方便用户管理和使用条码数据。
pull/871/MERGE
YunaiV 2026-03-07 10:12:43 +08:00
parent c7f9d41e07
commit 21821c92d9
2 changed files with 31 additions and 0 deletions

View File

@ -48,5 +48,10 @@ export const WmBarcodeApi = {
// 删除条码
deleteBarcode: async (id: number) => {
return await request.delete({ url: '/mes/wm/barcode/delete?id=' + id })
},
// 导出条码 Excel
exportBarcode: async (params: any) => {
return await request.download({ url: '/mes/wm/barcode/export-excel', params })
}
}

View File

@ -78,6 +78,15 @@
>
<Icon icon="ep:setting" class="mr-5px" /> 条码设置
</el-button>
<el-button
type="warning"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['mes:wm-barcode:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
@ -167,6 +176,7 @@ import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import { WmBarcodeApi } from '@/api/mes/wm/barcode'
import { Barcode, BarcodeDetail } from './components'
import BarcodeForm from './BarcodeForm.vue'
import download from '@/utils/download'
defineOptions({ name: 'MesWmBarcode' })
@ -245,6 +255,22 @@ const handleConfig = () => {
push({ name: 'MesWmBarcodeConfig' })
}
/** 导出按钮操作 */
const exportLoading = ref(false)
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await WmBarcodeApi.exportBarcode(queryParams)
download.excel(data, '条码清单.xls')
} catch {
} finally {
exportLoading.value = false
}
}
onMounted(() => {
getList()
})