Browse Source

fix--导出鉴权问题、添加样式

main
buaixuexideshitongxue 1 month ago
parent
commit
8abc1425b0
  1. 11
      src/api/report/index.ts
  2. 25
      src/views/statement/condition/index.vue
  3. 25
      src/views/statement/conditionCollect/index.vue
  4. 26
      src/views/statement/index.vue

11
src/api/report/index.ts

@ -60,6 +60,17 @@ export const getPageConditionVo=(body)=>{
}) })
} }
export const excelConditionVo = (body) => {
return request.post({
url: '/reportProject/excelConditionVo',
body,
config: {
excelName: '政府投资项目审计情况备案表.xlsx'
},
showErrorMsg: true
})
}
export const upFinalizationPathFun = (body)=>{ export const upFinalizationPathFun = (body)=>{
return request.post({ return request.post({

25
src/views/statement/condition/index.vue

@ -1,6 +1,6 @@
<script setup> <script setup>
import useCatchStore from "@/stores/modules/catch"; import useCatchStore from "@/stores/modules/catch";
import {getPageConditionVo} from "@/api/report/index"; import {excelConditionVo, getPageConditionVo} from "@/api/report/index";
import {timeFormat} from "@/utils/util"; import {timeFormat} from "@/utils/util";
import {getFlowNodeValue} from "@/enums/flowEnums"; import {getFlowNodeValue} from "@/enums/flowEnums";
import feedback from "@/utils/feedback"; import feedback from "@/utils/feedback";
@ -10,6 +10,7 @@
const total = ref(10) const total = ref(10)
const loading =ref(false) const loading =ref(false)
const exportLoading = ref(false)
const catchStore = useCatchStore(); const catchStore = useCatchStore();
const dict = catchStore.getDicts(["procurementMethod"]); const dict = catchStore.getDicts(["procurementMethod"]);
const dictNode = ref([ const dictNode = ref([
@ -69,8 +70,18 @@ const query =ref({
getList() getList()
} }
const handleExcel = async () => { const handleExcel = async () => {
// await feedback.confirm(""); if (exportLoading.value) return; //
window.open(`${BASE_PATH}/reportProject/excelConditionVo?` + new URLSearchParams(query.value).toString())
try {
exportLoading.value = true;
await excelConditionVo(query.value);
} catch (e) {
console.error('导出失败', e);
feedback.msgError("导出失败");
} finally {
exportLoading.value = false;
}
} }
onMounted(()=>{ onMounted(()=>{
getList() getList()
@ -171,7 +182,13 @@ const query =ref({
</el-row> </el-row>
<div class="flex end"> <div class="flex end">
<div> <div>
<el-button type="primary" @click="handleExcel">导出</el-button> <el-button
type="primary"
:loading="exportLoading"
@click="handleExcel"
>
导出
</el-button>
<el-button type="primary" @click="getList"> <el-button type="primary" @click="getList">
<template #icon> <template #icon>
<icon name="el-icon-Search"/> <icon name="el-icon-Search"/>

25
src/views/statement/conditionCollect/index.vue

@ -1,6 +1,6 @@
<script setup> <script setup>
import useCatchStore from "@/stores/modules/catch"; import useCatchStore from "@/stores/modules/catch";
import {getPageConditionVo} from "@/api/report/index"; import {excelConditionVo, getPageConditionVo} from "@/api/report/index";
import {timeFormat} from "@/utils/util"; import {timeFormat} from "@/utils/util";
import {getFlowNodeValue} from "@/enums/flowEnums"; import {getFlowNodeValue} from "@/enums/flowEnums";
import feedback from "@/utils/feedback"; import feedback from "@/utils/feedback";
@ -10,6 +10,7 @@ const router = useRouter();
const total = ref(10) const total = ref(10)
const loading =ref(false) const loading =ref(false)
const exportLoading = ref(false)
const catchStore = useCatchStore(); const catchStore = useCatchStore();
const dict = catchStore.getDicts(["procurementMethod"]); const dict = catchStore.getDicts(["procurementMethod"]);
const dictNode = ref([ const dictNode = ref([
@ -67,8 +68,18 @@ const handleClick =(val)=>{
getList() getList()
} }
const handleExcel = async () => { const handleExcel = async () => {
// await feedback.confirm(""); if (exportLoading.value) return; //
window.open(`${BASE_PATH}/reportProject/excelConditionVo?` + new URLSearchParams(query.value).toString())
try {
exportLoading.value = true;
await excelConditionVo(query.value);
} catch (e) {
console.error('导出失败', e);
feedback.msgError("导出失败");
} finally {
exportLoading.value = false;
}
} }
onMounted(()=>{ onMounted(()=>{
getList() getList()
@ -169,7 +180,13 @@ onMounted(()=>{
</el-row> </el-row>
<div class="flex end"> <div class="flex end">
<div> <div>
<el-button type="primary" @click="handleExcel">导出</el-button> <el-button
type="primary"
:loading="exportLoading"
@click="handleExcel"
>
导出
</el-button>
<el-button type="primary" @click="getList"> <el-button type="primary" @click="getList">
<template #icon> <template #icon>
<icon name="el-icon-Search"/> <icon name="el-icon-Search"/>

26
src/views/statement/index.vue

@ -1,6 +1,6 @@
<script setup> <script setup>
import useCatchStore from "@/stores/modules/catch"; import useCatchStore from "@/stores/modules/catch";
import {getPageConditionVo} from "@/api/report/index"; import {excelConditionVo, getPageConditionVo} from "@/api/report/index";
import {timeFormat} from "@/utils/util"; import {timeFormat} from "@/utils/util";
import {getFlowNodeValue} from "@/enums/flowEnums"; import {getFlowNodeValue} from "@/enums/flowEnums";
import feedback from "@/utils/feedback"; import feedback from "@/utils/feedback";
@ -10,6 +10,7 @@ const router = useRouter();
const total = ref(10) const total = ref(10)
const loading =ref(false) const loading =ref(false)
const exportLoading = ref(false)
const catchStore = useCatchStore(); const catchStore = useCatchStore();
const dict = catchStore.getDicts(["procurementMethod"]); const dict = catchStore.getDicts(["procurementMethod"]);
const dictNode = ref([ const dictNode = ref([
@ -69,8 +70,18 @@ const handleClick =(val)=>{
getList() getList()
} }
const handleExcel =async ()=>{ const handleExcel =async ()=>{
// await feedback.confirm(""); if (exportLoading.value) return; //
window.open(`${BASE_PATH}/reportProject/excelConditionVo?` + new URLSearchParams(query.value).toString())
try {
exportLoading.value = true;
await excelConditionVo(query.value);
} catch (e) {
console.error('导出失败', e);
feedback.msgError("导出失败");
} finally {
exportLoading.value = false;
}
} }
onMounted(()=>{ onMounted(()=>{
getList() getList()
@ -171,8 +182,13 @@ onMounted(()=>{
</el-row> </el-row>
<div class="flex end"> <div class="flex end">
<div> <div>
<el-button type="primary" @click="handleExcel">导出</el-button> <el-button
<el-button type="primary" @click="getList"> type="primary"
:loading="exportLoading"
@click="handleExcel"
>
导出
</el-button> <el-button type="primary" @click="getList">
<template #icon> <template #icon>
<icon name="el-icon-Search"/> <icon name="el-icon-Search"/>
</template> </template>

Loading…
Cancel
Save