Commit 1e03a8c7 by peii

分销开票对接

(cherry picked from commit e1710fdc)
parent 53607081
...@@ -57,3 +57,14 @@ ...@@ -57,3 +57,14 @@
&__text &__text
color #444 color #444
&-disabled
@extend .row
background-color #ddd
width 100%
&__text
color #999
font-size 18px
font-family font_family_regular
margin-left 8px
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/index.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/index.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-27 09:59:21 * @Date: 2021-12-27 09:59:21
* @LastEditTime: 2021-12-31 15:55:36 * @LastEditTime: 2022-01-04 10:53:48
* @LastEditors: peii * @LastEditors: peii
* @Vision: 1.0 * @Vision: 1.0
* @Description: 分销开票申请 * @Description: 分销开票申请
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
// @ts-nocheck // @ts-nocheck
import React, { Component } from 'react' import React, { Component } from 'react'
import { View, Text, TouchableOpacity, FlatList, Image } from 'react-native' import { View, Text, TouchableOpacity, Image, ActivityIndicator } from 'react-native'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import * as R from 'ramda' import * as R from 'ramda'
import { INavigation } from 'navigation' import { INavigation } from 'navigation'
...@@ -63,6 +63,7 @@ class Distribution extends Component<IProps, IState> { ...@@ -63,6 +63,7 @@ class Distribution extends Component<IProps, IState> {
sum: 0, sum: 0,
}, },
customers: [], customers: [],
submitting: false,
} }
componentDidMount() { componentDidMount() {
...@@ -275,15 +276,17 @@ class Distribution extends Component<IProps, IState> { ...@@ -275,15 +276,17 @@ class Distribution extends Component<IProps, IState> {
lines, lines,
} }
this.setState({ submitting: true })
const res = await api.postArInvoiceCreate(params) const res = await api.postArInvoiceCreate(params)
this.setState({ submitting: false })
if (res.error_code) return if (res.error_code) return
show('申请提交成功')
this.props.navigation.pop()
} }
render() { render() {
const title = this.props.navigation.getParam('title') const title = this.props.navigation.getParam('title')
const { visible, loading, data, fresh, statistic } = this.state const { visible, loading, data, fresh, statistic, submitting } = this.state
return ( return (
<View style={g(styles, 'container')}> <View style={g(styles, 'container')}>
...@@ -331,6 +334,7 @@ class Distribution extends Component<IProps, IState> { ...@@ -331,6 +334,7 @@ class Distribution extends Component<IProps, IState> {
<Text style={g(styles, 'body-ft-statistic__text')}>申请开票总金额: {statistic.sum}</Text> <Text style={g(styles, 'body-ft-statistic__text')}>申请开票总金额: {statistic.sum}</Text>
</View> </View>
<View style={g(styles, 'body-ft-btn')}> <View style={g(styles, 'body-ft-btn')}>
{!submitting ? (
<TouchableOpacity <TouchableOpacity
style={g(styles, 'btn', 'btn-submit')} style={g(styles, 'btn', 'btn-submit')}
activeOpacity={0.8} activeOpacity={0.8}
...@@ -338,6 +342,12 @@ class Distribution extends Component<IProps, IState> { ...@@ -338,6 +342,12 @@ class Distribution extends Component<IProps, IState> {
> >
<Text style={g(styles, 'btn__text', 'btn-submit__text')}>申请开票</Text> <Text style={g(styles, 'btn__text', 'btn-submit__text')}>申请开票</Text>
</TouchableOpacity> </TouchableOpacity>
) : (
<TouchableOpacity style={g(styles, 'btn', 'btn-disabled')} activeOpacity={1}>
<ActivityIndicator style={g(styles, 'btn-indicator')}></ActivityIndicator>
<Text style={g(styles, 'btn__text', 'btn-disabled__text')}>申请开票</Text>
</TouchableOpacity>
)}
{/* <TouchableOpacity {/* <TouchableOpacity
style={g(styles, 'btn', 'btn-select')} style={g(styles, 'btn', 'btn-select')}
activeOpacity={0.8} activeOpacity={0.8}
......
...@@ -123,6 +123,9 @@ export const request = (args: Partial<RequestConfig>) => { ...@@ -123,6 +123,9 @@ export const request = (args: Partial<RequestConfig>) => {
return doRequest() return doRequest()
} }
failHandler(e, pid) failHandler(e, pid)
if (!e.error_code) {
e.error_code = e.status
}
reject(e) reject(e)
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment