forked from yoone/WEB
1
0
Fork 0

Compare commits

..

34 Commits

Author SHA1 Message Date
黄珑 35c26c07c4 销售统计增加了筛选内容 2025-09-12 12:27:40 +00:00
cll 5e7bd8647e fix: 物流打印label 2025-09-03 10:53:07 +08:00
cll 23a40af797 fix: bug 2025-09-02 14:34:14 +08:00
cll 0da1459e3f fix:接口参数调整 2025-09-02 14:32:11 +08:00
cll c0f05bc6fe fix:订单来源排序 2025-09-01 16:38:44 +08:00
cll 46202d602e fix: 接口参数调整 2025-09-01 14:41:55 +08:00
cll ac948ac0f4 fix: track查询更换后产品 2025-09-01 11:52:27 +08:00
黄珑 c41f0e668e 增加了permission对左侧菜单显示的控制 2025-08-28 18:19:28 +08:00
黄珑 b432b3af17 补充: 高亮样式文件 2025-08-25 16:03:00 +08:00
黄珑 c77020f3d6 Fix: 换货sku初始值显示异常 2025-08-25 16:00:57 +08:00
黄珑 e19b6c3656 订单页,查看详情和创建运单增加高亮 2025-08-25 16:00:57 +08:00
黄珑 68a7b02d21 Fix: 获取运费增加正确提示 2025-08-25 01:41:06 +00:00
cll d54782f742 fix:销售统计 2025-08-23 11:47:10 +08:00
cll c815ab3396 fix:hash build 2025-08-23 09:23:25 +08:00
黄珑 fb79163721 Feature: 增加换货功能 2025-08-21 16:21:37 +08:00
黄珑 b9449c3a8a Fix: Fix shipment fee error 2025-08-16 11:36:51 +08:00
黄珑 2cc36e065b Fix: 仓库管理页显示网站名称 2025-08-13 18:07:58 +08:00
黄珑 1c0ee37b72 Fix: bug fix 2025-08-13 17:51:27 +08:00
黄珑 3c4a53b4bb 创建运单时增加订单号 2025-08-13 16:45:58 +08:00
黄珑 b6ba23864a Feature update shipment
物流管理增加订单号
取消运单响应
取消物流二次确认
追踪物流状态
取消运单检测物流检测
2025-08-13 12:27:12 +08:00
黄珑 081b87df7b 取消订单响应,取消物流二次确认 2025-08-11 15:13:27 +08:00
黄珑 00ee8d8656 物流管理:增加订单号,完善搜索功能 2025-08-11 13:57:58 +08:00
黄珑 0356c77bad Fix: 增加删除运单按钮 2025-08-09 19:47:48 +08:00
cll cb596ada87 Merge branch 'dev/cll-fix' 2025-08-08 20:47:21 +08:00
cll 95617d1c28 fix: bug 2025-08-08 20:46:58 +08:00
cll 45fb186ed3 Merge branch 'dev/cll-fix' 2025-08-08 20:24:45 +08:00
cll 94962c4835 fix: 订单列表-历史订单 2025-08-08 20:24:08 +08:00
longbot 644fb1775f Merge pull request 'Fix: bug fix' (#3) from longbot/WEB:Feature-add-shipment into main
Reviewed-on: yoone/WEB#3
2025-08-08 11:33:54 +00:00
黄珑 4da8fbfdc8 Fix: bug fix 2025-08-08 19:24:15 +08:00
yoone d609e563ff Merge pull request 'Fix bug' (#2) from longbot/WEB:Feature-add-shipment into main
Reviewed-on: yoone/WEB#2
2025-08-07 12:20:55 +00:00
黄珑 df374c4b35 Fix bug 2025-08-07 20:19:11 +08:00
yoone 7e6de57924 Merge pull request 'Feature-add-shipment' (#1) from longbot/WEB:Feature-add-shipment into main
Reviewed-on: yoone/WEB#1
2025-08-07 08:36:52 +00:00
黄珑 703e2c87cb Fix bug 2025-08-06 19:27:48 +08:00
黄珑 cb7a27530a Feature: add shipment 2025-08-06 10:59:14 +08:00
21 changed files with 820 additions and 405 deletions

3
.gitignore vendored
View File

@ -12,4 +12,5 @@
/.mfsu
.swc
/package-lock.json
/yarn.lock
/yarn.lock
*.yaml

View File

@ -6,6 +6,7 @@ const UMI_APP_API_URL = isDev
: 'https://api.yoone.ca';
export default defineConfig({
hash: true,
antd: {},
access: {},
model: {},
@ -25,7 +26,7 @@ export default defineConfig({
{
name: '组织架构',
path: '/organiza',
access: 'canSeeSuper',
access: 'canSeeOrganiza',
routes: [
{
name: '用户管理',
@ -37,6 +38,7 @@ export default defineConfig({
{
name: '商品管理',
path: '/product',
access: 'canSeeProduct',
routes: [
{
name: '商品分类',
@ -68,6 +70,7 @@ export default defineConfig({
{
name: '库存管理',
path: '/stock',
access: 'canSeeStock',
routes: [
{
name: '库存列表',
@ -99,7 +102,7 @@ export default defineConfig({
{
name: '订单管理',
path: '/order',
access: 'canSeeAdmin',
access: 'canSeeOrder',
routes: [
{
name: '订单列表',
@ -116,6 +119,7 @@ export default defineConfig({
{
name: '客户管理',
path: '/customer',
access: 'canSeeCustomer',
routes: [
{
name: '客户列表',
@ -124,54 +128,52 @@ export default defineConfig({
},
],
},
// {
// 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: '/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: '/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: '库存预测',

View File

@ -26,6 +26,7 @@
"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": {

View File

@ -1,9 +1,22 @@
export default (initialState: any) => {
const canSeeSuper = initialState?.user?.isSuper;
const canSeeAdmin =
initialState?.user?.isSuper || initialState?.user?.isAdmin;
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);
return {
canSeeSuper,
canSeeAdmin,
canSeeOrganiza,
canSeeProduct,
canSeeStock,
canSeeOrder,
canSeeCustomer,
canSeeLogistics,
canSeeStatistics,
};
};

View File

@ -23,7 +23,6 @@ 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();

View File

@ -1,21 +1,27 @@
import { logisticscontrollerGetlist } from '@/servers/api/logistics';
import { logisticscontrollerGetlist, logisticscontrollerGetshipmentlabel,
logisticscontrollerDeleteshipment,
logisticscontrollerUpdateshipmentstate
} from '@/servers/api/logistics';
import { stockcontrollerGetallstockpoints } from '@/servers/api/stock';
import { formatShipmentState } from '@/utils/format';
import { formatUniuniShipmentState } 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 } from 'antd';
import { App, Button, Divider, Popconfirm } 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>[] = [
{
@ -26,7 +32,7 @@ const ListPage: React.FC = () => {
{
title: '仓库',
dataIndex: 'stockPointId',
hideInTable: true,
// hideInTable: true,
valueType: 'select',
request: async () => {
const { data = [] } = await stockcontrollerGetallstockpoints();
@ -36,17 +42,34 @@ 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: 'primary_tracking_number',
dataIndex: 'return_tracking_number',
render(_, record) {
return (
<>
{record.primary_tracking_number}
{record.return_tracking_number}
<CopyOutlined
onClick={async () => {
try {
await navigator.clipboard.writeText(record.tracking_url);
await navigator.clipboard.writeText(record.return_tracking_number);
message.success('复制成功!');
} catch (err) {
message.error('复制失败!');
@ -62,7 +85,7 @@ const ListPage: React.FC = () => {
dataIndex: 'state',
hideInSearch: true,
render(_, record) {
return formatShipmentState(record.state);
return formatUniuniShipmentState(record.state);
},
},
{
@ -76,20 +99,62 @@ const ListPage: React.FC = () => {
dataIndex: 'operation',
hideInSearch: true,
render(_, record) {
if (!record?.labels?.length) return null;
return (
<Button
type="primary"
onClick={() => {
// printPDF([record.labels[record.labels.length - 1].url])
window.open(
record.labels[record.labels.length - 1].url,
'_blank',
);
}}
>
</Button>
<>
<Button
type="primary"
disabled={isLoading}
onClick={async () => {
setIsLoading(true);
const { data } = await logisticscontrollerGetshipmentlabel({shipmentId:record.id});
const content = data.content;
printPDF([content]);
setIsLoading(false);
}}
>
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 />
</>
);
},
},

View File

@ -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);

View File

@ -1,11 +1,16 @@
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,
@ -19,6 +24,7 @@ import {
ordercontrollerRefundorder,
ordercontrollerSyncorder,
ordercontrollerSyncorderbyid,
ordercontrollerUpdateorderitems,
} from '@/servers/api/order';
import { productcontrollerSearchproducts } from '@/servers/api/product';
import { sitecontrollerAll } from '@/servers/api/site';
@ -58,10 +64,12 @@ import {
Button,
Card,
Col,
Descriptions,
Divider,
Drawer,
Dropdown,
Empty,
message,
Popconfirm,
Radio,
Row,
@ -69,13 +77,16 @@ 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 = [
@ -257,7 +268,7 @@ const ListPage: React.FC = () => {
record.orderStatus,
) ? (
<>
<Shipping id={record.id as number} tableRef={actionRef} />
<Shipping id={record.id as number} tableRef={actionRef} setActiveLine={setActiveLine}/>
<Divider type="vertical" />
</>
) : (
@ -268,6 +279,7 @@ const ListPage: React.FC = () => {
record={record}
tableRef={actionRef}
orderId={record.id as number}
setActiveLine={setActiveLine}
/>
<Divider type="vertical" />
<Dropdown
@ -307,6 +319,14 @@ const ListPage: React.FC = () => {
: 'block',
},
},
{
key: 'history',
label:
<HistoryOrder
email={record.customer_email}
tableRef={actionRef}
/>,
},
{
key: 'note',
label: <OrderNote id={record.id as number} />,
@ -377,6 +397,9 @@ 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} />,
@ -464,7 +487,8 @@ const Detail: React.FC<{
tableRef: React.MutableRefObject<ActionType | undefined>;
orderId: number;
record: API.Order;
}> = ({ tableRef, orderId, record }) => {
setActiveLine: Function
}> = ({ tableRef, orderId, record, setActiveLine }) => {
const [visiable, setVisiable] = useState(false);
const { message } = App.useApp();
const ref = useRef<ActionType>();
@ -475,6 +499,7 @@ 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);
@ -494,7 +519,10 @@ const Detail: React.FC<{
return (
<>
<Button key="detail" type="primary" onClick={() => setVisiable(true)}>
<Button key="detail" type="primary" onClick={() => {
setVisiable(true);
setActiveLine(record.id);
}}>
<FileDoneOutlined />
</Button>
@ -511,29 +539,29 @@ const Detail: React.FC<{
)
? []
: [
<Divider type="vertical" />,
<Button
type="primary"
onClick={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerSyncorderbyid({
siteId: record.siteId as string,
orderId: record.externalOrderId as string,
});
if (!success) {
throw new Error(errMsg);
}
message.success('同步成功');
tableRef.current?.reload();
} catch (error) {
message.error(error?.message || '同步失败');
<Divider type="vertical" />,
<Button
type="primary"
onClick={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerSyncorderbyid({
siteId: record.siteId as string,
orderId: record.externalOrderId as string,
});
if (!success) {
throw new Error(errMsg);
}
}}
>
</Button>,
]),
message.success('同步成功');
tableRef.current?.reload();
} catch (error) {
message.error(error?.message || '同步失败');
}
}}
>
</Button>,
]),
// ...(['processing', 'pending_reshipment'].includes(record.orderStatus)
// ? [
// <Divider type="vertical" />,
@ -552,136 +580,136 @@ const Detail: React.FC<{
'pending_refund',
].includes(record.orderStatus)
? [
<Divider type="vertical" />,
<Popconfirm
title="转至售后"
description="确认转至售后?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerChangestatus(
{
id: record.id,
},
{
status: 'after_sale_pending',
},
);
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
<Divider type="vertical" />,
<Popconfirm
title="转至售后"
description="确认转至售后?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerChangestatus(
{
id: record.id,
},
{
status: 'after_sale_pending',
},
);
if (!success) {
throw new Error(errMsg);
}
}}
>
<Button type="primary" ghost>
</Button>
</Popconfirm>,
]
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
</Button>
</Popconfirm>,
]
: []),
...(record.orderStatus === 'after_sale_pending'
? [
<Divider type="vertical" />,
<Popconfirm
title="转至取消"
description="确认转至取消?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerCancelorder({
<Divider type="vertical" />,
<Popconfirm
title="转至取消"
description="确认转至取消?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerCancelorder({
id: record.id,
});
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
</Button>
</Popconfirm>,
<Divider type="vertical" />,
<Popconfirm
title="转至退款"
description="确认转至退款?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerRefundorder({
id: record.id,
});
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
退
</Button>
</Popconfirm>,
<Divider type="vertical" />,
<Popconfirm
title="转至完成"
description="确认转至完成?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerCompletedorder({
id: record.id,
});
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
</Button>
</Popconfirm>,
<Divider type="vertical" />,
<Popconfirm
title="转至待补发"
description="确认转至待补发?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerChangestatus(
{
id: record.id,
});
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
},
{
status: 'pending_reshipment',
},
);
if (!success) {
throw new Error(errMsg);
}
}}
>
<Button type="primary" ghost>
</Button>
</Popconfirm>,
<Divider type="vertical" />,
<Popconfirm
title="转至退款"
description="确认转至退款?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerRefundorder({
id: record.id,
});
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
退
</Button>
</Popconfirm>,
<Divider type="vertical" />,
<Popconfirm
title="转至完成"
description="确认转至完成?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerCompletedorder({
id: record.id,
});
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
</Button>
</Popconfirm>,
<Divider type="vertical" />,
<Popconfirm
title="转至待补发"
description="确认转至待补发?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await ordercontrollerChangestatus(
{
id: record.id,
},
{
status: 'pending_reshipment',
},
);
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
</Button>
</Popconfirm>,
]
tableRef.current?.reload();
} catch (error: any) {
message.error(error.message);
}
}}
>
<Button type="primary" ghost>
</Button>
</Popconfirm>,
]
: []),
]}
>
@ -847,6 +875,18 @@ 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}
@ -877,6 +917,7 @@ const Detail: React.FC<{
label="物流信息"
span={3}
render={(_, record) => {
console.log('record', record);
if (!record.shipment || record.shipment.length === 0) {
return <Empty description="暂无物流信息" />;
}
@ -912,31 +953,31 @@ const Detail: React.FC<{
}
actions={
v.state === 'waiting-for-scheduling' ||
v.state === 'waiting-for-transit'
v.state === 'waiting-for-transit'
? [
<Popconfirm
title="取消运单"
description="确认取消运单?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await logisticscontrollerDelshipment({
id: v.id,
});
if (!success) {
throw new Error(errMsg);
}
tableRef.current?.reload();
initRequest();
} catch (error: any) {
message.error(error.message);
<Popconfirm
title="取消运单"
description="确认取消运单?"
onConfirm={async () => {
try {
const { success, message: errMsg } =
await logisticscontrollerDelshipment({
id: v.id,
});
if (!success) {
throw new Error(errMsg);
}
}}
>
<DeleteFilled />
</Popconfirm>,
]
tableRef.current?.reload();
initRequest();
} catch (error: any) {
message.error(error.message);
}
}}
>
<DeleteFilled />
</Popconfirm>,
]
: []
}
>
@ -1020,14 +1061,15 @@ const Shipping: React.FC<{
tableRef?: React.MutableRefObject<ActionType | undefined>;
descRef?: React.MutableRefObject<ActionType | undefined>;
reShipping?: boolean;
}> = ({ id, tableRef, descRef, reShipping = false }) => {
setActiveLine: Function;
}> = ({ id, tableRef, descRef, reShipping = false, setActiveLine }) => {
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
@ -1042,7 +1084,11 @@ const Shipping: React.FC<{
},
}}
trigger={
<Button type="primary">
<Button type="primary"
onClick={() => {
setActiveLine(id);
}}
>
<CodeSandboxOutlined />
</Button>
@ -1076,7 +1122,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: {
@ -1118,11 +1164,11 @@ const Shipping: React.FC<{
{
measurements: {
weight: {
unit: 'lb',
unit: 'LBS',
value: 1,
},
cuboid: {
unit: 'in',
unit: 'IN',
l: 6,
w: 4,
h: 4,
@ -1133,9 +1179,10 @@ const Shipping: React.FC<{
],
},
},
};
}}
onFinish={async ({ customer_note, notes, items, details, ...data }) => {
onFinish={async ({ customer_note, notes, items, details, externalOrderId, ...data }) => {
details.origin.email_addresses =
details.origin.email_addresses.split(',');
details.destination.email_addresses =
@ -1144,11 +1191,10 @@ const Shipping: React.FC<{
details.destination.phone_number.phone;
details.origin.phone_number.number = details.origin.phone_number.phone;
try {
const { success, message: errMsg } =
const { success, message: errMsg, ...resShipment } =
await logisticscontrollerCreateshipment(
{ orderId: id },
{
service_type: serviceType,
details,
...data,
},
@ -1161,7 +1207,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,
@ -1170,6 +1216,12 @@ 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 || '创建失败');
@ -1182,6 +1234,11 @@ const Shipping: React.FC<{
}
}}
>
<ProFormText
label="订单号"
readonly
name={"externalOrderId"}
/>
<ProFormText label="客户备注" readonly name="customer_note" />
<ProFormList
label="后台备注"
@ -1213,7 +1270,7 @@ const Shipping: React.FC<{
}}
/>
</Col>
<Col span={12}>
{/* <Col span={12}>
<ProFormSelect
label="付款方式"
name="payment_method_id"
@ -1230,7 +1287,7 @@ const Shipping: React.FC<{
return [];
}}
/>
</Col>
</Col> */}
</Row>
<Row gutter={16}>
<Col span={12}>
@ -1273,7 +1330,7 @@ const Shipping: React.FC<{
return (
data?.map((item) => {
return {
label: `${item.name} - ${item.nameCn}`,
label: `${item.name} - ${item.nameCn}`,
value: item?.sku,
};
}) || options
@ -1549,6 +1606,8 @@ const Shipping: React.FC<{
if (packaging_type === 'package') {
return (
<ProFormList
min={1}
max={1}
label="纸箱尺寸"
name={['details', 'packaging_properties', 'packages']}
rules={[
@ -1652,11 +1711,8 @@ const Shipping: React.FC<{
label="单位"
name={['measurements', 'cuboid', 'unit']}
valueEnum={{
mm: '毫米',
cm: '厘米',
m: '米',
in: '英寸',
ft: '英尺',
CM: '厘米',
IN: '英寸',
}}
placeholder="请输入单位"
rules={[{ required: true, message: '请输入单位' }]}
@ -1672,7 +1728,8 @@ const Shipping: React.FC<{
<ProFormSelect
label="单位"
name={['measurements', 'weight', 'unit']}
valueEnum={{ kg: '千克', lb: '磅', g: '克', oz: '盎司' }}
valueEnum={{ KGS: '千克', LBS: '磅' }}
// valueEnum={{ KGS: '千克', LBS: '磅', OZS: '盎司' }}
placeholder="请输入单位"
rules={[{ required: true, message: '请输入单位' }]}
/>
@ -1681,7 +1738,7 @@ const Shipping: React.FC<{
name="description"
placeholder="请输入描述"
width="lg"
// rules={[{ required: true, message: '请输入描述' }]}
// rules={[{ required: true, message: '请输入描述' }]}
/>
</ProForm.Group>
</ProFormList>
@ -1712,7 +1769,8 @@ const Shipping: React.FC<{
<ProFormSelect
label="单位"
name={['weight', 'unit']}
valueEnum={{ kg: '千克', lb: '磅', g: '克', oz: '盎司' }}
valueEnum={{ kg: '千克', lb: '磅' }}
// valueEnum={{ kg: '千克', lb: '磅', oz: '盎司' }}
placeholder="请输入单位"
rules={[{ required: true, message: '请输入单位' }]}
/>
@ -1732,63 +1790,185 @@ const Shipping: React.FC<{
<Button
loading={ratesLoading}
onClick={async () => {
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;
try {
const {
success,
message: errMsg,
data,
} = await logisticscontrollerGetratelist(details);
const { customer_note, notes, items, details, externalOrderId, ...data } = formRef.current?.getFieldsValue();
const originEmail = details.origin.email_addresses;
const destinationEmail = details.destination.email_addresses;
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,
if (!success) throw new Error(errMsg);
setRates(data || []);
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('获取运费成功');
} catch (error) {
message.error(error?.message || '获取运费失败');
}
setRatesLoading(false);
}}
>
</Button>
<ProFormRadio.Group
label="选择运费"
name="service_id"
rules={[{ required: true, message: '请选择运费' }]}
<ProFormText
readonly
name={["details", "shipmentFee"]}
fieldProps={{
onChange: (e) => {
console.log(e.target.value);
const type = rates.find(
(v) => v.service_id === e.target.value,
)?.type;
setServiceType(type);
},
value: (shipmentFee / 100.0).toFixed(2)
}}
options={rates
?.sort((a, b) => Number(a?.total?.value) - Number(b?.total?.value))
?.map((rate) => {
return {
label: `${rate.carrier_name} ${rate.service_name} : ${
rate?.total?.value / 100
}${rate?.total?.currency}(${rate.transit_time_days})`,
value: rate.service_id,
};
})}
/>
</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' },
},
}}
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) => {
return {
label: `${item.name} - ${item.nameCn}`,
value: item?.sku,
};
})
);
} 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>;
}> = ({ tableRef }) => {
@ -1852,7 +2032,7 @@ const CreateOrder: React.FC<{
return (
data?.map((item) => {
return {
label: `${item.name} - ${item.nameCn}`,
label: `${item.name} - ${item.nameCn}`,
value: item?.sku,
};
}) || options

View File

@ -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)
const uniqueArr = arr.filter((item, index) => arr.indexOf(item) === index).sort((a,b)=> a.localeCompare(b))
const series = [
{
name: '新客户',

View File

@ -35,6 +35,12 @@ const ListPage: React.FC = () => {
],
},
},
{
title: '排除套装',
dataIndex: 'exceptPackage',
valueType: 'switch',
hideInTable: true,
},
{
title: '产品名称',
dataIndex: 'name',
@ -52,12 +58,12 @@ const ListPage: React.FC = () => {
},
hideInTable: true,
},
{
title: '分类',
dataIndex: 'categoryName',
hideInSearch: true,
hideInTable: isSource,
},
// {
// title: '分类',
// dataIndex: 'categoryName',
// hideInSearch: true,
// hideInTable: isSource,
// },
{
title: '数量',
dataIndex: 'totalQuantity',

View File

@ -525,6 +525,7 @@ const DetailForm: React.FC<{
id: number;
};
}> = ({ tableRef, values }) => {
const detailsActionRef = useRef<ActionType>();
const { message } = App.useApp();
const [form] = Form.useForm();
const initialValues = {

View File

@ -1,6 +1,6 @@
import {
logisticscontrollerGetlistbytrackingid,
logisticscontrollerGettrackingnumber,
logisticscontrollerGetorderlist,
logisticscontrollerGetlistbyorderid
} 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 logisticscontrollerGettrackingnumber({ number: keyWords });
await logisticscontrollerGetorderlist({ number: keyWords });
return trackList?.map((v) => {
return {
label: v.siteName + ' ' + v.externalOrderId,
@ -27,9 +27,16 @@ const TrackPage: React.FC = () => {
}}
fieldProps={{
prefix: '订单号',
onChange(value: string) {
async onChange(value: string) {
setId(value);
setData({})
const { data } = await logisticscontrollerGetlistbyorderid({
id,
});
setData(data);
},
placeholder: '请输入订单号',
allowClear: false,
suffixIcon: (
<SearchOutlined
@ -37,8 +44,8 @@ const TrackPage: React.FC = () => {
if (!id) {
return;
}
const { data } = await logisticscontrollerGetlistbytrackingid({
shipment_id: id,
const { data } = await logisticscontrollerGetlistbyorderid({
id,
});
setData(data);
}}
@ -46,22 +53,32 @@ const TrackPage: React.FC = () => {
),
}}
/>
<div>
{data.map((item) => (
{
data?.item ?
<div>
<h4>
{item.name} * {item.quantity}
</h4>
<div style={{ paddingLeft: 20, color: 'blue' }}>
{item.constitution.map((v) => (
<div>
{v.name} * {v.quantity * item.quantity}
<div>
<h4></h4>
{data?.item?.map((item) => (
<div style={{ paddingLeft: 20, color: 'blue' }}>
{item.name} * {item.quantity}
</div>
))}
</div>
</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>
);
};

View File

@ -36,6 +36,20 @@ 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默认没有生成对象)
@ -50,13 +64,28 @@ export async function logisticscontrollerDelshippingaddress(
});
}
/** 此处后端没有提供注释 POST /logistics/getListByTrackingId */
export async function logisticscontrollerGetlistbytrackingid(
/** 此处后端没有提供注释 POST /logistics/getListByOrderId */
export async function logisticscontrollerGetlistbyorderid(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.logisticscontrollerGetlistbytrackingidParams,
params: API.logisticscontrollerGetlistbyorderidParams,
options?: { [key: string]: any },
) {
return request<any>('/logistics/getListByTrackingId', {
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', {
method: 'POST',
params: {
...params,
@ -105,6 +134,35 @@ 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;
@ -118,21 +176,6 @@ 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;
@ -200,3 +243,17 @@ 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 || {}),
});
}

View File

@ -208,3 +208,22 @@ 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 || {}),
});
}

View File

@ -141,11 +141,6 @@ declare namespace API {
email_addresses?: any;
};
type LoginDTO = {
username?: string;
password?: string;
};
type LoginRes = {
/** 状态码 */
code?: number;
@ -168,16 +163,24 @@ declare namespace API {
orderId: number;
};
type logisticscontrollerDeleteshipmentParams = {
id: number;
};
type logisticscontrollerDelshipmentParams = {
id: string;
id: number;
};
type logisticscontrollerDelshippingaddressParams = {
id: number;
};
type logisticscontrollerGetlistbytrackingidParams = {
shipment_id?: string;
type logisticscontrollerGetlistbyorderidParams = {
id?: number;
};
type logisticscontrollerGetorderlistParams = {
number?: string;
};
type logisticscontrollerGetservicelistParams = {
@ -189,8 +192,12 @@ declare namespace API {
isActive?: boolean;
};
type logisticscontrollerGettrackingnumberParams = {
number?: string;
type logisticscontrollerGetshipmentlabelParams = {
shipmentId: number;
};
type logisticscontrollerUpdateshipmentstateParams = {
shipmentId: number;
};
type logisticscontrollerUpdateshippingaddressParams = {
@ -213,6 +220,7 @@ declare namespace API {
externalOrderId?: string;
status?: any;
orderStatus?: any;
shipmentId?: number;
currency?: string;
currency_symbol?: string;
prices_include_tax?: boolean;
@ -337,12 +345,17 @@ 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;
@ -386,7 +399,6 @@ declare namespace API {
items?: OrderItem[];
sales?: OrderSale[];
refundItems?: OrderRefundItem[];
trackings?: Tracking[];
notes?: OrderNote[];
};
@ -489,7 +501,11 @@ declare namespace API {
/** sku */
sku?: string;
quantity?: number;
isPackage?: boolean;
exceptPackage?: boolean;
isYoone?: boolean;
isZex?: boolean;
size?: number;
isYooneNew?: boolean;
/** 创建时间 */
createdAt?: string;
/** 更新时间 */
@ -506,7 +522,11 @@ declare namespace API {
/** sku */
sku?: string;
quantity?: number;
isPackage?: boolean;
exceptPackage?: boolean;
isYoone?: boolean;
isZex?: boolean;
size?: number;
isYooneNew?: boolean;
/** 创建时间 */
createdAt?: string;
/** 更新时间 */
@ -984,26 +1004,32 @@ declare namespace API {
type ShipmentBookDTO = {
sales?: OrderSale[];
payment_method_id?: string;
service_id?: string;
service_type?: string;
details?: ShippingDetailsDTO;
stockPointId?: number;
orderIds?: number[];
};
type ShipmentItem = {
id?: number;
shipment_id?: string;
productId?: number;
name?: string;
/** sku */
sku?: string;
quantity?: number;
/** 创建时间 */
createdAt: string;
/** 更新时间 */
updatedAt: string;
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 ShippingAddress = {
@ -1032,6 +1058,7 @@ declare namespace API {
};
type ShippingDetailsDTO = {
shipmentFee?: number;
origin?: Location;
destination?: Destination;
expected_ship_date?: Date;
@ -1270,27 +1297,6 @@ 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;
@ -1469,7 +1475,7 @@ declare namespace API {
/** 是否促销中 */
on_sale?: boolean;
/** 产品类型 */
type?: 'simple' | 'variable';
type?: 'simple' | 'variable' | 'woosb';
/** 创建时间 */
createdAt: string;
/** 更新时间 */

View File

@ -37,13 +37,13 @@ export async function usercontrollerListusers(options?: {
/** 此处后端没有提供注释 POST /user/login */
export async function usercontrollerLogin(
body: API.LoginDTO,
body: Record<string, any>,
options?: { [key: string]: any },
) {
return request<API.LoginRes>('/user/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Type': 'text/plain',
},
data: body,
...(options || {}),

3
src/style/order-list.css Normal file
View File

@ -0,0 +1,3 @@
.selected-line-order-protable {
background-color: #add8e6;
}

View File

View File

View File

@ -59,3 +59,47 @@ 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 '未知状态';
}
}

View File

@ -6,6 +6,7 @@ export async function printPDF(urls: string[]) {
function next() {
if (index >= urls.length) return;
printJS({
base64: true,
printable: urls[index],
type: 'pdf',
showModal: true,
@ -22,4 +23,4 @@ export async function printPDF(urls: string[]) {
}
next();
}
}