diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-26 09:57:24 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-26 09:57:24 +0000 |
| commit | 8b23b471638a155fd1bfa3a8c853b26d9315b272 (patch) | |
| tree | 47353e9dd342011cb2f1dcd24b09661707a8421b /lib/rfq-last | |
| parent | d62368d2b68d73da895977e60a18f9b1286b0545 (diff) | |
(대표님) 권한관리, 문서업로드, rfq첨부, SWP문서룰 등
(최겸) 입찰
Diffstat (limited to 'lib/rfq-last')
| -rw-r--r-- | lib/rfq-last/service.ts | 20 | ||||
| -rw-r--r-- | lib/rfq-last/table/create-general-rfq-dialog.tsx | 44 | ||||
| -rw-r--r-- | lib/rfq-last/table/rfq-table-columns.tsx | 18 | ||||
| -rw-r--r-- | lib/rfq-last/vendor-response/editor/quotation-items-table.tsx | 6 | ||||
| -rw-r--r-- | lib/rfq-last/vendor-response/rfq-attachments-dialog.tsx | 4 | ||||
| -rw-r--r-- | lib/rfq-last/vendor/batch-update-conditions-dialog.tsx | 2 |
6 files changed, 63 insertions, 31 deletions
diff --git a/lib/rfq-last/service.ts b/lib/rfq-last/service.ts index be8e13e6..f2894577 100644 --- a/lib/rfq-last/service.ts +++ b/lib/rfq-last/service.ts @@ -39,21 +39,23 @@ export async function getRfqs(input: GetRfqsSchema) { switch (input.rfqCategory) { case "general": // 일반견적: rfqType이 있는 경우 - typeFilter = and( - isNotNull(rfqsLastView.rfqType), - ne(rfqsLastView.rfqType, '') - ); + // typeFilter = and( + // isNotNull(rfqsLastView.rfqType), + // ne(rfqsLastView.rfqType, '') + // ); + // 일반견적: rfqCode가 F로 시작하는 경우 + typeFilter = + like(rfqsLastView.rfqCode,'F%'); break; case "itb": // ITB: projectCompany가 있는 경우 typeFilter = - like(rfqsLastView.rfqCode,'I%') - - ; + like(rfqsLastView.rfqCode,'I%'); break; case "rfq": // RFQ: prNumber가 있는 경우 - typeFilter = like(rfqsLastView.rfqCode,'R%'); + typeFilter = + like(rfqsLastView.rfqCode,'R%'); break; } } @@ -244,7 +246,7 @@ export async function getRfqAllAttachments(rfqId: number) { } } } -// 사용자 목록 조회 (필터용) +// 사용자 목록 조회 (필터용), 견적담당자, 구매담당자 export async function getPUsersForFilter() { try { diff --git a/lib/rfq-last/table/create-general-rfq-dialog.tsx b/lib/rfq-last/table/create-general-rfq-dialog.tsx index f7515787..023c9f2a 100644 --- a/lib/rfq-last/table/create-general-rfq-dialog.tsx +++ b/lib/rfq-last/table/create-general-rfq-dialog.tsx @@ -76,7 +76,7 @@ const createGeneralRfqSchema = z.object({ }), picUserId: z.number().min(1, "견적담당자를 선택해주세요"), remark: z.string().optional(), - items: z.array(itemSchema).min(1, "최소 하나의 아이템을 추가해주세요"), + items: z.array(itemSchema).min(1, "최소 하나의 자재를 추가해주세요"), }) type CreateGeneralRfqFormValues = z.infer<typeof createGeneralRfqSchema> @@ -386,7 +386,7 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp {field.value ? ( format(field.value, "yyyy-MM-dd") ) : ( - <span>제출마감일을 선택하세요 (미선택 시 생성일 +7일)</span> + <span>제출마감일을 선택하세요</span> )} <CalendarIcon className="ml-auto h-4 w-4 opacity-50" /> </Button> @@ -562,7 +562,7 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp {/* 아이템 정보 섹션 - 컴팩트한 UI */} <div className="space-y-4"> <div className="flex items-center justify-between"> - <h3 className="text-lg font-semibold">아이템 정보</h3> + <h3 className="text-lg font-semibold">자재 정보</h3> <Button type="button" variant="outline" @@ -570,7 +570,7 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp onClick={handleAddItem} > <PlusCircle className="mr-2 h-4 w-4" /> - 아이템 추가 + 자재 추가 </Button> </div> @@ -579,7 +579,7 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp <div key={field.id} className="border rounded-lg p-3 bg-gray-50/50"> <div className="flex items-center justify-between mb-3"> <span className="text-sm font-medium text-gray-700"> - 아이템 #{index + 1} + 자재 #{index + 1} </span> {fields.length > 1 && ( <Button @@ -623,7 +623,7 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp render={({ field }) => ( <FormItem> <FormLabel className="text-xs"> - 자재명 <span className="text-red-500">*</span> + 자재그룹(자재그룹명) <span className="text-red-500">*</span> </FormLabel> <FormControl> <Input @@ -670,13 +670,29 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp <FormLabel className="text-xs"> 단위 <span className="text-red-500">*</span> </FormLabel> - <FormControl> - <Input - placeholder="EA" - className="h-8 text-sm" - {...field} - /> - </FormControl> + <Select onValueChange={field.onChange} value={field.value}> + <FormControl> + <SelectTrigger className="h-8 text-sm"> + <SelectValue placeholder="단위 선택" /> + </SelectTrigger> + </FormControl> + <SelectContent> + <SelectItem value="EA">EA (Each)</SelectItem> + <SelectItem value="KG">KG (Kilogram)</SelectItem> + <SelectItem value="M">M (Meter)</SelectItem> + <SelectItem value="L">L (Liter)</SelectItem> + <SelectItem value="PC">PC (Piece)</SelectItem> + <SelectItem value="BOX">BOX (Box)</SelectItem> + <SelectItem value="SET">SET (Set)</SelectItem> + <SelectItem value="LOT">LOT (Lot)</SelectItem> + <SelectItem value="PCS">PCS (Pieces)</SelectItem> + <SelectItem value="TON">TON (Ton)</SelectItem> + <SelectItem value="G">G (Gram)</SelectItem> + <SelectItem value="ML">ML (Milliliter)</SelectItem> + <SelectItem value="CM">CM (Centimeter)</SelectItem> + <SelectItem value="MM">MM (Millimeter)</SelectItem> + </SelectContent> + </Select> <FormMessage /> </FormItem> )} @@ -693,7 +709,7 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp <FormLabel className="text-xs">비고</FormLabel> <FormControl> <Input - placeholder="아이템별 비고사항" + placeholder="자재별 비고사항" className="h-8 text-sm" {...field} /> diff --git a/lib/rfq-last/table/rfq-table-columns.tsx b/lib/rfq-last/table/rfq-table-columns.tsx index fc7f4415..d0a9ee1e 100644 --- a/lib/rfq-last/table/rfq-table-columns.tsx +++ b/lib/rfq-last/table/rfq-table-columns.tsx @@ -140,7 +140,11 @@ export function getRfqColumns({ { accessorKey: "picUserName", header: ({ column }) => <DataTableColumnHeaderSimple column={column} title="구매담당자" />, - cell: ({ row }) => row.original.picUserName || row.original.picName || "-", + cell: ({ row }) => { + const name = row.original.picUserName || row.original.picName || "-"; + const picCode = row.original.picCode || ""; + return name === "-" ? "-" : `${name}(${picCode})`; + }, size: 100, }, @@ -473,7 +477,11 @@ export function getRfqColumns({ { accessorKey: "picUserName", header: ({ column }) => <DataTableColumnHeaderSimple column={column} title="구매담당자" />, - cell: ({ row }) => row.original.picUserName || row.original.picName || "-", + cell: ({ row }) => { + const name = row.original.picUserName || row.original.picName || "-"; + const picCode = row.original.picCode || ""; + return name === "-" ? "-" : `${name}(${picCode})`; + }, size: 100, }, @@ -1035,7 +1043,11 @@ export function getRfqColumns({ { accessorKey: "picUserName", header: ({ column }) => <DataTableColumnHeaderSimple column={column} title="구매담당자" />, - cell: ({ row }) => row.original.picUserName || row.original.picName || "-", + cell: ({ row }) => { + const name = row.original.picUserName || row.original.picName || "-"; + const picCode = row.original.picCode || ""; + return name === "-" ? "-" : `${name}(${picCode})`; + }, size: 100, }, diff --git a/lib/rfq-last/vendor-response/editor/quotation-items-table.tsx b/lib/rfq-last/vendor-response/editor/quotation-items-table.tsx index 4a8960ff..26c3808a 100644 --- a/lib/rfq-last/vendor-response/editor/quotation-items-table.tsx +++ b/lib/rfq-last/vendor-response/editor/quotation-items-table.tsx @@ -410,15 +410,15 @@ export default function QuotationItemsTable({ prItems }: QuotationItemsTableProp <Input type="number" min="0" - step="0.01" + step="1" {...register(`quotationItems.${index}.unitPrice`, { valueAsNumber: true })} onChange={(e) => { - const value = Math.max(0, parseFloat(e.target.value) || 0) + const value = Math.max(0, Math.floor(parseFloat(e.target.value) || 0)) setValue(`quotationItems.${index}.unitPrice`, value) calculateTotal(index) }} className="w-[120px]" - placeholder="0.00" + placeholder="0" /> <span className="text-xs text-muted-foreground"> {currency} diff --git a/lib/rfq-last/vendor-response/rfq-attachments-dialog.tsx b/lib/rfq-last/vendor-response/rfq-attachments-dialog.tsx index cfe24d73..2b3138d6 100644 --- a/lib/rfq-last/vendor-response/rfq-attachments-dialog.tsx +++ b/lib/rfq-last/vendor-response/rfq-attachments-dialog.tsx @@ -380,7 +380,7 @@ export function RfqAttachmentsDialog({ isOpen, onClose, rfqData }: RfqAttachment )} {/* 전체 다운로드 버튼 추가 */} - {attachments.length > 0 && !isLoading && ( + {/* {attachments.length > 0 && !isLoading && ( <Button onClick={handleDownloadAll} disabled={isDownloadingAll} @@ -399,7 +399,7 @@ export function RfqAttachmentsDialog({ isOpen, onClose, rfqData }: RfqAttachment </> )} </Button> - )} + )} */} </div> </DialogContent> </Dialog> diff --git a/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx b/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx index 893fd9a3..ff3e27cc 100644 --- a/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx +++ b/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx @@ -436,7 +436,9 @@ export function BatchUpdateConditionsDialog({ className="w-full justify-between" disabled={!fieldsToUpdate.currency} > + <span className="text-muted-foreground"> {field.value || "통화 선택"} + </span> <ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" /> </Button> </PopoverTrigger> |
