Commit f7d13184 by peii

Merge branch 'develop' into product

parents 580b9f83 bdb925d7
......@@ -164,6 +164,12 @@ android {
xhk {
resValue "string", "baseUrl", '"https://obs.xhk.orth.tech"'
}
bjzr {
resValue "string", "baseUrl", '"https://hos.dev.bjhh.guke.tech"'
}
gyxj {
resValue "string", "baseUrl", '"http://190.3.1.42"'
}
}
// applicationVariants are e.g. debug, release
......
......@@ -12,6 +12,7 @@ import {
SET_SELECT_PRODUCT_OPTS
} from '../base/ActionTypes';
import local_inter_mock from '../containers/selfOrder/module/mock/inter_mock'
import * as R from 'ramda'
// 获取组织 params={access_token:''}
export function requestSelfOrganizations(params) {
......@@ -126,33 +127,42 @@ export const reqSelfSurgeryHospital = async (global_domain_config, params) => {
}
// 获取订单类型 params={access_token:'', value_set_code:'SUR_ORDER_TYPE'}
export function requestSelfOrderType(params) {
export function requestSelfOrderType(params, url) {
return (dispatch, getState) => {
dispatch(requestListDataing());
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))
if (!url) {
url = '/system/order_type/search'
}
GetRequest(global_domain_config, getUrlParams(url, params))
.then(res => {
console.log('获取订单类型 res=====', res);
// 兼容老的接口,有的环境没有实现获取订单类型接口
if (res.status === 404) {
return dispatch(requestSelfOrderType(params, '/system/value_set/search'))
}
if(res.error_code == 0) {
let { data: { sys_values } } = res
dispatch(requestListDataSuccess(sys_values));
let data = []
if (R.includes('order_type', url)) {
data = R.map(R.applySpec({
value_name: R.prop('order_type_name'),
value_code: R.prop('order_type_code'),
}))(res.data)
} else {
data = res.data.sys_values
}
dispatch(requestListDataSuccess(data));
}else {
showWarnErrorMessage(dispatch, res, exitLoginStatus, requestListDataFail)
}
// else if(res.error_code === 41006) {
// show('登录过期,请重新登录');
// dispatch(exitLoginStatus());
// } else {
// let error_msg = res.error_msg || res.message
// show(error_msg);
// dispatch(requestListDataFail());
// }
})
.catch(err => {
if (!url) {
requestSelfOrderType(params, '/system/value_set/search')
} else {
showErrorMessage(dispatch, err, requestListDataFail, '获取订单类型')
// console.log('------err--====获取订单类型----', Object.keys(err), err)
// show(err.error);
// dispatch(requestListDataFail());
}
})
}
}
......
......@@ -734,7 +734,6 @@ class EquipConsuPage extends Component {
customer_name: cus.customer_name,
}))(customers)
}
that.setState({
localCustomersOption: customers
})
......@@ -1210,13 +1209,15 @@ class EquipConsuPage extends Component {
const billSite = R.find(R.propEq('bill_to_site_code', listOptionData[3].value))(customer.bill_to_sites)
if (isNotBlank(billSite) && isNotBlank(billSite.ship_to_sites) && listOptionData[4].value) {
const ship = R.find(R.propEq('ship_to_site_code', listOptionData[4].value))(billSite.ship_to_sites)
const ship = R.filter(R.propEq('ship_to_site_code', listOptionData[4].value))(billSite.ship_to_sites)
if (isNotBlank(ship)) {
tempOption = R.prepend({
value: ship.customer_doctor,
name: ship.customer_doctor
}, tempOption)
tempOption = R.compose(
R.concat(R.__, tempOption),
R.map(R.applySpec({
value: R.prop('customer_doctor'),
name: R.prop('customer_doctor')
}))
)(ship)
}
}
}
......
......@@ -1103,13 +1103,16 @@ class SelfOrderPage extends Component {
const billSite = R.find(R.propEq('bill_to_site_code', listOptionData[3].value))(customer.bill_to_sites)
if (isNotBlank(billSite) && isNotBlank(billSite.ship_to_sites) && listOptionData[4].value) {
const ship = R.find(R.propEq('ship_to_site_code', listOptionData[4].value))(billSite.ship_to_sites)
const ship = R.filter(R.propEq('ship_to_site_code', listOptionData[4].value))(billSite.ship_to_sites)
if (isNotBlank(ship)) {
tempOption = R.prepend({
value: ship.customer_doctor,
name: ship.customer_doctor
}, tempOption)
tempOption = R.compose(
R.concat(R.__, tempOption),
R.map(R.applySpec({
value: R.prop('customer_doctor'),
name: R.prop('customer_doctor')
}))
)(ship)
}
}
}
......@@ -1218,6 +1221,7 @@ class SelfOrderPage extends Component {
// 订单类型 点击
handleOrderCheck(curData) {
let { props } = this
const { listOptionData } = this.state
if (this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
this.setState({
currentTitle: curData.title,
......@@ -1228,7 +1232,9 @@ class SelfOrderPage extends Component {
}, () => {
let params = {
access_token: props.token,
value_set_code: 'SUR_ORDER_TYPE'
value_set_code: 'SUR_ORDER_TYPE',
org_code: listOptionData[1].value,
order_type: 'SUR_ORDER_TYPE'
}
props.requestSelfOrderType(params)
})
......
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