From f7f13e119fbff2f7394bd6c9f73c41b7b63d0722 Mon Sep 17 00:00:00 2001
From: Apcallover <1503963513@qq.com>
Date: Mon, 8 Apr 2024 19:32:21 +0800
Subject: [PATCH] =?UTF-8?q?flat:=20=E6=9A=82=E5=AD=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/manage/mission.js | 13 +++++++++
src/api/workstation/post.js | 12 ++++++++
src/views/manage/mission/index.vue | 29 ++++++++++++++------
src/views/manage/works/index.vue | 28 +++++++++++++++----
src/views/report/main/innovation.vue | 6 +---
src/views/report/main/unemployment.vue | 6 +---
src/views/report/main/vocational.vue | 6 +---
src/views/report/main/vocationalTraining.vue | 6 +---
8 files changed, 71 insertions(+), 35 deletions(-)
diff --git a/src/api/manage/mission.js b/src/api/manage/mission.js
index 2a7a95f..8dcf3ec 100644
--- a/src/api/manage/mission.js
+++ b/src/api/manage/mission.js
@@ -13,6 +13,19 @@ export const getList = (current, size, params) => {
});
};
+export const exportList = (current, size, params) => {
+ return request({
+ url: "/api/jobslink-api/missions/mission/manage/export",
+ method: "get",
+ params: {
+ ...params,
+ current,
+ size,
+ },
+ responseType: 'blob',
+ });
+};
+
export const getZPView = (current, size, missionNo, params) => {
return request({
url: "/api/jobslink-api/missions/mission/apply/manage/list",
diff --git a/src/api/workstation/post.js b/src/api/workstation/post.js
index bd6c63a..2bdf1ce 100644
--- a/src/api/workstation/post.js
+++ b/src/api/workstation/post.js
@@ -59,6 +59,18 @@ export const getList = (current, size, params) => {
},
});
};
+export const exportList = (current, size, params) => {
+ return request({
+ url: "/api/jobslink-api/jkWorks/jkWorks/export",
+ method: "get",
+ params: {
+ ...params,
+ current,
+ size,
+ },
+ responseType: 'blob'
+ });
+};
export const getZPView = (current, size, missionNo, params) => {
return request({
diff --git a/src/views/manage/mission/index.vue b/src/views/manage/mission/index.vue
index 1c8bd39..39c16e2 100644
--- a/src/views/manage/mission/index.vue
+++ b/src/views/manage/mission/index.vue
@@ -152,7 +152,7 @@
>
- 导出
@@ -186,8 +186,10 @@ import {
complet,
getDetail,
download,
- Auditing
+ Auditing,
+ exportList
} from "@/api/manage/mission";
+import {downloadEcxel} from '@/util/util'
import { mapGetters } from "vuex";
import missionView from "@/views/util/mission-view";
import zpView from "./zpView";
@@ -211,6 +213,7 @@ export default {
recruitStatus,
dataSourcesEnum,
educationState,
+ downloadButton: false,
view: {},
form: {},
selectionList: [],
@@ -601,13 +604,21 @@ export default {
})
},
downRecords() {
- if (this.query.time) {
- this.query.stime = this.query.time[0];
- this.query.etime = this.query.time[1];
- // delete this.query.time;
- }
- window.open(download(this.query));
-
+ this.downloadButton = true
+ exportList(
+ this.page.currentPage,
+ this.page.pageSize,
+ this.query
+ ).then((response) => {
+ const blob = window.URL.createObjectURL(new Blob([response.data], { type: response.headers['content-type']}));
+ let fileName = decodeURI(response.headers['content-disposition'].split(';')[1].split('filename=')[1])
+ let a = document.createElement('a')
+ let event = new MouseEvent('click')
+ a.download = fileName || Date.now() + '.xlsx'
+ a.href = blob
+ a.dispatchEvent(event)
+ this.downloadButton = false
+ })
},
},
diff --git a/src/views/manage/works/index.vue b/src/views/manage/works/index.vue
index f17a759..66a59ef 100644
--- a/src/views/manage/works/index.vue
+++ b/src/views/manage/works/index.vue
@@ -126,6 +126,11 @@
v-if="vaildData(permission.manage_mission_zpview, false)"
>报名详情 -->
+
+ 导出
+
{
+ const blob = window.URL.createObjectURL(new Blob([response.data], { type: response.headers['content-type']}));
+ let fileName = decodeURI(response.headers['content-disposition'].split(';')[1].split('filename=')[1])
+ let a = document.createElement('a')
+ let event = new MouseEvent('click')
+ a.download = fileName || Date.now() + '.xlsx'
+ a.href = blob
+ a.dispatchEvent(event)
+ this.downloadButton = false
+ })
},
diff --git a/src/views/report/main/innovation.vue b/src/views/report/main/innovation.vue
index 05d20d5..bb515b0 100644
--- a/src/views/report/main/innovation.vue
+++ b/src/views/report/main/innovation.vue
@@ -65,11 +65,7 @@ export default {
this.headTitle = res[0].name
this.search.serveId = res[0].id
this.searchServeId = res[0].id
- this.getList().then((records) => {
- if(records.length) {
- this.headTitle = records[0].name
- }
- })
+ this.getList()
}
})
},
diff --git a/src/views/report/main/unemployment.vue b/src/views/report/main/unemployment.vue
index f8800da..8532335 100644
--- a/src/views/report/main/unemployment.vue
+++ b/src/views/report/main/unemployment.vue
@@ -66,11 +66,7 @@ export default {
this.headTitle = res[0].name
this.search.serveId = res[0].id
this.searchServeId = res[0].id
- this.getList().then((records) => {
- if(records.length) {
- this.headTitle = records[0].name
- }
- })
+ this.getList()
}
})
},
diff --git a/src/views/report/main/vocational.vue b/src/views/report/main/vocational.vue
index b097e35..2af2c31 100644
--- a/src/views/report/main/vocational.vue
+++ b/src/views/report/main/vocational.vue
@@ -66,11 +66,7 @@ export default {
this.headTitle = res[0].name
this.search.serveId = res[0].id
this.searchServeId = res[0].id
- this.getList().then((records) => {
- if(records.length) {
- this.headTitle = records[0].name
- }
- })
+ this.getList()
}
})
},
diff --git a/src/views/report/main/vocationalTraining.vue b/src/views/report/main/vocationalTraining.vue
index b22a31c..49929d3 100644
--- a/src/views/report/main/vocationalTraining.vue
+++ b/src/views/report/main/vocationalTraining.vue
@@ -67,11 +67,7 @@ export default {
this.headTitle = res[0].name
this.search.serveId = res[0].id
this.searchServeId = res[0].id
- this.getList().then((records) => {
- if(records.length) {
- this.headTitle = records[0].name
- }
- })
+ this.getList()
}
})
},