This commit is contained in:
@@ -38,6 +38,7 @@ export type PaymentMethodType = {
|
||||
|
||||
export type PriceDetailsType = {
|
||||
shipping_cost: number;
|
||||
shipping_cost_on_delivery?: number;
|
||||
process_cost: number;
|
||||
total_retail_price: number;
|
||||
total_payable_price: number;
|
||||
|
||||
@@ -34,6 +34,7 @@ export interface PaymentMethod {
|
||||
|
||||
export interface PriceDetails {
|
||||
shipping_cost: number;
|
||||
shipping_cost_on_delivery?: number;
|
||||
process_cost: number;
|
||||
total_retail_price: number;
|
||||
total_payable_price: number;
|
||||
|
||||
@@ -13,6 +13,7 @@ import { TickCircle, Add, Trash } from 'iconsax-react'
|
||||
import { toast } from 'react-toastify'
|
||||
import { extractErrorMessage } from '../../helpers/utils'
|
||||
import { Pages } from '../../config/Pages'
|
||||
import SwitchComponent from '../../components/Switch'
|
||||
|
||||
const CreateShipment: FC = () => {
|
||||
const navigate = useNavigate()
|
||||
@@ -25,6 +26,7 @@ const CreateShipment: FC = () => {
|
||||
costs: [],
|
||||
deliveryTime: 0,
|
||||
deliveryType: 'Standard',
|
||||
payDeliveryFeeOnDelivery: false,
|
||||
},
|
||||
validationSchema: Yup.object({
|
||||
name: Yup.string().required('عنوان روش ارسال الزامی است'),
|
||||
@@ -134,6 +136,19 @@ const CreateShipment: FC = () => {
|
||||
{...formik.getFieldProps('description')}
|
||||
error_text={formik.touched.description && formik.errors.description ? formik.errors.description : ''}
|
||||
/>
|
||||
|
||||
<div className='flex items-center justify-between border border-gray-200 rounded-lg p-4'>
|
||||
<div>
|
||||
<div className='font-medium text-gray-900'>پرداخت هزینه ارسال در زمان تحویل</div>
|
||||
<div className='text-xs text-gray-500 mt-1'>
|
||||
در صورت فعال بودن، هزینه ارسال در زمان تحویل پرداخت میشود و در پرداخت آنلاین لحاظ نمیگردد.
|
||||
</div>
|
||||
</div>
|
||||
<SwitchComponent
|
||||
active={formik.values.payDeliveryFeeOnDelivery ?? false}
|
||||
onChange={(value) => formik.setFieldValue('payDeliveryFeeOnDelivery', value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ const ShippingList: FC = () => {
|
||||
<Td text={'توضیحات'} />
|
||||
<Td text={'نوع ارسال'} />
|
||||
<Td text={'زمان ارسال (روز)'} />
|
||||
<Td text={'پرداخت در محل'} />
|
||||
<Td text={'هزینهها'} />
|
||||
<Td text={'عملیات'} />
|
||||
</tr>
|
||||
@@ -106,6 +107,7 @@ const ShippingList: FC = () => {
|
||||
<Td text={shipment.description} />
|
||||
<Td text={getDeliveryTypeText(shipment.deliveryType)} />
|
||||
<Td text={shipment.deliveryTime.toString()} />
|
||||
<Td text={shipment.payDeliveryFeeOnDelivery ? 'بله' : 'خیر'} />
|
||||
<Td text="">
|
||||
<div className="text-sm">
|
||||
{shipment.costs.length > 0 ? (
|
||||
|
||||
@@ -13,6 +13,7 @@ import { TickCircle, Add, Trash } from 'iconsax-react'
|
||||
import { toast } from 'react-toastify'
|
||||
import { extractErrorMessage } from '../../helpers/utils'
|
||||
import { Pages } from '../../config/Pages'
|
||||
import SwitchComponent from '../../components/Switch'
|
||||
|
||||
const UpdateShipment: FC = () => {
|
||||
const { id } = useParams<{ id: string }>()
|
||||
@@ -27,6 +28,7 @@ const UpdateShipment: FC = () => {
|
||||
costs: shipmentDetail?.costs || [],
|
||||
deliveryTime: shipmentDetail?.deliveryTime || 0,
|
||||
deliveryType: shipmentDetail?.deliveryType || 'Standard',
|
||||
payDeliveryFeeOnDelivery: shipmentDetail?.payDeliveryFeeOnDelivery ?? false,
|
||||
},
|
||||
enableReinitialize: true,
|
||||
validationSchema: Yup.object({
|
||||
@@ -170,6 +172,19 @@ const UpdateShipment: FC = () => {
|
||||
{...formik.getFieldProps('description')}
|
||||
error_text={formik.touched.description && formik.errors.description ? formik.errors.description : ''}
|
||||
/>
|
||||
|
||||
<div className='flex items-center justify-between border border-gray-200 rounded-lg p-4'>
|
||||
<div>
|
||||
<div className='font-medium text-gray-900'>پرداخت هزینه ارسال در زمان تحویل</div>
|
||||
<div className='text-xs text-gray-500 mt-1'>
|
||||
در صورت فعال بودن، هزینه ارسال در زمان تحویل پرداخت میشود و در پرداخت آنلاین لحاظ نمیگردد.
|
||||
</div>
|
||||
</div>
|
||||
<SwitchComponent
|
||||
active={formik.values.payDeliveryFeeOnDelivery ?? false}
|
||||
onChange={(value) => formik.setFieldValue('payDeliveryFeeOnDelivery', value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ export interface Shipper {
|
||||
costs: Cost[];
|
||||
deliveryType: "Standard" | "SameDay" | "Express";
|
||||
deliveryTime: number;
|
||||
payDeliveryFeeOnDelivery: boolean;
|
||||
deleted: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
@@ -35,6 +36,7 @@ export interface CreateShipper {
|
||||
description: string;
|
||||
costs: Cost[];
|
||||
deliveryTime: number;
|
||||
payDeliveryFeeOnDelivery?: boolean;
|
||||
deliveryType?: "Standard" | "SameDay" | "Express";
|
||||
}
|
||||
|
||||
@@ -62,6 +64,7 @@ export interface ShipmentMethod {
|
||||
costs: Cost[];
|
||||
deliveryType: string;
|
||||
deliveryTime: number;
|
||||
payDeliveryFeeOnDelivery: boolean;
|
||||
deleted: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
|
||||
Reference in New Issue
Block a user