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 = ( this.beginTimeChange(time)} format="YYYY-MM-DD"> 开始时间 this.endTimeChange(time)} format="YYYY-MM-DD"> 结束时间 { this.setState({ customerName: value, }); }} placeholder="请输入要查询的客户名"> 客户名: { this.setState({ customerEntTaxId: value, }); }} placeholder="请输入要查询的客户企业税号"> 客户企业税号: { this.setState({ invoiceCode: value, }); }} placeholder="请输入要查询的发票代码"> 发票代码: { this.setState({ invoiceNumber: value, }); }} placeholder="请输入要查询的发票号码"> 发票号码: this.flagChange(select)} cascade={false}> 发票是否可红冲: { this.searchDataEmpty(); }}> 全部清除 this.submitData()}> 查询 ); return ( (this.drawer = el)} onOpenChange={(open) => this.openStatus(open)} drawerBackgroundColor="#ccc" drawerWidth={300}> this.onChanges(i, l)} page={0}> ); } //判断是否点击了查询 shouldComponentUpdate( nextProps: Readonly

, 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, }); }; }