Commit b48ea1ea by Denglingling

优化代码

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