From 38af7850e2c62b28ccb6f990140ac17c4bc21419 Mon Sep 17 00:00:00 2001 From: zhouwenxuan <1175765986@qq.com> Date: 星期一, 18 三月 2024 14:49:27 +0800 Subject: [PATCH] 风险辨识管理 --- src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue b/src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue index 7798f8d..8502469 100644 --- a/src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue +++ b/src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue @@ -6,7 +6,7 @@ <el-row class="homeCard"> <div class="basic-line" style="display:flex;white-space:nowrap;line-height: 40px"> <span>时间筛选:</span> - <el-date-picker v-model="timeRange" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" @change="giveTime()" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" /> + <el-date-picker v-model="timeRange" value-format="YYYY-MM-DD" type="daterange" @change="giveTime" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" /> </div> <div class="basic-line" style="display:flex;white-space:nowrap;line-height: 40px"> <span>负责人:</span> @@ -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> @@ -92,7 +93,7 @@ <el-button v-else link type="primary" size="small" @click="openReport('查看', scope.row)">查看研判报告</el-button> </template> </el-table-column> - <el-table-column fixed="right" label="操作" align="center" width="300"> + <el-table-column fixed="right" label="操作" align="center" width="150"> <template #default="scope"> <span v-if="scope.row.status == -1">已废止</span> <el-button v-if="scope.row.status == 0 || scope.row.status == 1" link type="danger" size="small" :icon="Delete" @click="abortRecordBtn(scope.row)">作废</el-button> @@ -292,7 +293,7 @@ const giveTime = () => { if (state.timeRange && state.timeRange !== null) { state.searPara.startTime = state.timeRange[0]; - state.searPara.endTime = state.timeRange[1]; + state.searPara.endTime = state.timeRange[1] } else { state.searPara.startTime = ''; state.searPara.endTime = ''; @@ -381,6 +382,7 @@ // 关键词查询记录 const searchRecord = async () => { + state.pageIndex1 = 1 getListByPage(); }; // 重置搜索 @@ -482,15 +484,19 @@ } // 导出方法 - 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`,{startTime: state.searPara.startTime,endTime: state.searPara.endTime,secondDepId: state.searPara.secondDepId},{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"); + if(state.searPara.startTime !== '' && state.searPara.endTime !==''){ + link.setAttribute("download", state.searPara.startTime + '—' + state.searPara.endTime +"作业申报记录.xlsx") + }else{ + link.setAttribute("download", "作业申报记录.xlsx") + } document.body.appendChild(link); link.click(); document.body.removeChild(link); @@ -559,6 +565,7 @@ viewStatus, abortRecordBtn, downLoadBtn, + exportSheet, getListByPage, handleSizeChange1, handleCurrentChange1, -- Gitblit v1.9.2