Commit 192106ee authored by rainbowmorel@163.com's avatar rainbowmorel@163.com

修复一些BUG

parent 93c11a40
...@@ -29,6 +29,7 @@ const DeliveryNotice = [ ...@@ -29,6 +29,7 @@ const DeliveryNotice = [
hideInMenu: true, hideInMenu: true,
noMargin: true noMargin: true
}, },
{ {
/** 送货单编辑SRM*/ /** 送货单编辑SRM*/
path: '/memberCenter/order/deliveryNotice/manageSRM/edit', path: '/memberCenter/order/deliveryNotice/manageSRM/edit',
...@@ -38,7 +39,6 @@ const DeliveryNotice = [ ...@@ -38,7 +39,6 @@ const DeliveryNotice = [
noMargin: true noMargin: true
}, },
{ {
/** 送货单管理B2B*/ /** 送货单管理B2B*/
path: '/memberCenter/order/deliveryNotice/manageB2B', path: '/memberCenter/order/deliveryNotice/manageB2B',
...@@ -69,8 +69,6 @@ const DeliveryNotice = [ ...@@ -69,8 +69,6 @@ const DeliveryNotice = [
hideInMenu: true, hideInMenu: true,
noMargin: true noMargin: true
}, },
{ {
/** 收货单查询*/ /** 收货单查询*/
path: '/memberCenter/order/deliveryNotice/receivingNoteQuery', path: '/memberCenter/order/deliveryNotice/receivingNoteQuery',
...@@ -85,6 +83,14 @@ const DeliveryNotice = [ ...@@ -85,6 +83,14 @@ const DeliveryNotice = [
hideInMenu: true, hideInMenu: true,
noMargin: true, noMargin: true,
}, },
{
path: '/memberCenter/order/deliveryNotice/synergy/create',
name: '新增送货单(协同)',
component: '@/pages/order/deliveryNotice/synergy/add',
hideInMenu: true,
noMargin: true,
}
] ]
} }
] ]
......
...@@ -33,13 +33,15 @@ interface AddressDrawerProps { ...@@ -33,13 +33,15 @@ interface AddressDrawerProps {
disabled?: boolean disabled?: boolean
rows?: number rows?: number
showDefault?: boolean showDefault?: boolean
formatValue?: (value) => string
} }
function AddressDrawer(props: AddressDrawerProps) { function AddressDrawer(props: AddressDrawerProps) {
const { onChange, formInstance, renderForm, sumbitRequest, const { onChange, formInstance, renderForm, sumbitRequest,
addressListRequest, value: addr, disabled = false, rows = 1, addressListRequest, value: addr, disabled = false, rows = 1,
showDefault = false showDefault = false,
formatValue = (addr) => `${addr?.fullAddress ?? ''} ${addr?.shipperName ? addr?.shipperName : addr?.receiverName ?? ''} ${addr?.phone ?? ''}`
} = props; } = props;
const [visible, setVisible] = useState<boolean>(false); const [visible, setVisible] = useState<boolean>(false);
...@@ -50,11 +52,11 @@ function AddressDrawer(props: AddressDrawerProps) { ...@@ -50,11 +52,11 @@ function AddressDrawer(props: AddressDrawerProps) {
const handleInputChangeHooks = debounceFn((str) => { const handleInputChangeHooks = debounceFn((str) => {
const val: string = str const val: string = str
const reg = /.+?(省|市|自治区|自治州|镇|县|区)/g; const reg = /.+?(省|市|自治区|自治州|镇|县|区)/g;
const maths = val.match(reg); const maths = val.match(reg);
if (maths && maths.length >= 3) { if (maths && maths.length >= 3) {
//至少 拥有省市区 才进行处理 //至少 拥有省市区 才进行处理
const slice: string = maths[maths.length - 1]; const slice: string = maths[maths.length - 1];
...@@ -70,7 +72,7 @@ function AddressDrawer(props: AddressDrawerProps) { ...@@ -70,7 +72,7 @@ function AddressDrawer(props: AddressDrawerProps) {
phone: tryGetMatchValue(otherSplit, 2), phone: tryGetMatchValue(otherSplit, 2),
fullAddress: tryGetMatchValue(maths, 0) + tryGetMatchValue(maths, 1) + tryGetMatchValue(maths, 2) + tryGetMatchValue(maths, 3) + tryGetMatchValue(otherSplit, 0) fullAddress: tryGetMatchValue(maths, 0) + tryGetMatchValue(maths, 1) + tryGetMatchValue(maths, 2) + tryGetMatchValue(maths, 3) + tryGetMatchValue(otherSplit, 0)
} }
onChange(propValue) onChange(propValue)
} }
}, 1000); }, 1000);
...@@ -79,7 +81,7 @@ function AddressDrawer(props: AddressDrawerProps) { ...@@ -79,7 +81,7 @@ function AddressDrawer(props: AddressDrawerProps) {
renderAddressList().then(data => { renderAddressList().then(data => {
if (addr) { if (addr) {
// props 更新 内部状态更新 用于FormItem 的操作 // props 更新 内部状态更新 用于FormItem 的操作
let targetValue = `${addr?.fullAddress ?? ''} ${addr?.shipperName ? addr?.shipperName : addr?.receiverName ?? ''} ${addr?.phone ?? ''}` let targetValue = formatValue(addr)
setValue(targetValue) setValue(targetValue)
} else if (showDefault) { } else if (showDefault) {
// 如果没有默认值,且设置了 showDefault // 如果没有默认值,且设置了 showDefault
......
import { FormInstance } from "antd";
import { DeliveryNoteAddService, ReceivingNoteB2BAddService } from "../handles/HandleFormSubmit";
export class DeliveryAddFactory {
static instance;
static getInstance(target: 'B2B' | 'SRM' = 'SRM') {
if (target === 'SRM') {
return new DeliveryNoteAddService();
}
if (target === 'B2B') {
return new ReceivingNoteB2BAddService();
}
}
}
\ No newline at end of file
export const addrFormatValue = (addr) => {
return `${addr?.fullAddress ?? ''} ${addr?.shipperName ? addr?.shipperName : addr?.receiverName ?? ''}`
}
\ No newline at end of file
...@@ -240,7 +240,6 @@ export class DeliveryNoteUploadService extends DeliveryNoteAddService { ...@@ -240,7 +240,6 @@ export class DeliveryNoteUploadService extends DeliveryNoteAddService {
} }
} }
//新增送货单B2B //新增送货单B2B
export class ReceivingNoteB2BAddService extends DeliveryNoteAddService { export class ReceivingNoteB2BAddService extends DeliveryNoteAddService {
getSubmitRequest() { getSubmitRequest() {
...@@ -331,8 +330,6 @@ export class ReceiveOrderUpdate extends ReceiveOrderCreate { ...@@ -331,8 +330,6 @@ export class ReceiveOrderUpdate extends ReceiveOrderCreate {
} }
} }
export class DeliveryNoticeOrderAddService extends DeliveryNoteAddService { export class DeliveryNoticeOrderAddService extends DeliveryNoteAddService {
#formService: any #formService: any
......
...@@ -20,6 +20,7 @@ import { RoleSelect } from '@/components/RoleSelect'; ...@@ -20,6 +20,7 @@ import { RoleSelect } from '@/components/RoleSelect';
import LogisticsCompanyMerchantsSelect from '@/components/LogisticsCompanySelect/LogisticsCompanyMerchantsSelect'; import LogisticsCompanyMerchantsSelect from '@/components/LogisticsCompanySelect/LogisticsCompanyMerchantsSelect';
import { DeliveryNumColumn, OrderNumColumn } from '../../constants/table-column'; import { DeliveryNumColumn, OrderNumColumn } from '../../constants/table-column';
import moment from 'moment'; import moment from 'moment';
import { addrFormatValue } from '../../assets/format/addrValue';
const DeliveryNoticeManageSRMDetails: React.FC = () => { const DeliveryNoticeManageSRMDetails: React.FC = () => {
...@@ -135,6 +136,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => { ...@@ -135,6 +136,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
label={DeliveryNameLabel} name="deliveryVO"> label={DeliveryNameLabel} name="deliveryVO">
<AddressDrawer <AddressDrawer
showDefault={true} showDefault={true}
formatValue={addrFormatValue}
addressListRequest={(val) => { addressListRequest={(val) => {
return getLogisticsSelectListReceiverAddress(val) return getLogisticsSelectListReceiverAddress(val)
}} }}
...@@ -146,11 +148,6 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => { ...@@ -146,11 +148,6 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
return postLogisticsReceiverAddressAdd(val) return postLogisticsReceiverAddressAdd(val)
} }
}} }}
onChange={(val) => {
form.setFieldsValue({
"executorVO.phone": val?.phone
})
}}
/> />
</FormItem> </FormItem>
......
...@@ -59,7 +59,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => { ...@@ -59,7 +59,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
return ( return (
<AnchorPage title="送货单管理详情(SRM)" <AnchorPage title="送货单管理详情(B2B)"
anchors={anchors} anchors={anchors}
> >
...@@ -158,7 +158,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => { ...@@ -158,7 +158,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
</ContentBox> </ContentBox>
<ContentBox title={ExternalRoamRecord.name} key={ExternalRoamRecord.key} cols={1}> <ContentBox title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
<Table <Table
columns={[ columns={[
...ExternalRoamRecordTableColumn, ...ExternalRoamRecordTableColumn,
......
...@@ -21,6 +21,7 @@ import { RoleSelect } from '@/components/RoleSelect'; ...@@ -21,6 +21,7 @@ import { RoleSelect } from '@/components/RoleSelect';
import LogisticsCompanyMerchantsSelect from '@/components/LogisticsCompanySelect/LogisticsCompanyMerchantsSelect'; import LogisticsCompanyMerchantsSelect from '@/components/LogisticsCompanySelect/LogisticsCompanyMerchantsSelect';
import { useLocation } from 'umi'; import { useLocation } from 'umi';
import { DeliveryNumColumn } from '../../constants/table-column'; import { DeliveryNumColumn } from '../../constants/table-column';
import { addrFormatValue } from '../../assets/format/addrValue';
const ContentBoxItem = ContentBox.BaseInfoItem; const ContentBoxItem = ContentBox.BaseInfoItem;
...@@ -141,6 +142,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => { ...@@ -141,6 +142,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
]} ]}
label={DeliveryNameLabel} name="deliveryVO"> label={DeliveryNameLabel} name="deliveryVO">
<AddressDrawer <AddressDrawer
formatValue={addrFormatValue}
addressListRequest={(val) => { addressListRequest={(val) => {
return getLogisticsSelectListReceiverAddress(val) return getLogisticsSelectListReceiverAddress(val)
}} }}
...@@ -160,7 +162,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => { ...@@ -160,7 +162,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
required() required()
]} ]}
label={DeliveryTimeLabel} name="deliveryRangeTime"> label={DeliveryTimeLabel} name="deliveryRangeTime">
<DatePickerSelect.RangePicker className="w-full" picker='time' /> <DatePickerSelect.RangePicker disabled={true} className="w-full" picker='time' />
</FormItem> </FormItem>
<FormItem label={DeliveryPhoneLabel} name="executorVO.phone"> <FormItem label={DeliveryPhoneLabel} name="executorVO.phone">
......
...@@ -46,7 +46,7 @@ const DeliveryNoticeManageB2B: React.FC = () => { ...@@ -46,7 +46,7 @@ const DeliveryNoticeManageB2B: React.FC = () => {
} }
const buttonGroup = { const buttonGroup = {
'修改': true, '修改': true,
'作废': true, '作废': false,
'查看': true, '查看': true,
} }
const operationHandler = { const operationHandler = {
......
...@@ -23,6 +23,7 @@ import DeliveryNoticeOrderFactory from '../../assets/handles/DeliveryNoticeOrder ...@@ -23,6 +23,7 @@ import DeliveryNoticeOrderFactory from '../../assets/handles/DeliveryNoticeOrder
import LogisticsCompanyMerchantsSelect from '@/components/LogisticsCompanySelect/LogisticsCompanyMerchantsSelect'; import LogisticsCompanyMerchantsSelect from '@/components/LogisticsCompanySelect/LogisticsCompanyMerchantsSelect';
import { values } from 'lodash'; import { values } from 'lodash';
import { DeliveryNumColumn, OrderNumColumn } from '../../constants/table-column'; import { DeliveryNumColumn, OrderNumColumn } from '../../constants/table-column';
import { addrFormatValue } from '../../assets/format/addrValue';
const ContentBoxItem = ContentBox.BaseInfoItem; const ContentBoxItem = ContentBox.BaseInfoItem;
...@@ -55,9 +56,9 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => { ...@@ -55,9 +56,9 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
Modal.confirm({ Modal.confirm({
title: "提示", title: "提示",
content:"确认送货单资料填写是否正确,提交后不能再撤回!", content: "确认送货单资料填写是否正确,提交后不能再撤回!",
onOk: () => { onOk: () => {
service.setTableData(tableDataSource); service.setTableData(tableDataSource);
service.submit().then(res => { service.submit().then(res => {
if (res.code === 1000) { if (res.code === 1000) {
...@@ -134,6 +135,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => { ...@@ -134,6 +135,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
label={DeliveryNameLabel} name="deliveryVO"> label={DeliveryNameLabel} name="deliveryVO">
<AddressDrawer <AddressDrawer
showDefault={true} showDefault={true}
formatValue={addrFormatValue}
addressListRequest={(val) => { addressListRequest={(val) => {
return getLogisticsSelectListReceiverAddress(val) return getLogisticsSelectListReceiverAddress(val)
}} }}
...@@ -145,11 +147,6 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => { ...@@ -145,11 +147,6 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
return postLogisticsReceiverAddressAdd(val) return postLogisticsReceiverAddressAdd(val)
} }
}} }}
onChange={(val) => {
form.setFieldsValue({
"executorVO.phone": val?.phone
})
}}
/> />
</FormItem> </FormItem>
......
...@@ -23,6 +23,7 @@ import DeliveryNoticeOrderFactory from '../../assets/handles/DeliveryNoticeOrder ...@@ -23,6 +23,7 @@ import DeliveryNoticeOrderFactory from '../../assets/handles/DeliveryNoticeOrder
import LogisticsCompanyMerchantsSelect from '@/components/LogisticsCompanySelect/LogisticsCompanyMerchantsSelect'; import LogisticsCompanyMerchantsSelect from '@/components/LogisticsCompanySelect/LogisticsCompanyMerchantsSelect';
import { useLocation } from 'umi'; import { useLocation } from 'umi';
import { DeliveryNumColumn } from '../../constants/table-column'; import { DeliveryNumColumn } from '../../constants/table-column';
import { addrFormatValue } from '../../assets/format/addrValue';
const ContentBoxItem = ContentBox.BaseInfoItem; const ContentBoxItem = ContentBox.BaseInfoItem;
...@@ -134,7 +135,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => { ...@@ -134,7 +135,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
required() required()
]} ]}
label={DeliveryDateLabel} name="deliveryTime"> label={DeliveryDateLabel} name="deliveryTime">
<DatePickerSelect className='w-full' /> <DatePickerSelect disabled={true} className='w-full' />
</FormItem> </FormItem>
<FormItem <FormItem
...@@ -143,6 +144,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => { ...@@ -143,6 +144,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
]} ]}
label={DeliveryNameLabel} name="deliveryVO"> label={DeliveryNameLabel} name="deliveryVO">
<AddressDrawer <AddressDrawer
formatValue={addrFormatValue}
addressListRequest={(val) => { addressListRequest={(val) => {
return getLogisticsSelectListReceiverAddress(val) return getLogisticsSelectListReceiverAddress(val)
}} }}
...@@ -162,7 +164,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => { ...@@ -162,7 +164,7 @@ const DeliveryNoticeManageSRMEdit: React.FC = () => {
required() required()
]} ]}
label={DeliveryTimeLabel} name="deliveryRangeTime"> label={DeliveryTimeLabel} name="deliveryRangeTime">
<DatePickerSelect.RangePicker className="w-full" picker='time' /> <DatePickerSelect.RangePicker disabled={true} className="w-full" picker='time' />
</FormItem> </FormItem>
<FormItem label={DeliveryPhoneLabel} name="executorVO.phone"> <FormItem label={DeliveryPhoneLabel} name="executorVO.phone">
......
...@@ -47,14 +47,14 @@ const DeliveryNoticeManageSRM: React.FC = () => { ...@@ -47,14 +47,14 @@ const DeliveryNoticeManageSRM: React.FC = () => {
} }
const buttonGroup = { const buttonGroup = {
'修改': true, '修改': true,
'作废': true, '作废': false,
'查看': true, '查看': true,
} }
const operationHandler = { const operationHandler = {
'修改': () => { history.push(`/memberCenter/order/deliveryNotice/manageSRM/edit?id=${record.id}`) }, '修改': () => { history.push(`/memberCenter/order/deliveryNotice/manageSRM/edit?id=${record.id}`) },
'作废': () => { '作废': () => {
// /order/delivery/order/invalid // /order/delivery/order/invalid
}, },
'查看': () => { '查看': () => {
history.push(`/memberCenter/order/deliveryNotice/manageSRM/details?id=${record.id}`) history.push(`/memberCenter/order/deliveryNotice/manageSRM/details?id=${record.id}`)
}, },
......
This diff is collapsed.
...@@ -300,11 +300,15 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id ...@@ -300,11 +300,15 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
/> />
</HarvestMaterialContextProvider> </HarvestMaterialContextProvider>
</BaseInfo> </BaseInfo>
<BaseInfo className='mt-16' title={Remarks.name} id={Remarks.key} cols={1}> <BaseInfo className='mt-16' title={(<>{Remarks.name}<span className='text-red-600'>*</span></>)} id={Remarks.key} cols={1}>
<Form.Item <Form.Item
labelCol={{ span: 0 }} labelCol={{ span: 0 }}
wrapperCol={{ span: 24 }} wrapperCol={{ span: 24 }}
name='remark' name='remark'
rules={[{
required: true,
message: '备注不能为空'
}]}
> >
<Input.TextArea rows={6} maxLength={300} placeholder='最长600个字符,300个汉字' /> <Input.TextArea rows={6} maxLength={300} placeholder='最长600个字符,300个汉字' />
</Form.Item> </Form.Item>
......
...@@ -302,11 +302,15 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id ...@@ -302,11 +302,15 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
/> />
</HarvestMaterialContextProvider> </HarvestMaterialContextProvider>
</BaseInfo> </BaseInfo>
<BaseInfo className='mt-16' title={Remarks.name} id={Remarks.key} cols={1}> <BaseInfo className='mt-16' title={(<>{Remarks.name}<span className='text-red-600'>*</span></>)} id={Remarks.key} cols={1}>
<Form.Item <Form.Item
labelCol={{ span: 0 }} labelCol={{ span: 0 }}
wrapperCol={{ span: 24 }} wrapperCol={{ span: 24 }}
name='remark' name='remark'
rules={[{
required: true,
message: '备注不能为空'
}]}
> >
<Input.TextArea rows={6} maxLength={300} placeholder='最长600个字符,300个汉字' /> <Input.TextArea rows={6} maxLength={300} placeholder='最长600个字符,300个汉字' />
</Form.Item> </Form.Item>
......
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