!149 chore(docs): 忽略 localDocs 本地文档目录
* chore(docs): 忽略 localDocs 本地文档目录 * fix(inspectTask): 发起销号流程入口常显并移除状态调整菜单 * fix(xispeak): 督办状态结合反馈闭环实时推导
This commit is contained in:
@@ -474,17 +474,30 @@ import { PARTY_COMMITTEE_DEPT_ID, SDW_LEADER_ROLE_ID } from '/@/constant/supervi
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量刷新督办状态:以关联流程实时推导结果为准(无流程=未开始,有运行=督办中,全部结束=已完成)
|
||||
* 批量刷新督办状态:流程状态与督办事项(反馈)闭环情况合并推导
|
||||
* 规则:运行中的流程始终督办中;有督办事项时全部闭环=已完成、有未闭环=督办中;无督办事项以流程状态为准
|
||||
*/
|
||||
async function refreshSuperviseStatus(records) {
|
||||
const ids = collectAllIds(records).filter((id) => !String(id).includes('loadChild'));
|
||||
if (ids.length === 0) return;
|
||||
try {
|
||||
const results = await Promise.allSettled(ids.map((id) => getBusinessStatus({ businessId: id })));
|
||||
const [statusResults, countsRes] = await Promise.all([
|
||||
Promise.allSettled(ids.map((id) => getBusinessStatus({ businessId: id }))),
|
||||
queryFeedbackCounts({ ids: ids.join(',') }),
|
||||
]);
|
||||
const countsMap = countsRes || {};
|
||||
const statusMap: Record<string, string> = {};
|
||||
results.forEach((res, index) => {
|
||||
if (res.status === 'fulfilled' && res.value && res.value.status) {
|
||||
statusMap[ids[index]] = res.value.status;
|
||||
statusResults.forEach((res, index) => {
|
||||
const id = ids[index];
|
||||
let status = res.status === 'fulfilled' && res.value && res.value.status ? res.value.status : undefined;
|
||||
const counts = countsMap[id];
|
||||
if (counts && Number(counts.total) > 0) {
|
||||
if (status !== '2') {
|
||||
status = Number(counts.closed) >= Number(counts.total) ? '3' : '2';
|
||||
}
|
||||
}
|
||||
if (status) {
|
||||
statusMap[id] = status;
|
||||
}
|
||||
});
|
||||
const updateFn = (list) => {
|
||||
|
||||
Reference in New Issue
Block a user