Commit 6dff0437 by Denglingling

调整【器械消耗】 - 耗材明细单价页面,隐藏单价显示

parent 19fe2c3f
...@@ -13,6 +13,7 @@ import SubSuccessPage from './containers/selfOrder/module/SubSuccessPage'; ...@@ -13,6 +13,7 @@ import SubSuccessPage from './containers/selfOrder/module/SubSuccessPage';
import EquipConsuPage from './containers/equipConsu/EquipConsuPage'; import EquipConsuPage from './containers/equipConsu/EquipConsuPage';
import ConsumDetailsPage from './containers/equipConsu//module/ConsumDetailsPage'; import ConsumDetailsPage from './containers/equipConsu//module/ConsumDetailsPage';
import FillUnitPricePage from './containers/equipConsu/module/FillUnitPricePage'; import FillUnitPricePage from './containers/equipConsu/module/FillUnitPricePage';
import ShowDetailPage from './containers/equipConsu/module/ShowDetailPage';
import QuickOrderPage from './containers/quickOrder/QuickOrderPage'; import QuickOrderPage from './containers/quickOrder/QuickOrderPage';
import TransOrderPage from './containers/transOrder/TransOrderPage'; import TransOrderPage from './containers/transOrder/TransOrderPage';
import TransSearchPage from './containers/transOrder/module/TransSearchPage'; import TransSearchPage from './containers/transOrder/module/TransSearchPage';
...@@ -31,6 +32,7 @@ const Router = createAppContainer(createStackNavigator({ ...@@ -31,6 +32,7 @@ const Router = createAppContainer(createStackNavigator({
EquipConsuPage: {screen: EquipConsuPage}, EquipConsuPage: {screen: EquipConsuPage},
ConsumDetailsPage: {screen: ConsumDetailsPage}, ConsumDetailsPage: {screen: ConsumDetailsPage},
FillUnitPricePage: {screen: FillUnitPricePage}, FillUnitPricePage: {screen: FillUnitPricePage},
ShowDetailPage: {screen: ShowDetailPage},
QuickOrderPage: {screen: QuickOrderPage}, QuickOrderPage: {screen: QuickOrderPage},
TransOrderPage: {screen: TransOrderPage}, TransOrderPage: {screen: TransOrderPage},
TransSearchPage: {screen: TransSearchPage}, TransSearchPage: {screen: TransSearchPage},
......
...@@ -1388,9 +1388,9 @@ class EquipConsuPage extends Component { ...@@ -1388,9 +1388,9 @@ class EquipConsuPage extends Component {
<Text style={list_common_item.de_tip}> <Text style={list_common_item.de_tip}>
序列号:{ item.serial_number } 序列号:{ item.serial_number }
</Text> </Text>
<Text style={list_common_item.de_tip}> {/* <Text style={list_common_item.de_tip}>
单价(¥):{ item.sale_price } 单价(¥):{ item.sale_price }
</Text> </Text> */}
</View> </View>
) )
} }
......
...@@ -169,6 +169,10 @@ class ConsumDetailsPage extends Component { ...@@ -169,6 +169,10 @@ class ConsumDetailsPage extends Component {
this.changeIsSelected(index, true) this.changeIsSelected(index, true)
} }
handleSubSelectCheck(index, selFlag) {
this.changeIsSelected(index, selFlag)
}
// 修改 当前已选择 // 修改 当前已选择
changeIsSelected(ind, selFlag) { changeIsSelected(ind, selFlag) {
let {conDetaOption} = this.state let {conDetaOption} = this.state
...@@ -233,8 +237,13 @@ class ConsumDetailsPage extends Component { ...@@ -233,8 +237,13 @@ class ConsumDetailsPage extends Component {
show('请选择耗材') show('请选择耗材')
return return
} }
this.props.navigation.navigate('FillUnitPricePage', { // this.props.navigation.navigate('FillUnitPricePage', {
title: '器械消耗 - 填写单价', // title: '器械消耗 - 填写单价',
// localSelectOption: localSelectOption
// })
this.props.navigation.navigate('ShowDetailPage', {
title: '器械消耗 - 已选明细',
localSelectOption: localSelectOption localSelectOption: localSelectOption
}) })
...@@ -285,33 +294,36 @@ class ConsumDetailsPage extends Component { ...@@ -285,33 +294,36 @@ class ConsumDetailsPage extends Component {
// 返回每一列数据 // 返回每一列数据
renderSubListItem(item, index) { renderSubListItem(item, index) {
return( return(
<View style={styles.cons_sub_list}> <TouchableOpacity
activeOpacity={.8}
style={styles.cons_sub_list}
onPress={() => this.handleSubSelectCheck(index, !item.select)}>
<View style={styles.sub_list_lef}> <View style={styles.sub_list_lef}>
{ {
item.select ? item.select ?
<TouchableOpacity <View
activeOpacity={.8}
style={styles.sub_icon_box} style={styles.sub_icon_box}
onPress={() => this.handleCelSelCheck(item, index)}> // onPress={() => this.handleCelSelCheck(item, index)}
>
<Image style={icon_style} source={require('../../../images/radio_yes.png')} /> <Image style={icon_style} source={require('../../../images/radio_yes.png')} />
</TouchableOpacity> </View>
: <TouchableOpacity : <View
activeOpacity={.8}
style={styles.sub_icon_box} style={styles.sub_icon_box}
onPress={() => this.handleSubSelectedCheck(item, index)}> // onPress={() => this.handleSubSelectedCheck(item, index)}
>
<Image style={icon_style} source={require('../../../images/radio_no.png')} /> <Image style={icon_style} source={require('../../../images/radio_no.png')} />
</TouchableOpacity> </View>
} }
</View> </View>
<View style={styles.sub_list_rig}> <View style={styles.sub_list_rig}>
<Text style={styles.rig_tit}> <Text style={styles.rig_tit}>
{item.item_name} {index+1}. {item.item_name}
</Text> </Text>
<Text style={styles.rig_ser}> <Text style={styles.rig_ser}>
序列号:{item.serial_number} 序列号:{item.serial_number}
</Text> </Text>
</View> </View>
</View> </TouchableOpacity>
) )
} }
......
...@@ -211,7 +211,7 @@ class DetailsModel extends Component { ...@@ -211,7 +211,7 @@ class DetailsModel extends Component {
<View style={styles.ri_inner}> <View style={styles.ri_inner}>
<View style={styles.ri_text_box}> <View style={styles.ri_text_box}>
<Text style={styles.ri_te_tit}> <Text style={styles.ri_te_tit}>
{ item.item_name } - {item.specification} {index+1}. { item.item_name } - {item.specification}
</Text> </Text>
<Text style={[styles.ri_te_ot, styles.thr_ot]}>序列号:{item.serial_number}</Text> <Text style={[styles.ri_te_ot, styles.thr_ot]}>序列号:{item.serial_number}</Text>
</View> </View>
......
import React, { Component } from 'react';
import {
View,
Text,
StyleSheet,
SafeAreaView,
TouchableOpacity,
ScrollView,
FlatList,
TextInput
} from 'react-native';
import {
home_background_color, promary_color, safe_view, list_common_item, placehold_text_color, second_text_size, promary_text_color, font_family_regular, font_family_medium
} from '../../../base/BaseStyle';
import StatusBarView from '../../common/StatusBarView';
import HeadBackItem from '../../common/HeadBackItem';
import { show } from '../../../utils/Utils';
import { getSubdetailOption } from '../../../action/EquipAction';
import { connect } from 'react-redux';
class ShowDetailPage extends Component {
constructor(props) {
super(props);
this.state = {
unitPriceOption: [
// {
// "id": "2",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// sale_price: 90890,
// local_add_price: 90890,
// select: true
// }
]
}
}
componentDidMount() {
this.getLocalSelectedData()
}
// 获取选择的数据
getLocalSelectedData() {
let {localSelectOption} = this.props.navigation.state.params
console.log('localSelectOption----', localSelectOption)
this.setState({
unitPriceOption: localSelectOption
})
}
// 确认明细 点击
handleSubmit() {
let {unitPriceOption} = this.state
let canSubFlag = true
let {props} = this
if(canSubFlag) {
this.setState({
unitPriceOption
})
// 存储于store中,并跳转
props.getSubdetailOption(unitPriceOption)
props.navigation.navigate('EquipConsuPage', { title: '器械消耗' })
}
}
// 返回主要元素
renderContItem() {
return(
<ScrollView
style={styles.cons_cont_scroll}
// showsVerticalScrollIndicator={false}
>
<FlatList
style={styles.cons_cont}
keyExtractor={item => item.id}
data={this.state.unitPriceOption}
extraData={this.state}
renderItem={ ({item,index}) => this.renderSubListItem(item, index) }
/>
</ScrollView>
)
}
// 返回每一列元素
renderSubListItem(item, index) {
let price = ''
if(item.local_add_price) {
price = String(item.local_add_price)
}
return(
<View style={styles.cons_sub_list}>
<Text style={styles.cont_tit}>
{index+1}. {item.item_name}
</Text>
<Text style={styles.cont_ser}>
序列号:{item.serial_number}
</Text>
</View>
)
}
// 返回底部元素
renderFooterBtnItem() {
return (
<View style={list_common_item.sub_box}>
<View style={list_common_item.sub_two_btn}>
<TouchableOpacity
activeOpacity={.8}
style={[list_common_item.rig_btn, styles.fot_btn]}
onPress={() => this.handleSubmit()}
>
<Text style={list_common_item.rig_tip}>{'确定耗材'}</Text>
</TouchableOpacity>
</View>
</View>
)
}
render() {
let {navigation} = this.props
let {title} = navigation.state.params
return (
<View style={styles.cu_dl_container}>
<StatusBarView
isReactStackNavigator={true}
backgroundColor={promary_color}
barStyle = 'light-content'
/>
<SafeAreaView style={safe_view}>
<HeadBackItem title={title} navigation={navigation} />
<View style={styles.cu_dl_main}>
{ this.renderContItem() }
</View>
{this.renderFooterBtnItem()}
</SafeAreaView>
</View>
);
}
}
const styles = StyleSheet.create({
cu_dl_container: {
flex: 1,
backgroundColor: home_background_color,
padding: 0,
margin: 0
},
cu_dl_main: {
flex: 1
},
cons_cont_scroll: {},
cons_cont: {
paddingHorizontal: 20
},
cons_sub_list: {
backgroundColor: '#FFF',
marginVertical: 10,
padding: 10
},
cont_tit: {
fontSize: second_text_size,
color: promary_text_color,
fontFamily: font_family_regular
},
cont_ser: {
fontSize: 14,
color: '#A3A3A3',
fontFamily: font_family_regular
},
cont_pri: {
flexDirection: 'row',
alignItems: 'center'
},
pri_icon: {
color: '#EC3A2E',
fontSize: 16,
fontFamily: font_family_medium
},
pri_inner: {
fontFamily: font_family_medium,
fontSize: second_text_size,
color: promary_text_color
},
cont_pri_box: {
flex: 1,
paddingRight: 20
},
pri_txt: {
fontFamily: font_family_medium,
fontSize: second_text_size,
color: promary_text_color
},
fot_btn: {
width: '100%',
borderRadius: 10
}
})
const mapStateToProps = (state) => {
return {}
}
const mapDispatchToProps = (dispatch) => {
return {
getSubdetailOption: (data) => {
dispatch(getSubdetailOption(data))
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(ShowDetailPage);
\ No newline at end of file
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