Files
tuanwei-admin/src/views/gxmu/WSHQTZBForm/index.vue
T
weicw 0444846422 feat(declare): 申报记录支持撤回/作废,导入支持跳过与失败清单
- 申报记录详情弹窗新增撤回、作废(强制放行)入口,覆盖 9 个模块
- 申报管理支持配置允许重复提交与最多同时条数
- 批量导入逐行容错,命中重复时跳过并给出失败清单导出
2026-11-02 19:28:56 +08:00

482 lines
12 KiB
Vue

<template>
<div class="page">
<div class="ele-body">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:scroll="{ x: 3600 }"
tool-class="ele-toolbar-form"
>
<template #toolbar>
<a-space>
<a-button
class="gxmu-toolbar-btn gxmu-add-btn"
@click="openEdit()"
>
<template #icon>
<plus-outlined />
</template>
<span>{{ props.popup ? '立即申报' : '添加' }}</span>
</a-button>
<a-button
v-if="!props.popup"
class="gxmu-toolbar-btn gxmu-import-btn"
@click="openImport"
>
<template #icon>
<UploadOutlined />
</template>
<span>导入</span>
</a-button>
<a-button
v-if="!props.popup"
class="gxmu-toolbar-btn"
:loading="exporting"
@click="exportData"
>
<template #icon>
<DownloadOutlined />
</template>
<span>导出</span>
</a-button>
<a-input-search
allow-clear
v-model:value="searchText"
placeholder="请输入团支部/书记/联系方式"
@search="reload"
@pressEnter="reload"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'currentReviewStatus'">
<ReviewStatusTag :review-list="record.reviewList" />
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openDetail(record)">详情</a>
<a-divider type="vertical" />
<template v-if="!shouldHideEditByReviewList(record.reviewList)">
<a @click="openEdit(record)">编辑</a>
<a-divider type="vertical" />
</template>
<a @click="openReviewHistory(record)">审核历史</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
</div>
<edit-modal
v-model:visible="showEdit"
:data="current"
:fixed-year="props.fixedYear"
@done="reload"
/>
<import-modal v-model:visible="showImport" @done="reload" />
<ModuleDataModal
v-model:visible="showDetail"
:module="REVIEW_MODULE"
module-name="五四红旗团支部"
:pk="detailCurrent?.id"
@done="reload"
/>
<ReviewHistoryModal
v-model:visible="showReviewHistory"
:module="REVIEW_MODULE"
:pk="reviewCurrent?.id"
:review-list="reviewCurrent?.reviewList"
/>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { message } from 'ant-design-vue';
import {
DownloadOutlined,
UploadOutlined,
PlusOutlined
} from '@ant-design/icons-vue';
import EditModal from './components/edit.vue';
import ImportModal from './components/import.vue';
import ReviewHistoryModal from '../components/reviewHistoryModal.vue';
import ModuleDataModal from '../reviewList/components/moduleDataModal.vue';
import ReviewStatusTag from '../components/reviewStatusTag.vue';
import { shouldHideEditByReviewList } from '../utils/review';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import {
exportWshqtzbForm,
userPageWshqtzbForm,
removeWshqtzbForm
} from '@/api/gxmu/wshqtzb-form';
import type {
WshqtzbForm,
WshqtzbFormParam
} from '@/api/gxmu/wshqtzb-form/model';
const props = withDefaults(
defineProps<{
popup?: boolean;
fixedYear?: string | number;
}>(),
{
popup: false
}
);
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
const searchText = ref('');
const showEdit = ref(false);
const showImport = ref(false);
const showDetail = ref(false);
const current = ref<WshqtzbForm>();
const detailCurrent = ref<WshqtzbForm | null>(null);
const REVIEW_MODULE = 'gxmu_wshqtzb';
const showReviewHistory = ref(false);
const reviewCurrent = ref<WshqtzbForm | null>(null);
const exporting = ref(false);
const columns = ref<ColumnItem[]>([
{
title: '团支部全称',
dataIndex: 'branchName',
key: 'branchName',
align: 'center',
width: 180
},
{
title: '年份',
dataIndex: 'year',
key: 'year',
align: 'center',
width: 100
},
{
title: '所属二级团组织',
dataIndex: 'secondOrg',
key: 'secondOrg',
align: 'center',
width: 180
},
{
title: '团支部书记',
dataIndex: 'secretary',
key: 'secretary',
align: 'center',
width: 120
},
{
title: '政治面貌',
dataIndex: 'politics',
key: 'politics',
align: 'center',
width: 120
},
{
title: '联系方式',
dataIndex: 'contact',
key: 'contact',
align: 'center',
width: 140
},
{
title: '成立时间',
dataIndex: 'establishTime',
key: 'establishTime',
align: 'center',
width: 120
},
{
title: '最近一次换届时间',
dataIndex: 'lastElectionTime',
key: 'lastElectionTime',
align: 'center',
width: 160
},
{
title: '本级是否已登录“智慧团建”系统',
dataIndex: 'smartSystemLogin',
key: 'smartSystemLogin',
align: 'center',
width: 200
},
{
title: '现有团员总数',
dataIndex: 'memberTotal',
key: 'memberTotal',
align: 'center',
width: 130
},
{
title: '上一年度发展团员数',
dataIndex: 'memberDeveloped2024',
key: 'memberDeveloped2024',
align: 'center',
width: 150
},
{
title: '上一年度应收团费',
dataIndex: 'feeReceivable2024',
key: 'feeReceivable2024',
align: 'center',
width: 130
},
{
title: '上一年度实收团费',
dataIndex: 'feeReceived2024',
key: 'feeReceived2024',
align: 'center',
width: 130
},
{
title: '上一年度应上缴团费',
dataIndex: 'feePayable2024',
key: 'feePayable2024',
align: 'center',
width: 140
},
{
title: '上一年度实际上缴团费',
dataIndex: 'feePaid2024',
key: 'feePaid2024',
align: 'center',
width: 150
},
{
title: '推荐优秀团员作入党积极分子人数(上一年度)',
dataIndex: 'recommendActivist2024',
key: 'recommendActivist2024',
align: 'center',
width: 240
},
{
title: '其中被党组织确定为入党积极分子数',
dataIndex: 'activistConfirmed',
key: 'activistConfirmed',
align: 'center',
width: 220
},
{
title: '推荐优秀团员作党的发展对象人数(上一年度)',
dataIndex: 'recommendDevTarget2024',
key: 'recommendDevTarget2024',
align: 'center',
width: 240
},
{
title: '其中被党组织确定为党的发展对象数',
dataIndex: 'devTargetConfirmed',
key: 'devTargetConfirmed',
align: 'center',
width: 220
},
{
title: '团支部委员会会议召开次数',
dataIndex: 'branchCommitteeMeetingCount',
key: 'branchCommitteeMeetingCount',
align: 'center',
width: 200
},
{
title: '团支部团员大会召开次数',
dataIndex: 'branchMemberMeetingCount',
key: 'branchMemberMeetingCount',
align: 'center',
width: 200
},
{
title: '是否开展团员教育评议',
dataIndex: 'eduEvalDone',
key: 'eduEvalDone',
align: 'center',
width: 170
},
{
title: '是否开展团员年度团籍注册',
dataIndex: 'annualRegDone',
key: 'annualRegDone',
align: 'center',
width: 200
},
{
title: '开展团课次数',
dataIndex: 'classCount',
key: 'classCount',
align: 'center',
width: 130
},
{
title: '是否100%录入“智慧团建”',
dataIndex: 'smartSystem100',
key: 'smartSystem100',
align: 'center',
width: 200
},
{
title: '近五年获得院级及以上荣誉情况',
dataIndex: 'honorsFiveYears',
key: 'honorsFiveYears',
align: 'center',
width: 240,
ellipsis: true
},
{
title: '近三年开展的主要工作及取得的效果',
dataIndex: 'workSummaryThreeYears',
key: 'workSummaryThreeYears',
align: 'center',
width: 260,
ellipsis: true
},
{
title: '所在二级团组织意见',
dataIndex: 'leagueOpinion',
key: 'leagueOpinion',
align: 'center',
width: 200,
ellipsis: true
},
{
title: '所在单位党组织意见',
dataIndex: 'partyOpinion',
key: 'partyOpinion',
align: 'center',
width: 200,
ellipsis: true
},
{
title: '校团委意见',
dataIndex: 'schoolOpinion',
key: 'schoolOpinion',
align: 'center',
width: 200,
ellipsis: true
},
{
title: '当前审核状态',
dataIndex: 'reviewList',
key: 'currentReviewStatus',
align: 'center',
width: 140
},
{
title: '操作',
key: 'action',
fixed: 'right',
align: 'center',
width: 220
}
]);
const datasource: DatasourceFunction = ({ page, limit }) => {
return userPageWshqtzbForm({
page,
limit,
year: props.fixedYear ? String(props.fixedYear) : undefined,
keywords: searchText.value.trim() || undefined
} as WshqtzbFormParam).catch((e) => {
message.error(e.message);
return { list: [], count: 0 };
});
};
const buildQueryParams = (): WshqtzbFormParam => {
return {
year: props.fixedYear ? String(props.fixedYear) : undefined,
keywords: searchText.value.trim() || undefined
} as WshqtzbFormParam;
};
const reload = () => {
tableRef.value?.reload();
};
const openImport = () => {
showImport.value = true;
};
const resolveExportUrl = (payload: any) => {
return String(
payload?.url || payload?.downloadUrl || payload?.path || ''
);
};
const exportData = async () => {
if (exporting.value) {
return;
}
exporting.value = true;
const hide = message.loading('导出中..', 0);
try {
const result = await exportWshqtzbForm(buildQueryParams());
const url = resolveExportUrl(result);
if (!url) {
throw new Error('导出地址缺失');
}
window.open(url, '_blank');
hide();
message.success('导出成功');
} catch (e: any) {
hide();
message.error(e.message || '导出失败');
} finally {
exporting.value = false;
}
};
const openEdit = (record?: WshqtzbForm) => {
current.value = record
? (JSON.parse(JSON.stringify(record)) as WshqtzbForm)
: undefined;
showEdit.value = true;
};
const openReviewHistory = (record: WshqtzbForm) => {
reviewCurrent.value = record;
showReviewHistory.value = true;
};
const openDetail = (record: WshqtzbForm) => {
detailCurrent.value = record;
showDetail.value = true;
};
const remove = (record: WshqtzbForm) => {
const hide = message.loading('请求中..', 0);
removeWshqtzbForm(record.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
</script>
<script lang="ts">
export default {
name: 'WSHQTZBForm'
};
</script>
<style lang="less" scoped>
@import '../toolbar.less';
</style>