Commit 4231d95c by peii

直销开票申请及汇总

parent f329c8f6
......@@ -39,6 +39,7 @@ import DistributeInvoiceApplyDetail from '../src/pages/invoice/distribution/deta
// 直销开票
import DirectionInvoice from '../src/pages/invoice/direct';
import DirectionInvoiceCollections from '../src/pages/invoice/direct/collections';
import DirectionInvoiceApplyDetail from '../src/pages/invoice/direct/detail';
......@@ -72,6 +73,7 @@ const Router = createAppContainer(createStackNavigator({
DistributeInvoice: {screen: DistributeInvoice},
DistributeInvoiceApplyDetail: {screen: DistributeInvoiceApplyDetail},
DirectionInvoice: {screen: DirectionInvoice},
DirectionInvoiceCollections: {screen: DirectionInvoiceCollections},
DirectionInvoiceApplyDetail: {screen: DirectionInvoiceApplyDetail},
}, {
navigationOptions: {
......
......@@ -2,13 +2,13 @@
* @FilePath: /BoneHouse_Business_APP/app/action/SettlementAction.js
* @Author: peii
* @Date: 2021-12-21 16:30:41
* @LastEditTime: 2021-12-21 16:58:42
* @LastEditTime: 2022-01-05 15:35:27
* @LastEditors: peii
* @Vision: 1.0
* @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 { GetRequest } from '../network/RequestUtils'
import { getUrlParams } from '../utils/Utils'
......@@ -24,6 +24,17 @@ const settlementStatus = [
{ 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 = () => {
return (dispatch, getState) => {
let { global_domain_config, token } = getState().login
......@@ -44,3 +55,24 @@ export function setSettlementStatus(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---------------------------
export const LOGIN_NO = "LOGIN_NO"
export const LOGIN_DOING = "LOGIN_DOING"
......@@ -70,3 +79,4 @@ export const DEVICE_INFORMATION_UPDATE_FAILURE = "DEVICE_INFORMATION_UPDATE_FAIL
//-----------settlement information---------------------
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 {
font_family_regular,
} from '../../base/BaseStyle'
import { exitLoginStatus, requestSysProfile, setNavigation } from '../../action/LoginAction'
import { getSettlementStatus } from '../../action/SettlementAction'
import { getSettlementStatus, getInvoiceStatus } from '../../action/SettlementAction'
import HeadBackItem from '../common/HeadBackItem'
import StatusBarView from '../common/StatusBarView'
import TabBottomItem from './module/TabBottomItem'
......@@ -79,14 +79,14 @@ class HomePage extends Component {
page: '',
},
MOBILE_DIRECT_INVOICE_APPLICATION: {
icon: require('../../images/quick_order.png'),
icon: require('../../images/direct_invoice_icon.png'),
title: '直销-开票申请',
page: 'DirectionInvoice',
},
MOBILE_DIRECT_INVOICE_GATHER: {
icon: require('../../images/quick_order.png'),
icon: require('../../images/invoice_list_icon.png'),
title: '直销-开票汇总',
page: '',
page: 'DirectionInvoiceCollections',
},
},
},
......@@ -201,6 +201,7 @@ class HomePage extends Component {
if (isBlank(settlementModule)) return
this.props.getSettlementStatus()
this.props.getInvoiceStatus()
}
// 跳转页面
......@@ -346,6 +347,9 @@ const mapDispatchToProps = dispatch => ({
getSettlementStatus: () => {
dispatch(getSettlementStatus())
},
getInvoiceStatus: () => {
dispatch(getInvoiceStatus())
},
})
export default connect(mapStateToProps, mapDispatchToProps)(HomePage)
......@@ -2,15 +2,16 @@
* @FilePath: /BoneHouse_Business_APP/app/reducers/module/settlement.js
* @Author: peii
* @Date: 2021-12-21 16:52:11
* @LastEditTime: 2021-12-21 16:57:52
* @LastEditTime: 2022-01-05 15:20:50
* @LastEditors: peii
* @Vision: 1.0
* @Description: 结算
*/
import { SET_SETTLEMENT_STATUS } from '../../base/ActionTypes'
import { SET_SETTLEMENT_STATUS, SET_INVOICE_STATUS } from '../../base/ActionTypes'
const defaultState = {
headerStatus: [],
invoiceHeaderStatus: []
}
export default (state = defaultState, action) => {
......@@ -20,6 +21,11 @@ export default (state = defaultState, action) => {
headerStatus: action.values,
})
case SET_INVOICE_STATUS:
return Object.assign({}, state, {
invoiceHeaderStatus: action.values,
})
default:
return state
}
......
......@@ -42,6 +42,11 @@
width 80px
height @width
&-status
&__text
font-size 16px
font-family font_family_regular
.text
&-red
color #f00
......
......@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/components/list.tsx
* @Author: peii
* @Date: 2021-12-19 10:44:15
* @LastEditTime: 2022-01-04 11:49:24
* @LastEditTime: 2022-01-05 11:34:50
* @LastEditors: peii
* @Vision: 1.0
* @Description: 汇总列表
......@@ -119,6 +119,12 @@ class DistributeInvoiceList extends Component<IProps> {
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: 结算单单项
* @param {*} param1
......@@ -128,9 +134,9 @@ class DistributeInvoiceList extends Component<IProps> {
const { isCollection } = this.props
// 开票汇总
if (isCollection) {
return this.renderCollectionItem.call(this, item, index)
}
// if (isCollection) {
// return this.renderCollectionItem.call(this, item, index)
// }
// 分销开票申请单项
return (
......@@ -154,7 +160,19 @@ class DistributeInvoiceList extends Component<IProps> {
<Text style={g(styles, 'item-text', 'item-left-text')}>
金额: {item.total_amount && item.total_amount.toFixed(2)}
</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 style={g(styles, 'item-select')}>
<Checkbox
style={g(styles, 'item-select-box')}
......@@ -163,6 +181,7 @@ class DistributeInvoiceList extends Component<IProps> {
onChange={checked => this.checkedHandler(checked, item)}
/>
</View>
)}
</View>
{/* <View style={g(styles, 'item-line')}>
......
......@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/direct/detail.tsx
* @Author: peii
* @Date: 2021-12-29 11:26:53
* @LastEditTime: 2022-01-04 17:00:14
* @LastEditTime: 2022-01-05 11:45:19
* @LastEditors: peii
* @Vision: 1.0
* @Description: 开票申请详情
......@@ -136,6 +136,8 @@ class InvoiceApplyDetail extends Component<IProps> {
* @return {*}
*/
renderItem({ item, index }) {
const isCollection = this.props.navigation.getParam('isCollection', false)
return (
<View style={g(styles, 'item')}>
<View style={g(styles, 'item-info')}>
......@@ -167,6 +169,23 @@ class InvoiceApplyDetail extends Component<IProps> {
金额: {item.consumed_quantity * item.consumed_price}
</Text>
</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 style={g(styles, 'item-select')}>
<Checkbox
......
......@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/services/api.ts
* @Author: peii
* @Date: 2021-12-19 16:06:26
* @LastEditTime: 2022-01-04 17:21:58
* @LastEditTime: 2022-01-05 15:32:02
* @LastEditors: peii
* @Vision: 1.0
* @Description: 未重构完全暂用的所有请求
......@@ -90,7 +90,7 @@ export default {
* @return {*}
*/
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