Commit eb65aee0 by peii

直销开票申请及汇总

(cherry picked from commit 4231d95c)
parent 760913d5
...@@ -39,6 +39,7 @@ import DistributeInvoiceApplyDetail from '../src/pages/invoice/distribution/deta ...@@ -39,6 +39,7 @@ import DistributeInvoiceApplyDetail from '../src/pages/invoice/distribution/deta
// 直销开票 // 直销开票
import DirectionInvoice from '../src/pages/invoice/direct'; import DirectionInvoice from '../src/pages/invoice/direct';
import DirectionInvoiceCollections from '../src/pages/invoice/direct/collections';
import DirectionInvoiceApplyDetail from '../src/pages/invoice/direct/detail'; import DirectionInvoiceApplyDetail from '../src/pages/invoice/direct/detail';
...@@ -72,6 +73,7 @@ const Router = createAppContainer(createStackNavigator({ ...@@ -72,6 +73,7 @@ const Router = createAppContainer(createStackNavigator({
DistributeInvoice: {screen: DistributeInvoice}, DistributeInvoice: {screen: DistributeInvoice},
DistributeInvoiceApplyDetail: {screen: DistributeInvoiceApplyDetail}, DistributeInvoiceApplyDetail: {screen: DistributeInvoiceApplyDetail},
DirectionInvoice: {screen: DirectionInvoice}, DirectionInvoice: {screen: DirectionInvoice},
DirectionInvoiceCollections: {screen: DirectionInvoiceCollections},
DirectionInvoiceApplyDetail: {screen: DirectionInvoiceApplyDetail}, DirectionInvoiceApplyDetail: {screen: DirectionInvoiceApplyDetail},
}, { }, {
navigationOptions: { navigationOptions: {
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
* @FilePath: /BoneHouse_Business_APP/app/action/SettlementAction.js * @FilePath: /BoneHouse_Business_APP/app/action/SettlementAction.js
* @Author: peii * @Author: peii
* @Date: 2021-12-21 16:30:41 * @Date: 2021-12-21 16:30:41
* @LastEditTime: 2021-12-21 16:58:42 * @LastEditTime: 2022-01-05 15:35:27
* @LastEditors: peii * @LastEditors: peii
* @Vision: 1.0 * @Vision: 1.0
* @Description: 结算模块 action * @Description: 结算模块 action
*/ */
import { SET_SETTLEMENT_STATUS } from '../base/ActionTypes' import { SET_SETTLEMENT_STATUS, SET_INVOICE_STATUS } from '../base/ActionTypes'
import * as R from 'ramda' import * as R from 'ramda'
import { GetRequest } from '../network/RequestUtils' import { GetRequest } from '../network/RequestUtils'
import { getUrlParams } from '../utils/Utils' import { getUrlParams } from '../utils/Utils'
...@@ -24,6 +24,17 @@ const settlementStatus = [ ...@@ -24,6 +24,17 @@ const settlementStatus = [
{ value_code: 'SUBMITTED', value_name: '已提交' }, { value_code: 'SUBMITTED', value_name: '已提交' },
] ]
const invoiceStatus = [
{ value_code: 'ENTERED', value_name: '未申请' },
{ value_code: 'INVOICING', value_name: '开票中' },
{ value_code: 'INVOICED', value_name: '开票完成' },
]
/**
* @description: 请求结算状态
* @param {*}
* @return {*}
*/
export const getSettlementStatus = () => { export const getSettlementStatus = () => {
return (dispatch, getState) => { return (dispatch, getState) => {
let { global_domain_config, token } = getState().login let { global_domain_config, token } = getState().login
...@@ -44,3 +55,24 @@ export function setSettlementStatus(valueSets) { ...@@ -44,3 +55,24 @@ export function setSettlementStatus(valueSets) {
values: valueSets, values: valueSets,
} }
} }
export const getInvoiceStatus = () => {
return (dispatch, getState) => {
let { global_domain_config, token } = getState().login
const params = {
access_token: token,
value_set_code: 'SUR_CONSUME_INVOICE_HEADER_STATUS',
}
GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params)).then(res => {
const values = R.pathOr(invoiceStatus, ['data', 'sys_values'])(res)
return dispatch(setInvoiceStatus(values))
})
}
}
export function setInvoiceStatus(values) {
return {
type: SET_INVOICE_STATUS,
values,
}
}
/*
* @FilePath: /BoneHouse_Business_APP/app/base/ActionTypes.js
* @Author: peii
* @Date: 2022-01-04 10:18:02
* @LastEditTime: 2022-01-05 14:52:02
* @LastEditors: peii
* @Vision: 1.0
* @Description:
*/
//-----------user--------------------------- //-----------user---------------------------
export const LOGIN_NO = "LOGIN_NO" export const LOGIN_NO = "LOGIN_NO"
export const LOGIN_DOING = "LOGIN_DOING" export const LOGIN_DOING = "LOGIN_DOING"
...@@ -70,3 +79,4 @@ export const DEVICE_INFORMATION_UPDATE_FAILURE = "DEVICE_INFORMATION_UPDATE_FAIL ...@@ -70,3 +79,4 @@ export const DEVICE_INFORMATION_UPDATE_FAILURE = "DEVICE_INFORMATION_UPDATE_FAIL
//-----------settlement information--------------------- //-----------settlement information---------------------
export const SET_SETTLEMENT_STATUS = 'SET_SETTLEMENT_STATUS' export const SET_SETTLEMENT_STATUS = 'SET_SETTLEMENT_STATUS'
export const SET_INVOICE_STATUS = 'SET_INVOICE_STATUS'
\ No newline at end of file
...@@ -14,7 +14,7 @@ import { ...@@ -14,7 +14,7 @@ import {
font_family_regular, font_family_regular,
} from '../../base/BaseStyle' } from '../../base/BaseStyle'
import { exitLoginStatus, requestSysProfile, setNavigation } from '../../action/LoginAction' import { exitLoginStatus, requestSysProfile, setNavigation } from '../../action/LoginAction'
import { getSettlementStatus } from '../../action/SettlementAction' import { getSettlementStatus, getInvoiceStatus } from '../../action/SettlementAction'
import HeadBackItem from '../common/HeadBackItem' import HeadBackItem from '../common/HeadBackItem'
import StatusBarView from '../common/StatusBarView' import StatusBarView from '../common/StatusBarView'
import TabBottomItem from './module/TabBottomItem' import TabBottomItem from './module/TabBottomItem'
...@@ -79,14 +79,14 @@ class HomePage extends Component { ...@@ -79,14 +79,14 @@ class HomePage extends Component {
page: '', page: '',
}, },
MOBILE_DIRECT_INVOICE_APPLICATION: { MOBILE_DIRECT_INVOICE_APPLICATION: {
icon: require('../../images/quick_order.png'), icon: require('../../images/direct_invoice_icon.png'),
title: '直销-开票申请', title: '直销-开票申请',
page: 'DirectionInvoice', page: 'DirectionInvoice',
}, },
MOBILE_DIRECT_INVOICE_GATHER: { MOBILE_DIRECT_INVOICE_GATHER: {
icon: require('../../images/quick_order.png'), icon: require('../../images/invoice_list_icon.png'),
title: '直销-开票汇总', title: '直销-开票汇总',
page: '', page: 'DirectionInvoiceCollections',
}, },
}, },
}, },
...@@ -201,6 +201,7 @@ class HomePage extends Component { ...@@ -201,6 +201,7 @@ class HomePage extends Component {
if (isBlank(settlementModule)) return if (isBlank(settlementModule)) return
this.props.getSettlementStatus() this.props.getSettlementStatus()
this.props.getInvoiceStatus()
} }
// 跳转页面 // 跳转页面
...@@ -346,6 +347,9 @@ const mapDispatchToProps = dispatch => ({ ...@@ -346,6 +347,9 @@ const mapDispatchToProps = dispatch => ({
getSettlementStatus: () => { getSettlementStatus: () => {
dispatch(getSettlementStatus()) dispatch(getSettlementStatus())
}, },
getInvoiceStatus: () => {
dispatch(getInvoiceStatus())
},
}) })
export default connect(mapStateToProps, mapDispatchToProps)(HomePage) export default connect(mapStateToProps, mapDispatchToProps)(HomePage)
...@@ -2,15 +2,16 @@ ...@@ -2,15 +2,16 @@
* @FilePath: /BoneHouse_Business_APP/app/reducers/module/settlement.js * @FilePath: /BoneHouse_Business_APP/app/reducers/module/settlement.js
* @Author: peii * @Author: peii
* @Date: 2021-12-21 16:52:11 * @Date: 2021-12-21 16:52:11
* @LastEditTime: 2021-12-21 16:57:52 * @LastEditTime: 2022-01-05 15:20:50
* @LastEditors: peii * @LastEditors: peii
* @Vision: 1.0 * @Vision: 1.0
* @Description: 结算 * @Description: 结算
*/ */
import { SET_SETTLEMENT_STATUS } from '../../base/ActionTypes' import { SET_SETTLEMENT_STATUS, SET_INVOICE_STATUS } from '../../base/ActionTypes'
const defaultState = { const defaultState = {
headerStatus: [], headerStatus: [],
invoiceHeaderStatus: []
} }
export default (state = defaultState, action) => { export default (state = defaultState, action) => {
...@@ -20,6 +21,11 @@ export default (state = defaultState, action) => { ...@@ -20,6 +21,11 @@ export default (state = defaultState, action) => {
headerStatus: action.values, headerStatus: action.values,
}) })
case SET_INVOICE_STATUS:
return Object.assign({}, state, {
invoiceHeaderStatus: action.values,
})
default: default:
return state return state
} }
......
...@@ -42,6 +42,11 @@ ...@@ -42,6 +42,11 @@
width 80px width 80px
height @width height @width
&-status
&__text
font-size 16px
font-family font_family_regular
.text .text
&-red &-red
color #f00 color #f00
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/components/list.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/components/list.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-19 10:44:15 * @Date: 2021-12-19 10:44:15
* @LastEditTime: 2022-01-04 11:49:24 * @LastEditTime: 2022-01-05 11:34:50
* @LastEditors: peii * @LastEditors: peii
* @Vision: 1.0 * @Vision: 1.0
* @Description: 汇总列表 * @Description: 汇总列表
...@@ -119,6 +119,12 @@ class DistributeInvoiceList extends Component<IProps> { ...@@ -119,6 +119,12 @@ class DistributeInvoiceList extends Component<IProps> {
return { count, sum: sum.toFixed(2) } return { count, sum: sum.toFixed(2) }
} }
statusClzMap = R.cond([
[R.equals('INVOICING'), R.always('text-red')],
[R.equals('INVOICED'), R.always('text-blue')],
[R.T, R.always('text-black')],
])
/** /**
* @description: 结算单单项 * @description: 结算单单项
* @param {*} param1 * @param {*} param1
...@@ -128,9 +134,9 @@ class DistributeInvoiceList extends Component<IProps> { ...@@ -128,9 +134,9 @@ class DistributeInvoiceList extends Component<IProps> {
const { isCollection } = this.props const { isCollection } = this.props
// 开票汇总 // 开票汇总
if (isCollection) { // if (isCollection) {
return this.renderCollectionItem.call(this, item, index) // return this.renderCollectionItem.call(this, item, index)
} // }
// 分销开票申请单项 // 分销开票申请单项
return ( return (
...@@ -154,7 +160,19 @@ class DistributeInvoiceList extends Component<IProps> { ...@@ -154,7 +160,19 @@ class DistributeInvoiceList extends Component<IProps> {
<Text style={g(styles, 'item-text', 'item-left-text')}> <Text style={g(styles, 'item-text', 'item-left-text')}>
金额: {item.total_amount && item.total_amount.toFixed(2)} 金额: {item.total_amount && item.total_amount.toFixed(2)}
</Text> </Text>
{isCollection && (
<Text style={g(styles, 'item-text', 'item-left-text')}>
申请开票时间: {item.invocie_time ? dayjs(item.invocie_time).format('YYYY-MM-DD') : '——'}
</Text>
)}
</View>
{isCollection ? (
<View style={g(styles, 'item-status')}>
<Text style={g(styles, 'item-status__text', this.statusClzMap(item.invoice_header_status))}>
{item.invoice_header_status_name}
</Text>
</View> </View>
) : (
<View style={g(styles, 'item-select')}> <View style={g(styles, 'item-select')}>
<Checkbox <Checkbox
style={g(styles, 'item-select-box')} style={g(styles, 'item-select-box')}
...@@ -163,6 +181,7 @@ class DistributeInvoiceList extends Component<IProps> { ...@@ -163,6 +181,7 @@ class DistributeInvoiceList extends Component<IProps> {
onChange={checked => this.checkedHandler(checked, item)} onChange={checked => this.checkedHandler(checked, item)}
/> />
</View> </View>
)}
</View> </View>
{/* <View style={g(styles, 'item-line')}> {/* <View style={g(styles, 'item-line')}>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/detail.tsx * @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/detail.tsx
* @Author: peii * @Author: peii
* @Date: 2021-12-29 11:26:53 * @Date: 2021-12-29 11:26:53
* @LastEditTime: 2022-01-04 17:00:14 * @LastEditTime: 2022-01-05 11:45:19
* @LastEditors: peii * @LastEditors: peii
* @Vision: 1.0 * @Vision: 1.0
* @Description: 开票申请详情 * @Description: 开票申请详情
...@@ -136,6 +136,8 @@ class InvoiceApplyDetail extends Component<IProps> { ...@@ -136,6 +136,8 @@ class InvoiceApplyDetail extends Component<IProps> {
* @return {*} * @return {*}
*/ */
renderItem({ item, index }) { renderItem({ item, index }) {
const isCollection = this.props.navigation.getParam('isCollection', false)
return ( return (
<View style={g(styles, 'item')}> <View style={g(styles, 'item')}>
<View style={g(styles, 'item-info')}> <View style={g(styles, 'item-info')}>
...@@ -167,6 +169,23 @@ class InvoiceApplyDetail extends Component<IProps> { ...@@ -167,6 +169,23 @@ class InvoiceApplyDetail extends Component<IProps> {
金额: {item.consumed_quantity * item.consumed_price} 金额: {item.consumed_quantity * item.consumed_price}
</Text> </Text>
</View> </View>
{isCollection && (
<>
<View style={g(styles, 'item-info-line')}>
<Text style={g(styles, 'item-info__text', 'item-info-line__text')}>
开票完成时间: {(item.invoiced_time && dayjs(item.invoiced_time).format('YYYY-MM-DD')) || '--'}
</Text>
<Text style={g(styles, 'item-info__text', 'item-info-line__text')}>
已开票数量: {item.invoiced_quantity || '--'}
</Text>
</View>
<View style={g(styles, 'item-info-line')}>
<Text style={g(styles, 'item-info__text', 'item-info-line__text')}>
发票号: {item.invoice_number || '--'}
</Text>
</View>
</>
)}
</View> </View>
{/* <View style={g(styles, 'item-select')}> {/* <View style={g(styles, 'item-select')}>
<Checkbox <Checkbox
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/services/api.ts * @FilePath: /BoneHouse_Business_APP/src/services/api.ts
* @Author: peii * @Author: peii
* @Date: 2021-12-19 16:06:26 * @Date: 2021-12-19 16:06:26
* @LastEditTime: 2022-01-04 17:21:58 * @LastEditTime: 2022-01-05 15:32:02
* @LastEditors: peii * @LastEditors: peii
* @Vision: 1.0 * @Vision: 1.0
* @Description: 未重构完全暂用的所有请求 * @Description: 未重构完全暂用的所有请求
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
* @return {*} * @return {*}
*/ */
postArInvoiceCreate(data: { org_code: string; customer_code: string; bill_to_site_code: string; lines: any[] }) { postArInvoiceCreate(data: { org_code: string; customer_code: string; bill_to_site_code: string; lines: any[] }) {
return request({ url: `${v}/ar_invoice/create`, data: { data }, method: 'post' }) return request({ url: `${v}/receivable/ar_invoice/create`, data: { data }, method: 'post' })
}, },
/** /**
......
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