From daabc02e9ae54f216ada77aa826b349f37c3281a Mon Sep 17 00:00:00 2001 From: dujinkim Date: Thu, 27 Nov 2025 09:43:55 +0000 Subject: (최겸) 구매 입찰 피드백 반영(80%완) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vendor/components/pr-items-pricing-table.tsx | 140 +++++++++++---------- 1 file changed, 75 insertions(+), 65 deletions(-) (limited to 'lib/bidding/vendor/components/pr-items-pricing-table.tsx') diff --git a/lib/bidding/vendor/components/pr-items-pricing-table.tsx b/lib/bidding/vendor/components/pr-items-pricing-table.tsx index a0230478..7dd8384e 100644 --- a/lib/bidding/vendor/components/pr-items-pricing-table.tsx +++ b/lib/bidding/vendor/components/pr-items-pricing-table.tsx @@ -42,7 +42,7 @@ interface PrItem { materialGroupInfo: string | null materialNumber: string | null materialInfo: string | null - requestedDeliveryDate: Date | null + requestedDeliveryDate: Date | string | null annualUnitPrice: string | null currency: string | null quantity: string | null @@ -54,6 +54,11 @@ interface PrItem { materialWeight: string | null prNumber: string | null hasSpecDocument: boolean | null + specification: string | null + bidUnitPrice?: string | number | null + bidAmount?: string | number | null + proposedDeliveryDate?: string | Date | null + technicalSpecification?: string | null } interface PrItemQuotation { @@ -189,6 +194,18 @@ export function PrItemsPricingTable({ if (existing) { return existing } + + // prItems 자체에 견적 정보가 있는 경우 활용 + if (item.bidUnitPrice !== undefined || item.bidAmount !== undefined) { + return { + prItemId: item.id, + bidUnitPrice: item.bidUnitPrice ? Number(item.bidUnitPrice) : 0, + bidAmount: item.bidAmount ? Number(item.bidAmount) : 0, + proposedDeliveryDate: item.proposedDeliveryDate ? (item.proposedDeliveryDate instanceof Date ? item.proposedDeliveryDate.toISOString().split('T')[0] : String(item.proposedDeliveryDate)) : '', + technicalSpecification: item.technicalSpecification || '' + } + } + return { prItemId: item.id, bidUnitPrice: 0, @@ -288,22 +305,22 @@ export function PrItemsPricingTable({ - 아이템번호 - PR번호 - 품목정보 - 자재내역 + 자재번호 + 자재명 + SHI 납품예정일 + 업체 납품예정일 수량 - 단위 + 구매단위 가격단위 - 중량 - 중량단위 구매단위 - SHI 납품요청일 + 총중량 + 중량단위 입찰단가 입찰금액 - 납품예정일 - {/* 기술사양 */} - SPEC + 업체 통화 + 자재내역상세 + 스팩 + P/R번호 @@ -318,35 +335,46 @@ export function PrItemsPricingTable({ return ( - - {item.itemNumber || '-'} - - {item.prNumber || '-'} -
- {item.itemInfo || '-'} -
+ {item.materialNumber || '-'}
{item.materialInfo || '-'}
+ + {item.requestedDeliveryDate ? + formatDate(new Date(item.requestedDeliveryDate), 'KR') : '-' + } + + + {readOnly ? ( + quotation.proposedDeliveryDate ? + formatDate(quotation.proposedDeliveryDate, 'KR') : '-' + ) : ( + updateQuotation( + item.id, + 'proposedDeliveryDate', + e.target.value + )} + className="w-40" + /> + )} + {item.quantity ? parseFloat(item.quantity).toLocaleString() : '-'} {item.quantityUnit || '-'} {item.priceUnit || '-'} + {item.purchaseUnit || '-'} {item.totalWeight ? parseFloat(item.totalWeight).toLocaleString() : '-'} {item.weightUnit || '-'} - {item.purchaseUnit || '-'} - - {item.requestedDeliveryDate ? - formatDate(item.requestedDeliveryDate, 'KR') : '-' - } - {readOnly ? ( @@ -355,12 +383,23 @@ export function PrItemsPricingTable({ ) : ( updateQuotation( - item.id, - 'bidUnitPrice', - parseFloat(e.target.value) || 0 - )} + inputMode="decimal" + min={0} + pattern="^(0|[1-9][0-9]*)(\.[0-9]+)?$" + value={quotation.bidUnitPrice === 0 ? '' : quotation.bidUnitPrice} + onChange={(e) => { + let value = e.target.value + if (/^0[0-9]+/.test(value)) { + value = value.replace(/^0+/, '') + if (value === '') value = '0' + } + const numericValue = parseFloat(value) + updateQuotation( + item.id, + 'bidUnitPrice', + isNaN(numericValue) ? 0 : numericValue + ) + }} className="w-32 text-right" placeholder="단가" /> @@ -371,42 +410,12 @@ export function PrItemsPricingTable({ {formatCurrency(quotation.bidAmount)} + {currency} - {readOnly ? ( - quotation.proposedDeliveryDate ? - formatDate(quotation.proposedDeliveryDate, 'KR') : '-' - ) : ( - updateQuotation( - item.id, - 'proposedDeliveryDate', - e.target.value - )} - className="w-40" - /> - )} +
+ {item.specification || '-'} +
- {/* - {readOnly ? ( -
- {quotation.technicalSpecification || '-'} -
- ) : ( -