Commit a8938b2c by wong.peiyi

[调整] 多仓借还显隐调整

parent 1b5dbc4a
......@@ -71,7 +71,7 @@ import PageListArrow from '../common/listDataComponent/PageListArrow';
class EquipConsuPage extends Component {
constructor(props) {
super(props);
this.state = {
this.state = {
canSubFlag: false, // 生成订单按钮样式改变
listOptionData: [ // 页面元素
{
......@@ -86,7 +86,7 @@ class EquipConsuPage extends Component {
name: '请选择',
value: ''
},
{
{
"id": "2",
title: '客户名称',
name: '请选择',
......@@ -215,7 +215,7 @@ class EquipConsuPage extends Component {
// ],
showNotEnogPop: false, // 库存不足弹窗
not_enough_items_list:[], // 库存不足数据
bor_ware_required: '', // APP借货仓库必填权限
bor_ware_required: 0, // APP借货仓库必填权限
}
}
......@@ -279,7 +279,7 @@ class EquipConsuPage extends Component {
// data 录音数据
console.log(this.state.currentTime)
};
})
})
}
/**
......@@ -303,7 +303,7 @@ class EquipConsuPage extends Component {
}
AudioRecorder.prepareRecordingAtPath(path,option)
}
// 开始录音
_record = async () => {
console.log('-----this.state.hasPermission---', this.state.hasPermission)
......@@ -330,7 +330,7 @@ class EquipConsuPage extends Component {
// }, {
// text: '取消',
// }])
// }
// }
// console.log('this.state.hasPermission---!!----', this.state.hasPermission)
// this.setState({hasPermission: isAuthor})
// this.prepareRecordingPath(this.state.audioPath);
......@@ -356,7 +356,7 @@ class EquipConsuPage extends Component {
// } catch (err) {
// console.log('start record-!!-error->',err)
// }
// })
// })
// } else {
// console.log('---否则---')
// show('录音开始')
......@@ -402,14 +402,14 @@ class EquipConsuPage extends Component {
console.error(err)
}
}
// 停止录音
_stop = async () => {
console.log('----stop---', this.state.hasPermission)
if(!this.state.hasPermission) {
return
// return alert('没有授权')
}
}
show('录音结束')
try {
await AudioRecorder.stopRecording();
......@@ -418,7 +418,7 @@ class EquipConsuPage extends Component {
console.log('stop record--error->', error);
}
}
// 播放录音
_play = async () => {
let that = this
......@@ -471,7 +471,7 @@ class EquipConsuPage extends Component {
case QUICK_ORDER_LIST_FAILURE:
this.changeSubLoding(false)
break;
default:
default:
break;
}
}
......@@ -480,7 +480,7 @@ class EquipConsuPage extends Component {
case LOGIN_NO:
navigation.navigate('LoginPage')
break;
default:
default:
break;
}
}
......@@ -508,7 +508,7 @@ class EquipConsuPage extends Component {
case QUICK_SUBMIT_FAILURE:
this.changeSubLoding(false, '提交中')
break;
default:
default:
break;
}
}
......@@ -559,11 +559,11 @@ class EquipConsuPage extends Component {
let tempStatus = false
let tempTit = ''
let maxIndex = 10
if(bor_ware_required === 'Y'){
if(bor_ware_required === 3){
maxIndex = 11
}
for(let chIndex in listOptionData) {
if(chIndex > 0 && chIndex < maxIndex
if(chIndex > 0 && chIndex < maxIndex
&& chIndex != 6 && chIndex != 8
&& !listOptionData[chIndex].value
&& listOptionData[chIndex].name !== '其他') {
......@@ -685,7 +685,7 @@ class EquipConsuPage extends Component {
} else if (currentTitle === '借货仓库') {
let filterOpt = dedupQuoteArray(quickOrderOption, 'source_inv_code')
tempOption = this.changeNameAndValue(filterOpt, 'source_inv_name', 'source_inv_code')
}
}
this.setState({
listCurrentOption: [...tempOption]
}, () => {
......@@ -775,7 +775,7 @@ class EquipConsuPage extends Component {
}, () => {
// 在此修改接口
that.getCustomerData()
})
})
}
}
// 获取客户名称
......@@ -1080,7 +1080,7 @@ class EquipConsuPage extends Component {
this.setState({
listOptionData: listOptionData
})
}
}
this.closeDateModal(true)
}
// 关闭日期选择器
......@@ -1102,7 +1102,7 @@ class EquipConsuPage extends Component {
return item
})
})
}
}
// 订单类型 点击
handleOrderCheck(curData) {
let { props } = this
......@@ -1120,7 +1120,7 @@ class EquipConsuPage extends Component {
value_set_code:'SUR_ORDER_TYPE'
}
props.requestQuickOrderType(params)
})
})
}
}
// 借货仓库 点击
......@@ -1144,7 +1144,7 @@ class EquipConsuPage extends Component {
process_code: 'COLLECT'
}
props.requestQuickSurColSetting(params)
})
})
}
}
// 备注 输入
......@@ -1163,7 +1163,7 @@ class EquipConsuPage extends Component {
async handleSubmit() {
this.changeCanSub(true)
let { state, props } = this
let that = this
let that = this
// 可提交 并且 不处于正在提交中
if(state.canSubFlag && !state.isSubLoding) {
// 先提交录音,再提交接口
......@@ -1277,9 +1277,9 @@ class EquipConsuPage extends Component {
this.clearAllData()
let { state: { params: { title } } } = this.props.navigation
this.props.navigation.navigate('SubSuccPage', {
title: `${title} - 下单成功`,
title: `${title} - 下单成功`,
orderNumber: quickOrderOption.survey_collect_number
})
})
}
}
}
......@@ -1306,7 +1306,7 @@ class EquipConsuPage extends Component {
}
}, () => {
that.handleSubmit()
})
})
}
// 库存不足弹窗关闭
handleNotEnoughCloseModal(show) {
......@@ -1325,10 +1325,10 @@ class EquipConsuPage extends Component {
console.log('sysRes:==', sysRes)
if(sysRes.error_code === 0){
this.setState({
bor_ware_required: sysRes.data.profile_value
bor_ware_required: Number(sysRes.data.profile_value) || 0
})
}else {
this.showWarnError(sysRes)
// }else {
// this.showWarnError(sysRes)
}
}
showWarnError(res){
......@@ -1437,16 +1437,20 @@ class EquipConsuPage extends Component {
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}
/>
{
bor_ware_required > 1 ?
<PageListArrow
listActOpa={.8}
listHasAster={bor_ware_required === 3}
listItem={listOptionData[10]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleWareCheck(listOptionData[10])}
listHasArrow={true}
/>
: <Text></Text>
}
<DateModel
date={listOptionData[8].dateValue}
closeModal={(show) => this.closeDateModal(show)}
......@@ -1468,7 +1472,7 @@ class EquipConsuPage extends Component {
}
// 返回选择器弹窗
renderPickerModel() {
let {
let {
listCurrentOption,
currentItem,
currentTitle,
......@@ -1502,7 +1506,7 @@ class EquipConsuPage extends Component {
underlineColorAndroid = {'transparent'}
multiline = {true}
ref = {textInput => this.TextInput = textInput}
numberOfLines = {8}
numberOfLines = {8}
style={list_common_item.rema_Input}
maxLength={140}
onChangeText={(text) => this.handleRemarkInput(text)}
......@@ -1523,7 +1527,7 @@ class EquipConsuPage extends Component {
<View style={list_common_item.reco_btn_cont}>
{ !stop ? <Text style={list_common_item.reco_btn_tit}>还有什么要安排的,可录音备注哟!</Text> : null }
{
!stop ?
!stop ?
<View style={list_common_item.reco_btn_inner}>
<TouchableOpacity
activeOpacity = {.8}
......@@ -1536,7 +1540,7 @@ class EquipConsuPage extends Component {
</View>
<Text style={list_common_item.reco_btn_text}>长按录音</Text>
</TouchableOpacity>
</View>
: <View style={list_common_item.reco_play_box}>
<View style={list_common_item.play_btn}>
......@@ -1556,7 +1560,7 @@ class EquipConsuPage extends Component {
</TouchableOpacity>
</View>
</View>
}
}
</View>
</CellTextStyle>
)
......@@ -1571,14 +1575,14 @@ class EquipConsuPage extends Component {
}
// 返回库存不足弹窗
renderNotEnoughModel() {
let {
renderNotEnoughModel() {
let {
not_enough_items_list,
showNotEnogPop
} = this.state
return (
<SafeAreaView style={styles.item_container}>
<NotEnoughModel
<NotEnoughModel
not_enough_items_list={not_enough_items_list}
callback={() => this.handleNotEnoughCallBack()}
show={showNotEnogPop}
......@@ -1588,11 +1592,11 @@ class EquipConsuPage extends Component {
)
}
render() {
render() {
let {canSubFlag} = this.state
let {navigation} = this.props
let {title} = navigation.state.params
return (
return (
<View style={styles.quick_container}>
<StatusBarView
isReactStackNavigator={true}
......@@ -1615,9 +1619,9 @@ class EquipConsuPage extends Component {
textStyle= {styles.sub_btn}
onPress={() => this.handleSubmit()}
/>
</ScrollView>
</ScrollView>
{ this.renderLodingItem() }
{ this.renderNotEnoughModel() }
{ this.renderNotEnoughModel() }
</SafeAreaView>
</View>
);
......@@ -1634,9 +1638,9 @@ const styles = StyleSheet.create({
},
list_cont: {
flex: 1
},
},
item_container: {
flex: 1
flex: 1
},
sub_btn_pro: {
backgroundColor: promary_color
......@@ -1696,5 +1700,5 @@ const mapDispatchToProps = (dispatch) => {
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(EquipConsuPage);
\ No newline at end of file
export default connect(mapStateToProps, mapDispatchToProps)(EquipConsuPage);
......@@ -70,7 +70,7 @@ import PageListArrow from '../common/listDataComponent/PageListArrow';
class TransOrderPage extends Component {
constructor(props) {
super(props);
this.state = {
this.state = {
canSubFlag: false, // 生成订单按钮样式改变
listOptionData: [ // 备注以上的元素
{
......@@ -85,7 +85,7 @@ class TransOrderPage extends Component {
name: '请选择',
value: ''
},
{
{
"id": "2",
title: '客户名称',
name: '请选择',
......@@ -141,7 +141,7 @@ class TransOrderPage extends Component {
voice_url: '', // 录音地址
sur_order_transfer_line: '',
img_url: '' // 图片地址
// seller_code: '', // 用户名username
// org_code: '', // 组织
// customer_code: '', // 客户名称
......@@ -172,7 +172,7 @@ class TransOrderPage extends Component {
],
isShowImage: false,
currShowImgIndex: 0,
bor_ware_required: '', // APP目标仓库必填权限
bor_ware_required: 0, // APP目标仓库显示及必填权限
}
}
......@@ -237,7 +237,7 @@ class TransOrderPage extends Component {
// data 录音数据
console.log(this.state.currentTime)
};
})
})
}
/**
......@@ -261,7 +261,7 @@ class TransOrderPage extends Component {
}
AudioRecorder.prepareRecordingAtPath(path,option)
}
// 开始录音
_record = async () => {
// 【有问题】
......@@ -287,7 +287,7 @@ class TransOrderPage extends Component {
// }, {
// text: '取消',
// }])
// }
// }
// console.log('this.state.hasPermission---!!----', this.state.hasPermission)
// this.setState({hasPermission: isAuthor})
// this.prepareRecordingPath(this.state.audioPath);
......@@ -313,7 +313,7 @@ class TransOrderPage extends Component {
// } catch (err) {
// console.log('start record-!!-error->',err)
// }
// })
// })
// } else {
// console.log('---否则---')
// show('录音开始')
......@@ -359,13 +359,13 @@ class TransOrderPage extends Component {
console.error(err)
}
}
// 停止录音
_stop = async () => {
if(!this.state.hasPermission) {
return
// return alert('没有授权')
}
}
show('录音结束')
try {
await AudioRecorder.stopRecording();
......@@ -374,7 +374,7 @@ class TransOrderPage extends Component {
console.log('stop record--error->', error);
}
}
// 播放录音
_play = async () => {
let that = this
......@@ -428,7 +428,7 @@ class TransOrderPage extends Component {
case TRANS_ORDER_LIST_FAILURE:
this.changeSubLoding(false)
break;
default:
default:
break;
}
}
......@@ -437,7 +437,7 @@ class TransOrderPage extends Component {
case LOGIN_NO:
navigation.navigate('LoginPage')
break;
default:
default:
break;
}
}
......@@ -474,7 +474,7 @@ class TransOrderPage extends Component {
case TRANS_SUBMIT_FAILURE:
this.changeSubLoding(false, '提交中')
break;
default:
default:
break;
}
}
......@@ -515,7 +515,7 @@ class TransOrderPage extends Component {
let tempStatus = false
let tempTit = ''
let maxIndex = 4
if(bor_ware_required === 'Y'){
if(bor_ware_required === 3){
maxIndex = 5
}
for(let chIndex in listOptionData) {
......@@ -714,7 +714,7 @@ class TransOrderPage extends Component {
seller_code: props.userInfo.user_name
}
props.requestTransSurgeryHospital(params)
})
})
}
}
// 组织选择后,判断当前客户名称是否只有一个
......@@ -733,7 +733,7 @@ class TransOrderPage extends Component {
let { listOptionData } = state
// props.requestListDataSuccess(customers)
let filterOpt = dedupQuoteArray(customers, 'customer_code')
if(filterOpt.length === 0) {
if(filterOpt.length === 0) {
show(`当前${listOptionData[2].title}为空`)
return
}
......@@ -780,7 +780,7 @@ class TransOrderPage extends Component {
setting_type: 'COLLECT'
}
props.requestTransTargetOrderInfo(params)
})
})
}
}
// 客户名称选择后,判断目标订单信息是否只有一条数据
......@@ -851,7 +851,7 @@ class TransOrderPage extends Component {
showTypePop: true
})
}, 500)
})
})
}
}
......@@ -909,7 +909,7 @@ class TransOrderPage extends Component {
if(!listOptionData[7].subOption.length) {
this.props.setTransDetailOption([], {})
}
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()
&& this.judgeOrderInfoIsNull()) {
this.props.navigation.navigate('TransSearchPage', {
title: '耗材明细 - 转单查询',
......@@ -1003,7 +1003,7 @@ class TransOrderPage extends Component {
localPhoOption.push(source); // 本地图片地址
listOptionData[8].uploadImgArr.push(url) // 服务器图片地址
that.setState({
that.setState({
localPhoOption,
listOptionData
});
......@@ -1140,7 +1140,7 @@ class TransOrderPage extends Component {
this.clearAllData() // 清空数据
let { state: { params: { title } } } = this.props.navigation
this.props.navigation.navigate('SubSuccPage', {
title: `${title} - 下单成功`,
title: `${title} - 下单成功`,
orderNumber: transOrderOption.data.sur_order_transfer_number // 订单号
})
}
......@@ -1183,10 +1183,10 @@ class TransOrderPage extends Component {
console.log('sysRes:==', sysRes)
if(sysRes.error_code === 0){
this.setState({
bor_ware_required: sysRes.data.profile_value
bor_ware_required: Number(sysRes.data.profile_value) || 0
})
}else {
this.showWarnError(sysRes)
// }else {
// this.showWarnError(sysRes)
}
}
showWarnError(res){
......@@ -1240,15 +1240,18 @@ class TransOrderPage extends Component {
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}
/>
{
bor_ware_required > 1 &&
<PageListArrow
listActOpa={.8}
listHasAster={bor_ware_required === 3}
listItem={listOptionData[4]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleWareCheck(listOptionData[4])}
listHasArrow={true}
/>
}
{ this.renderPickerModel() }
......@@ -1267,7 +1270,7 @@ class TransOrderPage extends Component {
// 返回选择器弹窗
renderPickerModel() {
let {
let {
listCurrentOption,
currentItem,
currentTitle,
......@@ -1302,7 +1305,7 @@ class TransOrderPage extends Component {
underlineColorAndroid = {'transparent'}
multiline = {true}
ref = {textInput => this.TextInput = textInput}
numberOfLines = {8}
numberOfLines = {8}
style={list_common_item.rema_Input}
maxLength={140}
onChangeText={(text) => this.handleRemarkInput(text)}
......@@ -1323,7 +1326,7 @@ class TransOrderPage extends Component {
<View style={list_common_item.reco_btn_cont}>
{ !stop ? <Text style={list_common_item.reco_btn_tit}>还有什么要安排的,可录音备注哟!</Text> : null }
{
!stop ?
!stop ?
<View style={list_common_item.reco_btn_inner}>
<TouchableOpacity
activeOpacity = {.8}
......@@ -1357,7 +1360,7 @@ class TransOrderPage extends Component {
</View>
}
</View>
</CellTextStyle>
)
......@@ -1371,7 +1374,7 @@ class TransOrderPage extends Component {
<View style={list_common_item.detail_inner}>
<Text style={list_common_item.detail_tit}>耗材明细</Text>
{
state.listOptionData[7].subOption.length ?
state.listOptionData[7].subOption.length ?
<View
// activeOpacity={1}
style={list_common_item.detail_sub_cont}>
......@@ -1388,7 +1391,7 @@ class TransOrderPage extends Component {
onPress={() => this.handleDetailBtmCheck()}
>
<Image style={[icon_style, list_common_item.detail_top_icon]} source={require('../../images/arr_btm.png')} />
</TouchableOpacity> :
</TouchableOpacity> :
<TouchableOpacity
activeOpacity={.8}
style={[list_common_item.detail_icon, list_common_item.detail_icon_rig]}
......@@ -1397,7 +1400,7 @@ class TransOrderPage extends Component {
<Image style={[icon_style, list_common_item.detail_top_icon]} source={require('../../images/arr_rig.png')} />
</TouchableOpacity>
}
</View>
{
state.listOptionData[7].isShowSub ?
......@@ -1418,7 +1421,7 @@ class TransOrderPage extends Component {
}
</View> : null
}
<View style={list_common_item.detail_footer}>
<TouchableOpacity
activeOpacity={.8}
......@@ -1470,12 +1473,12 @@ class TransOrderPage extends Component {
>
<Image style={icon_style} source={require('../../images/add_icon_large.png')} />
</TouchableOpacity>
</View>
</View>
</View>
</CellTextStyle>
)
}
// 返回增加的图片
renderPicItem(item, index) {
return (
......@@ -1501,7 +1504,7 @@ class TransOrderPage extends Component {
// 加载放大图片弹窗
renderZoomPicture() {
let { isShowImage, currShowImgIndex, listOptionData } = this.state
let { global_domain_config } = this.props
let { global_domain_config } = this.props
// // 测试
// let zoomImages = [{
// url: 'https://obs.uat.sfrx.guke.tech/upload/dingding/image/QDw05sTo.jpg',
......@@ -1512,14 +1515,14 @@ class TransOrderPage extends Component {
// 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[8].uploadImgArr.forEach(item => {
zoomImages.push({
url: `${global_domain_config}/${item}`
})
})
})
return (
<ZoomPictureModel
isShowImage={isShowImage}
......@@ -1539,11 +1542,11 @@ class TransOrderPage extends Component {
)
}
render() {
render() {
let { canSubFlag } = this.state
let { navigation } = this.props
let { title } = navigation.state.params
return (
return (
<View style={styles.trans_container}>
<StatusBarView
isReactStackNavigator={true}
......@@ -1555,7 +1558,7 @@ class TransOrderPage extends Component {
<ScrollView
style={styles.trans_main}
showsVerticalScrollIndicator={false}
>
>
{this.renderListItem()}
{this.renderRemarksItem()}
{this.renderRecordingItem()}
......@@ -1587,9 +1590,9 @@ const styles = StyleSheet.create({
},
list_cont: {
flex: 1
},
},
item_container: {
flex: 1
flex: 1
},
sub_btn_pro: {
backgroundColor: promary_color
......@@ -1644,5 +1647,5 @@ const mapDispatchToProps = (dispatch) => {
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(TransOrderPage);
\ No newline at end of file
export default connect(mapStateToProps, mapDispatchToProps)(TransOrderPage);
This diff could not be displayed because it is too large.
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