Commit 2959b174 by peii

下单添加手术类型

parent ea0ae58b
......@@ -12,7 +12,8 @@ import {
SET_SYSPROFILE
} from '../base/ActionTypes';
import { GetRequest, PostRequest } from '../network/RequestUtils';
import { getUrlParams, show, showWarnErrorMessage, showErrorMessage } from '../utils/Utils';
import { getUrlParams, show, showWarnErrorMessage, showErrorMessage, isNotBlank } from '../utils/Utils';
import { originSysProfiles } from '../reducers/module/login';
export function requestLogin(params) {
return (dispatch, getState) => {
......@@ -167,7 +168,7 @@ export function setVersionApk(versionApk) {
*/
export function getSysProfiles() {
return (dispatch, getState) => {
let {global_domain_config, token, originSysProfiles} = getState().login
let {global_domain_config, token } = getState().login
function getSysProfile(profile_code) {
const params = {
......@@ -175,9 +176,10 @@ export function getSysProfiles() {
profile_code
}
requestSysProfile(global_domain_config, params).then(res => {
console.log(res)
console.log(profile_code, res)
if (res.error_code === 0) {
const value = R.pathOr(originSysProfiles[profile_code], ['data', 'profile_value'])(res)
let value = R.pathOr(originSysProfiles[profile_code], ['data', 'profile_value'])(res)
if (isNotBlank(value) && !isNaN(value)) value = parseInt(value)
dispatch(setSysProfiles(profile_code, value))
}
})
......
......@@ -407,3 +407,12 @@ export function setSelectProductOpts(data) {
rawData: data
}
}
/**
* @description: 请求手术类型
* @param {*}
* @return {*}
*/
export async function requestSurgeryType(global_domain_config, params) {
return await GetRequest(global_domain_config, getUrlParams(`/inventory/category/search`, params))
}
\ No newline at end of file
......@@ -216,7 +216,7 @@ class EquipConsuPage extends Component {
doctor_name: '', // 主治医生
// surgery_name: '', // 手术名称
surgery_date: '', // 手术时间
// surgery_type_code: '', // 手术类型
surgery_type: '', // 手术类型
template_collect_number: '', // 手术模板
order_type_code: '', // 订单类型
surgery_desc: '', // 备注信息
......@@ -1496,6 +1496,7 @@ class EquipConsuPage extends Component {
tempSubOption.doctor_name = state.listOptionData[5].value
}
tempSubOption.template_collect_number = state.listOptionData[7].value
tempSubOption.surgery_type = state.listOptionData[6].value
tempSubOption.surgery_date = state.listOptionData[8].value
tempSubOption.order_type_code = state.listOptionData[9].value
tempSubOption.collect_src_inv_code = state.listOptionData[10].value
......
......@@ -11,7 +11,7 @@ import LodingModel from '../common/LodingModel';
import DateModel from '../common/DateModel';
import { AudioRecorder, AudioUtils } from 'react-native-audio';
import Sound from 'react-native-sound';
import { requestSelfOrganizations, requestSelfSurgeryHospital, requestSelfOrderType, requestSelfTemplateCollect, requestSelfAudio, requestSelfSumbit, setSelfInitData, reqSelfSurgeryHospital, requestListDataSuccess, requestSelfSurgeryType, setSelectProductOpts, reqSelfOrganizations, reqOrgDepartments, requestQuickSurColSetting} from '../../action/SelfAction';
import { requestSelfOrganizations, requestSelfSurgeryHospital, requestSelfOrderType, requestSelfTemplateCollect, requestSelfAudio, requestSelfSumbit, setSelfInitData, reqSelfSurgeryHospital, requestListDataSuccess, requestSelfSurgeryType, setSelectProductOpts, reqSelfOrganizations, reqOrgDepartments, requestQuickSurColSetting, requestSurgeryType} from '../../action/SelfAction';
import { exitLoginStatus, requestSysProfile } from '../../action/LoginAction';
import { SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_SUCCESS, SELF_ORDER_LIST_FAILURE, LOGIN_NO, SELF_SUBMIT_DOING, SELF_SUBMIT_SUCCESS, SELF_SUBMIT_FAILURE } from '../../base/ActionTypes';
import PageListArrow from '../common/listDataComponent/PageListArrow';
......@@ -168,6 +168,12 @@ class SelfOrderPage extends Component {
title: '借货仓库',
name: '请选择',
value: '',
},
{
"id": "19",
title: '手术类型',
name: '请选择',
value: '',
}
],
subInitListOption: [], // 存储最初数据
......@@ -180,7 +186,7 @@ class SelfOrderPage extends Component {
doctor_name: '', // 主治医生
surgery_name: '', // 手术名称
surgery_date: '', // 手术时间
// surgery_type_code: '', // 手术类型,用来筛选手术套包
surgery_type: '', // 手术类型,用来筛选手术套包
order_type_code: '', // 订单类型
surgery_desc: '', // 备注信息
voice_url: '', // 录音地址
......@@ -220,18 +226,24 @@ class SelfOrderPage extends Component {
OBS_MOBILE_BM_DISPLAY: 0,
OBS_MOBILE_SUR_FOLLOWER_DISPLAY: 0,
OBS_MOBILE_DELIVERYMAN_DISPLAY: 0,
OBS_MOBILE_BOR_WARE_REQUIRED: 0
OBS_MOBILE_BOR_WARE_REQUIRED: 0,
},
departments: []
departments: [],
surgery_types: []
}
}
componentDidMount() {
const {sysProfiles} = this.props
this.getSysProfileValue()
this.props.setSelectProductOpts([])
this.getSellerName()
this.getAudioAuthorize()
this.getOrganizationData()
if (sysProfiles.SUR_MOBILE_INV_PRODUCT_LINE_CATEGORY_FLAG > 1) {
this.getSurgeryTypes()
}
}
// 赋值销售员 初始化数据
......@@ -519,6 +531,7 @@ class SelfOrderPage extends Component {
// 判断是否都有值,修改提交按钮的颜色
changeCanSub(isSubCheck) {
let { listOptionData, sysValues} = this.state
let { sysProfiles } = this.props
let tempStatus = false
let tempTit = ''
let curTip = '未选择'
......@@ -538,7 +551,8 @@ class SelfOrderPage extends Component {
|| (chIndex == 15 && sysValues.OBS_MOBILE_BM_DISPLAY > 2)
|| (chIndex == 16 && sysValues.OBS_MOBILE_SUR_FOLLOWER_DISPLAY > 2)
|| (chIndex == 17 && sysValues.OBS_MOBILE_DELIVERYMAN_DISPLAY > 2)
|| (chIndex == 18 && sysValues.OBS_MOBILE_BOR_WARE_REQUIRED > 2))
|| (chIndex == 18 && sysValues.OBS_MOBILE_BOR_WARE_REQUIRED > 2)
|| (chIndex == 19 && sysProfiles.SUR_MOBILE_INV_PRODUCT_LINE_CATEGORY_FLAG > 2))
&& !listOptionData[chIndex].value) {
tempTit = listOptionData[chIndex].title
tempStatus = true
......@@ -1208,25 +1222,52 @@ class SelfOrderPage extends Component {
})
}
/**
* @description: 请求手术类型
* @param {*}
* @return {*}
*/
async getSurgeryTypes() {
let { token, global_domain_config } = this.props
let params = {
access_token: token,
category_set: 'PRODUCT_LINE_CATEGORY'
}
const res = await requestSurgeryType(global_domain_config, params).catch(err => {return {}})
if (res.error_code !== 0) return
let surgery_types = R.compose(
R.map(R.applySpec({
name: R.prop('category_name'),
value: R.prop('category_code'),
})),
R.propOr([], 'data')
)(res)
this.setState({ surgery_types })
}
// 手术类型 点击
handleSurTypeCheck(curData) {
// let { props } = this
// let that = this
// if (this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
// that.setState({
// currentTitle: curData.title,
// currentItem: {
// name: curData.name,
// value: curData.value
// }
// }, () => {
// let params = {
// access_token: props.token,
// value_set_code: 'ORTHOPEDICS_PRODUCT_CLASS'
// }
// props.requestSelfSurgeryType(params)
// })
// }
async handleSurTypeCheck(curData) {
let {surgery_types} = this.state
if (!this.judgeOrgIsNull() || !this.judgeCustomerIsNull()) {
return
}
if (isBlank(surgery_types)) { return show('手术类型为空') }
this.setState({
currentTitle: curData.title,
currentItem: {
name: curData.name,
value: curData.value
},
listCurrentOption: surgery_types,
surgery_types
}, () => {
setTimeout(() => {
this.handleCloseModal(true)
}, 100)
})
}
// 订单类型 点击
......@@ -1577,7 +1618,7 @@ class SelfOrderPage extends Component {
tempSubOption.surgery_date = state.listOptionData[6].value
// tempSubOption.surgery_type_code = state.listOptionData[8].value
tempSubOption.surgery_type = state.listOptionData[19].value
tempSubOption.order_type_code = state.listOptionData[7].value
tempSubOption.lines = state.listOptionData[8].sub_lines
......@@ -1870,7 +1911,8 @@ class SelfOrderPage extends Component {
// 返回备注以上的元素
renderListItem() {
let { listOptionData, dateModelPop, sysValues } = this.state
const isShowOrg = R.compose(R.equals('Y'), R.prop('OBS_SHOW_ORG_FLAG'))(this.props.sysProfiles)
const {sysProfiles} = this.props
const isShowOrg = R.compose(R.equals('Y'), R.prop('OBS_SHOW_ORG_FLAG'))(sysProfiles)
return (
<View style={styles.list_cont}>
......@@ -2005,15 +2047,18 @@ class SelfOrderPage extends Component {
listCallBack={() => this.handleSurDateCheck(listOptionData[6])}
listHasArrow={true}
/>
{/* <PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[8]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleSurTypeCheck(listOptionData[8])}
listHasArrow={true}
/> */}
{
sysProfiles.SUR_MOBILE_INV_PRODUCT_LINE_CATEGORY_FLAG > 1 &&
<PageListArrow
listActOpa={.8}
listItem={listOptionData[19]}
listHasAster={sysProfiles.SUR_MOBILE_INV_PRODUCT_LINE_CATEGORY_FLAG > 2}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleSurTypeCheck(listOptionData[19])}
listHasArrow={true}
/>
}
<PageListArrow
listActOpa={.8}
listHasAster={true}
......
......@@ -22,16 +22,20 @@ const defaultState = {
global_domain_config: 'https://obs.uat.guke.tech',
hasSetDomainFromOrigin: false,
local_version_apk: '',
originSysProfiles: {
OBS_SHOW_ORG_FLAG: 'Y',
SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG: 'Y'
},
sysProfiles: {
OBS_SHOW_ORG_FLAG: 'Y',
SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG: 'Y'
SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG: 'Y',
SUR_MOBILE_INV_PRODUCT_LINE_CATEGORY_FLAG: 0
}
}
// 默认sysProfile,放state里时,会被持久化影响后面更新不了
export const originSysProfiles = {
OBS_SHOW_ORG_FLAG: 'Y',
SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG: 'Y',
SUR_MOBILE_INV_PRODUCT_LINE_CATEGORY_FLAG: 0
}
export default login = (state = defaultState, action) => {
switch (action.type) {
case LOGIN_DOING:
......
......@@ -903,11 +903,6 @@
resolved "https://registry.yarnpkg.com/@react-native-community/slider/-/slider-3.0.3.tgz#830167fd757ba70ac638747ba3169b2dbae60330"
integrity sha512-8IeHfDwJ9/CTUwFs6x90VlobV3BfuPgNLjTgC6dRZovfCWigaZwVNIFFJnHBakK3pW2xErAPwhdvNR4JeNoYbw==
"@react-native-community/viewpager@^2.0.1":
version "2.0.2"
resolved "https://r.cnpmjs.org/@react-native-community/viewpager/download/@react-native-community/viewpager-2.0.2.tgz#622b190294b1310c4825c98daeaee1c8443f7124"
integrity sha1-YisZApSxMQxIJcmNrq7hyEQ/cSQ=
"@react-navigation/core@~3.4.1":
version "3.4.2"
resolved "https://registry.npm.taobao.org/@react-navigation/core/download/@react-navigation/core-3.4.2.tgz#bec563e94fde40fbab3730cdc97f22afbb2a1498"
......@@ -5396,10 +5391,10 @@ react-native-modal-popover@^2.0.1:
lodash "^4.17.20"
prop-types "^15.7.2"
react-native-pager-view@^5.2.1:
react-native-pager-view@5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/react-native-pager-view/-/react-native-pager-view-5.2.1.tgz#ad69a6035edd998771daf302830f73602e5204a9"
integrity sha512-6aqsVr6Z4MjYP57lMwNEurlOPah0Lw34L6x+/nI6SxY+wyqZI+uaEB7sWS5EIcgQ9cGKMo925LnVWd6Xilu33A==
resolved "https://rg.cnpmjs.org/react-native-pager-view/download/react-native-pager-view-5.2.1.tgz#ad69a6035edd998771daf302830f73602e5204a9"
integrity sha1-rWmmA17dmYdx2vMCgw9zYC5SBKk=
react-native-root-siblings@^3.0.0:
version "3.2.3"
......@@ -5431,12 +5426,11 @@ react-native-safe-area-view@^0.14.1:
dependencies:
debounce "^1.2.0"
react-native-scrollable-tab-view@^1.0.0:
version "1.0.0"
resolved "https://r.cnpmjs.org/react-native-scrollable-tab-view/download/react-native-scrollable-tab-view-1.0.0.tgz#87319896067f7bb643ecd7fba2cba4d6d8f9e18b"
integrity sha1-hzGYlgZ/e7ZD7Nf7osuk1tj54Ys=
react-native-scrollable-tab-view@0.9.0:
version "0.9.0"
resolved "https://rg.cnpmjs.org/react-native-scrollable-tab-view/download/react-native-scrollable-tab-view-0.9.0.tgz#cf8c09018f1e1c88bb26db6a003c90de275a1c6f"
integrity sha1-z4wJAY8eHIi7JttqADyQ3idaHG8=
dependencies:
"@react-native-community/viewpager" "^2.0.1"
create-react-class "^15.6.2"
prop-types "^15.6.0"
react-timer-mixin "^0.13.3"
......
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