From abbd7c46f2055cc98071761bc7e6ad68c2bd5e35 Mon Sep 17 00:00:00 2001
From: JiilingLee <462362@qq.com>
Date: Fri, 20 Oct 2023 10:44:33 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E8=AE=A1=E5=87=AD=E8=AF=81=E5=85=83?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=8B=E8=BD=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/accounting/voucher.js | 12 +++-
src/views/accounting/voucher/index.vue | 79 +++++++++++++++++++++++++-
2 files changed, 89 insertions(+), 2 deletions(-)
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 = {