!134 feat(fixcontact): 台账列表新增状态统计展示与按流程状态行着色
* feat(fixcontact): 台账列表新增状态统计展示与按流程状态行着色
This commit is contained in:
@@ -16,6 +16,7 @@ enum Api {
|
||||
checkExcelByEasyExcel = '/bg/fixcontact/fixedContact20260730/checkExcelByEasyExcel',
|
||||
queryById = '/bg/fixcontact/fixedContact20260730/queryById',
|
||||
fixedContactFeedbackList = '/bg/fixcontact/fixedContact20260730/queryFixedContactFeedback20260730ByMainId',
|
||||
statusStats = '/bg/fixcontact/fixedContact20260730/statusStats',
|
||||
}
|
||||
|
||||
export const getExportUrl = Api.exportXls;
|
||||
@@ -63,6 +64,9 @@ export const fixedContactFeedbackList = (params) => {
|
||||
return Promise.resolve([]);
|
||||
};
|
||||
|
||||
export const statusStats = (params) =>
|
||||
defHttp.get({ url: Api.statusStats, params });
|
||||
|
||||
const BpmApi = {
|
||||
saveBpmForm: '/bg/fixcontact/fixedContact20260730/saveBpmForm',
|
||||
setBpmVariableLocal: '/act/process/setBpmVariableLocal',
|
||||
|
||||
@@ -88,7 +88,14 @@
|
||||
</a-form>
|
||||
</div>
|
||||
<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>
|
||||
<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>
|
||||
@@ -111,6 +118,11 @@
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<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 #action="{ record }">
|
||||
<Dropdown :trigger="['hover']" :dropMenuList="getFlowMenuList(record)" popconfirm>
|
||||
@@ -172,7 +184,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref, h } from 'vue';
|
||||
import { reactive, ref, h, onMounted } from 'vue';
|
||||
import { BasicTable } from '/@/components/Table';
|
||||
import type { BasicColumn } from '/@/components/Table';
|
||||
import { Dropdown } from '/@/components/Dropdown';
|
||||
@@ -191,7 +203,7 @@
|
||||
import { startProcessSchedules } from '/@/api/common/api';
|
||||
import { dateUtil } from '/@/utils/dateUtil';
|
||||
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';
|
||||
|
||||
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 feedbackTableData = reactive<Record<string, Recordable[]>>({});
|
||||
const feedbackTableLoading = reactive<Record<string, boolean>>({});
|
||||
const statsData = reactive({ notStarted: 0, inProgress: 0, overdue: 0, completed: 0 });
|
||||
|
||||
const feedbackExpandColumns: BasicColumn[] = [...fixedContactFeedbackColumns];
|
||||
|
||||
@@ -354,10 +367,22 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
|
||||
return params;
|
||||
}
|
||||
|
||||
async function fetchStatusStats() {
|
||||
try {
|
||||
const res = await statusStats(getQueryParams());
|
||||
if (res) {
|
||||
Object.assign(statsData, res);
|
||||
}
|
||||
} catch (e) {
|
||||
// 状态统计失败不阻塞列表
|
||||
}
|
||||
}
|
||||
|
||||
function searchQuery() {
|
||||
selectedRowKeys.value = [];
|
||||
resetFeedbackExpand();
|
||||
reload({ page: 1 });
|
||||
fetchStatusStats();
|
||||
}
|
||||
|
||||
function clearQueryParams() {
|
||||
@@ -394,6 +419,7 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
|
||||
selectedRowKeys.value = [];
|
||||
resetFeedbackExpand();
|
||||
reload();
|
||||
fetchStatusStats();
|
||||
}
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
@@ -543,6 +569,7 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
|
||||
if (res.success) {
|
||||
createMessage.success(res.message || '删除流程成功');
|
||||
reload();
|
||||
fetchStatusStats();
|
||||
} else {
|
||||
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);
|
||||
createMessage.success('发起成功');
|
||||
reload();
|
||||
fetchStatusStats();
|
||||
}
|
||||
|
||||
const labelCol = reactive({
|
||||
@@ -671,7 +699,12 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
|
||||
selectedRowKeys.value = [];
|
||||
resetFeedbackExpand();
|
||||
reload({ page: 1 });
|
||||
fetchStatusStats();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchStatusStats();
|
||||
});
|
||||
</script>
|
||||
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user