Compare commits
No commits in common. "35c26c07c43ee28e5cd26b5a913e43cdbbdf3305" and "c06cb33e89693b84f3e477d732db397d39df193d" have entirely different histories.
35c26c07c4
...
c06cb33e89
|
|
@ -13,4 +13,3 @@
|
|||
.swc
|
||||
/package-lock.json
|
||||
/yarn.lock
|
||||
*.yaml
|
||||
|
|
|
|||
56
.umirc.ts
56
.umirc.ts
|
|
@ -6,7 +6,6 @@ const UMI_APP_API_URL = isDev
|
|||
: 'https://api.yoone.ca';
|
||||
|
||||
export default defineConfig({
|
||||
hash: true,
|
||||
antd: {},
|
||||
access: {},
|
||||
model: {},
|
||||
|
|
@ -26,7 +25,7 @@ export default defineConfig({
|
|||
{
|
||||
name: '组织架构',
|
||||
path: '/organiza',
|
||||
access: 'canSeeOrganiza',
|
||||
access: 'canSeeSuper',
|
||||
routes: [
|
||||
{
|
||||
name: '用户管理',
|
||||
|
|
@ -38,7 +37,6 @@ export default defineConfig({
|
|||
{
|
||||
name: '商品管理',
|
||||
path: '/product',
|
||||
access: 'canSeeProduct',
|
||||
routes: [
|
||||
{
|
||||
name: '商品分类',
|
||||
|
|
@ -70,7 +68,6 @@ export default defineConfig({
|
|||
{
|
||||
name: '库存管理',
|
||||
path: '/stock',
|
||||
access: 'canSeeStock',
|
||||
routes: [
|
||||
{
|
||||
name: '库存列表',
|
||||
|
|
@ -102,7 +99,7 @@ export default defineConfig({
|
|||
{
|
||||
name: '订单管理',
|
||||
path: '/order',
|
||||
access: 'canSeeOrder',
|
||||
access: 'canSeeAdmin',
|
||||
routes: [
|
||||
{
|
||||
name: '订单列表',
|
||||
|
|
@ -119,7 +116,6 @@ export default defineConfig({
|
|||
{
|
||||
name: '客户管理',
|
||||
path: '/customer',
|
||||
access: 'canSeeCustomer',
|
||||
routes: [
|
||||
{
|
||||
name: '客户列表',
|
||||
|
|
@ -128,52 +124,54 @@ export default defineConfig({
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: '物流管理',
|
||||
path: '/logistics',
|
||||
access: 'canSeeLogistics',
|
||||
routes: [
|
||||
{
|
||||
name: '服务商',
|
||||
path: '/logistics/services',
|
||||
component: './Logistics/Services',
|
||||
},
|
||||
{
|
||||
name: '地址管理',
|
||||
path: '/logistics/address',
|
||||
component: './Logistics/Address',
|
||||
},
|
||||
{
|
||||
name: '物流列表',
|
||||
path: '/logistics/list',
|
||||
component: './Logistics/List',
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// name: '物流管理',
|
||||
// path: '/logistics',
|
||||
// routes: [
|
||||
// {
|
||||
// name: '服务商',
|
||||
// path: '/logistics/services',
|
||||
// component: './Logistics/Services',
|
||||
// },
|
||||
// {
|
||||
// name: '地址管理',
|
||||
// path: '/logistics/address',
|
||||
// component: './Logistics/Address',
|
||||
// },
|
||||
// {
|
||||
// name: '物流列表',
|
||||
// path: '/logistics/list',
|
||||
// component: './Logistics/List',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
name: '数据统计',
|
||||
path: '/statistics',
|
||||
access: 'canSeeStatistics',
|
||||
routes: [
|
||||
{
|
||||
name: '销售统计',
|
||||
path: '/statistics/sales',
|
||||
component: './Statistics/Sales',
|
||||
access: 'canSeeSuper',
|
||||
},
|
||||
{
|
||||
name: '订单统计',
|
||||
path: '/statistics/order',
|
||||
component: './Statistics/Order',
|
||||
access: 'canSeeSuper',
|
||||
},
|
||||
{
|
||||
name: '订单来源',
|
||||
path: '/statistics/orderSource',
|
||||
component: './Statistics/OrderSource',
|
||||
access: 'canSeeSuper',
|
||||
},
|
||||
{
|
||||
name: '客户统计',
|
||||
path: '/statistics/customer',
|
||||
component: './Statistics/Customer',
|
||||
access: 'canSeeSuper',
|
||||
},
|
||||
{
|
||||
name: '库存预测',
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
"file-saver": "^2.0.5",
|
||||
"print-js": "^1.6.0",
|
||||
"react-phone-input-2": "^2.15.1",
|
||||
"react-toastify": "^11.0.5",
|
||||
"xlsx": "^0.18.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
|
|
@ -1,22 +1,9 @@
|
|||
export default (initialState: any) => {
|
||||
const isSuper = initialState?.user?.isSuper ?? false;
|
||||
const isAdmin = initialState?.user?.Admin ?? false;
|
||||
const canSeeOrganiza = (isSuper || isAdmin) || (initialState?.user?.permissions?.includes('organiza') ?? false);
|
||||
const canSeeProduct = (isSuper || isAdmin) || (initialState?.user?.permissions?.includes('product') ?? false);
|
||||
const canSeeStock = (isSuper || isAdmin) || (initialState?.user?.permissions?.includes('stock') ?? false);
|
||||
const canSeeOrder = (isSuper || isAdmin) ||
|
||||
((initialState?.user?.permissions?.includes('order') ?? false) || (initialState?.user?.permissions?.includes('order-10-days') ?? false));
|
||||
const canSeeCustomer = (isSuper || isAdmin) || (initialState?.user?.permissions?.includes('customer') ?? false);
|
||||
const canSeeLogistics = (isSuper || isAdmin) || (initialState?.user?.permissions?.includes('logistics') ?? false);
|
||||
const canSeeStatistics = (isSuper || isAdmin) || (initialState?.user?.permissions?.includes('statistics') ?? false);
|
||||
|
||||
const canSeeSuper = initialState?.user?.isSuper;
|
||||
const canSeeAdmin =
|
||||
initialState?.user?.isSuper || initialState?.user?.isAdmin;
|
||||
return {
|
||||
canSeeOrganiza,
|
||||
canSeeProduct,
|
||||
canSeeStock,
|
||||
canSeeOrder,
|
||||
canSeeCustomer,
|
||||
canSeeLogistics,
|
||||
canSeeStatistics,
|
||||
canSeeSuper,
|
||||
canSeeAdmin,
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ const Page = () => {
|
|||
try {
|
||||
const { data, success, code, message: msg } = await usercontrollerLogin({...values, deviceId});
|
||||
if (success) {
|
||||
|
||||
message.success('登录成功');
|
||||
localStorage.setItem('token', data?.token as string);
|
||||
const { data: user } = await usercontrollerGetuser();
|
||||
|
|
|
|||
|
|
@ -1,27 +1,21 @@
|
|||
import { logisticscontrollerGetlist, logisticscontrollerGetshipmentlabel,
|
||||
logisticscontrollerDeleteshipment,
|
||||
logisticscontrollerUpdateshipmentstate
|
||||
} from '@/servers/api/logistics';
|
||||
import { logisticscontrollerGetlist } from '@/servers/api/logistics';
|
||||
import { stockcontrollerGetallstockpoints } from '@/servers/api/stock';
|
||||
import { formatUniuniShipmentState } from '@/utils/format';
|
||||
import { formatShipmentState } from '@/utils/format';
|
||||
import { printPDF } from '@/utils/util';
|
||||
import { CopyOutlined } from '@ant-design/icons';
|
||||
import { ToastContainer, toast } from 'react-toastify';
|
||||
import {
|
||||
ActionType,
|
||||
PageContainer,
|
||||
ProColumns,
|
||||
ProTable,
|
||||
} from '@ant-design/pro-components';
|
||||
import { App, Button, Divider, Popconfirm } from 'antd';
|
||||
import { App, Button } from 'antd';
|
||||
import { useRef, useState } from 'react';
|
||||
import { sitecontrollerAll } from '@/servers/api/site';
|
||||
|
||||
const ListPage: React.FC = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
const { message } = App.useApp();
|
||||
const [selectedRows, setSelectedRows] = useState([]);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
const columns: ProColumns<API.Service>[] = [
|
||||
{
|
||||
|
|
@ -32,7 +26,7 @@ const ListPage: React.FC = () => {
|
|||
{
|
||||
title: '仓库',
|
||||
dataIndex: 'stockPointId',
|
||||
// hideInTable: true,
|
||||
hideInTable: true,
|
||||
valueType: 'select',
|
||||
request: async () => {
|
||||
const { data = [] } = await stockcontrollerGetallstockpoints();
|
||||
|
|
@ -42,34 +36,17 @@ const ListPage: React.FC = () => {
|
|||
}));
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '网站',
|
||||
dataIndex: 'siteId',
|
||||
valueType: 'select',
|
||||
hideInSearch: true,
|
||||
request: async () => {
|
||||
const { data = [] } = await sitecontrollerAll();
|
||||
return data.map((item) => ({
|
||||
label: item.siteName,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '订单号',
|
||||
dataIndex: 'externalOrderId',
|
||||
},
|
||||
{
|
||||
title: '快递单号',
|
||||
dataIndex: 'return_tracking_number',
|
||||
dataIndex: 'primary_tracking_number',
|
||||
render(_, record) {
|
||||
return (
|
||||
<>
|
||||
{record.return_tracking_number}
|
||||
{record.primary_tracking_number}
|
||||
<CopyOutlined
|
||||
onClick={async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(record.return_tracking_number);
|
||||
await navigator.clipboard.writeText(record.tracking_url);
|
||||
message.success('复制成功!');
|
||||
} catch (err) {
|
||||
message.error('复制失败!');
|
||||
|
|
@ -85,7 +62,7 @@ const ListPage: React.FC = () => {
|
|||
dataIndex: 'state',
|
||||
hideInSearch: true,
|
||||
render(_, record) {
|
||||
return formatUniuniShipmentState(record.state);
|
||||
return formatShipmentState(record.state);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -99,62 +76,20 @@ const ListPage: React.FC = () => {
|
|||
dataIndex: 'operation',
|
||||
hideInSearch: true,
|
||||
render(_, record) {
|
||||
if (!record?.labels?.length) return null;
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
disabled={isLoading}
|
||||
onClick={async () => {
|
||||
setIsLoading(true);
|
||||
const { data } = await logisticscontrollerGetshipmentlabel({shipmentId:record.id});
|
||||
const content = data.content;
|
||||
printPDF([content]);
|
||||
setIsLoading(false);
|
||||
onClick={() => {
|
||||
// printPDF([record.labels[record.labels.length - 1].url])
|
||||
window.open(
|
||||
record.labels[record.labels.length - 1].url,
|
||||
'_blank',
|
||||
);
|
||||
}}
|
||||
>
|
||||
Label
|
||||
打印
|
||||
</Button>
|
||||
<Divider type="vertical" />
|
||||
<Button
|
||||
type="primary"
|
||||
disabled={isLoading}
|
||||
onClick={async () => {
|
||||
setIsLoading(true);
|
||||
const res = await logisticscontrollerUpdateshipmentstate({shipmentId:record.id});
|
||||
console.log('res', res);
|
||||
|
||||
setIsLoading(false);
|
||||
}}
|
||||
>
|
||||
刷新状态
|
||||
</Button>
|
||||
<Divider type="vertical" />
|
||||
<Popconfirm
|
||||
disabled={isLoading}
|
||||
title="删除"
|
||||
description="确认删除?"
|
||||
onConfirm={async () => {
|
||||
try {
|
||||
setIsLoading(true);
|
||||
const { success, message: errMsg } =
|
||||
await logisticscontrollerDeleteshipment({id:record.id});
|
||||
if (!success) {
|
||||
throw new Error(errMsg);
|
||||
}
|
||||
setIsLoading(false);
|
||||
actionRef.current?.reload();
|
||||
} catch (error: any) {
|
||||
setIsLoading(false);
|
||||
message.error(error.message);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Button type="primary" danger>
|
||||
删除
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
<ToastContainer />
|
||||
</>
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -68,23 +68,23 @@ const ListPage: React.FC = () => {
|
|||
actionRef={actionRef}
|
||||
rowKey="id"
|
||||
toolBarRender={() => [
|
||||
// <Button
|
||||
// key="syncSite"
|
||||
// type="primary"
|
||||
// onClick={async () => {
|
||||
// try {
|
||||
// const { success } = await logisticscontrollerSyncservices();
|
||||
// if (!success) {
|
||||
// throw new Error('同步失败');
|
||||
// }
|
||||
// actionRef.current?.reload();
|
||||
// } catch (e: any) {
|
||||
// message.error(e?.message || '同步失败');
|
||||
// }
|
||||
// }}
|
||||
// >
|
||||
// 同步服务商
|
||||
// </Button>,
|
||||
<Button
|
||||
key="syncSite"
|
||||
type="primary"
|
||||
onClick={async () => {
|
||||
try {
|
||||
const { success } = await logisticscontrollerSyncservices();
|
||||
if (!success) {
|
||||
throw new Error('同步失败');
|
||||
}
|
||||
actionRef.current?.reload();
|
||||
} catch (e: any) {
|
||||
message.error(e?.message || '同步失败');
|
||||
}
|
||||
}}
|
||||
>
|
||||
同步服务商
|
||||
</Button>,
|
||||
]}
|
||||
request={async (values) => {
|
||||
console.log(values);
|
||||
|
|
|
|||
|
|
@ -1,16 +1,11 @@
|
|||
import styles from '../../../style/order-list.css';
|
||||
|
||||
import InternationalPhoneInput from '@/components/InternationalPhoneInput';
|
||||
import { HistoryOrder } from '@/pages/Statistics/Order';
|
||||
import { ORDER_STATUS_ENUM } from '@/constants';
|
||||
import {
|
||||
logisticscontrollerCreateshipment,
|
||||
logisticscontrollerGetshipmentfee,
|
||||
logisticscontrollerDelshipment,
|
||||
logisticscontrollerGetpaymentmethods,
|
||||
logisticscontrollerGetratelist,
|
||||
logisticscontrollerGetshippingaddresslist,
|
||||
// logisticscontrollerGetshipmentlabel,
|
||||
} from '@/servers/api/logistics';
|
||||
import {
|
||||
ordercontrollerCancelorder,
|
||||
|
|
@ -24,7 +19,6 @@ import {
|
|||
ordercontrollerRefundorder,
|
||||
ordercontrollerSyncorder,
|
||||
ordercontrollerSyncorderbyid,
|
||||
ordercontrollerUpdateorderitems,
|
||||
} from '@/servers/api/order';
|
||||
import { productcontrollerSearchproducts } from '@/servers/api/product';
|
||||
import { sitecontrollerAll } from '@/servers/api/site';
|
||||
|
|
@ -64,12 +58,10 @@ import {
|
|||
Button,
|
||||
Card,
|
||||
Col,
|
||||
Descriptions,
|
||||
Divider,
|
||||
Drawer,
|
||||
Dropdown,
|
||||
Empty,
|
||||
message,
|
||||
Popconfirm,
|
||||
Radio,
|
||||
Row,
|
||||
|
|
@ -77,16 +69,13 @@ import {
|
|||
Tabs,
|
||||
TabsProps,
|
||||
} from 'antd';
|
||||
import Item from 'antd/es/list/Item';
|
||||
import dayjs from 'dayjs';
|
||||
import React, { useMemo, useRef, useState } from 'react';
|
||||
import { printPDF } from '@/utils/util';
|
||||
|
||||
const ListPage: React.FC = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [activeKey, setActiveKey] = useState<string>('all');
|
||||
const [count, setCount] = useState<any[]>([]);
|
||||
const [activeLine, setActiveLine] = useState<number>(-1);
|
||||
const tabs: TabsProps['items'] = useMemo(() => {
|
||||
const total = count.reduce((acc, cur) => acc + Number(cur.count), 0);
|
||||
const tabs = [
|
||||
|
|
@ -268,7 +257,7 @@ const ListPage: React.FC = () => {
|
|||
record.orderStatus,
|
||||
) ? (
|
||||
<>
|
||||
<Shipping id={record.id as number} tableRef={actionRef} setActiveLine={setActiveLine}/>
|
||||
<Shipping id={record.id as number} tableRef={actionRef} />
|
||||
<Divider type="vertical" />
|
||||
</>
|
||||
) : (
|
||||
|
|
@ -279,7 +268,6 @@ const ListPage: React.FC = () => {
|
|||
record={record}
|
||||
tableRef={actionRef}
|
||||
orderId={record.id as number}
|
||||
setActiveLine={setActiveLine}
|
||||
/>
|
||||
<Divider type="vertical" />
|
||||
<Dropdown
|
||||
|
|
@ -319,14 +307,6 @@ const ListPage: React.FC = () => {
|
|||
: 'block',
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'history',
|
||||
label:
|
||||
<HistoryOrder
|
||||
email={record.customer_email}
|
||||
tableRef={actionRef}
|
||||
/>,
|
||||
},
|
||||
{
|
||||
key: 'note',
|
||||
label: <OrderNote id={record.id as number} />,
|
||||
|
|
@ -397,9 +377,6 @@ const ListPage: React.FC = () => {
|
|||
scroll={{ x: 'max-content' }}
|
||||
actionRef={actionRef}
|
||||
rowKey="id"
|
||||
rowClassName={(record) => {
|
||||
return record.id === activeLine ? styles['selected-line-order-protable']: '';
|
||||
}}
|
||||
toolBarRender={() => [
|
||||
<CreateOrder tableRef={actionRef} />,
|
||||
<SyncForm tableRef={actionRef} />,
|
||||
|
|
@ -487,8 +464,7 @@ const Detail: React.FC<{
|
|||
tableRef: React.MutableRefObject<ActionType | undefined>;
|
||||
orderId: number;
|
||||
record: API.Order;
|
||||
setActiveLine: Function
|
||||
}> = ({ tableRef, orderId, record, setActiveLine }) => {
|
||||
}> = ({ tableRef, orderId, record }) => {
|
||||
const [visiable, setVisiable] = useState(false);
|
||||
const { message } = App.useApp();
|
||||
const ref = useRef<ActionType>();
|
||||
|
|
@ -499,7 +475,6 @@ const Detail: React.FC<{
|
|||
orderId,
|
||||
});
|
||||
if (!success || !data) return { data: {} };
|
||||
// 合并订单中相同的sku,只显示一次记录总数
|
||||
data.sales = data.sales?.reduce(
|
||||
(acc: API.OrderSale[], cur: API.OrderSale) => {
|
||||
let idx = acc.findIndex((v: any) => v.productId === cur.productId);
|
||||
|
|
@ -519,10 +494,7 @@ const Detail: React.FC<{
|
|||
|
||||
return (
|
||||
<>
|
||||
<Button key="detail" type="primary" onClick={() => {
|
||||
setVisiable(true);
|
||||
setActiveLine(record.id);
|
||||
}}>
|
||||
<Button key="detail" type="primary" onClick={() => setVisiable(true)}>
|
||||
<FileDoneOutlined />
|
||||
详情
|
||||
</Button>
|
||||
|
|
@ -875,18 +847,6 @@ const Detail: React.FC<{
|
|||
);
|
||||
}}
|
||||
/>
|
||||
<ProDescriptions.Item
|
||||
label="换货"
|
||||
span={3}
|
||||
render={(_, record) => {
|
||||
return (
|
||||
<SalesChange
|
||||
detailRef={ref}
|
||||
id={record.id as number}
|
||||
/>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<ProDescriptions.Item
|
||||
label="备注"
|
||||
span={3}
|
||||
|
|
@ -917,7 +877,6 @@ const Detail: React.FC<{
|
|||
label="物流信息"
|
||||
span={3}
|
||||
render={(_, record) => {
|
||||
console.log('record', record);
|
||||
if (!record.shipment || record.shipment.length === 0) {
|
||||
return <Empty description="暂无物流信息" />;
|
||||
}
|
||||
|
|
@ -1061,15 +1020,14 @@ const Shipping: React.FC<{
|
|||
tableRef?: React.MutableRefObject<ActionType | undefined>;
|
||||
descRef?: React.MutableRefObject<ActionType | undefined>;
|
||||
reShipping?: boolean;
|
||||
setActiveLine: Function;
|
||||
}> = ({ id, tableRef, descRef, reShipping = false, setActiveLine }) => {
|
||||
}> = ({ id, tableRef, descRef, reShipping = false }) => {
|
||||
const [options, setOptions] = useState<any[]>([]);
|
||||
const formRef = useRef<ProFormInstance>();
|
||||
|
||||
const [shipmentFee, setShipmentFee] = useState<number>(0);
|
||||
const [rates, setRates] = useState<API.RateDTO[]>([]);
|
||||
const [ratesLoading, setRatesLoading] = useState(false);
|
||||
const { message } = App.useApp();
|
||||
const [serviceType, setServiceType] = useState('');
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
|
|
@ -1084,11 +1042,7 @@ const Shipping: React.FC<{
|
|||
},
|
||||
}}
|
||||
trigger={
|
||||
<Button type="primary"
|
||||
onClick={() => {
|
||||
setActiveLine(id);
|
||||
}}
|
||||
>
|
||||
<Button type="primary">
|
||||
<CodeSandboxOutlined />
|
||||
创建运单
|
||||
</Button>
|
||||
|
|
@ -1122,7 +1076,7 @@ const Shipping: React.FC<{
|
|||
if (shipmentInfo) shipmentInfo = JSON.parse(shipmentInfo);
|
||||
return {
|
||||
...data,
|
||||
// payment_method_id: shipmentInfo?.payment_method_id,
|
||||
payment_method_id: shipmentInfo?.payment_method_id,
|
||||
stockPointId: shipmentInfo?.stockPointId,
|
||||
details: {
|
||||
destination: {
|
||||
|
|
@ -1164,11 +1118,11 @@ const Shipping: React.FC<{
|
|||
{
|
||||
measurements: {
|
||||
weight: {
|
||||
unit: 'LBS',
|
||||
unit: 'lb',
|
||||
value: 1,
|
||||
},
|
||||
cuboid: {
|
||||
unit: 'IN',
|
||||
unit: 'in',
|
||||
l: 6,
|
||||
w: 4,
|
||||
h: 4,
|
||||
|
|
@ -1179,10 +1133,9 @@ const Shipping: React.FC<{
|
|||
],
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
}}
|
||||
onFinish={async ({ customer_note, notes, items, details, externalOrderId, ...data }) => {
|
||||
onFinish={async ({ customer_note, notes, items, details, ...data }) => {
|
||||
details.origin.email_addresses =
|
||||
details.origin.email_addresses.split(',');
|
||||
details.destination.email_addresses =
|
||||
|
|
@ -1191,10 +1144,11 @@ const Shipping: React.FC<{
|
|||
details.destination.phone_number.phone;
|
||||
details.origin.phone_number.number = details.origin.phone_number.phone;
|
||||
try {
|
||||
const { success, message: errMsg, ...resShipment } =
|
||||
const { success, message: errMsg } =
|
||||
await logisticscontrollerCreateshipment(
|
||||
{ orderId: id },
|
||||
{
|
||||
service_type: serviceType,
|
||||
details,
|
||||
...data,
|
||||
},
|
||||
|
|
@ -1207,7 +1161,7 @@ const Shipping: React.FC<{
|
|||
localStorage.setItem(
|
||||
'shipmentInfo',
|
||||
JSON.stringify({
|
||||
// payment_method_id: data.payment_method_id,
|
||||
payment_method_id: data.payment_method_id,
|
||||
stockPointId: data.stockPointId,
|
||||
region: details.origin.address.region,
|
||||
city: details.origin.address.city,
|
||||
|
|
@ -1216,12 +1170,6 @@ const Shipping: React.FC<{
|
|||
phone_number: details.origin.phone_number,
|
||||
}),
|
||||
);
|
||||
|
||||
// todo, 直接打印label
|
||||
// const { resLabel } = await logisticscontrollerGetShipmentLabel(resShipment.data.shipmentId);
|
||||
// console.log('res', resShipment.data.shipmentId, resLabel);
|
||||
// const labelContent = resLabel.content;
|
||||
// printPDF([labelContent]);
|
||||
return true;
|
||||
} catch (error) {
|
||||
message.error(error?.message || '创建失败');
|
||||
|
|
@ -1234,11 +1182,6 @@ const Shipping: React.FC<{
|
|||
}
|
||||
}}
|
||||
>
|
||||
<ProFormText
|
||||
label="订单号"
|
||||
readonly
|
||||
name={"externalOrderId"}
|
||||
/>
|
||||
<ProFormText label="客户备注" readonly name="customer_note" />
|
||||
<ProFormList
|
||||
label="后台备注"
|
||||
|
|
@ -1270,7 +1213,7 @@ const Shipping: React.FC<{
|
|||
}}
|
||||
/>
|
||||
</Col>
|
||||
{/* <Col span={12}>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
label="付款方式"
|
||||
name="payment_method_id"
|
||||
|
|
@ -1287,7 +1230,7 @@ const Shipping: React.FC<{
|
|||
return [];
|
||||
}}
|
||||
/>
|
||||
</Col> */}
|
||||
</Col>
|
||||
</Row>
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
|
|
@ -1606,8 +1549,6 @@ const Shipping: React.FC<{
|
|||
if (packaging_type === 'package') {
|
||||
return (
|
||||
<ProFormList
|
||||
min={1}
|
||||
max={1}
|
||||
label="纸箱尺寸"
|
||||
name={['details', 'packaging_properties', 'packages']}
|
||||
rules={[
|
||||
|
|
@ -1711,8 +1652,11 @@ const Shipping: React.FC<{
|
|||
label="单位"
|
||||
name={['measurements', 'cuboid', 'unit']}
|
||||
valueEnum={{
|
||||
CM: '厘米',
|
||||
IN: '英寸',
|
||||
mm: '毫米',
|
||||
cm: '厘米',
|
||||
m: '米',
|
||||
in: '英寸',
|
||||
ft: '英尺',
|
||||
}}
|
||||
placeholder="请输入单位"
|
||||
rules={[{ required: true, message: '请输入单位' }]}
|
||||
|
|
@ -1728,8 +1672,7 @@ const Shipping: React.FC<{
|
|||
<ProFormSelect
|
||||
label="单位"
|
||||
name={['measurements', 'weight', 'unit']}
|
||||
valueEnum={{ KGS: '千克', LBS: '磅' }}
|
||||
// valueEnum={{ KGS: '千克', LBS: '磅', OZS: '盎司' }}
|
||||
valueEnum={{ kg: '千克', lb: '磅', g: '克', oz: '盎司' }}
|
||||
placeholder="请输入单位"
|
||||
rules={[{ required: true, message: '请输入单位' }]}
|
||||
/>
|
||||
|
|
@ -1769,8 +1712,7 @@ const Shipping: React.FC<{
|
|||
<ProFormSelect
|
||||
label="单位"
|
||||
name={['weight', 'unit']}
|
||||
valueEnum={{ kg: '千克', lb: '磅' }}
|
||||
// valueEnum={{ kg: '千克', lb: '磅', oz: '盎司' }}
|
||||
valueEnum={{ kg: '千克', lb: '磅', g: '克', oz: '盎司' }}
|
||||
placeholder="请输入单位"
|
||||
rules={[{ required: true, message: '请输入单位' }]}
|
||||
/>
|
||||
|
|
@ -1790,184 +1732,62 @@ const Shipping: React.FC<{
|
|||
<Button
|
||||
loading={ratesLoading}
|
||||
onClick={async () => {
|
||||
try {
|
||||
const { customer_note, notes, items, details, externalOrderId, ...data } = formRef.current?.getFieldsValue();
|
||||
const originEmail = details.origin.email_addresses;
|
||||
const destinationEmail = details.destination.email_addresses;
|
||||
await formRef?.current?.validateFields(['details']);
|
||||
setRatesLoading(true);
|
||||
setRates([]);
|
||||
const details = formRef?.current?.getFieldFormatValue?.('details');
|
||||
details.origin.email_addresses =
|
||||
details.origin.email_addresses.split(',');
|
||||
details.destination.email_addresses =
|
||||
details.destination.email_addresses.split(',');
|
||||
details.destination.phone_number.number =
|
||||
details.destination.phone_number.phone;
|
||||
details.origin.phone_number.number = details.origin.phone_number.phone;
|
||||
const res =
|
||||
await logisticscontrollerGetshipmentfee(
|
||||
{
|
||||
stockPointId: data.stockPointId,
|
||||
details.origin.phone_number.number =
|
||||
details.origin.phone_number.phone;
|
||||
try {
|
||||
const {
|
||||
success,
|
||||
message: errMsg,
|
||||
data,
|
||||
} = await logisticscontrollerGetratelist(details);
|
||||
|
||||
sender: details.origin.contact_name,
|
||||
startPhone: details.origin.phone_number,
|
||||
startPostalCode: details.origin.address.postal_code.replace(/\s/g, ''),
|
||||
pickupAddress: details.origin.address.address_line_1,
|
||||
shipperCountryCode: details.origin.address.country,
|
||||
receiver: details.destination.contact_name,
|
||||
city: details.destination.address.city,
|
||||
province: details.destination.address.region,
|
||||
country: details.destination.address.country,
|
||||
postalCode: details.destination.address.postal_code.replace(/\s/g, ''),
|
||||
deliveryAddress: details.destination.address.address_line_1,
|
||||
receiverPhone: details.destination.phone_number.number,
|
||||
receiverEmail: details.destination.email_addresses,
|
||||
length: details.packaging_properties.packages[0].measurements.cuboid.l,
|
||||
width: details.packaging_properties.packages[0].measurements.cuboid.w,
|
||||
height: details.packaging_properties.packages[0].measurements.cuboid.h,
|
||||
dimensionUom: details.packaging_properties.packages[0].measurements.cuboid.unit,
|
||||
weight: details.packaging_properties.packages[0].measurements.weight.value,
|
||||
weightUom: details.packaging_properties.packages[0].measurements.weight.unit,
|
||||
},
|
||||
);
|
||||
if (!res?.success) throw new Error(res?.message);
|
||||
const fee = res.data;
|
||||
setShipmentFee(fee);
|
||||
details.origin.email_addresses = originEmail;
|
||||
details.destination.email_addresses = destinationEmail;
|
||||
formRef.current?.setFieldValue("details", {
|
||||
...details,
|
||||
shipmentFee: fee
|
||||
});
|
||||
message.success('获取运费成功');
|
||||
if (!success) throw new Error(errMsg);
|
||||
setRates(data || []);
|
||||
} catch (error) {
|
||||
message.error(error?.message || '获取运费失败');
|
||||
}
|
||||
setRatesLoading(false);
|
||||
}}
|
||||
>
|
||||
获取运费
|
||||
</Button>
|
||||
<ProFormText
|
||||
readonly
|
||||
name={["details", "shipmentFee"]}
|
||||
<ProFormRadio.Group
|
||||
label="选择运费"
|
||||
name="service_id"
|
||||
rules={[{ required: true, message: '请选择运费' }]}
|
||||
fieldProps={{
|
||||
value: (shipmentFee / 100.0).toFixed(2)
|
||||
}}
|
||||
/>
|
||||
</ModalForm>
|
||||
);
|
||||
};
|
||||
|
||||
const SalesChange: React.FC<{
|
||||
id: number;
|
||||
detailRef?: React.MutableRefObject<ActionType | undefined>;
|
||||
reShipping?: boolean;
|
||||
}> = ({ id, detailRef }) => {
|
||||
const formRef = useRef<ProFormInstance>();
|
||||
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
formRef={formRef}
|
||||
title="换货"
|
||||
size="large"
|
||||
width="80vw"
|
||||
modalProps={{
|
||||
destroyOnHidden: true,
|
||||
styles: {
|
||||
body: { maxHeight: '65vh', overflowY: 'auto', overflowX: 'hidden' },
|
||||
onChange: (e) => {
|
||||
console.log(e.target.value);
|
||||
const type = rates.find(
|
||||
(v) => v.service_id === e.target.value,
|
||||
)?.type;
|
||||
setServiceType(type);
|
||||
},
|
||||
}}
|
||||
trigger={
|
||||
<Button type="primary">
|
||||
<CodeSandboxOutlined />
|
||||
换货
|
||||
</Button>
|
||||
}
|
||||
request={async () => {
|
||||
const { data, success }: API.OrderDetailRes =
|
||||
await ordercontrollerGetorderdetail({
|
||||
orderId: id,
|
||||
});
|
||||
if (!success || !data) return {};
|
||||
data.sales = data.sales?.reduce((acc: API.OrderSale[], cur: API.OrderSale) => {
|
||||
let idx = acc.findIndex((v: any) => v.productId === cur.productId);
|
||||
if (idx === -1) {
|
||||
acc.push(cur);
|
||||
} else {
|
||||
acc[idx].quantity += cur.quantity;
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
[],
|
||||
);
|
||||
// setOptions(
|
||||
// data.sales?.map((item) => ({
|
||||
// label: item.name,
|
||||
// value: item.sku,
|
||||
// })) || [],
|
||||
// );
|
||||
return { ...data };
|
||||
}}
|
||||
onFinish={async (formData: any) => {
|
||||
const { sales } = formData;
|
||||
const res = await ordercontrollerUpdateorderitems({orderId:id}, sales);
|
||||
if (!res.success) {
|
||||
message.error(`更新货物信息失败: ${res.message}`);
|
||||
return false;
|
||||
}
|
||||
message.success('更新成功')
|
||||
detailRef?.current?.reload();
|
||||
return true;
|
||||
}}
|
||||
>
|
||||
<ProFormList
|
||||
label="换货产品"
|
||||
name="sales"
|
||||
>
|
||||
<ProForm.Group>
|
||||
<ProFormSelect
|
||||
params={{ }}
|
||||
request={async ({ keyWords }) => {
|
||||
try {
|
||||
const { data } = await productcontrollerSearchproducts({
|
||||
name: keyWords,
|
||||
});
|
||||
return (
|
||||
data?.map((item) => {
|
||||
options={rates
|
||||
?.sort((a, b) => Number(a?.total?.value) - Number(b?.total?.value))
|
||||
?.map((rate) => {
|
||||
return {
|
||||
label: `${item.name} - ${item.nameCn}`,
|
||||
value: item?.sku,
|
||||
label: `${rate.carrier_name} ${rate.service_name} : ${
|
||||
rate?.total?.value / 100
|
||||
}${rate?.total?.currency}(${rate.transit_time_days}天)`,
|
||||
value: rate.service_id,
|
||||
};
|
||||
})
|
||||
);
|
||||
} catch (error) {
|
||||
return [];
|
||||
}
|
||||
}}
|
||||
name="sku"
|
||||
label="产品"
|
||||
placeholder="请选择产品"
|
||||
tooltip="至少输入3个字符"
|
||||
fieldProps={{
|
||||
showSearch: true,
|
||||
filterOption: false,
|
||||
}}
|
||||
debounceTime={300} // 防抖,减少请求频率
|
||||
rules={[{ required: true, message: '请选择产品' }]}
|
||||
})}
|
||||
/>
|
||||
<ProFormDigit
|
||||
name="quantity"
|
||||
colProps={{ span: 12 }}
|
||||
label="数量"
|
||||
placeholder="请输入数量"
|
||||
rules={[{ required: true, message: '请输入数量' }]}
|
||||
fieldProps={{
|
||||
precision: 0,
|
||||
}}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
</ProFormList>
|
||||
</ModalForm>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const CreateOrder: React.FC<{
|
||||
tableRef?: React.MutableRefObject<ActionType | undefined>;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ const ListPage: React.FC = () => {
|
|||
if(!data.inactiveRes) return {}
|
||||
const xAxisData = data?.inactiveRes?.map(v=> v.order_month)?.sort(_=>-1)
|
||||
const arr = data?.res?.map(v=>v.first_order_month_group)
|
||||
const uniqueArr = arr.filter((item, index) => arr.indexOf(item) === index).sort((a,b)=> a.localeCompare(b))
|
||||
const uniqueArr = arr.filter((item, index) => arr.indexOf(item) === index)
|
||||
const series = [
|
||||
{
|
||||
name: '新客户',
|
||||
|
|
|
|||
|
|
@ -35,12 +35,6 @@ const ListPage: React.FC = () => {
|
|||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '排除套装',
|
||||
dataIndex: 'exceptPackage',
|
||||
valueType: 'switch',
|
||||
hideInTable: true,
|
||||
},
|
||||
{
|
||||
title: '产品名称',
|
||||
dataIndex: 'name',
|
||||
|
|
@ -58,12 +52,12 @@ const ListPage: React.FC = () => {
|
|||
},
|
||||
hideInTable: true,
|
||||
},
|
||||
// {
|
||||
// title: '分类',
|
||||
// dataIndex: 'categoryName',
|
||||
// hideInSearch: true,
|
||||
// hideInTable: isSource,
|
||||
// },
|
||||
{
|
||||
title: '分类',
|
||||
dataIndex: 'categoryName',
|
||||
hideInSearch: true,
|
||||
hideInTable: isSource,
|
||||
},
|
||||
{
|
||||
title: '数量',
|
||||
dataIndex: 'totalQuantity',
|
||||
|
|
|
|||
|
|
@ -525,7 +525,6 @@ const DetailForm: React.FC<{
|
|||
id: number;
|
||||
};
|
||||
}> = ({ tableRef, values }) => {
|
||||
const detailsActionRef = useRef<ActionType>();
|
||||
const { message } = App.useApp();
|
||||
const [form] = Form.useForm();
|
||||
const initialValues = {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
logisticscontrollerGetorderlist,
|
||||
logisticscontrollerGetlistbyorderid
|
||||
logisticscontrollerGetlistbytrackingid,
|
||||
logisticscontrollerGettrackingnumber,
|
||||
} from '@/servers/api/logistics';
|
||||
import { SearchOutlined } from '@ant-design/icons';
|
||||
import { PageContainer, ProFormSelect } from '@ant-design/pro-components';
|
||||
|
|
@ -8,7 +8,7 @@ import { useState } from 'react';
|
|||
|
||||
const TrackPage: React.FC = () => {
|
||||
const [id, setId] = useState<string>();
|
||||
const [data, setData] = useState({});
|
||||
const [data, setData] = useState([]);
|
||||
return (
|
||||
<PageContainer>
|
||||
<ProFormSelect
|
||||
|
|
@ -17,7 +17,7 @@ const TrackPage: React.FC = () => {
|
|||
request={async ({ keyWords }) => {
|
||||
if (!keyWords || keyWords.length < 3) return [];
|
||||
const { data: trackList } =
|
||||
await logisticscontrollerGetorderlist({ number: keyWords });
|
||||
await logisticscontrollerGettrackingnumber({ number: keyWords });
|
||||
return trackList?.map((v) => {
|
||||
return {
|
||||
label: v.siteName + ' ' + v.externalOrderId,
|
||||
|
|
@ -27,16 +27,9 @@ const TrackPage: React.FC = () => {
|
|||
}}
|
||||
fieldProps={{
|
||||
prefix: '订单号',
|
||||
async onChange(value: string) {
|
||||
onChange(value: string) {
|
||||
setId(value);
|
||||
setData({})
|
||||
|
||||
const { data } = await logisticscontrollerGetlistbyorderid({
|
||||
id,
|
||||
});
|
||||
setData(data);
|
||||
},
|
||||
placeholder: '请输入订单号',
|
||||
allowClear: false,
|
||||
suffixIcon: (
|
||||
<SearchOutlined
|
||||
|
|
@ -44,8 +37,8 @@ const TrackPage: React.FC = () => {
|
|||
if (!id) {
|
||||
return;
|
||||
}
|
||||
const { data } = await logisticscontrollerGetlistbyorderid({
|
||||
id,
|
||||
const { data } = await logisticscontrollerGetlistbytrackingid({
|
||||
shipment_id: id,
|
||||
});
|
||||
setData(data);
|
||||
}}
|
||||
|
|
@ -53,32 +46,22 @@ const TrackPage: React.FC = () => {
|
|||
),
|
||||
}}
|
||||
/>
|
||||
{
|
||||
data?.item ?
|
||||
<div>
|
||||
{data.map((item) => (
|
||||
<div>
|
||||
<h4>原订单内容</h4>
|
||||
{data?.item?.map((item) => (
|
||||
<div style={{ paddingLeft: 20, color: 'blue' }}>
|
||||
<h4>
|
||||
{item.name} * {item.quantity}
|
||||
</h4>
|
||||
<div style={{ paddingLeft: 20, color: 'blue' }}>
|
||||
{item.constitution.map((v) => (
|
||||
<div>
|
||||
{v.name} * {v.quantity * item.quantity}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div> : <></>
|
||||
}
|
||||
{
|
||||
data?.saleItem ?
|
||||
<div>
|
||||
<div>
|
||||
<h4>订单内容</h4>
|
||||
{data?.saleItem?.map((item) => (
|
||||
<div style={{ paddingLeft: 20, color: 'blue' }}>
|
||||
{item.name} * {item.quantity}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div> : <></>
|
||||
}
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -36,20 +36,6 @@ export async function logisticscontrollerCreateshippingaddress(
|
|||
});
|
||||
}
|
||||
|
||||
/** 此处后端没有提供注释 POST /logistics/deleteShipment/${param0} */
|
||||
export async function logisticscontrollerDeleteshipment(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.logisticscontrollerDeleteshipmentParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { id: param0, ...queryParams } = params;
|
||||
return request<API.BooleanRes>(`/logistics/deleteShipment/${param0}`, {
|
||||
method: 'POST',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 此处后端没有提供注释 DELETE /logistics/delShippingAddress/${param0} */
|
||||
export async function logisticscontrollerDelshippingaddress(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
|
|
@ -64,28 +50,13 @@ export async function logisticscontrollerDelshippingaddress(
|
|||
});
|
||||
}
|
||||
|
||||
/** 此处后端没有提供注释 POST /logistics/getListByOrderId */
|
||||
export async function logisticscontrollerGetlistbyorderid(
|
||||
/** 此处后端没有提供注释 POST /logistics/getListByTrackingId */
|
||||
export async function logisticscontrollerGetlistbytrackingid(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.logisticscontrollerGetlistbyorderidParams,
|
||||
params: API.logisticscontrollerGetlistbytrackingidParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<any>('/logistics/getListByOrderId', {
|
||||
method: 'POST',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 此处后端没有提供注释 POST /logistics/getOrderList */
|
||||
export async function logisticscontrollerGetorderlist(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.logisticscontrollerGetorderlistParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<any>('/logistics/getOrderList', {
|
||||
return request<any>('/logistics/getListByTrackingId', {
|
||||
method: 'POST',
|
||||
params: {
|
||||
...params,
|
||||
|
|
@ -134,35 +105,6 @@ export async function logisticscontrollerGetservicelist(
|
|||
});
|
||||
}
|
||||
|
||||
/** 此处后端没有提供注释 POST /logistics/getShipmentFee */
|
||||
export async function logisticscontrollerGetshipmentfee(
|
||||
body: API.ShipmentFeeBookDTO,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.BooleanRes>('/logistics/getShipmentFee', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 此处后端没有提供注释 POST /logistics/getShipmentLabel/${param0} */
|
||||
export async function logisticscontrollerGetshipmentlabel(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.logisticscontrollerGetshipmentlabelParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { shipmentId: param0, ...queryParams } = params;
|
||||
return request<API.BooleanRes>(`/logistics/getShipmentLabel/${param0}`, {
|
||||
method: 'POST',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 此处后端没有提供注释 GET /logistics/getShippingAddressList */
|
||||
export async function logisticscontrollerGetshippingaddresslist(options?: {
|
||||
[key: string]: any;
|
||||
|
|
@ -176,6 +118,21 @@ export async function logisticscontrollerGetshippingaddresslist(options?: {
|
|||
);
|
||||
}
|
||||
|
||||
/** 此处后端没有提供注释 POST /logistics/getTrackingNumber */
|
||||
export async function logisticscontrollerGettrackingnumber(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.logisticscontrollerGettrackingnumberParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<any>('/logistics/getTrackingNumber', {
|
||||
method: 'POST',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 此处后端没有提供注释 GET /logistics/list */
|
||||
export async function logisticscontrollerGetlist(options?: {
|
||||
[key: string]: any;
|
||||
|
|
@ -243,17 +200,3 @@ export async function logisticscontrollerUpdateshippingaddress(
|
|||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 此处后端没有提供注释 POST /logistics/updateState/${param0} */
|
||||
export async function logisticscontrollerUpdateshipmentstate(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.logisticscontrollerUpdateshipmentstateParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { shipmentId: param0, ...queryParams } = params;
|
||||
return request<any>(`/logistics/updateState/${param0}`, {
|
||||
method: 'POST',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,22 +208,3 @@ export async function ordercontrollerSyncorderbyid(
|
|||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 此处后端没有提供注释 POST /order/updateOrderItems/${param0} */
|
||||
export async function ordercontrollerUpdateorderitems(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.ordercontrollerUpdateorderitemsParams,
|
||||
body: Record<string, any>,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { orderId: param0, ...queryParams } = params;
|
||||
return request<API.BooleanRes>(`/order/updateOrderItems/${param0}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'text/plain',
|
||||
},
|
||||
params: { ...queryParams },
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,6 +141,11 @@ declare namespace API {
|
|||
email_addresses?: any;
|
||||
};
|
||||
|
||||
type LoginDTO = {
|
||||
username?: string;
|
||||
password?: string;
|
||||
};
|
||||
|
||||
type LoginRes = {
|
||||
/** 状态码 */
|
||||
code?: number;
|
||||
|
|
@ -163,24 +168,16 @@ declare namespace API {
|
|||
orderId: number;
|
||||
};
|
||||
|
||||
type logisticscontrollerDeleteshipmentParams = {
|
||||
id: number;
|
||||
};
|
||||
|
||||
type logisticscontrollerDelshipmentParams = {
|
||||
id: number;
|
||||
id: string;
|
||||
};
|
||||
|
||||
type logisticscontrollerDelshippingaddressParams = {
|
||||
id: number;
|
||||
};
|
||||
|
||||
type logisticscontrollerGetlistbyorderidParams = {
|
||||
id?: number;
|
||||
};
|
||||
|
||||
type logisticscontrollerGetorderlistParams = {
|
||||
number?: string;
|
||||
type logisticscontrollerGetlistbytrackingidParams = {
|
||||
shipment_id?: string;
|
||||
};
|
||||
|
||||
type logisticscontrollerGetservicelistParams = {
|
||||
|
|
@ -192,12 +189,8 @@ declare namespace API {
|
|||
isActive?: boolean;
|
||||
};
|
||||
|
||||
type logisticscontrollerGetshipmentlabelParams = {
|
||||
shipmentId: number;
|
||||
};
|
||||
|
||||
type logisticscontrollerUpdateshipmentstateParams = {
|
||||
shipmentId: number;
|
||||
type logisticscontrollerGettrackingnumberParams = {
|
||||
number?: string;
|
||||
};
|
||||
|
||||
type logisticscontrollerUpdateshippingaddressParams = {
|
||||
|
|
@ -220,7 +213,6 @@ declare namespace API {
|
|||
externalOrderId?: string;
|
||||
status?: any;
|
||||
orderStatus?: any;
|
||||
shipmentId?: number;
|
||||
currency?: string;
|
||||
currency_symbol?: string;
|
||||
prices_include_tax?: boolean;
|
||||
|
|
@ -345,17 +337,12 @@ declare namespace API {
|
|||
siteId: string;
|
||||
};
|
||||
|
||||
type ordercontrollerUpdateorderitemsParams = {
|
||||
orderId: number;
|
||||
};
|
||||
|
||||
type OrderDetail = {
|
||||
id?: number;
|
||||
siteId?: string;
|
||||
externalOrderId?: string;
|
||||
status?: any;
|
||||
orderStatus?: any;
|
||||
shipmentId?: number;
|
||||
currency?: string;
|
||||
currency_symbol?: string;
|
||||
prices_include_tax?: boolean;
|
||||
|
|
@ -399,6 +386,7 @@ declare namespace API {
|
|||
items?: OrderItem[];
|
||||
sales?: OrderSale[];
|
||||
refundItems?: OrderRefundItem[];
|
||||
trackings?: Tracking[];
|
||||
notes?: OrderNote[];
|
||||
};
|
||||
|
||||
|
|
@ -501,11 +489,7 @@ declare namespace API {
|
|||
/** sku */
|
||||
sku?: string;
|
||||
quantity?: number;
|
||||
exceptPackage?: boolean;
|
||||
isYoone?: boolean;
|
||||
isZex?: boolean;
|
||||
size?: number;
|
||||
isYooneNew?: boolean;
|
||||
isPackage?: boolean;
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
/** 更新时间 */
|
||||
|
|
@ -522,11 +506,7 @@ declare namespace API {
|
|||
/** sku */
|
||||
sku?: string;
|
||||
quantity?: number;
|
||||
exceptPackage?: boolean;
|
||||
isYoone?: boolean;
|
||||
isZex?: boolean;
|
||||
size?: number;
|
||||
isYooneNew?: boolean;
|
||||
isPackage?: boolean;
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
/** 更新时间 */
|
||||
|
|
@ -1004,32 +984,26 @@ declare namespace API {
|
|||
|
||||
type ShipmentBookDTO = {
|
||||
sales?: OrderSale[];
|
||||
payment_method_id?: string;
|
||||
service_id?: string;
|
||||
service_type?: string;
|
||||
details?: ShippingDetailsDTO;
|
||||
stockPointId?: number;
|
||||
orderIds?: number[];
|
||||
};
|
||||
|
||||
type ShipmentFeeBookDTO = {
|
||||
stockPointId?: number;
|
||||
sender?: string;
|
||||
startPhone?: string;
|
||||
startPostalCode?: string;
|
||||
pickupAddress?: string;
|
||||
shipperCountryCode?: string;
|
||||
receiver?: string;
|
||||
city?: string;
|
||||
province?: string;
|
||||
country?: string;
|
||||
postalCode?: string;
|
||||
deliveryAddress?: string;
|
||||
receiverPhone?: string;
|
||||
receiverEmail?: string;
|
||||
length?: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
dimensionUom?: string;
|
||||
weight?: number;
|
||||
weightUom?: string;
|
||||
type ShipmentItem = {
|
||||
id?: number;
|
||||
shipment_id?: string;
|
||||
productId?: number;
|
||||
name?: string;
|
||||
/** sku */
|
||||
sku?: string;
|
||||
quantity?: number;
|
||||
/** 创建时间 */
|
||||
createdAt: string;
|
||||
/** 更新时间 */
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
type ShippingAddress = {
|
||||
|
|
@ -1058,7 +1032,6 @@ declare namespace API {
|
|||
};
|
||||
|
||||
type ShippingDetailsDTO = {
|
||||
shipmentFee?: number;
|
||||
origin?: Location;
|
||||
destination?: Destination;
|
||||
expected_ship_date?: Date;
|
||||
|
|
@ -1297,6 +1270,27 @@ declare namespace API {
|
|||
minute?: string;
|
||||
};
|
||||
|
||||
type Tracking = {
|
||||
id?: string;
|
||||
tracking_provider?: string;
|
||||
unique_id?: string;
|
||||
transaction_number?: string;
|
||||
primary_tracking_number?: string;
|
||||
tracking_numbers?: string[];
|
||||
tracking_url?: string;
|
||||
return_tracking_number?: string;
|
||||
bol_number?: string;
|
||||
pickup_confirmation_number?: string;
|
||||
customs_invoice_url?: string;
|
||||
rate?: Record<string, any>;
|
||||
labels?: any;
|
||||
/** 创建时间 */
|
||||
createdAt: string;
|
||||
/** 更新时间 */
|
||||
updatedAt: string;
|
||||
products?: ShipmentItem[];
|
||||
};
|
||||
|
||||
type UpdateCategoryDTO = {
|
||||
/** 分类名称 */
|
||||
name?: string;
|
||||
|
|
@ -1475,7 +1469,7 @@ declare namespace API {
|
|||
/** 是否促销中 */
|
||||
on_sale?: boolean;
|
||||
/** 产品类型 */
|
||||
type?: 'simple' | 'variable' | 'woosb';
|
||||
type?: 'simple' | 'variable';
|
||||
/** 创建时间 */
|
||||
createdAt: string;
|
||||
/** 更新时间 */
|
||||
|
|
|
|||
|
|
@ -37,13 +37,13 @@ export async function usercontrollerListusers(options?: {
|
|||
|
||||
/** 此处后端没有提供注释 POST /user/login */
|
||||
export async function usercontrollerLogin(
|
||||
body: Record<string, any>,
|
||||
body: API.LoginDTO,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.LoginRes>('/user/login', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'text/plain',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
.selected-line-order-protable {
|
||||
background-color: #add8e6;
|
||||
}
|
||||
|
|
@ -59,47 +59,3 @@ export function formatShipmentState(state: string) {
|
|||
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 '未知状态';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ export async function printPDF(urls: string[]) {
|
|||
function next() {
|
||||
if (index >= urls.length) return;
|
||||
printJS({
|
||||
base64: true,
|
||||
printable: urls[index],
|
||||
type: 'pdf',
|
||||
showModal: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue