| | |
| | | <!-- 弹窗组件 --> |
| | | <info-form-dia ref="infoFormDia" @close="handleQuery" :approveType="currentApproveType"></info-form-dia> |
| | | <approval-dia ref="approvalDia" @close="handleQuery" :approveType="currentApproveType"></approval-dia> |
| | | <FileList ref="fileListRef" /> |
| | | <FileList v-if="fileDialogVisible" |
| | | v-model:visible="fileDialogVisible" |
| | | record-type="approve_process" |
| | | :record-id="recordId" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import FileList from "./fileList.vue"; |
| | | import { Search, Plus, Delete, Download, RefreshRight, DocumentChecked } from "@element-plus/icons-vue"; |
| | | import {onMounted, ref, computed, reactive, toRefs, nextTick, getCurrentInstance} from "vue"; |
| | | import {onMounted, ref, computed, reactive, toRefs, nextTick, getCurrentInstance, defineAsyncComponent} from "vue"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import { useRoute } from 'vue-router'; |
| | | 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"; |
| | | const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue")); |
| | | |
| | | const userStore = useUserStore(); |
| | | const route = useRoute(); |
| | |
| | | // 动态表格列配置,根据审批类型生成列 |
| | | const tableColumnCopy = computed(() => { |
| | | const isLeaveType = currentApproveType.value === 2; // 请假管理 |
| | | const isBusinessTripType = currentApproveType.value === 3; // 出差管理 |
| | | const isReimburseType = currentApproveType.value === 4; // 报销管理 |
| | | const isQuotationType = currentApproveType.value === 6; // 报价审批 |
| | | const isPurchaseType = currentApproveType.value === 5; // 采购审批 |
| | |
| | | width: 120 |
| | | }); |
| | | } |
| | | |
| | | // 请假管理:开始日期 / 结束日期 |
| | | if (isLeaveType) { |
| | | baseColumns.push( |
| | | { label: "开始日期", prop: "startDate", width: 120 }, |
| | | { label: "结束日期", prop: "endDate", width: 120 } |
| | | ); |
| | | } |
| | | |
| | | // 日期列(根据类型动态配置) |
| | | baseColumns.push( |
| | | { |
| | | label: isLeaveType ? "开始日期" : "申请日期", |
| | | prop: isLeaveType ? "startDate" : "approveTime", |
| | | width: 200 |
| | | }, |
| | | { |
| | | label: "结束日期", |
| | | prop: isLeaveType ? "endDate" : "approveOverTime", |
| | | width: 120 |
| | | } |
| | | ); |
| | | // 出差管理:开始时间 / 结束时间(不含秒) |
| | | if (isBusinessTripType) { |
| | | baseColumns.push( |
| | | { |
| | | label: "开始时间", |
| | | prop: "startDateTime", |
| | | width: 180, |
| | | formatData: (val) => val ? val.substring(0, 16) : '' |
| | | }, |
| | | { |
| | | label: "结束时间", |
| | | prop: "endDateTime", |
| | | width: 180, |
| | | formatData: (val) => val ? val.substring(0, 16) : '' |
| | | } |
| | | ); |
| | | } |
| | | |
| | | // 当前审批人列 |
| | | baseColumns.push({ |
| | | label: "当前审批人", |
| | | prop: "approveUserCurrentName", |
| | | width: 120 |
| | | }); |
| | | |
| | | // 申请时间 - 所有类型都显示 |
| | | baseColumns.push({ |
| | | label: "申请时间", |
| | | prop: "approveTime", |
| | | width: 180, |
| | | }); |
| | | |
| | | // 审批时间 - 所有类型都显示 |
| | | baseColumns.push({ |
| | | label: "审批时间", |
| | | prop: "approveOverTime", |
| | | width: 180, |
| | | }); |
| | | |
| | | // 操作列 |
| | |
| | | name: "附件", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | downLoadFile(row); |
| | | openFilesFormDia(row); |
| | | }, |
| | | }); |
| | | } |
| | |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | const fileListRef = ref(null) |
| | | const downLoadFile = (row) => { |
| | | fileListRef.value.open(row.commonFileList) |
| | | |
| | | // 打开附件弹窗 |
| | | const recordId =ref(0) |
| | | const fileDialogVisible = ref(false) |
| | | |
| | | // 打开附件弹框 |
| | | const openFilesFormDia = async (row) => { |
| | | recordId.value = row.id |
| | | fileDialogVisible.value = true |
| | | } |
| | | |
| | | const pagination = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |