Commit 52195e37 authored by Gavin Peng's avatar Gavin Peng

feat: 完善送货计划详情

parent e1a97150
/**
* 订单模块 Table Column 组装
* @author: 莫雷
*/
import { HarvestMaterialInput } from "../assets/context";
import { BrandColumn, ClassColumn, ConsigneeNumColumn, DeliveryNumColumn, FlowNoteColumn, FlowOnColumn, FlowOptionsColumn, FlowOptionsTimeColumn, FlowRoleColumn, FlowStatusColumn, MaterialNameColumn, MaterialNoColumn, OrderCreatedAtColumn, OrderNoColumn, OredrNumColumn, UntilColumn } from "./table-column";
import { BrandColumn, ClassColumn, CommodityIdColumn, ConsigneeNumColumn, DeliveredNumColumn, DeliveryNumColumn, FlowNoteColumn, FlowOnColumn, FlowOptionsColumn, FlowOptionsTimeColumn, FlowRoleColumn, FlowStatusColumn, MaterialModelColumn, MaterialNameColumn, MaterialNoColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OredrNumColumn, PlannedDeliveryNumColumn, TradeNameColumn, TransitNumColumn, UntilColumn } from "./table-column";
export const DeliveryNoteAddFromTableColumn = [
MaterialNoColumn,
......@@ -34,14 +38,8 @@ export const OutStatusLogTableColumn = [
export const DeliveryNoticeTableColumn = [
{
title: '商品ID',
render: (txt) => txt
},
{
title: "商品名称",
render: (_, roced) => roced.id
},
CommodityIdColumn,
TradeNameColumn,
ClassColumn,
BrandColumn,
UntilColumn,
......@@ -49,4 +47,41 @@ export const DeliveryNoticeTableColumn = [
OrderCreatedAtColumn,
OredrNumColumn,
DeliveryNumColumn
];
\ No newline at end of file
];
// 计划送货物料表格
export const PlannedDeliveryMaterialTableColumn: any = [
{ dataIndex: 'name1', width: 80, ...MaterialNoColumn, },
{ dataIndex: 'name2', width: 192, ...MaterialNameColumn, },
{ dataIndex: 'name3', width: 128, ...MaterialModelColumn, },
{ dataIndex: 'name4', width: 96, ...ClassColumn, },
{ dataIndex: 'name5', width: 96, ...BrandColumn, },
{ dataIndex: 'name6', width: 64, ...UntilColumn, },
{ dataIndex: 'name7', width: 96, ...OredrNumColumn, },
{ dataIndex: 'name8', width: 96, ...ConsigneeNumColumn, },
{ dataIndex: 'name9', width: 96, ...TransitNumColumn, },
{ dataIndex: 'name10', width: 96, ...DeliveredNumColumn, },
{ dataIndex: 'name11', width: 128, ...PlannedDeliveryNumColumn, },
];
// 计划送货物料子表格
export const PlannedDeliveryMaterialExpandableTableColumn: any = [
{ dataIndex: 'name1', ...OrderNoColumn, },
{ dataIndex: 'name2', ...OrderSummaryColumn, },
{ dataIndex: 'name3', ...OrderCreatedAtColumn, },
{ dataIndex: 'name4', ...OredrNumColumn, },
{ dataIndex: 'name5', ...ConsigneeNumColumn, },
{ dataIndex: 'name6', ...TransitNumColumn, },
{ dataIndex: 'name7', ...DeliveredNumColumn, },
{ dataIndex: 'name8', ...PlannedDeliveryNumColumn, },
];
// // 外部单据流转记录
export const ExternalRoamRecordTableColumn: any = [
{ dataIndex: 'name1', ...FlowOnColumn, },
{ dataIndex: 'name2', ...FlowRoleColumn, },
{ dataIndex: 'name4', ...FlowStatusColumn, },
{ dataIndex: 'name5', ...FlowOptionsColumn, },
{ dataIndex: 'name6', ...FlowOptionsTimeColumn, },
{ dataIndex: 'name7', ...FlowNoteColumn },
]
\ No newline at end of file
import { TableColumnProps } from "antd";
/**
* 订单模块 Table Column 分离 (国际化统一配置)
* @author: 莫雷
*/
export const CommodityIdColumn = {
title: '商品ID',
align: 'center',
}
export const TradeNameColumn = {
title: '商品名称',
align: 'center',
}
export const MaterialNoColumn = {
title: '物料编号',
render: (txt, rcoed) => rcoed.MaterialNo
align: 'center',
}
export const MaterialNameColumn = {
title: '物料名称',
render: (txt, rcoed) => rcoed.MaterialName
align: 'center',
}
export const MaterialModelColumn = {
title: '规格型号',
render: (txt, rcoed) => rcoed.MaterialModel
align: 'center',
}
export const ClassColumn = {
title: '品类',
render: (txt, rcoed) => rcoed.Class
align: 'center',
}
export const BrandColumn = {
title: '品牌',
render: (txt, rcoed) => rcoed.Brand
align: 'center',
}
export const UntilColumn = {
title: '单位',
render: (txt, rcoed) => rcoed.Until
align: 'center',
}
export const OrderNoColumn = {
title: '订单号',
render: (txt, rcoed) => rcoed.OrderNo
align: 'center',
}
export const OrderSummaryColumn = {
title: '订单摘要',
align: 'center',
}
export const OrderCreatedAtColumn = {
title: '下单时间',
align: 'center',
render: (txt, rcoed) => rcoed.OrderCreatedAt
}
export const OredrNumColumn = {
title: '订单数量',
render: (txt, rcoed) => rcoed.OredrNum
align: 'center',
}
export const DeliveryNumColumn = {
title: '送货数量',
render: (txt, rcoed) => rcoed.DeliveryNum
align: 'center',
}
export const ConsigneeNumColumn = {
title: '收货数量',
render: (txt, rcoed) => rcoed.ConsigneeNum
align: 'center',
}
export const TransitNumColumn = {
title: '在途数量',
align: 'center',
render: (txt, rcoed) => txt
}
export const DeliveredNumColumn = {
title: '待送货数量',
align: 'center',
}
export const PlannedDeliveryNumColumn = {
title: '计划送货数量',
align: 'center',
}
export const FlowOnColumn = {
title: '流转顺序号',
render: (_, rcode) => rcode.FlowOnColumn
align: 'center',
}
export const FlowRoleColumn = {
title: '操作角色',
render: (_, rcode) => rcode.FlowRoleColumn
align: 'center',
}
export const FlowStatusColumn = {
title: '状态',
render: (_, rcode) => rcode.FlowStatusColumn
align: 'center',
}
export const FlowOptionsColumn = {
title: '操作',
render: (_, rcode) => rcode.FlowOptionsColumn
align: 'center',
}
export const FlowOptionsTimeColumn = {
title: '操作时间',
render: (_, rcode) => rcode.FlowOptionsTimeColumn
align: 'center',
}
export const FlowNoteColumn = {
title: '备注',
render: (_, rcode) => rcode.FlowNoteColumn
align: 'center',
}
\ No newline at end of file
......@@ -4,32 +4,18 @@
*/
import React, { useEffect, useState } from 'react'
import { history } from 'umi'
import { Card, Descriptions, Steps, Table, Tag } from 'antd'
import { Steps, Table, Tag } from 'antd'
import AnchorPage from '@/components/AnchorPage'
import { AnchorsItem } from "@/components/AnchorPage"
import BaseInfo from '@/components/BaseInfo/BaseInfo'
import { BaseInfo as base_Info, Circulation, ConfirmDeliveryPlan, DeliveryPlanDetails, ExternalRoamRecord, ExternalState, PlanMaterial, PlanningCycle, PlanNumber, PlanSummary, Purchaser, SubmitDeliveryPlan, Supplier, SupplyMember, } from '../../constants'
import { ExternalRoamRecordTableColumn, PlannedDeliveryMaterialExpandableTableColumn, PlannedDeliveryMaterialTableColumn } from '../../constants/page-table-column'
const DeliveryPlanManagementDetails: React.FC = () => {
const [iAnchors, setiAnchors] = useState<AnchorsItem[]>(DeliveryPlanDetails)
const [details, setDetails] = useState<any>({})
const [test, setTest] = useState<any>([])
// 计划送货物料
const columns = [
{ title: '物料编号', dataIndex: 'name1', width: 80, ellipsis: true, align: 'center'},
{ title: '物料名称', dataIndex: 'name2', width: 192, ellipsis: true, align: 'center'},
{ title: '规格型号', dataIndex: 'name3', width: 128, align: 'center' },
{ title: '品类', dataIndex: 'name4', width: 96, align: 'center' },
{ title: '品牌', dataIndex: 'name5', width: 96, align: 'center' },
{ title: '单位', dataIndex: 'name6', width: 64, align: 'center' },
{ title: '订单数量', dataIndex: 'name7', width: 96, align: 'center' },
{ title: '收货数量', dataIndex: 'name8', width: 96, align: 'center' },
{ title: '在途数量', dataIndex: 'name9',width: 96, align: 'center' },
{ title: '待送货数量', dataIndex: 'name10', width: 96, align: 'center' },
{ title: '计划送货数量', dataIndex: 'name11', width: 128, align: 'center' },
...test
]
const data = [
{
id: '1',
......@@ -89,17 +75,6 @@ const DeliveryPlanManagementDetails: React.FC = () => {
},
]
const expandedRowRender = () => {
const columns = [
{ title: '订单号', dataIndex: 'name1', align: 'center' },
{ title: '订单摘要', dataIndex: 'name2', align: 'center' },
{ title: '下单时间', dataIndex: 'name3', align: 'center' },
{ title: '订单数量', dataIndex: 'name4', align: 'center' },
{ title: '收货数量', dataIndex: 'name5', align: 'center' },
{ title: '在途数量', dataIndex: 'name6', align: 'center' },
{ title: '待送货数量', dataIndex: 'name7', align: 'center' },
{ title: '计划送货数量', dataIndex: 'name8', align: 'center' },
...test
]
const data = [
{
id: '1',
......@@ -135,21 +110,17 @@ const DeliveryPlanManagementDetails: React.FC = () => {
'name8': '14,000',
}
]
return <Table rowKey={'id'} columns={columns} dataSource={data} pagination={false} />
return <Table rowKey={'id'} columns={[...PlannedDeliveryMaterialExpandableTableColumn, ...test]} dataSource={data} pagination={false} />
}
useEffect(() => {
setTimeout(() => {
let arr = Array.from(Array(90)).map((item, i) => ({ title: '日期'+i, dataIndex: 'date'+i, width: 64, align: 'center' }))
console.log('执行渲染 :>> ', arr);
setTest(arr)
let arr = Array.from(Array(90)).map((item, i) => ({ title: '日期'+i, dataIndex: 'date'+i, width: '64px', align: 'center' }))
console.log('执行渲染 :>> ', arr);
setTest(PlannedDeliveryMaterialTableColumn.concat(arr))
},0)
}, [])
// 外部单据流转记录
const externalRoamColumns = [
{ title: '物料名称', dataIndex: 'name1', },
]
return (
<AnchorPage
title={details?.name || '没有title'}
......@@ -181,20 +152,20 @@ const DeliveryPlanManagementDetails: React.FC = () => {
</BaseInfo>
<BaseInfo className='mt-1' title={PlanMaterial.name} id={PlanMaterial.key} cols={1}>
<Table
defaultExpandAllRows
// defaultExpandAllRows
rowKey={'id'}
columns={columns}
columns={ [...PlannedDeliveryMaterialTableColumn, ...test]}
expandable={{ expandedRowRender }}
dataSource={data}
tableLayout="fixed"
scroll={{ x: 2022 }}
/>
</BaseInfo>
<BaseInfo className='mt-1' title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
<Table
rowKey={'id'}
columns={externalRoamColumns}
dataSource={[]}
/>
<Table
dataSource={data}
columns={ExternalRoamRecordTableColumn}
/>
</BaseInfo>
</AnchorPage>
)
......
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