diff --git a/src/api/accounting/voucher.js b/src/api/accounting/voucher.js index 1bf96f8e..2b465090 100644 --- a/src/api/accounting/voucher.js +++ b/src/api/accounting/voucher.js @@ -69,4 +69,14 @@ export function getVoucherDetailsPage(query) { method: 'get', params: query }) -} \ No newline at end of file +} + +// 下载元数据 +export function downloadXml(query) { + return request({ + url: '/accounting/voucher/downloadXml', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/views/accounting/voucher/index.vue b/src/views/accounting/voucher/index.vue index b87dde17..928cda48 100644 --- a/src/views/accounting/voucher/index.vue +++ b/src/views/accounting/voucher/index.vue @@ -80,6 +80,16 @@ >导出 + + 下载元数据 + 取 消 + + + + + + + + + + + + + + @@ -420,6 +460,7 @@ import { getVoucherPage, exportVoucherExcel, getVoucherDetailsPage, + downloadXml } from "@/api/accounting/voucher"; import { listUser } from "@/api/system/user"; import { getSiteTree } from "@/api/setting/organization"; @@ -458,6 +499,7 @@ export default { title: "", // 是否显示弹出层 open: false, + open1: false, activeName: "first", // 查询参数 queryParams: { @@ -493,6 +535,7 @@ export default { organizationId: null, depotId: null, cabinetId: null, + inputPassword: null, }, fjList: [], splcList: [], @@ -501,7 +544,11 @@ export default { // 表单参数 form: {}, // 表单校验 - rules: {}, + rules: { + inputPassword: [ + { required: true, message: "密码不能为空", trigger: "blur" }, + ], + }, userOptions: [], //用户数据 siteOptions: [], //归档位置数据 siteArray: [], //归档位置选中值 @@ -521,6 +568,32 @@ export default { this.handleInitList(); }, methods: { + 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(() => {}); + }); + }, + //下载元数据 + handleDownloadData() { + this.open1 = true; + this.queryParams.inputPassword = null; + }, /** 查询列表 */ getList() { this.loading = true; @@ -639,6 +712,10 @@ export default { this.open = false; this.reset(); }, + /** 取消按钮 */ + cancel1() { + this.open1 = false; + }, /** 表单重置 */ reset() { this.form = {