import React, {Component} from 'react';
import {View, TouchableOpacity, Image, Text} from 'react-native';
import {
DatePicker,
Drawer,
List,
Provider,
Tabs,
Picker,
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_inquiry_css from './invoice_inquiry_css';
export default class invoice_inquiry 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,
customerName: '',
customerEntTaxId: '',
invoiceCode: '',
invoiceNumber: '',
hongchongFlag: undefined,
};
}
render() {
const tabs = [{title: '开具中'}, {title: '开具完成'}, {title: '开具失败'}];
const seasons = [
[
{
label: '全部',
value: 2,
},
{
label: '是',
value: true,
},
{
label: '否',
value: false,
},
],
];
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,
customerName: '',
customerEntTaxId: '',
invoiceCode: '',
invoiceNumber: '',
hongchongFlag: undefined,
});
};
//传递方法到子组件
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,
});
};
//获取查询是否红冲
flagChange = select => {
this.setState({
hongchongFlag: select,
});
};
//查询
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,
customerName: '',
customerEntTaxId: '',
invoiceCode: '',
invoiceNumber: '',
hongchongFlag: undefined,
});
};
}