From 44d324bb2c73239c9f81145e9d505196e4c1a682 Mon Sep 17 00:00:00 2001 From: laishajiang <12977614+laishajiang@user.noreply.gitee.com> Date: Sat, 6 Apr 2024 07:32:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E4=BB=B6=E7=BB=9F=E8=AE=A1=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/data/category.vue | 46 +++++++++++++++++++++--- src/views/data/data.vue | 56 ++++++++++++++++++++++++----- src/views/data/source.vue | 71 +++++++++++++++++++++---------------- 3 files changed, 128 insertions(+), 45 deletions(-) diff --git a/src/views/data/category.vue b/src/views/data/category.vue index edc8c49..96e17b0 100644 --- a/src/views/data/category.vue +++ b/src/views/data/category.vue @@ -29,9 +29,20 @@ -
- 查询 - 重置 +
+
+ + + +
+
+
+ 查询 + 重置 +
+
@@ -103,7 +114,8 @@ import { ref, reactive, watchEffect } from "vue"; import { getCategoryHeaderlist ,getCategorylist} from '@/api/data' import { useDictOptions } from '@/hooks/useDictOptions' import { deptEasyLists,listSecond } from '@/api/org/department' - +import { getToken } from '@/utils/auth' +import axios from 'axios' const { optionsData } = useDictOptions<{ dept: any[] seconddept:any[] @@ -165,7 +177,31 @@ function reset() { getList() - +const exportLedger = () => { + delete query.value.size + delete query.value.current + + const data = query.value + console.log("exportLedger", data); + axios.post('/lan-api/api/data/exportcategory', data, { + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + "Admin": getToken() + }, + responseType: 'blob' + }).then((res: any) => { + const url = window.URL.createObjectURL(new Blob([res.data])); + const link = document.createElement('a'); + link.href = url; + link.setAttribute('download', '局长信箱即接即办信件三率统计.xlsx'); // 根据需求修改文件名 + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }).catch((err: any) => { + console.log(err); + }); +} diff --git a/src/views/data/data.vue b/src/views/data/data.vue index 17bb67b..2d55ad0 100644 --- a/src/views/data/data.vue +++ b/src/views/data/data.vue @@ -29,9 +29,21 @@ -
- 查询 - 重置 + +
+
+ + + +
+
+
+ 查询 + 重置 +
+
@@ -44,7 +56,7 @@
信件总量 - +
@@ -55,7 +67,7 @@
办结率 - +
@@ -66,7 +78,7 @@
解决率 - +
@@ -77,7 +89,7 @@
满意率 - +
@@ -87,7 +99,7 @@
总得分 - +
@@ -112,7 +124,8 @@ import { ref, reactive, watchEffect } from "vue"; import { getlist } from '@/api/data' import { useDictOptions } from '@/hooks/useDictOptions' import { deptEasyLists,listSecond } from '@/api/org/department' - +import { getToken } from '@/utils/auth' +import axios from 'axios' const { optionsData } = useDictOptions<{ dept: any[] seconddept:any[] @@ -155,6 +168,31 @@ const handleMailTimeQuery = (val: any) => { } } +const exportLedger = () => { + delete query.value.size + delete query.value.current + + const data = query.value + console.log("exportLedger", data); + axios.post('/lan-api/api/data/exportdata', data, { + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + "Admin": getToken() + }, + responseType: 'blob' + }).then((res: any) => { + const url = window.URL.createObjectURL(new Blob([res.data])); + const link = document.createElement('a'); + link.href = url; + link.setAttribute('download', '局长信箱即接即办信件三率统计.xlsx'); // 根据需求修改文件名 + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }).catch((err: any) => { + console.log(err); + }); +} diff --git a/src/views/data/source.vue b/src/views/data/source.vue index 6c8c7e5..81c4178 100644 --- a/src/views/data/source.vue +++ b/src/views/data/source.vue @@ -29,9 +29,20 @@ -
- 查询 - 重置 +
+
+ + + +
+
+
+ 查询 + 重置 +
+
@@ -88,7 +99,8 @@ import { ref, reactive, watchEffect } from "vue"; import { getsourcelist} from '@/api/data' import { useDictOptions } from '@/hooks/useDictOptions' import { deptEasyLists,listSecond } from '@/api/org/department' - +import { getToken } from '@/utils/auth' +import axios from 'axios' const { optionsData } = useDictOptions<{ dept: any[] seconddept:any[] @@ -100,34 +112,31 @@ const { optionsData } = useDictOptions<{ api: listSecond }, }) -const modifiedCategoryHeaders = computed(() => { - const headers = [...categoryHeaders.value]; - const complaintIndex = headers.findIndex(h => h.label === '投诉类'); - - if (complaintIndex !== -1) { - const complaintHeader = headers.splice(complaintIndex, 1); - headers.splice(complaintIndex, 0, ...complaintHeader, { label: '数量', width: 120 }, { label: '占比', width: 120 }); - } - - return headers; +const exportLedger = () => { + delete query.value.size + delete query.value.current + + const data = query.value + console.log("exportLedger", data); + axios.post('/lan-api/api/data/exportsource', data, { + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + "Admin": getToken() + }, + responseType: 'blob' + }).then((res: any) => { + const url = window.URL.createObjectURL(new Blob([res.data])); + const link = document.createElement('a'); + link.href = url; + link.setAttribute('download', '局长信箱即接即办信件三率统计.xlsx'); // 根据需求修改文件名 + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }).catch((err: any) => { + console.log(err); }); - -const categoryHeaders = ref([ - { label: '投诉类' }, - { label: '举报类' }, - { label: '咨询求助类' }, - { label: '工作建议类' }, - { label: '涉众金融平台类' }, - { label: '无效类' }, - { label: '终止类' }, - { label: '感谢信类' }, - ]) ; - -const subHeaders = ref([ - { label: '数量' }, - { label: '占比' }, - ]); - +} const mailStore = useMailStore(); mailStore.getMailCategorys(); const { dictData } = useDictData(["mail_source", "mail_level", "mail_state"]);