Add details

This commit is contained in:
ariari04 2024-09-04 22:12:45 +06:00
parent 1d68743bc8
commit 3b510b6d42
4 changed files with 51 additions and 2 deletions

View File

@ -11,6 +11,7 @@ const TenderDetails = async ({
const response = await apiInstance.get<ITenders>( const response = await apiInstance.get<ITenders>(
`/procurements/${params.id}/` `/procurements/${params.id}/`
); );
console.log(response.data);
return response.data; return response.data;
}; };
@ -137,6 +138,38 @@ const TenderDetails = async ({
size="lg" size="lg"
className="font-bold text-[24px] mb-[30px]" className="font-bold text-[24px] mb-[30px]"
/> />
<div className="w-full">
{data.lots.length > 0 &&
data.lots.map((lot) => (
<div
key={lot.id}
className="bg-white w-full h-[213px] px-34 py-27 flex gap-[186px] items-center shadow-md"
>
<div className="w-[840px]">
<Title
text={lot.id_of_lot}
className="text-[24px] font-bold mb-[16px]"
/>
<Title
text={lot.name_of_lot}
className="text-[18px] font-semibold mb-[24px]"
/>
<p className="text-gray-500 ">Место работ / услуг</p>
<p>{lot.address_of_lots}</p>
</div>
<div>
<p>Планируемая сумма</p>
<Title text={lot.summ} className="text-[18px] font-semibold" />
</div>
</div>
))}
</div>
<Title
text={"Документы"}
size="lg"
className="font-bold text-[24px] mb-[30px]"
/>
</Container> </Container>
); );
}; };

View File

@ -12,6 +12,7 @@ interface Props {
date_of_publication_datetime: string; date_of_publication_datetime: string;
date_of_offer_datetime: string; date_of_offer_datetime: string;
current_timestamp: string; current_timestamp: string;
plan_summ: string;
} }
const TenderCard: React.FC<Props> = ({ const TenderCard: React.FC<Props> = ({
id, id,
@ -23,7 +24,9 @@ const TenderCard: React.FC<Props> = ({
date_of_publication_datetime, date_of_publication_datetime,
date_of_offer_datetime, date_of_offer_datetime,
current_timestamp, current_timestamp,
plan_summ,
}: Props) => { }: Props) => {
console.log(plan_summ);
return ( return (
<div className="w-full min-h-[213px] bg-white shadow-sm rounded-sm flex gap-[82px] items-center p-6"> <div className="w-full min-h-[213px] bg-white shadow-sm rounded-sm flex gap-[82px] items-center p-6">
<div className="w-[840px] flex flex-col"> <div className="w-[840px] flex flex-col">
@ -42,7 +45,10 @@ const TenderCard: React.FC<Props> = ({
{name_of_organization} {name_of_organization}
</h2> </h2>
</div> </div>
<div className="w-[285px]"></div> <div className="w-[285px]">
<p className="text-[14px] leading-6">Планируемая сумма</p>
<Title text={plan_summ} />
</div>
</div> </div>
); );
}; };

View File

@ -1,5 +1,13 @@
import { IList } from "./list-type"; import { IList } from "./list-type";
export interface Lot {
id: number;
id_of_lot: string;
name_of_lot: string;
summ: string;
address_of_lots: string;
procurement: number;
}
export interface ITenders { export interface ITenders {
id: number; id: number;
id_of_card: string; id_of_card: string;
@ -14,6 +22,7 @@ export interface ITenders {
tel_number: string; tel_number: string;
more_info_url: string; more_info_url: string;
more_info_pdf: string; more_info_pdf: string;
lots: Lot[];
} }
export interface ITendersList extends IList { export interface ITendersList extends IList {

View File

@ -19,7 +19,7 @@ const TendersList: React.FC<Props> = ({ searchParams }) => {
useEffect(() => { useEffect(() => {
getTenders(activePage); getTenders(activePage);
}, [activePage]); }, [activePage]);
console.log(tenders);
const handleSubmit = () => {}; const handleSubmit = () => {};
return ( return (
<div> <div>
@ -41,6 +41,7 @@ const TendersList: React.FC<Props> = ({ searchParams }) => {
date_of_publication_datetime={tender.date_of_publication_datetime} date_of_publication_datetime={tender.date_of_publication_datetime}
date_of_offer_datetime={tender.date_of_offer_datetime} date_of_offer_datetime={tender.date_of_offer_datetime}
current_timestamp={tender.current_timestamp} current_timestamp={tender.current_timestamp}
plan_summ={tender.plan_summ}
/> />
))} ))}
<Pagination <Pagination