Commit a0e5646b authored by 许佳敏's avatar 许佳敏

Merge branch '20418order' into 'v2-220418'

显示字段不对,协同生成送货单单功能弥补 See merge request linkseeks-design/pro-platform!243
parents 00c2b088 b7c26878
......@@ -86,7 +86,6 @@ function AddressDrawer(props: AddressDrawerProps) {
} else if (showDefault) {
// 如果没有默认值,且设置了 showDefault
const target = data.find(v => v.isDefault === 1)
setValue(target)
onChange(target)
}
});
......
import { FormInstance } from "antd";
import { DeliveryNoteAddService, ReceivingNoteB2BAddService } from "../handles/HandleFormSubmit";
export enum DeliveryNoteAddType {
B2B = 1,
SRM = 2
}
export class DeliveryAddFactory {
static instance;
static getInstance(target: 'B2B' | 'SRM' = 'SRM') {
if (target === 'SRM') {
static getInstance(target: DeliveryNoteAddType = 2) {
if (target === DeliveryNoteAddType.SRM) {
return new DeliveryNoteAddService();
}
if (target === 'B2B') {
if (target === DeliveryNoteAddType.B2B) {
return new ReceivingNoteB2BAddService();
}
......
......@@ -79,48 +79,52 @@ export class HandleFormSubmit {
})
}
formatField(data) {
let formField = {
digest: data?.digest,
remark: data?.remark,
member: {
buyerMemberId: data?.buyerMemberName,
buyerMemberName: data?.buyerMemberName,
buyerRoleId: data?.vendorMemberId,
roleType: 2,
name: data?.buyerMemberName
},
deliveryTime: data?.deliveryTime ? moment(data?.deliveryTime) : moment().startOf('day'),
deliveryRangeTime: [
moment().startOf('day'),
moment().endOf('day')
],
deliveryVO: {
...data?.deliverVO,
shipperName: data?.deliverVO.consignee,
fullAddress: data?.deliverVO.provinceName + data?.deliverVO.cityName + data?.deliverVO.districtName + data?.deliverVO.streetName ?? ''
},
receiveVO: {
...data?.receiverBO,
receiverName: data?.receiverBO.consignee,
fullAddress: data?.receiverBO.provinceName + data?.receiverBO.cityName + data?.receiverBO.districtName + data?.receiverBO.streetName ?? ''
},
"executorVO.phone": data?.executorVO.phone,
sendTime: moment(data?.sendTime),
"executorVO.carNumbers": data?.executorVO.carNumbers,
"receiverBO.phone": data?.receiverBO.phone,
logisticsNo: data?.logisticsNo,
logisticsCompanyInt: {
label: data?.logisticsCompany,
value: data?.logisticsCompanyId
},
outerHistoryList: data?.outerHistoryList,
deliveryNo: data?.deliveryNo
}
return formField
}
getDetailById(id: string) {
///order/delivery/order/detail
return getOrderDeliveryOrderDetail({ id }).then(res => {
const data = res.data
let formField = {
digest: data.digest,
remark: data.remark,
member: {
buyerMemberId: data.buyerMemberId,
buyerMemberName: data.buyerMemberName,
buyerRoleId: data.buyerRoleId,
roleType: 2,
name: data.buyerMemberName
},
deliveryTime: moment(data.deliveryTime),
deliveryRangeTime: [
moment("1990-10-10 " + data.deliveryStartTime),
moment("1990-10-10 " + data.deliveryEndTime),
],
deliveryVO: {
...data.deliverVO,
shipperName: data.deliverVO.consignee,
fullAddress: data.deliverVO.provinceName + data.deliverVO.cityName + data.deliverVO.districtName + data.deliverVO.streetName ?? ''
},
receiveVO: {
...data.receiverBO,
receiverName: data.receiverBO.consignee,
fullAddress: data.receiverBO.provinceName + data.receiverBO.cityName + data.receiverBO.districtName + data.receiverBO.streetName ?? ''
},
deliveryType: data.deliveryType,
"executorVO.phone": data.executorVO.phone,
sendTime: moment(data.sendTime),
"executorVO.carNumbers": data.executorVO.carNumbers,
"receiverBO.phone": data.receiverBO.phone,
logisticsNo: data.logisticsNo,
logisticsCompanyInt: {
label: data.logisticsCompany,
value: data.logisticsCompanyId
},
outerHistoryList: data.outerHistoryList,
deliveryNo: data.deliveryNo
}
let formField = this.formatField(data);
return formField
})
}
......
......@@ -24,6 +24,8 @@ import LogisticsCompanyMerchantsSelect from '@/components/LogisticsCompanySelect
import { values } from 'lodash';
import { DeliveryNumColumn, OrderNumColumn } from '../../constants/table-column';
import { DeliveryAddFactory } from '../../assets/factory/DeliveryAddFactory';
import { useLocation } from 'umi';
import { SourceTypeEnum } from '../../constants/SourceTypeEnum';
const ContentBoxItem = ContentBox.BaseInfoItem;
......@@ -33,8 +35,11 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
const [tableDataSource, setTableDataSource] = useState();
const [form] = Form.useForm()
const service = DeliveryAddFactory.getInstance('SRM');
const location = useLocation()
const { time, ot } = (location as any).query
const service = DeliveryAddFactory.getInstance(Number(ot));
service.setForm(form)
const [anchors, setAnchors] = useState<AnchorsItem[]>([
BaseInfo,
......@@ -45,13 +50,18 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
])
useEffect(() => {
const DELIVERY_NOTICE_PATH: any = JSON.parse(localStorage.getItem('DELIVERY_NOTICE_PATH'))
const data = DELIVERY_NOTICE_PATH?.time
let formFeils = service.formatField(data)
form.setFieldsValue({
sourceType: 0,
deliveryRangeTime: [
moment().startOf('day').add('hour', 8),
moment().startOf('day').add('hour', 12)
]
sourceType: SourceTypeEnum.PlanAdd,
...formFeils
})
}, [])
const handleSubmit = useCallback(() => {
......@@ -87,7 +97,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<Form
form={form}
>
<FormItem name="sourceType">
<FormItem hidden name="sourceType">
<Input type="hidden" />
</FormItem>
......@@ -127,7 +137,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
required()
]}
label={DeliveryDate} name="deliveryTime">
<DatePickerSelect defualtToday={true} className='w-full' />
<DatePickerSelect disabled={true} defualtToday={true} className='w-full' />
</FormItem>
<FormItem
......
......@@ -3,11 +3,11 @@
* @author: Gavin
* @description:
*/
import React, { useRef } from 'react'
import { history } from 'umi'
import moment from 'moment'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { Card, Space, Tag } from 'antd'
import React, { useRef } from 'react'
import { history } from 'umi'
import moment from 'moment'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { Card, Space, Tag } from 'antd'
import StandardTable from '@/components/StandardTable'
import { ColumnType } from 'antd/lib/table'
import TableOperation from '@/components/TableOperation'
......@@ -23,7 +23,7 @@ import { getOrderDeliveryPlanVendorPage } from '@/services/OrderNewV2Api'
const tagStatus = new TagStatus()
const statusTxt = new Map([[1, '待提交'], [2, '待确认'], [3, '待修订'],[4,'已确认'],[5,'已删除']])
const statusTxt = new Map([[1, '待提交'], [2, '待确认'], [3, '待修订'], [4, '已确认'], [5, '已删除']])
const DeliveryPlanCollaborationQuery: React.FC = () => {
const ref = useRef<any>({})
......@@ -47,8 +47,12 @@ const DeliveryPlanCollaborationQuery: React.FC = () => {
}
const operationHandler = {
'查看': () => history.push(`/memberCenter/order/deliveryPlanCollaboration/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}`),
'生成送货通知单': () => { console.log('生成送货通知单 :>> ',) },
'生成送货单': () => { console.log('生成送货通知单 :>> ',) },
'生成送货通知单': () => {
history.push(`/memberCenter/order/deliveryPlanCollaboration/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}`)
},
'生成送货单': () => {
history.push(`/memberCenter/order/deliveryPlanCollaboration/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}`)
},
}
return (
<TableOperation
......@@ -66,7 +70,7 @@ const DeliveryPlanCollaborationQuery: React.FC = () => {
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')) },
{ ...PlannedStartDateColumn, dataIndex: 'planStartTime', key: 'planStartTime', render: (text: string, record: any) => (moment(text).format('YYYY-MM-DD')) },
{ ...PlannedEndDateColumn, dataIndex: 'planEndTime', key: 'planEndTime', render: (text: string, record: any) => (moment(text).format('YYYY-MM-DD')) },
{ ...SupplyMemberColumn, dataIndex: 'memberName', key: 'memberName' },
{
......@@ -102,7 +106,7 @@ const DeliveryPlanCollaborationQuery: React.FC = () => {
return (
<PageHeaderWrapper>
<Card>
<Card>
<StandardTable
// keepAlive={false}
currentRef={ref}
......
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