Commit fcfbb2f0 by Denglingling

调整获取手术类型的方式,从本地配置改为接口获取

(cherry picked from commit 781e11a4)
parent 34cfcc5e
......@@ -97,7 +97,7 @@ 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) {
return (dispatch, getState) => {
dispatch(requestListDataing());
......@@ -124,6 +124,37 @@ export function requestQuickTemplateCollect(params) {
}
}
// 获取手术类型 params={access_token:'', value_set_code:'ORTHOPEDICS_PRODUCT_CLASS'}
export function requestQuickSurgeryType(params) {
return (dispatch, getState) => {
dispatch(requestListDataing());
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params))
.then(res => {
if(res.error_code == 0) {
let typeOption = []
let { data: { value_set_code, sys_values } } = res
if(value_set_code === 'ORTHOPEDICS_PRODUCT_CLASS' && sys_values && sys_values.length) {
typeOption = sys_values
}
dispatch(requestListDataSuccess(typeOption));
} 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 => {
console.log('------err--====requestQuickSurgeryType----', Object.keys(err), err)
show(err.error);
dispatch(requestListDataFail());
})
}
}
function requestListDataing() {
return {
type: QUICK_ORDER_LIST_DOING
......
......@@ -49,7 +49,8 @@ import {
requestQuickSumbit,
setQuickInitData,
reqQuickSurgeryHospital,
requestListDataSuccess
requestListDataSuccess,
requestQuickSurgeryType
} from '../../action/QuickAction';
import { exitLoginStatus } from '../../action/LoginAction';
import {
......@@ -114,7 +115,7 @@ class EquipConsuPage extends Component {
},
{
"id": "7",
title: '配台模',
title: '配台模',
name: '请选择',
value: ''
},
......@@ -156,7 +157,7 @@ class EquipConsuPage extends Component {
// surgery_name: '', // 手术名称
surgery_date: '', // 手术时间
// surgery_type_code: '', // 手术类型
template_collect_number: '', // 配台模
template_collect_number: '', // 配台模
order_type_code: '', // 订单类型
surgery_desc: '', // 备注信息
voice_url: '', // 录音地址
......@@ -184,9 +185,7 @@ class EquipConsuPage extends Component {
],
dateModelPop: false, // 日期选择器
hasPermission: undefined, //录音 授权状态
// audioPath: AudioUtils.DocumentDirectoryPath + `/quickAudio${Math.floor(Math.random() * (1000))+1}.aac`, // 文件路径
audioPath: AudioUtils.DocumentDirectoryPath + `/quick_audio_${new Date().getTime()}.aac`, // 文件路径
// recording: false, //是否录音
stop: false, //录音是否停止
currentTime: 0, //录音时长
localCustomersOption: [], // 当前医院信息:客户名称、收单地点、收货地点、主治医生
......@@ -587,7 +586,7 @@ class EquipConsuPage extends Component {
if(itemTitle === '手术类型') {
self.clearInitNameAndValue(6)
}
if (itemTitle === '配台模') {
if (itemTitle === '配台模') {
listOptionData[10].value = item.desc
}
}
......@@ -633,8 +632,16 @@ class EquipConsuPage extends Component {
})
}
tempOption = this.changeNameAndValue(currentArr, 'customer_name', 'customer_code')
} else if (currentTitle === '配台模版') {
} else if (currentTitle === '手术类型') {
let resultArr = []
quickOrderOption.forEach(item => {
let obj = {}
obj.name = item.value_name
obj.value = item.value_code
resultArr.push(obj)
})
tempOption = [...resultArr]
} else if (currentTitle === '配台模板') {
let resultArr = []
quickOrderOption.forEach(item => {
let obj = {}
......@@ -642,8 +649,8 @@ class EquipConsuPage extends Component {
if(item.doctor_name) {
tempName += `——${item.doctor_name}`
}
obj.name = tempName,
obj.value = item.template_number,
obj.name = tempName
obj.value = item.template_number
obj.desc = item.template_desc
resultArr.push(obj)
})
......@@ -852,21 +859,11 @@ class EquipConsuPage extends Component {
})
}
}
// 主治医生 点击/输入
handleDoctorCheck(text) {
// 主治医生 点击
handleDoctorCheck() {
let { localCustomersOption, listOptionData } = this.state
let self = this
if(text) {
// 输入
self.setState({
listOptionData: listOptionData.map(item => {
if(item.title === '主治医生') {
item.inputValue = text
}
return item
})
})
} else if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
// 点击
self.setState({
currentTitle: '主治医生',
......@@ -900,9 +897,22 @@ class EquipConsuPage extends Component {
})
}
}
// 主治医生 输入
handleDoctorInput(text) {
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map(item => {
if(item.title === '主治医生') {
item.inputValue = text
}
return item
})
})
}
// 手术类型 点击
handleSurTypeCheck() {
let { listOptionData, surgeryTypeOption } = this.state
let { props } = this
let self = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
self.setState({
......@@ -912,19 +922,20 @@ class EquipConsuPage extends Component {
value: listOptionData[6].value
}
}, () => {
self.setState({
showTypePop: true,
listCurrentOption: [...surgeryTypeOption]
})
let params = {
access_token: props.token,
value_set_code: 'ORTHOPEDICS_PRODUCT_CLASS'
}
props.requestQuickSurgeryType(params)
})
}
}
// 配台模 点击
// 配台模 点击
handleMatchTempCheck() {
let { state, props } = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
this.setState({
currentTitle: '配台模',
currentTitle: '配台模',
currentItem: {
name: state.listOptionData[7].name,
value: state.listOptionData[7].value
......@@ -1244,11 +1255,10 @@ class EquipConsuPage extends Component {
<ContInputTextStyle
style={styles.cell_input}
placeholder={`请输入主治医生`}
onChangeText={(text) => this.handleDoctorCheck(text)}
onChangeText={(text) => this.handleDoctorInput(text)}
></ContInputTextStyle>
</CellTextStyle> : null
}
}
</View>
<View style={styles.item_container}>
<TouchableOpacity
......@@ -1269,7 +1279,7 @@ class EquipConsuPage extends Component {
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'配台模'}</TitleTextStyle>
<TitleTextStyle>{'配台模'}</TitleTextStyle>
<ContTextStyle>{listOptionData[7].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
......@@ -1285,15 +1295,13 @@ class EquipConsuPage extends Component {
<ContTextStyle>{listOptionData[8].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</TouchableOpacity>
<DateModel
date={listOptionData[8].dateValue}
closeModal={(show) => this.closeDateModal(show)}
show={dateModelPop}
callback={(date) => this.dateModalCallback(date)}
/>
</View>
<View style={styles.item_container}>
<TouchableOpacity
......@@ -1307,10 +1315,8 @@ class EquipConsuPage extends Component {
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View>
</View>
{ this.renderPickerModel() }
</View>
)
}
......@@ -1544,6 +1550,9 @@ const mapDispatchToProps = (dispatch) => {
},
requestListDataSuccess: (data) => {
dispatch(requestListDataSuccess(data))
},
requestQuickSurgeryType: (params) => {
dispatch(requestQuickSurgeryType(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