Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
JJIIIINN committed Mar 25, 2024
2 parents 48253b3 + 18257a8 commit e2d803c
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 43 deletions.
3 changes: 3 additions & 0 deletions src/Apis/Companies/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ export interface CompanyInfoEditType {
take: number;
service_name: string;
company_profile_url: string;
representative_phone_no: string;
business_area_code: number;
biz_registration_url: string;
}
2 changes: 2 additions & 0 deletions src/Apis/Companies/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ export interface CompanyDetailResponse {
attachments: string[];
service_name: string;
business_area: string;
business_area_code: number;
biz_registration_url: string;
}
50 changes: 39 additions & 11 deletions src/Components/Detail/CompanyDetail/Basic/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Button, Stack, Text } from '@team-return/design-system';
import { Button, Stack, Text, Icon } from '@team-return/design-system';
import { Dispatch, SetStateAction } from 'react';
import { useNavigate } from 'react-router-dom';
import { CompanyDetailResponse } from '../../../../Apis/Companies/response';
import * as _ from '../../style';
import { useDownloadData } from '../../../../Apis/File';

interface PropsType {
companyDetailInfo: CompanyDetailResponse;
Expand All @@ -14,42 +15,69 @@ export function CompanyDetailBasic({
setCanEdit,
}: PropsType) {
const navigate = useNavigate();

const nameArray = decodeURI(companyDetailInfo?.biz_registration_url).split(
'/'
);
const { mutate: downloadFile } = useDownloadData({
fileName: nameArray[nameArray.length - 1].substring(37),
fileUrl: companyDetailInfo?.biz_registration_url,
});

return (
<_.Container>
<_.Wrapper>
<Stack direction="column">
<_.BackWrapper onClick={() => navigate(-1)}>
<_.BackIcon
icon="Chevron"
/>
<Text margin={[0, 0, -4, 0]} size='Body2'>뒤로가기</Text>
<_.BackIcon icon="Chevron" />
<Text margin={[0, 0, -4, 0]} size="Body2">
뒤로가기
</Text>
</_.BackWrapper>
<_.LogoWrapper>
<_.CompanyLogo
src={`${process.env.REACT_APP_FILE_URL}${companyDetailInfo?.company_profile_url}`}
/>
</_.LogoWrapper>
</Stack>
<Button size="M" onClick={() => setCanEdit(true)}>
수정
</Button>
<Stack gap={10}>
<Button
size="M"
onClick={() => {
downloadFile();
}}
>
사업자등록증
<Icon icon="Download" color="gray10" size={20}></Icon>
</Button>
<Button size="M" onClick={() => setCanEdit(true)}>
수정
</Button>
</Stack>
</_.Wrapper>
<_.Stack>
<_.TitleBox>기업명</_.TitleBox>
<_.ContentBox width={25}>
<_.ContentBox width={15}>
{companyDetailInfo?.company_name}
</_.ContentBox>
<_.TitleBox>사업자 번호</_.TitleBox>
<_.ContentBox width={25}>
<_.ContentBox width={15}>
{companyDetailInfo?.business_number.replace(
/(\d{3})(\d{2})(\d{5})/,
'$1-$2-$3'
)}
</_.ContentBox>
<_.TitleBox>대표자</_.TitleBox>
<_.ContentBox width={20}>
<_.ContentBox width={15}>
{companyDetailInfo?.representative_name}
</_.ContentBox>
<_.TitleBox>대표 전화번호</_.TitleBox>
<_.ContentBox width={15}>
{companyDetailInfo?.representative_phone_no.replace(
/(\d{3})(\d{4})(\d{4})/,
'$1-$2-$3'
)}
</_.ContentBox>
</_.Stack>
<_.Stack>
<_.TitleBox>설립일</_.TitleBox>
Expand Down
29 changes: 25 additions & 4 deletions src/Components/Detail/CompanyDetail/Edit/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { Button, Icon, Stack, useToastStore, Text } from '@team-return/design-system';
import {
Button,
Icon,
Stack,
useToastStore,
Text,
} from '@team-return/design-system';
import { Dispatch, SetStateAction, useRef, useState } from 'react';
import { CompanyDetailResponse } from '../../../../Apis/Companies/response';
import { useForm } from '../../../../Hooks/useForm';
Expand Down Expand Up @@ -46,6 +52,9 @@ export function CompanyDetailEdit({
take: companyDetailInfo?.take,
service_name: companyDetailInfo?.service_name,
company_profile_url: companyDetailInfo?.company_profile_url,
representative_phone_no: companyDetailInfo?.representative_phone_no,
business_area_code: companyDetailInfo?.business_area_code,
biz_registration_url: companyDetailInfo?.biz_registration_url,
});

const {
Expand All @@ -66,6 +75,7 @@ export function CompanyDetailEdit({
worker_number,
take,
service_name,
representative_phone_no,
} = companyDetailEditInfo;

const { mutate: editCompanyInfo } = useChangeCompanyInfo(
Expand Down Expand Up @@ -164,9 +174,10 @@ export function CompanyDetailEdit({
</Button>
</Stack>
</_.Wrapper>
<div>asd</div>
<_.Stack>
<_.TitleBox>기업명</_.TitleBox>
<_.ContentBox width={25}>
<_.ContentBox width={15}>
<_.CustomInput
width={100}
type="text"
Expand All @@ -176,7 +187,7 @@ export function CompanyDetailEdit({
/>
</_.ContentBox>
<_.TitleBox>사업자 번호</_.TitleBox>
<_.ContentBox width={25}>
<_.ContentBox width={15}>
<_.CustomInput
width={100}
type="text"
Expand All @@ -188,7 +199,7 @@ export function CompanyDetailEdit({
/>
</_.ContentBox>
<_.TitleBox>대표자</_.TitleBox>
<_.ContentBox width={20}>
<_.ContentBox width={15}>
<_.CustomInput
width={100}
type="text"
Expand All @@ -197,6 +208,16 @@ export function CompanyDetailEdit({
onChange={companyDetailEditInfohandler}
/>
</_.ContentBox>
<_.TitleBox>대표 전화번호</_.TitleBox>
<_.ContentBox width={15}>
<_.CustomInput
width={100}
type="text"
value={representative_phone_no}
name="representative_phone_no"
onChange={companyDetailEditInfohandler}
/>
</_.ContentBox>
</_.Stack>
<_.Stack>
<_.TitleBox>설립일</_.TitleBox>
Expand Down
10 changes: 5 additions & 5 deletions src/Components/Detail/RecruitmentFormDetail/Basic/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Stack, Text } from '@team-return/design-system';
import { Button, Icon, Stack, Text } from '@team-return/design-system';
import { RecruitmentFormDetailResponse } from '../../../../Apis/Recruitments/response';
import { hiringProgress } from '../../../../Utils/Translation';
import * as _ from '../../style';
Expand Down Expand Up @@ -31,9 +31,6 @@ export function RecruitmentFormDetailBasic({
</_.LogoWrapper>
</Stack>
<Stack gap={10}>
<Button size="M" onClick={() => setCanEdit(true)}>
수정
</Button>
<Button
size="M"
onClick={() =>
Expand All @@ -42,7 +39,10 @@ export function RecruitmentFormDetailBasic({
)
}
>
pdf 출력
모집의뢰서 미리보기
</Button>
<Button size="M" onClick={() => setCanEdit(true)}>
수정
</Button>
</Stack>
</_.Wrapper>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Detail/RecruitmentFormDetail/Edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ export function RecruitmentFormDetailEdit({
)
}
/>
<_.CheckLogin>상시모집</_.CheckLogin>
<_.CheckLogin>유연근무제</_.CheckLogin>
</_.CheckEmailWrapper>
</_.ContentBox>
<_.TitleBox height={90}>실습수당</_.TitleBox>
Expand Down
10 changes: 6 additions & 4 deletions src/Components/Modal/RecruitmentModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ export function GatherModal({
const selectTechCode = tech.map((techItem) => techItem.code);

const { data: jobs, isLoading: jobsLoading } = useGetCode('JOB');
const selectJobsArray = jobs?.codes.filter((code) =>
areaData?.job.includes({ name: code.keyword, id: code.code })
const selectJobsArray = jobs?.codes.filter(
(code) => !!areaData?.job.filter((item) => item.id === code.code).length
);

const { data: techs, isLoading: techsLoading } = useGetCode('TECH');
const selectTechsArray = techs?.codes.filter((techItem) =>
areaData?.tech.includes({ name: techItem.keyword, id: techItem.code })
const selectTechsArray = techs?.codes.filter(
(techItem) =>
!!areaData?.tech.filter((item) => item.id === techItem.code).length
);
const selectTechsCodeArray = selectTechsArray?.map(
(techItem) => techItem.code
Expand Down Expand Up @@ -171,6 +172,7 @@ export function GatherModal({
const submit = () => {
areaData ? editArea() : addArea();
};
console.log(area.job_codes);

return (
<>
Expand Down
18 changes: 15 additions & 3 deletions src/Components/RecruitmentForm/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,21 @@ export function RecruitmentFormTable({
>
{recruitment.application_approved_count}
</_.ContentText>, // 지원자 수
<_.ContentText>{recruitment.start_date}</_.ContentText>, // 모집 시작 날짜
<_.ContentText>{recruitment.end_date}</_.ContentText>, // 모집 종료 날짜
];
].concat(
recruitment.start_date
? [
<_.ContentText>
{recruitment.start_date}
</_.ContentText>, // 모집 시작 날짜
<_.ContentText>
{recruitment.end_date}
</_.ContentText>, // 모집 종료 날짜
]
: [
<_.ContentText>상시모집</_.ContentText>,
<_.ContentText>상시모집</_.ContentText>,
]
);
})
.concat(emptyTableDataArray);

Expand Down
47 changes: 32 additions & 15 deletions src/Pages/PdfPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ export const PDFFile = () => {
<>
{!recruitmentDetailLoading && !companyDetailLoading && (
<Container>
{/* <img
src={ImgImg}
alt=""
style={{ width: '595px', height: '842px' }}
/> */}
<DownloadButton>
<Button onClick={converToPdf} iconName="Download">
다운로드
Expand Down Expand Up @@ -129,7 +124,9 @@ export const PDFFile = () => {
{recruitmentDetail?.areas
.map(
(area) =>
`${area.job.join(', ')}(${
`${area.job
.map((item) => item.name)
.join(', ')}(${
area.hiring
}명)`
)
Expand Down Expand Up @@ -238,7 +235,11 @@ export const PDFFile = () => {
연매출액
</td>
<td colSpan={5} align="center">
{companyDetail?.take}억/원
{' '}
{companyDetail?.take
.toString()
.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
억/원
</td>
<td
colSpan={3}
Expand Down Expand Up @@ -275,7 +276,11 @@ export const PDFFile = () => {
</td>
<td colSpan={20}>
{recruitmentDetail?.areas
.map((area) => area.job.join(', '))
.map((area) =>
area.job
.map((item) => item.name)
.join(', ')
)
.join(' / ')}
</td>
</tr>
Expand Down Expand Up @@ -336,10 +341,18 @@ export const PDFFile = () => {
{'수당 및\n채용 시\n급여 정보'}
</td>
<td colSpan={16}>
{`현장 실습) 수당 ${recruitmentDetail?.train_pay} 원\n`}
{`현장 실습) 수당 ${recruitmentDetail?.train_pay
.toString()
.replace(
/\B(?=(\d{3})+(?!\d))/g,
','
)} 원\n`}
{`채용 전환) 연봉 ${
recruitmentDetail?.pay
? `${recruitmentDetail.pay}만원`
? `${recruitmentDetail.pay.replace(
/\B(?=(\d{3})+(?!\d))/g,
','
)}만원`
: `추후협의`
} \n`}
{`※ 참고: 2024년 최저임금 2,060,740원(시급 9,860원)\n`}
Expand All @@ -359,7 +372,11 @@ export const PDFFile = () => {
</td>
<td colSpan={16}>
{recruitmentDetail?.areas
.map((area) => area.tech.join(', '))
.map((area) =>
area.tech
.map((item) => item.name)
.join(', ')
)
.join(' / ')}
</td>
</tr>
Expand Down Expand Up @@ -400,9 +417,7 @@ export const PDFFile = () => {
병역특례기업
</td>
<td colSpan={5}>
{recruitmentDetail?.military
? 'true'
: 'false'}
{recruitmentDetail?.military ? 'O' : 'X'}
</td>
</tr>
<tr>
Expand All @@ -413,7 +428,9 @@ export const PDFFile = () => {
>
{'산업기능요원 TO\n및 신청계획'}
</td>
<td colSpan={5}></td>
<td colSpan={5}>
{recruitmentDetail?.military ? 'O' : 'X'}
</td>
</tr>
<tr>
<td style={{ fontWeight: 700 }}>11</td>
Expand Down

0 comments on commit e2d803c

Please sign in to comment.