Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
zhangzhonghua
/
BoneHouse_Business_APP
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6473ab48
authored
Jan 07, 2022
by
peii
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
分销汇总查询
parent
1f67fbdf
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
680 additions
and
34 deletions
app/Router.js
app/action/SettlementAction.js
app/base/ActionTypes.js
app/containers/home/HomePage.js
app/reducers/module/settlement.js
src/components/form/radio-filter.tsx
src/pages/invoice/distribution/collection.tsx
src/pages/invoice/distribution/collection_detail.tsx
src/pages/invoice/distribution/components/collections.tsx
src/pages/invoice/distribution/components/filter.tsx
src/pages/invoice/distribution/components/list.styl
src/pages/invoice/distribution/components/list.tsx
src/pages/invoice/distribution/index.tsx
src/services/api.ts
app/Router.js
View file @
6473ab48
...
...
@@ -36,6 +36,8 @@ import SettlementReject from '../src/pages/settlement/reject';
// 分销开票
import
DistributeInvoice
from
'../src/pages/invoice/distribution'
;
import
DistributeInvoiceApplyDetail
from
'../src/pages/invoice/distribution/detail'
;
import
DistributeInvoiceCollections
from
'../src/pages/invoice/distribution/collection'
;
import
DistributeInvoiceCollectionDetail
from
'../src/pages/invoice/distribution/collection_detail'
;
// 直销开票
import
DirectionInvoice
from
'../src/pages/invoice/direct'
;
...
...
@@ -72,6 +74,8 @@ const Router = createAppContainer(createStackNavigator({
SettlementSaleDetail
:
{
screen
:
SettlementSaleDetail
},
DistributeInvoice
:
{
screen
:
DistributeInvoice
},
DistributeInvoiceApplyDetail
:
{
screen
:
DistributeInvoiceApplyDetail
},
DistributeInvoiceCollections
:
{
screen
:
DistributeInvoiceCollections
},
DistributeInvoiceCollectionDetail
:
{
screen
:
DistributeInvoiceCollectionDetail
},
DirectionInvoice
:
{
screen
:
DirectionInvoice
},
DirectionInvoiceCollections
:
{
screen
:
DirectionInvoiceCollections
},
DirectionInvoiceApplyDetail
:
{
screen
:
DirectionInvoiceApplyDetail
},
...
...
app/action/SettlementAction.js
View file @
6473ab48
...
...
@@ -2,13 +2,13 @@
* @FilePath: /BoneHouse_Business_APP/app/action/SettlementAction.js
* @Author: peii
* @Date: 2021-12-21 16:30:41
* @LastEditTime: 2022-01-0
5 15:35:27
* @LastEditTime: 2022-01-0
7 16:52:23
* @LastEditors: peii
* @Vision: 1.0
* @Description: 结算模块 action
*/
import
{
SET_SETTLEMENT_STATUS
,
SET_INVOICE_STATUS
}
from
'../base/ActionTypes'
import
{
SET_SETTLEMENT_STATUS
,
SET_INVOICE_STATUS
,
SET_AR_INVOICE_STATUS
}
from
'../base/ActionTypes'
import
*
as
R
from
'ramda'
import
{
GetRequest
}
from
'../network/RequestUtils'
import
{
getUrlParams
}
from
'../utils/Utils'
...
...
@@ -27,7 +27,15 @@ const settlementStatus = [
const
invoiceStatus
=
[
{
value_code
:
'ENTERED'
,
value_name
:
'未申请'
},
{
value_code
:
'INVOICING'
,
value_name
:
'开票中'
},
{
value_code
:
'INVOICED'
,
value_name
:
'开票完成'
},
{
value_code
:
'INVOICED'
,
value_name
:
'已开票'
},
]
const
arInvoiceStatus
=
[
{
value_code
:
'ENTERED'
,
value_name
:
'已创建'
},
{
value_code
:
'SUBMITTED'
,
value_name
:
'已提交'
},
{
value_code
:
'INVOICED'
,
value_name
:
'已开票'
},
{
value_code
:
'INVALID'
,
value_name
:
'已作废'
},
{
value_code
:
'CANCELED'
,
value_name
:
'已取消'
},
]
/**
...
...
@@ -76,3 +84,24 @@ export function setInvoiceStatus(values) {
values
,
}
}
export
const
getArInvoiceStatus
=
()
=>
{
return
(
dispatch
,
getState
)
=>
{
let
{
global_domain_config
,
token
}
=
getState
().
login
const
params
=
{
access_token
:
token
,
value_set_code
:
'AR_INVOICE_HEADER_STATUS'
,
}
GetRequest
(
global_domain_config
,
getUrlParams
(
'/system/value_set/search'
,
params
)).
then
(
res
=>
{
const
values
=
R
.
pathOr
(
arInvoiceStatus
,
[
'data'
,
'sys_values'
])(
res
)
return
dispatch
(
setArInvoiceStatus
(
values
))
})
}
}
export
function
setArInvoiceStatus
(
values
)
{
return
{
type
:
SET_AR_INVOICE_STATUS
,
values
,
}
}
app/base/ActionTypes.js
View file @
6473ab48
...
...
@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/app/base/ActionTypes.js
* @Author: peii
* @Date: 2022-01-04 10:18:02
* @LastEditTime: 2022-01-0
5 18:15:40
* @LastEditTime: 2022-01-0
7 16:42:55
* @LastEditors: peii
* @Vision: 1.0
* @Description:
...
...
@@ -80,4 +80,5 @@ 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
export
const
SET_INVOICE_STATUS
=
'SET_INVOICE_STATUS'
export
const
SET_AR_INVOICE_STATUS
=
'SET_AR_INVOICE_STATUS'
\ No newline at end of file
app/containers/home/HomePage.js
View file @
6473ab48
...
...
@@ -15,7 +15,7 @@ import {
}
from
'../../base/BaseStyle'
import
{
exitLoginStatus
,
requestSysProfile
,
setNavigation
}
from
'../../action/LoginAction'
import
{
getLendOrderCodeValues
}
from
'../../action/SelfAction'
import
{
getSettlementStatus
,
getInvoiceStatus
}
from
'../../action/SettlementAction'
import
{
getSettlementStatus
,
getInvoiceStatus
,
getArInvoiceStatus
}
from
'../../action/SettlementAction'
import
HeadBackItem
from
'../common/HeadBackItem'
import
StatusBarView
from
'../common/StatusBarView'
import
TabBottomItem
from
'./module/TabBottomItem'
...
...
@@ -88,7 +88,7 @@ class HomePage extends Component {
MOBILE_DISTRIBUTION_INVOICE_GATHER
:
{
icon
:
require
(
'../../images/invoice_list_icon.png'
),
title
:
'分销-开票汇总'
,
page
:
''
,
page
:
'
DistributeInvoiceCollections
'
,
},
MOBILE_DIRECT_INVOICE_APPLICATION
:
{
icon
:
require
(
'../../images/direct_invoice_icon.png'
),
...
...
@@ -222,6 +222,9 @@ class HomePage extends Component {
this
.
props
.
getSettlementStatus
()
// 直销开票状态
this
.
props
.
getInvoiceStatus
()
// 分销开票状态
this
.
props
.
getArInvoiceStatus
()
}
getLendOrderCodeValues
()
{
...
...
@@ -380,6 +383,9 @@ const mapDispatchToProps = dispatch => ({
getInvoiceStatus
:
()
=>
{
dispatch
(
getInvoiceStatus
())
},
getArInvoiceStatus
:
()
=>
{
dispatch
(
getArInvoiceStatus
())
},
getLendOrderCodeValues
:
()
=>
{
dispatch
(
getLendOrderCodeValues
())
},
...
...
app/reducers/module/settlement.js
View file @
6473ab48
...
...
@@ -2,16 +2,17 @@
* @FilePath: /BoneHouse_Business_APP/app/reducers/module/settlement.js
* @Author: peii
* @Date: 2021-12-21 16:52:11
* @LastEditTime: 2022-01-0
5 15:20:50
* @LastEditTime: 2022-01-0
7 16:43:26
* @LastEditors: peii
* @Vision: 1.0
* @Description: 结算
*/
import
{
SET_SETTLEMENT_STATUS
,
SET_INVOICE_STATUS
}
from
'../../base/ActionTypes'
import
{
SET_SETTLEMENT_STATUS
,
SET_INVOICE_STATUS
,
SET_AR_INVOICE_STATUS
}
from
'../../base/ActionTypes'
const
defaultState
=
{
headerStatus
:
[],
invoiceHeaderStatus
:
[]
invoiceHeaderStatus
:
[],
arInvoiceHeaderStatus
:
[]
}
export
default
(
state
=
defaultState
,
action
)
=>
{
...
...
@@ -26,6 +27,11 @@ export default (state = defaultState, action) => {
invoiceHeaderStatus
:
action
.
values
,
})
case
SET_AR_INVOICE_STATUS
:
return
Object
.
assign
({},
state
,
{
arInvoiceHeaderStatus
:
action
.
values
,
})
default
:
return
state
}
...
...
src/components/form/radio-filter.tsx
View file @
6473ab48
...
...
@@ -38,7 +38,7 @@ export default class BoxRadio extends Component<IProps> {
return
(
<
View
style=
{
g
(
styles
,
'box-item'
)
}
>
<
Title
item=
{
item
}
style=
{
{
width
:
'auto'
}
}
/>
<
Title
item=
{
item
}
style=
{
{
width
:
'auto'
,
paddingTop
:
16
}
}
/>
<
View
style=
{
g
(
styles
,
'box-radio'
)
}
>
{
item
.
options
&&
...
...
src/pages/invoice/distribution/collection.tsx
View file @
6473ab48
/*
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/collection.tsx
* @Author: peii
* @Date: 2021-12-27
10:14:3
1
* @LastEditTime: 202
1-12-27 10:14:32
* @Date: 2021-12-27
09:59:2
1
* @LastEditTime: 202
2-01-07 16:53:05
* @LastEditors: peii
* @Vision: 1.0
* @Description: 分销开票申请汇总
*/
// @ts-nocheck
import
React
,
{
Component
}
from
'react'
import
{
View
,
Text
,
TouchableOpacity
,
Image
,
ActivityIndicator
}
from
'react-native'
import
{
connect
}
from
'react-redux'
import
*
as
R
from
'ramda'
import
{
INavigation
}
from
'navigation'
import
Loading
from
'../../../../app/containers/common/LodingModel'
import
Header
from
'../../../components/header/header'
import
Resolution
from
'../../../components/common/Resolution'
import
FilterModal
from
'./components/filter'
import
InvoiceCollections
from
'./components/collections'
import
{
FieldType
}
from
'../../../enums'
import
{
isBlank
,
g
,
isNotBlank
,
show
}
from
'../../../utils/utils'
import
api
from
'../../../services/api'
import
styles
from
'./index.styl'
type
IProps
=
{
navigation
:
INavigation
status
:
any
[]
}
type
IState
=
{
visible
:
boolean
}
class
Distribution
extends
Component
<
IProps
,
IState
>
{
constructor
(
props
)
{
super
(
props
)
this
.
toggleModalVisible
=
this
.
toggleModalVisible
.
bind
(
this
)
this
.
getData
=
this
.
getData
.
bind
(
this
)
this
.
getLineData
=
this
.
getLineData
.
bind
(
this
)
this
.
itemClickHandler
=
this
.
itemClickHandler
.
bind
(
this
)
}
state
=
{
visible
:
false
,
loading
:
false
,
data
:
[],
pagination
:
{
start_index
:
0
,
limit
:
10
,
},
filterData
:
{},
isEnd
:
false
,
otherFilterItems
:
[
{
field
:
'invoice_sys_number'
,
label
:
'发票系统编号'
,
type
:
FieldType
.
TEXT
,
},
{
field
:
'invoice_number'
,
label
:
'发票号'
,
type
:
FieldType
.
TEXT
,
},
{
field
:
'header_status'
,
label
:
'状态'
,
type
:
FieldType
.
RADIO
,
options
:
R
.
compose
(
R
.
map
(
R
.
applySpec
({
value
:
R
.
prop
(
'value_code'
),
label
:
R
.
prop
(
'value_name'
),
}),
),
R
.
propOr
([],
'status'
),
)(
this
.
props
),
},
],
}
componentDidMount
()
{
this
.
toggleModalVisible
()
}
toggleModalVisible
()
{
const
{
visible
}
=
this
.
state
this
.
setState
({
visible
:
!
visible
})
}
/**
* @description: 请求分销结算数据
* @param {object} args 过滤参数
* @param {boolean} isRefresh 是否刷新类型
* @param {boolean} isNext 是否下一页
* @return {*}
*/
async
getData
(
args
,
isRefresh
=
false
,
isNext
=
false
)
{
// 确认页面只过滤出已输入的那些
let
{
pagination
,
filterData
,
data
,
isEnd
}
=
this
.
state
if
(
isRefresh
||
isNotBlank
(
args
))
{
pagination
.
start_index
=
0
}
if
(
isNext
)
{
pagination
.
start_index
+=
pagination
.
limit
if
(
isEnd
)
return
}
if
(
isBlank
(
args
))
{
args
=
filterData
}
else
{
this
.
setState
({
filterData
:
args
})
}
const
params
=
{
...
args
,
...
pagination
,
}
if
(
!
isRefresh
&&
!
isNext
)
{
this
.
setState
({
loading
:
true
})
}
const
res
=
await
api
.
getArInvoiceHeader
(
params
)
this
.
setState
({
loading
:
false
})
if
(
res
.
error_code
!==
0
)
return
const
newData
=
R
.
propOr
([],
'data'
)(
res
)
if
(
isBlank
(
newData
)
||
newData
.
length
<
pagination
.
limit
)
{
isEnd
=
true
}
else
{
isEnd
=
false
}
if
(
isNext
)
{
data
=
R
.
concat
(
data
,
newData
)
}
else
{
data
=
newData
}
this
.
setState
({
data
,
isEnd
})
}
/**
* @description: 开票行
* @param {*}
* @return {*}
*/
async
getLineData
(
order
,
loading
=
false
)
{
const
params
=
{
invoice_sys_number
:
order
.
invoice_sys_number
,
}
this
.
setState
({
loading
})
const
res
=
await
api
.
getArInvoiceLines
(
params
)
this
.
setState
({
loading
:
false
})
if
(
res
.
error_code
)
return
order
.
lines
=
R
.
compose
(
R
.
sort
(
R
.
ascend
(
R
.
prop
(
'line_number'
))),
R
.
propOr
([],
'data'
))(
res
)
}
/**
* @description: 单项点击
* @param {*} order
* @return {*}
*/
async
itemClickHandler
(
order
)
{
if
(
isBlank
(
order
.
lines
))
{
await
this
.
getLineData
(
order
,
true
)
}
const
title
=
this
.
props
.
navigation
.
getParam
(
'title'
)
this
.
props
.
navigation
.
navigate
(
'DistributeInvoiceCollectionDetail'
,
{
title
,
order
,
isCollection
:
true
,
})
}
render
()
{
const
title
=
this
.
props
.
navigation
.
getParam
(
'title'
)
const
{
visible
,
loading
,
data
,
otherFilterItems
}
=
this
.
state
return
(
<
View
style=
{
g
(
styles
,
'container'
)
}
>
<
Resolution
.
FixWidthView
>
<
Header
title=
{
title
}
backCallback=
{
()
=>
{
this
.
props
.
navigation
.
goBack
()
}
}
>
<
TouchableOpacity
style=
{
g
(
styles
,
'filter'
)
}
activeOpacity=
{
0.8
}
onPress=
{
this
.
toggleModalVisible
}
>
<
Image
source=
{
require
(
'../../../assets/images/filter_icon.png'
)
}
style=
{
g
(
styles
,
'filter-icon'
)
}
/>
</
TouchableOpacity
>
</
Header
>
<
View
style=
{
g
(
styles
,
'body'
)
}
>
{
/* 过滤弹窗 */
}
<
FilterModal
visible=
{
visible
}
onClose=
{
this
.
toggleModalVisible
}
searchHandler=
{
filterData
=>
{
this
.
getData
(
filterData
)
}
}
otherFilterItems=
{
otherFilterItems
}
/>
{
/* 显示列表 */
}
{
loading
?
(
<
Loading
show=
{
loading
}
/>
)
:
(
<
InvoiceCollections
data=
{
data
}
{
...
this
.
props
}
getData=
{
this
.
getData
}
itemClickHandler=
{
this
.
itemClickHandler
}
isCollection=
{
true
}
/>
)
}
</
View
>
</
Resolution
.
FixWidthView
>
</
View
>
)
}
}
const
mapStateToProps
=
state
=>
({
status
:
state
.
settlement
.
arInvoiceHeaderStatus
,
})
const
mapDispatchToProps
=
dispatch
=>
({})
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
Distribution
)
src/pages/invoice/distribution/collection_detail.tsx
0 → 100644
View file @
6473ab48
/*
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/collection_detail.tsx
* @Author: peii
* @Date: 2021-12-29 11:26:53
* @LastEditTime: 2022-01-07 12:00:23
* @LastEditors: peii
* @Vision: 1.0
* @Description: 开票申请详情
*/
// @ts-nocheck
import
React
,
{
Component
}
from
'react'
import
{
View
,
Text
,
TouchableOpacity
,
FlatList
,
Image
}
from
'react-native'
import
{
connect
}
from
'react-redux'
import
*
as
R
from
'ramda'
import
{
INavigation
}
from
'navigation'
import
dayjs
from
'dayjs'
import
Header
from
'../../../components/header/header'
import
Resolution
from
'../../../components/common/Resolution'
import
{
Checkbox
}
from
'../../../components/checkbox/checkbox'
import
{
isBlank
,
g
,
isNotBlank
}
from
'../../../utils/utils'
import
styles
from
'./detail.styl'
type
IProps
=
{
navigation
:
INavigation
}
type
IState
=
{}
class
InvoiceApplyDetail
extends
Component
<
IProps
>
{
constructor
(
props
)
{
super
(
props
)
this
.
renderItem
=
this
.
renderItem
.
bind
(
this
)
this
.
checkedHandler
=
this
.
checkedHandler
.
bind
(
this
)
this
.
selectAllHandler
=
this
.
selectAllHandler
.
bind
(
this
)
this
.
countAndSum
=
this
.
countAndSum
.
bind
(
this
)
}
state
=
{
order
:
{},
}
componentDidMount
()
{
const
order
=
this
.
props
.
navigation
.
getParam
(
'order'
)
this
.
setState
({
order
})
}
/**
* @description:
* @param {*} checked
* @param {*} item
* @return {*}
*/
checkedHandler
(
checked
,
item
)
{
const
{
order
}
=
this
.
state
item
.
_checked
=
checked
const
checkLen
=
R
.
compose
(
R
.
length
,
R
.
filter
(
R
.
propEq
(
'_checked'
,
true
)))(
order
.
lines
)
if
(
checkLen
===
0
)
{
order
.
_checked
=
false
order
.
_indeterminate
=
false
}
else
if
(
checkLen
<
R
.
length
(
order
.
lines
))
{
order
.
_checked
=
false
order
.
_indeterminate
=
true
}
else
{
order
.
_checked
=
true
order
.
_indeterminate
=
false
}
this
.
setState
({
order
},
()
=>
{
this
.
countAndSum
()
})
}
/**
* @description: 全选操作
* @param {*}
* @return {*}
*/
selectAllHandler
()
{
const
{
order
}
=
this
.
state
if
(
order
.
_checked
)
{
order
.
_checked
=
false
order
.
_indeterminate
=
false
R
.
map
(
item
=>
{
item
.
_checked
=
false
})(
order
.
lines
||
[])
}
else
{
order
.
_checked
=
true
order
.
_indeterminate
=
false
R
.
map
(
item
=>
{
item
.
_checked
=
true
})(
order
.
lines
||
[])
}
this
.
setState
({
order
},
()
=>
{
this
.
countAndSum
()
})
}
/**
* @description: 计算总数
* @param {*}
* @return {*}
*/
countAndSum
()
{
const
{
order
}
=
this
.
state
const
list
=
R
.
compose
(
R
.
filter
(
R
.
propEq
(
'_checked'
,
true
)))(
order
.
lines
||
[])
order
.
_quantity
=
R
.
compose
(
R
.
sum
,
R
.
pluck
(
'quantity'
))(
list
)
order
.
_amount
=
R
.
compose
(
R
.
sum
,
R
.
pluck
(
'settlement_amount'
))(
list
).
toFixed
(
2
)
this
.
setState
({
order
})
}
/**
* @description: 单项渲染
* @param {*} param1
* @return {*}
*/
renderItem
({
item
,
index
})
{
return
(
<
View
style=
{
g
(
styles
,
'item'
)
}
>
<
View
style=
{
g
(
styles
,
'item-info'
)
}
>
<
Text
style=
{
g
(
styles
,
'item-info__text'
)
}
>
结算单号:
{
item
.
source_header_number
}
</
Text
>
<
Text
style=
{
g
(
styles
,
'item-info__text'
)
}
>
结算行号:
{
item
.
source_line_number
}
</
Text
>
<
Text
style=
{
g
(
styles
,
'item-info__text'
)
}
>
物料名称:
{
item
.
customer_item_name
}
</
Text
>
<
Text
style=
{
g
(
styles
,
'item-info__text'
)
}
>
通用名称:
{
item
.
customer_general_name
}
</
Text
>
<
Text
style=
{
g
(
styles
,
'item-info__text'
)
}
>
规格型号:
{
item
.
customer_specification
}
</
Text
>
<
Text
style=
{
g
(
styles
,
'item-info__text'
)
}
>
存储条件:
{
item
.
storage_condition_name
}
</
Text
>
<
Text
style=
{
g
(
styles
,
'item-info__text'
)
}
>
注册证号:
{
item
.
reg_number
}
</
Text
>
<
Text
style=
{
g
(
styles
,
'item-info__text'
,
'item-info-line__text'
)
}
>
数量:
{
item
.
invoice_quantity
}
</
Text
>
<
Text
style=
{
g
(
styles
,
'item-info__text'
,
'item-info-line__text'
)
}
>
金额:
{
item
.
invoice_amount
}
</
Text
>
</
View
>
</
View
>
)
}
render
()
{
const
title
=
this
.
props
.
navigation
.
getParam
(
'title'
)
const
{
order
}
=
this
.
state
return
(
<
View
style=
{
g
(
styles
,
'container'
)
}
>
<
Resolution
.
FixWidthView
>
<
Header
title=
{
title
}
backCallback=
{
()
=>
{
this
.
props
.
navigation
.
goBack
()
}
}
/>
<
View
style=
{
g
(
styles
,
'body'
)
}
>
<
View
style=
{
g
(
styles
,
'card-info'
)
}
>
<
View
style=
{
g
(
styles
,
'card-info-line'
)
}
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__key'
)
}
>
客户名称:
</
Text
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__val'
)
}
>
{
order
.
customer_name
}
</
Text
>
</
View
>
<
View
style=
{
g
(
styles
,
'card-info-line'
)
}
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__key'
)
}
>
发票号:
</
Text
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__val'
)
}
>
{
order
.
invoice_number
||
'——'
}
</
Text
>
</
View
>
<
View
style=
{
g
(
styles
,
'card-info-line'
)
}
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__key'
)
}
>
开票日期:
</
Text
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__val'
)
}
>
{
order
.
invoiced_date
&&
dayjs
(
order
.
invoiced_date
).
format
(
'YYYY-MM-DD'
)
}
</
Text
>
</
View
>
<
View
style=
{
g
(
styles
,
'card-info-line'
)
}
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__key'
)
}
>
开票总数量:
</
Text
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__val'
)
}
>
{
order
.
invoice_quantity
}
</
Text
>
</
View
>
<
View
style=
{
g
(
styles
,
'card-info-line'
)
}
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__key'
)
}
>
开票总金额:
</
Text
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__val'
)
}
>
{
order
.
invoice_amount
}
</
Text
>
</
View
>
<
View
style=
{
g
(
styles
,
'card-info-line'
)
}
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__key'
)
}
>
发票类型:
</
Text
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__val'
)
}
>
{
order
.
invoice_type_name
||
'——'
}
</
Text
>
</
View
>
<
View
style=
{
g
(
styles
,
'card-info-line'
)
}
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__key'
)
}
>
发票税额:
</
Text
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__val'
)
}
>
{
order
.
invoice_tax
||
'——'
}
</
Text
>
</
View
>
<
View
style=
{
g
(
styles
,
'card-info-line'
)
}
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__key'
)
}
>
备注:
</
Text
>
<
Text
style=
{
g
(
styles
,
'card-info__text'
,
'card-info__val'
)
}
>
{
order
.
header_remark
||
'——'
}
</
Text
>
</
View
>
</
View
>
<
FlatList
data=
{
order
.
lines
}
keyExtractor=
{
item
=>
item
.
line_number
}
renderItem=
{
this
.
renderItem
}
style=
{
g
(
styles
,
'list'
)
}
/>
</
View
>
</
Resolution
.
FixWidthView
>
</
View
>
)
}
}
export
default
connect
()(
InvoiceApplyDetail
)
src/pages/invoice/distribution/components/collections.tsx
0 → 100644
View file @
6473ab48
/*
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/components/collections.tsx
* @Author: peii
* @Date: 2021-12-19 10:44:15
* @LastEditTime: 2022-01-07 11:37:52
* @LastEditors: peii
* @Vision: 1.0
* @Description: 汇总列表
*/
// @ts-nocheck
import
React
,
{
Component
}
from
'react'
import
{
View
,
Text
,
TouchableOpacity
,
FlatList
,
RefreshControl
}
from
'react-native'
import
*
as
R
from
'ramda'
import
{
connect
}
from
'react-redux'
import
{
INavigation
}
from
'navigation'
import
debounce
from
'debounce'
import
dayjs
from
'dayjs'
import
Empty
from
'../../../../components/empty'
import
{
Checkbox
}
from
'../../../../components/checkbox/checkbox'
import
{
isNotBlank
,
isBlank
,
g
}
from
'../../../../utils/utils'
import
styles
from
'./list.styl'
type
IProps
=
{
data
:
any
[]
navigation
:
INavigation
getData
:
Function
itemClickHandler
:
Function
checkedHandler
:
Function
isCollection
:
boolean
}
class
DistributeInvoiceList
extends
Component
<
IProps
>
{
constructor
(
props
)
{
super
(
props
)
this
.
renderItem
=
this
.
renderItem
.
bind
(
this
)
this
.
itemPressHandler
=
this
.
itemPressHandler
.
bind
(
this
)
this
.
onRefreshHandler
=
debounce
(
this
.
onRefreshHandler
.
bind
(
this
),
200
)
this
.
onEndReachedHandler
=
debounce
(
this
.
onEndReachedHandler
.
bind
(
this
),
500
)
}
state
=
{
refreshing
:
false
,
checked
:
true
,
}
refreshing
=
false
/**
* @description:
* @param {*} item
* @return {*}
*/
itemPressHandler
(
item
)
{
this
.
props
.
itemClickHandler
&&
this
.
props
.
itemClickHandler
(
item
)
}
/**
* @description: 状态显示类
* @param {*}
* @return {*}
*/
mapStatusClass
=
R
.
cond
([
[
R
.
includes
(
R
.
__
,
[
'ENTERED'
]),
R
.
always
(
'text-black'
)],
[
R
.
includes
(
R
.
__
,
[
'SUBMITTED'
]),
R
.
always
(
'text-red'
)],
[
R
.
includes
(
R
.
__
,
[
'INVOICED'
]),
R
.
always
(
'text-blue'
)],
[
R
.
T
,
R
.
always
(
'text-gray'
)],
])
/**
* @description: 下拉刷新
* @param {*}
* @return {*}
*/
async
onRefreshHandler
()
{
if
(
this
.
state
.
refreshing
)
return
this
.
refreshing
=
true
this
.
setState
({
refreshing
:
true
})
await
this
.
props
.
getData
(
null
,
true
)
this
.
refreshing
=
false
this
.
setState
({
refreshing
:
false
})
}
async
onEndReachedHandler
()
{
if
(
this
.
refreshing
||
isBlank
(
this
.
props
.
data
))
return
this
.
refreshing
=
true
await
this
.
props
.
getData
(
null
,
false
,
true
)
this
.
refreshing
=
false
}
/**
* @description: 结算单单项
* @param {*} param1
* @return {*}
*/
renderItem
({
item
,
index
})
{
// 分销开票申请单项
return
(
<
TouchableOpacity
style=
{
g
(
styles
,
'item'
)
}
activeOpacity=
{
0.8
}
onPress=
{
()
=>
this
.
itemPressHandler
(
item
)
}
>
<
View
style=
{
g
(
styles
,
'item-line'
)
}
>
<
Text
style=
{
g
(
styles
,
'item-text'
)
}
>
{
item
.
invoice_sys_number
}
</
Text
>
<
Text
style=
{
g
(
styles
,
'item-text'
,
this
.
mapStatusClass
(
item
.
header_status
))
}
>
{
item
.
header_status_name
}
</
Text
>
</
View
>
<
View
style=
{
g
(
styles
,
'item-line'
,
'item-column'
)
}
>
<
Text
style=
{
g
(
styles
,
'item-text'
)
}
>
开票总数量:
{
item
.
invoice_quantity
}
</
Text
>
<
Text
style=
{
g
(
styles
,
'item-text'
)
}
>
开票总金额:
{
item
.
invoice_amount
}
</
Text
>
<
Text
style=
{
g
(
styles
,
'item-text'
)
}
>
开票日期:
{
item
.
invoiced_date
&&
dayjs
(
item
.
invoiced_date
).
format
(
'YYYY-MM-DD'
)
}
</
Text
>
<
Text
style=
{
g
(
styles
,
'item-text'
,
'item-text-full'
)
}
>
发票号:
{
item
.
invoice_number
||
'——'
}
</
Text
>
<
Text
style=
{
g
(
styles
,
'item-text'
,
'item-text-full'
)
}
>
备注:
{
item
.
header_remark
||
'——'
}
</
Text
>
</
View
>
</
TouchableOpacity
>
)
}
render
()
{
const
{
data
=
[]
}
=
this
.
props
const
{
refreshing
}
=
this
.
state
return
(
<
View
style=
{
g
(
styles
,
'list'
)
}
>
<
FlatList
data=
{
data
}
renderItem=
{
this
.
renderItem
}
ListEmptyComponent=
{
Empty
}
style=
{
g
(
styles
,
'list-inner'
)
}
keyExtractor=
{
it
=>
it
.
invoice_sys_number
}
refreshControl=
{
<
RefreshControl
onRefresh=
{
this
.
onRefreshHandler
}
refreshing=
{
refreshing
}
/>
}
onEndReached=
{
this
.
onEndReachedHandler
}
></
FlatList
>
</
View
>
)
}
}
const
mapStateToProps
=
state
=>
({
status
:
state
.
settlement
.
headerStatus
,
})
export
default
connect
(
mapStateToProps
)(
DistributeInvoiceList
)
src/pages/invoice/distribution/components/filter.tsx
View file @
6473ab48
...
...
@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/components/filter.tsx
* @Author: peii
* @Date: 2021-12-19 10:49:42
* @LastEditTime: 202
1-12-31 15:49:49
* @LastEditTime: 202
2-01-07 11:11:06
* @LastEditors: peii
* @Vision: 1.0
* @Description: 过滤弹窗
...
...
@@ -50,19 +50,7 @@ class Filter extends React.Component<IProps, IState> {
seller_code
:
this
.
props
.
userInfo
.
user_name
,
},
filterItems
:
[
{
field
:
'seller_code'
,
label
:
'销售员'
,
disabled
:
true
,
type
:
FieldType
.
SELECT
,
options
:
[
{
value
:
this
.
props
.
userInfo
.
user_name
,
label
:
this
.
props
.
userInfo
.
person_name
,
},
],
rules
:
[{
required
:
true
,
message
:
'请选择客户'
}],
},
{
field
:
'customer_code'
,
label
:
'客户'
,
...
...
@@ -112,10 +100,11 @@ class Filter extends React.Component<IProps, IState> {
*/
setFieldItems
()
{
let
{
filterItems
,
data
}
=
this
.
state
const
{
userInfo
,
sysProfiles
,
otherFilterItems
=
[]
}
=
this
.
props
const
{
userInfo
,
sysProfiles
,
otherFilterItems
=
[]
,
prefixFilterItems
=
[]
}
=
this
.
props
const
showOrg
=
sysProfiles
.
OBS_SHOW_ORG_FLAG
!==
'N'
data
.
org_code
=
userInfo
.
department_code
&&
R
.
take
(
3
,
userInfo
.
department_code
)
filterItems
=
R
.
concat
(
filterItems
)(
otherFilterItems
)
filterItems
=
[...
prefixFilterItems
,
...
filterItems
,
...
otherFilterItems
]
this
.
setState
({
filterItems
,
data
})
if
(
!
showOrg
)
return
...
...
src/pages/invoice/distribution/components/list.styl
View file @
6473ab48
...
...
@@ -21,6 +21,10 @@
justify-content space-between
align-items center
&-column
flex-direction column
align-items flex-start
&-text
font-size 16px
line-height 22px
...
...
src/pages/invoice/distribution/components/list.tsx
View file @
6473ab48
...
...
@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/components/list.tsx
* @Author: peii
* @Date: 2021-12-19 10:44:15
* @LastEditTime: 202
1-12-30 16:54:47
* @LastEditTime: 202
2-01-07 11:25:43
* @LastEditors: peii
* @Vision: 1.0
* @Description: 汇总列表
...
...
src/pages/invoice/distribution/index.tsx
View file @
6473ab48
...
...
@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/index.tsx
* @Author: peii
* @Date: 2021-12-27 09:59:21
* @LastEditTime: 2022-01-0
4 17:47:54
* @LastEditTime: 2022-01-0
7 11:13:22
* @LastEditors: peii
* @Vision: 1.0
* @Description: 分销开票申请
...
...
@@ -19,6 +19,7 @@ import debounce from 'debounce'
import
Loading
from
'../../../../app/containers/common/LodingModel'
import
Header
from
'../../../components/header/header'
import
Resolution
from
'../../../components/common/Resolution'
import
{
FieldType
}
from
'../../../enums'
import
FilterModal
from
'./components/filter'
import
InvoiceList
from
'./components/list'
import
{
isBlank
,
g
,
isNotBlank
,
show
}
from
'../../../utils/utils'
...
...
@@ -64,6 +65,21 @@ class Distribution extends Component<IProps, IState> {
},
customers
:
[],
submitting
:
false
,
prefixFilterItems
:
[
{
field
:
'seller_code'
,
label
:
'销售员'
,
disabled
:
true
,
type
:
FieldType
.
SELECT
,
options
:
[
{
value
:
this
.
props
.
userInfo
.
user_name
,
label
:
this
.
props
.
userInfo
.
person_name
,
},
],
rules
:
[{
required
:
true
,
message
:
'请选择客户'
}],
},
],
}
componentDidMount
()
{
...
...
@@ -288,7 +304,7 @@ class Distribution extends Component<IProps, IState> {
render
()
{
const
title
=
this
.
props
.
navigation
.
getParam
(
'title'
)
const
{
visible
,
loading
,
data
,
fresh
,
statistic
,
submitting
}
=
this
.
state
const
{
visible
,
loading
,
data
,
fresh
,
statistic
,
submitting
,
prefixFilterItems
}
=
this
.
state
return
(
<
View
style=
{
g
(
styles
,
'container'
)
}
>
...
...
@@ -313,6 +329,7 @@ class Distribution extends Component<IProps, IState> {
this
.
setState
({
customers
})
this
.
getData
(
filterData
)
}
}
prefixFilterItems=
{
prefixFilterItems
}
/>
{
/* 显示列表 */
}
...
...
@@ -369,6 +386,7 @@ class Distribution extends Component<IProps, IState> {
const
mapStateToProps
=
state
=>
({
status
:
state
.
settlement
.
headerStatus
,
userInfo
:
state
.
login
.
userInfo
,
})
const
mapDispatchToProps
=
dispatch
=>
({})
...
...
src/services/api.ts
View file @
6473ab48
...
...
@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/services/api.ts
* @Author: peii
* @Date: 2021-12-19 16:06:26
* @LastEditTime: 2022-01-0
6 14:24:53
* @LastEditTime: 2022-01-0
7 11:03:44
* @LastEditors: peii
* @Vision: 1.0
* @Description: 未重构完全暂用的所有请求
...
...
@@ -94,6 +94,29 @@ export default {
},
/**
* @description: 请求应收发票汇总
* @param {*}
* @return {*}
*/
getArInvoiceHeader
(
data
:
{
org_code
:
string
customer_code
:
string
invoice_sys_number
?:
string
invoice_number
?:
string
})
{
return
request
({
url
:
`
${
v
}
/receivable/ar_invoice_header/search`
,
data
})
},
/**
* @description: 应收发票行查询
* @param {object} data
* @return {*}
*/
getArInvoiceLines
(
data
:
{
invoice_sys_number
:
string
})
{
return
request
({
url
:
`
${
v
}
/receivable/ar_invoice_line/search`
,
data
})
},
/**
* @description: 请求已确认消耗单头
* @param {*}
* @return {*}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment