Commit fa026b12 by Denglingling

调整转单模块,新增多仓调整

parent 70928b94
...@@ -48,8 +48,9 @@ import { ...@@ -48,8 +48,9 @@ import {
setTransInitData, setTransInitData,
setTransDetailOption, setTransDetailOption,
reqTransSurgeryHospital, reqTransSurgeryHospital,
reqTransTargetOrderInfo, requestSubSourBorOrdNum,
requestListDataSuccess requestListDataSuccess,
reqTransOrganizations
} from '../../action/TransAction'; } from '../../action/TransAction';
import { show, dedupQuoteArray, cloneObject } from '../../utils/Utils'; import { show, dedupQuoteArray, cloneObject } from '../../utils/Utils';
import { import {
...@@ -62,7 +63,7 @@ import { ...@@ -62,7 +63,7 @@ import {
TRANS_SUBMIT_FAILURE TRANS_SUBMIT_FAILURE
} from '../../base/ActionTypes'; } from '../../base/ActionTypes';
import ImagePicker from 'react-native-image-picker'; import ImagePicker from 'react-native-image-picker';
import { exitLoginStatus } from '../../action/LoginAction'; import { exitLoginStatus, requestSysProfile } from '../../action/LoginAction';
import moment from 'moment'; import moment from 'moment';
class TransOrderPage extends Component { class TransOrderPage extends Component {
...@@ -97,18 +98,25 @@ class TransOrderPage extends Component { ...@@ -97,18 +98,25 @@ class TransOrderPage extends Component {
}, },
{ {
"id": "4", "id": "4",
title: '目标仓库',
name: '请选择',
value: '',
sub_options: []
},
{
"id": "5",
title: '备注', title: '备注',
value: '', value: '',
isRemark: true // 备注 isRemark: true // 备注
}, },
{ {
"id": "5", "id": "6",
title: '还有什么要安排的,可录音备注哟!', title: '还有什么要安排的,可录音备注哟!',
value: '', value: '',
isRecode: true // 录音 isRecode: true // 录音
}, },
{ {
"id": "6", "id": "7",
title: '耗材明细', title: '耗材明细',
btnTit: '+添加转单申请明细', btnTit: '+添加转单申请明细',
value: '', value: '',
...@@ -117,7 +125,7 @@ class TransOrderPage extends Component { ...@@ -117,7 +125,7 @@ class TransOrderPage extends Component {
subOption: [] subOption: []
}, },
{ {
"id": "7", "id": "8",
title: '添加图片', title: '添加图片',
value: '', value: '',
isAddImage: true, // 添加图片 isAddImage: true, // 添加图片
...@@ -162,7 +170,8 @@ class TransOrderPage extends Component { ...@@ -162,7 +170,8 @@ class TransOrderPage extends Component {
// 'file:///storage/emulated/0/Pictures/images/image-ea1a24b8-2d12-468f-ac23-e9aed20c6d31.jpg' // 'file:///storage/emulated/0/Pictures/images/image-ea1a24b8-2d12-468f-ac23-e9aed20c6d31.jpg'
], ],
isShowImage: false, isShowImage: false,
currShowImgIndex: 0 currShowImgIndex: 0,
bor_ware_required: '', // APP目标仓库必填权限
} }
} }
...@@ -170,6 +179,8 @@ class TransOrderPage extends Component { ...@@ -170,6 +179,8 @@ class TransOrderPage extends Component {
componentDidMount() { componentDidMount() {
this.getSellerName() this.getSellerName()
this.getAudioAuthorize() this.getAudioAuthorize()
this.getOrganizationData()
this.getSysConfigValue()
} }
// 赋值销售员 初始化数据 // 赋值销售员 初始化数据
...@@ -389,7 +400,7 @@ class TransOrderPage extends Component { ...@@ -389,7 +400,7 @@ class TransOrderPage extends Component {
// 初始化录音 // 初始化录音
this.prepareRecordingPath(this.state.audioPath) this.prepareRecordingPath(this.state.audioPath)
let { listOptionData } = this.state let { listOptionData } = this.state
listOptionData[5].value = '' listOptionData[6].value = ''
this.setState({ this.setState({
currentTime: 0, currentTime: 0,
stop: false, stop: false,
...@@ -431,7 +442,7 @@ class TransOrderPage extends Component { ...@@ -431,7 +442,7 @@ class TransOrderPage extends Component {
} }
if(subTransDetOption != nextProps.subTransDetOption) { if(subTransDetOption != nextProps.subTransDetOption) {
let { listOptionData } = this.state let { listOptionData } = this.state
listOptionData[6].subOption = nextProps.subTransDetOption listOptionData[7].subOption = nextProps.subTransDetOption
this.setState({ this.setState({
listOptionData listOptionData
}, () => { }, () => {
...@@ -444,12 +455,20 @@ class TransOrderPage extends Component { ...@@ -444,12 +455,20 @@ class TransOrderPage extends Component {
this.changeSubLoding(true, '提交中') this.changeSubLoding(true, '提交中')
break; break;
case TRANS_SUBMIT_SUCCESS: case TRANS_SUBMIT_SUCCESS:
// that.setState({
// isSubLoding: false,
// lodingTitle: '提交中'
// },() => {
// that.processReturnData()
// })
setTimeout(() => {
that.setState({ that.setState({
isSubLoding: false, isSubLoding: false,
lodingTitle: '提交中' lodingTitle: '提交中'
},() => { }, () => {
that.processReturnData() that.processReturnData()
}) })
}, 500)
break; break;
case TRANS_SUBMIT_FAILURE: case TRANS_SUBMIT_FAILURE:
this.changeSubLoding(false, '提交中') this.changeSubLoding(false, '提交中')
...@@ -474,7 +493,7 @@ class TransOrderPage extends Component { ...@@ -474,7 +493,7 @@ class TransOrderPage 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 < 5 ) {
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 == '客户名称') {
...@@ -491,16 +510,20 @@ class TransOrderPage extends Component { ...@@ -491,16 +510,20 @@ class TransOrderPage extends Component {
// 判断是否都有值,修改提交按钮的颜色 // 判断是否都有值,修改提交按钮的颜色
changeCanSub(isSubCheck) { changeCanSub(isSubCheck) {
let { listOptionData } = this.state let { listOptionData, bor_ware_required } = this.state
let tempStatus = false let tempStatus = false
let tempTit = '' let tempTit = ''
let maxIndex = 4
if(bor_ware_required === 'Y'){
maxIndex = 5
}
for(let chIndex in listOptionData) { for(let chIndex in listOptionData) {
if(chIndex > 0 && chIndex < 4 if(chIndex > 0 && chIndex < maxIndex
&& !listOptionData[chIndex].value) { && !listOptionData[chIndex].value) {
tempTit = `“${listOptionData[chIndex].title}”未选择` tempTit = `“${listOptionData[chIndex].title}”未选择`
tempStatus = true tempStatus = true
break break
} else if( chIndex == 6 } else if( chIndex == 7
&& !listOptionData[chIndex].subOption.length ){ && !listOptionData[chIndex].subOption.length ){
tempTit = `“${listOptionData[chIndex].title}”未添加` tempTit = `“${listOptionData[chIndex].title}”未添加`
tempStatus = true tempStatus = true
...@@ -533,6 +556,9 @@ class TransOrderPage extends Component { ...@@ -533,6 +556,9 @@ class TransOrderPage extends Component {
if(itemTitle === '客户名称') { if(itemTitle === '客户名称') {
that.clearInitNameAndValue(2) that.clearInitNameAndValue(2)
} }
if(itemTitle === '目标订单信息' && item.sub_options) {
listOptionData[4].sub_options = item.sub_options
}
} }
return chItem return chItem
}) })
...@@ -550,7 +576,7 @@ class TransOrderPage extends Component { ...@@ -550,7 +576,7 @@ class TransOrderPage extends Component {
// 修改当前选择器数据 // 修改当前选择器数据
changeCurrentOption() { changeCurrentOption() {
let { currentTitle } = this.state let { currentTitle, listOptionData } = this.state
let { transOrderOption } = this.props let { transOrderOption } = this.props
let tempOption = [] let tempOption = []
let that = this let that = this
...@@ -584,6 +610,7 @@ class TransOrderPage extends Component { ...@@ -584,6 +610,7 @@ class TransOrderPage extends Component {
let tempName = `${collect_number}-${surgery_name}-${create_time}` let tempName = `${collect_number}-${surgery_name}-${create_time}`
obj.name = tempName, obj.name = tempName,
obj.value = item.collect_number obj.value = item.collect_number
obj.sub_options = item.surgery_settings
resultArr.push(obj) resultArr.push(obj)
}) })
tempOption = [...resultArr] tempOption = [...resultArr]
...@@ -629,6 +656,43 @@ class TransOrderPage extends Component { ...@@ -629,6 +656,43 @@ class TransOrderPage extends Component {
props.requestTransOrganizations(params) props.requestTransOrganizations(params)
}) })
} }
async getOrganizationData() {
let { state, props } = this
let params = {
access_token: props.token
}
let that = this
let { global_domain_config } = props
let orgResult = await reqTransOrganizations(global_domain_config, params);
if (orgResult.error_code == 0) {
let { data: { organizations } } = orgResult
let { listOptionData } = state
// props.requestListDataSuccess(organizations)
let filterOpt = dedupQuoteArray(organizations, 'org_code')
if (filterOpt.length === 0) {
show(`当前${listOptionData[1].title}为空`)
return
}
if (filterOpt.length === 1) {
listOptionData[1].name = filterOpt[0].org_name
listOptionData[1].value = filterOpt[0].org_code
that.setState({
listOptionData
}, () => {
that.organizationGetCustomerData()
})
}
}else {
this.showWarnError(orgResult)
}
// else if (orgResult.error_code == 41006) {
// show('登录过期,请重新登录');
// props.exitLoginStatus();
// } else {
// let error_msg = orgResult.error_msg || orgResult.message
// show(error_msg);
// }
}
// 客户名称 点击 // 客户名称 点击
handleCustomerCheck() { handleCustomerCheck() {
...@@ -665,31 +729,32 @@ class TransOrderPage extends Component { ...@@ -665,31 +729,32 @@ class TransOrderPage extends Component {
let cusResult = await reqTransSurgeryHospital(global_domain_config, params); let cusResult = await reqTransSurgeryHospital(global_domain_config, params);
if(cusResult.error_code == 0) { if(cusResult.error_code == 0) {
let { data: { customers } } = cusResult let { data: { customers } } = cusResult
props.requestListDataSuccess(customers) let { listOptionData } = state
// props.requestListDataSuccess(customers)
let filterOpt = dedupQuoteArray(customers, 'customer_code') let filterOpt = dedupQuoteArray(customers, 'customer_code')
if(filterOpt.length === 0) { if(filterOpt.length === 0) {
show(`当前客户名称为空`) show(`当前${listOptionData[2].title}为空`)
return return
} }
if(filterOpt.length === 1) { if(filterOpt.length === 1) {
let { listOptionData } = state
listOptionData[2].name = filterOpt[0].customer_name listOptionData[2].name = filterOpt[0].customer_name
listOptionData[2].value = filterOpt[0].customer_code listOptionData[2].value = filterOpt[0].customer_code
that.setState({ that.setState({
listOptionData listOptionData
}, () => { }, () => {
// that.customerGetTargetOrder() that.customerGetTargetOrder()
}) })
} }
} else if(cusResult.error_code == 41006) { }else{
show('登录过期,请重新登录'); that.showWarnError(cusResult)
props.exitLoginStatus();
} else {
let error_msg = cusResult.error_msg || cusResult.message
show(error_msg);
} }
// else if(cusResult.error_code == 41006) {
// show('登录过期,请重新登录');
// props.exitLoginStatus();
// } else {
// let error_msg = cusResult.error_msg || cusResult.message
// show(error_msg);
// }
} }
// 目标订单信息 点击 // 目标订单信息 点击
...@@ -710,7 +775,8 @@ class TransOrderPage extends Component { ...@@ -710,7 +775,8 @@ class TransOrderPage extends Component {
org_code: state.listOptionData[1].value, org_code: state.listOptionData[1].value,
seller_code: props.userInfo.user_name, seller_code: props.userInfo.user_name,
customer_code: state.listOptionData[2].value, customer_code: state.listOptionData[2].value,
collect_header_status: 'COLLECTING_WAITING_CONFIRM,CONFIRM_COLLECT,COLLECTED_WAITING_CONFIRMED,APPROVED,COLLECTED' collect_header_status: 'COLLECTING_WAITING_CONFIRM,CONFIRM_COLLECT,COLLECTED_WAITING_CONFIRMED,APPROVED,COLLECTED',
setting_type: 'COLLECT'
} }
props.requestTransTargetOrderInfo(params) props.requestTransTargetOrderInfo(params)
}) })
...@@ -728,16 +794,17 @@ class TransOrderPage extends Component { ...@@ -728,16 +794,17 @@ class TransOrderPage extends Component {
} }
let that = this let that = this
let { global_domain_config } = props let { global_domain_config } = props
let cusResult = await reqTransTargetOrderInfo(global_domain_config, params); let cusResult = await requestSubSourBorOrdNum(global_domain_config, params);
console.log('获取目标订单信息 res=====', cusResult);
if(cusResult.error_code == 0) { if(cusResult.error_code == 0) {
let { data: { surgery_collect_headers } } = cusResult let { data: { surgery_collect_headers } } = cusResult
props.requestListDataSuccess(surgery_collect_headers) let { listOptionData } = state
// props.requestListDataSuccess(surgery_collect_headers)
if(surgery_collect_headers.length === 0) { if(surgery_collect_headers.length === 0) {
show(`当前目标订单信息为空`) show(`当前${listOptionData[3].title}为空`)
return return
} }
if(surgery_collect_headers.length === 1) { if(surgery_collect_headers.length === 1) {
let { listOptionData } = state
let collect_number = surgery_collect_headers[0].collect_number ? surgery_collect_headers[0].collect_number : '空' let collect_number = surgery_collect_headers[0].collect_number ? surgery_collect_headers[0].collect_number : '空'
let surgery_name = surgery_collect_headers[0].surgery_name ? surgery_collect_headers[0].surgery_name : '空' let surgery_name = surgery_collect_headers[0].surgery_name ? surgery_collect_headers[0].surgery_name : '空'
let create_time = surgery_collect_headers[0].create_time ? moment(surgery_collect_headers[0].create_time).format("YYYY-MM-DD") : '空' let create_time = surgery_collect_headers[0].create_time ? moment(surgery_collect_headers[0].create_time).format("YYYY-MM-DD") : '空'
...@@ -748,12 +815,39 @@ class TransOrderPage extends Component { ...@@ -748,12 +815,39 @@ class TransOrderPage extends Component {
listOptionData listOptionData
}) })
} }
} else if(cusResult.error_code == 41006) { }else {
show('登录过期,请重新登录'); that.showWarnError(cusResult)
props.exitLoginStatus(); }
} else { // else if(cusResult.error_code == 41006) {
let error_msg = cusResult.error_msg || cusResult.message // show('登录过期,请重新登录');
show(error_msg); // props.exitLoginStatus();
// } else {
// let error_msg = cusResult.error_msg || cusResult.message
// show(error_msg);
// }
}
// 目标仓库 点击
handleWareCheck(){
let { state, props } = this
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')
that.setState({
currentTitle: state.listOptionData[4].title,
currentItem: {
name: state.listOptionData[4].name,
value: state.listOptionData[4].value
},
listCurrentOption: [...filterOpt]
}, () => {
// 解决 IOS 弹窗显示问题
setTimeout(() => {
that.setState({
showTypePop: true
})
}, 500)
})
} }
} }
...@@ -775,7 +869,7 @@ class TransOrderPage extends Component { ...@@ -775,7 +869,7 @@ class TransOrderPage extends Component {
let { listOptionData } = this.state let { listOptionData } = this.state
this.setState({ this.setState({
listOptionData: listOptionData.map((item, index) => { listOptionData: listOptionData.map((item, index) => {
if(index == 6) { if(index == 7) {
item.isShowSub = false item.isShowSub = false
} }
return item return item
...@@ -789,7 +883,7 @@ class TransOrderPage extends Component { ...@@ -789,7 +883,7 @@ class TransOrderPage extends Component {
let { listOptionData } = this.state let { listOptionData } = this.state
this.setState({ this.setState({
listOptionData: listOptionData.map((item, index) => { listOptionData: listOptionData.map((item, index) => {
if(index == 6) { if(index == 7) {
item.isShowSub = true item.isShowSub = true
} }
return item return item
...@@ -808,7 +902,7 @@ class TransOrderPage extends Component { ...@@ -808,7 +902,7 @@ class TransOrderPage extends Component {
customer_code: listOptionData[2].value, customer_code: listOptionData[2].value,
collect_number: listOptionData[3].value collect_number: listOptionData[3].value
} }
if(!listOptionData[6].subOption.length) { if(!listOptionData[7].subOption.length) {
this.props.setTransDetailOption([], {}) this.props.setTransDetailOption([], {})
} }
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull() if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()
...@@ -904,19 +998,21 @@ class TransOrderPage extends Component { ...@@ -904,19 +998,21 @@ class TransOrderPage extends Component {
let {url} = imgResult.data let {url} = imgResult.data
localPhoOption.push(source); // 本地图片地址 localPhoOption.push(source); // 本地图片地址
listOptionData[7].uploadImgArr.push(url) // 服务器图片地址 listOptionData[8].uploadImgArr.push(url) // 服务器图片地址
that.setState({ that.setState({
localPhoOption, localPhoOption,
listOptionData listOptionData
}); });
} else if(imgResult.error_code == 41006) { } else if(imgResult.error_code == 41006) {
that.changeSubLoding(false) that.changeSubLoding(false)
show('登录过期,请重新登录'); that.showWarnError(imgResult)
props.exitLoginStatus(); // show('登录过期,请重新登录');
// props.exitLoginStatus();
} else { } else {
that.changeSubLoding(false) that.changeSubLoding(false)
let error_msg = imgResult.error_msg || imgResult.message that.showWarnError(imgResult)
show(error_msg); // let error_msg = imgResult.error_msg || imgResult.message
// show(error_msg);
} }
} }
}) })
...@@ -927,7 +1023,7 @@ class TransOrderPage extends Component { ...@@ -927,7 +1023,7 @@ class TransOrderPage extends Component {
handleDelPickCheck(item, index) { handleDelPickCheck(item, index) {
let {listOptionData, localPhoOption} = this.state let {listOptionData, localPhoOption} = this.state
localPhoOption.splice(index, 1) // 删除本地地址 localPhoOption.splice(index, 1) // 删除本地地址
listOptionData[7].uploadImgArr.splice(index, 1) // 删除服务器地址 listOptionData[8].uploadImgArr.splice(index, 1) // 删除服务器地址
this.setState({ this.setState({
listOptionData, listOptionData,
localPhoOption localPhoOption
...@@ -958,7 +1054,7 @@ class TransOrderPage extends Component { ...@@ -958,7 +1054,7 @@ class TransOrderPage extends Component {
// 提交订单 // 提交订单
that.setState({ that.setState({
listOptionData: state.listOptionData.map((item, index) => { listOptionData: state.listOptionData.map((item, index) => {
if(index == 5) { if(index == 6) {
item.value = audioResult.data.url item.value = audioResult.data.url
} }
return item return item
...@@ -970,12 +1066,14 @@ class TransOrderPage extends Component { ...@@ -970,12 +1066,14 @@ class TransOrderPage extends Component {
} else if(audioResult.error_code == 41006) { } else if(audioResult.error_code == 41006) {
that.changeSubLoding(false) that.changeSubLoding(false)
show('登录过期,请重新登录'); that.showWarnError(audioResult)
props.exitLoginStatus(); // show('登录过期,请重新登录');
// props.exitLoginStatus();
} else { } else {
that.changeSubLoding(false) that.changeSubLoding(false)
let error_msg = audioResult.error_msg || audioResult.message that.showWarnError(audioResult)
show(error_msg); // let error_msg = audioResult.error_msg || audioResult.message
// show(error_msg);
} }
} else { } else {
that.submitTransOrder() that.submitTransOrder()
...@@ -991,10 +1089,11 @@ class TransOrderPage extends Component { ...@@ -991,10 +1089,11 @@ class TransOrderPage extends Component {
let tempSubOption = state.submitOption let tempSubOption = state.submitOption
tempSubOption.org_code = state.listOptionData[1].value tempSubOption.org_code = state.listOptionData[1].value
tempSubOption.collect_number = state.listOptionData[3].value tempSubOption.collect_number = state.listOptionData[3].value
tempSubOption.remark = state.listOptionData[4].value tempSubOption.destination_inv_code = state.listOptionData[4].value
tempSubOption.voice_url = state.listOptionData[5].value tempSubOption.remark = state.listOptionData[5].value
tempSubOption.sur_order_transfer_line = state.listOptionData[6].subOption tempSubOption.voice_url = state.listOptionData[6].value
tempSubOption.img_url = state.listOptionData[7].uploadImgArr.join(',') tempSubOption.sur_order_transfer_line = state.listOptionData[7].subOption
tempSubOption.img_url = state.listOptionData[8].uploadImgArr.join(',')
let params = { let params = {
access_token: props.token, access_token: props.token,
data: { ...tempSubOption } data: { ...tempSubOption }
...@@ -1069,10 +1168,36 @@ class TransOrderPage extends Component { ...@@ -1069,10 +1168,36 @@ class TransOrderPage extends Component {
currShowImgIndex: index || 0 currShowImgIndex: index || 0
}) })
} }
// 获取配置值
async getSysConfigValue() {
let { global_domain_config, token } = this.props
const params = {
access_token: token,
profile_code: 'OBS_MOBILE_BOR_WARE_REQUIRED'
}
let sysRes = await requestSysProfile(global_domain_config, params)
console.log('sysRes:==', sysRes)
if(sysRes.error_code === 0){
this.setState({
bor_ware_required: sysRes.data.profile_value
})
}else {
this.showWarnError(sysRes)
}
}
showWarnError(res){
if(res.error_code == 41006) {
show('登录过期,请重新登录');
this.props.exitLoginStatus();
} else {
let error_msg = res.error_msg || res.message
show(error_msg);
}
}
// 返回备注以上的元素 // 返回备注以上的元素
renderListItem() { renderListItem() {
let { listOptionData } = 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}> <View style={styles.item_container}>
...@@ -1125,6 +1250,19 @@ class TransOrderPage extends Component { ...@@ -1125,6 +1250,19 @@ class TransOrderPage extends Component {
</CellTextStyle> </CellTextStyle>
</TouchableOpacity> </TouchableOpacity>
</View> </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() }
...@@ -1182,7 +1320,7 @@ class TransOrderPage extends Component { ...@@ -1182,7 +1320,7 @@ class TransOrderPage extends Component {
style={list_common_item.rema_Input} style={list_common_item.rema_Input}
maxLength={140} maxLength={140}
onChangeText={(text) => this.handleRemarkInput(text)} onChangeText={(text) => this.handleRemarkInput(text)}
defaultValue={state.listOptionData[4].value} defaultValue={state.listOptionData[5].value}
/> />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
...@@ -1247,17 +1385,17 @@ class TransOrderPage extends Component { ...@@ -1247,17 +1385,17 @@ class TransOrderPage 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[6].subOption.length ? state.listOptionData[7].subOption.length ?
<View <View
// activeOpacity={1} // activeOpacity={1}
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}>
<Text style={list_common_item.detail_tit_text}> <Text style={list_common_item.detail_tit_text}>
耗材({state.listOptionData[6].subOption.length} 耗材({state.listOptionData[7].subOption.length}
</Text> </Text>
{ {
state.listOptionData[6].isShowSub ? state.listOptionData[7].isShowSub ?
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
style={list_common_item.detail_icon} style={list_common_item.detail_icon}
...@@ -1276,7 +1414,7 @@ class TransOrderPage extends Component { ...@@ -1276,7 +1414,7 @@ class TransOrderPage extends Component {
</View> </View>
{ {
state.listOptionData[6].isShowSub ? state.listOptionData[7].isShowSub ?
<View style={list_common_item.detail_sub_inner}> <View style={list_common_item.detail_sub_inner}>
<ScrollView <ScrollView
style={list_common_item.detail_scroll} style={list_common_item.detail_scroll}
...@@ -1285,7 +1423,7 @@ class TransOrderPage extends Component { ...@@ -1285,7 +1423,7 @@ class TransOrderPage extends Component {
// showsVerticalScrollIndicator={false} // showsVerticalScrollIndicator={false}
> >
{ {
state.listOptionData[6].subOption.map((item, index) => { state.listOptionData[7].subOption.map((item, index) => {
return this.renderConDeSubItem(item, index) return this.renderConDeSubItem(item, index)
}) })
} }
...@@ -1301,7 +1439,7 @@ class TransOrderPage extends Component { ...@@ -1301,7 +1439,7 @@ class TransOrderPage extends Component {
style={list_common_item.detail_btn_box} style={list_common_item.detail_btn_box}
onPress = {() => this.handleConsumDetailCheck()} onPress = {() => this.handleConsumDetailCheck()}
> >
<Text style={list_common_item.detail_btn}>{state.listOptionData[6].btnTit}</Text> <Text style={list_common_item.detail_btn}>{state.listOptionData[7].btnTit}</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
...@@ -1391,7 +1529,7 @@ class TransOrderPage extends Component { ...@@ -1391,7 +1529,7 @@ class TransOrderPage extends Component {
// }] // }]
// 正式 // 正式
let zoomImages = [] let zoomImages = []
listOptionData[7].uploadImgArr.forEach(item => { listOptionData[8].uploadImgArr.forEach(item => {
zoomImages.push({ zoomImages.push({
url: `${global_domain_config}/${item}` url: `${global_domain_config}/${item}`
}) })
......
...@@ -158,11 +158,11 @@ class TransSearchPage extends Component { ...@@ -158,11 +158,11 @@ class TransSearchPage extends Component {
// 选择器弹窗回调函数 // 选择器弹窗回调函数
handleCallBack(item, itemTitle) { handleCallBack(item, itemTitle) {
let { listOptionData} = this.state let { listOptionData} = this.state
let self = this let that = this
self.setState({ that.setState({
currentItem: item, currentItem: item,
}) })
self.setState({ that.setState({
listOptionData: listOptionData.map((chItem) => { listOptionData: listOptionData.map((chItem) => {
if(chItem.title === itemTitle) { if(chItem.title === itemTitle) {
chItem.name = item.name chItem.name = item.name
...@@ -232,11 +232,13 @@ class TransSearchPage extends Component { ...@@ -232,11 +232,13 @@ class TransSearchPage extends Component {
access_token: props.token, access_token: props.token,
org_code: subTransObj.org_code, org_code: subTransObj.org_code,
seller_code: props.userInfo.user_name, seller_code: props.userInfo.user_name,
collect_header_status: 'COLLECTING_WAITING_CONFIRM,CONFIRM_COLLECT,COLLECTED_WAITING_CONFIRMED,APPROVED,COLLECTED' collect_header_status: 'COLLECTING_WAITING_CONFIRM,CONFIRM_COLLECT,COLLECTED_WAITING_CONFIRMED,APPROVED,COLLECTED',
setting_type: 'COLLECT'
} }
let { global_domain_config } = that.props let { global_domain_config } = that.props
that.changeLodingFlag(true) that.changeLodingFlag(true)
let sourResult = await requestSubSourBorOrdNum(global_domain_config, params) let sourResult = await requestSubSourBorOrdNum(global_domain_config, params)
console.log('来源借货订单号 res=====', sourResult);
if(sourResult.error_code === 0) { if(sourResult.error_code === 0) {
that.changeLodingFlag(false) that.changeLodingFlag(false)
let { data: { surgery_collect_headers } } = sourResult let { data: { surgery_collect_headers } } = sourResult
...@@ -389,7 +391,7 @@ class TransSearchPage extends Component { ...@@ -389,7 +391,7 @@ class TransSearchPage extends Component {
if(detailResult.error_code === 0) { if(detailResult.error_code === 0) {
let { data: { sur_transfer_lines }} = detailResult let { data: { sur_transfer_lines }} = detailResult
if(sur_transfer_lines.length == 0) { if(sur_transfer_lines.length == 0) {
show('当前明细为空!') show('当前订单无明细数据,请重新选择订单!')
} else { } else {
let {subTransDetOption} = this.props // 【转单】主页面已存在的明细 let {subTransDetOption} = this.props // 【转单】主页面已存在的明细
subTransDetOption.length && subTransDetOption.forEach((item) => { subTransDetOption.length && subTransDetOption.forEach((item) => {
......
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