Commit 64322131 by Denglingling

完善【扫码】功能,样式调整,以及调用方式;增加【转单申请】菜单权限等;

(cherry picked from commit 0d2b185b)
parent ab7e6182
......@@ -18,10 +18,10 @@ import FillUnitPricePage from './containers/equipConsu/module/FillUnitPricePage'
import QuickOrderPage from './containers/quickOrder/QuickOrderPage';
import TransOrderPage from './containers/transOrder/TransOrderPage';
import TransSearchPage from './containers/transOrder/module/TransSearchPage';
import BarCodePage from './containers/transOrder/module/BarCodePage';
import HistoricalOrderPage from './containers/historicalOrder/HistoricalOrderPage';
import LineOrderPage from './containers/historicalOrder/module/LineOrderPage';
import SubSuccPage from './containers/common/SubSuccPage';
import BarCodePage from './containers/common/BarCodePage';
const Router = createAppContainer(createStackNavigator({
LoginPage: { screen: LoginPage },
......@@ -36,10 +36,10 @@ const Router = createAppContainer(createStackNavigator({
QuickOrderPage: {screen: QuickOrderPage},
TransOrderPage: {screen: TransOrderPage},
TransSearchPage: {screen: TransSearchPage},
BarCodePage: {screen: BarCodePage},
HistoricalOrderPage: {screen: HistoricalOrderPage},
LineOrderPage: {screen: LineOrderPage},
SubSuccPage: {screen: SubSuccPage}
SubSuccPage: {screen: SubSuccPage},
BarCodePage: {screen: BarCodePage},
}, {
navigationOptions: {
gesturesEnabled: true
......
import React, { Component } from 'react';
import {
View,
StyleSheet,
Text,
Animated,
Easing,
SafeAreaView,
ImageBackground
} from 'react-native';
import {
title_text_color,
Height,
Width,
safe_view,
promary_color
} from '../../base/BaseStyle';
import { show } from '../../utils/Utils';
import { RNCamera } from 'react-native-camera';
import StatusBarView from './StatusBarView';
import HeadBackItem from './HeadBackItem';
class BarCodePage extends Component {
constructor(props) {
super(props);
this.state = {
transCode:'', // 条码
// typeCode: '', // 条码类型
showCode: true,
// animate: new Animated.Value(0), // 二维坐标{x:0,y:0}
animateCode: new Animated.Value((Width() - 200) / 2,(Height() - 340) / 2),
// 中间横线动画初始值
moveAnim: new Animated.Value(-2)
}
}
componentDidMount() {
// InteractionManager.runAfterInteractions(() => {
// this.startAnimation()
// })
// console.log('进入-------', this.state.showCode)
this.startAnimation();
}
/** 扫描框动画*/
startAnimation = () => {
this.state.moveAnim.setValue(-2);
Animated.sequence([
Animated.timing(
this.state.moveAnim,
{
toValue: 200,
duration: 1500,
easing: Easing.linear
}
),
Animated.timing(
this.state.moveAnim,
{
toValue: -1,
duration: 1500,
easing: Easing.linear
}
)
]).start(() => this.startAnimation())
}
onBarCodeRead = (result) => {
let that = this
const { data } = result
const { navigate } = that.props.navigation;
let { typeName, supPage } = that.props.navigation.state.params
//扫码后的操作
console.log('data===========---------=====', data)
if(data) {
let barCodeData = {
typeName: typeName,
typeValue: data
}
navigate(supPage.pageName, { barCodeData, title: supPage.title })
}
}
render() {
let {navigation} = this.props
let {title} = navigation.state.params
return (
<View style={styles.bar_cord_container}>
<StatusBarView
isReactStackNavigator={true}
backgroundColor={promary_color}
barStyle = 'light-content'
/>
<SafeAreaView style={safe_view}>
<HeadBackItem title={title} navigation={navigation} />
<View style={styles.container}>
<RNCamera
ref={ref => {
this.camera = ref;
}}
autoFocus={RNCamera.Constants.AutoFocus.on}/*自动对焦*/
style={[styles.rnca_preview]}
type={RNCamera.Constants.Type.back}/*切换前后摄像头 front前back后*/
flashMode={RNCamera.Constants.FlashMode.off}/*相机闪光模式*/
onBarCodeRead={this.onBarCodeRead}
>
<View style={styles.anima_top_box} />
<View style={[styles.anima_box]}>
<View style={styles.anima_box_bg}/>
<ImageBackground style={styles.anima_box_inner}>
<Animated.View style={[
styles.anima_border,
{transform: [{translateY: this.state.moveAnim}]}]}/>
</ImageBackground>
<View style={styles.anima_box_bg}/>
</View>
<View style={styles.rnca_bot_box}>
<Text style={styles.recg_text}>将二维码放入框内,即可自动扫描</Text>
</View>
</RNCamera>
</View>
</SafeAreaView>
</View>
)
}
}
const styles = StyleSheet.create({
bar_cord_container: {
flex: 1
},
container: {
flex: 1,
flexDirection: 'row'
},
rnca_preview: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
anima_top_box: {
width:500,
height:140,
backgroundColor: 'rgba(0,0,0,0.5)',
},
anima_box: {
flexDirection:'row'
},
anima_box_inner: {
width:200,
height:200
},
anima_box_bg: {
backgroundColor: 'rgba(0,0,0,0.5)',
height:200,
width:200
},
anima_border: {
flex: 0,
width: 196,
height: 2,
backgroundColor: promary_color,
borderRadius: 50,
marginLeft: 2
},
rnca_bot_box: {
flex: 1,
backgroundColor: 'rgba(0, 0, 0, 0.5)',
width: 500,
alignItems: 'center'
},
recg_text: {
flex: 0,
color: title_text_color,
marginTop: 10
},
})
export default BarCodePage;
\ No newline at end of file
......@@ -35,7 +35,7 @@ import {
ContTextStyle
} from '../common/CellTextStyle';
import { connect } from 'react-redux';
import { isEmpty, dedupQuoteArray, show, formatStrForDate, cloneObject } from '../../utils/Utils';
import { dedupQuoteArray, show, formatStrForDate, cloneObject } from '../../utils/Utils';
import DateModel from '../common/DateModel';
import DialogModel from '../common/DialogModel';
import {
......@@ -186,27 +186,6 @@ class EquipConsuPage extends Component {
// serial_number: '2001202001001774',
// sale_price: '36668',
// select: true
// },{
// "id": "2",
// item_name: '人工髋关节假体-JS-HB ||| T3',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// sale_price: '36668',
// select: true
// },{
// "id": "3",
// item_name: '人工髋关节假体-JS-HB ||| T4',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// sale_price: '36668',
// select: true
// },{
// "id": "4",
// item_name: '人工髋关节假体-JS-HB ||| T5',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// sale_price: '36668',
// select: true
// }
]
},
......@@ -222,10 +201,8 @@ class EquipConsuPage extends Component {
],
subInitListOption: [], // 提交成功后,初始化当前数据
submitOption: { // 提交的信息
// seller_code: '', // 用户名username ?? 没有用户名
org_code: '', // 组织
surgery_collect_number: '', // 订单信息 ?? 没有客户名称
surgery_collect_number: '', // 订单信息
consume_date: '', // 消耗时间
patient_name: '', // 患者姓名
patient_gender: '', // 性别
......@@ -236,7 +213,6 @@ class EquipConsuPage extends Component {
remark: '', // 备注信息
lines: [], // 消耗明细
img_url: '', // 图片路径,逗号分割
},
currentItem: {
name: '请选择',
......@@ -254,10 +230,6 @@ class EquipConsuPage extends Component {
// {
// name: '测试1',
// value: '测试1'
// },
// {
// name: '测试2',
// value: '测试2'
// }
],
dateModelPop: false, // 日期选择器
......@@ -276,7 +248,6 @@ class EquipConsuPage extends Component {
}
}
componentDidMount() {
this.getSellerName()
}
......@@ -289,12 +260,6 @@ class EquipConsuPage extends Component {
subInitListOption: cloneObject(listOptionData) // 存储初始化数据,提交成功后赋此值
})
if(state.listOptionData[0].name !== props.userInfo.person_name) {
listOptionData[0].name = props.userInfo.person_name
listOptionData[0].value = props.userInfo.user_name
// this.setState({
// listOptionData,
// subInitListOption: cloneObject(listOptionData)
// })
this.setState({
listOptionData: state.listOptionData.map((item) => {
if(item.title === '销售员') {
......@@ -440,8 +405,6 @@ class EquipConsuPage extends Component {
// 选择器弹窗回调函数
handleCallBack(item, itemTitle) {
// console.warn(item, 'item--选择器弹窗回调函数----')
// console.warn('item-itemTitle-----',itemTitle)
let { listOptionData} = this.state
let self = this
this.setState({
......@@ -500,7 +463,6 @@ class EquipConsuPage extends Component {
currentArr.push(obj)
})
}
tempOption = this.changeNameAndValue(currentArr, 'customer_name', 'customer_code')
} else if (currentTitle === '订单信息') {
let resultArr = []
......@@ -543,7 +505,6 @@ class EquipConsuPage extends Component {
// 组织 点击
handleOrganizationCheck() {
// console.warn('组织------check')
let { state, props } = this
this.setState({
currentTitle: '组织',
......@@ -561,8 +522,7 @@ class EquipConsuPage extends Component {
// 客户名称 点击
handleCustomerCheck() {
// console.warn('客户名称------check')
let { state, props } = this
let { state } = this
let self = this
if(this.judgeOrgIsNull()) {
self.setState({
......@@ -572,7 +532,6 @@ class EquipConsuPage extends Component {
value: state.listOptionData[2].value
}
}, () => {
// 在此修改接口
self.getCustomerData()
})
}
......@@ -591,7 +550,6 @@ class EquipConsuPage extends Component {
// 订单信息 点击
handleOrderInfoCheck() {
// console.warn('订单信息------check')
let { state, props } = this
let that = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
......@@ -616,7 +574,6 @@ class EquipConsuPage extends Component {
// 消耗时间 点击
handleEquipDateCheck() {
// console.warn('消耗时间------check')
let { listOptionData } = this.state
let date = listOptionData[4].value
if(date) {
......@@ -641,7 +598,6 @@ class EquipConsuPage extends Component {
// 修改当前日期数据
dateModalCallback(date) {
// console.warn('callback',date)
let { listOptionData } = this.state
let self = this
this.setState({
......@@ -660,7 +616,6 @@ class EquipConsuPage extends Component {
// 患者姓名 输入
handlePatNameInput(text) {
// console.warn('患者姓名------input:', text)
let { listOptionData } = this.state
let self = this
this.setState({
......@@ -677,7 +632,6 @@ class EquipConsuPage extends Component {
// 性别 点击
handleGenderCheck() {
// console.warn('性别------check:')
let { listOptionData, sexTypeOption } = this.state
let self = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
......@@ -698,7 +652,6 @@ class EquipConsuPage extends Component {
// 年龄 输入
handleAgeInput(text) {
// console.warn('年龄------input:', text)
let { listOptionData } = this.state
let self = this
this.setState({
......@@ -715,7 +668,6 @@ class EquipConsuPage extends Component {
// 床位 输入
handleBedInput(text) {
// console.warn('床位------input:', text)
let { listOptionData } = this.state
let self = this
this.setState({
......@@ -732,7 +684,6 @@ class EquipConsuPage extends Component {
// 病历号 输入
handleRecordNumInput(text) {
// console.warn('病历号------input:', text)
let { listOptionData } = this.state
let self = this
this.setState({
......@@ -749,7 +700,7 @@ class EquipConsuPage extends Component {
// 结单 是
handleRadioYesClick() {
let {listOptionData} = this.state
let { listOptionData } = this.state
listOptionData[10].isRedio = 'Y'
this.setState({
listOptionData
......@@ -758,7 +709,7 @@ class EquipConsuPage extends Component {
// 结单 否
handleRadioNoClick() {
let {listOptionData} = this.state
let { listOptionData } = this.state
listOptionData[10].isRedio = 'N'
this.setState({
listOptionData
......@@ -767,7 +718,6 @@ class EquipConsuPage extends Component {
// 备注 输入
handleRemarkInput(text) {
// console.warn('备注---',text)
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
......@@ -781,7 +731,7 @@ class EquipConsuPage extends Component {
// 耗材明细 隐藏子项
handleDetailBtmCheck() {
let {listOptionData} = this.state
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(index == 12) {
......@@ -790,12 +740,11 @@ class EquipConsuPage extends Component {
return item
})
})
}
// 耗材明细 显示子项
handleDetailRigCheck() {
let {listOptionData} = this.state
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(index == 12) {
......@@ -808,20 +757,18 @@ class EquipConsuPage extends Component {
// 耗材明细 点击
handleConsumDetailCheck() {
// console.warn('耗材明细------check')
let { listOptionData } = this.state
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()
&& this.judgeOrderInfoIsNull()) {
this.props.navigation.navigate('ConsumDetailsPage', {
title: '器械消耗 - 添加明细',
orderId: listOptionData[3].value
})
})
}
}
// 添加图片 点击
handleAddPicCheck() {
// console.warn('添加图片------check')
let { localPhoOption, listOptionData } = this.state
let { props } = this
let that = this
......
......@@ -32,6 +32,8 @@ import { show} from '../../../utils/Utils';
import LodingModel from '../../common/LodingModel';
import { exitLoginStatus } from '../../../action/LoginAction';
const CONSUM_SEARCH_VALUE_BAR_CODE = 'CONSUM_SEARCH_VALUE_BAR_CODE';
class ConsumDetailsPage extends Component {
constructor(props) {
super(props);
......@@ -50,54 +52,6 @@ class ConsumDetailsPage extends Component {
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: false
// },{
// "id": "2",
// item_name: '人工髋关节假体-JS-HB ||| T3',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: true
// },{
// "id": "3",
// item_name: '人工髋关节假体-JS-HB ||| T4',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: true
// },{
// "id": "4",
// item_name: '人工髋关节假体-JS-HB ||| T5',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: true
// },{
// "id": "5",
// item_name: '人工髋关节假体-JS-HB ||| T6',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: true
// },{
// "id": "6",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: false
// },{
// "id": "7",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: false
// },{
// "id": "8",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: false
// },{
// "id": "9",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// serial_number: '2001202001001774',
// select: false
// }
],
allConOption: [], // 所有数据(未筛选过的)
......@@ -115,10 +69,11 @@ class ConsumDetailsPage extends Component {
componentWillReceiveProps(nextProps) {
let { barCodeData } = nextProps.navigation.state.params
let that = this
if(barCodeData && barCodeData.typeValue && barCodeData.typeName == 'consum_search_value') {
if(barCodeData && barCodeData.typeValue && barCodeData.typeName == CONSUM_SEARCH_VALUE_BAR_CODE) {
that.setState({
searchValue
searchValue: barCodeData.typeValue
})
that.handleSearchInput(barCodeData.typeValue)
}
}
......@@ -150,6 +105,7 @@ class ConsumDetailsPage extends Component {
chItem.local_add_price = item.local_add_price
chItem.select = true
}
chItem.id = chInd + ''
})
})
}
......@@ -172,8 +128,7 @@ class ConsumDetailsPage extends Component {
// 搜索 输入
handleSearchInput(text) {
// console.log('搜索 输入---', text)
let {allConOption} = this.state
let { allConOption } = this.state
let self = this
let tempArr = []
if(text) {
......@@ -197,7 +152,8 @@ class ConsumDetailsPage extends Component {
// 搜索 扫一扫
handleConsumScanCheck() {
this.props.navigation.navigate('BarCodePage', {
typeName: 'consum_search_value',
title: '扫描二维码',
typeName: CONSUM_SEARCH_VALUE_BAR_CODE,
supPage: {
title: '器械消耗 - 添加明细',
pageName: 'ConsumDetailsPage'
......@@ -312,6 +268,7 @@ class ConsumDetailsPage extends Component {
<View style={list_common_item.ser_img_box}>
<Image source={require('../../../images/search_icon.png')} style={icon_style}/>
</View>
<TouchableOpacity
activeOpacity={.8}
style={styles.ser_scanit_box}
......@@ -319,6 +276,7 @@ class ConsumDetailsPage extends Component {
>
<Image source={require('../../../images/scan_2.png')} style={icon_style} />
</TouchableOpacity>
</View>
)
}
......
......@@ -161,6 +161,7 @@ class DetailsModel extends Component {
<TouchableOpacity
activeOpacity={1}
style={styles.top_touch_cont}
key={index}
// onPress={() => this.handleTopNav(item, index)}
>
<View style={[
......
......@@ -540,7 +540,7 @@ const styles = StyleSheet.create({
borderBottomWidth: 1
},
top_touch_cont: {
width: '33.33333%'
width: '33.33333%' // 三个
// width: '50%'
},
top_inner: {
......
......@@ -48,6 +48,7 @@ import { show, dedupQuoteArray, cloneObject } from '../../../utils/Utils';
import moment from 'moment';
import ErrorTipModel from '../../common/ErrorTipModel';
const REQUEST_NUMBER_BAR_CODE = 'REQUEST_NUMBER_BAR_CODE'
class FilterModel extends Component {
constructor(props) {
......@@ -1185,6 +1186,18 @@ class FilterModel extends Component {
})
}
// 申请单号 - 扫一扫 -- 弹窗不好跳转!!!
handleRequeNumSacanCheck() {
// this.props.navigation.navigate('BarCodePage', {
// title: '扫描二维码',
// typeName: REQUEST_NUMBER_BAR_CODE,
// supPage: {
// title: '耗材明细 - 转单查询',
// pageName: 'HistoricalOrderPage'
// }
// })
}
// 判断组织是否为空
judgeOrgIsNull() {
let {topActiveIndex, borrowListOptionData, consumeListOptionData, transferListOptionData } = this.state
......@@ -2085,7 +2098,7 @@ class FilterModel extends Component {
<Text style={styles.qui_cell_tit}>申请单号</Text>
<TouchableOpacity
activeOpacity={.8}
style={styles.qui_cell_inp}>
style={[styles.qui_cell_inp, styles.qui_cell_tran]}>
<TextInput
placeholder={'请输入'}
style={[styles.cell_rig_sel, styles.cell_rig_input]}
......@@ -2095,6 +2108,13 @@ class FilterModel extends Component {
defaultValue={transferListOptionData[6].value}
keyboardType="email-address"
/>
{/* <TouchableOpacity
activeOpacity={.8}
style={styles.sea_scan_box}
onPress={() => this.handleRequeNumSacanCheck()}
>
<Image source={require('../../../images/scan_2.png')} style={icon_style} />
</TouchableOpacity> */}
</TouchableOpacity>
</View>
<View style={styles.qui_cell}>
......@@ -2271,7 +2291,7 @@ const styles = StyleSheet.create({
borderBottomWidth: 1
},
top_touch_cont: {
width: '33.33333%'
width: '33.33333%' // 三个
// width: '50%'
},
top_inner: {
......@@ -2432,6 +2452,9 @@ const styles = StyleSheet.create({
paddingHorizontal: 6,
paddingLeft: 52
},
qui_cell_tran: {
// paddingLeft: 22
},
cell_rig_input: {
flex: 1,
lineHeight: 20,
......@@ -2518,6 +2541,11 @@ const styles = StyleSheet.create({
sea_btn_reset: {
color: '#007EFF'
},
sea_scan_box: {
width: pxSize(22),
height: pxSize(22),
marginLeft: 2
},
})
......
......@@ -58,7 +58,7 @@ class HomePage extends Component {
// page: 'LoginPage',
// }
],
backLoginInfo: {
backLoginInfo: { // 不需要了
icon: require('../../images/return_login.png'),
title: '返回登录页',
page: 'LoginPage',
......@@ -110,9 +110,8 @@ class HomePage extends Component {
let { modDefauIcon, modSeleIcon,
hisDefauIcon, hisSeleIcon,
borrowInfo, consumpInfo,
backLoginInfo } = this.state
transInfo, backLoginInfo } = this.state
functions = referenceArrSort(functions, 'child_list', 'function_order')
// console.log('referenceArrSort---->', functions)
let tempTabNames = []
let tempTabCodes = []
let tempTabIconNames = []
......@@ -133,10 +132,13 @@ class HomePage extends Component {
} else if(chItem.function_code == 'MOBILE_CONSUMP_CONFIRMA') {
consumpInfo.title = chItem.function_name
tempModuleList.push(consumpInfo)
} else if(chItem.function_code == 'MOBILE_TRANSFER_APPLICATION') {
transInfo.title = chItem.function_name
tempModuleList.push(transInfo)
}
})
}
// tempModuleList.push(backLoginInfo)
// tempModuleList.push(backLoginInfo) // 不用了
} else if(item.function_code == 'MOBILE_HISTORICAL_ORDER') {
tempTabIconNames.push(hisDefauIcon)
......
......@@ -728,8 +728,7 @@ class TransOrderPage extends Component {
// 耗材明细 隐藏子项
handleDetailBtmCheck() {
let {listOptionData} = this.state
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(index == 6) {
......@@ -743,9 +742,7 @@ class TransOrderPage extends Component {
// 耗材明细 显示子项
handleDetailRigCheck() {
let {listOptionData} = this.state
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(index == 6) {
......
import React, { Component } from 'react';
import {
View,
StyleSheet,
Text,
Animated,
Easing,
InteractionManager,
TouchableOpacity,
Image,
SafeAreaView
} from 'react-native';
import {
title_text_color,
pxSize,
Height,
Width,
icon_style,
safe_view,
promary_color
} from '../../../base/BaseStyle';
import { show } from '../../../utils/Utils';
import { RNCamera } from 'react-native-camera';
import StatusBarView from '../../common/StatusBarView';
class BarCodePage extends Component {
constructor(props) {
super(props);
this.state = {
transCode:'', // 条码
// typeCode: '', // 条码类型
showCode: true,
// animate: new Animated.Value(0), // 二维坐标{x:0,y:0}
animateCode: new Animated.Value((Width() - 200) / 2,(Height() - 340) / 2),
}
}
componentDidMount() {
InteractionManager.runAfterInteractions(() => {
this.startAnimation()
})
console.log('进入-------', this.state.showCode)
}
// 动画开始
startAnimation() {
// if(this.state.showCode) {
this.state.animateCode.setValue(0)
Animated.timing(this.state.animateCode, {
toValue: 1, // 运动终止位置,比值
duration: 2500, // 动画时长
easing: Easing.linear, // 线性的渐变函数
delay: 0.3, // 在一段时间之后开始动画(单位是毫秒),默认为0
}).start(() => this.startAnimation())
// }
}
componentWillUnmount() {
this.state.showCode = false
console.log('进入-结束🔚------', this.state.showCode)
}
barcodeReceived(e) {
let that = this
let { typeName, supPage } = that.props.navigation.state.params
if(this.state.showCode){
console.log(e);
that.setState({
transCode: e.data,
// typeCode: e.type,
showCode: false
})
if(e.data) {
let barCodeData = {
typeName: typeName,
typeValue: e.data
}
that.props.navigation.navigate(supPage.pageName, { barCodeData, title: supPage.title })
}
}
}
// 关闭扫一扫
closeScanPage() {
let { supPage } = this.props.navigation.state.params
this.props.navigation.navigate(supPage.pageName, { title: supPage.title })
}
render() {
return (
<View style={styles.container}>
<StatusBarView
isReactStackNavigator={true}
backgroundColor={promary_color}
barStyle = 'light-content'
/>
<SafeAreaView style={safe_view}>
<RNCamera
onBarCodeRead={this.barcodeReceived.bind(this)}
onCameraReady={() => {
console.log('ready')
}}
permissionDialogTitle={'提示信息'}
permissionDialogMessage={'APP需要使用相机,请打开相机权限允许APP使用'}
style={styles.scan_camera}
>
<View style={styles.scan_cont_box}>
<View style={styles.scan_cont_circle}>
<Animated.View style={{
alignItems: 'center',
transform: [{
// translateX: x轴移动
// translateY: y轴移动
translateY: this.state.animateCode.interpolate({
inputRange: [0,1],
outputRange: [0,200]
})
}]
}}>
<Text style={styles.scan_circle_init}></Text>
</Animated.View>
</View>
</View>
<TouchableOpacity
activeOpacity={.8}
style={styles.scan_top_box}
onPress={() => this.closeScanPage()}
>
<Image source={require('../../../images/close_white_icon2.png')} style={icon_style}/>
</TouchableOpacity>
<View style={styles.scan_info_box}>
<Text style={styles.scan_info}>将条形码放入框内,即可自动扫描</Text>
</View>
</RNCamera>
</SafeAreaView>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1
},
scan_top_box: {
position: "absolute",
left: 20,
top: 20,
width: pxSize(24),
height: pxSize(24)
},
scan_camera: {
flex: 1,
height: Height()
},
scan_cont_box: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgba(0,0,0,0.3)',
},
scan_cont_circle: {
width: 260,
height: 260,
borderWidth: 1,
borderColor: '#919191',
backgroundColor: 'rgba(255,255,255,0.1)'
},
scan_circle_init: {
width:250,
height:1,
backgroundColor:'#00ff00'
},
scan_info_box: {
height: 100,
backgroundColor: 'rgba(0,0,0,0.3)',
alignItems: 'center',
width: Width()
},
scan_info: {
color: title_text_color
},
info: {
width: Width(),
height: 80,
backgroundColor: '#fff',
paddingLeft: 10,
paddingBottom:5,
justifyContent: 'space-around',
},
})
export default BarCodePage;
\ No newline at end of file
......@@ -52,6 +52,9 @@ import DialogModel from '../../common/DialogModel';
import DateModel from '../../common/DateModel';
import moment from 'moment';
const SERIAL_NUMBER_BAR_CODE = 'SERIAL_NUMBER_BAR_CODE';
const SURGERY_COLLECT_NUMBER_BAR_CODE = 'SURGERY_COLLECT_NUMBER_BAR_CODE';
class TransSearchPage extends Component {
constructor(props) {
super(props);
......@@ -106,42 +109,7 @@ class TransSearchPage extends Component {
// surgery_collect_number: "SC20200529000010",
// serial_number: '2001202001001772',
// select: false
// },{
// "id": "2",
// item_name: '人工髋关节假体-JS-HB ||| T3',
// specification: '3g,Ytg-DG-SZGT',
// surgery_collect_number: "SC20200529000010",
// serial_number: '2001202001001773',
// select: true
// },{
// "id": "3",
// item_name: '人工髋关节假体-JS-HB ||| T4',
// specification: '3g,Ytg-DG-SZGT',
// surgery_collect_number: "SC20200529000010",
// serial_number: '2001202001001774',
// select: true
// },{
// "id": "4",
// item_name: '人工髋关节假体-JS-HB ||| T5',
// specification: '3g,Ytg-DG-SZGT',
// surgery_collect_number: "SC20200529000010",
// serial_number: '2001202001001775',
// select: true
// },{
// "id": "5",
// item_name: '人工髋关节假体-JS-HB ||| T6',
// specification: '3g,Ytg-DG-SZGT',
// surgery_collect_number: "SC20200529000010",
// serial_number: '2001202001001776',
// select: true
// },{
// "id": "6",
// item_name: '人工髋关节假体-JS-HB ||| T',
// specification: '3g,Ytg-DG-SZGT',
// surgery_collect_number: "SC20200529000010",
// serial_number: '2001202001001777',
// select: false
// },
// }
],
allConOption: [], // 所有数据(未筛选过的)
selectShowPopup: false, // 共计已选弹窗
......@@ -182,13 +150,13 @@ class TransSearchPage extends Component {
let { barCodeData } = nextProps.navigation.state.params
let { listOptionData } = this.state
let that = this
if(barCodeData && barCodeData.typeValue && barCodeData.typeName == 'serial_number') {
if(barCodeData && barCodeData.typeValue && barCodeData.typeName == SERIAL_NUMBER_BAR_CODE) {
listOptionData[1].value = barCodeData.typeValue
that.setState({
listOptionData
})
}
if(barCodeData && barCodeData.typeValue && barCodeData.typeName == 'surgery_collect_number') {
if(barCodeData && barCodeData.typeValue && barCodeData.typeName == SURGERY_COLLECT_NUMBER_BAR_CODE) {
listOptionData[0].value = barCodeData.typeValue
that.setState({
listOptionData
......@@ -333,7 +301,8 @@ class TransSearchPage extends Component {
// 来源借货订单号 扫一扫
handleSourScanCheck() {
this.props.navigation.navigate('BarCodePage', {
typeName: 'surgery_collect_number',
title: '扫描二维码',
typeName: SURGERY_COLLECT_NUMBER_BAR_CODE,
supPage: {
title: '耗材明细 - 转单查询',
pageName: 'TransSearchPage'
......@@ -343,7 +312,6 @@ class TransSearchPage extends Component {
// 序列号 输入
handleSerialNumInput(text) {
console.log('序列号------input:', text)
this.changeInputValue('序列号', text)
}
......@@ -363,7 +331,8 @@ class TransSearchPage extends Component {
// 序列号 扫一扫
handleSerialScanCheck() {
this.props.navigation.navigate('BarCodePage', {
typeName: 'serial_number',
title: '扫描二维码',
typeName: SERIAL_NUMBER_BAR_CODE,
supPage: {
title: '耗材明细 - 转单查询',
pageName: 'TransSearchPage'
......@@ -408,7 +377,7 @@ class TransSearchPage extends Component {
} else if(curForm instanceof Object) {
return
}
// if(seaFlag) {
if(seaFlag) {
// 调用接口
let { subTransObj } = that.props.navigation.state.params
let { token } = that.props
......@@ -429,9 +398,11 @@ class TransSearchPage extends Component {
org_name: subTransObj.org_name,
...seaForm
}
console.log('params------', params)
this.changeLodingFlag(true)
let { global_domain_config } = that.props
let detailResult = await requestTransDetails(global_domain_config, params)
console.log('detailResult------', detailResult)
if(detailResult.error_code === 0) {
let { data: { sur_transfer_lines }} = detailResult
if(sur_transfer_lines.length == 0) {
......@@ -462,9 +433,9 @@ class TransSearchPage extends Component {
let error_msg = detailResult.error_msg || detailResult.message
show(error_msg);
}
// } else {
// show('请至少输入一个查询条件')
// }
} else {
show('请至少输入一个查询条件')
}
}
// 修改加载中
......
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