Commit b0ecec3d by Denglingling

新增器械消耗费用明细相关处理

parent 64a0d720
...@@ -10,7 +10,8 @@ import SelfOrderPage from './containers/selfOrder/SelfOrderPage'; ...@@ -10,7 +10,8 @@ import SelfOrderPage from './containers/selfOrder/SelfOrderPage';
import ChooseProductPage from './containers/selfOrder/module/ChooseProductPage'; import ChooseProductPage from './containers/selfOrder/module/ChooseProductPage';
import EditThirdLevelPage from './containers/selfOrder/module/EditThirdLevelPage'; import EditThirdLevelPage from './containers/selfOrder/module/EditThirdLevelPage';
import EquipConsuPage from './containers/equipConsu/EquipConsuPage'; import EquipConsuPage from './containers/equipConsu/EquipConsuPage';
import ConsumDetailsPage from './containers/equipConsu//module/ConsumDetailsPage'; import ConsumDetailsPage from './containers/equipConsu/module/ConsumDetailsPage';
import ChargeDetailsPage from './containers/equipConsu/module/ChargeDetailsPage';
import FillUnitPricePage from './containers/equipConsu/module/FillUnitPricePage'; import FillUnitPricePage from './containers/equipConsu/module/FillUnitPricePage';
import ShowDetailPage from './containers/equipConsu/module/ShowDetailPage'; import ShowDetailPage from './containers/equipConsu/module/ShowDetailPage';
import QuickOrderPage from './containers/quickOrder/QuickOrderPage'; import QuickOrderPage from './containers/quickOrder/QuickOrderPage';
...@@ -31,7 +32,8 @@ const Router = createAppContainer(createStackNavigator({ ...@@ -31,7 +32,8 @@ const Router = createAppContainer(createStackNavigator({
ChooseProductPage: {screen: ChooseProductPage}, ChooseProductPage: {screen: ChooseProductPage},
EditThirdLevelPage: {screen: EditThirdLevelPage}, EditThirdLevelPage: {screen: EditThirdLevelPage},
EquipConsuPage: {screen: EquipConsuPage}, EquipConsuPage: {screen: EquipConsuPage},
ConsumDetailsPage: {screen: ConsumDetailsPage}, ConsumDetailsPage: {screen: ConsumDetailsPage},
ChargeDetailsPage: {screen: ChargeDetailsPage},
FillUnitPricePage: {screen: FillUnitPricePage}, FillUnitPricePage: {screen: FillUnitPricePage},
ShowDetailPage: {screen: ShowDetailPage}, ShowDetailPage: {screen: ShowDetailPage},
QuickOrderPage: {screen: QuickOrderPage}, QuickOrderPage: {screen: QuickOrderPage},
......
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
EQUIP_SUBMIT_SUCCESS, EQUIP_SUBMIT_SUCCESS,
EQUIP_SUBMIT_FAILURE, EQUIP_SUBMIT_FAILURE,
GET_SUB_DETAIL_OPTION, GET_SUB_DETAIL_OPTION,
GET_CHARGE_DETAILS_OPTION,
EQUIP_INIT_DATA EQUIP_INIT_DATA
} from '../base/ActionTypes'; } from '../base/ActionTypes';
...@@ -122,7 +123,7 @@ function requestListDataFail() { ...@@ -122,7 +123,7 @@ function requestListDataFail() {
} }
} }
// 获取当前临时存储的明细 // 设置当前临时存储的明细
export function getSubdetailOption(data) { export function getSubdetailOption(data) {
return { return {
type: GET_SUB_DETAIL_OPTION, type: GET_SUB_DETAIL_OPTION,
...@@ -130,6 +131,14 @@ export function getSubdetailOption(data) { ...@@ -130,6 +131,14 @@ export function getSubdetailOption(data) {
} }
} }
// 设置当前费用明细
export function getCharDetailsOption(data) {
return {
type: GET_CHARGE_DETAILS_OPTION,
rawData: 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) => {
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))
......
...@@ -7,15 +7,15 @@ import { ...@@ -7,15 +7,15 @@ import {
AUTO_LOGIN_FAILURE, AUTO_LOGIN_FAILURE,
SET_DOMAIN_CONFIGURATE SET_DOMAIN_CONFIGURATE
} from '../base/ActionTypes'; } from '../base/ActionTypes';
import { PostRequest } from '../network/RequestUtils'; import { GetRequest, PostRequest } from '../network/RequestUtils';
import { show } from '../utils/Utils'; import { getUrlParams, show } from '../utils/Utils';
export function requestLogin(params) { export function requestLogin(params) {
return (dispatch, getState) => { return (dispatch, 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) => {
console.log('res-------', res) console.log('登录 res=====', res)
if(res.error_code === 0){ if(res.error_code === 0){
if(res.functions && res.functions.length) { if(res.functions && res.functions.length) {
show('登录成功'); show('登录成功');
...@@ -38,6 +38,7 @@ export function requestLogin(params) { ...@@ -38,6 +38,7 @@ export function requestLogin(params) {
let error_msg = err.error || '请求接口错误,请联系管理员' let error_msg = err.error || '请求接口错误,请联系管理员'
show(error_msg); show(error_msg);
dispatch(loginFailure()) dispatch(loginFailure())
console.error(err)
}) })
} }
} }
...@@ -86,6 +87,7 @@ export function autoLogin(params) { ...@@ -86,6 +87,7 @@ export function autoLogin(params) {
return (dispatch, getState) => { return (dispatch, getState) => {
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) => {
console.log('自动登录 res=====', res)
if(res.error_code === 0){ if(res.error_code === 0){
if(res.functions && res.functions.length) { if(res.functions && res.functions.length) {
dispatch(autoLoginSuccess(res)); dispatch(autoLoginSuccess(res));
...@@ -102,6 +104,7 @@ export function autoLogin(params) { ...@@ -102,6 +104,7 @@ export function autoLogin(params) {
}).catch((err) => { }).catch((err) => {
show(err.error); show(err.error);
dispatch(autoLoginFailure()) dispatch(autoLoginFailure())
console.error(err)
}) })
} }
} }
...@@ -111,4 +114,14 @@ export function setDomainConfigurate(domainVal) { ...@@ -111,4 +114,14 @@ export function setDomainConfigurate(domainVal) {
type: SET_DOMAIN_CONFIGURATE, type: SET_DOMAIN_CONFIGURATE,
global_domain_config: domainVal global_domain_config: domainVal
} }
}
//系统配置文件查询接口 access_token profile_code
export const requestSysProfile = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/system/sys_profile/search', params))
}
//系统值集查询接口 access_token value_set_code
export const requestSysValueSet = async (global_domain_config, params) => {
return await GetRequest(global_domain_config, getUrlParams('/system/value_set/search', params))
} }
\ No newline at end of file
...@@ -39,6 +39,7 @@ export const EQUIP_SUBMIT_SUCCESS = "EQUIP_SUBMIT_SUCCESS" ...@@ -39,6 +39,7 @@ export const EQUIP_SUBMIT_SUCCESS = "EQUIP_SUBMIT_SUCCESS"
export const EQUIP_SUBMIT_FAILURE = "EQUIP_SUBMIT_FAILURE" export const EQUIP_SUBMIT_FAILURE = "EQUIP_SUBMIT_FAILURE"
export const EQUIP_INIT_DATA = "EQUIP_INIT_DATA" export const EQUIP_INIT_DATA = "EQUIP_INIT_DATA"
export const GET_SUB_DETAIL_OPTION = "GET_SUB_DETAIL_OPTION" export const GET_SUB_DETAIL_OPTION = "GET_SUB_DETAIL_OPTION"
export const GET_CHARGE_DETAILS_OPTION = "GET_CHARGE_DETAILS_OPTION"
//-----------historical order search--------------------- //-----------historical order search---------------------
export const HISTOR_ORDER_SEARCH_NO = "HISTOR_ORDER_SEARCH_NO" export const HISTOR_ORDER_SEARCH_NO = "HISTOR_ORDER_SEARCH_NO"
export const HISTOR_ORDER_SEARCH_DOING = "HISTOR_ORDER_SEARCH_DOING" export const HISTOR_ORDER_SEARCH_DOING = "HISTOR_ORDER_SEARCH_DOING"
......
// export const BaseUrl = "http://192.168.10.188:8200"; // https://obs.uat.sfrx.guke.tech https://sob-os.uat.sfrx.guke.tech export const BaseUrl = "https://obs.uat.guke.tech";
// export const BaseUrlOther = "http://192.168.10.188:8200"; //http://192.168.10.188:8200/v1/dingding/upload_media export const BaseUrlOther = "https://sob-os.uat.guke.tech";
// export const VERSION = '/v1'; // /api/latest export const VERSION = '/api/latest';
export const BaseUrl = "https://obs.uat.sfrx.guke.tech"; // https://obs.uat.sfrx.guke.tech https://sob-os.uat.sfrx.guke.tech
export const BaseUrlOther = "https://sob-os.uat.sfrx.guke.tech"; //http://192.168.10.188:8200/v1/dingding/upload_media
export const VERSION = '/api/latest'; //
export const ACCESS_TOKEN = '201904091445193616b5e3d3a777848dda1de1a8123d0fdf9xw7t566c1S92U88';//未获取到access_token时使用 export const ACCESS_TOKEN = '201904091445193616b5e3d3a777848dda1de1a8123d0fdf9xw7t566c1S92U88';//未获取到access_token时使用
// export let
\ No newline at end of file
...@@ -28,6 +28,7 @@ class PageListArrow extends Component { ...@@ -28,6 +28,7 @@ class PageListArrow extends Component {
isTitInputStyle: PropTypes.bool, isTitInputStyle: PropTypes.bool,
listMaxLines: PropTypes.number, // 文本最大行数 listMaxLines: PropTypes.number, // 文本最大行数
listIsAudio: PropTypes.bool, listIsAudio: PropTypes.bool,
listCellStyle: PropTypes.object
} }
constructor(props) { constructor(props) {
...@@ -46,7 +47,7 @@ class PageListArrow extends Component { ...@@ -46,7 +47,7 @@ class PageListArrow extends Component {
render() { render() {
let {listActOpa, listCallBack, listHasAster, listEditAble, listDefaValue, listItem, listTitle, let {listActOpa, listCallBack, listHasAster, listEditAble, listDefaValue, listItem, listTitle,
listName, listValue, listHasArrow, listOtherInput, otherInput, otherInputCallBack, listInputPlace, listName, listValue, listHasArrow, listOtherInput, otherInput, otherInputCallBack, listInputPlace,
inputCallBack, isTitInputStyle, listMaxLines, listIsAudio} = this.props inputCallBack, isTitInputStyle, listMaxLines, listIsAudio, listCellStyle} = this.props
if(!listMaxLines){ if(!listMaxLines){
listMaxLines = 2 // 默认 listMaxLines = 2 // 默认
} }
...@@ -56,7 +57,7 @@ class PageListArrow extends Component { ...@@ -56,7 +57,7 @@ class PageListArrow extends Component {
activeOpacity={listActOpa} activeOpacity={listActOpa}
onPress={() => {return listCallBack ? listCallBack() : ''}} onPress={() => {return listCallBack ? listCallBack() : ''}}
> >
<CellTextStyle> <CellTextStyle style={listCellStyle ? listCellStyle : ''}>
{ listHasAster ? <AsteriskTextStyle>*</AsteriskTextStyle> : null } { listHasAster ? <AsteriskTextStyle>*</AsteriskTextStyle> : null }
<TitleTextStyle style={isTitInputStyle ? styles.cell_title : ''}>{listItem[listTitle]}</TitleTextStyle> <TitleTextStyle style={isTitInputStyle ? styles.cell_title : ''}>{listItem[listTitle]}</TitleTextStyle>
{ (listEditAble || inputCallBack) ? <ContInputTextStyle { (listEditAble || inputCallBack) ? <ContInputTextStyle
......
...@@ -144,21 +144,18 @@ class EquipConsuPage extends Component { ...@@ -144,21 +144,18 @@ class EquipConsuPage extends Component {
title: '耗材明细', // 跳转 title: '耗材明细', // 跳转
btnTit: '+添加消耗明细', btnTit: '+添加消耗明细',
value: '', value: '',
isJumpSubPage: true, // 跳转子页
isShowSub: true, // 是否展示子项 isShowSub: true, // 是否展示子项
subOption: [ subOption: []
// {
// "id": "0",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// sale_price: '360000',
// select: true
// }
]
}, },
{ {
"id": "13", "id": "13",
title: '费用明细', // 跳转
btnTit: '+添加费用明细',
value: '',
subOption: []
},
{
"id": "14",
title: '添加图片', title: '添加图片',
value: '', value: '',
isAddImage: true, // 添加图片 isAddImage: true, // 添加图片
...@@ -192,11 +189,7 @@ class EquipConsuPage extends Component { ...@@ -192,11 +189,7 @@ class EquipConsuPage extends Component {
showTypePop: false, // 选择器弹窗 showTypePop: false, // 选择器弹窗
isSubLoding: false, // 加载中弹窗 isSubLoding: false, // 加载中弹窗
lodingTitle: '加载中', lodingTitle: '加载中',
listCurrentOption: [ // 当前选择器数据 listCurrentOption: [ // 当前选择器数据
// {
// name: '测试1',
// value: '测试1'
// }
], ],
dateModelPop: false, // 日期选择器 dateModelPop: false, // 日期选择器
sexTypeOption: [ // 性别 sexTypeOption: [ // 性别
...@@ -209,7 +202,6 @@ class EquipConsuPage extends Component { ...@@ -209,7 +202,6 @@ class EquipConsuPage extends Component {
} }
], ],
localPhoOption: [ // 添加的图片 localPhoOption: [ // 添加的图片
// 'file:///storage/emulated/0/Pictures/images/image-ea1a24b8-2d12-468f-ac23-e9aed20c6d31.jpg'
], ],
isShowImage: false, isShowImage: false,
currShowImgIndex: 0 currShowImgIndex: 0
...@@ -821,6 +813,15 @@ class EquipConsuPage extends Component { ...@@ -821,6 +813,15 @@ class EquipConsuPage extends Component {
} }
} }
// 费用明细 点击
handleChargeDetailsCheck() {
let { listOptionData } = this.state
this.props.navigation.navigate('ChargeDetailsPage', {
title: '器械消耗 - 添加明细',
// orderId: listOptionData[3].value
})
}
// 添加图片 点击 // 添加图片 点击
handleAddPicCheck() { handleAddPicCheck() {
let { localPhoOption, listOptionData } = this.state let { localPhoOption, listOptionData } = this.state
...@@ -905,7 +906,7 @@ class EquipConsuPage extends Component { ...@@ -905,7 +906,7 @@ class EquipConsuPage extends Component {
let {url} = imgResult.data let {url} = imgResult.data
localPhoOption.push(source); // 本地图片地址 localPhoOption.push(source); // 本地图片地址
listOptionData[13].uploadImgArr.push(url) // 服务器图片地址 listOptionData[14].uploadImgArr.push(url) // 服务器图片地址
that.setState({ that.setState({
localPhoOption, localPhoOption,
listOptionData listOptionData
...@@ -929,7 +930,7 @@ class EquipConsuPage extends Component { ...@@ -929,7 +930,7 @@ class EquipConsuPage extends Component {
handleDelPickCheck(item, index) { handleDelPickCheck(item, index) {
let {listOptionData, localPhoOption} = this.state let {listOptionData, localPhoOption} = this.state
localPhoOption.splice(index, 1) // 删除本地地址 localPhoOption.splice(index, 1) // 删除本地地址
listOptionData[13].uploadImgArr.splice(index, 1) // 删除服务器地址 listOptionData[14].uploadImgArr.splice(index, 1) // 删除服务器地址
this.setState({ this.setState({
listOptionData, listOptionData,
localPhoOption localPhoOption
...@@ -964,7 +965,7 @@ class EquipConsuPage extends Component { ...@@ -964,7 +965,7 @@ class EquipConsuPage extends Component {
return item return item
}) })
} }
tempSubOption.img_url = state.listOptionData[13].uploadImgArr.join(',') tempSubOption.img_url = state.listOptionData[14].uploadImgArr.join(',')
let params = { let params = {
access_token: props.token, access_token: props.token,
data: { ...tempSubOption } data: { ...tempSubOption }
...@@ -1312,57 +1313,22 @@ class EquipConsuPage extends Component { ...@@ -1312,57 +1313,22 @@ class EquipConsuPage extends Component {
{ {
state.listOptionData[12].subOption.length ? state.listOptionData[12].subOption.length ?
<View <View
// activeOpacity={1}
style={list_common_item.detail_sub_cont}> style={list_common_item.detail_sub_cont}>
<View style={list_common_item.detail_sub_tit}> <View style={list_common_item.detail_sub_tit}>
<Text style={list_common_item.detail_tit_text}> <Text style={list_common_item.detail_tit_text}>
耗材({state.listOptionData[12].subOption.length} 耗材({state.listOptionData[12].subOption.length}
</Text> </Text>
{/* {
state.listOptionData[12].isShowSub ?
<TouchableOpacity
activeOpacity={.8}
style={list_common_item.detail_icon}
onPress={() => this.handleDetailBtmCheck()}
>
<Image style={[icon_style, list_common_item.detail_top_icon]} source={require('../../images/arr_btm.png')} />
</TouchableOpacity> :
<TouchableOpacity
activeOpacity={.8}
style={[list_common_item.detail_icon, list_common_item.detail_icon_rig]}
onPress={() => this.handleDetailRigCheck()}
>
<Image style={[icon_style, list_common_item.detail_top_icon]} source={require('../../images/arr_rig.png')} />
</TouchableOpacity>
} */}
</View> </View>
{ {
state.listOptionData[12].isShowSub ? state.listOptionData[12].isShowSub ?
<View style={list_common_item.detail_sub_inner}> <View style={list_common_item.detail_sub_inner}>
{/* <ScrollView {state.listOptionData[12].subOption.map((item, index) => {
style={list_common_item.detail_scroll} return this.renderConDeSubItem(item, index)
onPress={() => {console.log('--触碰---')}} })}
onScrollBeginDrag={() => {console.log('--滚动---')}}
// showsVerticalScrollIndicator={false}
>
{
state.listOptionData[12].subOption.map((item, index) => {
return this.renderConDeSubItem(item, index)
})
}
</ScrollView> */}
{
state.listOptionData[12].subOption.map((item, index) => {
return this.renderConDeSubItem(item, index)
})
}
</View> : null </View> : null
} }
</View> : null </View> : null
} }
<View style={list_common_item.detail_footer}> <View style={list_common_item.detail_footer}>
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
...@@ -1394,6 +1360,27 @@ class EquipConsuPage extends Component { ...@@ -1394,6 +1360,27 @@ class EquipConsuPage extends Component {
) )
} }
// 返回费用明细
renderChargeDetailsItem() {
let { state } = this
return (
<CellTextStyle style={list_common_item.consu_detail}>
<View style={list_common_item.detail_inner}>
<Text style={list_common_item.detail_tit}>{state.listOptionData[13].title}</Text>
<View style={list_common_item.detail_footer}>
<TouchableOpacity
activeOpacity={.8}
style={list_common_item.detail_btn_box}
onPress = {() => this.handleChargeDetailsCheck()}
>
<Text style={list_common_item.detail_btn}>{state.listOptionData[13].btnTit}</Text>
</TouchableOpacity>
</View>
</View>
</CellTextStyle>
)
}
// 返回添加图片 // 返回添加图片
renderAddPicturesItem() { renderAddPicturesItem() {
let { state } = this let { state } = this
...@@ -1402,17 +1389,15 @@ class EquipConsuPage extends Component { ...@@ -1402,17 +1389,15 @@ class EquipConsuPage extends Component {
<View style={list_common_item.addpic_inner}> <View style={list_common_item.addpic_inner}>
<Text style={list_common_item.addpic_tit}>添加图片</Text> <Text style={list_common_item.addpic_tit}>添加图片</Text>
<View style={list_common_item.addpic_cont}> <View style={list_common_item.addpic_cont}>
{ {state.localPhoOption.length
state.localPhoOption.length ? state.localPhoOption.map((item, index) => this.renderPicItem(item, index) )
? state.localPhoOption.map((item, index) => this.renderPicItem(item, index) ) : null}
: null
}
<TouchableOpacity <TouchableOpacity
activeOpacity={.8} activeOpacity={.8}
style={list_common_item.addpic_img_btn} style={list_common_item.addpic_img_btn}
onPress={() => this.handleAddPicCheck()} onPress={() => this.handleAddPicCheck()}
> >
<Image style={icon_style} source={require('../../images/add_icon_large.png')} /> <Image style={icon_style} source={require('../../images/add_icon_large.png')} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
...@@ -1459,7 +1444,7 @@ class EquipConsuPage extends Component { ...@@ -1459,7 +1444,7 @@ class EquipConsuPage extends Component {
// }] // }]
// 正式 // 正式
let zoomImages = [] let zoomImages = []
listOptionData[13].uploadImgArr.forEach(item => { listOptionData[14].uploadImgArr.forEach(item => {
zoomImages.push({ zoomImages.push({
url: `${global_domain_config}/${item}` url: `${global_domain_config}/${item}`
}) })
...@@ -1503,6 +1488,7 @@ class EquipConsuPage extends Component { ...@@ -1503,6 +1488,7 @@ class EquipConsuPage extends Component {
{this.renderListItem()} {this.renderListItem()}
{this.renderRemarksItem()} {this.renderRemarksItem()}
{this.renderConsumablesDetailsItem()} {this.renderConsumablesDetailsItem()}
{this.renderChargeDetailsItem()}
{this.renderAddPicturesItem()} {this.renderAddPicturesItem()}
{this.renderZoomPicture()} {this.renderZoomPicture()}
<FooterBtnStyle <FooterBtnStyle
...@@ -1587,6 +1573,7 @@ const mapStateToProps = (state) => { ...@@ -1587,6 +1573,7 @@ const mapStateToProps = (state) => {
submit_equip_order_status: state.equip.submit_equip_order_status, submit_equip_order_status: state.equip.submit_equip_order_status,
equipOrderOption: state.equip.equipOrderOption, equipOrderOption: state.equip.equipOrderOption,
subDetOption: state.equip.subDetOption, subDetOption: state.equip.subDetOption,
charDetailOption: state.equip.charDetailOption,
global_domain_config: state.login.global_domain_config global_domain_config: state.login.global_domain_config
} }
} }
......
import React, { Component } from 'react';
import { View, Text, StyleSheet, SafeAreaView, TouchableOpacity, ScrollView, FlatList, TextInput } from 'react-native';
import { home_background_color, promary_color, safe_view, list_common_item, placehold_text_color, second_text_size, promary_text_color, font_family_regular, font_family_medium, font_family_semibold, first_text_color, foundation_color, Width, pxSize } from '../../../base/BaseStyle';
import { LOGIN_NO } from '../../../base/ActionTypes';
import StatusBarView from '../../common/StatusBarView';
import HeadBackItem from '../../common/HeadBackItem';
import DialogModel from '../../common/DialogModel';
import { show } from '../../../utils/Utils';
import { getCharDetailsOption } from '../../../action/EquipAction';
import { exitLoginStatus, requestSysValueSet } from '../../../action/LoginAction';
import { connect } from 'react-redux';
import PageListArrow from '../../common/listDataComponent/PageListArrow';
import { CellTextStyle } from '../../common/CellTextStyle';
// 费用明细
class ChargeDetailsPage extends Component {
constructor(props) {
super(props);
this.state = {
listOptionData: [ // 页面元素
{
title: '费用类型',
name: '请选择',
value: ''
}, {
title: '费用金额',
value: ''
}, {
title: '备注',
value: ''
}],
charDetaOption: [
{
fee_type_title: '费用类型',
fee_type_name: '请选择',
fee_amount_title: '费用金额',
remark_title: '备注',
fee_type: '',
fee_amount: '',
remark: ''
},
{
fee_type_title: '费用类型',
fee_type_name: '请选择',
fee_amount_title: '费用金额',
remark_title: '备注',
fee_type: '',
fee_amount: '',
remark: ''
},
// {
// fee_type: '', // SUR_FEE_TYPE
// fee_amount: '',
// remark: ''
// },
// {
// fee_type: '', // SUR_FEE_TYPE
// fee_amount: '',
// remark: ''
// }
],
listCurrentOption: [], // 当前选择器数据
showTypePop: false,
currentItem: {
name: '请选择',
value: '-1'
},
currentTitle: '费用类型', // 当前点击项
currentIndex: 0, // 当前点击项
}
}
componentDidMount() {
this.getLocalSelectedData()
this.getChargeType()
}
// 获取费用类型
async getChargeType() {
let { props } = this
let that = this
let params = {
access_token: props.token,
value_set_code: 'SUR_FEE_TYPE'
}
console.log('charRes---', props)
console.log('charRes---', params)
let charRes = await requestSysValueSet(props.global_domain_config, params)
console.log('charRes---', charRes)
// that.props.callSupLoading(true)
if (charRes.error_code == 0) {
// that.props.callSupLoading(false)
let { data: { sys_values } } = charRes
if (sys_values.length === 0) {
that.showErrorModel(`当前费用类型为空,联系管理员配置!`)
return
}
let resultArr = []
sys_values.forEach(item => {
let obj = {}
obj.name = item.value_name
obj.value = item.value_code
resultArr.push(obj)
})
tempOption = [...resultArr]
that.setState({
// showTypePop: true,
listCurrentOption: [...tempOption]
})
} else if (charRes.error_code == 41006) {
// that.props.callSupLoading(false)
that.showErrorModel(`登录过期,请重新登录`)
props.exitLoginStatus();
} else {
// that.props.callSupLoading(false)
let error_msg = charRes.error_msg || charRes.message
that.showErrorModel(error_msg);
}
}
// 获取选择的数据
getLocalSelectedData() {
let {charDetailOption} = this.props
// let {localSelectOption} = this.props.navigation.state.params
this.setState({
charDetaOption: charDetailOption
})
}
// 删除
handleDelListItem(curIndex) {
let _this = this
let { charDetaOption } = _this.state
console.log('curLent---', charDetaOption.length)
if(charDetaOption.length === 1){
show('至少添加一项费用明细!')
return
}
charDetaOption.splice(curIndex, 1)
_this.setState({
charDetaOption
})
}
// 增加
handleAddListItem() {
let _this = this
let { charDetaOption } = _this.state
console.log('curLent---', charDetaOption.length)
let lastLen = charDetaOption.length - 1
let lastOpts = charDetaOption[lastLen]
if(!lastOpts.fee_type.trim()){
show(`请选择费用明细(${lastLen+1})的【费用类型】!`)
return
}else if(!lastOpts.fee_amount.trim()){
show(`请输入费用明细(${lastLen+1})的【费用金额】!`)
return
}
charDetaOption.push({
fee_type_title: '费用类型',
fee_type_name: '请选择',
fee_amount_title: '费用金额',
remark_title: '备注',
fee_type: '',
fee_amount: '',
remark: ''
})
_this.setState({
charDetaOption
})
// let cur_len = 360*(charDetaOption.length - 2)
let cur_len = _this.curScrollItemY
console.log('cur_len===', cur_len)
console.log('cur_len===', _this.refs.curScrollItem)
console.log('cur_len===', _this.curScrollItemY)
console.log('cur_len===', _this._scrollDetailView)
// _this.refs._scrollDetailView.measure((fx, fy, width, height, px, py) => {
// console.log('Component width is: ' + width)
// console.log('Component height is: ' + height)
// console.log('X offset to frame: ' + fx)
// console.log('Y offset to frame: ' + fy)
// console.log('X offset to page: ' + px)
// console.log('Y offset to page: ' + py)
// //然后用scrollTo跳转到对应位置
// //x是水平方向
// //y是垂直方向
// // this.myScrollView.scrollTo({ x: px, y: py, animated: true });
// });
setTimeout(() => {
_this._scrollDetailView.scrollTo({x: cur_len, y: cur_len, animated: true})
}, 100)
}
// 设置费用类型
handleSetChargeType(curDa, curIndex) {
let _this = this
let {listCurrentOption} = _this.state
_this.setState({
currentIndex: curIndex,
currentItem: {
name: curDa.name,
value: curDa.value
}
},() => {
if (listCurrentOption && listCurrentOption.length === 0) {
show('当前数据为空!')
return
}
// 解决 IOS 弹窗显示问题
setTimeout(() => {
_this.handleCloseModal(true)
}, 500)
})
}
// 设置费用金额
handleSetChargePrice(curIndex, curText) {
let _this = this
let { charDetaOption } = _this.state
charDetaOption[curIndex].fee_amount = curText
_this.setState({
currentIndex: curIndex,
charDetaOption
})
}
// 设置费用备注
handleSetChargeMark(curIndex, curText) {
let _this = this
let { charDetaOption } = _this.state
charDetaOption[curIndex].remark = curText
_this.setState({
currentIndex: curIndex,
charDetaOption
})
}
// 选择器弹窗回调函数
handleCallBack(item, itemTitle) {
let _this = this
let { charDetaOption, currentIndex} = _this.state
console.log(item, itemTitle)
console.log(currentIndex)
charDetaOption[currentIndex].fee_type_name = item.name
charDetaOption[currentIndex].fee_type = item.value
this.setState({
charDetaOption
})
}
// 关闭 选择器弹窗
handleCloseModal(show) {
this.setState({
showTypePop: show
})
}
// 确认明细 点击
handleSubmit() {
let {charDetaOption} = this.state
// let canSubFlag = true
let {props} = this
console.log('charDetaOption-', charDetaOption)
// if(canSubFlag) {
// this.setState({
// charDetaOption
// })
// 存储于store中,并跳转
props.getCharDetailsOption(charDetaOption)
props.navigation.navigate('EquipConsuPage', { title: '器械消耗' })
// }
}
// 返回主要元素
renderContItem() {
return (
<ScrollView
style={styles.cons_cont_scroll}
ref={component => this._scrollDetailView = component}
// showsVerticalScrollIndicator={false}
>
<FlatList
style={styles.cons_cont}
keyExtractor={item => item.id}
data={this.state.charDetaOption}
extraData={this.state}
renderItem={({ item, index }) => this.renderSubListItem(item, index)}
/>
{this.renderAddBtnItem()}
</ScrollView>
)
}
// 返回每一列元素
renderSubListItem(item, index) {
let { listOptionData } = this.state
return (
<View style={styles.cons_sub_list}>
<View style={styles.cons_sub_inner}>
<View style={styles.sub_list_cont}>
<Text style={styles.sub_list_tit}>费用明细({index + 1})</Text>
<TouchableOpacity
activeOpacity={.8}
style={styles.btn_del_list}
onPress={() => this.handleDelListItem(index)}
>
<Text style={[styles.sub_list_tit, styles.sub_del_tit]}>删除</Text>
</TouchableOpacity>
</View>
<PageListArrow
listActOpa={.8}
listHasAster={true}
// listItem={listOptionData[0]}
// listName={'name'}
// listTitle={'title'}
listItem={item}
listName={'fee_type_name'}
listTitle={'fee_type_title'}
listCallBack={() => this.handleSetChargeType(item, index)}
listHasArrow={true}
listCellStyle={styles.list_cell_box}
/>
<PageListArrow
listActOpa={.8}
listHasAster={true}
// listItem={listOptionData[1]}
// listDefaValue={'value'}
// listTitle={'title'}
listItem={item}
listDefaValue={'fee_amount'}
listTitle={'fee_amount_title'}
listInputPlace={'请输入'}
inputCallBack={(text) => this.handleSetChargePrice(index, text)}
isTitInputStyle={true}
listCellStyle={styles.list_cell_box}
/>
<CellTextStyle style={[list_common_item.remark_item, styles.list_cell_box]}>
<View style={list_common_item.rema_box}>
<Text style={list_common_item.rema_tit}>{item.remark_title}</Text>
<View style={list_common_item.rema_Input_outer} >
<TouchableOpacity activeOpacity={1} style={list_common_item.rema_Input_inner} onPress={() => this.TextInput.focus()} >
<TextInput
placeholder={`请输入${item.remark_title}信息`}
placeholderTextColor={placehold_text_color}
underlineColorAndroid={'transparent'}
multiline={true}
ref={textInput => this.TextInput = textInput}
numberOfLines={8}
style={list_common_item.rema_Input}
maxLength={140}
onChangeText={(text) => this.handleSetChargeMark(index, text)}
defaultValue={item.remark}
/>
</TouchableOpacity>
</View>
</View>
</CellTextStyle>
</View>
</View>
)
}
// 返回增加元素
renderAddBtnItem() {
return (
<View style={[styles.add_btn_box]} ref={'curScrollItem'} onLayout={e=>{this.curScrollItemY = e.nativeEvent.layout.y}}>
<View style={[styles.add_btn_inner]}>
<TouchableOpacity
activeOpacity={.8}
style={[styles.sub_list_tit, styles.add_btn_cont]}
onPress={() => this.handleAddListItem()}
>
<Text style={[styles.sub_list_tit, styles.sub_del_tit, styles.add_btn_txt]}>{'+添加'}</Text>
</TouchableOpacity>
</View>
{ this.renderPickerModel()}
</View>
)
}
// 返回底部元素
renderFooterBtnItem() {
return (
<View style={list_common_item.sub_box}>
<View style={list_common_item.sub_two_btn}>
<TouchableOpacity
activeOpacity={.8}
style={[list_common_item.rig_btn, styles.fot_btn]}
onPress={() => this.handleSubmit()}
>
<Text style={list_common_item.rig_tip}>{'确定费用'}</Text>
</TouchableOpacity>
</View>
</View>
)
}
// 返回选择器
renderPickerModel() {
let {
listCurrentOption,
currentItem,
currentTitle,
showTypePop,
} = this.state
return (
<SafeAreaView style={styles.item_container}>
<DialogModel
entityList={listCurrentOption}
callback={(item, itemTitle) => this.handleCallBack(item, itemTitle)}
show={showTypePop}
itemValue={currentItem.value}
itemTitle={currentTitle}
closeModal={(show) => this.handleCloseModal(show)}
/>
</SafeAreaView>
)
}
render() {
let { navigation } = this.props
let { title } = navigation.state.params
return (
<View style={styles.cu_dl_container}>
<StatusBarView
isReactStackNavigator={true}
backgroundColor={promary_color}
barStyle='light-content'
/>
<SafeAreaView style={safe_view}>
<HeadBackItem title={title} navigation={navigation} />
<View style={styles.cu_dl_main}>
{this.renderContItem()}
</View>
{this.renderFooterBtnItem()}
</SafeAreaView>
</View>
);
}
}
const styles = StyleSheet.create({
cu_dl_container: {
flex: 1,
backgroundColor: home_background_color,
padding: 0,
margin: 0
},
cu_dl_main: {
flex: 1
},
cons_cont_scroll: {},
cons_cont: {
paddingHorizontal: 20
},
cons_sub_list: {
backgroundColor: foundation_color,
borderRadius: 10,
marginVertical: 16,
paddingTop: 16
// marginVertical: 10,
// padding: 10,
// borderColor: '#FFF',
// borderWidth: 10
},
cons_sub_inner: {
// backgroundColor: home_background_color,
},
sub_list_cont: {
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-between',
marginHorizontal: 20,
paddingBottom: 10,
borderBottomWidth: 1,
borderColor: 'rgba(241, 241, 241, 0.87)',
backgroundColor: foundation_color,
},
sub_list_tit: {
fontSize: second_text_size,
fontFamily: font_family_semibold,
color: first_text_color
},
sub_del_tit: {
color: promary_color
},
cont_tit: {
fontSize: second_text_size,
color: promary_text_color,
fontFamily: font_family_regular
},
cont_ser: {
fontSize: 14,
color: '#A3A3A3',
fontFamily: font_family_regular
},
cont_pri: {
flexDirection: 'row',
alignItems: 'center'
},
pri_icon: {
color: '#EC3A2E',
fontSize: 16,
fontFamily: font_family_medium
},
pri_inner: {
fontFamily: font_family_medium,
fontSize: second_text_size,
color: promary_text_color
},
cont_pri_box: {
flex: 1,
paddingRight: 20
},
pri_txt: {
fontFamily: font_family_medium,
fontSize: second_text_size,
color: promary_text_color
},
fot_btn: {
width: '100%',
borderRadius: 10
},
list_cell_box: {
marginBottom: 0,
borderBottomWidth: 1,
borderColor: 'rgba(241, 241, 241, 0.87)',
backgroundColor: foundation_color,
paddingHorizontal: 0,
marginHorizontal: 20
},
add_btn_box: {
marginHorizontal: 20
// width: Width() - 40,
// // marginLeft: 10
// marginHorizontal: 20,
// height: 60,
// marginBottom: 16,
// backgroundColor: null
},
add_btn_inner: {
// width: Width() - 40,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: foundation_color,
marginBottom: 30,
borderRadius: 10,
},
add_btn_cont: {
// textAlign: 'center'
},
add_btn_txt: {
height: 46,
lineHeight: 46
}
})
const mapStateToProps = (state) => {
return {
token: state.login.token,
global_domain_config: state.login.global_domain_config,
charDetailOption: state.equip.charDetailOption
}
}
const mapDispatchToProps = (dispatch) => {
return {
exitLoginStatus: () => {
dispatch(exitLoginStatus())
},
getCharDetailsOption: (data) => {
dispatch(getCharDetailsOption(data))
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(ChargeDetailsPage);
\ No newline at end of file
...@@ -34,20 +34,13 @@ import { exitLoginStatus } from '../../../action/LoginAction'; ...@@ -34,20 +34,13 @@ import { exitLoginStatus } from '../../../action/LoginAction';
const CONSUM_SEARCH_VALUE_BAR_CODE = 'CONSUM_SEARCH_VALUE_BAR_CODE'; const CONSUM_SEARCH_VALUE_BAR_CODE = 'CONSUM_SEARCH_VALUE_BAR_CODE';
// 耗材明细
class ConsumDetailsPage extends Component { class ConsumDetailsPage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
searchValue: '', searchValue: '',
conDetaOption: [ conDetaOption: [],
// {
// "id": "0",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: false
// }
],
allConOption: [], // 所有数据(未筛选过的) allConOption: [], // 所有数据(未筛选过的)
selectShowPopup: false, // 共计已选弹窗 selectShowPopup: false, // 共计已选弹窗
localSelectOption: [], // 已选数据 localSelectOption: [], // 已选数据
......
...@@ -18,7 +18,7 @@ import { show } from '../../../utils/Utils'; ...@@ -18,7 +18,7 @@ import { show } from '../../../utils/Utils';
import { getSubdetailOption } from '../../../action/EquipAction'; import { getSubdetailOption } from '../../../action/EquipAction';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
// 可填写单价
class FillUnitPricePage extends Component { class FillUnitPricePage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
......
...@@ -18,7 +18,7 @@ import { show } from '../../../utils/Utils'; ...@@ -18,7 +18,7 @@ import { show } from '../../../utils/Utils';
import { getSubdetailOption } from '../../../action/EquipAction'; import { getSubdetailOption } from '../../../action/EquipAction';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
// 仅展示明细
class ShowDetailPage extends Component { class ShowDetailPage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -44,7 +44,6 @@ class ShowDetailPage extends Component { ...@@ -44,7 +44,6 @@ class ShowDetailPage extends Component {
// 获取选择的数据 // 获取选择的数据
getLocalSelectedData() { getLocalSelectedData() {
let {localSelectOption} = this.props.navigation.state.params let {localSelectOption} = this.props.navigation.state.params
console.log('localSelectOption----', localSelectOption)
this.setState({ this.setState({
unitPriceOption: localSelectOption unitPriceOption: localSelectOption
}) })
...@@ -192,9 +191,6 @@ const styles = StyleSheet.create({ ...@@ -192,9 +191,6 @@ const styles = StyleSheet.create({
fontSize: second_text_size, fontSize: second_text_size,
color: promary_text_color color: promary_text_color
}, },
fot_btn: { fot_btn: {
width: '100%', width: '100%',
borderRadius: 10 borderRadius: 10
......
// import {BaseUrl, BaseUrlOther, VERSION} from '../base/BaseConstants';
import {VERSION} from '../base/BaseConstants'; import {VERSION} from '../base/BaseConstants';
//post方式请求 //post方式请求
...@@ -18,6 +17,7 @@ export const PostRequest = (BaseUrl, url, paramsObject) => { ...@@ -18,6 +17,7 @@ export const PostRequest = (BaseUrl, url, paramsObject) => {
.then(response => response.json()) .then(response => response.json())
.then(data => data) .then(data => data)
.catch(error => { .catch(error => {
console.error(error)
return {error_code: -3, error_msg:'请求异常,请重试'} return {error_code: -3, error_msg:'请求异常,请重试'}
}) })
} }
...@@ -36,6 +36,7 @@ export const GetRequest = (BaseUrl, url) => { ...@@ -36,6 +36,7 @@ export const GetRequest = (BaseUrl, url) => {
.then(response => response.json()) .then(response => response.json())
.then(data => data) .then(data => data)
.catch(error => { .catch(error => {
console.error(error)
return {error_code: -3, error_msg:'请求异常,请重试'} return {error_code: -3, error_msg:'请求异常,请重试'}
}) })
}; };
...@@ -54,6 +55,7 @@ export const UploadRequest = (BaseUrl, url,datas) => { ...@@ -54,6 +55,7 @@ export const UploadRequest = (BaseUrl, url,datas) => {
.then(response => response.json()) .then(response => response.json())
.then(data => data) .then(data => data)
.catch(error => { .catch(error => {
console.error(error)
return {error_code: -3, error_msg:'请求异常,请重试'} return {error_code: -3, error_msg:'请求异常,请重试'}
}) })
}; };
\ No newline at end of file
...@@ -8,7 +8,8 @@ import { ...@@ -8,7 +8,8 @@ import {
EQUIP_SUBMIT_SUCCESS, EQUIP_SUBMIT_SUCCESS,
EQUIP_SUBMIT_FAILURE, EQUIP_SUBMIT_FAILURE,
EQUIP_INIT_DATA, EQUIP_INIT_DATA,
GET_SUB_DETAIL_OPTION GET_SUB_DETAIL_OPTION,
GET_CHARGE_DETAILS_OPTION
} from '../../base/ActionTypes'; } from '../../base/ActionTypes';
// 器械消耗状态 // 器械消耗状态
...@@ -17,6 +18,7 @@ const defaultState = { ...@@ -17,6 +18,7 @@ const defaultState = {
submit_equip_order_status: EQUIP_SUBMIT_NO, // 提交订单状态 submit_equip_order_status: EQUIP_SUBMIT_NO, // 提交订单状态
equipOrderOption: {}, // 当前选择器临时存储数据 equipOrderOption: {}, // 当前选择器临时存储数据
subDetOption: [], // 选择的消耗明细数据 subDetOption: [], // 选择的消耗明细数据
charDetailOption: [], // 选择的费用明细数据
} }
export default equip = (state = defaultState, action) => { export default equip = (state = defaultState, action) => {
...@@ -54,11 +56,16 @@ export default equip = (state = defaultState, action) => { ...@@ -54,11 +56,16 @@ export default equip = (state = defaultState, action) => {
equip_list_status: EQUIP_CONSU_LIST_NO, equip_list_status: EQUIP_CONSU_LIST_NO,
submit_equip_order_status: EQUIP_SUBMIT_NO, submit_equip_order_status: EQUIP_SUBMIT_NO,
equipOrderOption: {}, equipOrderOption: {},
subDetOption: [] subDetOption: [],
charDetailOption: []
}) })
case GET_SUB_DETAIL_OPTION: case GET_SUB_DETAIL_OPTION:
return Object.assign({}, state, { return Object.assign({}, state, {
subDetOption: action.rawData subDetOption: action.rawData
})
case GET_CHARGE_DETAILS_OPTION:
return Object.assign({}, state, {
charDetailOption: action.rawData
}) })
default: default:
return state; return state;
......
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