summaryrefslogtreecommitdiff
path: root/lib/procurement-rfqs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/procurement-rfqs')
-rw-r--r--lib/procurement-rfqs/services.ts21
-rw-r--r--lib/procurement-rfqs/table/detail-table/rfq-detail-column.tsx28
-rw-r--r--lib/procurement-rfqs/table/detail-table/update-vendor-sheet.tsx2
3 files changed, 33 insertions, 18 deletions
diff --git a/lib/procurement-rfqs/services.ts b/lib/procurement-rfqs/services.ts
index 32048768..3816605c 100644
--- a/lib/procurement-rfqs/services.ts
+++ b/lib/procurement-rfqs/services.ts
@@ -721,6 +721,8 @@ export async function sendRfq(rfqId: number) {
rfqSendDate: true,
remark: true,
rfqSealedYn: true,
+ itemCode: true,
+ itemName: true,
},
with: {
project: {
@@ -730,13 +732,6 @@ export async function sendRfq(rfqId: number) {
name: true,
}
},
- item: {
- columns: {
- id: true,
- itemCode: true,
- itemName: true,
- }
- },
createdByUser: {
columns: {
id: true,
@@ -1654,11 +1649,7 @@ export async function getVendorQuotations(input: GetQuotationsSchema, vendorId:
offset,
limit: perPage,
with: {
- rfq: {
- with: {
- item: true, // 여기서 item 정보도 가져옴
- }
- },
+ rfq:true,
vendor: true,
}
});
@@ -1669,7 +1660,6 @@ export async function getVendorQuotations(input: GetQuotationsSchema, vendorId:
.where(finalWhere || undefined)
.then(rows => rows[0]);
- console.log(totalCount)
// 페이지 수 계산
const pageCount = Math.ceil(Number(totalCount) / perPage);
@@ -1894,7 +1884,8 @@ export async function fetchExternalRfqs() {
rfqCode,
projectId: randomProject.id,
series:seriesValue,
- itemId: randomItem.id,
+ itemCode: randomItem.itemCode || `ITEM-${Math.floor(Math.random() * 1000)}`, // itemId 대신 itemCode 사용
+ itemName: randomItem.itemName || `임의 아이템 ${Math.floor(Math.random() * 100)}`, // itemName 추가
dueDate,
rfqSendDate: null, // null로 설정/
status: "RFQ Created",
@@ -1932,7 +1923,7 @@ export async function fetchExternalRfqs() {
rfqItem: `RFQI-${Math.floor(Math.random() * 1000)}`,
prItem: `PRI-${Math.floor(Math.random() * 1000)}`,
prNo: `PRN-${Math.floor(Math.random() * 1000)}`,
- itemId: randomItem.id,
+ // itemId: randomItem.id,
materialCode,
materialCategory: "Standard",
acc: `ACC-${Math.floor(Math.random() * 100)}`,
diff --git a/lib/procurement-rfqs/table/detail-table/rfq-detail-column.tsx b/lib/procurement-rfqs/table/detail-table/rfq-detail-column.tsx
index ce5e7767..bc257202 100644
--- a/lib/procurement-rfqs/table/detail-table/rfq-detail-column.tsx
+++ b/lib/procurement-rfqs/table/detail-table/rfq-detail-column.tsx
@@ -17,7 +17,7 @@ import {
DropdownMenuSubTrigger,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
-import { Ellipsis, MessageCircle } from "lucide-react";
+import { Ellipsis, MessageCircle, ExternalLink } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
@@ -116,7 +116,31 @@ export function getRfqDetailColumns({
header: ({ column }) => (
<DataTableColumnHeaderSimple column={column} title="벤더명" />
),
- cell: ({ row }) => <div>{row.getValue("vendorName")}</div>,
+ cell: ({ row }) => {
+ const vendorName = row.getValue("vendorName") as string;
+ const vendorId = row.original.vendorId;
+
+ if (!vendorName || !vendorId) {
+ return <div>{vendorName}</div>;
+ }
+
+ const handleVendorClick = () => {
+ window.open(`/evcp/vendors/${vendorId}/info`, '_blank');
+ };
+
+ return (
+ <Button
+ variant="link"
+ className="h-auto p-0 text-left justify-start font-normal text-foreground underline-offset-4 hover:underline"
+ onClick={handleVendorClick}
+ >
+ <span className="flex items-center gap-1">
+ {vendorName}
+ {/* <ExternalLink className="h-3 w-3 opacity-50" /> */}
+ </span>
+ </Button>
+ );
+ },
meta: {
excelHeader: "벤더명"
},
diff --git a/lib/procurement-rfqs/table/detail-table/update-vendor-sheet.tsx b/lib/procurement-rfqs/table/detail-table/update-vendor-sheet.tsx
index 45e4a602..edc04788 100644
--- a/lib/procurement-rfqs/table/detail-table/update-vendor-sheet.tsx
+++ b/lib/procurement-rfqs/table/detail-table/update-vendor-sheet.tsx
@@ -415,7 +415,7 @@ export function UpdateRfqDetailSheet({
/>
</FormControl>
<div className="space-y-1 leading-none">
- <FormLabel>자재 가격 관련 여부</FormLabel>
+ <FormLabel>하도급 대금 연동 여부</FormLabel>
</div>
</FormItem>
)}