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

修复一些BUG

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