diff --git a/src/api/accounting/book.js b/src/api/accounting/book.js
index ba63f6af..f0626d6b 100644
--- a/src/api/accounting/book.js
+++ b/src/api/accounting/book.js
@@ -53,3 +53,13 @@ export function exportAccountingBookExcel(query) {
responseType: 'blob'
})
}
+
+// 下载元数据
+export function downloadXml(query) {
+ return request({
+ url: '/archives/accounting-book/downloadXml',
+ method: 'get',
+ params: query,
+ responseType: 'blob'
+ })
+}
\ No newline at end of file
diff --git a/src/api/accounting/report.js b/src/api/accounting/report.js
index 0fdefb91..a9da0a98 100644
--- a/src/api/accounting/report.js
+++ b/src/api/accounting/report.js
@@ -52,3 +52,13 @@ export function exportAccountingReportExcel(query) {
responseType: 'blob'
})
}
+
+// 下载元数据
+export function downloadXml(query) {
+ return request({
+ url: '/archives/accounting-report/downloadXml',
+ method: 'get',
+ params: query,
+ responseType: 'blob'
+ })
+}
diff --git a/src/views/accounting/book/index.vue b/src/views/accounting/book/index.vue
index d37a322e..f17ffe8b 100644
--- a/src/views/accounting/book/index.vue
+++ b/src/views/accounting/book/index.vue
@@ -60,6 +60,16 @@
>导出
+
+ 下载元数据
+
取 消
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -245,6 +285,7 @@ import {
deleteAccountingBook,
getAccountingBookPage,
exportAccountingBookExcel,
+ downloadXml,
} from "@/api/accounting/book";
import { getAccessToken } from "@/utils/auth";
import { getOrganizationPage } from "@/api/setting/organization";
@@ -271,6 +312,7 @@ export default {
fileList2: [],
// 是否显示弹出层
open: false,
+ open1: false,
// 查询参数
queryParams: {
pageNo: 1,
@@ -281,6 +323,7 @@ export default {
type: null,
year: null,
period: null,
+ inputPassword: null,
},
// 表单参数
form: {},
@@ -293,6 +336,9 @@ export default {
period: [
{ required: true, message: "请输入会计期间", trigger: "blur" },
],
+ inputPassword: [
+ { required: true, message: "密码不能为空", trigger: "blur" },
+ ],
},
uploadUrl:
process.env.VUE_APP_BASE_API +
@@ -347,6 +393,10 @@ export default {
this.open = false;
this.reset();
},
+ /** 取消按钮 */
+ cancel1() {
+ this.open1 = false;
+ },
/** 表单重置 */
reset() {
this.form = {
@@ -387,6 +437,26 @@ 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) => {
+ this.$download.excel(response, "会计账簿元数据.xml");
+ this.open1 = false;
+ })
+ .catch(() => {});
+ });
+ },
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
diff --git a/src/views/accounting/report/index.vue b/src/views/accounting/report/index.vue
index 950f120b..57a1b80c 100644
--- a/src/views/accounting/report/index.vue
+++ b/src/views/accounting/report/index.vue
@@ -69,6 +69,16 @@
>导出
+
+ 下载元数据
+
取 消
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -251,6 +291,7 @@ import {
getAccountingReport,
getAccountingReportPage,
exportAccountingReportExcel,
+ downloadXml,
} from "@/api/accounting/report";
import { getAccessToken } from "@/utils/auth";
import { getOrganizationPage } from "@/api/setting/organization";
@@ -277,6 +318,7 @@ export default {
fileList2: [],
// 是否显示弹出层
open: false,
+ open1: false,
// 查询参数
queryParams: {
pageNo: 1,
@@ -295,6 +337,7 @@ export default {
archiveState: null,
deptId: null,
deptName: null,
+ inputPassword: null,
},
// 表单参数
form: {},
@@ -307,6 +350,9 @@ export default {
period: [
{ required: true, message: "请输入会计期间", trigger: "blur" },
],
+ inputPassword: [
+ { required: true, message: "密码不能为空", trigger: "blur" },
+ ],
},
uploadUrl:
process.env.VUE_APP_BASE_API +
@@ -338,6 +384,10 @@ export default {
this.open = false;
this.reset();
},
+ /** 取消按钮 */
+ cancel1() {
+ this.open1 = false;
+ },
/** 表单重置 */
reset() {
this.form = {
@@ -371,6 +421,26 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
+ //下载元数据
+ 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) => {
+ this.$download.excel(response, "会计账簿元数据.xml");
+ this.open1 = false;
+ })
+ .catch(() => {});
+ });
+ },
/** 新增按钮操作 */
handleAdd() {
this.reset();