forked from yoone/WEB
Feature update shipment
物流管理增加订单号 取消运单响应 取消物流二次确认 追踪物流状态 取消运单检测物流检测
This commit is contained in:
parent
081b87df7b
commit
b6ba23864a
|
|
@ -1,8 +1,9 @@
|
||||||
import { logisticscontrollerGetlist, logisticscontrollerGetShipmentLabel,
|
import { logisticscontrollerGetlist, logisticscontrollerGetShipmentLabel,
|
||||||
logisticscontrollerDeleteShipment
|
logisticscontrollerDeleteShipment,
|
||||||
|
logisticscontrollerGetShipmentState
|
||||||
} from '@/servers/api/logistics';
|
} from '@/servers/api/logistics';
|
||||||
import { stockcontrollerGetallstockpoints } from '@/servers/api/stock';
|
import { stockcontrollerGetallstockpoints } from '@/servers/api/stock';
|
||||||
import { formatShipmentState } from '@/utils/format';
|
import { formatUniuniShipmentState } from '@/utils/format';
|
||||||
import { printPDF } from '@/utils/util';
|
import { printPDF } from '@/utils/util';
|
||||||
import { CopyOutlined } from '@ant-design/icons';
|
import { CopyOutlined } from '@ant-design/icons';
|
||||||
import { ToastContainer, toast } from 'react-toastify';
|
import { ToastContainer, toast } from 'react-toastify';
|
||||||
|
|
@ -70,7 +71,7 @@ const ListPage: React.FC = () => {
|
||||||
dataIndex: 'state',
|
dataIndex: 'state',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
render(_, record) {
|
render(_, record) {
|
||||||
return formatShipmentState(record.state);
|
return formatUniuniShipmentState(record.state);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -99,19 +100,21 @@ const ListPage: React.FC = () => {
|
||||||
>
|
>
|
||||||
Label
|
Label
|
||||||
</Button>
|
</Button>
|
||||||
{/* <Divider type="vertical" /> */}
|
<Divider type="vertical" />
|
||||||
{/* <Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
const { data } = await logisticscontrollerDeleteShipment(record.id);
|
const res = await logisticscontrollerGetShipmentState(record.id);
|
||||||
console.log('data', data);// todo 刷新页面
|
console.log('res', res);
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Cancel
|
刷新状态
|
||||||
</Button> */}
|
</Button>
|
||||||
|
<Divider type="vertical" />
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
title="删除"
|
title="删除"
|
||||||
|
|
@ -133,7 +136,7 @@ const ListPage: React.FC = () => {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button type="primary" danger>
|
<Button type="primary" danger>
|
||||||
Cancel
|
删除
|
||||||
</Button>
|
</Button>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
<ToastContainer />
|
<ToastContainer />
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,19 @@ export async function logisticscontrollerGetShipmentLabel(
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 此处后端没有提供注释 POST /logistics/updateState/${param0}**/
|
||||||
|
export async function logisticscontrollerGetShipmentState(
|
||||||
|
shipmentId: number
|
||||||
|
) {
|
||||||
|
return request<API.BooleanRes>(`/logistics/updateState/${shipmentId}`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/** 此处后端没有提供注释 DEL /logistics/deleteShipment/${param0} */
|
/** 此处后端没有提供注释 DEL /logistics/deleteShipment/${param0} */
|
||||||
export async function logisticscontrollerDeleteShipment(
|
export async function logisticscontrollerDeleteShipment(
|
||||||
shipmentId: number
|
shipmentId: number
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,10 @@ declare namespace API {
|
||||||
orderId: number;
|
orderId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type logisticscontrollerDeleteshipmentParams = {
|
||||||
|
id: number;
|
||||||
|
};
|
||||||
|
|
||||||
type logisticscontrollerDelshipmentParams = {
|
type logisticscontrollerDelshipmentParams = {
|
||||||
id: string;
|
id: string;
|
||||||
};
|
};
|
||||||
|
|
@ -1015,13 +1019,13 @@ declare namespace API {
|
||||||
};
|
};
|
||||||
|
|
||||||
type ShippingDetailsDTO = {
|
type ShippingDetailsDTO = {
|
||||||
|
shipmentFee?: number;
|
||||||
origin?: Location;
|
origin?: Location;
|
||||||
destination?: Destination;
|
destination?: Destination;
|
||||||
expected_ship_date?: Date;
|
expected_ship_date?: Date;
|
||||||
packaging_type?: 'pallet' | 'package' | 'courier-pak' | 'envelope';
|
packaging_type?: 'pallet' | 'package' | 'courier-pak' | 'envelope';
|
||||||
packaging_properties?: PackagingPackage[];
|
packaging_properties?: PackagingPackage[];
|
||||||
reference_codes?: any;
|
reference_codes?: any;
|
||||||
shipmentFee: number;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type SiteConfig = {
|
type SiteConfig = {
|
||||||
|
|
|
||||||
|
|
@ -55,13 +55,51 @@ export function formatShipmentState(state: string) {
|
||||||
return '丢失';
|
return '丢失';
|
||||||
case 'cancelled':
|
case 'cancelled':
|
||||||
return '取消';
|
return '取消';
|
||||||
case '190': // ORDER_RECEIVED
|
|
||||||
return '订单待发送';
|
|
||||||
case '202': // IN_TRANSIT
|
|
||||||
return '在途中';
|
|
||||||
case '203': // DELIVERED
|
|
||||||
return '订单已送达';
|
|
||||||
default:
|
default:
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function formatUniuniShipmentState(state: string) {
|
||||||
|
const UNIUNI_STATUS_ENUM = {
|
||||||
|
'190': 'ORDER_RECEIVED',
|
||||||
|
'192': 'CUSTOM_HOLD',
|
||||||
|
'195': 'GATEWAY_TRANSIT_OUT',
|
||||||
|
'198': 'CUSTOM_RELEASE_DIRECT',
|
||||||
|
'199': 'GATEWAY_TRANSIT',
|
||||||
|
'200': 'PARCEL_SCANNED',
|
||||||
|
'202': 'IN_TRANSIT',
|
||||||
|
'203': 'DELIVERED',
|
||||||
|
'204': 'TRANSSHIPMENT',
|
||||||
|
'206': 'WRONG_ADDRESS_FROM_TRANSIT',
|
||||||
|
'207': 'PARCEL_LOST',
|
||||||
|
'209': 'OTHER_EXCEPTION',
|
||||||
|
'211': 'RETURN_OFFICE_FROM_TRANSIT',
|
||||||
|
'212': 'WRONG_ADDRESS_FROM_RECEIVE',
|
||||||
|
'213': 'STORAGE_30_DAYS_FROM_OFFICE',
|
||||||
|
'214': 'STORAGE_30_DAYS_AFTER_SCAN',
|
||||||
|
'215': 'PARCEL_ABANDONED',
|
||||||
|
'216': 'SELF_PICK_UP',
|
||||||
|
'217': 'TRANSSHIPMENT_COMPLETE',
|
||||||
|
'218': 'SCANNED_PARCEL_MISSING',
|
||||||
|
'219': 'WRONG_ROUTE_PARCEL',
|
||||||
|
'220': 'SECOND_DELIVERY',
|
||||||
|
'221': 'RETURNED_PARCEL_SCANNED',
|
||||||
|
'222': 'REJECTED_PARCEL_FROM_TRANSIT',
|
||||||
|
'223': 'CHANGED_ORDER_RESENT',
|
||||||
|
'224': 'RESENT_ORDER_VOIDED',
|
||||||
|
'225': 'FORWARDED_3RDPARTY',
|
||||||
|
'226': 'STORAGE_3RDPARTY_SERVICE_POINT',
|
||||||
|
'228': 'SECOND_DELIVERED',
|
||||||
|
'229': 'DROP_OFF_SERVICE_POINTS',
|
||||||
|
'230': 'RETURN TO SENDER WAREHOUSE',
|
||||||
|
'231': 'FAILED_DELIVERY_RETRY1',
|
||||||
|
'232': 'FAILED_DELIVERY_RETRY2',
|
||||||
|
'255': 'Gateway_To_Gateway_Transit'
|
||||||
|
}
|
||||||
|
if (state in UNIUNI_STATUS_ENUM) {
|
||||||
|
return UNIUNI_STATUS_ENUM[state];
|
||||||
|
} else {
|
||||||
|
return '未知状态';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue