Commit 0a992408 by Denglingling

完善【快速下单】模块:

1、如 [手术医院]、[主治医生] 选择器改变值之后,其他字段需要重新选择的逻辑;
2、调整 [生成订单] 按钮颜色、监听当前必填项,提示未填必选项,以及填完必填项显示可提交状态;
3、新增 [库存不足] 弹窗,以及点击取消和确定的逻辑
parent ce8571b3
......@@ -15,6 +15,7 @@ import SubSuccessPage from './containers/selfOrder/module/SubSuccessPage';
import EquipConsuPage from './containers/equipConsu/EquipConsuPage';
import QuickOrderPage from './containers/quickOrder/QuickOrderPage';
import TransOrderPage from './containers/transOrder/TransOrderPage';
import SubSuccPage from './containers/common/SubSuccPage';
const Router = createAppContainer(createStackNavigator({
LoginPage: { screen: LoginPage },
......@@ -25,7 +26,8 @@ const Router = createAppContainer(createStackNavigator({
SubSuccessPage: {screen: SubSuccessPage},
EquipConsuPage: {screen: EquipConsuPage},
QuickOrderPage: {screen: QuickOrderPage},
TransOrderPage: {screen: TransOrderPage}
TransOrderPage: {screen: TransOrderPage},
SubSuccPage: {screen: SubSuccPage}
}, {
navigationOptions: {
gesturesEnabled: true
......
......@@ -10,21 +10,18 @@ import {
QUICK_SUBMIT_FAILURE
} from '../base/ActionTypes';
import RNFetchBlob from 'react-native-fetch-blob'
import RNFS from 'react-native-fs';
// 获取组织 params={access_token:''}
// export const requestQuickOrganizations = async (params) => {
// return await GetRequest(`/api/latest/authorized_inventory/search?access_token=${params.access_token}`)
// }
export function requestQuickOrganizations(params) {
return dispatch => {
// console.warn('----requestQuickOrganizations====================')
console.log('----requestQuickOrganizations====================')
dispatch(requestOrganizationsing());
// GetRequest(`/authorized_inventory/search?access_token=${access_token}`)
GetRequest(getUrlParams('/authorized_inventory/search', params))
.then(res => {
// console.warn('res=====', Object.keys(res), res.error, res.message);
console.log('res=====', Object.keys(res), res);
if(res.error_code == 0) {
// console.warn('res====organizations==========', res.data.organizations);
let { data: { organizations } } = res
dispatch(requestOrganizationsSuccess(organizations));
} else if(res.error_code === 41006) {
......@@ -37,7 +34,7 @@ export function requestQuickOrganizations(params) {
}
})
.catch(err => {
// console.log('------err--====organizations----', Object.keys(err), err.error, err.message)
console.log('------err--====organizations----', Object.keys(err), err)
show(err.error);
})
}
......@@ -46,12 +43,11 @@ export function requestQuickOrganizations(params) {
// 获取手术医院 params={access_token:'', org_code:'', seller_code:''}
export function requestQuickSurgeryHospital(params) {
return dispatch => {
console.warn('----requestQuickSurgeryHospital====================', params)
console.log('----requestQuickSurgeryHospital====================', params)
dispatch(requestOrganizationsing());
GetRequest(getUrlParams('/sale/seller_customer/search', params))
// GetRequest('/sale/seller_customer/search?access_token=20200512140017932dcdff2129a5f4201900f116c819e74865T473Ma2PGh16ek&org_code=A02&seller_code=shi.ming')
.then(res => {
// console.warn('res===!!==', Object.keys(res));
console.log('res===!!==', Object.keys(res));
if(res.error_code == 0) {
let { data: { customers } } = res
dispatch(requestOrganizationsSuccess(customers));
......@@ -65,7 +61,7 @@ export function requestQuickSurgeryHospital(params) {
}
})
.catch(err => {
// console.log('------err--====requestQuickSurgeryHospital----', Object.keys(err))
console.log('------err--====requestQuickSurgeryHospital----', Object.keys(err), err)
show(err.error);
})
}
......@@ -74,11 +70,11 @@ export function requestQuickSurgeryHospital(params) {
// 获取订单类型 params={access_token:'', value_set_code:'SUR_ORDER_TYPE'}
export function requestQuickOrderType(params) {
return dispatch => {
console.warn('----requestQuickOrderType====================', params)
console.log('----requestQuickOrderType====================', params)
dispatch(requestOrganizationsing());
GetRequest(getUrlParams('/system/value_set/search', params))
.then(res => {
console.warn('res===!!==', Object.keys(res));
console.log('res===!!==', Object.keys(res));
if(res.error_code == 0) {
let { data: { sys_values } } = res
dispatch(requestOrganizationsSuccess(sys_values));
......@@ -92,7 +88,7 @@ export function requestQuickOrderType(params) {
}
})
.catch(err => {
// console.log('------err--====requestQuickSurgeryHospital----', Object.keys(err))
console.log('------err--====requestQuickSurgeryHospital----', Object.keys(err), err)
show(err.error);
})
}
......@@ -101,11 +97,11 @@ export function requestQuickOrderType(params) {
// 获取配台模版 params={access_token:'', org_code:'', seller_code: 'shi.ming', customer_code: '', surgery_type: '', doctor_name: ''}
export function requestQuickTemplateCollect(params) {
return dispatch => {
console.warn('----requestQuickTemplateCollect====================', params)
console.log('----requestQuickTemplateCollect====================', params)
dispatch(requestOrganizationsing());
GetRequest(getUrlParams('/surgery/template_header/search', params))
.then(res => {
console.warn('res===!!==', Object.keys(res));
console.log('res===!!==', Object.keys(res));
if(res.error_code == 0) {
let { data: { surgery_template_headers } } = res
dispatch(requestOrganizationsSuccess(surgery_template_headers));
......@@ -119,7 +115,7 @@ export function requestQuickTemplateCollect(params) {
}
})
.catch(err => {
// console.log('------err--====requestQuickTemplateCollect----', Object.keys(err))
console.log('------err--====requestQuickTemplateCollect----', Object.keys(err), err)
show(err.error);
})
}
......@@ -146,7 +142,7 @@ function requestOrganizationsFail() {
// 上传语音 params={ access_token:'', path='录音地址' }
// 上传语音 params={ access_token:'', path='录音地址' } -- 待修改
export function requestQuickAudio(params) {
return dispatch => {
let { access_token, path } = params
......@@ -155,17 +151,59 @@ export function requestQuickAudio(params) {
let formData = new FormData()
let soundPath = `file://${path}`
let tempPath = 'file:///storage/emulated/0/Pictures/image.jpg'
let fileName = path.substring(path.lastIndexOf('/') + 1, path.length)
let fileType = path.split('.')[1]
// let file = { uri: soundPath, type: 'ogg', name: fileName } // 类型和名字固定???
let file = { uri: soundPath, type: 'multipart/form-data', name: fileName } // 类型和名字固定???
let file = { uri: tempPath, type: 'multipart/form-data', name: 'image.jpg' } // 类型和名字固定???
formData.append('file', file)
console.log('----file====================', file, soundPath, formData)
// /system/attachment/create
// /dingding/upload_media
// // 这里需要将'///'处理掉,因为使用wrap的时候,会再包裹一层
// // 本文的fetch-blob使用的是0.10.4版本,据说其他版本不用添加下面的代码。
// // let PATH = iOS?path.replace('file:///',''):path;
// // 创建上传的请求头,使用fetch-blob必须要遵循name,data的格式,要不然就不成功。
// let body = [{
// name: 'file',
// filename: fileName || 'file',
// data: RNFetchBlob.wrap(path)
// }];
// RNFetchBlob
// .fetch('POST',getUrlParams('/dingding/upload_media', { access_token }),{
// // 上传图片要设置Header
// 'Content-Type' : 'multipart/form-data',
// },body)
// .uploadProgress((written, total) => {
// // 本地查找进度
// console.log(written, total);
// })
// .progress((received, total) => {
// let perent = received / total;
// // 上传进度打印
// console.log(perent);
// })
// .then((response)=> response.json())
// .then((response)=> {
// // 上传信息返回
// console.log(response);
// })
// .catch((error)=>{
// // 错误信息
// console.log(error);
// });
dispatch(requestSubmitOrganizationsing());
// /system/attachment/create
// /dingding/upload_media
UploadRequest(getUrlParams('/dingding/upload_media', { access_token }), formData)
.then(res => {
console.log('res===!!==', Object.keys(res), res);
......@@ -188,7 +226,7 @@ export function requestQuickAudio(params) {
}
}
//上传头像
//上传头像 -- 测试
export const uploadAttachment = async (token,datas) => {
return await UploadRequest('/system/attachment/create' + '?access_token=' + token,datas)
};
......@@ -198,12 +236,12 @@ export function requestQuickSumbit({access_token, ...params}) {
return dispatch => {
console.warn('----requestQuickSumbit====================', access_token, params)
dispatch(requestSubmitOrganizationsing());
PostRequest(getUrlParams('/surgery/consume_order/create', {access_token: access_token}), params)
PostRequest(getUrlParams('/surgery/collect_order/via_data/create', {access_token: access_token}), params)
.then(res => {
console.warn('res=====', Object.keys(res));
if(res.error_code == 0) {
console.warn('res====requestQuickSumbit==========', res.data);
let { data: { data } } = res
let { data } = res
dispatch(requestSubmitOrganizationsSuccess(data));
} else if(res.error_code === 41006) {
show('登录过期,请重新登录');
......@@ -215,7 +253,7 @@ export function requestQuickSumbit({access_token, ...params}) {
}
})
.catch(err => {
// console.log('------err--====requestQuickSumbit----', Object.keys(err), err.error, err.message)
console.log('------err--====requestQuickSumbit----', Object.keys(err), err)
show(err.error);
})
}
......
export const BaseUrl = "http://192.168.10.188:8200"; // https://obs.uat.sfrx.guke.tech https://sob-os.uat.sfrx.guke.tech
export const BaseUrlOther = "http://192.168.10.188:8200"; //http://192.168.10.188:8200/v1/dingding/upload_media
export const VERSION = '/v1'; // /api/latest
// export const BaseUrl = "http://192.168.10.188:8200"; // https://obs.uat.sfrx.guke.tech https://sob-os.uat.sfrx.guke.tech
// export const BaseUrlOther = "http://192.168.10.188:8200"; //http://192.168.10.188:8200/v1/dingding/upload_media
// export const VERSION = '/v1'; // /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时使用
import React, { Component } from 'react';
import {
View,
Text,
StyleSheet,
Modal,
ScrollView,
TouchableOpacity,
Image
} from 'react-native';
import {
Width,
pxHeight,
third_text_color,
second_text_color,
first_text_color,
safe_view,
pxSize,
font_family_medium,
icon_style,
font_family_regular,
font_family_semibold,
title_text_color,
promary_color
} from '../../base/BaseStyle';
class NotEnoughModel extends Component {
constructor(props) {
super(props);
this.state = {
isVisible: this.props.show,
notEnoughList: this.props.notEnoughList,
title: '以下物品缺失,是否继续提交?',
not_enough_items_list: [
{
"item_code": "AR00000004",
"reg_number": "国械注进20173466362",
"plan_quantity": 10,
"specification": "2.2mm带线锚钉,蓝色缝线",
"item_name": "钛合金缝线锚钉",
"general_name": "钛合金锚钉",
"storage_quantity": 0
},
{
"item_code": "AR00000003",
"reg_number": "国械注进20173466362",
"plan_quantity": 10,
"specification": "3.5*12.1,蓝色缝线",
"item_name": "钛合金缝线锚钉",
"general_name": "钛合金锚钉",
"storage_quantity": 6
},
{
"item_code": "AR00000002",
"reg_number": "国械注进20173466362",
"plan_quantity": 10,
"specification": "5.0X15.5,蓝色缝线",
"item_name": "钛合金缝线锚钉",
"general_name": "钛合金锚钉",
"storage_quantity": 4
}
],
}
}
componentWillReceiveProps(nextProps) {
// console.warn('------show--------------',nextProps.show, this.state.isVisible )
if (this.state.isVisible != nextProps.show) {
this.setState({
isVisible: nextProps.show
});
}
if (this.state.notEnoughList != nextProps.notEnoughList) {
this.setState({
notEnoughList: nextProps.notEnoughList
})
}
}
// 取消
closeModal() {
this.setState({
isVisible: false
});
this.props.closeModal(false);
}
// 确定
submitModal() {
console.log('确定!!!')
this.props.callback();
this.closeModal()
}
renderNotEnItem(item, index) {
return (
<TouchableOpacity
activeOpacity={1}
style={styles.cont_list}>
<Text style={[styles.co_li, styles.co_str]}>{item.item_name}({item.item_code})</Text>
<Text style={styles.co_li}>{item.general_name}</Text>
<Text style={styles.co_li}>{item.specification}</Text>
<Text style={styles.co_li}>{item.reg_number}</Text>
<Text style={styles.co_li}>{item.item_name}</Text>
<Text style={styles.co_li}>
计划数量:
<Text style={styles.plan_num}>{item.plan_quantity}</Text>
</Text>
<Text style={styles.co_li}>
库存数量:
<Text style={styles.sto_num}>{item.storage_quantity}</Text>
</Text>
</TouchableOpacity>
)
}
renderDialog() {
let { notEnoughList, title, not_enough_items_list } = this.state
return (
<View style={styles.opt_area}>
<View style={styles.modal_style}>
<View style={styles.modal_head}>
<View style={styles.modal_tit}>
<Image style={styles.err_icon} source={require('../../images/err_tit.png')} />
<Text style={styles.inner_tit}>{title}</Text>
</View>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.closeModal()}
style={styles.head_tou_clo}
>
<Image style={icon_style} source={require('../../images/close_icon.png')}></Image>
</TouchableOpacity>
</View>
<View style={styles.scro_box}>
<ScrollView
style={styles.item_scroll}
// showsVerticalScrollIndicator={false}
>
{/* notEnoughList not_enough_items_list */}
{
notEnoughList.map((item, index) => this.renderNotEnItem(item, index))
}
</ScrollView>
</View>
<View style={styles.model_footer}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.closeModal()}
style={[styles.foo_btn, styles.btn_cel]}
>
<Text style={[styles.btn_tit, styles.tit_cel]}>取消</Text>
</TouchableOpacity>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.submitModal()}
style={[styles.foo_btn, styles.btn_sub]}
>
<Text style={styles.btn_tit}>确定</Text>
</TouchableOpacity>
</View>
</View>
</View>
)
}
render() {
return (
<View style={styles.dia_container}>
<Modal
transparent={true}
visible={this.state.isVisible}
animationType={'fade'}
onRequestClose={() => this.closeModal()}>
<View style={safe_view}>
<TouchableOpacity style={styles.container} activeOpacity={1}
// onPress={() => this.closeModal()}
>
{this.renderDialog()}
</TouchableOpacity>
</View>
</Modal>
</View>
);
}
}
const styles = StyleSheet.create({
dia_container: {
flex: 1,
},
dis_cont: {
width: '80%',
maxHeight: '80%',
backgroundColor: '#FFF',
borderRadius: 10
},
container: {
flex: 1,
backgroundColor: 'rgba(0, 0, 0, 0.5)',
},
opt_area: {
flex: 1,
flexDirection: 'column',
justifyContent: 'center',
position: 'relative'
},
modal_style: {
position: "absolute",
left: 0,
top: '26%',
width: Width() - 40,
flex: 1,
flexDirection: "column",
backgroundColor: '#ffffff',
minHeight: pxHeight(380),
borderRadius: 20,
marginHorizontal: 20,
paddingHorizontal: 20,
paddingTop: 20,
paddingBottom: 30
},
item: {
width: Width(),
height: 40,
paddingLeft: 20,
paddingRight: 20,
alignItems: 'center'
},
itemText: {
fontSize: 16,
color: third_text_color
},
curr_item: {
color: first_text_color,
fontWeight: 'bold'
},
scro_box: {
marginTop: 14,
maxHeight: pxHeight(320),
minHeight: pxHeight(220),
borderWidth: 1,
borderColor: '#E0E0E0',
paddingLeft: 4
},
item_scroll: {},
modal_head: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'flex-end'
},
modal_tit: {
flexDirection: 'row',
alignItems: 'center'
},
err_icon: {
width: pxSize(18),
height: pxSize(18),
marginRight: 4
},
inner_tit: {
fontSize: 16,
fontFamily: font_family_medium
},
head_tou_clo: {
width: pxSize(28),
height: pxSize(28)
},
cont_list: {},
co_li: {
lineHeight: 20,
fontSize: 14,
fontFamily: font_family_regular,
color: second_text_color
},
co_str: {
fontFamily: font_family_semibold,
fontWeight: '500',
fontSize: 16,
paddingTop: 6,
paddingBottom: 2,
color: first_text_color
},
plan_num: {
fontSize: 16,
fontFamily: font_family_semibold
},
sto_num: {
fontSize: 16,
fontFamily: font_family_semibold,
color: 'red'
},
model_footer: {
flexDirection: 'row',
justifyContent: 'space-around'
},
foo_btn: {
width: pxSize(100),
height: pxSize(36),
borderRadius: 5,
marginTop: 20
},
btn_cel: {
backgroundColor: '#E0E0E0'
},
btn_sub: {
backgroundColor: promary_color
},
btn_tit: {
fontSize: 16,
color: title_text_color,
textAlign: 'center',
lineHeight: 32
},
tit_cel: {
color: first_text_color
},
})
export default NotEnoughModel;
\ No newline at end of file
import React, { Component } from 'react';
import {
SafeAreaView,
StyleSheet,
View,
Text,
Image,
TouchableOpacity,
Clipboard
} from 'react-native';
import { connect } from 'react-redux';
import HeadBackItem from './HeadBackItem';
import {
promary_color,
second_text_color,
first_text_color,
pxSize,
title_text_color,
safe_view,
font_family_medium,
font_family_regular
} from '../../base/BaseStyle';
import StatusBarView from './StatusBarView';
class SubSuccPage extends Component {
constructor(props) {
super(props);
this.state = {
orderVal: '20200318121230'
}
}
componentDidMount() {
let {orderNumber} = this.props.navigation.state.params
if(orderNumber) {
this.setState({
orderVal: orderNumber+''
})
}
}
async handleSubmit() {
console.warn('复制订单号并返回主页')
let { orderVal } = this.state
console.log('---orderNumber---', orderVal, typeof orderVal)
Clipboard.setString(orderVal)
// 获取复制的值
let str = await Clipboard.getString()
console.warn(str)
// 返回首页
let { navigation } = this.props
setTimeout(() => {
navigation.navigate('HomePage')
}, 500)
}
render() {
let {navigation} = this.props
let {title } = navigation.state.params
let { state } = this
return (
<View style={styles.succ_container}>
<StatusBarView
isReactStackNavigator={true}
backgroundColor={promary_color}
barStyle = 'light-content'
/>
<SafeAreaView style={safe_view}>
<HeadBackItem title={title} navigation={navigation} />
<View style={styles.succ_inner}>
<View style={styles.img_box}>
<Image source={require('../../images/cor_green.png')} style={styles.img_icon}/>
</View>
<Text style={styles.succ_title}>{'提交成功'}</Text>
<Text style={styles.succ_text}>{'订单号:'} { state.orderVal }</Text>
<TouchableOpacity
activeOpacity={.9}
style={styles.succ_btn}
onPress={() => this.handleSubmit()}
>
<Text style={styles.btn_text}>{'复制订单号并返回主页'}</Text>
</TouchableOpacity>
</View>
</SafeAreaView>
</View>
);
}
}
const styles = StyleSheet.create({
succ_container: {
flex: 1
},
succ_inner: {
justifyContent: 'center',
alignItems: 'center',
paddingTop: '26%'
},
img_box: {
width: pxSize(80),
height: pxSize(80)
},
img_icon: {
width: '100%',
height: '100%'
},
succ_title: {
fontSize: 17,
fontFamily: font_family_medium,
// fontWeight: 'bold',
color: first_text_color,
paddingTop: 8,
paddingBottom: 20
},
succ_text: {
fontSize: 14,
color: second_text_color,
paddingBottom: 30,
fontFamily: font_family_regular
},
succ_btn: {
backgroundColor: promary_color,
width: pxSize(330),
borderRadius: 30,
height: 48,
display: 'flex',
justifyContent: 'center',
alignItems: 'center'
},
btn_text: {
color: title_text_color,
fontSize: 16,
fontFamily: font_family_regular
}
})
export default SubSuccPage;
\ No newline at end of file
......@@ -19,7 +19,10 @@ import {
first_text_color,
Width,
placehold_text_color,
pxSize
pxSize,
title_text_color,
third_text_size,
foundation_color
} from '../../base/BaseStyle';
import StatusBarView from '../common/StatusBarView';
import HeadBackItem from '../common/HeadBackItem';
......@@ -39,6 +42,7 @@ import Sound from 'react-native-sound';
import DateModel from '../common/DateModel';
import DialogModel from '../common/DialogModel';
import LodingModel from '../common/LodingModel';
import NotEnoughModel from '../common/NotEnoughModel';
import {
requestQuickOrganizations,
requestQuickSurgeryHospital,
......@@ -48,7 +52,15 @@ import {
requestQuickSumbit,
uploadAttachment
} from '../../action/QuickAction';
import { QUICK_ORDER_LIST_DOING, QUICK_ORDER_LIST_SUCCESS, QUICK_ORDER_LIST_FAILURE, LOGIN_NO } from '../../base/ActionTypes';
import {
QUICK_ORDER_LIST_DOING,
QUICK_ORDER_LIST_SUCCESS,
QUICK_ORDER_LIST_FAILURE,
LOGIN_NO,
QUICK_SUBMIT_DOING,
QUICK_SUBMIT_SUCCESS,
QUICK_SUBMIT_FAILURE
} from '../../base/ActionTypes';
import ImagePicker from 'react-native-image-picker';
......@@ -230,7 +242,9 @@ class EquipConsuPage extends Component {
value:'运动医学'
}
],
localTemplateOption: [], // 当前配台模版需要的信息(需要同步到备注)
// localTemplateOption: [], // 当前配台模版需要的信息(需要同步到备注)
showNotEnogPop: false, // 库存不足弹窗
notEnoughList:[], // 库存不足数据
}
}
......@@ -239,7 +253,7 @@ class EquipConsuPage extends Component {
this.getAudioAuthorize()
}
//拍照上传
// 测试 -- 拍照上传
addPhotoAction(){
// const {headerData,itemData} = this.props.navigation.state.params;
// const {photos} = this.state;
......@@ -346,7 +360,7 @@ class EquipConsuPage extends Component {
// 赋值销售员
getSellerName() {
let {state, props} = this
console.log('---userInfo',props.userInfo)
// console.log('---userInfo',props.userInfo)
if(state.listOptionData[0].name !== props.userInfo.person_name) {
this.setState({
listOptionData: state.listOptionData.map((item) => {
......@@ -372,13 +386,15 @@ class EquipConsuPage extends Component {
this.prepareRecordingPath(this.state.audioPath);
// 录音进展
AudioRecorder.onProgress = (data) => {
this.setState({currentTime: Math.floor(data.currentTime)});
this.setState({
currentTime: Math.ceil(data.currentTime)
});
};
// 完成录音
AudioRecorder.onFinished = (data) => {
// data 返回需要上传到后台的录音数据
console.warn(this.state.currentTime)
console.warn(data)
console.log('录音完毕hello:------------------',data)
};
})
}
......@@ -407,7 +423,7 @@ class EquipConsuPage extends Component {
// 开始录音
_record = async () => {
console.warn('changan')
console.warn('录音开始=====')
show('录音开始')
if(!this.state.hasPermission) {
......@@ -459,7 +475,7 @@ class EquipConsuPage extends Component {
// 停止录音
_stop = async () => {
console.warn('tanqi')
console.warn('停止录音====')
show('录音结束')
console.warn('停止录音',this.state.currentTime)
try {
......@@ -512,8 +528,8 @@ class EquipConsuPage extends Component {
let { quick_list_status, loginState, navigation, submit_quick_order_status} = this.props
let self = this
if(quick_list_status != nextProps.quick_list_status) {
console.warn('-222------', nextProps.quick_list_status)
console.warn('--222---quick_list_status--', quick_list_status)
// console.warn('-222------', nextProps.quick_list_status)
// console.warn('--222---quick_list_status--', quick_list_status)
switch (nextProps.quick_list_status) {
case QUICK_ORDER_LIST_DOING:
this.changeSubLoding(true)
......@@ -531,7 +547,7 @@ class EquipConsuPage extends Component {
break;
}
}
console.log('-----nextProps.loginState----', nextProps.loginState, loginState)
// console.log('-----nextProps.loginState----', nextProps.loginState, loginState)
if(loginState != nextProps.loginState) {
switch(nextProps.loginState) {
case LOGIN_NO:
......@@ -542,19 +558,19 @@ class EquipConsuPage extends Component {
}
}
if(submit_quick_order_status != nextProps.submit_quick_order_status) {
console.warn('-submit_quick_order_status------', nextProps.submit_quick_order_status)
console.warn('--222---submit_quick_order_status--', submit_quick_order_status)
// console.warn('-submit_quick_order_status------', nextProps.submit_quick_order_status)
// console.warn('--222---submit_quick_order_status--', submit_quick_order_status)
switch (nextProps.submit_quick_order_status) {
case QUICK_ORDER_LIST_DOING:
case QUICK_SUBMIT_DOING:
this.changeSubLoding(true, '提交中')
break;
case QUICK_ORDER_LIST_SUCCESS:
case QUICK_SUBMIT_SUCCESS:
self.changeSubLoding(false, '提交中')
setTimeout(() => {
self.processReturnData()
}, 500)
break;
case QUICK_ORDER_LIST_FAILURE:
case QUICK_SUBMIT_FAILURE:
this.changeSubLoding(false, '提交中')
break;
default:
......@@ -573,7 +589,6 @@ class EquipConsuPage extends Component {
// 清空当前项以下的值
clearInitNameAndValue(curIndex) {
// let tempIndex = curIndex+1
let { listOptionData, localOtherObj } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
......@@ -586,6 +601,32 @@ class EquipConsuPage extends Component {
})
}
// 判断是否都有值,修改提交按钮的颜色
changeCanSub(isSubCheck) {
let { listOptionData } = this.state
let tempStatus = false
let tempTit = ''
for(let chIndex in listOptionData) {
if(chIndex > 0 && chIndex < 10
&& chIndex != 6 && chIndex != 8
&& !listOptionData[chIndex].value
&& listOptionData[chIndex].name !== '其他') {
// console.log('chIndex-----',chIndex, chIndex !== 6, typeof chIndex, listOptionData[chIndex].title)
// 不是主治医生
tempTit = listOptionData[chIndex].title
tempStatus = true
break
}
}
// console.log('tempStatus====',tempStatus)
this.setState({
canSubFlag: !tempStatus
})
if(isSubCheck && tempStatus) {
show(`${tempTit}未选择,不能提交`)
}
}
// 选择器弹窗回调函数
handleCallBack(item, itemTitle) {
// console.warn(item, 'item------')
......@@ -595,30 +636,17 @@ class EquipConsuPage extends Component {
this.setState({
currentItem: item,
})
// if(itemTitle === '组织' || itemTitle === '手术医院') {
this.setState({
listOptionData: listOptionData.map((chItem, index) => {
if(chItem.title === itemTitle) {
console.warn('---hhh-----', item)
// console.warn('---hhh-----', item)
chItem.name = item.name
chItem.value = item.value
if(itemTitle === '组织') {
self.clearInitNameAndValue(1)
// self.getCustomerData()
// listOptionData[2].name = localOtherObj.name
// listOptionData[2].value = localOtherObj.value
// listOptionData[3].name = localOtherObj.name
// listOptionData[3].value = localOtherObj.value
// listOptionData[4].name = localOtherObj.name
// listOptionData[4].value = localOtherObj.value
// listOptionData[5].name = localOtherObj.name
// listOptionData[5].value = localOtherObj.value
// listOptionData[6].name = localOtherObj.name
// listOptionData[6].value = localOtherObj.value
// listOptionData[7].name = localOtherObj.name
// listOptionData[7].value = localOtherObj.value
// listOptionData[9].name = localOtherObj.name
// listOptionData[9].value = localOtherObj.value
}
if(itemTitle === '手术医院') {
self.clearInitNameAndValue(2)
}
if (itemTitle === '主治医生') {
if(item.name === '其他') {
......@@ -627,6 +655,10 @@ class EquipConsuPage extends Component {
chItem.showInput = false
chItem.inputValue = ''
}
self.clearInitNameAndValue(5)
}
if(itemTitle === '手术类型') {
self.clearInitNameAndValue(6)
}
if (itemTitle === '配台模版') {
// localTemplateOption
......@@ -635,9 +667,9 @@ class EquipConsuPage extends Component {
}
return chItem
})
}, () => {
self.changeCanSub()
})
// }
// console.warn('listOptionData[2]-----',this.state.listOptionData[2])
}
......@@ -652,7 +684,7 @@ class EquipConsuPage extends Component {
changeCurrentOption() {
let { listOptionData, currentTitle, localCustomersOption } = this.state
let { quickOrderOption } = this.props
console.warn('当前:--quickOrderOption---', quickOrderOption)
console.log('当前:--quickOrderOption---', quickOrderOption)
let tempOption = []
if(quickOrderOption.length === 0) {
show(`当前${currentTitle}为空`)
......@@ -661,21 +693,6 @@ class EquipConsuPage extends Component {
if (currentTitle === '组织') {
tempOption = this.changeNameAndValue(quickOrderOption, 'org_name', 'org_code')
} else if (currentTitle === '手术医院') {
// tempOption =[
// {
// customer_name: '医院-4',
// customer_code: 'customer_4'
// },
// {
// customer_name: '医院-5',
// customer_code: 'customer_5'
// },
// {
// customer_name: '医院-6',
// customer_code: 'customer_6'
// }
// ]
this.setState({
localCustomersOption: quickOrderOption
})
......@@ -695,102 +712,16 @@ class EquipConsuPage extends Component {
})
}
console.log('---currentArr----', currentArr)
// console.log('---currentArr----', currentArr)
tempOption = this.changeNameAndValue(currentArr, 'customer_name', 'customer_code')
} else if (currentTitle === '收单地点') {
// tempOption =[
// {
// bill_to_site_name: '收单地点-4',
// bill_to_site_code: 'bill_4'
// },
// {
// bill_to_site_name: '收单地点-5',
// bill_to_site_code: 'bill_5'
// },
// {
// bill_to_site_name: '收单地点-6',
// bill_to_site_code: 'bill_6'
// }
// ]
// tempOption = this.changeNameAndValue(tempOption, 'bill_to_site_name', 'bill_to_site_code')
} else if (currentTitle === '收货地点') {
// tempOption =[
// {
// ship_to_site_name: '收货地点-4',
// ship_to_site_code: 'ship_4'
// },
// {
// ship_to_site_name: '收货地点-5',
// ship_to_site_code: 'ship_5'
// },
// {
// ship_to_site_name: '收货地点-6',
// ship_to_site_code: 'ship_6'
// }
// ]
// tempOption = this.changeNameAndValue(tempOption, 'ship_to_site_name', 'ship_to_site_code')
} else if (currentTitle === '主治医生') {
// tempOption =[
// {
// doctor_name: '主治医生-4',
// doctor_code: 'doctor_4'
// },
// {
// doctor_name: '主治医生-5',
// doctor_code: 'doctor_5'
// },
// {
// doctor_name: '主治医生-6',
// doctor_code: 'doctor_6'
// }
// ]
// tempOption.push({
// doctor_name: '其他',
// doctor_code: '-1'
// })
// tempOption = this.changeNameAndValue(tempOption, 'doctor_name', 'doctor_code')
} else if (currentTitle === '手术类型') {
// tempOption =[
// {
// surgery_type_name: '手术类型-4',
// surgery_type_code: 'surgery_4'
// },
// {
// surgery_type_name: '手术类型-5',
// surgery_type_code: 'surgery_5'
// },
// {
// surgery_type_name: '手术类型-6',
// surgery_type_code: 'surgery_6'
// }
// ]
// tempOption = this.changeNameAndValue(tempOption, 'surgery_type_name', 'surgery_type_code')
} else if (currentTitle === '配台模版') {
// tempOption =[
// {
// template_name: '配台模版-4',
// template_number: 'order_4'
// },
// {
// template_name: '配台模版-5',
// template_number: 'order_5'
// },
// {
// template_name: '配台模版-6',
// template_number: 'order_6'
// }
// ]
// ===== doctor_name 、 template_desc
this.setState({
localTemplateOption: quickOrderOption
})
// this.setState({
// localTemplateOption: quickOrderOption
// })
let resultArr = []
quickOrderOption.forEach(item => {
let obj = {}
let tempName = item.template_name
......@@ -806,21 +737,6 @@ class EquipConsuPage extends Component {
// tempOption = this.changeNameAndValue(quickOrderOption, 'template_name', 'template_number')
} else if (currentTitle === '订单类型') {
// tempOption =[
// {
// order_type_name: '订单类型-4',
// order_type_code: 'order_4'
// },
// {
// order_type_name: '订单类型-5',
// order_type_code: 'order_5'
// },
// {
// order_type_name: '订单类型-6',
// order_type_code: 'order_6'
// }
// ]
tempOption = this.changeNameAndValue(quickOrderOption, 'value_name', 'value_code')
}
this.setState({
......@@ -843,7 +759,7 @@ class EquipConsuPage extends Component {
// 组织 点击
handleOrganizationCheck() {
console.warn('组织------check')
// console.warn('组织------check')
let { state, props } = this
this.setState({
currentTitle: '组织',
......@@ -861,7 +777,7 @@ class EquipConsuPage extends Component {
// 手术医院 点击
handleCustomerCheck() {
console.warn('手术医院------check')
// console.warn('手术医院------check')
let { state, props } = this
let self = this
if(this.judgeOrgIsNull()) {
......@@ -873,13 +789,6 @@ class EquipConsuPage extends Component {
}
}, () => {
// 在此修改接口
// let params = {
// access_token: props.token,
// org_code: state.listOptionData[1].value,
// seller_code: props.userInfo.user_name
// }
// console.log('-----params---', params)
// props.requestQuickSurgeryHospital(params)
self.getCustomerData()
})
}
......@@ -893,13 +802,13 @@ class EquipConsuPage extends Component {
org_code: state.listOptionData[1].value,
seller_code: props.userInfo.user_name
}
console.log('-----params---', params)
// console.log('-----params---', params)
props.requestQuickSurgeryHospital(params)
}
// 收单地点 点击
handleBillCheck() {
console.warn('收单地点------check')
// console.warn('收单地点------check')
let { localCustomersOption, listOptionData } = this.state
let self = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
......@@ -923,7 +832,7 @@ class EquipConsuPage extends Component {
})
}
tempOption = dedupQuoteArray(tempOption, 'name')
console.log('---tempOption========?????-', tempOption)
// console.log('---tempOption========?????-', tempOption)
self.setState({
showTypePop: true,
......@@ -935,7 +844,7 @@ class EquipConsuPage extends Component {
// 收货地点 点击
handleShipCheck() {
console.warn('收货地点------check')
// console.warn('收货地点------check')
let { localCustomersOption, listOptionData } = this.state
let self = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
......@@ -959,7 +868,7 @@ class EquipConsuPage extends Component {
})
}
tempOption = dedupQuoteArray(tempOption, 'name')
console.log('---tempOption========?????-', tempOption)
// console.log('---tempOption========?????-', tempOption)
self.setState({
showTypePop: true,
......@@ -971,7 +880,7 @@ class EquipConsuPage extends Component {
// 主治医生 点击/输入
handleDoctorCheck(text) {
console.warn('主治医生------check', text)
// console.warn('主治医生------check', text)
let { localCustomersOption, listOptionData } = this.state
let self = this
if(text) {
......@@ -1008,11 +917,11 @@ class EquipConsuPage extends Component {
}
let othObj = {
name: '其他',
value: ''
value: '-1'
}
tempOption.push(othObj)
tempOption = dedupQuoteArray(tempOption, 'name')
console.log('---tempOption========?????-', tempOption)
// console.log('---tempOption========?????-', tempOption)
self.setState({
showTypePop: true,
listCurrentOption: [...tempOption]
......@@ -1023,7 +932,7 @@ class EquipConsuPage extends Component {
// 手术类型 点击
handleSurTypeCheck() {
console.warn('手术类型------check')
// console.warn('手术类型------check')
let { listOptionData, surgeryTypeOption } = this.state
let self = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
......@@ -1044,7 +953,7 @@ class EquipConsuPage extends Component {
// 配台模版 点击
handleMatchTempCheck() {
console.warn('配台模版------check')
// console.warn('配台模版------check')
let { state, props } = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
this.setState({
......@@ -1055,15 +964,19 @@ class EquipConsuPage extends Component {
}
}, () => {
// 在此修改接口
let tempDoctorName = ''
if(state.listOptionData[5].name !== '其他') {
tempDoctorName = state.listOptionData[5].value
}
let params = {
access_token: props.token,
org_code: state.listOptionData[1].value,
seller_code: props.userInfo.user_name,
customer_code: state.listOptionData[2].value,
surgery_type: state.listOptionData[6].value,
doctor_name: state.listOptionData[5].value
doctor_name: tempDoctorName
}
console.log('-----params---', params)
// console.log('-----params---', params)
props.requestQuickTemplateCollect(params)
})
}
......@@ -1071,7 +984,7 @@ class EquipConsuPage extends Component {
// 手术类时间 点击 2020-04-23 17:41
handleSurDateCheck() {
console.warn('手术类时间 点击 ===')
// console.warn('手术类时间 点击 ===')
let { listOptionData } = this.state
let date = listOptionData[8].value
if(date) {
......@@ -1083,7 +996,7 @@ class EquipConsuPage extends Component {
return item
})
})
console.warn('!date----', listOptionData[8])
// console.warn('!date----', listOptionData[8])
}
this.closeDateModal(true)
}
......@@ -1097,7 +1010,7 @@ class EquipConsuPage extends Component {
// 修改当前日期数据
dateModalCallback(date) {
console.warn('callback',date)
// console.warn('callback',date)
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
......@@ -1109,12 +1022,12 @@ class EquipConsuPage extends Component {
return item
})
})
console.warn('--手术类时间---', listOptionData[8])
// console.warn('--手术类时间---', listOptionData[8])
}
// 订单类型 点击
handleOrderCheck() {
console.warn('订单类型------check')
// console.warn('订单类型------check')
let { state, props } = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
this.setState({
......@@ -1129,7 +1042,7 @@ class EquipConsuPage extends Component {
access_token: props.token,
value_set_code:'SUR_ORDER_TYPE'
}
console.log('-----params---', params)
// console.log('-----params---', params)
props.requestQuickOrderType(params)
})
}
......@@ -1137,7 +1050,7 @@ class EquipConsuPage extends Component {
// 备注 输入
handleRemarkInput(text) {
console.warn('备注---',text)
// console.warn('备注---',text)
let { listOptionData } = this.state
this.setState({
listOptionData: listOptionData.map((item, index) => {
......@@ -1151,38 +1064,49 @@ class EquipConsuPage extends Component {
// 生成订单 点击
handleSubmit() {
this.changeCanSub(true)
let { state, props } = this
let params = {
access_token: props.token,
path: state.audioPath
}
console.log('---handleSubmit--',params)
props.requestQuickAudio(params)
// this.addPhotoAction()
// // // 测试 -- 录音
// // let params = {
// // access_token: props.token,
// // path: state.audioPath
// // }
// // console.log('---handleSubmit--',params)
// // props.requestQuickAudio(params)
// console.warn(state.listOptionData)
// // // 测试 -- 图片上传
// // this.addPhotoAction()
// let tempSubOption = {...state.submitOption}
// tempSubOption.seller_code = state.listOptionData[0].value
// tempSubOption.org_code = state.listOptionData[1].value
// tempSubOption.customer_code = state.listOptionData[2].value
// tempSubOption.bill_to_site_code = state.listOptionData[3].value
// tempSubOption.ship_to_site_code = state.listOptionData[4].value
// tempSubOption.doctor_name = state.listOptionData[5].value
// tempSubOption.template_collect_number = state.listOptionData[7].value
// tempSubOption.surgery_date = state.listOptionData[8].value
// tempSubOption.order_type_code = state.listOptionData[9].value
// tempSubOption.surgery_desc = state.listOptionData[10].value
// tempSubOption.voice_url = state.listOptionData[11].value
console.log('提交======》', state.canSubFlag)
if(state.canSubFlag) {
// console.warn(state.listOptionData)
// console.warn('tempSubOption-----', tempSubOption)
// let params = { access_token: props.token, ...tempSubOption}
// // Object.assign({},{ access_token: props.token }, tempSubOption)
// // this.setState({
let tempSubOption = state.submitOption
tempSubOption.seller_code = state.listOptionData[0].value
tempSubOption.org_code = state.listOptionData[1].value
tempSubOption.customer_code = state.listOptionData[2].value
tempSubOption.bill_to_site_code = state.listOptionData[3].value
tempSubOption.ship_to_site_code = state.listOptionData[4].value
if(state.listOptionData[5].name === '其他') {
tempSubOption.doctor_name = state.listOptionData[5].inputValue
} else {
tempSubOption.doctor_name = state.listOptionData[5].value
}
tempSubOption.template_collect_number = state.listOptionData[7].value
tempSubOption.surgery_date = state.listOptionData[8].value
tempSubOption.order_type_code = state.listOptionData[9].value
tempSubOption.surgery_desc = state.listOptionData[10].value
tempSubOption.voice_url = state.listOptionData[11].value
// // })
// props.requestQuickSumbit(params)
console.log('tempSubOption-----', tempSubOption)
let params = {
access_token: props.token,
data: { ...tempSubOption }
}
props.requestQuickSumbit(params)
}
}
// 判断组织是否为空
......@@ -1211,27 +1135,58 @@ class EquipConsuPage extends Component {
// 处理提交后返回的数据
processReturnData() {
let { listOptionData, currentTitle, localCustomersOption } = this.state
let { quickOrderOption } = this.props
console.warn('submit --- --- 当前:--quickOrderOption---', quickOrderOption)
console.log('submit --- !!!! --- 当前:--quickOrderOption---', quickOrderOption)
if(quickOrderOption.create_success) {
if(quickOrderOption.create_success == 'N') {
// 打开库存不足弹窗
this.setState({
notEnoughList: quickOrderOption.not_enough_items_list,
showNotEnogPop: true
})
} else if(quickOrderOption.create_success == 'Y') {
// 打开下单成功页面
let { state: { params: { title } } } = this.props.navigation
this.props.navigation.navigate('SubSuccPage', {
title: `${title} - 下单成功`,
orderNumber: quickOrderOption.survey_collect_number
})
}
}
}
// 库存不足弹窗回调 -- 确定
handleNotEnoughCallBack() {
// console.log('callback----heihei: 点击确定!!!')
// 再次调用提交并修改 force_balance_check_flag
let { submitOption } = this.state
let self = this
this.setState({
submitOption: {
...submitOption,
force_balance_check_flag: 'N'
}
}, () => {
// console.log('hhh--',this.state.submitOption )
self.handleSubmit()
})
}
// 库存不足弹窗关闭
handleNotEnoughCloseModal(show) {
// console.log('closeModal----heihei:', show)
this.setState({
showNotEnogPop: show
})
}
// 返回备注以上的元素
renderListItem() {
let { listOptionData, dateModelPop } = this.state
let {userInfo:{ person_name }} = this.props
if(!isEmpty(person_name)) {
// this.setState({
// listOptionData: listOptionData.map(item => {
// if(item.title === '销售员') {
// item.name = person_name
// item.value = person_name
// }
// return item
// })
// })
}
return(
<View style={styles.list_cont}>
<View style={styles.item_container}>
......@@ -1253,7 +1208,7 @@ class EquipConsuPage extends Component {
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'组织'}</TitleTextStyle>
<ContTextStyle>{listOptionData[1].name} -- {listOptionData[1].value}</ContTextStyle>
<ContTextStyle>{listOptionData[1].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
......@@ -1266,7 +1221,7 @@ class EquipConsuPage extends Component {
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'手术医院'}</TitleTextStyle>
<ContTextStyle>{listOptionData[2].name} -- {listOptionData[2].value}</ContTextStyle>
<ContTextStyle>{listOptionData[2].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
......@@ -1279,7 +1234,7 @@ class EquipConsuPage extends Component {
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'收单地点'}</TitleTextStyle>
<ContTextStyle>{listOptionData[3].name} -- {listOptionData[3].value}</ContTextStyle>
<ContTextStyle>{listOptionData[3].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
......@@ -1292,7 +1247,7 @@ class EquipConsuPage extends Component {
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'收货地点'}</TitleTextStyle>
<ContTextStyle>{listOptionData[4].name} -- {listOptionData[4].value}</ContTextStyle>
<ContTextStyle>{listOptionData[4].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
......@@ -1305,7 +1260,7 @@ class EquipConsuPage extends Component {
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'主治医生'}</TitleTextStyle>
<ContTextStyle>{listOptionData[5].name} -- {listOptionData[5].value}</ContTextStyle>
<ContTextStyle>{listOptionData[5].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
......@@ -1327,9 +1282,8 @@ class EquipConsuPage extends Component {
onPress={() => this.handleSurTypeCheck()}
>
<CellTextStyle>
{/* <AsteriskTextStyle>*</AsteriskTextStyle> */}
<TitleTextStyle>{'手术类型'}</TitleTextStyle>
<ContTextStyle>{listOptionData[6].name} -- {listOptionData[6].value}</ContTextStyle>
<ContTextStyle>{listOptionData[6].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
......@@ -1342,7 +1296,7 @@ class EquipConsuPage extends Component {
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'配台模版'}</TitleTextStyle>
<ContTextStyle>{listOptionData[7].name} -- {listOptionData[7].value}</ContTextStyle>
<ContTextStyle>{listOptionData[7].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
......@@ -1354,7 +1308,7 @@ class EquipConsuPage extends Component {
>
<CellTextStyle>
<TitleTextStyle>{'手术类时间'}</TitleTextStyle>
<ContTextStyle>{listOptionData[8].name} -- {listOptionData[8].value}</ContTextStyle>
<ContTextStyle>{listOptionData[8].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
......@@ -1375,7 +1329,7 @@ class EquipConsuPage extends Component {
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'订单类型'}</TitleTextStyle>
<ContTextStyle>{listOptionData[9].name} -- {listOptionData[9].value}</ContTextStyle>
<ContTextStyle>{listOptionData[9].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
......@@ -1404,20 +1358,10 @@ class EquipConsuPage extends Component {
currentTitle,
showTypePop,
} = this.state
// console.warn('弹窗-----,', listCurrentOption)
return (
<SafeAreaView style={styles.item_container}>
<DialogModel
// entityList={typeArr}
// callback={(i) => {
// this.setState({
// type: i,
// typeName: typeArr[i],
// })
// }}
// itemIndex={this.state.type}
entityList={listCurrentOption}
callback={(item, itemTitle) => this.handleCallBack(item, itemTitle)}
show={showTypePop}
......@@ -1502,10 +1446,17 @@ class EquipConsuPage extends Component {
<View style={styles.play_btn}>
<TouchableOpacity
activeOpacity = {.8}
style={styles.reco_list_box}
style={[styles.reco_list_box, styles.reco_del_btn]}
onPress={this._del}
>
<Text style={[styles.reco_text, styles.reco_del_tit]}> 删除 </Text>
</TouchableOpacity>
<TouchableOpacity
activeOpacity = {.8}
style={[styles.reco_list_box, styles.reco_play_btn]}
onPress={this._play}
>
<Text style={styles.reco_text}> 播放 </Text>
<Text style={[styles.reco_text, styles.reco_play_tit]}> 播放({currentTime}‘‘) </Text>
</TouchableOpacity>
{/* <TouchableOpacity
activeOpacity = {.8}
......@@ -1514,13 +1465,6 @@ class EquipConsuPage extends Component {
>
<Text style={styles.reco_text}> 停止 </Text>
</TouchableOpacity> */}
<TouchableOpacity
activeOpacity = {.8}
style={styles.reco_list_box}
onPress={this._del}
>
<Text style={styles.reco_text}> 删除 </Text>
</TouchableOpacity>
</View>
</View>
......@@ -1539,6 +1483,24 @@ class EquipConsuPage extends Component {
)
}
// 返回库存不足弹窗
renderNotEnoughModel() {
let {
notEnoughList,
showNotEnogPop
} = this.state
return (
<SafeAreaView style={styles.item_container}>
<NotEnoughModel
notEnoughList={notEnoughList}
callback={() => this.handleNotEnoughCallBack()}
show={showNotEnogPop}
closeModal={(show) => this.handleNotEnoughCloseModal(show)}
/>
</SafeAreaView>
)
}
render() {
let {canSubFlag} = this.state
let {navigation} = this.props
......@@ -1576,6 +1538,8 @@ class EquipConsuPage extends Component {
{ this.renderLodingItem() }
{ this.renderNotEnoughModel() }
</SafeAreaView>
</View>
);
......@@ -1689,7 +1653,7 @@ const styles = StyleSheet.create({
},
play_tit:{
flexDirection: 'row',
justifyContent: 'space-around',
justifyContent: 'space-between',
alignItems: 'center',
height: 60
},
......@@ -1700,7 +1664,7 @@ const styles = StyleSheet.create({
},
play_btn:{
flexDirection: 'row',
justifyContent: 'space-around',
justifyContent: 'space-between',
alignItems: 'center',
// height: 80
},
......@@ -1714,11 +1678,30 @@ const styles = StyleSheet.create({
height: 34,
width: pxSize(100)
},
reco_del_btn: {
backgroundColor: promary_color,
height: 20,
borderRadius: 5,
width: pxSize(60)
},
reco_play_btn: {
width: pxSize(200),
borderRadius: 5,
height: 34,
borderColor: '#DFDFDF',
borderWidth: 1,
backgroundColor: foundation_color
},
reco_text: {
fontSize: second_text_size,
color: first_text_color,
fontFamily: font_family_regular
},
reco_del_tit: {
color: title_text_color,
fontSize: third_text_size
},
reco_play_tit: {},
sub_btn_pro: {
backgroundColor: promary_color
},
......
......@@ -28,7 +28,6 @@ export const GetRequest = (url) => {
const opts = {
method: 'GET',
headers: {
// 'Accept': 'application/json',
'Content-Type': 'application/json'
},
timeout: 20000 //20s超时
......@@ -40,7 +39,7 @@ export const GetRequest = (url) => {
}
let allUrl = endBashUrl + VERSION + url
console.warn('---allUrl--=================--', allUrl)
// console.warn('---allUrl--=================--', allUrl)
// return fetch(BaseUrl + VERSION + url, opts)
return fetch(allUrl, opts)
.then(response => response.json())
......
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