notice.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. import React, {Component} from 'react';
  2. import {View, TouchableOpacity, Image, Text, SafeAreaView} from 'react-native';
  3. import {
  4. DatePicker,
  5. Drawer,
  6. List,
  7. Provider,
  8. Tabs,
  9. Picker,
  10. InputItem,
  11. } from '@ant-design/react-native';
  12. import NoticeMessage from "./notice_message";
  13. import Message from "./message";
  14. import public_css from '../../source/css/public_css';
  15. import invoice_inquiry_css from '../tax/invoiceInquiry/invoice_inquiry_css';
  16. export default class notice extends Component {
  17. constructor(props) {
  18. super(props);
  19. this.props.navigation.dangerouslyGetParent().setOptions({
  20. tabBarVisible: false,
  21. });
  22. this.state = {
  23. isShowSearch: false,
  24. visible1: false,
  25. tab: 0,
  26. clickNum: 0,
  27. beginDateTime: undefined,
  28. endDateTime: undefined,
  29. customerName: '',
  30. customerEntTaxId: '',
  31. invoiceCode: '',
  32. invoiceNumber: '',
  33. hongchongFlag: undefined,
  34. };
  35. }
  36. render() {
  37. const tabs = [{title: '消息'}, {title: '公告'}];
  38. return (
  39. <SafeAreaView style={public_css.body}>
  40. <Tabs tabs={tabs} onChange={(i, l) => this.onChanges(i, l)} page={0}>
  41. <View style={invoice_inquiry_css.container}>
  42. <Message children={this} />
  43. </View>
  44. <View style={invoice_inquiry_css.container}>
  45. <NoticeMessage children={this} />
  46. </View>
  47. </Tabs>
  48. </SafeAreaView>
  49. );
  50. }
  51. //tab变化事件
  52. onChanges = (i, l) => {
  53. this.setState({
  54. tab: l,
  55. clickNum: 0,
  56. beginDateTime: undefined,
  57. endDateTime: undefined,
  58. customerName: '',
  59. customerEntTaxId: '',
  60. invoiceCode: '',
  61. invoiceNumber: '',
  62. hongchongFlag: undefined,
  63. });
  64. };
  65. //传递方法到子组件
  66. getOnGoingRef = ref => {
  67. this.goingChild = ref;
  68. };
  69. //传递方法到子组件
  70. getCompletedRef = ref => {
  71. this.completedChild = ref;
  72. };
  73. //传递方法到子组件
  74. getFailRef = ref => {
  75. this.failChild = ref;
  76. };
  77. //查询菜单开关状态
  78. openStatus = open => {
  79. if (open) {
  80. } else {
  81. // this.props.children.setClickNum();
  82. }
  83. };
  84. //获取查询开始时间
  85. beginTimeChange = time => {
  86. this.setState({
  87. beginDateTime: time,
  88. });
  89. };
  90. //获取查询结束时间
  91. endTimeChange = time => {
  92. this.setState({
  93. endDateTime: time,
  94. });
  95. };
  96. //获取查询是否红冲
  97. flagChange = select => {
  98. this.setState({
  99. hongchongFlag: select,
  100. });
  101. };
  102. //查询
  103. submitData = () => {
  104. let tab = this.state.tab;
  105. if (tab == 0) {
  106. this.drawer.closeDrawer();
  107. this.goingChild.initData();
  108. }
  109. if (tab == 1) {
  110. this.drawer.closeDrawer();
  111. this.completedChild.initData();
  112. }
  113. if (tab == 2) {
  114. this.drawer.closeDrawer();
  115. this.failChild.initData();
  116. }
  117. };
  118. //清空查询数据
  119. searchDataEmpty = () => {
  120. this.setState({
  121. beginDateTime: undefined,
  122. endDateTime: undefined,
  123. customerName: '',
  124. customerEntTaxId: '',
  125. invoiceCode: '',
  126. invoiceNumber: '',
  127. hongchongFlag: undefined,
  128. });
  129. };
  130. }