summaryrefslogtreecommitdiff
path: root/lib/bidding/list
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-11-24 11:16:32 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-11-24 11:16:32 +0000
commita8674e6b91fb4d356c311fad0251878de154da53 (patch)
tree8bdf91ef99b2628f319df37912ccede1e2f5009c /lib/bidding/list
parent68160eba15a2c8408329b6e14b94d5e44fa7e3ab (diff)
(최겸) 구매 입찰 수정(폐찰, 낙찰 결재 기능 추가 등)
Diffstat (limited to 'lib/bidding/list')
-rw-r--r--lib/bidding/list/bidding-pr-documents-dialog.tsx2
-rw-r--r--lib/bidding/list/create-bidding-dialog.tsx64
2 files changed, 51 insertions, 15 deletions
diff --git a/lib/bidding/list/bidding-pr-documents-dialog.tsx b/lib/bidding/list/bidding-pr-documents-dialog.tsx
index ad377ee5..9d291ad8 100644
--- a/lib/bidding/list/bidding-pr-documents-dialog.tsx
+++ b/lib/bidding/list/bidding-pr-documents-dialog.tsx
@@ -304,7 +304,7 @@ export function PrDocumentsDialog({
</div>
</TableCell>
<TableCell className="text-xs">
- {item.purchaseUnit || "-"}
+ {item.priceUnit || "-"}
</TableCell>
<TableCell>
<div className="flex items-center gap-1">
diff --git a/lib/bidding/list/create-bidding-dialog.tsx b/lib/bidding/list/create-bidding-dialog.tsx
index 2f458873..90abda57 100644
--- a/lib/bidding/list/create-bidding-dialog.tsx
+++ b/lib/bidding/list/create-bidding-dialog.tsx
@@ -201,8 +201,8 @@ export function CreateBiddingDialog() {
materialGroupInfo: '',
materialNumber: '',
materialInfo: '',
- priceUnit: '',
- purchaseUnit: '1',
+ priceUnit: '1',
+ purchaseUnit: 'EA',
materialWeight: '',
wbsCode: '',
wbsName: '',
@@ -427,8 +427,8 @@ export function CreateBiddingDialog() {
materialGroupInfo: '',
materialNumber: '',
materialInfo: '',
- priceUnit: '',
- purchaseUnit: '1',
+ priceUnit: '1',
+ purchaseUnit: 'EA',
materialWeight: '',
wbsCode: '',
wbsName: '',
@@ -471,8 +471,8 @@ export function CreateBiddingDialog() {
prev.map((item) => {
if (item.id === id) {
const updatedItem = { ...item, ...updates }
- // 내정단가, 수량, 중량, 구매단위가 변경되면 내정금액 재계산
- if (updates.targetUnitPrice || updates.quantity || updates.totalWeight || updates.purchaseUnit) {
+ // 내정단가, 수량, 중량, 가격단위가 변경되면 내정금액 재계산
+ if (updates.targetUnitPrice || updates.quantity || updates.totalWeight || updates.priceUnit) {
updatedItem.targetAmount = calculateTargetAmount(updatedItem)
}
return updatedItem
@@ -497,17 +497,17 @@ export function CreateBiddingDialog() {
const calculateTargetAmount = (item: PRItemInfo) => {
const unitPrice = parseFloat(item.targetUnitPrice) || 0
- const purchaseUnit = parseFloat(item.purchaseUnit) || 1 // 기본값 1
+ const priceUnit = parseFloat(item.priceUnit) || 1 // 기본값 1
let amount = 0
if (quantityWeightMode === 'quantity') {
const quantity = parseFloat(item.quantity) || 0
- // (수량 / 구매단위) * 내정단가
- amount = (quantity / purchaseUnit) * unitPrice
+ // (수량 / 가격단위) * 내정단가
+ amount = (quantity / priceUnit) * unitPrice
} else {
const weight = parseFloat(item.totalWeight) || 0
- // (중량 / 구매단위) * 내정단가
- amount = (weight / purchaseUnit) * unitPrice
+ // (중량 / 가격단위) * 내정단가
+ amount = (weight / priceUnit) * unitPrice
}
// 소수점 버림
@@ -772,6 +772,7 @@ export function CreateBiddingDialog() {
<th className="border-r px-3 py-3 text-left text-xs font-medium min-w-[300px]">자재명</th>
<th className="border-r px-3 py-3 text-left text-xs font-medium min-w-[120px]">수량</th>
<th className="border-r px-3 py-3 text-left text-xs font-medium min-w-[80px]">단위</th>
+ <th className="border-r px-3 py-3 text-left text-xs font-medium min-w-[80px]">가격단위</th>
<th className="border-r px-3 py-3 text-left text-xs font-medium min-w-[80px]">구매단위</th>
<th className="border-r px-3 py-3 text-left text-xs font-medium min-w-[120px]">내정단가</th>
<th className="border-r px-3 py-3 text-left text-xs font-medium min-w-[120px]">내정금액</th>
@@ -955,13 +956,48 @@ export function CreateBiddingDialog() {
type="number"
min="1"
step="1"
- placeholder="구매단위"
- value={item.purchaseUnit || ''}
- onChange={(e) => updatePRItem(item.id, { purchaseUnit: e.target.value })}
+ placeholder="가격단위"
+ value={item.priceUnit || ''}
+ onChange={(e) => updatePRItem(item.id, { priceUnit: e.target.value })}
className="h-8 text-xs"
/>
</td>
<td className="border-r px-3 py-2">
+ {quantityWeightMode === 'quantity' ? (
+ <Select
+ value={item.purchaseUnit || item.quantityUnit || 'EA'}
+ onValueChange={(value) => updatePRItem(item.id, { purchaseUnit: value })}
+ >
+ <SelectTrigger className="h-8 text-xs">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="EA">EA</SelectItem>
+ <SelectItem value="SET">SET</SelectItem>
+ <SelectItem value="LOT">LOT</SelectItem>
+ <SelectItem value="M">M</SelectItem>
+ <SelectItem value="M2">M²</SelectItem>
+ <SelectItem value="M3">M³</SelectItem>
+ </SelectContent>
+ </Select>
+ ) : (
+ <Select
+ value={item.purchaseUnit || item.weightUnit || 'KG'}
+ onValueChange={(value) => updatePRItem(item.id, { purchaseUnit: value })}
+ >
+ <SelectTrigger className="h-8 text-xs">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="KG">KG</SelectItem>
+ <SelectItem value="TON">TON</SelectItem>
+ <SelectItem value="G">G</SelectItem>
+ <SelectItem value="LB">LB</SelectItem>
+ </SelectContent>
+ </Select>
+ )}
+ </td>
+ <td className="border-r px-3 py-2">
<Input
type="number"
min="0"