11.21 11.15电子评标室预约优化
This commit is contained in:
@ -6,6 +6,7 @@ import { dateFormat, disabledDate, otherDisabledDateTime, validateMessages } fro
|
||||
import moment from 'moment';
|
||||
import { dateTimeFormatter } from '@/utils/DateUtils';
|
||||
import { getProId } from '@/utils/session';
|
||||
import { isEmpty } from '@/utils/CommonUtils';
|
||||
|
||||
interface BidEvalAppointmentProps {
|
||||
modalVisible: boolean;
|
||||
@ -186,14 +187,22 @@ const BidEvalAppointment: React.FC<BidEvalAppointmentProps> = (props) => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setSelectedRowKeys([]);
|
||||
setSelectedRecord(null);
|
||||
setDisabledMap({});
|
||||
if (values?.areaId) {
|
||||
setSelectedRowKeys([values.areaId]);
|
||||
setSelectedRecord({ areaNumber: values?.numberInMeeting, ...values, id: values.areaId });
|
||||
form.setFieldsValue({ ...values, reserveStartDate: moment(values.reserveStartDate), reserveEndDate: moment(values.reserveEndDate) });
|
||||
} else {
|
||||
setSelectedRowKeys([]);
|
||||
setSelectedRecord(null);
|
||||
setDisabledMap({});
|
||||
}
|
||||
}, [values])
|
||||
|
||||
useEffect(() => {
|
||||
initValue && form.setFieldsValue({ ...initValue, reserveStartDate: initValue.startTime, reserveEndDate: initValue.endTime });
|
||||
}, [initValue, modalVisible])
|
||||
if (initValue && isEmpty(values)) {
|
||||
form.setFieldsValue({ ...initValue, reserveStartDate: initValue.startTime, reserveEndDate: initValue.endTime });
|
||||
}
|
||||
}, [initValue, values, modalVisible])
|
||||
|
||||
useEffect(() => {
|
||||
selectedRowKeys.length > 0 && getDisabledTime(selectedRowKeys);
|
||||
@ -234,8 +243,10 @@ const BidEvalAppointment: React.FC<BidEvalAppointmentProps> = (props) => {
|
||||
columns={columns}
|
||||
actionRef={actionRef}
|
||||
bordered={false}
|
||||
params={{ areaType: "eval_room" }}
|
||||
loading={false}
|
||||
params={{ areaType: "eval_room", chooseAreaId: values?.areaId }}
|
||||
request={async (params) => {
|
||||
setLoading(true);
|
||||
return await getBidEvalRoom(params).then(res => {
|
||||
if (res?.code == 200) {
|
||||
return {
|
||||
@ -250,6 +261,8 @@ const BidEvalAppointment: React.FC<BidEvalAppointmentProps> = (props) => {
|
||||
total: 0,
|
||||
}
|
||||
}
|
||||
}).finally(() => {
|
||||
setLoading(false);
|
||||
})
|
||||
}}
|
||||
rowKey="id"
|
||||
@ -278,7 +291,6 @@ const BidEvalAppointment: React.FC<BidEvalAppointmentProps> = (props) => {
|
||||
form={form}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 16 }}
|
||||
preserve={false}
|
||||
validateMessages={validateMessages}
|
||||
>
|
||||
<Form.Item
|
||||
|
Reference in New Issue
Block a user