Commit affd9956 by Denglingling

完善自助下单提交接口需要的数据

parent 9ea2b23d
......@@ -223,35 +223,35 @@ export function requestSelfSumbit({access_token, ...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))
}
// 选择产品-产品信息分类查询接口
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))
}
// 选择产品-手术模板头查询接口
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))
}
// 选择产品-手术模板行查询接口
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))
}
// 选择产品-螺钉盒(器械包)头查询接口
export const reqNailEquipHeadSearch = async (global_domain_config, params) => {
// if(params.category_code === '1301'){
// return local_inter_mock.inter_5
// }else {
// return local_inter_mock.inter_55
// }
if(params.category_code === '1301'){
return local_inter_mock.inter_5
}else {
return local_inter_mock.inter_55
}
return await GetRequest(global_domain_config, getUrlParams('/inventory/item_package_header/search', params))
}
......@@ -272,7 +272,7 @@ export const reqEquipPackageLineSearch = 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))
}
......
/**
* 自助下单-本地常用变量名
*/
export default class LocalVariable {
/**
* 计算数量的字段名
*/
static QUANTITY_FIELD = 'quantity'
/**
* 显示的子类数组名
*/
static CHILDREN_LINE_NAME = 'childrenLineData'
/**
* 外层已选数量字段名
*/
static SELECTED_QUQNTITY = 'selectedQuantity'
/**
* 外层已选数组名
*/
static SELECTED_DATA_ARR = 'selectedDataArr'
/**
* 中类原本元素
*/
static LOCAL_SECOND_DATA = 'localSecondData'
/**
* 只有两级的耗材
*/
static ONLY_TWO_LEVELS = 'onlyTwoLevels'
/**
* 三级原本元素
*/
static LOCAL_THRID_CONT_DATA = 'localThridContData'
/**
* 最终子类数组名
*/
static LINE_OPTIONS = 'lineOptions'
/**
* 已选展示父级标题名
*/
static SUPER_TITLE_NAME = 'super_title_name'
/**
* 已选展示父级提示名
*/
static SUPER_TITLE_TIP = 'super_title_tip'
/**
* 计划数量名
*/
static PLAN_QUANTITY = 'plan_quantity'
/**
* 手术模板名
*/
static SURGICAL_TEMPLATE = 'surg_temp'
/**
* 钉盒名
*/
static NAIL_BOX = 'screw_box'
/**
* 器械包名
*/
static EQUIPMENT_BAG = 'equip_bag'
/**
* 零散器械名
*/
static SCATTERED_EQUIPMENT = 'auxili_tool'
/**
* 单选耗材名
*/
static SIGN_SELECT_CONSUMABLES = 'sign_consu'
}
\ No newline at end of file
......@@ -40,6 +40,7 @@ class ChooseCardList extends Component {
cardCouStyle: PropTypes.object, // 指定计数样式
cardShowDefIcon: PropTypes.bool, // 是否显示默认无图
cardKeyName: PropTypes.string, // 关键key值
}
......@@ -54,7 +55,7 @@ class ChooseCardList extends Component {
render() {
let {cardScrollEnabled, cardHorizontal, cardShowsHorizontalScrollIndicator, cardShowsVerticalScrollIndicator, cardStyleBox, cardStyleScroll, cardListOptions, cardItemTitle, cardItemIcon, cardImgName,
cardStyleListItem, cardStyleListItemAct, cardStyleItemIcon, cardStyleItemTit, cardStyleNotIconTit, cardStyleItemTitAct, cardCallBack, curActIndex, cardCountName, cardStyleType, cardCouStyle,
global_domain_config, cardShowDefIcon } = this.props
global_domain_config, cardShowDefIcon, cardKeyName } = this.props
let {countStyleType} = this.state
......@@ -82,7 +83,7 @@ class ChooseCardList extends Component {
item[cardItemIcon] = {uri: global_domain_config+'/jeecg-boot/sys/common/view/'+item[cardItemIcon][0]} // 正式
}
return <View style={styles.card_list_box}>
return <View style={styles.card_list_box} key={'choose_card'+index}>
<TouchableOpacity
activeOpacity={.8}
style={styles.list_touch_cont}
......
......@@ -37,7 +37,7 @@ class TipInfoNeedSelect extends Component {
super(props);
this.state = {
isVisible: false,
title: '愿意自动更换器械包?'
title: '同意自动更换同品不同器械包?'
}
}
......@@ -86,14 +86,14 @@ class TipInfoNeedSelect extends Component {
onPress={() => this.closeModal()}
style={[styles.foo_btn, styles.btn_cel]}
>
<Text style={[styles.btn_tit, styles.tit_cel]}>取消</Text>
<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>
<Text style={styles.btn_tit}></Text>
</TouchableOpacity>
</View>
</View>
......
import React, { Component } from 'react';
import { View, Text, SafeAreaView, StyleSheet, TouchableOpacity, Image, ScrollView, TextInput, Alert, Linking, NativeModules, Platform, DeviceEventEmitter } from 'react-native';
import {connect} from 'react-redux';
import { connect } from 'react-redux';
import { home_background_color, placehold_text_color, promary_color, safe_view, icon_style, list_common_item } from '../../base/BaseStyle';
import {
AsteriskTextStyle,
......@@ -25,8 +25,11 @@ import { SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_SUCCESS, SELF_ORDER_LIST_FAILURE
import PageListArrow from '../common/listDataComponent/PageListArrow';
import EmitterEvents from '../common/EmitterEvents';
import TipInfoNeedSelect from '../common/listDataComponent/TipInfoNeedSelect';
import LocalVariable from '../common/LocalVariable';
const SELECTED_QUQNTITY = 'selectedQuantity'
const SELECTED_DATA_ARR = 'selectedDataArr'
const QUANTITY_FIELD = 'quantity' // 计算的字段
class SelfOrderPage extends Component {
constructor(props) {
......@@ -46,7 +49,7 @@ class SelfOrderPage extends Component {
name: '请选择',
value: ''
},
{
{
"id": "2",
title: '客户名称',
name: '请选择',
......@@ -101,7 +104,11 @@ class SelfOrderPage extends Component {
"id": "10",
title: '选择产品',
name: '请选择',
value: ''
value: '',
lines: [],
sub_lines: [],
replace_item_flag: 'N', // 器械包
take_cert_flag: 'N' // 合格证
},
{
"id": "11",
......@@ -152,16 +159,16 @@ class SelfOrderPage extends Component {
dateModelPop: false, // 日期选择器
hasPermission: undefined, //录音 授权状态
audioPath: AudioUtils.DocumentDirectoryPath + `/self_audio_${new Date().getTime()}.aac`, // 文件路径
recording: false, //是否录音
pause: false, //录音是否暂停
stop: false, //录音是否停止
currentTime: 0, //录音时长
localCustomersOption: [], // 当前医院信息:客户名称、收单地点、收货地点、主治医生
local_tip:{
will: 'N', // 器械包
take_cert: 'N' // 合格证
local_tip: {
replace_item_flag: 'N', // 器械包
take_cert_flag: 'N' // 合格证
}
}
}
......@@ -184,7 +191,7 @@ class SelfOrderPage extends Component {
this.setState({
subInitListOption: cloneObject(listOptionData) // 存储初始化数据,提交成功后赋此值
})
if(state.listOptionData[0].name !== props.userInfo.person_name) {
if (state.listOptionData[0].name !== props.userInfo.person_name) {
listOptionData[0].name = props.userInfo.person_name
listOptionData[0].value = props.userInfo.user_name
this.setState({
......@@ -199,15 +206,15 @@ class SelfOrderPage extends Component {
AudioRecorder.requestAuthorization()
.then(isAuthor => {
console.log('是否授权: ' + isAuthor)
if(!isAuthor) {
if (!isAuthor) {
// return alert('APP需要使用录音,请打开录音权限允许APP使用')
return Alert.alert('提示信息', 'APP需要使用录音,请打开录音权限允许APP使用', [{
text: '设置',
onPress: () => {
if(Platform.OS == 'ios') {
if (Platform.OS == 'ios') {
Linking.openURL('app-settings:')
.catch(err => console.log('error', err))
} else if(Platform.OS == 'android') {
.catch(err => console.log('error', err))
} else if (Platform.OS == 'android') {
NativeModules.OpenSettings.openNetworkSettings(data => {
console.log('call back data', data)
}).catch(err => console.log('android---', err))
......@@ -217,7 +224,7 @@ class SelfOrderPage extends Component {
text: '取消',
}])
}
this.setState({hasPermission: isAuthor})
this.setState({ hasPermission: isAuthor })
this.prepareRecordingPath(this.state.audioPath);
// 录音进展
AudioRecorder.onProgress = (data) => {
......@@ -230,7 +237,7 @@ class SelfOrderPage extends Component {
// data 录音数据
console.log(this.state.currentTime)
};
})
})
}
/**
......@@ -252,9 +259,9 @@ class SelfOrderPage extends Component {
IncludeBase64: true, //是否是base64格式
AudioSource: 0, //音频源
}
AudioRecorder.prepareRecordingAtPath(path,option)
AudioRecorder.prepareRecordingAtPath(path, option)
}
// 开始录音
_record = async () => {
console.log('开始录音==')
......@@ -271,21 +278,21 @@ class SelfOrderPage extends Component {
// this.prepareRecordingPath(this.state.audioPath)
// }
// this.setState({recording: true,pause: false})
// try {
// await AudioRecorder.startRecording()
// } catch (err) {
// console.log(err)
// }
if(!this.state.hasPermission) {
if (!this.state.hasPermission) {
return Alert.alert('提示信息', 'APP需要使用录音,请打开录音权限允许APP使用', [{
text: '设置',
onPress: () => {
if(Platform.OS == 'ios') {
if (Platform.OS == 'ios') {
Linking.openURL('app-settings:')
.catch(err => console.log('error', err))
} else if(Platform.OS == 'android') {
.catch(err => console.log('error', err))
} else if (Platform.OS == 'android') {
NativeModules.OpenSettings.openNetworkSettings(data => {
console.log('call back data', data)
}).catch(err => console.log('android---', err))
......@@ -297,7 +304,7 @@ class SelfOrderPage extends Component {
// return
}
show('录音开始')
if(this.state.stop) {
if (this.state.stop) {
// 初始化录音
this.prepareRecordingPath(this.state.audioPath)
}
......@@ -307,14 +314,14 @@ class SelfOrderPage extends Component {
console.error(err)
}
}
// 停止录音
_stop = async () => {
console.log('----停止录音---', this.state.hasPermission)
if(!this.state.hasPermission) {
if (!this.state.hasPermission) {
return
// return alert('没有授权')
}
}
show('录音结束')
try {
await AudioRecorder.stopRecording();
......@@ -332,20 +339,20 @@ class SelfOrderPage extends Component {
// console.error(error);
// }
}
// 播放录音
_play = async () => {
let self = this
show('正在播放')
self.whoosh = new Sound(this.state.audioPath, '', (err) => {
if(err) {
if (err) {
show('加载音频失败')
return console.log('加载音频失败-->',err)
return console.log('加载音频失败-->', err)
}
self.whoosh.play(success => {
if(success) {
if (success) {
show('播放完毕')
}else {
} else {
show('播放失败')
console.log('fail - 播放失败')
}
......@@ -367,7 +374,7 @@ class SelfOrderPage extends Component {
// })
// })
}
// 停止播放录音 -- 安卓不能停止、ios可以
// _stopPlay = async () => {
// console.log('tingzhi bofang')
......@@ -381,7 +388,7 @@ class SelfOrderPage extends Component {
_del = async () => {
// 初始化录音
this.prepareRecordingPath(this.state.audioPath)
let {listOptionData} = this.state
let { listOptionData } = this.state
listOptionData[12].value = ''
this.setState({
currentTime: 0,
......@@ -391,9 +398,9 @@ class SelfOrderPage extends Component {
}
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
if(self_list_status != nextProps.self_list_status) {
if (self_list_status != nextProps.self_list_status) {
switch (nextProps.self_list_status) {
case SELF_ORDER_LIST_DOING:
this.changeSubLoding(true)
......@@ -402,27 +409,27 @@ class SelfOrderPage extends Component {
self.setState({
isSubLoding: false,
lodingTitle: '加载中'
},() => {
}, () => {
self.changeCurrentOption()
})
break;
case SELF_ORDER_LIST_FAILURE:
this.changeSubLoding(false)
break;
default:
default:
break;
}
}
if(loginState != nextProps.loginState) {
switch(nextProps.loginState) {
if (loginState != nextProps.loginState) {
switch (nextProps.loginState) {
case LOGIN_NO:
navigation.navigate('LoginPage')
break;
default:
default:
break;
}
}
if(submit_self_order_status != nextProps.submit_self_order_status) {
if (submit_self_order_status != nextProps.submit_self_order_status) {
switch (nextProps.submit_self_order_status) {
case SELF_SUBMIT_DOING:
this.changeSubLoding(true, '提交中')
......@@ -431,14 +438,14 @@ class SelfOrderPage extends Component {
self.setState({
isSubLoding: false,
lodingTitle: '提交中'
},() => {
}, () => {
self.processReturnData()
})
break;
case SELF_SUBMIT_FAILURE:
this.changeSubLoding(false, '提交中')
break;
default:
default:
break;
}
}
......@@ -478,21 +485,21 @@ class SelfOrderPage extends Component {
let that = this
this.setState({
listOptionData: listOptionData.map((item, index) => {
if(index > curIndex && index < 12 ) {
if (index > curIndex && index < 12) {
item.name = localOtherObj.name
item.value = localOtherObj.value
if(listOptionData[1].value && item.title == '客户名称') {
if (listOptionData[1].value && item.title == '客户名称') {
that.organizationGetCustomerData()
}
if(listOptionData[2].value && item.title == '收单地点') {
if (listOptionData[2].value && item.title == '收单地点') {
that.customerGetBill()
}
if(listOptionData[2].value && item.title == '收货地点') {
if (listOptionData[2].value && item.title == '收货地点') {
that.customerGetShip()
}
if(item.title == '主治医生') {
if (item.title == '主治医生') {
item.showInput = false,
item.inputValue = ''
item.inputValue = ''
}
}
return item
......@@ -505,21 +512,21 @@ class SelfOrderPage extends Component {
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 !== '其他') {
// // 不是主治医生
// tempTit = listOptionData[chIndex].title
// tempStatus = true
// break
// }
for (let chIndex in listOptionData) {
if(chIndex > 0 && chIndex < 11
&& !listOptionData[chIndex].value
&& listOptionData[chIndex].name !== '其他') {
// 不是主治医生
console.log('tempTit--', tempTit)
tempTit = listOptionData[chIndex].title
tempStatus = true
break
}
}
this.setState({
canSubFlag: !tempStatus
})
if(isSubCheck && tempStatus) {
if (isSubCheck && tempStatus) {
show(`${tempTit}未选择,不能提交`)
}
}
......@@ -527,20 +534,20 @@ class SelfOrderPage extends Component {
// 选择器弹窗回调函数
handleCallBack(item, itemTitle) {
// console.log('选择器弹窗回调函数-----',itemTitle)
let { listOptionData} = this.state
let { listOptionData } = this.state
let self = this
listOptionData.map(function(chItem, index){
if(chItem.title === itemTitle) {
listOptionData.map(function (chItem, index) {
if (chItem.title === itemTitle) {
chItem.name = item.name
chItem.value = item.value
if(itemTitle === '组织') {
if (itemTitle === '组织') {
self.clearInitNameAndValue(1)
}
if(itemTitle === '客户名称') {
if (itemTitle === '客户名称') {
self.clearInitNameAndValue(2)
}
if (itemTitle === '主治医生') {
if(item.name === '其他') {
if (item.name === '其他') {
chItem.showInput = true
} else {
chItem.showInput = false
......@@ -548,7 +555,7 @@ class SelfOrderPage extends Component {
}
self.clearInitNameAndValue(5)
}
if(itemTitle === '手术类型') {
if (itemTitle === '手术类型') {
self.clearInitNameAndValue(8)
}
}
......@@ -556,7 +563,7 @@ class SelfOrderPage extends Component {
this.setState({
currentItem: item,
listOptionData: listOptionData
},() => {
}, () => {
self.changeCanSub()
})
}
......@@ -574,7 +581,7 @@ class SelfOrderPage extends Component {
let { selfOrderOption } = this.props
let tempOption = []
let that = this
if(selfOrderOption.length === 0) {
if (selfOrderOption.length === 0) {
show(`当前${currentTitle}为空`)
return
}
......@@ -587,7 +594,7 @@ class SelfOrderPage extends Component {
// 去重医院数据
let filterOpt = dedupQuoteArray(selfOrderOption, 'customer_code')
let currentArr = []
if(filterOpt.length) {
if (filterOpt.length) {
filterOpt.forEach(item => {
let obj = {}
obj.customer_code = item.customer_code
......@@ -605,9 +612,9 @@ class SelfOrderPage extends Component {
resultArr.push(obj)
})
tempOption = [...resultArr]
}else if (currentTitle === '订单类型') {
} else if (currentTitle === '订单类型') {
tempOption = this.changeNameAndValue(selfOrderOption, 'value_name', 'value_code')
}
}
this.setState({
listCurrentOption: [...tempOption]
}, () => {
......@@ -738,7 +745,7 @@ class SelfOrderPage extends Component {
data.forEach(item => {
let obj = {}
obj.name = item[nameType],
obj.value = item[valueType]
obj.value = item[valueType]
result.push(obj)
})
return result
......@@ -780,7 +787,7 @@ class SelfOrderPage extends Component {
handleCustomerCheck(curData) {
// let { state, props } = this
let self = this
if(this.judgeOrgIsNull()) {
if (this.judgeOrgIsNull()) {
self.setState({
currentTitle: curData.title,
currentItem: {
......@@ -790,13 +797,13 @@ class SelfOrderPage extends Component {
}, () => {
// 在此修改接口
self.getCustomerData()
})
})
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.log('客户名称------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '客户名称',
// currentItem: {
......@@ -829,15 +836,15 @@ class SelfOrderPage extends Component {
let that = this
let { global_domain_config } = props
let cusResult = await reqSelfSurgeryHospital(global_domain_config, params);
if(cusResult.error_code == 0) {
if (cusResult.error_code == 0) {
let { data: { customers } } = cusResult
props.requestListDataSuccess(customers)
let filterOpt = dedupQuoteArray(customers, 'customer_code')
if(filterOpt.length === 0) {
if (filterOpt.length === 0) {
show(`当前客户名称为空`)
return
}
if(filterOpt.length === 1) {
if (filterOpt.length === 1) {
let { listOptionData } = state
listOptionData[2].name = filterOpt[0].customer_name
listOptionData[2].value = filterOpt[0].customer_code
......@@ -849,7 +856,7 @@ class SelfOrderPage extends Component {
that.customerGetShip()
})
}
} else if(cusResult.error_code == 41006) {
} else if (cusResult.error_code == 41006) {
show('登录过期,请重新登录');
props.exitLoginStatus();
} else {
......@@ -862,7 +869,7 @@ class SelfOrderPage extends Component {
handleBillCheck(curData) {
let { localCustomersOption, listOptionData } = this.state
let self = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
if (this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
self.setState({
currentTitle: curData.title,
currentItem: {
......@@ -871,9 +878,9 @@ class SelfOrderPage extends Component {
}
}, () => {
let tempOption = []
if( localCustomersOption.length ) {
if (localCustomersOption.length) {
localCustomersOption.forEach((item) => {
if(item.customer_code === listOptionData[2].value) {
if (item.customer_code === listOptionData[2].value) {
// 保证是当前客户名称下的地点
let obj = {}
obj.value = item.bill_to_site_code
......@@ -909,11 +916,11 @@ class SelfOrderPage extends Component {
let that = this
let tempLocalOption = localCustomersOption.filter(item => item.customer_code === listOptionData[2].value)
tempLocalOption = dedupQuoteArray(tempLocalOption, 'bill_to_site_code')
if(tempLocalOption.length === 0) {
if (tempLocalOption.length === 0) {
show(`当前收单地点为空`)
return
}
if(tempLocalOption.length === 1) {
if (tempLocalOption.length === 1) {
listOptionData[3].name = tempLocalOption[0].bill_to_site_name
listOptionData[3].value = tempLocalOption[0].bill_to_site_code
that.setState({
......@@ -926,7 +933,7 @@ class SelfOrderPage extends Component {
handleShipCheck(curData) {
let { localCustomersOption, listOptionData } = this.state
let self = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
if (this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
self.setState({
currentTitle: curData.title,
currentItem: {
......@@ -935,9 +942,9 @@ class SelfOrderPage extends Component {
}
}, () => {
let tempOption = []
if( localCustomersOption.length ) {
if (localCustomersOption.length) {
localCustomersOption.forEach((item, index) => {
if(item.customer_code === listOptionData[2].value) {
if (item.customer_code === listOptionData[2].value) {
// 保证是当前客户名称下的地点
let obj = {}
obj.value = item.ship_to_site_code
......@@ -973,11 +980,11 @@ class SelfOrderPage extends Component {
let that = this
let tempLocalOption = localCustomersOption.filter(item => item.customer_code === listOptionData[2].value)
tempLocalOption = dedupQuoteArray(tempLocalOption, 'ship_to_site_code')
if(tempLocalOption.length === 0) {
if (tempLocalOption.length === 0) {
show(`当前收货地点为空`)
return
}
if(tempLocalOption.length === 1) {
if (tempLocalOption.length === 1) {
listOptionData[4].name = tempLocalOption[0].ship_to_site_name
listOptionData[4].value = tempLocalOption[0].ship_to_site_code
that.setState({
......@@ -990,7 +997,7 @@ class SelfOrderPage extends Component {
handleDoctorCheck(curData) {
let { localCustomersOption, listOptionData } = this.state
let self = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
if (this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
// 点击
self.setState({
currentTitle: curData.title,
......@@ -1000,9 +1007,9 @@ class SelfOrderPage extends Component {
}
}, () => {
let tempOption = []
if( localCustomersOption.length ) {
if (localCustomersOption.length) {
localCustomersOption.forEach((item) => {
if(item.customer_code === listOptionData[2].value) {
if (item.customer_code === listOptionData[2].value) {
// 保证是当前客户名称下的医生
let obj = {}
obj.value = item.customer_doctor
......@@ -1056,29 +1063,29 @@ class SelfOrderPage extends Component {
// 主治医生 输入
handleDoctorInput(text, curData) {
let { listOptionData } = this.state
listOptionData.map(function(item) {
if(item.title === curData.title) {
listOptionData.map(function (item) {
if (item.title === curData.title) {
item.inputValue = text
}
})
this.setState({
listOptionData: listOptionData
})
console.log('手术名称---',text, curData,listOptionData[5])
console.log('手术名称---', text, curData, listOptionData[5])
}
// 手术名称 输入
handleSurNameInput(text, curData) {
let { listOptionData } = this.state
listOptionData.map(function(item) {
if(item.title === curData.title) {
listOptionData.map(function (item) {
if (item.title === curData.title) {
item.value = text
}
})
this.setState({
listOptionData: listOptionData
})
console.log('手术名称---',text, curData,listOptionData[6])
console.log('手术名称---', text, curData, listOptionData[6])
}
// 手术时间 点击 2020-04-23 17:41
......@@ -1086,16 +1093,16 @@ class SelfOrderPage extends Component {
console.log('手术时间 点击 ===', curData)
let { listOptionData } = this.state
let date = curData.value
if(date) {
listOptionData.map(function(item) {
if(item.title === curData.title) {
if (date) {
listOptionData.map(function (item) {
if (item.title === curData.title) {
item.dateValue = formatStrForDate(date)
}
})
this.setState({
listOptionData: listOptionData
})
}
}
this.closeDateModal(true)
}
......@@ -1108,10 +1115,10 @@ class SelfOrderPage extends Component {
// 修改当前日期数据
dateModalCallback(date, curData) {
console.log('修改当前日期数据:',date,curData)
console.log('修改当前日期数据:', date, curData)
let { listOptionData } = this.state
listOptionData.map(function(item){
if(item.title === curData.title){
listOptionData.map(function (item) {
if (item.title === curData.title) {
item.name = date
item.value = date
item.dateValue = formatStrForDate(date)
......@@ -1127,7 +1134,7 @@ class SelfOrderPage extends Component {
handleSurTypeCheck(curData) {
let { props } = this
let self = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
if (this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
self.setState({
currentTitle: curData.title,
currentItem: {
......@@ -1161,7 +1168,7 @@ class SelfOrderPage extends Component {
// 订单类型 点击
handleOrderCheck(curData) {
let { state, props } = this
if(this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
if (this.judgeOrgIsNull() && this.judgeCustomerIsNull()) {
this.setState({
currentTitle: curData.title,
currentItem: {
......@@ -1172,10 +1179,10 @@ class SelfOrderPage extends Component {
// 在此修改接口
let params = {
access_token: props.token,
value_set_code:'SUR_ORDER_TYPE'
value_set_code: 'SUR_ORDER_TYPE'
}
props.requestSelfOrderType(params)
})
})
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
......@@ -1195,8 +1202,8 @@ class SelfOrderPage extends Component {
// 选择产品 点击跳转
handleProductCheck() {
if(this.judgeOrgIsNull()){
let {listOptionData} = this.state
if (this.judgeOrgIsNull()) {
let { listOptionData } = this.state
this.props.navigation.navigate('ChooseProductPage', {
title: `选择产品`,
selfData: {
......@@ -1208,127 +1215,250 @@ class SelfOrderPage extends Component {
// 选择产品 回调
productCallBack(params) {
let {listOptionData} = this.state
let { listOptionData } = this.state
// console.log('选择产品返回=!!!!=', params)
// console.log('选择产品返回=!!!!=', this)
// console.log('选择产品返回=!!!!=', this.state)
listOptionData[10].value = ''
if(params && params.local_lines) {
listOptionData[10].value = '已选'
listOptionData[10].lines = []
if (params && params.local_lines) {
params.local_lines.forEach(loc_item => {
if(loc_item[SELECTED_QUQNTITY] > 0){
listOptionData[10].value += `${loc_item.supplier_short_name}x${loc_item[SELECTED_QUQNTITY]} `
if (loc_item[SELECTED_QUQNTITY] > 0) {
listOptionData[10].value += `${loc_item.supplier_short_name}】物料 `
}
})
listOptionData[10].name = listOptionData[10].value
listOptionData[10].lines = cloneObject(params.local_lines)
}
// console.log('选择产品返回=!!!=', listOptionData[10])
this.setState({
listOptionData: listOptionData
},() => {
this.changeCanSub()
})
}
// 备注 输入
handleRemarkInput(text, curData) {
let { listOptionData } = this.state
listOptionData.map(function(item){
if(item.title === curData.title){
listOptionData.map(function (item) {
if (item.title === curData.title) {
item.value = text
}
})
this.setState({
listOptionData: listOptionData
})
console.log('备注---',listOptionData[11])
console.log('备注---', listOptionData[11])
}
// 生成订单 点击
handleSubmit() {
async handleSubmit() {
console.log('生成订单', this.props.navigation)
let { local_tip, listOptionData } = this.state
this.refs.PackageModel.show()
// this.refs.PackageModel.show()
// this.refs.CertModel.show('需要携带合格证?')
// this.refs.CertModel.show('需要携带注册证?')
// this.getSumLinesOps()
// this.changeCanSub(true)
// let { state, props } = this
// let that = this
// // 可提交 并且 不处于正在提交中
// if(state.canSubFlag && !state.isSubLoding) {
// // 先提交录音,再提交接口
// if(state.stop) {
// let params = {
// access_token: props.token,
// path: state.audioPath
// }
// let {global_domain_config} = props
// let audioResult = await requestSelfAudio(global_domain_config, params);
// that.changeSubLoding(true, '上传中')
// if(audioResult.error_code == 0) {
// // 提交订单
// that.setState({
// listOptionData: state.listOptionData.map((item, index) => {
// if(index == 11) {
// item.value = audioResult.data.url
// }
// return item
// })
// }, () => {
// that.changeSubLoding(false)
// that.submitSelfOrder()
// })
// } else if(audioResult.error_code == 41006) {
// that.changeSubLoding(false)
// show('登录过期,请重新登录');
// props.exitLoginStatus();
// } else {
// // that.changeSubLoding(false)
// let error_msg = audioResult.error_msg || audioResult.message
// show(error_msg);
// that.submitSelfOrder()
// }
// } else {
// that.submitSelfOrder()
// }
// }
// // let { navigation } = this.props
// // let { state: { params: { title } } } = navigation
// // navigation.navigate('SubSuccessPage', { title: `${title} - 下单成功` })
this.changeCanSub(true)
let { state, props } = this
let that = this
// 可提交 并且 不处于正在提交中
if(state.canSubFlag && !state.isSubLoding) {
// 先提交录音,再提交接口
if(state.stop) {
let params = {
access_token: props.token,
path: state.audioPath
}
let {global_domain_config} = props
let audioResult = await requestSelfAudio(global_domain_config, params);
that.changeSubLoding(true, '上传中')
if(audioResult.error_code == 0) {
// 提交订单
that.setState({
listOptionData: state.listOptionData.map((item, index) => {
if(index == 11) {
item.value = audioResult.data.url
}
return item
})
}, () => {
that.changeSubLoding(false)
that.submitSelfOrder()
})
} else if(audioResult.error_code == 41006) {
that.changeSubLoding(false)
show('登录过期,请重新登录');
props.exitLoginStatus();
} else {
that.changeSubLoding(false)
let error_msg = audioResult.error_msg || audioResult.message
show(error_msg);
that.submitSelfOrder()
}
} else {
that.submitSelfOrder()
}
}
// let { navigation } = this.props
// let { state: { params: { title } } } = navigation
// navigation.navigate('SubSuccessPage', { title: `${title} - 下单成功` })
}
// 提交订单
submitSelfOrder() {
// let { state, props } = this
// 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
// }
let { state, props } = this
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.surgery_name = state.listOptionData[6].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
// let params = {
// access_token: props.token,
// data: { ...tempSubOption }
// }
tempSubOption.surgery_date = state.listOptionData[7].value
tempSubOption.surgery_type_code = state.listOptionData[8].value
tempSubOption.order_type_code = state.listOptionData[9].value
tempSubOption.surgery_desc = state.listOptionData[11].value
tempSubOption.voice_url = state.listOptionData[12].value
tempSubOption.replace_item_flag = state.listOptionData[10].replace_item_flag
tempSubOption.take_cert_flag = state.listOptionData[10].take_cert_flag
tempSubOption.Caller = 'APP'
tempSubOption.lines = state.listOptionData[10].sub_lines
let params = {
access_token: props.token,
data: { ...tempSubOption }
}
console.log('submitSelfOrder!!!!',params )
// props.requestSelfSumbit(params)
}
// 获取选择产品提交接口需要的数据
getSumLinesOps() {
let { local_tip, listOptionData } = this.state
// 修改提交的行数据
let local_lines = cloneObject(listOptionData[10].lines)
let res_lines = []
console.log('提交==', local_lines)
let showPackageTip = false
local_lines.forEach(sup_item => {
if (sup_item[SELECTED_QUQNTITY] > 0 && sup_item.leftOptionList && sup_item.leftOptionList.length > 0) {
sup_item.leftOptionList.map(lef_item => {
let select_arr = lef_item[SELECTED_DATA_ARR]
if (lef_item[SELECTED_QUQNTITY] > 0 && select_arr && select_arr.length > 0) {
// console.log('lef_item.category_code--', lef_item.category_code)
if (lef_item.category_code === LocalVariable.SURGICAL_TEMPLATE) {
// 手术模板
select_arr.forEach(sel_item => {
let template_number = sel_item.template_number
// sel_item.childrenLineData[0].lineOptions[0][SELECTED_DATA_ARR]
if (sel_item[LocalVariable.CHILDREN_LINE_NAME] && sel_item[LocalVariable.CHILDREN_LINE_NAME].length > 0) {
sel_item[LocalVariable.CHILDREN_LINE_NAME].forEach(chi_item => {
if (chi_item[LocalVariable.LINE_OPTIONS] && chi_item[LocalVariable.LINE_OPTIONS].length > 0) {
chi_item[LocalVariable.LINE_OPTIONS].forEach(lin_item => {
if (lin_item[LocalVariable.SELECTED_DATA_ARR] && lin_item[LocalVariable.SELECTED_DATA_ARR].length > 0) {
lin_item[LocalVariable.SELECTED_DATA_ARR].forEach(sel_item => {
sel_item['template_number'] = template_number
sel_item[LocalVariable.PLAN_QUANTITY] = sel_item[LocalVariable.QUANTITY_FIELD]
res_lines.push(sel_item)
})
}
})
}
})
}
})
} else if (lef_item.category_code === LocalVariable.NAIL_BOX || lef_item.category_code === LocalVariable.EQUIPMENT_BAG) {
// 钉盒/器械包
if (lef_item.category_code === LocalVariable.EQUIPMENT_BAG) {
showPackageTip = true
}
select_arr.forEach(sel_item => {
sel_item['prefer_serial_number'] = sel_item.serial_number
sel_item[LocalVariable.PLAN_QUANTITY] = sel_item[LocalVariable.QUANTITY_FIELD]
res_lines.push(sel_item)
})
}
else if (lef_item.category_code === LocalVariable.SCATTERED_EQUIPMENT) {
// 零散器械
select_arr.forEach(sel_item => {
sel_item[LocalVariable.PLAN_QUANTITY] = sel_item[LocalVariable.QUANTITY_FIELD]
res_lines.push(sel_item)
})
}
else {
// 单选耗材
if (select_arr[0].details && select_arr[0].details.length > 0) {
// 大-中-小类
select_arr.forEach(sel_item => {
sel_item.details.forEach(end_item => {
if (end_item[QUANTITY_FIELD] > 0) {
end_item[LocalVariable.PLAN_QUANTITY] = end_item[LocalVariable.QUANTITY_FIELD]
res_lines.push(end_item)
}
})
})
} else {
// 大类-小类
select_arr.forEach(sel_item => {
sel_item[LocalVariable.PLAN_QUANTITY] = sel_item[LocalVariable.QUANTITY_FIELD]
res_lines.push(sel_item)
})
}
}
}
})
}
})
console.log('提交==', res_lines)
let test_sum_num = 0
res_lines.map(line => {
test_sum_num += line[LocalVariable.PLAN_QUANTITY]
})
console.log('提交==', test_sum_num)
console.log('提交==', showPackageTip)
console.log('提交==', listOptionData[10].lines)
listOptionData[10].sub_lines = res_lines
if(showPackageTip){
this.refs.PackageModel.show()
}else {
this.refs.CertModel.show('需要携带注册证?')
}
}
// 判断组织是否为空
judgeOrgIsNull() {
let { listOptionData } = this.state
let orgVal = listOptionData[1].value
if(!orgVal) {
if (!orgVal) {
show('请先选择组织')
return false
} else {
......@@ -1339,7 +1469,7 @@ class SelfOrderPage extends Component {
judgeCustomerIsNull() {
let { listOptionData } = this.state
let orgVal = listOptionData[2].value
if(!orgVal) {
if (!orgVal) {
show('请先选择客户名称')
return false
} else {
......@@ -1350,8 +1480,8 @@ class SelfOrderPage extends Component {
processReturnData() {
let { selfOrderOption } = this.props
let that = this
if(selfOrderOption.create_success) {
if(selfOrderOption.create_success == 'N') {
if (selfOrderOption.create_success) {
if (selfOrderOption.create_success == 'N') {
// // 打开库存不足弹窗
// this.setState({
// not_enough_items_list: selfOrderOption.not_enough_items_list
......@@ -1363,7 +1493,7 @@ class SelfOrderPage extends Component {
// })
// }, 500)
// })
} else if(selfOrderOption.create_success == 'Y') {
} else if (selfOrderOption.create_success == 'Y') {
// // 打开下单成功页面
// this.clearAllData()
// let { state: { params: { title } } } = this.props.navigation
......@@ -1376,8 +1506,8 @@ class SelfOrderPage extends Component {
}
// 清空数据
clearAllData() {
let {props} = this
let {listOptionData, subInitListOption} = this.state
let { props } = this
let { listOptionData, subInitListOption } = this.state
props.setSelfInitData() // 清空缓存数据
listOptionData = cloneObject(subInitListOption) // 清空本地数据
this.setState({
......@@ -1388,13 +1518,21 @@ class SelfOrderPage extends Component {
}
// 提交的提示回调函数
modelPackageCertCB(typeName, nowVal){
let {local_tip} = this.state
local_tip[typeName] = nowVal
modelPackageCertCB(typeName, nowVal) {
let { local_tip, listOptionData } = this.state
listOptionData[10][typeName] = nowVal
// local_tip[typeName] = nowVal
this.setState({
local_tip: local_tip
listOptionData: listOptionData
// local_tip: local_tip
})
console.log('local_tip---', local_tip)
console.log('modelPackageCertCB---', listOptionData[10])
if (typeName === 'replace_item_flag') {
this.refs.CertModel.show('需要携带注册证?')
} else {
console.log('请求提交====')
this.handleSubmit()
}
}
......@@ -1421,16 +1559,16 @@ class SelfOrderPage extends Component {
// 返回备注以上的元素
renderListItem() {
let { listOptionData, dateModelPop } = this.state
return(
return (
<View style={styles.list_cont}>
<PageListArrow
<PageListArrow
listActOpa={1}
listEditAble={true}
listHasAster={true}
listItem={listOptionData[0]}
listDefaValue={'name'}
listTitle={'title'}
/>
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={1}
......@@ -1444,7 +1582,7 @@ class SelfOrderPage extends Component {
</TouchableOpacity>
</View> */}
<PageListArrow
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[1]}
......@@ -1452,7 +1590,7 @@ class SelfOrderPage extends Component {
listTitle={'title'}
listCallBack={() => this.handleOrganizationCheck(listOptionData[1])}
listHasArrow={true}
/>
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
......@@ -1467,7 +1605,7 @@ class SelfOrderPage extends Component {
</TouchableOpacity>
</View> */}
<PageListArrow
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[2]}
......@@ -1475,7 +1613,7 @@ class SelfOrderPage extends Component {
listTitle={'title'}
listCallBack={() => this.handleCustomerCheck(listOptionData[2])}
listHasArrow={true}
/>
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
......@@ -1490,7 +1628,7 @@ class SelfOrderPage extends Component {
</TouchableOpacity>
</View> */}
<PageListArrow
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[3]}
......@@ -1498,7 +1636,7 @@ class SelfOrderPage extends Component {
listTitle={'title'}
listCallBack={() => this.handleBillCheck(listOptionData[3])}
listHasArrow={true}
/>
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
......@@ -1513,7 +1651,7 @@ class SelfOrderPage extends Component {
</TouchableOpacity>
</View> */}
<PageListArrow
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[4]}
......@@ -1521,7 +1659,7 @@ class SelfOrderPage extends Component {
listTitle={'title'}
listCallBack={() => this.handleShipCheck(listOptionData[4])}
listHasArrow={true}
/>
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
......@@ -1536,7 +1674,7 @@ class SelfOrderPage extends Component {
</TouchableOpacity>
</View> */}
<PageListArrow
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[5]}
......@@ -1547,7 +1685,7 @@ class SelfOrderPage extends Component {
listOtherInput={'请输入主治医生'}
otherInput={'showInput'}
otherInputCallBack={(text) => this.handleDoctorInput(text, listOptionData[5])}
/>
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
......@@ -1573,15 +1711,16 @@ class SelfOrderPage extends Component {
</View> */}
<PageListArrow
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[6]}
listInputPlace={'请输入'}
listDefaValue={'value'}
listTitle={'title'}
inputCallBack={(text) => this.handleSurNameInput(text, listOptionData[6])}
isTitInputStyle={true}
/>
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={1}
......@@ -1599,14 +1738,15 @@ class SelfOrderPage extends Component {
</TouchableOpacity>
</View> */}
<PageListArrow
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[7]}
listName={'name'}
listTitle={'title'}
listCallBack={() => this.handleSurDateCheck(listOptionData[7])}
listHasArrow={true}
/>
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
......@@ -1620,7 +1760,7 @@ class SelfOrderPage extends Component {
</TouchableOpacity>
</View> */}
<PageListArrow
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[8]}
......@@ -1628,7 +1768,7 @@ class SelfOrderPage extends Component {
listTitle={'title'}
listCallBack={() => this.handleSurTypeCheck(listOptionData[8])}
listHasArrow={true}
/>
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
......@@ -1643,7 +1783,7 @@ class SelfOrderPage extends Component {
</TouchableOpacity>
</View> */}
<PageListArrow
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[9]}
......@@ -1651,7 +1791,7 @@ class SelfOrderPage extends Component {
listTitle={'title'}
listCallBack={() => this.handleOrderCheck(listOptionData[9])}
listHasArrow={true}
/>
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
......@@ -1666,7 +1806,7 @@ class SelfOrderPage extends Component {
</TouchableOpacity>
</View> */}
<PageListArrow
<PageListArrow
listActOpa={.8}
listHasAster={true}
listItem={listOptionData[10]}
......@@ -1675,7 +1815,7 @@ class SelfOrderPage extends Component {
listCallBack={() => this.handleProductCheck(listOptionData[10])}
listHasArrow={true}
listMaxLines={1}
/>
/>
{/* <View style={styles.item_container}>
<TouchableOpacity
activeOpacity={.8}
......@@ -1689,17 +1829,17 @@ class SelfOrderPage extends Component {
</CellTextStyle>
</TouchableOpacity>
</View> */}
<DateModel
date={listOptionData[7].dateValue}
closeModal={(show) => this.closeDateModal(show)}
show={dateModelPop}
callback={(date) => this.dateModalCallback(date, listOptionData[7])}
/>
/>
{ this.renderPickerModel() }
{ this.renderTipModelPackage() }
{ this.renderTipModelCert() }
{ this.renderPickerModel()}
{ this.renderTipModelPackage()}
{ this.renderTipModelCert()}
</View>
)
......@@ -1709,7 +1849,7 @@ class SelfOrderPage extends Component {
renderRightArrowItem() {
return (
<ImageTextStyle>
<Image source={require('../../images/arr_rig.png')} style={icon_style}/>
<Image source={require('../../images/arr_rig.png')} style={icon_style} />
</ImageTextStyle>
)
}
......@@ -1727,7 +1867,7 @@ class SelfOrderPage extends Component {
itemValue={currentItem.value}
itemTitle={currentTitle}
closeModal={(show) => this.handleCloseModal(show)}
/>
/>
</SafeAreaView>
)
}
......@@ -1739,20 +1879,20 @@ class SelfOrderPage extends Component {
<CellTextStyle style={list_common_item.remark_item}>
<View style={list_common_item.rema_box}>
<Text style={list_common_item.rema_tit}>备注</Text>
<View style = {list_common_item.rema_Input_outer} >
<TouchableOpacity activeOpacity = {1} style = {list_common_item.rema_Input_inner} onPress = {() => this.TextInput.focus()} >
<View style={list_common_item.rema_Input_outer} >
<TouchableOpacity activeOpacity={1} style={list_common_item.rema_Input_inner} onPress={() => this.TextInput.focus()} >
<TextInput
placeholder = {'请输入备注信息'}
placeholderTextColor = {placehold_text_color}
underlineColorAndroid = {'transparent'}
multiline = {true}
ref = {textInput => this.TextInput = textInput}
numberOfLines = {8}
placeholder={'请输入备注信息'}
placeholderTextColor={placehold_text_color}
underlineColorAndroid={'transparent'}
multiline={true}
ref={textInput => this.TextInput = textInput}
numberOfLines={8}
style={list_common_item.rema_Input}
maxLength={140}
onChangeText={(text) => this.handleRemarkInput(text, listOptionData[11])}
defaultValue={listOptionData[11].value}
/>
/>
</TouchableOpacity>
</View>
</View>
......@@ -1766,42 +1906,42 @@ class SelfOrderPage extends Component {
return (
<CellTextStyle style={[list_common_item.reco_item, !stop ? '' : list_common_item.reco_play_height]}>
<View style={list_common_item.reco_btn_cont}>
{ !stop ? <Text style={list_common_item.reco_btn_tit}>还有什么要安排的,可录音备注哟!</Text> : null }
{!stop ? <Text style={list_common_item.reco_btn_tit}>还有什么要安排的,可录音备注哟!</Text> : null}
{
!stop ?
!stop ?
<View style={list_common_item.reco_btn_inner}>
<TouchableOpacity
activeOpacity = {.8}
activeOpacity={.8}
style={list_common_item.reco_btn_box}
onLongPress={this._record}
onPressOut={this._stop}
>
>
<View style={list_common_item.reco_img_box}>
<Image source={require('../../images/record_icon.png')} style={icon_style}/>
<Image source={require('../../images/record_icon.png')} style={icon_style} />
</View>
<Text style={list_common_item.reco_btn_text}>长按录音</Text>
</TouchableOpacity>
</View>
: <View style={list_common_item.reco_play_box}>
<View style={list_common_item.play_btn}>
: <View style={list_common_item.reco_play_box}>
<View style={list_common_item.play_btn}>
<TouchableOpacity
activeOpacity = {.8}
style={[list_common_item.reco_list_box, list_common_item.reco_del_btn]}
onPress={this._del}
>
<Text style={[list_common_item.reco_text, list_common_item.reco_del_tit]}> 删除 </Text>
</TouchableOpacity>
<TouchableOpacity
activeOpacity = {.8}
style={[list_common_item.reco_list_box, list_common_item.reco_play_btn]}
onPress={this._play}
>
<Text style={[list_common_item.reco_text, list_common_item.reco_play_tit]}> 点击播放({currentTime}'') </Text>
</TouchableOpacity>
</View>
activeOpacity={.8}
style={[list_common_item.reco_list_box, list_common_item.reco_del_btn]}
onPress={this._del}
>
<Text style={[list_common_item.reco_text, list_common_item.reco_del_tit]}> 删除 </Text>
</TouchableOpacity>
<TouchableOpacity
activeOpacity={.8}
style={[list_common_item.reco_list_box, list_common_item.reco_play_btn]}
onPress={this._play}
>
<Text style={[list_common_item.reco_text, list_common_item.reco_play_tit]}> 点击播放({currentTime}'') </Text>
</TouchableOpacity>
</View>
</View>
}
</View>
</CellTextStyle>
)
......@@ -1810,73 +1950,74 @@ class SelfOrderPage extends Component {
// 返回正在加载中
renderLodingItem() {
let { lodingTitle, isSubLoding } = this.state
return(
return (
<LodingModel title={lodingTitle} show={isSubLoding} style_back={styles.loding_back} />
)
}
// 返回提交器械包提示
renderTipModelPackage(){
renderTipModelPackage() {
return (
<TipInfoNeedSelect ref="PackageModel" closeCallBack={() => this.modelPackageCertCB('will','N')} submitCallBack={() => this.modelPackageCertCB('will','Y')}/>
<TipInfoNeedSelect ref="PackageModel" closeCallBack={() => this.modelPackageCertCB('replace_item_flag', 'N')} submitCallBack={() => this.modelPackageCertCB('replace_item_flag', 'Y')} />
)
}
// 返回提交合格证提示
renderTipModelCert(){
renderTipModelCert() {
return (
<TipInfoNeedSelect ref="CertModel" closeCallBack={() => this.modelPackageCertCB('take_cert','N')} submitCallBack={() => this.modelPackageCertCB('take_cert','Y')}/>
<TipInfoNeedSelect ref="CertModel" closeCallBack={() => this.modelPackageCertCB('take_cert_flag', 'N')} submitCallBack={() => this.modelPackageCertCB('take_cert_flag', 'Y')} />
)
}
render() {
let {canSubFlag} = this.state
render() {
let { canSubFlag } = this.state
// console.log(this.props)
let {navigation} = this.props
let {title} = navigation.state.params
let { navigation } = this.props
let { title } = navigation.state.params
return (
<View style={styles.self_container}>
<StatusBarView
isReactStackNavigator={true}
backgroundColor={promary_color}
barStyle = 'light-content'
/>
barStyle='light-content'
/>
<SafeAreaView style={safe_view}>
<HeadBackItem title={title} navigation={navigation} />
<ScrollView
<ScrollView
style={styles.self_main}
showsVerticalScrollIndicator={false}
>
>
{this.renderListItem()}
{this.renderRemarksItem()}
{this.renderRecordingItem()}
<FooterBtnStyle
<FooterBtnStyle
style={canSubFlag ? styles.sub_btn_pro : ''}
activeOpacity={canSubFlag ? .8 : 1}
title={'生成订单'}
textStyle= {styles.sub_btn}
onPress={() => this.handleSubmit()}
/>
textStyle={styles.sub_btn}
onPress={() => this.getSumLinesOps()}
// onPress={() => this.handleSubmit()}
/>
</ScrollView>
{ this.renderLodingItem() }
{this.renderLodingItem()}
</SafeAreaView>
</View>
);
</View>
);
}
}
const styles = StyleSheet.create({
self_container : {
self_container: {
flex: 1,
backgroundColor: home_background_color
},
self_main : {
self_main: {
padding: 14
},
sub_btn_pro: {
......@@ -1885,9 +2026,9 @@ const styles = StyleSheet.create({
sub_btn: {},
list_cont: {
flex: 1
},
},
item_container: {
flex: 1
flex: 1
},
cell_title: {
width: 120
......@@ -1912,7 +2053,7 @@ const mapStateToProps = (state) => {
local_sele_pro_options: state.selfOrder.local_sele_pro_options
}
}
const mapDispatchToProps = (dispatch) => {
return {
requestSelfOrganizations: (params) => {
......
......@@ -328,18 +328,21 @@ class ChooseProductPage extends Component {
} else if (leftIndex > 3) {
let params = {
access_token: token,
category_code: leftItem.category_code,
manufacturer_code: topItem.supplier_code,
org_code: cur_org_code,
leftIndex: leftIndex, // 本地测试
}
let single_all_search = await reqSingleConsumSearch(global_domain_config, params)
console.log('res_3 : ', single_all_search, leftIndex, leftIndex % 2)
if (single_all_search.error_code === 0) {
let { data } = single_all_search
console.log('data : ', data, data instanceof Array)
if (data instanceof Array) {
console.log('data : ', data, data.items)
if (data && data.items) {
// if(leftItem[SELECTED_QUQNTITY] === 0){
//大-中-小类
leftItem.localSecondData = cloneObject(data)
leftItem.localSecondData = cloneObject(data.items)
leftItem['localSecondData'].forEach(function (righDa) {
righDa[CHILDREN_LINE_NAME] = []
// if (!righDa['quantity']) {
......
......@@ -421,7 +421,7 @@ class EditThirdLevelPage extends Component {
curImgIcon = 'photos'
return (
<SafeAreaView style={styles.column_container}>
<SafeAreaView style={styles.column_container} key={'item_code'+index}>
<PicTitDetaiCalcu
listItem={item}
listIndex={index}
......
......@@ -4,10 +4,10 @@ import { third_text_color, foundation_color, second_text_size, Width, pxSize, fo
import PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu';
import PictureZoom from '../../common/listDataComponent/PictureZoom';
import { cloneObject } from '../../../utils/Utils';
import { PicListNoData } from '../../common/CellTextStyle';
import _ from "lodash";
import { connect } from 'react-redux';
import localMockData from './mock/sen_mock';
import { PicListNoData } from '../../common/CellTextStyle';
const PropTypes = require('prop-types');
const QUANTITY_FIELD = 'quantity' // 计算的字段
......@@ -469,7 +469,7 @@ class ProductRightStyle extends Component {
curReduceCallBack = (() => this.props.superReduceBack())
}
return (
<SafeAreaView style={styles.ri_container}>
<SafeAreaView style={styles.ri_container} key={'template_name'+index}>
<PicTitDetaiCalcu
listItem={item}
listIndex={index}
......@@ -516,7 +516,7 @@ class ProductRightStyle extends Component {
// 单选耗材 -- 小类每一列
renderThridItem(item, index) {
return (
<SafeAreaView style={styles.thr_container}>
<SafeAreaView style={styles.thr_container} key={'item_code'+index}>
<PicTitDetaiCalcu
listItem={item}
listIndex={index}
......@@ -573,7 +573,7 @@ class ProductRightStyle extends Component {
// console.log('大类===', item)
return (
<SafeAreaView style={styles.oth_container}>
<SafeAreaView style={styles.oth_container} key={'item_code'+index}>
<PicTitDetaiCalcu
listItem={item}
listIndex={index}
......
......@@ -508,8 +508,8 @@ const inter_9 = //大-中-小类
{
"error_code": 0,
"error_msg": "成功",
"data":
[{
"data":{
"items": [{
"category_code": "JSTH-01-01",
"category_name": "股骨头",
"details": [
......@@ -550,9 +550,8 @@ const inter_9 = //大-中-小类
"photos": local_photos
}
]
}
]
}]
}
}
//大-小类
......
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