summaryrefslogtreecommitdiff
path: root/src/containers/WaybillPanel.tsx
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-03-18 01:21:41 +0300
committereug-vs <eug-vs@keemail.me>2021-03-18 01:21:41 +0300
commit5ac1a56a157dc116fd61712ac47c29e6d02f4c0c (patch)
treef227744eff222ca9836739a5b640a249dcd2c9ab /src/containers/WaybillPanel.tsx
parent60b6d39562012ef1e330d4c578ecd671de131b94 (diff)
downloadcommercel-ui-5ac1a56a157dc116fd61712ac47c29e6d02f4c0c.tar.gz
feat: add print button
Diffstat (limited to 'src/containers/WaybillPanel.tsx')
-rw-r--r--src/containers/WaybillPanel.tsx7
1 files changed, 6 insertions, 1 deletions
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<PanelProps> = ({ 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<PanelProps> = ({ item, mutate }) => {
<Button route={`/contractors/${item.contractorId}`} variant="outlined">
Перейти к контрагенту
</Button>
+ <Button onClick={handlePrint}>
+ Печать
+ </Button>
{
executed
? <Button onClick={handleCancel}>Откатить</Button>