Commit 3878bca4 by wong.peiyi

消耗汇总

parent 30a28f13
...@@ -228,6 +228,10 @@ export const list_common_item = { ...@@ -228,6 +228,10 @@ export const list_common_item = {
detail_inner: { detail_inner: {
flex: 1 flex: 1
}, },
detail_title_box: {
flexDirection: 'row',
justifyContent: 'space-between',
},
detail_tit: { detail_tit: {
fontSize: second_text_size, fontSize: second_text_size,
color: '#A3A3A3', color: '#A3A3A3',
......
...@@ -1357,6 +1357,15 @@ class EquipConsuPage extends Component { ...@@ -1357,6 +1357,15 @@ class EquipConsuPage extends Component {
}) })
} }
consumeSum() {
try {
const {listOptionData} = this.state
return R.compose(R.sum, R.pluck('local_add_price'), R.pathOr([], [12, 'subOption']))(listOptionData)
} catch (error) {
return 0
}
}
// 返回备注以上的元素 // 返回备注以上的元素
renderListItem() { renderListItem() {
let { listOptionData, dateModelPop, sysValues } = this.state let { listOptionData, dateModelPop, sysValues } = this.state
...@@ -1618,10 +1627,16 @@ class EquipConsuPage extends Component { ...@@ -1618,10 +1627,16 @@ class EquipConsuPage extends Component {
// 返回耗材明细 // 返回耗材明细
renderConsumablesDetailsItem() { renderConsumablesDetailsItem() {
let { state } = this let { state } = this
const sum = this.consumeSum()
return ( return (
<CellTextStyle style={list_common_item.consu_detail}> <CellTextStyle style={list_common_item.consu_detail}>
<View style={list_common_item.detail_inner}> <View style={list_common_item.detail_inner}>
<View style={list_common_item.detail_title_box}>
<Text style={list_common_item.detail_tit}>耗材明细</Text> <Text style={list_common_item.detail_tit}>耗材明细</Text>
<Text style={list_common_item.detail_tit}>总金额(){sum}</Text>
</View>
{ {
state.listOptionData[12].subOption.length ? state.listOptionData[12].subOption.length ?
<View <View
......
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