forked from yoone/WEB
1
0
Fork 0

Fix: 增加删除运单按钮

This commit is contained in:
黄珑 2025-08-09 19:08:22 +08:00
parent cb596ada87
commit 4d3abcd13f
2 changed files with 40 additions and 12 deletions

View File

@ -1,4 +1,6 @@
import { logisticscontrollerGetlist, logisticscontrollerGetShipmentLabel } from '@/servers/api/logistics'; import { logisticscontrollerGetlist, logisticscontrollerGetShipmentLabel,
logisticscontrollerDeleteShipment
} from '@/servers/api/logistics';
import { stockcontrollerGetallstockpoints } from '@/servers/api/stock'; 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';
@ -9,7 +11,7 @@ import {
ProColumns, ProColumns,
ProTable, ProTable,
} from '@ant-design/pro-components'; } from '@ant-design/pro-components';
import { App, Button } 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 = () => {
@ -77,16 +79,28 @@ const ListPage: React.FC = () => {
hideInSearch: true, hideInSearch: true,
render(_, record) { render(_, record) {
return ( return (
<Button <>
type="primary" <Button
onClick={async () => { type="primary"
const { data } = await logisticscontrollerGetShipmentLabel(record.id); onClick={async () => {
const content = data.content; const { data } = await logisticscontrollerGetShipmentLabel(record.id);
printPDF([content]); const content = data.content;
}} printPDF([content]);
> }}
Label >
</Button> Label
</Button>
<Divider type="vertical" />
<Button
type="primary"
onClick={async () => {
const { data } = await logisticscontrollerDeleteShipment(record.id);
console.log('data', data);// todo 刷新页面
}}
>
Cancel
</Button>
</>
); );
}, },
}, },

View File

@ -48,6 +48,20 @@ export async function logisticscontrollerGetShipmentLabel(
} }
}); });
} }
/** 此处后端没有提供注释 DEL /logistics/deleteShipment/${param0} */
export async function logisticscontrollerDeleteShipment(
shipmentId: number
) {
return request<API.BooleanRes>(`/logistics/deleteShipment/${shipmentId}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
}
});
}
/** 此处后端没有提供注释 POST /logistics/createShippingAddress */ /** 此处后端没有提供注释 POST /logistics/createShippingAddress */
export async function logisticscontrollerCreateshippingaddress( export async function logisticscontrollerCreateshippingaddress(