diff --git a/src/api/accounting/flow.js b/src/api/accounting/flow.js index 7d2ffcdf..df75d3a7 100644 --- a/src/api/accounting/flow.js +++ b/src/api/accounting/flow.js @@ -52,3 +52,13 @@ export function exportFlowExcel(query) { responseType: 'blob' }) } + +// 下载元数据 +export function downloadXml(query) { + return request({ + url: '/archives/flow/downloadXml', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/views/accounting/flow/index.vue b/src/views/accounting/flow/index.vue index 6968b097..8622518a 100644 --- a/src/views/accounting/flow/index.vue +++ b/src/views/accounting/flow/index.vue @@ -58,6 +58,17 @@ >导出 + + 下载元数据 + --> - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - 请选择字典生成 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -193,6 +246,7 @@ import { getFlow, getFlowPage, exportFlowExcel, + downloadXml, } from "@/api/accounting/flow"; export default { @@ -214,6 +268,7 @@ export default { title: "", // 是否显示弹出层 open: false, + open1: false, // 查询参数 queryParams: { pageNo: 1, @@ -236,6 +291,7 @@ export default { deptName: null, archiveId: null, archiveState: null, + inputPassword: null, }, // 表单参数 form: {}, @@ -257,11 +313,19 @@ export default { this.loading = false; }); }, + openLink(fileUrl) { + window.open(fileUrl); + }, /** 取消按钮 */ cancel() { this.open = false; this.reset(); }, + + /** 取消按钮 */ + cancel1() { + this.open1 = false; + }, /** 表单重置 */ reset() { this.form = { @@ -367,6 +431,32 @@ export default { }) .catch(() => {}); }, + //下载元数据 + handleDownloadData() { + this.open1 = true; + this.queryParams.inputPassword = null; + }, + submitForm1() { + this.$refs["queryForm"].validate((valid) => { + if (!valid) { + return; + } + // 处理查询参数 + let params = { ...this.queryParams }; + downloadXml(params) + .then((response) => { + console.log(response.size); + if (response.size == 39) { + this.$modal.msgError("密码错误"); + return false; + } else { + this.$download.excel(response, "审批流程元数据.xml"); + this.open1 = false; + } + }) + .catch(() => {}); + }); + }, }, };