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

🐞 fix: 修改物流bug

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