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 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> <script setup>
import {reportPage,recessedData} from '@/api/entryWindow/index' import {reportPage,recessedData, excelEntryWindowList} from '@/api/entryWindow/index'
import useCatchStore from "@/stores/modules/catch"; import useCatchStore from "@/stores/modules/catch";
import {listPolice} from "@/api/system/police"; import {listPolice} from "@/api/system/police";
import {timeFormat} from "@/utils/util"; import {timeFormat} from "@/utils/util";
@ -13,14 +13,29 @@ const uid = userStore.user.userName;
const dict = catchStore.getDicts(["procurementMethod"]); const dict = catchStore.getDicts(["procurementMethod"]);
const tableData = ref([]) const tableData = ref([])
const ressDialog =ref(false) 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 })) 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, current: 1,
size: 10, size: 10,
code:'all', code:'all',
nodeList: [], nodeList: [],
auditLevel: '' auditLevel: ''
}) })
let query = ref(createDefaultQuery())
let showRecord =ref(false) let showRecord =ref(false)
let total = ref(10) let total = ref(10)
let loading =ref(false) let loading =ref(false)
@ -82,9 +97,21 @@ const showRecordClose = ()=>{
showRecord.value=false showRecord.value=false
} }
const syncNodeListByTab = () => {
const allowedNodes = stageNodeMap[activeTab.value]
if (!allowedNodes) {
query.value.nodeList = []
return
}
query.value.nodeList = [...allowedNodes]
}
const handleClick =(val)=>{ const handleClick =(tab)=>{
query.value.code=val.props.name; const tabName = tab.props.name;
activeTab.value = tabName;
query.value.current = 1;
query.value.code = tabName === 'recessed' ? '1' : 'all';
syncNodeListByTab()
getList() getList()
} }
@ -114,15 +141,23 @@ const getList =async ()=>{
total.value=res.total total.value=res.total
loading.value=false 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 =()=>{ const reset =()=>{
query.value = { query.value = createDefaultQuery();
current: 1, activeTab.value = 'all'
size: 10,
code:'all',
nodeList: [],
auditLevel: ''
};
getList(); getList();
} }
getList() getList()
@ -364,7 +399,7 @@ const isAdminShow = ()=>{
collapse-tags-tooltip collapse-tags-tooltip
> >
<el-option <el-option
v-for="item in currentNodeOptions" v-for="item in filteredNodeOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
@ -411,6 +446,7 @@ const isAdminShow = ()=>{
</el-form> </el-form>
<div class="flex end"> <div class="flex end">
<div> <div>
<el-button type="primary" :loading="exportLoading" @click="handleExcel">导出</el-button>
<el-button type="primary" @click="getList"> <el-button type="primary" @click="getList">
<template #icon> <template #icon>
<icon name="el-icon-Search"/> <icon name="el-icon-Search"/>
@ -423,10 +459,12 @@ const isAdminShow = ()=>{
</div> </div>
</header> </header>
<div class="table-container"> <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="all"></el-tab-pane>
<el-tab-pane label="进窗" name="0"></el-tab-pane> <el-tab-pane label="待受理" name="pending"></el-tab-pane>
<el-tab-pane label="退窗" name="1"></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-tabs>
<el-table :data="tableData" v-loading="loading"> <el-table :data="tableData" v-loading="loading">
<el-table-column label="项目名称" prop="reportName" width="200" /> <el-table-column label="项目名称" prop="reportName" width="200" />

Loading…
Cancel
Save