Compare commits
No commits in common. "081b87df7bfab1becf1c14ead40e46a66fae2924" and "0356c77bad1681069bd514142eedbf8e9ce799df" have entirely different histories.
081b87df7b
...
0356c77bad
|
|
@ -26,7 +26,6 @@
|
||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
"print-js": "^1.6.0",
|
"print-js": "^1.6.0",
|
||||||
"react-phone-input-2": "^2.15.1",
|
"react-phone-input-2": "^2.15.1",
|
||||||
"react-toastify": "^11.0.5",
|
|
||||||
"xlsx": "^0.18.5"
|
"xlsx": "^0.18.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
||||||
|
|
@ -5,21 +5,19 @@ import { stockcontrollerGetallstockpoints } from '@/servers/api/stock';
|
||||||
import { formatShipmentState } from '@/utils/format';
|
import { formatShipmentState } from '@/utils/format';
|
||||||
import { printPDF } from '@/utils/util';
|
import { printPDF } from '@/utils/util';
|
||||||
import { CopyOutlined } from '@ant-design/icons';
|
import { CopyOutlined } from '@ant-design/icons';
|
||||||
import { ToastContainer, toast } from 'react-toastify';
|
|
||||||
import {
|
import {
|
||||||
ActionType,
|
ActionType,
|
||||||
PageContainer,
|
PageContainer,
|
||||||
ProColumns,
|
ProColumns,
|
||||||
ProTable,
|
ProTable,
|
||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import { App, Button, Divider, Popconfirm } from 'antd';
|
import { App, Button, Divider } from 'antd';
|
||||||
import { useRef, useState } from 'react';
|
import { useRef, useState } from 'react';
|
||||||
|
|
||||||
const ListPage: React.FC = () => {
|
const ListPage: React.FC = () => {
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
const { message } = App.useApp();
|
const { message } = App.useApp();
|
||||||
const [selectedRows, setSelectedRows] = useState([]);
|
const [selectedRows, setSelectedRows] = useState([]);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
|
||||||
|
|
||||||
const columns: ProColumns<API.Service>[] = [
|
const columns: ProColumns<API.Service>[] = [
|
||||||
{
|
{
|
||||||
|
|
@ -40,21 +38,17 @@ const ListPage: React.FC = () => {
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '订单号',
|
|
||||||
dataIndex: 'externalOrderId',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '快递单号',
|
title: '快递单号',
|
||||||
dataIndex: 'return_tracking_number',
|
dataIndex: 'primary_tracking_number',
|
||||||
render(_, record) {
|
render(_, record) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{record.return_tracking_number}
|
{record.unique_id}
|
||||||
<CopyOutlined
|
<CopyOutlined
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
try {
|
try {
|
||||||
await navigator.clipboard.writeText(record.return_tracking_number);
|
await navigator.clipboard.writeText(record.unique_id);
|
||||||
message.success('复制成功!');
|
message.success('复制成功!');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
message.error('复制失败!');
|
message.error('复制失败!');
|
||||||
|
|
@ -88,55 +82,24 @@ const ListPage: React.FC = () => {
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
disabled={isLoading}
|
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
setIsLoading(true);
|
|
||||||
const { data } = await logisticscontrollerGetShipmentLabel(record.id);
|
const { data } = await logisticscontrollerGetShipmentLabel(record.id);
|
||||||
const content = data.content;
|
const content = data.content;
|
||||||
printPDF([content]);
|
printPDF([content]);
|
||||||
setIsLoading(false);
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Label
|
Label
|
||||||
</Button>
|
</Button>
|
||||||
{/* <Divider type="vertical" /> */}
|
<Divider type="vertical" />
|
||||||
{/* <Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
disabled={isLoading}
|
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
setIsLoading(true);
|
|
||||||
const { data } = await logisticscontrollerDeleteShipment(record.id);
|
const { data } = await logisticscontrollerDeleteShipment(record.id);
|
||||||
console.log('data', data);// todo 刷新页面
|
console.log('data', data);// todo 刷新页面
|
||||||
setIsLoading(false);
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</Button> */}
|
|
||||||
<Popconfirm
|
|
||||||
disabled={isLoading}
|
|
||||||
title="删除"
|
|
||||||
description="确认删除?"
|
|
||||||
onConfirm={async () => {
|
|
||||||
try {
|
|
||||||
setIsLoading(true);
|
|
||||||
const { success, message: errMsg } =
|
|
||||||
await logisticscontrollerDeleteShipment(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>
|
|
||||||
Cancel
|
|
||||||
</Button>
|
</Button>
|
||||||
</Popconfirm>
|
|
||||||
<ToastContainer />
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue