Commit 2eb42250 authored by cellee's avatar cellee

Signed-off-by: cellee <893264950@qq.com>

parent d9d0e084
...@@ -173,7 +173,6 @@ class SelectOptions extends React.PureComponent { ...@@ -173,7 +173,6 @@ class SelectOptions extends React.PureComponent {
}; };
// 多选框改变的回调 // 多选框改变的回调
onChangeValue = (checkedList) => { onChangeValue = (checkedList) => {
// console.log(checkedList);
if (this.props.single != null) { if (this.props.single != null) {
var tmp; var tmp;
if (checkedList.length > 1) { if (checkedList.length > 1) {
......
...@@ -27,6 +27,8 @@ const TitleSearch = (props: any) => { ...@@ -27,6 +27,8 @@ const TitleSearch = (props: any) => {
push, push,
} = props; } = props;
// console.log(props);
const key = props.listkey; const key = props.listkey;
const name = props.list; const name = props.list;
...@@ -48,9 +50,6 @@ const TitleSearch = (props: any) => { ...@@ -48,9 +50,6 @@ const TitleSearch = (props: any) => {
// console.log("小区数量初始化") OK // console.log("小区数量初始化") OK
tosCommunityget(null); tosCommunityget(null);
} }
if (defaultValue != null) {
form.setFieldsValue(defaultValue);
}
}, []); }, []);
useEffect(() => { useEffect(() => {
...@@ -81,7 +80,6 @@ const TitleSearch = (props: any) => { ...@@ -81,7 +80,6 @@ const TitleSearch = (props: any) => {
// 监听 time // 监听 time
useEffect(() => { useEffect(() => {
if (time) { if (time) {
// console.log(time);
form.setFieldsValue({ form.setFieldsValue({
subscribeDate: time[2], subscribeDate: time[2],
}); });
...@@ -89,21 +87,25 @@ const TitleSearch = (props: any) => { ...@@ -89,21 +87,25 @@ const TitleSearch = (props: any) => {
}, [time]); }, [time]);
const onFinish = (values: any) => { const onFinish = (values: any) => {
// console.log(values);
if (datePicker) { if (datePicker) {
values[time[0]] = datePicker; values[time[0]] = datePicker;
} }
if (community) { if (community) {
values[community] = communitys; values[community] = communitys;
} }
if (time) {
values.subscribeDate = time[2];
}
// console.log(values);
props.onSubmit(values); props.onSubmit(values);
}; };
const onFinishFailed = () => {}; const onFinishFailed = () => {};
// 选择时间 // 选择时间
const onChange = (date: any, dateString: string) => { const onChanges = (date: any, dateString: string) => {
console.log(dateString); // console.log(dateString);
time[2] = dateString;
setDate(dateString); setDate(dateString);
}; };
...@@ -201,11 +203,10 @@ const TitleSearch = (props: any) => { ...@@ -201,11 +203,10 @@ const TitleSearch = (props: any) => {
{/* 时间 */} {/* 时间 */}
{time != null ? ( {time != null ? (
<Col key="datePicker_"> <Col key="datePicker_">
{' '}
<DatePicker <DatePicker
placeholder={time[1]} placeholder={time[1]}
defaultValue={time[2] ? moment(time[2], 'YYYY/MM/DD') : null} value={time[2] ? moment(time[2], 'YYYY/MM/DD') : null}
onChange={onChange} onChange={onChanges}
/> />
</Col> </Col>
) : null} ) : null}
......
...@@ -216,6 +216,7 @@ const FacilityBookings = (props: any) => { ...@@ -216,6 +216,7 @@ const FacilityBookings = (props: any) => {
pageNum: search.pageNum ? search.pageNum : 1, // 实际搜索页码 pageNum: search.pageNum ? search.pageNum : 1, // 实际搜索页码
globalMark: search.globalMark ? search.globalMark : 'no', // 搜索全部内容 globalMark: search.globalMark ? search.globalMark : 'no', // 搜索全部内容
}; };
// console.log(obj);
requse(obj, tab); requse(obj, tab);
} else { } else {
let obj = { let obj = {
...@@ -229,20 +230,16 @@ const FacilityBookings = (props: any) => { ...@@ -229,20 +230,16 @@ const FacilityBookings = (props: any) => {
// 发起搜索 // 发起搜索
const CallBackTitleSearch = (comment: any) => { const CallBackTitleSearch = (comment: any) => {
// console.log(comment);
if (tab == 1) { if (tab == 1) {
if ( if (
comment.communityName && comment.communityName != null ||
comment.communityName.length == 0 && comment.subscribeDate != null ||
comment.status == null && comment.status != null
comment.key == null
) { ) {
message.warning('Please fill in at least one condition');
return false;
}
if (comment.communityName != null || comment.key != null || comment.status != null) {
let obj = { let obj = {
communityNameList: comment.communityName ? comment.communityName : null, // 所选小区 communityNameList: comment.communityName ? comment.communityName : null, // 所选小区
subscribeDate: comment.key ? comment.key : null, // 时间 subscribeDate: comment.subscribeDate ? comment.subscribeDate : null, // 时间
status: comment.status !== null ? comment.status : null, // 状态 status: comment.status !== null ? comment.status : null, // 状态
pageNum: 1, // 实际搜索页码 pageNum: 1, // 实际搜索页码
globalMark: 'no', // 搜索全部内容 globalMark: 'no', // 搜索全部内容
...@@ -250,14 +247,6 @@ const FacilityBookings = (props: any) => { ...@@ -250,14 +247,6 @@ const FacilityBookings = (props: any) => {
requse(obj, tab); requse(obj, tab);
} }
} else { } else {
if (
comment.communityName2 &&
comment.communityName2.length == 0 &&
comment.facilityName == ''
) {
message.warning('Please fill in at least one condition');
return false;
}
if (comment.communityName2 != null || comment.facilityName != null) { if (comment.communityName2 != null || comment.facilityName != null) {
let obj = { let obj = {
communityNameList: comment.communityName2 ? comment.communityName2 : null, communityNameList: comment.communityName2 ? comment.communityName2 : null,
...@@ -327,6 +316,7 @@ const FacilityBookings = (props: any) => { ...@@ -327,6 +316,7 @@ const FacilityBookings = (props: any) => {
status: v.status !== null ? v.status : null, status: v.status !== null ? v.status : null,
globalMark: v.globalMark ? v.globalMark : 'yes', globalMark: v.globalMark ? v.globalMark : 'yes',
}; };
// console.log(obj);
QA({ ...obj }); QA({ ...obj });
RA(9, { ...obj }); RA(9, { ...obj });
} else { } else {
......
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