|
|
@@ -1674,12 +1674,12 @@ export default function TaskManagement() {
|
|
|
color: '#ffffff',
|
|
|
};
|
|
|
}
|
|
|
- // 已完成:绿色 #0acb57
|
|
|
+ // 已完成:深绿色 #15803d
|
|
|
if (statusTextLower.includes('已完成') || statusTextLower.includes('已通过') ||
|
|
|
statusTextLower.includes('approved') || statusTextLower.includes('完成') ||
|
|
|
statusTextLower.includes('执行完成')) {
|
|
|
return {
|
|
|
- backgroundColor: '#0acb57',
|
|
|
+ backgroundColor: '#15803d',
|
|
|
color: '#ffffff',
|
|
|
};
|
|
|
}
|
|
|
@@ -1713,7 +1713,7 @@ export default function TaskManagement() {
|
|
|
const getWorkStatusStyle = (status: string | number | undefined): React.CSSProperties => {
|
|
|
const s = String(status || '').toLowerCase();
|
|
|
if (['running', '2'].includes(s)) return { backgroundColor: '#1677ff', color: '#fff' };
|
|
|
- if (['completed', 'approved'].includes(s)) return { backgroundColor: '#0acb57', color: '#fff' };
|
|
|
+ if (['completed', 'approved'].includes(s)) return { backgroundColor: '#15803d', color: '#fff' };
|
|
|
if (['rejected', 'cancelled'].includes(s)) return { backgroundColor: '#ff4d4f', color: '#fff' };
|
|
|
if (['pending', '1'].includes(s)) return { backgroundColor: '#e5e5e5', color: '#333' };
|
|
|
return { backgroundColor: '#e2e8f0', color: '#64748b' };
|
|
|
@@ -1861,10 +1861,21 @@ export default function TaskManagement() {
|
|
|
render: (status: string | number | undefined, record: MyTaskVO) => {
|
|
|
// 优先使用 approvalStatus,如果没有则使用其他状态字段
|
|
|
const taskStatus = status || record.taskStatus || record.status;
|
|
|
+ // 列表里“已完成/已通过”使用浅绿,弹框/详情仍保持深绿
|
|
|
+ const baseStyle = getTaskStatusStyle(taskStatus);
|
|
|
+ const statusTextLower = String(getTaskStatusText(taskStatus) || '').toLowerCase();
|
|
|
+ const listStyle =
|
|
|
+ statusTextLower.includes('已完成') ||
|
|
|
+ statusTextLower.includes('已通过') ||
|
|
|
+ statusTextLower.includes('approved') ||
|
|
|
+ statusTextLower.includes('完成') ||
|
|
|
+ statusTextLower.includes('执行完成')
|
|
|
+ ? { ...baseStyle, backgroundColor: '#0acb57', color: '#ffffff' }
|
|
|
+ : baseStyle;
|
|
|
return (
|
|
|
<span
|
|
|
className="inline-flex px-3 py-1 rounded-lg text-xs"
|
|
|
- style={getTaskStatusStyle(taskStatus)}
|
|
|
+ style={listStyle}
|
|
|
>
|
|
|
{getTaskStatusText(taskStatus)}
|
|
|
</span>
|
|
|
@@ -1983,26 +1994,30 @@ export default function TaskManagement() {
|
|
|
<div className="bg-white rounded-2xl border border-gray-200/50 shadow-sm overflow-hidden">
|
|
|
{/* 查询与操作栏 */}
|
|
|
<div className="p-4 lg:p-5 border-b border-gray-200/50">
|
|
|
- <div className="flex flex-wrap gap-3 items-center">
|
|
|
- {/* 搜索条件:作业编号、作业名称 */}
|
|
|
- <span className="text-sm text-gray-700 whitespace-nowrap">作业编号:</span>
|
|
|
- <Input
|
|
|
- value={searchOrderNo}
|
|
|
- onChange={(e) => setSearchOrderNo(e.target.value)}
|
|
|
- placeholder="请输入作业编号"
|
|
|
- allowClear
|
|
|
- style={{ width: 160 }}
|
|
|
- onPressEnter={handleSearch}
|
|
|
- />
|
|
|
- <span className="text-sm text-gray-700 whitespace-nowrap">作业名称:</span>
|
|
|
- <Input
|
|
|
- value={searchName}
|
|
|
- onChange={(e) => setSearchName(e.target.value)}
|
|
|
- placeholder="请输入作业名称"
|
|
|
- allowClear
|
|
|
- style={{ width: 160 }}
|
|
|
- onPressEnter={handleSearch}
|
|
|
- />
|
|
|
+ <div className="flex flex-wrap gap-2 lg:gap-3 items-center min-w-0">
|
|
|
+ {/* 搜索条件:按原宽度 200px,不超出,可缩小 */}
|
|
|
+ <div className="flex items-center gap-2 lg:gap-3 w-[200px] min-w-[100px] flex-shrink">
|
|
|
+ <span className="text-sm font-medium text-gray-700 whitespace-nowrap flex-shrink-0">作业编号:</span>
|
|
|
+ <Input
|
|
|
+ value={searchOrderNo}
|
|
|
+ onChange={(e) => setSearchOrderNo(e.target.value)}
|
|
|
+ placeholder="请输入作业编号"
|
|
|
+ allowClear
|
|
|
+ className="min-w-0 w-full"
|
|
|
+ onPressEnter={handleSearch}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div className="flex items-center gap-2 lg:gap-3 w-[200px] min-w-[100px] flex-shrink">
|
|
|
+ <span className="text-sm font-medium text-gray-700 whitespace-nowrap flex-shrink-0">作业名称:</span>
|
|
|
+ <Input
|
|
|
+ value={searchName}
|
|
|
+ onChange={(e) => setSearchName(e.target.value)}
|
|
|
+ placeholder="请输入作业名称"
|
|
|
+ allowClear
|
|
|
+ className="min-w-0 w-full"
|
|
|
+ onPressEnter={handleSearch}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
|
|
|
{/* 按钮组:小屏整行,大屏右对齐 */}
|
|
|
<div className="flex gap-2 w-full sm:w-auto sm:ml-auto justify-start sm:justify-end">
|
|
|
@@ -2128,14 +2143,32 @@ export default function TaskManagement() {
|
|
|
{(() => {
|
|
|
const workStatus = (detailData as any).workDetail?.status;
|
|
|
if (workStatus != null && String(workStatus).trim() !== '') {
|
|
|
+ const baseStyle = getWorkStatusStyle(workStatus);
|
|
|
+ const workText = getWorkStatusText(workStatus);
|
|
|
+ const isCompleted = String(workText || '').toLowerCase().includes('已完成');
|
|
|
+ const headerStyle = isCompleted ? { ...baseStyle, backgroundColor: '#0acb57', color: '#ffffff' } : baseStyle;
|
|
|
return (
|
|
|
- <span className="inline-flex px-3 py-1 rounded-full text-xs font-medium" style={getWorkStatusStyle(workStatus)}>
|
|
|
- {getWorkStatusText(workStatus)}
|
|
|
+ <span className="inline-flex px-3 py-1 rounded-full text-xs font-medium" style={headerStyle}>
|
|
|
+ {workText}
|
|
|
</span>
|
|
|
);
|
|
|
}
|
|
|
return (
|
|
|
- <span className="inline-flex px-3 py-1 rounded-full text-xs font-medium" style={getTaskStatusStyle(detailData.approvalStatus ?? detailData.taskStatus ?? (detailData as any).nodeProgress)}>
|
|
|
+ <span
|
|
|
+ className="inline-flex px-3 py-1 rounded-full text-xs font-medium"
|
|
|
+ style={(() => {
|
|
|
+ const s = detailData.approvalStatus ?? detailData.taskStatus ?? (detailData as any).nodeProgress;
|
|
|
+ const baseStyle = getTaskStatusStyle(s);
|
|
|
+ const textLower = String(getTaskStatusText(s) || '').toLowerCase();
|
|
|
+ const isCompleted =
|
|
|
+ textLower.includes('已完成') ||
|
|
|
+ textLower.includes('已通过') ||
|
|
|
+ textLower.includes('approved') ||
|
|
|
+ textLower.includes('完成') ||
|
|
|
+ textLower.includes('执行完成');
|
|
|
+ return isCompleted ? { ...baseStyle, backgroundColor: '#0acb57', color: '#ffffff' } : baseStyle;
|
|
|
+ })()}
|
|
|
+ >
|
|
|
{getTaskStatusText(detailData.approvalStatus ?? detailData.taskStatus ?? (detailData as any).nodeProgress)}
|
|
|
</span>
|
|
|
);
|
|
|
@@ -2194,7 +2227,13 @@ export default function TaskManagement() {
|
|
|
任务名称:<span style={{ color: '#1e293b', fontWeight: 600 }}>{detailData?.nodeName ?? '-'}</span>
|
|
|
<span
|
|
|
className="inline-flex px-3 py-1 rounded-full text-xs font-medium"
|
|
|
- style={{ ...getTaskStatusStyle(taskStatus), marginLeft: 10 }}
|
|
|
+ style={(() => {
|
|
|
+ const baseStyle = getTaskStatusStyle(taskStatus);
|
|
|
+ const textLower = String(getTaskStatusText(taskStatus) || '').toLowerCase();
|
|
|
+ const isCompleted = textLower.includes('已完成') || textLower.includes('已通过') || textLower.includes('approved') || textLower.includes('完成') || textLower.includes('执行完成');
|
|
|
+ const badgeStyle = isCompleted ? { ...baseStyle, backgroundColor: '#0acb57', color: '#ffffff', marginLeft: 10 } : { ...baseStyle, marginLeft: 10 };
|
|
|
+ return badgeStyle;
|
|
|
+ })()}
|
|
|
>
|
|
|
{getTaskStatusText(taskStatus)}
|
|
|
</span>
|
|
|
@@ -2456,7 +2495,7 @@ export default function TaskManagement() {
|
|
|
const isLocked = (p: any) => Boolean(p?.lockTime) || p?.locked === true || String(p?.status || '').toLowerCase() === 'locked';
|
|
|
const lockBadgeStyle = (locked: boolean): React.CSSProperties =>
|
|
|
locked
|
|
|
- ? { backgroundColor: '#0acb57', color: '#ffffff' }
|
|
|
+ ? { backgroundColor: '#15803d', color: '#ffffff' }
|
|
|
: { backgroundColor: '#e2e8f0', color: '#475569' };
|
|
|
const getKeyStatus = (k: any) => {
|
|
|
const status = String(k?.keyStatus ?? '').trim();
|
|
|
@@ -2477,7 +2516,7 @@ export default function TaskManagement() {
|
|
|
undefined;
|
|
|
const getUserName = (u: any) => u?.nickname ?? u?.nickName ?? u?.name ?? u?.username ?? '-';
|
|
|
const getLockerStatus = (u: any) => {
|
|
|
- // 上锁人状态:0初始、1已上锁、2已解锁
|
|
|
+ // 上锁人状态:0未上锁、1已上锁、2已解锁
|
|
|
const s = String(u?.status ?? '').trim();
|
|
|
if (s === '1') return 'locked';
|
|
|
if (s === '2') return 'unlocked_done';
|
|
|
@@ -2575,13 +2614,13 @@ export default function TaskManagement() {
|
|
|
</>
|
|
|
) : st === 'locked' ? (
|
|
|
<>
|
|
|
- <CheckCircleOutlined style={{ fontSize: 14, color: '#16a34a' }} />
|
|
|
- <span style={{ color: '#16a34a' }}>已上锁</span>
|
|
|
+ <CheckCircleOutlined style={{ fontSize: 14, color: '#15803d' }} />
|
|
|
+ <span style={{ color: '#15803d' }}>已上锁</span>
|
|
|
</>
|
|
|
) : st === 'unlocked_done' ? (
|
|
|
<>
|
|
|
- <CheckCircleOutlined style={{ fontSize: 14, color: '#16a34a' }} />
|
|
|
- <span style={{ color: '#16a34a' }}>已解锁</span>
|
|
|
+ <CheckCircleOutlined style={{ fontSize: 14, color: '#15803d' }} />
|
|
|
+ <span style={{ color: '#15803d' }}>已解锁</span>
|
|
|
</>
|
|
|
) : (
|
|
|
<>
|
|
|
@@ -2703,7 +2742,7 @@ export default function TaskManagement() {
|
|
|
statusColor = '#dc2626';
|
|
|
} else if (isReturned) {
|
|
|
statusText = '已归还';
|
|
|
- statusColor = '#16a34a';
|
|
|
+ statusColor = '#15803d';
|
|
|
}
|
|
|
const returnedAt =
|
|
|
k?.giveBackTime ??
|
|
|
@@ -2756,7 +2795,7 @@ export default function TaskManagement() {
|
|
|
}}
|
|
|
>
|
|
|
{status === 'returned' ? (
|
|
|
- <CheckCircleOutlined style={{ fontSize: 14, color: '#16a34a' }} />
|
|
|
+ <CheckCircleOutlined style={{ fontSize: 14, color: '#15803d' }} />
|
|
|
) : status === 'taken' ? (
|
|
|
<CloseCircleOutlined style={{ fontSize: 14, color: '#dc2626' }} />
|
|
|
) : status === 'to_take' ? (
|
|
|
@@ -2807,8 +2846,10 @@ export default function TaskManagement() {
|
|
|
}
|
|
|
const name = getUserName(u);
|
|
|
const avatarSrc = getUserAvatarSrc(u);
|
|
|
+ // 共锁人状态: 0未共锁、1已共锁、2已解共锁
|
|
|
const lockedStatus = String(u?.status ?? '').trim();
|
|
|
- const isCoLocked = lockedStatus === '1';
|
|
|
+ const coLockStatusText = lockedStatus === '1' ? '已共锁' : lockedStatus === '2' ? '已解共锁' : '未共锁';
|
|
|
+ const coLockStatusColor = lockedStatus === '1' ? '#15803d' : lockedStatus === '2' ? '#15803d' : '#dc2626';
|
|
|
return (
|
|
|
<div
|
|
|
key={u.id ?? u.userId ?? u.uid ?? idx}
|
|
|
@@ -2837,13 +2878,15 @@ export default function TaskManagement() {
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <span style={{ display: 'inline-flex', alignItems: 'center', gap: 6, fontSize: 12, color: isCoLocked ? '#16a34a' : '#dc2626' }}>
|
|
|
- {isCoLocked ? (
|
|
|
- <CheckCircleOutlined style={{ fontSize: 14, color: '#16a34a' }} />
|
|
|
+ <span style={{ display: 'inline-flex', alignItems: 'center', gap: 6, fontSize: 12, color: coLockStatusColor }}>
|
|
|
+ {lockedStatus === '1' ? (
|
|
|
+ <CheckCircleOutlined style={{ fontSize: 14, color: '#15803d' }} />
|
|
|
+ ) : lockedStatus === '2' ? (
|
|
|
+ <CheckCircleOutlined style={{ fontSize: 14, color: '#15803d' }} />
|
|
|
) : (
|
|
|
<CloseCircleOutlined style={{ fontSize: 14, color: '#dc2626' }} />
|
|
|
)}
|
|
|
- <span>{isCoLocked ? '已共锁' : '未共锁'}</span>
|
|
|
+ <span>{coLockStatusText}</span>
|
|
|
</span>
|
|
|
</div>
|
|
|
);
|
|
|
@@ -2907,17 +2950,19 @@ export default function TaskManagement() {
|
|
|
}
|
|
|
const name = getReleaseUserName(u);
|
|
|
const avatarSrc = getReleaseUserAvatarSrc(u);
|
|
|
- // 共锁人状态:0初始、1已上锁/已共锁、2已解锁/已解共锁
|
|
|
- const released = String(u?.status ?? '').trim() === '2';
|
|
|
+ // 共锁人状态: 0未共锁、1已共锁、2已解共锁
|
|
|
+ const coLockStatus = String(u?.status ?? '').trim();
|
|
|
+ const coLockText = coLockStatus === '1' ? '已共锁' : coLockStatus === '2' ? '已解共锁' : '未共锁';
|
|
|
+ const coLockColor = coLockStatus === '1' ? '#15803d' : coLockStatus === '2' ? '#15803d' : '#dc2626';
|
|
|
return (
|
|
|
<div key={u.id ?? u.userId ?? idx} style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 10, padding: '10px 10px', borderRadius: 10, border: '1px solid #e6e8f0', background: '#ffffff' }}>
|
|
|
<div style={{ display: 'flex', alignItems: 'center', gap: 10, minWidth: 0 }}>
|
|
|
<Avatar size={32} src={avatarSrc} style={{ background: '#e5e7eb', color: '#111827', flexShrink: 0 }}>{String(name || '-').slice(0, 1)}</Avatar>
|
|
|
<div style={{ fontSize: 13, fontWeight: 600, color: '#0f172a', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{name}</div>
|
|
|
</div>
|
|
|
- <span style={{ display: 'inline-flex', alignItems: 'center', gap: 6, fontSize: 12, color: released ? '#16a34a' : '#dc2626' }}>
|
|
|
- {released ? <CheckCircleOutlined style={{ fontSize: 14, color: '#16a34a' }} /> : <CloseCircleOutlined style={{ fontSize: 14, color: '#dc2626' }} />}
|
|
|
- <span>{released ? '已解除共锁' : '未解除共锁'}</span>
|
|
|
+ <span style={{ display: 'inline-flex', alignItems: 'center', gap: 6, fontSize: 12, color: coLockColor }}>
|
|
|
+ {coLockStatus === '1' ? <CheckCircleOutlined style={{ fontSize: 14, color: '#15803d' }} /> : coLockStatus === '2' ? <CheckCircleOutlined style={{ fontSize: 14, color: '#15803d' }} /> : <CloseCircleOutlined style={{ fontSize: 14, color: '#dc2626' }} />}
|
|
|
+ <span>{coLockText}</span>
|
|
|
</span>
|
|
|
</div>
|
|
|
);
|
|
|
@@ -2925,7 +2970,7 @@ export default function TaskManagement() {
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- {/* 第二步:取钥匙 */}
|
|
|
+ {/* 第二步:取钥匙(只显示待取出/已取出,接口若为2已归还则视为已取出) */}
|
|
|
<div style={{ padding: '0 14px', borderRight: '1px solid #eef0f6', display: 'flex', flexDirection: 'column', minHeight: 0 }}>
|
|
|
<div style={{ fontSize: 14, fontWeight: 600, color: '#0f172a', marginBottom: 12, minHeight: 22 }}>第二步:取钥匙</div>
|
|
|
<div style={{ padding: '8px 0', flex: 1 }}>
|
|
|
@@ -2938,9 +2983,9 @@ export default function TaskManagement() {
|
|
|
);
|
|
|
}
|
|
|
const status = getReleaseKeyStatus(k);
|
|
|
- const isReturned = status === 'returned';
|
|
|
- const statusText = status === 'returned' ? '已归还' : status === 'pending' ? '未归还' : '未知';
|
|
|
- const returnedAt = k?.giveBackTime ?? k?.returnTime ?? k?.returnedTime ?? k?.backTime ?? k?.keyReturnTime ?? k?.updateTime ?? k?.returnedAt ?? k?.returnAt;
|
|
|
+ // 第二步只显示两种:0待取出 / 1或2 均显示已取出(已归还说明必然已取出过)
|
|
|
+ const step2Taken = status !== 'to_take';
|
|
|
+ const step2StatusText = step2Taken ? '已取出' : '待取出';
|
|
|
return (
|
|
|
<div key={k.id ?? k.keyId ?? idx} style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '10px 10px', borderRadius: 10, border: '1px solid #e6e8f0', background: '#ffffff' }}>
|
|
|
<span style={{ width: 32, height: 32, borderRadius: 10, background: '#eff6ff', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0 }}>
|
|
|
@@ -2949,12 +2994,11 @@ export default function TaskManagement() {
|
|
|
<div style={{ minWidth: 0, flex: 1 }}>
|
|
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>
|
|
|
<div style={{ fontSize: 13, fontWeight: 600, color: '#0f172a', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{k?.keyNfc ?? k?.keyName ?? k?.name ?? '-'}</div>
|
|
|
- <span style={{ display: 'inline-flex', alignItems: 'center', gap: 4, fontSize: 12, color: isReturned ? '#16a34a' : '#dc2626' }}>
|
|
|
- {isReturned ? <CheckCircleOutlined style={{ fontSize: 14, color: '#16a34a' }} /> : <CloseCircleOutlined style={{ fontSize: 14, color: '#dc2626' }} />}
|
|
|
- <span>{statusText}</span>
|
|
|
+ <span style={{ display: 'inline-flex', alignItems: 'center', gap: 4, fontSize: 12, color: step2Taken ? '#15803d' : '#dc2626' }}>
|
|
|
+ {step2Taken ? <CheckCircleOutlined style={{ fontSize: 14, color: '#15803d' }} /> : <CloseCircleOutlined style={{ fontSize: 14, color: '#dc2626' }} />}
|
|
|
+ <span>{step2StatusText}</span>
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div style={{ marginTop: 4, fontSize: 12, color: '#64748b' }}>归还时间:{returnedAt != null && String(returnedAt).trim() !== '' ? dateFormatter(returnedAt) : '-'}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
);
|
|
|
@@ -2976,18 +3020,19 @@ export default function TaskManagement() {
|
|
|
}
|
|
|
const name = getReleaseUserName(u);
|
|
|
const avatarSrc = getReleaseUserAvatarSrc(u);
|
|
|
- const unlockStatus = String(u?.status ?? '').trim();
|
|
|
- // 解锁状态:0初始、1已上锁、2已解锁
|
|
|
- const isUnlocked = unlockStatus === '2';
|
|
|
+ // 上锁人状态: 0未上锁、1已上锁、2已解锁
|
|
|
+ const lockStatus = String(u?.status ?? '').trim();
|
|
|
+ const lockText = lockStatus === '1' ? '已上锁' : lockStatus === '2' ? '已解锁' : '未上锁';
|
|
|
+ const lockColor = lockStatus === '1' ? '#15803d' : lockStatus === '2' ? '#15803d' : '#dc2626';
|
|
|
return (
|
|
|
<div key={u.id ?? u.userId ?? idx} style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 10, padding: '10px 10px', borderRadius: 10, border: '1px solid #e6e8f0', background: '#ffffff' }}>
|
|
|
<div style={{ display: 'flex', alignItems: 'center', gap: 10, minWidth: 0 }}>
|
|
|
<Avatar size={32} src={avatarSrc} style={{ background: '#e5e7eb', color: '#111827', flexShrink: 0 }}>{String(name || '-').slice(0, 1)}</Avatar>
|
|
|
<div style={{ fontSize: 13, fontWeight: 600, color: '#0f172a', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{name}</div>
|
|
|
</div>
|
|
|
- <span style={{ display: 'inline-flex', alignItems: 'center', gap: 6, fontSize: 12, color: isUnlocked ? '#16a34a' : '#dc2626' }}>
|
|
|
- {isUnlocked ? <CheckCircleOutlined style={{ fontSize: 14, color: '#16a34a' }} /> : <CloseCircleOutlined style={{ fontSize: 14, color: '#dc2626' }} />}
|
|
|
- <span>{isUnlocked ? '已解锁' : '未解锁'}</span>
|
|
|
+ <span style={{ display: 'inline-flex', alignItems: 'center', gap: 6, fontSize: 12, color: lockColor }}>
|
|
|
+ {lockStatus === '1' ? <CheckCircleOutlined style={{ fontSize: 14, color: '#15803d' }} /> : lockStatus === '2' ? <CheckCircleOutlined style={{ fontSize: 14, color: '#15803d' }} /> : <CloseCircleOutlined style={{ fontSize: 14, color: '#dc2626' }} />}
|
|
|
+ <span>{lockText}</span>
|
|
|
</span>
|
|
|
</div>
|
|
|
);
|
|
|
@@ -3002,8 +3047,9 @@ export default function TaskManagement() {
|
|
|
);
|
|
|
}
|
|
|
const status = getReleaseKeyStatus(k);
|
|
|
- const isReturned = status === 'returned';
|
|
|
- const statusText = status === 'returned' ? '已归还' : status === 'pending' ? '未归还' : '未知';
|
|
|
+ // 第三步显示三种状态:0待取出、1已取出、2已归还
|
|
|
+ const step3StatusText = status === 'returned' ? '已归还' : status === 'taken' ? '已取出' : status === 'to_take' ? '待取出' : '未知';
|
|
|
+ const step3Color = status === 'returned' ? '#15803d' : status === 'taken' ? '#f97316' : '#dc2626';
|
|
|
const returnedAt = k?.giveBackTime ?? k?.returnTime ?? k?.returnedTime ?? k?.backTime ?? k?.keyReturnTime ?? k?.updateTime ?? k?.returnedAt ?? k?.returnAt;
|
|
|
return (
|
|
|
<div key={k.id ?? k.keyId ?? idx} style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '10px 10px', borderRadius: 10, border: '1px solid #e6e8f0', background: '#ffffff' }}>
|
|
|
@@ -3013,9 +3059,9 @@ export default function TaskManagement() {
|
|
|
<div style={{ minWidth: 0, flex: 1 }}>
|
|
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>
|
|
|
<div style={{ fontSize: 13, fontWeight: 600, color: '#0f172a', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{k?.keyNfc ?? k?.keyName ?? k?.name ?? '-'}</div>
|
|
|
- <span style={{ display: 'inline-flex', alignItems: 'center', gap: 4, fontSize: 12, color: isReturned ? '#16a34a' : '#dc2626' }}>
|
|
|
- {isReturned ? <CheckCircleOutlined style={{ fontSize: 14, color: '#16a34a' }} /> : <CloseCircleOutlined style={{ fontSize: 14, color: '#dc2626' }} />}
|
|
|
- <span>{statusText}</span>
|
|
|
+ <span style={{ display: 'inline-flex', alignItems: 'center', gap: 4, fontSize: 12, color: step3Color }}>
|
|
|
+ {status === 'returned' ? <CheckCircleOutlined style={{ fontSize: 14, color: '#15803d' }} /> : status === 'taken' ? <CheckCircleOutlined style={{ fontSize: 14, color: '#f97316' }} /> : <CloseCircleOutlined style={{ fontSize: 14, color: '#dc2626' }} />}
|
|
|
+ <span>{step3StatusText}</span>
|
|
|
</span>
|
|
|
</div>
|
|
|
<div style={{ marginTop: 4, fontSize: 12, color: '#64748b' }}>归还时间:{returnedAt != null && String(returnedAt).trim() !== '' ? dateFormatter(returnedAt) : '-'}</div>
|