Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
zhangzhonghua
/
BoneHouse_Business_APP
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a6f6cbe7
authored
Jan 04, 2021
by
Denglingling
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
完善自助下单的已选模块
parent
744e4c61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
79 deletions
app/containers/common/ProductModel.js
app/containers/common/ProductModel.js
View file @
a6f6cbe7
...
...
@@ -51,87 +51,50 @@ class ProductModel extends Component {
// 修改已选数据
getTopOptions
()
{
let
{
orginOptionList
}
=
this
.
state
let
otherArr
=
[]
let
otherChildObj
=
{
category_code
:
'local_sign_items'
,
category_name
:
'耗材'
,
[
LocalVariable
.
SELECTED_QUQNTITY
]:
0
,
[
LocalVariable
.
SELECTED_DATA_ARR
]:
[],
[
LocalVariable
.
LOCAL_SECOND_DATA
]:
[]
}
orginOptionList
.
forEach
((
orItem
,
orIndex
)
=>
{
// if (orIndex < 4) {
if
(
orItem
.
category_code
===
LocalVariable
.
SURGICAL_TEMPLATE
||
orItem
.
category_code
===
LocalVariable
.
NAIL_BOX
||
orItem
.
category_code
===
LocalVariable
.
EQUIPMENT_BAG
||
orItem
.
category_code
===
LocalVariable
.
SCATTERED_EQUIPMENT
)
{
otherArr
.
push
(
orItem
)
}
else
{
otherChildObj
[
LocalVariable
.
LOCAL_SECOND_DATA
].
push
(
orItem
)
if
(
orItem
[
LocalVariable
.
SELECTED_QUQNTITY
])
{
otherChildObj
[
LocalVariable
.
SELECTED_QUQNTITY
]
+=
Number
(
orItem
[
LocalVariable
.
SELECTED_QUQNTITY
])
}
if
(
orItem
[
LocalVariable
.
SELECTED_DATA_ARR
])
{
orItem
[
LocalVariable
.
SELECTED_DATA_ARR
].
forEach
(
function
(
sign_it
)
{
sign_it
[
LocalVariable
.
SUPER_TITLE_NAME
]
=
orItem
.
category_name
})
otherChildObj
[
LocalVariable
.
SELECTED_DATA_ARR
].
push
(...
orItem
[
LocalVariable
.
SELECTED_DATA_ARR
])
}
}
})
// otherArr.push(otherChildObj)
if
(
otherChildObj
[
LocalVariable
.
SELECTED_QUQNTITY
]
>
0
)
{
otherArr
.
push
(
otherChildObj
)
}
this
.
setState
({
topProcOptionList
:
otherArr
})
// let shppArr = []
// orginOptionList.map((top_item) => {
// if (top_item.leftOptionList && top_item.leftOptionList.length > 0) {
// let otherArr = []
// let otherChildObj = {
// category_code: 'local_sign_items',
// category_name: '耗材',
// [LocalVariable.SELECTED_QUQNTITY]: 0,
// [LocalVariable.SELECTED_DATA_ARR]: [],
// [LocalVariable.LOCAL_SECOND_DATA]: []
// let { orginOptionList } = this.state
// let otherArr = []
// let otherChildObj = {
// category_code: 'local_sign_items',
// category_name: '耗材',
// [LocalVariable.SELECTED_QUQNTITY]: 0,
// [LocalVariable.SELECTED_DATA_ARR]: [],
// [LocalVariable.LOCAL_SECOND_DATA]: []
// }
// orginOptionList.forEach((orItem, orIndex) => {
// // if (orIndex < 4) {
// if (orItem.category_code === LocalVariable.SURGICAL_TEMPLATE || orItem.category_code === LocalVariable.NAIL_BOX || orItem.category_code === LocalVariable.EQUIPMENT_BAG || orItem.category_code === LocalVariable.SCATTERED_EQUIPMENT) {
// otherArr.push(orItem)
// } else {
// otherChildObj[LocalVariable.LOCAL_SECOND_DATA].push(orItem)
// if (orItem[LocalVariable.SELECTED_QUQNTITY]) {
// otherChildObj[LocalVariable.SELECTED_QUQNTITY] += Number(orItem[LocalVariable.SELECTED_QUQNTITY])
// }
// if (orItem[LocalVariable.SELECTED_DATA_ARR]) {
// orItem[LocalVariable.SELECTED_DATA_ARR].forEach(function (sign_it) {
// sign_it[LocalVariable.SUPER_TITLE_NAME] = orItem.category_name
// })
// otherChildObj[LocalVariable.SELECTED_DATA_ARR].push(...orItem[LocalVariable.SELECTED_DATA_ARR])
// }
// top_item.leftOptionList.forEach((orItem, orIndex) => {
// if (orIndex < 4) {
// otherArr.push(orItem)
// } else {
// otherChildObj[LocalVariable.LOCAL_SECOND_DATA].push(orItem)
// if (orItem[LocalVariable.SELECTED_QUQNTITY]) {
// otherChildObj[LocalVariable.SELECTED_QUQNTITY] += Number(orItem[LocalVariable.SELECTED_QUQNTITY])
// }
// if (orItem[LocalVariable.SELECTED_DATA_ARR]) {
// orItem[LocalVariable.SELECTED_DATA_ARR].forEach(function (sign_it) {
// sign_it[LocalVariable.SUPER_TITLE_NAME] = orItem.category_name
// })
// otherChildObj[LocalVariable.SELECTED_DATA_ARR].push(...orItem[LocalVariable.SELECTED_DATA_ARR])
// }
// }
// })
// otherArr.push(otherChildObj)
// top_item.selectLeftOptionList = otherArr
// shppArr.push(top_item)
// }
// })
// // otherArr.push(otherChildObj)
// if (otherChildObj[LocalVariable.SELECTED_QUQNTITY] > 0) {
// otherArr.push(otherChildObj)
// }
// this.setState({
// topProcOptionList:
shpp
Arr
// topProcOptionList:
other
Arr
// })
}
// 恢复耗材以外的数据
setTopOrginTopData
(
curOptions
)
{
let
{
orginOptionList
}
=
this
.
state
orginOptionList
.
map
(
function
(
orgItem
,
orgIndex
)
{
if
(
orgIndex
<
4
)
{
orgItem
=
curOptions
[
orgIndex
]
}
})
this
.
props
.
modelCallBack
(
orginOptionList
)
//
let { orginOptionList } = this.state
//
orginOptionList.map(function (orgItem, orgIndex) {
//
if (orgIndex < 4) {
//
orgItem = curOptions[orgIndex]
//
}
//
})
//
this.props.modelCallBack(orginOptionList)
}
// 选好了 点击
...
...
@@ -554,7 +517,9 @@ class ProductModel extends Component {
handleClearRubbish
()
{
let
{
orginOptionList
,
topProcOptionList
}
=
this
.
state
// this.refs.ClearAllModel.show('清空当前所有数据')
console
.
log
(
'this--'
,
this
)
console
.
log
(
'清空🎹所有==--'
,
this
)
// this.modelClearAllCB(true)
let
that
=
this
...
...
@@ -562,14 +527,19 @@ class ProductModel extends Component {
top_item
[
LocalVariable
.
SELECTED_QUQNTITY
]
=
0
top_item
[
LocalVariable
.
SELECTED_DATA_ARR
]
=
[]
})
that
.
props
.
changeCallBack
(
topProcOptionList
)
//
that.props.changeCallBack(topProcOptionList)
that
.
setState
({
topProcOptionList
:
topProcOptionList
}
)
setTimeout
(()
=>
{
}
,
()
=>
{
that
.
props
.
changeCallBack
(
topProcOptionList
)
that
.
closeModal
()
},
300
)
})
// setTimeout(() => {
// that.closeModal()
// }, 300)
}
// 清空当前
...
...
@@ -975,7 +945,7 @@ class ProductModel extends Component {
<
View
style
=
{
styles
.
opt_area
}
>
<
View
style
=
{
styles
.
modal_style
}
>
<
View
style
=
{
styles
.
scro_box
}
>
{
this
.
renderRubbish
()
}
{
/* {this.renderRubbish()} */
}
{
/* {this.renderTopSuppItem()} */
}
...
...
@@ -1042,7 +1012,8 @@ const styles = StyleSheet.create({
},
top_box
:
{
width
:
Width
(),
paddingHorizontal
:
20
paddingHorizontal
:
20
,
paddingTop
:
10
},
top_scroll_cont
:
{
paddingBottom
:
4
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment