Commit e39b2ef1 by Denglingling

调整器械消耗模块,“费用明细”提交、以及“消耗明细”的布局

parent b0ecec3d
......@@ -8,8 +8,8 @@ import {
EQUIP_SUBMIT_DOING,
EQUIP_SUBMIT_SUCCESS,
EQUIP_SUBMIT_FAILURE,
GET_SUB_DETAIL_OPTION,
GET_CHARGE_DETAILS_OPTION,
SET_SUB_DETAIL_OPTION,
SET_CHARGE_DETAILS_OPTION,
EQUIP_INIT_DATA
} from '../base/ActionTypes';
......@@ -21,6 +21,7 @@ export function requestEquipOrganizations(params) {
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/authorized_inventory/search', params))
.then(res => {
console.log('获取组织 res=====', res)
if(res.error_code == 0) {
let { data: { organizations } } = res
dispatch(requestListDataSuccess(organizations));
......@@ -48,6 +49,7 @@ export function requestEquipSurgeryHospital(params) {
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/sale/seller_customer/search', params))
.then(res => {
console.log('获取客户名称 res=====', res)
if(res.error_code == 0) {
let { data: { customers } } = res
dispatch(requestListDataSuccess(customers));
......@@ -79,7 +81,7 @@ export function requestEquipOrderInfo(params) {
let {global_domain_config} = getState().login
GetRequest(global_domain_config, getUrlParams('/surgery/collect_order/search', params))
.then(res => {
console.log('res===', res)
console.log('获取订单信息 res=====', res)
if(res.error_code == 0) {
let { data: { surgery_collect_headers } } = res
dispatch(requestListDataSuccess(surgery_collect_headers));
......@@ -124,17 +126,17 @@ function requestListDataFail() {
}
// 设置当前临时存储的明细
export function getSubdetailOption(data) {
export function setSubdetailOption(data) {
return {
type: GET_SUB_DETAIL_OPTION,
type: SET_SUB_DETAIL_OPTION,
rawData: data
}
}
// 设置当前费用明细
export function getCharDetailsOption(data) {
export function setCharDetailsOption(data) {
return {
type: GET_CHARGE_DETAILS_OPTION,
type: SET_CHARGE_DETAILS_OPTION,
rawData: data
}
}
......@@ -157,6 +159,7 @@ export function requestEquipSumbit({access_token, ...params}) {
let {global_domain_config} = getState().login
PostRequest(global_domain_config, getUrlParams('/surgery/consume_order/create', {access_token: access_token}), params)
.then(res => {
console.log('提交数据 res=====', res)
if(res.error_code == 0) {
dispatch(requestSubmitSuccess(res));
} else if(res.error_code === 41006) {
......
......@@ -38,8 +38,8 @@ export const EQUIP_SUBMIT_DOING = "EQUIP_SUBMIT_DOING"
export const EQUIP_SUBMIT_SUCCESS = "EQUIP_SUBMIT_SUCCESS"
export const EQUIP_SUBMIT_FAILURE = "EQUIP_SUBMIT_FAILURE"
export const EQUIP_INIT_DATA = "EQUIP_INIT_DATA"
export const GET_SUB_DETAIL_OPTION = "GET_SUB_DETAIL_OPTION"
export const GET_CHARGE_DETAILS_OPTION = "GET_CHARGE_DETAILS_OPTION"
export const SET_SUB_DETAIL_OPTION = "SET_SUB_DETAIL_OPTION"
export const SET_CHARGE_DETAILS_OPTION = "SET_CHARGE_DETAILS_OPTION"
//-----------historical order search---------------------
export const HISTOR_ORDER_SEARCH_NO = "HISTOR_ORDER_SEARCH_NO"
export const HISTOR_ORDER_SEARCH_DOING = "HISTOR_ORDER_SEARCH_DOING"
......
......@@ -2,4 +2,12 @@ export const BaseUrl = "https://obs.uat.guke.tech";
export const BaseUrlOther = "https://sob-os.uat.guke.tech";
export const VERSION = '/api/latest';
export const ACCESS_TOKEN = '201904091445193616b5e3d3a777848dda1de1a8123d0fdf9xw7t566c1S92U88';//未获取到access_token时使用
// export let
\ No newline at end of file
export let OBS_MOBILE_EQU_CON_DISPLAY_PRICE = 'N'
/**
* 设置耗材明细单价权限
* @param {String} price_flag 'Y'/'N'
*/
export const setEquConDisplayPrice = (price_flag) => {
OBS_MOBILE_EQU_CON_DISPLAY_PRICE = price_flag
}
......@@ -44,6 +44,10 @@ export const text_default_color = "#01B2B9"; // 默认颜色
export const text_audit_color = "#FF0000"; // 拒绝颜色
export const text_return_color = "#007EFF"; // 归还颜色
export const text_other_color = "#F4B61B"; // 其他颜色
export const list_tit_color = 'rgba(0, 0, 0, 0.87)'; // 列表标题颜色
export const list_str_color = "#0CB4E8"; // 列表加粗颜色
export const list_one_color = "#1B40B5"; // 列表一级颜色
export const list_thr_color = "#3B4C82"; // 列表其他颜色
// 字号
export const first_text_size = 20; // 一级字号
......@@ -269,10 +273,13 @@ export const list_common_item = {
marginBottom: 10
},
de_sub_tit: {
color: second_text_color
color: first_text_color,
fontSize: 14
},
de_tip: {
color: second_text_color
color: second_text_color,
fontSize: 12,
lineHeight: 18
},
detail_btn_box: {
backgroundColor: promary_color,
......
import React, { Component } from 'react';
import {
View,
Text,
StyleSheet,
SafeAreaView,
ScrollView,
Image,
TouchableOpacity,
TextInput,
Platform,
Alert,
Linking
} from 'react-native';
import {
home_background_color,
promary_color,
safe_view,
icon_style,
placehold_text_color,
first_text_color,
font_family_regular,
pxSize,
list_common_item
} from '../../base/BaseStyle';
import { View, Text, StyleSheet, SafeAreaView, ScrollView, Image, TouchableOpacity, TextInput, Platform, Alert, Linking } from 'react-native';
import { home_background_color, promary_color, safe_view, icon_style, placehold_text_color, first_text_color, font_family_regular, pxSize, list_common_item } from '../../base/BaseStyle';
import StatusBarView from '../common/StatusBarView';
import HeadBackItem from '../common/HeadBackItem';
import {
FooterBtnStyle,
ImageTextStyle,
CellTextStyle,
AsteriskTextStyle,
TitleTextStyle,
ContInputTextStyle,
ContTextStyle
} from '../common/CellTextStyle';
import { FooterBtnStyle, ImageTextStyle, CellTextStyle, AsteriskTextStyle, TitleTextStyle, ContInputTextStyle, ContTextStyle } from '../common/CellTextStyle';
import { connect } from 'react-redux';
import { dedupQuoteArray, show, formatStrForDate, cloneObject } from '../../utils/Utils';
import DateModel from '../common/DateModel';
import DialogModel from '../common/DialogModel';
import ZoomPictureModel from '../common/ZoomPictureModel';
import {
requestEquipOrganizations,
requestEquipSurgeryHospital,
requestEquipOrderInfo,
uploadEquipImg,
getSubdetailOption,
requestEquipSumbit,
setEquipInitData,
reqEquipSurgeryHospital,
reqEquipOrderInfo,
requestListDataSuccess
} from '../../action/EquipAction';
import {
EQUIP_CONSU_LIST_DOING,
EQUIP_CONSU_LIST_SUCCESS,
EQUIP_CONSU_LIST_FAILURE,
LOGIN_NO,
EQUIP_SUBMIT_DOING,
EQUIP_SUBMIT_SUCCESS,
EQUIP_SUBMIT_FAILURE
} from '../../base/ActionTypes';
import { requestEquipOrganizations, requestEquipSurgeryHospital, requestEquipOrderInfo, uploadEquipImg, setSubdetailOption, setCharDetailsOption, requestEquipSumbit, setEquipInitData, reqEquipSurgeryHospital, reqEquipOrderInfo, requestListDataSuccess } from '../../action/EquipAction';
import { EQUIP_CONSU_LIST_DOING, EQUIP_CONSU_LIST_SUCCESS, EQUIP_CONSU_LIST_FAILURE, LOGIN_NO, EQUIP_SUBMIT_DOING, EQUIP_SUBMIT_SUCCESS, EQUIP_SUBMIT_FAILURE } from '../../base/ActionTypes';
import moment from 'moment';
import ImagePicker from 'react-native-image-picker';
import { exitLoginStatus } from '../../action/LoginAction';
import LodingModel from '../common/LodingModel';
import { OBS_MOBILE_EQU_CON_DISPLAY_PRICE } from '../../base/BaseConstants';
class EquipConsuPage extends Component {
constructor(props) {
......@@ -152,6 +104,7 @@ class EquipConsuPage extends Component {
title: '费用明细', // 跳转
btnTit: '+添加费用明细',
value: '',
isShowSub: true, // 是否展示子项
subOption: []
},
{
......@@ -176,6 +129,7 @@ class EquipConsuPage extends Component {
remark: '', // 备注信息
lines: [], // 消耗明细
img_url: '', // 图片路径,逗号分割
fee_lines: [], // 费用明细
},
currentItem: {
name: '请选择',
......@@ -210,6 +164,7 @@ class EquipConsuPage extends Component {
componentDidMount() {
this.getSellerName()
this.initSetOptsValue()
}
// 赋值销售员
......@@ -233,8 +188,15 @@ class EquipConsuPage extends Component {
}
}
// 初始化数据
initSetOptsValue(){
let {props} = this
props.setSubdetailOption([])
props.setCharDetailsOption([])
}
componentWillReceiveProps(nextProps) {
let { equip_list_status, loginState, navigation, subDetOption, submit_equip_order_status} = this.props
let { equip_list_status, loginState, navigation, subDetOption, charDetailOption, submit_equip_order_status} = this.props
let self = this
if(equip_list_status != nextProps.equip_list_status) {
switch (nextProps.equip_list_status) {
......@@ -274,6 +236,13 @@ class EquipConsuPage extends Component {
self.changeCanSub()
})
}
if(charDetailOption != nextProps.charDetailOption){
let {listOptionData} = this.state
listOptionData[13].subOption = nextProps.charDetailOption
this.setState({
listOptionData
})
}
if(submit_equip_order_status != nextProps.submit_equip_order_status) {
switch (nextProps.submit_equip_order_status) {
case EQUIP_SUBMIT_DOING:
......@@ -322,12 +291,12 @@ class EquipConsuPage extends Component {
}
// 清空耗材明细
listOptionData[12].subOption = []
props.getSubdetailOption([])
props.setSubdetailOption([])
}
if(index == curIndex && curIndex == 3) {
// 清空耗材明细
listOptionData[12].subOption = []
props.getSubdetailOption([])
props.setSubdetailOption([])
}
return item
})
......@@ -572,7 +541,6 @@ class EquipConsuPage extends Component {
customer_code: state.listOptionData[2].value,
collect_header_status: 'RETURNED,COLLECTED'
}
console.log('params----', params)
props.requestEquipOrderInfo(params)
})
}
......@@ -904,7 +872,6 @@ class EquipConsuPage extends Component {
// 提交订单
show('上传成功');
let {url} = imgResult.data
localPhoOption.push(source); // 本地图片地址
listOptionData[14].uploadImgArr.push(url) // 服务器图片地址
that.setState({
......@@ -941,7 +908,6 @@ class EquipConsuPage extends Component {
// 生成订单 点击
handleSubmit() {
// console.warn('生成订单------check')
this.changeCanSub(true)
let { state, props } = this
......@@ -959,6 +925,19 @@ class EquipConsuPage extends Component {
// tempSubOption.settled_flag = state.listOptionData[10].isRedio
tempSubOption.remark = state.listOptionData[11].value
tempSubOption.lines = state.listOptionData[12].subOption
if(state.listOptionData[13].subOption && state.listOptionData[13].subOption.length > 0){
tempSubOption.fee_lines = []
state.listOptionData[13].subOption.forEach(item => {
if(item.fee_amount && item.fee_type){
let obj_val = {
fee_amount : item.fee_amount,
fee_type : item.fee_type,
remark: item.remark
}
tempSubOption.fee_lines.push(obj_val)
}
})
}
if( tempSubOption.lines.length ) {
tempSubOption.lines = tempSubOption.lines.map(item => {
item['consumed_quantity'] = 1
......@@ -970,6 +949,7 @@ class EquipConsuPage extends Component {
access_token: props.token,
data: { ...tempSubOption }
}
console.log('==params====', params)
props.requestEquipSumbit(params)
}
}
......@@ -1347,15 +1327,16 @@ class EquipConsuPage extends Component {
renderConDeSubItem(item, index) {
return(
<View style={list_common_item.con_de_sub} key={index}>
<Text style={list_common_item.de_sub_tit}>
{index+1}{ item.item_name } - {item.specification}
<Text style={[list_common_item.de_sub_tit]}>
{index+1}[ { item.item_name } ] - {item.specification}
</Text>
<Text style={list_common_item.de_tip}>
序列号:{ item.serial_number }
</Text>
{/* <Text style={list_common_item.de_tip}>
{ OBS_MOBILE_EQU_CON_DISPLAY_PRICE === 'Y' ?
<Text style={list_common_item.de_tip}>
单价(¥){ item.sale_price }
</Text> */}
</Text> : null }
</View>
)
}
......@@ -1367,6 +1348,25 @@ class EquipConsuPage extends Component {
<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>
{
state.listOptionData[13].subOption.length ?
<View
style={list_common_item.detail_sub_cont}>
<View style={list_common_item.detail_sub_tit}>
<Text style={list_common_item.detail_tit_text}>
费用({state.listOptionData[13].subOption.length}
</Text>
</View>
{
state.listOptionData[13].isShowSub ?
<View style={list_common_item.detail_sub_inner}>
{state.listOptionData[13].subOption.map((item, index) => {
return this.renderChargeSubItem(item, index)
})}
</View> : null
}
</View> : null
}
<View style={list_common_item.detail_footer}>
<TouchableOpacity
activeOpacity={.8}
......@@ -1381,6 +1381,20 @@ class EquipConsuPage extends Component {
)
}
// 返回费用明细子项
renderChargeSubItem(item, index) {
return(
<View style={list_common_item.con_de_sub} key={index}>
<Text style={[list_common_item.de_sub_tit]}>
{index+1}{ item.fee_type_name }
</Text>
<Text style={list_common_item.de_tip}>
{item.fee_amount_title}{ item.fee_amount }
</Text>
</View>
)
}
// 返回添加图片
renderAddPicturesItem() {
let { state } = this
......@@ -1592,8 +1606,11 @@ const mapDispatchToProps = (dispatch) => {
exitLoginStatus: () => {
dispatch(exitLoginStatus())
},
getSubdetailOption: (data) => {
dispatch(getSubdetailOption(data))
setSubdetailOption: (data) => {
dispatch(setSubdetailOption(data))
},
setCharDetailsOption: (data) => {
dispatch(setCharDetailsOption(data))
},
requestEquipSumbit: (params) => {
dispatch(requestEquipSumbit(params))
......
......@@ -5,30 +5,19 @@ 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 { cloneObject, show } from '../../../utils/Utils';
import { setCharDetailsOption } 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';
import LoadingModel from '../../common/listDataComponent/LoadingModel';
// 费用明细
class ChargeDetailsPage extends Component {
constructor(props) {
super(props);
this.state = {
listOptionData: [ // 页面元素
{
title: '费用类型',
name: '请选择',
value: ''
}, {
title: '费用金额',
value: ''
}, {
title: '备注',
value: ''
}],
charDetaOption: [
{
fee_type_title: '费用类型',
......@@ -38,26 +27,7 @@ class ChargeDetailsPage extends Component {
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,
......@@ -73,7 +43,6 @@ class ChargeDetailsPage extends Component {
componentDidMount() {
this.getLocalSelectedData()
this.getChargeType()
}
// 获取费用类型
......@@ -84,13 +53,11 @@ class ChargeDetailsPage extends Component {
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)
console.log('获取费用类型 res==', charRes)
that.refs.LoadingModel.show()
if (charRes.error_code == 0) {
// that.props.callSupLoading(false)
that.refs.LoadingModel.hide()
let { data: { sys_values } } = charRes
if (sys_values.length === 0) {
that.showErrorModel(`当前费用类型为空,联系管理员配置!`)
......@@ -105,15 +72,14 @@ class ChargeDetailsPage extends Component {
})
tempOption = [...resultArr]
that.setState({
// showTypePop: true,
listCurrentOption: [...tempOption]
})
} else if (charRes.error_code == 41006) {
// that.props.callSupLoading(false)
that.refs.LoadingModel.hide()
that.showErrorModel(`登录过期,请重新登录`)
props.exitLoginStatus();
} else {
// that.props.callSupLoading(false)
that.refs.LoadingModel.hide()
let error_msg = charRes.error_msg || charRes.message
that.showErrorModel(error_msg);
}
......@@ -122,17 +88,17 @@ class ChargeDetailsPage extends Component {
// 获取选择的数据
getLocalSelectedData() {
let {charDetailOption} = this.props
// let {localSelectOption} = this.props.navigation.state.params
if(charDetailOption && charDetailOption.length > 0){
this.setState({
charDetaOption: charDetailOption
charDetaOption: cloneObject(charDetailOption)
})
}
}
// 删除
handleDelListItem(curIndex) {
let _this = this
let { charDetaOption } = _this.state
console.log('curLent---', charDetaOption.length)
if(charDetaOption.length === 1){
show('至少添加一项费用明细!')
return
......@@ -147,7 +113,6 @@ class ChargeDetailsPage extends Component {
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()){
......@@ -169,27 +134,9 @@ class ChargeDetailsPage extends Component {
_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)
}
......@@ -201,8 +148,8 @@ class ChargeDetailsPage extends Component {
_this.setState({
currentIndex: curIndex,
currentItem: {
name: curDa.name,
value: curDa.value
name: curDa.fee_type_name,
value: curDa.fee_type
}
},() => {
if (listCurrentOption && listCurrentOption.length === 0) {
......@@ -242,8 +189,6 @@ class ChargeDetailsPage extends Component {
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({
......@@ -262,17 +207,27 @@ class ChargeDetailsPage extends Component {
// 确认明细 点击
handleSubmit() {
let {charDetaOption} = this.state
// let canSubFlag = true
let canSubFlag = true
let {props} = this
console.log('charDetaOption-', charDetaOption)
// if(canSubFlag) {
// this.setState({
// charDetaOption
// })
for(let i in charDetaOption) {
if(!charDetaOption[i].fee_type) {
show(`请选择费用明细(${1+i*1})的【费用类型】!`)
canSubFlag = false
break
}else if(!charDetaOption[i].fee_amount.trim()) {
show(`请输入费用明细(${1+i*1})的【费用金额】!`)
canSubFlag = false
break
}
}
if(canSubFlag) {
this.setState({
charDetaOption
})
// 存储于store中,并跳转
props.getCharDetailsOption(charDetaOption)
props.setCharDetailsOption(charDetaOption)
props.navigation.navigate('EquipConsuPage', { title: '器械消耗' })
// }
}
}
// 返回主要元素
......@@ -291,15 +246,15 @@ class ChargeDetailsPage extends Component {
renderItem={({ item, index }) => this.renderSubListItem(item, index)}
/>
{this.renderAddBtnItem()}
{ this.renderLodingItem()}
</ScrollView>
)
}
// 返回每一列元素
renderSubListItem(item, index) {
let { listOptionData } = this.state
return (
<View style={styles.cons_sub_list}>
<View style={styles.cons_sub_list} key={index+'_im'}>
<View style={styles.cons_sub_inner}>
<View style={styles.sub_list_cont}>
<Text style={styles.sub_list_tit}>费用明细({index + 1})</Text>
......@@ -314,9 +269,6 @@ class ChargeDetailsPage extends Component {
<PageListArrow
listActOpa={.8}
listHasAster={true}
// listItem={listOptionData[0]}
// listName={'name'}
// listTitle={'title'}
listItem={item}
listName={'fee_type_name'}
listTitle={'fee_type_title'}
......@@ -327,9 +279,6 @@ class ChargeDetailsPage extends Component {
<PageListArrow
listActOpa={.8}
listHasAster={true}
// listItem={listOptionData[1]}
// listDefaValue={'value'}
// listTitle={'title'}
listItem={item}
listDefaValue={'fee_amount'}
listTitle={'fee_amount_title'}
......@@ -401,12 +350,7 @@ class ChargeDetailsPage extends Component {
// 返回选择器
renderPickerModel() {
let {
listCurrentOption,
currentItem,
currentTitle,
showTypePop,
} = this.state
let { listCurrentOption, currentItem, currentTitle, showTypePop } = this.state
return (
<SafeAreaView style={styles.item_container}>
<DialogModel
......@@ -421,6 +365,13 @@ class ChargeDetailsPage extends Component {
)
}
// 返回加载中
renderLodingItem() {
return (
<LoadingModel ref="LoadingModel" />
)
}
render() {
let { navigation } = this.props
let { title } = navigation.state.params
......@@ -463,14 +414,8 @@ const styles = StyleSheet.create({
borderRadius: 10,
marginVertical: 16,
paddingTop: 16
// marginVertical: 10,
// padding: 10,
// borderColor: '#FFF',
// borderWidth: 10
},
cons_sub_inner: {
// backgroundColor: home_background_color,
},
cons_sub_inner: {},
sub_list_cont: {
display: 'flex',
flexDirection: 'row',
......@@ -536,25 +481,15 @@ const styles = StyleSheet.create({
},
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_cont: {},
add_btn_txt: {
height: 46,
lineHeight: 46
......@@ -574,8 +509,8 @@ const mapDispatchToProps = (dispatch) => {
exitLoginStatus: () => {
dispatch(exitLoginStatus())
},
getCharDetailsOption: (data) => {
dispatch(getCharDetailsOption(data))
setCharDetailsOption: (data) => {
dispatch(setCharDetailsOption(data))
}
}
}
......
......@@ -10,17 +10,7 @@ import {
TouchableOpacity,
FlatList
} from 'react-native';
import {
home_background_color,
promary_color,
safe_view,
list_common_item,
icon_style,
pxSize,
second_text_size,
promary_text_color,
font_family_regular
} from '../../../base/BaseStyle';
import { home_background_color, promary_color, safe_view, list_common_item, icon_style, pxSize, second_text_size, promary_text_color, font_family_regular, font_family_semibold, foundation_color, list_tit_color, list_str_color, list_one_color, list_thr_color, third_text_size } from '../../../base/BaseStyle';
import StatusBarView from '../../common/StatusBarView';
import HeadBackItem from '../../common/HeadBackItem';
import DetailsModel from './DetailsModel';
......@@ -31,6 +21,7 @@ import { connect } from 'react-redux';
import { show} from '../../../utils/Utils';
import LodingModel from '../../common/LodingModel';
import { exitLoginStatus } from '../../../action/LoginAction';
import { OBS_MOBILE_EQU_CON_DISPLAY_PRICE } from '../../../base/BaseConstants';
const CONSUM_SEARCH_VALUE_BAR_CODE = 'CONSUM_SEARCH_VALUE_BAR_CODE';
......@@ -230,16 +221,17 @@ class ConsumDetailsPage extends Component {
show('请选择耗材')
return
}
// this.props.navigation.navigate('FillUnitPricePage', {
// title: '器械消耗 - 填写单价',
// localSelectOption: localSelectOption
// })
if(OBS_MOBILE_EQU_CON_DISPLAY_PRICE === 'Y'){
this.props.navigation.navigate('FillUnitPricePage', {
title: '器械消耗 - 填写单价',
localSelectOption: localSelectOption
})
}else {
this.props.navigation.navigate('ShowDetailPage', {
title: '器械消耗 - 已选明细',
localSelectOption: localSelectOption
})
}
}
// 返回搜索元素
......@@ -310,17 +302,20 @@ class ConsumDetailsPage extends Component {
</View>
<View style={styles.sub_list_rig}>
<Text style={styles.rig_tit}>
{index+1}. {item.item_name}
{index+1}. {item.item_name ? item.item_name : '物料名称无'}
</Text>
<Text style={styles.rig_ser}>
通用名称:{item.general_name}
<Text style={[styles.rig_ser, styles.te_ot_str]}>
通用名称:{item.general_name ? item.general_name : '无'}
</Text>
<Text style={styles.rig_ser}>
规格型号:{item.specification}
<Text style={[styles.rig_ser, styles.te_ot_one]}>
规格型号:{item.specification ? item.specification : '无'}
</Text>
<Text style={styles.rig_ser}>
序列号:{item.serial_number}
<Text style={[styles.rig_ser, styles.te_ot_two]}>
序列号:{item.serial_number ? item.serial_number : '无'}
</Text>
{/* <Text style={styles.rig_ser}>
厂家产品代码:{item.manufacturer_product_code ? item.manufacturer_product_code : '无'}
</Text> */}
</View>
</TouchableOpacity>
)
......@@ -408,12 +403,17 @@ const styles = StyleSheet.create({
flex: 1
},
cons_cont_scroll: {},
cons_cont: {},
cons_cont: {
marginTop: 16
},
cons_sub_list: {
paddingHorizontal: 20,
paddingVertical: 12,
flexDirection: 'row',
alignItems: 'center'
alignItems: 'center',
backgroundColor: foundation_color,
marginHorizontal: 16,
marginBottom: 16
},
sub_list_lef: {
paddingRight: 12
......@@ -422,17 +422,38 @@ const styles = StyleSheet.create({
width: pxSize(20),
height: pxSize(20)
},
sub_list_rig: {},
sub_list_rig: {
flex: 1
},
rig_tit: {
fontSize: second_text_size,
color: promary_text_color,
fontFamily: font_family_regular
// color: promary_text_color,
fontFamily: font_family_regular,
color: list_tit_color,
},
rig_ser: {
fontSize: 14,
color: '#ADADAD',
// fontSize: 14,
// color: '#ADADAD',
fontSize: third_text_size,
fontFamily: font_family_regular
},
te_ot_str: {
fontFamily: font_family_semibold,
// color: '#0CB4E8'
color: list_str_color
},
te_ot_one:{
// color: '#1B40B5',
color: list_one_color
},
te_ot_two:{
// color: '#1B40B5',
color: list_one_color
},
te_ot_thr:{
// color: '#3B4C82',
color: list_thr_color
},
fot_btn_lef: {
// width: pxSize(220)
},
......
......@@ -15,7 +15,7 @@ import {
import StatusBarView from '../../common/StatusBarView';
import HeadBackItem from '../../common/HeadBackItem';
import { show } from '../../../utils/Utils';
import { getSubdetailOption } from '../../../action/EquipAction';
import { setSubdetailOption } from '../../../action/EquipAction';
import { connect } from 'react-redux';
// 可填写单价
......@@ -23,17 +23,7 @@ class FillUnitPricePage extends Component {
constructor(props) {
super(props);
this.state = {
unitPriceOption: [
// {
// "id": "2",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// sale_price: 90890,
// local_add_price: 90890,
// select: true
// }
]
unitPriceOption: []
}
}
......@@ -65,7 +55,7 @@ class FillUnitPricePage extends Component {
let {props} = this
for(let i in unitPriceOption) {
if(!unitPriceOption[i].local_add_price) {
show('请填写完单价')
show('请填写完单价')
canSubFlag = false
break
}
......@@ -76,7 +66,7 @@ class FillUnitPricePage extends Component {
unitPriceOption
})
// 存储于store中,并跳转
props.getSubdetailOption(unitPriceOption)
props.setSubdetailOption(unitPriceOption)
props.navigation.navigate('EquipConsuPage', { title: '器械消耗' })
}
}
......@@ -243,8 +233,8 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) => {
return {
getSubdetailOption: (data) => {
dispatch(getSubdetailOption(data))
setSubdetailOption: (data) => {
dispatch(setSubdetailOption(data))
}
}
}
......
......@@ -10,12 +10,11 @@ import {
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
} from '../../../base/BaseStyle';
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, foundation_color, list_tit_color, list_str_color, list_one_color, list_thr_color, third_text_size } from '../../../base/BaseStyle';
import StatusBarView from '../../common/StatusBarView';
import HeadBackItem from '../../common/HeadBackItem';
import { show } from '../../../utils/Utils';
import { getSubdetailOption } from '../../../action/EquipAction';
import { setSubdetailOption } from '../../../action/EquipAction';
import { connect } from 'react-redux';
// 仅展示明细
......@@ -58,7 +57,7 @@ class ShowDetailPage extends Component {
unitPriceOption
})
// 存储于store中,并跳转
props.getSubdetailOption(unitPriceOption)
props.setSubdetailOption(unitPriceOption)
props.navigation.navigate('EquipConsuPage', { title: '器械消耗' })
}
}
......@@ -83,18 +82,23 @@ class ShowDetailPage extends Component {
// 返回每一列元素
renderSubListItem(item, index) {
let price = ''
if(item.local_add_price) {
price = String(item.local_add_price)
}
return(
<View style={styles.cons_sub_list}>
<Text style={styles.cont_tit}>
{index+1}. {item.item_name}
{index+1}. {item.item_name ? item.item_name : '物料名称无'}
</Text>
<Text style={[styles.cont_ser, styles.te_ot_str]}>
通用名称:{item.general_name ? item.general_name : '无'}
</Text>
<Text style={styles.cont_ser}>
序列号:{item.serial_number}
<Text style={[styles.cont_ser, styles.te_ot_one]}>
规格型号:{item.specification ? item.specification : '无'}
</Text>
<Text style={[styles.cont_ser, styles.te_ot_two]}>
序列号:{item.serial_number ? item.serial_number : '无'}
</Text>
{/* <Text style={styles.cont_ser}>
厂家产品代码:{item.manufacturer_product_code ? item.manufacturer_product_code : '无'}
</Text> */}
</View>
)
}
......@@ -150,24 +154,44 @@ const styles = StyleSheet.create({
},
cons_cont_scroll: {},
cons_cont: {
paddingHorizontal: 20
paddingHorizontal: 20,
marginTop: 16
},
cons_sub_list: {
backgroundColor: '#FFF',
marginVertical: 10,
padding: 10
backgroundColor: foundation_color,
padding: 10,
marginBottom: 16
},
cont_tit: {
fontSize: second_text_size,
color: promary_text_color,
fontFamily: font_family_regular
// color: promary_text_color,
fontFamily: font_family_regular,
color: list_tit_color,
},
cont_ser: {
fontSize: 14,
color: '#A3A3A3',
// fontSize: 14,
// color: '#A3A3A3',
fontSize: third_text_size,
fontFamily: font_family_regular
},
te_ot_str: {
fontFamily: font_family_semibold,
// color: '#0CB4E8'
color: list_str_color
},
te_ot_one:{
// color: '#1B40B5',
color: list_one_color
},
te_ot_two:{
// color: '#1B40B5',
color: list_one_color
},
te_ot_thr:{
// color: '#3B4C82',
color: list_thr_color
},
cont_pri: {
flexDirection: 'row',
alignItems: 'center'
......@@ -203,8 +227,8 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) => {
return {
getSubdetailOption: (data) => {
dispatch(getSubdetailOption(data))
setSubdetailOption: (data) => {
dispatch(setSubdetailOption(data))
}
}
}
......
......@@ -18,13 +18,14 @@ import {
safe_view,
font_family_regular
} from '../../base/BaseStyle';
import { exitLoginStatus } from '../../action/LoginAction';
import { exitLoginStatus, requestSysProfile } from '../../action/LoginAction';
import HeadBackItem from '../common/HeadBackItem';
import StatusBarView from '../common/StatusBarView';
import ScrollableTabView from 'react-native-scrollable-tab-view';
import TabBottomItem from './module/TabBottomItem';
import HistoricalOrderPage from '../historicalOrder/HistoricalOrderPage';
import { referenceArrSort } from '../../utils/Utils';
import { referenceArrSort, show } from '../../utils/Utils';
import { setEquConDisplayPrice } from '../../base/BaseConstants';
class HomePage extends Component {
......@@ -107,6 +108,7 @@ class HomePage extends Component {
componentDidMount() {
this.getMenuRuleInfo()
this.getSysConfigValue()
}
// 获取菜单权限
......@@ -167,6 +169,26 @@ class HomePage extends Component {
}
// 获取配置值
async getSysConfigValue() {
let { global_domain_config, token } = this.props
const params = {
access_token: token,
profile_code: 'OBS_MOBILE_EQU_CON_DISPLAY_PRICE'
}
let sysRes = await requestSysProfile(global_domain_config, params)
console.log('sysRes:==', sysRes)
if(sysRes.error_code === 0){
setEquConDisplayPrice(sysRes.data.profile_value)
} else if(sysRes.error_code == 41006) {
show('登录过期,请重新登录');
this.props.exitLoginStatus();
} else {
let error_msg = sysRes.error_msg || sysRes.message
show(error_msg);
}
}
// 跳转页面
jumpToSubpage(index) {
let {page, title} = this.state.showList[index]
......@@ -287,7 +309,9 @@ const styles = StyleSheet.create({
const mapStateToProps = (state) => ({
loginState:state.login.loginState,
userInfo: state.login.userInfo
userInfo: state.login.userInfo,
token: state.login.token,
global_domain_config: state.login.global_domain_config
})
const mapDispatchToProps = (dispatch) => ({
......
......@@ -7,7 +7,8 @@ import {
ImageBackground,
Image,
TextInput,
TouchableOpacity
TouchableOpacity,
NativeModules
} from 'react-native';
import {connect} from "react-redux";
import {
......@@ -24,8 +25,7 @@ import {
placehold_text_color,
font_family_regular,
safe_view,
font_family_medium,
third_text_color
font_family_medium
} from '../../base/BaseStyle';
import { requestLogin, autoLogin, setDomainConfigurate } from '../../action/LoginAction';
import { show, isEmpty } from '../../utils/Utils';
......@@ -45,7 +45,7 @@ class LoginPage extends Component{
subTitList: ['登录', '登录中...'],
isSubLoding: false,
isShowDomain: false, // 域名填写
version_apk: 'v1.2.0'
version_apk: 'v1.2.1'
}
}
......@@ -98,6 +98,11 @@ class LoginPage extends Component{
}
}
// 设置版本号
setVersion() {
// NativeModules
}
// 判断是否打开域名弹窗
isOpenDomainModel() {
let {global_domain_config} = this.props
......@@ -442,8 +447,8 @@ const styles = StyleSheet.create({
marginTop: 42
},
fo_vers: {
fontSize: 10,
color: third_text_color,
fontSize: 12,
color: title_text_color,
paddingTop: 4
},
footer_img: {
......
......@@ -8,8 +8,8 @@ import {
EQUIP_SUBMIT_SUCCESS,
EQUIP_SUBMIT_FAILURE,
EQUIP_INIT_DATA,
GET_SUB_DETAIL_OPTION,
GET_CHARGE_DETAILS_OPTION
SET_SUB_DETAIL_OPTION,
SET_CHARGE_DETAILS_OPTION
} from '../../base/ActionTypes';
// 器械消耗状态
......@@ -59,11 +59,11 @@ export default equip = (state = defaultState, action) => {
subDetOption: [],
charDetailOption: []
})
case GET_SUB_DETAIL_OPTION:
case SET_SUB_DETAIL_OPTION:
return Object.assign({}, state, {
subDetOption: action.rawData
})
case GET_CHARGE_DETAILS_OPTION:
case SET_CHARGE_DETAILS_OPTION:
return Object.assign({}, state, {
charDetailOption: action.rawData
})
......
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