Commit 1659da2f by wong.peiyi

消耗确认添加显示病人名称

parent 15e67e1a
...@@ -21,7 +21,7 @@ import PageListArrow from '../common/listDataComponent/PageListArrow'; ...@@ -21,7 +21,7 @@ import PageListArrow from '../common/listDataComponent/PageListArrow';
class EquipConsuPage extends Component { class EquipConsuPage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
canSubFlag: false, // 生成订单按钮样式改变 canSubFlag: false, // 生成订单按钮样式改变
listOptionData: [ // 页面元素 listOptionData: [ // 页面元素
{ {
...@@ -36,7 +36,7 @@ class EquipConsuPage extends Component { ...@@ -36,7 +36,7 @@ class EquipConsuPage extends Component {
name: '请选择', name: '请选择',
value: '' value: ''
}, },
{ {
"id": "2", "id": "2",
title: '客户名称', title: '客户名称',
name: '请选择', name: '请选择',
...@@ -144,7 +144,7 @@ class EquipConsuPage extends Component { ...@@ -144,7 +144,7 @@ class EquipConsuPage extends Component {
showTypePop: false, // 选择器弹窗 showTypePop: false, // 选择器弹窗
isSubLoding: false, // 加载中弹窗 isSubLoding: false, // 加载中弹窗
lodingTitle: '加载中', lodingTitle: '加载中',
listCurrentOption: [ // 当前选择器数据 listCurrentOption: [ // 当前选择器数据
], ],
dateModelPop: false, // 日期选择器 dateModelPop: false, // 日期选择器
sexTypeOption: [ // 性别 sexTypeOption: [ // 性别
...@@ -216,7 +216,7 @@ class EquipConsuPage extends Component { ...@@ -216,7 +216,7 @@ class EquipConsuPage extends Component {
case EQUIP_CONSU_LIST_FAILURE: case EQUIP_CONSU_LIST_FAILURE:
this.changeSubLoding(false) this.changeSubLoding(false)
break; break;
default: default:
break; break;
} }
} }
...@@ -225,7 +225,7 @@ class EquipConsuPage extends Component { ...@@ -225,7 +225,7 @@ class EquipConsuPage extends Component {
case LOGIN_NO: case LOGIN_NO:
navigation.navigate('LoginPage') navigation.navigate('LoginPage')
break; break;
default: default:
break; break;
} }
} }
...@@ -269,7 +269,7 @@ class EquipConsuPage extends Component { ...@@ -269,7 +269,7 @@ class EquipConsuPage extends Component {
case EQUIP_SUBMIT_FAILURE: case EQUIP_SUBMIT_FAILURE:
this.changeSubLoding(false, '提交中') this.changeSubLoding(false, '提交中')
break; break;
default: default:
break; break;
} }
} }
...@@ -290,7 +290,7 @@ class EquipConsuPage extends Component { ...@@ -290,7 +290,7 @@ class EquipConsuPage extends Component {
let that = this let that = this
this.setState({ this.setState({
listOptionData: listOptionData.map((item, index) => { listOptionData: listOptionData.map((item, index) => {
if(index > curIndex && index < 4 ) { if(index > curIndex && index < 4 ) {
item.name = localOtherObj.name item.name = localOtherObj.name
item.value = localOtherObj.value item.value = localOtherObj.value
if(listOptionData[1].value && item.title == '客户名称') { if(listOptionData[1].value && item.title == '客户名称') {
...@@ -320,7 +320,7 @@ class EquipConsuPage extends Component { ...@@ -320,7 +320,7 @@ class EquipConsuPage extends Component {
let tempTit = '' let tempTit = ''
for(let chIndex in listOptionData) { for(let chIndex in listOptionData) {
if(chIndex > 0 && chIndex < 7 if(chIndex > 0 && chIndex < 7
&& chIndex != 5 && chIndex != 5
&& !listOptionData[chIndex].value) { && !listOptionData[chIndex].value) {
// 选择器为空 // 选择器为空
tempTit = `“${listOptionData[chIndex].title}”未选择` tempTit = `“${listOptionData[chIndex].title}”未选择`
...@@ -334,7 +334,7 @@ class EquipConsuPage extends Component { ...@@ -334,7 +334,7 @@ class EquipConsuPage extends Component {
tempTit = `“${listOptionData[chIndex].title}”未输入` tempTit = `“${listOptionData[chIndex].title}”未输入`
tempStatus = true tempStatus = true
break break
} else if( chIndex == 12 } else if( chIndex == 12
&& !listOptionData[chIndex].subOption.length ) { && !listOptionData[chIndex].subOption.length ) {
tempTit = `“${listOptionData[chIndex].title}”未添加` tempTit = `“${listOptionData[chIndex].title}”未添加`
tempStatus = true tempStatus = true
...@@ -425,7 +425,7 @@ class EquipConsuPage extends Component { ...@@ -425,7 +425,7 @@ class EquipConsuPage extends Component {
}) })
tempOption = [...resultArr] tempOption = [...resultArr]
} }
this.setState({ this.setState({
listCurrentOption: [...tempOption] listCurrentOption: [...tempOption]
}, () => { }, () => {
...@@ -513,7 +513,7 @@ class EquipConsuPage extends Component { ...@@ -513,7 +513,7 @@ class EquipConsuPage extends Component {
} }
}, () => { }, () => {
that.getCustomerData() that.getCustomerData()
}) })
} }
} }
...@@ -676,7 +676,7 @@ class EquipConsuPage extends Component { ...@@ -676,7 +676,7 @@ class EquipConsuPage extends Component {
this.setState({ this.setState({
listOptionData: listOptionData listOptionData: listOptionData
}) })
} }
this.closeDateModal(true) this.closeDateModal(true)
} }
...@@ -849,7 +849,7 @@ class EquipConsuPage extends Component { ...@@ -849,7 +849,7 @@ class EquipConsuPage extends Component {
// 耗材明细 点击 // 耗材明细 点击
handleConsumDetailCheck() { handleConsumDetailCheck() {
let { listOptionData } = this.state let { listOptionData } = this.state
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull() if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()
&& this.judgeOrderInfoIsNull()) { && this.judgeOrderInfoIsNull()) {
this.props.navigation.navigate('ConsumDetailsPage', { this.props.navigation.navigate('ConsumDetailsPage', {
title: '器械消耗 - 添加明细', title: '器械消耗 - 添加明细',
...@@ -947,7 +947,7 @@ class EquipConsuPage extends Component { ...@@ -947,7 +947,7 @@ class EquipConsuPage extends Component {
let {url} = imgResult.data let {url} = imgResult.data
localPhoOption.push(source); // 本地图片地址 localPhoOption.push(source); // 本地图片地址
listOptionData[14].uploadImgArr.push(url) // 服务器图片地址 listOptionData[14].uploadImgArr.push(url) // 服务器图片地址
that.setState({ that.setState({
localPhoOption, localPhoOption,
listOptionData listOptionData
}); });
...@@ -983,7 +983,7 @@ class EquipConsuPage extends Component { ...@@ -983,7 +983,7 @@ class EquipConsuPage extends Component {
handleSubmit() { handleSubmit() {
this.changeCanSub(true) this.changeCanSub(true)
let { state, props } = this let { state, props } = this
// 可提交 并且 不处于正在提交中 // 可提交 并且 不处于正在提交中
if(state.canSubFlag && !state.isSubLoding) { if(state.canSubFlag && !state.isSubLoding) {
let tempSubOption = state.submitOption let tempSubOption = state.submitOption
...@@ -1213,7 +1213,7 @@ class EquipConsuPage extends Component { ...@@ -1213,7 +1213,7 @@ class EquipConsuPage extends Component {
> >
<View style={styles.radio_icon}> <View style={styles.radio_icon}>
{ {
listOptionData[10].isRedio == 'Y' ? listOptionData[10].isRedio == 'Y' ?
<Image style={icon_style} source={require('../../images/radio_yes.png')} /> <Image style={icon_style} source={require('../../images/radio_yes.png')} />
: <Image style={icon_style} source={require('../../images/radio_no.png')} /> : <Image style={icon_style} source={require('../../images/radio_no.png')} />
} }
...@@ -1227,7 +1227,7 @@ class EquipConsuPage extends Component { ...@@ -1227,7 +1227,7 @@ class EquipConsuPage extends Component {
> >
<View style={styles.radio_icon}> <View style={styles.radio_icon}>
{ {
listOptionData[10].isRedio == 'Y' ? listOptionData[10].isRedio == 'Y' ?
<Image style={icon_style} source={require('../../images/radio_no.png')} /> <Image style={icon_style} source={require('../../images/radio_no.png')} />
: <Image style={icon_style} source={require('../../images/radio_yes.png')} /> : <Image style={icon_style} source={require('../../images/radio_yes.png')} />
} }
...@@ -1261,7 +1261,7 @@ class EquipConsuPage extends Component { ...@@ -1261,7 +1261,7 @@ class EquipConsuPage extends Component {
// 返回选择器 // 返回选择器
renderPickerModel() { renderPickerModel() {
let { let {
listCurrentOption, listCurrentOption,
currentItem, currentItem,
currentTitle, currentTitle,
...@@ -1276,12 +1276,12 @@ class EquipConsuPage extends Component { ...@@ -1276,12 +1276,12 @@ class EquipConsuPage extends Component {
itemValue={currentItem.value} itemValue={currentItem.value}
itemTitle={currentTitle} itemTitle={currentTitle}
closeModal={(show) => this.handleCloseModal(show)} closeModal={(show) => this.handleCloseModal(show)}
/> />
</SafeAreaView> </SafeAreaView>
) )
} }
// 返回备注元素 // 返回备注元素
renderRemarksItem() { renderRemarksItem() {
let { state } = this let { state } = this
...@@ -1297,7 +1297,7 @@ class EquipConsuPage extends Component { ...@@ -1297,7 +1297,7 @@ class EquipConsuPage extends Component {
underlineColorAndroid = {'transparent'} underlineColorAndroid = {'transparent'}
multiline = {true} multiline = {true}
ref = {textInput => this.TextInput = textInput} ref = {textInput => this.TextInput = textInput}
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, state.listOptionData[11])} onChangeText={(text) => this.handleRemarkInput(text, state.listOptionData[11])}
...@@ -1318,7 +1318,7 @@ class EquipConsuPage extends Component { ...@@ -1318,7 +1318,7 @@ class EquipConsuPage extends Component {
<View style={list_common_item.detail_inner}> <View style={list_common_item.detail_inner}>
<Text style={list_common_item.detail_tit}>耗材明细</Text> <Text style={list_common_item.detail_tit}>耗材明细</Text>
{ {
state.listOptionData[12].subOption.length ? state.listOptionData[12].subOption.length ?
<View <View
style={list_common_item.detail_sub_cont}> style={list_common_item.detail_sub_cont}>
<View style={list_common_item.detail_sub_tit}> <View style={list_common_item.detail_sub_tit}>
...@@ -1360,7 +1360,7 @@ class EquipConsuPage extends Component { ...@@ -1360,7 +1360,7 @@ class EquipConsuPage extends Component {
<Text style={list_common_item.de_tip}> <Text style={list_common_item.de_tip}>
序列号:{item.serial_number ? item.serial_number : '无'} 序列号:{item.serial_number ? item.serial_number : '无'}
</Text> </Text>
{ OBS_MOBILE_EQU_CON_DISPLAY_PRICE === 'Y' ? { OBS_MOBILE_EQU_CON_DISPLAY_PRICE === 'Y' ?
<Text style={list_common_item.de_tip}> <Text style={list_common_item.de_tip}>
单价(¥){ item.sale_price } 单价(¥){ item.sale_price }
</Text> : null } </Text> : null }
...@@ -1376,7 +1376,7 @@ class EquipConsuPage extends Component { ...@@ -1376,7 +1376,7 @@ class EquipConsuPage extends Component {
<View style={list_common_item.detail_inner}> <View style={list_common_item.detail_inner}>
<Text style={list_common_item.detail_tit}>{state.listOptionData[13].title}</Text> <Text style={list_common_item.detail_tit}>{state.listOptionData[13].title}</Text>
{ {
state.listOptionData[13].subOption.length ? state.listOptionData[13].subOption.length ?
<View <View
style={list_common_item.detail_sub_cont}> style={list_common_item.detail_sub_cont}>
<View style={list_common_item.detail_sub_tit}> <View style={list_common_item.detail_sub_tit}>
...@@ -1413,7 +1413,7 @@ class EquipConsuPage extends Component { ...@@ -1413,7 +1413,7 @@ class EquipConsuPage extends Component {
return( return(
<View style={list_common_item.con_de_sub} key={index}> <View style={list_common_item.con_de_sub} key={index}>
<Text style={[list_common_item.de_sub_tit]}> <Text style={[list_common_item.de_sub_tit]}>
{index+1}{ item.fee_type_name } {index+1}{ item.fee_type_name }
</Text> </Text>
<Text style={list_common_item.de_tip}> <Text style={list_common_item.de_tip}>
{item.fee_amount_title}(¥){ item.fee_amount } {item.fee_amount_title}(¥){ item.fee_amount }
...@@ -1440,12 +1440,12 @@ class EquipConsuPage extends Component { ...@@ -1440,12 +1440,12 @@ class EquipConsuPage extends Component {
> >
<Image style={icon_style} source={require('../../images/add_icon_large.png')} /> <Image style={icon_style} source={require('../../images/add_icon_large.png')} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
</CellTextStyle> </CellTextStyle>
) )
} }
// 返回增加的图片 // 返回增加的图片
renderPicItem(item, index) { renderPicItem(item, index) {
return ( return (
...@@ -1478,7 +1478,7 @@ class EquipConsuPage extends Component { ...@@ -1478,7 +1478,7 @@ class EquipConsuPage extends Component {
zoomImages.push({ zoomImages.push({
url: `${global_domain_config}/${item}` url: `${global_domain_config}/${item}`
}) })
}) })
return ( return (
<ZoomPictureModel <ZoomPictureModel
isShowImage={isShowImage} isShowImage={isShowImage}
...@@ -1498,11 +1498,11 @@ class EquipConsuPage extends Component { ...@@ -1498,11 +1498,11 @@ class EquipConsuPage extends Component {
) )
} }
render() { render() {
let { canSubFlag } = this.state let { canSubFlag } = this.state
let { navigation } = this.props let { navigation } = this.props
let { title } = navigation.state.params let { title } = navigation.state.params
return ( return (
<View style={styles.equip_container}> <View style={styles.equip_container}>
<StatusBarView <StatusBarView
isReactStackNavigator={true} isReactStackNavigator={true}
...@@ -1581,9 +1581,9 @@ const styles = StyleSheet.create({ ...@@ -1581,9 +1581,9 @@ const styles = StyleSheet.create({
}, },
list_cont: { list_cont: {
flex: 1 flex: 1
}, },
item_container: { item_container: {
flex: 1 flex: 1
}, },
sub_btn_pro: { sub_btn_pro: {
backgroundColor: promary_color backgroundColor: promary_color
...@@ -1639,5 +1639,5 @@ const mapDispatchToProps = (dispatch) => { ...@@ -1639,5 +1639,5 @@ const mapDispatchToProps = (dispatch) => {
} }
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(EquipConsuPage); export default connect(mapStateToProps, mapDispatchToProps)(EquipConsuPage);
\ No newline at end of file
...@@ -44,7 +44,7 @@ import FilterModel from './module/FilterModel'; ...@@ -44,7 +44,7 @@ import FilterModel from './module/FilterModel';
class HistoricalOrderPage extends Component { class HistoricalOrderPage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
searchValue: '', searchValue: '',
isSubLoding: false, // 加载中弹窗 isSubLoding: false, // 加载中弹窗
lodingTitle: '加载中', lodingTitle: '加载中',
...@@ -73,14 +73,14 @@ class HistoricalOrderPage extends Component { ...@@ -73,14 +73,14 @@ class HistoricalOrderPage extends Component {
], ],
isShowSelect: false, // 显示/隐藏 筛选内容 isShowSelect: false, // 显示/隐藏 筛选内容
borrowStatus: ['待审核','待出库','待还货','其他'], borrowStatus: ['待审核','待出库','待还货','其他'],
consumeStatus: ['待审核','已消耗'], consumeStatus: ['待确认消耗','已确认消耗'],
transferStatus: ['已输入', '已审批', '已驳回', '已提交', '已取消'], transferStatus: ['已输入', '已审批', '已驳回', '已提交', '已取消'],
searchBorrowStatus: [ // 【借货】对应的状态值 searchBorrowStatus: [ // 【借货】对应的状态值
"ENTERED,SUBMITTED", "ENTERED,SUBMITTED",
"APPROVED,COLLECTING_WAITING_CONFIRM", "APPROVED,COLLECTING_WAITING_CONFIRM",
"COLLECTED,RETURNING_WAITING_CONFIRM", "COLLECTED,RETURNING_WAITING_CONFIRM",
"RETURNED,CLOSED,REJECTED,CANCELED,CONSUMED" "RETURNED,CLOSED,REJECTED,CANCELED,CONSUMED"
], ],
searchComsumeStatus: [ // 【消耗】对应的状态值 searchComsumeStatus: [ // 【消耗】对应的状态值
"N", "N",
"Y" "Y"
...@@ -90,7 +90,7 @@ class HistoricalOrderPage extends Component { ...@@ -90,7 +90,7 @@ class HistoricalOrderPage extends Component {
], ],
whetherCallClick: false, // 是否调用筛选弹窗的查询 whetherCallClick: false, // 是否调用筛选弹窗的查询
wheShowNoData: false, // 是否展示无数据提示 wheShowNoData: false, // 是否展示无数据提示
} }
} }
...@@ -106,7 +106,7 @@ class HistoricalOrderPage extends Component { ...@@ -106,7 +106,7 @@ class HistoricalOrderPage extends Component {
case LOGIN_NO: case LOGIN_NO:
navigation.navigate('LoginPage') navigation.navigate('LoginPage')
break; break;
default: default:
break; break;
} }
} }
...@@ -124,12 +124,12 @@ class HistoricalOrderPage extends Component { ...@@ -124,12 +124,12 @@ class HistoricalOrderPage extends Component {
that.changeCurrentOption(); that.changeCurrentOption();
}) })
}, 500) }, 500)
break; break;
case HISTOR_ORDER_SEARCH_FAILURE: case HISTOR_ORDER_SEARCH_FAILURE:
that.changeSubLoding(false) that.changeSubLoding(false)
break; break;
default: default:
break; break;
} }
} }
...@@ -247,7 +247,7 @@ class HistoricalOrderPage extends Component { ...@@ -247,7 +247,7 @@ class HistoricalOrderPage extends Component {
contOptionData: [], // 清空查询数据 contOptionData: [], // 清空查询数据
wheShowNoData: false // 默认不展示 wheShowNoData: false // 默认不展示
}) })
switch(topActiveIndex) { switch(topActiveIndex) {
case 0: case 0:
props.requestGetAllBorrow(params) props.requestGetAllBorrow(params)
...@@ -324,7 +324,7 @@ class HistoricalOrderPage extends Component { ...@@ -324,7 +324,7 @@ class HistoricalOrderPage extends Component {
// 返回中间主要内容 // 返回中间主要内容
renderContItem() { renderContItem() {
let { let {
whetherCallClick, whetherCallClick,
topProcOptionList, topProcOptionList,
topActiveIndex, topActiveIndex,
...@@ -337,7 +337,7 @@ class HistoricalOrderPage extends Component { ...@@ -337,7 +337,7 @@ class HistoricalOrderPage extends Component {
<View style={styles.top_box}> <View style={styles.top_box}>
<View style={styles.top_tab_cont}> <View style={styles.top_tab_cont}>
{ {
topProcOptionList.map((item, index) => topProcOptionList.map((item, index) =>
<TouchableOpacity <TouchableOpacity
activeOpacity={1} activeOpacity={1}
style={styles.top_touch_cont} style={styles.top_touch_cont}
...@@ -370,7 +370,7 @@ class HistoricalOrderPage extends Component { ...@@ -370,7 +370,7 @@ class HistoricalOrderPage extends Component {
</Text> </Text>
<View style={styles.sea_icon}> <View style={styles.sea_icon}>
{ {
isShowSelect ? isShowSelect ?
<Image source={require('../../images/arr_top.png')} style={icon_style} /> <Image source={require('../../images/arr_top.png')} style={icon_style} />
: <Image source={require('../../images/arr_bom.png')} style={icon_style} /> : <Image source={require('../../images/arr_bom.png')} style={icon_style} />
} }
...@@ -389,7 +389,7 @@ class HistoricalOrderPage extends Component { ...@@ -389,7 +389,7 @@ class HistoricalOrderPage extends Component {
callSupClick={whetherCallClick} callSupClick={whetherCallClick}
callSupTopList={(data) => this.handleChangeTopList(data) } callSupTopList={(data) => this.handleChangeTopList(data) }
/> />
</View> </View>
</View> </View>
{/* 底部筛选数据 */} {/* 底部筛选数据 */}
...@@ -399,9 +399,9 @@ class HistoricalOrderPage extends Component { ...@@ -399,9 +399,9 @@ class HistoricalOrderPage extends Component {
> >
{/* 查询为空数据时 */} {/* 查询为空数据时 */}
{ {
wheShowNoData ? wheShowNoData ?
<View style={styles.cont_list_item}> <View style={styles.cont_list_item}>
<TouchableOpacity <TouchableOpacity
activeOpacity={1} activeOpacity={1}
style={styles.cont_no_list_box} style={styles.cont_no_list_box}
> >
...@@ -409,10 +409,10 @@ class HistoricalOrderPage extends Component { ...@@ -409,10 +409,10 @@ class HistoricalOrderPage extends Component {
</TouchableOpacity> </TouchableOpacity>
</View> </View>
: null : null
} }
{/* 底部每一列数据 */} {/* 底部每一列数据 */}
{ {
contOptionData.map((item, index) => contOptionData.map((item, index) =>
this.renderSubListItem(item, index) this.renderSubListItem(item, index)
) )
} }
...@@ -458,13 +458,13 @@ class HistoricalOrderPage extends Component { ...@@ -458,13 +458,13 @@ class HistoricalOrderPage extends Component {
{item.local_his_time} {item.local_his_time}
</Text> </Text>
{ {
topActiveIndex == 2 ? topActiveIndex == 2 ?
<Text style={styles.cont_tip}> <Text style={styles.cont_tip}>
来源借货订单号:{item.source_surgery_order_number} 来源借货订单号:{item.source_surgery_order_number}
</Text> : null </Text> : null
} }
{ {
topActiveIndex == 2 ? topActiveIndex == 2 ?
<Text style={styles.cont_tip}> <Text style={styles.cont_tip}>
{item.source_surgery_date ? moment(item.source_surgery_date).format('YYYY/MM/DD HH:mm') : '无'} {item.source_surgery_date ? moment(item.source_surgery_date).format('YYYY/MM/DD HH:mm') : '无'}
</Text> : null </Text> : null
...@@ -474,9 +474,9 @@ class HistoricalOrderPage extends Component { ...@@ -474,9 +474,9 @@ class HistoricalOrderPage extends Component {
<Text <Text
style={[ style={[
styles.cont_rig_status, styles.cont_rig_status,
(item.local_his_status == '待审核' || item.local_his_status == '已提交') ? styles.status_audit : '', ['待审核', '已提交', '待确认消耗'].includes(item.local_his_status) && styles.status_audit,
(item.local_his_status == '待还货' || item.local_his_status == '已输入' || item.local_his_status == '已驳回') ? styles.status_return : '', ['待还货', '已输入', '已驳回', '已确认消耗'].includes(item.local_his_status) && styles.status_return,
(item.local_his_status == '其他' || item.local_his_status == '已取消') ? styles.status_other : '' ['其他', '已取消'].includes(item.local_his_status) && styles.status_other
]}> ]}>
{item.local_his_status} {item.local_his_status}
</Text> </Text>
...@@ -671,5 +671,5 @@ const mapDispatchToProps = (dispatch) => { ...@@ -671,5 +671,5 @@ const mapDispatchToProps = (dispatch) => {
} }
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(HistoricalOrderPage); export default connect(mapStateToProps, mapDispatchToProps)(HistoricalOrderPage);
\ No newline at end of file
...@@ -44,7 +44,7 @@ import ShowModel from '../../common/ShowModel'; ...@@ -44,7 +44,7 @@ import ShowModel from '../../common/ShowModel';
class LineOrderPage extends Component { class LineOrderPage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
isSubLoding: false, // 加载中弹窗 isSubLoding: false, // 加载中弹窗
lodingTitle: '加载中', lodingTitle: '加载中',
consumaData: { consumaData: {
...@@ -61,6 +61,142 @@ class LineOrderPage extends Component { ...@@ -61,6 +61,142 @@ class LineOrderPage extends Component {
orderSupOptions: {}, // 获取主表数据 orderSupOptions: {}, // 获取主表数据
toolShowPopup: false, // 弹窗显示 toolShowPopup: false, // 弹窗显示
popFormItem: {}, // 弹窗对象 popFormItem: {}, // 弹窗对象
// 渲染内容,下标就是历史列表里的序号subIndex
columns: [
// 借货订单
[
{
prop: 'local_his_name',
name: '手术名称',
},
{
prop: 'doctor_name',
name: '手术医生',
},
{
prop: 'local_his_time',
name: '手术时间',
},
{
prop: 'customer_name',
name: '客户名称',
},
{
prop: 'local_his_number',
name: '订 单 号',
},
{
prop: 'create_time',
name: '下单日期',
format: data => data && moment(data).format('YYYY/MM/DD HH:mm')
},
{
prop: 'allPlanQuanSum',
name: '下单数量',
obj: 'consumaData'
},
{
prop: 'surgery_desc',
name: '备注信息',
},
],
[ // 消耗订单
{
prop: 'surgery_collect_number',
name: '借货订单',
},
{
prop: 'consume_order_number',
name: '消耗订单',
},
{
prop: 'local_his_name',
name: '结单标识',
},
{
prop: 'seller_name',
name: '业 务 员',
suffix: () => {
const {local_his_time} = this.state.orderSupOptions
return !!local_his_time && `(${moment(local_his_time).format('YYYY/MM/DD HH:mm')})`
}
},
{
prop: 'customer_name',
name: '客户名称',
},
{
prop: 'doctor_name',
name: '手术医生',
},
{
prop: 'local_his_time',
name: '消耗时间',
},
{
prop: 'patient_id',
name: '病 历 号',
},
{
prop: 'patient_bed',
name: '床 位',
},
{
prop: 'patient_name',
name: '患者姓名',
},
{
prop: 'patient_age',
name: '患者年龄',
},
{
prop: 'patient_gender',
name: '患者性别',
},
{
prop: 'surgery_desc',
name: '备注信息',
},
], [{
prop: 'local_his_name',
name: '目标借货订单号',
suffix: () => {
const {orderSupOptions} = this.state
return `(${orderSupOptions.local_his_time})`
}
},
{
prop: 'source_surgery_order_number',
name: '来源借货订单号',
ifShow: () => !!this.state.orderSupOptions.source_surgery_order_number,
suffix: () => {
const {source_surgery_date} = this.state.orderSupOptions
return !!source_surgery_date && `(${moment(source_surgery_date).format('YYYY/MM/DD HH:mm')})`
}
},
{
prop: 'doctor_name',
name: '手术医生',
},
{
prop: 'destination_customer_name',
name: '目标客户名称',
},
{
prop: 'source_customer_name',
name: '来源客户名称',
},
{
prop: 'order_number',
name: '订单号',
},
{
prop: 'surgery_desc',
name: '备注信息',
},
]
]
} }
} }
...@@ -75,7 +211,7 @@ class LineOrderPage extends Component { ...@@ -75,7 +211,7 @@ class LineOrderPage extends Component {
case LOGIN_NO: case LOGIN_NO:
navigation.navigate('LoginPage') navigation.navigate('LoginPage')
break; break;
default: default:
break; break;
} }
} }
...@@ -270,7 +406,7 @@ class LineOrderPage extends Component { ...@@ -270,7 +406,7 @@ class LineOrderPage extends Component {
<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}>
{ {
state.consumaData.subOption.length ? state.consumaData.subOption.length ?
<View style={list_common_item.detail_sub_cont}> <View style={list_common_item.detail_sub_cont}>
<View style={list_common_item.detail_sub_tit}> <View style={list_common_item.detail_sub_tit}>
<Text style={list_common_item.detail_tit_text}> <Text style={list_common_item.detail_tit_text}>
...@@ -285,7 +421,7 @@ class LineOrderPage extends Component { ...@@ -285,7 +421,7 @@ class LineOrderPage extends Component {
onPress={() => this.handleDetailBtmCheck(false)} onPress={() => this.handleDetailBtmCheck(false)}
> >
<Image style={[icon_style, list_common_item.detail_top_icon]} source={require('../../../images/arr_btm.png')} /> <Image style={[icon_style, list_common_item.detail_top_icon]} source={require('../../../images/arr_btm.png')} />
</TouchableOpacity> : </TouchableOpacity> :
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
style={[list_common_item.detail_icon, list_common_item.detail_icon_rig]} style={[list_common_item.detail_icon, list_common_item.detail_icon_rig]}
...@@ -294,7 +430,7 @@ class LineOrderPage extends Component { ...@@ -294,7 +430,7 @@ class LineOrderPage extends Component {
<Image style={[icon_style, list_common_item.detail_top_icon]} source={require('../../../images/arr_rig.png')} /> <Image style={[icon_style, list_common_item.detail_top_icon]} source={require('../../../images/arr_rig.png')} />
</TouchableOpacity> </TouchableOpacity>
} }
</View> </View>
{ {
state.consumaData.isShowSub ? state.consumaData.isShowSub ?
...@@ -339,122 +475,51 @@ class LineOrderPage extends Component { ...@@ -339,122 +475,51 @@ class LineOrderPage extends Component {
// 返回主要内容 // 返回主要内容
renderContItem() { renderContItem() {
let {orderSupOptions, consumaData} = this.state let {orderSupOptions, consumaData, columns} = this.state
let {supIndex} = this.props.navigation.state.params let {supIndex} = this.props.navigation.state.params
let tempTit = [] const subColumns = columns[supIndex]
if(supIndex == 0) {
tempTit.push('手术名称:', '手术时间:')
} else if(supIndex == 1) {
tempTit.push('结单标识:', '消耗时间:')
} else if(supIndex == 2) {
tempTit.push('目标借货订单号:', '手术时间:')
}
return ( return (
<ScrollView style={styles.line_cont_scroll}> <ScrollView style={styles.line_cont_scroll}>
<View style={styles.fo_cont_inner}> <View style={styles.fo_cont_inner}>
<Text style={styles.fo_cont_top_tit}>订单信息</Text> <Text style={styles.fo_cont_top_tit}>订单信息</Text>
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
{tempTit[0]}{orderSupOptions.local_his_name}
{
supIndex == 2 ? `(${orderSupOptions.local_his_time})` : null
}
</Text>
</View>
{
supIndex == 2 && orderSupOptions.source_surgery_order_number ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
来源借货订单号:{orderSupOptions.source_surgery_order_number}
{
orderSupOptions.source_surgery_date ? `(${moment(orderSupOptions.source_surgery_date).format('YYYY/MM/DD HH:mm')})` : null
}
</Text>
</View> : null
}
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
手术医生:{orderSupOptions.doctor_name ? orderSupOptions.doctor_name : '无'}
</Text>
</View>
{
supIndex !== 2 ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
{tempTit[1]}{orderSupOptions.local_his_time}
</Text>
</View> : null
}
{
supIndex !== 2 ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
客户名称:{orderSupOptions.customer_name ? orderSupOptions.customer_name : '无'}
</Text>
</View> :
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
目标客户名称:{orderSupOptions.destination_customer_name ? orderSupOptions.destination_customer_name : '无'}
</Text>
<Text style={styles.fo_tip_txt}>
来源客户名称:{orderSupOptions.source_customer_name ? orderSupOptions.source_customer_name : '无'}
</Text>
</View>
}
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
订单号:{supIndex == 0 ? orderSupOptions.local_his_number :
(supIndex == 1 ? orderSupOptions.surgery_collect_number : orderSupOptions.order_number)}
</Text>
</View>
{
supIndex == 0 ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
下单日期 {orderSupOptions.create_time ? moment(orderSupOptions.create_time).format('YYYY/MM/DD HH:mm') : '无'}
</Text>
</View>
: null
}
{ {
supIndex == 0 ? subColumns.map(col => {
<View style={styles.fo_cell_box}> const obj = this.state[col.obj] || orderSupOptions
<Text style={styles.fo_tip_txt}> if(!!col.ifShow && !col.ifShow()) return null
下单数量 {consumaData.allPlanQuanSum} console.log(Object.prototype.toString.call(col.prop))
</Text> return (
</View> <View key={col.name} style={styles.fo_cell_box}>
: null <View style={{minWidth: pxSize(70), }}>
} <Text style={[styles.fo_tip_txt]}>{col.name}:</Text>
<View style={styles.fo_cell_box}> </View>
<Text style={styles.fo_tip_txt}> <Text style={styles.fo_tip_txt}>
备注信息:{orderSupOptions.surgery_desc ? orderSupOptions.surgery_desc : '无'} {
</Text> <Text>{col.format ? col.format(obj[col.prop]) : obj[col.prop] || '无'}</Text>
</View> }
{ {
supIndex == 1 ? !!col.suffix && <Text>{col.suffix()}</Text>
<View style={styles.fo_cell_box}> }
<Text style={styles.fo_tip_txt}> </Text>
消耗数量:{consumaData.allConmQuanSum} </View>
</Text> )
</View> })
: null
}
{
consumaData.allOptSum ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_sum_txt}>
消耗金额:¥{consumaData.allOptSum}
</Text>
</View>
: null
} }
</View> </View>
<View style={styles.line_cont}> <View style={styles.line_cont}>
<Text style={styles.cont_tip_tit}>订单详情</Text> <View style={styles.line_cont_title}>
<Text style={styles.cont_tip_tit}>订单详情</Text>
{
supIndex === 1 &&
<View style={[styles.line_cont_title]}>
<Text style={{marginRight: pxSize(15)}}>数量:{consumaData.allConmQuanSum}</Text>
<Text style>金额:{consumaData.allOptSum}</Text>
</View>
}
</View>
{ this.renderConsumablesItem() } { this.renderConsumablesItem() }
{ this.renderDetailModel() } { this.renderDetailModel() }
...@@ -463,9 +528,9 @@ class LineOrderPage extends Component { ...@@ -463,9 +528,9 @@ class LineOrderPage extends Component {
<View style={styles.fo_sta_inner}> <View style={styles.fo_sta_inner}>
<Text style={[ <Text style={[
styles.fo_sta_txt, styles.fo_sta_txt,
(orderSupOptions.local_his_status == '待审核' || orderSupOptions.local_his_status == '已提交') ? styles.status_audit : '', ['待审核', '已提交', '待确认消耗'].includes(orderSupOptions.local_his_status) && styles.status_audit,
(orderSupOptions.local_his_status == '待还货' || orderSupOptions.local_his_status == '已输入' || orderSupOptions.local_his_status == '已驳回') ? styles.status_return : '', ['待还货', '已输入', '已驳回', '已确认消耗'].includes(orderSupOptions.local_his_status) && styles.status_return,
(orderSupOptions.local_his_status == '其他' || orderSupOptions.local_his_status == '已取消') ? styles.status_other : '' ['其他', '已取消'].includes(orderSupOptions.local_his_status) && styles.status_other
]}> ]}>
{orderSupOptions.local_his_status} {orderSupOptions.local_his_status}
</Text> </Text>
...@@ -550,10 +615,10 @@ class LineOrderPage extends Component { ...@@ -550,10 +615,10 @@ class LineOrderPage extends Component {
) )
} }
render() { render() {
let {navigation} = this.props let {navigation} = this.props
let {title} = navigation.state.params let {title} = navigation.state.params
return ( return (
<View style={styles.line_container}> <View style={styles.line_container}>
<StatusBarView <StatusBarView
isReactStackNavigator={true} isReactStackNavigator={true}
...@@ -593,6 +658,11 @@ const styles = StyleSheet.create({ ...@@ -593,6 +658,11 @@ const styles = StyleSheet.create({
paddingVertical: 16, paddingVertical: 16,
paddingBottom: 20 paddingBottom: 20
}, },
line_cont_title: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: "center"
},
cont_tip_tit: { cont_tip_tit: {
fontSize: 16, fontSize: 16,
fontFamily: font_family_regular, fontFamily: font_family_regular,
...@@ -621,13 +691,18 @@ const styles = StyleSheet.create({ ...@@ -621,13 +691,18 @@ const styles = StyleSheet.create({
fontFamily: font_family_regular, fontFamily: font_family_regular,
color: second_text_color color: second_text_color
}, },
fo_cell_box: {}, fo_cell_box: {
flexDirection: 'row'
},
fo_tip_txt: { fo_tip_txt: {
fontSize: third_text_size, fontSize: third_text_size,
fontFamily: font_family_regular, fontFamily: font_family_regular,
color: second_text_color, color: second_text_color,
lineHeight: 18 lineHeight: 18
}, },
fo_tip_txt_key: {
// minWidth: pxSize(120),
},
fo_sum_txt: { fo_sum_txt: {
color: first_text_color, color: first_text_color,
fontSize: 14, fontSize: 14,
...@@ -706,4 +781,4 @@ const mapDispatchToProps = (dispatch) => { ...@@ -706,4 +781,4 @@ const mapDispatchToProps = (dispatch) => {
}, },
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(LineOrderPage); export default connect(mapStateToProps, mapDispatchToProps)(LineOrderPage);
\ 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