!134 feat(fixcontact): 台账列表新增状态统计展示与按流程状态行着色

* feat(fixcontact): 台账列表新增状态统计展示与按流程状态行着色
This commit is contained in:
wsm
2026-08-04 02:58:06 +00:00
parent 87c18efaeb
commit efeaecbdfd
2 changed files with 50 additions and 3 deletions
@@ -16,6 +16,7 @@ enum Api {
checkExcelByEasyExcel = '/bg/fixcontact/fixedContact20260730/checkExcelByEasyExcel', checkExcelByEasyExcel = '/bg/fixcontact/fixedContact20260730/checkExcelByEasyExcel',
queryById = '/bg/fixcontact/fixedContact20260730/queryById', queryById = '/bg/fixcontact/fixedContact20260730/queryById',
fixedContactFeedbackList = '/bg/fixcontact/fixedContact20260730/queryFixedContactFeedback20260730ByMainId', fixedContactFeedbackList = '/bg/fixcontact/fixedContact20260730/queryFixedContactFeedback20260730ByMainId',
statusStats = '/bg/fixcontact/fixedContact20260730/statusStats',
} }
export const getExportUrl = Api.exportXls; export const getExportUrl = Api.exportXls;
@@ -63,6 +64,9 @@ export const fixedContactFeedbackList = (params) => {
return Promise.resolve([]); return Promise.resolve([]);
}; };
export const statusStats = (params) =>
defHttp.get({ url: Api.statusStats, params });
const BpmApi = { const BpmApi = {
saveBpmForm: '/bg/fixcontact/fixedContact20260730/saveBpmForm', saveBpmForm: '/bg/fixcontact/fixedContact20260730/saveBpmForm',
setBpmVariableLocal: '/act/process/setBpmVariableLocal', setBpmVariableLocal: '/act/process/setBpmVariableLocal',
@@ -88,7 +88,14 @@
</a-form> </a-form>
</div> </div>
<div class="content"> <div class="content">
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expandedRowKeys="expandedRowKeys" @expand="handleExpand" :expandIcon="expandIcon"> <BasicTable
@register="registerTable"
:rowSelection="rowSelection"
:expandedRowKeys="expandedRowKeys"
@expand="handleExpand"
:expandIcon="expandIcon"
:rowClassName="(r) => (r.bpmStatus ? 'status-row-' + r.bpmStatus : '')"
>
<template #tableTitle> <template #tableTitle>
<a-button type="primary" v-auth="actionAuth.add" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> <a-button type="primary" v-auth="actionAuth.add" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="actionAuth.exportXls" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> <a-button type="primary" v-auth="actionAuth.exportXls" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
@@ -111,6 +118,11 @@
</a-button> </a-button>
</a-dropdown> </a-dropdown>
<super-query :config="superQueryConfig" @search="handleSuperQuery" /> <super-query :config="superQueryConfig" @search="handleSuperQuery" />
<a-space style="float: right; font-size: 14px; font-weight: bold">
<a-tag color="warning" style="color: #8c6900">未开始 {{ statsData.notStarted }}</a-tag>
<a-tag color="error">督办中 {{ statsData.inProgress }}已逾期 {{ statsData.overdue }}</a-tag>
<a-tag color="success">已完成 {{ statsData.completed }}</a-tag>
</a-space>
</template> </template>
<template #action="{ record }"> <template #action="{ record }">
<Dropdown :trigger="['hover']" :dropMenuList="getFlowMenuList(record)" popconfirm> <Dropdown :trigger="['hover']" :dropMenuList="getFlowMenuList(record)" popconfirm>
@@ -172,7 +184,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { reactive, ref, h } from 'vue'; import { reactive, ref, h, onMounted } from 'vue';
import { BasicTable } from '/@/components/Table'; import { BasicTable } from '/@/components/Table';
import type { BasicColumn } from '/@/components/Table'; import type { BasicColumn } from '/@/components/Table';
import { Dropdown } from '/@/components/Dropdown'; import { Dropdown } from '/@/components/Dropdown';
@@ -191,7 +203,7 @@
import { startProcessSchedules } from '/@/api/common/api'; import { startProcessSchedules } from '/@/api/common/api';
import { dateUtil } from '/@/utils/dateUtil'; import { dateUtil } from '/@/utils/dateUtil';
import { columns, superQuerySchema, fixedContactFeedbackColumns } from './FixedContact20260730.data'; import { columns, superQuerySchema, fixedContactFeedbackColumns } from './FixedContact20260730.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, getExportXlsHeadersUrl, getImportExcelByEasyExcelUrl, getCheckExcelByEasyExcelUrl, fixedContactFeedbackList, saveOrUpdate, withDrawFixContact } from './FixedContact20260730.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, getExportXlsHeadersUrl, getImportExcelByEasyExcelUrl, getCheckExcelByEasyExcelUrl, fixedContactFeedbackList, saveOrUpdate, withDrawFixContact, statusStats } from './FixedContact20260730.api';
import { showImportValidationErrors } from '/@/utils/helper/importError'; import { showImportValidationErrors } from '/@/utils/helper/importError';
function expandIcon({ expanded, onExpand, record }: { expanded: boolean; onExpand: Function; record: Recordable }) { function expandIcon({ expanded, onExpand, record }: { expanded: boolean; onExpand: Function; record: Recordable }) {
@@ -236,6 +248,7 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
const expandedRowKeys = ref<Array<string | number>>([]); const expandedRowKeys = ref<Array<string | number>>([]);
const feedbackTableData = reactive<Record<string, Recordable[]>>({}); const feedbackTableData = reactive<Record<string, Recordable[]>>({});
const feedbackTableLoading = reactive<Record<string, boolean>>({}); const feedbackTableLoading = reactive<Record<string, boolean>>({});
const statsData = reactive({ notStarted: 0, inProgress: 0, overdue: 0, completed: 0 });
const feedbackExpandColumns: BasicColumn[] = [...fixedContactFeedbackColumns]; const feedbackExpandColumns: BasicColumn[] = [...fixedContactFeedbackColumns];
@@ -354,10 +367,22 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
return params; return params;
} }
async function fetchStatusStats() {
try {
const res = await statusStats(getQueryParams());
if (res) {
Object.assign(statsData, res);
}
} catch (e) {
// 状态统计失败不阻塞列表
}
}
function searchQuery() { function searchQuery() {
selectedRowKeys.value = []; selectedRowKeys.value = [];
resetFeedbackExpand(); resetFeedbackExpand();
reload({ page: 1 }); reload({ page: 1 });
fetchStatusStats();
} }
function clearQueryParams() { function clearQueryParams() {
@@ -394,6 +419,7 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
selectedRowKeys.value = []; selectedRowKeys.value = [];
resetFeedbackExpand(); resetFeedbackExpand();
reload(); reload();
fetchStatusStats();
} }
const { createMessage } = useMessage(); const { createMessage } = useMessage();
@@ -543,6 +569,7 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
if (res.success) { if (res.success) {
createMessage.success(res.message || '删除流程成功'); createMessage.success(res.message || '删除流程成功');
reload(); reload();
fetchStatusStats();
} else { } else {
createMessage.error(res.message || '删除流程失败'); createMessage.error(res.message || '删除流程失败');
} }
@@ -595,6 +622,7 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
await saveOrUpdate({ id: record.id, bpmStatus: '2', superviseCount: nextSuperviseCount, isNeedAppro: options.isNeedAppro ?? record.isNeedAppro ?? '0', supDeptleaderid: options.supDeptleaderid ?? record.supDeptleaderid ?? '' }, true); await saveOrUpdate({ id: record.id, bpmStatus: '2', superviseCount: nextSuperviseCount, isNeedAppro: options.isNeedAppro ?? record.isNeedAppro ?? '0', supDeptleaderid: options.supDeptleaderid ?? record.supDeptleaderid ?? '' }, true);
createMessage.success('发起成功'); createMessage.success('发起成功');
reload(); reload();
fetchStatusStats();
} }
const labelCol = reactive({ const labelCol = reactive({
@@ -671,7 +699,12 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
selectedRowKeys.value = []; selectedRowKeys.value = [];
resetFeedbackExpand(); resetFeedbackExpand();
reload({ page: 1 }); reload({ page: 1 });
fetchStatusStats();
} }
onMounted(() => {
fetchStatusStats();
});
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@@ -792,4 +825,14 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
} }
} }
} }
:deep(.status-row-1 td) {
background: #fffbe6 !important;
}
:deep(.status-row-2 td) {
background: #fff1f0 !important;
}
:deep(.status-row-3 td) {
background: #f6ffed !important;
}
</style> </style>