From d66628e95a691fae99ca0e9ed9a47309a6486e84 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 31 十月 2025 13:43:31 +0800
Subject: [PATCH] 协同审批-添加导出功能
---
src/views/collaborativeApproval/approvalProcess/index.vue | 68 +++++++++++++++++++++++++++++++---
1 files changed, 62 insertions(+), 6 deletions(-)
diff --git a/src/views/collaborativeApproval/approvalProcess/index.vue b/src/views/collaborativeApproval/approvalProcess/index.vue
index 9398a1b..13e155b 100644
--- a/src/views/collaborativeApproval/approvalProcess/index.vue
+++ b/src/views/collaborativeApproval/approvalProcess/index.vue
@@ -11,13 +11,21 @@
clearable
:prefix-icon="Search"
/>
+ <span class="search_title ml10">瀹℃壒鐘舵�侊細</span>
+ <el-select v-model="searchForm.approveStatus" clearable @change="handleQuery" style="width: 240px">
+ <el-option label="寰呭鏍�" :value="0" />
+ <el-option label="瀹℃牳涓�" :value="1" />
+ <el-option label="瀹℃牳瀹屾垚" :value="2" />
+ <el-option label="瀹℃牳鏈�氳繃" :value="3" />
+ <el-option label="宸查噸鏂版彁浜�" :value="4" />
+ </el-select>
<el-button type="primary" @click="handleQuery" style="margin-left: 10px"
>鎼滅储</el-button
>
</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>
@@ -34,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";
@@ -47,12 +57,22 @@
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();
const data = reactive({
searchForm: {
approveId: "",
+ approveStatus: "",
},
});
const { searchForm } = toRefs(data);
@@ -107,11 +127,12 @@
{
label: "鐢宠浜�",
prop: "approveUserName",
+ width: 120
},
{
label: "鐢宠鏃ユ湡",
prop: "approveTime",
- width: 120
+ width: 200
},
{
label: "缁撴潫鏃ユ湡",
@@ -128,7 +149,7 @@
label: "鎿嶄綔",
align: "center",
fixed: "right",
- width: 150,
+ width: 230,
operation: [
{
name: "缂栬緫",
@@ -144,13 +165,20 @@
clickFun: (row) => {
openApprovalDia("approval", row);
},
- disabled: (row) => row.approveUserCurrentId == null || row.approveStatus == 2 || row.approveStatus == 3 || row.approveStatus == 4 || row.approveUsercurrentId !== userStore.id
+ disabled: (row) => row.approveUserCurrentId == null || row.approveStatus == 2 || row.approveStatus == 3 || row.approveStatus == 4 || row.approveUserCurrentId !== userStore.id
},
{
name: "璇︽儏",
type: "text",
clickFun: (row) => {
openApprovalDia('view', row);
+ },
+ },
+ {
+ name: "闄勪欢",
+ type: "text",
+ clickFun: (row) => {
+ downLoadFile(row);
},
},
],
@@ -174,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;
@@ -181,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;
@@ -189,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