!85 feat(xispeak): 用业务状态列替换完成状态列,修正dataIndex对齐接口
* feat(xispeak): 用业务状态列替换完成状态列,修正dataIndex对齐接口 * fix(xispeak): 修复业务状态字段取值与列dataIndex不匹配 * feat(xispeak): 台账列表新增业务状态字段
This commit is contained in:
@@ -21,6 +21,7 @@ enum Api {
|
|||||||
deletePendingTask = '/tasktask/taskTask/deletePendingTask',
|
deletePendingTask = '/tasktask/taskTask/deletePendingTask',
|
||||||
updateTitleAndDeadline = '/tasktask/taskTask/updateTitleAndDeadline',
|
updateTitleAndDeadline = '/tasktask/taskTask/updateTitleAndDeadline',
|
||||||
currentNodeInfo = '/act/task/currentNodeInfo',
|
currentNodeInfo = '/act/task/currentNodeInfo',
|
||||||
|
getBusinessStatus = '/tasktask/taskTask/getBusinessStatus',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -209,6 +210,12 @@ export const updateTitleAndDeadline = (params) => {
|
|||||||
*/
|
*/
|
||||||
export const queryCurrentNodeInfo = (params) => defHttp.get({ url: Api.currentNodeInfo, params });
|
export const queryCurrentNodeInfo = (params) => defHttp.get({ url: Api.currentNodeInfo, params });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询业务状态(单条)
|
||||||
|
* @param params { businessId: string }
|
||||||
|
*/
|
||||||
|
export const getBusinessStatus = (params) => defHttp.get({ url: Api.getBusinessStatus, params });
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 【用于评论功能】自定义文件上传-方法
|
* 【用于评论功能】自定义文件上传-方法
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -90,10 +90,15 @@ export const columns: BasicColumn[] = [
|
|||||||
// align: 'center',
|
// align: 'center',
|
||||||
// dataIndex: 'delayRiskMitigation',
|
// dataIndex: 'delayRiskMitigation',
|
||||||
// },
|
// },
|
||||||
|
// {
|
||||||
|
// title: '完成状态',
|
||||||
|
// align: 'center',
|
||||||
|
// dataIndex: 'completionStatus_dictText',
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
title: '完成状态',
|
title: '业务状态',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'completionStatus_dictText',
|
dataIndex: 'status_dictText',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '截止日期',
|
title: '截止日期',
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
import { defHttp } from '/@/utils/http/axios';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import { showImportValidationErrors } from '/@/utils/helper/importError';
|
import { showImportValidationErrors } from '/@/utils/helper/importError';
|
||||||
import { startProcessSchedules } from '/@/api/common/api';
|
import { startProcessSchedules, getBusinessStatus } from '/@/api/common/api';
|
||||||
import { dateUtil } from '/@/utils/dateUtil';
|
import { dateUtil } from '/@/utils/dateUtil';
|
||||||
|
|
||||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
@@ -334,6 +334,7 @@ import { defHttp } from '/@/utils/http/axios';
|
|||||||
if (result && result.length > 0) {
|
if (result && result.length > 0) {
|
||||||
record.children = getDataByResult(result);
|
record.children = getDataByResult(result);
|
||||||
await refreshFeedbackCounts(record.children);
|
await refreshFeedbackCounts(record.children);
|
||||||
|
await refreshBusinessStatus(record.children);
|
||||||
// 触发表格重新渲染
|
// 触发表格重新渲染
|
||||||
updateTableDataRecord(record.id, { ...record });
|
updateTableDataRecord(record.id, { ...record });
|
||||||
} else {
|
} else {
|
||||||
@@ -416,6 +417,40 @@ import { defHttp } from '/@/utils/http/axios';
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量查询业务状态并更新到 records 中
|
||||||
|
*/
|
||||||
|
async function refreshBusinessStatus(records) {
|
||||||
|
const ids = collectAllIds(records);
|
||||||
|
if (ids.length === 0) return;
|
||||||
|
try {
|
||||||
|
const results = await Promise.all(
|
||||||
|
ids.map((id) =>
|
||||||
|
getBusinessStatus({ businessId: id }).catch(() => null)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
const statusMap: Record<string, string> = {};
|
||||||
|
for (const item of results) {
|
||||||
|
if (item?.businessId) {
|
||||||
|
statusMap[item.businessId] = item.status_dictText || '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const updateFn = (list) => {
|
||||||
|
if (!list) return;
|
||||||
|
for (const item of list) {
|
||||||
|
const status = statusMap[item.id];
|
||||||
|
if (status !== undefined) {
|
||||||
|
item.status_dictText = status;
|
||||||
|
}
|
||||||
|
if (item.children) updateFn(item.children);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
updateFn(records);
|
||||||
|
} catch (e) {
|
||||||
|
// 静默处理查询异常
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接口请求成功后回调
|
* 接口请求成功后回调
|
||||||
*/
|
*/
|
||||||
@@ -423,7 +458,8 @@ import { defHttp } from '/@/utils/http/axios';
|
|||||||
getDataByResult(result.items) && loadDataByExpandedRows();
|
getDataByResult(result.items) && loadDataByExpandedRows();
|
||||||
if (result.items && result.items.length > 0) {
|
if (result.items && result.items.length > 0) {
|
||||||
await refreshFeedbackCounts(result.items);
|
await refreshFeedbackCounts(result.items);
|
||||||
// 触发表格重新渲染以显示更新后的 implCount / closedCount
|
await refreshBusinessStatus(result.items);
|
||||||
|
// 触发表格重新渲染以显示更新后的 implCount / closedCount / businessStatus
|
||||||
setTableData([...getDataSource()]);
|
setTableData([...getDataSource()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user