// capa.jsx — CAPA(시정 및 예방조치): 가상 심사 지적사항을 개선 항목으로 추적 const { Icon, Pill, Button } = window.RAlly; const SEVC = { Critical: { bg: '#f3ded7', fg: '#b94a2c' }, Major: { bg: '#fbf0d8', fg: '#9a6a12' }, Minor: { bg: '#e7e3da', fg: '#5a6068' }, }; const Capa = ({ go }) => { const [res, setRes] = React.useState(null); const [busy, setBusy] = React.useState(false); const [done, setDone] = React.useState({}); // 로컬 조치 완료 표시 const [noTrack, setNoTrack] = React.useState(false); const load = () => { setBusy(true); window.RAlly.resolveTrackId().then((tid) => { if (!tid) { setNoTrack(true); setBusy(false); return; } fetch('/api/track/' + tid + '/audit', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ use_llm: false }), }).then((r) => r.json()).then((d) => { setRes(d); setBusy(false); }).catch(() => setBusy(false)); }); }; React.useEffect(load, []); const items = res ? res.findings : []; const openCount = items.filter((f) => !done[f.id]).length; if (noTrack) { return (
아직 트랙이 없습니다
CAPA는 가상 심사 지적사항에서 만들어집니다. 먼저 '시작하기'에서 품목을 입력해 문서를 생성하세요.
); } return (
CAPA 시정 및 예방조치
개선 항목 추적
가상 심사에서 발견된 지적사항을 시정·예방조치(CAPA) 항목으로 추적합니다. 각 항목의 권고를 조치하고 완료 표시하세요. (절차: SP-OP-M21 시정 및 예방조치)
{openCount}
미조치 항목
{busy &&
심사 지적사항을 불러오는 중…
} {res && items.length === 0 && (
조치할 CAPA 항목이 없습니다
가상 심사에서 지적사항이 발견되지 않았습니다.
)} {res && items.map((f) => { const isDone = !!done[f.id]; return (
{f.severity} CAPA-{f.id} {f.category} · {f.doc} 근거 {f.basis}
{f.title}
{f.detail}
조치: {f.recommendation}
); })}
※ 조치 완료 표시는 현재 세션 내 임시 표시입니다. 정식 CAPA 기록은 시정 및 예방조치 보고서(SP-OP-M21-F01)로 관리합니다.
); }; window.RAlly.Capa = Capa;