Commit 40776087 by Denglingling

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

parent 74ee86e9
......@@ -554,14 +554,20 @@ class ProductModel extends Component {
let {topActiveIndex} = this.state
let curTitText='', curTipTextOne='', curTipTextTwo=''
if(topActiveIndex === 1 || topActiveIndex === 2 || topActiveIndex === 3){
//钉盒 零散器械
//钉盒 零散器械
curTitText = 'title'
curTipTextOne = 'tip1'
curTipTextTwo = 'tip2'
if(topActiveIndex === 2){
curTipTextOne = 'lineTip'
curTipTextTwo = ''
}
// if(topActiveIndex === 2){
// curTipTextOne = 'lineTip'
// curTipTextTwo = ''
// }
}else if(topActiveIndex === 2){
// 器械包
curTitText = 'item_name'
curTipTextOne = 'category_name'
curTipTextTwo = 'category_desc'
}else {
curTitText = 'superTit'
curTipTextOne = 'superTip'
......
......@@ -291,7 +291,7 @@ class ChooseProductPage extends Component {
}
}
})
// console.log('计算中级之后---', leftOptionList)
console.log('计算中级之后---', leftOptionList)
this.setState({
leftOptionList,
topProcOptionList
......
......@@ -71,13 +71,14 @@ class EditThirdLevelPage extends Component {
}else if(params.superData.leftIndex === 2) {
// 器械包
curOptions = cloneObject(localMockData.localThridOption_qxb)
if(curOptions.length > 0){
curOptions.forEach(function(curIt) {
curIt.select = false // 初始化
})
}
// if(curOptions.length > 0){
// curOptions.forEach(function(curIt) {
// curIt.select = false // 初始化
// })
// }
this.setState({
onlySignSelect: params.superData.thirdSign,
// onlySignSelect: params.superData.thirdSign,
onlyShow: params.superData.thirdShow,
topProcOptionList: curOptions
})
}else {
......@@ -98,21 +99,22 @@ class EditThirdLevelPage extends Component {
console.log('修改列表计算后数据',item, index, dataName)
console.log('修改列表计算后数据',topActiveIndex, topProcOptionList)
console.log('父组件传递的值==', params.superData.leftIndex)
if(params.superData.leftIndex === 2){
topProcOptionList.map(function(topItem, topInd) {
if(topInd === index){
topItem = item
}else {
topItem.select = false // 初始化
}
})
that.setState({
topProcOptionList
})
// if(params.superData.leftIndex === 2){
// topProcOptionList.map(function(topItem, topInd) {
// if(topInd === index){
// topItem = item
// }else {
// topItem.select = false // 初始化
// }
// })
// that.setState({
// topProcOptionList
// })
console.log('设置当前所有已选值---', topProcOptionList)
// console.log('设置当前所有已选值---', topProcOptionList)
}else if(dataName && topProcOptionList[topActiveIndex][dataName]){
// }else
if(dataName && topProcOptionList[topActiveIndex][dataName]){
topProcOptionList.map(function(listItem, listIndex) {
if(listIndex === topActiveIndex){
listItem[dataName][index] = item
......@@ -203,7 +205,7 @@ class EditThirdLevelPage extends Component {
curData = topProcOptionList
}else if(params.superData.leftIndex === 2){
localThridContData = topProcOptionList
// localThridContData = topProcOptionList
}else{
curData = topProcOptionList[topActiveIndex]
......@@ -214,6 +216,12 @@ class EditThirdLevelPage extends Component {
if(curData && curData.imgIconArr){
imgIconArr = curData.imgIconArr
}
if(params.superData.leftIndex === 2){
// 器械包
localThridContData = topProcOptionList['package_components']
}
console.log('底部数据==' ,curData, localThridContData, topProcOptionList)
......@@ -248,20 +256,36 @@ class EditThirdLevelPage extends Component {
console.log('onlySignSelect', onlySignSelect)
let curImgIcon=''
let curTitText='', curTipTextStr='', curTipTextOne='',curCalField='',curImgIcon=''
if(!onlyShow){
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 (
<SafeAreaView style={styles.column_container}>
<PicTitDetaiCalcu
listItem={item}
listIndex={index}
calField={'quantity'}
calField={curCalField}
subCalCallBack={(item,index) => this.handleCalCallBack(item,index,DEFAULT_SECOND_DATA)}
titText={'title'}
tipTextStr={'tip1'}
tipTextOne={'tip2'}
titText={curTitText}
tipTextStr={curTipTextStr}
tipTextOne={curTipTextOne}
listImgIcon={curImgIcon}
listPicType={'ROUND'}
onlyShowNum={onlyShow}
......
......@@ -81,14 +81,17 @@ class ProductRightStyle extends Component {
let {superIndex} = this.props
console.log('右侧标题点击事件 ', superIndex, index, item)
if(superIndex >= 0 && superIndex < 3) {
let curThirdShow=false, curThirdSign=false
let curThirdShow=false, curThirdSign=false, curTit='编辑模板'
if(superIndex === 1){
curThirdShow = true
curTit='钉盒明细'
}else if(superIndex === 2){
curThirdSign = true
curThirdShow = true
// curThirdSign = true
curTit='器械包明细'
}
this.props.navigation.navigate('EditThirdLevelPage', {
title: '选择产品 - 编辑模板',
title: curTit,
superData:{
superItem: item,
superIndex: index,
......@@ -111,15 +114,14 @@ class ProductRightStyle extends Component {
}
}
// 当前直接加1/减1
// 零散器械标题点击
canPlusOrdReduceOne(item, index){
let {superIndex} = this.props
let {rightSecondData} = this.state
console.log('当前直接加1/减1:',rightSecondData)
console.log('当前直接加1/减1:',superIndex)
console.log('当前直接加1/减1:',item)
console.log('当前直接加1/减1:',index)
// console.log('零散器械标题点击/减1:',rightSecondData)
// console.log('零散器械标题点击/减1:',superIndex)
// console.log('零散器械标题点击/减1:',item)
// console.log('零散器械标题点击/减1:',index)
}
// 大类加减,小类所有加1/减1
......@@ -354,12 +356,15 @@ class ProductRightStyle extends Component {
curReduceCallBack = ''
}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))
curPlusCallBack = ((item, index) => this.TitleClickEvent(item,index))
curReduceCallBack = (() => this.props.superReduceBack())
}
// curTitCallBack=((item,index) => this.TitleClickEvent(item,index))
// curPlusCallBack = ((item, index) => this.TitleClickEvent(item,index))
// curReduceCallBack = (() => this.props.superReduceBack())
// }
}else if(superIndex === 3){
// 零散器械
curTitCallBack=''
......
......@@ -684,35 +684,50 @@ const localThridOption_dh = {
// 器械包可选数据
const localThridOption_qxb = [{
"id": "0",
title: '器械包-旧-1',
tip1: '型号:10',
tip2: '物料代码:JUST00000104',
quantity: 2,
imgIconArr: localTestImageUrls,
},{
"id": "1",
title: '器械包-旧-2',
tip1: '型号:10',
tip2: '物料代码:JUST00000104',
quantity: 1,
imgIconArr: localTestImageUrls,
},{
"id": "2",
title: '器械包-新-1',
tip1: '型号:10',
tip2: '物料代码:JUST00000104',
quantity: 1,
imgIconArr: localTestImageUrls,
},{
"id": "3",
title: '器械包-新-2',
tip1: '型号:10',
tip2: '物料代码:JUST00000104',
quantity: 3,
imgIconArr: localTestImageUrls,
}]
const localThridOption_qxb = {
"item_code": "SPH2000091209",
"package_components": [
{
"item_code": "GYSXQX00000002",
"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": "GYSXQX00000003",
"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": "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 = [
......
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