Skip to content

Commit

Permalink
Merge pull request #40 from Jingil-Integrated-Management/james
Browse files Browse the repository at this point in the history
James
  • Loading branch information
therealjamesjung authored Jan 15, 2022
2 parents 5077e5e + 737422d commit 466c186
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
30 changes: 24 additions & 6 deletions src/components/drawers/info/Info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import PartInfo from './PartInfo';
import DrawingInfo from './DrawingInfo';

//types
import { DrawingData, PartData } from '../../../types';
import { DrawingData, OutsourceData, PartData } from '../../../types';

import OUTSOURCE from '../../../constants/OUTSOURCE.json';

interface tableDrawerProps {
target: string;
Expand All @@ -23,7 +25,10 @@ interface tableDrawerProps {

const Info = (props: tableDrawerProps) => {
const finishDrawing = async () => {
if (!isClosed()) return;
if (!isClosed()) {
alert('가격이 확정되지 않은 파트가 존재합니다.');
return;
}

try {
await webClient.patch(`drawing/${props.drawing?.id}`, {
Expand Down Expand Up @@ -75,10 +80,23 @@ const Info = (props: tableDrawerProps) => {

const isClosed = () => {
for (let i = 0; i < props.parts.length; i++) {
if (props.parts[i].price === '' || props.parts[i].price === null) {
alert('가격이 확정되지 않은 파트가 존재합니다.');
return false;
}
let isClosed = true;

if (props.parts[i].price === '' || props.parts[i].price === null)
isClosed = false;

if (!isClosed) return isClosed;

OUTSOURCE.os_subjects.forEach(subject => {
const tmpOs = props.parts[i].outsource_info;
if (
tmpOs &&
tmpOs[(subject + '_client') as keyof OutsourceData] &&
!tmpOs[(subject + '_price') as keyof OutsourceData]
)
isClosed = false;
});
if (!isClosed) return isClosed;
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion src/components/drawers/patch/PatchOutSourcePart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const OutSource = (props: outSourceProps) => {
<div className="text-14 font-medium leading-1.14 text-palette-grey-menuicons">
외주 추가하기
</div>
<div className="w-544 h-48 mt-8 item-border bg-palette-gray-osbox flex items-center justify-center">
<div className="w-544 h-48 mt-8 rounded-8 item-border bg-palette-purple-input flex items-center justify-center">
{OUTSOURCE.os_subjects.map((subject, index) => (
<button
key={index}
Expand Down
2 changes: 1 addition & 1 deletion src/css/TopNavigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}

.unfocus-text {
color: #6c6c84;
color: #abacbe;
font-family: NotoSansKR;
font-size: 20px;
font-weight: bold;
Expand Down

0 comments on commit 466c186

Please sign in to comment.