Commit 6fb1665c authored by Gavin Peng's avatar Gavin Peng

fix: 修复禅道bug

parent 7490be07
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
*/ */
import { Button } from "antd"; import { Button } from "antd";
import { HarvestMaterialDelete, HarvestMaterialInput } from "../assets/context"; import { HarvestMaterialDelete, HarvestMaterialInput } from "../assets/context";
import { BrandColumn, ClassColumn, CommodityIdColumn, ConsigneeNumColumn, DeliveredNumColumn, DeliveryNumColumn, FlowNoteColumn, FlowOnColumn, FlowOptionsColumn, FlowOptionsTimeColumn, FlowRoleColumn, FlowStatusColumn, MaterialModelColumn, MaterialNameColumn, MaterialNoColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OrderNumColumn, PlannedDeliveryNumColumn, TradeNameColumn, TransitNumColumn, UntilColumn } from "./table-column"; import { BrandColumn, ClassColumn, CommodityIdColumn, ConsigneeNumColumn, DeliveredNumColumn, DeliveryNumColumn, FlowNoteColumn, FlowOnColumn, FlowOptionsColumn, FlowOptionsTimeColumn, FlowRoleColumn, FlowStatusColumn, MaterialModelColumn, MaterialNameColumn, MaterialNoColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OrderNumColumn, PlannedDeliveryNumColumn, TradeNameColumn, TransitNumColumn, UntilColumn, CommodityNoColumn } from "./table-column";
export const DeliveryNoteAddFromTableColumn: any = [ export const DeliveryNoteAddFromTableColumn: any = [
MaterialNoColumn, MaterialNoColumn,
...@@ -125,3 +125,43 @@ export const DeliveryGoodsTableColumn: any = [ ...@@ -125,3 +125,43 @@ export const DeliveryGoodsTableColumn: any = [
{ ...OrderNumColumn, dataIndex: 'purchaseCount' }, { ...OrderNumColumn, dataIndex: 'purchaseCount' },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCount' }, { ...PlannedDeliveryNumColumn, dataIndex: 'planCount' },
] ]
// 送货计划管理,协同 B2B通用 column
export const columnB2B = [
{ ...CommodityNoColumn, dataIndex: 'skuId', width: 80, ellipsis: true, },
{ ...TradeNameColumn, dataIndex: 'productName', width: 192, ellipsis: true, },
{ ...ClassColumn, dataIndex: 'category', width: 96, ellipsis: true, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, ellipsis: true, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, ellipsis: true, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, ellipsis: true, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, ellipsis: true, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, ellipsis: true, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, ellipsis: true, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, ellipsis: true, },
]
// 送货计划管理,协同 SRM通用 column
export const columnSRM = [
{ ...MaterialNoColumn, dataIndex: 'skuId', width: 80, ellipsis: true, },
{ ...MaterialNameColumn, dataIndex: 'productName', width: 192, ellipsis: true, },
{ ...MaterialModelColumn, dataIndex: 'spec', width: 128, ellipsis: true, },
{ ...ClassColumn, dataIndex: 'category', width: 96, ellipsis: true, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, ellipsis: true, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, ellipsis: true, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, ellipsis: true, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, ellipsis: true, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, ellipsis: true, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, ellipsis: true, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, ellipsis: true, },
]
// 送货计划管理,协同 SRM,B2B 嵌套表格通用 column - 不带地址
export const initExpandIconColumn = [
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 80, ellipsis: true, },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 90, ellipsis: true, },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 120, ellipsis: true, },
{ ...OrderNumColumn, dataIndex: 'purchaseCount', width: 96, ellipsis: true, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 96, ellipsis: true, },
{ ...TransitNumColumn, dataIndex: 'transitCount', width: 96, ellipsis: true, },
{ ...DeliveredNumColumn, dataIndex: 'leftCount', width: 96, ellipsis: true, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCount', width: 128, ellipsis: true, },
]
...@@ -52,7 +52,7 @@ export const deliveryPlanCollaborationQuerySchema: ISchema = { ...@@ -52,7 +52,7 @@ export const deliveryPlanCollaborationQuerySchema: ISchema = {
type: 'string', type: 'string',
'x-component-props': { 'x-component-props': {
allowClear: true, allowClear: true,
placeholder: '供应会员' placeholder: '采购会员'
} }
}, },
submit: { submit: {
......
...@@ -8,14 +8,14 @@ import AnchorPage, { AnchorsItem } from '@/components/AnchorPage' ...@@ -8,14 +8,14 @@ import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import { history } from 'umi' import { history } from 'umi'
import { Circulation, ConfirmDeliveryPlan, Purchaser, SubmitDeliveryPlan, BaseInfo as base_Info, Supplier, PlanningCycle, SupplyMembersLabel, PlanSummary, Remarks, PlannedDelivery, DeliveryPlanText, DeliveryPlanRemark, CreateDeliveryPlanTitleB2B } from '../../constants' import { Circulation, ConfirmDeliveryPlan, Purchaser, SubmitDeliveryPlan, BaseInfo as base_Info, Supplier, PlanningCycle, SupplyMembersLabel, PlanSummary, Remarks, PlannedDelivery, DeliveryPlanText, DeliveryPlanRemark, CreateDeliveryPlanTitleB2B } from '../../constants'
import { Button, DatePicker, Form, Input, InputNumber, message, Space, Spin, Steps, Table } from 'antd' import { Button, DatePicker, Form, Input, InputNumber, message, Space, Spin, Steps, Table } from 'antd'
import { SaveOutlined } from '@ant-design/icons' import { CaretDownOutlined, CaretRightOutlined, SaveOutlined } from '@ant-design/icons'
import BaseInfo from '@/components/BaseInfo/BaseInfo' import BaseInfo from '@/components/BaseInfo/BaseInfo'
import _ from 'lodash' import _ from 'lodash'
import { afterToday, convertArrToObj, disabledDate, getDayAll, limitDecimalsF, limitDecimalsP } from '../../utils' import { afterToday, convertArrToObj, disabledDate, getDayAll, limitDecimalsF, limitDecimalsP } from '../../utils'
import { BrandColumn, ClassColumn, CommodityNoColumn, ConsigneeNumColumn, DeliveredNumColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OrderNumColumn, PlannedDeliveryNumColumn, TradeNameColumn, TransitNumColumn, UntilColumn } from '../../constants/table-column'
import { RoleSelect } from '@/components/RoleSelect' import { RoleSelect } from '@/components/RoleSelect'
import { getMemberManageSupplyMember } from '@/services/MemberV2Api' import { getMemberManageSupplyMember } from '@/services/MemberV2Api'
import { getOrderDeliveryPlanOrderProductPage, postOrderDeliveryPlanB2bCreate } from '@/services/OrderNewV2Api' import { getOrderDeliveryPlanOrderProductPage, postOrderDeliveryPlanB2bCreate } from '@/services/OrderNewV2Api'
import { columnB2B, initExpandIconColumn } from '../../constants/page-table-column'
const formItemLayout = { const formItemLayout = {
labelCol: { span: 3 }, labelCol: { span: 3 },
...@@ -27,28 +27,6 @@ const ROLE_TYPE = '1' ...@@ -27,28 +27,6 @@ const ROLE_TYPE = '1'
// 1:b2b,2:srm // 1:b2b,2:srm
const ORDER_TYPE = '1' const ORDER_TYPE = '1'
const initGoodsTableColumn = [
{ ...CommodityNoColumn, dataIndex: 'skuId', width: 80, },
{ ...TradeNameColumn, dataIndex: 'productName', width: 192, },
{ ...ClassColumn, dataIndex: 'category', width: 96, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, },
]
const initExpandIconColumn = [
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 80, },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 150, },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 120, },
{ ...OrderNumColumn, dataIndex: 'purchaseCount', width: 86, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 86, },
{ ...TransitNumColumn, dataIndex: 'transitCount', width: 86, },
{ ...DeliveredNumColumn, dataIndex: 'leftCount', width: 86, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCount', width: 96, },
]
const DeliveryPlanAwaitB2BCreate: React.FC = () => { const DeliveryPlanAwaitB2BCreate: React.FC = () => {
const [form] = Form.useForm() const [form] = Form.useForm()
const datesRef = useRef<any>(null) const datesRef = useRef<any>(null)
...@@ -58,19 +36,21 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => { ...@@ -58,19 +36,21 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
// 锚点标题 // 锚点标题
const [iAnchors, setIAnchors] = useState<AnchorsItem[]>([ const [iAnchors, setIAnchors] = useState<AnchorsItem[]>([
Circulation, // Circulation,
base_Info, base_Info,
PlannedDelivery, PlannedDelivery,
Remarks, Remarks,
]) ])
// 动态 TableColumn // 动态 TableColumn
const [goodsTableColumn, setGoodsTableColumn] = useState<any>(initGoodsTableColumn) const [goodsTableColumn, setGoodsTableColumn] = useState<any>(columnB2B)
// 动态 expandIconColumn // 动态 expandIconColumn
const [expandIconColumn, setExpandIconColumn] = useState<any>(initExpandIconColumn) const [expandIconColumn, setExpandIconColumn] = useState<any>(initExpandIconColumn)
const expandedRowRender = (record, index) => { const expandedRowRender = (record, index) => {
return <Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" /> return <div>
<Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" />
</div>
} }
// 选中 开始时间,结束时间 // 选中 开始时间,结束时间
...@@ -127,7 +107,7 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => { ...@@ -127,7 +107,7 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
const inputChange = (val: any, text: any, record: any) => { const inputChange = (val: any, text: any, record: any) => {
let { day } = text let { day } = text
let dataArr = JSON.parse(JSON.stringify(goodsTableDataRef.current)) let dataArr = JSON.parse(JSON.stringify(goodsTableDataRef.current))
let index = dataArr.findIndex(f => f.skuId === record.skuId) let index = dataArr.findIndex(f => f.planProductId === record.planProductId)
let childIndex = dataArr[index].orders.findIndex(f => f.orderProductId === record.orderProductId) let childIndex = dataArr[index].orders.findIndex(f => f.orderProductId === record.orderProductId)
dataArr[index].orders[childIndex][`$${day}`].planCount = val dataArr[index].orders[childIndex][`$${day}`].planCount = val
goodsTableDataRef.current = dataArr goodsTableDataRef.current = dataArr
...@@ -161,7 +141,7 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => { ...@@ -161,7 +141,7 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
/> />
) )
})) }))
setGoodsTableColumn([...initGoodsTableColumn, ...datesColumn]) setGoodsTableColumn([...columnB2B, ...datesColumn])
setExpandIconColumn([...initExpandIconColumn, ...datesExpandIconColumn]) setExpandIconColumn([...initExpandIconColumn, ...datesExpandIconColumn])
} else { } else {
// 清空 // 清空
...@@ -169,7 +149,7 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => { ...@@ -169,7 +149,7 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
goodsTableDataRef.current = null goodsTableDataRef.current = null
setSelectedDate([]) setSelectedDate([])
setGoodsTableData([]) setGoodsTableData([])
setGoodsTableColumn(initGoodsTableColumn) setGoodsTableColumn(columnB2B)
setExpandIconColumn(initExpandIconColumn) setExpandIconColumn(initExpandIconColumn)
} }
} }
...@@ -189,7 +169,7 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => { ...@@ -189,7 +169,7 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
roleType: ROLE_TYPE, roleType: ROLE_TYPE,
orderType: ORDER_TYPE, orderType: ORDER_TYPE,
current: '1', current: '1',
pageSize: '100' pageSize: '999'
}).then((res) => { }).then((res) => {
if (res.code === 1000) { if (res.code === 1000) {
const assemble = res.data.data.map((item => { const assemble = res.data.data.map((item => {
...@@ -234,13 +214,13 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => { ...@@ -234,13 +214,13 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
labelAlign='left' labelAlign='left'
form={form} form={form}
> >
<BaseInfo className='mt-0' title={Circulation.name} id={Circulation.key} cols={1}> {/* <BaseInfo className='mt-0' title={Circulation.name} id={Circulation.key} cols={1}>
<Steps progressDot current={0}> <Steps progressDot current={0}>
<Steps.Step title={Purchaser} description={SubmitDeliveryPlan} /> <Steps.Step title={Purchaser} description={SubmitDeliveryPlan} />
<Steps.Step title={Supplier} description={ConfirmDeliveryPlan} /> <Steps.Step title={Supplier} description={ConfirmDeliveryPlan} />
</Steps> </Steps>
</BaseInfo> </BaseInfo> */}
<BaseInfo className='mt-16' title={base_Info.name} id={base_Info.key}> <BaseInfo className='mt-0' title={base_Info.name} id={base_Info.key}>
<Form.Item <Form.Item
{...formItemLayout} {...formItemLayout}
label={PlanningCycle} label={PlanningCycle}
...@@ -280,19 +260,27 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => { ...@@ -280,19 +260,27 @@ const DeliveryPlanAwaitB2BCreate: React.FC = () => {
<BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}> <BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}>
<Table <Table
// defaultExpandAllRows // defaultExpandAllRows
rowKey={'skuId'} rowKey={'planProductId'}
columns={goodsTableColumn} columns={goodsTableColumn}
expandedRowRender={expandedRowRender} expandable={{
expandIcon: ({ expanded, onExpand, record }) =>
expanded ? (
<CaretDownOutlined onClick={e => onExpand(record, e)} />
) : (
<CaretRightOutlined onClick={e => onExpand(record, e)} />
),
expandedRowRender
}}
dataSource={goodsTableData} dataSource={goodsTableData}
tableLayout="fixed" tableLayout="fixed"
scroll={{ x: '100%' }} scroll={{ x: '100%' }}
/> />
</BaseInfo> </BaseInfo>
<BaseInfo className='mt-16' title={<>{Remarks.name} <span style={{ color: 'red' }}>*</span></>} id={Remarks.key} cols={1}> <BaseInfo className='mt-16' title={Remarks.name} id={Remarks.key} cols={1}>
<Form.Item <Form.Item
name='remark' name='remark'
rules={[ rules={[
{ required: true, message: '请输入' } { required: false, message: '请输入' }
]} ]}
> >
<Input.TextArea rows={4} maxLength={300} placeholder={DeliveryPlanRemark} /> <Input.TextArea rows={4} maxLength={300} placeholder={DeliveryPlanRemark} />
......
...@@ -9,13 +9,13 @@ import { history } from 'umi' ...@@ -9,13 +9,13 @@ import { history } from 'umi'
import { Circulation, ConfirmDeliveryPlan, Purchaser, SubmitDeliveryPlan, BaseInfo as base_Info, Supplier, PlanningCycle, SupplyMembersLabel, PlanSummary, ExternalState, Remarks, ExternalRoamRecord, PlannedDelivery, PlanNumber } from '../../constants' import { Circulation, ConfirmDeliveryPlan, Purchaser, SubmitDeliveryPlan, BaseInfo as base_Info, Supplier, PlanningCycle, SupplyMembersLabel, PlanSummary, ExternalState, Remarks, ExternalRoamRecord, PlannedDelivery, PlanNumber } from '../../constants'
import { Steps, Table, Tag } from 'antd' import { Steps, Table, Tag } from 'antd'
import BaseInfo from '@/components/BaseInfo/BaseInfo' import BaseInfo from '@/components/BaseInfo/BaseInfo'
import { ExternalRoamRecordTableColumn } from '../../constants/page-table-column' import { columnB2B, ExternalRoamRecordTableColumn, initExpandIconColumn } from '../../constants/page-table-column'
import _ from 'lodash' import _ from 'lodash'
import { getDayAll, godAtob, integrationArrToObj, integrationOjb, TagStatus } from '../../utils' import { getDayAll, godAtob, integrationArrToObj, integrationOjb, TagStatus } from '../../utils'
import { BrandColumn, ClassColumn, CommodityNoColumn, ConsigneeNumColumn, DeliveredNumColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OrderNumColumn, PlannedDeliveryNumColumn, TradeNameColumn, TransitNumColumn, UntilColumn } from '../../constants/table-column'
import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage } from '@/services/OrderNewV2Api' import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage } from '@/services/OrderNewV2Api'
import moment from 'moment' import moment from 'moment'
import CustomizedTableItem from '../../components/CustomizedTableItem' import CustomizedTableItem from '../../components/CustomizedTableItem'
import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons'
const tagStatus = new TagStatus() const tagStatus = new TagStatus()
const statusTxt = new Map([[1, '待提交'], [2, '待确认'], [3, '待修订'], [4, '已确认'], [5, '已删除']]) const statusTxt = new Map([[1, '待提交'], [2, '待确认'], [3, '待修订'], [4, '已确认'], [5, '已删除']])
...@@ -35,32 +35,14 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => { ...@@ -35,32 +35,14 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
]) ])
// 动态 TableColumn // 动态 TableColumn
const [goodsTableColumn, setGoodsTableColumn] = useState<any>([ const [goodsTableColumn, setGoodsTableColumn] = useState<any>(columnB2B)
{ ...CommodityNoColumn, dataIndex: 'skuId', width: 80, },
{ ...TradeNameColumn, dataIndex: 'productName', width: 192, },
{ ...ClassColumn, dataIndex: 'category', width: 96, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, },
])
// 动态 expandIconColumn // 动态 expandIconColumn
const [expandIconColumn, setExpandIconColumn] = useState<any>([ const [expandIconColumn, setExpandIconColumn] = useState<any>(initExpandIconColumn)
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 80, },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 200, },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 160, },
{ ...OrderNumColumn, dataIndex: 'purchaseCount', width: 96, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 96, },
{ ...TransitNumColumn, dataIndex: 'transitCount', width: 96, },
{ ...DeliveredNumColumn, dataIndex: 'leftCount', width: 96, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCount', width: 128, },
])
const expandedRowRender = (record, index) => { const expandedRowRender = (record, index) => {
return <Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" /> return <div>
<Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" />
</div>
} }
// 详情 // 详情
...@@ -91,7 +73,7 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => { ...@@ -91,7 +73,7 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
getOrderDeliveryPlanDetailProductPage({ getOrderDeliveryPlanDetailProductPage({
id, id,
current: '1', current: '1',
pageSize: '10' pageSize: '999'
}).then((res) => { }).then((res) => {
if (res.code === 1000) { if (res.code === 1000) {
const assemble = res.data.data.map(item => { const assemble = res.data.data.map(item => {
...@@ -136,7 +118,7 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => { ...@@ -136,7 +118,7 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
return (<> return (<>
<AnchorPage <AnchorPage
title={details?.planNo} title={`${details?.digest}|${details?.planNo}`}
onBack={() => history.goBack()} onBack={() => history.goBack()}
anchors={iAnchors} anchors={iAnchors}
> >
...@@ -164,12 +146,20 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => { ...@@ -164,12 +146,20 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
<BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}> <BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}>
<Table <Table
// defaultExpandAllRows // defaultExpandAllRows
rowKey={'skuId'} rowKey={'planProductId'}
columns={goodsTableColumn} columns={goodsTableColumn}
expandedRowRender={expandedRowRender} expandable={{
expandIcon: ({ expanded, onExpand, record }) =>
expanded ? (
<CaretDownOutlined onClick={e => onExpand(record, e)} />
) : (
<CaretRightOutlined onClick={e => onExpand(record, e)} />
),
expandedRowRender
}}
dataSource={goodsTableData} dataSource={goodsTableData}
tableLayout="fixed" tableLayout="fixed"
scroll={{ x: 2022 }} scroll={{ x: '100%' }}
/> />
</BaseInfo> </BaseInfo>
<BaseInfo className='mt-16' title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}> <BaseInfo className='mt-16' title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
......
...@@ -80,7 +80,7 @@ const DeliveryPlanManagementAwaitB2B: React.FC = () => { ...@@ -80,7 +80,7 @@ const DeliveryPlanManagementAwaitB2B: React.FC = () => {
} }
const buttonGroup = { const buttonGroup = {
'提交': record.status <= 1, '提交': record.status <= 1,
'修改': record.status >= 1, '修改':record.status === 1 || record.status === 3,
'删除': record.status <= 1, '删除': record.status <= 1,
'查看': true, '查看': true,
} }
......
...@@ -48,6 +48,12 @@ export const deliveryPlanManagementAwaitB2BSchema: ISchema = { ...@@ -48,6 +48,12 @@ export const deliveryPlanManagementAwaitB2BSchema: ISchema = {
}, },
}, },
properties: { properties: {
digest: {
type: 'string',
'x-component-props': {
placeholder: '计划摘要',
}
},
'[startTime, endTime]': { '[startTime, endTime]': {
type: 'daterange', type: 'daterange',
'x-component-props': { 'x-component-props': {
......
...@@ -8,14 +8,13 @@ import AnchorPage, { AnchorsItem } from '@/components/AnchorPage' ...@@ -8,14 +8,13 @@ import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import { history } from 'umi' import { history } from 'umi'
import { Circulation, ConfirmDeliveryPlan, Purchaser, SubmitDeliveryPlan, BaseInfo as base_Info, Supplier, PlanningCycle, SupplyMembersLabel, PlanSummary, Remarks, PlannedDelivery, DeliveryPlanRemark, ExternalRoamRecord, ExternalState } from '../../constants' import { Circulation, ConfirmDeliveryPlan, Purchaser, SubmitDeliveryPlan, BaseInfo as base_Info, Supplier, PlanningCycle, SupplyMembersLabel, PlanSummary, Remarks, PlannedDelivery, DeliveryPlanRemark, ExternalRoamRecord, ExternalState } from '../../constants'
import { Button, Form, Input, InputNumber, message, Space, Spin, Steps, Table, Tag } from 'antd' import { Button, Form, Input, InputNumber, message, Space, Spin, Steps, Table, Tag } from 'antd'
import { SaveOutlined } from '@ant-design/icons' import { CaretDownOutlined, CaretRightOutlined, SaveOutlined } from '@ant-design/icons'
import BaseInfo from '@/components/BaseInfo/BaseInfo' import BaseInfo from '@/components/BaseInfo/BaseInfo'
import _ from 'lodash' import _ from 'lodash'
import { afterToday, getDayAll, godAtob, integrationArrToObj, integrationOjb, limitDecimalsF, limitDecimalsP, TagStatus } from '../../utils' import { afterToday, getDayAll, godAtob, integrationArrToObj, integrationOjb, limitDecimalsF, limitDecimalsP, TagStatus } from '../../utils'
import { BrandColumn, ClassColumn, CommodityNoColumn, ConsigneeNumColumn, DeliveredNumColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OrderNumColumn, PlannedDeliveryNumColumn, TradeNameColumn, TransitNumColumn, UntilColumn } from '../../constants/table-column'
import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage, postOrderDeliveryPlanUpdate } from '@/services/OrderNewV2Api' import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage, postOrderDeliveryPlanUpdate } from '@/services/OrderNewV2Api'
import moment from 'moment' import moment from 'moment'
import { ExternalRoamRecordTableColumn } from '../../constants/page-table-column' import { columnB2B, ExternalRoamRecordTableColumn, initExpandIconColumn } from '../../constants/page-table-column'
const formItemLayout = { const formItemLayout = {
labelCol: { span: 6 }, labelCol: { span: 6 },
...@@ -44,29 +43,9 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => { ...@@ -44,29 +43,9 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => {
]) ])
// 动态 TableColumn // 动态 TableColumn
const [goodsTableColumn, setGoodsTableColumn] = useState<any>([ const [goodsTableColumn, setGoodsTableColumn] = useState<any>(columnB2B)
{ ...CommodityNoColumn, dataIndex: 'skuId', width: 80, },
{ ...TradeNameColumn, dataIndex: 'productName', width: 192, },
{ ...ClassColumn, dataIndex: 'category', width: 96, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, },
])
// 动态 expandIconColumn // 动态 expandIconColumn
const [expandIconColumn, setExpandIconColumn] = useState<any>([ const [expandIconColumn, setExpandIconColumn] = useState<any>(initExpandIconColumn)
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 80, },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 150, },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 120, },
{ ...OrderNumColumn, dataIndex: 'purchaseCount', width: 86, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 86, },
{ ...TransitNumColumn, dataIndex: 'transitCount', width: 86, },
{ ...DeliveredNumColumn, dataIndex: 'leftCount', width: 86, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCount', width: 96, },
])
const expandedRowRender = (record, index) => { const expandedRowRender = (record, index) => {
return <Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" /> return <Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" />
...@@ -82,7 +61,6 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => { ...@@ -82,7 +61,6 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => {
// 保存 // 保存
const save = () => { const save = () => {
form.validateFields().then(values => { form.validateFields().then(values => {
console.log('values :>> ', values)
if (_.isEmpty(goodsTableDataRef.current)) { if (_.isEmpty(goodsTableDataRef.current)) {
message.warning('没有找到可执行计划送货') message.warning('没有找到可执行计划送货')
return return
...@@ -112,7 +90,7 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => { ...@@ -112,7 +90,7 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => {
const inputChange = (val: any, text: any, record: any) => { const inputChange = (val: any, text: any, record: any) => {
let { day } = text let { day } = text
let dataArr = JSON.parse(JSON.stringify(goodsTableDataRef.current)) let dataArr = JSON.parse(JSON.stringify(goodsTableDataRef.current))
let index = dataArr.findIndex(f => f.skuId === record.skuId) let index = dataArr.findIndex(f => f.planProductId === record.planProductId)
let childIndex = dataArr[index].orders.findIndex(f => f.orderProductId === record.orderProductId) let childIndex = dataArr[index].orders.findIndex(f => f.orderProductId === record.orderProductId)
dataArr[index].orders[childIndex][`$${day}`].planCount = val dataArr[index].orders[childIndex][`$${day}`].planCount = val
goodsTableDataRef.current = dataArr goodsTableDataRef.current = dataArr
...@@ -151,7 +129,7 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => { ...@@ -151,7 +129,7 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => {
getOrderDeliveryPlanDetailProductPage({ getOrderDeliveryPlanDetailProductPage({
id, id,
current: '1', current: '1',
pageSize: '10' pageSize: '999'
}).then((res) => { }).then((res) => {
if (res.code === 1000) { if (res.code === 1000) {
const assemble = res.data.data.map(item => { const assemble = res.data.data.map(item => {
...@@ -246,9 +224,17 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => { ...@@ -246,9 +224,17 @@ const DeliveryPlanAwaitB2BUpdate: React.FC = () => {
<BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}> <BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}>
<Table <Table
// defaultExpandAllRows // defaultExpandAllRows
rowKey={'skuId'} rowKey={'planProductId'}
columns={goodsTableColumn} columns={goodsTableColumn}
expandedRowRender={expandedRowRender} expandable={{
expandIcon: ({ expanded, onExpand, record }) =>
expanded ? (
<CaretDownOutlined onClick={e => onExpand(record, e)} />
) : (
<CaretRightOutlined onClick={e => onExpand(record, e)} />
),
expandedRowRender
}}
dataSource={goodsTableData} dataSource={goodsTableData}
tableLayout="fixed" tableLayout="fixed"
scroll={{ x: 2022 }} scroll={{ x: 2022 }}
......
...@@ -6,16 +6,16 @@ ...@@ -6,16 +6,16 @@
import React, { useEffect, useRef, useState } from 'react' import React, { useEffect, useRef, useState } from 'react'
import { history } from 'umi' import { history } from 'umi'
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage' import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import { BaseInfo as base_Info, Remarks, PlanningCycle, SupplyMembersLabel, PlanSummary, ExternalState, ExternalDeliveryPlanCirculation, Purchaser, SubmitDeliveryPlan, Supplier, ConfirmDeliveryPlan, PlanMaterial, DeliveryPlanText, DeliveryPlanRemark, CreateDeliveryPlanTitleSRM } from '../../constants' import { BaseInfo as base_Info, Remarks, PlanningCycle, SupplyMembersLabel, PlanSummary, Purchaser, SubmitDeliveryPlan, Supplier, ConfirmDeliveryPlan, PlanMaterial, DeliveryPlanText, DeliveryPlanRemark, CreateDeliveryPlanTitleSRM, Circulation } from '../../constants'
import { Button, DatePicker, Form, Input, InputNumber, message, Space, Spin, Steps, Table } from 'antd' import { Button, DatePicker, Form, Input, InputNumber, message, Space, Spin, Steps, Table } from 'antd'
import { SaveOutlined } from '@ant-design/icons' import { CaretDownOutlined, CaretRightOutlined, SaveOutlined } from '@ant-design/icons'
import BaseInfo from '@/components/BaseInfo/BaseInfo' import BaseInfo from '@/components/BaseInfo/BaseInfo'
import _ from 'lodash' import _ from 'lodash'
import { afterToday, convertArrToObj, disabledDate, getDayAll, limitDecimalsF, limitDecimalsP } from '../../utils' import { afterToday, convertArrToObj, disabledDate, getDayAll, limitDecimalsF, limitDecimalsP } from '../../utils'
import { BrandColumn, ClassColumn, ConsigneeNumColumn, DeliveredNumColumn, MaterialModelColumn, MaterialNameColumn, MaterialNoColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OrderNumColumn, PlannedDeliveryNumColumn, TransitNumColumn, UntilColumn } from '../../constants/table-column'
import { RoleSelect } from '@/components/RoleSelect' import { RoleSelect } from '@/components/RoleSelect'
import { getOrderDeliveryPlanOrderProductPage, postOrderDeliveryPlanSrmCreate } from '@/services/OrderNewV2Api' import { getOrderDeliveryPlanOrderProductPage, postOrderDeliveryPlanSrmCreate } from '@/services/OrderNewV2Api'
import { getMemberManageLowerMerchantProviderPage } from '@/services/MemberV2Api' import { getMemberManageLowerMerchantProviderPage } from '@/services/MemberV2Api'
import { columnSRM, initExpandIconColumn } from '../../constants/page-table-column'
const formItemLayout = { const formItemLayout = {
labelCol: { span: 3 }, labelCol: { span: 3 },
...@@ -27,29 +27,6 @@ const ROLE_TYPE = '1' ...@@ -27,29 +27,6 @@ const ROLE_TYPE = '1'
// 1:b2b,2:srm // 1:b2b,2:srm
const ORDER_TYPE = '2' const ORDER_TYPE = '2'
const initMaterialTableColumn = [
{ ...MaterialNoColumn, dataIndex: 'skuId', width: 80, },
{ ...MaterialNameColumn, dataIndex: 'productName', width: 192, },
{ ...MaterialModelColumn, dataIndex: 'spec', width: 128, },
{ ...ClassColumn, dataIndex: 'category', width: 96, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, },
]
const initExpandIconColumn = [
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 80, },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 150, },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 120, },
{ ...OrderNumColumn, dataIndex: 'purchaseCount', width: 86, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 86, },
{ ...TransitNumColumn, dataIndex: 'transitCount', width: 86, },
{ ...DeliveredNumColumn, dataIndex: 'leftCount', width: 86, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCount', width: 96, },
]
const DeliveryPlanAwaitSRMCreate: React.FC = () => { const DeliveryPlanAwaitSRMCreate: React.FC = () => {
const [form] = Form.useForm() const [form] = Form.useForm()
const datesRef = useRef<any>(null) const datesRef = useRef<any>(null)
...@@ -58,19 +35,21 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => { ...@@ -58,19 +35,21 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
const [spinning, setSpinning] = useState<boolean>(false) const [spinning, setSpinning] = useState<boolean>(false)
const [iAnchors, setIAnchors] = useState<AnchorsItem[]>([ const [iAnchors, setIAnchors] = useState<AnchorsItem[]>([
ExternalDeliveryPlanCirculation, // Circulation,
base_Info, base_Info,
PlanMaterial, PlanMaterial,
Remarks, Remarks,
]) ])
// 动态 TableColumn // 动态 TableColumn
const [materialTableColumn, setMaterialTableColumn] = useState<any>(initMaterialTableColumn) const [materialTableColumn, setMaterialTableColumn] = useState<any>(columnSRM)
// 动态 expandIconColumn // 动态 expandIconColumn
const [expandIconColumn, setExpandIconColumn] = useState<any>(initExpandIconColumn) const [expandIconColumn, setExpandIconColumn] = useState<any>(initExpandIconColumn)
const expandedRowRender = (record) => { const expandedRowRender = (record) => {
return <Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" /> return <div>
<Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" />
</div>
} }
...@@ -129,7 +108,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => { ...@@ -129,7 +108,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
const inputChange = (val: any, text: any, record: any) => { const inputChange = (val: any, text: any, record: any) => {
let { day } = text let { day } = text
let dataArr = JSON.parse(JSON.stringify(materialTableDataRef.current)) let dataArr = JSON.parse(JSON.stringify(materialTableDataRef.current))
let index = dataArr.findIndex(f => f.skuId === record.skuId) let index = dataArr.findIndex(f => f.planProductId === record.planProductId)
let childIndex = dataArr[index].orders.findIndex(f => f.orderProductId === record.orderProductId) let childIndex = dataArr[index].orders.findIndex(f => f.orderProductId === record.orderProductId)
dataArr[index].orders[childIndex][`$${day}`].planCount = val dataArr[index].orders[childIndex][`$${day}`].planCount = val
materialTableDataRef.current = dataArr materialTableDataRef.current = dataArr
...@@ -163,7 +142,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => { ...@@ -163,7 +142,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
/> />
) )
})) }))
setMaterialTableColumn([...initMaterialTableColumn, ...datesColumn]) setMaterialTableColumn([...columnSRM, ...datesColumn])
setExpandIconColumn([...initExpandIconColumn, ...datesExpandIconColumn]) setExpandIconColumn([...initExpandIconColumn, ...datesExpandIconColumn])
} else { } else {
// 清空 // 清空
...@@ -171,7 +150,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => { ...@@ -171,7 +150,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
materialTableDataRef.current = null materialTableDataRef.current = null
setSelectedDate([]) setSelectedDate([])
setMaterialTableData([]) setMaterialTableData([])
setMaterialTableColumn(initMaterialTableColumn) setMaterialTableColumn(columnSRM)
setExpandIconColumn(initExpandIconColumn) setExpandIconColumn(initExpandIconColumn)
} }
} }
...@@ -191,7 +170,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => { ...@@ -191,7 +170,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
roleType: ROLE_TYPE, roleType: ROLE_TYPE,
orderType: ORDER_TYPE, orderType: ORDER_TYPE,
current: '1', current: '1',
pageSize: '110' pageSize: '999'
}).then((res) => { }).then((res) => {
if (res.code === 1000) { if (res.code === 1000) {
const assemble = res.data.data.map((item => { const assemble = res.data.data.map((item => {
...@@ -236,13 +215,13 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => { ...@@ -236,13 +215,13 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
labelAlign='left' labelAlign='left'
form={form} form={form}
> >
<BaseInfo className='mt-0' title={ExternalDeliveryPlanCirculation.name} id={ExternalDeliveryPlanCirculation.key} cols={1}> {/* <BaseInfo className='mt-0' title={Circulation.name} id={Circulation.key} cols={1}>
<Steps progressDot current={0}> <Steps progressDot current={0}>
<Steps.Step title={Purchaser} description={SubmitDeliveryPlan} /> <Steps.Step title={Purchaser} description={SubmitDeliveryPlan} />
<Steps.Step title={Supplier} description={ConfirmDeliveryPlan} /> <Steps.Step title={Supplier} description={ConfirmDeliveryPlan} />
</Steps> </Steps>
</BaseInfo> </BaseInfo> */}
<BaseInfo className='mt-16' title={base_Info.name} id={base_Info.key}> <BaseInfo className='mt-0' title={base_Info.name} id={base_Info.key}>
<Form.Item <Form.Item
{...formItemLayout} {...formItemLayout}
label={PlanningCycle} label={PlanningCycle}
...@@ -273,7 +252,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => { ...@@ -273,7 +252,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
label={PlanSummary} label={PlanSummary}
name='planSummaryText' name='planSummaryText'
rules={[ rules={[
{ required: true, message: '请选择' } { required: false, message: '请选择' }
]} ]}
> >
<Input /> <Input />
...@@ -282,19 +261,27 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => { ...@@ -282,19 +261,27 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
<BaseInfo className='mt-16' title={PlanMaterial.name} id={PlanMaterial.key} cols={1}> <BaseInfo className='mt-16' title={PlanMaterial.name} id={PlanMaterial.key} cols={1}>
<Table <Table
// defaultExpandAllRows // defaultExpandAllRows
rowKey={'skuId'} rowKey={'planProductId'}
columns={materialTableColumn} columns={materialTableColumn}
expandedRowRender={expandedRowRender} expandable={{
expandIcon: ({ expanded, onExpand, record }) =>
expanded ? (
<CaretDownOutlined onClick={e => onExpand(record, e)} />
) : (
<CaretRightOutlined onClick={e => onExpand(record, e)} />
),
expandedRowRender
}}
dataSource={materialTableData} dataSource={materialTableData}
tableLayout="fixed" tableLayout="fixed"
scroll={{ x: 2022 }} scroll={{ x: '100%' }}
/> />
</BaseInfo> </BaseInfo>
<BaseInfo className='mt-16' title={<>{Remarks.name} <span style={{ color: 'red' }}>*</span></>} id={Remarks.key} cols={1}> <BaseInfo className='mt-16' title={Remarks.name} id={Remarks.key} cols={1}>
<Form.Item <Form.Item
name='remark' name='remark'
rules={[ rules={[
{ required: true, message: '请输入' } { required: false, message: '请输入' }
]} ]}
> >
<Input.TextArea rows={4} maxLength={300} placeholder={DeliveryPlanRemark} /> <Input.TextArea rows={4} maxLength={300} placeholder={DeliveryPlanRemark} />
......
...@@ -9,13 +9,13 @@ import AnchorPage, { AnchorsItem } from '@/components/AnchorPage' ...@@ -9,13 +9,13 @@ import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import { BaseInfo as base_Info, PlanningCycle, SupplyMembersLabel, PlanSummary, ExternalRoamRecord, Circulation, Purchaser, SubmitDeliveryPlan, Supplier, ConfirmDeliveryPlan, PlannedDelivery, ExternalState, PlanNumber } from '../../constants' import { BaseInfo as base_Info, PlanningCycle, SupplyMembersLabel, PlanSummary, ExternalRoamRecord, Circulation, Purchaser, SubmitDeliveryPlan, Supplier, ConfirmDeliveryPlan, PlannedDelivery, ExternalState, PlanNumber } from '../../constants'
import { Steps, Table, Tag } from 'antd' import { Steps, Table, Tag } from 'antd'
import BaseInfo from '@/components/BaseInfo/BaseInfo' import BaseInfo from '@/components/BaseInfo/BaseInfo'
import { ExternalRoamRecordTableColumn } from '../../constants/page-table-column' import { columnSRM, ExternalRoamRecordTableColumn, initExpandIconColumn } from '../../constants/page-table-column'
import _ from 'lodash' import _ from 'lodash'
import { getDayAll, godAtob, integrationArrToObj, integrationOjb, TagStatus } from '../../utils' import { getDayAll, godAtob, integrationArrToObj, integrationOjb, TagStatus } from '../../utils'
import { BrandColumn, ClassColumn, ConsigneeNumColumn, DeliveredNumColumn, MaterialModelColumn, MaterialNameColumn, MaterialNoColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OrderNumColumn, PlannedDeliveryNumColumn, TransitNumColumn, UntilColumn } from '../../constants/table-column'
import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage } from '@/services/OrderNewV2Api' import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage } from '@/services/OrderNewV2Api'
import moment from 'moment' import moment from 'moment'
import CustomizedTableItem from '../../components/CustomizedTableItem' import CustomizedTableItem from '../../components/CustomizedTableItem'
import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons'
const tagStatus = new TagStatus() const tagStatus = new TagStatus()
const statusTxt = new Map([[1, '待提交'], [2, '待确认'], [3, '待修订'], [4, '已确认'], [5, '已删除']]) const statusTxt = new Map([[1, '待提交'], [2, '待确认'], [3, '待修订'], [4, '已确认'], [5, '已删除']])
...@@ -31,33 +31,14 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => { ...@@ -31,33 +31,14 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => {
]) ])
// 动态 TableColumn // 动态 TableColumn
const [materialTableColumn, setMaterialTableColumn] = useState<any>([ const [materialTableColumn, setMaterialTableColumn] = useState<any>(columnSRM)
{ ...MaterialNoColumn, dataIndex: 'skuId', width: 80, },
{ ...MaterialNameColumn, dataIndex: 'productName', width: 192, },
{ ...MaterialModelColumn, dataIndex: 'spec', width: 128, },
{ ...ClassColumn, dataIndex: 'category', width: 96, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, },
])
// 动态 expandIconColumn // 动态 expandIconColumn
const [expandIconColumn, setExpandIconColumn] = useState<any>([ const [expandIconColumn, setExpandIconColumn] = useState<any>(initExpandIconColumn)
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 80, },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 150, },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 120, },
{ ...OrderNumColumn, dataIndex: 'purchaseCount', width: 86, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 86, },
{ ...TransitNumColumn, dataIndex: 'transitCount', width: 86, },
{ ...DeliveredNumColumn, dataIndex: 'leftCount', width: 86, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCount', width: 96, },
])
const expandedRowRender = (record, index) => { const expandedRowRender = (record, index) => {
return <Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" /> return <div>
<Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" />
</div>
} }
...@@ -89,7 +70,7 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => { ...@@ -89,7 +70,7 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => {
getOrderDeliveryPlanDetailProductPage({ getOrderDeliveryPlanDetailProductPage({
id, id,
current: '1', current: '1',
pageSize: '10' pageSize: '999'
}).then((res) => { }).then((res) => {
if (res.code === 1000) { if (res.code === 1000) {
const assemble = res.data.data.map(item => { const assemble = res.data.data.map(item => {
...@@ -133,7 +114,7 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => { ...@@ -133,7 +114,7 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => {
return ( return (
<AnchorPage <AnchorPage
title={details?.planNo} title={`${details?.digest}|${details?.planNo}`}
onBack={() => history.goBack()} onBack={() => history.goBack()}
anchors={iAnchors} anchors={iAnchors}
> >
...@@ -161,12 +142,20 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => { ...@@ -161,12 +142,20 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => {
<BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}> <BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}>
<Table <Table
// defaultExpandAllRows // defaultExpandAllRows
rowKey={'skuId'} rowKey={'planProductId'}
columns={materialTableColumn} columns={materialTableColumn}
expandedRowRender={expandedRowRender} expandable={{
expandIcon: ({ expanded, onExpand, record }) =>
expanded ? (
<CaretDownOutlined onClick={e => onExpand(record, e)} />
) : (
<CaretRightOutlined onClick={e => onExpand(record, e)} />
),
expandedRowRender
}}
dataSource={materialTableData} dataSource={materialTableData}
tableLayout="fixed" tableLayout="fixed"
scroll={{ x: 2022 }} scroll={{ x: '100%' }}
/> />
</BaseInfo> </BaseInfo>
<BaseInfo className='mt-16' title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}> <BaseInfo className='mt-16' title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
......
...@@ -80,7 +80,7 @@ const DeliveryPlanManagementAwaitSRM: React.FC = () => { ...@@ -80,7 +80,7 @@ const DeliveryPlanManagementAwaitSRM: React.FC = () => {
} }
const buttonGroup = { const buttonGroup = {
'提交': record.status <= 1, '提交': record.status <= 1,
'修改': record.status >= 1, '修改': record.status === 1 || record.status === 3,
'删除': record.status <= 1, '删除': record.status <= 1,
'查看': true, '查看': true,
} }
......
...@@ -8,12 +8,11 @@ import { history } from 'umi' ...@@ -8,12 +8,11 @@ import { history } from 'umi'
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage' import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import { BaseInfo as base_Info, Remarks, PlanningCycle, SupplyMembersLabel, PlanSummary, ExternalRoamRecord, ExternalState, Circulation, Purchaser, SubmitDeliveryPlan, Supplier, ConfirmDeliveryPlan, PlannedDelivery, DeliveryPlanRemark } from '../../constants' import { BaseInfo as base_Info, Remarks, PlanningCycle, SupplyMembersLabel, PlanSummary, ExternalRoamRecord, ExternalState, Circulation, Purchaser, SubmitDeliveryPlan, Supplier, ConfirmDeliveryPlan, PlannedDelivery, DeliveryPlanRemark } from '../../constants'
import { Button, Form, Input, InputNumber, message, Space, Spin, Steps, Table, Tag } from 'antd' import { Button, Form, Input, InputNumber, message, Space, Spin, Steps, Table, Tag } from 'antd'
import { SaveOutlined } from '@ant-design/icons' import { CaretDownOutlined, CaretRightOutlined, SaveOutlined } from '@ant-design/icons'
import BaseInfo from '@/components/BaseInfo/BaseInfo' import BaseInfo from '@/components/BaseInfo/BaseInfo'
import { ExternalRoamRecordTableColumn } from '../../constants/page-table-column' import { columnSRM, ExternalRoamRecordTableColumn, initExpandIconColumn } from '../../constants/page-table-column'
import _ from 'lodash' import _ from 'lodash'
import { afterToday, getDayAll, godAtob, integrationArrToObj, integrationOjb, limitDecimalsF, limitDecimalsP, TagStatus } from '../../utils' import { afterToday, getDayAll, godAtob, integrationArrToObj, integrationOjb, limitDecimalsF, limitDecimalsP, TagStatus } from '../../utils'
import { BrandColumn, ClassColumn, ConsigneeNumColumn, DeliveredNumColumn, MaterialModelColumn, MaterialNameColumn, MaterialNoColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OrderNumColumn, PlannedDeliveryNumColumn, TransitNumColumn, UntilColumn } from '../../constants/table-column'
import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage, postOrderDeliveryPlanUpdate } from '@/services/OrderNewV2Api' import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage, postOrderDeliveryPlanUpdate } from '@/services/OrderNewV2Api'
import moment from 'moment' import moment from 'moment'
...@@ -43,33 +42,14 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => { ...@@ -43,33 +42,14 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => {
]) ])
// 动态 TableColumn // 动态 TableColumn
const [materialTableColumn, setMaterialTableColumn] = useState<any>([ const [materialTableColumn, setMaterialTableColumn] = useState<any>(columnSRM)
{ ...MaterialNoColumn, dataIndex: 'skuId', width: 80, },
{ ...MaterialNameColumn, dataIndex: 'productName', width: 192, },
{ ...MaterialModelColumn, dataIndex: 'spec', width: 128, },
{ ...ClassColumn, dataIndex: 'category', width: 96, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, },
])
// 动态 expandIconColumn // 动态 expandIconColumn
const [expandIconColumn, setExpandIconColumn] = useState<any>([ const [expandIconColumn, setExpandIconColumn] = useState<any>(initExpandIconColumn)
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 80, },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 150, },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 120, },
{ ...OrderNumColumn, dataIndex: 'purchaseCount', width: 86, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 86, },
{ ...TransitNumColumn, dataIndex: 'transitCount', width: 86, },
{ ...DeliveredNumColumn, dataIndex: 'leftCount', width: 86, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCount', width: 96, },
])
const expandedRowRender = (record) => { const expandedRowRender = (record) => {
return <Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" /> return <div>
<Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" />
</div>
} }
// 详情 // 详情
...@@ -112,7 +92,7 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => { ...@@ -112,7 +92,7 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => {
const inputChange = (val: any, text: any, record: any) => { const inputChange = (val: any, text: any, record: any) => {
let { day } = text let { day } = text
let dataArr = JSON.parse(JSON.stringify(materialTableDataRef.current)) let dataArr = JSON.parse(JSON.stringify(materialTableDataRef.current))
let index = dataArr.findIndex(f => f.skuId === record.skuId) let index = dataArr.findIndex(f => f.planProductId === record.planProductId)
let childIndex = dataArr[index].orders.findIndex(f => f.orderProductId === record.orderProductId) let childIndex = dataArr[index].orders.findIndex(f => f.orderProductId === record.orderProductId)
dataArr[index].orders[childIndex][`$${day}`].planCount = val dataArr[index].orders[childIndex][`$${day}`].planCount = val
materialTableDataRef.current = dataArr materialTableDataRef.current = dataArr
...@@ -151,7 +131,7 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => { ...@@ -151,7 +131,7 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => {
getOrderDeliveryPlanDetailProductPage({ getOrderDeliveryPlanDetailProductPage({
id, id,
current: '1', current: '1',
pageSize: '10' pageSize: '999'
}).then((res) => { }).then((res) => {
if (res.code === 1000) { if (res.code === 1000) {
const assemble = res.data.data.map(item => { const assemble = res.data.data.map(item => {
...@@ -201,7 +181,7 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => { ...@@ -201,7 +181,7 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => {
return ( return (
<Spin spinning={spinning}> <Spin spinning={spinning}>
<AnchorPage <AnchorPage
title={details?.planNo} title={`${details?.digest}|${details?.planNo}`}
onBack={() => history.goBack()} onBack={() => history.goBack()}
anchors={iAnchors} anchors={iAnchors}
extra={ extra={
...@@ -245,19 +225,27 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => { ...@@ -245,19 +225,27 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => {
<BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}> <BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}>
<Table <Table
// defaultExpandAllRows // defaultExpandAllRows
rowKey={'skuId'} rowKey={'planProductId'}
columns={materialTableColumn} columns={materialTableColumn}
expandedRowRender={expandedRowRender} expandable={{
expandIcon: ({ expanded, onExpand, record }) =>
expanded ? (
<CaretDownOutlined onClick={e => onExpand(record, e)} />
) : (
<CaretRightOutlined onClick={e => onExpand(record, e)} />
),
expandedRowRender
}}
dataSource={materialTableData} dataSource={materialTableData}
tableLayout="fixed" tableLayout="fixed"
scroll={{ x: 2022 }} scroll={{ x: '100%' }}
/> />
</BaseInfo> </BaseInfo>
<BaseInfo className='mt-16' title={Remarks.name} id={Remarks.key} cols={1}> <BaseInfo className='mt-16' title={Remarks.name} id={Remarks.key} cols={1}>
<Form.Item <Form.Item
name='remark' name='remark'
rules={[ rules={[
{ required: true, message: '请输入' } { required: false, message: '请输入' }
]} ]}
> >
<Input.TextArea rows={4} maxLength={300} placeholder={DeliveryPlanRemark} /> <Input.TextArea rows={4} maxLength={300} placeholder={DeliveryPlanRemark} />
......
...@@ -10,8 +10,7 @@ import { Steps, Table, Tag } from 'antd' ...@@ -10,8 +10,7 @@ import { Steps, Table, Tag } from 'antd'
import AnchorPage, { AnchorsItem } from "@/components/AnchorPage" import AnchorPage, { AnchorsItem } from "@/components/AnchorPage"
import BaseInfo from '@/components/BaseInfo/BaseInfo' import BaseInfo from '@/components/BaseInfo/BaseInfo'
import { BaseInfo as base_Info, Circulation, ConfirmDeliveryPlan, ExternalRoamRecord, ExternalState, PlanMaterial, PlannedDelivery, PlanningCycle, PlanNumber, PlanSummary, Purchaser, SubmitDeliveryPlan, Supplier, SupplyMember, SupplyMembersLabel, } from '../../constants' import { BaseInfo as base_Info, Circulation, ConfirmDeliveryPlan, ExternalRoamRecord, ExternalState, PlanMaterial, PlannedDelivery, PlanningCycle, PlanNumber, PlanSummary, Purchaser, SubmitDeliveryPlan, Supplier, SupplyMember, SupplyMembersLabel, } from '../../constants'
import { ExternalRoamRecordTableColumn } from '../../constants/page-table-column' import { columnB2B, columnSRM, initExpandIconColumn, ExternalRoamRecordTableColumn } from '../../constants/page-table-column'
import { BrandColumn, ClassColumn, CommodityNoColumn, ConsigneeNumColumn, DeliveredNumColumn, MaterialModelColumn, MaterialNameColumn, MaterialNoColumn, OrderCreatedAtColumn, OrderNoColumn, OrderNumColumn, OrderSummaryColumn, PlannedDeliveryNumColumn, TradeNameColumn, TransitNumColumn, UntilColumn } from '../../constants/table-column'
import { getDayAll, godAtob, integrationArrToObj, integrationOjb, TagStatus } from '../../utils' import { getDayAll, godAtob, integrationArrToObj, integrationOjb, TagStatus } from '../../utils'
import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage } from '@/services/OrderNewV2Api' import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage } from '@/services/OrderNewV2Api'
import CustomizedTableItem from '../../components/CustomizedTableItem' import CustomizedTableItem from '../../components/CustomizedTableItem'
...@@ -20,32 +19,6 @@ import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons' ...@@ -20,32 +19,6 @@ import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons'
const intl = getIntl(); const intl = getIntl();
const columnB2B = [
{ ...CommodityNoColumn, dataIndex: 'skuId', width: 80, ellipsis: true, },
{ ...TradeNameColumn, dataIndex: 'productName', width: 192, ellipsis: true, },
{ ...ClassColumn, dataIndex: 'category', width: 96, ellipsis: true, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, ellipsis: true, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, ellipsis: true, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, ellipsis: true, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, ellipsis: true, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, ellipsis: true, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, ellipsis: true, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, ellipsis: true, },
]
const columnSRM = [
{ ...MaterialNoColumn, dataIndex: 'skuId', width: 80, ellipsis: true, },
{ ...MaterialNameColumn, dataIndex: 'productName', width: 192, ellipsis: true, },
{ ...MaterialModelColumn, dataIndex: 'spec', width: 128, ellipsis: true, },
{ ...ClassColumn, dataIndex: 'category', width: 96, ellipsis: true, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, ellipsis: true, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, ellipsis: true, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, ellipsis: true, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, ellipsis: true, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, ellipsis: true, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, ellipsis: true, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, ellipsis: true, },
]
const tagStatus = new TagStatus() const tagStatus = new TagStatus()
const statusTxt = new Map([[1, '待提交'], [2, '待确认'], [3, '待修订'], [4, '已确认'], [5, '已删除']]) const statusTxt = new Map([[1, '待提交'], [2, '待确认'], [3, '待修订'], [4, '已确认'], [5, '已删除']])
...@@ -65,18 +38,11 @@ const DeliveryPlanManagementDetails: React.FC = () => { ...@@ -65,18 +38,11 @@ const DeliveryPlanManagementDetails: React.FC = () => {
const [tableColumn, setTableColumn] = useState<any>([]) const [tableColumn, setTableColumn] = useState<any>([])
// 动态 expandIconColumn // 动态 expandIconColumn
// const dynamicWidth = deliveryPlanType === '1' ? 214 : 342 // const dynamicWidth = deliveryPlanType === '1' ? 214 : 342
const [expandIconColumn, setExpandIconColumn] = useState<any>([ const [expandIconColumn, setExpandIconColumn] = useState<any>(initExpandIconColumn)
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 80, ellipsis: true, },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 160, ellipsis: true, },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 120, ellipsis: true, },
{ ...OrderNumColumn, dataIndex: 'purchaseCount', width: 96, ellipsis: true, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 96, ellipsis: true, },
{ ...TransitNumColumn, dataIndex: 'transitCount', width: 96, ellipsis: true, },
{ ...DeliveredNumColumn, dataIndex: 'leftCount', width: 96, ellipsis: true, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCount', width: 128, ellipsis: true, },
])
const expandedRowRender = (record) => { const expandedRowRender = (record) => {
return <Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} /> return <div>
<Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" scroll={{ x: '100%' }} />
</div>
} }
// 详情 // 详情
...@@ -181,7 +147,7 @@ const DeliveryPlanManagementDetails: React.FC = () => { ...@@ -181,7 +147,7 @@ const DeliveryPlanManagementDetails: React.FC = () => {
{/* B2B 显示计划送货物料,SRM显示计划送货商品 */} {/* B2B 显示计划送货物料,SRM显示计划送货商品 */}
<Table <Table
// defaultExpandAllRows // defaultExpandAllRows
rowKey={'skuId'} rowKey={'planProductId'}
columns={tableColumn} columns={tableColumn}
expandable={{ expandable={{
expandIcon: ({ expanded, onExpand, record }) => expandIcon: ({ expanded, onExpand, record }) =>
......
...@@ -9,39 +9,13 @@ import moment from 'moment' ...@@ -9,39 +9,13 @@ import moment from 'moment'
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage' import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import { BaseInfo as base_Info, Remarks, PlanningCycle, SupplyMembersLabel, PlanSummary, ExternalRoamRecord, ExternalState, Circulation, Purchaser, SubmitDeliveryPlan, Supplier, ConfirmDeliveryPlan, PlannedDelivery, DeliveryPlanRemark, PlanNumber } from '../../constants' import { BaseInfo as base_Info, Remarks, PlanningCycle, SupplyMembersLabel, PlanSummary, ExternalRoamRecord, ExternalState, Circulation, Purchaser, SubmitDeliveryPlan, Supplier, ConfirmDeliveryPlan, PlannedDelivery, DeliveryPlanRemark, PlanNumber } from '../../constants'
import { Button, Form, Input, InputNumber, message, Space, Spin, Steps, Table, Tag } from 'antd' import { Button, Form, Input, InputNumber, message, Space, Spin, Steps, Table, Tag } from 'antd'
import { SaveOutlined } from '@ant-design/icons' import { CaretDownOutlined, CaretRightOutlined, SaveOutlined } from '@ant-design/icons'
import BaseInfo from '@/components/BaseInfo/BaseInfo' import BaseInfo from '@/components/BaseInfo/BaseInfo'
import { ExternalRoamRecordTableColumn } from '../../constants/page-table-column' import { columnB2B, columnSRM, initExpandIconColumn, ExternalRoamRecordTableColumn } from '../../constants/page-table-column'
import { afterToday, getDayAll, godAtob, integrationArrToObj, integrationOjb, limitDecimalsF, limitDecimalsP, TagStatus } from '../../utils' import { afterToday, getDayAll, godAtob, integrationArrToObj, integrationOjb, limitDecimalsF, limitDecimalsP, TagStatus } from '../../utils'
import { BrandColumn, ClassColumn, ConsigneeNumColumn, DeliveredNumColumn, MaterialModelColumn, MaterialNameColumn, MaterialNoColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OrderNumColumn, PlannedDeliveryNumColumn, TransitNumColumn, UntilColumn, CommodityNoColumn, TradeNameColumn } from '../../constants/table-column' import { BrandColumn, ClassColumn, ConsigneeNumColumn, DeliveredNumColumn, MaterialModelColumn, MaterialNameColumn, MaterialNoColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OrderNumColumn, PlannedDeliveryNumColumn, TransitNumColumn, UntilColumn, CommodityNoColumn, TradeNameColumn } from '../../constants/table-column'
import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage, postOrderDeliveryPlanUpdate } from '@/services/OrderNewV2Api' import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage, postOrderDeliveryPlanUpdate } from '@/services/OrderNewV2Api'
const columnB2B = [
{ ...CommodityNoColumn, dataIndex: 'skuId', width: 80, },
{ ...TradeNameColumn, dataIndex: 'productName', width: 192, },
{ ...ClassColumn, dataIndex: 'category', width: 96, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, },
]
const columnSRM = [
{ ...MaterialNoColumn, dataIndex: 'skuId', width: 80, },
{ ...MaterialNameColumn, dataIndex: 'productName', width: 192, },
{ ...MaterialModelColumn, dataIndex: 'productName', width: 128, },
{ ...ClassColumn, dataIndex: 'category', width: 96, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, },
{ ...OrderNumColumn, dataIndex: 'purchaseCountSum', width: 96, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, },
]
const formItemLayout = { const formItemLayout = {
labelCol: { span: 6 }, labelCol: { span: 6 },
wrapperCol: { span: 16 } wrapperCol: { span: 16 }
...@@ -72,16 +46,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => { ...@@ -72,16 +46,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
// 动态 TableColumn // 动态 TableColumn
const [tableColumn, setTableColumn] = useState<any>([]) const [tableColumn, setTableColumn] = useState<any>([])
// 动态 expandIconColumn // 动态 expandIconColumn
const [expandIconColumn, setExpandIconColumn] = useState<any>([ const [expandIconColumn, setExpandIconColumn] = useState<any>(initExpandIconColumn)
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 80, },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 150, },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 120, },
{ ...OrderNumColumn, dataIndex: 'purchaseCount', width: 86, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 86, },
{ ...TransitNumColumn, dataIndex: 'transitCount', width: 86, },
{ ...DeliveredNumColumn, dataIndex: 'leftCount', width: 86, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCount', width: 96, },
])
const expandedRowRender = (record: any) => { const expandedRowRender = (record: any) => {
return <Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" /> return <Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" />
...@@ -126,7 +91,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => { ...@@ -126,7 +91,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
const inputChange = (val: any, text: any, record: any) => { const inputChange = (val: any, text: any, record: any) => {
let { day } = text let { day } = text
let dataArr = JSON.parse(JSON.stringify(tableDataRef.current)) let dataArr = JSON.parse(JSON.stringify(tableDataRef.current))
let index = dataArr.findIndex(f => f.skuId === record.skuId) let index = dataArr.findIndex(f => f.planProductId === record.planProductId)
let childIndex = dataArr[index].orders.findIndex(f => f.orderProductId === record.orderProductId) let childIndex = dataArr[index].orders.findIndex(f => f.orderProductId === record.orderProductId)
dataArr[index].orders[childIndex][`$${day}`].planCount = val dataArr[index].orders[childIndex][`$${day}`].planCount = val
tableDataRef.current = dataArr tableDataRef.current = dataArr
...@@ -166,7 +131,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => { ...@@ -166,7 +131,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
getOrderDeliveryPlanDetailProductPage({ getOrderDeliveryPlanDetailProductPage({
id, id,
current: '1', current: '1',
pageSize: '10' pageSize: '999'
}).then((res) => { }).then((res) => {
if (res.code === 1000) { if (res.code === 1000) {
const assemble = res.data.data.map(item => { const assemble = res.data.data.map(item => {
...@@ -216,7 +181,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => { ...@@ -216,7 +181,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
return ( return (
<Spin spinning={spinning}> <Spin spinning={spinning}>
<AnchorPage <AnchorPage
title={details?.planNo} title={`${details?.digest}|${details?.planNo}`}
onBack={() => history.goBack()} onBack={() => history.goBack()}
anchors={iAnchors} anchors={iAnchors}
extra={ extra={
...@@ -263,9 +228,17 @@ const DeliveryPlanManagementUpdate: React.FC = () => { ...@@ -263,9 +228,17 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
<BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}> <BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}>
<Table <Table
// defaultExpandAllRows // defaultExpandAllRows
rowKey={'skuId'} rowKey={'planProductId'}
columns={tableColumn} columns={tableColumn}
expandedRowRender={expandedRowRender} expandable={{
expandIcon: ({ expanded, onExpand, record }) =>
expanded ? (
<CaretDownOutlined onClick={e => onExpand(record, e)} />
) : (
<CaretRightOutlined onClick={e => onExpand(record, e)} />
),
expandedRowRender
}}
dataSource={tableData} dataSource={tableData}
tableLayout="fixed" tableLayout="fixed"
scroll={{ x: '100%' }} scroll={{ x: '100%' }}
...@@ -275,7 +248,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => { ...@@ -275,7 +248,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
<Form.Item <Form.Item
name='remark' name='remark'
rules={[ rules={[
{ required: true, message: '请输入' } { required: false, message: '请输入' }
]} ]}
> >
<Input.TextArea rows={4} maxLength={300} placeholder={DeliveryPlanRemark} /> <Input.TextArea rows={4} maxLength={300} placeholder={DeliveryPlanRemark} />
......
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