From 15315b1772036eb5168792aac0121f6e9005b11e Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期一, 08 一月 2024 10:16:26 +0800 Subject: [PATCH] Default Changelist --- src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue b/src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue index 7798f8d..5eee2f8 100644 --- a/src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue +++ b/src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue @@ -44,6 +44,7 @@ <el-row class="cardTop"> <el-col :span="12" class="mainCardBtn"> <el-button type="primary" :icon="Plus" size="default" @click="toApply()">申请</el-button> + <el-button type="primary" :icon="Download" size="default" @click="exportSheet()">导出当日记录</el-button> </el-col> <el-button type="primary" :icon="Refresh" size="default" @click="reLoadData()" /> </el-row> @@ -482,15 +483,15 @@ } // 导出方法 - const downLoadRecord = async (data: any) => { + const exportSheet = async () => { // let res = await workApplyApi().postPrinting(data); - axios.post(import.meta.env.VITE_API_URL + `/work/apply/printingPdf`,data,{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ + axios.post(import.meta.env.VITE_API_URL + `/specialwork9step/work/export/excel`,{},{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ if (res) { const link = document.createElement('a') - let blob = new Blob([res.data],{type: 'application/pdf'}) + let blob = new Blob([res.data],{type: 'application/excel'}) link.style.display = "none"; link.href = URL.createObjectURL(blob); // 创建URL - link.setAttribute("download", state.downLoadName + "作业证.pdf"); + link.setAttribute("download", "作业申报记录.xlsx"); document.body.appendChild(link); link.click(); document.body.removeChild(link); @@ -559,6 +560,7 @@ viewStatus, abortRecordBtn, downLoadBtn, + exportSheet, getListByPage, handleSizeChange1, handleCurrentChange1, -- Gitblit v1.9.2