diff --git a/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts b/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts index bff5776f0..f5ec5d94b 100644 --- a/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts +++ b/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts @@ -27,7 +27,7 @@ export interface InspectionRecordMainVO { export const getInspectionRecordMainPage = async (params) => { if (params.isSearch) { // delete params.isSearch - const data = {...params} + const data = { ...params } return await request.post({ url: '/qms/inspection-record-main/senior', data }) } else { return await request.get({ url: `/qms/inspection-record-main/page`, params }) @@ -62,12 +62,28 @@ export const deleteInspectionRecordMain = async (id: number) => { export const exportInspectionRecordMain = async (params) => { if (params.isSearch) { const data = { ...params } - return await request.downloadPost({ url: `/qms/inspection-record-main/export-excel-senior`, data }) + return await request.downloadPost({ + url: `/qms/inspection-record-main/export-excel-senior`, + data + }) } else { return await request.download({ url: `/qms/inspection-record-main/export-excel`, params }) } } +// 导出首件检验记录 Excel +export const exportFirstInspectionRecordMain = async (params) => { + if (params.isSearch) { + const data = { ...params } + return await request.downloadPost({ + url: `/qms/inspection-record-main/export-excel-first-senior`, + data + }) + } else { + return await request.download({ url: `/qms/inspection-record-main/export-excel-first`, params }) + } +} + // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/qms/inspection-record-main/get-import-template' }) diff --git a/src/views/qms/inspectionRecordFirst/index.vue b/src/views/qms/inspectionRecordFirst/index.vue index df2442aed..be76b3c3e 100644 --- a/src/views/qms/inspectionRecordFirst/index.vue +++ b/src/views/qms/inspectionRecordFirst/index.vue @@ -216,14 +216,14 @@ const handleMainExport = async (row: any) => { } - /** 导出按钮操作 */ + /** 导出按钮操作 */ const handleExport = async () => { try { // 导出的二次确认 await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await InspectionRecordMainApi.exportInspectionRecordMain(tableObject.params) + const data = await InspectionRecordMainApi.exportFirstInspectionRecordMain(tableObject.params) download.excel(data, '首件检验记录.xlsx') } catch { } finally {