Commit 6f3aef4b by Denglingling

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

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