forked from yoone/WEB
1
0
Fork 0

Compare commits

..

No commits in common. "df374c4b3571bf9ae1cd4c55b5ce2a4eb8f63030" and "703e2c87cb34ffe8266745ceff3e723651186a70" have entirely different histories.

6 changed files with 11 additions and 28 deletions

View File

@ -1,4 +1,4 @@
import { logisticscontrollerGetlist, logisticscontrollerGetShipmentLabel } from '@/servers/api/logistics';
import { logisticscontrollerGetlist } from '@/servers/api/logistics';
import { stockcontrollerGetallstockpoints } from '@/servers/api/stock';
import { formatShipmentState } from '@/utils/format';
import { printPDF } from '@/utils/util';
@ -76,16 +76,19 @@ const ListPage: React.FC = () => {
dataIndex: 'operation',
hideInSearch: true,
render(_, record) {
if (!record?.labels?.length) return null;
return (
<Button
type="primary"
onClick={async () => {
const { data } = await logisticscontrollerGetShipmentLabel(record.id);
const content = data.content;
printPDF([content]);
onClick={() => {
// printPDF([record.labels[record.labels.length - 1].url])
window.open(
record.labels[record.labels.length - 1].url,
'_blank',
);
}}
>
Label
</Button>
);
},

View File

@ -877,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="暂无物流信息" />;
}
@ -1548,8 +1547,6 @@ const Shipping: React.FC<{
if (packaging_type === 'package') {
return (
<ProFormList
min={1}
max={1}
label="纸箱尺寸"
name={['details', 'packaging_properties', 'packages']}
rules={[

View File

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

View File

@ -184,10 +184,6 @@ declare namespace API {
isActive?: boolean;
};
type logisticscontrollerGetshipmentlabelParams = {
shipmentId: string;
};
type logisticscontrollerGettrackingnumberParams = {
number?: string;
};
@ -1431,7 +1427,7 @@ declare namespace API {
/** 是否促销中 */
on_sale?: boolean;
/** 产品类型 */
type?: 'simple' | 'variable' | 'woosb';
type?: 'simple' | 'variable';
/** 创建时间 */
createdAt: string;
/** 更新时间 */

View File

@ -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,
@ -23,4 +22,4 @@ export async function printPDF(urls: string[]) {
}
next();
}
}