Commit b48ea1ea by Denglingling

优化代码

parent 6c064d41
......@@ -56,6 +56,7 @@ class LoginPage extends Component{
this.timer = setTimeout(() => {
this.getLocalUserName()
this.setVersion()
this.initLoginInfo()
}, 300)
}
......@@ -111,6 +112,16 @@ class LoginPage extends Component{
})
}
// 初始化信息
initLoginInfo() {
let {subTitList} = this.state
this.setState({
isSubLoding: false,
subTit: subTitList[0],
isEnterHomeFlag: false
})
}
// 判断是否打开域名弹窗
isOpenDomainModel() {
let {global_domain_config} = this.props
......@@ -311,7 +322,7 @@ class LoginPage extends Component{
callback={(domainVal) => this.fillDomainCallBack(domainVal)}
domainValue={tempGlobalDomain}
/>
{ isEnterHomeFlag ? <UpgradeView version_apk={version_apk}/> : null}
{/* { isEnterHomeFlag ? <UpgradeView version_apk={version_apk}/> : null} */}
</View>
</ImageBackground>
</SafeAreaView>
......
......@@ -459,7 +459,7 @@ class ChooseProductPage extends Component {
left_item[LocalVariable.SELECTED_QUQNTITY] = 0
if (left_item.category_code === LocalVariable.SURGICAL_TEMPLATE || left_item.category_code === LocalVariable.NAIL_BOX || left_item.category_code === LocalVariable.EQUIPMENT_BAG || left_item.category_code === LocalVariable.SCATTERED_EQUIPMENT) {
if (left_item[LocalVariable.SELECTED_DATA_ARR].length) {
if (left_item[LocalVariable.SELECTED_DATA_ARR] && left_item[LocalVariable.SELECTED_DATA_ARR].length) {
// 加减
left_item[LocalVariable.SELECTED_DATA_ARR].map(arr_obj => {
left_item[LocalVariable.SELECTED_QUQNTITY] += arr_obj[LocalVariable.QUANTITY_FIELD]
......
......@@ -65,6 +65,7 @@ import {
import ImagePicker from 'react-native-image-picker';
import { exitLoginStatus, requestSysProfile } from '../../action/LoginAction';
import moment from 'moment';
import PageListArrow from '../common/listDataComponent/PageListArrow';
class TransOrderPage extends Component {
constructor(props) {
......@@ -641,13 +642,13 @@ class TransOrderPage extends Component {
}
// 组织 点击
handleOrganizationCheck() {
let { state, props } = this
handleOrganizationCheck(curData) {
let { props } = this
this.setState({
currentTitle: '组织',
currentTitle: curData.title,
currentItem: {
name: state.listOptionData[1].name,
value: state.listOptionData[1].value
name: curData.name,
value: curData.value
}
}, () => {
let params = {
......@@ -695,15 +696,15 @@ class TransOrderPage extends Component {
}
// 客户名称 点击
handleCustomerCheck() {
handleCustomerCheck(curData) {
let { state, props } = this
let that = this
if(this.judgeOrgIsNull()) {
that.setState({
currentTitle: '客户名称',
currentTitle: curData.title,
currentItem: {
name: state.listOptionData[2].name,
value: state.listOptionData[2].value
name: curData.name,
value: curData.value
}
}, () => {
// 在此修改接口
......@@ -758,15 +759,15 @@ class TransOrderPage extends Component {
}
// 目标订单信息 点击
handleTargetOrderCheck() {
handleTargetOrderCheck(curData) {
let { state, props } = this
let that = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
that.setState({
currentTitle: '目标订单信息',
currentTitle: curData.title,
currentItem: {
name: state.listOptionData[3].name,
value: state.listOptionData[3].value
name: curData.name,
value: curData.value
}
}, () => {
// 在此修改接口
......@@ -827,17 +828,20 @@ class TransOrderPage extends Component {
// }
}
// 目标仓库 点击
handleWareCheck(){
let { state, props } = this
handleWareCheck(curData){
let that = this
if(that.judgeOrgIsNull() && that.judgeCustomerIsNull()) {
let tempOption = this.changeNameAndValue(state.listOptionData[4].sub_options, 'destination_inv_name', 'destination_inv_code')
let filterOpt = dedupQuoteArray(tempOption, 'destination_inv_code')
let tempOption = dedupQuoteArray(curData.sub_options, 'destination_inv_code')
let filterOpt = this.changeNameAndValue(tempOption, 'destination_inv_name', 'destination_inv_code')
if(filterOpt.length === 0) {
show(`当前${curData.title}为空`)
return
}
that.setState({
currentTitle: state.listOptionData[4].title,
currentTitle: curData.title,
currentItem: {
name: state.listOptionData[4].name,
value: state.listOptionData[4].value
name: curData.name,
value: curData.value
},
listCurrentOption: [...filterOpt]
}, () => {
......@@ -1200,69 +1204,51 @@ class TransOrderPage extends Component {
let { listOptionData, bor_ware_required } = this.state
return(
<View style={styles.list_cont}>
<View style={styles.item_container}>
<TouchableOpacity
activeOpacity={1}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'销售员'}</TitleTextStyle>
<ContInputTextStyle editable={false} defaultValue={listOptionData[0].name}></ContInputTextStyle>
</CellTextStyle>
</TouchableOpacity>
</View>
<View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleOrganizationCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'组织'}</TitleTextStyle>
<ContTextStyle>{listOptionData[1].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View>
<View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleCustomerCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'客户名称'}</TitleTextStyle>
<ContTextStyle>{listOptionData[2].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View>
<View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleTargetOrderCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'目标订单信息'}</TitleTextStyle>
<ContTextStyle style={styles.small_txt}>{listOptionData[3].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleWareCheck()}
>
<CellTextStyle>
{ bor_ware_required === 'Y' ? <AsteriskTextStyle>*</AsteriskTextStyle> : null}
<TitleTextStyle>{listOptionData[4].title}</TitleTextStyle>
<ContTextStyle>{listOptionData[4].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow
listActOpa={1}
listEditAble={true}
listHasAster={true}
listItem={listOptionData[0]}
listDefaValue={'name'}
listTitle={'title'}
/>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[1]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[2]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleCustomerCheck(listOptionData[2])}
listHasArrow={true}
/>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[3]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleTargetOrderCheck(listOptionData[3])}
listHasArrow={true}
listMaxLines={3}
/>
{/* <PageListArrow
listActOpa={.8}
listHasAster={bor_ware_required === 'Y'}
listItem={listOptionData[4]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleWareCheck(listOptionData[4])}
listHasArrow={true}
/> */}
{ this.renderPickerModel() }
......
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