[feat] negodata/front: 이용안내 마감판정 재작성 + 견적상세 목표가·앵커링 표시
- 이용안내(OnboardingGuideModal) '마감 판정' 탭 재구성: 가격게이트(견적세팅 mid/over_action 정책·기본 낙찰) + 완료양상 결정표(낙찰/재생성/결렬, 8행=close_reason 8종) + 재생성 한도(체인 전체 총합). - 견적상세 헤더카드에 목표가(→산정내역 링크)·앵커링가 표기(대표 세션 공통값), 협상 리스트에 앵커링 컬럼 추가. onShowTarget 을 헤더카드로 이관. - 목록 마감결과 배지: 낙찰 시 낙찰 협력사명 병기. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
bfdc0c3047
commit
c98e5fa7bb
6 files changed
+281
-114
No files matched your search
+22
@@ -36,6 +36,8 @@ type DrawerHeaderCardsProps = {
|
||||
sessionViews: SessionView[];
|
||||
/** 현재 선택 세션의 상품(없으면 상품 카드는 빈 상태). */
|
||||
currentProduct: Product | undefined;
|
||||
/** 목표가 클릭 → 산정내역 모달(대표 세션 기준). 목표가/앵커링가는 견적 단위(1견적=1상품)라 세션 공통값. */
|
||||
onShowTarget: (sessionId: string) => void;
|
||||
};
|
||||
|
||||
export function DrawerHeaderCards({
|
||||
@@ -43,6 +45,7 @@ export function DrawerHeaderCards({
|
||||
quotationSettings,
|
||||
sessionViews,
|
||||
currentProduct,
|
||||
onShowTarget,
|
||||
}: DrawerHeaderCardsProps) {
|
||||
// Quotations DDL 표시값
|
||||
const q_name = quotation.name || '-';
|
||||
@@ -58,6 +61,10 @@ export function DrawerHeaderCards({
|
||||
|
||||
const selectedSettingObj = quotationSettings.find((qs) => qs.qt_setting_id === quotation.qt_setting_id);
|
||||
|
||||
// 목표가·앵커링가는 견적 단위값(1견적=1상품 → 모든 세션 공통). 대표 세션 하나에서 읽어 견적 정보에 표기한다.
|
||||
const repSession = sessionViews[0];
|
||||
const repSessionId = repSession?.session_id;
|
||||
|
||||
// 상품 카드는 '가격 관련' 값만 노출(모델명·규격·제조사 등 스펙은 상품 상세에서 확인).
|
||||
const won = (n?: number | null) => (n != null ? `₩${Number(n).toLocaleString()}` : '-');
|
||||
const productPriceRows = currentProduct
|
||||
@@ -82,6 +89,21 @@ export function DrawerHeaderCards({
|
||||
<InfoField label="견적번호" value={q_number} />
|
||||
<InfoField label="유형" value={quotationTypeLabel(quotation.type)} />
|
||||
<InfoField label="차수" value={`${q_round}차`} />
|
||||
<InfoField label="목표가">
|
||||
{repSessionId ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onShowTarget(repSessionId)}
|
||||
title="목표가 산정 내역 보기"
|
||||
className={cn(typographyVariants({ variant: 'link' }), 'font-bold font-sans')}
|
||||
>
|
||||
{won(repSession?.target_price)}
|
||||
</button>
|
||||
) : (
|
||||
<span className="font-sans font-bold text-foreground">{won(repSession?.target_price)}</span>
|
||||
)}
|
||||
</InfoField>
|
||||
<InfoField label="앵커링가" value={won(repSession?.target_anchoring_price)} valueClassName="font-sans" />
|
||||
<InfoField label="견적상태" labelClassName="opacity-90 font-bold mb-1">
|
||||
<QuotationStatusBadge status={quotation.status} />
|
||||
</InfoField>
|
||||
|
||||
+15
-16
@@ -3,8 +3,6 @@ import { MessageSquare, Copy, Mail, MailCheck, Send } from 'lucide-react';
|
||||
import { showToast } from '@/lib/notify';
|
||||
import { confirm } from '@/lib/confirm';
|
||||
import { Table, TableHeader, TableBody, TableRow, TableHead, TableCell } from '@/components/ui/table';
|
||||
import { typographyVariants } from '@/components/ui/typography';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { StatusPill, sessionStatusTone } from './StatusPill';
|
||||
import { mapServerSessionView, sessionStatusLabel } from '../../types';
|
||||
|
||||
@@ -14,7 +12,6 @@ export function SessionsStatusTab({
|
||||
sessionViews,
|
||||
canNotify,
|
||||
onOpenChat,
|
||||
onShowTarget,
|
||||
onNotifyAll,
|
||||
onNotifyOne,
|
||||
}: {
|
||||
@@ -22,8 +19,6 @@ export function SessionsStatusTab({
|
||||
/** 초청 메일 발송 권한(견적 소유자만). false 면 발송 버튼 비활성. */
|
||||
canNotify: boolean;
|
||||
onOpenChat: (sessionId: string) => void;
|
||||
/** 목표가 셀 클릭 → 산정내역 모달. */
|
||||
onShowTarget: (sessionId: string) => void;
|
||||
/** 미발송 세션 전체에 초청 메일 발송. */
|
||||
onNotifyAll: () => Promise<void>;
|
||||
/** 한 세션(공급사)에 초청 메일 발송/재발송. */
|
||||
@@ -94,7 +89,7 @@ export function SessionsStatusTab({
|
||||
</div>
|
||||
|
||||
<div className="border border-border rounded-lg bg-card overflow-x-auto">
|
||||
<Table className="w-full text-left text-xs border-collapse font-mono min-w-[1350px]">
|
||||
<Table className="w-full text-left text-xs border-collapse font-mono min-w-[1250px]">
|
||||
<TableHeader className="bg-muted text-muted-foreground text-[10px] border-b border-border">
|
||||
<TableRow>
|
||||
<TableHead className="p-3 font-semibold font-sans">협력사</TableHead>
|
||||
@@ -102,7 +97,7 @@ export function SessionsStatusTab({
|
||||
<TableHead className="p-3 font-semibold text-center font-sans">초청메일</TableHead>
|
||||
<TableHead className="p-3 font-semibold font-sans">상품</TableHead>
|
||||
<TableHead className="p-3 font-semibold text-center font-sans">협상상태</TableHead>
|
||||
<TableHead className="p-3 font-semibold text-right">목표가</TableHead>
|
||||
<TableHead className="p-3 font-semibold text-right">앵커링가</TableHead>
|
||||
<TableHead className="p-3 font-semibold text-right">투찰가</TableHead>
|
||||
<TableHead className="p-3 font-semibold">투찰시각</TableHead>
|
||||
<TableHead className="p-3 font-semibold">마감시각</TableHead>
|
||||
@@ -185,15 +180,19 @@ export function SessionsStatusTab({
|
||||
<TableCell className="p-3 text-center">
|
||||
<StatusPill tone={sessionStatusTone(sess.status)}>{sessionStatusLabel(sess.status)}</StatusPill>
|
||||
</TableCell>
|
||||
<TableCell className="p-3 text-right">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onShowTarget(sess.session_id)}
|
||||
title="목표가 산정 내역 보기"
|
||||
className={cn(typographyVariants({ variant: 'link' }), 'font-bold')}
|
||||
>
|
||||
₩{sess.target_price?.toLocaleString() || '-'}
|
||||
</button>
|
||||
<TableCell className="p-3 text-right text-muted-foreground">
|
||||
{sess.target_anchoring_price > 0 ? (
|
||||
<>
|
||||
₩{sess.target_anchoring_price.toLocaleString()}
|
||||
{sess.target_price > 0 && (
|
||||
<span className="ml-0.5 text-[10px] opacity-70">
|
||||
({((1 - sess.target_anchoring_price / sess.target_price) * 100).toFixed(1)}%)
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
'-'
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell className="p-3 text-right font-bold text-foreground">
|
||||
{sess.bid_price ? `₩${sess.bid_price.toLocaleString()}` : '-'}
|
||||
|
||||
@@ -205,6 +205,7 @@ export function QuotationDetailSheet({
|
||||
quotationSettings={quotationSettings}
|
||||
sessionViews={sessionViews}
|
||||
currentProduct={currentProduct}
|
||||
onShowTarget={setTargetSessionId}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -248,7 +249,6 @@ export function QuotationDetailSheet({
|
||||
sessionViews={sessionViews}
|
||||
canNotify={canNotify}
|
||||
onOpenChat={goToChat}
|
||||
onShowTarget={setTargetSessionId}
|
||||
onNotifyAll={() => onNotify(qtId)}
|
||||
onNotifyOne={(sessionId) => onNotifySession(sessionId, qtId)}
|
||||
/>
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
quotationStatusLabel,
|
||||
quotationTypeLabel,
|
||||
chainRoundState,
|
||||
quotationOutcomeLabel,
|
||||
CHAIN_ROUND_STATE_LABEL,
|
||||
} from '../types';
|
||||
import { QuotationType, QuotationStatus } from '@/api/generated/model';
|
||||
@@ -38,7 +37,7 @@ const statusBadgeClass = (status?: number | null) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 마감결과 배지 색. 낙찰=초록/재생성=주황/유찰=로즈/진행중=회색(아직 마감 전).
|
||||
// 마감결과 배지 색. 낙찰=초록/재생성=주황/결렬=로즈/진행중=회색(아직 마감 전).
|
||||
const outcomeBadgeClass = (state: ChainRoundState) => {
|
||||
switch (state) {
|
||||
case 'awarded':
|
||||
@@ -144,15 +143,22 @@ export function QuotationTable({ data, products, onOpenDetail, onFilterChain, fo
|
||||
{
|
||||
header: '마감결과',
|
||||
align: 'center',
|
||||
// 상세 마감사유는 상세 드로어에서만. 목록은 거친 결과(낙찰/재생성/결렬/진행중)만,
|
||||
// 낙찰이면 배지에 '낙찰 - 낙찰사명' 한 줄로 붙인다.
|
||||
cell: (est) => {
|
||||
const state = chainRoundState(est); // 배지 색 그룹
|
||||
const state = chainRoundState(est);
|
||||
const winner = state === 'awarded' ? est.preferred_sp_name : null;
|
||||
return (
|
||||
<Typography
|
||||
as="span"
|
||||
variant="small"
|
||||
className={`inline-flex items-center gap-1 px-2.5 py-0.5 text-[10px] font-semibold rounded-full border ${outcomeBadgeClass(state)}`}
|
||||
className={`inline-flex max-w-[180px] items-center px-2.5 py-0.5 text-[10px] font-semibold rounded-full border ${outcomeBadgeClass(state)}`}
|
||||
title={winner ?? undefined}
|
||||
>
|
||||
{quotationOutcomeLabel(est)}
|
||||
<span className="truncate">
|
||||
{CHAIN_ROUND_STATE_LABEL[state]}
|
||||
{winner ? ` - ${winner}` : ''}
|
||||
</span>
|
||||
</Typography>
|
||||
);
|
||||
},
|
||||
|
||||
@@ -45,7 +45,7 @@ export interface QuotationSetting {
|
||||
export const PRICE_GATE_ACTION_LABEL: Record<PriceGateAction, string> = {
|
||||
[PriceGateAction.AWARD]: '낙찰',
|
||||
[PriceGateAction.RENEGO]: '재협상',
|
||||
[PriceGateAction.FAIL]: '유찰',
|
||||
[PriceGateAction.FAIL]: '결렬',
|
||||
};
|
||||
export const priceGateActionLabel = (a?: number | null): string =>
|
||||
a != null ? PRICE_GATE_ACTION_LABEL[a as PriceGateAction] ?? String(a) : '';
|
||||
@@ -183,7 +183,7 @@ export type ChainRoundState = 'awarded' | 'regenerated' | 'failed' | 'active';
|
||||
export const CHAIN_ROUND_STATE_LABEL: Record<ChainRoundState, string> = {
|
||||
awarded: '낙찰',
|
||||
regenerated: '재생성',
|
||||
failed: '유찰',
|
||||
failed: '결렬',
|
||||
active: '진행중',
|
||||
};
|
||||
|
||||
@@ -296,10 +296,10 @@ export const CLOSE_REASON_LABEL: Record<CloseReason, string> = {
|
||||
[CloseReason.REGEN_PRICE]: '목표초과 — 재협상 진행',
|
||||
[CloseReason.REGEN_EQUAL]: '동가 — 재입찰 진행',
|
||||
[CloseReason.REGEN_NOSHOW]: '전원 미참여 — 재소집 진행',
|
||||
[CloseReason.FAIL_PRICE]: '목표초과로 유찰',
|
||||
[CloseReason.FAIL_EQUAL]: '동가로 유찰',
|
||||
[CloseReason.FAIL_NOSHOW]: '미참여로 유찰',
|
||||
[CloseReason.FAIL_REJECT]: '협상 거부로 유찰',
|
||||
[CloseReason.FAIL_PRICE]: '목표초과로 결렬',
|
||||
[CloseReason.FAIL_EQUAL]: '동가로 결렬',
|
||||
[CloseReason.FAIL_NOSHOW]: '미참여로 결렬',
|
||||
[CloseReason.FAIL_REJECT]: '협상 거부로 결렬',
|
||||
};
|
||||
|
||||
// 마감결과 텍스트(정밀). 마감결과 배지·라벨은 이 값을 쓴다 — close_reason(CloseReason) 을 그대로 표기.
|
||||
|
||||
Reference in new issue
Block a user