Commit dc87fb35 by lhc

feat: 添加customer_code

parent a311bae1
This diff could not be displayed because it is too large.
...@@ -300,6 +300,7 @@ class ChooseProductPage extends Component { ...@@ -300,6 +300,7 @@ class ChooseProductPage extends Component {
if (navigation.state.params.selfData) { if (navigation.state.params.selfData) {
cur_org_code = navigation.state.params.selfData.org_code cur_org_code = navigation.state.params.selfData.org_code
cur_doctor_name = navigation.state.params.selfData.doctor_name cur_doctor_name = navigation.state.params.selfData.doctor_name
customer_code = navigation.state.params.selfData.customer_code
} }
let topItem = topProcOptionList[topActiveIndex] let topItem = topProcOptionList[topActiveIndex]
if (leftIndex === 0) { if (leftIndex === 0) {
...@@ -307,6 +308,7 @@ class ChooseProductPage extends Component { ...@@ -307,6 +308,7 @@ class ChooseProductPage extends Component {
access_token: token, access_token: token,
org_code: cur_org_code, org_code: cur_org_code,
manufacturer_code: topItem.supplier_code, manufacturer_code: topItem.supplier_code,
customer_code,
// doctor_name: cur_doctor_name // doctor_name: cur_doctor_name
} }
console.log('params=', params) console.log('params=', params)
...@@ -343,6 +345,7 @@ class ChooseProductPage extends Component { ...@@ -343,6 +345,7 @@ class ChooseProductPage extends Component {
access_token: token, access_token: token,
manufacturer_code: topItem.supplier_code, manufacturer_code: topItem.supplier_code,
category_code: cur_category_code, category_code: cur_category_code,
customer_code,
} }
console.log('params=', params) console.log('params=', params)
let nail_equip_head_search = await reqNailEquipHeadSearch(global_domain_config, params) let nail_equip_head_search = await reqNailEquipHeadSearch(global_domain_config, params)
...@@ -372,6 +375,7 @@ class ChooseProductPage extends Component { ...@@ -372,6 +375,7 @@ class ChooseProductPage extends Component {
let params = { let params = {
access_token: token, access_token: token,
manufacturer_code: topItem.supplier_code, manufacturer_code: topItem.supplier_code,
customer_code,
} }
console.log('params=', params) console.log('params=', params)
let scat_head_search = await reqScatEquipmentSearch(global_domain_config, params) let scat_head_search = await reqScatEquipmentSearch(global_domain_config, params)
...@@ -404,6 +408,7 @@ class ChooseProductPage extends Component { ...@@ -404,6 +408,7 @@ class ChooseProductPage extends Component {
manufacturer_code: topItem.supplier_code, manufacturer_code: topItem.supplier_code,
org_code: cur_org_code, org_code: cur_org_code,
leftIndex: leftIndex, // 测试 leftIndex: leftIndex, // 测试
customer_code,
} }
console.log('params=', params) console.log('params=', params)
let single_all_search = await reqSingleConsumSearch(global_domain_config, params) let single_all_search = await reqSingleConsumSearch(global_domain_config, params)
...@@ -898,6 +903,7 @@ class ChooseProductPage extends Component { ...@@ -898,6 +903,7 @@ class ChooseProductPage extends Component {
selfData: { selfData: {
org_code: cur_org_code, org_code: cur_org_code,
authorizations, authorizations,
customer_code: navigation.state.params.selfData.customer_code,
}, },
}) })
}} }}
......
import React, { Component } from 'react'; import React, { Component } from 'react'
import { View, StyleSheet, SafeAreaView, ScrollView, FlatList, Text } from 'react-native'; import { View, StyleSheet, SafeAreaView, ScrollView, FlatList, Text } 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 {
import { FooterBtnStyle, PicListNoData } from '../../common/CellTextStyle'; home_background_color,
import StatusBarView from '../../common/StatusBarView'; foundation_color,
import ChooseCardList from '../../common/listDataComponent/ChooseCardList'; promary_color,
import PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu'; third_text_color,
import PictureZoom from '../../common/listDataComponent/PictureZoom'; first_text_color,
import { cloneObject, show } from '../../../utils/Utils'; second_text_size,
import { reqSurTempLineSearch, reqNailBoxLineSearch, reqEquipPackageLineSearch, reqNailAndEquipSearch } from '../../../action/SelfAction'; Width,
import LoadingModel from '../../common/listDataComponent/LoadingModel'; pxSize,
import LocalVariable from '../../common/LocalVariable'; safe_view,
import { exitLoginStatus } from '../../../action/LoginAction'; font_family_semibold,
font_family_light,
} from '../../../base/BaseStyle'
import { FooterBtnStyle, PicListNoData } from '../../common/CellTextStyle'
import StatusBarView from '../../common/StatusBarView'
import ChooseCardList from '../../common/listDataComponent/ChooseCardList'
import PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu'
import PictureZoom from '../../common/listDataComponent/PictureZoom'
import { cloneObject, show } from '../../../utils/Utils'
import {
reqSurTempLineSearch,
reqNailBoxLineSearch,
reqEquipPackageLineSearch,
reqNailAndEquipSearch,
} from '../../../action/SelfAction'
import LoadingModel from '../../common/listDataComponent/LoadingModel'
import LocalVariable from '../../common/LocalVariable'
import { exitLoginStatus } from '../../../action/LoginAction'
class EditThirdLevelPage extends Component { class EditThirdLevelPage extends Component {
constructor(props) {
constructor(props) { super(props)
super(props); this.state = {
this.state = { topProcOptionList: [],
topProcOptionList: [], topActiveIndex: 0,
topActiveIndex: 0, onlyShow: false, // 只展示
onlyShow: false, // 只展示 onlySignSelect: false, // 单选
onlySignSelect: false, // 单选 defalutTopItem: [
defalutTopItem: [{ // 手术套包显示 {
"category_code": LocalVariable.SIGN_SELECT_CONSUMABLES, // 手术套包显示
"category_name": "耗材" category_code: LocalVariable.SIGN_SELECT_CONSUMABLES,
}, { category_name: '耗材',
"category_code": LocalVariable.NAIL_BOX, },
"category_name": "钉盒", {
"cate_local_icon": require('../../../images/screw_box.png') category_code: LocalVariable.NAIL_BOX,
}, { category_name: '钉盒',
"category_code": LocalVariable.EQUIPMENT_BAG, cate_local_icon: require('../../../images/screw_box.png'),
"category_name": "器械包", },
"cate_local_icon": require('../../../images/equip_bag.png') {
}, { category_code: LocalVariable.EQUIPMENT_BAG,
"category_code": LocalVariable.SCATTERED_EQUIPMENT, category_name: '器械包',
"category_name": "零散器械", cate_local_icon: require('../../../images/equip_bag.png'),
"cate_local_icon": require('../../../images/auxili_tool.png') },
}], {
superData: {} category_code: LocalVariable.SCATTERED_EQUIPMENT,
} category_name: '零散器械',
cate_local_icon: require('../../../images/auxili_tool.png'),
},
],
superData: {},
} }
}
componentDidMount() { componentDidMount() {
this.initGetData() this.initGetData()
} }
// 初始化获取数据 // 初始化获取数据
async initGetData() { async initGetData() {
let that = this let that = this
let { superData } = that.props.navigation.state.params let { superData, customer_code } = that.props.navigation.state.params
let { token, global_domain_config } = that.props let { token, global_domain_config } = that.props
let { defalutTopItem, topProcOptionList } = that.state let { defalutTopItem, topProcOptionList } = that.state
let { leftIndex, superItem } = superData let { leftIndex, superItem } = superData
that.refs.LoadingModel.show() that.refs.LoadingModel.show()
that.setState({ that.setState({
superData: cloneObject(superData) superData: cloneObject(superData),
}) })
if (leftIndex === 0) { if (leftIndex === 0) {
let params = { let params = {
access_token: token, access_token: token,
template_number: superItem.template_number template_number: superItem.template_number,
} customer_code,
let sur_line_search = await reqSurTempLineSearch(global_domain_config, params) }
console.log('res_line_1 : ', sur_line_search) let sur_line_search = await reqSurTempLineSearch(global_domain_config, params)
if (sur_line_search.error_code === 0) { console.log('res_line_1 : ', sur_line_search)
let { data } = sur_line_search if (sur_line_search.error_code === 0) {
topProcOptionList = cloneObject(defalutTopItem) let { data } = sur_line_search
topProcOptionList.forEach(function (topIt) { topProcOptionList = cloneObject(defalutTopItem)
topIt[LocalVariable.LOCAL_THRID_CONT_DATA] = [] topProcOptionList.forEach(function (topIt) {
topIt[LocalVariable.SELECTED_DATA_ARR] = [] topIt[LocalVariable.LOCAL_THRID_CONT_DATA] = []
topIt[LocalVariable.SELECTED_QUQNTITY] = 0 topIt[LocalVariable.SELECTED_DATA_ARR] = []
}) topIt[LocalVariable.SELECTED_QUQNTITY] = 0
if (data.items) { })
topProcOptionList[0].localThridContData = data.items if (data.items) {
} topProcOptionList[0].localThridContData = data.items
if (data.nail_box) { }
topProcOptionList[1].localThridContData = data.nail_box if (data.nail_box) {
} topProcOptionList[1].localThridContData = data.nail_box
if (data.item_package) { }
topProcOptionList[2].localThridContData = data.item_package if (data.item_package) {
} topProcOptionList[2].localThridContData = data.item_package
if (data.tool) { }
topProcOptionList[3].localThridContData = data.tool if (data.tool) {
} topProcOptionList[3].localThridContData = data.tool
that.setState({ }
topProcOptionList: topProcOptionList that.setState(
}, () => { {
that.refs.LoadingModel.hide() topProcOptionList: topProcOptionList,
that.setAllSelectData() },
}) () => {
} else { that.refs.LoadingModel.hide()
that.showRrrorTip(sur_line_search) that.setAllSelectData()
} },
} else if (leftIndex === 1) { )
// let params = { } else {
// access_token: token, that.showRrrorTip(sur_line_search)
// nail_box_code: superItem.item_code, }
// nail_box_serial_number: superItem.serial_number, } else if (leftIndex === 1) {
// inv_code: superItem.inv_code // let params = {
// } // access_token: token,
// let nail_line_search = await reqNailBoxLineSearch(global_domain_config, params) // nail_box_code: superItem.item_code,
// nail_box_serial_number: superItem.serial_number,
// inv_code: superItem.inv_code
// }
// let nail_line_search = await reqNailBoxLineSearch(global_domain_config, params)
let params = { let params = {
access_token: token, access_token: token,
item_code: superItem.item_code, item_code: superItem.item_code,
serial_number: superItem.serial_number, serial_number: superItem.serial_number,
inv_code: superItem.inv_code, inv_code: superItem.inv_code,
nail_box_flag: 'N' nail_box_flag: 'N',
}
let nail_line_search = await reqNailAndEquipSearch(global_domain_config, params)
console.log('res_line_1 : ', nail_line_search)
if (nail_line_search.error_code === 0) {
let { data } = nail_line_search
if (data.segemt && data.segemt.length > 0) {
data.segemt.forEach(function (seg_it) {
if (seg_it.segment_code == '0') {
seg_it.segment_name = '默认区域'
} }
let nail_line_search = await reqNailAndEquipSearch(global_domain_config, params) })
console.log('res_line_1 : ', nail_line_search) }
if (nail_line_search.error_code === 0) { topProcOptionList = cloneObject(data.segemt)
let { data } = nail_line_search topProcOptionList.forEach(function (topIt) {
if (data.segemt && data.segemt.length > 0) { topIt[LocalVariable.LOCAL_THRID_CONT_DATA] = topIt['details']
data.segemt.forEach(function (seg_it) { topIt[LocalVariable.SELECTED_DATA_ARR] = []
if (seg_it.segment_code == "0") { topIt[LocalVariable.SELECTED_QUQNTITY] = 0
seg_it.segment_name = "默认区域" })
} that.setState(
}) {
} topProcOptionList: topProcOptionList,
topProcOptionList = cloneObject(data.segemt) onlyShow: true,
topProcOptionList.forEach(function (topIt) { },
topIt[LocalVariable.LOCAL_THRID_CONT_DATA] = topIt['details'] () => {
topIt[LocalVariable.SELECTED_DATA_ARR] = [] that.refs.LoadingModel.hide()
topIt[LocalVariable.SELECTED_QUQNTITY] = 0 that.setAllSelectData()
}) },
that.setState({ )
topProcOptionList: topProcOptionList, } else {
onlyShow: true that.showRrrorTip(nail_line_search)
}, () => { }
that.refs.LoadingModel.hide() } else if (leftIndex === 2) {
that.setAllSelectData() // let params = {
}) // access_token: token,
} else { // inv_code: superItem.inv_code,
that.showRrrorTip(nail_line_search) // item_code: superItem.item_code,
} // serial_number: superItem.serial_number,
} else if (leftIndex === 2) { // start_index: 1,
// let params = { // limit: 1000
// access_token: token, // }
// inv_code: superItem.inv_code, // let equip_line_search = await reqEquipPackageLineSearch(global_domain_config, params)
// item_code: superItem.item_code,
// serial_number: superItem.serial_number,
// start_index: 1,
// limit: 1000
// }
// let equip_line_search = await reqEquipPackageLineSearch(global_domain_config, params)
let params = { let params = {
access_token: token, access_token: token,
item_code: superItem.item_code, item_code: superItem.item_code,
serial_number: superItem.serial_number, serial_number: superItem.serial_number,
inv_code: superItem.inv_code, inv_code: superItem.inv_code,
nail_box_flag: 'N' nail_box_flag: 'N',
} }
let equip_line_search = await reqNailAndEquipSearch(global_domain_config, params) let equip_line_search = await reqNailAndEquipSearch(global_domain_config, params)
console.log('res_line_1 : ', equip_line_search) console.log('res_line_1 : ', equip_line_search)
if (equip_line_search.error_code === 0) { if (equip_line_search.error_code === 0) {
let { data } = equip_line_search let { data } = equip_line_search
// data[LocalVariable.LOCAL_THRID_CONT_DATA] = data['package_components'] // data[LocalVariable.LOCAL_THRID_CONT_DATA] = data['package_components']
// data[LocalVariable.SELECTED_DATA_ARR] = [] // data[LocalVariable.SELECTED_DATA_ARR] = []
// data[LocalVariable.SELECTED_QUQNTITY] = 0 // data[LocalVariable.SELECTED_QUQNTITY] = 0
// topProcOptionList[0] = cloneObject(data) // topProcOptionList[0] = cloneObject(data)
if (data.segemt && data.segemt.length > 0) { if (data.segemt && data.segemt.length > 0) {
data.segemt.forEach(function (seg_it) { data.segemt.forEach(function (seg_it) {
if (seg_it.segment_code == "0") { if (seg_it.segment_code == '0') {
seg_it.segment_name = "未分层器械" seg_it.segment_name = '未分层器械'
} else {
seg_it.segment_name = `第 ${seg_it.segment_code} 层器械`
}
})
}
topProcOptionList = cloneObject(data.segemt)
topProcOptionList.forEach(function (topIt) {
topIt[LocalVariable.LOCAL_THRID_CONT_DATA] = topIt['details']
topIt[LocalVariable.SELECTED_DATA_ARR] = []
topIt[LocalVariable.SELECTED_QUQNTITY] = 0
})
that.setState({
topProcOptionList: topProcOptionList,
onlyShow: true
}, () => {
that.refs.LoadingModel.hide()
that.setAllSelectData()
})
} else { } else {
that.showRrrorTip(equip_line_search) seg_it.segment_name = `第 ${seg_it.segment_code} 层器械`
} }
})
} }
topProcOptionList = cloneObject(data.segemt)
topProcOptionList.forEach(function (topIt) {
topIt[LocalVariable.LOCAL_THRID_CONT_DATA] = topIt['details']
topIt[LocalVariable.SELECTED_DATA_ARR] = []
topIt[LocalVariable.SELECTED_QUQNTITY] = 0
})
that.setState(
{
topProcOptionList: topProcOptionList,
onlyShow: true,
},
() => {
that.refs.LoadingModel.hide()
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 that = this let that = this
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({
topProcOptionList
}, () => {
that.setAllSelectData()
})
} }
})
that.setState(
{
topProcOptionList,
},
() => {
that.setAllSelectData()
},
)
} }
}
// 设置当前所有已选值 // 设置当前所有已选值
setAllSelectData() { setAllSelectData() {
let { topProcOptionList } = this.state let { topProcOptionList } = this.state
topProcOptionList.map(function (listItem) { topProcOptionList.map(function (listItem) {
listItem[LocalVariable.SELECTED_QUQNTITY] = 0 listItem[LocalVariable.SELECTED_QUQNTITY] = 0
listItem[LocalVariable.SELECTED_DATA_ARR] = [] listItem[LocalVariable.SELECTED_DATA_ARR] = []
if (listItem[LocalVariable.LOCAL_THRID_CONT_DATA].length) { if (listItem[LocalVariable.LOCAL_THRID_CONT_DATA].length) {
listItem[LocalVariable.LOCAL_THRID_CONT_DATA].forEach(function (chItem) { listItem[LocalVariable.LOCAL_THRID_CONT_DATA].forEach(function (chItem) {
if (chItem[LocalVariable.QUANTITY_FIELD]) { if (chItem[LocalVariable.QUANTITY_FIELD]) {
listItem[LocalVariable.SELECTED_QUQNTITY] += Number(chItem[LocalVariable.QUANTITY_FIELD]) listItem[LocalVariable.SELECTED_QUQNTITY] += Number(chItem[LocalVariable.QUANTITY_FIELD])
listItem[LocalVariable.SELECTED_DATA_ARR].push(chItem) listItem[LocalVariable.SELECTED_DATA_ARR].push(chItem)
} }
})
}
}) })
this.setState({ }
topProcOptionList })
}) this.setState({
} topProcOptionList,
})
}
// 点击顶部菜单 // 点击顶部菜单
handleTopNav(item, index) { handleTopNav(item, index) {
this.setState({ this.setState({
topActiveIndex: index topActiveIndex: index,
}) })
} }
// 点击编辑完成 // 点击编辑完成
handleSubmit() { handleSubmit() {
let { topProcOptionList, superData } = this.state let { topProcOptionList, superData } = this.state
let { params } = this.props.navigation.state let { params } = this.props.navigation.state
params.childrenPageCallBack(topProcOptionList, superData.superIndex) params.childrenPageCallBack(topProcOptionList, superData.superIndex)
this.props.navigation.goBack() this.props.navigation.goBack()
} }
// 接口错误提示 // 接口错误提示
showRrrorTip(result) { showRrrorTip(result) {
this.refs.LoadingModel.hide() this.refs.LoadingModel.hide()
if (result.error_code == 41006) { if (result.error_code == 41006) {
show('登录过期,请重新登录'); show('登录过期,请重新登录')
this.props.exitLoginStatus(); this.props.exitLoginStatus()
} else { } else {
let error_msg = result.error_msg || result.message let error_msg = result.error_msg || result.message
show(error_msg); show(error_msg)
}
} }
}
// 返回顶部编辑选项 // 返回顶部编辑选项
renderTopProItem() { renderTopProItem() {
let { topProcOptionList, topActiveIndex, superData } = this.state let { topProcOptionList, topActiveIndex, superData } = this.state
let { leftIndex } = superData let { leftIndex } = superData
let curTit = '', curTopList = topProcOptionList let curTit = '',
if (leftIndex === 0) { curTopList = topProcOptionList
curTit = 'category_name' if (leftIndex === 0) {
} else if (leftIndex === 1 || leftIndex === 2) { curTit = 'category_name'
curTit = 'segment_name' } else if (leftIndex === 1 || leftIndex === 2) {
} curTit = 'segment_name'
return (
<ChooseCardList
cardStyleBox={styles.top_box}
cardStyleScroll={styles.top_scroll_cont}
cardScrollEnabled={true}
cardHorizontal={true}
cardShowsHorizontalScrollIndicator={false}
cardStyleListItem={styles.top_inner}
cardStyleListItemAct={styles.top_inner_act}
cardStyleItemTit={styles.top_tit}
cardStyleItemTitAct={styles.top_tit_act}
cardListOptions={curTopList}
cardItemTitle={curTit}
curActIndex={topActiveIndex}
cardCallBack={(item, index) => this.handleTopNav(item, index)}
cardCountName={LocalVariable.SELECTED_QUQNTITY}
cardStyleType={'DEFAULT'}
/>
)
} }
return (
<ChooseCardList
cardStyleBox={styles.top_box}
cardStyleScroll={styles.top_scroll_cont}
cardScrollEnabled={true}
cardHorizontal={true}
cardShowsHorizontalScrollIndicator={false}
cardStyleListItem={styles.top_inner}
cardStyleListItemAct={styles.top_inner_act}
cardStyleItemTit={styles.top_tit}
cardStyleItemTitAct={styles.top_tit_act}
cardListOptions={curTopList}
cardItemTitle={curTit}
curActIndex={topActiveIndex}
cardCallBack={(item, index) => this.handleTopNav(item, index)}
cardCountName={LocalVariable.SELECTED_QUQNTITY}
cardStyleType={'DEFAULT'}
/>
)
}
// 返回底部主要元素 // 返回底部主要元素
renderContItem() { renderContItem() {
let { topProcOptionList, topActiveIndex } = this.state let { topProcOptionList, topActiveIndex } = this.state
let localThridContData = [] let localThridContData = []
let imgIconArr = '' let imgIconArr = ''
let topItem = topProcOptionList[topActiveIndex] let topItem = topProcOptionList[topActiveIndex]
if (topItem) { if (topItem) {
localThridContData = topItem[LocalVariable.LOCAL_THRID_CONT_DATA] localThridContData = topItem[LocalVariable.LOCAL_THRID_CONT_DATA]
} }
return ( return (
<View style={styles.edit_cont}> <View style={styles.edit_cont}>
{ imgIconArr ? <PictureZoom {imgIconArr ? (
listImageIndex={0} <PictureZoom
listImageUrls={imgIconArr} listImageIndex={0}
listStyleImage={styles.thr_head_tit_img} listImageUrls={imgIconArr}
listPicType={'RECTANGLE'} listStyleImage={styles.thr_head_tit_img}
/> : null} listPicType={'RECTANGLE'}
<ScrollView />
style={styles.edit_scroll_cont} ) : null}
showsVerticalScrollIndicator={false} <ScrollView style={styles.edit_scroll_cont} showsVerticalScrollIndicator={false}>
> {localThridContData.length > 0 ? (
{localThridContData.length > 0 ? <FlatList
<FlatList style={styles.edit_list}
style={styles.edit_list} 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)} />
/> : <PicListNoData /> ) : (
} <PicListNoData />
</ScrollView> )}
</ScrollView>
{ this.renderLodingItem()} {this.renderLodingItem()}
</View>
)
}
</View> // 返回每一列元素
) renderContColumnItem(item, index) {
let { onlyShow, onlySignSelect, topActiveIndex, superData } = this.state
let { leftIndex } = superData
let curTit = '',
curTipStr = '',
curTipOne = '',
curTipTwo = '',
curCalField = '',
curImgIcon = ''
let curTxtTit = '',
curTipStrTit = '',
curTipOneTit = '',
curTipTwoTit = ''
if (leftIndex === 0) {
if (topActiveIndex === 0 || topActiveIndex === 3) {
curTit = 'manufacturer_product_code'
curTipStr = 'item_name'
curTipOne = 'general_name'
curTipTwo = 'specification'
curTxtTit = '厂家产品代码'
curTipStrTit = '物料名称'
curTipOneTit = '通用名称'
curTipTwoTit = '规格型号'
} else if (topActiveIndex === 1) {
curTit = 'item_name'
curTipStr = 'general_name'
curTipOne = 'specification'
curTxtTit = '物料名称'
curTipStrTit = '通用名称'
curTipOneTit = '规格型号'
} else if (topActiveIndex === 2) {
curTit = 'item_name'
curTipStr = 'general_name'
curTxtTit = '物料名称'
curTipStrTit = '通用名称'
}
} else if (leftIndex === 1 || leftIndex === 2) {
curTit = 'manufacturer_product_code'
curTipStr = 'item_name'
curTipOne = 'general_name'
curTipTwo = 'specification'
curTxtTit = '厂家产品代码'
curTipStrTit = '物料名称'
curTipOneTit = '通用名称'
curTipTwoTit = '规格型号'
} }
// 返回每一列元素 // curTit = 'item_name'
renderContColumnItem(item, index) { // curTipStr = 'general_name'
let { onlyShow, onlySignSelect, topActiveIndex, superData } = this.state // curTipOne = 'specification'
let { leftIndex } = superData // curTipStrTit = '通用名称'
let curTit = '', curTipStr = '', curTipOne = '', curTipTwo = '', curCalField = '', curImgIcon = '' // curTipOneTit = '规格型号'
let curTxtTit = '', curTipStrTit = '', curTipOneTit = '', curTipTwoTit = '' curCalField = LocalVariable.QUANTITY_FIELD
if(leftIndex === 0){ curImgIcon = 'photos'
if (topActiveIndex === 0 || topActiveIndex === 3) {
curTit = 'manufacturer_product_code'
curTipStr = 'item_name'
curTipOne = 'general_name'
curTipTwo = 'specification'
curTxtTit = '厂家产品代码'
curTipStrTit = '物料名称'
curTipOneTit = '通用名称'
curTipTwoTit = '规格型号'
} else if (topActiveIndex === 1) {
curTit = 'item_name'
curTipStr = 'general_name'
curTipOne = 'specification'
curTxtTit = '物料名称'
curTipStrTit = '通用名称'
curTipOneTit = '规格型号'
} else if (topActiveIndex === 2) {
curTit = 'item_name'
curTipStr = 'general_name'
curTxtTit = '物料名称'
curTipStrTit = '通用名称'
}
}else if(leftIndex === 1 || leftIndex === 2){
curTit = 'manufacturer_product_code'
curTipStr = 'item_name'
curTipOne = 'general_name'
curTipTwo = 'specification'
curTxtTit = '厂家产品代码'
curTipStrTit = '物料名称'
curTipOneTit = '通用名称'
curTipTwoTit = '规格型号'
}
// curTit = 'item_name'
// curTipStr = 'general_name'
// curTipOne = 'specification'
// curTipStrTit = '通用名称'
// curTipOneTit = '规格型号'
curCalField = LocalVariable.QUANTITY_FIELD
curImgIcon = 'photos'
return ( return (
<SafeAreaView style={styles.column_container} key={'item_code' + index}> <SafeAreaView style={styles.column_container} key={'item_code' + index}>
<PicTitDetaiCalcu <PicTitDetaiCalcu
listItem={item} listItem={item}
listIndex={index} listIndex={index}
calField={curCalField} calField={curCalField}
subCalCallBack={(item, index) => this.handleCalCallBack(item, index, LocalVariable.LOCAL_THRID_CONT_DATA)} subCalCallBack={(item, index) => this.handleCalCallBack(item, index, LocalVariable.LOCAL_THRID_CONT_DATA)}
titText={curTit} titText={curTit}
tipTextStr={curTipStr} tipTextStr={curTipStr}
tipTextOne={curTipOne} tipTextOne={curTipOne}
tipTextTwo={curTipTwo} tipTextTwo={curTipTwo}
titTextTit={curTxtTit} titTextTit={curTxtTit}
tipTextStrTit={curTipStrTit} tipTextStrTit={curTipStrTit}
tipTextOneTit={curTipOneTit} tipTextOneTit={curTipOneTit}
tipTextTwoTit={curTipTwoTit} tipTextTwoTit={curTipTwoTit}
listImgIcon={curImgIcon} listImgIcon={curImgIcon}
listPicType={'ROUND'} listPicType={'ROUND'}
onlyShowNum={onlyShow} onlyShowNum={onlyShow}
onlyShowSelect={onlySignSelect} onlyShowSelect={onlySignSelect}
listStyleBox={styles.list_style_box} listStyleBox={styles.list_style_box}
/> />
</SafeAreaView> </SafeAreaView>
) )
} }
// 返回正在加载中 // 返回正在加载中
renderLodingItem() { renderLodingItem() {
return ( return <LoadingModel ref="LoadingModel" />
<LoadingModel ref="LoadingModel" /> }
)
}
render() { render() {
let { navigation } = this.props let { navigation } = this.props
let { title } = navigation.state.params let { title } = navigation.state.params
let { onlyShow } = this.state let { onlyShow } = this.state
return ( return (
<View style={styles.edit_container}> <View style={styles.edit_container}>
<StatusBarView <StatusBarView isReactStackNavigator={true} backgroundColor={promary_color} barStyle="light-content" />
isReactStackNavigator={true} <SafeAreaView style={safe_view}>
backgroundColor={promary_color} <HeadBackItem title={title} navigation={navigation} />
barStyle='light-content' <View style={styles.edit_main}>
/> {this.renderTopProItem()}
<SafeAreaView style={safe_view}> {this.renderContItem()}
<HeadBackItem title={title} navigation={navigation} /> </View>
<View style={styles.edit_main}> {!onlyShow ? (
{this.renderTopProItem()} <View style={styles.btom_btn_box}>
{this.renderContItem()} <FooterBtnStyle
</View> style={styles.sub_btn_pro}
{!onlyShow ? <View style={styles.btom_btn_box}> activeOpacity={0.8}
<FooterBtnStyle title={'编辑完成'}
style={styles.sub_btn_pro} textStyle={styles.sub_btn_txt}
activeOpacity={.8} onPress={() => this.handleSubmit()}
title={'编辑完成'} />
textStyle={styles.sub_btn_txt}
onPress={() => this.handleSubmit()}
/>
</View> : null}
</SafeAreaView>
</View> </View>
); ) : null}
} </SafeAreaView>
</View>
)
}
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
edit_container: { edit_container: {
flex: 1, flex: 1,
backgroundColor: home_background_color, backgroundColor: home_background_color,
padding: 0, padding: 0,
margin: 0 margin: 0,
}, },
edit_main: { edit_main: {
flex: 1 flex: 1,
}, },
top_box: { top_box: {
width: Width(), width: Width(),
paddingHorizontal: 20, paddingHorizontal: 20,
paddingTop: 12 paddingTop: 12,
}, },
top_scroll_cont: {}, top_scroll_cont: {},
top_touch_cont: {}, top_touch_cont: {},
top_inner: {}, top_inner: {},
se_thr_width: { se_thr_width: {
minWidth: 42 minWidth: 42,
}, },
four_width: { four_width: {
minWidth: 28 minWidth: 28,
}, },
top_inner_act: {}, top_inner_act: {},
top_tit: { top_tit: {
fontSize: 14 fontSize: 14,
}, },
top_tit_act: { top_tit_act: {
color: first_text_color, color: first_text_color,
fontWeight: 'bold' fontWeight: 'bold',
}, },
edit_cont: { edit_cont: {
marginTop: 14, marginTop: 14,
flex: 1, flex: 1,
paddingHorizontal: 20 paddingHorizontal: 20,
}, },
edit_list: {}, edit_list: {},
column_container: { column_container: {
marginBottom: 10, marginBottom: 10,
paddingHorizontal: 10, paddingHorizontal: 10,
paddingVertical: 6, paddingVertical: 6,
backgroundColor: foundation_color backgroundColor: foundation_color,
},
ri_inner: {},
oth_img_box: {
borderColor: '#ccc',
borderWidth: 1,
borderRadius: 50,
width: pxSize(50),
height: pxSize(50),
justifyContent: 'center',
alignItems: 'center',
},
oth_img: {
width: '90%',
height: '90%',
},
ri_text_box: {},
ri_te_tit: {
fontSize: second_text_size,
color: first_text_color,
fontFamily: font_family_semibold,
},
thr_ot: {},
ri_te_ot: {
fontSize: 14,
color: third_text_color,
fontFamily: font_family_light,
},
ri_num_box: {
flexDirection: 'row',
alignItems: 'center',
},
thr_num_btn: {
width: pxSize(24),
height: pxSize(24),
},
thr_btn_left: {
marginRight: 4,
},
thr_btn_right: {
marginLeft: 4,
},
thr_num_icon: {
width: '100%',
height: '100%',
},
btn_inner: {},
thr_num: {
minWidth: pxSize(20),
textAlign: 'center',
},
btom_btn_box: {
backgroundColor: foundation_color,
paddingTop: 14,
shadowColor: 'rgba(0, 0, 0, 0.12)',
shadowOffset: {
width: 1,
height: 2,
}, },
ri_inner: {}, shadowOpacity: 1,
oth_img_box: { elevation: 2,
borderColor: '#ccc', borderWidth: 0,
borderWidth: 1, },
borderRadius: 50, sub_btn_pro: {
width: pxSize(50), backgroundColor: promary_color,
height: pxSize(50), marginBottom: 14,
justifyContent: 'center', },
alignItems: 'center' thr_head_tit_img: {
}, borderWidth: 0.5,
oth_img: { borderColor: 'rgba(0, 0, 0, 0.12)',
width: '90%', marginBottom: 10,
height: '90%' },
}, list_style_box: {
ri_text_box: {}, borderBottomWidth: 0,
ri_te_tit: { },
fontSize: second_text_size, sub_btn_txt: {},
color: first_text_color,
fontFamily: font_family_semibold
},
thr_ot: {},
ri_te_ot: {
fontSize: 14,
color: third_text_color,
fontFamily: font_family_light
},
ri_num_box: {
flexDirection: 'row',
alignItems: 'center'
},
thr_num_btn: {
width: pxSize(24),
height: pxSize(24)
},
thr_btn_left: {
marginRight: 4
},
thr_btn_right: {
marginLeft: 4
},
thr_num_icon: {
width: '100%',
height: '100%'
},
btn_inner: {},
thr_num: {
minWidth: pxSize(20),
textAlign: 'center'
},
btom_btn_box: {
backgroundColor: foundation_color,
paddingTop: 14,
shadowColor: 'rgba(0, 0, 0, 0.12)',
shadowOffset: {
width: 1,
height: 2
},
shadowOpacity: 1,
elevation: 2,
borderWidth: 0
},
sub_btn_pro: {
backgroundColor: promary_color,
marginBottom: 14
},
thr_head_tit_img: {
borderWidth: .5,
borderColor: 'rgba(0, 0, 0, 0.12)',
marginBottom: 10
},
list_style_box: {
borderBottomWidth: 0
},
sub_btn_txt: {}
}) })
const mapStateToProps = (state) => { const mapStateToProps = state => {
return { return {
userInfo: state.login.userInfo, userInfo: state.login.userInfo,
token: state.login.token, token: state.login.token,
loginState: state.login.loginState, loginState: state.login.loginState,
global_domain_config: state.login.global_domain_config global_domain_config: state.login.global_domain_config,
} }
} }
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = dispatch => {
return { return {
exitLoginStatus: () => { exitLoginStatus: () => {
dispatch(exitLoginStatus()) dispatch(exitLoginStatus())
}, },
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(EditThirdLevelPage); export default connect(mapStateToProps, mapDispatchToProps)(EditThirdLevelPage)
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 * as R from "ramda"; import * as R from 'ramda'
import { third_text_color, foundation_color, second_text_size, Width, pxSize, font_family_regular, icon_style } from '../../../base/BaseStyle'; import {
import PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu'; third_text_color,
import { cloneObject, isBlank, isNotBlank} from '../../../utils/Utils'; foundation_color,
import { PicListNoData } from '../../common/CellTextStyle'; second_text_size,
import _ from "lodash"; Width,
import { connect } from 'react-redux'; pxSize,
import LocalVariable from '../../common/LocalVariable'; font_family_regular,
const PropTypes = require('prop-types'); icon_style,
} from '../../../base/BaseStyle'
import PicTitDetaiCalcu from '../../common/listDataComponent/PicTitDetaiCalcu'
import { cloneObject, isBlank, isNotBlank } from '../../../utils/Utils'
import { PicListNoData } from '../../common/CellTextStyle'
import _ from 'lodash'
import { connect } from 'react-redux'
import LocalVariable from '../../common/LocalVariable'
const PropTypes = require('prop-types')
class ProductRightStyle extends Component { class ProductRightStyle extends Component {
static propTypres = {
superCallBack: PropTypes.func, // 回调计算函数
superReduceBack: PropTypes.func, // 减法回调
superLeftData: PropTypes.object, // 三级大类数据
superStencilData: PropTypes.array, // 当前右侧二级数据
leftIndex: PropTypes.numberm, // 左侧index
}
static propTypres = { constructor(props) {
superCallBack: PropTypes.func, // 回调计算函数 super(props)
superReduceBack: PropTypes.func, // 减法回调 this.state = {
superLeftData: PropTypes.object, // 三级大类数据 rightSecondData: this.props.superStencilData, // 右侧数据-手术套包、螺钉盒、器械包、零散器械
superStencilData: PropTypes.array, // 当前右侧二级数据 rowSingleData: [], // 耗材-小类
leftIndex: PropTypes.numberm, // 左侧index thridIsVisible: false, // 小类展示
curThridObj: {
superItem: '',
superIndex: '',
title: '',
image: '',
},
} }
}
constructor(props) { componentWillReceiveProps(nextProps) {
super(props) if (this.state.thridIsVisible != nextProps.defaultThridShow) {
this.state = { this.setState({ thridIsVisible: nextProps.defaultThridShow })
rightSecondData: this.props.superStencilData, // 右侧数据-手术套包、螺钉盒、器械包、零散器械
rowSingleData: [], // 耗材-小类
thridIsVisible: false, // 小类展示
curThridObj: {
superItem: '',
superIndex: '',
title: '',
image: ''
}
}
} }
if (nextProps.superStencilData) {
componentWillReceiveProps(nextProps) { this.setState({ rightSecondData: nextProps.superStencilData })
if (this.state.thridIsVisible != nextProps.defaultThridShow) {
this.setState({ thridIsVisible: nextProps.defaultThridShow });
}
if (nextProps.superStencilData) {
this.setState({ rightSecondData: nextProps.superStencilData });
}
} }
}
// 右侧 二级数据标题 点击 // 右侧 二级数据标题 点击
TitleClickEvent(item, index) { TitleClickEvent(item, index) {
let { leftIndex } = this.props let { navigation } = this.props
if (leftIndex >= 0 && leftIndex < 3) { let { leftIndex } = this.props
let curThirdShow = false, curTit = '编辑模板' if (leftIndex >= 0 && leftIndex < 3) {
if (leftIndex === 1) { let curThirdShow = false,
curThirdShow = true curTit = '编辑模板'
curTit = '钉盒明细' if (leftIndex === 1) {
} else if (leftIndex === 2) { curThirdShow = true
curThirdShow = true curTit = '钉盒明细'
curTit = '器械包明细' } else if (leftIndex === 2) {
} curThirdShow = true
this.props.navigation.navigate('EditThirdLevelPage', { curTit = '器械包明细'
title: curTit, }
superData: { this.props.navigation.navigate('EditThirdLevelPage', {
superItem: item, title: curTit,
superIndex: index, superData: {
leftIndex: leftIndex, superItem: item,
thirdShow: curThirdShow superIndex: index,
}, leftIndex: leftIndex,
childrenPageCallBack: this.childrenPageCallBack.bind(this) // 传递函数,编辑完成时调用 thirdShow: curThirdShow,
}) customer_code: navigation.state.params.selfData.customer_code,
} else if (leftIndex > 3) { },
// 耗材 中级标题点击 childrenPageCallBack: this.childrenPageCallBack.bind(this), // 传递函数,编辑完成时调用
this.changeThrShow(true, item, index) })
} } else if (leftIndex > 3) {
// 耗材 中级标题点击
this.changeThrShow(true, item, index)
} }
}
// 大类加减时,小类所有加1/减1 // 大类加减时,小类所有加1/减1
handleAllPlusReduce(curData, curIndex, isPlus) { handleAllPlusReduce(curData, curIndex, isPlus) {
const list = this.props.rightNameFilter(curData.details, true, true) const list = this.props.rightNameFilter(curData.details, true, true)
if (isBlank(list)) return if (isBlank(list)) return
let sumCount = 0 let sumCount = 0
curData[LocalVariable.QUANTITY_FIELD] = 0 // 初始化 curData[LocalVariable.QUANTITY_FIELD] = 0 // 初始化
list.forEach(function (line_val) { list.forEach(function (line_val) {
if (!line_val[LocalVariable.QUANTITY_FIELD]) { if (!line_val[LocalVariable.QUANTITY_FIELD]) {
line_val[LocalVariable.QUANTITY_FIELD] = 0 line_val[LocalVariable.QUANTITY_FIELD] = 0
} }
if (isPlus) { if (isPlus) {
line_val[LocalVariable.QUANTITY_FIELD] += 1 line_val[LocalVariable.QUANTITY_FIELD] += 1
} else if (line_val[LocalVariable.QUANTITY_FIELD] > 0) { } else if (line_val[LocalVariable.QUANTITY_FIELD] > 0) {
line_val[LocalVariable.QUANTITY_FIELD] -= 1 line_val[LocalVariable.QUANTITY_FIELD] -= 1
} }
sumCount += line_val[LocalVariable.QUANTITY_FIELD] sumCount += line_val[LocalVariable.QUANTITY_FIELD]
}) })
curData[LocalVariable.QUANTITY_FIELD] = sumCount curData[LocalVariable.QUANTITY_FIELD] = sumCount
this.handleCalCallBack(curData, curIndex, 'rightSecondData', LocalVariable.QUANTITY_FIELD) this.handleCalCallBack(curData, curIndex, 'rightSecondData', LocalVariable.QUANTITY_FIELD)
} }
// 手术套包-编辑页面回调 // 手术套包-编辑页面回调
childrenPageCallBack(childData, index) { childrenPageCallBack(childData, index) {
let { rightSecondData } = this.state let { rightSecondData } = this.state
let { leftIndex } = this.props let { leftIndex } = this.props
let that = this let that = this
if (rightSecondData.length > 0) { if (rightSecondData.length > 0) {
rightSecondData.forEach(function (rsdItem, rsdIndex) { rightSecondData.forEach(function (rsdItem, rsdIndex) {
if (!rsdItem[LocalVariable.CHILDREN_LINE_NAME]) { if (!rsdItem[LocalVariable.CHILDREN_LINE_NAME]) {
rsdItem[LocalVariable.CHILDREN_LINE_NAME] = [] rsdItem[LocalVariable.CHILDREN_LINE_NAME] = []
}
if (!rsdItem[LocalVariable.QUANTITY_FIELD]) {
rsdItem[LocalVariable.QUANTITY_FIELD] = 0
}
if (rsdIndex === index && leftIndex === 0) {
let superTip = ''
childData.map((chDa, chInd) => {
let splitStr = ' / '
// if (chInd === childData.length - 1) {
// splitStr = ''
// }
if(!superTip){
splitStr = ''
}
if(chDa[LocalVariable.SELECTED_QUQNTITY] > 0){
superTip += `${splitStr}${chDa.category_name}x${chDa[LocalVariable.SELECTED_QUQNTITY]}`
}
// superTip += `${chDa.category_name}x${chDa[LocalVariable.SELECTED_QUQNTITY]}${splitStr}`
})
let curObj = {
superId: rsdItem['template_number'],
superIndex: rsdIndex,
superTit: rsdItem['template_name'],
superImg: rsdItem['photos'],
superTipStr: rsdItem['customer_name'],
superTipOne: rsdItem['doctor_name'],
superTip: superTip,
version: 0,
lineOptions: childData,
[LocalVariable.QUANTITY_FIELD]: 1
}
if (rsdItem[LocalVariable.CHILDREN_LINE_NAME].length !== 0) {
curObj.version = rsdItem[LocalVariable.CHILDREN_LINE_NAME].length
}
let filEquArr = rsdItem[LocalVariable.CHILDREN_LINE_NAME].filter(function (lineItem) {
if (_.isEqual(lineItem.lineOptions, childData)) {
lineItem[LocalVariable.QUANTITY_FIELD] += 1
return lineItem
}
})
if (filEquArr.length === 0) {
rsdItem[LocalVariable.CHILDREN_LINE_NAME].push(curObj)
}
rsdItem[LocalVariable.QUANTITY_FIELD] = Number(rsdItem[LocalVariable.QUANTITY_FIELD]) + 1
that.handleCalCallBack(rsdItem, rsdIndex, 'rightSecondData', LocalVariable.QUANTITY_FIELD)
}
})
} }
this.setState({ if (!rsdItem[LocalVariable.QUANTITY_FIELD]) {
rightSecondData rsdItem[LocalVariable.QUANTITY_FIELD] = 0
})
}
// 修改当前小类是否展示
changeThrShow(show, superItem, superIndex) {
let { curThridObj, rowSingleData, lastInputText } = this.state
let that = this
if (show && superItem) {
// 大类点击标题
curThridObj = {
superItem: superItem,
superIndex: superIndex,
title: superItem.category_name
}
that.setState({
thridIsVisible: show,
curThridObj: curThridObj,
rowSingleData: R.clone(superItem['details'])
})
this.props.changeThrShow(show)
} else {
// 小类点击标题
if (curThridObj.superItem) {
let curDa = curThridObj.superItem
let curInd = curThridObj.superIndex
curDa.details = R.clone(rowSingleData)
curDa[LocalVariable.QUANTITY_FIELD] = 0
curDa.details.forEach(itVal => {
if (itVal[LocalVariable.QUANTITY_FIELD] > 0) {
curDa[LocalVariable.QUANTITY_FIELD] += itVal[LocalVariable.QUANTITY_FIELD]
}
})
that.handleCalCallBack(curDa, curInd, 'rightSecondData', LocalVariable.QUANTITY_FIELD)
that.setState({
thridIsVisible: show,
lastInputText: ''
})
this.props.changeThrShow(show)
}
} }
} if (rsdIndex === index && leftIndex === 0) {
let superTip = ''
// 计算后的回调 - 头/行 childData.map((chDa, chInd) => {
handleCalCallBack(item, index, dataName, coutFieName) { let splitStr = ' / '
let that = this // if (chInd === childData.length - 1) {
// 除了耗材小类的回调 // splitStr = ''
if (dataName && this.state[dataName]) { // }
let curDataName = this.state[dataName] if (!superTip) {
curDataName[index] = item splitStr = ''
this.setState({
[dataName]: curDataName
})
if(dataName === 'rowSingleData'){
// 小类
that.changeThrShow(true)
} }
if(coutFieName) { if (chDa[LocalVariable.SELECTED_QUQNTITY] > 0) {
// 计算==头 superTip += `${splitStr}${chDa.category_name}x${chDa[LocalVariable.SELECTED_QUQNTITY]}`
let sumCount = 0
curDataName.map(item => {
if (item[coutFieName]) {
sumCount += Number(item[coutFieName])
}
})
this.props.superCallBack(sumCount, coutFieName)
} }
// superTip += `${chDa.category_name}x${chDa[LocalVariable.SELECTED_QUQNTITY]}${splitStr}`
})
let curObj = {
superId: rsdItem['template_number'],
superIndex: rsdIndex,
superTit: rsdItem['template_name'],
superImg: rsdItem['photos'],
superTipStr: rsdItem['customer_name'],
superTipOne: rsdItem['doctor_name'],
superTip: superTip,
version: 0,
lineOptions: childData,
[LocalVariable.QUANTITY_FIELD]: 1,
}
if (rsdItem[LocalVariable.CHILDREN_LINE_NAME].length !== 0) {
curObj.version = rsdItem[LocalVariable.CHILDREN_LINE_NAME].length
}
let filEquArr = rsdItem[LocalVariable.CHILDREN_LINE_NAME].filter(function (lineItem) {
if (_.isEqual(lineItem.lineOptions, childData)) {
lineItem[LocalVariable.QUANTITY_FIELD] += 1
return lineItem
}
})
if (filEquArr.length === 0) {
rsdItem[LocalVariable.CHILDREN_LINE_NAME].push(curObj)
}
rsdItem[LocalVariable.QUANTITY_FIELD] = Number(rsdItem[LocalVariable.QUANTITY_FIELD]) + 1
that.handleCalCallBack(rsdItem, rsdIndex, 'rightSecondData', LocalVariable.QUANTITY_FIELD)
} }
})
} }
this.setState({
rightSecondData,
})
}
// 返回右侧二级每一列(耗材以上) // 修改当前小类是否展示
renderSecondtem(item, index) { changeThrShow(show, superItem, superIndex) {
let { leftIndex } = this.props let { curThridObj, rowSingleData, lastInputText } = this.state
let curTitCallBack = '', curPlusCallBack = '', curReduceCallBack = '' let that = this
let curTit = '', curTipStr = '', curTipOne = '', curTipTwo = '', curTipThr = '', curTxtTit = '', curTipStrTit = '', curTipOneTit = '', curTipTwoTit = '', curTipThrTit = '', curIcon = '' if (show && superItem) {
let curListMaxNum = '' // 大类点击标题
if (leftIndex === 0) { curThridObj = {
curTit = 'template_name' superItem: superItem,
curTipStr = 'customer_name' superIndex: superIndex,
curTipOne = 'doctor_name' title: superItem.category_name,
curTipTwo = 'surgery_type_name' }
curTipThr = 'template_desc' that.setState({
curTxtTit = '套包名称' thridIsVisible: show,
curTipStrTit = '客户' curThridObj: curThridObj,
curTipOneTit = '主治医生' rowSingleData: R.clone(superItem['details']),
curTipTwoTit = '手术类型' })
curTipThrTit = '模板说明' this.props.changeThrShow(show)
} else if (leftIndex === 1) { } else {
curTit = 'item_name' // 小类点击标题
curTipStr = 'general_name' if (curThridObj.superItem) {
curTipOne = 'specification' let curDa = curThridObj.superItem
curTipTwo = 'serial_number' let curInd = curThridObj.superIndex
curTxtTit = '物料名称' curDa.details = R.clone(rowSingleData)
curTipStrTit = '通用名称' curDa[LocalVariable.QUANTITY_FIELD] = 0
curTipOneTit = '规格型号' curDa.details.forEach(itVal => {
curTipTwoTit = '物料序列' if (itVal[LocalVariable.QUANTITY_FIELD] > 0) {
} else if (leftIndex === 2) { curDa[LocalVariable.QUANTITY_FIELD] += itVal[LocalVariable.QUANTITY_FIELD]
curTit = 'item_name' }
curTipStr = 'general_name' })
curTipOne = 'serial_number' that.handleCalCallBack(curDa, curInd, 'rightSecondData', LocalVariable.QUANTITY_FIELD)
curTxtTit = '物料名称' that.setState({
curTipStrTit = '通用名称' thridIsVisible: show,
curTipOneTit = '物料序列' lastInputText: '',
} else if (leftIndex === 3) { })
curTit = 'manufacturer_product_code' this.props.changeThrShow(show)
curTipStr = 'item_name' }
curTipOne = 'general_name'
curTipTwo = 'specification'
curTxtTit = '厂家产品代码'
curTipStrTit = '物料名称'
curTipOneTit = '通用名称'
curTipTwoTit = '规格型号'
}
curIcon = 'photos'
if (leftIndex === 1) {
// 钉盒
curTitCallBack = ((item, index) => this.TitleClickEvent(item, index))
curPlusCallBack = ''
curReduceCallBack = ''
} else if (leftIndex === 2) {
// 器械包
curTitCallBack = ((item, index) => this.TitleClickEvent(item, index))
curPlusCallBack = ''
curReduceCallBack = ''
curListMaxNum = 1
} else if (leftIndex === 3) {
// 零散器械
curTitCallBack = ''
curPlusCallBack = ''
curReduceCallBack = ''
} else {
curTitCallBack = ((item, index) => this.TitleClickEvent(item, index))
curPlusCallBack = ((item, index) => this.TitleClickEvent(item, index))
curReduceCallBack = (() => this.props.superReduceBack())
}
return (
<SafeAreaView style={styles.ri_container} key={'template_name' + index}>
<PicTitDetaiCalcu
listItem={item}
listIndex={index}
calField={LocalVariable.QUANTITY_FIELD}
subCalCallBack={(item, index) => this.handleCalCallBack(item, index, 'rightSecondData', LocalVariable.QUANTITY_FIELD)}
titCallBack={curTitCallBack}
titText={curTit}
tipTextStr={curTipStr}
tipTextOne={curTipOne}
tipTextTwo={curTipTwo}
tipTextThr={curTipThr}
titTextTit={curTxtTit}
tipTextStrTit={curTipStrTit}
tipTextOneTit={curTipOneTit}
tipTextTwoTit={curTipTwoTit}
tipTextThrTit={curTipThrTit}
listImgIcon={curIcon}
listPicType={'SQUARE'}
plusCallBack={curPlusCallBack}
reduceCallBack={curReduceCallBack}
listMaxNum={curListMaxNum}
listStyleImg={styles.rig_icon}
/>
</SafeAreaView>
)
} }
}
// 返回右侧元素(耗材以上) // 计算后的回调 - 头/行
renderStencilStyle() { handleCalCallBack(item, index, dataName, coutFieName) {
let { rightSecondData } = this.state let that = this
return ( // 除了耗材小类的回调
<View style={styles.stencil_cont}> if (dataName && this.state[dataName]) {
{ rightSecondData.length > 0 ? let curDataName = this.state[dataName]
<FlatList curDataName[index] = item
style={styles.cont_right_list} this.setState({
keyExtractor={item => item.id} [dataName]: curDataName,
data={rightSecondData} })
extraData={this.state} if (dataName === 'rowSingleData') {
renderItem={({ item, index }) => this.renderSecondtem(item, index)} // 小类
/> : <PicListNoData />} that.changeThrShow(true)
}
if (coutFieName) {
// 计算==头
let sumCount = 0
curDataName.map(item => {
if (item[coutFieName]) {
sumCount += Number(item[coutFieName])
}
})
this.props.superCallBack(sumCount, coutFieName)
}
}
}
</View> // 返回右侧二级每一列(耗材以上)
) renderSecondtem(item, index) {
let { leftIndex } = this.props
let curTitCallBack = '',
curPlusCallBack = '',
curReduceCallBack = ''
let curTit = '',
curTipStr = '',
curTipOne = '',
curTipTwo = '',
curTipThr = '',
curTxtTit = '',
curTipStrTit = '',
curTipOneTit = '',
curTipTwoTit = '',
curTipThrTit = '',
curIcon = ''
let curListMaxNum = ''
if (leftIndex === 0) {
curTit = 'template_name'
curTipStr = 'customer_name'
curTipOne = 'doctor_name'
curTipTwo = 'surgery_type_name'
curTipThr = 'template_desc'
curTxtTit = '套包名称'
curTipStrTit = '客户'
curTipOneTit = '主治医生'
curTipTwoTit = '手术类型'
curTipThrTit = '模板说明'
} else if (leftIndex === 1) {
curTit = 'item_name'
curTipStr = 'general_name'
curTipOne = 'specification'
curTipTwo = 'serial_number'
curTxtTit = '物料名称'
curTipStrTit = '通用名称'
curTipOneTit = '规格型号'
curTipTwoTit = '物料序列'
} else if (leftIndex === 2) {
curTit = 'item_name'
curTipStr = 'general_name'
curTipOne = 'serial_number'
curTxtTit = '物料名称'
curTipStrTit = '通用名称'
curTipOneTit = '物料序列'
} else if (leftIndex === 3) {
curTit = 'manufacturer_product_code'
curTipStr = 'item_name'
curTipOne = 'general_name'
curTipTwo = 'specification'
curTxtTit = '厂家产品代码'
curTipStrTit = '物料名称'
curTipOneTit = '通用名称'
curTipTwoTit = '规格型号'
}
curIcon = 'photos'
if (leftIndex === 1) {
// 钉盒
curTitCallBack = (item, index) => this.TitleClickEvent(item, index)
curPlusCallBack = ''
curReduceCallBack = ''
} else if (leftIndex === 2) {
// 器械包
curTitCallBack = (item, index) => this.TitleClickEvent(item, index)
curPlusCallBack = ''
curReduceCallBack = ''
curListMaxNum = 1
} else if (leftIndex === 3) {
// 零散器械
curTitCallBack = ''
curPlusCallBack = ''
curReduceCallBack = ''
} else {
curTitCallBack = (item, index) => this.TitleClickEvent(item, index)
curPlusCallBack = (item, index) => this.TitleClickEvent(item, index)
curReduceCallBack = () => this.props.superReduceBack()
} }
return (
<SafeAreaView style={styles.ri_container} key={'template_name' + index}>
<PicTitDetaiCalcu
listItem={item}
listIndex={index}
calField={LocalVariable.QUANTITY_FIELD}
subCalCallBack={(item, index) =>
this.handleCalCallBack(item, index, 'rightSecondData', LocalVariable.QUANTITY_FIELD)
}
titCallBack={curTitCallBack}
titText={curTit}
tipTextStr={curTipStr}
tipTextOne={curTipOne}
tipTextTwo={curTipTwo}
tipTextThr={curTipThr}
titTextTit={curTxtTit}
tipTextStrTit={curTipStrTit}
tipTextOneTit={curTipOneTit}
tipTextTwoTit={curTipTwoTit}
tipTextThrTit={curTipThrTit}
listImgIcon={curIcon}
listPicType={'SQUARE'}
plusCallBack={curPlusCallBack}
reduceCallBack={curReduceCallBack}
listMaxNum={curListMaxNum}
listStyleImg={styles.rig_icon}
/>
</SafeAreaView>
)
}
// 耗材 -- 小类每一列 // 返回右侧元素(耗材以上)
renderThridItem(item, index) { renderStencilStyle() {
let { rowSingleData } = this.state let { rightSecondData } = this.state
const idx = R.findIndex(R.propEq('item_code', item.item_code))(rowSingleData) return (
<View style={styles.stencil_cont}>
{rightSecondData.length > 0 ? (
<FlatList
style={styles.cont_right_list}
keyExtractor={item => item.id}
data={rightSecondData}
extraData={this.state}
renderItem={({ item, index }) => this.renderSecondtem(item, index)}
/>
) : (
<PicListNoData />
)}
</View>
)
}
return ( // 耗材 -- 小类每一列
<SafeAreaView style={styles.thr_container} key={'item_code' + index}> renderThridItem(item, index) {
<PicTitDetaiCalcu let { rowSingleData } = this.state
listItem={item} const idx = R.findIndex(R.propEq('item_code', item.item_code))(rowSingleData)
listIndex={idx}
calField={LocalVariable.QUANTITY_FIELD}
subCalCallBack={(item, idx) => this.handleCalCallBack(item, idx, 'rowSingleData')}
titText={'manufacturer_product_code'}
tipTextStr={'item_name'}
tipTextOne={'general_name'}
tipTextTwo={'specification'}
titTextTit={'厂家产品代码'}
tipTextStrTit={'物料名称'}
tipTextOneTit={'通用名称'}
tipTextTwoTit={'规格型号'}
listImgIcon={'photos'}
/>
</SafeAreaView>
)
}
// 耗材 -- 小类 return (
renderThridStyle() { <SafeAreaView style={styles.thr_container} key={'item_code' + index}>
let { rowSingleData } = this.state <PicTitDetaiCalcu
let data = this.props.rightNameFilter(rowSingleData, true) listItem={item}
listIndex={idx}
calField={LocalVariable.QUANTITY_FIELD}
subCalCallBack={(item, idx) => this.handleCalCallBack(item, idx, 'rowSingleData')}
titText={'manufacturer_product_code'}
tipTextStr={'item_name'}
tipTextOne={'general_name'}
tipTextTwo={'specification'}
titTextTit={'厂家产品代码'}
tipTextStrTit={'物料名称'}
tipTextOneTit={'通用名称'}
tipTextTwoTit={'规格型号'}
listImgIcon={'photos'}
/>
</SafeAreaView>
)
}
return ( // 耗材 -- 小类
<View style={styles.stencil_cont}> renderThridStyle() {
<FlatList let { rowSingleData } = this.state
style={styles.cont_thr_list} let data = this.props.rightNameFilter(rowSingleData, true)
keyExtractor={item => item.id}
data={data}
extraData={this.state}
renderItem={({ item, index }) => this.renderThridItem(item, index)}
/>
</View>
)
}
// 耗材 -- 大类每一列 return (
renderOtherListItem(item, index) { <View style={styles.stencil_cont}>
let curTit = '', curTipStr = '', curTipOne = '', curTipTwo = '', curTxtTit = '', curTipStrTit = '', curTipOneTit = '', curTipTwoTit = '', curIcon = '' <FlatList
let curTitCallBack = '', curPlusCallBack = '', curReduceCallBack = '' style={styles.cont_thr_list}
if (item[LocalVariable.ONLY_TWO_LEVELS]) { keyExtractor={item => item.id}
// 两级数据 data={data}
curTit = 'manufacturer_product_code' extraData={this.state}
curTipStr = 'item_name' renderItem={({ item, index }) => this.renderThridItem(item, index)}
curTipOne = 'general_name' />
curTipTwo = 'specification' </View>
curTxtTit = '厂家产品代码' )
curTipStrTit = '物料名称' }
curTipOneTit = '通用名称'
curTipTwoTit = '规格型号'
curIcon = 'photos'
} else {
// 三级数据
curTit = 'category_name'
curTxtTit = '分类名称'
curIcon = 'category_image'
curTitCallBack = (item, index) => this.TitleClickEvent(item, index)
curPlusCallBack = (item, index) => this.handleAllPlusReduce(item, index, true)
curReduceCallBack = (item, index) => this.handleAllPlusReduce(item, index)
}
return ( // 耗材 -- 大类每一列
<SafeAreaView style={styles.oth_container} key={'item_code' + index}> renderOtherListItem(item, index) {
<PicTitDetaiCalcu let curTit = '',
listItem={item} curTipStr = '',
listIndex={index} curTipOne = '',
calField={LocalVariable.QUANTITY_FIELD} curTipTwo = '',
listImgIcon={curIcon} curTxtTit = '',
listPicType={'ROUND'} curTipStrTit = '',
subCalCallBack={(item, index) => this.handleCalCallBack(item, index, 'rightSecondData', LocalVariable.QUANTITY_FIELD)} curTipOneTit = '',
titCallBack={curTitCallBack} curTipTwoTit = '',
titText={curTit} curIcon = ''
tipTextStr={curTipStr} let curTitCallBack = '',
tipTextOne={curTipOne} curPlusCallBack = '',
tipTextTwo={curTipTwo} curReduceCallBack = ''
titTextTit={curTxtTit} if (item[LocalVariable.ONLY_TWO_LEVELS]) {
tipTextStrTit={curTipStrTit} // 两级数据
tipTextOneTit={curTipOneTit} curTit = 'manufacturer_product_code'
tipTextTwoTit={curTipTwoTit} curTipStr = 'item_name'
plusCallBack={curPlusCallBack} curTipOne = 'general_name'
reduceCallBack={curReduceCallBack} curTipTwo = 'specification'
/> curTxtTit = '厂家产品代码'
</SafeAreaView> curTipStrTit = '物料名称'
) curTipOneTit = '通用名称'
curTipTwoTit = '规格型号'
curIcon = 'photos'
} else {
// 三级数据
curTit = 'category_name'
curTxtTit = '分类名称'
curIcon = 'category_image'
curTitCallBack = (item, index) => this.TitleClickEvent(item, index)
curPlusCallBack = (item, index) => this.handleAllPlusReduce(item, index, true)
curReduceCallBack = (item, index) => this.handleAllPlusReduce(item, index)
} }
// 耗材 -- 大类 return (
renderOtherStyle() { <SafeAreaView style={styles.oth_container} key={'item_code' + index}>
let { rightSecondData } = this.state <PicTitDetaiCalcu
return ( listItem={item}
<View style={styles.cont_other_cont}> listIndex={index}
{ calField={LocalVariable.QUANTITY_FIELD}
rightSecondData.length > 0 ? <FlatList listImgIcon={curIcon}
style={styles.cont_other_list} listPicType={'ROUND'}
keyExtractor={item => item.id} subCalCallBack={(item, index) =>
data={this.state.rightSecondData} this.handleCalCallBack(item, index, 'rightSecondData', LocalVariable.QUANTITY_FIELD)
extraData={this.state} }
renderItem={({ item, index }) => this.renderOtherListItem(item, index)} titCallBack={curTitCallBack}
/> : <PicListNoData /> titText={curTit}
} tipTextStr={curTipStr}
tipTextOne={curTipOne}
tipTextTwo={curTipTwo}
titTextTit={curTxtTit}
tipTextStrTit={curTipStrTit}
tipTextOneTit={curTipOneTit}
tipTextTwoTit={curTipTwoTit}
plusCallBack={curPlusCallBack}
reduceCallBack={curReduceCallBack}
/>
</SafeAreaView>
)
}
</View> // 耗材 -- 大类
) renderOtherStyle() {
} let { rightSecondData } = this.state
return (
<View style={styles.cont_other_cont}>
{rightSecondData.length > 0 ? (
<FlatList
style={styles.cont_other_list}
keyExtractor={item => item.id}
data={this.state.rightSecondData}
extraData={this.state}
renderItem={({ item, index }) => this.renderOtherListItem(item, index)}
/>
) : (
<PicListNoData />
)}
</View>
)
}
// 右侧元素 // 右侧元素
renderRightCurrentStyle() { renderRightCurrentStyle() {
let { leftIndex } = this.props let { leftIndex } = this.props
let { thridIsVisible } = this.state let { thridIsVisible } = this.state
if (leftIndex >= 0 && leftIndex < 4) { if (leftIndex >= 0 && leftIndex < 4) {
return this.renderStencilStyle() return this.renderStencilStyle()
} else { } else {
if (!thridIsVisible) { if (!thridIsVisible) {
return this.renderOtherStyle() return this.renderOtherStyle()
} else { } else {
return this.renderThridStyle() return this.renderThridStyle()
} }
}
} }
}
// 耗材 -- 三级顶部标题 // 耗材 -- 三级顶部标题
renderThrHeadStyle() { renderThrHeadStyle() {
let { thridIsVisible, curThridObj } = this.state let { thridIsVisible, curThridObj } = this.state
if (thridIsVisible) { if (thridIsVisible) {
return ( return (
<View> <View>
<TouchableOpacity <TouchableOpacity activeOpacity={0.8} style={styles.thr_head_inner} onPress={() => this.changeThrShow(false)}>
activeOpacity={.8} <View style={styles.thr_head_back}>
style={styles.thr_head_inner} <View style={styles.thr_icon_box}>
onPress={() => this.changeThrShow(false)} <Image source={require('../../../images/arr_left.png')} style={icon_style}></Image>
> </View>
<View style={styles.thr_head_back}> <Text style={styles.thr_head_tit}>{curThridObj.title}</Text>
<View style={styles.thr_icon_box}> </View>
<Image source={require('../../../images/arr_left.png')} style={icon_style}></Image> </TouchableOpacity>
</View> {/* <PictureZoom
<Text style={styles.thr_head_tit}>{curThridObj.title}</Text>
</View>
</TouchableOpacity>
{/* <PictureZoom
listImageIndex={0} listImageIndex={0}
listImageUrls={curThridObj.image} listImageUrls={curThridObj.image}
listStyleImage={styles.thr_head_tit_img} listStyleImage={styles.thr_head_tit_img}
listPicType={'RECTANGLE'} listPicType={'RECTANGLE'}
/> */} /> */}
</View> </View>
) )
}
} }
}
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} showsVerticalScrollIndicator={false}>
style={styles.cont_right_scroll_cont} {this.renderRightCurrentStyle()}
showsVerticalScrollIndicator={false} </ScrollView>
> </View>
{this.renderRightCurrentStyle()} )
</ScrollView> }
</View>
)
}
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
cont_right_box: { cont_right_box: {
position: 'absolute', position: 'absolute',
left: 80, left: 80,
top: 0, top: 0,
width: Width() - 80, width: Width() - 80,
backgroundColor: foundation_color, backgroundColor: foundation_color,
height: '100%', height: '100%',
paddingHorizontal: 20, paddingHorizontal: 20,
paddingLeft: 10 paddingLeft: 10,
}, },
cont_right_scroll_cont: {}, cont_right_scroll_cont: {},
cont_right_list: {}, cont_right_list: {},
ri_container: {}, ri_container: {},
model_cont: {}, model_cont: {},
cont_other_cont: {}, cont_other_cont: {},
cont_other_list: {}, cont_other_list: {},
oth_container: {}, oth_container: {},
stencil_cont: {}, stencil_cont: {},
thr_head_inner: {}, thr_head_inner: {},
thr_head_back: { thr_head_back: {
flexDirection: 'row', flexDirection: 'row',
paddingVertical: 12, paddingVertical: 12,
alignItems: 'center' alignItems: 'center',
}, },
thr_icon_box: { thr_icon_box: {
width: pxSize(14), width: pxSize(14),
height: pxSize(18) height: pxSize(18),
}, },
thr_head_tit: { thr_head_tit: {
color: third_text_color, color: third_text_color,
paddingLeft: 6, paddingLeft: 6,
fontSize: second_text_size, fontSize: second_text_size,
fontFamily: font_family_regular fontFamily: font_family_regular,
}, },
thr_head_tit_img: { thr_head_tit_img: {
borderWidth: .5, borderWidth: 0.5,
borderColor: 'rgba(0, 0, 0, 0.12)', borderColor: 'rgba(0, 0, 0, 0.12)',
marginBottom: 10 marginBottom: 10,
}, },
cont_thr_list: {}, cont_thr_list: {},
thr_container: {}, thr_container: {},
rig_icon: { rig_icon: {
width: pxSize(68), width: pxSize(68),
height: pxSize(68) height: pxSize(68),
} },
}) })
const mapStateToProps = (state) => { const mapStateToProps = state => {
return { return {
userInfo: state.login.userInfo, userInfo: state.login.userInfo,
token: state.login.token, token: state.login.token,
loginState: state.login.loginState, loginState: state.login.loginState,
global_domain_config: state.login.global_domain_config global_domain_config: state.login.global_domain_config,
} }
} }
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = dispatch => {
return { return {
exitLoginStatus: () => { exitLoginStatus: () => {
dispatch(exitLoginStatus()) dispatch(exitLoginStatus())
}, },
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(ProductRightStyle); export default connect(mapStateToProps, mapDispatchToProps)(ProductRightStyle)
...@@ -110,7 +110,7 @@ class SearchPage extends Component { ...@@ -110,7 +110,7 @@ class SearchPage extends Component {
const { navigation, global_domain_config, token } = this.props const { navigation, global_domain_config, token } = this.props
const { topActiveIndex, searchValue, page, data } = this.state const { topActiveIndex, searchValue, page, data } = this.state
const { selfData, topProcOptionList } = navigation.state.params const { selfData, topProcOptionList } = navigation.state.params
const { authorizations } = selfData const { authorizations, customer_code } = selfData
const productLineCategory = authorizations?.product_line_category_list const productLineCategory = authorizations?.product_line_category_list
?.map(item => item.product_line_category_code) ?.map(item => item.product_line_category_code)
...@@ -121,6 +121,7 @@ class SearchPage extends Component { ...@@ -121,6 +121,7 @@ class SearchPage extends Component {
orgCode: selfData.org_code, orgCode: selfData.org_code,
manufacturerCode: topProcOptionList[topActiveIndex].supplier_code, manufacturerCode: topProcOptionList[topActiveIndex].supplier_code,
productLineCategory, productLineCategory,
customer_code,
keyword: encodeURIComponent(searchValue), keyword: encodeURIComponent(searchValue),
page, page,
} }
...@@ -140,11 +141,13 @@ class SearchPage extends Component { ...@@ -140,11 +141,13 @@ class SearchPage extends Component {
// 获取搜索到的类目 // 获取搜索到的类目
async getLeftOptionList(item) { async getLeftOptionList(item) {
const { navigation, global_domain_config, token } = this.props const { navigation, global_domain_config, token } = this.props
const { topProcOptionList } = navigation.state.params const { topProcOptionList, selfData } = navigation.state.params
const { defalutLeftItem, topActiveIndex } = this.state const { defalutLeftItem, topActiveIndex } = this.state
const { customer_code } = selfData
const params = { const params = {
access_token: token, access_token: token,
manufacturer_code: topProcOptionList[topActiveIndex].supplier_code, manufacturer_code: topProcOptionList[topActiveIndex].supplier_code,
customer_code,
} }
console.log('params=', params) console.log('params=', params)
this.refs.LoadingModel.show() this.refs.LoadingModel.show()
...@@ -180,11 +183,13 @@ class SearchPage extends Component { ...@@ -180,11 +183,13 @@ class SearchPage extends Component {
const { navigation, global_domain_config, token } = this.props const { navigation, global_domain_config, token } = this.props
const { topActiveIndex } = this.state const { topActiveIndex } = this.state
const { topProcOptionList, selfData } = navigation.state.params const { topProcOptionList, selfData } = navigation.state.params
const { customer_code } = selfData
let params = { let params = {
access_token: token, access_token: token,
category_code: item.big_category.category_code, category_code: item.big_category.category_code,
manufacturer_code: topProcOptionList[topActiveIndex].supplier_code, manufacturer_code: topProcOptionList[topActiveIndex].supplier_code,
org_code: selfData.org_code, org_code: selfData.org_code,
customer_code,
// leftIndex: leftIndex, // 测试 // leftIndex: leftIndex, // 测试
} }
console.log('params=', params) console.log('params=', params)
......
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