diff options
Diffstat (limited to 'src/containers/WaybillPanel.tsx')
-rw-r--r-- | src/containers/WaybillPanel.tsx | 7 |
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> |