From 3df8b1aa4ac3d5ca030121ab7ee9387e9d106951 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期五, 09 十月 2026 10:58:54 +0800
Subject: [PATCH] feat: 增加科目总账明细表excel导出 和 凭证增加记账凭证work导出
---
src/views/financialManagement/voucher/index.vue | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/src/views/financialManagement/voucher/index.vue b/src/views/financialManagement/voucher/index.vue
index fb38a26..4b41202 100644
--- a/src/views/financialManagement/voucher/index.vue
+++ b/src/views/financialManagement/voucher/index.vue
@@ -65,6 +65,7 @@
</template>
<template #operation="{ row }">
<el-button type="primary" link @click="view(row)">鏌ョ湅</el-button>
+ <el-button type="primary" link @click="exportVoucher(row)">瀵煎嚭</el-button>
<el-button type="primary" link @click="edit(row)" v-if="canEditVoucher(row.status)">缂栬緫</el-button>
<el-button type="success" link @click="handlePost(row)" v-if="canEditVoucher(row.status)">杩囪处</el-button>
<el-button type="danger" link @click="handleCancel(row)" v-if="canEditVoucher(row.status)">浣滃簾</el-button>
@@ -267,6 +268,7 @@
<script setup>
import { ref, reactive, onMounted, computed, nextTick } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
+import { saveAs } from "file-saver";
import FormDialog from "@/components/Dialog/FormDialog.vue";
import AttachmentUploadFile from "@/components/AttachmentUpload/file/index.vue";
import FileList from "@/components/Dialog/FileList.vue";
@@ -283,6 +285,7 @@
cancelVoucher,
getVoucherDetail,
} from "@/api/financialManagement/voucher";
+import { buildVoucherDocxBlob, buildVoucherFileName } from "./voucherExport";
defineOptions({
name: "鍑瘉绠$悊",
@@ -312,7 +315,7 @@
{ label: "璐锋柟閲戦", prop: "credit", dataType: "slot", slot: "credit" },
{ label: "鍒跺崟浜�", prop: "creator", width: "100" },
{ label: "鐘舵��", prop: "status", dataType: "slot", slot: "status" },
- { label: "鎿嶄綔", prop: "operation", dataType: "slot", slot: "operation", width: "220", fixed: "right" },
+ { label: "鎿嶄綔", prop: "operation", dataType: "slot", slot: "operation", width: "280", fixed: "right" },
];
const dataList = ref([]);
@@ -720,6 +723,19 @@
ElMessage.info("瀵煎叆鍔熻兘");
};
+// 瀵煎嚭閫変腑鍑瘉鐨勬槑缁嗗垎褰曪紙Word锛岀増闈笌浼氳鍑瘉妯℃澘涓�鑷达級
+const exportVoucher = async (row) => {
+ try {
+ const { data } = await getVoucherDetail(row.id);
+ const detail = data || row;
+ saveAs(buildVoucherDocxBlob(detail), buildVoucherFileName(detail));
+ ElMessage.success("瀵煎嚭鎴愬姛");
+ } catch (error) {
+ console.error(error);
+ ElMessage.error("瀵煎嚭澶辫触锛岃绋嶅悗閲嶈瘯");
+ }
+};
+
const handleOut = () => {
ElMessage.success("瀵煎嚭鎴愬姛");
};
--
Gitblit v1.9.3