Commit 6f3aef4b by Denglingling

1、添加顶部【返回】回调函数;2、修改【接口】报错,调用对应失败函数;3、解决【IOS】弹窗显示问题;

parent 9c1acb66
......@@ -18,7 +18,7 @@ import FillUnitPricePage from './containers/equipConsu/module/FillUnitPricePage'
import QuickOrderPage from './containers/quickOrder/QuickOrderPage';
import TransOrderPage from './containers/transOrder/TransOrderPage';
import TransSearchPage from './containers/transOrder/module/TransSearchPage';
import HistoricalOrderPage from './containers/historicalOrder/HistoricalOrderPage';
// import HistoricalOrderPage from './containers/historicalOrder/HistoricalOrderPage';
import LineOrderPage from './containers/historicalOrder/module/LineOrderPage';
import SubSuccPage from './containers/common/SubSuccPage';
......@@ -35,7 +35,7 @@ const Router = createAppContainer(createStackNavigator({
QuickOrderPage: {screen: QuickOrderPage},
TransOrderPage: {screen: TransOrderPage},
TransSearchPage: {screen: TransSearchPage},
HistoricalOrderPage: {screen: HistoricalOrderPage},
// HistoricalOrderPage: {screen: HistoricalOrderPage},
LineOrderPage: {screen: LineOrderPage},
SubSuccPage: {screen: SubSuccPage}
}, {
......
......@@ -16,12 +16,10 @@ import {
// 获取组织 params={access_token:''}
export function requestEquipOrganizations(params) {
return (dispatch, getState) => {
console.log('----requestEquipOrganizations====================')
dispatch(requestListDataing());
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/authorized_inventory/search', params))
.then(res => {
console.log('res=====', Object.keys(res), res);
if(res.error_code == 0) {
let { data: { organizations } } = res
dispatch(requestListDataSuccess(organizations));
......@@ -37,6 +35,7 @@ export function requestEquipOrganizations(params) {
.catch(err => {
console.log('------err--====requestEquipOrganizations----', Object.keys(err), err)
show(err.error);
dispatch(requestListDataFail());
})
}
}
......@@ -44,12 +43,10 @@ export function requestEquipOrganizations(params) {
// 获取手术医院 params={access_token:'', org_code:'', seller_code:''}
export function requestEquipSurgeryHospital(params) {
return (dispatch, getState) => {
console.log('----requestEquipSurgeryHospital====================', params)
dispatch(requestListDataing());
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/sale/seller_customer/search', params))
.then(res => {
console.log('res===!!==', Object.keys(res));
if(res.error_code == 0) {
let { data: { customers } } = res
dispatch(requestListDataSuccess(customers));
......@@ -65,20 +62,18 @@ export function requestEquipSurgeryHospital(params) {
.catch(err => {
console.log('------err--====requestEquipSurgeryHospital----', Object.keys(err), err)
show(err.error);
dispatch(requestListDataFail());
})
}
}
// api/latest/surgery/collect_order/search?access_token=${access_token}&org_code=A02&seller_code=shi.ming&customer_code=CU00000017&collect_header_status=RETURNED,COLLECTED
// 获取订单信息 params={access_token:'', org_code:'', seller_code:'', customer_code:'', collect_header_status: ''}
// 获取订单信息 params={access_token:'', org_code:'', seller_code:'', customer_code:'', collect_header_status: 'RETURNED,COLLECTED'}
export function requestEquipOrderInfo(params) {
return (dispatch, getState) => {
console.log('----requestEquipOrderInfo====================', params)
dispatch(requestListDataing());
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/surgery/collect_order/search', params))
.then(res => {
console.log('res===!!==', Object.keys(res));
if(res.error_code == 0) {
let { data: { surgery_collect_headers } } = res
dispatch(requestListDataSuccess(surgery_collect_headers));
......@@ -94,6 +89,7 @@ export function requestEquipOrderInfo(params) {
.catch(err => {
console.log('------err--====requestEquipOrderInfo----', Object.keys(err), err)
show(err.error);
dispatch(requestListDataFail());
})
}
}
......@@ -127,28 +123,23 @@ export function getSubdetailOption(data) {
// 获取消耗明细 params={access_token:'', surgery_collect_number:''}
export const requestEquipDetails = async (global_domain_config, params) => {
console.log('----requestEquipDetails----', params)
return await GetRequest(global_domain_config, getUrlParams('/surgery/collected_order_line/search', params))
}
// 图片上传
export const uploadEquipImg = async (global_domain_config, params) => {
let { access_token, formData } = params
console.log('--------', access_token, formData)
return await UploadRequest(global_domain_config, getUrlParams('/dingding/upload_media', { access_token }), formData)
}
// 提交数据
export function requestEquipSumbit({access_token, ...params}) {
return (dispatch, getState) => {
console.warn('----requestEquipSumbit====================', access_token, params)
dispatch(requestSubmiting());
let {global_domain_config} = getState().login
PostRequest(global_domain_config, getUrlParams('/surgery/consume_order/create', {access_token: access_token}), params)
.then(res => {
console.warn('res=====', Object.keys(res), res);
if(res.error_code == 0) {
console.warn('res====requestEquipSumbit==========', res);
dispatch(requestSubmitSuccess(res));
} else if(res.error_code === 41006) {
show('登录过期,请重新登录');
......@@ -162,6 +153,7 @@ export function requestEquipSumbit({access_token, ...params}) {
.catch(err => {
console.log('------err--====requestEquipSumbit----', Object.keys(err), err)
show(err.error);
dispatch(requestSubmitFail());
})
}
}
......
......@@ -9,43 +9,29 @@ import { exitLoginStatus } from './LoginAction';
// 历史订单-获取组织 params={access_token:''}
export const requestHistorOrganizations = async (global_domain_config, params) => {
console.log('----requestHistorOrganizations----', params)
return await GetRequest(global_domain_config, getUrlParams('/authorized_inventory/search', params))
}
// 获取手术医院 params={access_token:'', org_code:'', seller_code:''}
export const requestHistorSurgeryHospital = async (global_domain_config, params) => {
console.log('----requestHistorSurgeryHospital----', params)
return await GetRequest(global_domain_config, getUrlParams('/sale/seller_customer/search', params))
}
// 获取订单类型 params={access_token:'', value_set_code:'SUR_ORDER_TYPE'}
export const requestHistorOrderType = async (global_domain_config, params) => {
console.log('----requestHistorOrderType----', params)
return await GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params))
}
// 借货订单查询 params: {access_token: '', ...}
export function requestGetAllBorrow(params) {
console.log('----requestGetAllBorrow----', params)
return (dispatch, getState) => {
dispatch(requestSearching())
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/surgery/collect_order/search', params))
.then(res => {
console.log('res=====', Object.keys(res), res);
if(res.error_code == 0) {
// 待定!======!!!
let { data: { surgery_collect_headers } } = res
dispatch(requestSearchSuccess(surgery_collect_headers));
} else if(res.error_code === 41006) {
show('登录过期,请重新登录');
dispatch(exitLoginStatus());
......@@ -58,29 +44,24 @@ export function requestGetAllBorrow(params) {
.catch(err => {
console.log('------err--====requestGetAllBorrow----', Object.keys(err), err)
show(err.error);
dispatch(requestSearchFail());
})
}
}
// 借货订单-行表查询 params: {access_token: '', surgery_collect_number: ''}
export const requestGetLineFormBorrow = async (global_domain_config, params) => {
console.log('----requestGetLineFormBorrow----', params)
return await GetRequest(global_domain_config, getUrlParams('/surgery/collect_line/search', params))
}
// 消耗订单查询 params: {access_token: '', ...}
export function requestGetAllConsume(params) {
console.log('----requestGetAllConsume----', params)
return (dispatch, getState) => {
dispatch(requestSearching())
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/surgery/consume_header/search', params))
.then(res => {
console.log('res=====', Object.keys(res), res);
if(res.error_code == 0) {
// 待定!======!!!
let { data: { sur_consume_headers } } = res
dispatch(requestSearchSuccess(sur_consume_headers));
......@@ -96,13 +77,13 @@ export function requestGetAllConsume(params) {
.catch(err => {
console.log('------err--====requestGetAllBorrow----', Object.keys(err), err)
show(err.error);
dispatch(requestSearchFail());
})
}
}
// 消耗订单-行表查询 params: {access_token: '', consume_order_number: ''}
export const requestGetLineFormConsume = async (global_domain_config, params) => {
console.log('----requestGetLineFormConsume----', params)
return await GetRequest(global_domain_config, getUrlParams('/surgery/consume_line/search', params))
}
......
......@@ -12,12 +12,10 @@ import { show } from '../utils/Utils';
export function requestLogin(params) {
return (dispatch, getState) => {
console.log('-------store--!!=========================---', getState())
dispatch(logining());
let {global_domain_config} = getState().login
PostRequest(global_domain_config, '/access_token/password/search?app_code=MOBILE', params).then((res) => {
if(res.error_code === 0){
// console.warn('res---', res)
// if(res.functions && res.functions.length) {
// show('登录成功');
// dispatch(loginSuccess(res, params.data.user_name, params.data.user_password));
......@@ -26,18 +24,19 @@ export function requestLogin(params) {
// dispatch(loginFailure())
// }
show('登录成功');
console.warn('res---', res)
dispatch(loginSuccess(res, params.data.user_name, params.data.user_password));
}else {
let {error_msg} = res
if(error_code == -3) {
let error_msg = res.error_msg || res.message
if(res.error_code == -3) {
error_msg += '\n尝试修改域名'
}
show(error_msg);
dispatch(loginFailure())
}
}).catch((err) => {
show(err.error);
let error_msg = err.error || '请求接口错误,请联系管理员'
show(error_msg);
dispatch(loginFailure())
})
}
}
......@@ -87,7 +86,7 @@ export function autoLogin(params) {
let {global_domain_config} = getState().login
PostRequest(global_domain_config, '/access_token/password/search?app_code=MOBILE', params).then((res) => {
if(res.error_code === 0){
console.warn('auto------',res);
// console.warn('auto------',res);
// if(res.functions && res.functions.length) {
// dispatch(autoLoginSuccess(res));
// } else {
......@@ -97,11 +96,12 @@ export function autoLogin(params) {
dispatch(autoLoginSuccess(res))
}else {
console.warn(res.error_msg);
show(res.error_msg, 'error');
show(res.error_msg);
dispatch(autoLoginFailure())
}
}).catch((err) => {
show(err.error, 'error');
show(err.error);
dispatch(autoLoginFailure())
})
}
}
......
......@@ -14,10 +14,8 @@ import {
// 获取组织 params={access_token:''}
export function requestQuickOrganizations(params) {
return (dispatch, getState) => {
console.log('----requestQuickOrganizations====================')
dispatch(requestListDataing());
let {global_domain_config} = getState().login
// GetRequest(`/authorized_inventory/search?access_token=${access_token}`)
GetRequest(global_domain_config, getUrlParams('/authorized_inventory/search', params))
.then(res => {
console.log('res=====', Object.keys(res), res);
......@@ -36,6 +34,7 @@ export function requestQuickOrganizations(params) {
.catch(err => {
console.log('------err--====organizations----', Object.keys(err), err)
show(err.error);
dispatch(requestListDataFail());
})
}
}
......@@ -43,12 +42,10 @@ export function requestQuickOrganizations(params) {
// 获取手术医院 params={access_token:'', org_code:'', seller_code:''}
export function requestQuickSurgeryHospital(params) {
return (dispatch, getState) => {
console.log('----requestQuickSurgeryHospital====================', params)
dispatch(requestListDataing());
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/sale/seller_customer/search', params))
.then(res => {
console.log('res===!!==', Object.keys(res));
if(res.error_code == 0) {
let { data: { customers } } = res
dispatch(requestListDataSuccess(customers));
......@@ -64,6 +61,7 @@ export function requestQuickSurgeryHospital(params) {
.catch(err => {
console.log('------err--====requestQuickSurgeryHospital----', Object.keys(err), err)
show(err.error);
dispatch(requestListDataFail());
})
}
}
......@@ -71,12 +69,10 @@ export function requestQuickSurgeryHospital(params) {
// 获取订单类型 params={access_token:'', value_set_code:'SUR_ORDER_TYPE'}
export function requestQuickOrderType(params) {
return (dispatch, getState) => {
console.log('----requestQuickOrderType====================', params)
dispatch(requestListDataing());
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params))
.then(res => {
console.log('res===!!==', Object.keys(res));
if(res.error_code == 0) {
let { data: { sys_values } } = res
dispatch(requestListDataSuccess(sys_values));
......@@ -92,6 +88,7 @@ export function requestQuickOrderType(params) {
.catch(err => {
console.log('------err--====requestQuickSurgeryHospital----', Object.keys(err), err)
show(err.error);
dispatch(requestListDataFail());
})
}
}
......@@ -99,12 +96,10 @@ export function requestQuickOrderType(params) {
// 获取配台模版 params={access_token:'', org_code:'', seller_code: 'shi.ming', customer_code: '', surgery_type: '', doctor_name: ''}
export function requestQuickTemplateCollect(params) {
return (dispatch, getState) => {
console.log('----requestQuickTemplateCollect====================', params)
dispatch(requestListDataing());
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/surgery/template_header/search', params))
.then(res => {
console.log('res===!!==', Object.keys(res));
if(res.error_code == 0) {
let { data: { surgery_template_headers } } = res
dispatch(requestListDataSuccess(surgery_template_headers));
......@@ -120,6 +115,7 @@ export function requestQuickTemplateCollect(params) {
.catch(err => {
console.log('------err--====requestQuickTemplateCollect----', Object.keys(err), err)
show(err.error);
dispatch(requestListDataFail());
})
}
}
......@@ -151,21 +147,17 @@ export const requestQuickAudio = async (global_domain_config, params) => {
let fileName = path.substring(path.lastIndexOf('/') + 1, path.length)
let file = { uri: soundPath, type: "multipart/form-data", name: fileName}
formData.append('file', file)
console.log('--------', file, formData)
return await UploadRequest(global_domain_config, getUrlParams('/dingding/upload_media', { access_token }), formData)
}
// 提交数据
export function requestQuickSumbit({access_token, ...params}) {
return (dispatch, getState) => {
console.warn('----requestQuickSumbit====================', access_token, params)
dispatch(requestSubmiting());
let {global_domain_config} = getState().login
PostRequest(global_domain_config, getUrlParams('/surgery/collect_order/via_data/create', {access_token: access_token}), params)
.then(res => {
console.warn('res=====', Object.keys(res));
if(res.error_code == 0) {
console.warn('res====requestQuickSumbit==========', res.data);
let { data } = res
dispatch(requestSubmitSuccess(data));
} else if(res.error_code === 41006) {
......@@ -180,6 +172,7 @@ export function requestQuickSumbit({access_token, ...params}) {
.catch(err => {
console.log('------err--====requestQuickSumbit----', Object.keys(err), err)
show(err.error);
dispatch(requestSubmitFail());
})
}
}
......
......@@ -34,6 +34,7 @@ export function requestOrganizations(access_token) {
})
.catch(err => {
show(err.error);
dispatch(requestOrganizationsFail());
})
}
}
......
......@@ -21,7 +21,7 @@ class DialogModel extends Component {
constructor(props) {
super(props);
this.state = {
isVisible: this.props.show,
isVisible: false,
entityList: this.props.entityList
}
}
......@@ -94,7 +94,8 @@ class DialogModel extends Component {
transparent={true}
visible={this.state.isVisible}
animationType={'fade'}
onRequestClose={() => this.closeModal()}>
// onRequestClose={() => this.closeModal()} // onRequestClose 只支持安卓
>
<SafeAreaView style={safe_view}>
<TouchableOpacity style={styles.container} activeOpacity={1}
onPress={() => this.closeModal()}>
......
......@@ -23,7 +23,15 @@ class HeadBackItem extends Component {
}
goBack() {
this.props.navigation.goBack()
let {callback, navigation} = this.props
if(callback && callback instanceof Function) {
callback()
setTimeout(() => {
navigation.goBack()
}, 500)
} else {
navigation.goBack()
}
}
render() {
......
......@@ -6,7 +6,8 @@ import {
Modal,
TouchableOpacity,
Image,
SafeAreaView
SafeAreaView,
ScrollView
} from 'react-native';
import {
Width,
......@@ -15,7 +16,8 @@ import {
pxSize,
safe_view,
icon_style,
font_family_medium
font_family_medium,
font_family_semibold
} from '../../base/BaseStyle';
class ShowModel extends Component {
......@@ -43,7 +45,6 @@ class ShowModel extends Component {
renderDialog() {
let { title, children } = this.props
console.warn(title, children)
return (
<View style={styles.opt_area}>
<View style={styles.modal_style}>
......@@ -73,13 +74,13 @@ class ShowModel extends Component {
visible={this.state.isVisible}
animationType={'fade'}
onRequestClose={() => this.closeModal()}>
<SafeAreaView style={safe_view}>
<View style={safe_view}>
<TouchableOpacity style={styles.container} activeOpacity={1}
// onPress={() => this.closeModal()}
>
{this.renderDialog()}
</TouchableOpacity>
</SafeAreaView>
</View>
</Modal>
</View>
);
......@@ -92,7 +93,7 @@ const styles = StyleSheet.create({
},
container: {
flex: 1,
backgroundColor: 'rgba(0, 0, 0, 0.1)'
backgroundColor: 'rgba(0, 0, 0, 0.3)'
},
opt_area: {
flex: 1,
......@@ -111,6 +112,7 @@ const styles = StyleSheet.create({
// borderTopLeftRadius: 20,
// borderTopRightRadius: 20,
minHeight: pxHeight(380),
maxHeight: pxHeight(480),
borderRadius: 20,
marginHorizontal: 20,
paddingHorizontal: 20,
......@@ -124,7 +126,9 @@ const styles = StyleSheet.create({
},
modal_tit: {
fontSize: first_text_size,
fontFamily: font_family_medium
fontFamily: font_family_semibold,
color: '#3A3A3A',
flex: 1
},
head_tou_clo: {
width: pxSize(28),
......@@ -135,7 +139,9 @@ const styles = StyleSheet.create({
// height: '100%'
// },
model_cont: {
paddingTop: 20
paddingTop: 20,
// height: pxHeight(220),
// flex: 1
},
})
......
......@@ -384,7 +384,6 @@ class EquipConsuPage extends Component {
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(index > curIndex && index < 4 ) {
console.log('进入')
item.name = localOtherObj.name
item.value = localOtherObj.value
// 清空耗材明细
......@@ -479,8 +478,8 @@ class EquipConsuPage extends Component {
changeCurrentOption() {
let { currentTitle } = this.state
let { equipOrderOption } = this.props
// console.log('当前:--equipOrderOption---', equipOrderOption)
let tempOption = []
let that = this
if(equipOrderOption.length === 0) {
show(`当前${currentTitle}为空`)
return
......@@ -501,7 +500,6 @@ class EquipConsuPage extends Component {
}
tempOption = this.changeNameAndValue(currentArr, 'customer_name', 'customer_code')
} else if (currentTitle === '订单信息') {
let resultArr = []
equipOrderOption.forEach(item => {
......@@ -518,8 +516,14 @@ class EquipConsuPage extends Component {
}
this.setState({
showTypePop: true,
listCurrentOption: [...tempOption]
}, () => {
// 解决 IOS 弹窗显示问题
setTimeout(() => {
that.setState({
showTypePop: true
})
}, 500)
})
}
......@@ -613,7 +617,6 @@ class EquipConsuPage extends Component {
// console.warn('消耗时间------check')
let { listOptionData } = this.state
let date = listOptionData[4].value
console.log('date-----', date)
if(date) {
this.setState({
listOptionData: listOptionData.map((item, index) => {
......@@ -777,7 +780,6 @@ class EquipConsuPage extends Component {
// 耗材明细 隐藏子项
handleDetailBtmCheck() {
let {listOptionData} = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(index == 12) {
......@@ -791,9 +793,7 @@ class EquipConsuPage extends Component {
// 耗材明细 显示子项
handleDetailRigCheck() {
let {listOptionData} = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(index == 12) {
......@@ -941,16 +941,8 @@ class EquipConsuPage extends Component {
this.changeCanSub(true)
let { state, props } = this
// // 测试提交--重复数据
// this.clearAllData() // 清空数据
// let { state: { params: { title } } } = this.props.navigation
// this.props.navigation.navigate('SubSuccPage', { // 现在没返回订单号
// title: `${title} - 下单成功`
// })
// 可提交 并且 不处于正在提交中
if(state.canSubFlag && !state.isSubLoding) {
// console.warn('进入提交内容----!!------')
let tempSubOption = state.submitOption
tempSubOption.org_code = state.listOptionData[1].value
tempSubOption.surgery_collect_number = state.listOptionData[3].value
......@@ -1268,6 +1260,7 @@ class EquipConsuPage extends Component {
itemTitle={currentTitle}
closeModal={(show) => this.handleCloseModal(show)}
/>
</SafeAreaView>
)
}
......@@ -1275,7 +1268,6 @@ class EquipConsuPage extends Component {
// 返回备注元素
renderRemarksItem() {
let { state } = this
console.log('备注===', state.listOptionData[11], state.subInitListOption[11])
return (
<CellTextStyle style={list_common_item.remark_item}>
<View style={list_common_item.rema_box}>
......@@ -1421,7 +1413,6 @@ class EquipConsuPage extends Component {
// 返回增加的图片
renderPicItem(item, index) {
console.log('item----',item)
return (
<View style={list_common_item.addnew_pic_btn} key={index}>
<TouchableOpacity
......@@ -1429,7 +1420,6 @@ class EquipConsuPage extends Component {
style={list_common_item.show_pic_btn}
onPress={()=>console.log('放大图片')}
>
{/* <Image style={icon_style} source={{uri: "file:///storage/emulated/0/Pictures/images/image-ea1a24b8-2d12-468f-ac23-e9aed20c6d31.jpg"}} /> */}
<Image style={icon_style} source={{uri: item}} />
</TouchableOpacity>
<TouchableOpacity
......
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