马宇豪
2024-01-08 15315b1772036eb5168792aac0121f6e9005b11e
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,