Commit 46259d8e by Denglingling

对接钉盒明细接口,已经自助下单提交接口

parent a39ad05f
...@@ -9,7 +9,6 @@ import HomePage from './containers/home/HomePage'; ...@@ -9,7 +9,6 @@ import HomePage from './containers/home/HomePage';
import SelfOrderPage from './containers/selfOrder/SelfOrderPage'; import SelfOrderPage from './containers/selfOrder/SelfOrderPage';
import ChooseProductPage from './containers/selfOrder/module/ChooseProductPage'; import ChooseProductPage from './containers/selfOrder/module/ChooseProductPage';
import EditThirdLevelPage from './containers/selfOrder/module/EditThirdLevelPage'; import EditThirdLevelPage from './containers/selfOrder/module/EditThirdLevelPage';
import SubSuccessPage from './containers/selfOrder/module/SubSuccessPage';
import EquipConsuPage from './containers/equipConsu/EquipConsuPage'; import EquipConsuPage from './containers/equipConsu/EquipConsuPage';
import ConsumDetailsPage from './containers/equipConsu//module/ConsumDetailsPage'; import ConsumDetailsPage from './containers/equipConsu//module/ConsumDetailsPage';
import FillUnitPricePage from './containers/equipConsu/module/FillUnitPricePage'; import FillUnitPricePage from './containers/equipConsu/module/FillUnitPricePage';
...@@ -31,7 +30,6 @@ const Router = createAppContainer(createStackNavigator({ ...@@ -31,7 +30,6 @@ const Router = createAppContainer(createStackNavigator({
SelfOrderPage: {screen: SelfOrderPage}, SelfOrderPage: {screen: SelfOrderPage},
ChooseProductPage: {screen: ChooseProductPage}, ChooseProductPage: {screen: ChooseProductPage},
EditThirdLevelPage: {screen: EditThirdLevelPage}, EditThirdLevelPage: {screen: EditThirdLevelPage},
SubSuccessPage: {screen: SubSuccessPage},
EquipConsuPage: {screen: EquipConsuPage}, EquipConsuPage: {screen: EquipConsuPage},
ConsumDetailsPage: {screen: ConsumDetailsPage}, ConsumDetailsPage: {screen: ConsumDetailsPage},
FillUnitPricePage: {screen: FillUnitPricePage}, FillUnitPricePage: {screen: FillUnitPricePage},
......
...@@ -198,7 +198,6 @@ export function requestSelfSumbit({access_token, ...params}) { ...@@ -198,7 +198,6 @@ export function requestSelfSumbit({access_token, ...params}) {
dispatch(requestSubmiting()); dispatch(requestSubmiting());
let {global_domain_config} = getState().login let {global_domain_config} = getState().login
PostRequest(global_domain_config, getUrlParams('/order/sur_requirement/create', {access_token: access_token}), params) PostRequest(global_domain_config, getUrlParams('/order/sur_requirement/create', {access_token: access_token}), params)
// PostRequest(global_domain_config, getUrlParams('/surgery/collect_order/via_data/create', {access_token: access_token}), params)
.then(res => { .then(res => {
console.log('提交数据 res=====', res); console.log('提交数据 res=====', res);
if(res.error_code == 0) { if(res.error_code == 0) {
...@@ -223,67 +222,67 @@ export function requestSelfSumbit({access_token, ...params}) { ...@@ -223,67 +222,67 @@ export function requestSelfSumbit({access_token, ...params}) {
// 选择产品-供应商信息查询接口 // 选择产品-供应商信息查询接口
export const reqPurSupplierSearch = async (global_domain_config, params) => { export const reqPurSupplierSearch = async (global_domain_config, params) => {
return local_inter_mock.inter_1 // return local_inter_mock.inter_1
return await GetRequest(global_domain_config, getUrlParams('/order/pur_supplier/search', params)) return await GetRequest(global_domain_config, getUrlParams('/order/pur_supplier/search', params))
} }
// 选择产品-产品信息分类查询接口 // 选择产品-产品信息分类查询接口
export const reqProCategorySearch = async (global_domain_config, params) => { export const reqProCategorySearch = async (global_domain_config, params) => {
return local_inter_mock.inter_2 // return local_inter_mock.inter_2
return await GetRequest(global_domain_config, getUrlParams('/order/item/search', params)) return await GetRequest(global_domain_config, getUrlParams('/order/item/search', params))
} }
// 选择产品-手术模板头查询接口 // 选择产品-手术模板头查询接口
export const reqSurTempHeadSearch = async (global_domain_config, params) => { export const reqSurTempHeadSearch = async (global_domain_config, params) => {
return local_inter_mock.inter_3 // return local_inter_mock.inter_3
return await GetRequest(global_domain_config, getUrlParams('/surgery/template_header/search', params)) return await GetRequest(global_domain_config, getUrlParams('/surgery/template_header/search', params))
} }
// 选择产品-手术模板行查询接口 // 选择产品-手术模板行查询接口
export const reqSurTempLineSearch = async (global_domain_config, params) => { export const reqSurTempLineSearch = async (global_domain_config, params) => {
return local_inter_mock.inter_4 // return local_inter_mock.inter_4
return await GetRequest(global_domain_config, getUrlParams('/surgery/template_line/search', params)) return await GetRequest(global_domain_config, getUrlParams('/surgery/template_line/search', params))
} }
// 选择产品-螺钉盒(器械包)头查询接口 // 选择产品-螺钉盒(器械包)头查询接口
export const reqNailEquipHeadSearch = async (global_domain_config, params) => { export const reqNailEquipHeadSearch = async (global_domain_config, params) => {
if(params.category_code === '1301'){ // if(params.category_code === '1301'){
return local_inter_mock.inter_5 // return local_inter_mock.inter_5
}else { // }else {
return local_inter_mock.inter_55 // return local_inter_mock.inter_55
} // }
return await GetRequest(global_domain_config, getUrlParams('/inventory/item_package_header/search', params)) return await GetRequest(global_domain_config, getUrlParams('/inventory/item_package_header/search', params))
} }
// 选择产品-螺钉盒明细查询接口 // 选择产品-螺钉盒明细查询接口
export const reqNailBoxLineSearch = async (global_domain_config, params) => { export const reqNailBoxLineSearch = async (global_domain_config, params) => {
return local_inter_mock.inter_6 // return local_inter_mock.inter_6
return await GetRequest(global_domain_config, getUrlParams('/inventory/nail_box_template_detail/search', params)) return await GetRequest(global_domain_config, getUrlParams('/inventory/nail_box_template_detail/search', params))
} }
// 选择产品-器械包明细查询接口 // 选择产品-器械包明细查询接口
export const reqEquipPackageLineSearch = async (global_domain_config, params) => { export const reqEquipPackageLineSearch = async (global_domain_config, params) => {
return local_inter_mock.inter_7 // return local_inter_mock.inter_7
return await GetRequest(global_domain_config, getUrlParams('/inventory/item_package/search', params)) return await GetRequest(global_domain_config, getUrlParams('/inventory/item_package/search', params))
} }
// 选择产品-零散器械查询接口 // 选择产品-零散器械查询接口
export const reqScatEquipmentSearch = async (global_domain_config, params) => { export const reqScatEquipmentSearch = async (global_domain_config, params) => {
return local_inter_mock.inter_8 // return local_inter_mock.inter_8
return await GetRequest(global_domain_config, getUrlParams('/order/tool/search', params)) return await GetRequest(global_domain_config, getUrlParams('/order/tool/search', params))
} }
// 选择产品-单点耗材查询接口 // 选择产品-单点耗材查询接口
export const reqSingleConsumSearch = async (global_domain_config, params) => { export const reqSingleConsumSearch = async (global_domain_config, params) => {
if(params.leftIndex && params.leftIndex%2 === 0){ // if(params.leftIndex && params.leftIndex%2 === 0){
return local_inter_mock.inter_9 // return local_inter_mock.inter_9
}else { // }else {
return local_inter_mock.inter_99 // return local_inter_mock.inter_99
} // }
return await GetRequest(global_domain_config, getUrlParams('/order/item_detail/search', params)) return await GetRequest(global_domain_config, getUrlParams('/order/item_detail/search', params))
} }
......
...@@ -24,6 +24,7 @@ class LodingModel extends Component { ...@@ -24,6 +24,7 @@ class LodingModel extends Component {
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
if (this.state.isVisible != nextProps.show) { if (this.state.isVisible != nextProps.show) {
console.log('nextProps.show====', nextProps.show)
this.setState({ this.setState({
isVisible: nextProps.show isVisible: nextProps.show
}) })
...@@ -32,6 +33,7 @@ class LodingModel extends Component { ...@@ -32,6 +33,7 @@ class LodingModel extends Component {
render() { render() {
let { title, size, color, style_back } = this.props let { title, size, color, style_back } = this.props
console.log('!!this.state.isVisible====', !!this.state.isVisible)
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Modal <Modal
......
...@@ -2,8 +2,6 @@ import React, { Component } from 'react'; ...@@ -2,8 +2,6 @@ import React, { Component } from 'react';
import { StyleSheet, Image, Text, TouchableOpacity, View, ScrollView } from 'react-native'; import { StyleSheet, Image, Text, TouchableOpacity, View, ScrollView } from 'react-native';
import { first_text_color, font_family_light, font_family_regular, font_family_semibold, foundation_color, home_background_color, icon_style, point_color, promary_color, pxSize, second_text_color, second_text_size, third_text_color, third_text_size, title_text_color, Width } from '../../../base/BaseStyle'; import { first_text_color, font_family_light, font_family_regular, font_family_semibold, foundation_color, home_background_color, icon_style, point_color, promary_color, pxSize, second_text_color, second_text_size, third_text_color, third_text_size, title_text_color, Width } from '../../../base/BaseStyle';
const PropTypes = require('prop-types'); const PropTypes = require('prop-types');
import PictureZoom from '../../common/listDataComponent/PictureZoom';
import PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu';
import localMockData from '../../selfOrder/module/mock/sen_mock'; import localMockData from '../../selfOrder/module/mock/sen_mock';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
...@@ -96,7 +94,8 @@ class ChooseCardList extends Component { ...@@ -96,7 +94,8 @@ class ChooseCardList extends Component {
<Image <Image
defaultSource={require('../../../images/not_img.png')} defaultSource={require('../../../images/not_img.png')}
source={item[cardItemIcon]} source={item[cardItemIcon]}
style={icon_style}/> : <Image source={item[cardItemIcon]} style={icon_style}/> style={icon_style}
resizeMode="cover"/> : <Image source={item[cardItemIcon]} style={icon_style} resizeMode="cover"/>
} }
</View> : null } </View> : null }
<Text numberOfLines={2} style={[styles.list_item_tit, cardStyleItemTit, item[cardItemIcon] ? '' : cardStyleNotIconTit, index == curActIndex ? [styles.list_tit_act, cardStyleItemTitAct] : '']}> <Text numberOfLines={2} style={[styles.list_item_tit, cardStyleItemTit, item[cardItemIcon] ? '' : cardStyleNotIconTit, index == curActIndex ? [styles.list_tit_act, cardStyleItemTitAct] : '']}>
......
...@@ -26,6 +26,7 @@ import PageListArrow from '../common/listDataComponent/PageListArrow'; ...@@ -26,6 +26,7 @@ import PageListArrow from '../common/listDataComponent/PageListArrow';
import EmitterEvents from '../common/EmitterEvents'; import EmitterEvents from '../common/EmitterEvents';
import TipInfoNeedSelect from '../common/listDataComponent/TipInfoNeedSelect'; import TipInfoNeedSelect from '../common/listDataComponent/TipInfoNeedSelect';
import LocalVariable from '../common/LocalVariable'; import LocalVariable from '../common/LocalVariable';
import LoadingModel from '../common/listDataComponent/LoadingModel';
const SELECTED_QUQNTITY = 'selectedQuantity' const SELECTED_QUQNTITY = 'selectedQuantity'
const SELECTED_DATA_ARR = 'selectedDataArr' const SELECTED_DATA_ARR = 'selectedDataArr'
...@@ -36,7 +37,7 @@ class SelfOrderPage extends Component { ...@@ -36,7 +37,7 @@ class SelfOrderPage extends Component {
super(props); super(props);
this.state = { this.state = {
canSubFlag: false, // 生成订单按钮样式改变 canSubFlag: false, // 生成订单按钮样式改变
listOptionData: [ // 备注以上的元素 listOptionData: [
{ {
"id": "0", "id": "0",
title: '销售员', title: '销售员',
...@@ -133,10 +134,10 @@ class SelfOrderPage extends Component { ...@@ -133,10 +134,10 @@ class SelfOrderPage extends Component {
doctor_name: '', // 主治医生 doctor_name: '', // 主治医生
surgery_name: '', // 手术名称 surgery_name: '', // 手术名称
surgery_date: '', // 手术时间 surgery_date: '', // 手术时间
surgery_type_code: '', // 手术类型 // surgery_type_code: '', // 手术类型,用来筛选手术模板
order_type_code: '', // 订单类型 order_type_code: '', // 订单类型
surgery_desc: '', // 备注信息 surgery_desc: '', // 备注信息
file_path: '', // 录音地址 voice_url: '', // 录音地址
}, },
currentItem: { currentItem: {
name: '请选择', name: '请选择',
...@@ -399,22 +400,22 @@ class SelfOrderPage extends Component { ...@@ -399,22 +400,22 @@ class SelfOrderPage extends Component {
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
let { self_list_status, loginState, navigation, submit_self_order_status } = this.props let { self_list_status, loginState, navigation, submit_self_order_status } = this.props
let self = this let that = this
if (self_list_status != nextProps.self_list_status) { if (self_list_status != nextProps.self_list_status) {
switch (nextProps.self_list_status) { switch (nextProps.self_list_status) {
case SELF_ORDER_LIST_DOING: case SELF_ORDER_LIST_DOING:
this.changeSubLoding(true) that.changeSubLoding(true)
break; break;
case SELF_ORDER_LIST_SUCCESS: case SELF_ORDER_LIST_SUCCESS:
self.setState({ that.setState({
isSubLoding: false, isSubLoding: false,
lodingTitle: '加载中' lodingTitle: '加载中'
}, () => { }, () => {
self.changeCurrentOption() that.changeCurrentOption()
}) })
break; break;
case SELF_ORDER_LIST_FAILURE: case SELF_ORDER_LIST_FAILURE:
this.changeSubLoding(false) that.changeSubLoding(false)
break; break;
default: default:
break; break;
...@@ -430,20 +431,22 @@ class SelfOrderPage extends Component { ...@@ -430,20 +431,22 @@ class SelfOrderPage extends Component {
} }
} }
if (submit_self_order_status != nextProps.submit_self_order_status) { if (submit_self_order_status != nextProps.submit_self_order_status) {
console.log('SELF_ORDER_LIST_SUCCESS=====', nextProps.submit_self_order_status)
switch (nextProps.submit_self_order_status) { switch (nextProps.submit_self_order_status) {
case SELF_SUBMIT_DOING: case SELF_SUBMIT_DOING:
this.changeSubLoding(true, '提交中') that.changeSubLoding(true, '提交中')
break; break;
case SELF_SUBMIT_SUCCESS: case SELF_SUBMIT_SUCCESS:
self.setState({ // that.setState({
isSubLoding: false, // isSubLoding: false,
lodingTitle: '提交中' // lodingTitle: '提交中'
}, () => { // }, () => {
self.processReturnData() // that.processReturnData()
}) // })
that.processReturnData()
break; break;
case SELF_SUBMIT_FAILURE: case SELF_SUBMIT_FAILURE:
this.changeSubLoding(false, '提交中') that.changeSubLoding(false, '提交中')
break; break;
default: default:
break; break;
...@@ -513,7 +516,7 @@ class SelfOrderPage extends Component { ...@@ -513,7 +516,7 @@ class SelfOrderPage extends Component {
let tempStatus = false let tempStatus = false
let tempTit = '' let tempTit = ''
for (let chIndex in listOptionData) { for (let chIndex in listOptionData) {
if(chIndex > 0 && chIndex < 11 if (chIndex > 0 && chIndex < 11 && chIndex != 8
&& !listOptionData[chIndex].value && !listOptionData[chIndex].value
&& listOptionData[chIndex].name !== '其他') { && listOptionData[chIndex].name !== '其他') {
// 不是主治医生 // 不是主治医生
...@@ -553,11 +556,10 @@ class SelfOrderPage extends Component { ...@@ -553,11 +556,10 @@ class SelfOrderPage extends Component {
chItem.showInput = false chItem.showInput = false
chItem.inputValue = '' chItem.inputValue = ''
} }
self.clearInitNameAndValue(5)
}
if (itemTitle === '手术类型') {
self.clearInitNameAndValue(8)
} }
// if (itemTitle === '手术类型') {
// self.clearInitNameAndValue(8)
// }
} }
}) })
this.setState({ this.setState({
...@@ -625,118 +627,6 @@ class SelfOrderPage extends Component { ...@@ -625,118 +627,6 @@ class SelfOrderPage extends Component {
}) })
}, 500) }, 500)
}) })
// let { listOptionData, currentTitle } = this.state
// let { selfOrderOption } = this.props
// console.log('当前:--selfOrderOption---', selfOrderOption)
// let tempOption = []
// if (currentTitle === '组织') {
// tempOption = this.changeNameAndValue(selfOrderOption, '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'
// }
// ]
// tempOption = this.changeNameAndValue(tempOption, '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 =[
// {
// 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(tempOption, 'order_type_name', 'order_type_code')
// }
// this.setState({
// showTypePop: true,
// listCurrentOption: [...tempOption]
// })
} }
// 修改选择器为属性 name 和 value // 修改选择器为属性 name 和 value
...@@ -767,20 +657,6 @@ class SelfOrderPage extends Component { ...@@ -767,20 +657,6 @@ class SelfOrderPage extends Component {
} }
props.requestSelfOrganizations(params) props.requestSelfOrganizations(params)
}) })
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.log('组织------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '组织',
// currentItem: {
// name: listOptionData[1].name,
// value: listOptionData[1].value
// }
// }, () => {
// requestSelfOrganizations(token)
// })
} }
// 客户名称 点击 // 客户名称 点击
...@@ -799,21 +675,6 @@ class SelfOrderPage extends Component { ...@@ -799,21 +675,6 @@ class SelfOrderPage extends Component {
self.getCustomerData() self.getCustomerData()
}) })
} }
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.log('客户名称------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '客户名称',
// currentItem: {
// name: listOptionData[2].name,
// value: listOptionData[2].value
// }
// }, () => {
// // 在此修改接口
// requestSelfOrganizations(token)
// })
} }
// 获取客户名称 // 获取客户名称
getCustomerData() { getCustomerData() {
...@@ -896,20 +757,6 @@ class SelfOrderPage extends Component { ...@@ -896,20 +757,6 @@ class SelfOrderPage extends Component {
}) })
}) })
} }
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.log('收单地点------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '收单地点',
// currentItem: {
// name: listOptionData[3].name,
// value: listOptionData[3].value
// }
// }, () => {
// // 在此修改接口
// requestSelfOrganizations(token)
// })
} }
customerGetBill() { customerGetBill() {
let { localCustomersOption, listOptionData } = this.state let { localCustomersOption, listOptionData } = this.state
...@@ -960,20 +807,6 @@ class SelfOrderPage extends Component { ...@@ -960,20 +807,6 @@ class SelfOrderPage extends Component {
}) })
}) })
} }
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.log('收货地点------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '收货地点',
// currentItem: {
// name: listOptionData[4].name,
// value: listOptionData[4].value
// }
// }, () => {
// // 在此修改接口
// requestSelfOrganizations(token)
// })
} }
customerGetShip() { customerGetShip() {
let { localCustomersOption, listOptionData } = this.state let { localCustomersOption, listOptionData } = this.state
...@@ -1030,35 +863,6 @@ class SelfOrderPage extends Component { ...@@ -1030,35 +863,6 @@ class SelfOrderPage extends Component {
}) })
}) })
} }
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.log('主治医生------check', token, requestSelfOrganizations)
// let self = this
// if(text) {
// // 输入
// this.setState({
// listOptionData: listOptionData.map(item => {
// if(item.title === '主治医生') {
// item.inputValue = text
// }
// return item
// })
// })
// } else {
// // 点击
// this.setState({
// currentTitle: '主治医生',
// currentItem: {
// name: listOptionData[5].name,
// value: listOptionData[5].value
// }
// }, () => {
// // 在此修改接口
// requestSelfOrganizations(token)
// })
// }
// console.log('主治医生------check',listOptionData[5])
} }
// 主治医生 输入 // 主治医生 输入
handleDoctorInput(text, curData) { handleDoctorInput(text, curData) {
...@@ -1071,7 +875,7 @@ class SelfOrderPage extends Component { ...@@ -1071,7 +875,7 @@ class SelfOrderPage extends Component {
this.setState({ this.setState({
listOptionData: listOptionData listOptionData: listOptionData
}) })
console.log('手术名称---', text, curData, listOptionData[5]) console.log('主治医生---', text, curData, listOptionData[5])
} }
// 手术名称 输入 // 手术名称 输入
...@@ -1127,7 +931,7 @@ class SelfOrderPage extends Component { ...@@ -1127,7 +931,7 @@ class SelfOrderPage extends Component {
this.setState({ this.setState({
listOptionData: listOptionData listOptionData: listOptionData
}) })
console.log('-----', listOptionData[7]) console.log('修改当前日期数据-----', listOptionData[7])
} }
// 手术类型 点击 // 手术类型 点击
...@@ -1149,20 +953,6 @@ class SelfOrderPage extends Component { ...@@ -1149,20 +953,6 @@ class SelfOrderPage extends Component {
props.requestSelfSurgeryType(params) props.requestSelfSurgeryType(params)
}) })
} }
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.log('手术类型------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '手术类型',
// currentItem: {
// name: listOptionData[8].name,
// value: listOptionData[8].value
// }
// }, () => {
// // 在此修改接口
// requestSelfOrganizations(token)
// })
} }
// 订单类型 点击 // 订单类型 点击
...@@ -1184,20 +974,6 @@ class SelfOrderPage extends Component { ...@@ -1184,20 +974,6 @@ class SelfOrderPage extends Component {
props.requestSelfOrderType(params) props.requestSelfOrderType(params)
}) })
} }
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.log('订单类型------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '订单类型',
// currentItem: {
// name: listOptionData[9].name,
// value: listOptionData[9].value
// }
// }, () => {
// // 在此修改接口
// requestSelfOrganizations(token)
// })
} }
// 选择产品 点击跳转 // 选择产品 点击跳转
...@@ -1216,25 +992,28 @@ class SelfOrderPage extends Component { ...@@ -1216,25 +992,28 @@ class SelfOrderPage extends Component {
// 选择产品 回调 // 选择产品 回调
productCallBack(params) { productCallBack(params) {
let { listOptionData } = this.state let { listOptionData } = this.state
// console.log('选择产品返回=!!!!=', params) console.log('选择产品返回=!!!!=', params)
// console.log('选择产品返回=!!!!=', this) console.log('选择产品返回=!!!!=', this)
// console.log('选择产品返回=!!!!=', this.state) console.log('选择产品返回=!!!!=', this.state)
listOptionData[10].value = '已选' listOptionData[10].name = '请选择'
listOptionData[10].value = ''
listOptionData[10].lines = [] listOptionData[10].lines = []
if (params && params.local_lines) { if (params && params.local_lines) {
params.local_lines.forEach(loc_item => { params.local_lines.forEach(loc_item => {
if (loc_item[SELECTED_QUQNTITY] > 0) { if (loc_item[SELECTED_QUQNTITY] > 0) {
listOptionData[10].value += `【${loc_item.supplier_short_name}】物料 ` listOptionData[10].value += `已选${loc_item.supplier_short_name}】物料 `
} }
}) })
if (!!listOptionData[10].value) {
listOptionData[10].name = listOptionData[10].value listOptionData[10].name = listOptionData[10].value
listOptionData[10].lines = cloneObject(params.local_lines) listOptionData[10].lines = cloneObject(params.local_lines)
} }
}
// console.log('选择产品返回=!!!=', listOptionData[10]) console.log('选择产品返回=!!!=', listOptionData[10])
this.setState({ this.setState({
listOptionData: listOptionData listOptionData: listOptionData
},() => { }, () => {
this.changeCanSub() this.changeCanSub()
}) })
} }
...@@ -1255,45 +1034,36 @@ class SelfOrderPage extends Component { ...@@ -1255,45 +1034,36 @@ class SelfOrderPage extends Component {
// 生成订单 点击 // 生成订单 点击
async handleSubmit() { async handleSubmit() {
console.log('生成订单', this.props.navigation) console.log('生成订单')
let { local_tip, listOptionData } = this.state
// this.refs.PackageModel.show()
// this.refs.CertModel.show('需要携带注册证?')
// this.getSumLinesOps()
this.changeCanSub(true) this.changeCanSub(true)
let { state, props } = this let { state, props } = this
let that = this let that = this
// 可提交 并且 不处于正在提交中 // 可提交 并且 不处于正在提交中
if(state.canSubFlag && !state.isSubLoding) { if (state.canSubFlag && !state.isSubLoding) {
// 先提交录音,再提交接口 // 先提交录音,再提交接口
if(state.stop) { if (state.stop) {
let params = { let params = {
access_token: props.token, access_token: props.token,
path: state.audioPath path: state.audioPath
} }
let {global_domain_config} = props let { global_domain_config } = props
let audioResult = await requestSelfAudio(global_domain_config, params); let audioResult = await requestSelfAudio(global_domain_config, params);
that.changeSubLoding(true, '上传中') that.changeSubLoding(true, '上传中')
if(audioResult.error_code == 0) { if (audioResult.error_code == 0) {
// 提交订单 // 提交订单
that.setState({ that.setState({
listOptionData: state.listOptionData.map((item, index) => { listOptionData: state.listOptionData.map((item, index) => {
if(index == 11) { if (index == 12) {
item.value = audioResult.data.url item.value = audioResult.data.url
} }
return item return item
}) })
}, () => { }, () => {
that.changeSubLoding(false) that.changeSubLoding(false)
that.submitSelfOrder() that.getSumLinesOps()
}) })
} else if(audioResult.error_code == 41006) { } else if (audioResult.error_code == 41006) {
that.changeSubLoding(false) that.changeSubLoding(false)
show('登录过期,请重新登录'); show('登录过期,请重新登录');
props.exitLoginStatus(); props.exitLoginStatus();
...@@ -1301,16 +1071,12 @@ class SelfOrderPage extends Component { ...@@ -1301,16 +1071,12 @@ class SelfOrderPage extends Component {
that.changeSubLoding(false) that.changeSubLoding(false)
let error_msg = audioResult.error_msg || audioResult.message let error_msg = audioResult.error_msg || audioResult.message
show(error_msg); show(error_msg);
that.submitSelfOrder() that.getSumLinesOps()
} }
} else { } else {
that.submitSelfOrder() that.getSumLinesOps()
} }
} }
// let { navigation } = this.props
// let { state: { params: { title } } } = navigation
// navigation.navigate('SubSuccessPage', { title: `${title} - 下单成功` })
} }
// 提交订单 // 提交订单
...@@ -1322,15 +1088,14 @@ class SelfOrderPage extends Component { ...@@ -1322,15 +1088,14 @@ class SelfOrderPage extends Component {
tempSubOption.customer_code = state.listOptionData[2].value tempSubOption.customer_code = state.listOptionData[2].value
tempSubOption.bill_to_site_code = state.listOptionData[3].value tempSubOption.bill_to_site_code = state.listOptionData[3].value
tempSubOption.ship_to_site_code = state.listOptionData[4].value tempSubOption.ship_to_site_code = state.listOptionData[4].value
if(state.listOptionData[5].name === '其他') { if (state.listOptionData[5].name === '其他') {
tempSubOption.doctor_name = state.listOptionData[5].inputValue tempSubOption.doctor_name = state.listOptionData[5].inputValue
} else { } else {
tempSubOption.doctor_name = state.listOptionData[5].value tempSubOption.doctor_name = state.listOptionData[5].value
} }
tempSubOption.surgery_name = state.listOptionData[6].value tempSubOption.surgery_name = state.listOptionData[6].value
// tempSubOption.template_collect_number = state.listOptionData[7].value
tempSubOption.surgery_date = state.listOptionData[7].value tempSubOption.surgery_date = state.listOptionData[7].value
tempSubOption.surgery_type_code = state.listOptionData[8].value // tempSubOption.surgery_type_code = state.listOptionData[8].value
tempSubOption.order_type_code = state.listOptionData[9].value tempSubOption.order_type_code = state.listOptionData[9].value
tempSubOption.surgery_desc = state.listOptionData[11].value tempSubOption.surgery_desc = state.listOptionData[11].value
tempSubOption.voice_url = state.listOptionData[12].value tempSubOption.voice_url = state.listOptionData[12].value
...@@ -1342,13 +1107,15 @@ class SelfOrderPage extends Component { ...@@ -1342,13 +1107,15 @@ class SelfOrderPage extends Component {
access_token: props.token, access_token: props.token,
data: { ...tempSubOption } data: { ...tempSubOption }
} }
console.log('submitSelfOrder!!!!',params ) console.log('submitSelfOrder!!!!', params)
// props.requestSelfSumbit(params)
// this.processReturnData() // 测试
props.requestSelfSumbit(params) // 正式
} }
// 获取选择产品提交接口需要的数据 // 获取选择产品提交接口需要的数据
getSumLinesOps() { getSumLinesOps() {
let { local_tip, listOptionData } = this.state let { listOptionData } = this.state
// 修改提交的行数据 // 修改提交的行数据
let local_lines = cloneObject(listOptionData[10].lines) let local_lines = cloneObject(listOptionData[10].lines)
let res_lines = [] let res_lines = []
...@@ -1445,9 +1212,9 @@ class SelfOrderPage extends Component { ...@@ -1445,9 +1212,9 @@ class SelfOrderPage extends Component {
listOptionData[10].sub_lines = res_lines listOptionData[10].sub_lines = res_lines
if(showPackageTip){ if (showPackageTip) {
this.refs.PackageModel.show() this.refs.PackageModel.show()
}else { } else {
this.refs.CertModel.show('需要携带注册证?') this.refs.CertModel.show('需要携带注册证?')
} }
} }
...@@ -1480,28 +1247,19 @@ class SelfOrderPage extends Component { ...@@ -1480,28 +1247,19 @@ class SelfOrderPage extends Component {
processReturnData() { processReturnData() {
let { selfOrderOption } = this.props let { selfOrderOption } = this.props
let that = this let that = this
if (selfOrderOption.create_success) { console.log('selfOrderOption----', selfOrderOption)
if (selfOrderOption.create_success == 'N') { that.setState({
// // 打开库存不足弹窗 isSubLoding: false
// this.setState({ })
// not_enough_items_list: selfOrderOption.not_enough_items_list if (selfOrderOption && selfOrderOption.create_success == 'Y') {
// },() => { // 打开下单成功页面
// // 解决 IOS 弹窗显示问题 that.clearAllData()
// setTimeout(() => { let { state: { params: { title } } } = that.props.navigation
// that.setState({ that.props.navigation.navigate('SubSuccPage', {
// showNotEnogPop: true title: `${title} - 提交成功`,
// }) // orderNumber: 'TS_11001100100110' // 测试
// }, 500) orderNumber: selfOrderOption.order_number
// }) })
} else if (selfOrderOption.create_success == 'Y') {
// // 打开下单成功页面
// this.clearAllData()
// let { state: { params: { title } } } = this.props.navigation
// this.props.navigation.navigate('SubSuccPage', {
// title: `${title} - 下单成功`,
// orderNumber: selfOrderOption.survey_collect_number
// })
}
} }
} }
// 清空数据 // 清空数据
...@@ -1531,31 +1289,10 @@ class SelfOrderPage extends Component { ...@@ -1531,31 +1289,10 @@ class SelfOrderPage extends Component {
this.refs.CertModel.show('需要携带注册证?') this.refs.CertModel.show('需要携带注册证?')
} else { } else {
console.log('请求提交====') console.log('请求提交====')
this.handleSubmit() this.submitSelfOrder()
} }
} }
// // 库存不足弹窗回调 -- 确定
// handleNotEnoughCallBack() {
// let { submitOption } = this.state
// let self = this
// this.setState({
// submitOption: {
// ...submitOption,
// force_balance_check_flag: 'N'
// }
// }, () => {
// self.handleSubmit()
// })
// }
// // 库存不足弹窗关闭
// handleNotEnoughCloseModal(show) {
// this.setState({
// showNotEnogPop: show
// })
// }
// 返回备注以上的元素 // 返回备注以上的元素
renderListItem() { renderListItem() {
let { listOptionData, dateModelPop } = this.state let { listOptionData, dateModelPop } = this.state
...@@ -1569,19 +1306,6 @@ class SelfOrderPage extends Component { ...@@ -1569,19 +1306,6 @@ class SelfOrderPage extends Component {
listDefaValue={'name'} listDefaValue={'name'}
listTitle={'title'} listTitle={'title'}
/> />
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={1}
// onPress={() => this.handleOpenDialog()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'销售员'}</TitleTextStyle>
<ContInputTextStyle editable={false} defaultValue={listOptionData[0].name}></ContInputTextStyle>
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow <PageListArrow
listActOpa={.8} listActOpa={.8}
listHasAster={true} listHasAster={true}
...@@ -1591,20 +1315,6 @@ class SelfOrderPage extends Component { ...@@ -1591,20 +1315,6 @@ class SelfOrderPage extends Component {
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])} listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true} listHasArrow={true}
/> />
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleOrganizationCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'组织'}</TitleTextStyle>
<ContTextStyle>{listOptionData[1].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow <PageListArrow
listActOpa={.8} listActOpa={.8}
listHasAster={true} listHasAster={true}
...@@ -1614,20 +1324,6 @@ class SelfOrderPage extends Component { ...@@ -1614,20 +1324,6 @@ class SelfOrderPage extends Component {
listCallBack={() => this.handleCustomerCheck(listOptionData[2])} listCallBack={() => this.handleCustomerCheck(listOptionData[2])}
listHasArrow={true} listHasArrow={true}
/> />
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleCustomerCheck(listOptionData[2])}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'客户名称'}</TitleTextStyle>
<ContTextStyle>{listOptionData[2].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow <PageListArrow
listActOpa={.8} listActOpa={.8}
listHasAster={true} listHasAster={true}
...@@ -1637,20 +1333,6 @@ class SelfOrderPage extends Component { ...@@ -1637,20 +1333,6 @@ class SelfOrderPage extends Component {
listCallBack={() => this.handleBillCheck(listOptionData[3])} listCallBack={() => this.handleBillCheck(listOptionData[3])}
listHasArrow={true} listHasArrow={true}
/> />
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleBillCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'收单地点'}</TitleTextStyle>
<ContTextStyle>{listOptionData[3].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow <PageListArrow
listActOpa={.8} listActOpa={.8}
listHasAster={true} listHasAster={true}
...@@ -1660,20 +1342,6 @@ class SelfOrderPage extends Component { ...@@ -1660,20 +1342,6 @@ class SelfOrderPage extends Component {
listCallBack={() => this.handleShipCheck(listOptionData[4])} listCallBack={() => this.handleShipCheck(listOptionData[4])}
listHasArrow={true} listHasArrow={true}
/> />
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleShipCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'收货地点'}</TitleTextStyle>
<ContTextStyle>{listOptionData[4].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow <PageListArrow
listActOpa={.8} listActOpa={.8}
listHasAster={true} listHasAster={true}
...@@ -1686,31 +1354,6 @@ class SelfOrderPage extends Component { ...@@ -1686,31 +1354,6 @@ class SelfOrderPage extends Component {
otherInput={'showInput'} otherInput={'showInput'}
otherInputCallBack={(text) => this.handleDoctorInput(text, listOptionData[5])} otherInputCallBack={(text) => this.handleDoctorInput(text, listOptionData[5])}
/> />
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleDoctorCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'主治医生'}</TitleTextStyle>
<ContTextStyle>{listOptionData[5].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
{
listOptionData[5].showInput ?
<CellTextStyle>
<ContInputTextStyle
style={styles.cell_input}
placeholder={`请输入主治医生`}
onChangeText={(text) => this.handleDoctorInput(text)}
></ContInputTextStyle>
</CellTextStyle> : null
}
</View> */}
<PageListArrow <PageListArrow
listActOpa={.8} listActOpa={.8}
listHasAster={true} listHasAster={true}
...@@ -1721,23 +1364,6 @@ class SelfOrderPage extends Component { ...@@ -1721,23 +1364,6 @@ class SelfOrderPage extends Component {
inputCallBack={(text) => this.handleSurNameInput(text, listOptionData[6])} inputCallBack={(text) => this.handleSurNameInput(text, listOptionData[6])}
isTitInputStyle={true} isTitInputStyle={true}
/> />
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={1}
// onPress={() => this.handleSurNameInput()}
>
<CellTextStyle>
<TitleTextStyle style={styles.cell_title}>{'手术名称'}</TitleTextStyle>
<ContInputTextStyle
style={styles.cell_input}
placeholder={'请输入'}
defaultValue={listOptionData[6].value}
onChangeText={(text) => this.handleSurNameInput(text)}
></ContInputTextStyle>
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow <PageListArrow
listActOpa={.8} listActOpa={.8}
listHasAster={true} listHasAster={true}
...@@ -1747,20 +1373,7 @@ class SelfOrderPage extends Component { ...@@ -1747,20 +1373,7 @@ class SelfOrderPage extends Component {
listCallBack={() => this.handleSurDateCheck(listOptionData[7])} listCallBack={() => this.handleSurDateCheck(listOptionData[7])}
listHasArrow={true} listHasArrow={true}
/> />
{/* <View style={styles.item_container}> {/* <PageListArrow
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleSurDateCheck()}
>
<CellTextStyle>
<TitleTextStyle>{'手术时间'}</TitleTextStyle>
<ContTextStyle>{listOptionData[7].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow
listActOpa={.8} listActOpa={.8}
listHasAster={true} listHasAster={true}
listItem={listOptionData[8]} listItem={listOptionData[8]}
...@@ -1768,21 +1381,7 @@ class SelfOrderPage extends Component { ...@@ -1768,21 +1381,7 @@ class SelfOrderPage extends Component {
listTitle={'title'} listTitle={'title'}
listCallBack={() => this.handleSurTypeCheck(listOptionData[8])} listCallBack={() => this.handleSurTypeCheck(listOptionData[8])}
listHasArrow={true} listHasArrow={true}
/> /> */}
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleSurTypeCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'手术类型'}</TitleTextStyle>
<ContTextStyle>{listOptionData[8].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow <PageListArrow
listActOpa={.8} listActOpa={.8}
listHasAster={true} listHasAster={true}
...@@ -1792,20 +1391,6 @@ class SelfOrderPage extends Component { ...@@ -1792,20 +1391,6 @@ class SelfOrderPage extends Component {
listCallBack={() => this.handleOrderCheck(listOptionData[9])} listCallBack={() => this.handleOrderCheck(listOptionData[9])}
listHasArrow={true} listHasArrow={true}
/> />
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleOrderCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'订单类型'}</TitleTextStyle>
<ContTextStyle>{listOptionData[9].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View> */}
<PageListArrow <PageListArrow
listActOpa={.8} listActOpa={.8}
listHasAster={true} listHasAster={true}
...@@ -1816,19 +1401,6 @@ class SelfOrderPage extends Component { ...@@ -1816,19 +1401,6 @@ class SelfOrderPage extends Component {
listHasArrow={true} listHasArrow={true}
listMaxLines={1} listMaxLines={1}
/> />
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.handleProductCheck()}
>
<CellTextStyle>
<AsteriskTextStyle>*</AsteriskTextStyle>
<TitleTextStyle>{'选择产品'}</TitleTextStyle>
<ContTextStyle>{listOptionData[10].name}</ContTextStyle>
{ this.renderRightArrowItem() }
</CellTextStyle>
</TouchableOpacity>
</View> */}
<DateModel <DateModel
date={listOptionData[7].dateValue} date={listOptionData[7].dateValue}
...@@ -1857,7 +1429,6 @@ class SelfOrderPage extends Component { ...@@ -1857,7 +1429,6 @@ class SelfOrderPage extends Component {
// 返回选择器弹窗 // 返回选择器弹窗
renderPickerModel() { renderPickerModel() {
let { listCurrentOption, currentItem, currentTitle, showTypePop } = this.state let { listCurrentOption, currentItem, currentTitle, showTypePop } = this.state
return ( return (
<SafeAreaView style={styles.item_container}> <SafeAreaView style={styles.item_container}>
<DialogModel <DialogModel
...@@ -1955,6 +1526,13 @@ class SelfOrderPage extends Component { ...@@ -1955,6 +1526,13 @@ class SelfOrderPage extends Component {
) )
} }
// 返回正在加载中 -- 新
renderLodingItemNew() {
return (
<LoadingModel ref="LoadingModel" />
)
}
// 返回提交器械包提示 // 返回提交器械包提示
renderTipModelPackage() { renderTipModelPackage() {
return ( return (
...@@ -1971,7 +1549,6 @@ class SelfOrderPage extends Component { ...@@ -1971,7 +1549,6 @@ class SelfOrderPage extends Component {
render() { render() {
let { canSubFlag } = this.state let { canSubFlag } = this.state
// console.log(this.props)
let { navigation } = this.props let { navigation } = this.props
let { title } = navigation.state.params let { title } = navigation.state.params
return ( return (
...@@ -1988,24 +1565,22 @@ class SelfOrderPage extends Component { ...@@ -1988,24 +1565,22 @@ class SelfOrderPage extends Component {
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
> >
{this.renderListItem()} {this.renderListItem()}
{this.renderRemarksItem()} {this.renderRemarksItem()}
{this.renderRecordingItem()} {this.renderRecordingItem()}
<FooterBtnStyle <FooterBtnStyle
style={canSubFlag ? styles.sub_btn_pro : ''} style={canSubFlag ? styles.sub_btn_pro : ''}
activeOpacity={canSubFlag ? .8 : 1} activeOpacity={canSubFlag ? .8 : 1}
title={'生成订单'} title={'生成订单'}
textStyle={styles.sub_btn} textStyle={styles.sub_btn}
onPress={() => this.getSumLinesOps()} onPress={() => this.handleSubmit()}
// onPress={() => this.handleSubmit()}
/> />
</ScrollView> </ScrollView>
{this.renderLodingItem()} {this.renderLodingItem()}
{this.renderLodingItemNew()}
</SafeAreaView> </SafeAreaView>
</View> </View>
); );
......
...@@ -12,6 +12,7 @@ import { reqPurSupplierSearch, reqProCategorySearch, reqSurTempHeadSearch, reqNa ...@@ -12,6 +12,7 @@ import { reqPurSupplierSearch, reqProCategorySearch, reqSurTempHeadSearch, reqNa
import EmitterEvents from '../../common/EmitterEvents'; import EmitterEvents from '../../common/EmitterEvents';
import LoadingModel from '../../common/listDataComponent/LoadingModel'; import LoadingModel from '../../common/listDataComponent/LoadingModel';
import localMockData from './mock/sen_mock'; import localMockData from './mock/sen_mock';
import LocalVariable from '../../common/LocalVariable';
const QUANTITY_FIELD = 'quantity' // 计算的字段 const QUANTITY_FIELD = 'quantity' // 计算的字段
const CHILDREN_LINE_NAME = 'childrenLineData' // 显示的子类数组名称 const CHILDREN_LINE_NAME = 'childrenLineData' // 显示的子类数组名称
...@@ -79,8 +80,8 @@ class ChooseProductPage extends Component { ...@@ -79,8 +80,8 @@ class ChooseProductPage extends Component {
let { setSelectProductOpts } = this.props let { setSelectProductOpts } = this.props
setSelectProductOpts(topProcOptionList) setSelectProductOpts(topProcOptionList)
// 并且=======调用返回 // 并且=======调用返回
this.props.navigation.goBack()
DeviceEventEmitter.emit(EmitterEvents.BACK_TO_SELF_PAGE, { local_lines: topProcOptionList }) DeviceEventEmitter.emit(EmitterEvents.BACK_TO_SELF_PAGE, { local_lines: topProcOptionList })
this.props.navigation.goBack()
} }
// 初始化获取数据 // 初始化获取数据
...@@ -121,7 +122,7 @@ class ChooseProductPage extends Component { ...@@ -121,7 +122,7 @@ class ChooseProductPage extends Component {
topProcOptionList.forEach(function (topObj) { topProcOptionList.forEach(function (topObj) {
topObj['selectedQuantity'] = 0 topObj['selectedQuantity'] = 0
topObj['leftOptionList'] = [] topObj['leftOptionList'] = []
if(!topObj['supplier_short_name']){ if (!topObj['supplier_short_name']) {
topObj.supplier_short_name = topObj.supplier_name.substring(0, 3) topObj.supplier_short_name = topObj.supplier_name.substring(0, 3)
} }
}) })
...@@ -176,8 +177,9 @@ class ChooseProductPage extends Component { ...@@ -176,8 +177,9 @@ class ChooseProductPage extends Component {
that.setState({ that.setState({
topActiveIndex: topIndex, topActiveIndex: topIndex,
topProcOptionList: topProcOptionList topProcOptionList: topProcOptionList
}, () => {
that.handleLeftNav(topItem['leftOptionList'][0], 0)
}) })
that.showRrrorTip(pro_scate_search) that.showRrrorTip(pro_scate_search)
} }
...@@ -190,63 +192,42 @@ class ChooseProductPage extends Component { ...@@ -190,63 +192,42 @@ class ChooseProductPage extends Component {
// 左侧标题点击 // 左侧标题点击
async handleLeftNav(leftItem, leftIndex) { async handleLeftNav(leftItem, leftIndex) {
let that = this let that = this
let { topProcOptionList, topActiveIndex, leftOptionList } = that.state let { topProcOptionList, topActiveIndex } = that.state
let { token, global_domain_config, navigation } = that.props
console.log('左侧标题--', topActiveIndex, leftItem, leftIndex) console.log('左侧标题--', topActiveIndex, leftItem, leftIndex)
let { token, global_domain_config, navigation, userInfo } = that.props
if (leftItem[SELECTED_QUQNTITY] !== 0) { if (leftItem[SELECTED_QUQNTITY] !== 0) {
// topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = leftItem
that.setState({ that.setState({
leftActiveIndex: leftIndex, leftActiveIndex: leftIndex
// topProcOptionList: topProcOptionList
// leftOptionList: leftOptionList
}) })
return return
} }
that.refs.LoadingModel.show() that.refs.LoadingModel.show()
let cur_org_code = '' let cur_org_code = ''
if (navigation.state.params.selfData) { if (navigation.state.params.selfData) {
cur_org_code = navigation.state.params.selfData.org_code cur_org_code = navigation.state.params.selfData.org_code
} }
let topItem = topProcOptionList[topActiveIndex] let topItem = topProcOptionList[topActiveIndex]
if (leftIndex === 0) { if (leftIndex === 0) {
let params = { let params = {
access_token: token, access_token: token,
org_code: cur_org_code, org_code: cur_org_code,
// seller_code: userInfo.user_name,
manufacturer_code: topItem.supplier_code, manufacturer_code: topItem.supplier_code,
} }
console.log('params-', params) console.log('params-', params)
let sur_head_search = await reqSurTempHeadSearch(global_domain_config, params) let sur_head_search = await reqSurTempHeadSearch(global_domain_config, params)
console.log('res_3 : ', sur_head_search) console.log('res_3 : ', sur_head_search)
if (sur_head_search.error_code === 0) { if (sur_head_search.error_code === 0) {
if (sur_head_search.data && sur_head_search.data.surgery_template_headers) {
// // if(leftItem[SELECTED_QUQNTITY] === 0){
// let { data } = sur_head_search
// leftItem.localSecondData = cloneObject(data.surgery_template_headers)
// leftItem['localSecondData'].forEach(function (righDa) {
// if (!righDa['quantity']) {
// righDa['quantity'] = 0
// } else {
// righDa['quantity'] = Number(righDa['quantity'])
// }
// })
// topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = cloneObject(leftItem)
topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = that.getInitLocalSecondData(leftItem, sur_head_search.data.surgery_template_headers) topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = that.getInitLocalSecondData(leftItem, sur_head_search.data.surgery_template_headers)
// } } else {
topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = []
}
that.setState({ that.setState({
leftActiveIndex: leftIndex, leftActiveIndex: leftIndex,
topProcOptionList: topProcOptionList topProcOptionList: topProcOptionList
// leftOptionList: leftOptionList
}, () => { }, () => {
that.refs.LoadingModel.hide() that.refs.LoadingModel.hide()
}) })
} else { } else {
that.showRrrorTip(sur_head_search) that.showRrrorTip(sur_head_search)
} }
...@@ -257,7 +238,6 @@ class ChooseProductPage extends Component { ...@@ -257,7 +238,6 @@ class ChooseProductPage extends Component {
} }
let params = { let params = {
access_token: token, access_token: token,
// category_set: 'INVENTORY',
manufacturer_code: topItem.supplier_code, manufacturer_code: topItem.supplier_code,
category_code: cur_category_code, category_code: cur_category_code,
} }
...@@ -265,30 +245,17 @@ class ChooseProductPage extends Component { ...@@ -265,30 +245,17 @@ class ChooseProductPage extends Component {
let nail_equip_head_search = await reqNailEquipHeadSearch(global_domain_config, params) let nail_equip_head_search = await reqNailEquipHeadSearch(global_domain_config, params)
console.log('res_3 : ', nail_equip_head_search) console.log('res_3 : ', nail_equip_head_search)
if (nail_equip_head_search.error_code === 0) { if (nail_equip_head_search.error_code === 0) {
if(nail_equip_head_search.data && nail_equip_head_search.data.items){
// // if(leftItem[SELECTED_QUQNTITY] === 0){
// let { data } = nail_equip_head_search
// leftItem.localSecondData = cloneObject(data.items)
// leftItem['localSecondData'].forEach(function (righDa) {
// if (!righDa['quantity']) {
// righDa['quantity'] = 0
// } else {
// righDa['quantity'] = Number(righDa['quantity'])
// }
// })
// topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = cloneObject(leftItem)
topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = that.getInitLocalSecondData(leftItem, nail_equip_head_search.data.items) topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = that.getInitLocalSecondData(leftItem, nail_equip_head_search.data.items)
// } }else {
topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = []
}
that.setState({ that.setState({
leftActiveIndex: leftIndex, leftActiveIndex: leftIndex,
topProcOptionList: topProcOptionList topProcOptionList: topProcOptionList
// leftOptionList: leftOptionList
}, () => { }, () => {
that.refs.LoadingModel.hide() that.refs.LoadingModel.hide()
}) })
} else { } else {
that.showRrrorTip(nail_equip_head_search) that.showRrrorTip(nail_equip_head_search)
} }
...@@ -299,26 +266,14 @@ class ChooseProductPage extends Component { ...@@ -299,26 +266,14 @@ class ChooseProductPage extends Component {
let scat_head_search = await reqScatEquipmentSearch(global_domain_config, params) let scat_head_search = await reqScatEquipmentSearch(global_domain_config, params)
console.log('res_3 : ', scat_head_search) console.log('res_3 : ', scat_head_search)
if (scat_head_search.error_code === 0) { if (scat_head_search.error_code === 0) {
if(scat_head_search.data && scat_head_search.data.tools){
// // if(leftItem[SELECTED_QUQNTITY] === 0){
// let { data } = scat_head_search
// leftItem.localSecondData = cloneObject(data.tools)
// leftItem['localSecondData'].forEach(function (righDa) {
// if (!righDa['quantity']) {
// righDa['quantity'] = 0
// } else {
// righDa['quantity'] = Number(righDa['quantity'])
// }
// })
// topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = cloneObject(leftItem)
topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = that.getInitLocalSecondData(leftItem, scat_head_search.data.tools) topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = that.getInitLocalSecondData(leftItem, scat_head_search.data.tools)
// } }else {
topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = []
}
that.setState({ that.setState({
leftActiveIndex: leftIndex, leftActiveIndex: leftIndex,
topProcOptionList: topProcOptionList topProcOptionList: topProcOptionList
// leftOptionList: leftOptionList
}, () => { }, () => {
that.refs.LoadingModel.hide() that.refs.LoadingModel.hide()
}) })
...@@ -339,80 +294,71 @@ class ChooseProductPage extends Component { ...@@ -339,80 +294,71 @@ class ChooseProductPage extends Component {
let { data } = single_all_search let { data } = single_all_search
console.log('data : ', data, data.items) console.log('data : ', data, data.items)
if (data && data.items) { if (data && data.items) {
// if(leftItem[SELECTED_QUQNTITY] === 0){
//大-中-小类 //大-中-小类
leftItem.localSecondData = cloneObject(data.items) data.items = data.items.filter(fi_item => fi_item.details && fi_item.details.length > 0)
leftItem['localSecondData'].forEach(function (righDa) { leftItem[LocalVariable.LOCAL_SECOND_DATA] = cloneObject(data.items)
righDa[CHILDREN_LINE_NAME] = [] leftItem[LocalVariable.LOCAL_SECOND_DATA].forEach(function (righDa) {
// if (!righDa['quantity']) { righDa[LocalVariable.CHILDREN_LINE_NAME] = []
// righDa['quantity'] = 0 righDa[LocalVariable.QUANTITY_FIELD] = 0 // 默认
// } else { if (righDa.details) {
// righDa['quantity'] = Number(righDa['quantity']) righDa.details.forEach(function (det_item) {
// } det_item[LocalVariable.QUANTITY_FIELD] = 0 // 默认
righDa['quantity'] = 0
}) })
topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = cloneObject(leftItem) }
// }
that.setState({
leftActiveIndex: leftIndex,
topProcOptionList: topProcOptionList
// leftOptionList: leftOptionList
}, () => {
that.refs.LoadingModel.hide()
}) })
} else { // topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = cloneObject(leftItem)
// that.setState({
// leftActiveIndex: leftIndex,
// topProcOptionList: topProcOptionList
// }, () => {
// that.refs.LoadingModel.hide()
// })
} else if (data && data.details) {
//大-小类 //大-小类
// if(leftItem[SELECTED_QUQNTITY] === 0){ leftItem[LocalVariable.LOCAL_SECOND_DATA] = cloneObject(data.details)
leftItem.localSecondData = cloneObject(data.details) leftItem[LocalVariable.LOCAL_SECOND_DATA].forEach(function (righDa) {
leftItem['localSecondData'].forEach(function (righDa) { righDa[LocalVariable.ONLY_TWO_LEVELS] = true
righDa['onlyTwoLevels'] = true righDa[LocalVariable.QUANTITY_FIELD] = 0 // 默认
// if (!righDa['quantity']) {
// righDa['quantity'] = 0
// } else {
// righDa['quantity'] = Number(righDa['quantity'])
// }
righDa['quantity'] = 0
}) })
// topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = cloneObject(leftItem)
// that.setState({
// leftActiveIndex: leftIndex,
// topProcOptionList: topProcOptionList
// }, () => {
// that.refs.LoadingModel.hide()
// })
} else {
// 空数据
leftItem.localSecondData = []
// topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = cloneObject(leftItem)
// that.setState({
// leftActiveIndex: leftIndex,
// topProcOptionList: topProcOptionList
// }, () => {
// that.refs.LoadingModel.hide()
// })
}
topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = cloneObject(leftItem) topProcOptionList[topActiveIndex].leftOptionList[leftIndex] = cloneObject(leftItem)
// }
that.setState({ that.setState({
leftActiveIndex: leftIndex, leftActiveIndex: leftIndex,
topProcOptionList: topProcOptionList topProcOptionList: topProcOptionList
// leftOptionList: leftOptionList
}, () => { }, () => {
that.refs.LoadingModel.hide() that.refs.LoadingModel.hide()
}) })
}
} else { } else {
that.showRrrorTip(single_all_search) that.showRrrorTip(single_all_search)
} }
} }
// this.setState({
// leftActiveIndex: leftIndex,
// // rightSecondData: leftOptionList[index][LOCAL_SECOND_DATA] // 本地数据
// // rightSecondData: leftOptionList[index].localSecondData // 本地数据
// })
} }
// 初始化二级数据 // 初始化二级数据
getInitLocalSecondData(leftItem, resDa) { getInitLocalSecondData(leftItem, resDa) {
if (!leftItem.localSecondData) { if (!leftItem[LocalVariable.LOCAL_SECOND_DATA]) {
leftItem.localSecondData = [] leftItem[LocalVariable.LOCAL_SECOND_DATA] = []
} }
leftItem.localSecondData = cloneObject(resDa) leftItem[LocalVariable.LOCAL_SECOND_DATA] = cloneObject(resDa)
leftItem['localSecondData'].forEach(function (righDa) { leftItem[LocalVariable.LOCAL_SECOND_DATA].forEach(function (righDa) {
// if (!righDa['quantity']) { righDa[LocalVariable.QUANTITY_FIELD] = 0 // 默认
// righDa['quantity'] = 0
// } else {
// righDa['quantity'] = Number(righDa['quantity'])
// }
// 默认为0
righDa['quantity'] = 0
}) })
return cloneObject(leftItem) return cloneObject(leftItem)
} }
...@@ -671,7 +617,7 @@ class ChooseProductPage extends Component { ...@@ -671,7 +617,7 @@ class ChooseProductPage extends Component {
topProcOptionList[topActiveIndex].leftOptionList = options topProcOptionList[topActiveIndex].leftOptionList = options
topProcOptionList[topActiveIndex][SELECTED_QUQNTITY] = 0 topProcOptionList[topActiveIndex][SELECTED_QUQNTITY] = 0
options.forEach(cur_ops => { options.forEach(cur_ops => {
if(cur_ops[SELECTED_QUQNTITY] > 0){ if (cur_ops[SELECTED_QUQNTITY] > 0) {
topProcOptionList[topActiveIndex][SELECTED_QUQNTITY] += cur_ops[SELECTED_QUQNTITY] topProcOptionList[topActiveIndex][SELECTED_QUQNTITY] += cur_ops[SELECTED_QUQNTITY]
} }
}) })
......
...@@ -137,6 +137,7 @@ class EditThirdLevelPage extends Component { ...@@ -137,6 +137,7 @@ class EditThirdLevelPage extends Component {
access_token: token, access_token: token,
nail_box_code: superItem.item_code, nail_box_code: superItem.item_code,
nail_box_serial_number: superItem.serial_number, nail_box_serial_number: superItem.serial_number,
inv_code: superItem.inv_code
} }
let nail_line_search = await reqNailBoxLineSearch(global_domain_config, params) let nail_line_search = await reqNailBoxLineSearch(global_domain_config, params)
console.log('res_line_1 : ', nail_line_search) console.log('res_line_1 : ', nail_line_search)
...@@ -153,6 +154,7 @@ class EditThirdLevelPage extends Component { ...@@ -153,6 +154,7 @@ class EditThirdLevelPage extends Component {
onlyShow: true onlyShow: true
}, () => { }, () => {
that.refs.LoadingModel.hide() that.refs.LoadingModel.hide()
that.setAllSelectData()
}) })
} else { } else {
that.showRrrorTip(nail_line_search) that.showRrrorTip(nail_line_search)
...@@ -162,6 +164,7 @@ class EditThirdLevelPage extends Component { ...@@ -162,6 +164,7 @@ class EditThirdLevelPage extends Component {
access_token: token, access_token: token,
inv_code: superItem.inv_code, inv_code: superItem.inv_code,
item_code: superItem.item_code, item_code: superItem.item_code,
serial_number: superItem.serial_number,
start_index: 1, start_index: 1,
limit: 1000 limit: 1000
} }
...@@ -178,6 +181,7 @@ class EditThirdLevelPage extends Component { ...@@ -178,6 +181,7 @@ class EditThirdLevelPage extends Component {
onlyShow: true onlyShow: true
}, () => { }, () => {
that.refs.LoadingModel.hide() that.refs.LoadingModel.hide()
that.setAllSelectData()
}) })
} else { } else {
that.showRrrorTip(equip_line_search) that.showRrrorTip(equip_line_search)
...@@ -286,6 +290,9 @@ class EditThirdLevelPage extends Component { ...@@ -286,6 +290,9 @@ class EditThirdLevelPage extends Component {
curTit = 'category_name' curTit = 'category_name'
} else if (leftIndex === 1) { } else if (leftIndex === 1) {
curTit = 'segment_name' curTit = 'segment_name'
if(curTopList.length > 0 && curTopList[0].segment_code === 'ALL'){
curTopList = []
}
} else if (leftIndex === 2) { } else if (leftIndex === 2) {
curTopList = [] curTopList = []
} else { } else {
...@@ -295,7 +302,7 @@ class EditThirdLevelPage extends Component { ...@@ -295,7 +302,7 @@ class EditThirdLevelPage extends Component {
<ChooseCardList <ChooseCardList
cardStyleBox={styles.top_box} cardStyleBox={styles.top_box}
cardStyleScroll={styles.top_scroll_cont} cardStyleScroll={styles.top_scroll_cont}
cardScrollEnabled={false} cardScrollEnabled={true}
cardHorizontal={true} cardHorizontal={true}
cardShowsHorizontalScrollIndicator={false} cardShowsHorizontalScrollIndicator={false}
cardStyleListItem={styles.top_inner} cardStyleListItem={styles.top_inner}
......
...@@ -427,9 +427,9 @@ class ProductRightStyle extends Component { ...@@ -427,9 +427,9 @@ class ProductRightStyle extends Component {
curIcon = 'photos' curIcon = 'photos'
} else if (leftIndex === 1 || leftIndex === 2 || leftIndex === 3) { } else if (leftIndex === 1 || leftIndex === 2 || leftIndex === 3) {
curTit = 'item_name' curTit = 'item_name'
curTipStr='item_code' curTipStr = 'item_code'
curTipOne = 'specification' curTipOne = 'specification'
curTipStrTit='物料代码' curTipStrTit = '物料代码'
curTipOneTit = '规格型号' curTipOneTit = '规格型号'
curIcon = 'photos' curIcon = 'photos'
} else { } else {
...@@ -469,7 +469,7 @@ class ProductRightStyle extends Component { ...@@ -469,7 +469,7 @@ class ProductRightStyle extends Component {
curReduceCallBack = (() => this.props.superReduceBack()) curReduceCallBack = (() => this.props.superReduceBack())
} }
return ( return (
<SafeAreaView style={styles.ri_container} key={'template_name'+index}> <SafeAreaView style={styles.ri_container} key={'template_name' + index}>
<PicTitDetaiCalcu <PicTitDetaiCalcu
listItem={item} listItem={item}
listIndex={index} listIndex={index}
...@@ -516,16 +516,16 @@ class ProductRightStyle extends Component { ...@@ -516,16 +516,16 @@ class ProductRightStyle extends Component {
// 单选耗材 -- 小类每一列 // 单选耗材 -- 小类每一列
renderThridItem(item, index) { renderThridItem(item, index) {
return ( return (
<SafeAreaView style={styles.thr_container} key={'item_code'+index}> <SafeAreaView style={styles.thr_container} key={'item_code' + index}>
<PicTitDetaiCalcu <PicTitDetaiCalcu
listItem={item} listItem={item}
listIndex={index} listIndex={index}
calField={QUANTITY_FIELD} calField={QUANTITY_FIELD}
subCalCallBack={(item, index) => this.handleCalCallBack(item, index, 'rowSingleData')} subCalCallBack={(item, index) => this.handleCalCallBack(item, index, 'rowSingleData')}
titText={'general_name'} titText={'item_name'}
tipTextOne={'item_name'} tipTextOne={'general_name'}
tipTextTwo={'item_code'} tipTextTwo={'item_code'}
tipTextOneTit={'物料名称'} tipTextOneTit={'通用名称'}
tipTextTwoTit={'物料代码'} tipTextTwoTit={'物料代码'}
listImgIcon={'photos'} listImgIcon={'photos'}
/> />
...@@ -555,7 +555,7 @@ class ProductRightStyle extends Component { ...@@ -555,7 +555,7 @@ class ProductRightStyle extends Component {
let curSubCalCallBack = '', curTitCallBack = '', curPlusCallBack = '', curReduceCallBack = '' let curSubCalCallBack = '', curTitCallBack = '', curPlusCallBack = '', curReduceCallBack = ''
if (item[ONLY_TWO_LEVELS]) { if (item[ONLY_TWO_LEVELS]) {
// 两级 // 两级
curTit = 'general_name' curTit = 'item_name'
curTipOne = 'item_code' curTipOne = 'item_code'
curTipOneTit = '物料代码' curTipOneTit = '物料代码'
curIcon = 'photos' curIcon = 'photos'
...@@ -573,7 +573,7 @@ class ProductRightStyle extends Component { ...@@ -573,7 +573,7 @@ class ProductRightStyle extends Component {
// console.log('大类===', item) // console.log('大类===', item)
return ( return (
<SafeAreaView style={styles.oth_container} key={'item_code'+index}> <SafeAreaView style={styles.oth_container} key={'item_code' + index}>
<PicTitDetaiCalcu <PicTitDetaiCalcu
listItem={item} listItem={item}
listIndex={index} listIndex={index}
...@@ -594,15 +594,19 @@ class ProductRightStyle extends Component { ...@@ -594,15 +594,19 @@ class ProductRightStyle extends Component {
// 单选耗材 -- 大类 // 单选耗材 -- 大类
renderOtherStyle() { renderOtherStyle() {
let { rightSecondData } = this.state
return ( return (
<View style={styles.cont_other_cont}> <View style={styles.cont_other_cont}>
<FlatList {
rightSecondData.length > 0 ? <FlatList
style={styles.cont_other_list} style={styles.cont_other_list}
keyExtractor={item => item.id} keyExtractor={item => item.id}
data={this.state.rightSecondData} data={this.state.rightSecondData}
extraData={this.state} extraData={this.state}
renderItem={({ item, index }) => this.renderOtherListItem(item, index)} renderItem={({ item, index }) => this.renderOtherListItem(item, index)}
/> /> : <PicListNoData />
}
</View> </View>
) )
} }
......
import React, { Component } from 'react';
import {
SafeAreaView,
StyleSheet,
View,
Text,
Image,
TouchableOpacity
} from 'react-native';
import { connect } from 'react-redux';
import HeadBackItem from '../../common/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 '../../common/StatusBarView';
class SubSuccessPage extends Component {
constructor(props) {
super(props);
this.state = { }
}
handleSubmit() {
console.warn('复制订单号并返回主页')
}
render() {
let {navigation} = this.props
let {title} = navigation.state.params
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}>{'订单号:20200318121230'}</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 SubSuccessPage;
\ No newline at end of file
...@@ -334,53 +334,111 @@ const inter_55 = { ...@@ -334,53 +334,111 @@ const inter_55 = {
// 选择产品-螺钉盒明细查询接口 // 选择产品-螺钉盒明细查询接口
const inter_6 = //当钉盒可视化时,分区域展示 const inter_6 = //当钉盒可视化时,分区域展示
{ {
"error_code": 0, "error_code": 0,
"error_msg": "成功", "error_msg": "成功",
"data": { "data": {
"photos": local_photos,
"segemt": [ "segemt": [
{ {
"segment_code": "HB4.0-QY", "details": [
"segment_name": "HB4.0松质螺钉(全牙)", {
"details": [{ "item_code": "ZT00000740",
"item_code": "GYSXQX01100007", "quantity": 2,
"item_name": "HB4.0-12松质螺钉(全牙)", "specification": "SD2.0*22,HAZ04",
"general_name": "HB4.0-12松质螺钉(全牙)", "item_name": "金属接骨螺钉",
"specification": "L12", "general_name": "金属接骨螺钉(实心)梅花 锁定"
"quantity": "4",
}, {
"item_code": "GYSXQX02200008",
"item_name": "HB4.0-14松质螺钉(全牙)",
"general_name": "HB4.0-14松质螺钉(全牙)",
"specification": "L14",
"quantity": "2",
}]
}, },
{ {
"segment_code": "HA3.5-PD", "item_code": "ZT00000752",
"segment_name": "HA3.5-皮质螺钉", "quantity": 1,
"details": [{ "specification": "SD1.5*14,HAZ04",
"item_code": "GYSXQX00011008", "item_name": "金属接骨螺钉",
"item_name": "锁定螺钉Φ3.5(梅花自攻)", "general_name": "金属接骨螺钉(实心)梅花 锁定"
"general_name": "锁定螺钉Φ3.5(梅花自攻)", }
"specification": "Φ3.5×22", ],
"quantity": "2", "segment_name": "HA3.5皮质螺钉",
}, { "segment_code": "HA3.5PZ"
"item_code": "GYSXQX00022008", },
"item_name": "锁定螺钉Φ3.5(梅花自攻)", {
"general_name": "锁定螺钉Φ3.5(梅花自攻)", "details": [
"specification": "Φ3.5×30", {
"quantity": "2", "item_code": "ZT00000737",
}, { "quantity": 1,
"item_code": "GYSXQX00033008", "specification": "SD2.0*28,HAZ04",
"item_name": "锁定螺钉Φ3.5(梅花自攻)", "item_name": "金属接骨螺钉",
"general_name": "锁定螺钉Φ3.5(梅花自攻)", "general_name": "金属接骨螺钉(实心)梅花 锁定"
"specification": "Φ3.5×45", },
"quantity": "1", {
}] "item_code": "ZT00000739",
"quantity": 1,
"specification": "SD2.0*24,HAZ04",
"item_name": "金属接骨螺钉",
"general_name": "金属接骨螺钉(实心)梅花 锁定"
}
],
"segment_name": "HB3.5普通螺钉",
"segment_code": "HB3.5PT"
},
{
"details": [
{
"item_code": "ZT00000752",
"quantity": 2,
"specification": "SD1.5*14,HAZ04",
"item_name": "金属接骨螺钉",
"general_name": "金属接骨螺钉(实心)梅花 锁定"
},
{
"item_code": "ZT00000739",
"quantity": 2,
"specification": "SD2.0*24,HAZ04",
"item_name": "金属接骨螺钉",
"general_name": "金属接骨螺钉(实心)梅花 锁定"
}
],
"segment_name": "4.0锁定螺钉",
"segment_code": "4.0SD"
},
{
"details": [
{
"item_code": "ZT00000746",
"quantity": 4,
"specification": "SD2.0*10,HAZ04",
"item_name": "金属接骨螺钉",
"general_name": "金属接骨螺钉(实心)梅花 锁定"
}
],
"segment_name": "HB4.0普通螺钉",
"segment_code": "HB4.0PT"
},
{
"details": [
{
"item_code": "ZT00000740",
"quantity": 2,
"specification": "SD2.0*22,HAZ04",
"item_name": "金属接骨螺钉",
"general_name": "金属接骨螺钉(实心)梅花 锁定"
},
{
"item_code": "ZT00000737",
"quantity": 1,
"specification": "SD2.0*28,HAZ04",
"item_name": "金属接骨螺钉",
"general_name": "金属接骨螺钉(实心)梅花 锁定"
}, },
{
"item_code": "ZT00000744",
"quantity": 5,
"specification": "SD2.0*14,HAZ04",
"item_name": "金属接骨螺钉",
"general_name": "金属接骨螺钉(实心)梅花 锁定"
}
],
"segment_name": "HA3.5普通螺钉",
"segment_code": "HA3.5PT"
}
] ]
} }
} }
...@@ -389,31 +447,89 @@ const inter_66 = { ...@@ -389,31 +447,89 @@ const inter_66 = {
"error_code": 0, "error_code": 0,
"error_msg": "成功", "error_msg": "成功",
"data": { "data": {
"photos": local_photos,
"segemt": [ "segemt": [
{ {
"segment_code": "", "details": [
{
"item_code": "ZT00000104",
"quantity": 5,
"specification": "3.5*30,HBKQ 03",
"item_name": "空心螺钉",
"general_name": "空心螺钉(半螺纹)"
},
{
"item_code": "ZT00000043",
"quantity": 1,
"specification": "Φ5mm,DQ 1",
"item_name": "空心螺钉",
"general_name": "空心螺钉—垫圈"
},
{
"item_code": "ZT00000087",
"quantity": 2,
"specification": "4.0*35,HBKQ 03",
"item_name": "空心螺钉",
"general_name": "空心螺钉(半螺纹)"
},
{
"item_code": "ZT00000097",
"quantity": 3,
"specification": "3.5*40,HBKQ 03",
"item_name": "空心螺钉",
"general_name": "空心螺钉(半螺纹)"
},
{
"item_code": "ZT00000100",
"quantity": 2,
"specification": "3.5*35,HBKQ 03",
"item_name": "空心螺钉",
"general_name": "空心螺钉(半螺纹)"
},
{
"item_code": "ZT00000094",
"quantity": 3,
"specification": "3.5*50,HBKQ 03",
"item_name": "空心螺钉",
"general_name": "空心螺钉(半螺纹)"
},
{
"item_code": "ZT00000082",
"quantity": 2,
"specification": "4.0*45,HBKQ 03",
"item_name": "空心螺钉",
"general_name": "空心螺钉(半螺纹)"
},
{
"item_code": "ZT00000084",
"quantity": 2,
"specification": "4.0*40,HBKQ 03",
"item_name": "空心螺钉",
"general_name": "空心螺钉(半螺纹)"
},
{
"item_code": "ZT00000095",
"quantity": 3,
"specification": "3.5*45,HBKQ 03",
"item_name": "空心螺钉",
"general_name": "空心螺钉(半螺纹)"
},
{
"item_code": "ZT00000081",
"quantity": 2,
"specification": "4.0*50,HBKQ 03",
"item_name": "空心螺钉",
"general_name": "空心螺钉(半螺纹)"
},
{
"item_code": "ZT00000091",
"quantity": 2,
"specification": "4.0*30,HBKQ 03",
"item_name": "空心螺钉",
"general_name": "空心螺钉(半螺纹)"
}
],
"segment_name": "全部", "segment_name": "全部",
"details": [{ "segment_code": "ALL"
"item_code": "GYSXQX00000117",
"item_name": "金属锁定接骨板系统",
"general_name": "金属锁定接骨板系统",
"specification": "自攻型规则螺纹锥型锁定钉I型 RTCLS01 φ2.4×14mm",
"quantity": "1",
}, {
"item_code": "GYSXQX00000338",
"item_name": "金属锁定接骨板系统",
"general_name": "金属锁定接骨板系统",
"specification": "自攻型规则螺纹锥型锁定钉I型 RTCLS01 φ2.4×16mm",
"quantity": "1",
}, {
"item_code": "GYSXQX00000668",
"item_name": "金属锁定接骨板系统",
"general_name": "金属锁定接骨板系统",
"specification": "自攻型规则螺纹锥型锁定钉I型 RTCLS01 φ2.4×16mm",
"quantity": "2",
}]
} }
] ]
} }
...@@ -508,7 +624,7 @@ const inter_9 = //大-中-小类 ...@@ -508,7 +624,7 @@ const inter_9 = //大-中-小类
{ {
"error_code": 0, "error_code": 0,
"error_msg": "成功", "error_msg": "成功",
"data":{ "data": {
"items": [{ "items": [{
"category_code": "JSTH-01-01", "category_code": "JSTH-01-01",
"category_name": "股骨头", "category_name": "股骨头",
...@@ -595,7 +711,7 @@ const inter_99 = { ...@@ -595,7 +711,7 @@ const inter_99 = {
} }
export default{ export default {
inter_1, inter_1,
inter_2, inter_2,
inter_3, inter_3,
......
...@@ -41,7 +41,6 @@ export default quick = (state = defaultState, action) => { ...@@ -41,7 +41,6 @@ export default quick = (state = defaultState, action) => {
return Object.assign({}, state, { return Object.assign({}, state, {
submit_quick_order_status: QUICK_SUBMIT_SUCCESS, submit_quick_order_status: QUICK_SUBMIT_SUCCESS,
quickOrderOption: action.rawData quickOrderOption: action.rawData
// quickOrderOption: {} // 清空当前临时数据
}) })
case QUICK_SUBMIT_FAILURE: case QUICK_SUBMIT_FAILURE:
return Object.assign({}, state, { return Object.assign({}, state, {
......
...@@ -41,8 +41,7 @@ export default selfOrder = (state = defaultState, action) => { ...@@ -41,8 +41,7 @@ export default selfOrder = (state = defaultState, action) => {
case SELF_SUBMIT_SUCCESS: case SELF_SUBMIT_SUCCESS:
return Object.assign({}, state, { return Object.assign({}, state, {
submit_self_order_status: SELF_SUBMIT_SUCCESS, submit_self_order_status: SELF_SUBMIT_SUCCESS,
selfOrderOption: {}, // 清空当前临时数据 selfOrderOption: action.rawData
local_sele_pro_options: {}
}) })
case SELF_SUBMIT_FAILURE: case SELF_SUBMIT_FAILURE:
return Object.assign({}, state, { return Object.assign({}, state, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment