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
dc87fb35
authored
May 26, 2022
by
lhc
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat: 添加customer_code
parent
a311bae1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1143 additions
and
1062 deletions
app/containers/selfOrder/SelfOrderPage.js
app/containers/selfOrder/module/ChooseProductPage.js
app/containers/selfOrder/module/EditThirdLevelPage.js
app/containers/selfOrder/module/ProductRightStyle.js
app/containers/selfOrder/module/SearchPage.js
app/containers/selfOrder/SelfOrderPage.js
View file @
dc87fb35
This diff could not be displayed because it is too large.
app/containers/selfOrder/module/ChooseProductPage.js
View file @
dc87fb35
...
...
@@ -300,6 +300,7 @@ class ChooseProductPage extends Component {
if
(
navigation
.
state
.
params
.
selfData
)
{
cur_org_code
=
navigation
.
state
.
params
.
selfData
.
org_code
cur_doctor_name
=
navigation
.
state
.
params
.
selfData
.
doctor_name
customer_code
=
navigation
.
state
.
params
.
selfData
.
customer_code
}
let
topItem
=
topProcOptionList
[
topActiveIndex
]
if
(
leftIndex
===
0
)
{
...
...
@@ -307,6 +308,7 @@ class ChooseProductPage extends Component {
access_token
:
token
,
org_code
:
cur_org_code
,
manufacturer_code
:
topItem
.
supplier_code
,
customer_code
,
// doctor_name: cur_doctor_name
}
console
.
log
(
'params='
,
params
)
...
...
@@ -343,6 +345,7 @@ class ChooseProductPage extends Component {
access_token
:
token
,
manufacturer_code
:
topItem
.
supplier_code
,
category_code
:
cur_category_code
,
customer_code
,
}
console
.
log
(
'params='
,
params
)
let
nail_equip_head_search
=
await
reqNailEquipHeadSearch
(
global_domain_config
,
params
)
...
...
@@ -372,6 +375,7 @@ class ChooseProductPage extends Component {
let
params
=
{
access_token
:
token
,
manufacturer_code
:
topItem
.
supplier_code
,
customer_code
,
}
console
.
log
(
'params='
,
params
)
let
scat_head_search
=
await
reqScatEquipmentSearch
(
global_domain_config
,
params
)
...
...
@@ -404,6 +408,7 @@ class ChooseProductPage extends Component {
manufacturer_code
:
topItem
.
supplier_code
,
org_code
:
cur_org_code
,
leftIndex
:
leftIndex
,
// 测试
customer_code
,
}
console
.
log
(
'params='
,
params
)
let
single_all_search
=
await
reqSingleConsumSearch
(
global_domain_config
,
params
)
...
...
@@ -898,6 +903,7 @@ class ChooseProductPage extends Component {
selfData
:
{
org_code
:
cur_org_code
,
authorizations
,
customer_code
:
navigation
.
state
.
params
.
selfData
.
customer_code
,
},
})
}}
...
...
app/containers/selfOrder/module/EditThirdLevelPage.js
View file @
dc87fb35
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
StyleSheet
,
SafeAreaView
,
ScrollView
,
FlatList
,
Text
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
;
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
{
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'
;
import
React
,
{
Component
}
from
'react'
import
{
View
,
StyleSheet
,
SafeAreaView
,
ScrollView
,
FlatList
,
Text
}
from
'react-native'
import
{
connect
}
from
'react-redux'
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
{
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
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
topProcOptionList
:
[],
topActiveIndex
:
0
,
onlyShow
:
false
,
// 只展示
onlySignSelect
:
false
,
// 单选
defalutTopItem
:
[{
// 手术套包显示
"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
.
EQUIPMENT_BAG
,
"category_name"
:
"器械包"
,
"cate_local_icon"
:
require
(
'../../../images/equip_bag.png'
)
},
{
"category_code"
:
LocalVariable
.
SCATTERED_EQUIPMENT
,
"category_name"
:
"零散器械"
,
"cate_local_icon"
:
require
(
'../../../images/auxili_tool.png'
)
}],
superData
:
{}
}
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
topProcOptionList
:
[],
topActiveIndex
:
0
,
onlyShow
:
false
,
// 只展示
onlySignSelect
:
false
,
// 单选
defalutTopItem
:
[
{
// 手术套包显示
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
.
EQUIPMENT_BAG
,
category_name
:
'器械包'
,
cate_local_icon
:
require
(
'../../../images/equip_bag.png'
),
},
{
category_code
:
LocalVariable
.
SCATTERED_EQUIPMENT
,
category_name
:
'零散器械'
,
cate_local_icon
:
require
(
'../../../images/auxili_tool.png'
),
},
],
superData
:
{},
}
}
componentDidMount
()
{
this
.
initGetData
()
}
componentDidMount
()
{
this
.
initGetData
()
}
// 初始化获取数据
async
initGetData
()
{
let
that
=
this
let
{
superData
}
=
that
.
props
.
navigation
.
state
.
params
let
{
token
,
global_domain_config
}
=
that
.
props
let
{
defalutTopItem
,
topProcOptionList
}
=
that
.
state
let
{
leftIndex
,
superItem
}
=
superData
that
.
refs
.
LoadingModel
.
show
()
that
.
setState
({
superData
:
cloneObject
(
superData
)
})
// 初始化获取数据
async
initGetData
()
{
let
that
=
this
let
{
superData
,
customer_code
}
=
that
.
props
.
navigation
.
state
.
params
let
{
token
,
global_domain_config
}
=
that
.
props
let
{
defalutTopItem
,
topProcOptionList
}
=
that
.
state
let
{
leftIndex
,
superItem
}
=
superData
that
.
refs
.
LoadingModel
.
show
()
that
.
setState
({
superData
:
cloneObject
(
superData
),
})
if
(
leftIndex
===
0
)
{
let
params
=
{
access_token
:
token
,
template_number
:
superItem
.
template_number
}
let
sur_line_search
=
await
reqSurTempLineSearch
(
global_domain_config
,
params
)
console
.
log
(
'res_line_1 : '
,
sur_line_search
)
if
(
sur_line_search
.
error_code
===
0
)
{
let
{
data
}
=
sur_line_search
topProcOptionList
=
cloneObject
(
defalutTopItem
)
topProcOptionList
.
forEach
(
function
(
topIt
)
{
topIt
[
LocalVariable
.
LOCAL_THRID_CONT_DATA
]
=
[]
topIt
[
LocalVariable
.
SELECTED_DATA_ARR
]
=
[]
topIt
[
LocalVariable
.
SELECTED_QUQNTITY
]
=
0
})
if
(
data
.
items
)
{
topProcOptionList
[
0
].
localThridContData
=
data
.
items
}
if
(
data
.
nail_box
)
{
topProcOptionList
[
1
].
localThridContData
=
data
.
nail_box
}
if
(
data
.
item_package
)
{
topProcOptionList
[
2
].
localThridContData
=
data
.
item_package
}
if
(
data
.
tool
)
{
topProcOptionList
[
3
].
localThridContData
=
data
.
tool
}
that
.
setState
({
topProcOptionList
:
topProcOptionList
},
()
=>
{
that
.
refs
.
LoadingModel
.
hide
()
that
.
setAllSelectData
()
})
}
else
{
that
.
showRrrorTip
(
sur_line_search
)
}
}
else
if
(
leftIndex
===
1
)
{
// let params = {
// access_token: token,
// 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)
if
(
leftIndex
===
0
)
{
let
params
=
{
access_token
:
token
,
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
)
if
(
sur_line_search
.
error_code
===
0
)
{
let
{
data
}
=
sur_line_search
topProcOptionList
=
cloneObject
(
defalutTopItem
)
topProcOptionList
.
forEach
(
function
(
topIt
)
{
topIt
[
LocalVariable
.
LOCAL_THRID_CONT_DATA
]
=
[]
topIt
[
LocalVariable
.
SELECTED_DATA_ARR
]
=
[]
topIt
[
LocalVariable
.
SELECTED_QUQNTITY
]
=
0
})
if
(
data
.
items
)
{
topProcOptionList
[
0
].
localThridContData
=
data
.
items
}
if
(
data
.
nail_box
)
{
topProcOptionList
[
1
].
localThridContData
=
data
.
nail_box
}
if
(
data
.
item_package
)
{
topProcOptionList
[
2
].
localThridContData
=
data
.
item_package
}
if
(
data
.
tool
)
{
topProcOptionList
[
3
].
localThridContData
=
data
.
tool
}
that
.
setState
(
{
topProcOptionList
:
topProcOptionList
,
},
()
=>
{
that
.
refs
.
LoadingModel
.
hide
()
that
.
setAllSelectData
()
},
)
}
else
{
that
.
showRrrorTip
(
sur_line_search
)
}
}
else
if
(
leftIndex
===
1
)
{
// let params = {
// access_token: token,
// 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
=
{
access_token
:
token
,
item_code
:
superItem
.
item_code
,
serial_number
:
superItem
.
serial_number
,
inv_code
:
superItem
.
inv_code
,
nail_box_flag
:
'N'
let
params
=
{
access_token
:
token
,
item_code
:
superItem
.
item_code
,
serial_number
:
superItem
.
serial_number
,
inv_code
:
superItem
.
inv_code
,
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
)
{
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
=
"默认区域"
}
})
}
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
(
nail_line_search
)
}
}
else
if
(
leftIndex
===
2
)
{
// let params = {
// access_token: token,
// inv_code: superItem.inv_code,
// 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)
})
}
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
(
nail_line_search
)
}
}
else
if
(
leftIndex
===
2
)
{
// let params = {
// access_token: token,
// inv_code: superItem.inv_code,
// 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
=
{
access_token
:
token
,
item_code
:
superItem
.
item_code
,
serial_number
:
superItem
.
serial_number
,
inv_code
:
superItem
.
inv_code
,
nail_box_flag
:
'N'
}
let
equip_line_search
=
await
reqNailAndEquipSearch
(
global_domain_config
,
params
)
console
.
log
(
'res_line_1 : '
,
equip_line_search
)
if
(
equip_line_search
.
error_code
===
0
)
{
let
{
data
}
=
equip_line_search
let
params
=
{
access_token
:
token
,
item_code
:
superItem
.
item_code
,
serial_number
:
superItem
.
serial_number
,
inv_code
:
superItem
.
inv_code
,
nail_box_flag
:
'N'
,
}
let
equip_line_search
=
await
reqNailAndEquipSearch
(
global_domain_config
,
params
)
console
.
log
(
'res_line_1 : '
,
equip_line_search
)
if
(
equip_line_search
.
error_code
===
0
)
{
let
{
data
}
=
equip_line_search
// data[LocalVariable.LOCAL_THRID_CONT_DATA] = data['package_components']
// data[LocalVariable.SELECTED_DATA_ARR] = []
// data[LocalVariable.SELECTED_QUQNTITY] = 0
// topProcOptionList[0] = cloneObject(data)
// data[LocalVariable.LOCAL_THRID_CONT_DATA] = data['package_components']
// data[LocalVariable.SELECTED_DATA_ARR] = []
// data[LocalVariable.SELECTED_QUQNTITY] = 0
// topProcOptionList[0] = cloneObject(data)
if
(
data
.
segemt
&&
data
.
segemt
.
length
>
0
)
{
data
.
segemt
.
forEach
(
function
(
seg_it
)
{
if
(
seg_it
.
segment_code
==
"0"
)
{
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
()
})
if
(
data
.
segemt
&&
data
.
segemt
.
length
>
0
)
{
data
.
segemt
.
forEach
(
function
(
seg_it
)
{
if
(
seg_it
.
segment_code
==
'0'
)
{
seg_it
.
segment_name
=
'未分层器械'
}
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
)
{
let
{
topProcOptionList
,
topActiveIndex
}
=
this
.
state
let
that
=
this
if
(
dataName
&&
topProcOptionList
[
topActiveIndex
][
dataName
])
{
topProcOptionList
.
map
(
function
(
listItem
,
listIndex
)
{
if
(
listIndex
===
topActiveIndex
)
{
listItem
[
dataName
][
index
]
=
item
}
})
that
.
setState
({
topProcOptionList
},
()
=>
{
that
.
setAllSelectData
()
})
// 计算后的回调
handleCalCallBack
(
item
,
index
,
dataName
)
{
let
{
topProcOptionList
,
topActiveIndex
}
=
this
.
state
let
that
=
this
if
(
dataName
&&
topProcOptionList
[
topActiveIndex
][
dataName
])
{
topProcOptionList
.
map
(
function
(
listItem
,
listIndex
)
{
if
(
listIndex
===
topActiveIndex
)
{
listItem
[
dataName
][
index
]
=
item
}
})
that
.
setState
(
{
topProcOptionList
,
},
()
=>
{
that
.
setAllSelectData
()
},
)
}
}
// 设置当前所有已选值
setAllSelectData
()
{
let
{
topProcOptionList
}
=
this
.
state
topProcOptionList
.
map
(
function
(
listItem
)
{
listItem
[
LocalVariable
.
SELECTED_QUQNTITY
]
=
0
listItem
[
LocalVariable
.
SELECTED_DATA_ARR
]
=
[]
if
(
listItem
[
LocalVariable
.
LOCAL_THRID_CONT_DATA
].
length
)
{
listItem
[
LocalVariable
.
LOCAL_THRID_CONT_DATA
].
forEach
(
function
(
chItem
)
{
if
(
chItem
[
LocalVariable
.
QUANTITY_FIELD
])
{
listItem
[
LocalVariable
.
SELECTED_QUQNTITY
]
+=
Number
(
chItem
[
LocalVariable
.
QUANTITY_FIELD
])
listItem
[
LocalVariable
.
SELECTED_DATA_ARR
].
push
(
chItem
)
}
})
}
// 设置当前所有已选值
setAllSelectData
()
{
let
{
topProcOptionList
}
=
this
.
state
topProcOptionList
.
map
(
function
(
listItem
)
{
listItem
[
LocalVariable
.
SELECTED_QUQNTITY
]
=
0
listItem
[
LocalVariable
.
SELECTED_DATA_ARR
]
=
[]
if
(
listItem
[
LocalVariable
.
LOCAL_THRID_CONT_DATA
].
length
)
{
listItem
[
LocalVariable
.
LOCAL_THRID_CONT_DATA
].
forEach
(
function
(
chItem
)
{
if
(
chItem
[
LocalVariable
.
QUANTITY_FIELD
])
{
listItem
[
LocalVariable
.
SELECTED_QUQNTITY
]
+=
Number
(
chItem
[
LocalVariable
.
QUANTITY_FIELD
])
listItem
[
LocalVariable
.
SELECTED_DATA_ARR
].
push
(
chItem
)
}
})
this
.
setState
({
topProcOptionList
})
}
}
})
this
.
setState
({
topProcOptionList
,
})
}
// 点击顶部菜单
handleTopNav
(
item
,
index
)
{
this
.
setState
({
topActiveIndex
:
index
})
}
// 点击顶部菜单
handleTopNav
(
item
,
index
)
{
this
.
setState
({
topActiveIndex
:
index
,
})
}
// 点击编辑完成
handleSubmit
()
{
let
{
topProcOptionList
,
superData
}
=
this
.
state
let
{
params
}
=
this
.
props
.
navigation
.
state
params
.
childrenPageCallBack
(
topProcOptionList
,
superData
.
superIndex
)
this
.
props
.
navigation
.
goBack
()
}
// 点击编辑完成
handleSubmit
()
{
let
{
topProcOptionList
,
superData
}
=
this
.
state
let
{
params
}
=
this
.
props
.
navigation
.
state
params
.
childrenPageCallBack
(
topProcOptionList
,
superData
.
superIndex
)
this
.
props
.
navigation
.
goBack
()
}
// 接口错误提示
showRrrorTip
(
result
)
{
this
.
refs
.
LoadingModel
.
hide
()
if
(
result
.
error_code
==
41006
)
{
show
(
'登录过期,请重新登录'
);
this
.
props
.
exitLoginStatus
();
}
else
{
let
error_msg
=
result
.
error_msg
||
result
.
message
show
(
error_msg
);
}
// 接口错误提示
showRrrorTip
(
result
)
{
this
.
refs
.
LoadingModel
.
hide
()
if
(
result
.
error_code
==
41006
)
{
show
(
'登录过期,请重新登录'
)
this
.
props
.
exitLoginStatus
()
}
else
{
let
error_msg
=
result
.
error_msg
||
result
.
message
show
(
error_msg
)
}
}
// 返回顶部编辑选项
renderTopProItem
()
{
let
{
topProcOptionList
,
topActiveIndex
,
superData
}
=
this
.
state
let
{
leftIndex
}
=
superData
let
curTit
=
''
,
curTopList
=
topProcOptionList
if
(
leftIndex
===
0
)
{
curTit
=
'category_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'
}
/
>
)
// 返回顶部编辑选项
renderTopProItem
()
{
let
{
topProcOptionList
,
topActiveIndex
,
superData
}
=
this
.
state
let
{
leftIndex
}
=
superData
let
curTit
=
''
,
curTopList
=
topProcOptionList
if
(
leftIndex
===
0
)
{
curTit
=
'category_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'
}
/
>
)
}
// 返回底部主要元素
renderContItem
()
{
let
{
topProcOptionList
,
topActiveIndex
}
=
this
.
state
let
localThridContData
=
[]
let
imgIconArr
=
''
let
topItem
=
topProcOptionList
[
topActiveIndex
]
if
(
topItem
)
{
localThridContData
=
topItem
[
LocalVariable
.
LOCAL_THRID_CONT_DATA
]
}
// 返回底部主要元素
renderContItem
()
{
let
{
topProcOptionList
,
topActiveIndex
}
=
this
.
state
let
localThridContData
=
[]
let
imgIconArr
=
''
let
topItem
=
topProcOptionList
[
topActiveIndex
]
if
(
topItem
)
{
localThridContData
=
topItem
[
LocalVariable
.
LOCAL_THRID_CONT_DATA
]
}
return
(
<
View
style
=
{
styles
.
edit_cont
}
>
{
imgIconArr
?
<
PictureZoom
listImageIndex
=
{
0
}
listImageUrls
=
{
imgIconArr
}
listStyleImage
=
{
styles
.
thr_head_tit_img
}
listPicType
=
{
'RECTANGLE'
}
/> : null
}
<
ScrollView
style
=
{
styles
.
edit_scroll_cont
}
showsVerticalScrollIndicator
=
{
false
}
>
{
localThridContData
.
length
>
0
?
<
FlatList
style
=
{
styles
.
edit_list
}
keyExtractor
=
{
item
=>
item
.
id
}
data
=
{
localThridContData
}
extraData
=
{
this
.
state
}
renderItem
=
{({
item
,
index
})
=>
this
.
renderContColumnItem
(
item
,
index
)}
/> : <PicListNoData /
>
}
<
/ScrollView
>
return
(
<
View
style
=
{
styles
.
edit_cont
}
>
{
imgIconArr
?
(
<
PictureZoom
listImageIndex
=
{
0
}
listImageUrls
=
{
imgIconArr
}
listStyleImage
=
{
styles
.
thr_head_tit_img
}
listPicType
=
{
'RECTANGLE'
}
/
>
)
:
null
}
<
ScrollView
style
=
{
styles
.
edit_scroll_cont
}
showsVerticalScrollIndicator
=
{
false
}
>
{
localThridContData
.
length
>
0
?
(
<
FlatList
style
=
{
styles
.
edit_list
}
keyExtractor
=
{
item
=>
item
.
id
}
data
=
{
localThridContData
}
extraData
=
{
this
.
state
}
renderItem
=
{({
item
,
index
})
=>
this
.
renderContColumnItem
(
item
,
index
)}
/
>
)
:
(
<
PicListNoData
/>
)}
<
/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
=
'规格型号'
}
// 返回每一列元素
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'
// curTipStr = 'general_name'
// curTipOne = 'specification'
// curTipStrTit = '通用名称'
// curTipOneTit = '规格型号'
curCalField
=
LocalVariable
.
QUANTITY_FIELD
curImgIcon
=
'photos'
// curTit = 'item_name'
// curTipStr = 'general_name'
// curTipOne = 'specification'
// curTipStrTit = '通用名称'
// curTipOneTit = '规格型号'
curCalField
=
LocalVariable
.
QUANTITY_FIELD
curImgIcon
=
'photos'
return
(
<
SafeAreaView
style
=
{
styles
.
column_container
}
key
=
{
'item_code'
+
index
}
>
<
PicTitDetaiCalcu
listItem
=
{
item
}
listIndex
=
{
index
}
calField
=
{
curCalField
}
subCalCallBack
=
{(
item
,
index
)
=>
this
.
handleCalCallBack
(
item
,
index
,
LocalVariable
.
LOCAL_THRID_CONT_DATA
)}
titText
=
{
curTit
}
tipTextStr
=
{
curTipStr
}
tipTextOne
=
{
curTipOne
}
tipTextTwo
=
{
curTipTwo
}
titTextTit
=
{
curTxtTit
}
tipTextStrTit
=
{
curTipStrTit
}
tipTextOneTit
=
{
curTipOneTit
}
tipTextTwoTit
=
{
curTipTwoTit
}
listImgIcon
=
{
curImgIcon
}
listPicType
=
{
'ROUND'
}
onlyShowNum
=
{
onlyShow
}
onlyShowSelect
=
{
onlySignSelect
}
listStyleBox
=
{
styles
.
list_style_box
}
/
>
<
/SafeAreaView
>
)
}
return
(
<
SafeAreaView
style
=
{
styles
.
column_container
}
key
=
{
'item_code'
+
index
}
>
<
PicTitDetaiCalcu
listItem
=
{
item
}
listIndex
=
{
index
}
calField
=
{
curCalField
}
subCalCallBack
=
{(
item
,
index
)
=>
this
.
handleCalCallBack
(
item
,
index
,
LocalVariable
.
LOCAL_THRID_CONT_DATA
)}
titText
=
{
curTit
}
tipTextStr
=
{
curTipStr
}
tipTextOne
=
{
curTipOne
}
tipTextTwo
=
{
curTipTwo
}
titTextTit
=
{
curTxtTit
}
tipTextStrTit
=
{
curTipStrTit
}
tipTextOneTit
=
{
curTipOneTit
}
tipTextTwoTit
=
{
curTipTwoTit
}
listImgIcon
=
{
curImgIcon
}
listPicType
=
{
'ROUND'
}
onlyShowNum
=
{
onlyShow
}
onlyShowSelect
=
{
onlySignSelect
}
listStyleBox
=
{
styles
.
list_style_box
}
/
>
<
/SafeAreaView
>
)
}
// 返回正在加载中
renderLodingItem
()
{
return
(
<
LoadingModel
ref
=
"LoadingModel"
/>
)
}
// 返回正在加载中
renderLodingItem
()
{
return
<
LoadingModel
ref
=
"LoadingModel"
/>
}
render
()
{
let
{
navigation
}
=
this
.
props
let
{
title
}
=
navigation
.
state
.
params
let
{
onlyShow
}
=
this
.
state
render
()
{
let
{
navigation
}
=
this
.
props
let
{
title
}
=
navigation
.
state
.
params
let
{
onlyShow
}
=
this
.
state
return
(
<
View
style
=
{
styles
.
edit_container
}
>
<
StatusBarView
isReactStackNavigator
=
{
true
}
backgroundColor
=
{
promary_color
}
barStyle
=
'light-content'
/>
<
SafeAreaView
style
=
{
safe_view
}
>
<
HeadBackItem
title
=
{
title
}
navigation
=
{
navigation
}
/
>
<
View
style
=
{
styles
.
edit_main
}
>
{
this
.
renderTopProItem
()}
{
this
.
renderContItem
()}
<
/View
>
{
!
onlyShow
?
<
View
style
=
{
styles
.
btom_btn_box
}
>
<
FooterBtnStyle
style
=
{
styles
.
sub_btn_pro
}
activeOpacity
=
{.
8
}
title
=
{
'编辑完成'
}
textStyle
=
{
styles
.
sub_btn_txt
}
onPress
=
{()
=>
this
.
handleSubmit
()}
/
>
<
/View> : null
}
<
/SafeAreaView
>
return
(
<
View
style
=
{
styles
.
edit_container
}
>
<
StatusBarView
isReactStackNavigator
=
{
true
}
backgroundColor
=
{
promary_color
}
barStyle
=
"light-content"
/>
<
SafeAreaView
style
=
{
safe_view
}
>
<
HeadBackItem
title
=
{
title
}
navigation
=
{
navigation
}
/
>
<
View
style
=
{
styles
.
edit_main
}
>
{
this
.
renderTopProItem
()}
{
this
.
renderContItem
()}
<
/View
>
{
!
onlyShow
?
(
<
View
style
=
{
styles
.
btom_btn_box
}
>
<
FooterBtnStyle
style
=
{
styles
.
sub_btn_pro
}
activeOpacity
=
{
0.8
}
title
=
{
'编辑完成'
}
textStyle
=
{
styles
.
sub_btn_txt
}
onPress
=
{()
=>
this
.
handleSubmit
()}
/
>
<
/View
>
);
}
)
:
null
}
<
/SafeAreaView
>
<
/View
>
)
}
}
const
styles
=
StyleSheet
.
create
({
edit_container
:
{
flex
:
1
,
backgroundColor
:
home_background_color
,
padding
:
0
,
margin
:
0
},
edit_main
:
{
flex
:
1
},
top_box
:
{
width
:
Width
(),
paddingHorizontal
:
20
,
paddingTop
:
12
},
top_scroll_cont
:
{},
top_touch_cont
:
{},
top_inner
:
{},
se_thr_width
:
{
minWidth
:
42
},
four_width
:
{
minWidth
:
28
},
top_inner_act
:
{},
top_tit
:
{
fontSize
:
14
},
top_tit_act
:
{
color
:
first_text_color
,
fontWeight
:
'bold'
},
edit_cont
:
{
marginTop
:
14
,
flex
:
1
,
paddingHorizontal
:
20
},
edit_list
:
{},
column_container
:
{
marginBottom
:
10
,
paddingHorizontal
:
10
,
paddingVertical
:
6
,
backgroundColor
:
foundation_color
edit_container
:
{
flex
:
1
,
backgroundColor
:
home_background_color
,
padding
:
0
,
margin
:
0
,
},
edit_main
:
{
flex
:
1
,
},
top_box
:
{
width
:
Width
(),
paddingHorizontal
:
20
,
paddingTop
:
12
,
},
top_scroll_cont
:
{},
top_touch_cont
:
{},
top_inner
:
{},
se_thr_width
:
{
minWidth
:
42
,
},
four_width
:
{
minWidth
:
28
,
},
top_inner_act
:
{},
top_tit
:
{
fontSize
:
14
,
},
top_tit_act
:
{
color
:
first_text_color
,
fontWeight
:
'bold'
,
},
edit_cont
:
{
marginTop
:
14
,
flex
:
1
,
paddingHorizontal
:
20
,
},
edit_list
:
{},
column_container
:
{
marginBottom
:
10
,
paddingHorizontal
:
10
,
paddingVertical
:
6
,
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
:
{},
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
},
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
:
{}
shadowOpacity
:
1
,
elevation
:
2
,
borderWidth
:
0
,
},
sub_btn_pro
:
{
backgroundColor
:
promary_color
,
marginBottom
:
14
,
},
thr_head_tit_img
:
{
borderWidth
:
0.5
,
borderColor
:
'rgba(0, 0, 0, 0.12)'
,
marginBottom
:
10
,
},
list_style_box
:
{
borderBottomWidth
:
0
,
},
sub_btn_txt
:
{},
})
const
mapStateToProps
=
(
state
)
=>
{
return
{
userInfo
:
state
.
login
.
userInfo
,
token
:
state
.
login
.
token
,
loginState
:
state
.
login
.
loginState
,
global_domain_config
:
state
.
login
.
global_domain_config
}
const
mapStateToProps
=
state
=>
{
return
{
userInfo
:
state
.
login
.
userInfo
,
token
:
state
.
login
.
token
,
loginState
:
state
.
login
.
loginState
,
global_domain_config
:
state
.
login
.
global_domain_config
,
}
}
const
mapDispatchToProps
=
(
dispatch
)
=>
{
return
{
exitLoginStatus
:
()
=>
{
dispatch
(
exitLoginStatus
())
},
}
const
mapDispatchToProps
=
dispatch
=>
{
return
{
exitLoginStatus
:
()
=>
{
dispatch
(
exitLoginStatus
())
},
}
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
EditThirdLevelPage
)
;
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
EditThirdLevelPage
)
app/containers/selfOrder/module/ProductRightStyle.js
View file @
dc87fb35
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
,
TouchableOpacity
,
Image
,
ScrollView
,
FlatList
,
SafeAreaView
}
from
'react-native'
;
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
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'
);
import
React
,
{
Component
}
from
'react'
import
{
View
,
Text
,
StyleSheet
,
TouchableOpacity
,
Image
,
ScrollView
,
FlatList
,
SafeAreaView
}
from
'react-native'
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
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
{
static
propTypres
=
{
superCallBack
:
PropTypes
.
func
,
// 回调计算函数
superReduceBack
:
PropTypes
.
func
,
// 减法回调
superLeftData
:
PropTypes
.
object
,
// 三级大类数据
superStencilData
:
PropTypes
.
array
,
// 当前右侧二级数据
leftIndex
:
PropTypes
.
numberm
,
// 左侧index
}
static
propTypres
=
{
superCallBack
:
PropTypes
.
func
,
// 回调计算函数
superReduceBack
:
PropTypes
.
func
,
// 减法回调
superLeftData
:
PropTypes
.
object
,
// 三级大类数据
superStencilData
:
PropTypes
.
array
,
// 当前右侧二级数据
leftIndex
:
PropTypes
.
numberm
,
// 左侧index
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
rightSecondData
:
this
.
props
.
superStencilData
,
// 右侧数据-手术套包、螺钉盒、器械包、零散器械
rowSingleData
:
[],
// 耗材-小类
thridIsVisible
:
false
,
// 小类展示
curThridObj
:
{
superItem
:
''
,
superIndex
:
''
,
title
:
''
,
image
:
''
,
},
}
}
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
rightSecondData
:
this
.
props
.
superStencilData
,
// 右侧数据-手术套包、螺钉盒、器械包、零散器械
rowSingleData
:
[],
// 耗材-小类
thridIsVisible
:
false
,
// 小类展示
curThridObj
:
{
superItem
:
''
,
superIndex
:
''
,
title
:
''
,
image
:
''
}
}
componentWillReceiveProps
(
nextProps
)
{
if
(
this
.
state
.
thridIsVisible
!=
nextProps
.
defaultThridShow
)
{
this
.
setState
({
thridIsVisible
:
nextProps
.
defaultThridShow
})
}
componentWillReceiveProps
(
nextProps
)
{
if
(
this
.
state
.
thridIsVisible
!=
nextProps
.
defaultThridShow
)
{
this
.
setState
({
thridIsVisible
:
nextProps
.
defaultThridShow
});
}
if
(
nextProps
.
superStencilData
)
{
this
.
setState
({
rightSecondData
:
nextProps
.
superStencilData
});
}
if
(
nextProps
.
superStencilData
)
{
this
.
setState
({
rightSecondData
:
nextProps
.
superStencilData
})
}
}
// 右侧 二级数据标题 点击
TitleClickEvent
(
item
,
index
)
{
let
{
leftIndex
}
=
this
.
props
if
(
leftIndex
>=
0
&&
leftIndex
<
3
)
{
let
curThirdShow
=
false
,
curTit
=
'编辑模板'
if
(
leftIndex
===
1
)
{
curThirdShow
=
true
curTit
=
'钉盒明细'
}
else
if
(
leftIndex
===
2
)
{
curThirdShow
=
true
curTit
=
'器械包明细'
}
this
.
props
.
navigation
.
navigate
(
'EditThirdLevelPage'
,
{
title
:
curTit
,
superData
:
{
superItem
:
item
,
superIndex
:
index
,
leftIndex
:
leftIndex
,
thirdShow
:
curThirdShow
},
childrenPageCallBack
:
this
.
childrenPageCallBack
.
bind
(
this
)
// 传递函数,编辑完成时调用
})
}
else
if
(
leftIndex
>
3
)
{
// 耗材 中级标题点击
this
.
changeThrShow
(
true
,
item
,
index
)
}
// 右侧 二级数据标题 点击
TitleClickEvent
(
item
,
index
)
{
let
{
navigation
}
=
this
.
props
let
{
leftIndex
}
=
this
.
props
if
(
leftIndex
>=
0
&&
leftIndex
<
3
)
{
let
curThirdShow
=
false
,
curTit
=
'编辑模板'
if
(
leftIndex
===
1
)
{
curThirdShow
=
true
curTit
=
'钉盒明细'
}
else
if
(
leftIndex
===
2
)
{
curThirdShow
=
true
curTit
=
'器械包明细'
}
this
.
props
.
navigation
.
navigate
(
'EditThirdLevelPage'
,
{
title
:
curTit
,
superData
:
{
superItem
:
item
,
superIndex
:
index
,
leftIndex
:
leftIndex
,
thirdShow
:
curThirdShow
,
customer_code
:
navigation
.
state
.
params
.
selfData
.
customer_code
,
},
childrenPageCallBack
:
this
.
childrenPageCallBack
.
bind
(
this
),
// 传递函数,编辑完成时调用
})
}
else
if
(
leftIndex
>
3
)
{
// 耗材 中级标题点击
this
.
changeThrShow
(
true
,
item
,
index
)
}
}
// 大类加减时,小类所有加1/减1
handleAllPlusReduce
(
curData
,
curIndex
,
isPlus
)
{
const
list
=
this
.
props
.
rightNameFilter
(
curData
.
details
,
true
,
true
)
if
(
isBlank
(
list
))
return
// 大类加减时,小类所有加1/减1
handleAllPlusReduce
(
curData
,
curIndex
,
isPlus
)
{
const
list
=
this
.
props
.
rightNameFilter
(
curData
.
details
,
true
,
true
)
if
(
isBlank
(
list
))
return
let
sumCount
=
0
curData
[
LocalVariable
.
QUANTITY_FIELD
]
=
0
// 初始化
list
.
forEach
(
function
(
line_val
)
{
if
(
!
line_val
[
LocalVariable
.
QUANTITY_FIELD
])
{
line_val
[
LocalVariable
.
QUANTITY_FIELD
]
=
0
}
if
(
isPlus
)
{
line_val
[
LocalVariable
.
QUANTITY_FIELD
]
+=
1
}
else
if
(
line_val
[
LocalVariable
.
QUANTITY_FIELD
]
>
0
)
{
line_val
[
LocalVariable
.
QUANTITY_FIELD
]
-=
1
}
sumCount
+=
line_val
[
LocalVariable
.
QUANTITY_FIELD
]
})
curData
[
LocalVariable
.
QUANTITY_FIELD
]
=
sumCount
this
.
handleCalCallBack
(
curData
,
curIndex
,
'rightSecondData'
,
LocalVariable
.
QUANTITY_FIELD
)
}
let
sumCount
=
0
curData
[
LocalVariable
.
QUANTITY_FIELD
]
=
0
// 初始化
list
.
forEach
(
function
(
line_val
)
{
if
(
!
line_val
[
LocalVariable
.
QUANTITY_FIELD
])
{
line_val
[
LocalVariable
.
QUANTITY_FIELD
]
=
0
}
if
(
isPlus
)
{
line_val
[
LocalVariable
.
QUANTITY_FIELD
]
+=
1
}
else
if
(
line_val
[
LocalVariable
.
QUANTITY_FIELD
]
>
0
)
{
line_val
[
LocalVariable
.
QUANTITY_FIELD
]
-=
1
}
sumCount
+=
line_val
[
LocalVariable
.
QUANTITY_FIELD
]
})
curData
[
LocalVariable
.
QUANTITY_FIELD
]
=
sumCount
this
.
handleCalCallBack
(
curData
,
curIndex
,
'rightSecondData'
,
LocalVariable
.
QUANTITY_FIELD
)
}
// 手术套包-编辑页面回调
childrenPageCallBack
(
childData
,
index
)
{
let
{
rightSecondData
}
=
this
.
state
let
{
leftIndex
}
=
this
.
props
let
that
=
this
if
(
rightSecondData
.
length
>
0
)
{
rightSecondData
.
forEach
(
function
(
rsdItem
,
rsdIndex
)
{
if
(
!
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
)
}
})
// 手术套包-编辑页面回调
childrenPageCallBack
(
childData
,
index
)
{
let
{
rightSecondData
}
=
this
.
state
let
{
leftIndex
}
=
this
.
props
let
that
=
this
if
(
rightSecondData
.
length
>
0
)
{
rightSecondData
.
forEach
(
function
(
rsdItem
,
rsdIndex
)
{
if
(
!
rsdItem
[
LocalVariable
.
CHILDREN_LINE_NAME
])
{
rsdItem
[
LocalVariable
.
CHILDREN_LINE_NAME
]
=
[]
}
this
.
setState
({
rightSecondData
})
}
// 修改当前小类是否展示
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
(
!
rsdItem
[
LocalVariable
.
QUANTITY_FIELD
])
{
rsdItem
[
LocalVariable
.
QUANTITY_FIELD
]
=
0
}
}
// 计算后的回调 - 头/行
handleCalCallBack
(
item
,
index
,
dataName
,
coutFieName
)
{
let
that
=
this
// 除了耗材小类的回调
if
(
dataName
&&
this
.
state
[
dataName
])
{
let
curDataName
=
this
.
state
[
dataName
]
curDataName
[
index
]
=
item
this
.
setState
({
[
dataName
]:
curDataName
})
if
(
dataName
===
'rowSingleData'
){
// 小类
that
.
changeThrShow
(
true
)
if
(
rsdIndex
===
index
&&
leftIndex
===
0
)
{
let
superTip
=
''
childData
.
map
((
chDa
,
chInd
)
=>
{
let
splitStr
=
' / '
// if (chInd === childData.length - 1) {
// splitStr = ''
// }
if
(
!
superTip
)
{
splitStr
=
''
}
if
(
coutFieName
)
{
// 计算==头
let
sumCount
=
0
curDataName
.
map
(
item
=>
{
if
(
item
[
coutFieName
])
{
sumCount
+=
Number
(
item
[
coutFieName
])
}
})
this
.
props
.
superCallBack
(
sumCount
,
coutFieName
)
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
({
rightSecondData
,
})
}
// 返回右侧二级每一列(耗材以上)
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
>
)
// 修改当前小类是否展示
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
)
}
}
}
// 返回右侧元素(耗材以上)
renderStencilStyle
()
{
let
{
rightSecondData
}
=
this
.
state
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 /
>
}
// 计算后的回调 - 头/行
handleCalCallBack
(
item
,
index
,
dataName
,
coutFieName
)
{
let
that
=
this
// 除了耗材小类的回调
if
(
dataName
&&
this
.
state
[
dataName
])
{
let
curDataName
=
this
.
state
[
dataName
]
curDataName
[
index
]
=
item
this
.
setState
({
[
dataName
]:
curDataName
,
})
if
(
dataName
===
'rowSingleData'
)
{
// 小类
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
)
{
let
{
rowSingleData
}
=
this
.
state
const
idx
=
R
.
findIndex
(
R
.
propEq
(
'item_code'
,
item
.
item_code
))(
rowSingleData
)
// 返回右侧元素(耗材以上)
renderStencilStyle
()
{
let
{
rightSecondData
}
=
this
.
state
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
}
>
<
PicTitDetaiCalcu
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
>
)
}
// 耗材 -- 小类每一列
renderThridItem
(
item
,
index
)
{
let
{
rowSingleData
}
=
this
.
state
const
idx
=
R
.
findIndex
(
R
.
propEq
(
'item_code'
,
item
.
item_code
))(
rowSingleData
)
// 耗材 -- 小类
renderThridStyle
()
{
let
{
rowSingleData
}
=
this
.
state
let
data
=
this
.
props
.
rightNameFilter
(
rowSingleData
,
true
)
return
(
<
SafeAreaView
style
=
{
styles
.
thr_container
}
key
=
{
'item_code'
+
index
}
>
<
PicTitDetaiCalcu
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
}
>
<
FlatList
style
=
{
styles
.
cont_thr_list
}
keyExtractor
=
{
item
=>
item
.
id
}
data
=
{
data
}
extraData
=
{
this
.
state
}
renderItem
=
{({
item
,
index
})
=>
this
.
renderThridItem
(
item
,
index
)}
/
>
<
/View
>
)
}
// 耗材 -- 小类
renderThridStyle
()
{
let
{
rowSingleData
}
=
this
.
state
let
data
=
this
.
props
.
rightNameFilter
(
rowSingleData
,
true
)
// 耗材 -- 大类每一列
renderOtherListItem
(
item
,
index
)
{
let
curTit
=
''
,
curTipStr
=
''
,
curTipOne
=
''
,
curTipTwo
=
''
,
curTxtTit
=
''
,
curTipStrTit
=
''
,
curTipOneTit
=
''
,
curTipTwoTit
=
''
,
curIcon
=
''
let
curTitCallBack
=
''
,
curPlusCallBack
=
''
,
curReduceCallBack
=
''
if
(
item
[
LocalVariable
.
ONLY_TWO_LEVELS
])
{
// 两级数据
curTit
=
'manufacturer_product_code'
curTipStr
=
'item_name'
curTipOne
=
'general_name'
curTipTwo
=
'specification'
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
(
<
View
style
=
{
styles
.
stencil_cont
}
>
<
FlatList
style
=
{
styles
.
cont_thr_list
}
keyExtractor
=
{
item
=>
item
.
id
}
data
=
{
data
}
extraData
=
{
this
.
state
}
renderItem
=
{({
item
,
index
})
=>
this
.
renderThridItem
(
item
,
index
)}
/
>
<
/View
>
)
}
return
(
<
SafeAreaView
style
=
{
styles
.
oth_container
}
key
=
{
'item_code'
+
index
}
>
<
PicTitDetaiCalcu
listItem
=
{
item
}
listIndex
=
{
index
}
calField
=
{
LocalVariable
.
QUANTITY_FIELD
}
listImgIcon
=
{
curIcon
}
listPicType
=
{
'ROUND'
}
subCalCallBack
=
{(
item
,
index
)
=>
this
.
handleCalCallBack
(
item
,
index
,
'rightSecondData'
,
LocalVariable
.
QUANTITY_FIELD
)}
titCallBack
=
{
curTitCallBack
}
titText
=
{
curTit
}
tipTextStr
=
{
curTipStr
}
tipTextOne
=
{
curTipOne
}
tipTextTwo
=
{
curTipTwo
}
titTextTit
=
{
curTxtTit
}
tipTextStrTit
=
{
curTipStrTit
}
tipTextOneTit
=
{
curTipOneTit
}
tipTextTwoTit
=
{
curTipTwoTit
}
plusCallBack
=
{
curPlusCallBack
}
reduceCallBack
=
{
curReduceCallBack
}
/
>
<
/SafeAreaView
>
)
// 耗材 -- 大类每一列
renderOtherListItem
(
item
,
index
)
{
let
curTit
=
''
,
curTipStr
=
''
,
curTipOne
=
''
,
curTipTwo
=
''
,
curTxtTit
=
''
,
curTipStrTit
=
''
,
curTipOneTit
=
''
,
curTipTwoTit
=
''
,
curIcon
=
''
let
curTitCallBack
=
''
,
curPlusCallBack
=
''
,
curReduceCallBack
=
''
if
(
item
[
LocalVariable
.
ONLY_TWO_LEVELS
])
{
// 两级数据
curTit
=
'manufacturer_product_code'
curTipStr
=
'item_name'
curTipOne
=
'general_name'
curTipTwo
=
'specification'
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
)
}
// 耗材 -- 大类
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 /
>
}
return
(
<
SafeAreaView
style
=
{
styles
.
oth_container
}
key
=
{
'item_code'
+
index
}
>
<
PicTitDetaiCalcu
listItem
=
{
item
}
listIndex
=
{
index
}
calField
=
{
LocalVariable
.
QUANTITY_FIELD
}
listImgIcon
=
{
curIcon
}
listPicType
=
{
'ROUND'
}
subCalCallBack
=
{(
item
,
index
)
=>
this
.
handleCalCallBack
(
item
,
index
,
'rightSecondData'
,
LocalVariable
.
QUANTITY_FIELD
)
}
titCallBack
=
{
curTitCallBack
}
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
()
{
let
{
leftIndex
}
=
this
.
props
let
{
thridIsVisible
}
=
this
.
state
if
(
leftIndex
>=
0
&&
leftIndex
<
4
)
{
return
this
.
renderStencilStyle
()
}
else
{
if
(
!
thridIsVisible
)
{
return
this
.
renderOtherStyle
()
}
else
{
return
this
.
renderThridStyle
()
}
}
// 右侧元素
renderRightCurrentStyle
()
{
let
{
leftIndex
}
=
this
.
props
let
{
thridIsVisible
}
=
this
.
state
if
(
leftIndex
>=
0
&&
leftIndex
<
4
)
{
return
this
.
renderStencilStyle
()
}
else
{
if
(
!
thridIsVisible
)
{
return
this
.
renderOtherStyle
()
}
else
{
return
this
.
renderThridStyle
()
}
}
}
// 耗材 -- 三级顶部标题
renderThrHeadStyle
()
{
let
{
thridIsVisible
,
curThridObj
}
=
this
.
state
if
(
thridIsVisible
)
{
return
(
<
View
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
style
=
{
styles
.
thr_head_inner
}
onPress
=
{()
=>
this
.
changeThrShow
(
false
)}
>
<
View
style
=
{
styles
.
thr_head_back
}
>
<
View
style
=
{
styles
.
thr_icon_box
}
>
<
Image
source
=
{
require
(
'../../../images/arr_left.png'
)}
style
=
{
icon_style
}
><
/Image
>
<
/View
>
<
Text
style
=
{
styles
.
thr_head_tit
}
>
{
curThridObj
.
title
}
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
{
/* <PictureZoom
// 耗材 -- 三级顶部标题
renderThrHeadStyle
()
{
let
{
thridIsVisible
,
curThridObj
}
=
this
.
state
if
(
thridIsVisible
)
{
return
(
<
View
>
<
TouchableOpacity
activeOpacity
=
{
0.8
}
style
=
{
styles
.
thr_head_inner
}
onPress
=
{()
=>
this
.
changeThrShow
(
false
)}
>
<
View
style
=
{
styles
.
thr_head_back
}
>
<
View
style
=
{
styles
.
thr_icon_box
}
>
<
Image
source
=
{
require
(
'../../../images/arr_left.png'
)}
style
=
{
icon_style
}
><
/Image
>
<
/View
>
<
Text
style
=
{
styles
.
thr_head_tit
}
>
{
curThridObj
.
title
}
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
{
/* <PictureZoom
listImageIndex={0}
listImageUrls={curThridObj.image}
listStyleImage={styles.thr_head_tit_img}
listPicType={'RECTANGLE'}
/> */
}
<
/View
>
)
}
<
/View
>
)
}
}
render
()
{
return
(
<
View
style
=
{
styles
.
cont_right_box
}
>
{
this
.
renderThrHeadStyle
()}
<
ScrollView
style
=
{
styles
.
cont_right_scroll_cont
}
showsVerticalScrollIndicator
=
{
false
}
>
{
this
.
renderRightCurrentStyle
()}
<
/ScrollView
>
<
/View
>
)
}
render
()
{
return
(
<
View
style
=
{
styles
.
cont_right_box
}
>
{
this
.
renderThrHeadStyle
()}
<
ScrollView
style
=
{
styles
.
cont_right_scroll_cont
}
showsVerticalScrollIndicator
=
{
false
}
>
{
this
.
renderRightCurrentStyle
()}
<
/ScrollView
>
<
/View
>
)
}
}
const
styles
=
StyleSheet
.
create
({
cont_right_box
:
{
position
:
'absolute'
,
left
:
80
,
top
:
0
,
width
:
Width
()
-
80
,
backgroundColor
:
foundation_color
,
height
:
'100%'
,
paddingHorizontal
:
20
,
paddingLeft
:
10
},
cont_right_scroll_cont
:
{},
cont_right_list
:
{},
ri_container
:
{},
model_cont
:
{},
cont_other_cont
:
{},
cont_other_list
:
{},
oth_container
:
{},
stencil_cont
:
{},
thr_head_inner
:
{},
thr_head_back
:
{
flexDirection
:
'row'
,
paddingVertical
:
12
,
alignItems
:
'center'
},
thr_icon_box
:
{
width
:
pxSize
(
14
),
height
:
pxSize
(
18
)
},
thr_head_tit
:
{
color
:
third_text_color
,
paddingLeft
:
6
,
fontSize
:
second_text_size
,
fontFamily
:
font_family_regular
},
thr_head_tit_img
:
{
borderWidth
:
.
5
,
borderColor
:
'rgba(0, 0, 0, 0.12)'
,
marginBottom
:
10
},
cont_thr_list
:
{},
thr_container
:
{},
rig_icon
:
{
width
:
pxSize
(
68
),
height
:
pxSize
(
68
)
}
cont_right_box
:
{
position
:
'absolute'
,
left
:
80
,
top
:
0
,
width
:
Width
()
-
80
,
backgroundColor
:
foundation_color
,
height
:
'100%'
,
paddingHorizontal
:
20
,
paddingLeft
:
10
,
},
cont_right_scroll_cont
:
{},
cont_right_list
:
{},
ri_container
:
{},
model_cont
:
{},
cont_other_cont
:
{},
cont_other_list
:
{},
oth_container
:
{},
stencil_cont
:
{},
thr_head_inner
:
{},
thr_head_back
:
{
flexDirection
:
'row'
,
paddingVertical
:
12
,
alignItems
:
'center'
,
},
thr_icon_box
:
{
width
:
pxSize
(
14
),
height
:
pxSize
(
18
),
},
thr_head_tit
:
{
color
:
third_text_color
,
paddingLeft
:
6
,
fontSize
:
second_text_size
,
fontFamily
:
font_family_regular
,
},
thr_head_tit_img
:
{
borderWidth
:
0
.5
,
borderColor
:
'rgba(0, 0, 0, 0.12)'
,
marginBottom
:
10
,
},
cont_thr_list
:
{},
thr_container
:
{},
rig_icon
:
{
width
:
pxSize
(
68
),
height
:
pxSize
(
68
),
},
})
const
mapStateToProps
=
(
state
)
=>
{
return
{
userInfo
:
state
.
login
.
userInfo
,
token
:
state
.
login
.
token
,
loginState
:
state
.
login
.
loginState
,
global_domain_config
:
state
.
login
.
global_domain_config
}
const
mapStateToProps
=
state
=>
{
return
{
userInfo
:
state
.
login
.
userInfo
,
token
:
state
.
login
.
token
,
loginState
:
state
.
login
.
loginState
,
global_domain_config
:
state
.
login
.
global_domain_config
,
}
}
const
mapDispatchToProps
=
(
dispatch
)
=>
{
return
{
exitLoginStatus
:
()
=>
{
dispatch
(
exitLoginStatus
())
},
}
const
mapDispatchToProps
=
dispatch
=>
{
return
{
exitLoginStatus
:
()
=>
{
dispatch
(
exitLoginStatus
())
},
}
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
ProductRightStyle
)
;
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
ProductRightStyle
)
app/containers/selfOrder/module/SearchPage.js
View file @
dc87fb35
...
...
@@ -110,7 +110,7 @@ class SearchPage extends Component {
const
{
navigation
,
global_domain_config
,
token
}
=
this
.
props
const
{
topActiveIndex
,
searchValue
,
page
,
data
}
=
this
.
state
const
{
selfData
,
topProcOptionList
}
=
navigation
.
state
.
params
const
{
authorizations
}
=
selfData
const
{
authorizations
,
customer_code
}
=
selfData
const
productLineCategory
=
authorizations
?.
product_line_category_list
?.
map
(
item
=>
item
.
product_line_category_code
)
...
...
@@ -121,6 +121,7 @@ class SearchPage extends Component {
orgCode
:
selfData
.
org_code
,
manufacturerCode
:
topProcOptionList
[
topActiveIndex
].
supplier_code
,
productLineCategory
,
customer_code
,
keyword
:
encodeURIComponent
(
searchValue
),
page
,
}
...
...
@@ -140,11 +141,13 @@ class SearchPage extends Component {
// 获取搜索到的类目
async
getLeftOptionList
(
item
)
{
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
{
customer_code
}
=
selfData
const
params
=
{
access_token
:
token
,
manufacturer_code
:
topProcOptionList
[
topActiveIndex
].
supplier_code
,
customer_code
,
}
console
.
log
(
'params='
,
params
)
this
.
refs
.
LoadingModel
.
show
()
...
...
@@ -180,11 +183,13 @@ class SearchPage extends Component {
const
{
navigation
,
global_domain_config
,
token
}
=
this
.
props
const
{
topActiveIndex
}
=
this
.
state
const
{
topProcOptionList
,
selfData
}
=
navigation
.
state
.
params
const
{
customer_code
}
=
selfData
let
params
=
{
access_token
:
token
,
category_code
:
item
.
big_category
.
category_code
,
manufacturer_code
:
topProcOptionList
[
topActiveIndex
].
supplier_code
,
org_code
:
selfData
.
org_code
,
customer_code
,
// leftIndex: leftIndex, // 测试
}
console
.
log
(
'params='
,
params
)
...
...
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