Commit a01929a6 authored by Gavin Peng's avatar Gavin Peng

fix: 对接送货计划协同

parent 65449c05
/**
* 业务定制弹窗
* @author: Gavin
* @description: 【Ref 版本】选状态反馈选择结果, 示例应用场景: 详情页面点击提交, 弹窗选择审核状态, 是否需要填写原因。 ~~~!!!!单选模式,暂为不可异步, 待优化。
*/
import { Form, Input, Modal, Radio } from 'antd';
import React, { useEffect, useState } from 'react'
import { ModalCancelText, ModalOkText, ReasonPlaceholder, ReasonRulesMessage, SelectRadioRulesMessage } from '../translate';
export interface IRadioGroup {
/**
* Radio Label
*/
label: string,
/**
* Radio Value (Must be unique)
*/
value: string | number,
/**
* Need to fill in the reason
*/
isReason?: boolean
}
export interface SubmitFeedback {
/**
* Radio box checked value
*/
selectedRadio: string | number,
/**
* Input content
*/
reason?: string,
}
interface CustomizedModalProps {
/**
* (必填) 标题
*/
title: string,
/**
* (必填) 是否显示
*/
visible: boolean,
/**
* (必填) Radio.Group渲染数组
*/
radioGroup: IRadioGroup[],
/**
* (必填) 内部校验通过返回
*/
onSubmit: (values: SubmitFeedback) => void
/**
* (必填) 关闭操作反馈 visible 布尔值
*/
onCancel: (visible: boolean) => void
/**
* (非必填) 默认选中 Radio
*/
defaultRadioValue?: string | number,
/**
* (非必填) 确认按钮文字自定义
*/
okText?: string,
/**
* (非必填) 取消按钮文字自定义
*/
cancelText?: string,
}
const CustomizedModal: React.FC<CustomizedModalProps> = (props) => {
const [form] = Form.useForm()
const [visibleReason, setVisibleReason] = useState<boolean>(false)
const onOk = () => {
form.validateFields().then(values => {
props.onSubmit(values)
})
}
const onCancel = () => {
props.onCancel(false)
}
const onRadioGroupChange = (val: any) => {
setVisibleReason(props.radioGroup.find(_f => _f.value == val)?.isReason)
}
useEffect(() => {
if (!props.visible) {
form.resetFields()
} else {
if (props?.defaultRadioValue) {
const _visibleReason = props.radioGroup.find(_f => _f.value === props?.defaultRadioValue)?.isReason
setVisibleReason(_visibleReason)
}
}
},[props.visible])
return (
<Modal
title={props.title}
visible={props.visible}
okText={props?.okText || ModalOkText}
cancelText={props?.okText || ModalCancelText}
onOk={onOk}
onCancel={onCancel}
>
<Form form={form}>
<Form.Item
name='isPass'
initialValue={props.defaultRadioValue}
rules={[{ required: true, message: SelectRadioRulesMessage }]}
>
<Radio.Group onChange={(e) => onRadioGroupChange(e.target.value)}>
{
props.radioGroup?.map((item: IRadioGroup, index: number) => (
<Radio value={item.value} key={index}>{item.label}</Radio>
))
}
</Radio.Group>
</Form.Item>
{
visibleReason
? <Form.Item
name='reason'
rules={[{ required: true, message: ReasonRulesMessage }]}
>
<Input.TextArea allowClear rows={3} maxLength={60} placeholder={ReasonPlaceholder} />
</Form.Item>
: null
}
</Form>
</Modal>
)
}
CustomizedModal.defaultProps = {
visible: false,
radioGroup: [],
onSubmit: (values) => {},
onCancel: (visible) => {},
}
export default CustomizedModal;
......@@ -26,7 +26,7 @@ export interface SubmitFeedback {
/**
* Radio box checked value
*/
selectedRadio: string | number,
isPass: string | number,
/**
* Input content
*/
......
......@@ -3,28 +3,171 @@
* @author: Gavin
* @description:
*/
import React, { useState } from 'react'
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import React, { useEffect, useState } from 'react'
import { history } from 'umi'
import { Button, Space, Steps, Table, Tag } from 'antd'
import moment from 'moment'
import _ from 'lodash'
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import { Button, Space, Spin, Steps, Table, Tag } from 'antd'
import { CheckCircleOutlined } from '@ant-design/icons'
import { DeliveryPlanCollaborationAnchors, Circulation, BaseInfo as base_Info, Purchaser, SubmitDeliveryPlan, Supplier, ConfirmDeliveryPlan, PlanNumber, SupplyMember, PlanSummary, PlanningCycle, ExternalState, PlannedDelivery, ExternalRoamRecord, } from '../../constants'
import { Circulation, BaseInfo as base_Info, Purchaser, SubmitDeliveryPlan, Supplier, ConfirmDeliveryPlan, PlanNumber, SupplyMember, PlanSummary, PlanningCycle, ExternalState, PlannedDelivery, ExternalRoamRecord, SupplyMembersLabel, } from '../../constants'
import BaseInfo from '@/components/BaseInfo/BaseInfo'
import { ExternalRoamRecordTableColumn } from '../../constants/page-table-column'
import CustomizedModal, { SubmitFeedback } from '../../components/customizedModal'
import { getDayAll, godAtob, integrationArrToObj, integrationOjb, TagStatus } from '../../utils'
import { BrandColumn, ClassColumn, CommodityNoColumn, ConsigneeNumColumn, DeliveredNumColumn, MaterialModelColumn, MaterialNameColumn, MaterialNoColumn, OrderCreatedAtColumn, OrderNoColumn, OrderNumColumn, OrderSummaryColumn, PlannedDeliveryNumColumn, TradeNameColumn, TransitNumColumn, UntilColumn } from '../../constants/table-column'
import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage, postOrderDeliveryPlanConfirm } 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 tagStatus = new TagStatus()
const statusTxt = new Map([[1, '待提交'], [2, '待确认'], [3, '待修订'], [4, '已确认'], [5, '已删除']])
const DeliveryPlanCollaborationAwaitDetails: React.FC = () => {
const [iAnchors, setIAnchors] = useState<AnchorsItem[]>(DeliveryPlanCollaborationAnchors)
const { location: { query: { ty, i } } } = history
// 1-B2B 2-SRM
const deliveryPlanType = godAtob(ty as string)
const id = godAtob(i as string)
const [iAnchors, setIAnchors] = useState<AnchorsItem[]>([
Circulation,
base_Info,
PlannedDelivery,
ExternalRoamRecord,
])
const [spinning, setSpinning] = useState<boolean>(false)
const [details, setDetails] = useState<any>({})
// 计划送货物 列表
const [tableData, setTableData] = useState<any>(null)
// 外部流转单据记录
const [externalRoamRecordData, setExternalRoamRecordData] = useState<any>(null)
const [modalVisible, setModalVisible] = useState<boolean>(false)
const modalSubmint = (values: SubmitFeedback) => {
console.log('modalSubmint -> values :>> ', values)
// 动态 TableColumn
const [tableColumn, setTableColumn] = useState<any>([])
// 动态 expandIconColumn
const [expandIconColumn, setExpandIconColumn] = useState<any>([
{ ...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) => {
return <Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" />
}
// 计划周期 渲染日期
const handleDateAssembleColumn = (startDate: string, endDate: string) => {
const dates = getDayAll(moment(startDate).format('YYYY-MM-DD'), moment(endDate).format('YYYY-MM-DD'))
const datesColumn = dates.map((item, i) => ({ title: item.substr(1), dataIndex: item, key: item, width: 120, align: 'center', }))
const datesExpandIconColumn = dates.map((item, i) => ({
title: item.substr(1),
dataIndex: item,
key: item,
width: 80,
align: 'center',
render: (text: any, record: any) => (<span>{text?.planCount}</span>)
}))
const table_column = deliveryPlanType === '1' ? columnB2B : deliveryPlanType === '2' ? columnSRM : []
setTableColumn([...table_column, ...datesColumn])
setExpandIconColumn([...expandIconColumn, ...datesExpandIconColumn])
}
return (<>
// 获取计划送货
const getPlannedDelivery = () => {
getOrderDeliveryPlanDetailProductPage({
id,
current: '1',
pageSize: '10'
}).then((res) => {
if (res.code === 1000) {
const assemble = res.data.data.map(item => {
return {
...item,
...integrationOjb(item.dayNumbers),
orders: item.orders.map(o => ({ ...o, ...integrationArrToObj(o.planDays) }))
}
})
setTableData(assemble)
}
})
}
// 获取详情
const getDetails = () => {
getOrderDeliveryPlanDetail({
id
}).then((res: any) => {
if (res.code === 1000) {
setDetails(res.data)
getPlannedDelivery()
handleDateAssembleColumn(res.data.planStartTime, res.data.planEndTime)
}
})
}
// 获取流转记录
const getExternalRoamRecordData = () => {
getOrderDeliveryPlanDeliveryHistory({ id }).then((res: any) => {
if (res.code === 1000 && !_.isEmpty(res.data)) {
setExternalRoamRecordData(res.data)
}
})
}
// 提交
const modalSubmit = (values: SubmitFeedback) => {
// console.log('modalSubmit -> values :>> ', values)
setSpinning(true)
postOrderDeliveryPlanConfirm({
id: Number(id),
isPass: values.isPass === 1,
remark: values.reason
}).then((res: any) => {
setSpinning(false)
if (res.code === 1000) history.goBack()
}).catch((err: any) => {
setSpinning(false)
})
}
useEffect(() => {
getDetails()
getExternalRoamRecordData()
}, [])
return (<Spin spinning={spinning}>
<AnchorPage
title={details?.name || '没有title'}
title={details?.planNo}
onBack={() => history.goBack()}
anchors={iAnchors}
extra={
......@@ -41,37 +184,36 @@ const DeliveryPlanCollaborationAwaitDetails: React.FC = () => {
</Steps>
</BaseInfo>
<BaseInfo className='mt-16' title={base_Info.name} id={base_Info.key}>
<BaseInfo.BaseInfoItem label={PlanNumber}>
DL2014070100001
</BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={SupplyMember}>
温州龙昌手袋有限公司
</BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={PlanSummary}>
2014-07-01~2014-07-31 广州白马皮具交易中心送货计划
</BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={PlanningCycle}>
2020-08-25 至 2020-10-25
</BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={PlanNumber}> {details?.planNo} </BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={SupplyMembersLabel}> {details?.vendorMemberName} </BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={PlanningCycle}> {moment(details?.planStartTime).format('YYYY-MM-DD')} ~ {moment(details?.planEndTime).format('YYYY-MM-DD')} </BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={PlanSummary}> {details?.digest} </BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={ExternalState}>
<Tag color='green'>已提交</Tag>
<Tag color={tagStatus.getTagStyle(details?.status).bgColor}>
<span style={{ color: tagStatus.getTagStyle(details?.status).fontColor }}>{statusTxt.get(details?.status)}</span>
</Tag>
</BaseInfo.BaseInfoItem>
</BaseInfo>
<BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}>
SRM计划送货物料, B2B计划送货商品
{/* B2B 显示计划送货物料,SRM显示计划送货商品 */}
<Table
// defaultExpandAllRows
rowKey={'skuId'}
columns={tableColumn}
expandable={{ expandedRowRender }}
dataSource={tableData}
tableLayout="fixed"
scroll={{ x: 2022 }}
/>
</BaseInfo>
<BaseInfo className='mt-16' title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
<Table
rowKey={'id'}
dataSource={[{
id: '1',
'name1': '1',
'name2': '操作角色',
'name3': '状态',
'name4': '操作',
'name5': '操作时间',
'name6': '备注',
},]}
dataSource={externalRoamRecordData}
columns={ExternalRoamRecordTableColumn}
/>
</BaseInfo>
......@@ -81,10 +223,10 @@ const DeliveryPlanCollaborationAwaitDetails: React.FC = () => {
visible={modalVisible}
defaultRadioValue={1}
radioGroup={[{ label: '确认', value: 1, isReason: false }, { label: '不确认', value: 2, isReason: true }]}
onSubmit={(values) => modalSubmint(values)}
onSubmit={(values) => modalSubmit(values)}
onCancel={(visible: boolean) => setModalVisible(visible)}
/>
</>)
</Spin>)
}
export default DeliveryPlanCollaborationAwaitDetails
\ No newline at end of file
......@@ -7,7 +7,7 @@ import React, { useRef } from 'react'
import { history } from 'umi'
import moment from 'moment'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { Button, Card, Space, Tag } from 'antd'
import { Card, Space, Tag } from 'antd'
import StandardTable from '@/components/StandardTable'
import { ColumnType } from 'antd/lib/table'
import TableOperation from '@/components/TableOperation'
......
......@@ -3,22 +3,159 @@
* @author: Gavin
* @description:
*/
import React, { useState } from 'react'
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import React, { useEffect, useState } from 'react'
import { history } from 'umi'
import { Button, Space, Steps, Table, Tag } from 'antd'
import { DeliveryPlanCollaborationAnchors, BaseInfo as base_Info, Circulation, ConfirmDeliveryPlan, ExternalRoamRecord, ExternalState, PlanMaterial, PlanningCycle, PlanNumber, PlanSummary, Purchaser, Remarks, SubmitDeliveryPlan, Supplier, SupplyMember, SupplyMembersLabel } from '../../constants'
import moment from 'moment'
import _ from 'lodash'
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import { Button, Space, Spin, Steps, Table, Tag } from 'antd'
import { CheckCircleOutlined } from '@ant-design/icons'
import BaseInfo from '@/components/BaseInfo/BaseInfo'
import { BaseInfo as base_Info, Circulation, ConfirmDeliveryPlan, ExternalRoamRecord, ExternalState, PlanMaterial, PlanningCycle, PlanNumber, PlanSummary, Purchaser, Remarks, SubmitDeliveryPlan, Supplier, SupplyMember, SupplyMembersLabel, PlannedDelivery } from '../../constants'
import { 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 { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage } 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 tagStatus = new TagStatus()
const statusTxt = new Map([[1, '待提交'], [2, '待确认'], [3, '待修订'], [4, '已确认'], [5, '已删除']])
const DeliveryPlanCollaborationDetails: React.FC = () => {
const [iAnchors, setiAnchors] = useState<AnchorsItem[]>(DeliveryPlanCollaborationAnchors)
const { location: { query: { ty, i } } } = history
// 1-B2B 2-SRM
const deliveryPlanType = godAtob(ty as string)
const id = godAtob(i as string)
const [iAnchors, setIAnchors] = useState<AnchorsItem[]>([
Circulation,
base_Info,
PlannedDelivery,
ExternalRoamRecord,
])
const [spinning, setSpinning] = useState<boolean>(false)
const [details, setDetails] = useState<any>({})
// 计划送货物 列表
const [tableData, setTableData] = useState<any>(null)
// 外部流转单据记录
const [externalRoamRecordData, setExternalRoamRecordData] = useState<any>(null)
// 动态 TableColumn
const [tableColumn, setTableColumn] = useState<any>([])
// 动态 expandIconColumn
const [expandIconColumn, setExpandIconColumn] = useState<any>([
{ ...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) => {
return <Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" />
}
// 计划周期 渲染日期
const handleDateAssembleColumn = (startDate: string, endDate: string) => {
const dates = getDayAll(moment(startDate).format('YYYY-MM-DD'), moment(endDate).format('YYYY-MM-DD'))
const datesColumn = dates.map((item, i) => ({ title: item.substr(1), dataIndex: item, key: item, width: 120, align: 'center', }))
const datesExpandIconColumn = dates.map((item, i) => ({
title: item.substr(1),
dataIndex: item,
key: item,
width: 80,
align: 'center',
render: (text: any, record: any) => (<span>{text?.planCount}</span>)
}))
const table_column = deliveryPlanType === '1' ? columnB2B : deliveryPlanType === '2' ? columnSRM : []
setTableColumn([...table_column, ...datesColumn])
setExpandIconColumn([...expandIconColumn, ...datesExpandIconColumn])
}
// 获取计划送货
const getPlannedDelivery = () => {
getOrderDeliveryPlanDetailProductPage({
id,
current: '1',
pageSize: '10'
}).then((res) => {
if (res.code === 1000) {
const assemble = res.data.data.map(item => {
return {
...item,
...integrationOjb(item.dayNumbers),
orders: item.orders.map(o => ({ ...o, ...integrationArrToObj(o.planDays) }))
}
})
setTableData(assemble)
}
})
}
// 获取详情
const getDetails = () => {
getOrderDeliveryPlanDetail({
id
}).then((res: any) => {
if (res.code === 1000) {
setDetails(res.data)
getPlannedDelivery()
handleDateAssembleColumn(res.data.planStartTime, res.data.planEndTime)
}
})
}
// 获取流转记录
const getExternalRoamRecordData = () => {
getOrderDeliveryPlanDeliveryHistory({ id }).then((res: any) => {
if (res.code === 1000 && !_.isEmpty(res.data)) {
setExternalRoamRecordData(res.data)
}
})
}
// 生成通知单
// 生成送货单
useEffect(() => {
getDetails()
getExternalRoamRecordData()
}, [])
return (
<Spin spinning={spinning}>
<AnchorPage
title={details?.name || '没有title'}
title={details?.planNo}
onBack={() => history.goBack()}
anchors={iAnchors}
extra={
......@@ -30,47 +167,47 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
}
>
<BaseInfo className='mt-0' title={Circulation.name} id={Circulation.key} cols={1}>
<Steps progressDot current={0}>
<Steps progressDot current={1}>
<Steps.Step title={Purchaser} description={SubmitDeliveryPlan} />
<Steps.Step title={Supplier} description={ConfirmDeliveryPlan} />
</Steps>
</BaseInfo>
<BaseInfo className='mt-16' title={base_Info.name} id={base_Info.key}>
<BaseInfo.BaseInfoItem label={PlanNumber}>
DL2014070100001
</BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={SupplyMember}>
温州龙昌手袋有限公司
</BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={PlanSummary}>
2014-07-01~2014-07-31 广州白马皮具交易中心送货计划
</BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={PlanningCycle}>
2020-08-25 至 2020-10-25
</BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={PlanNumber}> {details?.planNo} </BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={SupplyMembersLabel}> {details?.vendorMemberName} </BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={PlanningCycle}> {moment(details?.planStartTime).format('YYYY-MM-DD')} ~ {moment(details?.planEndTime).format('YYYY-MM-DD')} </BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={PlanSummary}> {details?.digest} </BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={ExternalState}>
<Tag color='green'>已提交</Tag>
<Tag color={tagStatus.getTagStyle(details?.status).bgColor}>
<span style={{ color: tagStatus.getTagStyle(details?.status).fontColor }}>{statusTxt.get(details?.status)}</span>
</Tag>
</BaseInfo.BaseInfoItem>
</BaseInfo>
<BaseInfo className='mt-16' title={PlanMaterial.name} id={PlanMaterial.key} cols={1}>
计划送货物料
{/* B2B 显示计划送货物料,SRM显示计划送货商品 */}
<Table
// defaultExpandAllRows
rowKey={'skuId'}
columns={tableColumn}
expandable={{ expandedRowRender }}
dataSource={tableData}
tableLayout="fixed"
scroll={{ x: 2022 }}
/>
</BaseInfo>
<BaseInfo className='mt-16' title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
<Table
rowKey={'id'}
dataSource={[{
id: '1',
'name1': '1',
'name2': '操作角色',
'name3': '状态',
'name4': '操作',
'name5': '操作时间',
'name6': '备注',
},]}
dataSource={externalRoamRecordData}
columns={ExternalRoamRecordTableColumn}
/>
</BaseInfo>
</AnchorPage>
</Spin>
)
}
......
......@@ -63,7 +63,7 @@ const DeliveryPlanCollaborationQuery: React.FC = () => {
...PlanNumberColumn,
dataIndex: 'planNo',
key: 'planNo',
render: (text: unknown, record: any) => <EyePreview url={`/memberCenter/order/deliveryPlanCollaboration/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}}`}>{text}</EyePreview>
render: (text: unknown, record: any) => <EyePreview url={`/memberCenter/order/deliveryPlanCollaboration/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}`}>{text}</EyePreview>
},
{ ...PlanSummaryColumn, dataIndex: 'digest', key: 'digest' },
{ ...PlannedStartDateColumn, dataIndex: 'planStartTime', key: 'planStartTime', render: (text: string, record: any) => (moment(text).format('YYYY-MM-DD')) },
......
......@@ -97,7 +97,7 @@ const DeliveryPlanManagementDetails: React.FC = () => {
setExpandIconColumn([...expandIconColumn, ...datesExpandIconColumn])
}
// 获取计划送货 物料
// 获取计划送货
const getPlannedDelivery = () => {
getOrderDeliveryPlanDetailProductPage({
id,
......@@ -139,7 +139,6 @@ const DeliveryPlanManagementDetails: React.FC = () => {
})
}
useEffect(() => {
getDetails()
getExternalRoamRecordData()
......
......@@ -57,7 +57,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
const [form] = Form.useForm()
const datesRef = useRef(null)
const materialTableDataRef = useRef(null)
const tableDataRef = useRef(null)
const [spinning, setSpinning] = useState<boolean>(false)
......@@ -97,12 +97,12 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
// 保存
const save = () => {
form.validateFields().then(values => {
if (_.isEmpty(materialTableDataRef.current)) {
if (_.isEmpty(tableDataRef.current)) {
message.warning('没有找到可执行计划送货')
return
}
setSpinning(true)
const orders = materialTableDataRef.current.flatMap((item: any) => item.orders).flatMap((o: any) => ({
const orders = tableDataRef.current.flatMap((item: any) => item.orders).flatMap((o: any) => ({
...o,
planDays: Object.keys(o).filter((f: any) => f.startsWith('$')).map((p: any) => o[p])
}))
......@@ -125,11 +125,11 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
// 对应日期填入的送货数量
const inputChange = (val: any, text: any, record: any) => {
let { day } = text
let dataArr = JSON.parse(JSON.stringify(materialTableDataRef.current))
let dataArr = JSON.parse(JSON.stringify(tableDataRef.current))
let index = dataArr.findIndex(f => f.skuId === record.skuId)
let childIndex = dataArr[index].orders.findIndex(f => f.orderProductId === record.orderProductId)
dataArr[index].orders[childIndex][`$${day}`].planCount = val
materialTableDataRef.current = dataArr
tableDataRef.current = dataArr
setTableData(dataArr)
}
......@@ -166,7 +166,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
orders: item.orders.map(o => ({ ...o, ...integrationArrToObj(o.planDays) }))
}
})
materialTableDataRef.current = assemble
tableDataRef.current = assemble
setTableData(assemble)
}
})
......
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