Compare commits

...

2 Commits

  1. 10
      src/api/entryWindow/index.ts
  2. 68
      src/views/entryWindow/index.vue

10
src/api/entryWindow/index.ts

@ -11,3 +11,13 @@ export const recessedData=(body)=>{
body
})
}
export const excelEntryWindowList = (body) => {
return request.post({
url: '/reportProject/excelEntryWindowList',
body,
config: {
excelName: '进退窗项目列表.xlsx'
},
showErrorMsg: true
})
}

68
src/views/entryWindow/index.vue

@ -1,5 +1,5 @@
<script setup>
import {reportPage,recessedData} from '@/api/entryWindow/index'
import {reportPage,recessedData, excelEntryWindowList} from '@/api/entryWindow/index'
import useCatchStore from "@/stores/modules/catch";
import {listPolice} from "@/api/system/police";
import {timeFormat} from "@/utils/util";
@ -13,14 +13,29 @@ const uid = userStore.user.userName;
const dict = catchStore.getDicts(["procurementMethod"]);
const tableData = ref([])
const ressDialog =ref(false)
const activeTab = ref('all')
const exportLoading = ref(false)
const stageNodeMap = {
pending: ['initial', 'review'],
auditing: ['first', 'second', 'third', 'Lead'],
issued: ['original', 'audit', 'end']
}
const currentNodeOptions = Object.entries(FlowNodeEnum).map(([value, label]) => ({ value, label }))
let query = ref({
const filteredNodeOptions = computed(() => {
const allowedNodes = stageNodeMap[activeTab.value]
if (!allowedNodes) {
return currentNodeOptions
}
return currentNodeOptions.filter(item => allowedNodes.includes(item.value))
})
const createDefaultQuery = () => ({
current: 1,
size: 10,
code:'all',
nodeList: [],
auditLevel: ''
})
let query = ref(createDefaultQuery())
let showRecord =ref(false)
let total = ref(10)
let loading =ref(false)
@ -82,9 +97,21 @@ const showRecordClose = ()=>{
showRecord.value=false
}
const syncNodeListByTab = () => {
const allowedNodes = stageNodeMap[activeTab.value]
if (!allowedNodes) {
query.value.nodeList = []
return
}
query.value.nodeList = [...allowedNodes]
}
const handleClick =(val)=>{
query.value.code=val.props.name;
const handleClick =(tab)=>{
const tabName = tab.props.name;
activeTab.value = tabName;
query.value.current = 1;
query.value.code = tabName === 'recessed' ? '1' : 'all';
syncNodeListByTab()
getList()
}
@ -114,15 +141,23 @@ const getList =async ()=>{
total.value=res.total
loading.value=false
}
const handleExcel = async ()=>{
if (exportLoading.value) return;
try {
exportLoading.value = true;
await excelEntryWindowList(query.value);
} catch (e) {
console.error('导出失败', e);
feedback.msgError("导出失败");
} finally {
exportLoading.value = false;
}
}
//
const reset =()=>{
query.value = {
current: 1,
size: 10,
code:'all',
nodeList: [],
auditLevel: ''
};
query.value = createDefaultQuery();
activeTab.value = 'all'
getList();
}
getList()
@ -364,7 +399,7 @@ const isAdminShow = ()=>{
collapse-tags-tooltip
>
<el-option
v-for="item in currentNodeOptions"
v-for="item in filteredNodeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
@ -411,6 +446,7 @@ const isAdminShow = ()=>{
</el-form>
<div class="flex end">
<div>
<el-button type="primary" :loading="exportLoading" @click="handleExcel">导出</el-button>
<el-button type="primary" @click="getList">
<template #icon>
<icon name="el-icon-Search"/>
@ -423,10 +459,12 @@ const isAdminShow = ()=>{
</div>
</header>
<div class="table-container">
<el-tabs v-model="query.code" @tab-click="handleClick">
<el-tabs v-model="activeTab" @tab-click="handleClick">
<el-tab-pane label="全部" name="all"></el-tab-pane>
<el-tab-pane label="进窗" name="0"></el-tab-pane>
<el-tab-pane label="退窗" name="1"></el-tab-pane>
<el-tab-pane label="待受理" name="pending"></el-tab-pane>
<el-tab-pane label="审计中" name="auditing"></el-tab-pane>
<el-tab-pane label="已发文" name="issued"></el-tab-pane>
<el-tab-pane label="退窗" name="recessed"></el-tab-pane>
</el-tabs>
<el-table :data="tableData" v-loading="loading">
<el-table-column label="项目名称" prop="reportName" width="200" />

Loading…
Cancel
Save