Commit 4dba1d79 authored by 许佳敏's avatar 许佳敏

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

送货单管理-新增送货单时,选择物料处,在已选择的物料里将记录删除,在弹框选择页并没有取消选择,应该要取消选择才对 See merge request linkseeks-design/pro-platform!620
parents aedfae11 444b8b50
import { DatePicker } from 'antd';
import moment from 'moment';
import React, { useEffect, useState } from 'react';
import React, { MutableRefObject, useEffect, useRef, useState } from 'react';
interface DatePickerSelectProps {
......@@ -10,6 +10,7 @@ interface DatePickerSelectProps {
value?: any
disabled?: boolean
hidden?: boolean
errorMsg?: any
}
/**
......@@ -19,12 +20,25 @@ interface DatePickerSelectProps {
*/
function DatePickerSelect(props: DatePickerSelectProps) {
const { defualtToday = false, onChange, className, value, disabled = false, hidden = false } = props;
const { defualtToday = false, onChange, className, value, disabled = false, hidden = false, errorMsg = '' } = props;
const dom = useRef<any>(null)
const disabledDate = (current) => {
return current && current < moment().startOf('day');
}
useEffect(() => {
if (errorMsg.length > 0) {
dom.current.focus()
} else {
dom.current.blur()
}
}, [
errorMsg
])
const renderDefaultValue = () => {
if (defualtToday) {
let result = moment().startOf('day')
......@@ -38,6 +52,8 @@ function DatePickerSelect(props: DatePickerSelectProps) {
return (
<DatePicker
ref={dom}
autoFocus
style={{
display: hidden ? 'none' : 'block'
}}
......
......@@ -6,7 +6,7 @@ import { PlannedDeliveryMaterialExpandableTableColumn, PlannedDeliveryMaterialTa
import ExpandedRowTableRender from "./ExpandedRowTableRender";
import { PlusOutlined } from '@ant-design/icons'
const selectedRowKeys = new Map()
let selectedRowKeys = new Map()
interface DeliveryGoodTableModalProps {
form: FormInstance
onChange: (value) => void
......@@ -23,7 +23,10 @@ interface DeliveryGoodTableModalProps {
*/
function DeliveryGoodTableModal(props: DeliveryGoodTableModalProps) {
const { onChange, form, disabled, orderType, title = '选择送货物料' } = props;
const { onChange, form, disabled, orderType, title = '选择送货物料', value } = props;
console.log(value);
const [visible, setVisible] = useState(false)
const service = DeliveryNoticeOrderFactory.getInstance()
......@@ -32,22 +35,15 @@ function DeliveryGoodTableModal(props: DeliveryGoodTableModalProps) {
const handleVisible = useCallback(() => {
setVisible(true)
selectedRowKeys = value
}, [visible])
const handleSubmit = useCallback(() => {
let result = []
for (const v of selectedRowKeys) {
result.push(...v[1])
}
let targetValue = Array.from(new Set(result))
onChange(targetValue);
onChange(selectedRowKeys);
setVisible(false);
}, [visible])
useEffect(() => {
console.log(form.getFieldValue('member'));
if (form.getFieldValue('member')) {
service.getOrderDeliveryPlanOrderProductPage(form, 1, orderType).then(handleResponseHttp)
......@@ -68,7 +64,6 @@ function DeliveryGoodTableModal(props: DeliveryGoodTableModalProps) {
}
const expandedRowRender = (record, index) => {
let data = record;
let combination = (record.orders as any[]).map(v => {
let result = {
......@@ -81,11 +76,11 @@ function DeliveryGoodTableModal(props: DeliveryGoodTableModalProps) {
return (
<ExpandedRowTableRender
row={data.id}
selectedRowKeys={value.get(index)}
dataSource={combination}
onChange={(keys, index) => {
console.log('keys,index :>> ', keys, index);
onChange={(keys) => {
selectedRowKeys.set(index, keys);
onChange(selectedRowKeys);
}}
/>
);
......@@ -123,14 +118,14 @@ function DeliveryGoodTableModal(props: DeliveryGoodTableModalProps) {
>
{
tableData.map(t => {
tableData.map((t, i) => {
return (
<Table
className="mt-16"
columns={PlannedDeliveryMaterialTableColumn}
rowKey={row => row.no}
dataSource={[t]}
expandedRowRender={expandedRowRender}
expandedRowRender={(r) => expandedRowRender(r, i)}
defaultExpandAllRows={true}
expandIcon={() => ""}
pagination={false}
......
import { Table } from "antd";
import { useState } from "react";
import { Table, TableProps } from "antd";
import { useEffect, useState } from "react";
import { PlannedDeliveryMaterialExpandableTableColumn } from "../../constants/page-table-column";
/**
......@@ -11,29 +11,28 @@ import { PlannedDeliveryMaterialExpandableTableColumn } from "../../constants/pa
interface ExpandedRowTableRenderProps {
dataSource: any[],
row?: number,
onChange?: (selectedRowKeys, index?: number) => void
onChange?: (selectedRowKeys, index?: number) => void,
selectedRowKeys?: any[]
}
function ExpandedRowTableRender(props: ExpandedRowTableRenderProps) {
const { row = 0, onChange } = props;
const { row = 0, onChange, selectedRowKeys: selectedRowKeysProps = [] } = props;
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
const onSelectChange = (selectedRowKeys: any[]) => {
setSelectedRowKeys(selectedRowKeys)
let result = props.dataSource.filter(v => selectedRowKeys.includes(v.orderNo));
console.log(row)
onChange(result, row)
};
const rowSelection = {
selectedRowKeys,
selectedRowKeys: selectedRowKeysProps.map(v => v.orderNo),
onChange: onSelectChange,
};
return (
<Table
rowSelection={rowSelection}
dataSource={props.dataSource}
rowKey={record => record.orderNo}
......
export function formatTable(selectedRowKeys: Map<string, any>) {
console.log(selectedRowKeys);
let result = []
for (const v of selectedRowKeys) {
result.push(...v[1])
}
console.log(result);
let targetValue = Array.from(new Set(result))
return targetValue;
}
export function formMapData(selectedRowKeys, currentTable: any[]) {
let result = new Map<string, any>()
let orderNos = currentTable.map(v => v.orderNo);
for (const v of selectedRowKeys) {
let tpm = [];
for (const t of v[1]) {
if (orderNos.includes(t.orderNo)) {
tpm.push(t);
}
}
result.set(v[0], tpm);
}
return result;
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
* @description: 与B2B内容大致相同,文件分开方便后续对接以及日后变动修改二开
*/
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import React, { useCallback, useEffect, useState, useContext } from 'react'
import React, { useCallback, useEffect, useState, useContext, useMemo } from 'react'
import { BillsInfo, BuyerLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryDate, DeliveryDateLabel, DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryPhoneLabel, DeliverySlefAddrLabel, DeliveryTimeLabel, DeliveryTypeLabel, Distribution, LogisticsCarNoLabel, LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, NoteLabel, ReceivingAddress } from '../../constants'
import { BaseInfo as ContentBox } from '@/components/BaseInfo'
import { Input, Table, Radio, Form, Button, Modal } from 'antd';
......@@ -27,10 +27,13 @@ import { size } from 'lodash';
import usePrompt from '@/hooks/usePrompt';
import useLogistics from '../../assets/hooks/useLogistics';
import { validatorByteObject } from '@/utils/regExp';
import { formatTable, formMapData } from '../../components/DeliveryGoodTableSelect/useformatTable';
const DeliveryNoticeManageSRMDetails: React.FC = () => {
const [tableDataSource, setTableDataSource] = useState<any[]>();
const [tableDataSource, setTableDataSource] = useState<Map<string, any>>(new Map());
const [tableDataSourceContext, setTableDataSourceContext] = useState([])
const { renderPrompt, handleLeave } = usePrompt()
const [form] = Form.useForm()
......@@ -64,7 +67,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
content: "确认送货单资料填写是否正确,提交后不能再撤回!",
onOk: () => {
service.setTableData(tableDataSource);
service.setTableData(tableDataSourceContext);
service.submit().then(res => {
if (res.code === 1000) {
handleLeave(false)
......@@ -78,12 +81,12 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
})
}, [form, tableDataSource])
}, [form, tableDataSourceContext])
const handleRemoveMaterialTableRow = (i: number) => {
const source: any[] = JSON.parse(JSON.stringify(tableDataSource));
const source: any[] = JSON.parse(JSON.stringify(tableDataSourceContext));
source.splice(i, 1);
setTableDataSource(source);
let atpm = JSON.parse(JSON.stringify(anchors));
atpm.pop()
......@@ -94,6 +97,11 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
name: `${DeliveryGood.name}(${source.length})`
}
])
const r = formMapData(tableDataSource, source)
setTableDataSource(r);
setTableDataSourceContext(source);
}
return (
......@@ -176,7 +184,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
{ pattern: PATTERN_MAPS.phone, message: "手机号是否正确" }
]}
label={DeliveryPhoneLabel} name="executorVO.phone">
<Input type="tel" placeholder={`请输入${DeliveryPhoneLabel}`} />
<Input type="tel" placeholder={`请输入${DeliveryPhoneLabel}`} />
</FormItem>
</ContentBox>
......@@ -195,6 +203,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
label={ReceivingAddress} name="receiveVO">
<ReceiverAddress
disabled={true}
hiddenBtn={true}
/>
</FormItem>
......@@ -247,42 +256,50 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<ContentBox title={DeliveryGood.name} id={DeliveryGood.key} cols={1}>
{/* 在编辑的时候不需要进行此操作 */}
<DeliveryGoodTableSelectB2B
value={tableDataSource}
form={form}
onChange={(value) => {
if (value.length > 0) {
let addr = {
provinceName: value[0].provinceName,
cityName: value[0].cityName,
districtName: value[0].districtName,
streetName: value[0].streetName,
address: value[0].address,
phone: value[0].phone,
consignee: value[0].consignee,
receiverName: value[0].consignee,
fullAddress: `${value[0].provinceName}${value[0].cityName}${value[0].districtName}${value[0].streetName}${value[0].address}`
}
form.setFieldsValue({
'receiveVO': addr
})
}
let atpm = JSON.parse(JSON.stringify(anchors));
atpm.pop()
const ft = formatTable(value);
setAnchors([
...atpm,
{
...DeliveryGood,
name: `${DeliveryGood.name}(${value.length})`
name: `${DeliveryGood.name}(${ft.length})`
}
])
if (ft.length > 0) {
let addr = {
provinceName: ft[0].provinceName,
cityName: ft[0].cityName,
districtName: ft[0].districtName,
streetName: ft[0].streetName,
address: ft[0].address,
phone: ft[0].phone,
consignee: ft[0].consignee,
receiverName: ft[0].consignee,
fullAddress: `${ft[0].provinceName}${ft[0].cityName}${ft[0].districtName}${ft[0].streetName}${ft[0].address}`
}
form.setFieldsValue({
'receiveVO': addr
})
}
setTableDataSource(value)
setTableDataSourceContext(ft)
}}
/>
<HarvestMaterialContextProvider value={{
dataSource: tableDataSource
dataSource: tableDataSourceContext
}}>
<Table
rowKey={row => row.orderNo}
......@@ -309,7 +326,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
}
}
]}
dataSource={tableDataSource}
dataSource={tableDataSourceContext}
pagination={{
size: "small"
}}
......
......@@ -4,7 +4,7 @@
* @description: 与B2B内容大致相同,文件分开方便后续对接以及日后变动修改二开
*/
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import React, { useCallback, useEffect, useState, useContext } from 'react'
import React, { useCallback, useEffect, useState, useContext, useMemo } 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, Material, NoteLabel, OutStatusLabel, ReceivingAddress } from '../../constants'
import { BaseInfo as ContentBox } from '@/components/BaseInfo'
import { Input, Table, Row, Col, Select, Radio, Form, Button, Modal } from 'antd';
......@@ -29,12 +29,14 @@ import { PATTERN_MAPS } from '@/constants/regExp';
import usePrompt from '@/hooks/usePrompt';
import useLogistics from '../../assets/hooks/useLogistics';
import { validatorByteObject } from '@/utils/regExp';
import { formatTable, formMapData } from '../../components/DeliveryGoodTableSelect/useformatTable';
const ContentBoxItem = ContentBox.BaseInfoItem;
const DeliveryNoticeManageSRMDetails: React.FC = () => {
const [tableDataSource, setTableDataSource] = useState<any[]>();
const [tableDataSource, setTableDataSource] = useState<Map<string, any>>(new Map());
const [tableDataSourceContext, setTableDataSourceContext] = useState([])
const { renderPrompt, handleLeave } = usePrompt()
......@@ -68,7 +70,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
content: "确认送货单资料填写是否正确,提交后不能再撤回!",
onOk: () => {
service.setTableData(tableDataSource);
service.setTableData(tableDataSourceContext);
service.submit().then(res => {
if (res.code === 1000) {
setTimeout(() => {
......@@ -80,9 +82,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
}
})
}, [form, tableDataSource])
}, [form, tableDataSourceContext])
return (
<AnchorPage title="新增送货单"
......@@ -239,43 +239,48 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<ContentBox title={Material.name} id={Material.key} cols={1}>
{/* 在编辑的时候不需要进行此操作 */}
<DeliveryGoodTableSelectSRM
value={tableDataSource}
form={form}
onChange={(value) => {
if (value.length > 0) {
let atpm = JSON.parse(JSON.stringify(anchors));
atpm.pop()
const ft = formatTable(value)
if (ft.length > 0) {
let addr = {
provinceName: value[0].provinceName,
cityName: value[0].cityName,
districtName: value[0].districtName,
streetName: value[0].streetName,
address: value[0].address,
phone: value[0].phone,
consignee: value[0].consignee,
receiverName: value[0].consignee,
fullAddress: `${value[0].provinceName}${value[0].cityName}${value[0].districtName}${value[0].streetName}${value[0].address}`
provinceName: ft[0].provinceName,
cityName: ft[0].cityName,
districtName: ft[0].districtName,
streetName: ft[0].streetName,
address: ft[0].address,
phone: ft[0].phone,
consignee: ft[0].consignee,
receiverName: ft[0].consignee,
fullAddress: `${ft[0].provinceName}${ft[0].cityName}${ft[0].districtName}${ft[0].streetName}${ft[0].address}`
}
form.setFieldsValue({
'receiveVO': addr
})
}
let atpm = JSON.parse(JSON.stringify(anchors));
atpm.pop()
setAnchors([
...atpm,
{
...Material,
name: `${Material.name}(${value.length})`
name: `${Material.name}(${ft.length})`
}
])
setTableDataSource(value)
setTableDataSourceContext(ft)
}}
/>
<HarvestMaterialContextProvider value={{
dataSource: tableDataSource
dataSource: tableDataSourceContext
}}>
<Table
rowKey={row => row.orderNo}
......@@ -299,7 +304,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
render: (t, r, i) => {
return (
<Button type='link' onClick={() => {
let tpm = JSON.parse(JSON.stringify(tableDataSource))
let tpm = JSON.parse(JSON.stringify(tableDataSourceContext))
tpm.splice(i, 1);
let atpm = JSON.parse(JSON.stringify(anchors));
atpm.pop();
......@@ -311,14 +316,18 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
name: `${Material.name}(${tpm.length})`
}
])
setTableDataSource(tpm);
const r = formMapData(tableDataSource, tpm)
setTableDataSource(r);
setTableDataSourceContext(tpm);
}}>删除</Button>
)
}
}
]}
dataSource={tableDataSource}
dataSource={tableDataSourceContext}
/>
</HarvestMaterialContextProvider>
......
......@@ -21,6 +21,7 @@ import usePrompt from '@/hooks/usePrompt'
import FormProgress, { HandleType } from '@/components/FormProgress'
import { getMemberManageBuyerMember } from '@/services/MemberV2Api'
import { validatorByte } from '@/utils/regExp'
import { formatTable, formMapData } from '@/pages/order/components/DeliveryGoodTableSelect/useformatTable'
type PropsType = {
type: 'add' | 'edit';
......@@ -56,13 +57,19 @@ const getConst = (len = 0) => {
const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id, planData, btnCode }) => {
const [form] = Form.useForm()
const { renderPrompt, handleLeave } = usePrompt()
const [tableDataSource, setTableDataSource] = useState<any[]>([])
const [tableDataSource, setTableDataSource] = useState<any>([])
const [tableDataSourceContext, setTableDataSourceContext] = useState([])
const [loading, setLoading] = useState<boolean>(false)
const progressRef = useRef<HandleType>()
const changeTableSource = (data = []) => {
setTableDataSource(data)
const r = formMapData(tableDataSource, data)
setTableDataSource(r);
setTableDataSourceContext(data);
renderProgress(data)
}
......@@ -324,36 +331,40 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
</BaseInfo>
<BaseInfo className='mt-16' title={DeliveryGood.name} id={DeliveryGood.key} cols={1}>
<DeliveryGoodTableSelect
value={tableDataSource}
title={`选择${DeliveryGood.name}`}
disabled={!!planData}
form={form}
onChange={(value) => {
if (value.length > 0) {
const ft = formatTable(value)
if (ft.length > 0) {
let addr = {
provinceName: value[0].provinceName,
cityName: value[0].cityName,
districtName: value[0].districtName,
streetName: value[0].streetName,
address: value[0].address,
phone: value[0].phone,
consignee: value[0].consignee,
consigneeId: value[0].consigneeId,
fullAddress: `${value[0].provinceName}${value[0].cityName}${value[0].districtName}${value[0].streetName}${value[0].address}`
provinceName: ft[0].provinceName,
cityName: ft[0].cityName,
districtName: ft[0].districtName,
streetName: ft[0].streetName,
address: ft[0].address,
phone: ft[0].phone,
consignee: ft[0].consignee,
consigneeId: ft[0].consigneeId,
fullAddress: `${ft[0].provinceName}${ft[0].cityName}${ft[0].districtName}${ft[0].streetName}${ft[0].address}`
}
form.setFieldsValue({
'receivingAddress': addr
})
}
changeTableSource(value)
setTableDataSource(value)
changeTableSource(ft)
}}
/>
<HarvestMaterialContextProvider value={{
dataSource: tableDataSource
dataSource: tableDataSourceContext
}}>
<Table
rowKey={row => row.orderNo}
columns={columns}
dataSource={tableDataSource}
dataSource={tableDataSourceContext}
/>
</HarvestMaterialContextProvider>
</BaseInfo>
......
......@@ -24,6 +24,7 @@ import usePrompt from '@/hooks/usePrompt'
import FormProgress, { HandleType } from '@/components/FormProgress'
import { getMemberManageUpperConsumerMerchantPage } from '@/services/MemberV2Api'
import { validatorByte } from '@/utils/regExp'
import { formatTable, formMapData } from '@/pages/order/components/DeliveryGoodTableSelect/useformatTable'
type PropsType = {
type: 'add' | 'edit';
......@@ -59,13 +60,21 @@ const getConst = (len = 0) => {
const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id, planData, btnCode }) => {
const [form] = Form.useForm()
const { renderPrompt, handleLeave } = usePrompt()
const [tableDataSource, setTableDataSource] = useState<any[]>([])
const [tableDataSource, setTableDataSource] = useState<any>([])
const [tableDataSourceContext, setTableDataSourceContext] = useState([])
const [loading, setLoading] = useState<boolean>(false)
const progressRef = useRef<HandleType>()
const changeTableSource = (data = []) => {
setTableDataSource(data)
const r = formMapData(tableDataSource, data)
setTableDataSource(r);
setTableDataSourceContext(data);
renderProgress(data)
}
......@@ -118,9 +127,10 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
}
const handleRemoveMaterialTableRow = (i: number) => {
const source: any[] = tableDataSource;
const source: any[] = tableDataSourceContext;
const newSource = source.splice(i, 0)
changeTableSource(newSource)
}
const getDetail = async () => {
......@@ -311,7 +321,7 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
{ required: true, message: `请选择${ReceivingAddress}` }
]}
>
<ReceiverAddress disabled />
<ReceiverAddress disabled hiddenBtn={true} />
</Form.Item>
<Form.Item
......@@ -328,36 +338,43 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
</BaseInfo>
<BaseInfo className='mt-16' title={Material.name} id={Material.key} cols={1}>
<DeliveryGoodTableSelect
value={tableDataSource}
disabled={!!planData}
form={form}
orderType={2}
onChange={(value) => {
if (value.length > 0) {
const ft = formatTable(value)
if (ft.length > 0) {
let addr = {
provinceName: value[0].provinceName,
cityName: value[0].cityName,
districtName: value[0].districtName,
streetName: value[0].streetName,
address: value[0].address,
phone: value[0].phone,
consignee: value[0].consignee,
consigneeId: value[0].consigneeId,
fullAddress: `${value[0].provinceName}${value[0].cityName}${value[0].districtName}${value[0].streetName}${value[0].address}`
provinceName: ft[0].provinceName,
cityName: ft[0].cityName,
districtName: ft[0].districtName,
streetName: ft[0].streetName,
address: ft[0].address,
phone: ft[0].phone,
consignee: ft[0].consignee,
consigneeId: ft[0].consigneeId,
fullAddress: `${ft[0].provinceName}${ft[0].cityName}${ft[0].districtName}${ft[0].streetName}${ft[0].address}`
}
form.setFieldsValue({
'receivingAddress': addr
})
}
changeTableSource(value)
setTableDataSource(value)
changeTableSource(ft)
}}
/>
<HarvestMaterialContextProvider value={{
dataSource: tableDataSource
dataSource: tableDataSourceContext
}}>
<Table
rowKey={row => row.orderNo}
columns={columns}
dataSource={tableDataSource}
dataSource={tableDataSourceContext}
/>
</HarvestMaterialContextProvider>
</BaseInfo>
......
......@@ -216,6 +216,7 @@ function DeliveryNoticeFromCreate() {
label={ReceivingAddress} name="receiveVO">
<ReceiverAddress
hiddenBtn={true}
disabled={false}
/>
......
import AnchorPage, { AnchorsItem } from "@/components/AnchorPage"
import { BaseInfo } from "@/components/BaseInfo"
import { useContext, useEffect, useState } from "react"
import { useContext, useEffect, useRef, useState } from "react"
import {
BillsInfo, DeliveryInfo, LogisticsInfo, Harvest, HarvestMaterial,
ReceiptAddLabel, NoteLabel, DeliveryTimeLabel,
......@@ -41,6 +41,7 @@ function DeliveryNoteAddForm() {
service.setTableData(tableDataSource)
const { renderPrompt, handleLeave } = usePrompt()
const [info, setInfo] = useState<any>();
const [errorMsg, setErrorMsg] = useState("")
const [anchors, setAnchors] = useState<AnchorsItem[]>(() => {
return [
......@@ -91,6 +92,8 @@ function DeliveryNoteAddForm() {
history.go(-1)
}, 1000);
}
}).catch(err => {
setErrorMsg(err.errorFields[0].errors[0])
})
}
......@@ -157,10 +160,10 @@ function DeliveryNoteAddForm() {
<div>
<FormItem
rules={[
required()
required(`请输入${ReceivingTime}`)
]}
label={ReceivingTime} name="receiveTime">
<DatePickerSelect className='w-full' />
<DatePickerSelect errorMsg={errorMsg} className='w-full' />
</FormItem>
<FormItem
......@@ -178,6 +181,7 @@ function DeliveryNoteAddForm() {
<FormItem
label={ReceivingAddress} name="receiveVO">
<ReceiverAddress
hiddenBtn={true}
disabled={true}
/>
</FormItem>
......
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