Commit bf6d88b2 by Denglingling

新增模拟接口获取APP数据

(cherry picked from commit e62546a8)
parent 74bcbe53
...@@ -10,6 +10,7 @@ import { ...@@ -10,6 +10,7 @@ import {
SELF_SUBMIT_FAILURE, SELF_SUBMIT_FAILURE,
SELF_INIT_DATA SELF_INIT_DATA
} from '../base/ActionTypes'; } from '../base/ActionTypes';
import local_inter_mock from '../containers/selfOrder/module/mock/inter_mock'
// 获取组织 params={access_token:''} // 获取组织 params={access_token:''}
export function requestSelfOrganizations(params) { export function requestSelfOrganizations(params) {
...@@ -221,50 +222,63 @@ export function requestSelfSumbit({access_token, ...params}) { ...@@ -221,50 +222,63 @@ 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 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 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 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 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'){
return local_inter_mock.inter_5
}else {
return local_inter_mock.inter_55
}
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 reqNailBoxLineSearch = async (global_domain_config, params) => { export const reqNailBoxLineSearch = async (global_domain_config, params) => {
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 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 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) => {
return local_inter_mock.inter_9
return await GetRequest(global_domain_config, getUrlParams('/order/item_detail/search', params)) return await GetRequest(global_domain_config, getUrlParams('/order/item_detail/search', params))
} }
......
...@@ -21,7 +21,7 @@ class ProductModel extends Component { ...@@ -21,7 +21,7 @@ class ProductModel extends Component {
closeModal: PropTypes.func, // 关闭回调 closeModal: PropTypes.func, // 关闭回调
closeSubmit: PropTypes.func, // 选好了回调 closeSubmit: PropTypes.func, // 选好了回调
show: PropTypes.bool, show: PropTypes.bool,
modelOption: PropTypes.array, // 已选数据 modelOption: PropTypes.array, // 已选左侧数据
modelCallBack: PropTypes.func, // 修改选择的回调函数 modelCallBack: PropTypes.func, // 修改选择的回调函数
} }
...@@ -474,7 +474,7 @@ class ProductModel extends Component { ...@@ -474,7 +474,7 @@ class ProductModel extends Component {
cardStyleItemTit={styles.top_tit} cardStyleItemTit={styles.top_tit}
cardStyleItemTitAct={styles.top_tit_act} cardStyleItemTitAct={styles.top_tit_act}
cardListOptions={topProcOptionList} cardListOptions={topProcOptionList}
cardItemTitle={'title'} cardItemTitle={'category_name'}
curActIndex={topActiveIndex} curActIndex={topActiveIndex}
cardCallBack={(item, index) => this.handleTopNav(item, index)} cardCallBack={(item, index) => this.handleTopNav(item, index)}
cardCountName={SELECTED_QUQNTITY} cardCountName={SELECTED_QUQNTITY}
...@@ -487,9 +487,9 @@ class ProductModel extends Component { ...@@ -487,9 +487,9 @@ class ProductModel extends Component {
renderContItem() { renderContItem() {
let {topProcOptionList, topActiveIndex} = this.state let {topProcOptionList, topActiveIndex} = this.state
let curData = topProcOptionList[topActiveIndex] let curData = topProcOptionList[topActiveIndex]
// console.log('已选展示信息 === curData---', topProcOptionList) console.log('已选展示信息 === curData---', topProcOptionList)
// console.log('已选展示信息 === curData---', topActiveIndex) console.log('已选展示信息 === curData---', topActiveIndex)
// console.log('已选展示信息 === curData---', curData) console.log('已选展示信息 === curData---', curData)
let localBottomContData = [] let localBottomContData = []
if(curData && curData[SELECTED_DATA_ARR]){ if(curData && curData[SELECTED_DATA_ARR]){
// localBottomContData = curData[SELECTED_DATA_ARR] // localBottomContData = curData[SELECTED_DATA_ARR]
......
...@@ -5,6 +5,7 @@ const PropTypes = require('prop-types'); ...@@ -5,6 +5,7 @@ const PropTypes = require('prop-types');
import PictureZoom from '../../common/listDataComponent/PictureZoom'; import PictureZoom from '../../common/listDataComponent/PictureZoom';
import PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu'; 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';
class ChooseCardList extends Component { class ChooseCardList extends Component {
...@@ -32,7 +33,7 @@ class ChooseCardList extends Component { ...@@ -32,7 +33,7 @@ class ChooseCardList extends Component {
cardItemName: PropTypes.string, cardItemName: PropTypes.string,
cardCallBack: PropTypes.func, cardCallBack: PropTypes.func,
curActIndex: PropTypes.number, curActIndex: PropTypes.number, // 当前已选项index
cardIsCount: PropTypes.bool, // 显示计数 cardIsCount: PropTypes.bool, // 显示计数
...@@ -64,22 +65,13 @@ class ChooseCardList extends Component { ...@@ -64,22 +65,13 @@ class ChooseCardList extends Component {
this.state = { this.state = {
countStyleType: ['DEFAULT', 'GRAPHICS'], countStyleType: ['DEFAULT', 'GRAPHICS'],
countStyleName: ['card_default', 'card_graphice'] countStyleName: ['card_default', 'card_graphice']
// curActIndex: 0
} }
} }
// 点击当前选项
// handleCheckTit(item, index) {
// console.log('item, index----', item, index)
// // this.state = {
// // // curActIndex: index
// // }
// this.props.cardCallBack(item, index)
// }
render() { render() {
let {cardScrollEnabled, cardHorizontal, cardShowsHorizontalScrollIndicator, cardShowsVerticalScrollIndicator, cardStyleBox, cardStyleScroll, cardListOptions, cardItemTitle, cardItemIcon, cardImgName, cardItemName, let {cardScrollEnabled, cardHorizontal, cardShowsHorizontalScrollIndicator, cardShowsVerticalScrollIndicator, cardStyleBox, cardStyleScroll, cardListOptions, cardItemTitle, cardItemIcon, cardImgName, cardItemName,
cardStyleListItem, cardStyleListItemAct, cardStyleItemIcon, cardStyleItemTit, cardStyleNotIconTit, cardStyleItemTitAct, cardCallBack, curActIndex, cardIsCount, cardCountName, cardStyleCount, cardStyleType, cardCouStyle, ...props} = this.props cardStyleListItem, cardStyleListItemAct, cardStyleItemIcon, cardStyleItemTit, cardStyleNotIconTit, cardStyleItemTitAct, cardCallBack, curActIndex, cardIsCount, cardCountName, cardStyleCount, cardStyleType, cardCouStyle,
global_domain_config } = this.props
let {countStyleType} = this.state let {countStyleType} = this.state
...@@ -97,7 +89,8 @@ class ChooseCardList extends Component { ...@@ -97,7 +89,8 @@ class ChooseCardList extends Component {
> >
{ cardListOptions.map((item, index) => { { cardListOptions.map((item, index) => {
if(typeof item[cardItemIcon] === 'string'){ if(typeof item[cardItemIcon] === 'string'){
item[cardItemIcon] = {uri: item[cardItemIcon]} global_domain_config = 'https://obs-dev.gyjtsx.com' // 本地测试 ======= 正式需要隐藏
item[cardItemIcon] = {uri: global_domain_config+item[cardItemIcon]}
} }
return <View style={styles.card_list_box}> return <View style={styles.card_list_box}>
<TouchableOpacity <TouchableOpacity
...@@ -182,4 +175,18 @@ const styles = StyleSheet.create({ ...@@ -182,4 +175,18 @@ const styles = StyleSheet.create({
} }
}) })
export default ChooseCardList; const mapStateToProps = (state) => {
\ No newline at end of file return {
global_domain_config: state.login.global_domain_config
}
}
const mapDispatchToProps = (dispatch) => {
return {
// exitLoginStatus: () => {
// dispatch(exitLoginStatus())
// },
}
}
export default connect(mapStateToProps, mapDispatchToProps)(ChooseCardList);
\ No newline at end of file
import React, { Component } from 'react'; import React, { Component } from 'react';
import { StyleSheet, Image, Text, TouchableOpacity, View } from 'react-native'; import { StyleSheet, Image, Text, TouchableOpacity, View } from 'react-native';
import { connect } from 'react-redux';
import { first_text_color, font_family_light, font_family_medium, font_family_regular, font_family_semibold, home_background_color, icon_style, promary_text_color, pxSize, second_text_size, third_text_color, third_text_size } from '../../../base/BaseStyle'; import { first_text_color, font_family_light, font_family_medium, font_family_regular, font_family_semibold, home_background_color, icon_style, promary_text_color, pxSize, second_text_size, third_text_color, third_text_size } from '../../../base/BaseStyle';
import PictureZoom from '../../common/listDataComponent/PictureZoom'; import PictureZoom from '../../common/listDataComponent/PictureZoom';
const PropTypes = require('prop-types'); const PropTypes = require('prop-types');
...@@ -52,7 +53,7 @@ class PicTitDetaiCalcu extends Component { ...@@ -52,7 +53,7 @@ class PicTitDetaiCalcu extends Component {
// } // }
// 单选点击 // 单选点击
handelSelectCheck(item, index){ handelSelectCheck(item, index) {
item.select = !!!item.select item.select = !!!item.select
this.props.subCalCallBack(item, index) this.props.subCalCallBack(item, index)
} }
...@@ -64,130 +65,94 @@ class PicTitDetaiCalcu extends Component { ...@@ -64,130 +65,94 @@ class PicTitDetaiCalcu extends Component {
* @param {boolean} isPlus 默认减法 false,加法 true, * @param {boolean} isPlus 默认减法 false,加法 true,
*/ */
handelCalculation(item, index, isPlus) { handelCalculation(item, index, isPlus) {
let {calField, plusCallBack, reduceCallBack} = this.props let { calField, plusCallBack, reduceCallBack } = this.props
if(!isPlus && reduceCallBack){ if (!isPlus && reduceCallBack) {
// console.log('减法回调======') // console.log('减法回调======')
reduceCallBack(item, index) reduceCallBack(item, index)
return return
} }
if(isPlus && plusCallBack){ if (isPlus && plusCallBack) {
// console.log('加法回调======', item, index) // console.log('加法回调======', item, index)
plusCallBack(item, index) plusCallBack(item, index)
return return
} }
// console.log('加减======', item, index, isPlus) // console.log('加减======', item, index, isPlus)
item[calField] = Number(item[calField]) item[calField] = Number(item[calField])
if(Number.isNaN(item[calField])){ if (Number.isNaN(item[calField])) {
item[calField] = 0 item[calField] = 0
} }
if(isPlus) { if (isPlus) {
item[calField] += 1 item[calField] += 1
} else if(!isPlus && item[calField] > 0) { } else if (!isPlus && item[calField] > 0) {
item[calField] -= 1 item[calField] -= 1
} }
this.props.subCalCallBack(item, index) this.props.subCalCallBack(item, index)
} }
render() { render() {
let {listItem, listIndex, calField, listStyleBox, listStyleTit, listStyleTip, listStyleCalBtn, listPicType, titCallBack, let { listItem, listIndex, calField, listStyleBox, listStyleTit, listStyleTip, listStyleCalBtn, listPicType, titCallBack,
titText, tipTextStr, tipTextOne, tipTextTwo, listImgIcon, listStyleImg, showClearIcon, showClearIndex, listCardActIndex, titText, tipTextStr, tipTextOne, tipTextTwo, listImgIcon, listStyleImg, showClearIcon, showClearIndex, listCardActIndex,
listStyleClearBtn, clearCallBack, onlyShowNum, onlyShowSelect, tipTextStrTit, tipTextOneTit, tipTextTwoTit} = this.props listStyleClearBtn, clearCallBack, onlyShowNum, onlyShowSelect, tipTextStrTit, tipTextOneTit, tipTextTwoTit, global_domain_config } = this.props
let {listPicTypeArr, picStyleArr} = this.state let { listPicTypeArr, picStyleArr } = this.state
let picOthStyle = '' let picOthStyle = ''
if(listPicTypeArr.indexOf(listPicType) > -1){ if (listPicTypeArr.indexOf(listPicType) > -1) {
picOthStyle = picStyleArr[listPicTypeArr.indexOf(listPicType)] picOthStyle = picStyleArr[listPicTypeArr.indexOf(listPicType)]
} }
let valIsZero = Boolean(listItem[calField] === 0) let valIsZero = Boolean(listItem[calField] === 0)
let calIcon = require('../../../images/plur_icon_big.png') let calIcon = require('../../../images/plur_icon_big.png')
if(!valIsZero) { if (!valIsZero) {
calIcon = require('../../../images/plur_big_act.png') calIcon = require('../../../images/plur_big_act.png')
} }
let defSelIcon = require('../../../images/radio_no.png') let defSelIcon = require('../../../images/radio_no.png')
if(onlyShowSelect && listItem.select){ if (onlyShowSelect && listItem.select) {
defSelIcon = require('../../../images/radio_yes.png') defSelIcon = require('../../../images/radio_yes.png')
} }
let cur_photos = []
if(listItem[listImgIcon] instanceof Array){
global_domain_config = 'https://obs.uat.sfrx.guke.tech' // 本地测试
listItem[listImgIcon].map((iconIt) => {
cur_photos.push({ url: global_domain_config + iconIt})
})
}
// console.log('每一列----',listItem[listImgIcon], listItem[listImgIcon] instanceof Array) // console.log('每一列----',listItem[listImgIcon], listItem[listImgIcon] instanceof Array)
return ( return (
// <View>
// { curListArr.map((curListItem, curListIndex) => {
// <View style={[styles.ri_inner, listStyleBox]}>
// { listImgIcon ?
// <View style={[styles.oth_img_box, styles[picOthStyle], listStyleImg]}>
// <Image style={icon_style} source={curListItem.imgIcon}/>
// </View> : null }
// <View style={styles.ri_text_box}>
// <TouchableOpacity
// activeOpacity={.8}
// onPress={() => {titCallBack ? titCallBack(curListItem, listIndex) : {}}}
// style={styles.oth_box}
// >
// <Text numberOfLines={1} style={[styles.thr_ot, listStyleTit]}>
// { curListItem[titText] }
// </Text>
// </TouchableOpacity>
// { curListItem[tipTextStr] ? <Text numberOfLines={1} style={[styles.ri_te_ot, styles.te_ot_str, listStyleTip]}>{curListItem[tipTextStr]}</Text> : null }
// { curListItem[tipTextOne] ? <Text numberOfLines={1} style={[styles.ri_te_ot, listStyleTip]}>{curListItem[tipTextOne]}</Text> : null }
// { curListItem[tipTextTwo] ? <Text numberOfLines={1} style={[styles.ri_te_ot, listStyleTip]}>{curListItem[tipTextTwo]}</Text> : null }
// </View>
// <View style={styles.ri_num_box}>
// { curListItem[calField] !== 0 ?
// <TouchableOpacity
// activeOpacity={.9}
// style={[styles.btn_inner, listStyleCalBtn]}
// onPress={() => this.handelCalculation(curListItem, listIndex)}
// >
// <View style={[styles.thr_num_btn, styles.thr_btn_left]}>
// <Image source={require('../../../images/less_icon_big.png')} style={icon_style}></Image>
// </View>
// </TouchableOpacity> : null }
// { curListItem[calField] !== 0 ? <Text style={styles.thr_num}>{ curListItem[calField] }</Text> : null}
// <TouchableOpacity
// activeOpacity={.9}
// style={[styles.btn_inner, listStyleCalBtn]}
// onPress={() => this.handelCalculation(curListItem, listIndex, true)}
// >
// <View style={[styles.thr_num_btn, styles.thr_btn_right]}>
// <Image source={calIcon} style={icon_style}></Image>
// </View>
// </TouchableOpacity>
// </View>
// </View>
// })
// }
// </View>
<View style={[styles.ri_inner, listStyleBox]}> <View style={[styles.ri_inner, listStyleBox]}>
{/* { listImgIcon ? {/* { listImgIcon ?
<View style={[styles.oth_img_box, styles[picOthStyle], listStyleImg]}> <View style={[styles.oth_img_box, styles[picOthStyle], listStyleImg]}>
<Image style={icon_style} source={listItem[listImgIcon]}/> <Image style={icon_style} source={listItem[listImgIcon]}/>
</View> : null } */} </View> : null } */}
{ (listImgIcon && listItem[listImgIcon] instanceof Array) ? { (listImgIcon && cur_photos.length > 0) ?
<PictureZoom <PictureZoom
listImageIndex={0} listImageIndex={0}
listImageUrls={listItem[listImgIcon]} listImageUrls={cur_photos}
listStyleImage={[styles.oth_img_box, styles[picOthStyle], listStyleImg]} listStyleImage={[styles.oth_img_box, styles[picOthStyle], listStyleImg]}
listPicType={listPicType} listPicType={listPicType}
/>: listImgIcon ? <View style={[styles.oth_img_box, styles[picOthStyle], listStyleImg]}> />
<Image style={icon_style} source={listItem[listImgIcon]}/> // : listImgIcon ? <View style={[styles.oth_img_box, styles[picOthStyle], listStyleImg]}>
</View> : null } // <Image style={icon_style} source={listItem[listImgIcon]} />
// </View>
: null}
<View style={styles.ri_text_box}> <View style={styles.ri_text_box}>
<TouchableOpacity <TouchableOpacity
activeOpacity={titCallBack ? .8 : 1} activeOpacity={titCallBack ? .8 : 1}
onPress={() => {titCallBack ? titCallBack(listItem, listIndex) : {}}} onPress={() => { titCallBack ? titCallBack(listItem, listIndex) : {} }}
style={styles.oth_box} style={styles.oth_box}
> >
<Text numberOfLines={1} style={[styles.thr_ot, listStyleTit]}> <Text numberOfLines={1} style={[styles.thr_ot, listStyleTit]}>
{ listItem[titText] } {listItem[titText]}
</Text> </Text>
{ listItem[tipTextStr] ? <Text numberOfLines={1} style={[styles.ri_te_ot, styles.te_ot_str, listStyleTip]}>{listItem[tipTextStr]}</Text> : null } {listItem[tipTextStr] ? <Text numberOfLines={1} style={[styles.ri_te_ot, styles.te_ot_str, listStyleTip]}>
{ listItem[tipTextOne] ? <Text numberOfLines={1} style={[styles.ri_te_ot, listStyleTip]}>{listItem[tipTextOne]}</Text> : null } {tipTextStrTit ? `${tipTextStrTit}:` : ''}{listItem[tipTextStr]}
{ listItem[tipTextTwo] ? <Text numberOfLines={1} style={[styles.ri_te_ot, listStyleTip]}>{listItem[tipTextTwo]}</Text> : null } </Text> : null}
{listItem[tipTextOne] ? <Text numberOfLines={1} style={[styles.ri_te_ot, listStyleTip]}>
{tipTextOneTit ? `${tipTextOneTit}:` : ''}{listItem[tipTextOne]}
</Text> : null}
{listItem[tipTextTwo] ? <Text numberOfLines={1} style={[styles.ri_te_ot, listStyleTip]}>
{tipTextTwoTit ? `${tipTextTwoTit}:` : ''}{listItem[tipTextTwo]}
</Text> : null}
</TouchableOpacity> </TouchableOpacity>
</View> </View>
{ {
...@@ -204,7 +169,7 @@ class PicTitDetaiCalcu extends Component { ...@@ -204,7 +169,7 @@ class PicTitDetaiCalcu extends Component {
</TouchableOpacity> </TouchableOpacity>
</View> : </View> :
<View style={[styles.ri_num_box, onlyShowNum ? styles.show_num_box : null]}> <View style={[styles.ri_num_box, onlyShowNum ? styles.show_num_box : null]}>
{ (listItem[calField] !== 0 && !onlyShowNum && !onlyShowSelect) ? {(listItem[calField] !== 0 && !onlyShowNum && !onlyShowSelect) ?
<TouchableOpacity <TouchableOpacity
activeOpacity={.9} activeOpacity={.9}
style={[styles.btn_inner, listStyleCalBtn]} style={[styles.btn_inner, listStyleCalBtn]}
...@@ -213,9 +178,9 @@ class PicTitDetaiCalcu extends Component { ...@@ -213,9 +178,9 @@ class PicTitDetaiCalcu extends Component {
<View style={[styles.thr_num_btn, styles.thr_btn_left]}> <View style={[styles.thr_num_btn, styles.thr_btn_left]}>
<Image source={require('../../../images/less_icon_big.png')} style={icon_style}></Image> <Image source={require('../../../images/less_icon_big.png')} style={icon_style}></Image>
</View> </View>
</TouchableOpacity> : null } </TouchableOpacity> : null}
{ (listItem[calField] !== 0 && !onlyShowSelect) ? <Text style={[styles.thr_num, onlyShowNum ? styles.show_num : null]}>{ listItem[calField] }</Text> : null} {(listItem[calField] !== 0 && !onlyShowSelect) ? <Text style={[styles.thr_num, onlyShowNum ? styles.show_num : null]}>{listItem[calField]}</Text> : null}
{ (!onlyShowNum && !onlyShowSelect) ? <TouchableOpacity {(!onlyShowNum && !onlyShowSelect) ? <TouchableOpacity
activeOpacity={.9} activeOpacity={.9}
style={[styles.btn_inner, listStyleCalBtn]} style={[styles.btn_inner, listStyleCalBtn]}
onPress={() => this.handelCalculation(listItem, listIndex, true)} onPress={() => this.handelCalculation(listItem, listIndex, true)}
...@@ -225,7 +190,7 @@ class PicTitDetaiCalcu extends Component { ...@@ -225,7 +190,7 @@ class PicTitDetaiCalcu extends Component {
</View> </View>
</TouchableOpacity> : null} </TouchableOpacity> : null}
{ onlyShowSelect ? <TouchableOpacity {onlyShowSelect ? <TouchableOpacity
activeOpacity={.9} activeOpacity={.9}
style={[styles.btn_sel_inner]} style={[styles.btn_sel_inner]}
onPress={() => this.handelSelectCheck(listItem, listIndex)} onPress={() => this.handelSelectCheck(listItem, listIndex)}
...@@ -239,6 +204,56 @@ class PicTitDetaiCalcu extends Component { ...@@ -239,6 +204,56 @@ class PicTitDetaiCalcu extends Component {
} }
</View> </View>
// <View>
// { curListArr.map((curListItem, curListIndex) => {
// <View style={[styles.ri_inner, listStyleBox]}>
// { listImgIcon ?
// <View style={[styles.oth_img_box, styles[picOthStyle], listStyleImg]}>
// <Image style={icon_style} source={curListItem.imgIcon}/>
// </View> : null }
// <View style={styles.ri_text_box}>
// <TouchableOpacity
// activeOpacity={.8}
// onPress={() => {titCallBack ? titCallBack(curListItem, listIndex) : {}}}
// style={styles.oth_box}
// >
// <Text numberOfLines={1} style={[styles.thr_ot, listStyleTit]}>
// { curListItem[titText] }
// </Text>
// </TouchableOpacity>
// { curListItem[tipTextStr] ? <Text numberOfLines={1} style={[styles.ri_te_ot, styles.te_ot_str, listStyleTip]}>{curListItem[tipTextStr]}</Text> : null }
// { curListItem[tipTextOne] ? <Text numberOfLines={1} style={[styles.ri_te_ot, listStyleTip]}>{curListItem[tipTextOne]}</Text> : null }
// { curListItem[tipTextTwo] ? <Text numberOfLines={1} style={[styles.ri_te_ot, listStyleTip]}>{curListItem[tipTextTwo]}</Text> : null }
// </View>
// <View style={styles.ri_num_box}>
// { curListItem[calField] !== 0 ?
// <TouchableOpacity
// activeOpacity={.9}
// style={[styles.btn_inner, listStyleCalBtn]}
// onPress={() => this.handelCalculation(curListItem, listIndex)}
// >
// <View style={[styles.thr_num_btn, styles.thr_btn_left]}>
// <Image source={require('../../../images/less_icon_big.png')} style={icon_style}></Image>
// </View>
// </TouchableOpacity> : null }
// { curListItem[calField] !== 0 ? <Text style={styles.thr_num}>{ curListItem[calField] }</Text> : null}
// <TouchableOpacity
// activeOpacity={.9}
// style={[styles.btn_inner, listStyleCalBtn]}
// onPress={() => this.handelCalculation(curListItem, listIndex, true)}
// >
// <View style={[styles.thr_num_btn, styles.thr_btn_right]}>
// <Image source={calIcon} style={icon_style}></Image>
// </View>
// </TouchableOpacity>
// </View>
// </View>
// })
// }
// </View>
); );
} }
} }
...@@ -300,17 +315,17 @@ const styles = StyleSheet.create({ ...@@ -300,17 +315,17 @@ const styles = StyleSheet.create({
height: pxSize(22) height: pxSize(22)
}, },
btn_inner: {}, btn_inner: {},
btn_sel_inner:{}, btn_sel_inner: {},
btn_cle_box:{ btn_cle_box: {
marginRight: 6, marginRight: 6,
// backgroundColor: 'red', // backgroundColor: 'red',
paddingHorizontal: 4, paddingHorizontal: 4,
paddingVertical: 4 paddingVertical: 4
}, },
btn_clear_inner:{ btn_clear_inner: {
}, },
icon_cle_btn:{ icon_cle_btn: {
width: pxSize(22), width: pxSize(22),
height: pxSize(22) height: pxSize(22)
}, },
...@@ -337,4 +352,18 @@ const styles = StyleSheet.create({ ...@@ -337,4 +352,18 @@ const styles = StyleSheet.create({
} }
}) })
export default PicTitDetaiCalcu; const mapStateToProps = (state) => {
\ No newline at end of file return {
global_domain_config: state.login.global_domain_config
}
}
const mapDispatchToProps = (dispatch) => {
return {
// exitLoginStatus: () => {
// dispatch(exitLoginStatus())
// },
}
}
export default connect(mapStateToProps, mapDispatchToProps)(PicTitDetaiCalcu);
\ No newline at end of file
import React, { Component } from 'react'; import React, { Component } from 'react';
import { import { View, Text, SafeAreaView, StyleSheet, TouchableOpacity, Image, ScrollView, TextInput, Alert, Linking, NativeModules, Platform } from 'react-native';
View,
Text,
SafeAreaView,
StyleSheet,
TouchableOpacity,
Image,
ScrollView,
TextInput,
FlatList,
Alert,
Linking,
NativeModules,
Platform
} from 'react-native';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import { import { home_background_color, placehold_text_color, promary_color, safe_view, icon_style, list_common_item } from '../../base/BaseStyle';
second_text_size,
home_background_color,
dis_sub_color,
placehold_text_color,
Width,
first_text_color,
pxSize,
promary_color,
safe_view,
icon_style,
font_family_regular,
list_common_item
} from '../../base/BaseStyle';
import { import {
AsteriskTextStyle, AsteriskTextStyle,
TitleTextStyle, TitleTextStyle,
...@@ -46,28 +19,9 @@ import LodingModel from '../common/LodingModel'; ...@@ -46,28 +19,9 @@ import LodingModel from '../common/LodingModel';
import DateModel from '../common/DateModel'; import DateModel from '../common/DateModel';
import { AudioRecorder, AudioUtils } from 'react-native-audio'; import { AudioRecorder, AudioUtils } from 'react-native-audio';
import Sound from 'react-native-sound'; import Sound from 'react-native-sound';
import { import { requestSelfOrganizations, requestSelfSurgeryHospital, requestSelfOrderType, requestSelfTemplateCollect, requestSelfAudio, requestSelfSumbit, setSelfInitData, reqSelfSurgeryHospital, requestListDataSuccess, requestSelfSurgeryType } from '../../action/SelfAction';
requestSelfOrganizations,
requestSelfSurgeryHospital,
requestSelfOrderType,
requestSelfTemplateCollect,
requestSelfAudio,
requestSelfSumbit,
setSelfInitData,
reqSelfSurgeryHospital,
requestListDataSuccess,
requestSelfSurgeryType
} from '../../action/SelfAction';
import { exitLoginStatus } from '../../action/LoginAction'; import { exitLoginStatus } from '../../action/LoginAction';
import { import { SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_SUCCESS, SELF_ORDER_LIST_FAILURE, LOGIN_NO, SELF_SUBMIT_DOING, SELF_SUBMIT_SUCCESS, SELF_SUBMIT_FAILURE } from '../../base/ActionTypes';
SELF_ORDER_LIST_DOING,
SELF_ORDER_LIST_SUCCESS,
SELF_ORDER_LIST_FAILURE,
LOGIN_NO,
SELF_SUBMIT_DOING,
SELF_SUBMIT_SUCCESS,
SELF_SUBMIT_FAILURE
} from '../../base/ActionTypes';
import PageListArrow from '../common/listDataComponent/PageListArrow'; import PageListArrow from '../common/listDataComponent/PageListArrow';
class SelfOrderPage extends Component { class SelfOrderPage extends Component {
...@@ -1227,7 +1181,13 @@ class SelfOrderPage extends Component { ...@@ -1227,7 +1181,13 @@ class SelfOrderPage extends Component {
// 选择产品 点击跳转 // 选择产品 点击跳转
handleProductCheck() { handleProductCheck() {
this.props.navigation.navigate('ChooseProductPage', {title: `自助下单 - 选择产品`}) let {listOptionData} = this.state
this.props.navigation.navigate('ChooseProductPage', {
title: `选择产品`,
selfData: {
org_code: listOptionData[1].value
}
})
} }
// 备注 输入 // 备注 输入
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { View, Text, StyleSheet, TouchableOpacity, Image, TextInput } from 'react-native'; import { View, Text, StyleSheet, TouchableOpacity, Image, TextInput } from 'react-native';
import {connect} from 'react-redux'; import { connect } from 'react-redux';
import { foundation_color, home_background_color, Width, third_text_size, pxSize, promary_color, safe_view, font_family_semibold, font_family_regular, icon_style, title_text_color, font_family_medium, list_common_item} from '../../../base/BaseStyle'; import { foundation_color, home_background_color, Width, third_text_size, pxSize, promary_color, safe_view, font_family_regular, icon_style, title_text_color, font_family_medium, list_common_item } from '../../../base/BaseStyle';
import HeadBackItem from '../../common/HeadBackItem'; import HeadBackItem from '../../common/HeadBackItem';
import ProductRightStyle from './ProductRightStyle'; import ProductRightStyle from './ProductRightStyle';
import ProductModel from '../../common/ProductModel'; import ProductModel from '../../common/ProductModel';
import StatusBarView from '../../common/StatusBarView'; import StatusBarView from '../../common/StatusBarView';
import ChooseCardList from '../../common/listDataComponent/ChooseCardList'; import ChooseCardList from '../../common/listDataComponent/ChooseCardList';
import {cloneObject} from '../../../utils/Utils'; import { cloneObject, dedupQuoteArray, show } from '../../../utils/Utils';
import { reqPurSupplierSearch, reqProCategorySearch, reqSurTempHeadSearch, reqNailEquipHeadSearch, reqScatEquipmentSearch, reqSingleConsumSearch } from '../../../action/SelfAction';
import localMockData from './mock/sen_mock'; import localMockData from './mock/sen_mock';
const DEFAULT_FIELD = 'quantity' // 计算的字段 const DEFAULT_FIELD = 'quantity' // 计算的字段
...@@ -15,7 +16,7 @@ const CHILD_DATA_NAME = 'childrenLineData' // 显示的子类数组名称 ...@@ -15,7 +16,7 @@ const CHILD_DATA_NAME = 'childrenLineData' // 显示的子类数组名称
const SELECTED_QUQNTITY = 'selectedQuantity' // 中类数量 const SELECTED_QUQNTITY = 'selectedQuantity' // 中类数量
const SELECTED_DATA_ARR = 'selectedDataArr' // 中类已选元素 const SELECTED_DATA_ARR = 'selectedDataArr' // 中类已选元素
const DEFAULT_SECOND_DATA = 'localSecondData' // 中类原本元素 const LOCAL_SECOND_DATA = 'localSecondData' // 中类原本元素
class ChooseProductPage extends Component { class ChooseProductPage extends Component {
constructor(props) { constructor(props) {
...@@ -29,57 +30,259 @@ class ChooseProductPage extends Component { ...@@ -29,57 +30,259 @@ class ChooseProductPage extends Component {
leftOptionList: [], // 左侧分类数据 leftOptionList: [], // 左侧分类数据
defaultThridShow: false, // 默认人体髋关节-小类不显示 defaultThridShow: false, // 默认人体髋关节-小类不显示
selectShowPopup: false, // 共计已选弹窗 selectShowPopup: false, // 共计已选弹窗
defalutLeftItem: [{
"category_code": "surg_temp",
"category_name": "手术模板",
"cate_local_icon": require('../../../images/surg_temp.png')
}, {
"category_code": "screw_box",
"category_name": "钉盒",
"cate_local_icon": require('../../../images/screw_box.png')
}, {
"category_code": "equip_bag",
"category_name": "器械包",
"cate_local_icon": require('../../../images/equip_bag.png')
}, {
"category_code": "auxili_tool",
"category_name": "零散器械",
"cate_local_icon": require('../../../images/auxili_tool.png')
}]
} }
} }
componentDidMount() { componentDidMount() {
// console.log('本地测试数据====localMockData===', localMockData) // // console.log('本地测试数据====localMockData===', localMockData)
let {topProcOptionList} = this.state // let {topProcOptionList} = this.state
topProcOptionList = cloneObject(localMockData.localTopProcOption) // topProcOptionList = cloneObject(localMockData.localTopProcOption)
topProcOptionList.forEach(function (topObj) { // topProcOptionList.forEach(function (topObj) {
topObj[SELECTED_QUQNTITY] = 0 // topObj[SELECTED_QUQNTITY] = 0
topObj['leftOptionList'] = cloneObject(localMockData.localLeftOption) // topObj['leftOptionList'] = cloneObject(localMockData.localLeftOption)
}) // })
// 赋值本地测试数据 // // 赋值本地测试数据
this.setState({ // this.setState({
topProcOptionList: topProcOptionList, // topProcOptionList: topProcOptionList,
leftOptionList: cloneObject(localMockData.localLeftOption) // leftOptionList: cloneObject(localMockData.localLeftOption)
// })
this.initGetData()
}
// 初始化获取数据
async initGetData() {
let that = this
let { token, global_domain_config, navigation } = that.props
let cur_org_code = ''
if (navigation.state.params.selfData) {
cur_org_code = navigation.state.params.selfData.org_code
}
let params = {
access_token: token,
org_code: cur_org_code,
supplier_type: 'MANUFACTURER' // 供应商
}
let pur_sup_search = await reqPurSupplierSearch(global_domain_config, params)
console.log('res_1 : ', pur_sup_search)
if (pur_sup_search.error_code === 0) {
let { data } = pur_sup_search
let { topProcOptionList } = that.state
topProcOptionList = cloneObject(data)
topProcOptionList.forEach(function (topObj) {
topObj['selectedQuantity'] = 0
topObj['leftOptionList'] = []
})
that.setState({
topProcOptionList
}, () => {
that.handleTopNav(topProcOptionList[0], 0)
}) })
} else {
that.showRrrorTip(pur_sup_search)
}
}
// 顶部产品点击,获取左侧数据
async handleTopNav(topItem, topIndex) {
// console.log('top产品--',topItem, topIndex)
let that = this
let { token, global_domain_config } = that.props
let params = {
access_token: token,
manufacturer_code: topItem.supplier_code,
}
let pro_scate_search = await reqProCategorySearch(global_domain_config, params)
console.log('res_2 : ', pro_scate_search)
if (pro_scate_search.error_code === 0) {
let { topProcOptionList, defalutLeftItem } = this.state
let { data } = pro_scate_search
topItem.leftOptionList = defalutLeftItem.concat(data.item)
topItem.leftOptionList.forEach(function (leftObj) {
leftObj['selectedQuantity'] = 0
leftObj['localSecondData'] = []
})
topProcOptionList[topIndex] = topItem
that.setState({
topActiveIndex: topIndex,
topProcOptionList: topProcOptionList
}, () => {
that.handleLeftNav(topItem['leftOptionList'][0], 0)
})
} else {
that.showRrrorTip(pro_scate_search)
} }
// 顶部产品点击 // this.setState({
handleTopNav(item, index) { // topActiveIndex: topIndex,
// console.log('top产品--',item, index) // // leftOptionList: cloneObject(localMockData.localLeftOption)
this.setState({ // })
topActiveIndex: index,
// leftOptionList: cloneObject(localMockData.localLeftOption)
})
} }
// 左侧标题点击 // 左侧标题点击
handleLeftNav(item, index) { async handleLeftNav(leftItem, leftIndex) {
// console.log('左侧标题--', index, item) // console.log('左侧标题--', index, item)
let {leftOptionList} = this.state let { topProcOptionList, topActiveIndex, leftOptionList } = this.state
this.setState({ let that = this
leftActiveIndex: index, let { token, global_domain_config, navigation, userInfo } = that.props
// rightSecondData: leftOptionList[index][DEFAULT_SECOND_DATA] // 本地数据 let cur_org_code = ''
// rightSecondData: leftOptionList[index].localSecondData // 本地数据 if (navigation.state.params.selfData) {
cur_org_code = navigation.state.params.selfData.org_code
}
let topItem = topProcOptionList[topActiveIndex]
if (leftIndex === 0) {
let params = {
access_token: token,
org_code: cur_org_code,
seller_code: userInfo.user_name,
manufacturer_code: topItem.supplier_code,
}
let sur_head_search = await reqSurTempHeadSearch(global_domain_config, params)
console.log('res_3 : ', sur_head_search)
if (sur_head_search.error_code === 0) {
let { data } = sur_head_search
leftItem.localSecondData = cloneObject(data.surgery_template)
leftItem['localSecondData'].forEach(function (righDa) {
if (!righDa['quantity']) {
righDa['quantity'] = 0
} else {
righDa['quantity'] = Number(righDa['quantity'])
}
}) })
leftOptionList[leftIndex] = leftItem
that.setState({
leftActiveIndex: leftIndex,
leftOptionList: leftOptionList
})
} else {
that.showRrrorTip(sur_head_search)
}
} else if (leftIndex === 1 || leftIndex === 2) {
let cur_category_code = '1301'
if (leftIndex === 2) {
cur_category_code = '1302'
}
let params = {
access_token: token,
category_set: 'INVENTORY',
category_code: cur_category_code,
}
let nail_equip_head_search = await reqNailEquipHeadSearch(global_domain_config, params)
console.log('res_3 : ', nail_equip_head_search)
if (nail_equip_head_search.error_code === 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'])
}
})
leftOptionList[leftIndex] = leftItem
that.setState({
leftActiveIndex: leftIndex,
leftOptionList: leftOptionList
})
} else {
that.showRrrorTip(nail_equip_head_search)
}
} else if (leftIndex === 3) {
let params = {
access_token: token
}
let scat_head_search = await reqScatEquipmentSearch(global_domain_config, params)
console.log('res_3 : ', scat_head_search)
if (scat_head_search.error_code === 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'])
}
})
leftOptionList[leftIndex] = leftItem
that.setState({
leftActiveIndex: leftIndex,
leftOptionList: leftOptionList
})
} else {
that.showRrrorTip(scat_head_search)
}
} else {
let params = {
access_token: token
}
let single_all_search = await reqSingleConsumSearch(global_domain_config, params)
console.log('res_3 : ', single_all_search)
if (single_all_search.error_code === 0) {
let { data } = single_all_search
console.log('data : ', data, data instanceof Array)
if (data instanceof Array) {
//大-中-小类
leftItem.localSecondData = cloneObject(data)
leftItem['localSecondData'].forEach(function (righDa) {
if (!righDa['quantity']) {
righDa['quantity'] = 0
} else {
righDa['quantity'] = Number(righDa['quantity'])
}
righDa[CHILD_DATA_NAME] = cloneObject(righDa['details'])
})
leftOptionList[leftIndex] = leftItem
that.setState({
leftActiveIndex: leftIndex,
leftOptionList: leftOptionList
})
}
} else {
that.showRrrorTip(single_all_search)
}
}
// this.setState({
// leftActiveIndex: leftIndex,
// // rightSecondData: leftOptionList[index][LOCAL_SECOND_DATA] // 本地数据
// // rightSecondData: leftOptionList[index].localSecondData // 本地数据
// })
} }
// 修改 // 修改
handleChangeThrShow (show) { handleChangeThrShow(show) {
this.setState({ this.setState({
defaultThridShow: show defaultThridShow: show
}) })
} }
// 计算三级回调函数 // 计算三级回调函数
handleChangeThird(childData, superIndex){ handleChangeThird(childData, superIndex) {
let {leftActiveIndex, leftOptionList, topProcOptionList, topActiveIndex} = this.state let { leftActiveIndex, leftOptionList, topProcOptionList, topActiveIndex } = this.state
// console.log("计算三级的回调函数",childData, superIndex, leftActiveIndex) // console.log("计算三级的回调函数",childData, superIndex, leftActiveIndex)
// console.log(leftOptionList) // console.log(leftOptionList)
...@@ -93,48 +296,48 @@ class ChooseProductPage extends Component { ...@@ -93,48 +296,48 @@ class ChooseProductPage extends Component {
let top_sel_sum = 0 let top_sel_sum = 0
leftOptionList.map(function(leItem, leIndex) { leftOptionList.map(function (leItem, leIndex) {
if(!leItem[SELECTED_QUQNTITY]){ if (!leItem[SELECTED_QUQNTITY]) {
leItem[SELECTED_QUQNTITY] = 0 leItem[SELECTED_QUQNTITY] = 0
} }
if(!leItem[SELECTED_DATA_ARR]){ if (!leItem[SELECTED_DATA_ARR]) {
leItem[SELECTED_DATA_ARR] = [] leItem[SELECTED_DATA_ARR] = []
} }
if(leIndex === leftActiveIndex) { if (leIndex === leftActiveIndex) {
if(leItem[DEFAULT_SECOND_DATA].length && leItem[DEFAULT_SECOND_DATA][superIndex] && childData.length){ if (leItem[LOCAL_SECOND_DATA].length && leItem[LOCAL_SECOND_DATA][superIndex] && childData.length) {
let sumCount = 0 let sumCount = 0
childData.map((chDa, chInd) => { childData.map((chDa, chInd) => {
if(!chDa[DEFAULT_FIELD]){ if (!chDa[DEFAULT_FIELD]) {
chDa[DEFAULT_FIELD] = 0 chDa[DEFAULT_FIELD] = 0
} }
sumCount += chDa[DEFAULT_FIELD] sumCount += chDa[DEFAULT_FIELD]
}) })
let chDa = leItem[DEFAULT_SECOND_DATA][superIndex] let chDa = leItem[LOCAL_SECOND_DATA][superIndex]
let curObj = { let curObj = {
superId: chDa['id'], // 本地测试 superId: chDa['id'], // 本地测试
superIndex: superIndex, // 本地测试 superIndex: superIndex, // 本地测试
superTit: leItem['title'], // 本地测试 superTit: leItem['title'], // 本地测试
superImg: chDa['imgIcon'], // 本地测试 superImg: chDa['imgIcon'], // 本地测试
superTip: `${chDa['title'] }x${sumCount}`, // 本地测试 superTip: `${chDa['title']}x${sumCount}`, // 本地测试
curTitle: chDa['title'], // 本地测试 curTitle: chDa['title'], // 本地测试
version: 0, version: 0,
lineOptions: childData, lineOptions: childData,
[DEFAULT_FIELD]: sumCount [DEFAULT_FIELD]: sumCount
} }
// 初始化 // 初始化
leItem[DEFAULT_SECOND_DATA][superIndex][CHILD_DATA_NAME] = [] leItem[LOCAL_SECOND_DATA][superIndex][CHILD_DATA_NAME] = []
leItem[DEFAULT_SECOND_DATA][superIndex][CHILD_DATA_NAME].push(curObj) leItem[LOCAL_SECOND_DATA][superIndex][CHILD_DATA_NAME].push(curObj)
leItem[DEFAULT_SECOND_DATA][superIndex][DEFAULT_FIELD] = sumCount leItem[LOCAL_SECOND_DATA][superIndex][DEFAULT_FIELD] = sumCount
} }
// 初始化 // 初始化
leItem[SELECTED_QUQNTITY] = 0 leItem[SELECTED_QUQNTITY] = 0
leItem[SELECTED_DATA_ARR] = [] leItem[SELECTED_DATA_ARR] = []
if(leItem[DEFAULT_SECOND_DATA].length){ // 本地测试 localSecondData DEFAULT_SECOND_DATA if (leItem[LOCAL_SECOND_DATA].length) { // 本地测试 localSecondData LOCAL_SECOND_DATA
leItem[DEFAULT_SECOND_DATA].forEach(function(chItem) { leItem[LOCAL_SECOND_DATA].forEach(function (chItem) {
if(chItem[DEFAULT_FIELD] > 0){ if (chItem[DEFAULT_FIELD] > 0) {
leItem[SELECTED_QUQNTITY] += Number(chItem[DEFAULT_FIELD]) leItem[SELECTED_QUQNTITY] += Number(chItem[DEFAULT_FIELD])
leItem[SELECTED_DATA_ARR].push(chItem) leItem[SELECTED_DATA_ARR].push(chItem)
} }
...@@ -148,48 +351,48 @@ class ChooseProductPage extends Component { ...@@ -148,48 +351,48 @@ class ChooseProductPage extends Component {
// topProcOptionList[topActiveIndex] = top_sel_sum // topProcOptionList[topActiveIndex] = top_sel_sum
topProcOptionList[topActiveIndex].leftOptionList.map(function(leItem, leIndex) { topProcOptionList[topActiveIndex].leftOptionList.map(function (leItem, leIndex) {
if(!leItem[SELECTED_QUQNTITY]){ if (!leItem[SELECTED_QUQNTITY]) {
leItem[SELECTED_QUQNTITY] = 0 leItem[SELECTED_QUQNTITY] = 0
} }
if(!leItem[SELECTED_DATA_ARR]){ if (!leItem[SELECTED_DATA_ARR]) {
leItem[SELECTED_DATA_ARR] = [] leItem[SELECTED_DATA_ARR] = []
} }
if(leIndex === leftActiveIndex) { if (leIndex === leftActiveIndex) {
if(leItem[DEFAULT_SECOND_DATA].length && leItem[DEFAULT_SECOND_DATA][superIndex] && childData.length){ if (leItem[LOCAL_SECOND_DATA].length && leItem[LOCAL_SECOND_DATA][superIndex] && childData.length) {
let sumCount = 0 let sumCount = 0
childData.map((chDa, chInd) => { childData.map((chDa, chInd) => {
if(!chDa[DEFAULT_FIELD]){ if (!chDa[DEFAULT_FIELD]) {
chDa[DEFAULT_FIELD] = 0 chDa[DEFAULT_FIELD] = 0
} }
sumCount += chDa[DEFAULT_FIELD] sumCount += chDa[DEFAULT_FIELD]
}) })
let chDa = leItem[DEFAULT_SECOND_DATA][superIndex] let chDa = leItem[LOCAL_SECOND_DATA][superIndex]
let curObj = { let curObj = {
superId: chDa['id'], // 本地测试 superId: chDa['id'], // 本地测试
superIndex: superIndex, // 本地测试 superIndex: superIndex, // 本地测试
superTit: leItem['title'], // 本地测试 superTit: leItem['title'], // 本地测试
superImg: chDa['imgIcon'], // 本地测试 superImg: chDa['imgIcon'], // 本地测试
superTip: `${chDa['title'] }x${sumCount}`, // 本地测试 superTip: `${chDa['title']}x${sumCount}`, // 本地测试
curTitle: chDa['title'], // 本地测试 curTitle: chDa['title'], // 本地测试
version: 0, version: 0,
lineOptions: childData, lineOptions: childData,
[DEFAULT_FIELD]: sumCount [DEFAULT_FIELD]: sumCount
} }
// 初始化 // 初始化
leItem[DEFAULT_SECOND_DATA][superIndex][CHILD_DATA_NAME] = [] leItem[LOCAL_SECOND_DATA][superIndex][CHILD_DATA_NAME] = []
leItem[DEFAULT_SECOND_DATA][superIndex][CHILD_DATA_NAME].push(curObj) leItem[LOCAL_SECOND_DATA][superIndex][CHILD_DATA_NAME].push(curObj)
leItem[DEFAULT_SECOND_DATA][superIndex][DEFAULT_FIELD] = sumCount leItem[LOCAL_SECOND_DATA][superIndex][DEFAULT_FIELD] = sumCount
} }
// 初始化 // 初始化
leItem[SELECTED_QUQNTITY] = 0 leItem[SELECTED_QUQNTITY] = 0
leItem[SELECTED_DATA_ARR] = [] leItem[SELECTED_DATA_ARR] = []
if(leItem[DEFAULT_SECOND_DATA].length){ // 本地测试 localSecondData DEFAULT_SECOND_DATA if (leItem[LOCAL_SECOND_DATA].length) { // 本地测试 localSecondData LOCAL_SECOND_DATA
leItem[DEFAULT_SECOND_DATA].forEach(function(chItem) { leItem[LOCAL_SECOND_DATA].forEach(function (chItem) {
if(chItem[DEFAULT_FIELD] > 0){ if (chItem[DEFAULT_FIELD] > 0) {
leItem[SELECTED_QUQNTITY] += Number(chItem[DEFAULT_FIELD]) leItem[SELECTED_QUQNTITY] += Number(chItem[DEFAULT_FIELD])
leItem[SELECTED_DATA_ARR].push(chItem) leItem[SELECTED_DATA_ARR].push(chItem)
} }
...@@ -210,7 +413,7 @@ class ChooseProductPage extends Component { ...@@ -210,7 +413,7 @@ class ChooseProductPage extends Component {
// 计算中级数量回调 // 计算中级数量回调
handleChangeCount(count, coutFieName) { handleChangeCount(count, coutFieName) {
let {leftActiveIndex, leftOptionList, topProcOptionList, topActiveIndex,defaultThridShow} = this.state let { leftActiveIndex, leftOptionList, topProcOptionList, topActiveIndex, defaultThridShow } = this.state
// console.log('计算中级数量回调===', count, leftActiveIndex, defaultThridShow, coutFieName) // console.log('计算中级数量回调===', count, leftActiveIndex, defaultThridShow, coutFieName)
topProcOptionList[topActiveIndex].leftOptionList[leftActiveIndex][SELECTED_QUQNTITY] = 0 topProcOptionList[topActiveIndex].leftOptionList[leftActiveIndex][SELECTED_QUQNTITY] = 0
...@@ -219,19 +422,19 @@ class ChooseProductPage extends Component { ...@@ -219,19 +422,19 @@ class ChooseProductPage extends Component {
leftOptionList[leftActiveIndex][SELECTED_QUQNTITY] = 0 leftOptionList[leftActiveIndex][SELECTED_QUQNTITY] = 0
leftOptionList[leftActiveIndex][SELECTED_DATA_ARR] = [] leftOptionList[leftActiveIndex][SELECTED_DATA_ARR] = []
leftOptionList.map(function(leItem, leIndex) { leftOptionList.map(function (leItem, leIndex) {
if(!leItem[SELECTED_QUQNTITY]){ if (!leItem[SELECTED_QUQNTITY]) {
leItem[SELECTED_QUQNTITY] = 0 leItem[SELECTED_QUQNTITY] = 0
} }
if(!leItem[SELECTED_DATA_ARR]){ if (!leItem[SELECTED_DATA_ARR]) {
leItem[SELECTED_DATA_ARR] = [] leItem[SELECTED_DATA_ARR] = []
} }
if(leIndex === leftActiveIndex) { if (leIndex === leftActiveIndex) {
// 当前选择项 // 当前选择项
leItem[SELECTED_QUQNTITY] = count leItem[SELECTED_QUQNTITY] = count
if(leItem[DEFAULT_SECOND_DATA].length){ // 本地测试 localSecondData DEFAULT_SECOND_DATA if (leItem[LOCAL_SECOND_DATA].length) { // 本地测试 localSecondData LOCAL_SECOND_DATA
leItem[DEFAULT_SECOND_DATA].forEach(function(chItem) { leItem[LOCAL_SECOND_DATA].forEach(function (chItem) {
if(chItem[coutFieName]){ if (chItem[coutFieName]) {
leItem[SELECTED_DATA_ARR].push(chItem) leItem[SELECTED_DATA_ARR].push(chItem)
} }
}) })
...@@ -239,26 +442,27 @@ class ChooseProductPage extends Component { ...@@ -239,26 +442,27 @@ class ChooseProductPage extends Component {
} }
}) })
topProcOptionList[topActiveIndex].leftOptionList.map(function(leItem, leIndex) { topProcOptionList[topActiveIndex].leftOptionList.map(function (leItem, leIndex) {
if(!leItem[SELECTED_QUQNTITY]){ if (!leItem[SELECTED_QUQNTITY]) {
leItem[SELECTED_QUQNTITY] = 0 leItem[SELECTED_QUQNTITY] = 0
} }
if(!leItem[SELECTED_DATA_ARR]){ if (!leItem[SELECTED_DATA_ARR]) {
leItem[SELECTED_DATA_ARR] = [] leItem[SELECTED_DATA_ARR] = []
} }
if(leIndex === leftActiveIndex) { if (leIndex === leftActiveIndex) {
// 当前选择项 // 当前选择项
leItem[SELECTED_QUQNTITY] = count leItem[SELECTED_QUQNTITY] = count
if(leItem[DEFAULT_SECOND_DATA].length){ // 本地测试 localSecondData DEFAULT_SECOND_DATA if (leItem[LOCAL_SECOND_DATA].length > 0) {
leItem[DEFAULT_SECOND_DATA].forEach(function(chItem) { leItem[SELECTED_DATA_ARR] = []
if(chItem[coutFieName]){ leItem[LOCAL_SECOND_DATA].forEach(function (chItem) {
if (chItem[coutFieName]) {
leItem[SELECTED_DATA_ARR].push(chItem) leItem[SELECTED_DATA_ARR].push(chItem)
} }
}) })
} }
} }
}) })
console.log('计算中级之后---', leftOptionList) // console.log('计算中级之后---', leftOptionList)
this.setState({ this.setState({
leftOptionList, leftOptionList,
topProcOptionList topProcOptionList
...@@ -275,14 +479,14 @@ class ChooseProductPage extends Component { ...@@ -275,14 +479,14 @@ class ChooseProductPage extends Component {
// 计算所有已选数量 // 计算所有已选数量
getAllCountQuantity() { getAllCountQuantity() {
let {leftOptionList, topProcOptionList, topActiveIndex} = this.state let { leftOptionList, topProcOptionList, topActiveIndex } = this.state
let allCountQuantity = 0 let allCountQuantity = 0
if(!topProcOptionList.length){ if (!topProcOptionList.length) {
return allCountQuantity return allCountQuantity
} }
topProcOptionList[topActiveIndex].leftOptionList.map(leItem => { topProcOptionList[topActiveIndex].leftOptionList.map(leItem => {
// leftOptionList.map(leItem => { // leftOptionList.map(leItem => {
if(!leItem[SELECTED_QUQNTITY]){ if (!leItem[SELECTED_QUQNTITY]) {
leItem[SELECTED_QUQNTITY] = 0 leItem[SELECTED_QUQNTITY] = 0
} }
allCountQuantity += leItem[SELECTED_QUQNTITY] allCountQuantity += leItem[SELECTED_QUQNTITY]
...@@ -294,8 +498,8 @@ class ChooseProductPage extends Component { ...@@ -294,8 +498,8 @@ class ChooseProductPage extends Component {
// 点击共计已选 // 点击共计已选
handleSubSelected() { handleSubSelected() {
// console.log('show-----', show) // console.log('show-----', show)
let {selectShowPopup} = this.state let { selectShowPopup } = this.state
if(this.getAllCountQuantity() !== 0) { if (this.getAllCountQuantity() !== 0) {
this.handleCloseSelectModal(!selectShowPopup) this.handleCloseSelectModal(!selectShowPopup)
} }
} }
...@@ -310,7 +514,7 @@ class ChooseProductPage extends Component { ...@@ -310,7 +514,7 @@ class ChooseProductPage extends Component {
// 已选修改回调 // 已选修改回调
handleSelectCallBack(options) { handleSelectCallBack(options) {
// console.log('--已选修改回调--', options) // console.log('--已选修改回调--', options)
let {topProcOptionList, topActiveIndex} = this.state let { topProcOptionList, topActiveIndex } = this.state
topProcOptionList[topActiveIndex].leftOptionList = options topProcOptionList[topActiveIndex].leftOptionList = options
this.setState({ this.setState({
// leftOptionList: options, // leftOptionList: options,
...@@ -319,8 +523,8 @@ class ChooseProductPage extends Component { ...@@ -319,8 +523,8 @@ class ChooseProductPage extends Component {
} }
// 接口错误提示 // 接口错误提示
showRrrorTip(result){ showRrrorTip(result) {
if(result.error_code == 41006) { if (result.error_code == 41006) {
show('登录过期,请重新登录'); show('登录过期,请重新登录');
this.props.exitLoginStatus(); this.props.exitLoginStatus();
} else { } else {
...@@ -339,7 +543,7 @@ class ChooseProductPage extends Component { ...@@ -339,7 +543,7 @@ class ChooseProductPage extends Component {
defaultValue={this.state.searchValue} defaultValue={this.state.searchValue}
/> />
<View style={list_common_item.ser_img_box}> <View style={list_common_item.ser_img_box}>
<Image source={require('../../../images/search_icon.png')} style={icon_style}/> <Image source={require('../../../images/search_icon.png')} style={icon_style} />
</View> </View>
</View> </View>
) )
...@@ -347,11 +551,14 @@ class ChooseProductPage extends Component { ...@@ -347,11 +551,14 @@ class ChooseProductPage extends Component {
// 返回顶部产品元素 // 返回顶部产品元素
renderTopProItem() { renderTopProItem() {
let {topProcOptionList, topActiveIndex} = this.state let { topProcOptionList, topActiveIndex } = this.state
// if(topProcOptionList.length > 0){
// topProcOptionList[topActiveIndex][SELECTED_QUQNTITY]= this.getAllCountQuantity()
// }
console.log('返回顶部产品元素---', topProcOptionList) console.log('返回顶部产品元素---', topProcOptionList)
if(topProcOptionList.length > 0){ let cur_title = 'title', cur_icon = 'iconImg'
topProcOptionList[topActiveIndex][SELECTED_QUQNTITY]= this.getAllCountQuantity() cur_title = 'supplier_short_name'
} cur_icon = 'supplier_icon'
return ( return (
<ChooseCardList <ChooseCardList
...@@ -365,8 +572,8 @@ class ChooseProductPage extends Component { ...@@ -365,8 +572,8 @@ class ChooseProductPage extends Component {
cardStyleItemTit={styles.top_tit} cardStyleItemTit={styles.top_tit}
cardStyleItemTitAct={styles.top_tit_act} cardStyleItemTitAct={styles.top_tit_act}
cardListOptions={topProcOptionList} cardListOptions={topProcOptionList}
cardItemTitle={'title'} cardItemTitle={cur_title}
cardItemIcon={'iconImg'} cardItemIcon={cur_icon}
curActIndex={topActiveIndex} curActIndex={topActiveIndex}
cardCallBack={(item, index) => this.handleTopNav(item, index)} cardCallBack={(item, index) => this.handleTopNav(item, index)}
cardCountName={SELECTED_QUQNTITY} cardCountName={SELECTED_QUQNTITY}
...@@ -378,15 +585,18 @@ class ChooseProductPage extends Component { ...@@ -378,15 +585,18 @@ class ChooseProductPage extends Component {
// 返回底部左侧元素 // 返回底部左侧元素
renderContLeftItem() { renderContLeftItem() {
let {leftActiveIndex, leftOptionList, topProcOptionList, topActiveIndex} = this.state let { leftActiveIndex, leftOptionList, topProcOptionList, topActiveIndex } = this.state
let curLeftOptions = [] let curLeftOptions = []
let curLeftActIndex = 0
// curLeftOptions = leftOptionList // curLeftOptions = leftOptionList
// curLeftActIndex = leftActiveIndex if (topProcOptionList.length > 0) {
if(topProcOptionList.length > 0){
curLeftOptions = topProcOptionList[topActiveIndex].leftOptionList curLeftOptions = topProcOptionList[topActiveIndex].leftOptionList
} }
curLeftActIndex = leftActiveIndex
console.log('返回左侧元素---', curLeftOptions)
let cur_title = 'title', cur_icon = 'iconImg'
cur_title = 'category_name'
cur_icon = 'cate_local_icon'
return ( return (
<ChooseCardList <ChooseCardList
cardStyleBox={styles.cont_left_box} cardStyleBox={styles.cont_left_box}
...@@ -401,8 +611,8 @@ class ChooseProductPage extends Component { ...@@ -401,8 +611,8 @@ class ChooseProductPage extends Component {
cardStyleItemIcon={styles.cont_left_img_box} cardStyleItemIcon={styles.cont_left_img_box}
// cardListOptions={leftOptionList} // cardListOptions={leftOptionList}
cardListOptions={curLeftOptions} cardListOptions={curLeftOptions}
cardItemTitle={'title'} cardItemTitle={cur_title}
cardItemIcon={'iconImg'} cardItemIcon={cur_icon}
curActIndex={leftActiveIndex} curActIndex={leftActiveIndex}
cardCallBack={(item, index) => this.handleLeftNav(item, index)} cardCallBack={(item, index) => this.handleLeftNav(item, index)}
cardCountName={SELECTED_QUQNTITY} cardCountName={SELECTED_QUQNTITY}
...@@ -418,23 +628,28 @@ class ChooseProductPage extends Component { ...@@ -418,23 +628,28 @@ class ChooseProductPage extends Component {
let curRigSecoOption = [] let curRigSecoOption = []
let curSuperLeftOption = [] let curSuperLeftOption = []
// if(leftOptionList[leftActiveIndex]){ // if(leftOptionList[leftActiveIndex]){
// curRigSecoOption = leftOptionList[leftActiveIndex][DEFAULT_SECOND_DATA] // 本地数据 // curRigSecoOption = leftOptionList[leftActiveIndex][LOCAL_SECOND_DATA] // 本地数据
// curSuperLeftOption = leftOptionList[leftActiveIndex] // curSuperLeftOption = leftOptionList[leftActiveIndex]
// } // }
if(topProcOptionList[topActiveIndex] && topProcOptionList[topActiveIndex].leftOptionList){ let topItem = topProcOptionList[topActiveIndex]
curRigSecoOption = topProcOptionList[topActiveIndex].leftOptionList[leftActiveIndex][DEFAULT_SECOND_DATA] // 本地数据
curSuperLeftOption = topProcOptionList[topActiveIndex].leftOptionList[leftActiveIndex] if (topItem && topItem.leftOptionList) {
let leftItem = topItem.leftOptionList[leftActiveIndex]
if (leftItem && leftItem[LOCAL_SECOND_DATA]) {
curRigSecoOption = leftItem[LOCAL_SECOND_DATA]
curSuperLeftOption = leftItem
}
} }
// console.log('-返回右侧二级元素--curRigSecoOption', curRigSecoOption) // console.log('-返回右侧二级元素--curRigSecoOption', curRigSecoOption)
return ( return (
<View style={styles.cont_bom_box}> <View style={styles.cont_bom_box}>
{ this.renderContLeftItem() } { this.renderContLeftItem()}
<ProductRightStyle <ProductRightStyle
navigation={this.props.navigation} navigation={this.props.navigation}
superIndex={leftActiveIndex} leftIndex={leftActiveIndex}
defaultThridShow={defaultThridShow} defaultThridShow={defaultThridShow}
changeThrShow={(defaultThridShow) => this.handleChangeThrShow(defaultThridShow)} changeThrShow={(defaultThridShow) => this.handleChangeThrShow(defaultThridShow)}
superStencilData={curRigSecoOption} superStencilData={curRigSecoOption}
...@@ -450,12 +665,12 @@ class ChooseProductPage extends Component { ...@@ -450,12 +665,12 @@ class ChooseProductPage extends Component {
// 返回底部按钮 // 返回底部按钮
renderFooterBtnItem() { renderFooterBtnItem() {
let {selectShowPopup, leftOptionList, topProcOptionList, topActiveIndex} = this.state let { selectShowPopup, leftOptionList, topProcOptionList, topActiveIndex } = this.state
let allCountQuantity = this.getAllCountQuantity() let allCountQuantity = this.getAllCountQuantity()
console.log('左侧数据----', leftOptionList) console.log('左侧数据----', leftOptionList)
let cur_sel_options = [] let cur_sel_options = []
// cur_sel_options = leftOptionList // cur_sel_options = leftOptionList
if(topProcOptionList.length > 0){ if (topProcOptionList.length > 0) {
cur_sel_options = topProcOptionList[topActiveIndex].leftOptionList cur_sel_options = topProcOptionList[topActiveIndex].leftOptionList
} }
return ( return (
...@@ -478,7 +693,7 @@ class ChooseProductPage extends Component { ...@@ -478,7 +693,7 @@ class ChooseProductPage extends Component {
</View> </View>
<ProductModel <ProductModel
show={ selectShowPopup } show={selectShowPopup}
closeModal={(show) => this.handleCloseSelectModal(show)} closeModal={(show) => this.handleCloseSelectModal(show)}
closeSubmit={() => this.handleSubmit()} closeSubmit={() => this.handleSubmit()}
modelOption={cur_sel_options} modelOption={cur_sel_options}
...@@ -490,14 +705,14 @@ class ChooseProductPage extends Component { ...@@ -490,14 +705,14 @@ class ChooseProductPage extends Component {
} }
render() { render() {
let {navigation} = this.props let { navigation } = this.props
let {title} = navigation.state.params let { title } = navigation.state.params
return ( return (
<View style={styles.choo_container}> <View style={styles.choo_container}>
<StatusBarView <StatusBarView
isReactStackNavigator={true} isReactStackNavigator={true}
backgroundColor={promary_color} backgroundColor={promary_color}
barStyle = 'light-content' barStyle='light-content'
/> />
<View style={safe_view}> <View style={safe_view}>
<HeadBackItem title={title} navigation={navigation} /> <HeadBackItem title={title} navigation={navigation} />
...@@ -531,16 +746,14 @@ const styles = StyleSheet.create({ ...@@ -531,16 +746,14 @@ const styles = StyleSheet.create({
borderBottomWidth: 1 borderBottomWidth: 1
}, },
top_scroll_cont: {}, top_scroll_cont: {},
// top_touch_cont: {},
top_inner: { top_inner: {
borderBottomColor: foundation_color, borderBottomColor: foundation_color,
minWidth: 60 minWidth: 60
}, },
top_inner_act: {}, top_inner_act: {},
// top_img_box: {},
top_tit: {}, top_tit: {},
top_tit_act: {}, top_tit_act: {},
top_cot_num:{ top_cot_num: {
right: 8 right: 8
}, },
cont_bom_box: { cont_bom_box: {
...@@ -646,9 +859,9 @@ const mapStateToProps = (state) => { ...@@ -646,9 +859,9 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { return {
// requestSelfOrganizations: (params) => { exitLoginStatus: () => {
// dispatch(requestSelfOrganizations(params)) dispatch(exitLoginStatus())
// } },
} }
} }
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { View, StyleSheet, SafeAreaView, ScrollView, FlatList } from 'react-native'; import { View, StyleSheet, SafeAreaView, ScrollView, FlatList } from 'react-native';
import {connect} from 'react-redux'; import { connect } from 'react-redux';
import HeadBackItem from '../../common/HeadBackItem'; import HeadBackItem from '../../common/HeadBackItem';
import { home_background_color, foundation_color, promary_color, third_text_color, first_text_color, second_text_size, Width, pxSize, safe_view, font_family_semibold, font_family_light } from '../../../base/BaseStyle'; import { home_background_color, foundation_color, promary_color, third_text_color, first_text_color, second_text_size, Width, pxSize, safe_view, font_family_semibold, font_family_light } from '../../../base/BaseStyle';
import { import {
...@@ -10,13 +10,14 @@ import StatusBarView from '../../common/StatusBarView'; ...@@ -10,13 +10,14 @@ import StatusBarView from '../../common/StatusBarView';
import ChooseCardList from '../../common/listDataComponent/ChooseCardList'; import ChooseCardList from '../../common/listDataComponent/ChooseCardList';
import PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu'; import PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu';
import PictureZoom from '../../common/listDataComponent/PictureZoom'; import PictureZoom from '../../common/listDataComponent/PictureZoom';
import {cloneObject} from '../../../utils/Utils'; import { cloneObject, show } from '../../../utils/Utils';
import { reqSurTempLineSearch, reqNailBoxLineSearch, reqEquipPackageLineSearch } from '../../../action/SelfAction';
import localMockData from './mock/sen_mock'; import localMockData from './mock/sen_mock';
const SELECTED_QUQNTITY = 'selectedQuantity' // 三级数量 const SELECTED_QUQNTITY = 'selectedQuantity' // 三级数量
const SELECTED_DATA_ARR = 'selectedDataArr' // 三级已选元素 const SELECTED_DATA_ARR = 'selectedDataArr' // 三级已选元素
const DEFAULT_SECOND_DATA = 'localThridContData' // 三级原本元素 const LOCAL_THRID_CONT_DATA = 'localThridContData' // 三级原本元素
const DEFAULT_FIELD = 'quantity' // 计算的字段 const QUANTITY_FIELD = 'quantity' // 计算的字段
class EditThirdLevelPage extends Component { class EditThirdLevelPage extends Component {
...@@ -27,55 +28,167 @@ class EditThirdLevelPage extends Component { ...@@ -27,55 +28,167 @@ class EditThirdLevelPage extends Component {
topActiveIndex: 0, topActiveIndex: 0,
onlyShow: false, // 只展示 onlyShow: false, // 只展示
onlySignSelect: false, // 单选 onlySignSelect: false, // 单选
defalutTopItem: [{ // 手术模板显示
"category_code": "sign_consu",
"category_name": "单选耗材"
}, {
"category_code": "screw_box",
"category_name": "钉盒",
"cate_local_icon": require('../../../images/screw_box.png')
}, {
"category_code": "equip_bag",
"category_name": "器械包",
"cate_local_icon": require('../../../images/equip_bag.png')
}, {
"category_code": "auxili_tool",
"category_name": "零散器械",
"cate_local_icon": require('../../../images/auxili_tool.png')
}],
superData: {}
} }
} }
componentDidMount() { componentDidMount() {
let {params} = this.props.navigation.state // let {params} = this.props.navigation.state
let that = this // let that = this
// console.log('本地测试数据====localMockData===', localMockData) // console.log('本地测试数据====localMockData===', localMockData)
console.log('父组件传递的值==', params) // console.log('父组件传递的值==', params)
// 赋值测试数据 // // 赋值测试数据
let curOptions = [] // let curOptions = []
if(params.superData.leftIndex === 1){ // if(params.superData.leftIndex === 1){
// 钉盒 // // 钉盒
curOptions = cloneObject(localMockData.localThridOption_dh) // curOptions = cloneObject(localMockData.localThridOption_dh)
this.setState({ // this.setState({
onlyShow: params.superData.thirdShow, // onlyShow: params.superData.thirdShow,
topProcOptionList: curOptions // topProcOptionList: curOptions
}) // })
}else if(params.superData.leftIndex === 2) { // }else if(params.superData.leftIndex === 2) {
// 器械包 // // 器械包
curOptions = cloneObject(localMockData.localThridOption_qxb) // curOptions = cloneObject(localMockData.localThridOption_qxb)
// if(curOptions.length > 0){ // this.setState({
// curOptions.forEach(function(curIt) { // onlyShow: params.superData.thirdShow,
// curIt.select = false // 初始化 // topProcOptionList: curOptions
// })
// }else {
// curOptions = cloneObject(localMockData.localThridOption)
// this.setState({
// topProcOptionList: curOptions
// }, () => {
// that.setAllSelectData()
// }) // })
// } // }
this.setState({ this.initGetData()
// onlySignSelect: params.superData.thirdSign, }
onlyShow: params.superData.thirdShow,
topProcOptionList: curOptions // 初始化获取数据
async initGetData() {
let that = this
let { superData } = that.props.navigation.state.params
let { token, global_domain_config } = that.props
let { defalutTopItem, topProcOptionList } = that.state
let { leftIndex, superIndex, superItem, thirdShow } = superData
console.log('父组件传递的值==', leftIndex, superIndex, superItem, thirdShow)
that.setState({
superData: cloneObject(superData)
}) })
}else {
curOptions = cloneObject(localMockData.localThridOption) if (leftIndex === 0) {
this.setState({ let params = {
topProcOptionList: curOptions access_token: token,
template_number: superItem.template_number
}
let sur_line_search = await reqSurTempLineSearch(global_domain_config, params)
console.log('res_line_1 : ', sur_line_search)
if (sur_line_search.error_code === 0) {
let { data } = sur_line_search
topProcOptionList = cloneObject(defalutTopItem)
topProcOptionList.forEach(function (topIt) {
topIt['localThridContData'] = []
topIt['selectedDataArr'] = []
topIt['selectedQuantity'] = 0
})
if (data.items) {
topProcOptionList[0].localThridContData = data.items
}
if (data.nail_box) {
topProcOptionList[1].localThridContData = data.nail_box
}
if (data.item_package) {
topProcOptionList[2].localThridContData = data.item_package
}
if (data.tool) {
topProcOptionList[3].localThridContData = data.tool
}
that.setState({
topProcOptionList: topProcOptionList
}, () => { }, () => {
that.setAllSelectData() that.setAllSelectData()
}) })
} else {
that.showRrrorTip(sur_line_search)
}
} else if (leftIndex === 1) {
let params = {
access_token: token,
nail_box_code: superItem.item_code,
nail_box_serial_number: superItem.serial_number,
}
let nail_line_search = await reqNailBoxLineSearch(global_domain_config, params)
console.log('res_line_1 : ', nail_line_search)
if (nail_line_search.error_code === 0) {
let { data } = nail_line_search
topProcOptionList = cloneObject(data.segemt)
topProcOptionList.forEach(function (topIt) {
topIt['localThridContData'] = topIt['details']
topIt['selectedDataArr'] = []
topIt['selectedQuantity'] = 0
})
that.setState({
topProcOptionList: topProcOptionList,
onlyShow: true
}, () => {
// that.setAllSelectData()
})
} else {
that.showRrrorTip(nail_line_search)
}
} else if (leftIndex === 2) {
let params = {
access_token: token,
nail_box_code: superItem.item_code,
nail_box_serial_number: superItem.serial_number,
}
let equip_line_search = await reqEquipPackageLineSearch(global_domain_config, params)
console.log('res_line_1 : ', equip_line_search)
if (equip_line_search.error_code === 0) {
let { data } = equip_line_search
data['localThridContData'] = data['package_components']
data['selectedDataArr'] = []
data['selectedQuantity'] = 0
topProcOptionList[0] = cloneObject(data)
that.setState({
topProcOptionList: topProcOptionList,
onlyShow: true
}, () => {
// that.setAllSelectData()
})
} else {
that.showRrrorTip(equip_line_search)
} }
} }
}
// 修改列表计算后数据 // 修改列表计算后数据
handleCalCallBack(item, index, dataName){ handleCalCallBack(item, index, dataName) {
let {topProcOptionList, topActiveIndex} = this.state let { topProcOptionList, topActiveIndex } = this.state
let {params} = this.props.navigation.state let { params } = this.props.navigation.state
let that = this let that = this
console.log('修改列表计算后数据',item, index, dataName) // console.log('修改列表计算后数据', item, index, dataName)
console.log('修改列表计算后数据',topActiveIndex, topProcOptionList) // console.log('修改列表计算后数据', topActiveIndex, topProcOptionList)
console.log('父组件传递的值==', params.superData.leftIndex) // console.log('父组件传递的值==', params.superData.leftIndex)
// if(params.superData.leftIndex === 2){ // if(params.superData.leftIndex === 2){
// topProcOptionList.map(function(topItem, topInd) { // topProcOptionList.map(function(topItem, topInd) {
// if(topInd === index){ // if(topInd === index){
...@@ -91,15 +204,15 @@ class EditThirdLevelPage extends Component { ...@@ -91,15 +204,15 @@ class EditThirdLevelPage extends Component {
// console.log('设置当前所有已选值---', topProcOptionList) // console.log('设置当前所有已选值---', topProcOptionList)
// }else // }else
if(dataName && topProcOptionList[topActiveIndex][dataName]){ if (dataName && topProcOptionList[topActiveIndex][dataName]) {
topProcOptionList.map(function(listItem, listIndex) { topProcOptionList.map(function (listItem, listIndex) {
if(listIndex === topActiveIndex){ if (listIndex === topActiveIndex) {
listItem[dataName][index] = item listItem[dataName][index] = item
} }
}) })
that.setState({ that.setState({
topProcOptionList topProcOptionList
},() => { }, () => {
that.setAllSelectData() that.setAllSelectData()
}) })
} }
...@@ -107,20 +220,20 @@ class EditThirdLevelPage extends Component { ...@@ -107,20 +220,20 @@ class EditThirdLevelPage extends Component {
// 设置当前所有已选值 // 设置当前所有已选值
setAllSelectData() { setAllSelectData() {
let {topProcOptionList} = this.state let { topProcOptionList } = this.state
topProcOptionList.map(function(listItem) { topProcOptionList.map(function (listItem) {
listItem[SELECTED_QUQNTITY] = 0 listItem[SELECTED_QUQNTITY] = 0
listItem[SELECTED_DATA_ARR] = [] listItem[SELECTED_DATA_ARR] = []
if(listItem[DEFAULT_SECOND_DATA].length){ if (listItem[LOCAL_THRID_CONT_DATA].length) {
listItem[DEFAULT_SECOND_DATA].forEach(function(chItem) { listItem[LOCAL_THRID_CONT_DATA].forEach(function (chItem) {
if(chItem[DEFAULT_FIELD]){ if (chItem[QUANTITY_FIELD]) {
listItem[SELECTED_QUQNTITY] += Number(chItem[DEFAULT_FIELD]) listItem[SELECTED_QUQNTITY] += Number(chItem[QUANTITY_FIELD])
listItem[SELECTED_DATA_ARR].push(chItem) listItem[SELECTED_DATA_ARR].push(chItem)
} }
}) })
} }
}) })
console.log('设置当前所有已选值---', topProcOptionList) // console.log('设置当前所有已选值---', topProcOptionList)
this.setState({ this.setState({
topProcOptionList topProcOptionList
}) })
...@@ -137,17 +250,40 @@ class EditThirdLevelPage extends Component { ...@@ -137,17 +250,40 @@ class EditThirdLevelPage extends Component {
// 点击编辑完成 // 点击编辑完成
handleSubmit() { handleSubmit() {
let {topProcOptionList} = this.state let { topProcOptionList, superData } = this.state
let {params} = this.props.navigation.state let { params } = this.props.navigation.state
// console.log('编辑完成====>', topProcOptionList, params.superData) // console.log('编辑完成====>', topProcOptionList, params.superData)
// console.log(topProcOptionList[0][DEFAULT_SECOND_DATA][0]) // console.log(topProcOptionList[0][LOCAL_THRID_CONT_DATA][0])
params.childrenPageCallBack(topProcOptionList, params.superData.superIndex) params.childrenPageCallBack(topProcOptionList, superData.superIndex)
this.props.navigation.goBack() this.props.navigation.goBack()
} }
// 接口错误提示
showRrrorTip(result) {
if (result.error_code == 41006) {
show('登录过期,请重新登录');
this.props.exitLoginStatus();
} else {
let error_msg = result.error_msg || result.message
show(error_msg);
}
}
// 返回顶部编辑选项 // 返回顶部编辑选项
renderTopProItem() { renderTopProItem() {
let { topProcOptionList, topActiveIndex } = this.state let { topProcOptionList, topActiveIndex, superData } = this.state
let { leftIndex } = superData
console.log('顶部编辑选项===', topProcOptionList)
let curTit = '', curTopList = topProcOptionList
if (leftIndex === 0) {
curTit = 'category_name'
} else if (leftIndex === 1) {
curTit = 'segment_name'
} else if (leftIndex === 2) {
curTopList = []
} else {
curTit = 'title'
}
return ( return (
<ChooseCardList <ChooseCardList
cardStyleBox={styles.top_box} cardStyleBox={styles.top_box}
...@@ -159,8 +295,8 @@ class EditThirdLevelPage extends Component { ...@@ -159,8 +295,8 @@ class EditThirdLevelPage extends Component {
cardStyleListItemAct={styles.top_inner_act} cardStyleListItemAct={styles.top_inner_act}
cardStyleItemTit={styles.top_tit} cardStyleItemTit={styles.top_tit}
cardStyleItemTitAct={styles.top_tit_act} cardStyleItemTitAct={styles.top_tit_act}
cardListOptions={topProcOptionList} cardListOptions={curTopList}
cardItemTitle={'title'} cardItemTitle={curTit}
curActIndex={topActiveIndex} curActIndex={topActiveIndex}
cardCallBack={(item, index) => this.handleTopNav(item, index)} cardCallBack={(item, index) => this.handleTopNav(item, index)}
cardCountName={SELECTED_QUQNTITY} cardCountName={SELECTED_QUQNTITY}
...@@ -171,45 +307,54 @@ class EditThirdLevelPage extends Component { ...@@ -171,45 +307,54 @@ class EditThirdLevelPage extends Component {
// 返回底部主要元素 // 返回底部主要元素
renderContItem() { renderContItem() {
let {topProcOptionList, topActiveIndex, onlyShow} = this.state let { topProcOptionList, topActiveIndex, superData, onlyShow } = this.state
let {params} = this.props.navigation.state let { leftIndex } = superData
let curData = []
// 本地测试数据
let localThridContData = []
let imgIconArr = ''
if(params.superData.leftIndex === 1){ // let { params } = this.props.navigation.state
curData = topProcOptionList // let curData = []
}else if(params.superData.leftIndex === 2){ // // 本地测试数据
// let localThridContData = []
// let imgIconArr = ''
// localThridContData = topProcOptionList // if (params.superData.leftIndex === 1) {
// curData = topProcOptionList
// } else if (params.superData.leftIndex === 2) {
}else{ // // localThridContData = topProcOptionList
curData = topProcOptionList[topActiveIndex]
} // } else {
if(curData && curData[DEFAULT_SECOND_DATA]) { // curData = topProcOptionList[topActiveIndex]
localThridContData = curData[DEFAULT_SECOND_DATA] // }
} // if (curData && curData[LOCAL_THRID_CONT_DATA]) {
if(curData && curData.imgIconArr){ // localThridContData = curData[LOCAL_THRID_CONT_DATA]
imgIconArr = curData.imgIconArr // }
} // if (curData && curData.imgIconArr) {
// imgIconArr = curData.imgIconArr
// }
if(params.superData.leftIndex === 2){ // if (params.superData.leftIndex === 2) {
// 器械包 // // 器械包
localThridContData = topProcOptionList['package_components'] // localThridContData = topProcOptionList['package_components']
// }
let localThridContData = []
let imgIconArr = ''
let topItem = topProcOptionList[topActiveIndex]
if (topItem) {
localThridContData = topItem[LOCAL_THRID_CONT_DATA]
} }
console.log('底部数据==' ,curData, localThridContData, topProcOptionList) console.log('底部数据==', topItem, localThridContData)
return( return (
<View style={styles.edit_cont}> <View style={styles.edit_cont}>
{ imgIconArr ? <PictureZoom { imgIconArr ? <PictureZoom
listImageIndex={0} listImageIndex={0}
listImageUrls={imgIconArr} listImageUrls={imgIconArr}
listStyleImage={styles.thr_head_tit_img} listStyleImage={styles.thr_head_tit_img}
listPicType={'RECTANGLE'} listPicType={'RECTANGLE'}
/> : null } /> : null}
<ScrollView <ScrollView
style={styles.edit_scroll_cont} style={styles.edit_scroll_cont}
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
...@@ -219,7 +364,7 @@ class EditThirdLevelPage extends Component { ...@@ -219,7 +364,7 @@ class EditThirdLevelPage extends Component {
keyExtractor={item => item.id} keyExtractor={item => item.id}
data={localThridContData} data={localThridContData}
extraData={this.state} extraData={this.state}
renderItem={ ({item, index}) => this.renderContColumnItem(item, index) } renderItem={({ item, index }) => this.renderContColumnItem(item, index)}
/> />
</ScrollView> </ScrollView>
</View> </View>
...@@ -228,41 +373,55 @@ class EditThirdLevelPage extends Component { ...@@ -228,41 +373,55 @@ class EditThirdLevelPage extends Component {
// 返回每一列元素 // 返回每一列元素
renderContColumnItem(item, index) { renderContColumnItem(item, index) {
let {onlyShow, onlySignSelect} = this.state let { topProcOptionList, topActiveIndex, superData, onlyShow, onlySignSelect } = this.state
let {params} = this.props.navigation.state let { leftIndex } = superData
console.log('onlySignSelect', onlySignSelect) let curTit = '', curTipStr = '', curTipOne = '', curTipTwo = '', curCalField = '', curImgIcon = ''
let curTipStrTit = '', curTipOneTit = '', curTipTwoTit = ''
let curTitText='', curTipTextStr='', curTipTextOne='',curCalField='',curImgIcon='' // if (!onlyShow) {
if(!onlyShow){ // curImgIcon = 'imgIconArr'
curImgIcon = 'imgIconArr' // }
}
// if (params.superData.leftIndex === 2) {
if(params.superData.leftIndex === 2){ // // 器械包
// 器械包 // curTit = 'item_name'
curTitText='item_name' // curTipStr = 'category_name'
curTipTextStr='category_name' // curTipOne = 'category_desc'
curTipTextOne='category_desc' // curCalField = 'quantity'
curCalField='quantity'
curImgIcon=''
// 物料名称、分类名称、分类说明
}else{
curTitText='title'
curTipTextStr='tip1'
curTipTextOne='tip2'
curCalField='quantity'
// curImgIcon = '' // curImgIcon = ''
} // // 物料名称、分类名称、分类说明
// } else {
// curTit = 'title'
// curTipStr = 'tip1'
// curTipOne = 'tip2'
// curCalField = 'quantity'
// // curImgIcon = ''
// }
curTit = 'general_name'
curTipStr = 'specification'
curTipOne = 'item_name'
curTipTwo = 'category_desc'
curTipStrTit = '规格型号'
curTipOneTit = '物料名称'
curTipTwoTit = '描述'
curCalField = 'quantity'
curImgIcon = 'photos'
return ( return (
<SafeAreaView style={styles.column_container}> <SafeAreaView style={styles.column_container}>
<PicTitDetaiCalcu <PicTitDetaiCalcu
listItem={item} listItem={item}
listIndex={index} listIndex={index}
calField={curCalField} calField={curCalField}
subCalCallBack={(item,index) => this.handleCalCallBack(item,index,DEFAULT_SECOND_DATA)} subCalCallBack={(item, index) => this.handleCalCallBack(item, index, LOCAL_THRID_CONT_DATA)}
titText={curTitText} titText={curTit}
tipTextStr={curTipTextStr} tipTextStr={curTipStr}
tipTextOne={curTipTextOne} tipTextOne={curTipOne}
tipTextTwo={curTipTwo}
tipTextStrTit={curTipStrTit}
tipTextOneTit={curTipOneTit}
tipTextTwoTit={curTipTwoTit}
listImgIcon={curImgIcon} listImgIcon={curImgIcon}
listPicType={'ROUND'} listPicType={'ROUND'}
onlyShowNum={onlyShow} onlyShowNum={onlyShow}
...@@ -274,16 +433,16 @@ class EditThirdLevelPage extends Component { ...@@ -274,16 +433,16 @@ class EditThirdLevelPage extends Component {
} }
render() { render() {
let {navigation} = this.props let { navigation } = this.props
let {title} = navigation.state.params let { title } = navigation.state.params
let {onlyShow, onlySignSelect} = this.state let { onlyShow, onlySignSelect } = this.state
console.log('onlyShow==', onlyShow) console.log('onlyShow==', onlyShow)
let curShowTop = true let curShowTop = true
if(onlyShow){ if (onlyShow) {
curShowTop = !onlyShow curShowTop = !onlyShow
} }
if(onlySignSelect) { if (onlySignSelect) {
curShowTop = !onlySignSelect curShowTop = !onlySignSelect
} }
return ( return (
...@@ -291,20 +450,21 @@ class EditThirdLevelPage extends Component { ...@@ -291,20 +450,21 @@ class EditThirdLevelPage extends Component {
<StatusBarView <StatusBarView
isReactStackNavigator={true} isReactStackNavigator={true}
backgroundColor={promary_color} backgroundColor={promary_color}
barStyle = 'light-content' barStyle='light-content'
/> />
<SafeAreaView style={safe_view}> <SafeAreaView style={safe_view}>
<HeadBackItem title={title} navigation={navigation} /> <HeadBackItem title={title} navigation={navigation} />
<View style={styles.edit_main}> <View style={styles.edit_main}>
{ curShowTop ? this.renderTopProItem() : null} {/* {curShowTop ? this.renderTopProItem() : null} */}
{this.renderTopProItem()}
{this.renderContItem()} {this.renderContItem()}
</View> </View>
{ !onlyShow ? <View style={styles.btom_btn_box}> {!onlyShow ? <View style={styles.btom_btn_box}>
<FooterBtnStyle <FooterBtnStyle
style={styles.sub_btn_pro} style={styles.sub_btn_pro}
activeOpacity={.8} activeOpacity={.8}
title={'编辑完成'} title={'编辑完成'}
textStyle= {styles.sub_btn_txt} textStyle={styles.sub_btn_txt}
onPress={() => this.handleSubmit()} onPress={() => this.handleSubmit()}
/> />
</View> : null} </View> : null}
...@@ -445,9 +605,9 @@ const mapStateToProps = (state) => { ...@@ -445,9 +605,9 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { return {
// requestSelfOrganizations: (params) => { exitLoginStatus: () => {
// dispatch(requestSelfOrganizations(params)) dispatch(exitLoginStatus())
// } },
} }
} }
......
import React , { Component } from 'react'; import React, { Component } from 'react';
import { View, Text, StyleSheet, TouchableOpacity, Image, ScrollView, FlatList, SafeAreaView } from 'react-native'; import { View, Text, StyleSheet, TouchableOpacity, Image, ScrollView, FlatList, SafeAreaView } from 'react-native';
import { third_text_color, foundation_color, second_text_size, Width, pxSize, font_family_regular, icon_style } from '../../../base/BaseStyle'; import { third_text_color, foundation_color, second_text_size, Width, pxSize, font_family_regular, icon_style } from '../../../base/BaseStyle';
import PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu'; import PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu';
import PictureZoom from '../../common/listDataComponent/PictureZoom'; import PictureZoom from '../../common/listDataComponent/PictureZoom';
import {cloneObject} from '../../../utils/Utils'; import { cloneObject } from '../../../utils/Utils';
import _ from "lodash"; import _ from "lodash";
import localMockData from './mock/sen_mock'; import localMockData from './mock/sen_mock';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
...@@ -23,13 +23,15 @@ class ProductRightStyle extends Component { ...@@ -23,13 +23,15 @@ class ProductRightStyle extends Component {
superReduceBack: PropTypes.func, // 减法回调 superReduceBack: PropTypes.func, // 减法回调
thirdCallBack: PropTypes.func, // 三级小类的回调函数 thirdCallBack: PropTypes.func, // 三级小类的回调函数
superLeftData: PropTypes.object, // 三级大类数据 superLeftData: PropTypes.object, // 三级大类数据
superStencilData: PropTypes.array, // 当前右侧二级数据
leftIndex: PropTypes.numberm, // 左侧index
} }
constructor (props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
rightSecondData: this.props.superStencilData, // 右侧分类数据-模块、螺钉盒、器械包、赋值工具 rightSecondData: this.props.superStencilData, // 右侧分类数据-模块、螺钉盒、器械包、赋值工具
selectItem : [], // 当前选中模板 -- 之前版本 selectItem: [], // 当前选中模板 -- 之前版本
rowSingleData: [], // 人工髋关节假体等数据 -- 小类 rowSingleData: [], // 人工髋关节假体等数据 -- 小类
thridIsVisible: false, // 小类展示 thridIsVisible: false, // 小类展示
curThridObj: { curThridObj: {
...@@ -39,7 +41,7 @@ class ProductRightStyle extends Component { ...@@ -39,7 +41,7 @@ class ProductRightStyle extends Component {
} }
} }
componentDidMount(){ componentDidMount() {
// console.log('本地测试数据====localMockData===', localMockData) // console.log('本地测试数据====localMockData===', localMockData)
// // 赋值测试数据 // // 赋值测试数据
// this.setState({ // this.setState({
...@@ -49,65 +51,65 @@ class ProductRightStyle extends Component { ...@@ -49,65 +51,65 @@ class ProductRightStyle extends Component {
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
if (this.state.thridIsVisible != nextProps.defaultThridShow) { if (this.state.thridIsVisible != nextProps.defaultThridShow) {
this.setState({thridIsVisible: nextProps.defaultThridShow}); this.setState({ thridIsVisible: nextProps.defaultThridShow });
} }
if (nextProps.superStencilData) { if (nextProps.superStencilData) {
this.setState({rightSecondData: nextProps.superStencilData}); this.setState({ rightSecondData: nextProps.superStencilData });
} }
} }
// 所有二级数据标题点击事件 // 所有二级数据标题点击事件
TitleClickEvent(item, index) { TitleClickEvent(item, index) {
let {superIndex} = this.props let { leftIndex } = this.props
console.log('右侧标题点击事件 ', superIndex, index, item) console.log('右侧标题点击事件 ', leftIndex, index, item)
if(superIndex >= 0 && superIndex < 3) { if (leftIndex >= 0 && leftIndex < 3) {
let curThirdShow=false, curThirdSign=false, curTit='编辑模板' let curThirdShow = false, curThirdSign = false, curTit = '编辑模板'
if(superIndex === 1){ if (leftIndex === 1) {
curThirdShow = true curThirdShow = true
curTit='钉盒明细' curTit = '钉盒明细'
}else if(superIndex === 2){ } else if (leftIndex === 2) {
curThirdShow = true curThirdShow = true
// curThirdSign = true // curThirdSign = true
curTit='器械包明细' curTit = '器械包明细'
} }
this.props.navigation.navigate('EditThirdLevelPage', { this.props.navigation.navigate('EditThirdLevelPage', {
title: curTit, title: curTit,
superData:{ superData: {
superItem: item, superItem: item,
superIndex: index, superIndex: index,
leftIndex: superIndex, leftIndex: leftIndex,
thirdShow: curThirdShow, thirdShow: curThirdShow,
thirdSign: curThirdSign, // thirdSign: curThirdSign,
}, },
childrenPageCallBack: this.childrenPageCallBack.bind(this) // 传递函数,编辑完成时调用 childrenPageCallBack: this.childrenPageCallBack.bind(this) // 传递函数,编辑完成时调用
}) })
}else if(superIndex === 3){ } else if (leftIndex === 3) {
// 零散器械 // 零散器械
this.canPlusOrdReduceOne(item, index) this.canPlusOrdReduceOne(item, index)
// this.handleCalCallBack(curData, curIndex, 'rightSecondData', DEFAULT_FIELD) // this.handleCalCallBack(curData, curIndex, 'rightSecondData', DEFAULT_FIELD)
// this.setState({ // this.setState({
// rightSecondData // rightSecondData
// }) // })
}else { } else {
// 单选耗材 中级标题点击之后 // 单选耗材 中级标题点击之后
this.changeThrShow(true, item, index) this.changeThrShow(true, item, index)
} }
} }
// 零散器械标题点击 // 零散器械标题点击
canPlusOrdReduceOne(item, index){ canPlusOrdReduceOne(item, index) {
let {superIndex} = this.props let { leftIndex } = this.props
let {rightSecondData} = this.state let { rightSecondData } = this.state
// console.log('零散器械标题点击/减1:',rightSecondData) // console.log('零散器械标题点击/减1:',rightSecondData)
// console.log('零散器械标题点击/减1:',superIndex) // console.log('零散器械标题点击/减1:',leftIndex)
// console.log('零散器械标题点击/减1:',item) // console.log('零散器械标题点击/减1:',item)
// console.log('零散器械标题点击/减1:',index) // console.log('零散器械标题点击/减1:',index)
} }
// 大类加减,小类所有加1/减1 // 大类加减,小类所有加1/减1
handleAllPlusReduce(curData, curIndex, isPlus){ handleAllPlusReduce(curData, curIndex, isPlus) {
let {rightSecondData} = this.state let { rightSecondData } = this.state
let {superLeftData} = this.props let { superLeftData } = this.props
// console.log('大类加减,整理加一/减一', curData, curIndex) // console.log('大类加减,整理加一/减一', curData, curIndex)
// console.log('右侧数据', rightSecondData, curData[CHILD_DATA_NAME]) // console.log('右侧数据', rightSecondData, curData[CHILD_DATA_NAME])
...@@ -116,13 +118,13 @@ class ProductRightStyle extends Component { ...@@ -116,13 +118,13 @@ class ProductRightStyle extends Component {
// console.log('本地测试,获取接口数据--', curData) // console.log('本地测试,获取接口数据--', curData)
if((!curData[CHILD_DATA_NAME] || !curData[CHILD_DATA_NAME].length) && isPlus){ if ((!curData[CHILD_DATA_NAME] || !curData[CHILD_DATA_NAME].length) && isPlus) {
let curObj = { let curObj = {
superId: curData['id'], // 本地测试 superId: curData['id'], // 本地测试
superIndex: curIndex, // 本地测试 superIndex: curIndex, // 本地测试
superTit: superLeftData['title'], // 本地测试 superTit: superLeftData['title'], // 本地测试
superImg: curData['imgIcon'], // 本地测试 superImg: curData['imgIcon'], // 本地测试
superTip: curData['title'] , // 本地测试 superTip: curData['title'], // 本地测试
curTitle: curData['title'], // 本地测试 curTitle: curData['title'], // 本地测试
version: 0, version: 0,
lineOptions: rowData, lineOptions: rowData,
...@@ -135,30 +137,30 @@ class ProductRightStyle extends Component { ...@@ -135,30 +137,30 @@ class ProductRightStyle extends Component {
} }
// 加法/减法 // 加法/减法
if(curData[CHILD_DATA_NAME] && curData[CHILD_DATA_NAME].length > 0){ if (curData[CHILD_DATA_NAME] && curData[CHILD_DATA_NAME].length > 0) {
let sumCount = 0 let sumCount = 0
curData[CHILD_DATA_NAME][0].lineOptions.forEach(function(lineIt) { curData[CHILD_DATA_NAME][0].lineOptions.forEach(function (lineIt) {
if(!lineIt[DEFAULT_FIELD]){ if (!lineIt[DEFAULT_FIELD]) {
lineIt[DEFAULT_FIELD] = 0 lineIt[DEFAULT_FIELD] = 0
} }
if(!isPlus){ if (!isPlus) {
// 减法 // 减法
if(lineIt[DEFAULT_FIELD]){ if (lineIt[DEFAULT_FIELD]) {
lineIt[DEFAULT_FIELD] -= 1 lineIt[DEFAULT_FIELD] -= 1
}else { } else {
lineIt[DEFAULT_FIELD] = 0 lineIt[DEFAULT_FIELD] = 0
} }
}else { } else {
// 加法 // 加法
lineIt[DEFAULT_FIELD] += 1 lineIt[DEFAULT_FIELD] += 1
} }
sumCount += lineIt[DEFAULT_FIELD] sumCount += lineIt[DEFAULT_FIELD]
}) })
if(sumCount){ if (sumCount) {
curData[CHILD_DATA_NAME][0][DEFAULT_FIELD] = sumCount curData[CHILD_DATA_NAME][0][DEFAULT_FIELD] = sumCount
curData[DEFAULT_FIELD] = sumCount curData[DEFAULT_FIELD] = sumCount
curData[CHILD_DATA_NAME][0].superTip = `${curData['title']}x${sumCount}` curData[CHILD_DATA_NAME][0].superTip = `${curData['title']}x${sumCount}`
}else { } else {
curData[DEFAULT_FIELD] = 0 curData[DEFAULT_FIELD] = 0
delete curData[CHILD_DATA_NAME] delete curData[CHILD_DATA_NAME]
} }
...@@ -174,11 +176,11 @@ class ProductRightStyle extends Component { ...@@ -174,11 +176,11 @@ class ProductRightStyle extends Component {
// 编辑页面的回调 // 编辑页面的回调
childrenPageCallBack(childData, index) { childrenPageCallBack(childData, index) {
let {rightSecondData} = this.state let { rightSecondData } = this.state
let {superIndex} = this.props let { leftIndex } = this.props
console.log('编辑页面的回调----', childData, index, superIndex) console.log('编辑页面的回调----', childData, index, leftIndex)
let that = this let that = this
if(superIndex === 8){ // superIndex === 2 器械包有问题 if (leftIndex === 8) { // leftIndex === 2 器械包有问题
// rightSecondData.forEach(function(rsdItem, rsdIndex) { // rightSecondData.forEach(function(rsdItem, rsdIndex) {
// if(!rsdItem[CHILD_DATA_NAME]) { // if(!rsdItem[CHILD_DATA_NAME]) {
// rsdItem[CHILD_DATA_NAME] = [] // rsdItem[CHILD_DATA_NAME] = []
...@@ -217,44 +219,56 @@ class ProductRightStyle extends Component { ...@@ -217,44 +219,56 @@ class ProductRightStyle extends Component {
// that.handleCalCallBack(rsdItem, rsdIndex, 'rightSecondData', DEFAULT_FIELD) // that.handleCalCallBack(rsdItem, rsdIndex, 'rightSecondData', DEFAULT_FIELD)
// } // }
// }) // })
}else { } else {
rightSecondData.forEach(function(rsdItem, rsdIndex) { rightSecondData.forEach(function (rsdItem, rsdIndex) {
if(!rsdItem[CHILD_DATA_NAME]) { if (!rsdItem[CHILD_DATA_NAME]) {
rsdItem[CHILD_DATA_NAME] = [] rsdItem[CHILD_DATA_NAME] = []
} }
if(!rsdItem[DEFAULT_FIELD]) { if (!rsdItem[DEFAULT_FIELD]) {
rsdItem[DEFAULT_FIELD] = 0 rsdItem[DEFAULT_FIELD] = 0
} }
if(rsdIndex === index) { if (rsdIndex === index && leftIndex === 0) {
let superTip = '' let superTip = ''
childData.map((chDa, chInd) => { childData.map((chDa, chInd) => {
let splitStr = ' / ' let splitStr = ' / '
if(chInd === childData.length - 1){ if (chInd === childData.length - 1) {
splitStr = '' splitStr = ''
} }
superTip += `${chDa.title}x${chDa.selectedQuantity}${splitStr}` superTip += `${chDa.category_name}x${chDa.selectedQuantity}${splitStr}`
// superTip += `${chDa.title}x${chDa.selectedQuantity}${splitStr}`
}) })
let curObj = { let curObj = {
superId: rsdItem['id'], // 本地测试 superId: rsdItem['template_number'],
superIndex: rsdIndex, // 本地测试 superIndex: rsdIndex,
superTit: rsdItem['title'], // 本地测试 superTit: rsdItem['template_name'],
superImg: rsdItem['imgIcon'], // 本地测试 superImg: rsdItem['photos'],
superTip: superTip , // 本地测试 superTip: superTip,
version: 0, version: 0,
lineOptions: childData, lineOptions: childData,
[DEFAULT_FIELD]: 1 [DEFAULT_FIELD]: 1
} }
if(rsdItem[CHILD_DATA_NAME].length !== 0){ // let curObj = {
// superId: rsdItem['id'], // 本地测试
// superIndex: rsdIndex, // 本地测试
// superTit: rsdItem['title'], // 本地测试
// superImg: rsdItem['imgIcon'], // 本地测试
// superTip: superTip, // 本地测试
// version: 0,
// lineOptions: childData,
// [DEFAULT_FIELD]: 1
// }
if (rsdItem[CHILD_DATA_NAME].length !== 0) {
curObj.version = rsdItem[CHILD_DATA_NAME].length curObj.version = rsdItem[CHILD_DATA_NAME].length
} }
let filEquArr = rsdItem[CHILD_DATA_NAME].filter(function(lineItem) { let filEquArr = rsdItem[CHILD_DATA_NAME].filter(function (lineItem) {
if(_.isEqual(lineItem.lineOptions, childData)){ if (_.isEqual(lineItem.lineOptions, childData)) {
lineItem[DEFAULT_FIELD] += 1 lineItem[DEFAULT_FIELD] += 1
return lineItem return lineItem
} }
}) })
// 本地测试 // 本地测试
if(filEquArr.length === 0) { if (filEquArr.length === 0) {
rsdItem[CHILD_DATA_NAME].push(curObj) rsdItem[CHILD_DATA_NAME].push(curObj)
} }
rsdItem[DEFAULT_FIELD] = Number(rsdItem[DEFAULT_FIELD]) + 1 rsdItem[DEFAULT_FIELD] = Number(rsdItem[DEFAULT_FIELD]) + 1
...@@ -272,50 +286,52 @@ class ProductRightStyle extends Component { ...@@ -272,50 +286,52 @@ class ProductRightStyle extends Component {
// 修改当前小类是否展示 // 修改当前小类是否展示
changeThrShow(show, superItem, superIndex) { changeThrShow(show, superItem, superIndex) {
let {curThridObj, rowSingleData} = this.state let { curThridObj, rowSingleData } = this.state
// console.log('修改当前小类是否展示----', show, superItem, superIndex) // console.log('修改当前小类是否展示----', show, superItem, superIndex)
let localTestImageUrls = localMockData.localTestImageUrls // 本地测试数据 // let localTestImageUrls = localMockData.localTestImageUrls // 本地测试数据
let curRowData = cloneObject(localMockData.localSingleRowData) // 本地测试数据 此处应该要请求接口,获取小类数据 // let curRowData = cloneObject(localMockData.localSingleRowData) // 本地测试数据 此处应该要请求接口,获取小类数据
if(superItem) { if (superItem) {
// 中类点击时
curThridObj = { curThridObj = {
superItem: superItem, superItem: superItem,
superIndex: superIndex, superIndex: superIndex,
image:localTestImageUrls, // image: localTestImageUrls,
title: superItem.title title: superItem.category_name
}
if(superItem[CHILD_DATA_NAME] && superItem[CHILD_DATA_NAME].length > 0 && superItem[CHILD_DATA_NAME][0].lineOptions) {
curRowData = cloneObject(superItem[CHILD_DATA_NAME][0].lineOptions)
} }
// if (superItem[CHILD_DATA_NAME] && superItem[CHILD_DATA_NAME].length > 0 && superItem[CHILD_DATA_NAME][0].lineOptions) {
// curRowData = cloneObject(superItem[CHILD_DATA_NAME][0].lineOptions)
// }
} }
this.setState({ this.setState({
thridIsVisible: show, thridIsVisible: show,
curThridObj, curThridObj: curThridObj,
rowSingleData: curRowData rowSingleData: superItem['details']
// rowSingleData: curRowData
}) })
if(!show){ if (!show) {
// 点击标题时回调函数修改左侧数据 // 小类点击标题时,回调函数修改左侧数据
this.props.thirdCallBack(rowSingleData, curThridObj.superIndex) this.props.thirdCallBack(rowSingleData, curThridObj.superIndex)
} }
} }
// 修改列表计算后数据 - 头/行 // 修改列表计算后数据 - 头/行
handleCalCallBack(item, index, dataName, coutFieName){ handleCalCallBack(item, index, dataName, coutFieName) {
console.log('修改列表计算后数据==',item, index, dataName, coutFieName) // console.log('修改列表计算后数据==', item, index, dataName, coutFieName)
if(dataName && this.state[dataName]) { if (dataName && this.state[dataName]) {
let curDataName = this.state[dataName] let curDataName = this.state[dataName]
curDataName[index] = item curDataName[index] = item
this.setState({ this.setState({
[dataName]: curDataName [dataName]: curDataName
}) })
if(coutFieName) { if (coutFieName) {
// 除了单选耗材小类的回调 // 除了单选耗材小类的回调
// console.log('除了单选耗材的回调==',item, index, dataName, coutFieName) // console.log('除了单选耗材的回调==',item, index, dataName, coutFieName)
// 计算==头 // 计算==头
let sumCount = 0 let sumCount = 0
curDataName.map(item => { curDataName.map(item => {
if(item[coutFieName]){ if (item[coutFieName]) {
sumCount += Number(item[coutFieName]) sumCount += Number(item[coutFieName])
} }
}) })
...@@ -327,16 +343,39 @@ class ProductRightStyle extends Component { ...@@ -327,16 +343,39 @@ class ProductRightStyle extends Component {
// 返回右侧二级每一列(单选耗材以上) // 返回右侧二级每一列(单选耗材以上)
renderSecondtem(item, index) { renderSecondtem(item, index) {
let {superIndex} = this.props let { leftIndex } = this.props
let curTitCallBack='', curPlusCallBack='', curReduceCallBack='' let curTitCallBack = '', curPlusCallBack = '', curReduceCallBack = ''
if(superIndex === 1){ let curTit='', curTipOne='', curTipTwo='', curTipOneTit='', curTipTwoTit='', curIcon=''
if(leftIndex === 0){
curTit = 'template_name'
curTipOne = 'surgery_type_name'
curTipTwo = 'template_number'
curTipOneTit='手术类型'
curTipTwoTit='模板号'
curIcon='photos'
}else if(leftIndex === 1 || leftIndex === 2 || leftIndex === 3){
curTit = 'general_name'
curTipOne = 'specification'
curTipTwo = 'item_code'
curTipOneTit='规格型号'
curTipTwoTit='物料代码'
curIcon='photos'
}else{
// curTit = 'title'
// curTipOne = 'tip1'
// curTipTwo = 'tip2'
// curTipOneTit='提示1'
// curTipTwoTit='提示2'
// curIcon='imgIconArr'
}
if (leftIndex === 1) {
// 钉盒 // 钉盒
curTitCallBack=((item,index) => this.TitleClickEvent(item,index)) curTitCallBack = ((item, index) => this.TitleClickEvent(item, index))
curPlusCallBack = '' curPlusCallBack = ''
curReduceCallBack = '' curReduceCallBack = ''
}else if(superIndex === 2){ } else if (leftIndex === 2) {
// 器械包 // 器械包
curTitCallBack=((item,index) => this.TitleClickEvent(item,index)) curTitCallBack = ((item, index) => this.TitleClickEvent(item, index))
curPlusCallBack = '' curPlusCallBack = ''
curReduceCallBack = '' curReduceCallBack = ''
// if(item['childQuantity'] > 0) { // if(item['childQuantity'] > 0) {
...@@ -345,14 +384,14 @@ class ProductRightStyle extends Component { ...@@ -345,14 +384,14 @@ class ProductRightStyle extends Component {
// curPlusCallBack = ((item, index) => this.TitleClickEvent(item,index)) // curPlusCallBack = ((item, index) => this.TitleClickEvent(item,index))
// curReduceCallBack = (() => this.props.superReduceBack()) // curReduceCallBack = (() => this.props.superReduceBack())
// } // }
}else if(superIndex === 3){ } else if (leftIndex === 3) {
// 零散器械 // 零散器械
curTitCallBack='' curTitCallBack = ''
curPlusCallBack = '' curPlusCallBack = ''
curReduceCallBack = '' curReduceCallBack = ''
}else { } else {
curTitCallBack=((item,index) => this.TitleClickEvent(item,index)) curTitCallBack = ((item, index) => this.TitleClickEvent(item, index))
curPlusCallBack = ((item, index) => this.TitleClickEvent(item,index)) curPlusCallBack = ((item, index) => this.TitleClickEvent(item, index))
curReduceCallBack = (() => this.props.superReduceBack()) curReduceCallBack = (() => this.props.superReduceBack())
} }
return ( return (
...@@ -361,13 +400,14 @@ class ProductRightStyle extends Component { ...@@ -361,13 +400,14 @@ class ProductRightStyle extends Component {
listItem={item} listItem={item}
listIndex={index} listIndex={index}
calField={DEFAULT_FIELD} calField={DEFAULT_FIELD}
subCalCallBack={(item,index) => this.handleCalCallBack(item,index,'rightSecondData', DEFAULT_FIELD)} subCalCallBack={(item, index) => this.handleCalCallBack(item, index, 'rightSecondData', DEFAULT_FIELD)}
titCallBack={curTitCallBack} titCallBack={curTitCallBack}
titText={'title'} titText={curTit}
tipTextOne={'tip1'} tipTextOne={curTipOne}
tipTextTwo={'tip2'} tipTextTwo={curTipTwo}
// listImgIcon={'imgIcon'} tipTextOneTit={curTipOneTit}
listImgIcon={'imgIconArr'} tipTextTwoTit={curTipTwoTit}
listImgIcon={curIcon}
listPicType={'SQUARE'} listPicType={'SQUARE'}
plusCallBack={curPlusCallBack} plusCallBack={curPlusCallBack}
reduceCallBack={curReduceCallBack} reduceCallBack={curReduceCallBack}
...@@ -378,14 +418,14 @@ class ProductRightStyle extends Component { ...@@ -378,14 +418,14 @@ class ProductRightStyle extends Component {
// 返回右侧元素(单选耗材以上) // 返回右侧元素(单选耗材以上)
renderStencilStyle() { renderStencilStyle() {
return( return (
<View style={styles.stencil_cont}> <View style={styles.stencil_cont}>
<FlatList <FlatList
style={styles.cont_right_list} style={styles.cont_right_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.renderSecondtem(item, index)} renderItem={({ item, index }) => this.renderSecondtem(item, index)}
/> />
</View> </View>
) )
...@@ -399,7 +439,7 @@ class ProductRightStyle extends Component { ...@@ -399,7 +439,7 @@ class ProductRightStyle extends Component {
listItem={item} listItem={item}
listIndex={index} listIndex={index}
calField={DEFAULT_FIELD} calField={DEFAULT_FIELD}
subCalCallBack={(item,index) => this.handleCalCallBack(item,index,'rowSingleData')} subCalCallBack={(item, index) => this.handleCalCallBack(item, index, 'rowSingleData')}
titText={'title'} titText={'title'}
tipTextOne={'tip1'} tipTextOne={'tip1'}
tipTextTwo={'tip2'} tipTextTwo={'tip2'}
...@@ -411,15 +451,15 @@ class ProductRightStyle extends Component { ...@@ -411,15 +451,15 @@ class ProductRightStyle extends Component {
// 单选耗材 -- 小类 // 单选耗材 -- 小类
renderThridStyle() { renderThridStyle() {
let {rowSingleData} = this.state let { rowSingleData } = this.state
return( return (
<View style={styles.stencil_cont}> <View style={styles.stencil_cont}>
<FlatList <FlatList
style={styles.cont_thr_list} style={styles.cont_thr_list}
keyExtractor={item => item.id} keyExtractor={item => item.id}
data={rowSingleData} data={rowSingleData}
extraData={this.state} extraData={this.state}
renderItem={({item, index}) => this.renderThridItem(item, index)} renderItem={({ item, index }) => this.renderThridItem(item, index)}
/> />
</View> </View>
) )
...@@ -434,15 +474,13 @@ class ProductRightStyle extends Component { ...@@ -434,15 +474,13 @@ class ProductRightStyle extends Component {
listIndex={index} listIndex={index}
calField={DEFAULT_FIELD} calField={DEFAULT_FIELD}
listPicType={'ROUND'} listPicType={'ROUND'}
subCalCallBack={(item,index) => this.handleCalCallBack(item, index, 'rightSecondData', DEFAULT_FIELD)} subCalCallBack={(item, index) => this.handleCalCallBack(item, index, 'rightSecondData', DEFAULT_FIELD)}
titCallBack={(item,index) => this.TitleClickEvent(item, index)} titCallBack={(item, index) => this.TitleClickEvent(item, index)}
titText={'title'} titText={'category_name'}
// listImgIcon={'imgIcon'} tipTextOne={'category_code'}
// listImgIcon={'imgIconArr'} tipTextOneTit={'分类编码'}
tipTextOne={'tip1'} plusCallBack={(item, index) => this.handleAllPlusReduce(item, index, true)}
tipTextTwo={'tip2'} reduceCallBack={(item, index) => this.handleAllPlusReduce(item, index)}
plusCallBack={(item, index) => this.handleAllPlusReduce(item,index, true)}
reduceCallBack={(item, index) => this.handleAllPlusReduce(item,index)}
/> />
</SafeAreaView> </SafeAreaView>
) )
...@@ -450,14 +488,14 @@ class ProductRightStyle extends Component { ...@@ -450,14 +488,14 @@ class ProductRightStyle extends Component {
// 单选耗材 -- 大类 // 单选耗材 -- 大类
renderOtherStyle() { renderOtherStyle() {
return( return (
<View style={styles.cont_other_cont}> <View style={styles.cont_other_cont}>
<FlatList <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)}
/> />
</View> </View>
) )
...@@ -465,9 +503,9 @@ class ProductRightStyle extends Component { ...@@ -465,9 +503,9 @@ class ProductRightStyle extends Component {
// 返回右侧元素 // 返回右侧元素
renderRightCurrentStyle() { renderRightCurrentStyle() {
let { superIndex } = this.props let { leftIndex } = this.props
let { thridIsVisible } = this.state let { thridIsVisible } = this.state
if(superIndex >= 0 && superIndex < 4) { if (leftIndex >= 0 && leftIndex < 4) {
return this.renderStencilStyle() return this.renderStencilStyle()
} else { } else {
if (!thridIsVisible) { if (!thridIsVisible) {
...@@ -493,7 +531,7 @@ class ProductRightStyle extends Component { ...@@ -493,7 +531,7 @@ class ProductRightStyle extends Component {
<View style={styles.thr_icon_box}> <View style={styles.thr_icon_box}>
<Image source={require('../../../images/arr_left.png')} style={icon_style}></Image> <Image source={require('../../../images/arr_left.png')} style={icon_style}></Image>
</View> </View>
<Text style={styles.thr_head_tit}>{ curThridObj.title }</Text> <Text style={styles.thr_head_tit}>{curThridObj.title}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
{/* <PictureZoom {/* <PictureZoom
...@@ -510,12 +548,12 @@ class ProductRightStyle extends Component { ...@@ -510,12 +548,12 @@ class ProductRightStyle extends Component {
render() { render() {
return ( return (
<View style={styles.cont_right_box}> <View style={styles.cont_right_box}>
{ this.renderThrHeadStyle() } { this.renderThrHeadStyle()}
<ScrollView <ScrollView
style={styles.cont_right_scroll_cont} style={styles.cont_right_scroll_cont}
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
> >
{ this.renderRightCurrentStyle() } {this.renderRightCurrentStyle()}
</ScrollView> </ScrollView>
</View> </View>
) )
...@@ -577,9 +615,9 @@ const mapStateToProps = (state) => { ...@@ -577,9 +615,9 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { return {
// requestSelfOrganizations: (params) => { exitLoginStatus: () => {
// dispatch(requestSelfOrganizations(params)) dispatch(exitLoginStatus())
// } },
} }
} }
......
const local_photos = ['/jeecg-boot/sys/common/view/files/20200731/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20200731113857_1596166761793_1596184849964.jpg',
'/jeecg-boot/sys/common/view/files/20200921/5_1599645385381_1600672374371.jpg',
'/jeecg-boot/sys/common/view/files/20200921/4_1599645381425_1600672375091.jpg',
'/jeecg-boot/sys/common/view/files/20200921/3_1599645381259_1600672375488.jpg']
// 选择产品-供应商信息查询接口
const inter_1 = {
"error_code": 0,
"error_msg": "成功",
"data": [
{
"org_code": "",
"supplier_type": "MANUFACTURER",
"supplier_code": "SU00000235",
"supplier_name": "大博医疗科技股份有限公司",
"supplier_icon": "/img/logo.5b8eddb3.png",
"supplier_short_name": "大博医疗"
}, {
"org_code": "",
"supplier_type": "MANUFACTURER",
"supplier_code": "SU00000237",
"supplier_name": "山东威高集团医用高分子制品股份有限公司",
"supplier_icon": "/img/logo.5b8eddb3.png",
"supplier_short_name": "山东威高"
}, {
"org_code": "",
"supplier_type": "MANUFACTURER",
"supplier_code": "SU00000237",
"supplier_name": "嘉思特华剑医疗器材(天津)有限公司",
"supplier_icon": "/img/logo.5b8eddb3.png",
"supplier_short_name": "嘉思特"
}, {
"org_code": "",
"supplier_type": "MANUFACTURER",
"supplier_code": "SU00000237",
"supplier_name": "国药集团山西有限公司",
"supplier_icon": "/img/logo.5b8eddb3.png",
"supplier_short_name": "国药集团"
}, {
"org_code": "",
"supplier_type": "MANUFACTURER",
"supplier_code": "SU00000237",
"supplier_name": "国药集团山西有限公司器械分公司",
"supplier_icon": "/img/logo.5b8eddb3.png",
"supplier_short_name": "山西器械"
}, {
"org_code": "",
"supplier_type": "MANUFACTURER",
"supplier_code": "SU00000237",
"supplier_name": "国药集团山西物流有限公司",
"supplier_icon": "/img/logo.5b8eddb3.png",
"supplier_short_name": "山西物流"
}
]
}
// 选择产品-产品信息分类查询接口
const inter_2 = {
"error_code": 0,
"error_msg": "成功",
"data": {
// 上面四个为固定🧷
//单点耗材(此处只返回一级分类)
"item": [{
"category_code": "JSTH-01",
"category_name": "人工髋关节假体"
}, {
"category_code": "JSTH-02",
"category_name": "膝关节假体"
}, {
"category_code": "JSTH-03",
"category_name": "金属带锁髓内钉"
}, {
"category_code": "JSTH-04",
"category_name": "髋关节假体金属髋臼"
}
]
}
}
// 选择产品-手术模板头查询接口
const inter_3 = {
"error_code": 0,
"error_msg": "成功",
"data": {
//手术模板
"surgery_template": [
{
"org_id": "",
"template_number": "ST20200924001",
"template_name": "华森标准PFNA",
"template_desc": "主钉 刀片 锁钉,加长尾帽 PFNA器械",
"surgery_type": "JOINT",
"surgery_type_name": "关节",
"photos": local_photos
}, {
"org_id": "",
"template_number": "ST20200924002",
"template_name": "华森-尺桡骨骨折",
"template_desc": "",
"surgery_type": "TRAUMA",
"surgery_type_name": "创伤",
"photos": local_photos
}, {
"org_id": "",
"template_number": "ST20200924003",
"template_name": "大博右侧联合加压加长",
"template_desc": "上海丙文医疗器械销售中心",
"surgery_type": "TRAUMA",
"surgery_type_name": "创伤",
"photos": local_photos
}, {
"org_id": "",
"template_number": "ST20200924004",
"template_name": "爱康右侧GT",
"template_desc": "右侧股骨髁8个(1.5-6) 胫骨托 10个(A-G) 垫片 16个(8 10 12 14)膝关节工具股骨侧+胫骨侧共两箱",
"surgery_type": "JOINT",
"surgery_type_name": "关节",
"photos": local_photos
}, {
"org_id": "",
"template_number": "ST20200924005",
"template_name": "大博肱骨多维左侧",
"template_desc": "大博肱骨多维左侧*-器械",
"surgery_type": "TRAUMA",
"surgery_type_name": "创伤",
"photos": local_photos
},
]
}
}
// 选择产品-手术模板行查询接口
const inter_4 = {
"error_code": 0,
"error_msg": "成功",
"data": {
//普通耗材
"items": [{
"item_code": "3001202007000098",
"item_name": "042150038",
"general_name": "金属接骨螺钉",
"specification": "全螺牙松质骨螺钉 DTQ06-FT φ4.0×50mm",
"manufacturer_product_code": "",
quantity: 2,
"photos": local_photos
}, {
"item_code": "3001202010006127",
"item_name": "042150050",
"general_name": "金属接骨螺钉",
"specification": "全螺牙松质骨螺钉 DTQ06-FT φ4.0×38mm",
"manufacturer_product_code": "",
quantity: 3,
"photos": local_photos
}, {
"item_code": "3001202010006128",
"item_name": "042150050",
"general_name": "金属接骨螺钉",
"specification": "全螺牙松质骨螺钉 DTQ06-FT φ4.0×26mm",
"manufacturer_product_code": "",
quantity: 1,
"photos": local_photos
}, {
"item_code": "3001202010006113",
"item_name": "栓子16(PE)",
"general_name": "人工髋关节假体",
"specification": "栓子JS-CSO PE 16",
"manufacturer_product_code": "",
quantity: 0,
"photos": local_photos
}, {
"item_code": "3001202010006114",
"item_name": "栓子13(PE)",
"general_name": "人工髋关节假体",
"specification": "栓子JS-CSO PE 13",
"manufacturer_product_code": "",
quantity: 0,
"photos": local_photos
}],
//螺钉盒
"nail_box": [
{
"item_code": "GYSX00000003",
"item_name": "大骨块成套手术器械包-内附属钉盒",
"general_name": "大骨块成套手术器械包-内附属钉盒",
"manufacturer_product_code": "",
quantity: 0,
"photos": local_photos
}, {
"item_code": "GYSX00000004",
"item_name": "小骨块成套手术器械包-内附属钉盒",
"general_name": "小骨块成套手术器械包-内附属钉盒",
"manufacturer_product_code": "",
quantity: 1,
"photos": local_photos
}, {
"item_code": "GYSX00000005",
"item_name": "上肢锁定钉盒II型",
"general_name": "上肢锁定钉盒II型",
"manufacturer_product_code": "",
quantity: 1,
"photos": local_photos
},
],
//器械包
"item_package": [
{
"item_code": "GYSX110000001",
"item_name": "上肢器械包",
"general_name": "上肢器械包",
"specification": "12",
quantity: 1,
"photos": local_photos
}, {
"item_code": "GYSX220000002",
"item_name": "下肢器械包",
"general_name": "下肢器械包",
"specification": "12L",
quantity: 1,
"photos": local_photos
}, {
"item_code": "GYSX330000003",
"item_name": "足踝手术器械包",
"general_name": "足踝手术器械包",
"specification": "JC",
quantity: 0,
"photos": local_photos
}
],
//零散器械
"tool": [
{
"item_code": "GYSXQX00000007",
"item_name": "下肢锁定器械_导针测深器",
"general_name": "下肢锁定器械_导针测深器",
"specification": "L:250.230",
"manufacturer_product_code": "",
quantity: 2,
"photos": local_photos,
},
{
"item_code": "GYSXQX00000006",
"item_name": "III型伽玛型髓内钉通用工具_防旋杆",
"general_name": "III型伽玛型髓内钉通用工具_防旋杆",
quantity: 0,
"specification": "",
"photos": local_photos,
},
{
"item_code": "GYSXQX00000005",
"item_name": "空心钉工具包(4.0型)",
"general_name": "空心钉工具包(4.0型)",
quantity: 0,
"specification": "4.0型",
"photos": local_photos,
}
]
}
}
// 选择产品-螺钉盒头查询接口
const inter_5 = {
"error_code": 0,
"error_msg": "成功",
"data": {
"items": [
{
"item_code": "GYSX000000011",
"item_name": "大骨块成套手术器械包-内附属钉盒",
"general_name": "大骨块成套手术器械包-内附属钉盒",
"specification": "12",
"serial_number": "30012020120400001",
"inv_code": "",
"photos": local_photos
}, {
"item_code": "GYSX000000021",
"item_name": "小骨块成套手术器械包-内附属钉盒",
"general_name": "小骨块成套手术器械包-内附属钉盒",
"specification": "12",
"serial_number": "30012020120400002",
"inv_code": "",
"photos": local_photos
}, {
"item_code": "GYSX000000032",
"item_name": "上肢锁定钉盒II型",
"general_name": "上肢锁定钉盒II型",
"specification": "12",
"serial_number": "30012020120400003",
"inv_code": "",
"photos": local_photos
}
]
}
}
// 选择产品-器械包头查询接口
const inter_55 = {
"error_code": 0,
"error_msg": "成功",
"data": {
"items": [
{
"item_code": "GYSX000000001",
"item_name": "上肢器械包",
"general_name": "上肢器械包",
"specification": "12",
"serial_number": "30012020120400001",
"inv_code": "",
"photos": local_photos
}, {
"item_code": "GYSX000000001",
"item_name": "下肢器械包",
"general_name": "下肢器械包",
"specification": "12L",
"serial_number": "30012020120400002",
"inv_code": "",
"photos": local_photos
}, {
"item_code": "GYSX000000002",
"item_name": "足踝手术器械包",
"general_name": "足踝手术器械包",
"specification": "JC",
"serial_number": "30012020120400003",
"inv_code": "",
"photos": local_photos
}
]
}
}
// 选择产品-螺钉盒明细查询接口
const inter_6 = //当钉盒可视化时,分区域展示
{
"error_code": 0,
"error_msg": "成功",
"data": {
"photos": local_photos,
"segemt": [
{
"segment_code": "HB4.0-QY",
"segment_name": "HB4.0松质螺钉(全牙)",
"details": [{
"item_code": "GYSXQX01100007",
"item_name": "HB4.0-12松质螺钉(全牙)",
"general_name": "HB4.0-12松质螺钉(全牙)",
"specification": "L12",
"quantity": "4",
}, {
"item_code": "GYSXQX02200008",
"item_name": "HB4.0-14松质螺钉(全牙)",
"general_name": "HB4.0-14松质螺钉(全牙)",
"specification": "L14",
"quantity": "2",
}]
},
{
"segment_code": "HA3.5-PD",
"segment_name": "HA3.5-皮质螺钉",
"details": [{
"item_code": "GYSXQX00011008",
"item_name": "锁定螺钉Φ3.5(梅花自攻)",
"general_name": "锁定螺钉Φ3.5(梅花自攻)",
"specification": "Φ3.5×22",
"quantity": "2",
}, {
"item_code": "GYSXQX00022008",
"item_name": "锁定螺钉Φ3.5(梅花自攻)",
"general_name": "锁定螺钉Φ3.5(梅花自攻)",
"specification": "Φ3.5×30",
"quantity": "2",
}, {
"item_code": "GYSXQX00033008",
"item_name": "锁定螺钉Φ3.5(梅花自攻)",
"general_name": "锁定螺钉Φ3.5(梅花自攻)",
"specification": "Φ3.5×45",
"quantity": "1",
}]
},
]
}
}
//当钉盒未可视化,仅在inv_item_package配套
const inter_66 = {
"error_code": 0,
"error_msg": "成功",
"data": {
"photos": local_photos,
"segemt": [
{
"segment_code": "",
"segment_name": "全部",
"details": [{
"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",
}]
}
]
}
}
// 选择产品-器械包明细查询接口
const inter_7 = {
"error_code": 0,
"error_msg": "成功",
"data": {
"item_code": "SPH2000091209",
"package_components": [
{
"item_code": "GYSXQX01100002",
"quantity": 2,
"category_name": "一类医疗器械",
"category_code": "12",
"specification": "",
"item_name": "SKI膝关节器械",
"unit": "个",
"category_desc": "单件可重复使用的器械",
"general_name": "膝关节手术工具",
"start_date": "2020-10-27T18:46:21"
},
{
"item_code": "GYSXQX02200003",
"quantity": 3,
"category_name": "一类医疗器械",
"category_code": "12",
"specification": "",
"item_name": "HARMONY全髋器械",
"unit": "个",
"category_desc": "单件可重复使用的器械",
"general_name": "人工髋关节手术工具(箱)",
"start_date": "2020-10-27T18:46:21"
},
{
"item_code": "GYSXQX00330004",
"quantity": 2,
"category_name": "一类医疗器械",
"category_code": "12",
"specification": "",
"item_name": "SKII膝关节器械",
"unit": "个",
"category_desc": "单件可重复使用的器械",
"general_name": "膝关节手术工具",
"start_date": "2020-10-27T18:46:21"
}
],
"serial_number": "3001202009000006",
"parent_item_code": "SPH2000091209",
"component_quantity": 2
}
}
// 选择产品-零散器械查询接口
const inter_8 = {
"error_code": 0,
"error_msg": "成功",
"data": {
"tools": [
{
"item_code": "GYSXQX02201103",
"item_name": "下肢锁定器械_导针测深器",
"general_name": "下肢锁定器械_导针测深器",
"specification": "L:250.230",
"quantity": 0,
"photos": local_photos
}, {
"item_code": "GYSXQX02202203",
"item_name": "III型伽玛型髓内钉通用工具_防旋杆",
"general_name": "III型伽玛型髓内钉通用工具_防旋杆",
"specification": "L:250.230",
"quantity": 0,
"photos": local_photos
}, {
"item_code": "GYSXQX02203303",
"item_name": "RSL专用工具",
"general_name": "人工髋关节翻修手术工具(箱)",
"specification": "QX-KS-01 560X275X127",
"quantity": 0,
"photos": local_photos
}
]
}
}
// 选择产品-单点耗材查询接口
const inter_9 = //大-中-小类
{
"error_code": 0,
"error_msg": "成功",
"data":
[{
"category_code": "JSTH-01-01",
"category_name": "股骨头",
"details": [
{
"item_code": "GYSX2010006120",
"item_name": "金属接骨螺钉HBQ6.0X30",
"general_name": "金属接骨螺钉HBQ6.0X30",
"specification": "",
"manufacturer_product_code": "",
"quantity": 0,
"photos": local_photos
}, {
"item_code": "GYSX2010006121",
"item_name": "金属接骨螺钉6.0X26(T)",
"general_name": "金属接骨螺钉6.0X26(T)",
"specification": "",
"quantity": 0,
"photos": local_photos
}
]
}, {
"category_code": "JSTH-01-02",
"category_name": "中置器",
"details": [
{
"item_code": "GYSX2010006122",
"item_name": "栓子16(PE)",
"general_name": "人工髋关节假体",
"specification": "栓子JS-CSO PE 16",
"quantity": 0,
"photos": local_photos
}, {
"item_code": "GYSX2010006125",
"item_name": "栓子13(PE)",
"general_name": "人工髋关节假体",
"specification": "栓子JS-CSO PE 13",
"quantity": 0,
"photos": local_photos
}
]
}
]
}
//大-小类
const inter_99 = {
"error_code": 0,
"error_msg": "成功",
"data": {
"details": [
{
"item_code": "GYSX2010006120",
"item_name": "金属接骨螺钉HBQ6.0X30",
"general_name": "金属接骨螺钉HBQ6.0X30",
"specification": "",
"manufacturer_product_code": "",
"quantity": 0,
"photos": local_photos
}, {
"item_code": "GYSX2010006121",
"item_name": "金属接骨螺钉6.0X26(T)",
"general_name": "金属接骨螺钉6.0X26(T)",
"specification": "",
"quantity": 0,
"photos": local_photos
}, {
"item_code": "GYSX2010006128",
"item_name": "金属接骨螺钉6.0X36(T)",
"general_name": "金属接骨螺钉6.0X36(T)",
"specification": "",
"quantity": 0,
"photos": local_photos
}, {
"item_code": "GYSX2010006129",
"item_name": "金属接骨螺钉6.0X38(T)",
"general_name": "金属接骨螺钉6.0X38(T)",
"specification": "",
"quantity": 0,
"photos": local_photos
}
]
}
}
export default{
inter_1,
inter_2,
inter_3,
inter_4,
inter_5,
inter_55,
inter_6,
inter_66,
inter_7,
inter_8,
inter_9,
inter_99
}
\ No newline at end of file
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