123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505 |
- import React, {Component} from 'react';
- import {
- View,
- Image,
- Text,
- SafeAreaView,
- ScrollView,
- } from 'react-native';
- import {Tabs, WingBlank, WhiteSpace} from '@ant-design/react-native';
- import public_css from '../../source/css/public_css';
- import {RetrieveData} from '../../data/storage';
- import {RequestNetwork} from '../../data/encryption';
- export default class home_amount_statistics extends Component {
- constructor(props) {
- super(props);
- this.props.navigation.dangerouslyGetParent().setOptions({
- tabBarVisible: false,
- });
- this.state = {
- tab: 0,
- clickNum: 0,
- statisticsData: {},
- nowDate: '',
- };
- }
- render() {
- const tabs = [{title: '本月'}, {title: '本季'}];
- return (
- <SafeAreaView style={public_css.body}>
- <View style={{height: 200, backgroundColor: '#2A67FE'}}>
- <View
- style={{flex: 2, justifyContent: 'center', alignItems: 'center'}}>
- <Text style={{color: '#ffffff', fontWeight: 'bold', fontSize: 18}}>
- {this.state.nowDate}
- </Text>
- {/*<Text style={{color: '#ffffff', fontWeight: 'bold', fontSize: 14}}>*/}
- {/* 本月开票总数*/}
- {/*</Text>*/}
- {/*<Text style={{color: '#ffffff', fontWeight: 'bold', fontSize: 30}}>*/}
- {/* 235*/}
- {/*</Text>*/}
- </View>
- <View style={{flex: 1, flexDirection: 'row'}}>
- <View
- style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
- <View style={{alignItems: 'center'}}>
- <Text
- style={{color: '#ffffff', fontWeight: 'bold', fontSize: 16}}>
- 开票总额(元)
- </Text>
- <Text
- style={{color: '#ffffff', fontWeight: 'bold', fontSize: 20}}>
- {this.state.statisticsData.monthTotal}
- </Text>
- </View>
- </View>
- <View
- style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
- <View style={{alignItems: 'center'}}>
- <Text
- style={{color: '#ffffff', fontWeight: 'bold', fontSize: 16}}>
- 税额(元)
- </Text>
- <Text
- style={{color: '#ffffff', fontWeight: 'bold', fontSize: 20}}>
- {this.state.statisticsData.monthTotalTaxes}
- </Text>
- </View>
- </View>
- </View>
- </View>
- <Tabs tabs={tabs} onChange={(i, l) => this.onChanges(i, l)} page={0}>
- <ScrollView>
- <View style={{backgroundColor: '#FCFCFE'}}>
- <View
- style={{
- flexDirection: 'row',
- margin: 10,
- height: 20,
- alignItems: 'center',
- }}>
- <View
- style={{borderWidth: 1.5, height: 15, borderColor: '#2A67FE'}}
- />
- <View style={{marginLeft: 10}}>
- <Text
- style={{
- fontWeight: 'bold',
- color: '#464646',
- fontSize: 15,
- }}>
- 未税金额
- </Text>
- </View>
- </View>
- <WhiteSpace />
- <WingBlank>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 50,
- backgroundColor: '#ffffff',
- }}>
- <View style={{flexDirection: 'row'}}>
- <Image
- style={{marginLeft: 10, width: 20, height: 20}}
- source={require('../../source/img/homeImg/leiji.png')}
- />
- <Text style={{marginLeft: 5}}>
- 累计成功开票未税金额(元)
- </Text>
- </View>
- <View>
- <Text style={{marginRight: 10}}>{this.state.statisticsData.monthTotal}</Text>
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- <WhiteSpace />
- <WingBlank>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 50,
- backgroundColor: '#ffffff',
- }}>
- <View style={{flexDirection: 'row'}}>
- <Image
- style={{marginLeft: 10, width: 20, height: 20}}
- source={require('../../source/img/homeImg/zhuan.png')}
- />
- <Text style={{marginLeft: 5}}>专票开票未税金额(元)</Text>
- </View>
- <View>
- <Text style={{marginRight: 10}}>{this.state.statisticsData.monthZhuanpiaoTotal}</Text>
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- <WhiteSpace />
- <WingBlank>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 50,
- backgroundColor: '#ffffff',
- }}>
- <View style={{flexDirection: 'row'}}>
- <Image
- style={{marginLeft: 10, width: 20, height: 20}}
- source={require('../../source/img/homeImg/leijicheng.png')}
- />
- <Text style={{marginLeft: 5}}>普票开票未税金额(元)</Text>
- </View>
- <View>
- <Text style={{marginRight: 10}}>{this.state.statisticsData.monthPupiaoTotal}</Text>
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- <View
- style={{
- flexDirection: 'row',
- margin: 10,
- height: 20,
- alignItems: 'center',
- }}>
- <View
- style={{borderWidth: 1.5, height: 15, borderColor: '#2A67FE'}}
- />
- <View style={{marginLeft: 10}}>
- <Text
- style={{
- fontWeight: 'bold',
- color: '#464646',
- fontSize: 15,
- }}>
- 累计税额
- </Text>
- </View>
- </View>
- <WhiteSpace />
- <WingBlank>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 50,
- backgroundColor: '#ffffff',
- }}>
- <View style={{flexDirection: 'row'}}>
- <Image
- style={{marginLeft: 10, width: 20, height: 20}}
- source={require('../../source/img/homeImg/leiji.png')}
- />
- <Text style={{marginLeft: 5}}>累计开票税额(元)</Text>
- </View>
- <View>
- <Text style={{marginRight: 10}}>{this.state.statisticsData.monthTotalTaxes}</Text>
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- <WhiteSpace />
- <WingBlank>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 50,
- backgroundColor: '#ffffff',
- }}>
- <View style={{flexDirection: 'row'}}>
- <Image
- style={{marginLeft: 10, width: 20, height: 20}}
- source={require('../../source/img/homeImg/zhuan.png')}
- />
- <Text style={{marginLeft: 5}}>专票开票税额(元)</Text>
- </View>
- <View>
- <Text style={{marginRight: 10}}>{this.state.statisticsData.monthZhuanpiaoTotalTaxes}</Text>
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- <WhiteSpace />
- <WingBlank>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 50,
- backgroundColor: '#ffffff',
- }}>
- <View style={{flexDirection: 'row'}}>
- <Image
- style={{marginLeft: 10, width: 20, height: 20}}
- source={require('../../source/img/homeImg/leijicheng.png')}
- />
- <Text style={{marginLeft: 5}}>普票开票税额(元)</Text>
- </View>
- <View>
- <Text style={{marginRight: 10}}>{this.state.statisticsData.monthPupiaoTotalTaxes}</Text>
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- </View>
- </ScrollView>
- <ScrollView>
- <View style={{backgroundColor: '#FCFCFE'}}>
- <View
- style={{
- flexDirection: 'row',
- margin: 10,
- height: 20,
- alignItems: 'center',
- }}>
- <View
- style={{borderWidth: 1.5, height: 15, borderColor: '#2A67FE'}}
- />
- <View style={{marginLeft: 10}}>
- <Text
- style={{
- fontWeight: 'bold',
- color: '#464646',
- fontSize: 15,
- }}>
- 未税金额
- </Text>
- </View>
- </View>
- <WhiteSpace />
- <WingBlank>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 50,
- backgroundColor: '#ffffff',
- }}>
- <View style={{flexDirection: 'row'}}>
- <Image
- style={{marginLeft: 10, width: 20, height: 20}}
- source={require('../../source/img/homeImg/leiji.png')}
- />
- <Text style={{marginLeft: 5}}>
- 累计成功开票未税金额(元)
- </Text>
- </View>
- <View>
- <Text style={{marginRight: 10}}>{this.state.statisticsData.quarterTotal}</Text>
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- <WhiteSpace />
- <WingBlank>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 50,
- backgroundColor: '#ffffff',
- }}>
- <View style={{flexDirection: 'row'}}>
- <Image
- style={{marginLeft: 10, width: 20, height: 20}}
- source={require('../../source/img/homeImg/zhuan.png')}
- />
- <Text style={{marginLeft: 5}}>专票开票未税金额(元)</Text>
- </View>
- <View>
- <Text style={{marginRight: 10}}>{this.state.statisticsData.quarterZhuanpiaoTotal}</Text>
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- <WhiteSpace />
- <WingBlank>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 50,
- backgroundColor: '#ffffff',
- }}>
- <View style={{flexDirection: 'row'}}>
- <Image
- style={{marginLeft: 10, width: 20, height: 20}}
- source={require('../../source/img/homeImg/leijicheng.png')}
- />
- <Text style={{marginLeft: 5}}>普票开票未税金额(元)</Text>
- </View>
- <View>
- <Text style={{marginRight: 10}}>{this.state.statisticsData.quarterPupiaoTotal}</Text>
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- <View
- style={{
- flexDirection: 'row',
- margin: 10,
- height: 20,
- alignItems: 'center',
- }}>
- <View
- style={{borderWidth: 1.5, height: 15, borderColor: '#2A67FE'}}
- />
- <View style={{marginLeft: 10}}>
- <Text
- style={{
- fontWeight: 'bold',
- color: '#464646',
- fontSize: 15,
- }}>
- 累计税额
- </Text>
- </View>
- </View>
- <WhiteSpace />
- <WingBlank>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 50,
- backgroundColor: '#ffffff',
- }}>
- <View style={{flexDirection: 'row'}}>
- <Image
- style={{marginLeft: 10, width: 20, height: 20}}
- source={require('../../source/img/homeImg/leiji.png')}
- />
- <Text style={{marginLeft: 5}}>累计开票税额(元)</Text>
- </View>
- <View>
- <Text style={{marginRight: 10}}>{this.state.statisticsData.quarterTotalTaxes}</Text>
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- <WhiteSpace />
- <WingBlank>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 50,
- backgroundColor: '#ffffff',
- }}>
- <View style={{flexDirection: 'row'}}>
- <Image
- style={{marginLeft: 10, width: 20, height: 20}}
- source={require('../../source/img/homeImg/zhuan.png')}
- />
- <Text style={{marginLeft: 5}}>专票开票税额(元)</Text>
- </View>
- <View>
- <Text style={{marginRight: 10}}>{this.state.statisticsData.quarterZhuanpiaoTotalTaxes}</Text>
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- <WhiteSpace />
- <WingBlank>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'space-between',
- height: 50,
- backgroundColor: '#ffffff',
- }}>
- <View style={{flexDirection: 'row'}}>
- <Image
- style={{marginLeft: 10, width: 20, height: 20}}
- source={require('../../source/img/homeImg/leijicheng.png')}
- />
- <Text style={{marginLeft: 5}}>普票开票税额(元)</Text>
- </View>
- <View>
- <Text style={{marginRight: 10}}>{this.state.statisticsData.quarterPupiaoTotalTaxes}</Text>
- </View>
- </View>
- </WingBlank>
- <WhiteSpace />
- </View>
- </ScrollView>
- </Tabs>
- </SafeAreaView>
- );
- }
- componentDidMount() {
- this.getNowDate();
- this.getInvoiceStatistics();
- }
- //获取统计数据
- getInvoiceStatistics = async () => {
- const company = JSON.parse(await RetrieveData('company'));
- const token = await RetrieveData('token');
- if (token && company) {
- const url = '/sys/stat/toInvoice';
- let response = await RequestNetwork(
- url,
- token,
- {
- entTaxId: company.entTaxId,
- },
- false,
- 2,
- );
- if (response) {
- console.log(response);
- if (response.code === 0) {
- this.setState({
- statisticsData: response.data,
- });
- } else {
- // await this.abnormalMessage(response);
- }
- }
- }
- };
- // 获取当前年月
- getNowDate = () => {
- let now = new Date(); //当前日期
- let nowMonth = now.getMonth(); //当前月
- let nowYear = now.getFullYear(); //当前年
- let monthStartDate = new Date(nowYear, nowMonth, 1);
- let yy = monthStartDate.getFullYear();
- let mm =
- monthStartDate.getMonth() + 1 < 10
- ? '0' + (monthStartDate.getMonth() + 1)
- : monthStartDate.getMonth() + 1;
- this.setState({
- nowDate: yy + '年' + mm + '月',
- });
- };
- //tab变化事件
- onChanges = (i, l) => {
- this.getInvoiceStatistics();
- };
- }
|