From 9aae2af6f3937a7d99ec619b51f457002cef969f Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 03 十一月 2025 14:29:37 +0800
Subject: [PATCH] 档案管理-添加导出功能
---
src/views/collaborativeApproval/approvalProcess/index.vue | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 52 insertions(+), 5 deletions(-)
diff --git a/src/views/collaborativeApproval/approvalProcess/index.vue b/src/views/collaborativeApproval/approvalProcess/index.vue
index 79f358b..13e155b 100644
--- a/src/views/collaborativeApproval/approvalProcess/index.vue
+++ b/src/views/collaborativeApproval/approvalProcess/index.vue
@@ -25,7 +25,7 @@
</div>
<div>
<el-button type="primary" @click="openForm('add')">鏂板</el-button>
-<!-- <el-button @click="handleOut">瀵煎嚭</el-button>-->
+ <el-button @click="handleOut">瀵煎嚭</el-button>
<el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
</div>
</div>
@@ -42,12 +42,14 @@
:total="page.total"
></PIMTable>
</div>
- <info-form-dia ref="infoFormDia" @close="handleQuery"></info-form-dia>
+ <info-form-dia ref="infoFormDia" @close="handleQuery" :approveType="approveType"></info-form-dia>
<approval-dia ref="approvalDia" @close="handleQuery"></approval-dia>
+ <FileList ref="fileListRef" />
</div>
</template>
<script setup>
+import FileList from "./fileList.vue";
import { Search } from "@element-plus/icons-vue";
import {onMounted, ref} from "vue";
import {ElMessageBox} from "element-plus";
@@ -55,6 +57,15 @@
import ApprovalDia from "@/views/collaborativeApproval/approvalProcess/components/approvalDia.vue";
import {approveProcessDelete, approveProcessListPage} from "@/api/collaborativeApproval/approvalProcess.js";
import useUserStore from "@/store/modules/user";
+
+// 瀹氫箟缁勪欢鎺ユ敹鐨刾rops
+const props = defineProps({
+ approveType: {
+ type: [Number, String],
+ default: 0
+ }
+});
+
const userStore = useUserStore();
@@ -116,11 +127,12 @@
{
label: "鐢宠浜�",
prop: "approveUserName",
+ width: 120
},
{
label: "鐢宠鏃ユ湡",
prop: "approveTime",
- width: 120
+ width: 200
},
{
label: "缁撴潫鏃ユ湡",
@@ -137,7 +149,7 @@
label: "鎿嶄綔",
align: "center",
fixed: "right",
- width: 150,
+ width: 230,
operation: [
{
name: "缂栬緫",
@@ -162,6 +174,13 @@
openApprovalDia('view', row);
},
},
+ {
+ name: "闄勪欢",
+ type: "text",
+ clickFun: (row) => {
+ downLoadFile(row);
+ },
+ },
],
},
]);
@@ -183,6 +202,11 @@
page.current = 1;
getList();
};
+const fileListRef = ref(null)
+const downLoadFile = (row) => {
+ fileListRef.value.open(row.commonFileList)
+
+}
const pagination = (obj) => {
page.current = obj.page;
page.size = obj.limit;
@@ -190,7 +214,7 @@
};
const getList = () => {
tableLoading.value = true;
- approveProcessListPage({...page, ...searchForm.value,}).then(res => {
+ approveProcessListPage({...page, ...searchForm.value,approveType:props.approveType}).then(res => {
tableLoading.value = false;
tableData.value = res.data.records
page.total = res.data.total;
@@ -198,6 +222,29 @@
tableLoading.value = false;
})
};
+// 瀵煎嚭
+const handleOut = () => {
+ const type = Number(props.approveType || 0)
+ const urlMap = {
+ 0: "/approveProcess/exportZero",
+ 1: "/approveProcess/exportOne",
+ 2: "/approveProcess/exportTwo",
+ 3: "/approveProcess/exportThree",
+ 4: "/approveProcess/exportFour",
+ 5: "/approveProcess/exportFive",
+ }
+ const url = urlMap[type] || urlMap[0]
+ const nameMap = {
+ 0: "鍗忓悓瀹℃壒绠$悊琛�",
+ 1: "鍏嚭绠$悊瀹℃壒琛�",
+ 2: "璇峰亣绠$悊瀹℃壒琛�",
+ 3: "鍑哄樊绠$悊瀹℃壒琛�",
+ 4: "鎶ラ攢绠$悊瀹℃壒琛�",
+ 5: "閲囪喘鐢宠瀹℃壒琛�",
+ }
+ const fileName = nameMap[type] || nameMap[0]
+ proxy.download(url, {}, `${fileName}.xlsx`)
+}
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = (selection) => {
selectedRows.value = selection;
--
Gitblit v1.9.3