From 5ac1a56a157dc116fd61712ac47c29e6d02f4c0c Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 18 Mar 2021 01:21:41 +0300 Subject: feat: add print button --- src/containers/WaybillPanel.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/containers') diff --git a/src/containers/WaybillPanel.tsx b/src/containers/WaybillPanel.tsx index a978ad3..386d8bb 100644 --- a/src/containers/WaybillPanel.tsx +++ b/src/containers/WaybillPanel.tsx @@ -3,7 +3,7 @@ import { useHistory } from 'react-router-dom'; import Input from '../components/Input'; import Button from '../components/Button'; import Paper from '../components/Paper'; -import { patch } from '../requests'; +import { patch, get, baseURL } from '../requests'; import { PanelProps } from './Service/ServiceContext'; @@ -16,6 +16,8 @@ const WaybillPanel: React.FC = ({ item, mutate }) => { mutate({ ...item, status }); }); + const handlePrint = () => window.open(`${baseURL}/spreadsheets/${item._id}`, '_blank'); + const handleExecute = () => handleChangeStatus('executed'); const handleCancel = () => handleChangeStatus('cancelled'); @@ -29,6 +31,9 @@ const WaybillPanel: React.FC = ({ item, mutate }) => { + { executed ? -- cgit v1.2.3