박권수

feat. QRCode Print

......@@ -267,15 +267,21 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
Alert.onCheck(`${prescribeMedicine.name}(일 복용량:${dosage})\n을 처방하시겠습니까?`, async () => {
setQrcodeUrl(await QRCode.toDataURL(`${prescribeMedicine.name}/${prescribeMedicine.medicineId}/${dosage}/${userId}`, {
type : "image/png",
color : {dark : '#337DFF', light : '#FFF'},
color : { dark : '#337DFF', light : '#FFF' },
}));
Alert.onSuccess('처방 정보가 생성 되었습니다.', () => onSetNextStepPrescribe());
}, () => null);
};
const onPrintQrcode = async() => {
//toDo : QR코드 출력
Alert.onWarning('준비 중입니다.', () => null);
const onPrintQrcode = async(divId : string) => {
const printContent : any = document.getElementById(divId);
const windowOpen : any = window.open('', 'PrintQRCode');
windowOpen.document.writeln(printContent.innerHTML);
windowOpen.document.close();
windowOpen.focus();
windowOpen.print();
windowOpen.close();
};
const onPrescribeCancel = () => {
......
......@@ -67,7 +67,7 @@ interface DoctorMenuProps {
qrcodeUrl : string | null;
onPrescribeSubmit : () => void;
onPrintQrcode : () => void;
onPrintQrcode : (arg0 : string) => void;
onPrescribeCancel : () => void;
}
......@@ -264,7 +264,9 @@ const DoctorMenuPresenter = (props : DoctorMenuProps) => {
/>
</styled.MedicineDosageSetWrapper>
:
<styled.MedicineQRCodeWrapper>
<styled.MedicineQRCodeWrapper
id = 'qrCodePrint'
>
<styled.MedicineQRCodeInfo>
*어플리케이션에서 QR코드를 스캔하면 약병에 약이 등록됩니다.
</styled.MedicineQRCodeInfo>
......@@ -293,7 +295,7 @@ const DoctorMenuPresenter = (props : DoctorMenuProps) => {
:
<styled.MedicinePrescribeButton
isClose = {false}
onClick = {props.onPrintQrcode}
onClick = {() => props.onPrintQrcode('qrCodePrint')}
>
출력
</styled.MedicinePrescribeButton>
......