From 3f3d35d6d6445f9cc90a8cf7bb496bee7f465542 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 06 一月 2026 17:12:09 +0800
Subject: [PATCH] fix: 会议管理页面合并
---
src/views/collaborativeApproval/approvalProcess/index.vue | 234 ++++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 153 insertions(+), 81 deletions(-)
diff --git a/src/views/collaborativeApproval/approvalProcess/index.vue b/src/views/collaborativeApproval/approvalProcess/index.vue
index c3b713e..d8a99dd 100644
--- a/src/views/collaborativeApproval/approvalProcess/index.vue
+++ b/src/views/collaborativeApproval/approvalProcess/index.vue
@@ -1,5 +1,14 @@
<template>
<div class="app-container">
+ <!-- 鏍囩椤靛垏鎹笉鍚岀殑瀹℃壒绫诲瀷 -->
+ <el-tabs v-model="activeTab" @tab-change="handleTabChange" class="approval-tabs">
+ <el-tab-pane label="鍏嚭绠$悊" name="1"></el-tab-pane>
+ <el-tab-pane label="璇峰亣绠$悊" name="2"></el-tab-pane>
+ <el-tab-pane label="鍑哄樊绠$悊" name="3"></el-tab-pane>
+ <el-tab-pane label="鎶ラ攢绠$悊" name="4"></el-tab-pane>
+ <el-tab-pane label="閲囪喘瀹℃壒" name="5"></el-tab-pane>
+ </el-tabs>
+
<div class="search_form">
<div>
<span class="search_title">娴佺▼缂栧彿锛�</span>
@@ -25,14 +34,14 @@
</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>
<div class="table_list">
<PIMTable
rowKey="id"
- :column="tableColumn"
+ :column="tableColumnCopy"
:tableData="tableData"
:page="page"
:isSelection="true"
@@ -42,7 +51,7 @@
:total="page.total"
></PIMTable>
</div>
- <info-form-dia ref="infoFormDia" @close="handleQuery" :approveType="approveType"></info-form-dia>
+ <info-form-dia ref="infoFormDia" @close="handleQuery" :approveType="currentApproveType"></info-form-dia>
<approval-dia ref="approvalDia" @close="handleQuery"></approval-dia>
<FileList ref="fileListRef" />
</div>
@@ -51,22 +60,31 @@
<script setup>
import FileList from "./fileList.vue";
import { Search } from "@element-plus/icons-vue";
-import {onMounted, ref} from "vue";
+import {onMounted, ref, computed, reactive, toRefs, nextTick, getCurrentInstance} from "vue";
import {ElMessageBox} from "element-plus";
import InfoFormDia from "@/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue";
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 activeTab = ref('1');
+
+// 褰撳墠瀹℃壒绫诲瀷锛屾牴鎹�変腑鐨勬爣绛鹃〉璁$畻
+const currentApproveType = computed(() => {
+ return Number(activeTab.value);
});
-const userStore = useUserStore();
+// 鏍囩椤靛垏鎹㈠鐞�
+const handleTabChange = (tabName) => {
+ // 鍒囨崲鏍囩椤垫椂閲嶇疆鎼滅储鏉′欢鍜屽垎椤碉紝骞堕噸鏂板姞杞芥暟鎹�
+ searchForm.value.approveId = '';
+ searchForm.value.approveStatus = '';
+ page.current = 1;
+ getList();
+};
const data = reactive({
@@ -76,75 +94,100 @@
},
});
const { searchForm } = toRefs(data);
-const tableColumn = ref([
- {
- label: "瀹℃壒鐘舵��",
- prop: "approveStatus",
- dataType: "tag",
- width: 100,
- formatData: (params) => {
- if (params == 0) {
- return "寰呭鏍�";
- } else if (params == 1) {
- return "瀹℃牳涓�";
- } else if (params == 2) {
- return "瀹℃牳瀹屾垚";
- } else if (params == 4) {
- return "宸查噸鏂版彁浜�";
- } else {
- return '涓嶉�氳繃';
- }
+
+// 鍔ㄦ�佽〃鏍煎垪閰嶇疆锛屾牴鎹鎵圭被鍨嬬敓鎴愬垪
+const tableColumnCopy = computed(() => {
+ const isLeaveType = currentApproveType.value === 2; // 璇峰亣绠$悊
+ const isReimburseType = currentApproveType.value === 4; // 鎶ラ攢绠$悊
+
+ // 鍩虹鍒楅厤缃�
+ const baseColumns = [
+ {
+ label: "瀹℃壒鐘舵��",
+ prop: "approveStatus",
+ dataType: "tag",
+ width: 100,
+ formatData: (params) => {
+ if (params == 0) {
+ return "寰呭鏍�";
+ } else if (params == 1) {
+ return "瀹℃牳涓�";
+ } else if (params == 2) {
+ return "瀹℃牳瀹屾垚";
+ } else if (params == 4) {
+ return "宸查噸鏂版彁浜�";
+ } else {
+ return '涓嶉�氳繃';
+ }
+ },
+ formatType: (params) => {
+ if (params == 0) {
+ return "warning";
+ } else if (params == 1) {
+ return "primary";
+ } else if (params == 2) {
+ return "success";
+ } else if (params == 4) {
+ return "info";
+ } else {
+ return 'danger';
+ }
+ },
},
- formatType: (params) => {
- if (params == 0) {
- return "warning";
- } else if (params == 1) {
- return "primary";
- } else if (params == 2) {
- return "success";
- } else if (params == 4) {
- return "";
- } else {
- return 'danger';
- }
+ {
+ label: "娴佺▼缂栧彿",
+ prop: "approveId",
+ width: 170
},
- },
- {
- label: "娴佺▼缂栧彿",
- prop: "approveId",
- width: 170
- },
- {
- label: "鐢宠閮ㄩ棬",
- prop: "approveDeptName",
- width: 220
- },
- {
- label: "瀹℃壒浜嬬敱",
- prop: "approveReason",
- width: 200
- },
- {
- label: "鐢宠浜�",
- prop: "approveUserName",
- width: 120
- },
- {
- label: "鐢宠鏃ユ湡",
- prop: "approveTime",
- width: 200
- },
- {
- label: "缁撴潫鏃ユ湡",
- prop: "approveOverTime",
- width: 120
- },
- {
+ {
+ label: "鐢宠閮ㄩ棬",
+ prop: "approveDeptName",
+ width: 220
+ },
+ {
+ label: "瀹℃壒浜嬬敱",
+ prop: "approveReason",
+ width: 200
+ },
+ {
+ label: "鐢宠浜�",
+ prop: "approveUserName",
+ width: 120
+ }
+ ];
+
+ // 閲戦鍒楋紙浠呮姤閿�绠$悊鏄剧ず锛�
+ if (isReimburseType) {
+ baseColumns.push({
+ label: "閲戦锛堝厓锛�",
+ prop: "price",
+ width: 120
+ });
+ }
+
+ // 鏃ユ湡鍒楋紙鏍规嵁绫诲瀷鍔ㄦ�侀厤缃級
+ baseColumns.push(
+ {
+ label: isLeaveType ? "寮�濮嬫棩鏈�" : "鐢宠鏃ユ湡",
+ prop: isLeaveType ? "startDate" : "approveTime",
+ width: 200
+ },
+ {
+ label: "缁撴潫鏃ユ湡",
+ prop: isLeaveType ? "endDate" : "approveOverTime",
+ width: 120
+ }
+ );
+
+ // 褰撳墠瀹℃壒浜哄垪
+ baseColumns.push({
label: "褰撳墠瀹℃壒浜�",
prop: "approveUserCurrentName",
width: 120
- },
- {
+ });
+
+ // 鎿嶄綔鍒�
+ baseColumns.push({
dataType: "action",
label: "鎿嶄綔",
align: "center",
@@ -157,7 +200,7 @@
clickFun: (row) => {
openForm("edit", row);
},
- disabled: (row) => row.approveStatus == 2 || row.approveStatus == 1 || row.approveStatus == 4
+ disabled: (row) => row.approveStatus == 2 || row.approveStatus == 1 || row.approveStatus == 4
},
{
name: "瀹℃牳",
@@ -165,7 +208,7 @@
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: "璇︽儏",
@@ -182,8 +225,10 @@
},
},
],
- },
-]);
+ });
+
+ return baseColumns;
+});
const tableData = ref([]);
const selectedRows = ref([]);
const tableLoading = ref(false);
@@ -214,7 +259,7 @@
};
const getList = () => {
tableLoading.value = true;
- approveProcessListPage({...page, ...searchForm.value,approveType:props.approveType}).then(res => {
+ approveProcessListPage({...page, ...searchForm.value, approveType: currentApproveType.value}).then(res => {
tableLoading.value = false;
tableData.value = res.data.records
page.total = res.data.total;
@@ -222,6 +267,29 @@
tableLoading.value = false;
})
};
+// 瀵煎嚭
+const handleOut = () => {
+ const type = currentApproveType.value
+ 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;
@@ -269,4 +337,8 @@
});
</script>
-<style scoped></style>
+<style scoped>
+.approval-tabs {
+ margin-bottom: 10px;
+}
+</style>
--
Gitblit v1.9.3