diff --git a/src/api/accounting/bankSlip.js b/src/api/accounting/bankSlip.js index 30f8a2d5..589f6d31 100644 --- a/src/api/accounting/bankSlip.js +++ b/src/api/accounting/bankSlip.js @@ -52,3 +52,13 @@ export function exportBankSlipExcel(query) { responseType: 'blob' }) } + +// 下载元数据 +export function downloadXml(query) { + return request({ + url: '/archives/bank-slip/downloadXml', + method: 'get', + params: query, + responseType: 'blob' + }) +} \ No newline at end of file diff --git a/src/views/accounting/bankSlip/index.vue b/src/views/accounting/bankSlip/index.vue index aa0c7c12..66da0f1a 100644 --- a/src/views/accounting/bankSlip/index.vue +++ b/src/views/accounting/bankSlip/index.vue @@ -134,6 +134,17 @@ >导出 + + 下载元数据 + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 请选择字典生成 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -394,6 +530,7 @@ import { getBankSlip, getBankSlipPage, exportBankSlipExcel, + downloadXml, } from "@/api/accounting/bankSlip"; export default { @@ -415,6 +552,7 @@ export default { title: "", // 是否显示弹出层 open: false, + open1: false, // 查询参数 queryParams: { pageNo: 1, @@ -460,6 +598,7 @@ export default { archiveId: null, archiveState: null, password: null, + inputPassword: null, }, // 表单参数 form: {}, @@ -486,6 +625,10 @@ export default { this.open = false; this.reset(); }, + /** 取消按钮 */ + cancel1() { + this.open1 = false; + }, /** 表单重置 */ reset() { this.form = { @@ -582,6 +725,32 @@ export default { }); }); }, + //下载元数据 + 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(() => {}); + }); + }, /** 删除按钮操作 */ handleDelete(row) { const id = row.id;