Commit 74185580 by wong.peiyi

自助下单过滤、消耗确认过滤已消耗订单、ios上传图片加文件名

parent ef444ba0
......@@ -87,7 +87,7 @@ export const list_common_item = {
color: first_text_color,
fontFamily: font_family_regular
// fontWeight: 'bold'
},
},
rema_Input_outer: {
height: 120,
alignItems: 'center',
......@@ -432,10 +432,10 @@ export const list_common_item = {
ser_text_input: {
backgroundColor: '#F5F5F5',
height: 38,
lineHeight: 16,
lineHeight: 20,
paddingLeft: 34,
borderRadius: 10,
fontSize: 14,
fontFamily: font_family_regular
},
}
\ No newline at end of file
}
......@@ -90,10 +90,13 @@ class ChooseCardList extends Component {
resizeMode="center" /> : <Image source={cur_icon} style={icon_style} resizeMode="cover" />
}
</View> : null}
<Text numberOfLines={3} style={[styles.list_item_tit, cardStyleItemTit, cur_icon ? '' : cardStyleNotIconTit, index == curActIndex ? [styles.list_tit_act, cardStyleItemTitAct] : '']}>
{item[cardItemTitle]}
{(item[cardCountName] && countStyleType[0] === cardStyleType) ? <Text style={[styles.sum_def, cardCouStyle]}>({item[cardCountName]})</Text> : null}
</Text>
{
cardItemTitle &&
<Text numberOfLines={3} style={[styles.list_item_tit, cardStyleItemTit, cur_icon ? '' : cardStyleNotIconTit, index == curActIndex ? [styles.list_tit_act, cardStyleItemTitAct] : '']}>
{item[cardItemTitle]}
{(item[cardCountName] && countStyleType[0] === cardStyleType) ? <Text style={[styles.sum_def, cardCouStyle]}>({item[cardCountName]})</Text> : null}
</Text>
}
</View>
</TouchableOpacity>
{(item[cardCountName] && countStyleType[1] === cardStyleType) ? <View style={[styles.card_def_count, cardCouStyle]}>
......@@ -177,4 +180,4 @@ const mapDispatchToProps = (dispatch) => {
}
}
export default connect(mapStateToProps, mapDispatchToProps)(ChooseCardList);
\ No newline at end of file
export default connect(mapStateToProps, mapDispatchToProps)(ChooseCardList);
......@@ -768,7 +768,8 @@ class EquipConsuPage extends Component {
access_token: props.token,
org_code: state.listOptionData[1].value,
customer_code: state.listOptionData[2].value,
collect_header_status: 'RETURNED,COLLECTED'
collect_header_status: 'RETURNED,COLLECTED',
filter_none_flag: 'Y',
}
if (OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY > 0) {
params.department_code = state.listOptionData[15].value
......@@ -787,7 +788,8 @@ class EquipConsuPage extends Component {
access_token: props.token,
org_code: state.listOptionData[1].value,
customer_code: state.listOptionData[2].value,
collect_header_status: 'RETURNED,COLLECTED'
collect_header_status: 'RETURNED,COLLECTED',
filter_none_flag: 'Y',
}
if (OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY > 0 && !!state.listOptionData[15].value) {
params.department_code = state.listOptionData[15].value
......
......@@ -1389,6 +1389,9 @@ class SelfOrderPage extends Component {
source = res.uri;
} else {
source = res.uri.replace('file://', '');
if (!res.fileName) {
res.fileName = new Date().getTime() + '.HEIC'
}
}
const formData = new FormData();
let file = { uri: source, type: 'multipart/form-data', name: res.fileName };
......
/*
* @FilePath: /BoneHouse_Business_APP/app/containers/selfOrder/module/ChooseFilter.js
* @Author: peii
* @Date: 2021-05-18 11:07:03
* @Vision: 1.0
* @Description:
*
* @Revision:
*
*/
import React, { Component } from 'react'
import {
View,
Text,
StyleSheet,
TouchableOpacity,
Image,
TextInput,
SafeAreaView,
ScrollView,
} from 'react-native'
import * as R from 'ramda'
import {
foundation_color,
home_background_color,
Width,
Height,
third_text_size,
pxSize,
promary_color,
safe_view,
font_family_regular,
icon_style,
title_text_color,
font_family_medium,
list_common_item,
point_color,
second_text_size,
second_text_color,
first_text_color,
} from '../../../base/BaseStyle'
const PropTypes = require('prop-types')
export default class ChoolseFilter extends Component {
static propTypes = {
filterData: PropTypes.arrayOf(PropTypes.any).isRequired,
onCallback: PropTypes.func.isRequired,
}
constructor(props) {
super(props)
this.state = {
visible: false,
}
}
render() {
const { visible } = this.state
const { filterData, onCallback } = this.props
return (
<View style={styles.filterBar}>
<View style={styles.filterBarTitle}>
<TouchableOpacity
style={styles.filterBtn}
activeOpacity={0.8}
onPress={() => {
this.setState({ visible: !visible })
}}
>
<Text style={styles.filterBtnText}>筛选</Text>
<Image
source={require('../../../images/arr_bom.png')}
style={[icon_style, styles.btnIcon]}
/>
</TouchableOpacity>
{filterData &&
R.compose(
R.map(filter => {
return <Text style={styles.filterSelect}>{filter.value}</Text>
}),
R.filter(R.prop('value')),
)(filterData)}
</View>
{visible && (
<View
style={styles.searchModal}
visible={visible}
animationType="slide"
transparent={true}
>
<TouchableOpacity
style={styles.mask}
onPress={() => {
this.setState({ visible: !visible })
}}
></TouchableOpacity>
<View style={styles.searchContent}>
<ScrollView style={styles.scrollView}>
{filterData &&
filterData.map(item => {
return (
<View key={item.field}>
<Text style={styles.searchLabel}>{item.label}</Text>
{item.type === 'select' ? (
<View style={styles.optionsBox}>
{!!item.options &&
item.options.map(option => {
return (
<TouchableOpacity
key={option.value}
style={
item.value === option.value
? [styles.optionItem, styles.optionItemActive]
: styles.optionItem
}
activeOpacity={0.8}
onPress={() => {
if (item.value === option.value) {
onCallback && onCallback(item.field, '')
} else {
onCallback && onCallback(item.field, option.value)
}
}}
>
<Text
style={
item.value === option.value
? [styles.optionItemText, styles.optionItemTextActive]
: styles.optionItemText
}
>
{option.label}
</Text>
{item.value === option.value && (
<Image
style={styles.optionItemImgActive}
source={require('../../../images/his_ord_sel.png')}
/>
)}
</TouchableOpacity>
)
})}
</View>
) : (
<></>
)}
</View>
)
})}
</ScrollView>
<View style={styles.searchBtns}>
<TouchableOpacity
style={[styles.searchBtn, styles.resetBtn]}
activeOpacity={0.8}
onPress={() => {
R.map(filter => {
onCallback && onCallback(filter.field, '')
})(filterData)
}}
>
<Text style={styles.resetBtnText}>重置</Text>
</TouchableOpacity>
<TouchableOpacity
style={[styles.searchBtn, styles.confirmBtn]}
activeOpacity={0.8}
onPress={() => {
this.setState({ visible: !visible })
}}
>
<Text style={styles.confirmBtnText}>确定</Text>
</TouchableOpacity>
</View>
</View>
</View>
)}
</View>
)
}
}
const styles = StyleSheet.create({
filterBar: {
width: Width(),
height: pxSize(36),
paddingLeft: pxSize(20),
zIndex: 999,
},
filterBarTitle: {
flexDirection: 'row',
alignItems: 'center',
},
filterSelect: {
fontSize: 12,
borderColor: '#E1F1FE',
borderWidth: 1,
padding: 3,
borderRadius: 4
},
filterBtn: {
height: pxSize(36),
flexDirection: 'row',
alignItems: 'center',
marginRight: 20,
},
filterBtnText: {
color: promary_color,
},
btnIcon: {
width: pxSize(10),
height: pxSize(10),
},
searchModal: {
position: 'absolute',
top: pxSize(36),
width: Width(),
height: Height(),
backgroundColor: 'rgba(0, 0, 0, 0.5)',
},
mask: {
position: 'absolute',
width: '100%',
height: '100%',
},
searchContent: {
width: Width(),
height: pxSize(300),
backgroundColor: home_background_color,
borderColor: '#ddd',
borderTopWidth: 1,
},
scrollView: {
height: pxSize(260),
padding: pxSize(20),
},
searchLabel: {
fontSize: second_text_size,
color: first_text_color,
fontWeight: 'bold',
marginBottom: 10,
},
searchBtns: {
height: pxSize(40),
width: Width(),
flexDirection: 'row',
},
searchBtn: {
width: '50%',
justifyContent: 'center',
alignItems: 'center',
},
resetBtn: {
backgroundColor: '#E1F1FE',
},
resetBtnText: {
color: promary_color,
},
confirmBtn: {
backgroundColor: promary_color,
},
confirmBtnText: {
color: '#fff',
},
optionsBox: {
flexDirection: 'row',
},
optionItem: {
padding: pxSize(8),
paddingLeft: pxSize(20),
paddingRight: pxSize(20),
marginRight: pxSize(15),
marginBottom: pxSize(15),
backgroundColor: '#fff',
},
optionItemActive: {
backgroundColor: '#E1F1FE',
},
optionItemText: {
color: second_text_color,
},
optionItemTextActive: {
color: promary_color,
},
optionItemImgActive: {
position: 'absolute',
bottom: 0,
right: 0,
},
})
import React, { Component } from 'react';
import { View, Text, StyleSheet, TouchableOpacity, Image, TextInput, SafeAreaView } from 'react-native';
import { connect } from 'react-redux';
import debounce from 'debounce';
import { foundation_color, home_background_color, Width, third_text_size, pxSize, promary_color, safe_view, font_family_regular, icon_style, title_text_color, font_family_medium, list_common_item, point_color } from '../../../base/BaseStyle';
import ChooseFilter from './ChooseFilter';
import HeadBackItem from '../../common/HeadBackItem';
import ProductRightStyle from './ProductRightStyle';
import ProductModel from '../../common/ProductModel';
import StatusBarView from '../../common/StatusBarView';
import ChooseCardList from '../../common/listDataComponent/ChooseCardList';
import { cloneObject, show } from '../../../utils/Utils';
import { cloneObject, show, isNotBlank } from '../../../utils/Utils';
import { reqPurSupplierSearch, reqProCategorySearch, reqSurTempHeadSearch, reqNailEquipHeadSearch, reqScatEquipmentSearch, reqSingleConsumSearch, setSelectProductOpts } from '../../../action/SelfAction';
import LoadingModel from '../../common/listDataComponent/LoadingModel';
import LocalVariable from '../../common/LocalVariable';
......@@ -68,8 +70,17 @@ class ChooseProductPage extends Component {
[LocalVariable.SELECTED_QUQNTITY]: 0
}],
local_cur_options: [],
cur_hc_opts: []
cur_hc_opts: [],
filterData: [{
field: 'surgery_type',
label: '手术类型',
options: [],
value: '',
type: 'select'
}]
}
this.inputSearchValue = debounce(this.inputSearchValue.bind(this), 500)
}
componentDidMount() {
......@@ -188,8 +199,12 @@ class ChooseProductPage extends Component {
that.handleChangeThrShow(false)
if (leftItem[LocalVariable.SELECTED_QUQNTITY] !== 0) {
that.setState({
leftActiveIndex: leftIndex
}, () => {
if (leftIndex) return
this.setFilterData(topProcOptionList[topActiveIndex].leftOptionList[leftIndex].localSecondData)
})
return
}
......@@ -206,7 +221,7 @@ class ChooseProductPage extends Component {
access_token: token,
org_code: cur_org_code,
manufacturer_code: topItem.supplier_code,
doctor_name: cur_doctor_name
// doctor_name: cur_doctor_name
}
console.log('params=', params)
let sur_head_search = await reqSurTempHeadSearch(global_domain_config, params)
......@@ -214,6 +229,7 @@ class ChooseProductPage extends Component {
if (sur_head_search.error_code === 0) {
if (sur_head_search.data && sur_head_search.data.surgery_template_headers) {
topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = that.getInitLocalSecondData(leftItem, sur_head_search.data.surgery_template_headers)
this.setFilterData(topProcOptionList[topActiveIndex].leftOptionList[leftIndex].localSecondData)
} else {
topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = []
}
......@@ -598,20 +614,92 @@ class ChooseProductPage extends Component {
}
}
setFilterData(localSecondData) {
let options = R.compose(
R.groupBy(R.prop('value')),
R.map(R.applySpec({
label: R.prop('surgery_type_name'),
value: R.prop('surgery_type')
})
), R.clone)(localSecondData)
options = R.compose(
R.map( k => ({value: k, label: options[k][0].label})),
R.filter(R.allPass([isNotBlank, R.complement(R.equals)('undefined')])),
R.keys
)(options)
const {filterData} = this.state
filterData[0].value = ''
filterData[0].options = options
this.setState({filterData})
}
inputSearchValue(text) {
this.setState({searchValue: text})
}
fillterCallback(key, value) {
const {filterData} = this.state
const filter = R.find(R.propEq('field', key))(filterData)
if (!filter) return
filter.value = value
this.setState({ filterData })
}
/**
* @description: 手术模板过滤
* @param {*}
* @return {*}
*/
rightFilter(list = []) {
const {filterData} = this.state
R.compose(R.map(filter => {
const value = filter.value
if (isNotBlank(value)) {
const reg = new RegExp(value, 'g')
list = R.filter(item => {
return reg.test(item[filter.field])
}, list)
}
}))(filterData)
return list
}
/**
* @description: 搜索过滤
* @param {*}
* @return {*}
*/
rightNameFilter(list = []) {
const {searchValue} = this.state
const includes = item => {
const reg = new RegExp(searchValue, 'g')
return reg.test(item.general_name) || reg.test(item.item_name)
}
return R.filter(includes, list)
}
// 返回搜索元素
renderSearchItem() {
return (
<View style={list_common_item.ser_cont}>
<TextInput
placeholder={'请输入搜索关键词'}
style={list_common_item.ser_text_input}
defaultValue={this.state.searchValue}
/>
<View style={list_common_item.ser_img_box}>
<Image source={require('../../../images/search_icon.png')} style={icon_style} />
const {leftActiveIndex, filterData} = this.state
if (leftActiveIndex) {
return (
<View style={list_common_item.ser_cont}>
<TextInput
placeholder={'请输入搜索关键词'}
style={list_common_item.ser_text_input}
defaultValue={this.state.searchValue}
onChangeText={(text) => this.inputSearchValue(text)}
/>
<View style={list_common_item.ser_img_box}>
<Image source={require('../../../images/search_icon.png')} style={icon_style} />
</View>
</View>
</View>
)
)
} else {
return <ChooseFilter filterData={filterData} onCallback={this.fillterCallback.bind(this)}/>
}
}
// 返回顶部厂家
......@@ -633,7 +721,7 @@ class ChooseProductPage extends Component {
cardStyleItemTit={styles.top_tit}
cardStyleItemTitAct={styles.top_tit_act}
cardListOptions={topProcOptionList}
cardItemTitle={cur_title}
// cardItemTitle={cur_title}
cardItemIcon={cur_icon}
curActIndex={topActiveIndex}
cardCallBack={(item, index) => this.handleTopNav(item, index)}
......@@ -681,7 +769,7 @@ class ChooseProductPage extends Component {
// 返回右侧二级数据
renderContItem() {
let { leftActiveIndex, defaultThridShow, topProcOptionList, topActiveIndex } = this.state
let { leftActiveIndex, defaultThridShow, topProcOptionList, topActiveIndex} = this.state
let curRigSecoOption = []
let curSuperLeftOption = []
let topItem = topProcOptionList[topActiveIndex]
......@@ -693,6 +781,12 @@ class ChooseProductPage extends Component {
}
}
if (leftActiveIndex) {
curRigSecoOption = this.rightNameFilter(curRigSecoOption)
} else {
curRigSecoOption = this.rightFilter(curRigSecoOption)
}
return (
<View style={styles.cont_bom_box}>
{ this.renderContLeftItem()}
......@@ -854,7 +948,7 @@ class ChooseProductPage extends Component {
<SafeAreaView style={safe_view}>
<HeadBackItem title={title} navigation={navigation} callback={() => this.handleGoBack()} />
<View style={styles.choo_main}>
{/* {this.renderSearchItem()} */}
{this.renderSearchItem()}
{topProcOptionList && topProcOptionList.length > 0 ? this.renderTopProItem() : null}
{topProcOptionList && topProcOptionList.length > 0 ? this.renderContItem() : null}
</View>
......@@ -871,11 +965,12 @@ const styles = StyleSheet.create({
backgroundColor: home_background_color
},
choo_main: {
flex: 1
flex: 1,
zIndex: 99,
},
top_box: {
width: Width(),
height: 89,
height: 58,
backgroundColor: foundation_color,
paddingHorizontal: 20,
paddingTop: 12,
......@@ -885,7 +980,8 @@ const styles = StyleSheet.create({
top_scroll_cont: {},
top_inner: {
borderBottomColor: foundation_color,
minWidth: 60
minWidth: 60,
paddingBottom: 10
},
top_inner_act: {},
top_tit: {},
......@@ -895,7 +991,7 @@ const styles = StyleSheet.create({
},
cont_bom_box: {
position: 'relative',
flex: 1
flex: 1,
},
cont_left_box: {
backgroundColor: '#F5F5F5',
......
......@@ -1067,6 +1067,9 @@ class TransOrderPage extends Component {
source = res.uri;
} else {
source = res.uri.replace('file://','');
if (!res.fileName) {
res.fileName = new Date().getTime() + '.HEIC'
}
}
const formData = new FormData();
let file = { uri: source, type: 'multipart/form-data', name: res.fileName };
......
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