评审结果 显示reviewName
This commit is contained in:
@ -121,15 +121,15 @@ const ResultModal: React.FC<ResultModalProps> = ({
|
||||
},
|
||||
...suppliers.map(sup => {
|
||||
// 当前公司所有人员(所有非summary项,取 coscoAccessUserItemList 多个)
|
||||
const reviewerSet = new Set<string>();
|
||||
const reviewerMap = new Map<string, string>();
|
||||
(sup.coscoAccessItemList || []).forEach((item: any) => {
|
||||
if (item.itemType !== 'summary' && Array.isArray(item.coscoAccessUserItemList)) {
|
||||
item.coscoAccessUserItemList.forEach((u: any) => {
|
||||
reviewerSet.add(u.reviewBy);
|
||||
reviewerMap.set(u.reviewBy, u.reviewName); // 工号 -> 姓名
|
||||
});
|
||||
}
|
||||
});
|
||||
const reviewers = Array.from(reviewerSet);
|
||||
const reviewers = Array.from(reviewerMap.entries()).map(([reviewBy, reviewName]) => ({ reviewBy, reviewName }));
|
||||
|
||||
return {
|
||||
title: (
|
||||
@ -148,8 +148,8 @@ const ResultModal: React.FC<ResultModalProps> = ({
|
||||
</a>
|
||||
</div>
|
||||
),
|
||||
children: reviewers.map((reviewBy: string) => ({
|
||||
title: reviewBy,
|
||||
children: reviewers.map(({ reviewName, reviewBy }) => ({
|
||||
title: reviewName,
|
||||
dataIndex: `${sup.supplierId}_${reviewBy}`,
|
||||
key: `${sup.supplierId}_${reviewBy}`,
|
||||
width: 100,
|
||||
|
@ -154,7 +154,16 @@ const GroupLeaderModal: React.FC<GroupLeaderModalProps> = ({
|
||||
fixed: 'left',
|
||||
},
|
||||
...suppliers.map(sup => {
|
||||
const reviewers = supplierReviewerMap[sup.supplierId] || [];
|
||||
// 构建对象数组
|
||||
const reviewerSet = new Map();
|
||||
(sup.coscoAccessUserItemList || []).forEach((u: any) => {
|
||||
if (u.itemType === 'item' && u.reviewBy) {
|
||||
reviewerSet.set(u.reviewBy, u.reviewName || u.reviewBy);
|
||||
}
|
||||
});
|
||||
const reviewers = Array.from(reviewerSet.entries()).map(([reviewBy, reviewName]) => ({ reviewBy, reviewName }));
|
||||
|
||||
// const reviewers = supplierReviewerMap[sup.supplierId] || [];
|
||||
return {
|
||||
title: (
|
||||
<div>
|
||||
@ -170,14 +179,13 @@ const GroupLeaderModal: React.FC<GroupLeaderModalProps> = ({
|
||||
</a>
|
||||
</div>
|
||||
),
|
||||
children: reviewers.map((reviewBy: string) => ({
|
||||
title: reviewBy,
|
||||
children: reviewers.map(({ reviewName, reviewBy }) => ({
|
||||
title: reviewName,
|
||||
dataIndex: `${sup.supplierId}_${reviewBy}`,
|
||||
key: `${sup.supplierId}_${reviewBy}`,
|
||||
width: 100,
|
||||
align: 'center',
|
||||
render: (_: any, row: any) => {
|
||||
// itemName+reviewBy精确查找
|
||||
const userItem = (sup.coscoAccessUserItemList || []).find(
|
||||
(u: any) => u.itemType === 'item' && u.itemName === row.itemName && u.reviewBy === reviewBy
|
||||
);
|
||||
|
Reference in New Issue
Block a user