Commit b48ea1ea by Denglingling

优化代码

parent 6c064d41
......@@ -1106,17 +1106,6 @@ class EquipConsuPage extends Component {
listDefaValue={'name'}
listTitle={'title'}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={1}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'销售员'}</TitleTextStyle>
<ContInputTextStyle editable={false} defaultValue={listOptionData[0].name}></ContInputTextStyle>
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1126,19 +1115,6 @@ class EquipConsuPage extends Component {
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
{/* <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> */}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1148,19 +1124,6 @@ class EquipConsuPage extends Component {
listCallBack={() => this.handleCustomerCheck(listOptionData[2])}
listHasArrow={true}
/>
{/* <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> */}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1170,19 +1133,6 @@ class EquipConsuPage extends Component {
listCallBack={() => this.handleOrderInfoCheck(listOptionData[3])}
listHasArrow={true}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleOrderInfoCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'订单信息'}</TitleTextStyle>
<ContTextStyle>{listOptionData[3].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1192,27 +1142,6 @@ class EquipConsuPage extends Component {
listCallBack={() => this.handleEquipDateCheck(listOptionData[4])}
listHasArrow={true}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleEquipDateCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'消耗时间'}</TitleTextStyle>
<ContTextStyle>{listOptionData[4].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
<DateModel
date={listOptionData[4].dateValue}
closeModal={(show) => this.closeDateModal(show)}
show={dateModelPop}
callback={(date) => this.dateModalCallback(date)}
/>
</View> */}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1224,22 +1153,6 @@ class EquipConsuPage extends Component {
isTitInputStyle={true}
listCellStyle={styles.list_cell_box}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle style={styles.cell_title}>{'患者姓名'}</TitleTextStyle>
<ContInputTextStyle
style={styles.cell_input}
placeholder={`请输入`}
onChangeText={(text) => this.handlePatNameInput(text)}
defaultValue={listOptionData[5].value}
/>
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1249,21 +1162,6 @@ class EquipConsuPage extends Component {
listCallBack={() => this.handleGenderCheck(listOptionData[6])}
listHasArrow={true}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleGenderCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'性别'}</TitleTextStyle>
<ContTextStyle>{listOptionData[6].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1276,24 +1174,6 @@ class EquipConsuPage extends Component {
listCellStyle={styles.list_cell_box}
inputKeyboardType={'numeric'}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle style={styles.cell_title}>{'年龄'}</TitleTextStyle>
<ContInputTextStyle
style={styles.cell_input}
placeholder={`请输入`}
keyboardType={'numeric'}
onChangeText={(text) => this.handleAgeInput(text)}
defaultValue={listOptionData[7].value}
/>
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1306,24 +1186,6 @@ class EquipConsuPage extends Component {
listCellStyle={styles.list_cell_box}
inputKeyboardType={'numeric'}
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle style={styles.cell_title}>{'床位'}</TitleTextStyle>
<ContInputTextStyle
style={styles.cell_input}
placeholder={`请输入`}
keyboardType={'numeric'}
onChangeText={(text) => this.handleBedInput(text)}
defaultValue={listOptionData[8].value}
/>
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......@@ -1342,23 +1204,6 @@ class EquipConsuPage extends Component {
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle style={styles.cell_title}>{'病历号'}</TitleTextStyle>
<ContInputTextStyle
style={styles.cell_input}
placeholder={`请输入`}
keyboardType={'numeric'}
onChangeText={(text) => this.handleRecordNumInput(text)}
defaultValue={listOptionData[9].value}
/>
</CellTextStyle>
</TouchableOpacity>
</View> */}
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'是否结单'}</TitleTextStyle>
<View style={styles.btn_radio_box}>
<TouchableOpacity
......@@ -1627,17 +1472,6 @@ class EquipConsuPage extends Component {
renderZoomPicture() {
let { isShowImage, currShowImgIndex, listOptionData } = this.state
let { global_domain_config } = this.props
// // 测试
// let zoomImages = [{
// url: 'https://obs.uat.sfrx.guke.tech/upload/dingding/image/QDw05sTo.jpg',
// props: {
// // headers: ...
// }
// },{
// url: 'https://obs.uat.sfrx.guke.tech/upload/dingding/image/QDw05sTo.jpg',
// },{
// url: 'https://obs.uat.sfrx.guke.tech/jeecg-boot/sys/common/view/upload/dingding/image/8V4599aH.jpg'
// }]
// 正式
let zoomImages = []
listOptionData[14].uploadImgArr.forEach(item => {
......
......@@ -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>
......
......@@ -66,6 +66,7 @@ import {
QUICK_SUBMIT_FAILURE
} from '../../base/ActionTypes';
import moment from 'moment';
import PageListArrow from '../common/listDataComponent/PageListArrow';
class EquipConsuPage extends Component {
constructor(props) {
......@@ -709,13 +710,13 @@ class EquipConsuPage extends Component {
return result
}
// 组织 点击
handleOrganizationCheck() {
handleOrganizationCheck(curData) {
let { state, 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 = {
......@@ -762,15 +763,14 @@ class EquipConsuPage extends Component {
// }
}
// 客户名称 点击
handleCustomerCheck() {
let { state } = this
handleCustomerCheck(curData) {
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
}
}, () => {
// 在此修改接口
......@@ -831,15 +831,15 @@ class EquipConsuPage extends Component {
// }
}
// 收单地点 点击
handleBillCheck() {
handleBillCheck(curData) {
let { localCustomersOption, listOptionData } = this.state
let that = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
that.setState({
currentTitle: '收单地点',
currentTitle: curData.title,
currentItem: {
name: listOptionData[3].name,
value: listOptionData[3].value
name: curData.name,
value: curData.value
}
}, () => {
let tempOption = []
......@@ -880,15 +880,15 @@ class EquipConsuPage extends Component {
}
}
// 收货地点 点击
handleShipCheck() {
handleShipCheck(curData) {
let { localCustomersOption, listOptionData } = this.state
let that = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
that.setState({
currentTitle: '收货地点',
currentTitle: curData.title,
currentItem: {
name: listOptionData[4].name,
value: listOptionData[4].value
name: curData.name,
value: curData.value
}
}, () => {
let tempOption = []
......@@ -929,16 +929,16 @@ class EquipConsuPage extends Component {
}
}
// 主治医生 点击
handleDoctorCheck() {
handleDoctorCheck(curData) {
let { localCustomersOption, listOptionData } = this.state
let that = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
// 点击
that.setState({
currentTitle: '主治医生',
currentTitle: curData.title,
currentItem: {
name: listOptionData[5].name,
value: listOptionData[5].value
name: curData.name,
value: curData.value
}
}, () => {
let tempOption = []
......@@ -967,28 +967,27 @@ class EquipConsuPage extends Component {
}
}
// 主治医生 输入
handleDoctorInput(text) {
handleDoctorInput(text, curData) {
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map(item => {
if(item.title === '主治医生') {
listOptionData.map(function (item) {
if (item.title === curData.title) {
item.inputValue = text
}
return item
})
this.setState({
listOptionData: listOptionData
})
}
// 手术类型 点击
handleSurTypeCheck() {
let { listOptionData } = this.state
handleSurTypeCheck(curData) {
let { props } = this
let that = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
that.setState({
currentTitle: '手术类型',
currentTitle: curData.title,
currentItem: {
name: listOptionData[6].name,
value: listOptionData[6].value
name: curData.name,
value: curData.value
}
}, () => {
let params = {
......@@ -1000,14 +999,14 @@ class EquipConsuPage extends Component {
}
}
// 手术模板 点击
handleMatchTempCheck() {
handleMatchTempCheck(curData) {
let { state, props } = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
this.setState({
currentTitle: '手术模板',
currentTitle: curData.title,
currentItem: {
name: state.listOptionData[7].name,
value: state.listOptionData[7].value
name: curData.name,
value: curData.value
}
}, () => {
// 在此修改接口
......@@ -1069,17 +1068,17 @@ class EquipConsuPage extends Component {
}
}
// 手术时间 点击 2020-04-23 17:41
handleSurDateCheck() {
handleSurDateCheck(curData) {
let { listOptionData } = this.state
let date = listOptionData[8].value
let date = curData.value
if(date) {
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(item.title === '手术时间') {
listOptionData.map(function (item) {
if (item.title === curData.title) {
item.dateValue = formatStrForDate(date)
}
return item
})
this.setState({
listOptionData: listOptionData
})
}
this.closeDateModal(true)
......@@ -1105,14 +1104,14 @@ class EquipConsuPage extends Component {
})
}
// 订单类型 点击
handleOrderCheck() {
let { state, props } = this
handleOrderCheck(curData) {
let { props } = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
this.setState({
currentTitle: '订单类型',
currentTitle: curData.title,
currentItem: {
name: state.listOptionData[9].name,
value: state.listOptionData[9].value
name: curData.name,
value: curData.value
}
}, () => {
// 在此修改接口
......@@ -1125,14 +1124,14 @@ class EquipConsuPage extends Component {
}
}
// 借货仓库 点击
handleWareCheck(){
handleWareCheck(curData){
let { state, props } = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
this.setState({
currentTitle: state.listOptionData[10].title,
currentTitle: curData.title,
currentItem: {
name: state.listOptionData[10].name,
value: state.listOptionData[10].value
name: curData.name,
value: curData.value
}
}, () => {
// 在此修改接口
......@@ -1331,13 +1330,6 @@ class EquipConsuPage extends Component {
}else {
this.showWarnError(sysRes)
}
// else if(sysRes.error_code == 41006) {
// show('登录过期,请重新登录');
// this.props.exitLoginStatus();
// } else {
// let error_msg = sysRes.error_msg || sysRes.message
// show(error_msg);
// }
}
showWarnError(res){
if(res.error_code == 41006) {
......@@ -1354,161 +1346,113 @@ class EquipConsuPage extends Component {
let { listOptionData, dateModelPop, 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.handleBillCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'收单地点'}</TitleTextStyle>
<ContTextStyle>{listOptionData[3].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View>
<View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleShipCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'收货地点'}</TitleTextStyle>
<ContTextStyle>{listOptionData[4].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View>
<View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleDoctorCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'主治医生'}</TitleTextStyle>
<ContTextStyle>{listOptionData[5].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
{
listOptionData[5].showInput ?
<CellTextStyle>
<ContInputTextStyle
style={styles.cell_input}
placeholder={`请输入主治医生`}
onChangeText={(text) => this.handleDoctorInput(text)}
></ContInputTextStyle>
</CellTextStyle> : null
}
</View>
<View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleSurTypeCheck()}
>
<CellTextStyle>
<TitleTextStyle>{'手术类型'}</TitleTextStyle>
<ContTextStyle>{listOptionData[6].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View>
<View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleMatchTempCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'手术模板'}</TitleTextStyle>
<ContTextStyle>{listOptionData[7].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View>
<View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleSurDateCheck()}
>
<CellTextStyle>
<TitleTextStyle>{'手术时间'}</TitleTextStyle>
<ContTextStyle>{listOptionData[8].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
<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.handleBillCheck(listOptionData[3])}
listHasArrow={true}
/>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[4]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleShipCheck(listOptionData[4])}
listHasArrow={true}
/>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[5]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleDoctorCheck(listOptionData[5])}
listHasArrow={true}
listOtherInput={'请输入主治医生'}
otherInput={'showInput'}
otherInputCallBack={(text) => this.handleDoctorInput(text, listOptionData[5])}
/>
<PageListArrow
listActOpa={.8}
listItem={listOptionData[6]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleSurTypeCheck(listOptionData[6])}
listHasArrow={true}
/>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[7]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleMatchTempCheck(listOptionData[7])}
listHasArrow={true}
/>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[8]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleSurDateCheck(listOptionData[8])}
listHasArrow={true}
/>
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[9]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleOrderCheck(listOptionData[9])}
listHasArrow={true}
/>
{/* <PageListArrow
listActOpa={.8}
listHasAster={bor_ware_required === 'Y'}
listItem={listOptionData[10]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleWareCheck(listOptionData[10])}
listHasArrow={true}
/> */}
<DateModel
date={listOptionData[8].dateValue}
closeModal={(show) => this.closeDateModal(show)}
show={dateModelPop}
callback={(date) => this.dateModalCallback(date)}
callback={(date) => this.dateModalCallback(date, listOptionData[8])}
/>
</View>
<View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleOrderCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'订单类型'}</TitleTextStyle>
<ContTextStyle>{listOptionData[9].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[10].title}</TitleTextStyle>
<ContTextStyle>{listOptionData[10].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View> */}
{ this.renderPickerModel() }
</View>
)
......
......@@ -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