import React, {Component} from 'react';
import {Image, Text, TouchableOpacity, View} from 'react-native';
import {
DatePicker,
Drawer,
List,
Provider,
Tabs,
InputItem,
} from '@ant-design/react-native';
import Invoice_inquiry_ongoing from './invoice_inquiry_ongoing';
import Invoice_inquiry_completed from './invoice_inquiry_completed';
import Invoice_inquiry_fail from './invoice_inquiry_fail';
import public_css from '../../source/css/public_css';
import invoice_red_rush_css from './invoice_red_rush_css';
export default class invoice_inquiry_red_rush extends Component {
constructor(props) {
super(props);
this.props.navigation.dangerouslyGetParent().setOptions({
tabBarVisible: false,
});
this.state = {
isShowSearch: false,
visible1: false,
tab: 0,
clickNum: 0,
beginDateTime: undefined,
endDateTime: undefined,
belongEntTaxId: '',
invoiceCode: '',
invoiceNumber: '',
};
}
render() {
const tabs = [{title: '进行中'}, {title: '开具完成'}, {title: '开具失败'}];
let draw = (
,
nextState: Readonly,
nextContext: any,
): boolean {
if (nextProps.route.params != undefined) {
if (nextProps.route.params.isShow) {
if (this.state.clickNum === 0) {
this.setState({
isShowSearch: true,
clickNum: this.state.clickNum++,
});
this.drawer.openDrawer();
this.props.navigation.setParams({
isShow: false,
});
}
}
}
return true;
}
//tab变化事件
onChanges = (i, l) => {
this.setState({
tab: l,
clickNum: 0,
beginDateTime: undefined,
endDateTime: undefined,
belongEntTaxId: '',
invoiceCode: '',
invoiceNumber: '',
});
};
//传递方法到子组件
getOnGoingRef = ref => {
this.goingChild = ref;
};
//传递方法到子组件
getCompletedRef = ref => {
this.completedChild = ref;
};
//传递方法到子组件
getFailRef = ref => {
this.failChild = ref;
};
//查询菜单开关状态
openStatus = open => {
if (open) {
} else {
// this.props.children.setClickNum();
}
};
//获取查询开始时间
beginTimeChange = time => {
this.setState({
beginDateTime: time,
});
};
//获取查询结束时间
endTimeChange = time => {
this.setState({
endDateTime: time,
});
};
//查询
submitData = () => {
let tab = this.state.tab;
if (tab == 0) {
this.drawer.closeDrawer();
this.goingChild.initData();
}
if (tab == 1) {
this.drawer.closeDrawer();
this.completedChild.initData();
}
if (tab == 2) {
this.drawer.closeDrawer();
this.failChild.initData();
}
};
//清空查询数据
searchDataEmpty = () => {
this.setState({
beginDateTime: undefined,
endDateTime: undefined,
belongEntTaxId: '',
invoiceCode: '',
invoiceNumber: '',
});
};
}