Commit e303e9b6 authored by Gavin Peng's avatar Gavin Peng

fix: 修复计划送货协同bug

parent 6cb72ac5
......@@ -61,6 +61,9 @@ export const DeliveryPlanRemark = '最长600个字符,300个汉字'
export const CreateDeliveryPlanTitleSRM = '新增送货计划(SRM)'
export const CreateDeliveryPlanTitleB2B = '新增送货计划(B2B)'
export const NoticeGenerated = '生成送货通知单'
export const DeliveryNoteGenerated = '生成送货单'
export const AlreadyNoticeGenerated = '已生成送货通知单'
export const AlreadyDeliveryNoteGenerated = '已生成送货单'
......
......@@ -10,7 +10,7 @@ import _ from 'lodash'
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import { Button, Space, Spin, Steps, Table, Tag } from 'antd'
import { CaretDownOutlined, CaretRightOutlined, CheckCircleOutlined } from '@ant-design/icons'
import { Circulation, BaseInfo as base_Info, Purchaser, SubmitDeliveryPlan, Supplier, ConfirmDeliveryPlan, PlanNumber, SupplyMember, PlanSummary, PlanningCycle, ExternalState, PlannedDelivery, ExternalRoamRecord, SupplyMembersLabel, } from '../../constants'
import { Circulation, BaseInfo as base_Info, Purchaser, SubmitDeliveryPlan, Supplier, ConfirmDeliveryPlan, PlanNumber, PlanSummary, PlanningCycle, ExternalState, PlannedDelivery, BuyerLabel, } from '../../constants'
import BaseInfo from '@/components/BaseInfo/BaseInfo'
import { columnB2B, columnSRM, ExternalRoamRecordTableColumn, initExpandIconColumn } from '../../constants/page-table-column'
import CustomizedModal, { SubmitFeedback } from '../../components/customizedModal'
......@@ -32,7 +32,6 @@ const DeliveryPlanCollaborationAwaitDetails: React.FC = () => {
Circulation,
base_Info,
PlannedDelivery,
ExternalRoamRecord,
])
const [spinning, setSpinning] = useState<boolean>(false)
......@@ -123,7 +122,7 @@ const DeliveryPlanCollaborationAwaitDetails: React.FC = () => {
return (<Spin spinning={spinning}>
<AnchorPage
title={details?.planNo}
title={`${details?.digest} | ${details?.planNo}`}
onBack={() => history.goBack()}
anchors={iAnchors}
extra={
......@@ -147,14 +146,14 @@ const DeliveryPlanCollaborationAwaitDetails: React.FC = () => {
}
>
<Steps progressDot current={details?.outerStatus - 1}>
<Steps.Step title={Purchaser} description={SubmitDeliveryPlan} />
<Steps.Step title={Supplier} description={ConfirmDeliveryPlan} />
<Steps.Step title={SubmitDeliveryPlan} description={Purchaser} />
<Steps.Step title={ConfirmDeliveryPlan} description={Supplier} />
</Steps>
</BaseInfo>
<BaseInfo className='mt-16' title={base_Info.name} id={base_Info.key}>
<BaseInfo.BaseInfoItem label={PlanNumber}> {details?.planNo} </BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={SupplyMembersLabel}> {details?.vendorMemberName} </BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={BuyerLabel}> {details?.vendorMemberName} </BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={PlanSummary}> {details?.digest} </BaseInfo.BaseInfoItem>
......
......@@ -8,11 +8,11 @@ import { history } from 'umi'
import moment from 'moment'
import _ from 'lodash'
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import { Badge, Button, message, Modal, Space, Spin, Steps, Table, Tag, Tooltip } from 'antd'
import { Button, message, Space, Spin, Steps, Table, Tag } from 'antd'
import { CaretDownOutlined, CaretRightOutlined, CheckCircleOutlined } from '@ant-design/icons'
import BaseInfo from '@/components/BaseInfo/BaseInfo'
import CalendarModal from '../../components/CalendarModal'
import { BaseInfo as base_Info, Circulation, ConfirmDeliveryPlan, ExternalRoamRecord, ExternalState, PlanMaterial, PlanningCycle, PlanNumber, PlanSummary, Purchaser, Remarks, SubmitDeliveryPlan, Supplier, SupplyMember, SupplyMembersLabel, PlannedDelivery, AlreadyNoticeGenerated, AlreadyDeliveryNoteGenerated } from '../../constants'
import { BaseInfo as base_Info, Circulation, ConfirmDeliveryPlan, ExternalState, PlanMaterial, PlanningCycle, PlanNumber, PlanSummary, Purchaser, SubmitDeliveryPlan, Supplier, SupplyMembersLabel, PlannedDelivery, BuyerLabel, DeliveryNoteGenerated, NoticeGenerated } from '../../constants'
import { columnB2B, columnSRM, ExternalRoamRecordTableColumn, initExpandIconColumn } from '../../constants/page-table-column'
import { getDayAll, godAtob, integrationArrToObj, integrationOjb, newMapValues, TagStatus } from '../../utils'
import { getOrderDeliveryPlanDeliveryHistory, getOrderDeliveryPlanDeliveryOrder, getOrderDeliveryPlanDetail, getOrderDeliveryPlanDetailProductPage, getOrderDeliveryPlanNoticeOrder } from '@/services/OrderNewV2Api'
......@@ -36,7 +36,7 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
const [iAnchors, setIAnchors] = useState<AnchorsItem[]>([
Circulation,
base_Info,
PlannedDelivery,
deliveryPlanType === '1' ? PlannedDelivery : PlanMaterial,
])
const [spinning, setSpinning] = useState<boolean>(false)
......@@ -51,13 +51,12 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
// 动态 expandIconColumn
const [expandIconColumn, setExpandIconColumn] = useState<any>(initExpandIconColumn)
const expandIconRowSelection = (skuId: string) => {
const expandIconRowSelection = (planProductId: string) => {
return {
onChange: (selectedRowKeys: React.Key[], selectedRows: any[]) => {
// TODO 挂坑 ---> 父级rowKey(skuId)由于数据返回可能不是唯一值, 后续可能出现重复
// console.log(`expandIconRowSelection -> selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
// console.log('selectedRowKeys :>> ', skuId, '====>', selectedRowKeys)
selectedTableItem.set(skuId, selectedRowKeys)
selectedTableItem.set(planProductId, selectedRowKeys)
},
}
}
......@@ -70,7 +69,7 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
dataSource={record.orders}
pagination={false}
tableLayout="fixed"
rowSelection={expandIconRowSelection(record.skuId)}
rowSelection={expandIconRowSelection(record.planProductId)}
/>
</div>
}
......@@ -97,7 +96,7 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
getOrderDeliveryPlanDetailProductPage({
id,
current: '1',
pageSize: '10'
pageSize: '999'
}).then((res) => {
if (res.code === 1000) {
const assemble = res.data.data.map(item => {
......@@ -205,7 +204,7 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
return (
<Spin spinning={spinning}>
<AnchorPage
title={details?.planNo}
title={ `${details?.digest} | ${details?.planNo}`}
onBack={() => history.goBack()}
anchors={iAnchors}
extra={
......@@ -213,9 +212,9 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
{/* 条件渲染 */}
{
pageBtn === 'notice'
? <Button type='primary' icon={<CheckCircleOutlined />} onClick={() => handleSubmitVerify('Notice')}>生成送货通知单</Button>
? <Button type='primary' icon={<CheckCircleOutlined />} onClick={() => handleSubmitVerify('Notice')}>{NoticeGenerated}</Button>
: pageBtn === 'deliveryNote'
? <Button type='primary' icon={<CheckCircleOutlined />} onClick={() => handleSubmitVerify('DeliveryNote')}>生成送货单</Button>
? <Button type='primary' icon={<CheckCircleOutlined />} onClick={() => handleSubmitVerify('DeliveryNote')}>{DeliveryNoteGenerated}</Button>
: null
}
</Space>
......@@ -235,26 +234,26 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
}
>
<Steps progressDot current={details?.status === 4 ? 1 : 0}>
<Steps.Step title={Purchaser} description={SubmitDeliveryPlan} />
<Steps.Step title={Supplier} description={ConfirmDeliveryPlan} />
<Steps.Step title={SubmitDeliveryPlan} description={Purchaser} />
<Steps.Step title={ConfirmDeliveryPlan} description={Supplier} />
</Steps>
</BaseInfo>
<BaseInfo className='mt-16' title={base_Info.name} id={base_Info.key}>
<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={BuyerLabel}> {details?.vendorMemberName} </BaseInfo.BaseInfoItem>
<BaseInfo.BaseInfoItem label={PlanSummary}> {details?.digest} </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={ExternalState}>
<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}>
<BaseInfo className='mt-16' title={deliveryPlanType === '1' ? PlannedDelivery.name : PlanMaterial.name} id={deliveryPlanType === '1' ? PlannedDelivery.key : PlanMaterial.key} cols={1}>
{/* B2B 显示计划送货物料,SRM显示计划送货商品 */}
<Table
// defaultExpandAllRows
......
......@@ -108,7 +108,7 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
return (<>
<AnchorPage
title={`${details?.digest}|${details?.planNo}`}
title={`${details?.digest} | ${details?.planNo}`}
onBack={() => history.goBack()}
anchors={iAnchors}
>
......
......@@ -227,7 +227,7 @@ const DeliveryPlanAwaitSRMCreate: React.FC = () => {
label={PlanSummary}
name='planSummaryText'
rules={[
{ required: false, message: '请选择' }
{ required: true, message: '请选择' }
]}
>
<Input />
......
......@@ -102,7 +102,7 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => {
return (
<AnchorPage
title={`${details?.digest}|${details?.planNo}`}
title={`${details?.digest} | ${details?.planNo}`}
onBack={() => history.goBack()}
anchors={iAnchors}
>
......
......@@ -169,7 +169,7 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => {
return (
<Spin spinning={spinning}>
<AnchorPage
title={`${details?.digest}|${details?.planNo}`}
title={`${details?.digest} | ${details?.planNo}`}
onBack={() => history.goBack()}
anchors={iAnchors}
extra={
......
......@@ -106,7 +106,7 @@ const DeliveryPlanManagementDetails: React.FC = () => {
return (
<AnchorPage
title={`${details?.digest}|${details?.planNo}`}
title={`${details?.digest} | ${details?.planNo}`}
onBack={() => history.goBack()}
anchors={iAnchors}
>
......
......@@ -169,7 +169,7 @@ const DeliveryPlanManagementUpdate: React.FC = () => {
return (
<Spin spinning={spinning}>
<AnchorPage
title={`${details?.digest}|${details?.planNo}`}
title={`${details?.digest} | ${details?.planNo}`}
onBack={() => history.goBack()}
anchors={iAnchors}
extra={
......
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