From b9e9b2a03f0747f2dccf88c2fa8fb95c2de42fb8 Mon Sep 17 00:00:00 2001
From: JiilingLee <462362@qq.com>
Date: Fri, 20 Oct 2023 10:55:27 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E8=AE=A1=E5=85=B6=E4=BB=96=E8=B5=84?=
=?UTF-8?q?=E6=96=99=E5=85=83=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/other.js | 10 ++++
src/views/accounting/other/index.vue | 78 +++++++++++++++++++++++++++-
2 files changed, 87 insertions(+), 1 deletion(-)
diff --git a/src/api/accounting/other.js b/src/api/accounting/other.js
index 1dd8b2bb..c635109b 100644
--- a/src/api/accounting/other.js
+++ b/src/api/accounting/other.js
@@ -52,3 +52,13 @@ export function exportOtherExcel(query) {
responseType: 'blob'
})
}
+
+// 下载元数据
+export function downloadXml(query) {
+ return request({
+ url: '/accounting/other/downloadXml',
+ method: 'get',
+ params: query,
+ responseType: 'blob'
+ })
+}
diff --git a/src/views/accounting/other/index.vue b/src/views/accounting/other/index.vue
index 77d325e0..53ab45bd 100644
--- a/src/views/accounting/other/index.vue
+++ b/src/views/accounting/other/index.vue
@@ -65,6 +65,16 @@
>导出
+
+ 下载元数据
+
取 消
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -290,6 +329,7 @@ import {
getOther,
getOtherPage,
exportOtherExcel,
+ downloadXml,
} from "@/api/accounting/other";
import { getAccessToken, getTenantId } from "@/utils/auth";
import { getOrganizationPage } from "@/api/setting/organization";
@@ -313,6 +353,7 @@ export default {
title: "",
// 是否显示弹出层
open: false,
+ open1: false,
// 查询参数
queryParams: {
pageNo: 1,
@@ -338,11 +379,16 @@ export default {
userId: null,
fileStatus: null,
remark: null,
+ inputPassword: null,
},
// 表单参数
form: {},
// 表单校验
- rules: {},
+ rules: {
+ inputPassword: [
+ { required: true, message: "密码不能为空", trigger: "blur" },
+ ],
+ },
fileList: [], // 文件列表
uploadUrl:
process.env.VUE_APP_BASE_API + "/admin-api/accounting/other/upload", // 上传地址地址
@@ -358,6 +404,36 @@ export default {
this.getOrganizationList();
},
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;
+ },
+ /** 取消按钮 */
+ cancel1() {
+ this.open1 = false;
+ },
/**
* 文件预览
* @param fileUrl 地址