Commit 6c064d41 by Denglingling

增加注释说明,以及优化自助下单

parent 485480a2
...@@ -10,25 +10,26 @@ const PropTypes = require('prop-types'); ...@@ -10,25 +10,26 @@ const PropTypes = require('prop-types');
class PageListArrow extends Component { class PageListArrow extends Component {
static propTypres = { static propTypres = {
listActOpa: PropTypes.number, listActOpa: PropTypes.number, // 透明度显示(0 到 1 之间)
listCallBack: PropTypes.func, // 点击后的回调函数 listCallBack: PropTypes.func, // 组件点击后的回调函数
listHasAster: PropTypes.bool, // 是否必填 listHasAster: PropTypes.bool, // 必填✳️号显示
listEditAble: PropTypes.bool, listEditAble: PropTypes.bool, // 文本框可编辑的。默认值为 true
listDefaValue: PropTypes.string, listDefaValue: PropTypes.string, // 文本框中的初始值
listItem: PropTypes.object, listItem: PropTypes.object, // 当前组件的数据
listTitle: PropTypes.string, listTitle: PropTypes.string, // 标题属性名
listName: PropTypes.string, listName: PropTypes.string, // 展示字段属性名
listValue: PropTypes.string, listValue: PropTypes.string, // 值字段属性名
listHasArrow: PropTypes.bool, listHasArrow: PropTypes.bool, // 右侧箭头图标显示
listOtherInput: PropTypes.string, listOtherInput: PropTypes.string, // 特定输入框显示(如‘医生’)
otherInput: PropTypes.string, otherInput: PropTypes.string, // 特定输入框属性名
otherInputCallBack: PropTypes.func, otherInputCallBack: PropTypes.func, // 特定输入框回调函数
listInputPlace: PropTypes.string, listInputPlace: PropTypes.string, // 输入框默认显示内容
inputCallBack: PropTypes.func, inputCallBack: PropTypes.func, // 输入框默认显示内容
isTitInputStyle: PropTypes.bool, isTitInputStyle: PropTypes.bool, // 输入框回调函数
listMaxLines: PropTypes.number, // 文本最大行数 listMaxLines: PropTypes.number, // 限制输入框的行数
listIsAudio: PropTypes.bool, listIsAudio: PropTypes.bool, // 特定单选按钮显示
listCellStyle: PropTypes.object listCellStyle: PropTypes.object, // 组件另外样式
inputKeyboardType: PropTypes.string, // 弹出何种软键盘类型
} }
constructor(props) { constructor(props) {
...@@ -47,7 +48,7 @@ class PageListArrow extends Component { ...@@ -47,7 +48,7 @@ class PageListArrow extends Component {
render() { render() {
let {listActOpa, listCallBack, listHasAster, listEditAble, listDefaValue, listItem, listTitle, let {listActOpa, listCallBack, listHasAster, listEditAble, listDefaValue, listItem, listTitle,
listName, listValue, listHasArrow, listOtherInput, otherInput, otherInputCallBack, listInputPlace, listName, listValue, listHasArrow, listOtherInput, otherInput, otherInputCallBack, listInputPlace,
inputCallBack, isTitInputStyle, listMaxLines, listIsAudio, listCellStyle} = this.props inputCallBack, isTitInputStyle, listMaxLines, listIsAudio, listCellStyle, inputKeyboardType} = this.props
if(!listMaxLines){ if(!listMaxLines){
listMaxLines = 2 // 默认 listMaxLines = 2 // 默认
} }
...@@ -65,6 +66,7 @@ class PageListArrow extends Component { ...@@ -65,6 +66,7 @@ class PageListArrow extends Component {
editable={!listEditAble} editable={!listEditAble}
defaultValue={listItem[listDefaValue]} defaultValue={listItem[listDefaValue]}
placeholder={listInputPlace} placeholder={listInputPlace}
keyboardType={inputKeyboardType ? inputKeyboardType : 'default'}
onChangeText={(text) => {return inputCallBack ? inputCallBack(text) : ''}} onChangeText={(text) => {return inputCallBack ? inputCallBack(text) : ''}}
/> : <ContTextStyle numberOfLines={listMaxLines}>{listItem[listName]}</ContTextStyle> /> : <ContTextStyle numberOfLines={listMaxLines}>{listItem[listName]}</ContTextStyle>
} }
......
...@@ -16,6 +16,7 @@ import ImagePicker from 'react-native-image-picker'; ...@@ -16,6 +16,7 @@ import ImagePicker from 'react-native-image-picker';
import { exitLoginStatus } from '../../action/LoginAction'; import { exitLoginStatus } from '../../action/LoginAction';
import LodingModel from '../common/LodingModel'; import LodingModel from '../common/LodingModel';
import { OBS_MOBILE_EQU_CON_DISPLAY_PRICE } from '../../base/BaseConstants'; import { OBS_MOBILE_EQU_CON_DISPLAY_PRICE } from '../../base/BaseConstants';
import PageListArrow from '../common/listDataComponent/PageListArrow';
class EquipConsuPage extends Component { class EquipConsuPage extends Component {
constructor(props) { constructor(props) {
...@@ -450,13 +451,13 @@ class EquipConsuPage extends Component { ...@@ -450,13 +451,13 @@ class EquipConsuPage extends Component {
} }
// 组织 点击 // 组织 点击
handleOrganizationCheck() { handleOrganizationCheck(curData) {
let { state, props } = this let { props } = this
this.setState({ this.setState({
currentTitle: '组织', currentTitle: curData.title,
currentItem: { currentItem: {
name: state.listOptionData[1].name, name: curData.name,
value: state.listOptionData[1].value value: curData.value
} }
}, () => { }, () => {
let params = { let params = {
...@@ -501,15 +502,14 @@ class EquipConsuPage extends Component { ...@@ -501,15 +502,14 @@ class EquipConsuPage extends Component {
} }
// 客户名称 点击 // 客户名称 点击
handleCustomerCheck() { handleCustomerCheck(curData) {
let { state } = this
let that = this let that = this
if(this.judgeOrgIsNull()) { if(this.judgeOrgIsNull()) {
that.setState({ that.setState({
currentTitle: '客户名称', currentTitle: curData.title,
currentItem: { currentItem: {
name: state.listOptionData[2].name, name: curData.name,
value: state.listOptionData[2].value value: curData.value
} }
}, () => { }, () => {
that.getCustomerData() that.getCustomerData()
...@@ -567,15 +567,15 @@ class EquipConsuPage extends Component { ...@@ -567,15 +567,15 @@ class EquipConsuPage extends Component {
} }
// 订单信息 点击 // 订单信息 点击
handleOrderInfoCheck() { handleOrderInfoCheck(curData) {
let { state, props } = this let { state, props } = this
let that = this let that = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) { if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
that.setState({ that.setState({
currentTitle: '订单信息', currentTitle: curData.title,
currentItem: { currentItem: {
name: state.listOptionData[3].name, name: curData.name,
value: state.listOptionData[3].value value: curData.value
} }
}, () => { }, () => {
let params = { let params = {
...@@ -664,17 +664,17 @@ class EquipConsuPage extends Component { ...@@ -664,17 +664,17 @@ class EquipConsuPage extends Component {
} }
// 消耗时间 点击 // 消耗时间 点击
handleEquipDateCheck() { handleEquipDateCheck(curData) {
let { listOptionData } = this.state let { listOptionData } = this.state
let date = listOptionData[4].value let date = curData.value
if(date) { if(date) {
this.setState({ listOptionData.map(function (item) {
listOptionData: listOptionData.map((item, index) => { if (item.title === curData.title) {
if(item.title === '消耗时间') {
item.dateValue = formatStrForDate(date) item.dateValue = formatStrForDate(date)
} }
return item
}) })
this.setState({
listOptionData: listOptionData
}) })
} }
this.closeDateModal(true) this.closeDateModal(true)
...@@ -706,31 +706,31 @@ class EquipConsuPage extends Component { ...@@ -706,31 +706,31 @@ class EquipConsuPage extends Component {
} }
// 患者姓名 输入 // 患者姓名 输入
handlePatNameInput(text) { handlePatNameInput(text, curData) {
let { listOptionData } = this.state let { listOptionData } = this.state
let that = this let that = this
this.setState({ listOptionData.map(function (item) {
listOptionData: listOptionData.map((item, index) => { if (item.title === curData.title) {
if(item.title === '患者姓名') {
item.value = text item.value = text
} }
return item
}) })
that.setState({
listOptionData: listOptionData
},() => { },() => {
that.changeCanSub() that.changeCanSub()
}) })
} }
// 性别 点击 // 性别 点击
handleGenderCheck() { handleGenderCheck(curData) {
let { listOptionData, sexTypeOption } = this.state let { sexTypeOption } = this.state
let that = this let that = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) { if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
that.setState({ that.setState({
currentTitle: '性别', currentTitle: curData.title,
currentItem: { currentItem: {
name: listOptionData[6].name, name: curData.name,
value: listOptionData[6].value value: curData.value
} }
}, () => { }, () => {
that.setState({ that.setState({
...@@ -742,48 +742,48 @@ class EquipConsuPage extends Component { ...@@ -742,48 +742,48 @@ class EquipConsuPage extends Component {
} }
// 年龄 输入 // 年龄 输入
handleAgeInput(text) { handleAgeInput(text, curData) {
let { listOptionData } = this.state let { listOptionData } = this.state
let that = this let that = this
this.setState({ listOptionData.map(function (item) {
listOptionData: listOptionData.map((item, index) => { if (item.title === curData.title) {
if(item.title === '年龄') {
item.value = text item.value = text
} }
return item
}) })
that.setState({
listOptionData: listOptionData
},() => { },() => {
that.changeCanSub() that.changeCanSub()
}) })
} }
// 床位 输入 // 床位 输入
handleBedInput(text) { handleBedInput(text, curData) {
let { listOptionData } = this.state let { listOptionData } = this.state
let that = this let that = this
this.setState({ listOptionData.map(function (item) {
listOptionData: listOptionData.map((item, index) => { if (item.title === curData.title) {
if(item.title === '床位') {
item.value = text item.value = text
} }
return item
}) })
that.setState({
listOptionData: listOptionData
},() => { },() => {
that.changeCanSub() that.changeCanSub()
}) })
} }
// 病历号 输入 // 病历号 输入
handleRecordNumInput(text) { handleRecordNumInput(text, curData) {
let { listOptionData } = this.state let { listOptionData } = this.state
let that = this let that = this
this.setState({ listOptionData.map(function (item) {
listOptionData: listOptionData.map((item, index) => { if (item.title === curData.title) {
if(item.title === '病历号') {
item.value = text item.value = text
} }
return item
}) })
that.setState({
listOptionData: listOptionData
},() => { },() => {
that.changeCanSub() that.changeCanSub()
}) })
...@@ -808,42 +808,42 @@ class EquipConsuPage extends Component { ...@@ -808,42 +808,42 @@ class EquipConsuPage extends Component {
} }
// 备注 输入 // 备注 输入
handleRemarkInput(text) { handleRemarkInput(text, curData) {
let { listOptionData } = this.state let { listOptionData } = this.state
this.setState({ listOptionData.map(function (item) {
listOptionData: listOptionData.map((item, index) => { if (item.title === curData.title) {
if(item.title === '备注') {
item.value = text item.value = text
} }
return item
}) })
that.setState({
listOptionData: listOptionData
}) })
} }
// 耗材明细 隐藏子项 // 耗材明细 隐藏子项
handleDetailBtmCheck() { handleDetailBtmCheck() {
let { listOptionData } = this.state // let { listOptionData } = this.state
this.setState({ // this.setState({
listOptionData: listOptionData.map((item, index) => { // listOptionData: listOptionData.map((item, index) => {
if(index == 12) { // if(index == 12) {
item.isShowSub = false // item.isShowSub = false
} // }
return item // return item
}) // })
}) // })
} }
// 耗材明细 显示子项 // 耗材明细 显示子项
handleDetailRigCheck() { handleDetailRigCheck() {
let { listOptionData } = this.state // let { listOptionData } = this.state
this.setState({ // this.setState({
listOptionData: listOptionData.map((item, index) => { // listOptionData: listOptionData.map((item, index) => {
if(index == 12) { // if(index == 12) {
item.isShowSub = true // item.isShowSub = true
} // }
return item // return item
}) // })
}) // })
} }
// 耗材明细 点击 // 耗材明细 点击
...@@ -860,11 +860,7 @@ class EquipConsuPage extends Component { ...@@ -860,11 +860,7 @@ class EquipConsuPage extends Component {
// 费用明细 点击 // 费用明细 点击
handleChargeDetailsCheck() { handleChargeDetailsCheck() {
let { listOptionData } = this.state this.props.navigation.navigate('ChargeDetailsPage', { title: '器械消耗 - 添加明细' })
this.props.navigation.navigate('ChargeDetailsPage', {
title: '器械消耗 - 添加明细',
// orderId: listOptionData[3].value
})
} }
// 添加图片 点击 // 添加图片 点击
...@@ -1100,10 +1096,17 @@ class EquipConsuPage extends Component { ...@@ -1100,10 +1096,17 @@ class EquipConsuPage extends Component {
// 返回备注以上的元素 // 返回备注以上的元素
renderListItem() { renderListItem() {
let { listOptionData, dateModelPop } = this.state let { listOptionData, dateModelPop } = this.state
return( return(
<View style={styles.list_cont}> <View style={styles.list_cont}>
<View style={styles.item_container}> <PageListArrow
listActOpa={1}
listEditAble={true}
listHasAster={true}
listItem={listOptionData[0]}
listDefaValue={'name'}
listTitle={'title'}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity <TouchableOpacity
activeOpacity={1} activeOpacity={1}
> >
...@@ -1113,8 +1116,17 @@ class EquipConsuPage extends Component { ...@@ -1113,8 +1116,17 @@ class EquipConsuPage extends Component {
<ContInputTextStyle editable={false} defaultValue={listOptionData[0].name}></ContInputTextStyle> <ContInputTextStyle editable={false} defaultValue={listOptionData[0].name}></ContInputTextStyle>
</CellTextStyle> </CellTextStyle>
</TouchableOpacity> </TouchableOpacity>
</View> </View> */}
<View style={styles.item_container}> <PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[1]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
onPress={() => this.handleOrganizationCheck()} onPress={() => this.handleOrganizationCheck()}
...@@ -1126,8 +1138,17 @@ class EquipConsuPage extends Component { ...@@ -1126,8 +1138,17 @@ class EquipConsuPage extends Component {
{ this.renderRightArrowItem() } { this.renderRightArrowItem() }
</CellTextStyle> </CellTextStyle>
</TouchableOpacity> </TouchableOpacity>
</View> </View> */}
<View style={styles.item_container}> <PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[2]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleCustomerCheck(listOptionData[2])}
listHasArrow={true}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
onPress={() => this.handleCustomerCheck()} onPress={() => this.handleCustomerCheck()}
...@@ -1139,8 +1160,17 @@ class EquipConsuPage extends Component { ...@@ -1139,8 +1160,17 @@ class EquipConsuPage extends Component {
{ this.renderRightArrowItem() } { this.renderRightArrowItem() }
</CellTextStyle> </CellTextStyle>
</TouchableOpacity> </TouchableOpacity>
</View> </View> */}
<View style={styles.item_container}> <PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[3]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleOrderInfoCheck(listOptionData[3])}
listHasArrow={true}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
onPress={() => this.handleOrderInfoCheck()} onPress={() => this.handleOrderInfoCheck()}
...@@ -1152,8 +1182,17 @@ class EquipConsuPage extends Component { ...@@ -1152,8 +1182,17 @@ class EquipConsuPage extends Component {
{ this.renderRightArrowItem() } { this.renderRightArrowItem() }
</CellTextStyle> </CellTextStyle>
</TouchableOpacity> </TouchableOpacity>
</View> </View> */}
<View style={styles.item_container}> <PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[4]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleEquipDateCheck(listOptionData[4])}
listHasArrow={true}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
onPress={() => this.handleEquipDateCheck()} onPress={() => this.handleEquipDateCheck()}
...@@ -1173,8 +1212,19 @@ class EquipConsuPage extends Component { ...@@ -1173,8 +1212,19 @@ class EquipConsuPage extends Component {
callback={(date) => this.dateModalCallback(date)} callback={(date) => this.dateModalCallback(date)}
/> />
</View> </View> */}
<View style={styles.item_container}> <PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[5]}
listDefaValue={'value'}
listTitle={'title'}
listInputPlace={`请输入${listOptionData[5].title}`}
inputCallBack={(text) => this.handlePatNameInput(text, listOptionData[5])}
isTitInputStyle={true}
listCellStyle={styles.list_cell_box}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
> >
...@@ -1189,8 +1239,17 @@ class EquipConsuPage extends Component { ...@@ -1189,8 +1239,17 @@ class EquipConsuPage extends Component {
/> />
</CellTextStyle> </CellTextStyle>
</TouchableOpacity> </TouchableOpacity>
</View> </View> */}
<View style={styles.item_container}> <PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[6]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleGenderCheck(listOptionData[6])}
listHasArrow={true}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
onPress={() => this.handleGenderCheck()} onPress={() => this.handleGenderCheck()}
...@@ -1202,8 +1261,22 @@ class EquipConsuPage extends Component { ...@@ -1202,8 +1261,22 @@ class EquipConsuPage extends Component {
{ this.renderRightArrowItem() } { this.renderRightArrowItem() }
</CellTextStyle> </CellTextStyle>
</TouchableOpacity> </TouchableOpacity>
</View> </View> */}
<View style={styles.item_container}>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[7]}
listDefaValue={'value'}
listTitle={'title'}
listInputPlace={`请输入${listOptionData[7].title}`}
inputCallBack={(text) => this.handleAgeInput(text, listOptionData[7])}
isTitInputStyle={true}
listCellStyle={styles.list_cell_box}
inputKeyboardType={'numeric'}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
> >
...@@ -1219,8 +1292,21 @@ class EquipConsuPage extends Component { ...@@ -1219,8 +1292,21 @@ class EquipConsuPage extends Component {
/> />
</CellTextStyle> </CellTextStyle>
</TouchableOpacity> </TouchableOpacity>
</View> </View> */}
<View style={styles.item_container}>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[8]}
listDefaValue={'value'}
listTitle={'title'}
listInputPlace={`请输入${listOptionData[8].title}`}
inputCallBack={(text) => this.handleBedInput(text, listOptionData[8])}
isTitInputStyle={true}
listCellStyle={styles.list_cell_box}
inputKeyboardType={'numeric'}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
> >
...@@ -1236,8 +1322,21 @@ class EquipConsuPage extends Component { ...@@ -1236,8 +1322,21 @@ class EquipConsuPage extends Component {
/> />
</CellTextStyle> </CellTextStyle>
</TouchableOpacity> </TouchableOpacity>
</View> </View> */}
<View style={styles.item_container}>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[9]}
listDefaValue={'value'}
listTitle={'title'}
listInputPlace={`请输入${listOptionData[9].title}`}
inputCallBack={(text) => this.handleRecordNumInput(text, listOptionData[9])}
isTitInputStyle={true}
listCellStyle={styles.list_cell_box}
inputKeyboardType={'numeric'}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
> >
...@@ -1253,7 +1352,7 @@ class EquipConsuPage extends Component { ...@@ -1253,7 +1352,7 @@ class EquipConsuPage extends Component {
/> />
</CellTextStyle> </CellTextStyle>
</TouchableOpacity> </TouchableOpacity>
</View> </View> */}
{/* <View style={styles.item_container}> {/* <View style={styles.item_container}>
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
...@@ -1294,6 +1393,12 @@ class EquipConsuPage extends Component { ...@@ -1294,6 +1393,12 @@ class EquipConsuPage extends Component {
</CellTextStyle> </CellTextStyle>
</TouchableOpacity> </TouchableOpacity>
</View> */} </View> */}
<DateModel
date={listOptionData[4].dateValue}
closeModal={(show) => this.closeDateModal(show)}
show={dateModelPop}
callback={(date) => this.dateModalCallback(date, listOptionData[4])}
/>
{ this.renderPickerModel() } { this.renderPickerModel() }
</View> </View>
) )
...@@ -1350,7 +1455,7 @@ class EquipConsuPage extends Component { ...@@ -1350,7 +1455,7 @@ class EquipConsuPage extends Component {
numberOfLines = {8} numberOfLines = {8}
style={list_common_item.rema_Input} style={list_common_item.rema_Input}
maxLength={140} maxLength={140}
onChangeText={(text) => this.handleRemarkInput(text)} onChangeText={(text) => this.handleRemarkInput(text, state.listOptionData[11])}
defaultValue={state.listOptionData[11].value} defaultValue={state.listOptionData[11].value}
/> />
</TouchableOpacity> </TouchableOpacity>
......
...@@ -592,7 +592,6 @@ class SelfOrderPage extends Component { ...@@ -592,7 +592,6 @@ class SelfOrderPage extends Component {
// 组织 点击 // 组织 点击
handleOrganizationCheck(curData) { handleOrganizationCheck(curData) {
console.log(curData)
let { props } = this let { props } = this
this.setState({ this.setState({
currentTitle: curData.title, currentTitle: curData.title,
......
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