Commit d9584521 by Denglingling

优化自助下单

parent fe0a2608
......@@ -114,9 +114,6 @@ class ProductModel extends Component {
// 耗材清空图标回调
handleClearBack(item, index, superIndex) {
let { orginOptionList, topProcOptionList } = this.state
// console.log('耗材😋=====', item, index, superIndex)
// console.log('耗材😋=====', orginOptionList)
// console.log('耗材😋=====', topProcOptionList)
// 耗材当前清空项
let allCountQuantity = 0 // 初始化
......@@ -163,11 +160,6 @@ class ProductModel extends Component {
allCountQuantity += orgOpts[LocalVariable.SELECTED_QUQNTITY]
})
// console.log('🆕topProcOptionList=====', topProcOptionList)
// console.log('🆕topProcOptionList=====', allCountQuantity)
this.props.changeCallBack(topProcOptionList)
this.setState({
......@@ -176,73 +168,11 @@ class ProductModel extends Component {
if (allCountQuantity === 0) {
this.closeModal()
}
// this.props.modelCallBack(orginOptionList)
// if (allCountQuantity === 0) {
// this.closeModal()
// }
// orginOptionList.forEach(function (orgOpts, orgInd) {
// if (orgInd >= 4) {
// if (orgOpts[LocalVariable.LOCAL_SECOND_DATA] && orgOpts[LocalVariable.LOCAL_SECOND_DATA].length > 0) {
// orgOpts[LocalVariable.LOCAL_SECOND_DATA].forEach(function (localDa) {
// if (localDa[LocalVariable.ONLY_TWO_LEVELS] && localDa['item_code'] === item['item_code']) {
// // 二级
// localDa[LocalVariable.QUANTITY_FIELD] = 0
// } else if (!localDa[LocalVariable.ONLY_TWO_LEVELS] && localDa['category_code'] === item['category_code']) {
// localDa[LocalVariable.QUANTITY_FIELD] = 0
// if (localDa.details && localDa.details.length > 0) {
// // 三级
// localDa.details.forEach(function (da_it) {
// da_it[LocalVariable.QUANTITY_FIELD] = 0
// })
// }
// }
// })
// }
// if (orgOpts[LocalVariable.SELECTED_DATA_ARR] && orgOpts[LocalVariable.SELECTED_DATA_ARR].length > 0) {
// let delArr = []
// orgOpts[LocalVariable.SELECTED_DATA_ARR].map((deIt, deIndex) => {
// if (deIt[LocalVariable.ONLY_TWO_LEVELS] && deIt['item_code'] === item['item_code']) {
// delArr.push(deIndex)
// } else if (!deIt[LocalVariable.ONLY_TWO_LEVELS] && deIt['category_code'] === item['category_code']) {
// delArr.push(deIndex)
// }
// })
// for (let i = delArr.length - 1; i >= 0; i--) {
// orgOpts[LocalVariable.SELECTED_DATA_ARR].splice(delArr[i], 1);
// }
// }
// // 初始化
// orgOpts[LocalVariable.SELECTED_QUQNTITY] = 0
// if (orgOpts[LocalVariable.SELECTED_DATA_ARR] && orgOpts[LocalVariable.SELECTED_DATA_ARR].length > 0) {
// orgOpts[LocalVariable.SELECTED_DATA_ARR].map(function (itDa) {
// if (!itDa[LocalVariable.QUANTITY_FIELD]) {
// itDa[LocalVariable.QUANTITY_FIELD] = 0
// }
// orgOpts[LocalVariable.SELECTED_QUQNTITY] += Number(itDa[LocalVariable.QUANTITY_FIELD])
// })
// }
// }
// if (!orgOpts[LocalVariable.SELECTED_QUQNTITY]) {
// orgOpts[LocalVariable.SELECTED_QUQNTITY] = 0
// }
// allCountQuantity += orgOpts[LocalVariable.SELECTED_QUQNTITY]
// })
// this.props.modelCallBack(orginOptionList)
// if (allCountQuantity === 0) {
// this.closeModal()
// }
}
// 列表计算后回调
handleCalCallBack(item, index, superIndex) {
// console.log('计算后🐒=====', item, index, superIndex)
let { topProcOptionList, topActiveIndex } = this.state
// console.log('计算后🐒=====', topProcOptionList)
let defauIndex = index
defauIndex = item.superIndex
if (LocalVariable.SELECTED_DATA_ARR && topProcOptionList[topActiveIndex][LocalVariable.SELECTED_DATA_ARR]) {
......@@ -250,7 +180,6 @@ class ProductModel extends Component {
topProcOptionList.map(function (listItem, listIndex) {
if (listIndex === topActiveIndex) {
if (listItem.category_code === LocalVariable.NAIL_BOX || listItem.category_code === LocalVariable.EQUIPMENT_BAG || listItem.category_code === LocalVariable.SCATTERED_EQUIPMENT) {
// if (topActiveIndex === 1 || topActiveIndex === 2 || topActiveIndex === 3) {
//钉盒 器械包 零散器械
//初始化 中类
let deleFlag = false
......@@ -267,10 +196,8 @@ class ProductModel extends Component {
deleInd = seInd
}
listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.SELECTED_QUQNTITY] += Number(seDa[LocalVariable.QUANTITY_FIELD])
// listItem[LocalVariable.SELECTED_QUQNTITY] += Number(seDa[LocalVariable.QUANTITY_FIELD])
})
if (deleFlag) {
// listItem[LocalVariable.SELECTED_DATA_ARR].splice(deleInd, 1)
listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.CHILDREN_LINE_NAME].splice(deleInd, 1)
}
......@@ -292,29 +219,23 @@ class ProductModel extends Component {
// 手术套包
let deleFlag = false
let deleInd = null
// console.log('listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.CHILDREN_LINE_NAME][index]--', listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.CHILDREN_LINE_NAME][index])
// 初始化 三级
listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.CHILDREN_LINE_NAME][index][LocalVariable.QUANTITY_FIELD] = 0
// listItem[LocalVariable.SELECTED_DATA_ARR][defauIndex][LocalVariable.QUANTITY_FIELD] = 0
listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.CHILDREN_LINE_NAME][index][LocalVariable.CHILDREN_LINE_NAME].forEach(function (chIt, chInd) {
// listItem[LocalVariable.SELECTED_DATA_ARR][defauIndex][LocalVariable.CHILDREN_LINE_NAME].forEach(function (chIt, chInd) {
if (_.isEqual(chIt, item)) {
chIt = item
if (chIt[LocalVariable.QUANTITY_FIELD] === 0) {
deleFlag = true
deleInd = chInd
}
// console.log('相同🧵=====',deleInd, deleFlag)
}
if (!chIt[LocalVariable.QUANTITY_FIELD]) {
chIt[LocalVariable.QUANTITY_FIELD] = 0
}
listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.CHILDREN_LINE_NAME][index][LocalVariable.QUANTITY_FIELD] += Number(chIt[LocalVariable.QUANTITY_FIELD])
// listItem[LocalVariable.SELECTED_DATA_ARR][defauIndex][LocalVariable.QUANTITY_FIELD] += Number(chIt[LocalVariable.QUANTITY_FIELD])
})
if (deleFlag) {
listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.CHILDREN_LINE_NAME][index][LocalVariable.CHILDREN_LINE_NAME].splice(deleInd, 1)
// listItem[LocalVariable.SELECTED_DATA_ARR][defauIndex][LocalVariable.CHILDREN_LINE_NAME].splice(deleInd, 1)
}
let line_de_flag =false
......@@ -335,12 +256,6 @@ class ProductModel extends Component {
// 初始化 中类
listItem[LocalVariable.SELECTED_QUQNTITY] = 0
listItem[LocalVariable.SELECTED_DATA_ARR].forEach(function (seDa, seInd) {
// if (!seDa[LocalVariable.QUANTITY_FIELD]) {
// seDa[LocalVariable.QUANTITY_FIELD] = 0
// }
// listItem[LocalVariable.SELECTED_QUQNTITY] += Number(seDa[LocalVariable.QUANTITY_FIELD])
seDa[LocalVariable.SELECTED_QUQNTITY] = 0
if(seDa[LocalVariable.CHILDREN_LINE_NAME] && seDa[LocalVariable.CHILDREN_LINE_NAME].length > 0){
seDa[LocalVariable.CHILDREN_LINE_NAME].map(function (lineDa) {
......@@ -358,36 +273,6 @@ class ProductModel extends Component {
for (let i = del_out_arr.length - 1; i >= 0; i--) {
listItem[LocalVariable.SELECTED_DATA_ARR].splice(del_out_arr[i], 1);
}
// let sel_de_flag =false
// let sel_de_index = null
// listItem[LocalVariable.SELECTED_DATA_ARR].map((sel_arr, sel_ind) => {
// if (sel_arr[LocalVariable.SELECTED_QUQNTITY] === 0) {
// sel_de_flag = true
// sel_de_index = sel_ind
// }
// listItem[LocalVariable.SELECTED_QUQNTITY] += Number(sel_arr[LocalVariable.SELECTED_QUQNTITY])
// })
// if(sel_de_flag){
// listItem[LocalVariable.SELECTED_DATA_ARR].splice(sel_de_index, 1)
// }
// // 已选数量赋值之前默认数据
// let curObj = listItem[LocalVariable.SELECTED_DATA_ARR][superIndex][LocalVariable.CHILDREN_LINE_NAME][index]
// // let curObj = listItem[LocalVariable.SELECTED_DATA_ARR][defauIndex]
// if (listIndex < 4) {
// if (curObj['template_number']) {
// listItem[LocalVariable.LOCAL_SECOND_DATA].forEach(function (deIt) {
// // listItem[LocalVariable.LOCAL_SECOND_DATA].forEach(function (deIt) {
// if (deIt.template_number === curObj.template_number) {
// deIt = curObj
// }
// })
// }
// }
}
}
......@@ -397,106 +282,14 @@ class ProductModel extends Component {
allCountQuantity += listItem[LocalVariable.SELECTED_QUQNTITY]
})
// console.log('topProcOptionList=====', topProcOptionList)
// console.log('topProcOptionList=====', allCountQuantity)
this.props.changeCallBack(topProcOptionList)
this.setState({
topProcOptionList: topProcOptionList
})
if (allCountQuantity === 0) {
this.closeModal()
}
// // 恢复之后再调用
// this.setTopOrginTopData(topProcOptionList)
// if (allCountQuantity === 0) {
// this.closeModal()
// }
}
// if (LocalVariable.SELECTED_DATA_ARR && topProcOptionList[topActiveIndex][LocalVariable.SELECTED_DATA_ARR]) {
// let allCountQuantity = 0 // 初始化
// topProcOptionList.map(function (listItem, listIndex) {
// if (listIndex === topActiveIndex) {
// if (orItem.category_code === LocalVariable.NAIL_BOX || orItem.category_code === LocalVariable.EQUIPMENT_BAG || orItem.category_code === LocalVariable.SCATTERED_EQUIPMENT) {
// // if (topActiveIndex === 1 || topActiveIndex === 2 || topActiveIndex === 3) {
// //钉盒 器械包 零散器械
// //初始化 中类
// let deleFlag = false
// let deleInd = null
// listItem[LocalVariable.SELECTED_QUQNTITY] = 0
// listItem[LocalVariable.SELECTED_DATA_ARR].forEach(function (seDa, seInd) {
// if (!seDa[LocalVariable.QUANTITY_FIELD]) {
// seDa[LocalVariable.QUANTITY_FIELD] = 0
// }
// if (seDa[LocalVariable.QUANTITY_FIELD] === 0) {
// deleFlag = true
// deleInd = seInd
// }
// listItem[LocalVariable.SELECTED_QUQNTITY] += Number(seDa[LocalVariable.QUANTITY_FIELD])
// })
// if (deleFlag) {
// listItem[LocalVariable.SELECTED_DATA_ARR].splice(deleInd, 1)
// }
// } else {
// // 手术套包
// let deleFlag = false
// let deleInd = null
// // 初始化 三级
// listItem[LocalVariable.SELECTED_DATA_ARR][defauIndex][LocalVariable.QUANTITY_FIELD] = 0
// listItem[LocalVariable.SELECTED_DATA_ARR][defauIndex][LocalVariable.CHILDREN_LINE_NAME].forEach(function (chIt, chInd) {
// if (_.isEqual(chIt, item)) {
// chIt = item
// if (chIt[LocalVariable.QUANTITY_FIELD] === 0) {
// deleFlag = true
// deleInd = chInd
// }
// }
// if (!chIt[LocalVariable.QUANTITY_FIELD]) {
// chIt[LocalVariable.QUANTITY_FIELD] = 0
// }
// listItem[LocalVariable.SELECTED_DATA_ARR][defauIndex][LocalVariable.QUANTITY_FIELD] += Number(chIt[LocalVariable.QUANTITY_FIELD])
// })
// if (deleFlag) {
// listItem[LocalVariable.SELECTED_DATA_ARR][defauIndex][LocalVariable.CHILDREN_LINE_NAME].splice(deleInd, 1)
// }
// // 初始化 中类
// listItem[LocalVariable.SELECTED_QUQNTITY] = 0
// listItem[LocalVariable.SELECTED_DATA_ARR].forEach(function (seDa) {
// if (!seDa[LocalVariable.QUANTITY_FIELD]) {
// seDa[LocalVariable.QUANTITY_FIELD] = 0
// }
// listItem[LocalVariable.SELECTED_QUQNTITY] += Number(seDa[LocalVariable.QUANTITY_FIELD])
// })
// // 已选数量赋值之前默认数据
// let curObj = listItem[LocalVariable.SELECTED_DATA_ARR][defauIndex]
// if (listIndex < 4) {
// if (curObj['template_number']) {
// listItem[LocalVariable.LOCAL_SECOND_DATA].forEach(function (deIt) {
// if (deIt.template_number === curObj.template_number) {
// deIt = curObj
// }
// })
// }
// }
// }
// }
// if (!listItem[LocalVariable.SELECTED_QUQNTITY]) {
// listItem[LocalVariable.SELECTED_QUQNTITY] = 0
// }
// allCountQuantity += listItem[LocalVariable.SELECTED_QUQNTITY]
// })
// // 恢复之后再调用
// this.setTopOrginTopData(topProcOptionList)
// if (allCountQuantity === 0) {
// this.closeModal()
// }
// }
}
// 点击顶部菜单
......@@ -516,35 +309,22 @@ class ProductModel extends Component {
// 清空
handleClearRubbish() {
let { orginOptionList, topProcOptionList } = this.state
// this.refs.ClearAllModel.show('清空当前所有数据')
// console.log('清空🎹所有==--', this)
// this.modelClearAllCB(true)
let that = this
topProcOptionList.map(function(top_item) {
top_item[LocalVariable.SELECTED_QUQNTITY] = 0
top_item[LocalVariable.SELECTED_DATA_ARR] = []
})
// that.props.changeCallBack(topProcOptionList)
that.setState({
topProcOptionList: topProcOptionList
}, () => {
that.props.changeCallBack(topProcOptionList)
that.closeModal()
})
// setTimeout(() => {
// that.closeModal()
// }, 300)
}
// 清空当前
handleClearCurSuppRubbish(cu_item, cu_index) {
// console.log('当前🥚=====', cu_item, cu_index)
let {orginOptionList, topProcOptionList, topActiveIndex} = this.state
topProcOptionList[topActiveIndex][LocalVariable.SELECTED_DATA_ARR].splice(cu_index, 1)
topProcOptionList[topActiveIndex][LocalVariable.SELECTED_QUQNTITY] = 0
......@@ -562,8 +342,6 @@ class ProductModel extends Component {
this.props.changeCallBack(topProcOptionList)
// console.log('topProcOptionList=====', allCountQuantity)
this.setState({
topProcOptionList: topProcOptionList
})
......@@ -574,8 +352,6 @@ class ProductModel extends Component {
// 清空所有回调
modelClearAllCB(clear_flag){
// console.log('clear_flag===', clear_flag)
// console.log('clear_flag===', this)
let { orginOptionList, topProcOptionList } = this.state
let that = this
if(clear_flag){
......@@ -674,53 +450,32 @@ class ProductModel extends Component {
let localBottomContData = []
if (curData && curData[LocalVariable.SELECTED_DATA_ARR]) {
curData[LocalVariable.SELECTED_DATA_ARR].forEach(function (sedItem, sedInd) {
// if (sedItem.category_code === LocalVariable.SIGN_SELECT_CONSUMABLES) {
// if (sedItem[LocalVariable.ONLY_TWO_LEVELS]) {
// // 二级
// sedItem[LocalVariable.SUPER_TITLE_TIP] = `${sedItem.general_name} (${sedItem.item_code}) x ${sedItem[LocalVariable.QUANTITY_FIELD]}`
// } else {
// // 三级
// sedItem[LocalVariable.SUPER_TITLE_TIP] = `${sedItem.category_name} (${sedItem.category_code}) x ${sedItem[LocalVariable.QUANTITY_FIELD]}`
// }
// }
if(sedItem.category_code === LocalVariable.SIGN_SELECT_CONSUMABLES){
if(sedItem[LocalVariable.CHILDREN_LINE_NAME] && sedItem[LocalVariable.CHILDREN_LINE_NAME].length > 0){
sedItem[LocalVariable.CHILDREN_LINE_NAME].forEach(function(child_it) {
if(child_it.details) {
if(child_it.details && child_it.details.length > 0) {
child_it[LocalVariable.SUPER_TITLE_NAME] = child_it.left_category_name
child_it[LocalVariable.SUPER_TITLE_TIP] = `${child_it.category_name} x ${child_it[LocalVariable.QUANTITY_FIELD]}`
let cur_arr = []
child_it.details.forEach((de_val) => {
if(de_val[LocalVariable.QUANTITY_FIELD] > 0) {
cur_arr.push(de_val)
}
})
if(cur_arr.length > 0){
child_it[LocalVariable.SUPER_SEL_ALL_ARR] = cur_arr
}
}else {
child_it[LocalVariable.SUPER_TITLE_NAME] = child_it.left_category_name
child_it[LocalVariable.SUPER_TITLE_TIP] = `${child_it.general_name} x ${child_it[LocalVariable.QUANTITY_FIELD]}`
child_it[LocalVariable.SUPER_TITLE_TIP] = `${child_it.item_name} - ${child_it.manufacturer_product_code} - ${child_it.specification} - ${child_it.general_name} x ${child_it[LocalVariable.QUANTITY_FIELD]}`
}
})
}
}
localBottomContData.push(sedItem)
// if (topActiveIndex === 0) {
// // 手术套包
// // localBottomContData.push(...sedItem[LocalVariable.CHILDREN_LINE_NAME])
// localBottomContData.push(sedItem)
// } else {
// if (sedItem.category_code === LocalVariable.SIGN_SELECT_CONSUMABLES) {
// if (topActiveIndex > 3) {
// // 二级
// sedItem[LocalVariable.SUPER_TITLE_TIP] = `${sedItem.general_name} (${sedItem.item_code}) x ${sedItem[LocalVariable.QUANTITY_FIELD]}`
// } else {
// // 三级
// sedItem[LocalVariable.SUPER_TITLE_TIP] = `${sedItem.category_name} (${sedItem.category_code}) x ${sedItem[LocalVariable.QUANTITY_FIELD]}`
// }
// }
// localBottomContData.push(sedItem)
// }
})
}
// console.log('底部🉐️=====', localBottomContData)
return (
<View style={styles.edit_cont}>
<ScrollView
......@@ -750,9 +505,7 @@ class ProductModel extends Component {
curTipStr = 'superTipStr'
curTipOne = 'superTipOne'
curTipTwo = 'superTip'
// curTipOne = 'superTip'
curTxtTit='套包名'
// curTipOneTit = '详情'
curTipStrTit = '客户'
curTipOneTit = '主治医生'
curTipTwoTit = '详情'
......@@ -779,30 +532,13 @@ class ProductModel extends Component {
curTipStrTit = '物料名称'
curTipOneTit = '通用名称'
curTipTwoTit = '规格型号'
}
// else if (topActiveIndex === 1 || topActiveIndex === 2 || topActiveIndex === 3) {
// curTit = 'item_name'
// curTipOne = 'specification'
// curTipTwo = 'item_code'
// curTxtTit='物料名称'
// curTipOneTit = '规格型号'
// curTipTwoTit = '物料代码'
// curImgIcon = 'photos'
// if (topActiveIndex === 2) {
// curListMaxNum = 1
// }
// }
else {
}else {
curTit = LocalVariable.SUPER_TITLE_NAME
curTipOne = LocalVariable.SUPER_TITLE_TIP
curTipStr = LocalVariable.SUPER_TITLE_TIP
curTxtTit='耗材名'
curTipOneTit = '详情'
curTipStrTit = '详情'
}
// let cur_supplier_icon = ["files/20201224/截屏2020-12-24 上午11.11.20_1608779494102.11.20.png"]
// let cur_icon = ''
// cur_icon = { uri: global_domain_config + '/jeecg-boot/sys/common/view/' + cur_supplier_icon[0] }
let bttom_options = []
if (item[LocalVariable.CHILDREN_LINE_NAME]) {
if (item.category_code === LocalVariable.SURGICAL_TEMPLATE) {
......@@ -816,7 +552,6 @@ class ProductModel extends Component {
bttom_options = item[LocalVariable.CHILDREN_LINE_NAME]
}
}
// console.log('哈👌===', bttom_options)
return (
<TouchableOpacity
......@@ -868,6 +603,7 @@ class ProductModel extends Component {
clearCallBack={(ch_item, ch_index) => this.handleClearBack(ch_item, ch_index, index)}
listMaxNum={curListMaxNum}
key={'ch_item' + ch_index}
listShowOthOptFlag={true}
/>
)
}
......
......@@ -87,7 +87,7 @@ class ChooseCardList extends Component {
defaultSource={require('../../../images/not_img.png')}
source={cur_icon}
style={icon_style}
resizeMode="cover" /> : <Image source={cur_icon} style={icon_style} resizeMode="cover" />
resizeMode="center" /> : <Image source={cur_icon} style={icon_style} resizeMode="cover" />
}
</View> : null}
<Text numberOfLines={3} style={[styles.list_item_tit, cardStyleItemTit, cur_icon ? '' : cardStyleNotIconTit, index == curActIndex ? [styles.list_tit_act, cardStyleItemTitAct] : '']}>
......
import React, { Component } from 'react';
import { StyleSheet, Image, Text, TouchableOpacity, View } from 'react-native';
import { connect } from 'react-redux';
import { first_text_color, font_family_medium, font_family_regular, font_family_semibold, home_background_color, icon_style, pxSize, second_text_size, third_text_color, third_text_size, list_tit_color, list_str_color, list_one_color, list_thr_color } from '../../../base/BaseStyle';
import { first_text_color, font_family_medium, font_family_regular, font_family_semibold, home_background_color, icon_style, pxSize, second_text_size, third_text_color, third_text_size, list_tit_color, list_str_color, list_one_color, list_thr_color, list_one_light_color } from '../../../base/BaseStyle';
import PictureZoom from '../../common/listDataComponent/PictureZoom';
import LocalVariable from '../LocalVariable';
const PropTypes = require('prop-types');
/**
......@@ -43,13 +44,16 @@ class PicTitDetaiCalcu extends Component {
onlyShowNum: PropTypes.bool, // 只展示数字
onlyShowSelect: PropTypes.bool, // 只能单选
listMaxNum: PropTypes.number, // 数量限制最大值
listShowOthOptFlag: PropTypes.bool, // 展示耗材详情
}
constructor(props) {
super(props);
this.state = {
listPicTypeArr: ['ROUND', 'SQUARE', 'RECTANGLE'],
picStyleArr: ['round_pic', 'square_pic', 'rectan_pic']
picStyleArr: ['round_pic', 'square_pic', 'rectan_pic'],
showOtherFlag: true,
showOtherTitle: '点击隐藏具体详情'
}
}
......@@ -87,12 +91,22 @@ class PicTitDetaiCalcu extends Component {
this.props.subCalCallBack(item, index)
}
// 具体详情
showAllTip(){
let {showOtherFlag} = this.state
let curShowOtherTitle = showOtherFlag ? '点击查看具体详情' : '点击隐藏具体详情'
this.setState({
showOtherFlag: !showOtherFlag,
showOtherTitle: curShowOtherTitle
})
}
render() {
let { listItem, listIndex, calField, listStyleBox, listStyleTit, listStyleTip, listStyleCalBtn, listPicType, titCallBack,
titText, tipTextStr, tipTextOne, tipTextTwo, tipTextThr, listImgIcon, listStyleImg, showClearIcon, showClearIndex, listCardActIndex,
listStyleClearBtn, clearCallBack, onlyShowNum, onlyShowSelect, titTextTit, tipTextStrTit, tipTextOneTit, tipTextTwoTit, tipTextThrTit,
global_domain_config, listMaxNum } = this.props
let { listPicTypeArr, picStyleArr } = this.state
global_domain_config, listMaxNum, listShowOthOptFlag } = this.props
let { listPicTypeArr, picStyleArr, showOtherFlag, showOtherTitle } = this.state
let picOthStyle = ''
if (listPicTypeArr.indexOf(listPicType) > -1) {
......@@ -122,7 +136,6 @@ class PicTitDetaiCalcu extends Component {
}else if(typeof listItem[listImgIcon] === 'string'){
cur_photos[0] = { url: global_domain_config + '/jeecg-boot/sys/common/view/' + listItem[listImgIcon] }
}
return (
<View style={[styles.ri_inner, listStyleBox]}>
{(listImgIcon && cur_photos.length > 0) ?
......@@ -139,25 +152,39 @@ class PicTitDetaiCalcu extends Component {
onPress={() => { titCallBack ? titCallBack(listItem, listIndex) : {} }}
style={styles.oth_box}
>
<Text numberOfLines={2} style={[styles.thr_ot, listStyleTit]}>
{listItem[titText] ? listItem[titText] : '' }
{!listItem[titText] && titTextTit ? `${titTextTit}: 空` : ''}
<Text numberOfLines={3} style={[styles.thr_ot, listStyleTit]}>
{listItem[titText] ? `${listIndex+1}. ${listItem[titText]}` : '' }
{!listItem[titText] && titTextTit ? `${listIndex+1}. ${titTextTit}: 无` : ''}
</Text>
{tipTextStrTit ? <Text numberOfLines={2} style={[styles.ri_te_ot, styles.te_ot_str, listStyleTip]}>
{`${tipTextStrTit}:`} {listItem[tipTextStr] ? listItem[tipTextStr] : ''}
{tipTextStrTit ? <Text numberOfLines={3} style={[styles.ri_te_ot, styles.te_ot_str, listStyleTip]}>
{`${tipTextStrTit}:`} {listItem[tipTextStr] ? listItem[tipTextStr] : ''}
</Text> : null}
{tipTextOneTit ? <Text numberOfLines={2} style={[styles.ri_te_ot, styles.te_ot_one,listStyleTip]}>
{/* {tipTextOneTit ? `${tipTextOneTit}:` : ''}{listItem[tipTextOne]} */}
{`${tipTextOneTit}:`} {listItem[tipTextOne] ? listItem[tipTextOne] : '空'}
{tipTextOneTit ? <Text numberOfLines={3} style={[styles.ri_te_ot, styles.te_ot_one,listStyleTip]}>
{`${tipTextOneTit}:`} {listItem[tipTextOne] ? listItem[tipTextOne] : '无'}
</Text> : null}
{tipTextTwoTit ? <Text numberOfLines={2} style={[styles.ri_te_ot, styles.te_ot_two,listStyleTip]}>
{/* {tipTextTwoTit ? `${tipTextTwoTit}:` : ''}{listItem[tipTextTwo]} */}
{`${tipTextTwoTit}:`} {listItem[tipTextTwo] ? listItem[tipTextTwo] : '空'}
{tipTextTwoTit ? <Text numberOfLines={3} style={[styles.ri_te_ot, styles.te_ot_two,listStyleTip]}>
{`${tipTextTwoTit}:`} {listItem[tipTextTwo] ? listItem[tipTextTwo] : '无'}
</Text> : null}
{tipTextThrTit ? <Text numberOfLines={2} style={[styles.ri_te_ot, styles.te_ot_thr,listStyleTip]}>
{/* {tipTextThrTit ? `${tipTextThrTit}:` : ''}{listItem[tipTextThr]} */}
{`${tipTextThrTit}:`} {listItem[tipTextThr] ? listItem[tipTextThr] : '空'}
{tipTextThrTit ? <Text numberOfLines={3} style={[styles.ri_te_ot, styles.te_ot_thr,listStyleTip]}>
{`${tipTextThrTit}:`} {listItem[tipTextThr] ? listItem[tipTextThr] : '无'}
</Text> : null}
{listShowOthOptFlag && listItem[LocalVariable.SUPER_SEL_ALL_ARR] ? <View>
<TouchableOpacity
activeOpacity={.8}
onPress={() => this.showAllTip()}
>
<Text numberOfLines={3} style={[styles.ri_te_ot, styles.te_ot_thr,listStyleTip]}>{showOtherTitle}</Text>
</TouchableOpacity>
{
showOtherFlag ? listItem[LocalVariable.SUPER_SEL_ALL_ARR].map((item, item_index) => {
return <View>
<Text numberOfLines={3} style={[styles.ri_te_ot, styles.te_ot_one,listStyleTip]}>
{item_index+1}. {item.item_name} - <Text style={[styles.ri_te_ot, styles.te_ot_main,listStyleTip]}>{item.manufacturer_product_code} - {item.specification}</Text> - {item.general_name} x {item[LocalVariable.QUANTITY_FIELD]}
</Text>
</View>
}) : null
}
</View> : null}
</TouchableOpacity>
</View>
{
......@@ -254,13 +281,16 @@ const styles = StyleSheet.create({
te_ot_thr:{
color: list_thr_color
},
te_ot_main: {
color: list_one_light_color
},
oth_img_box: {
width: pxSize(58),
height: pxSize(58),
justifyContent: 'center',
alignItems: 'center',
marginRight: 6,
padding: 6
marginRight: 3,
padding: 3
},
round_pic: {
borderColor: 'rgba(0, 0, 0, 0.12)',
......@@ -283,7 +313,7 @@ const styles = StyleSheet.create({
btn_inner: {},
btn_sel_inner: {},
btn_cle_box: {
marginRight: 6,
marginRight: 3,
paddingHorizontal: 4,
paddingVertical: 4
},
......@@ -295,7 +325,7 @@ const styles = StyleSheet.create({
ri_num_box: {
flexDirection: 'row',
alignItems: 'center',
marginLeft: 6,
marginLeft: 3,
backgroundColor: home_background_color
},
show_num_box: {
......
......@@ -618,7 +618,7 @@ class SelfOrderPage extends Component {
if (orgResult.error_code == 0) {
let { data: { organizations } } = orgResult
let { listOptionData } = state
props.requestListDataSuccess(organizations)
// props.requestListDataSuccess(organizations)
let filterOpt = dedupQuoteArray(organizations, 'org_code')
if (filterOpt.length === 0) {
show(`当前${listOptionData[1].title}为空`)
......@@ -681,7 +681,7 @@ class SelfOrderPage extends Component {
if (cusResult.error_code == 0) {
let { data: { customers } } = cusResult
let { listOptionData } = state
props.requestListDataSuccess(customers)
// props.requestListDataSuccess(customers)
let filterOpt = dedupQuoteArray(customers, 'customer_code')
if (filterOpt.length === 0) {
show(`当前${listOptionData[2].title}为空`)
......
......@@ -92,6 +92,8 @@ class ChooseProductPage extends Component {
// 之前选择过值
that.setState({
topProcOptionList: local_sele_pro_options
}, () => {
that.handleTopNav(local_sele_pro_options[0], 0)
})
return
}
......
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