Compare commits
No commits in common. "d609e563ffb6696265e5850aa9d482c5befccbf7" and "7e6de57924aab59d1eb835d20a97b5e7f3db02f8" have entirely different histories.
d609e563ff
...
7e6de57924
|
|
@ -1,4 +1,4 @@
|
||||||
import { logisticscontrollerGetlist, logisticscontrollerGetShipmentLabel } from '@/servers/api/logistics';
|
import { logisticscontrollerGetlist } 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,16 +76,19 @@ 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={async () => {
|
onClick={() => {
|
||||||
const { data } = await logisticscontrollerGetShipmentLabel(record.id);
|
// printPDF([record.labels[record.labels.length - 1].url])
|
||||||
const content = data.content;
|
window.open(
|
||||||
printPDF([content]);
|
record.labels[record.labels.length - 1].url,
|
||||||
|
'_blank',
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Label
|
打印
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -877,7 +877,6 @@ 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="暂无物流信息" />;
|
||||||
}
|
}
|
||||||
|
|
@ -1548,8 +1547,6 @@ 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,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 */
|
/** 此处后端没有提供注释 POST /logistics/createShippingAddress */
|
||||||
export async function logisticscontrollerCreateshippingaddress(
|
export async function logisticscontrollerCreateshippingaddress(
|
||||||
body: API.ShippingAddress,
|
body: API.ShippingAddress,
|
||||||
|
|
|
||||||
|
|
@ -184,10 +184,6 @@ declare namespace API {
|
||||||
isActive?: boolean;
|
isActive?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type logisticscontrollerGetshipmentlabelParams = {
|
|
||||||
shipmentId: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type logisticscontrollerGettrackingnumberParams = {
|
type logisticscontrollerGettrackingnumberParams = {
|
||||||
number?: string;
|
number?: string;
|
||||||
};
|
};
|
||||||
|
|
@ -1431,7 +1427,7 @@ declare namespace API {
|
||||||
/** 是否促销中 */
|
/** 是否促销中 */
|
||||||
on_sale?: boolean;
|
on_sale?: boolean;
|
||||||
/** 产品类型 */
|
/** 产品类型 */
|
||||||
type?: 'simple' | 'variable' | 'woosb';
|
type?: 'simple' | 'variable';
|
||||||
/** 创建时间 */
|
/** 创建时间 */
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
/** 更新时间 */
|
/** 更新时间 */
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ 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