summaryrefslogtreecommitdiff
path: root/components/bidding/manage/bidding-items-editor.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-11-28 03:12:57 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-11-28 03:12:57 +0000
commit9cda8482660a87fd98c9ee43f507d75ff75b4e23 (patch)
tree67eb1fc24eec7c4e61d3154f7b09fc5349454672 /components/bidding/manage/bidding-items-editor.tsx
parentf57898bd240d068301ce3ef477f52cff1234e4ee (diff)
(최겸) 구매 입찰 피드백 반영(90%)
Diffstat (limited to 'components/bidding/manage/bidding-items-editor.tsx')
-rw-r--r--components/bidding/manage/bidding-items-editor.tsx35
1 files changed, 30 insertions, 5 deletions
diff --git a/components/bidding/manage/bidding-items-editor.tsx b/components/bidding/manage/bidding-items-editor.tsx
index ef0aa568..9d858f40 100644
--- a/components/bidding/manage/bidding-items-editor.tsx
+++ b/components/bidding/manage/bidding-items-editor.tsx
@@ -807,7 +807,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
<Checkbox
checked={item.isRepresentative}
onCheckedChange={() => setRepresentativeItem(item.id)}
- disabled={items.length <= 1 && item.isRepresentative}
+ disabled={(items.length <= 1 && item.isRepresentative) || readonly}
title="대표 아이템"
/>
</td>
@@ -831,6 +831,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
}
}}
placeholder="프로젝트 선택"
+ disabled={readonly}
/>
</td>
<td className="border-r px-3 py-2">
@@ -942,21 +943,25 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
<Input
type="number"
min="0"
+ step="0.001"
placeholder="수량"
value={item.quantity || ''}
onChange={(e) => updatePRItem(item.id, { quantity: e.target.value })}
className="h-8 text-xs"
required
+ disabled={readonly}
/>
) : (
<Input
type="number"
min="0"
+ step="0.001"
placeholder="중량"
value={item.totalWeight || ''}
onChange={(e) => updatePRItem(item.id, { totalWeight: e.target.value })}
className="h-8 text-xs"
required
+ disabled={readonly}
/>
)}
</td>
@@ -966,6 +971,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
value={item.quantityUnit || 'EA'}
onValueChange={(value) => updatePRItem(item.id, { quantityUnit: value })}
required
+ disabled={readonly}
>
<SelectTrigger className="h-8 text-xs">
<SelectValue />
@@ -984,6 +990,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
value={item.weightUnit || 'KG'}
onValueChange={(value) => updatePRItem(item.id, { weightUnit: value })}
required
+ disabled={readonly}
>
<SelectTrigger className="h-8 text-xs">
<SelectValue />
@@ -1004,6 +1011,9 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
onChange={(e) => updatePRItem(item.id, { requestedDeliveryDate: e.target.value })}
className="h-8 text-xs"
required
+ disabled={readonly}
+ min="1900-01-01"
+ max="2100-12-31"
/>
</td>
<td className="border-r px-3 py-2">
@@ -1015,12 +1025,14 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
value={item.priceUnit || ''}
onChange={(e) => updatePRItem(item.id, { priceUnit: e.target.value })}
className="h-8 text-xs"
+ disabled={readonly}
/>
</td>
<td className="border-r px-3 py-2">
<Select
value={item.purchaseUnit || 'EA'}
onValueChange={(value) => updatePRItem(item.id, { purchaseUnit: value })}
+ disabled={readonly}
>
<SelectTrigger className="h-8 text-xs">
<SelectValue />
@@ -1043,11 +1055,12 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
<Input
type="number"
min="0"
- step="0.01"
+ step="0.001"
placeholder="자재순중량"
value={item.materialWeight || ''}
onChange={(e) => updatePRItem(item.id, { materialWeight: e.target.value })}
className="h-8 text-xs"
+ disabled={readonly}
/>
</td>
<td className="border-r px-3 py-2">
@@ -1057,6 +1070,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
value={formatNumberWithCommas(item.targetUnitPrice)}
onChange={(e) => updatePRItem(item.id, { targetUnitPrice: parseNumberFromCommas(e.target.value) })}
className="h-8 text-xs"
+ disabled={readonly}
/>
</td>
<td className="border-r px-3 py-2">
@@ -1072,6 +1086,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
<Select
value={item.targetCurrency || 'KRW'}
onValueChange={(value) => updatePRItem(item.id, { targetCurrency: value })}
+ disabled={readonly}
>
<SelectTrigger className="h-8 text-xs">
<SelectValue />
@@ -1091,12 +1106,14 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
value={formatNumberWithCommas(item.budgetAmount)}
onChange={(e) => updatePRItem(item.id, { budgetAmount: parseNumberFromCommas(e.target.value) })}
className="h-8 text-xs"
+ disabled={readonly}
/>
</td>
<td className="border-r px-3 py-2">
<Select
value={item.budgetCurrency || 'KRW'}
onValueChange={(value) => updatePRItem(item.id, { budgetCurrency: value })}
+ disabled={readonly}
>
<SelectTrigger className="h-8 text-xs">
<SelectValue />
@@ -1116,12 +1133,14 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
value={formatNumberWithCommas(item.actualAmount)}
onChange={(e) => updatePRItem(item.id, { actualAmount: parseNumberFromCommas(e.target.value) })}
className="h-8 text-xs"
+ disabled={readonly}
/>
</td>
<td className="border-r px-3 py-2">
<Select
value={item.actualCurrency || 'KRW'}
onValueChange={(value) => updatePRItem(item.id, { actualCurrency: value })}
+ disabled={readonly}
>
<SelectTrigger className="h-8 text-xs">
<SelectValue />
@@ -1148,6 +1167,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
setWbsCodeDialogOpen(true)
}}
className="w-full justify-start h-8 text-xs"
+ disabled={readonly}
>
{item.wbsCode ? (
<span className="truncate">
@@ -1201,6 +1221,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
setCostCenterDialogOpen(true)
}}
className="w-full justify-start h-8 text-xs"
+ disabled={readonly}
>
{item.costCenterCode ? (
<span className="truncate">
@@ -1254,6 +1275,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
setGlAccountDialogOpen(true)
}}
className="w-full justify-start h-8 text-xs"
+ disabled={readonly}
>
{item.glAccountCode ? (
<span className="truncate">
@@ -1309,7 +1331,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
variant="ghost"
size="sm"
onClick={() => handleRemoveItem(item.id)}
- disabled={items.length <= 1}
+ disabled={items.length <= 1 || readonly}
className="h-7 w-7 p-0"
title="품목 삭제"
>
@@ -1343,11 +1365,11 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
</p>
</div>
<div className="flex gap-2">
- <Button onClick={() => setPreQuoteDialogOpen(true)} variant="outline" className="flex items-center gap-2">
+ <Button onClick={() => setPreQuoteDialogOpen(true)} variant="outline" className="flex items-center gap-2" disabled={readonly}>
<FileText className="h-4 w-4" />
사전견적
</Button>
- <Button onClick={handleAddItem} className="flex items-center gap-2">
+ <Button onClick={handleAddItem} className="flex items-center gap-2" disabled={readonly}>
<Plus className="h-4 w-4" />
품목 추가
</Button>
@@ -1364,6 +1386,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
onChange={(e) => setTargetPriceCalculationCriteria(e.target.value)}
rows={3}
className="resize-none"
+ disabled={readonly}
/>
<p className="text-xs text-muted-foreground">
내정가를 산정한 기준이나 방법을 입력하세요
@@ -1379,6 +1402,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
checked={quantityWeightMode === 'quantity'}
onChange={() => handleQuantityWeightModeChange('quantity')}
className="h-4 w-4"
+ disabled={readonly}
/>
<label htmlFor="quantity-mode" className="text-sm">수량 기준</label>
</div>
@@ -1390,6 +1414,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems
checked={quantityWeightMode === 'weight'}
onChange={() => handleQuantityWeightModeChange('weight')}
className="h-4 w-4"
+ disabled={readonly}
/>
<label htmlFor="weight-mode" className="text-sm">중량 기준</label>
</div>