fix: 修复保洁订单结束时间能早于开始时间bug
This commit is contained in:
parent
f0f0cc6746
commit
8dee11802e
@ -4,7 +4,7 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { resident_unitList } from '#/api/property/resident/unit';
|
||||
import { useCleanStore } from '#/store';
|
||||
import type { FormSchema } from '../../../../../../../packages/@core/ui-kit/form-ui/src/types';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
const cleanStore = useCleanStore();
|
||||
|
||||
export const querySchema: (areaList: any[]) => FormSchema[] = (areaList) => [
|
||||
@ -163,12 +163,21 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '结束时间',
|
||||
fieldName: 'endTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
componentProps: (values) => ({
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
placeholder: '请选择结束时间',
|
||||
placeholder: !values.starTime?'请先选择开始时间':`请选择结束时间(结束时间不能早于开始时间)`,
|
||||
disabled: !values.starTime, // 没选开始时间时禁用
|
||||
disabledDate: (current:any) => {
|
||||
if (!values.starTime) return false;
|
||||
// 只允许选择大于等于开始时间的日期
|
||||
return current && current < dayjs(values.starTime).startOf('second');
|
||||
},
|
||||
}),
|
||||
rules: 'required',
|
||||
dependencies: {
|
||||
triggerFields: ['starTime'],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '申请人',
|
||||
|
Loading…
Reference in New Issue
Block a user