| | |
| | | <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> |
| | |
| | | } |
| | | |
| | | // 导出方法 |
| | | 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); |
| | |
| | | viewStatus, |
| | | abortRecordBtn, |
| | | downLoadBtn, |
| | | exportSheet, |
| | | getListByPage, |
| | | handleSizeChange1, |
| | | handleCurrentChange1, |