Commit 6b31573d by Denglingling

修改APP-自助下单本地数据,以及布局逻辑调整

(cherry picked from commit 40776087)
parent bdddd9dc
...@@ -554,14 +554,20 @@ class ProductModel extends Component { ...@@ -554,14 +554,20 @@ class ProductModel extends Component {
let {topActiveIndex} = this.state let {topActiveIndex} = this.state
let curTitText='', curTipTextOne='', curTipTextTwo='' let curTitText='', curTipTextOne='', curTipTextTwo=''
if(topActiveIndex === 1 || topActiveIndex === 2 || topActiveIndex === 3){ if(topActiveIndex === 1 || topActiveIndex === 2 || topActiveIndex === 3){
//钉盒 零散器械 //钉盒 零散器械
curTitText = 'title' curTitText = 'title'
curTipTextOne = 'tip1' curTipTextOne = 'tip1'
curTipTextTwo = 'tip2' curTipTextTwo = 'tip2'
if(topActiveIndex === 2){ // if(topActiveIndex === 2){
curTipTextOne = 'lineTip' // curTipTextOne = 'lineTip'
curTipTextTwo = '' // curTipTextTwo = ''
} // }
}else if(topActiveIndex === 2){
// 器械包
curTitText = 'item_name'
curTipTextOne = 'category_name'
curTipTextTwo = 'category_desc'
}else { }else {
curTitText = 'superTit' curTitText = 'superTit'
curTipTextOne = 'superTip' curTipTextOne = 'superTip'
......
...@@ -291,7 +291,7 @@ class ChooseProductPage extends Component { ...@@ -291,7 +291,7 @@ class ChooseProductPage extends Component {
} }
} }
}) })
// console.log('计算中级之后---', leftOptionList) console.log('计算中级之后---', leftOptionList)
this.setState({ this.setState({
leftOptionList, leftOptionList,
topProcOptionList topProcOptionList
......
...@@ -71,13 +71,14 @@ class EditThirdLevelPage extends Component { ...@@ -71,13 +71,14 @@ class EditThirdLevelPage extends Component {
}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){ // if(curOptions.length > 0){
curOptions.forEach(function(curIt) { // curOptions.forEach(function(curIt) {
curIt.select = false // 初始化 // curIt.select = false // 初始化
}) // })
} // }
this.setState({ this.setState({
onlySignSelect: params.superData.thirdSign, // onlySignSelect: params.superData.thirdSign,
onlyShow: params.superData.thirdShow,
topProcOptionList: curOptions topProcOptionList: curOptions
}) })
}else { }else {
...@@ -98,21 +99,22 @@ class EditThirdLevelPage extends Component { ...@@ -98,21 +99,22 @@ class EditThirdLevelPage extends Component {
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){
topItem = item // topItem = item
}else { // }else {
topItem.select = false // 初始化 // topItem.select = false // 初始化
} // }
}) // })
that.setState({ // that.setState({
topProcOptionList // topProcOptionList
}) // })
console.log('设置当前所有已选值---', topProcOptionList) // console.log('设置当前所有已选值---', topProcOptionList)
}else if(dataName && topProcOptionList[topActiveIndex][dataName]){ // }else
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
...@@ -203,7 +205,7 @@ class EditThirdLevelPage extends Component { ...@@ -203,7 +205,7 @@ class EditThirdLevelPage extends Component {
curData = topProcOptionList curData = topProcOptionList
}else if(params.superData.leftIndex === 2){ }else if(params.superData.leftIndex === 2){
localThridContData = topProcOptionList // localThridContData = topProcOptionList
}else{ }else{
curData = topProcOptionList[topActiveIndex] curData = topProcOptionList[topActiveIndex]
...@@ -214,6 +216,12 @@ class EditThirdLevelPage extends Component { ...@@ -214,6 +216,12 @@ class EditThirdLevelPage extends Component {
if(curData && curData.imgIconArr){ if(curData && curData.imgIconArr){
imgIconArr = curData.imgIconArr imgIconArr = curData.imgIconArr
} }
if(params.superData.leftIndex === 2){
// 器械包
localThridContData = topProcOptionList['package_components']
}
console.log('底部数据==' ,curData, localThridContData, topProcOptionList) console.log('底部数据==' ,curData, localThridContData, topProcOptionList)
...@@ -248,20 +256,36 @@ class EditThirdLevelPage extends Component { ...@@ -248,20 +256,36 @@ class EditThirdLevelPage extends Component {
console.log('onlySignSelect', onlySignSelect) console.log('onlySignSelect', onlySignSelect)
let curImgIcon='' let curTitText='', curTipTextStr='', curTipTextOne='',curCalField='',curImgIcon=''
if(!onlyShow){ if(!onlyShow){
curImgIcon = 'imgIconArr' curImgIcon = 'imgIconArr'
} }
if(params.superData.leftIndex === 2){
// 器械包
curTitText='item_name'
curTipTextStr='category_name'
curTipTextOne='category_desc'
curCalField='quantity'
curImgIcon=''
// 物料名称、分类名称、分类说明
}else{
curTitText='title'
curTipTextStr='tip1'
curTipTextOne='tip2'
curCalField='quantity'
// curImgIcon = ''
}
return ( return (
<SafeAreaView style={styles.column_container}> <SafeAreaView style={styles.column_container}>
<PicTitDetaiCalcu <PicTitDetaiCalcu
listItem={item} listItem={item}
listIndex={index} listIndex={index}
calField={'quantity'} calField={curCalField}
subCalCallBack={(item,index) => this.handleCalCallBack(item,index,DEFAULT_SECOND_DATA)} subCalCallBack={(item,index) => this.handleCalCallBack(item,index,DEFAULT_SECOND_DATA)}
titText={'title'} titText={curTitText}
tipTextStr={'tip1'} tipTextStr={curTipTextStr}
tipTextOne={'tip2'} tipTextOne={curTipTextOne}
listImgIcon={curImgIcon} listImgIcon={curImgIcon}
listPicType={'ROUND'} listPicType={'ROUND'}
onlyShowNum={onlyShow} onlyShowNum={onlyShow}
......
...@@ -81,14 +81,17 @@ class ProductRightStyle extends Component { ...@@ -81,14 +81,17 @@ class ProductRightStyle extends Component {
let {superIndex} = this.props let {superIndex} = this.props
console.log('右侧标题点击事件 ', superIndex, index, item) console.log('右侧标题点击事件 ', superIndex, index, item)
if(superIndex >= 0 && superIndex < 3) { if(superIndex >= 0 && superIndex < 3) {
let curThirdShow=false, curThirdSign=false let curThirdShow=false, curThirdSign=false, curTit='编辑模板'
if(superIndex === 1){ if(superIndex === 1){
curThirdShow = true curThirdShow = true
curTit='钉盒明细'
}else if(superIndex === 2){ }else if(superIndex === 2){
curThirdSign = true curThirdShow = true
// curThirdSign = true
curTit='器械包明细'
} }
this.props.navigation.navigate('EditThirdLevelPage', { this.props.navigation.navigate('EditThirdLevelPage', {
title: '选择产品 - 编辑模板', title: curTit,
superData:{ superData:{
superItem: item, superItem: item,
superIndex: index, superIndex: index,
...@@ -111,15 +114,14 @@ class ProductRightStyle extends Component { ...@@ -111,15 +114,14 @@ class ProductRightStyle extends Component {
} }
} }
// 当前直接加1/减1 // 零散器械标题点击
canPlusOrdReduceOne(item, index){ canPlusOrdReduceOne(item, index){
let {superIndex} = this.props let {superIndex} = this.props
let {rightSecondData} = this.state let {rightSecondData} = this.state
console.log('当前直接加1/减1:',rightSecondData) // console.log('零散器械标题点击/减1:',rightSecondData)
console.log('当前直接加1/减1:',superIndex) // console.log('零散器械标题点击/减1:',superIndex)
console.log('当前直接加1/减1:',item) // console.log('零散器械标题点击/减1:',item)
console.log('当前直接加1/减1:',index) // console.log('零散器械标题点击/减1:',index)
} }
// 大类加减,小类所有加1/减1 // 大类加减,小类所有加1/减1
...@@ -354,12 +356,15 @@ class ProductRightStyle extends Component { ...@@ -354,12 +356,15 @@ class ProductRightStyle extends Component {
curReduceCallBack = '' curReduceCallBack = ''
}else if(superIndex === 2){ }else if(superIndex === 2){
// 器械包 // 器械包
if(item['childQuantity'] > 0) { curTitCallBack=((item,index) => this.TitleClickEvent(item,index))
curPlusCallBack = ''
curReduceCallBack = ''
// if(item['childQuantity'] > 0) {
// 有数量时,需要点击进入选择 // 有数量时,需要点击进入选择
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())
} // }
}else if(superIndex === 3){ }else if(superIndex === 3){
// 零散器械 // 零散器械
curTitCallBack='' curTitCallBack=''
......
...@@ -684,35 +684,50 @@ const localThridOption_dh = { ...@@ -684,35 +684,50 @@ const localThridOption_dh = {
// 器械包可选数据 // 器械包可选数据
const localThridOption_qxb = [{ const localThridOption_qxb = {
"id": "0", "item_code": "SPH2000091209",
title: '器械包-旧-1', "package_components": [
tip1: '型号:10', {
tip2: '物料代码:JUST00000104', "item_code": "GYSXQX00000002",
quantity: 2, "quantity": 2,
imgIconArr: localTestImageUrls, "category_name": "一类医疗器械",
},{ "category_code": "12",
"id": "1", "specification": "",
title: '器械包-旧-2', "item_name": "SKI膝关节器械",
tip1: '型号:10', "unit": "个",
tip2: '物料代码:JUST00000104', "category_desc": "单件可重复使用的器械",
quantity: 1, "general_name": "膝关节手术工具",
imgIconArr: localTestImageUrls, "start_date": "2020-10-27T18:46:21"
},{ },
"id": "2", {
title: '器械包-新-1', "item_code": "GYSXQX00000003",
tip1: '型号:10', "quantity": 3,
tip2: '物料代码:JUST00000104', "category_name": "一类医疗器械",
quantity: 1, "category_code": "12",
imgIconArr: localTestImageUrls, "specification": "",
},{ "item_name": "HARMONY全髋器械",
"id": "3", "unit": "个",
title: '器械包-新-2', "category_desc": "单件可重复使用的器械",
tip1: '型号:10', "general_name": "人工髋关节手术工具(箱)",
tip2: '物料代码:JUST00000104', "start_date": "2020-10-27T18:46:21"
quantity: 3, },
imgIconArr: localTestImageUrls, {
}] "item_code": "SKII膝关节器械",
"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 localBottomOption = [ const localBottomOption = [
......
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