박권수

feat. QRCode Print

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