评审结果 显示reviewName

This commit is contained in:
孙景学
2025-07-17 16:35:30 +08:00
parent 6f2993b8e0
commit da7098aa42
2 changed files with 24 additions and 16 deletions

View File

@ -5,7 +5,7 @@ import { connect } from 'umi';
interface ResultModalProps {
visible: boolean;
record?: { id?: string; [key: string]: any } | null;
record?: { id?: string;[key: string]: any } | null;
onCancel: () => void;
dispatch: any;
}
@ -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,

View File

@ -6,7 +6,7 @@ import './GroupLeaderModal.less'
interface GroupLeaderModalProps {
visible: boolean;
view: boolean;
record?: { id?: string; [key: string]: any } | null;
record?: { id?: string;[key: string]: any } | null;
onCancel: () => void;
onSubmit: () => void;
dispatch: any;
@ -131,7 +131,7 @@ const GroupLeaderModal: React.FC<GroupLeaderModalProps> = ({
}).filter(Boolean);
let accessWorkId = record?.id || '';
for (let index = 0; index < summaryParams.length; index++) {
if(summaryParams[index].reviewResult === null || summaryParams[index].reviewResult === undefined) {
if (summaryParams[index].reviewResult === null || summaryParams[index].reviewResult === undefined) {
message.warning('有未评审项');
return
}
@ -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
);
@ -187,8 +195,8 @@ const GroupLeaderModal: React.FC<GroupLeaderModalProps> = ({
{userItem.reviewResult === '0'
? <span style={{ color: '#52c41a' }}></span>
: userItem.reviewResult === '1'
? <span style={{ color: '#f5222d' }}></span>
: ''}
? <span style={{ color: '#f5222d' }}></span>
: ''}
{userItem.remark && (
<Button type="link" size="small" onClick={() =>
setRemarkModal({ open: true, remark: userItem.remark, file: userItem.coscoAccessTtemAttachments })
@ -232,9 +240,9 @@ const GroupLeaderModal: React.FC<GroupLeaderModalProps> = ({
return (
<Table.Summary.Cell index={index} key={sup.supplierId} colSpan={colSpan} align="center">
{view && (
<span style={{color: groupSummaryResult[sup.supplierId] === '0'? '#52c41a': '#f5222d' }}> {groupSummaryResult[sup.supplierId] === '0'? '合格': '不合格'}</span>
<span style={{ color: groupSummaryResult[sup.supplierId] === '0' ? '#52c41a' : '#f5222d' }}> {groupSummaryResult[sup.supplierId] === '0' ? '合格' : '不合格'}</span>
)}
{ !view && (
{!view && (
<Select
style={{ width: 120 }}
value={groupSummaryResult[sup.supplierId]}