Commit c86c939c by Denglingling

1、修改【筛选】布局,封装为单独的组件;2、修改【订单明细】布局,增加详情弹窗;3、完善登录页【域名弹窗】

parent 6f3aef4b
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -18,7 +18,10 @@ import {
font_family_regular,
third_text_size,
second_text_size,
home_background_color
home_background_color,
first_text_color,
foundation_color,
pxSize
} from '../../../base/BaseStyle';
import StatusBarView from '../../common/StatusBarView';
import HeadBackItem from '../../common/HeadBackItem';
......@@ -34,6 +37,8 @@ import {
exitLoginStatus
} from '../../../action/LoginAction';
import { LOGIN_NO } from '../../../base/ActionTypes';
import moment from 'moment';
import ShowModel from '../../common/ShowModel';
class LineOrderPage extends Component {
constructor(props) {
......@@ -72,7 +77,9 @@ class LineOrderPage extends Component {
// }
]
},
supOptions: {}, // 获取主表数据
orderSupOptions: {}, // 获取主表数据
toolShowPopup: false, // 弹窗显示
popFormItem: {}, // 弹窗对象
}
}
......@@ -105,9 +112,8 @@ class LineOrderPage extends Component {
getLineOptionData() {
let {supIndex, data} = this.props.navigation.state.params
this.setState({
supOptions: data
orderSupOptions: data
})
console.log('supIndex-----', supIndex)
switch(supIndex) {
case 0:
// 借货
......@@ -140,7 +146,14 @@ class LineOrderPage extends Component {
that.changeSubLoding(false)
// 成功
let {surgery_collect_lines} = bowResult.data
let tempSum = 0
surgery_collect_lines.length && surgery_collect_lines.forEach(item => {
if(item.plan_quantity) {
tempSum += Number(item.plan_quantity)
}
})
consumaData.subOption = [...surgery_collect_lines]
consumaData.allPlanQuanSum = tempSum
that.setState({
consumaData
})
......@@ -170,7 +183,19 @@ class LineOrderPage extends Component {
that.changeSubLoding(false)
// 成功
let {sur_consume_lines} = conResult.data
let tempSum = 0
let tempConQuanSum = 0
sur_consume_lines.length && sur_consume_lines.forEach(item => {
if(item.sale_price) {
tempSum += Number(item.sale_price)
}
if(item.consumed_quantity) {
tempConQuanSum += Number(item.consumed_quantity)
}
})
consumaData.subOption = [...sur_consume_lines]
consumaData.allOptSum = tempSum
consumaData.allConmQuanSum = tempConQuanSum
that.setState({
consumaData
})
......@@ -194,6 +219,21 @@ class LineOrderPage extends Component {
})
}
// 关闭当前弹窗
handleCloseModal(show) {
this.setState({
toolShowPopup: show
})
}
// 耗材弹窗显示
handleIsShowDialog(item) {
this.setState({
toolShowPopup: !this.state.toolShowPopup,
popFormItem: item
})
}
// 返回耗材内容
renderConsumablesItem() {
let { state } = this
......@@ -237,6 +277,7 @@ class LineOrderPage extends Component {
}
</View> : null
}
</View> : null
}
</View>
......@@ -246,32 +287,30 @@ class LineOrderPage extends Component {
// 返回耗材明细子项
renderConDeSubItem(item, index) {
let {supIndex} = this.props.navigation.state.params
return(
<View style={list_common_item.con_de_sub} key={index}>
<TouchableOpacity
activeOpacity={.8}
style={list_common_item.con_de_sub}
key={index}
onPress={() => this.handleIsShowDialog(item)}
>
<Text style={list_common_item.de_sub_tit}>
{index+1}{ item.item_name } - {item.specification}
</Text>
{
item.serial_number ?
<Text style={list_common_item.de_tip}>
序列号:{ item.serial_number }
</Text>
: null
}
{
item.item_code ?
<Text style={list_common_item.de_tip}>
物料代码:{ item.item_code }
(supIndex == 1 && item.sale_price) ? <Text style={list_common_item.de_tip}>
单价(¥){ item.sale_price }
</Text>
: null
}
</View>
</TouchableOpacity>
)
}
// 返回主要内容
renderContItem() {
let {supOptions} = this.state
let {orderSupOptions, consumaData} = this.state
let {supIndex} = this.props.navigation.state.params
let tempTit = []
if(supIndex == 0) {
......@@ -282,52 +321,93 @@ class LineOrderPage extends Component {
return (
<ScrollView style={styles.line_cont_scroll}>
<View style={styles.line_cont}>
<Text style={styles.cont_tip_tit}>订单详情</Text>
{ this.renderConsumablesItem() }
<View style={styles.line_footer}>
<View style={styles.fo_cont_inner}>
<View style={styles.fo_tit_box}>
<Text style={styles.fo_txt}>
备注:{supOptions.surgery_desc ? supOptions.surgery_desc : '无'}
<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}
</Text>
</View>
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
手术医生:{orderSupOptions.doctor_name ? orderSupOptions.doctor_name : '无'}
</Text>
</View>
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
{tempTit[1]}{orderSupOptions.local_his_time}
</Text>
</View>
<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}>
{tempTit[0]}{supOptions.local_his_name}
订单号:{supIndex == 0 ? orderSupOptions.local_his_number : orderSupOptions.surgery_collect_number}
</Text>
</View>
{
supIndex == 0 ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
手术医生:{supOptions.doctor_name ? supOptions.doctor_name : '无'}
下单日期 {orderSupOptions.create_time ? moment(orderSupOptions.create_time).format('YYYY/MM/DD HH:mm') : '无'}
</Text>
</View>
: null
}
{
supIndex == 0 ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
{tempTit[1]}{supOptions.local_his_time}
下单数量 {consumaData.allPlanQuanSum}
</Text>
</View>
: null
}
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
客户名称:{supOptions.customer_name ? supOptions.customer_name : '无'}
备注信息:{orderSupOptions.surgery_desc ? orderSupOptions.surgery_desc : '无'}
</Text>
</View>
{
supIndex == 1 ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_tip_txt}>
订单号:{supOptions.local_his_number}
消耗数量:{consumaData.allConmQuanSum}
</Text>
</View>
: null
}
{
consumaData.allOptSum ?
<View style={styles.fo_cell_box}>
<Text style={styles.fo_sum_txt}>
消耗金额:¥{consumaData.allOptSum}
</Text>
</View>
: null
}
</View>
<View style={styles.line_cont}>
<Text style={styles.cont_tip_tit}>订单详情</Text>
{ this.renderConsumablesItem() }
{ this.renderDetailModel() }
<View style={styles.line_footer}>
<View style={styles.fo_sta_inner}>
<Text style={[
styles.fo_sta_txt,
supOptions.local_his_status == '待审核' ? styles.status_audit : '',
supOptions.local_his_status == '待还货' ? styles.status_return : '',
supOptions.local_his_status == '其他' ? styles.status_other : ''
orderSupOptions.local_his_status == '待审核' ? styles.status_audit : '',
orderSupOptions.local_his_status == '待还货' ? styles.status_return : '',
orderSupOptions.local_his_status == '其他' ? styles.status_other : ''
]}>
{supOptions.local_his_status}
{orderSupOptions.local_his_status}
</Text>
</View>
</View>
......@@ -344,6 +424,72 @@ class LineOrderPage extends Component {
)
}
// 返回弹窗
renderDetailModel() {
let {popFormItem, toolShowPopup} = this.state
return (
<ShowModel
title={ popFormItem.item_name}
show={ toolShowPopup }
closeModal={(show) => this.handleCloseModal(show)}
>
<View style={styles.model_cont}>
<View style={styles.model_cont_inner}>
<Text style={styles.mo_cont_title}>详细信息:</Text>
{
popFormItem.item_name ?
<Text style={styles.mo_cont_tip}>
通用名称:{popFormItem.item_name}
</Text> : null
}
{
popFormItem.serial_number ?
<Text style={styles.mo_cont_tip}>
物料序列:{popFormItem.serial_number}
</Text> : null
}
{
popFormItem.item_code ?
<Text style={styles.mo_cont_tip}>
物料代码:{popFormItem.item_code}
</Text> : null
}
{
popFormItem.specification ?
<Text style={styles.mo_cont_tip}>
规格型号:{popFormItem.specification}
</Text> : null
}
{
popFormItem.plan_quantity ?
<Text style={styles.mo_cont_tip}>
计划数量:{popFormItem.plan_quantity}
</Text> : null
}
{
popFormItem.storage_quantity ?
<Text style={styles.mo_cont_tip}>
库存数量:{popFormItem.storage_quantity}
</Text> : null
}
{
popFormItem.consumed_quantity ?
<Text style={styles.mo_cont_tip}>
消耗数量:{popFormItem.consumed_quantity}
</Text> : null
}
{
popFormItem.sale_price ?
<Text style={styles.mo_cont_tip}>
销售价格:{popFormItem.sale_price}
</Text> : null
}
</View>
</View>
</ShowModel>
)
}
render() {
let {navigation} = this.props
let {title} = navigation.state.params
......@@ -357,7 +503,6 @@ class LineOrderPage extends Component {
<SafeAreaView style={safe_view}>
<HeadBackItem title={title} navigation={navigation} />
<View style={styles.line_main}>
{ this.renderContItem() }
{this.renderLodingItem()}
......@@ -389,16 +534,24 @@ const styles = StyleSheet.create({
paddingBottom: 20
},
cont_tip_tit: {
fontSize: 14,
fontFamily: font_family_medium,
color: second_text_color
fontSize: 16,
fontFamily: font_family_regular,
color: first_text_color
},
line_footer: {},
fo_cont_inner: {
borderBottomWidth: 1,
borderBottomColor: '#CCCCCC',
paddingBottom: 18
// borderBottomWidth: 1,
// borderBottomColor: '#CCCCCC',
// paddingBottom: 18
backgroundColor: foundation_color,
padding: 20
},
fo_cont_top_tit: {
color: first_text_color,
fontFamily: font_family_medium,
fontSize: second_text_size,
paddingBottom: 8
},
fo_tit_box: {
paddingBottom: 12
......@@ -415,10 +568,19 @@ const styles = StyleSheet.create({
color: second_text_color,
lineHeight: 18
},
fo_sum_txt: {
color: first_text_color,
fontSize: 14,
fontFamily: font_family_medium,
paddingTop: 8
},
fo_sta_inner: {
paddingTop: 12,
alignItems: 'flex-end'
alignItems: 'flex-end',
borderTopWidth: 1,
borderTopColor: '#ECECEC',
paddingTop: 18
},
fo_sta_txt: {
fontSize: second_text_size,
......@@ -434,6 +596,39 @@ const styles = StyleSheet.create({
status_other: {
color: '#F4B61B'
},
// 弹窗
model_cont: {
// flex: 1
},
model_cont_inner: {
marginBottom: 48
},
mo_cont_title: {
color: first_text_color,
// fontWeight: 'bold',
fontSize: 14,
lineHeight: 24,
fontFamily: font_family_medium
},
mo_cont_tip: {
color: second_text_color,
fontSize: 14,
lineHeight: 24,
fontFamily: font_family_regular
},
mo_img_box: {
flex: 1,
borderWidth: 1,
borderColor: '#E1E1E1',
justifyContent: 'center',
alignItems: 'center',
height: pxSize(120)
},
mo_img: {
width: pxSize(100),
height: '100%'
},
})
const mapStateToProps = (state) => {
......
......@@ -49,17 +49,12 @@ class LoginPage extends Component{
componentDidMount() {
// this.subAutoLogin()
SplashScreen.hide() //关闭启动屏幕
// this.isOpenDomainModel()
}
componentWillReceiveProps(nextProps) {
// console.warn('this---',this.props.loginState)
// console.warn('next-----',nextProps.loginState)
if(this.props.loginState != nextProps.loginState) {
// console.warn('next-----',nextProps.loginState)
// console.warn('this---',this.props.loginState)
switch(nextProps.loginState) {
case LOGIN_DOING:
this.changeSubTit(true);
......@@ -68,7 +63,6 @@ class LoginPage extends Component{
this.changeSubTit();
break;
case LOGIN_NO:
// console.warn('LOGIN_NO---',LOGIN_NO,this.props)
this.changeSubTit();
this.setState({
password: ''
......@@ -85,10 +79,19 @@ class LoginPage extends Component{
}
// 获取当前用户名 ???
getLocalUserName() {
let {username} = this.props
if(username) {
this.setState({
username
})
}
}
// 判断是否打开域名弹窗
isOpenDomainModel() {
let {global_domain_config} = this.props
console.log('isOpenDomainModel-----', global_domain_config)
let tempInd = global_domain_config.indexOf('/') + 2
let tempGlobalDomain = global_domain_config.slice(tempInd)
if(tempGlobalDomain.includes("obs.uat.guke.tech")) {
......@@ -125,11 +128,11 @@ class LoginPage extends Component{
// this.enterHomePage()
let {username, password, isSubLoding} = this.state
let {global_domain_config} = this.props
if(global_domain_config.includes("obs.uat.guke.tech")) {
show('请修改正确域名')
return
}
// let {global_domain_config} = this.props
// if(global_domain_config.includes("obs.uat.guke.tech")) {
// show('请修改正确域名')
// return
// }
if (!isSubLoding) {
if (isEmpty(username)) {
show('请输入用户名')
......@@ -209,7 +212,6 @@ class LoginPage extends Component{
// 域名弹窗 回调
fillDomainCallBack(domainVal) {
// 存储值到 store
console.log('login-----', domainVal)
let {props} = this
props.setDomainConfigurate(domainVal)
}
......@@ -217,7 +219,6 @@ class LoginPage extends Component{
render() {
let {username, password, isSubLoding, subTit, isShowDomain} = this.state
let {global_domain_config} = this.props
console.log('login-----', global_domain_config)
let tempInd = global_domain_config.indexOf('/') + 2
let tempGlobalDomain = global_domain_config.slice(tempInd)
return (
......@@ -260,6 +261,7 @@ class LoginPage extends Component{
returnKeyType="done"
style={styles.row_input}
defaultValue={password}
clearButtonMode="while-editing"
onChangeText={(text) => this.handlePassword(text)}
/>
</View>
......
......@@ -20,7 +20,8 @@ import {
first_text_color,
btn_sub_color,
second_text_size,
title_text_color
title_text_color,
pxSize
} from '../../../base/BaseStyle';
import { show } from '../../../utils/Utils';
......@@ -36,7 +37,6 @@ class FillDomainModel extends Component {
}
componentWillReceiveProps(nextProps) {
console.log('nextProps.show----', nextProps.show, nextProps.domainValue)
if (this.state.isVisible != nextProps.show) {
this.setState({
isVisible: nextProps.show
......@@ -46,7 +46,7 @@ class FillDomainModel extends Component {
let tempDomain = nextProps.domainValue
let {isVisible} = this.state
if(tempDomain.includes("obs.uat.guke.tech")) {
tempDomain = ''
// tempDomain = ''
isVisible = true
}
this.setState({
......@@ -65,7 +65,6 @@ class FillDomainModel extends Component {
// 域名 输入
handleDomainInput(text) {
console.log('text----', text)
let isNull = false
if(!text) {
isNull = true
......@@ -78,10 +77,8 @@ class FillDomainModel extends Component {
// 确定
handleSubClick() {
let {defaDomainHead, domainValue, isNull} = this.state
console.log('确定-----', defaDomainHead, domainValue)
let {defaDomainHead, domainValue} = this.state
if(!domainValue) {
console.log('请输入域名!', isNull, domainValue)
this.setState({
isNull: true
})
......@@ -141,17 +138,9 @@ class FillDomainModel extends Component {
transparent={true}
visible={this.state.isVisible}
animationType={'fade'}
// onRequestClose={() => this.closeModal()}
>
<SafeAreaView style={safe_view}>
{/* <TouchableOpacity style={styles.container} activeOpacity={1}
// onPress={() => this.closeModal()}
>
{this.renderDialog()}
</TouchableOpacity> */}
<View style={styles.container}>
{/* <Text>hhh</Text> */}
{this.renderDialog()}
</View>
</SafeAreaView>
......@@ -167,9 +156,7 @@ const styles = StyleSheet.create({
},
container: {
flex: 1,
backgroundColor: 'rgba(0, 0, 0, 0.8)',
// paddingTop: '55%',
// alignItems: 'center'
backgroundColor: 'rgba(0, 0, 0, 0.5)'
},
cont_mian: {
flex: 1,
......@@ -184,7 +171,7 @@ const styles = StyleSheet.create({
flex: 1,
flexDirection: 'column',
backgroundColor: foundation_color,
height: pxHeight(400),
height: pxSize(360),
borderRadius: 10,
marginHorizontal: 30,
marginVertical: 20,
......@@ -192,18 +179,15 @@ const styles = StyleSheet.create({
paddingBottom: 60,
paddingHorizontal: 20
},
cont_tit_box: {
height: 20
},
cont_tit_box: {},
cont_tit: {
color: promary_text_color,
fontSize: 20,
lineHeight: 28,
fontFamily: font_family_semibold
},
cont_cell: {
height: 45,
// borderWidth: 1,
// borderColor: '#FF0000',
flexDirection: 'row',
alignItems: 'center',
borderRadius: 100,
......
......@@ -16,7 +16,7 @@ const defaultState = {
token:null,
username:'',
password:'',
global_domain_config: 'https://obs.uat.guke.tech', // 默认【深圳仓】;【十方】https://obs.uat.sfrx.guke.tech
global_domain_config: 'https://obs.uat.sfrx.guke.tech', // 默认【深圳仓】https://obs.uat.guke.tech;【十方】https://obs.uat.sfrx.guke.tech
}
export default login = (state = defaultState, action) => {
......
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