Commit 5643a576 authored by rainbowmorel@163.com's avatar rainbowmorel@163.com

收货地址和发货地址修改

parent b709593a
......@@ -83,14 +83,14 @@ const DeliveryNotice = [
hideInMenu: true,
noMargin: true,
},
{
path: '/memberCenter/order/deliveryNotice/synergy/create',
name: '新增送货单(协同)',
component: '@/pages/order/deliveryNotice/synergy/add',
component: '@/pages/order/deliveryNotice/create/add',
hideInMenu: true,
noMargin: true,
}
},
]
}
]
......
......@@ -41,7 +41,9 @@ function AddressDrawer(props: AddressDrawerProps) {
const { onChange, formInstance, renderForm, sumbitRequest,
addressListRequest, value: addr, disabled = false, rows = 1,
showDefault = false,
formatValue = (addr) => `${addr?.fullAddress ?? ''} ${addr?.shipperName ? addr?.shipperName : addr?.receiverName ?? ''} ${addr?.phone ?? ''}`
formatValue = (addr) => {
return `${addr?.fullAddress ?? ''} ${addr?.shipperName ? addr?.shipperName ?? '' : addr?.receiverName ?? ''} ${addr?.phone ?? ''}`
}
} = props;
const [visible, setVisible] = useState<boolean>(false);
......
......@@ -97,23 +97,23 @@ export class HandleFormSubmit {
],
deliveryVO: {
...data?.deliverVO,
shipperName: data?.deliverVO.consignee,
fullAddress: data?.deliverVO.provinceName + data?.deliverVO.cityName + data?.deliverVO.districtName + data?.deliverVO.streetName ?? ''
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 ?? ''
receiverName: data?.receiverBO?.consignee,
fullAddress: `${data?.receiverBO?.provinceName ?? ''}${data?.receiverBO?.cityName ?? ''}${data?.receiverBO?.districtName??''}${data?.receiverBO?.streetName ?? ''}`
},
executorVO: {
...data?.executorVO,
receiverName: data?.executorVO.consignee,
fullAddress: data?.executorVO.provinceName + data?.executorVO.cityName + data?.executorVO.districtName + data?.executorVO.streetName ?? ''
receiverName: data?.executorVO?.consignee,
fullAddress: data?.executorVO?.provinceName ?? '' + data?.executorVO?.cityName ?? '' + data?.executorVO?.districtName ?? '' + data?.executorVO?.streetName ?? ''
},
"executorVO.phone": data?.executorVO.phone,
sendTime: moment(data?.sendTime),
"executorVO.carNumbers": data?.executorVO.carNumbers,
"receiverBO.phone": data?.receiverBO.phone,
"executorVO.phone": data?.executorVO?.phone,
sendTime: data?.sendTime ? moment(data?.sendTime) : moment().startOf('day'),
"executorVO.carNumbers": data?.executorVO?.carNumbers,
"receiverBO.phone": data?.receiverBO?.phone,
logisticsNo: data?.logisticsNo,
logisticsCompanyInt: {
label: data?.logisticsCompany,
......@@ -122,6 +122,8 @@ export class HandleFormSubmit {
outerHistoryList: data?.outerHistoryList,
deliveryNo: data?.deliveryNo
}
console.log(formField);
return formField
}
......@@ -285,7 +287,7 @@ export class ReceiveOrderCreate extends DeliveryNoteAddService {
})
}
formatField(data) {
formatField(data): any {
let formField = {
digest: data.digest,
remark: data.remark,
......@@ -303,13 +305,13 @@ export class ReceiveOrderCreate extends DeliveryNoteAddService {
],
deliveryVO: {
...data.deliverVO,
shipperName: data.deliverVO.consignee,
fullAddress: data.deliverVO.provinceName + data.deliverVO.cityName + data.deliverVO.districtName + data.deliverVO.streetName ?? ''
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 ?? ''
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),
......
......@@ -5,30 +5,24 @@
*/
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import React, { useCallback, useEffect, useState, useContext } from 'react'
import { BaseInfo, BillsInfo, BuyerLabel, ConsigneeLabel, ConsigneePhoneLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryAddrLabel, DeliveryDate, DeliveryDateLabel, DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryNoLabel, DeliveryPhoneLabel, DeliverySlefAddrLabel, DeliveryTime, DeliveryTimeLabel, DeliveryTypeLabel, Distribution, LogisticsCarNoLabel, LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, NoteLabel, OutStatusLabel, ReceivingAddress } from '../../constants'
import { BaseInfo, BuyerLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryDate, DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryPhoneLabel, DeliveryTime, DeliveryTimeLabel, DeliveryTypeLabel, Distribution, LogisticsCarNoLabel, LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, NoteLabel, ReceivingAddress } from '../../constants'
import { BaseInfo as ContentBox } from '@/components/BaseInfo'
import { Input, Table, Row, Col, Select, Radio, Form, Button, Modal } from 'antd';
import { Input, Table, Radio, Form, Button, Modal } from 'antd';
import { DeliveryNoticeTableColumn } from '../../constants/page-table-column';
import { FormItem, required } from '@/components/FormItem';
import { DatePickerSelect } from '@/components/DatePickerSelect'
import { AddressDrawer } from '@/components/AddressDrawer';
import { getLogisticsSelectListReceiverAddress, getLogisticsSelectListShipperAddress, postLogisticsReceiverAddressAdd, postLogisticsReceiverAddressUpdate, postLogisticsShipperAddressAdd, postLogisticsShipperAddressUpdate } from '@/services/LogisticsV2Api';
import DeliveryGoodTableSelect from '../../components/DeliveryGoodTableSelect/DeliveryGoodTableSelect';
import { HarvestMaterialContextProvider, HarvestMaterialContext, HarvestMaterialInput } from '../../assets/context';
import moment from 'moment';
import { HandelFormFieldsKeyValue } from '@/utils/form';
import { DeliveryNoteAddService } from '../../assets/handles/HandleFormSubmit';
import { HarvestMaterialContextProvider, HarvestMaterialInput } from '../../assets/context';
import { RoleSelect } from '@/components/RoleSelect';
import DeliveryNoticeOrderFactory from '../../assets/handles/DeliveryNoticeOrder';
import LogisticsCompanyMerchantsSelect from '@/components/LogisticsCompanySelect/LogisticsCompanyMerchantsSelect';
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;
const DeliveryNoticeManageSRMDetails: React.FC = () => {
......@@ -53,7 +47,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
const DELIVERY_NOTICE_PATH: any = JSON.parse(localStorage.getItem('DELIVERY_NOTICE_PATH'))
const data = DELIVERY_NOTICE_PATH?.time
const data = DELIVERY_NOTICE_PATH[time]
let formFeils = service.formatField(data)
......@@ -86,7 +80,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
return (
<AnchorPage title="送货单管理新增(SRM)"
<AnchorPage title="送货单管理新增"
anchors={anchors}
extra={
<Button.Group>
......@@ -164,6 +158,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
})
}}
/>
</FormItem>
<FormItem
......@@ -199,6 +194,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
]}
label={ReceivingAddress} name="receiveVO">
<AddressDrawer
addressListRequest={(val) => {
return getLogisticsSelectListShipperAddress(val)
}}
......@@ -211,6 +207,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
}
}}
/>
</FormItem>
</ContentBox>
......@@ -241,7 +238,6 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
</FormItem>
</ContentBox>
<ContentBox title={DeliveryGood.name} id={DeliveryGood.key} cols={1}>
{/* 在编辑的时候不需要进行此操作 */}
<DeliveryGoodTableSelect
......
......@@ -135,20 +135,19 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
]}
label={DeliveryNameLabel} name="executorVO">
<AddressDrawer
showDefault={true}
formatValue={addrFormatValue}
addressListRequest={(val) => {
return getLogisticsSelectListReceiverAddress(val)
return getLogisticsSelectListShipperAddress(val)
}}
sumbitRequest={{
update: (val) => {
return postLogisticsReceiverAddressUpdate(val)
return postLogisticsShipperAddressUpdate(val)
},
add: (val) => {
return postLogisticsReceiverAddressAdd(val)
return postLogisticsShipperAddressAdd(val)
}
}}
/>
</FormItem>
<FormItem
......@@ -185,18 +184,21 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
label={ReceivingAddress} name="receiveVO">
<AddressDrawer
disabled={false}
showDefault={true}
formatValue={addrFormatValue}
addressListRequest={(val) => {
return getLogisticsSelectListShipperAddress(val)
return getLogisticsSelectListReceiverAddress(val)
}}
sumbitRequest={{
update: (val) => {
return postLogisticsShipperAddressUpdate(val)
return postLogisticsReceiverAddressUpdate(val)
},
add: (val) => {
return postLogisticsShipperAddressAdd(val)
return postLogisticsReceiverAddressAdd(val)
}
}}
/>
</FormItem>
</ContentBox>
......
......@@ -142,16 +142,16 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
]}
label={DeliveryNameLabel} name="executorVO">
<AddressDrawer
formatValue={addrFormatValue}
disabled={true}
addressListRequest={(val) => {
return getLogisticsSelectListReceiverAddress(val)
return getLogisticsSelectListShipperAddress(val)
}}
sumbitRequest={{
update: (val) => {
return postLogisticsReceiverAddressUpdate(val)
return postLogisticsShipperAddressUpdate(val)
},
add: (val) => {
return postLogisticsReceiverAddressAdd(val)
return postLogisticsShipperAddressAdd(val)
}
}}
/>
......@@ -185,19 +185,21 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
]}
label={ReceivingAddress} name="receiveVO">
<AddressDrawer
disabled={true}
disabled={false}
formatValue={addrFormatValue}
addressListRequest={(val) => {
return getLogisticsSelectListShipperAddress(val)
return getLogisticsSelectListReceiverAddress(val)
}}
sumbitRequest={{
update: (val) => {
return postLogisticsShipperAddressUpdate(val)
return postLogisticsReceiverAddressUpdate(val)
},
add: (val) => {
return postLogisticsShipperAddressAdd(val)
return postLogisticsReceiverAddressAdd(val)
}
}}
/>
</FormItem>
</ContentBox>
......
......@@ -134,20 +134,19 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
]}
label={DeliveryNameLabel} name="executorVO">
<AddressDrawer
showDefault={true}
formatValue={addrFormatValue}
addressListRequest={(val) => {
return getLogisticsSelectListReceiverAddress(val)
return getLogisticsSelectListShipperAddress(val)
}}
sumbitRequest={{
update: (val) => {
return postLogisticsReceiverAddressUpdate(val)
return postLogisticsShipperAddressUpdate(val)
},
add: (val) => {
return postLogisticsReceiverAddressAdd(val)
return postLogisticsShipperAddressAdd(val)
}
}}
/>
</FormItem>
<FormItem
......@@ -183,15 +182,18 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
]}
label={ReceivingAddress} name="receiveVO">
<AddressDrawer
disabled={false}
showDefault={true}
formatValue={addrFormatValue}
addressListRequest={(val) => {
return getLogisticsSelectListShipperAddress(val)
return getLogisticsSelectListReceiverAddress(val)
}}
sumbitRequest={{
update: (val) => {
return postLogisticsShipperAddressUpdate(val)
return postLogisticsReceiverAddressUpdate(val)
},
add: (val) => {
return postLogisticsShipperAddressAdd(val)
return postLogisticsReceiverAddressAdd(val)
}
}}
/>
......
......@@ -64,7 +64,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
Modal.confirm({
title: "提示",
content:"确认送货单资料填写是否正确,提交后不能再撤回!",
content: "确认送货单资料填写是否正确,提交后不能再撤回!",
onOk: () => {
service.setTableData(tableDataSource);
service.submit().then(res => {
......@@ -135,7 +135,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
required()
]}
label={DeliveryDateLabel} name="deliveryTime">
<DatePickerSelect disabled={true} className='w-full' />
<DatePickerSelect disabled={true} className='w-full' />
</FormItem>
<FormItem
......@@ -144,16 +144,15 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
]}
label={DeliveryNameLabel} name="executorVO">
<AddressDrawer
formatValue={addrFormatValue}
addressListRequest={(val) => {
return getLogisticsSelectListReceiverAddress(val)
return getLogisticsSelectListShipperAddress(val)
}}
sumbitRequest={{
update: (val) => {
return postLogisticsReceiverAddressUpdate(val)
return postLogisticsShipperAddressUpdate(val)
},
add: (val) => {
return postLogisticsReceiverAddressAdd(val)
return postLogisticsShipperAddressAdd(val)
}
}}
/>
......@@ -188,18 +187,20 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
label={ReceivingAddress} name="receiveVO">
<AddressDrawer
disabled={true}
formatValue={addrFormatValue}
addressListRequest={(val) => {
return getLogisticsSelectListShipperAddress(val)
return getLogisticsSelectListReceiverAddress(val)
}}
sumbitRequest={{
update: (val) => {
return postLogisticsShipperAddressUpdate(val)
return postLogisticsReceiverAddressUpdate(val)
},
add: (val) => {
return postLogisticsShipperAddressAdd(val)
return postLogisticsReceiverAddressAdd(val)
}
}}
/>
</FormItem>
</ContentBox>
......
......@@ -135,24 +135,26 @@ function DeliveryNoticeFromCreate() {
required()
]}
label={DeliveryNameLabel} name="deliveryVO">
<AddressDrawer
addressListRequest={(val) => {
return getLogisticsSelectListShipperAddress(val)
}}
onChange={(v) => {
form.setFieldsValue({
"executorVO.phone": v.phone
})
}}
addressListRequest={(val) => {
return getLogisticsSelectListReceiverAddress(val)
}}
sumbitRequest={{
update: (val) => {
return postLogisticsReceiverAddressUpdate(val)
return postLogisticsShipperAddressUpdate(val)
},
add: (val) => {
return postLogisticsReceiverAddressAdd(val)
return postLogisticsShipperAddressAdd(val)
}
}}
/>
</FormItem>
<FormItem
......@@ -190,17 +192,18 @@ function DeliveryNoticeFromCreate() {
<AddressDrawer
disabled={false}
addressListRequest={(val) => {
return getLogisticsSelectListShipperAddress(val)
return getLogisticsSelectListReceiverAddress(val)
}}
sumbitRequest={{
update: (val) => {
return postLogisticsShipperAddressUpdate(val)
return postLogisticsReceiverAddressUpdate(val)
},
add: (val) => {
return postLogisticsShipperAddressAdd(val)
return postLogisticsReceiverAddressAdd(val)
}
}}
/>
</FormItem>
</ContentBox>
......
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