Compare commits
2 Commits
703e2c87cb
...
df374c4b35
| Author | SHA1 | Date |
|---|---|---|
|
|
df374c4b35 | |
|
|
7e6de57924 |
|
|
@ -1,4 +1,4 @@
|
||||||
import { logisticscontrollerGetlist } from '@/servers/api/logistics';
|
import { logisticscontrollerGetlist, logisticscontrollerGetShipmentLabel } 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';
|
||||||
|
|
@ -76,19 +76,16 @@ const ListPage: React.FC = () => {
|
||||||
dataIndex: 'operation',
|
dataIndex: 'operation',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
render(_, record) {
|
render(_, record) {
|
||||||
if (!record?.labels?.length) return null;
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
onClick={() => {
|
onClick={async () => {
|
||||||
// printPDF([record.labels[record.labels.length - 1].url])
|
const { data } = await logisticscontrollerGetShipmentLabel(record.id);
|
||||||
window.open(
|
const content = data.content;
|
||||||
record.labels[record.labels.length - 1].url,
|
printPDF([content]);
|
||||||
'_blank',
|
|
||||||
);
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
打印
|
Label
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -877,6 +877,7 @@ const Detail: React.FC<{
|
||||||
label="物流信息"
|
label="物流信息"
|
||||||
span={3}
|
span={3}
|
||||||
render={(_, record) => {
|
render={(_, record) => {
|
||||||
|
console.log('record', record);
|
||||||
if (!record.shipment || record.shipment.length === 0) {
|
if (!record.shipment || record.shipment.length === 0) {
|
||||||
return <Empty description="暂无物流信息" />;
|
return <Empty description="暂无物流信息" />;
|
||||||
}
|
}
|
||||||
|
|
@ -1547,6 +1548,8 @@ const Shipping: React.FC<{
|
||||||
if (packaging_type === 'package') {
|
if (packaging_type === 'package') {
|
||||||
return (
|
return (
|
||||||
<ProFormList
|
<ProFormList
|
||||||
|
min={1}
|
||||||
|
max={1}
|
||||||
label="纸箱尺寸"
|
label="纸箱尺寸"
|
||||||
name={['details', 'packaging_properties', 'packages']}
|
name={['details', 'packaging_properties', 'packages']}
|
||||||
rules={[
|
rules={[
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,18 @@ 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 */
|
/** 此处后端没有提供注释 POST /logistics/createShippingAddress */
|
||||||
export async function logisticscontrollerCreateshippingaddress(
|
export async function logisticscontrollerCreateshippingaddress(
|
||||||
body: API.ShippingAddress,
|
body: API.ShippingAddress,
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,10 @@ declare namespace API {
|
||||||
isActive?: boolean;
|
isActive?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type logisticscontrollerGetshipmentlabelParams = {
|
||||||
|
shipmentId: string;
|
||||||
|
};
|
||||||
|
|
||||||
type logisticscontrollerGettrackingnumberParams = {
|
type logisticscontrollerGettrackingnumberParams = {
|
||||||
number?: string;
|
number?: string;
|
||||||
};
|
};
|
||||||
|
|
@ -1427,7 +1431,7 @@ declare namespace API {
|
||||||
/** 是否促销中 */
|
/** 是否促销中 */
|
||||||
on_sale?: boolean;
|
on_sale?: boolean;
|
||||||
/** 产品类型 */
|
/** 产品类型 */
|
||||||
type?: 'simple' | 'variable';
|
type?: 'simple' | 'variable' | 'woosb';
|
||||||
/** 创建时间 */
|
/** 创建时间 */
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
/** 更新时间 */
|
/** 更新时间 */
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ export async function printPDF(urls: string[]) {
|
||||||
function next() {
|
function next() {
|
||||||
if (index >= urls.length) return;
|
if (index >= urls.length) return;
|
||||||
printJS({
|
printJS({
|
||||||
|
base64: true,
|
||||||
printable: urls[index],
|
printable: urls[index],
|
||||||
type: 'pdf',
|
type: 'pdf',
|
||||||
showModal: true,
|
showModal: true,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue