add whatsapp contact button and prepayment/full payment badge
This commit is contained in:
@@ -2,7 +2,7 @@ import { useState, useEffect, useCallback } from 'react';
|
||||
import { Button, Input, Select, Modal } from '../ui';
|
||||
import { deliveryRequestSourceOptions, pickupOptions } from '../../constants/pickup';
|
||||
import { formatDateForInput, parseDateFromInput, getTodayFrontend } from '../../utils/date';
|
||||
import type { Delivery, DeliveryRequestSource, PickupLocation, DeliveryStatus } from '../../types';
|
||||
import type { Delivery, DeliveryRequestSource, PickupLocation, DeliveryStatus, PaymentStatus } from '../../types';
|
||||
|
||||
interface DeliveryFormProps {
|
||||
isOpen: boolean;
|
||||
@@ -22,6 +22,10 @@ const requestSourceOptions = [
|
||||
{ value: '', label: 'Выберите источник заявки' },
|
||||
...deliveryRequestSourceOptions,
|
||||
];
|
||||
const paymentStatusOptions = [
|
||||
{ value: 'prepaid', label: 'Предоплата' },
|
||||
{ value: 'paid', label: 'Полная оплата' },
|
||||
];
|
||||
|
||||
const buildAddressString = (
|
||||
street: string,
|
||||
@@ -56,6 +60,7 @@ export const DeliveryForm = ({ isOpen, onClose, onSubmit, initialData, defaultDa
|
||||
phone: '',
|
||||
additionalPhone: '',
|
||||
hasElevator: false,
|
||||
paymentStatus: 'prepaid' as PaymentStatus,
|
||||
serviceInfo: '',
|
||||
comment: '',
|
||||
status: 'new' as DeliveryStatus,
|
||||
@@ -82,6 +87,7 @@ export const DeliveryForm = ({ isOpen, onClose, onSubmit, initialData, defaultDa
|
||||
phone: initialData.phone,
|
||||
additionalPhone: initialData.additionalPhone || '',
|
||||
hasElevator: initialData.hasElevator,
|
||||
paymentStatus: initialData.paymentStatus || 'prepaid',
|
||||
serviceInfo: initialData.serviceInfo || '',
|
||||
comment: initialData.comment,
|
||||
status: initialData.status,
|
||||
@@ -147,6 +153,7 @@ export const DeliveryForm = ({ isOpen, onClose, onSubmit, initialData, defaultDa
|
||||
phone: '',
|
||||
additionalPhone: '',
|
||||
hasElevator: false,
|
||||
paymentStatus: 'prepaid',
|
||||
serviceInfo: '',
|
||||
comment: '',
|
||||
status: 'new',
|
||||
@@ -383,6 +390,14 @@ export const DeliveryForm = ({ isOpen, onClose, onSubmit, initialData, defaultDa
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<Select
|
||||
label="Оплата"
|
||||
value={formData.paymentStatus}
|
||||
onChange={(e) => setFormData({ ...formData, paymentStatus: e.target.value as PaymentStatus })}
|
||||
options={paymentStatusOptions}
|
||||
required
|
||||
/>
|
||||
|
||||
<Input
|
||||
label="Услуги (сборка, подъём)"
|
||||
value={formData.serviceInfo}
|
||||
|
||||
Reference in New Issue
Block a user