Commit f02e18dc authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

🐞 fix: 修改物流bug

parent ad021c91
......@@ -300,7 +300,7 @@
.ant-form-item-label
> label.ant-form-item-required::before {
order: 10;
margin-left: -6px;
// margin-left: -6px;
}
.ant-table-filter-column {
......
import React, { useRef } from 'react';
import { } from 'antd';
import { Table } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import Card from '../../../card';
......@@ -8,17 +8,21 @@ export interface ListLayoutIProps {
/** 锚点 */
anchor?: string,
/** id */
id: string | number,
id?: string | number,
/** 标题 */
title: string,
/** columns */
columns: ColumnType<any>[],
/** 接口 */
fetch?: () => Promise<unknown>,
/** 是否请求 */
done?: boolean,
/** 展示的数据 */
data?: [],
}
const ListLayout: React.FC<ListLayoutIProps> = (props: any) => {
const { anchor, id, title, columns, fetch } = props;
const { anchor, id, title, columns, fetch, done, data } = props;
const currentRef = useRef({});
const fetchTableData = (params: any) => {
......@@ -34,12 +38,22 @@ const ListLayout: React.FC<ListLayoutIProps> = (props: any) => {
id={anchor}
title={title}
>
{!done && (
<StandardTable
currentRef={currentRef}
columns={columns}
tableProps={{ rowKey: 'id' }}
fetchTableData={(params: any) => fetchTableData(params)}
/>
)}
{done && (
<Table
rowKey="id"
columns={columns}
dataSource={data}
pagination={false}
/>
)}
</Card>
)
}
......
......@@ -93,7 +93,21 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
useEffect(() => {
if (isEdit && spam) {
const data: any = JSON.parse(sessionStorage.getItem(spam));
const inquiryListProductRequests: any[] = [];
inquiryListProductRequests.push({
commodityId: id,
productId: data.id,
productName: data.name,
category: data.category,
brand: data.brand.name,
unit: data.unitName,
purchaseCount: 1,
logistics: data.logistics,
memberId: data.memberId,
memberRoleId: data.memberRoleId
})
setInquiryProduct(inquiryListProductRequests)
} else if (isEdit) {
PublicApi.getTransactionInquiryListDetails({ id }).then(res => {
if (res.code !== 1000) {
......@@ -114,7 +128,6 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
children: data.fullAddress,
})
setInquiryProduct(data.inquiryListProductRequests)
console.log(data.inquiryListProductRequests)
form.setFieldsValue({
"inquiryListProductRequests": data.inquiryListProductRequests
})
......
import React, { Fragment, useCallback, useEffect, useState } from 'react';
import { Button, message } from 'antd';
import { Button, message, Typography, Space } from 'antd';
import { history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import PeripheralLayout from '@/pages/transaction/components/detailLayout';
......@@ -83,38 +83,45 @@ const LogisticsBillManageDetail = () => {
const columns: ColumnType<any>[] = [
{
title: '商品ID/名称',
key: 'id',
dataIndex: 'id',
key: 'productId',
dataIndex: 'productId',
render: (text: any, record: any) => (
<Space direction="vertical" size={0}>
<Typography.Text>{text}</Typography.Text>
<Typography.Text>{record.productName}</Typography.Text>
</Space>
)
},
{
title: '品类',
key: 'category',
dataIndex: 'category',
key: 'categoryName',
dataIndex: 'categoryName',
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand',
key: 'brandName',
dataIndex: 'brandName',
},
{
title: '数量/单位',
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'amount',
dataIndex: 'amount',
render: (text: any, record: any) => <Typography.Text>{`${text}/${record.unitName}`}</Typography.Text>
},
{
title: <>箱数<br />合计:{dataSource.totalCarton}</>,
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'carton',
dataIndex: 'carton',
},
{
title: <>重量(KG)<br />合计:{dataSource.totalWeight}</>,
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'weight',
dataIndex: 'weight',
},
{
title: <>体积(M3)<br />合计:{dataSource.totalVolume}</>,
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'volume',
dataIndex: 'volume',
},
]
......@@ -202,11 +209,11 @@ const LogisticsBillManageDetail = () => {
<ProgressLayout />
<BasicLayout effect={basicEffect} />
<ListLayout
id={id}
anchor="logisticsBillLayout"
title="物流单明细"
anchor="logisticsBillLayout"
columns={columns}
fetch={PublicApi.getTransactionEnquiryProductList}
done={true}
data={dataSource.detailList}
/>
<FreightLayout
anchor="freightLayout"
......
import React, { Fragment, useCallback, useEffect, useState } from 'react';
import { Typography, Space } from 'antd'
import { history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import PeripheralLayout from '@/pages/transaction/components/detailLayout';
......@@ -75,38 +76,45 @@ const LogisticsBillSubmitDetail = () => {
const columns: ColumnType<any>[] = [
{
title: '商品ID/名称',
key: 'id',
dataIndex: 'id',
key: 'productId',
dataIndex: 'productId',
render: (text: any, record: any) => (
<Space direction="vertical" size={0}>
<Typography.Text>{text}</Typography.Text>
<Typography.Text>{record.productName}</Typography.Text>
</Space>
)
},
{
title: '品类',
key: 'category',
dataIndex: 'category',
key: 'categoryName',
dataIndex: 'categoryName',
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand',
key: 'brandName',
dataIndex: 'brandName',
},
{
title: '数量/单位',
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'amount',
dataIndex: 'amount',
render: (text: any, record: any) => <Typography.Text>{`${text}/${record.unitName}`}</Typography.Text>
},
{
title: <>箱数<br />合计:{dataSource.totalCarton}</>,
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'carton',
dataIndex: 'carton',
},
{
title: <>重量(KG)<br />合计:{dataSource.totalWeight}</>,
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'weight',
dataIndex: 'weight',
},
{
title: <>体积(M3)<br />合计:{dataSource.totalVolume}</>,
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'volume',
dataIndex: 'volume',
},
]
......@@ -161,11 +169,11 @@ const LogisticsBillSubmitDetail = () => {
<ProgressLayout />
<BasicLayout effect={basicEffect} />
<ListLayout
id={id}
anchor="logisticsBillLayout"
title="物流单明细"
anchor="logisticsBillLayout"
columns={columns}
fetch={PublicApi.getTransactionEnquiryProductList}
done={true}
data={dataSource.detailList}
/>
<FreightLayout anchor="freightLayout" title="运费" effect={freightEffect} />
<RecordLyout />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment