|
|
@@ -4,6 +4,7 @@ import { dayjsFormat } from '@/utils/utils'
|
|
|
import { ModalForm } from '@ant-design/pro-form'
|
|
|
import { Plus } from '@icon-park/react'
|
|
|
import dayjs from 'dayjs'
|
|
|
+import moment from 'moment'
|
|
|
|
|
|
const AddRecord = props => {
|
|
|
const formRef = useRef(null)
|
|
|
@@ -13,6 +14,9 @@ const AddRecord = props => {
|
|
|
const onChange = value => {
|
|
|
setShowExtraItem(value)
|
|
|
}
|
|
|
+ const disabledDate = current => {
|
|
|
+ return current && current < moment().endOf('day')
|
|
|
+ }
|
|
|
return (
|
|
|
<ModalForm
|
|
|
layout="vertical"
|
|
|
@@ -45,7 +49,7 @@ const AddRecord = props => {
|
|
|
</Radio.Group>
|
|
|
</Form.Item>
|
|
|
<Form.Item name="date" label="服务日期" initialValue={dayjs(new Date())}>
|
|
|
- <DatePicker style={{ width: '100%' }} />
|
|
|
+ <DatePicker style={{ width: '100%' }} disabledDate={disabledDate} />
|
|
|
</Form.Item>
|
|
|
<Form.Item name="mark" label="内容">
|
|
|
<TextArea rows={3} />
|
|
|
@@ -57,7 +61,7 @@ const AddRecord = props => {
|
|
|
{showExtraItem ? (
|
|
|
<>
|
|
|
<Form.Item name="remindTime" label="备忘日期">
|
|
|
- <DatePicker style={{ width: '100%' }} />
|
|
|
+ <DatePicker style={{ width: '100%' }} disabledDate={disabledDate} />
|
|
|
</Form.Item>
|
|
|
<Form.Item name="remark" label="备忘内容">
|
|
|
<TextArea rows={2} />
|