feat: cancel deal bill, date range in timetable
This commit is contained in:
@@ -156,6 +156,32 @@ const ProductAndServiceTab: FC = () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
const onCancelBillClick = () => {
|
||||
if (!dealState.deal) return;
|
||||
const dealId = dealState.deal.id;
|
||||
modals.openConfirmModal({
|
||||
withCloseButton: false,
|
||||
children:
|
||||
<Text style={{textAlign: "justify"}}>
|
||||
Вы уверены что хотите отозвать заявку на оплату?
|
||||
</Text>,
|
||||
onConfirm: () => {
|
||||
BillingService.cancelDealBill({
|
||||
requestBody: {
|
||||
dealId
|
||||
}
|
||||
}).then(async ({ok, message}) => {
|
||||
notifications.guess(ok, {message});
|
||||
await dealState.refetch();
|
||||
})
|
||||
},
|
||||
labels: {
|
||||
confirm: "Отозвать",
|
||||
cancel: "Отмена"
|
||||
},
|
||||
|
||||
});
|
||||
}
|
||||
return (
|
||||
<div
|
||||
className={
|
||||
@@ -209,11 +235,19 @@ const ProductAndServiceTab: FC = () => {
|
||||
</div>
|
||||
<Divider my={rem(15)}/>
|
||||
<div className={styles['deal-container-buttons']}>
|
||||
<Button
|
||||
disabled={isLocked}
|
||||
onClick={onCreateBillClick}
|
||||
variant={"default"}
|
||||
fullWidth>Выставить счет</Button>
|
||||
{isLocked ? <Button
|
||||
onClick={onCancelBillClick}
|
||||
color={"red"}
|
||||
>
|
||||
Отозвать счет
|
||||
</Button> :
|
||||
<Button
|
||||
disabled={isLocked}
|
||||
onClick={onCreateBillClick}
|
||||
variant={"default"}
|
||||
fullWidth>Выставить счет</Button>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
</Flex>
|
||||
|
||||
Reference in New Issue
Block a user