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
ea37a4c6
authored
Dec 14, 2020
by
Denglingling
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
对接部分自助下单已有接口,选择产品相关交互调整
parent
12a55f69
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1759 additions
and
1496 deletions
app/action/QuickAction.js
app/action/SelfAction.js
app/containers/common/ProductModel.js
app/containers/common/listDataComponent/PageListArrow.js
app/containers/common/listDataComponent/PicTitDetaiCalcu.js
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/mock/sen_mock.js
app/reducers/module/selfOrder.js
app/action/QuickAction.js
View file @
ea37a4c6
...
...
@@ -18,7 +18,7 @@ export function requestQuickOrganizations(params) {
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/authorized_inventory/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'
res====='
,
Object
.
keys
(
res
)
,
res
);
console
.
log
(
'
获取组织 res====='
,
res
);
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
organizations
}
}
=
res
dispatch
(
requestListDataSuccess
(
organizations
));
...
...
@@ -32,7 +32,7 @@ export function requestQuickOrganizations(params) {
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--
====organizations
----'
,
Object
.
keys
(
err
),
err
)
console
.
log
(
'------err--
获取组织
----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
dispatch
(
requestListDataFail
());
})
...
...
@@ -46,6 +46,7 @@ export function requestQuickSurgeryHospital(params) {
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'获取客户名称 res====='
,
res
);
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
customers
}
}
=
res
dispatch
(
requestListDataSuccess
(
customers
));
...
...
@@ -59,7 +60,7 @@ export function requestQuickSurgeryHospital(params) {
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====
requestQuickSurgeryHospital
----'
,
Object
.
keys
(
err
),
err
)
console
.
log
(
'------err--====
获取客户名称
----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
dispatch
(
requestListDataFail
());
})
...
...
@@ -77,6 +78,7 @@ export function requestQuickOrderType(params) {
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/system/value_set/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'获取订单类型 res====='
,
res
);
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
sys_values
}
}
=
res
dispatch
(
requestListDataSuccess
(
sys_values
));
...
...
@@ -90,7 +92,7 @@ export function requestQuickOrderType(params) {
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====
requestQuickSurgeryHospital
----'
,
Object
.
keys
(
err
),
err
)
console
.
log
(
'------err--====
获取订单类型
----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
dispatch
(
requestListDataFail
());
})
...
...
@@ -104,7 +106,7 @@ export function requestQuickTemplateCollect(params) {
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/template_header/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'
res==>'
,
res
)
console
.
log
(
'
获取配台模板 res====='
,
res
);
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
surgery_template_headers
}
}
=
res
dispatch
(
requestListDataSuccess
(
surgery_template_headers
));
...
...
@@ -118,7 +120,7 @@ export function requestQuickTemplateCollect(params) {
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====
requestQuickTemplateCollect
----'
,
Object
.
keys
(
err
),
err
)
console
.
log
(
'------err--====
获取配台模板
----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
dispatch
(
requestListDataFail
());
})
...
...
@@ -132,6 +134,7 @@ export function requestQuickSurgeryType(params) {
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/system/value_set/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'获取手术类型 res====='
,
res
);
if
(
res
.
error_code
==
0
)
{
let
typeOption
=
[]
let
{
data
:
{
value_set_code
,
sys_values
}
}
=
res
...
...
@@ -149,7 +152,7 @@ export function requestQuickSurgeryType(params) {
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====
requestQuickSurgeryType
----'
,
Object
.
keys
(
err
),
err
)
console
.
log
(
'------err--====
获取手术类型
----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
dispatch
(
requestListDataFail
());
})
...
...
@@ -193,6 +196,7 @@ export function requestQuickSumbit({access_token, ...params}) {
let
{
global_domain_config
}
=
getState
().
login
PostRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/collect_order/via_data/create'
,
{
access_token
:
access_token
}),
params
)
.
then
(
res
=>
{
console
.
log
(
'提交数据 res====='
,
res
);
if
(
res
.
error_code
==
0
)
{
let
{
data
}
=
res
dispatch
(
requestSubmitSuccess
(
data
));
...
...
@@ -206,7 +210,7 @@ export function requestQuickSumbit({access_token, ...params}) {
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====
requestQuickSumbit
----'
,
Object
.
keys
(
err
),
err
)
console
.
log
(
'------err--====
提交数据
----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
dispatch
(
requestSubmitFail
());
})
...
...
app/action/SelfAction.js
View file @
ea37a4c6
import
{
PostRequest
,
GetRequest
}
from
'../network/RequestUtils'
;
import
{
show
}
from
'../utils/Utils'
;
import
{
PostRequest
,
GetRequest
,
UploadRequest
}
from
'../network/RequestUtils'
;
import
{
show
,
getUrlParams
}
from
'../utils/Utils'
;
import
{
exitLoginStatus
}
from
'./LoginAction'
;
import
{
SELF_ORDER_LIST_DOING
,
SELF_ORDER_LIST_SUCCESS
,
SELF_ORDER_LIST_FAILURE
,
SELF_SUBMIT_DOING
,
SELF_SUBMIT_SUCCESS
,
SELF_SUBMIT_FAILURE
,
SELF_INIT_DATA
}
from
'../base/ActionTypes'
;
// 获取组织
// export const requestOrganizations = async (params) => {
// return await GetRequest(`/api/latest/authorized_inventory/search?access_token=${params.access_token}`)
// }
export
function
requestOrganizations
(
access_token
)
{
// 获取组织 params={access_token:''}
export
function
requestSelfOrganizations
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
// console.warn('----requestOrganizations')
dispatch
(
requestOrganizationsing
());
dispatch
(
requestListDataing
());
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
`/authorized_inventory/search?access_token=
${
access_token
}
`
)
GetRequest
(
global_domain_config
,
getUrlParams
(
'/authorized_inventory/search'
,
params
)
)
.
then
(
res
=>
{
// console.warn('res=====', Object.keys(res)
);
console
.
log
(
'获取组织 res====='
,
res
);
if
(
res
.
error_code
==
0
)
{
// console.warn('res====organizations=', res.data.organizations);
let
{
data
:
{
organizations
}
}
=
res
dispatch
(
request
Organizations
Success
(
organizations
));
dispatch
(
request
ListData
Success
(
organizations
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
show
(
res
.
error_msg
);
dispatch
(
request
Organizations
Fail
());
dispatch
(
request
ListData
Fail
());
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--获取组织----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
dispatch
(
request
Organizations
Fail
());
dispatch
(
request
ListData
Fail
());
})
}
}
function
requestOrganizationsing
()
{
// 获取客户名称 params={access_token:'', org_code:'', seller_code:''}
export
function
requestSelfSurgeryHospital
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestListDataing
());
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'获取客户名称 res====='
,
res
);
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
customers
}
}
=
res
dispatch
(
requestListDataSuccess
(
customers
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
dispatch
(
requestListDataFail
());
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====获取客户名称----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
dispatch
(
requestListDataFail
());
})
}
}
export
const
reqSelfSurgeryHospital
=
async
(
global_domain_config
,
params
)
=>
{
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
}
// 获取订单类型 params={access_token:'', value_set_code:'SUR_ORDER_TYPE'}
export
function
requestSelfOrderType
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestListDataing
());
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/system/value_set/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'获取订单类型 res====='
,
res
);
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
sys_values
}
}
=
res
dispatch
(
requestListDataSuccess
(
sys_values
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
dispatch
(
requestListDataFail
());
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====获取订单类型----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
dispatch
(
requestListDataFail
());
})
}
}
// 获取配台模板 params={access_token:'', org_code:'', seller_code: 'shi.ming', customer_code: '', surgery_type: '', doctor_name: ''}
export
function
requestSelfTemplateCollect
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestListDataing
());
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/template_header/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'获取配台模板 res====='
,
res
);
if
(
res
.
error_code
==
0
)
{
let
{
data
:
{
surgery_template_headers
}
}
=
res
dispatch
(
requestListDataSuccess
(
surgery_template_headers
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
dispatch
(
requestListDataFail
());
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====获取配台模板----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
dispatch
(
requestListDataFail
());
})
}
}
// 获取手术类型 params={access_token:'', value_set_code:'ORTHOPEDICS_PRODUCT_CLASS'}
export
function
requestSelfSurgeryType
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestListDataing
());
let
{
global_domain_config
}
=
getState
().
login
GetRequest
(
global_domain_config
,
getUrlParams
(
'/system/value_set/search'
,
params
))
.
then
(
res
=>
{
console
.
log
(
'获取手术类型 res====='
,
res
);
if
(
res
.
error_code
==
0
)
{
let
typeOption
=
[]
let
{
data
:
{
value_set_code
,
sys_values
}
}
=
res
if
(
value_set_code
===
'ORTHOPEDICS_PRODUCT_CLASS'
&&
sys_values
&&
sys_values
.
length
)
{
typeOption
=
sys_values
}
dispatch
(
requestListDataSuccess
(
typeOption
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
dispatch
(
requestListDataFail
());
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====获取手术类型----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
dispatch
(
requestListDataFail
());
})
}
}
function
requestListDataing
()
{
return
{
type
:
SELF_ORDER_LIST_DOING
}
}
function
request
Organizations
Success
(
data
)
{
function
request
ListData
Success
(
data
)
{
return
{
type
:
SELF_ORDER_LIST_SUCCESS
,
rawData
:
data
}
}
function
request
Organizations
Fail
()
{
function
request
ListData
Fail
()
{
return
{
type
:
SELF_ORDER_LIST_FAILURE
}
}
// 上传语音
export
const
requestSelfAudio
=
async
(
global_domain_config
,
params
)
=>
{
let
{
access_token
,
path
}
=
params
let
formData
=
new
FormData
()
let
soundPath
=
`file://
${
path
}
`
let
fileName
=
path
.
substring
(
path
.
lastIndexOf
(
'/'
)
+
1
,
path
.
length
)
let
file
=
{
uri
:
soundPath
,
type
:
"multipart/form-data"
,
name
:
fileName
}
formData
.
append
(
'file'
,
file
)
return
await
UploadRequest
(
global_domain_config
,
getUrlParams
(
'/dingding/upload_media'
,
{
access_token
}),
formData
)
}
// 提交数据
export
function
requestSelfSumbit
({
access_token
,
...
params
})
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestSubmiting
());
let
{
global_domain_config
}
=
getState
().
login
PostRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/collect_order/via_data/create'
,
{
access_token
:
access_token
}),
params
)
.
then
(
res
=>
{
console
.
log
(
'提交数据 res====='
,
res
);
if
(
res
.
error_code
==
0
)
{
let
{
data
}
=
res
dispatch
(
requestSubmitSuccess
(
data
));
}
else
if
(
res
.
error_code
===
41006
)
{
show
(
'登录过期,请重新登录'
);
dispatch
(
exitLoginStatus
());
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
dispatch
(
requestSubmitFail
());
}
})
.
catch
(
err
=>
{
console
.
log
(
'------err--====提交数据----'
,
Object
.
keys
(
err
),
err
)
show
(
err
.
error
);
dispatch
(
requestSubmitFail
());
})
}
}
function
requestSubmiting
()
{
return
{
type
:
SELF_SUBMIT_DOING
}
}
function
requestSubmitSuccess
(
data
)
{
return
{
type
:
SELF_SUBMIT_SUCCESS
,
rawData
:
data
}
}
function
requestSubmitFail
()
{
return
{
type
:
SELF_SUBMIT_FAILURE
}
}
// 初始化数据
export
function
setSelfInitData
()
{
return
{
type
:
SELF_INIT_DATA
}
}
\ No newline at end of file
app/containers/common/ProductModel.js
View file @
ea37a4c6
...
...
@@ -59,8 +59,6 @@ class ProductModel extends Component {
topProcOptionList
:
[],
topActiveIndex
:
0
,
orginOptionList
:
[],
// 原始数据
// SELECTED_QUQNTITY: 'selectedQuantity', // 中类数量
// SELECTED_DATA_ARR: 'selectedDataArr', // 中类已选元素
}
}
...
...
@@ -79,7 +77,6 @@ class ProductModel extends Component {
}
if
(
nextProps
.
modelOption
)
{
that
.
setState
({
// topProcOptionList: nextProps.modelOption,
orginOptionList
:
nextProps
.
modelOption
},()
=>
{
that
.
getTopOptions
()
...
...
@@ -91,7 +88,6 @@ class ProductModel extends Component {
getTopOptions
(){
let
{
orginOptionList
}
=
this
.
state
let
otherArr
=
[]
// let otherChildData = []
let
otherChildObj
=
{
title
:
'单选耗材'
,
[
SELECTED_QUQNTITY
]:
0
,
...
...
@@ -112,7 +108,7 @@ class ProductModel extends Component {
}
})
otherArr
.
push
(
otherChildObj
)
console
.
log
(
'修改后的已选数据===='
,
otherArr
)
//
console.log('修改后的已选数据====', otherArr)
this
.
setState
({
topProcOptionList
:
otherArr
})
...
...
@@ -121,137 +117,120 @@ class ProductModel extends Component {
// 恢复其他所有数据
setTopOrginTopData
(
curOptions
){
let
{
orginOptionList
}
=
this
.
state
console
.
log
(
'回调之前的==原始已选数据=='
,
orginOptionList
)
console
.
log
(
'回调之前的===当前修改后的已选数据=='
,
curOptions
)
// console.log('回调之前的==原始已选数据==', orginOptionList)
// console.log('回调之前的===当前修改后的已选数据==', curOptions)
orginOptionList
.
map
(
function
(
orgItem
,
orgIndex
)
{
if
(
orgIndex
<
4
){
orgItem
=
curOptions
[
orgIndex
]
}
})
console
.
log
(
'当前修改后的原始数据=='
,
orginOptionList
)
// console.log('当前修改后的原始数据==', orginOptionList)
this
.
props
.
modelCallBack
(
orginOptionList
)
// 调用
}
// 恢复已选数据
setTopOrginTopData_old
(
curOptions
){
let
{
orginOptionList
}
=
this
.
state
console
.
log
(
'回调之前的==原始已选数据=='
,
orginOptionList
)
console
.
log
(
'回调之前的===当前修改后的已选数据=='
,
curOptions
)
orginOptionList
.
map
(
function
(
orgItem
,
orgIndex
)
{
if
(
orgIndex
<
4
){
orgItem
=
curOptions
[
orgIndex
]
}
else
{
if
(
orgItem
[
SELECTED_DATA_ARR
]
&&
orgItem
[
SELECTED_DATA_ARR
].
length
>
0
&&
curOptions
[
SELECTED_DATA_ARR
]
&&
curOptions
[
SELECTED_DATA_ARR
].
length
>
0
){
let
delArr
=
[]
orgItem
[
SELECTED_DATA_ARR
].
map
(
function
(
seIt
,
seInd
)
{
console
.
log
(
'标题===='
,
curSeChild
[
'superTit'
],
seIt
[
CHILD_DATA_NAME
][
0
][
'superTit'
])
let
orgCurChild
=
seIt
[
CHILD_DATA_NAME
][
0
]
curOptions
[
SELECTED_DATA_ARR
].
forEach
(
function
(
curSeItem
,
curSeInd
){
let
curSeChild
=
curSeItem
[
CHILD_DATA_NAME
][
0
]
if
(
curSeChild
&&
orgCurChild
&&
curSeChild
[
'superTit'
]
===
orgCurChild
[
'superTit'
]
&&
curSeChild
[
'id'
]
===
orgCurChild
[
'id'
]
&&
curSeChild
[
'superIndex'
]
===
orgCurChild
[
'superIndex'
]
&&
curSeChild
[
'curTitle'
]
===
orgCurChild
[
'curTitle'
]){
// seIt[CHILD_DATA_NAME][0]['lineOptions'] = curSeChild['lineOptions']
seIt
=
curSeChild
}
})
// 是否在已选存在
let
isExitArr
=
curOptions
[
SELECTED_DATA_ARR
].
filter
(
item
=>
{
let
curSeChild
=
curSeItem
[
CHILD_DATA_NAME
][
0
]
return
curSeChild
&&
orgCurChild
&&
curSeChild
[
'superTit'
]
===
orgCurChild
[
'superTit'
]
&&
curSeChild
[
'id'
]
===
orgCurChild
[
'id'
]
&&
curSeChild
[
'superIndex'
]
===
orgCurChild
[
'superIndex'
]
&&
curSeChild
[
'curTitle'
]
===
orgCurChild
[
'curTitle'
]
})
if
(
isExitArr
.
length
>
0
){
// 存在,并且数量不为空
}
else
{
// 不存在,即数量为空
delArr
.
push
(
seInd
)
// 清空之前的
}
})
// let {orginOptionList} = this.state
// console.log('回调之前的==原始已选数据==', orginOptionList)
// console.log('回调之前的===当前修改后的已选数据==', curOptions)
// orginOptionList.map(function(orgItem, orgIndex) {
// if(orgIndex < 4){
// orgItem = curOptions[orgIndex]
// }else {
// if(orgItem[SELECTED_DATA_ARR] && orgItem[SELECTED_DATA_ARR].length > 0
// && curOptions[SELECTED_DATA_ARR] && curOptions[SELECTED_DATA_ARR].length > 0){
// let delArr = []
// orgItem[SELECTED_DATA_ARR].map(function(seIt, seInd) {
// console.log('标题====', curSeChild['superTit'], seIt[CHILD_DATA_NAME][0]['superTit'])
// let orgCurChild = seIt[CHILD_DATA_NAME][0]
// curOptions[SELECTED_DATA_ARR].forEach(function(curSeItem, curSeInd){
// let curSeChild = curSeItem[CHILD_DATA_NAME][0]
// if(curSeChild && orgCurChild && curSeChild['superTit'] === orgCurChild['superTit'] && curSeChild['id'] === orgCurChild['id']
// && curSeChild['superIndex'] === orgCurChild['superIndex'] && curSeChild['curTitle'] === orgCurChild['curTitle']){
// // seIt[CHILD_DATA_NAME][0]['lineOptions'] = curSeChild['lineOptions']
// seIt = curSeChild
// }
// })
// // 是否在已选存在
// let isExitArr = curOptions[SELECTED_DATA_ARR].filter(item => {
// let curSeChild = curSeItem[CHILD_DATA_NAME][0]
// return curSeChild && orgCurChild && curSeChild['superTit'] === orgCurChild['superTit'] && curSeChild['id'] === orgCurChild['id']
// && curSeChild['superIndex'] === orgCurChild['superIndex'] && curSeChild['curTitle'] === orgCurChild['curTitle']
// })
// if(isExitArr.length > 0){
// // 存在,并且数量不为空
// }else {
// // 不存在,即数量为空
// delArr.push(seInd)
// // 清空之前的
// }
// })
if
(
delArr
.
length
){
for
(
let
i
=
delArr
.
length
-
1
;
i
>=
0
;
i
--
){
let
seDelChild
=
orgItem
[
SELECTED_DATA_ARR
][
i
][
CHILD_DATA_NAME
][
0
]
//
if(delArr.length){
//
for(let i=delArr.length-1; i>=0; i--){
//
let seDelChild = orgItem[SELECTED_DATA_ARR][i][CHILD_DATA_NAME][0]
if
(
orgItem
[
DEFAULT_SECOND_DATA
]
&&
orgItem
[
DEFAULT_SECOND_DATA
].
length
>
0
&&
seDelChild
){
// for(let deIt of orgItem[DEFAULT_SECOND_DATA]){
//
if(orgItem[DEFAULT_SECOND_DATA] && orgItem[DEFAULT_SECOND_DATA].length > 0 && seDelChild){
//
// for(let deIt of orgItem[DEFAULT_SECOND_DATA]){
// let deItChild = deIt[CHILD_DATA_NAME][0]
// if(deItChild && seDelChild && deItChild['superTit'] === seDelChild['superTit'] && deItChild['id'] === seDelChild['id']
// && deItChild['index'] === seDelChild['index']){
// deIt[DEFAULT_QUANTITY] = 0
// delete deIt[CHILD_DATA_NAME]
// // let deItChild = deIt[CHILD_DATA_NAME][0]
// // if(deItChild && seDelChild && deItChild['superTit'] === seDelChild['superTit'] && deItChild['id'] === seDelChild['id']
// // && deItChild['index'] === seDelChild['index']){
// }
// }
// // deIt[DEFAULT_QUANTITY] = 0
// // delete deIt[CHILD_DATA_NAME]
orgItem
[
DEFAULT_SECOND_DATA
].
forEach
(
function
(
deIt
)
{
let
deItChild
=
deIt
[
CHILD_DATA_NAME
][
0
]
if
(
deItChild
&&
seDelChild
&&
deItChild
[
'superTit'
]
===
seDelChild
[
'superTit'
]
&&
deItChild
[
'id'
]
===
seDelChild
[
'id'
]
&&
deItChild
[
'index'
]
===
seDelChild
[
'index'
]){
// // }
// // }
deIt
[
DEFAULT_QUANTITY
]
=
0
delete
deIt
[
CHILD_DATA_NAME
]
// orgItem[DEFAULT_SECOND_DATA].forEach(function(deIt) {
// let deItChild = deIt[CHILD_DATA_NAME][0]
// if(deItChild && seDelChild && deItChild['superTit'] === seDelChild['superTit'] && deItChild['id'] === seDelChild['id']
// && deItChild['index'] === seDelChild['index']){
}
})
}
// deIt[DEFAULT_QUANTITY] = 0
// delete deIt[CHILD_DATA_NAME]
orgItem
[
SELECTED_DATA_ARR
].
splice
(
i
,
1
)
}
}
}
else
{
// 清空所有已选
orgItem
[
SELECTED_DATA_ARR
]
=
[]
orgItem
[
DEFAULT_QUANTITY
]
=
0
if
(
orgItem
[
DEFAULT_SECOND_DATA
]
&&
orgItem
[
DEFAULT_SECOND_DATA
].
length
>
0
){
orgItem
[
DEFAULT_SECOND_DATA
].
forEach
(
function
(
deIt
)
{
deIt
[
DEFAULT_QUANTITY
]
=
0
// deIt[CHILD_DATA_NAME] = []
delete
deIt
[
CHILD_DATA_NAME
]
})
}
}
}
})
console
.
log
(
'修改后的原始数据========>'
,
orginOptionList
)
// this.props.modelCallBack(orginOptionList) // 调用
// }
// })
// }
// orgItem[SELECTED_DATA_ARR].splice(i, 1)
// }
// }
// }else {
// // 清空所有已选
// orgItem[SELECTED_DATA_ARR] = []
// orgItem[DEFAULT_QUANTITY] = 0
// if(orgItem[DEFAULT_SECOND_DATA] && orgItem[DEFAULT_SECOND_DATA].length > 0){
// orgItem[DEFAULT_SECOND_DATA].forEach(function(deIt) {
// deIt[DEFAULT_QUANTITY] = 0
// // deIt[CHILD_DATA_NAME] = []
// delete deIt[CHILD_DATA_NAME]
// })
// }
// }
// }
// })
// console.log('修改后的原始数据========>', orginOptionList)
// // this.props.modelCallBack(orginOptionList) // 调用
}
// 共计已选 点击
handleCloseSelected
()
{
console
.
log
(
'
共计已选:666--model
'
)
console
.
log
(
'
已选:handleCloseSelected
'
)
this
.
closeModal
()
// // this.props.closeSelected(false)
// this.props.closeModal(false)
}
// 选好了 点击
handleCloseSubmit
()
{
console
.
log
(
'选好了--
model
'
)
console
.
log
(
'选好了--
handleCloseSubmit
'
)
this
.
closeModal
()
this
.
props
.
closeSubmit
()
}
...
...
@@ -265,77 +244,36 @@ class ProductModel extends Component {
// 清空图标回调
handleClearBack
(
item
,
index
){
console
.
log
(
'清空图标回调---'
,
item
,
index
)
// console.log('清空图标回调---', item, index)
let
{
orginOptionList
,
topProcOptionList
,
topActiveIndex
}
=
this
.
state
// console.log('原始已选数据==--===--', orginOptionList)
// console.log('当前已选数据==----', topProcOptionList, topActiveIndex)
console
.
log
(
'原始已选数据==--===--'
,
orginOptionList
)
console
.
log
(
'当前已选数据==----'
,
topProcOptionList
,
topActiveIndex
)
// topProcOptionList
// 单选耗材当前清空项
let
deleOpts
=
cloneObject
(
topProcOptionList
[
topActiveIndex
][
SELECTED_DATA_ARR
][
index
])
let
allCountQuantity
=
0
// 初始化
orginOptionList
.
forEach
(
function
(
orgOpts
,
orgInd
)
{
if
(
orgInd
>=
4
){
// console.log('orgOpts[SELECTED_DATA_ARR]---', orgOpts[SELECTED_DATA_ARR], SELECTED_DATA_ARR)
// if(orgOpts[SELECTED_DATA_ARR] && orgOpts[SELECTED_DATA_ARR].length > 0){
// let deIndex = 0
// let deFlag = false
// orgOpts[SELECTED_DATA_ARR].forEach(function(selDa, selInde){
// if(selDa[CHILD_DATA_NAME] && deleOpts[CHILD_DATA_NAME]){
// let curLine = selDa[CHILD_DATA_NAME][0]
// console.log('curLine---', curLine)
// let deLi = deleOpts[CHILD_DATA_NAME][0]
// console.log('deLi---', deLi)
// if(curLine && deLi && curLine['superTit'] === deLi['superTit'] && curLine['id'] === deLi['id']
// && curLine['superIndex'] === deLi['superIndex']){
// console.log('---删除=!!!====-', curLine, deLi)
// deFlag = true
// deIndex = localInd
// // selDa[DEFAULT_QUANTITY] = 0
// // delete selDa[CHILD_DATA_NAME]
// }
// }
// })
// if(deFlag){
// console.log('---删除=====-', deFlag, deIndex)
// orgOpts[SELECTED_DATA_ARR].splice(deIndex, 1)
// }
// }
if
(
orgOpts
[
DEFAULT_SECOND_DATA
]
&&
orgOpts
[
DEFAULT_SECOND_DATA
].
length
>
0
){
orgOpts
[
DEFAULT_SECOND_DATA
].
forEach
(
function
(
localDa
,
localInd
)
{
// console.log('localDa--CHILD_DATA_NAME-', localDa, CHILD_DATA_NAME)
if
(
localDa
[
CHILD_DATA_NAME
]
&&
deleOpts
[
CHILD_DATA_NAME
]){
let
curLine
=
localDa
[
CHILD_DATA_NAME
][
0
]
// console.log('curLine---', curLine, deleOpts)
let
deLi
=
deleOpts
[
CHILD_DATA_NAME
][
0
]
// console.log('deLi--', deLi)
if
(
curLine
&&
deLi
&&
curLine
[
'superTit'
]
===
deLi
[
'superTit'
]
&&
curLine
[
'id'
]
===
deLi
[
'id'
]
&&
curLine
[
'superIndex'
]
===
deLi
[
'superIndex'
]
&&
curLine
[
'curTitle'
]
===
deLi
[
'curTitle'
]){
// deIndex = localInd
localDa
[
DEFAULT_QUANTITY
]
=
0
delete
localDa
[
CHILD_DATA_NAME
]
}
}
})
}
if
(
orgOpts
[
SELECTED_DATA_ARR
]
&&
orgOpts
[
SELECTED_DATA_ARR
].
length
>
0
){
let
delArr
=
[]
orgOpts
[
SELECTED_DATA_ARR
].
map
((
deIt
,
deIndex
)
=>
{
...
...
@@ -343,20 +281,15 @@ class ProductModel extends Component {
delArr
.
push
(
deIndex
)
}
})
console
.
log
(
'delArr----'
,
delArr
)
//
console.log('delArr----', delArr)
for
(
let
i
=
delArr
.
length
-
1
;
i
>=
0
;
i
--
){
console
.
log
(
'orgOpts--!!--'
,
i
,
delArr
[
i
],
orgOpts
[
SELECTED_DATA_ARR
])
// console.log('orgOpts--!!--', i, delArr[i],orgOpts[SELECTED_DATA_ARR])
orgOpts
[
SELECTED_DATA_ARR
].
splice
(
delArr
[
i
],
1
);
}
console
.
log
(
'orgOpts----'
,
orgOpts
[
SELECTED_DATA_ARR
])
// console.log('orgOpts----', orgOpts[SELECTED_DATA_ARR])
}
// 初始化
orgOpts
[
SELECTED_QUQNTITY
]
=
0
if
(
orgOpts
[
SELECTED_DATA_ARR
].
length
>
0
){
orgOpts
[
SELECTED_DATA_ARR
].
map
(
itDa
=>
{
if
(
!
itDa
[
DEFAULT_QUANTITY
]){
...
...
@@ -365,8 +298,38 @@ class ProductModel extends Component {
orgOpts
[
SELECTED_QUQNTITY
]
+=
Number
(
itDa
[
DEFAULT_QUANTITY
])
})
}
// else {
// orgOpts[SELECTED_QUQNTITY] = 0
// console.log('orgOpts[SELECTED_DATA_ARR]---', orgOpts[SELECTED_DATA_ARR], SELECTED_DATA_ARR)
// if(orgOpts[SELECTED_DATA_ARR] && orgOpts[SELECTED_DATA_ARR].length > 0){
// let deIndex = 0
// let deFlag = false
// orgOpts[SELECTED_DATA_ARR].forEach(function(selDa, selInde){
// if(selDa[CHILD_DATA_NAME] && deleOpts[CHILD_DATA_NAME]){
// let curLine = selDa[CHILD_DATA_NAME][0]
// console.log('curLine---', curLine)
// let deLi = deleOpts[CHILD_DATA_NAME][0]
// console.log('deLi---', deLi)
// if(curLine && deLi && curLine['superTit'] === deLi['superTit'] && curLine['id'] === deLi['id']
// && curLine['superIndex'] === deLi['superIndex']){
// console.log('---删除=!!!====-', curLine, deLi)
// deFlag = true
// deIndex = localInd
// // selDa[DEFAULT_QUANTITY] = 0
// // delete selDa[CHILD_DATA_NAME]
// }
// }
// })
// if(deFlag){
// console.log('---删除=====-', deFlag, deIndex)
// orgOpts[SELECTED_DATA_ARR].splice(deIndex, 1)
// }
// }
}
...
...
@@ -379,37 +342,23 @@ class ProductModel extends Component {
})
console
.
log
(
'修改后的已选=======---'
,
topProcOptionList
)
console
.
log
(
'修改后的数量---'
,
allCountQuantity
)
console
.
log
(
'修改后端所有数据---'
,
orginOptionList
)
//
console.log('修改后的已选=======---', topProcOptionList)
//
console.log('修改后的数量---', allCountQuantity)
//
console.log('修改后端所有数据---', orginOptionList)
this
.
props
.
modelCallBack
(
orginOptionList
)
// 调用
this
.
props
.
modelCallBack
(
orginOptionList
)
if
(
allCountQuantity
===
0
){
this
.
closeModal
()
}
}
// 修改列表计算后数据
handleCalCallBack
(
item
,
index
,
SUB_LINE_NAME
){
console
.
log
(
'回调====='
,
item
,
index
,
SUB_LINE_NAME
)
handleCalCallBack
(
item
,
index
){
// console.log('回调=====', item, index)
let
{
topProcOptionList
,
topActiveIndex
}
=
this
.
state
let
defauIndex
=
index
SUB_LINE_NAME
=
'childrenLineData'
// 测试 item.superIndex
// if(SUB_LINE_NAME){
// defauIndex = item.superIndex
// }
// SUB_LINE_NAME = 'childrenLineData' // 测试 item.superIndex
defauIndex
=
item
.
superIndex
// console.log('--当前已选数据 ===',topProcOptionList, topActiveIndex)
if
(
SELECTED_DATA_ARR
&&
topProcOptionList
[
topActiveIndex
][
SELECTED_DATA_ARR
])
{
...
...
@@ -446,7 +395,7 @@ class ProductModel extends Component {
})
// 已选数量赋值之前默认数据
let
curObj
=
listItem
[
SELECTED_DATA_ARR
][
defauIndex
]
console
.
log
(
'curObj----'
,
curObj
)
//
console.log('curObj----', curObj)
if
(
listIndex
<
4
){
if
(
curObj
.
id
){
...
...
@@ -464,90 +413,12 @@ class ProductModel extends Component {
}
allCountQuantity
+=
listItem
[
SELECTED_QUQNTITY
]
})
// 恢复之后再调用
this
.
setTopOrginTopData
(
topProcOptionList
)
// this.props.modelCallBack(topProcOptionList)
if
(
allCountQuantity
===
0
){
this
.
closeModal
()
}
}
// if(SELECTED_DATA_ARR && topProcOptionList[topActiveIndex][SELECTED_DATA_ARR]) {
// topProcOptionList.map(function(listItem, listIndex) {
// if(listIndex === topActiveIndex){
// if(SUB_LINE_NAME){
// listItem[SELECTED_DATA_ARR][item.superIndex][SUB_LINE_NAME].forEach(function(chIt) {
// if(_.isEqual(chIt, item)){
// chIt = item
// }
// })
// }else {
// // listItem[SELECTED_DATA_ARR][index] = item
// listItem[SELECTED_DATA_ARR][defauIndex] = item
// }
// // 本地测试 id为唯一值
// // let curObj = listItem[SELECTED_DATA_ARR][index]
// let curObj = listItem[SELECTED_DATA_ARR][defauIndex]
// if(curObj.id){
// listItem[DEFAULT_SECOND_DATA].forEach(function(deIt) {
// if(deIt.id === curObj.id){
// deIt = curObj
// }
// })
// }
// }
// })
// // console.log('---item[DEFAULT_QUANTITY] ', item[DEFAULT_QUANTITY], index)
// if(item[DEFAULT_QUANTITY] === 0) {
// topProcOptionList[topActiveIndex][SELECTED_DATA_ARR].splice(index, 1)
// // console.log('topProcOptionList[topActiveIndex][SELECTED_DATA_ARR]---', topProcOptionList[topActiveIndex][SELECTED_DATA_ARR])
// }
// // 修改左侧分类汇总
// // 本地测试
// let curCalField = 'quantity'
// let allCountQuantity = 0 // 初始化
// if(topProcOptionList[topActiveIndex][SELECTED_DATA_ARR].length > 0) {
// topProcOptionList[topActiveIndex][SELECTED_QUQNTITY] = 0
// topProcOptionList[topActiveIndex][SELECTED_DATA_ARR].map((selItem) => {
// if(!selItem[curCalField]){
// selItem[curCalField] = 0
// }
// topProcOptionList[topActiveIndex][SELECTED_QUQNTITY] += Number(selItem[curCalField])
// })
// } else{
// topProcOptionList[topActiveIndex][SELECTED_QUQNTITY] = 0
// }
// topProcOptionList.map(proItem => {
// if(!proItem[SELECTED_QUQNTITY]){
// proItem[SELECTED_QUQNTITY] = 0
// }
// allCountQuantity += proItem[SELECTED_QUQNTITY]
// })
// // 回调函数
// // console.log('---计算后 ', topProcOptionList, allCountQuantity)
// this.props.modelCallBack(topProcOptionList)
// if(allCountQuantity === 0){
// this.closeModal()
// }
// }
}
// 点击顶部菜单
...
...
@@ -559,8 +430,8 @@ class ProductModel extends Component {
// 清空
handleClearRubbish
()
{
let
{
topProcOptionList
,
orginOptionList
}
=
this
.
state
console
.
log
(
'清空======'
,
orginOptionList
)
let
{
orginOptionList
}
=
this
.
state
//
console.log('清空======', orginOptionList)
orginOptionList
.
map
(
function
(
listItem
)
{
listItem
[
SELECTED_QUQNTITY
]
=
0
listItem
[
SELECTED_DATA_ARR
]
=
[]
...
...
@@ -569,33 +440,10 @@ class ProductModel extends Component {
deIt
[
CHILD_DATA_NAME
]
=
[]
})
})
// 回调函数
console
.
log
(
'---清空之后===== '
,
orginOptionList
)
// this.setTopOrginTopData(topProcOptionList)
// console.log('---清空之后===== ', orginOptionList)
this
.
props
.
modelCallBack
(
orginOptionList
)
this
.
closeModal
()
// let {topProcOptionList} = this.state
// // 本地测试
// let curCalField = 'quantity'
// topProcOptionList.map(function(listItem) {
// listItem[SELECTED_QUQNTITY] = 0
// listItem[SELECTED_DATA_ARR] = []
// listItem[DEFAULT_SECOND_DATA].forEach(function(deIt) {
// deIt[curCalField] = 0
// })
// })
// // 回调函数
// // console.log('---清空之后===== ', topProcOptionList)
// this.props.modelCallBack(topProcOptionList)
// this.closeModal()
}
// 返回清空
...
...
@@ -620,7 +468,6 @@ class ProductModel extends Component {
renderTopProItem
()
{
let
{
topProcOptionList
,
topActiveIndex
}
=
this
.
state
return
(
<
ChooseCardList
cardStyleBox
=
{
styles
.
top_box
}
cardStyleScroll
=
{
styles
.
top_scroll_cont
}
...
...
@@ -644,33 +491,19 @@ class ProductModel extends Component {
// 返回底部主要元素
renderContItem
()
{
let
{
topProcOptionList
,
topActiveIndex
}
=
this
.
state
// let curData = topProcOptionList[topActiveIndex]
// console.log('curData---', topProcOptionList, topActiveIndex)
// // 本地测试数据
// let localBottomContData = []
// if(curData && curData.localBottomContData) {
// localBottomContData = curData.localBottomContData
// }
let
curData
=
topProcOptionList
[
topActiveIndex
]
// console.log('已选展示信息 === curData---', topProcOptionList, topActiveIndex, curData)
let
localBottomContData
=
[]
if
(
curData
&&
curData
[
SELECTED_DATA_ARR
]){
// localBottomContData = curData[SELECTED_DATA_ARR]
curData
[
SELECTED_DATA_ARR
].
forEach
(
function
(
sedItem
)
{
if
(
sedItem
[
CHILD_DATA_NAME
]){
localBottomContData
.
push
(...
sedItem
[
CHILD_DATA_NAME
])
}
})
}
console
.
log
(
'已选当前模块数据---'
,
curData
,
topActiveIndex
)
console
.
log
(
'已选展示信息---'
,
localBottomContData
)
// console.log('已选当前模块数据---',curData,topActiveIndex)
// console.log('已选展示信息---',localBottomContData)
return
(
<
View
style
=
{
styles
.
edit_cont
}
>
<
ScrollView
...
...
@@ -713,21 +546,6 @@ class ProductModel extends Component {
listCardActIndex
=
{
topActiveIndex
}
clearCallBack
=
{(
item
,
index
)
=>
this
.
handleClearBack
(
item
,
index
)}
/
>
{
/* <PicTitDetaiCalcu
listItem={item}
listIndex={index}
calField={DEFAULT_QUANTITY}
subCalCallBack={(item,index) => this.handleCalCallBack(item,index)}
titText={'title'}
listImgIcon={'imgIcon'}
listPicType={'SQUARE'}
listStyleImg={styles.list_icon}
listStyleTit={styles.list_tit}
// listShowChildNum={CHILD_DATA_NAME}
/> */
}
<
/TouchableOpacity
>
)
}
...
...
@@ -735,7 +553,6 @@ class ProductModel extends Component {
// 返回底部按钮
renderFooterBtnItem
()
{
let
{
topProcOptionList
}
=
this
.
state
let
allCountQuantity
=
0
topProcOptionList
.
map
(
proItem
=>
{
if
(
!
proItem
[
SELECTED_QUQNTITY
]){
...
...
@@ -743,7 +560,6 @@ class ProductModel extends Component {
}
allCountQuantity
+=
proItem
[
SELECTED_QUQNTITY
]
})
return
(
<
View
style
=
{
list_common_item
.
sub_box
}
>
<
View
style
=
{
list_common_item
.
sub_two_btn
}
>
...
...
@@ -774,7 +590,6 @@ class ProductModel extends Component {
{
this
.
renderRubbish
()}
{
this
.
renderTopProItem
()}
{
this
.
renderContItem
()}
{
/* {this.renderFooterBtnItem()} */
}
<
/View
>
{
this
.
renderFooterBtnItem
()}
<
/View
>
...
...
@@ -782,8 +597,7 @@ class ProductModel extends Component {
)
}
render
()
{
// console.log('已选----', this.state.isVisible)
render
()
{
return
(
<
View
style
=
{
styles
.
dia_container
}
>
<
Modal
...
...
@@ -832,21 +646,6 @@ const styles = StyleSheet.create({
// maxHeight: pxHeight(580),
// minHeight: pxHeight(360)
},
// item: {
// width: Width(),
// height: 40,
// paddingLeft: 20,
// paddingRight: 20,
// alignItems: 'center'
// },
// itemText: {
// fontSize: 16,
// color: third_text_color
// },
// curr_item: {
// color: first_text_color,
// fontWeight: 'bold'
// },
scro_box
:
{
flex
:
1
},
...
...
@@ -995,34 +794,6 @@ const styles = StyleSheet.create({
fontFamily
:
font_family_light
,
paddingLeft
:
4
}
// sub_box: {
// width: Width(),
// backgroundColor: dis_sub_color,
// flexDirection: 'row',
// shadowColor: '#E5E5E5',
// shadowOffset: {
// width: 0,
// height: -1
// },
// shadowOpacity: .3,
// shadowRadius: 2,
// elevation: 3
// },
// sub_btn_left: {
// width: '50%',
// backgroundColor: '#EEECEC'
// },
// sub_btn_tit: {
// fontSize: 18
// },
// sub_btn_left_text: {
// color: third_text_color
// },
// sub_btn_rig: {
// width: '50%',
// backgroundColor: promary_color
// },
// sub_btn_rig_text: {},
})
export
default
ProductModel
;
\ No newline at end of file
app/containers/common/listDataComponent/PageListArrow.js
0 → 100644
View file @
ea37a4c6
import
React
,
{
Component
}
from
'react'
;
import
{
StyleSheet
,
Image
,
TouchableOpacity
,
View
,
Modal
,
ActivityIndicator
,
Text
,
SafeAreaView
}
from
'react-native'
;
import
{
font_family_medium
,
Height
,
icon_style
,
pxSize
,
second_text_size
,
Width
}
from
'../../../base/BaseStyle'
;
import
{
AsteriskTextStyle
,
CellTextStyle
,
ContInputTextStyle
,
ContTextStyle
,
ImageTextStyle
,
TitleTextStyle
}
from
'../CellTextStyle'
;
import
DialogModel
from
'../DialogModel'
;
const
PropTypes
=
require
(
'prop-types'
);
/**
* 页面组件,可含选择器
*/
class
PageListArrow
extends
Component
{
static
propTypres
=
{
listActOpa
:
PropTypes
.
number
,
listCallBack
:
PropTypes
.
func
,
// 点击后的回调函数
listHasAster
:
PropTypes
.
bool
,
// 是否必填
listEditAble
:
PropTypes
.
bool
,
listDefaValue
:
PropTypes
.
string
,
listItem
:
PropTypes
.
object
,
listTitle
:
PropTypes
.
string
,
listName
:
PropTypes
.
string
,
listHasArrow
:
PropTypes
.
bool
,
}
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
listCurrentOption
:
[],
currentItem
:
{
name
:
'请选择'
,
value
:
''
},
currentTitle
:
'组织'
,
// 当前点击项
showTypePop
:
false
,
// 选择器弹窗
}
}
// 返回选择器弹窗
renderPickerModel
()
{
let
{
listCurrentOption
,
currentItem
,
currentTitle
,
showTypePop
}
=
this
.
state
return
(
<
SafeAreaView
style
=
{
styles
.
item_container
}
>
<
DialogModel
ref
=
{
'pickerModel'
}
entityList
=
{
listCurrentOption
}
callback
=
{(
item
,
itemTitle
)
=>
this
.
handleCallBack
(
item
,
itemTitle
)}
show
=
{
showTypePop
}
itemValue
=
{
currentItem
.
value
}
itemTitle
=
{
currentTitle
}
closeModal
=
{(
show
)
=>
this
.
handleCloseModal
(
show
)}
/
>
<
/SafeAreaView
>
)
}
render
()
{
let
{
listActOpa
,
listCallBack
,
listHasAster
,
listEditAble
,
listDefaValue
,
listItem
,
listTitle
,
listHasArrow
}
=
this
.
props
return
(
<
View
style
=
{
styles
.
item_container
}
>
<
TouchableOpacity
activeOpacity
=
{
listActOpa
}
onPress
=
{()
=>
listCallBack
()}
>
<
CellTextStyle
>
{
listHasAster
?
<
AsteriskTextStyle
>*<
/AsteriskTextStyle> : null
}
<
TitleTextStyle
>
{
listItem
[
listTitle
]}
<
/TitleTextStyle
>
{
listEditAble
?
<
ContInputTextStyle
editable
=
{
listEditAble
}
defaultValue
=
{
listItem
[
listDefaValue
]}
/>
:
<
ContTextStyle
>
{
listItem
[
listName
]}
<
/ContTextStyle
>
}
{
listHasArrow
?
<
ImageTextStyle
>
<
Image
source
=
{
require
(
'../../images/arr_rig.png'
)}
style
=
{
icon_style
}
/
>
<
/ImageTextStyle> : null
}
<
/CellTextStyle
>
<
/TouchableOpacity
>
{
this
.
renderPickerModel
()
}
<
/View
>
);
}
}
const
styles
=
StyleSheet
.
create
({
item_container
:
{
flex
:
1
}
})
export
default
PageListArrow
;
\ No newline at end of file
app/containers/common/listDataComponent/PicTitDetaiCalcu.js
View file @
ea37a4c6
import
React
,
{
Component
}
from
'react'
;
import
{
StyleSheet
,
Image
,
Text
,
TouchableOpacity
,
View
}
from
'react-native'
;
import
{
first_text_color
,
font_family_light
,
font_family_medium
,
font_family_regular
,
font_family_semibold
,
home_background_color
,
icon_style
,
promary_text_color
,
pxSize
,
second_text_size
,
third_text_color
,
third_text_size
}
from
'../../../base/BaseStyle'
;
import
PictureZoom
from
'../../common/listDataComponent/PictureZoom'
;
const
PropTypes
=
require
(
'prop-types'
);
class
PicTitDetaiCalcu
extends
Component
{
...
...
@@ -93,7 +94,7 @@ class PicTitDetaiCalcu extends Component {
calIcon
=
require
(
'../../../images/plur_big_act.png'
)
}
console
.
log
(
'每一列----'
,
showClearIcon
,
listCardActIndex
,
showClearIndex
,
(
showClearIcon
&&
listIndex
===
showClearIndex
)
)
console
.
log
(
'每一列----'
,
listItem
[
listImgIcon
],
listItem
[
listImgIcon
]
instanceof
Array
)
return
(
...
...
@@ -148,9 +149,18 @@ class PicTitDetaiCalcu extends Component {
<
View
style
=
{[
styles
.
ri_inner
,
listStyleBox
]}
>
{
listImgIcon
?
{
/* {
listImgIcon ?
<View style={[styles.oth_img_box, styles[picOthStyle], listStyleImg]}>
<
Image
style
=
{
icon_style
}
source
=
{
listItem
.
imgIcon
}
/
>
<Image style={icon_style} source={listItem[listImgIcon]}/>
</View> : null } */
}
{
(
listImgIcon
&&
listItem
[
listImgIcon
]
instanceof
Array
)
?
<
PictureZoom
listImageIndex
=
{
0
}
listImageUrls
=
{
listItem
[
listImgIcon
]}
listStyleImage
=
{[
styles
.
oth_img_box
,
styles
[
picOthStyle
],
listStyleImg
]}
listPicType
=
{
listPicType
}
/>: listImgIcon
?
<View style={
[
styles.oth_img_box, styles[picOthStyle
]
, listStyleImg]}
>
<
Image
style
=
{
icon_style
}
source
=
{
listItem
[
listImgIcon
]}
/
>
<
/View> : null
}
<
View
style
=
{
styles
.
ri_text_box
}
>
<
TouchableOpacity
...
...
@@ -161,10 +171,10 @@ class PicTitDetaiCalcu extends Component {
<
Text
numberOfLines
=
{
1
}
style
=
{[
styles
.
thr_ot
,
listStyleTit
]}
>
{
listItem
[
titText
]
}
<
/Text
>
{
listItem
[
tipTextStr
]
?
<
Text
numberOfLines
=
{
1
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_str
,
listStyleTip
]}
>
{
listItem
[
tipTextStr
]}
<
/Text> : null
}
{
listItem
[
tipTextOne
]
?
<
Text
numberOfLines
=
{
1
}
style
=
{[
styles
.
ri_te_ot
,
listStyleTip
]}
>
{
listItem
[
tipTextOne
]}
<
/Text> : null
}
{
listItem
[
tipTextTwo
]
?
<
Text
numberOfLines
=
{
1
}
style
=
{[
styles
.
ri_te_ot
,
listStyleTip
]}
>
{
listItem
[
tipTextTwo
]}
<
/Text> : null
}
<
/TouchableOpacity
>
{
listItem
[
tipTextStr
]
?
<
Text
numberOfLines
=
{
1
}
style
=
{[
styles
.
ri_te_ot
,
styles
.
te_ot_str
,
listStyleTip
]}
>
{
listItem
[
tipTextStr
]}
<
/Text> : null
}
{
listItem
[
tipTextOne
]
?
<
Text
numberOfLines
=
{
1
}
style
=
{[
styles
.
ri_te_ot
,
listStyleTip
]}
>
{
listItem
[
tipTextOne
]}
<
/Text> : null
}
{
listItem
[
tipTextTwo
]
?
<
Text
numberOfLines
=
{
1
}
style
=
{[
styles
.
ri_te_ot
,
listStyleTip
]}
>
{
listItem
[
tipTextTwo
]}
<
/Text> : null
}
<
/View
>
{
(
showClearIcon
&&
listCardActIndex
===
showClearIndex
)
?
...
...
app/containers/selfOrder/SelfOrderPage.js
View file @
ea37a4c6
...
...
@@ -8,7 +8,11 @@ import {
Image
,
ScrollView
,
TextInput
,
FlatList
FlatList
,
Alert
,
Linking
,
NativeModules
,
Platform
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
;
import
{
...
...
@@ -34,19 +38,38 @@ import {
ContInputTextStyle
,
FooterBtnStyle
}
from
'../common/CellTextStyle'
;
import
ItemCellModel
from
'../common/ItemCellModel'
;
import
tagData
from
'./module/mock/listTagData'
;
import
{
show
,
isEmpty
,
formatStrForDate
,
changeDateFormat
}
from
'../../utils/Utils'
;
import
{
show
,
isEmpty
,
formatStrForDate
,
cloneObject
,
dedupQuoteArray
,
changeDateFormat
}
from
'../../utils/Utils'
;
import
HeadBackItem
from
'../common/HeadBackItem'
;
import
StatusBarView
from
'../common/StatusBarView'
;
import
{
requestOrganizations
}
from
'../../action/SelfAction'
;
import
{
SELF_ORDER_LIST_DOING
,
SELF_ORDER_LIST_SUCCESS
,
SELF_ORDER_LIST_FAILURE
}
from
'../../base/ActionTypes'
;
import
DialogModel
from
'../common/DialogModel'
;
import
LodingModel
from
'../common/LodingModel'
;
import
DateModel
from
'../common/DateModel'
;
import
DatePicker
from
'react-native-date-picker'
;
import
{
AudioRecorder
,
AudioUtils
}
from
'react-native-audio'
;
import
Sound
from
'react-native-sound'
;
import
{
requestSelfOrganizations
,
requestSelfSurgeryHospital
,
requestSelfOrderType
,
requestSelfTemplateCollect
,
requestSelfAudio
,
requestSelfSumbit
,
setSelfInitData
,
reqSelfSurgeryHospital
,
requestListDataSuccess
,
requestSelfSurgeryType
}
from
'../../action/SelfAction'
;
import
{
exitLoginStatus
}
from
'../../action/LoginAction'
;
import
{
SELF_ORDER_LIST_DOING
,
SELF_ORDER_LIST_SUCCESS
,
SELF_ORDER_LIST_FAILURE
,
LOGIN_NO
,
SELF_SUBMIT_DOING
,
SELF_SUBMIT_SUCCESS
,
SELF_SUBMIT_FAILURE
}
from
'../../base/ActionTypes'
;
import
tagData
from
'./module/mock/listTagData'
;
class
SelfOrderPage
extends
Component
{
constructor
(
props
)
{
...
...
@@ -57,60 +80,45 @@ class SelfOrderPage extends Component {
{
"id"
:
"0"
,
title
:
'销售员'
,
name
:
'蔡妍'
,
value
:
'蔡妍'
,
isPicker
:
false
,
select
:
false
,
isEditable
:
false
// 不可编辑
name
:
''
,
value
:
''
},
{
"id"
:
"1"
,
title
:
'组织'
,
name
:
'请选择'
,
value
:
''
,
isPicker
:
true
,
select
:
false
value
:
''
},
{
"id"
:
"2"
,
title
:
'客户名称'
,
name
:
'请选择'
,
value
:
''
,
isPicker
:
true
,
select
:
false
value
:
''
},
{
"id"
:
"3"
,
title
:
'收单地点'
,
name
:
'请选择'
,
value
:
''
,
isPicker
:
true
,
select
:
false
value
:
''
},
{
"id"
:
"4"
,
title
:
'收货地点'
,
name
:
'请选择'
,
value
:
''
,
isPicker
:
true
,
select
:
false
value
:
''
},
{
"id"
:
"5"
,
title
:
'主治医生'
,
name
:
'请选择'
,
value
:
''
,
isPicker
:
true
,
select
:
false
,
showInput
:
false
,
inputValue
:
''
},
{
"id"
:
"6"
,
title
:
'手术名称'
,
value
:
''
,
isPicker
:
false
,
select
:
false
value
:
''
},
{
"id"
:
"7"
,
...
...
@@ -118,8 +126,6 @@ class SelfOrderPage extends Component {
name
:
'请选择'
,
value
:
''
,
dateValue
:
new
Date
(),
isPicker
:
true
,
select
:
false
,
showDatePicker
:
true
},
{
...
...
@@ -127,43 +133,33 @@ class SelfOrderPage extends Component {
title
:
'手术类型'
,
name
:
'请选择'
,
value
:
''
,
isPicker
:
true
,
select
:
false
},
{
"id"
:
"9"
,
title
:
'订单类型'
,
name
:
'请选择'
,
value
:
''
,
isPicker
:
true
,
select
:
false
value
:
''
},
{
"id"
:
"10"
,
title
:
'选择产品'
,
name
:
'请选择'
,
value
:
''
,
isPicker
:
true
,
select
:
false
,
showItemPage
:
true
// 展示子页
value
:
''
},
{
"id"
:
"11"
,
title
:
'备注'
,
value
:
''
,
isPicker
:
false
,
select
:
false
,
isRemark
:
true
// 备注
},
{
"id"
:
"12"
,
title
:
'还有什么要安排的,可录音备注哟!'
,
value
:
''
,
isPicker
:
false
,
select
:
false
,
isRecode
:
true
// 录音
}
],
subInitListOption
:
[],
// 提交成功后,初始化当前数据
submitOption
:
{
// 提交的信息
seller_code
:
''
,
// 用户名username
org_code
:
''
,
// 组织
...
...
@@ -182,6 +178,10 @@ class SelfOrderPage extends Component {
name
:
'请选择'
,
value
:
'-1'
},
localOtherObj
:
{
// 恢复原状态
name
:
'请选择'
,
value
:
''
},
currentTitle
:
'组织'
,
// 当前点击项
showTypePop
:
false
,
// 选择器弹窗
isSubLoding
:
false
,
// 加载中弹窗
...
...
@@ -190,71 +190,103 @@ class SelfOrderPage extends Component {
{
name
:
'男'
,
value
:
'boy'
},
{
name
:
'女'
,
value
:
'girl'
},
{
name
:
'其他'
,
value
:
'other'
},
{
name
:
'其他1'
,
value
:
'other1'
},
{
name
:
'其他2'
,
value
:
'other2'
},
{
name
:
'其他3'
,
value
:
'other3'
},
{
name
:
'其他4'
,
value
:
'other4'
},
{
name
:
'其他5'
,
value
:
'other5'
},
{
name
:
'其他6'
,
value
:
'other6'
}
],
dateModelPop
:
false
,
// 日期选择器
hasPermission
:
undefined
,
//录音 授权状态
audioPath
:
AudioUtils
.
DocumentDirectoryPath
+
'/selfAudio.aac'
,
// 文件路径
audioPath
:
AudioUtils
.
DocumentDirectoryPath
+
`/self_audio_
${
new
Date
().
getTime
()}
.aac`
,
// 文件路径
recording
:
false
,
//是否录音
pause
:
false
,
//录音是否暂停
stop
:
false
,
//录音是否停止
currentTime
:
0
,
//录音时长
localCustomersOption
:
[],
// 当前医院信息:客户名称、收单地点、收货地点、主治医生
}
}
componentDidMount
()
{
// 请求授权
this
.
getSellerName
()
this
.
getAudioAuthorize
()
// // 请求授权
// AudioRecorder.requestAuthorization()
// .then(isAuthor => {
// console.warn('是否授权: ' + isAuthor)
// if(!isAuthor) {
// return alert('请前往设置开启录音权限')
// }
// this.setState({hasPermission: isAuthor})
// this.prepareRecordingPath(this.state.audioPath);
// // 录音进展
// AudioRecorder.onProgress = (data) => {
// this.setState({currentTime: Math.floor(data.currentTime)});
// };
// // 完成录音
// AudioRecorder.onFinished = (data) => {
// // data 返回需要上传到后台的录音数据
// console.warn(this.state.currentTime)
// console.warn(data)
// };
// })
}
// 赋值销售员 初始化数据
getSellerName
()
{
let
{
state
,
props
}
=
this
let
{
listOptionData
}
=
this
.
state
this
.
setState
({
subInitListOption
:
cloneObject
(
listOptionData
)
// 存储初始化数据,提交成功后赋此值
})
if
(
state
.
listOptionData
[
0
].
name
!==
props
.
userInfo
.
person_name
)
{
listOptionData
[
0
].
name
=
props
.
userInfo
.
person_name
listOptionData
[
0
].
value
=
props
.
userInfo
.
user_name
this
.
setState
({
listOptionData
,
subInitListOption
:
cloneObject
(
listOptionData
)
})
}
}
// 请求授权
getAudioAuthorize
()
{
AudioRecorder
.
requestAuthorization
()
.
then
(
isAuthor
=>
{
console
.
warn
(
'是否授权: '
+
isAuthor
)
console
.
log
(
'是否授权: '
+
isAuthor
)
if
(
!
isAuthor
)
{
return
alert
(
'请前往设置开启录音权限'
)
// return alert('APP需要使用录音,请打开录音权限允许APP使用')
return
Alert
.
alert
(
'提示信息'
,
'APP需要使用录音,请打开录音权限允许APP使用'
,
[{
text
:
'设置'
,
onPress
:
()
=>
{
if
(
Platform
.
OS
==
'ios'
)
{
Linking
.
openURL
(
'app-settings:'
)
.
catch
(
err
=>
console
.
log
(
'error'
,
err
))
}
else
if
(
Platform
.
OS
==
'android'
)
{
NativeModules
.
OpenSettings
.
openNetworkSettings
(
data
=>
{
console
.
log
(
'call back data'
,
data
)
}).
catch
(
err
=>
console
.
log
(
'android---'
,
err
))
}
}
},
{
text
:
'取消'
,
}])
}
this
.
setState
({
hasPermission
:
isAuthor
})
this
.
prepareRecordingPath
(
this
.
state
.
audioPath
);
// 录音进展
AudioRecorder
.
onProgress
=
(
data
)
=>
{
this
.
setState
({
currentTime
:
Math
.
floor
(
data
.
currentTime
)});
this
.
setState
({
currentTime
:
Math
.
ceil
(
data
.
currentTime
)
});
};
// 完成录音
AudioRecorder
.
onFinished
=
(
data
)
=>
{
// data 返回需要上传到后台的录音数据
console
.
warn
(
this
.
state
.
currentTime
)
console
.
warn
(
data
)
// data 录音数据
console
.
log
(
this
.
state
.
currentTime
)
};
})
})
}
/**
...
...
@@ -281,96 +313,153 @@ class SelfOrderPage extends Component {
// 开始录音
_record
=
async
()
=>
{
console
.
warn
(
'changan'
)
show
(
'录音开始'
)
console
.
warn
(
'开始录音=='
)
// show('录音开始')
// if(!this.state.hasPermission) {
// return alert('没有授权')
// }
// if(this.state.recording) {
// return alert('正在录音中...')
// }
// if(this.state.stop) {
// // 初始化录音
// this.prepareRecordingPath(this.state.audioPath)
// }
// this.setState({recording: true,pause: false})
// try {
// await AudioRecorder.startRecording()
// } catch (err) {
// console.log(err)
// }
if
(
!
this
.
state
.
hasPermission
)
{
return
alert
(
'没有授权'
)
}
if
(
this
.
state
.
recording
)
{
return
alert
(
'正在录音中...'
)
return
Alert
.
alert
(
'提示信息'
,
'APP需要使用录音,请打开录音权限允许APP使用'
,
[{
text
:
'设置'
,
onPress
:
()
=>
{
if
(
Platform
.
OS
==
'ios'
)
{
Linking
.
openURL
(
'app-settings:'
)
.
catch
(
err
=>
console
.
log
(
'error'
,
err
))
}
else
if
(
Platform
.
OS
==
'android'
)
{
NativeModules
.
OpenSettings
.
openNetworkSettings
(
data
=>
{
console
.
log
(
'call back data'
,
data
)
}).
catch
(
err
=>
console
.
log
(
'android---'
,
err
))
}
}
},
{
text
:
'取消'
,
}])
// return
}
show
(
'录音开始'
)
if
(
this
.
state
.
stop
)
{
// 初始化录音
this
.
prepareRecordingPath
(
this
.
state
.
audioPath
)
}
this
.
setState
({
recording
:
true
,
pause
:
false
})
try
{
await
AudioRecorder
.
startRecording
()
}
catch
(
err
)
{
console
.
log
(
err
)
console
.
error
(
err
)
}
}
// 暂停录音
_pause
=
async
()
=>
{
if
(
!
this
.
state
.
recording
)
{
return
alert
(
'当前未录音'
)
}
//
_pause = async () => {
//
if(!this.state.recording) {
//
return alert('当前未录音')
//
}
try
{
await
AudioRecorder
.
pauseRecording
()
this
.
setState
({
pause
:
true
,
recording
:
false
})
}
catch
(
err
)
{
console
.
log
(
err
)
}
}
//
try {
//
await AudioRecorder.pauseRecording()
//
this.setState({pause: true, recording: false})
//
} catch (err) {
//
console.log(err)
//
}
//
}
// 恢复录音
_resume
=
async
()
=>
{
if
(
!
this
.
state
.
pause
)
{
return
alert
(
'录音未暂停'
)
}
//
_resume = async () => {
//
if(!this.state.pause) {
//
return alert('录音未暂停')
//
}
try
{
await
AudioRecorder
.
resumeRecording
();
this
.
setState
({
pause
:
false
,
recording
:
true
})
}
catch
(
err
)
{
console
.
log
(
err
)
}
}
//
try {
//
await AudioRecorder.resumeRecording();
//
this.setState({pause: false, recording: true})
//
} catch (err) {
//
console.log(err)
//
}
//
}
// 停止录音
_stop
=
async
()
=>
{
console
.
warn
(
'tanqi'
)
console
.
log
(
'----停止录音---'
,
this
.
state
.
hasPermission
)
if
(
!
this
.
state
.
hasPermission
)
{
return
// return alert('没有授权')
}
show
(
'录音结束'
)
console
.
warn
(
'停止录音'
,
this
.
state
.
currentTime
)
try
{
await
AudioRecorder
.
stopRecording
();
this
.
setState
({
stop
:
true
,
recording
:
false
,
paused
:
false
});
this
.
setState
({
stop
:
true
});
}
catch
(
error
)
{
console
.
error
(
error
);
console
.
log
(
'stop record--error->'
,
error
);
}
// console.warn('tanqi')
// show('录音结束')
// console.warn('停止录音',this.state.currentTime)
// try {
// await AudioRecorder.stopRecording();
// this.setState({stop: true, recording: false, paused: false});
// } catch (error) {
// console.error(error);
// }
}
// 播放录音
_play
=
async
()
=>
{
let
self
=
this
show
(
'正在播放'
)
self
.
whoosh
=
new
Sound
(
this
.
state
.
audioPath
,
''
,
(
err
)
=>
{
if
(
err
)
{
show
(
'加载音频失败'
)
return
console
.
warn
(
err
)
return
console
.
log
(
'加载音频失败-->'
,
err
)
}
self
.
whoosh
.
play
(
success
=>
{
if
(
success
)
{
console
.
warn
(
'success - 播放成功
'
)
show
(
'播放完毕
'
)
}
else
{
console
.
warn
(
'fail - 播放失败'
)
show
(
'播放失败'
)
console
.
log
(
'fail - 播放失败'
)
}
})
})
// let self = this
// self.whoosh = new Sound(this.state.audioPath, '', (err) => {
// if(err) {
// show('加载音频失败')
// return console.warn(err)
// }
// self.whoosh.play(success => {
// if(success) {
// console.warn('success - 播放成功')
// }else {
// console.warn('fail - 播放失败')
// show('播放失败')
// }
// })
// })
}
// 停止播放录音 -- 安卓不能停止、ios可以
_stopPlay
=
async
()
=>
{
console
.
warn
(
'tingzhi bofang'
)
let
self
=
this
self
.
whoosh
.
stop
(()
=>
{
console
.
warn
(
'success - 停止成功'
)
})
}
//
_stopPlay = async () => {
//
console.warn('tingzhi bofang')
//
let self = this
//
self.whoosh.stop(() => {
//
console.warn('success - 停止成功')
//
})
//
}
// 删除录音
_del
=
async
()
=>
{
...
...
@@ -401,61 +490,179 @@ class SelfOrderPage extends Component {
// }
componentWillReceiveProps
(
nextProps
)
{
let
{
self_list_status
}
=
this
.
props
let
{
self_list_status
,
loginState
,
navigation
,
submit_self_order_status
}
=
this
.
props
let
self
=
this
if
(
self_list_status
!=
nextProps
.
self_list_status
)
{
// console.warn('-222------', nextProps.self_list_status)
// console.warn('--222---self_list_status--', self_list_status)
switch
(
nextProps
.
self_list_status
)
{
case
SELF_ORDER_LIST_DOING
:
this
.
changeSubLoding
(
true
)
break
;
case
SELF_ORDER_LIST_SUCCESS
:
self
.
changeSubLoding
()
setTimeout
(()
=>
{
self
.
setState
({
isSubLoding
:
false
,
lodingTitle
:
'加载中'
},()
=>
{
self
.
changeCurrentOption
()
}
,
500
)
})
break
;
case
SELF_ORDER_LIST_FAILURE
:
this
.
changeSubLoding
()
this
.
changeSubLoding
(
false
)
break
;
default
:
break
;
}
}
if
(
loginState
!=
nextProps
.
loginState
)
{
switch
(
nextProps
.
loginState
)
{
case
LOGIN_NO
:
navigation
.
navigate
(
'LoginPage'
)
break
;
default
:
break
;
}
}
if
(
submit_self_order_status
!=
nextProps
.
submit_self_order_status
)
{
switch
(
nextProps
.
submit_self_order_status
)
{
case
SELF_SUBMIT_DOING
:
this
.
changeSubLoding
(
true
,
'提交中'
)
break
;
case
SELF_SUBMIT_SUCCESS
:
self
.
setState
({
isSubLoding
:
false
,
lodingTitle
:
'提交中'
},()
=>
{
self
.
processReturnData
()
})
break
;
case
SELF_SUBMIT_FAILURE
:
this
.
changeSubLoding
(
false
,
'提交中'
)
break
;
default
:
break
;
}
}
// let self = this
// if(self_list_status != nextProps.self_list_status) {
// // console.warn('-222------', nextProps.self_list_status)
// // console.warn('--222---self_list_status--', self_list_status)
// switch (nextProps.self_list_status) {
// case SELF_ORDER_LIST_DOING:
// this.changeSubLoding(true)
// break;
// case SELF_ORDER_LIST_SUCCESS:
// self.changeSubLoding()
// setTimeout(() => {
// self.changeCurrentOption()
// }, 500)
// break;
// case SELF_ORDER_LIST_FAILURE:
// this.changeSubLoding()
// break;
// }
// }
}
// 修改正在加载
changeSubLoding
(
loading
)
{
changeSubLoding
(
loading
,
loadTit
)
{
this
.
setState
({
isSubLoding
:
loading
||
false
,
lodingTitle
:
loadTit
||
'加载中'
})
}
// 清空当前项以下的值
clearInitNameAndValue
(
curIndex
)
{
let
{
listOptionData
,
localOtherObj
}
=
this
.
state
let
that
=
this
this
.
setState
({
listOptionData
:
listOptionData
.
map
((
item
,
index
)
=>
{
if
(
index
>
curIndex
&&
index
<
12
)
{
item
.
name
=
localOtherObj
.
name
item
.
value
=
localOtherObj
.
value
// if(listOptionData[1].value && item.title == '客户名称') {
// that.organizationGetCustomerData()
// }
// if(listOptionData[2].value && item.title == '收单地点') {
// that.customerGetBill()
// }
// if(listOptionData[2].value && item.title == '收货地点') {
// that.customerGetShip()
// }
// if(item.title == '主治医生') {
// item.showInput = false,
// item.inputValue = ''
// }
}
return
item
})
})
}
// 判断是否都有值,修改提交按钮的颜色
changeCanSub
(
isSubCheck
)
{
let
{
listOptionData
}
=
this
.
state
let
tempStatus
=
false
let
tempTit
=
''
for
(
let
chIndex
in
listOptionData
)
{
// if(chIndex > 0 && chIndex < 10
// && chIndex != 6 && chIndex != 8
// && !listOptionData[chIndex].value
// && listOptionData[chIndex].name !== '其他') {
// // 不是主治医生
// tempTit = listOptionData[chIndex].title
// tempStatus = true
// break
// }
}
this
.
setState
({
isSubLoding
:
loading
||
false
canSubFlag
:
!
tempStatus
})
if
(
isSubCheck
&&
tempStatus
)
{
show
(
`
${
tempTit
}
未选择,不能提交`
)
}
}
// 选择器弹窗回调函数
handleCallBack
(
item
,
itemTitle
)
{
// console.warn(item, 'item------')
// console.warn('item-itemTitle-----',itemTitle)
let
{
listOptionData
}
=
this
.
state
// console.warn('选择器弹窗回调函数-----',itemTitle)
let
{
listOptionData
}
=
this
.
state
let
self
=
this
listOptionData
.
map
(
function
(
chItem
,
index
){
if
(
chItem
.
title
===
itemTitle
)
{
chItem
.
name
=
item
.
name
chItem
.
value
=
item
.
value
// if(itemTitle === '组织') {
// self.clearInitNameAndValue(1)
// }
// if(itemTitle === '客户名称') {
// self.clearInitNameAndValue(2)
// }
// if (itemTitle === '主治医生') {
// if(item.name === '其他') {
// chItem.showInput = true
// } else {
// chItem.showInput = false
// chItem.inputValue = ''
// }
// self.clearInitNameAndValue(5)
// }
// if(itemTitle === '手术类型') {
// self.clearInitNameAndValue(6)
// }
// if (itemTitle === '手术模板') {
// listOptionData[10].value = item.desc
// }
}
})
this
.
setState
({
currentItem
:
item
,
listOptionData
:
listOptionData
},()
=>
{
self
.
changeCanSub
()
})
// if(itemTitle === '组织' || itemTitle === '客户名称') {
this
.
setState
({
listOptionData
:
listOptionData
.
map
((
chItem
,
index
)
=>
{
if
(
chItem
.
title
===
itemTitle
)
{
console
.
warn
(
'---hhh-----'
,
item
)
chItem
.
name
=
item
.
name
chItem
.
value
=
item
.
value
if
(
itemTitle
===
'主治医生'
&&
item
.
name
===
'其他'
)
{
chItem
.
showInput
=
true
}
}
return
chItem
})
})
// }
// console.warn('listOptionData[2]-----',this.state.listOptionData[2])
}
// 关闭弹窗
...
...
@@ -467,117 +674,181 @@ class SelfOrderPage extends Component {
// 修改当前选择器数据
changeCurrentOption
()
{
let
{
listOptionData
,
currentTitle
}
=
this
.
state
let
{
currentTitle
}
=
this
.
state
let
{
selfOrderOption
}
=
this
.
props
console
.
warn
(
'当前:--selfOrderOption---'
,
selfOrderOption
)
let
tempOption
=
[]
let
that
=
this
if
(
selfOrderOption
.
length
===
0
)
{
show
(
`当前
${
currentTitle
}
为空`
)
return
}
if
(
currentTitle
===
'组织'
)
{
tempOption
=
this
.
changeNameAndValue
(
selfOrderOption
,
'org_name'
,
'org_code'
)
}
else
if
(
currentTitle
===
'客户名称'
)
{
tempOption
=
[
{
customer_name
:
'医院-4'
,
customer_code
:
'customer_4'
},
{
customer_name
:
'医院-5'
,
customer_code
:
'customer_5'
},
{
customer_name
:
'医院-6'
,
customer_code
:
'customer_6'
}
]
tempOption
=
this
.
changeNameAndValue
(
tempOption
,
'customer_name'
,
'customer_code'
)
}
else
if
(
currentTitle
===
'收单地点'
)
{
tempOption
=
[
{
bill_to_site_name
:
'收单地点-4'
,
bill_to_site_code
:
'bill_4'
},
{
bill_to_site_name
:
'收单地点-5'
,
bill_to_site_code
:
'bill_5'
},
{
bill_to_site_name
:
'收单地点-6'
,
bill_to_site_code
:
'bill_6'
}
]
tempOption
=
this
.
changeNameAndValue
(
tempOption
,
'bill_to_site_name'
,
'bill_to_site_code'
)
}
else
if
(
currentTitle
===
'收货地点'
)
{
tempOption
=
[
{
ship_to_site_name
:
'收货地点-4'
,
ship_to_site_code
:
'ship_4'
},
{
ship_to_site_name
:
'收货地点-5'
,
ship_to_site_code
:
'ship_5'
},
{
ship_to_site_name
:
'收货地点-6'
,
ship_to_site_code
:
'ship_6'
}
]
tempOption
=
this
.
changeNameAndValue
(
tempOption
,
'ship_to_site_name'
,
'ship_to_site_code'
)
}
else
if
(
currentTitle
===
'主治医生'
)
{
tempOption
=
[
{
doctor_name
:
'主治医生-4'
,
doctor_code
:
'doctor_4'
},
{
doctor_name
:
'主治医生-5'
,
doctor_code
:
'doctor_5'
},
{
doctor_name
:
'主治医生-6'
,
doctor_code
:
'doctor_6'
}
]
tempOption
.
push
({
doctor_name
:
'其他'
,
doctor_code
:
'-1'
this
.
setState
({
localCustomersOption
:
selfOrderOption
})
tempOption
=
this
.
changeNameAndValue
(
tempOption
,
'doctor_name'
,
'doctor_code'
)
// 去重医院数据
let
filterOpt
=
dedupQuoteArray
(
selfOrderOption
,
'customer_code'
)
let
currentArr
=
[]
if
(
filterOpt
.
length
)
{
filterOpt
.
forEach
(
item
=>
{
let
obj
=
{}
obj
.
customer_code
=
item
.
customer_code
obj
.
customer_name
=
item
.
customer_name
currentArr
.
push
(
obj
)
})
}
tempOption
=
this
.
changeNameAndValue
(
currentArr
,
'customer_name'
,
'customer_code'
)
}
else
if
(
currentTitle
===
'手术类型'
)
{
tempOption
=
[
{
surgery_type_name
:
'手术类型-4'
,
surgery_type_code
:
'surgery_4'
},
{
surgery_type_name
:
'手术类型-5'
,
surgery_type_code
:
'surgery_5'
},
{
surgery_type_name
:
'手术类型-6'
,
surgery_type_code
:
'surgery_6'
}
]
tempOption
=
this
.
changeNameAndValue
(
tempOption
,
'surgery_type_name'
,
'surgery_type_code'
)
}
else
if
(
currentTitle
===
'订单类型'
)
{
tempOption
=
[
{
order_type_name
:
'订单类型-4'
,
order_type_code
:
'order_4'
},
{
order_type_name
:
'订单类型-5'
,
order_type_code
:
'order_5'
},
{
order_type_name
:
'订单类型-6'
,
order_type_code
:
'order_6'
let
resultArr
=
[]
selfOrderOption
.
forEach
(
item
=>
{
let
obj
=
{}
obj
.
name
=
item
.
value_name
obj
.
value
=
item
.
value_code
resultArr
.
push
(
obj
)
})
tempOption
=
[...
resultArr
]
}
else
if
(
currentTitle
===
'手术模板'
)
{
let
resultArr
=
[]
selfOrderOption
.
forEach
(
item
=>
{
let
obj
=
{}
let
tempName
=
item
.
template_name
if
(
item
.
doctor_name
)
{
tempName
+=
`——
${
item
.
doctor_name
}
`
}
]
tempOption
=
this
.
changeNameAndValue
(
tempOption
,
'order_type_name'
,
'order_type_code'
)
obj
.
name
=
tempName
obj
.
value
=
item
.
template_number
obj
.
desc
=
item
.
template_desc
obj
.
template_pic
=
item
.
template_pic
resultArr
.
push
(
obj
)
})
tempOption
=
[...
resultArr
]
}
else
if
(
currentTitle
===
'订单类型'
)
{
tempOption
=
this
.
changeNameAndValue
(
selfOrderOption
,
'value_name'
,
'value_code'
)
}
this
.
setState
({
showTypePop
:
true
,
listCurrentOption
:
[...
tempOption
]
},
()
=>
{
// 解决 IOS 弹窗显示问题
setTimeout
(()
=>
{
that
.
setState
({
showTypePop
:
true
})
},
500
)
})
// let { listOptionData, currentTitle } = this.state
// let { selfOrderOption } = this.props
// console.warn('当前:--selfOrderOption---', selfOrderOption)
// let tempOption = []
// if (currentTitle === '组织') {
// tempOption = this.changeNameAndValue(selfOrderOption, 'org_name', 'org_code')
// } else if (currentTitle === '客户名称') {
// tempOption =[
// {
// customer_name: '医院-4',
// customer_code: 'customer_4'
// },
// {
// customer_name: '医院-5',
// customer_code: 'customer_5'
// },
// {
// customer_name: '医院-6',
// customer_code: 'customer_6'
// }
// ]
// tempOption = this.changeNameAndValue(tempOption, 'customer_name', 'customer_code')
// } else if (currentTitle === '收单地点') {
// tempOption =[
// {
// bill_to_site_name: '收单地点-4',
// bill_to_site_code: 'bill_4'
// },
// {
// bill_to_site_name: '收单地点-5',
// bill_to_site_code: 'bill_5'
// },
// {
// bill_to_site_name: '收单地点-6',
// bill_to_site_code: 'bill_6'
// }
// ]
// tempOption = this.changeNameAndValue(tempOption, 'bill_to_site_name', 'bill_to_site_code')
// } else if (currentTitle === '收货地点') {
// tempOption =[
// {
// ship_to_site_name: '收货地点-4',
// ship_to_site_code: 'ship_4'
// },
// {
// ship_to_site_name: '收货地点-5',
// ship_to_site_code: 'ship_5'
// },
// {
// ship_to_site_name: '收货地点-6',
// ship_to_site_code: 'ship_6'
// }
// ]
// tempOption = this.changeNameAndValue(tempOption, 'ship_to_site_name', 'ship_to_site_code')
// } else if (currentTitle === '主治医生') {
// tempOption =[
// {
// doctor_name: '主治医生-4',
// doctor_code: 'doctor_4'
// },
// {
// doctor_name: '主治医生-5',
// doctor_code: 'doctor_5'
// },
// {
// doctor_name: '主治医生-6',
// doctor_code: 'doctor_6'
// }
// ]
// tempOption.push({
// doctor_name: '其他',
// doctor_code: '-1'
// })
// tempOption = this.changeNameAndValue(tempOption, 'doctor_name', 'doctor_code')
// } else if (currentTitle === '手术类型') {
// tempOption =[
// {
// surgery_type_name: '手术类型-4',
// surgery_type_code: 'surgery_4'
// },
// {
// surgery_type_name: '手术类型-5',
// surgery_type_code: 'surgery_5'
// },
// {
// surgery_type_name: '手术类型-6',
// surgery_type_code: 'surgery_6'
// }
// ]
// tempOption = this.changeNameAndValue(tempOption, 'surgery_type_name', 'surgery_type_code')
// } else if (currentTitle === '订单类型') {
// tempOption =[
// {
// order_type_name: '订单类型-4',
// order_type_code: 'order_4'
// },
// {
// order_type_name: '订单类型-5',
// order_type_code: 'order_5'
// },
// {
// order_type_name: '订单类型-6',
// order_type_code: 'order_6'
// }
// ]
// tempOption = this.changeNameAndValue(tempOption, 'order_type_name', 'order_type_code')
// }
// this.setState({
// showTypePop: true,
// listCurrentOption: [...tempOption]
// })
}
// 修改选择器为属性 name 和 value
...
...
@@ -594,138 +865,323 @@ class SelfOrderPage extends Component {
// 组织 点击
handleOrganizationCheck
()
{
let
{
listOptionData
}
=
this
.
state
let
{
token
,
requestOrganizations
}
=
this
.
props
console
.
warn
(
'组织------check'
,
token
,
requestOrganizations
)
let
self
=
this
let
{
state
,
props
}
=
this
this
.
setState
({
currentTitle
:
'组织'
,
currentItem
:
{
name
:
listOptionData
[
1
].
name
,
value
:
listOptionData
[
1
].
value
name
:
state
.
listOptionData
[
1
].
name
,
value
:
state
.
listOptionData
[
1
].
value
}
},
()
=>
{
requestOrganizations
(
token
)
let
params
=
{
access_token
:
props
.
token
}
props
.
requestSelfOrganizations
(
params
)
})
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.warn('组织------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// isSubLoding: true
// currentTitle: '组织',
// currentItem: {
// name: listOptionData[1].name,
// value: listOptionData[1].value
// }
// }, () => {
// setTimeout(() => {
// self.setState({
// currentTitle: '组织',
// showTypePop: true,
// currentItem: {
// name: listOptionData[1].name,
// value: listOptionData[1].value
// },
// listCurrentOption: [
// {
// name: '男',
// value: 'boy'
// },
// {
// name: '女',
// value: 'girl'
// },
// {
// name: '其他',
// value: 'other'
// }
// ],
// isSubLoding: false
// })
// }, 2000)
// requestSelfOrganizations(token)
// })
}
// 客户名称 点击
handleCustomerCheck
()
{
let
{
listOptionData
}
=
this
.
state
let
{
token
,
requestOrganizations
}
=
this
.
props
console
.
warn
(
'客户名称------check'
,
token
,
requestOrganizations
)
let
{
state
,
props
}
=
this
let
self
=
this
if
(
this
.
judgeOrgIsNull
())
{
self
.
setState
({
currentTitle
:
'客户名称'
,
currentItem
:
{
name
:
state
.
listOptionData
[
2
].
name
,
value
:
state
.
listOptionData
[
2
].
value
}
},
()
=>
{
// 在此修改接口
self
.
getCustomerData
()
})
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.warn('客户名称------check', token, requestSelfOrganizations)
// let self = this
this
.
setState
({
currentTitle
:
'客户名称'
,
currentItem
:
{
name
:
listOptionData
[
2
].
name
,
value
:
listOptionData
[
2
].
value
// this.setState({
// currentTitle: '客户名称',
// currentItem: {
// name: listOptionData[2].name,
// value: listOptionData[2].value
// }
// }, () => {
// // 在此修改接口
// requestSelfOrganizations(token)
// })
}
// 获取客户名称
getCustomerData
()
{
let
{
state
,
props
}
=
this
let
params
=
{
access_token
:
props
.
token
,
org_code
:
state
.
listOptionData
[
1
].
value
,
seller_code
:
props
.
userInfo
.
user_name
}
props
.
requestSelfSurgeryHospital
(
params
)
}
// 组织选择后,判断当前客户名称是否只有一个
async
organizationGetCustomerData
()
{
let
{
state
,
props
}
=
this
let
params
=
{
access_token
:
props
.
token
,
org_code
:
state
.
listOptionData
[
1
].
value
,
seller_code
:
props
.
userInfo
.
user_name
}
let
that
=
this
let
{
global_domain_config
}
=
props
let
cusResult
=
await
reqSelfSurgeryHospital
(
global_domain_config
,
params
);
if
(
cusResult
.
error_code
==
0
)
{
let
{
data
:
{
customers
}
}
=
cusResult
props
.
requestListDataSuccess
(
customers
)
let
filterOpt
=
dedupQuoteArray
(
customers
,
'customer_code'
)
if
(
filterOpt
.
length
===
0
)
{
show
(
`当前客户名称为空`
)
return
}
},
()
=>
{
// 在此修改接口
requestOrganizations
(
token
)
})
if
(
filterOpt
.
length
===
1
)
{
let
{
listOptionData
}
=
state
listOptionData
[
2
].
name
=
filterOpt
[
0
].
customer_name
listOptionData
[
2
].
value
=
filterOpt
[
0
].
customer_code
that
.
setState
({
listOptionData
,
localCustomersOption
:
customers
},
()
=>
{
that
.
customerGetBill
()
that
.
customerGetShip
()
})
}
}
else
if
(
cusResult
.
error_code
==
41006
)
{
show
(
'登录过期,请重新登录'
);
props
.
exitLoginStatus
();
}
else
{
let
error_msg
=
cusResult
.
error_msg
||
cusResult
.
message
show
(
error_msg
);
}
}
// 收单地点 点击
handleBillCheck
()
{
let
{
listOptionData
}
=
this
.
state
let
{
token
,
requestOrganizations
}
=
this
.
props
console
.
warn
(
'收单地点------check'
,
token
,
requestOrganizations
)
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
this
.
setState
({
currentTitle
:
'收单地点'
,
currentItem
:
{
name
:
listOptionData
[
3
].
name
,
value
:
listOptionData
[
3
].
value
}
},
()
=>
{
// 在此修改接口
requestOrganizations
(
token
)
})
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
currentTitle
:
'收单地点'
,
currentItem
:
{
name
:
listOptionData
[
3
].
name
,
value
:
listOptionData
[
3
].
value
}
},
()
=>
{
let
tempOption
=
[]
if
(
localCustomersOption
.
length
)
{
localCustomersOption
.
forEach
((
item
)
=>
{
if
(
item
.
customer_code
===
listOptionData
[
2
].
value
)
{
// 保证是当前客户名称下的地点
let
obj
=
{}
obj
.
value
=
item
.
bill_to_site_code
obj
.
name
=
item
.
bill_to_site_name
tempOption
.
push
(
obj
)
}
})
}
tempOption
=
dedupQuoteArray
(
tempOption
,
'name'
)
self
.
setState
({
showTypePop
:
true
,
listCurrentOption
:
[...
tempOption
]
})
})
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.warn('收单地点------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '收单地点',
// currentItem: {
// name: listOptionData[3].name,
// value: listOptionData[3].value
// }
// }, () => {
// // 在此修改接口
// requestSelfOrganizations(token)
// })
}
customerGetBill
()
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
that
=
this
let
tempLocalOption
=
localCustomersOption
.
filter
(
item
=>
item
.
customer_code
===
listOptionData
[
2
].
value
)
tempLocalOption
=
dedupQuoteArray
(
tempLocalOption
,
'bill_to_site_code'
)
if
(
tempLocalOption
.
length
===
0
)
{
show
(
`当前收单地点为空`
)
return
}
if
(
tempLocalOption
.
length
===
1
)
{
listOptionData
[
3
].
name
=
tempLocalOption
[
0
].
bill_to_site_name
listOptionData
[
3
].
value
=
tempLocalOption
[
0
].
bill_to_site_code
that
.
setState
({
listOptionData
})
}
}
// 收货地点 点击
handleShipCheck
()
{
let
{
listOptionData
}
=
this
.
state
let
{
token
,
requestOrganizations
}
=
this
.
props
console
.
warn
(
'收货地点------check'
,
token
,
requestOrganizations
)
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
this
.
setState
({
currentTitle
:
'收货地点'
,
currentItem
:
{
name
:
listOptionData
[
4
].
name
,
value
:
listOptionData
[
4
].
value
}
},
()
=>
{
// 在此修改接口
requestOrganizations
(
token
)
})
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
currentTitle
:
'收货地点'
,
currentItem
:
{
name
:
listOptionData
[
4
].
name
,
value
:
listOptionData
[
4
].
value
}
},
()
=>
{
let
tempOption
=
[]
if
(
localCustomersOption
.
length
)
{
localCustomersOption
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
customer_code
===
listOptionData
[
2
].
value
)
{
// 保证是当前客户名称下的地点
let
obj
=
{}
obj
.
value
=
item
.
ship_to_site_code
obj
.
name
=
item
.
ship_to_site_name
tempOption
.
push
(
obj
)
}
})
}
tempOption
=
dedupQuoteArray
(
tempOption
,
'name'
)
self
.
setState
({
showTypePop
:
true
,
listCurrentOption
:
[...
tempOption
]
})
})
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.warn('收货地点------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '收货地点',
// currentItem: {
// name: listOptionData[4].name,
// value: listOptionData[4].value
// }
// }, () => {
// // 在此修改接口
// requestSelfOrganizations(token)
// })
}
customerGetShip
()
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
that
=
this
let
tempLocalOption
=
localCustomersOption
.
filter
(
item
=>
item
.
customer_code
===
listOptionData
[
2
].
value
)
tempLocalOption
=
dedupQuoteArray
(
tempLocalOption
,
'ship_to_site_code'
)
if
(
tempLocalOption
.
length
===
0
)
{
show
(
`当前收货地点为空`
)
return
}
if
(
tempLocalOption
.
length
===
1
)
{
listOptionData
[
4
].
name
=
tempLocalOption
[
0
].
ship_to_site_name
listOptionData
[
4
].
value
=
tempLocalOption
[
0
].
ship_to_site_code
that
.
setState
({
listOptionData
})
}
}
// 主治医生 点击/输入
handleDoctorCheck
(
text
)
{
let
{
listOptionData
}
=
this
.
state
let
{
token
,
requestOrganizations
}
=
this
.
props
console
.
warn
(
'主治医生------check'
,
token
,
requestOrganizations
)
handleDoctorCheck
()
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
if
(
text
)
{
// 输入
this
.
setState
({
listOptionData
:
listOptionData
.
map
(
item
=>
{
if
(
item
.
title
===
'主治医生'
)
{
item
.
inputValue
=
text
}
return
item
})
})
}
else
{
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
// 点击
this
.
setState
({
self
.
setState
({
currentTitle
:
'主治医生'
,
currentItem
:
{
name
:
listOptionData
[
5
].
name
,
value
:
listOptionData
[
5
].
value
}
},
()
=>
{
// 在此修改接口
requestOrganizations
(
token
)
let
tempOption
=
[]
if
(
localCustomersOption
.
length
)
{
localCustomersOption
.
forEach
((
item
)
=>
{
if
(
item
.
customer_code
===
listOptionData
[
2
].
value
)
{
// 保证是当前客户名称下的医生
let
obj
=
{}
obj
.
value
=
item
.
customer_doctor
obj
.
name
=
item
.
customer_doctor
tempOption
.
push
(
obj
)
}
})
}
let
othObj
=
{
name
:
'其他'
,
value
:
'-1'
}
tempOption
.
push
(
othObj
)
tempOption
=
dedupQuoteArray
(
tempOption
,
'name'
)
self
.
setState
({
showTypePop
:
true
,
listCurrentOption
:
[...
tempOption
]
})
})
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.warn('主治医生------check', token, requestSelfOrganizations)
// let self = this
// if(text) {
// // 输入
// this.setState({
// listOptionData: listOptionData.map(item => {
// if(item.title === '主治医生') {
// item.inputValue = text
// }
// return item
// })
// })
// } else {
// // 点击
// this.setState({
// currentTitle: '主治医生',
// currentItem: {
// name: listOptionData[5].name,
// value: listOptionData[5].value
// }
// }, () => {
// // 在此修改接口
// requestSelfOrganizations(token)
// })
// }
console
.
warn
(
'主治医生------check'
,
listOptionData
[
5
])
// console.warn('主治医生------check',listOptionData[5])
}
// 主治医生 输入
handleDoctorInput
(
text
)
{
let
{
listOptionData
}
=
this
.
state
this
.
setState
({
listOptionData
:
listOptionData
.
map
(
item
=>
{
if
(
item
.
title
===
'主治医生'
)
{
item
.
inputValue
=
text
}
return
item
})
})
}
// 手术名称 输入
...
...
@@ -789,37 +1245,72 @@ class SelfOrderPage extends Component {
// 手术类型 点击
handleSurTypeCheck
()
{
let
{
listOptionData
}
=
this
.
state
let
{
token
,
requestOrganizations
}
=
this
.
props
console
.
warn
(
'手术类型------check'
,
token
,
requestOrganizations
)
let
{
props
}
=
this
let
self
=
this
this
.
setState
({
currentTitle
:
'手术类型'
,
currentItem
:
{
name
:
listOptionData
[
8
].
name
,
value
:
listOptionData
[
8
].
value
}
},
()
=>
{
// 在此修改接口
requestOrganizations
(
token
)
})
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
currentTitle
:
'手术类型'
,
currentItem
:
{
// name: listOptionData[6].name,
// value: listOptionData[6].value
}
},
()
=>
{
let
params
=
{
access_token
:
props
.
token
,
value_set_code
:
'ORTHOPEDICS_PRODUCT_CLASS'
}
props
.
requestSelfSurgeryType
(
params
)
})
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.warn('手术类型------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '手术类型',
// currentItem: {
// name: listOptionData[8].name,
// value: listOptionData[8].value
// }
// }, () => {
// // 在此修改接口
// requestSelfOrganizations(token)
// })
}
// 订单类型 点击
handleOrderCheck
()
{
let
{
listOptionData
}
=
this
.
state
let
{
token
,
requestOrganizations
}
=
this
.
props
console
.
warn
(
'订单类型------check'
,
token
,
requestOrganizations
)
let
self
=
this
this
.
setState
({
currentTitle
:
'订单类型'
,
currentItem
:
{
name
:
listOptionData
[
9
].
name
,
value
:
listOptionData
[
9
].
value
}
},
()
=>
{
// 在此修改接口
requestOrganizations
(
token
)
})
let
{
state
,
props
}
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
this
.
setState
({
currentTitle
:
'订单类型'
,
currentItem
:
{
// name: state.listOptionData[9].name,
// value: state.listOptionData[9].value
}
},
()
=>
{
// 在此修改接口
let
params
=
{
access_token
:
props
.
token
,
value_set_code
:
'SUR_ORDER_TYPE'
}
props
.
requestSelfOrderType
(
params
)
})
}
// let { listOptionData } = this.state
// let { token, requestSelfOrganizations } = this.props
// console.warn('订单类型------check', token, requestSelfOrganizations)
// let self = this
// this.setState({
// currentTitle: '订单类型',
// currentItem: {
// name: listOptionData[9].name,
// value: listOptionData[9].value
// }
// }, () => {
// // 在此修改接口
// requestSelfOrganizations(token)
// })
}
// 选择产品 点击跳转
...
...
@@ -861,10 +1352,160 @@ class SelfOrderPage extends Component {
// 生成订单 点击
handleSubmit
()
{
console
.
warn
(
'生成订单'
,
this
.
props
.
navigation
)
let
{
navigation
}
=
this
.
props
let
{
state
:
{
params
:
{
title
}
}
}
=
navigation
navigation
.
navigate
(
'SubSuccessPage'
,
{
title
:
`
${
title
}
- 下单成功`
})
// this.changeCanSub(true)
// let { state, props } = this
// let that = this
// // 可提交 并且 不处于正在提交中
// if(state.canSubFlag && !state.isSubLoding) {
// // 先提交录音,再提交接口
// if(state.stop) {
// let params = {
// access_token: props.token,
// path: state.audioPath
// }
// let {global_domain_config} = props
// let audioResult = await requestSelfAudio(global_domain_config, params);
// that.changeSubLoding(true, '上传中')
// if(audioResult.error_code == 0) {
// // 提交订单
// that.setState({
// listOptionData: state.listOptionData.map((item, index) => {
// if(index == 11) {
// item.value = audioResult.data.url
// }
// return item
// })
// }, () => {
// that.changeSubLoding(false)
// that.submitSelfOrder()
// })
// } else if(audioResult.error_code == 41006) {
// that.changeSubLoding(false)
// show('登录过期,请重新登录');
// props.exitLoginStatus();
// } else {
// // that.changeSubLoding(false)
// let error_msg = audioResult.error_msg || audioResult.message
// show(error_msg);
// that.submitSelfOrder()
// }
// } else {
// that.submitSelfOrder()
// }
// }
// // let { navigation } = this.props
// // let { state: { params: { title } } } = navigation
// // navigation.navigate('SubSuccessPage', { title: `${title} - 下单成功` })
}
// 提交订单
submitSelfOrder
()
{
// let { state, props } = this
// let tempSubOption = state.submitOption
// tempSubOption.seller_code = state.listOptionData[0].value
// tempSubOption.org_code = state.listOptionData[1].value
// tempSubOption.customer_code = state.listOptionData[2].value
// tempSubOption.bill_to_site_code = state.listOptionData[3].value
// tempSubOption.ship_to_site_code = state.listOptionData[4].value
// if(state.listOptionData[5].name === '其他') {
// tempSubOption.doctor_name = state.listOptionData[5].inputValue
// } else {
// tempSubOption.doctor_name = state.listOptionData[5].value
// }
// tempSubOption.template_collect_number = state.listOptionData[7].value
// tempSubOption.surgery_date = state.listOptionData[8].value
// tempSubOption.order_type_code = state.listOptionData[9].value
// tempSubOption.surgery_desc = state.listOptionData[10].value
// tempSubOption.voice_url = state.listOptionData[11].value
// let params = {
// access_token: props.token,
// data: { ...tempSubOption }
// }
// props.requestSelfSumbit(params)
}
// 判断组织是否为空
judgeOrgIsNull
()
{
let
{
listOptionData
}
=
this
.
state
let
orgVal
=
listOptionData
[
1
].
value
if
(
!
orgVal
)
{
show
(
'请先选择组织'
)
return
false
}
else
{
return
true
}
}
// 判断客户名称是否为空
judgeCustomerIsNull
()
{
let
{
listOptionData
}
=
this
.
state
let
orgVal
=
listOptionData
[
2
].
value
if
(
!
orgVal
)
{
show
(
'请先选择客户名称'
)
return
false
}
else
{
return
true
}
}
// 处理提交后返回的数据
processReturnData
()
{
let
{
selfOrderOption
}
=
this
.
props
let
that
=
this
if
(
selfOrderOption
.
create_success
)
{
if
(
selfOrderOption
.
create_success
==
'N'
)
{
// // 打开库存不足弹窗
// this.setState({
// not_enough_items_list: selfOrderOption.not_enough_items_list
// },() => {
// // 解决 IOS 弹窗显示问题
// setTimeout(() => {
// that.setState({
// showNotEnogPop: true
// })
// }, 500)
// })
}
else
if
(
selfOrderOption
.
create_success
==
'Y'
)
{
// // 打开下单成功页面
// this.clearAllData()
// let { state: { params: { title } } } = this.props.navigation
// this.props.navigation.navigate('SubSuccPage', {
// title: `${title} - 下单成功`,
// orderNumber: selfOrderOption.survey_collect_number
// })
}
}
}
// 清空数据
clearAllData
()
{
let
{
props
}
=
this
let
{
listOptionData
,
subInitListOption
}
=
this
.
state
props
.
setSelfInitData
()
// 清空缓存数据
listOptionData
=
cloneObject
(
subInitListOption
)
// 清空本地数据
this
.
setState
({
listOptionData
,
currentTime
:
0
,
// 清除语音
stop
:
false
})
}
// // 库存不足弹窗回调 -- 确定
// handleNotEnoughCallBack() {
// let { submitOption } = this.state
// let self = this
// this.setState({
// submitOption: {
// ...submitOption,
// force_balance_check_flag: 'N'
// }
// }, () => {
// self.handleSubmit()
// })
// }
// // 库存不足弹窗关闭
// handleNotEnoughCloseModal(show) {
// this.setState({
// showNotEnogPop: show
// })
// }
// 返回备注以上的元素
renderListItem
()
{
...
...
@@ -895,7 +1536,7 @@ class SelfOrderPage extends Component {
<
CellTextStyle
>
<
AsteriskTextStyle
>*<
/AsteriskTextStyle
>
<
TitleTextStyle
>
{
'销售员'
}
<
/TitleTextStyle
>
<
ContInputTextStyle
editable
=
{
false
}
defaultValue
=
{
listOptionData
[
0
].
valu
e
}
><
/ContInputTextStyle
>
<
ContInputTextStyle
editable
=
{
false
}
defaultValue
=
{
listOptionData
[
0
].
nam
e
}
><
/ContInputTextStyle
>
<
/CellTextStyle
>
<
/TouchableOpacity
>
<
/View
>
...
...
@@ -907,7 +1548,7 @@ class SelfOrderPage extends Component {
<
CellTextStyle
>
<
AsteriskTextStyle
>*<
/AsteriskTextStyle
>
<
TitleTextStyle
>
{
'组织'
}
<
/TitleTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
1
].
name
}
--
{
listOptionData
[
1
].
value
}
<
/ContTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
1
].
name
}
<
/ContTextStyle
>
{
this
.
renderRightArrowItem
()
}
<
/CellTextStyle
>
<
/TouchableOpacity
>
...
...
@@ -920,7 +1561,7 @@ class SelfOrderPage extends Component {
<
CellTextStyle
>
<
AsteriskTextStyle
>*<
/AsteriskTextStyle
>
<
TitleTextStyle
>
{
'客户名称'
}
<
/TitleTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
2
].
name
}
--
{
listOptionData
[
2
].
value
}
<
/ContTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
2
].
name
}
<
/ContTextStyle
>
{
this
.
renderRightArrowItem
()
}
<
/CellTextStyle
>
<
/TouchableOpacity
>
...
...
@@ -933,7 +1574,7 @@ class SelfOrderPage extends Component {
<
CellTextStyle
>
<
AsteriskTextStyle
>*<
/AsteriskTextStyle
>
<
TitleTextStyle
>
{
'收单地点'
}
<
/TitleTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
3
].
name
}
--
{
listOptionData
[
3
].
value
}
<
/ContTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
3
].
name
}
<
/ContTextStyle
>
{
this
.
renderRightArrowItem
()
}
<
/CellTextStyle
>
<
/TouchableOpacity
>
...
...
@@ -946,7 +1587,7 @@ class SelfOrderPage extends Component {
<
CellTextStyle
>
<
AsteriskTextStyle
>*<
/AsteriskTextStyle
>
<
TitleTextStyle
>
{
'收货地点'
}
<
/TitleTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
4
].
name
}
--
{
listOptionData
[
4
].
value
}
<
/ContTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
4
].
name
}
<
/ContTextStyle
>
{
this
.
renderRightArrowItem
()
}
<
/CellTextStyle
>
<
/TouchableOpacity
>
...
...
@@ -959,7 +1600,7 @@ class SelfOrderPage extends Component {
<
CellTextStyle
>
<
AsteriskTextStyle
>*<
/AsteriskTextStyle
>
<
TitleTextStyle
>
{
'主治医生'
}
<
/TitleTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
5
].
name
}
--
{
listOptionData
[
5
].
value
}
<
/ContTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
5
].
name
}
<
/ContTextStyle
>
{
this
.
renderRightArrowItem
()
}
<
/CellTextStyle
>
<
/TouchableOpacity
>
...
...
@@ -997,7 +1638,7 @@ class SelfOrderPage extends Component {
>
<
CellTextStyle
>
<
TitleTextStyle
>
{
'手术时间'
}
<
/TitleTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
7
].
name
}
--
{
listOptionData
[
7
].
value
}
<
/ContTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
7
].
name
}
<
/ContTextStyle
>
{
this
.
renderRightArrowItem
()
}
<
/CellTextStyle
>
<
/TouchableOpacity
>
...
...
@@ -1018,7 +1659,7 @@ class SelfOrderPage extends Component {
<
CellTextStyle
>
<
AsteriskTextStyle
>*<
/AsteriskTextStyle
>
<
TitleTextStyle
>
{
'手术类型'
}
<
/TitleTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
8
].
name
}
--
{
listOptionData
[
8
].
value
}
<
/ContTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
8
].
name
}
<
/ContTextStyle
>
{
this
.
renderRightArrowItem
()
}
<
/CellTextStyle
>
<
/TouchableOpacity
>
...
...
@@ -1031,7 +1672,7 @@ class SelfOrderPage extends Component {
<
CellTextStyle
>
<
AsteriskTextStyle
>*<
/AsteriskTextStyle
>
<
TitleTextStyle
>
{
'订单类型'
}
<
/TitleTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
9
].
name
}
--
{
listOptionData
[
9
].
value
}
<
/ContTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
9
].
name
}
<
/ContTextStyle
>
{
this
.
renderRightArrowItem
()
}
<
/CellTextStyle
>
<
/TouchableOpacity
>
...
...
@@ -1044,7 +1685,7 @@ class SelfOrderPage extends Component {
<
CellTextStyle
>
<
AsteriskTextStyle
>*<
/AsteriskTextStyle
>
<
TitleTextStyle
>
{
'选择产品'
}
<
/TitleTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
10
].
name
}
--
{
listOptionData
[
10
].
value
}
<
/ContTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
10
].
name
}
<
/ContTextStyle
>
{
this
.
renderRightArrowItem
()
}
<
/CellTextStyle
>
<
/TouchableOpacity
>
...
...
@@ -1052,11 +1693,6 @@ class SelfOrderPage extends Component {
{
this
.
renderPickerModel
()
}
{
/* {
tagData.map((item, index) => {
return <ItemCellModel item={item} navigation={navigation}></ItemCellModel>
})
} */
}
<
/View
>
)
}
...
...
@@ -1072,13 +1708,7 @@ class SelfOrderPage extends Component {
// 返回选择器弹窗
renderPickerModel
()
{
let
{
listCurrentOption
,
currentItem
,
currentTitle
,
showTypePop
,
}
=
this
.
state
// console.warn('弹窗-----,', listCurrentOption)
let
{
listCurrentOption
,
currentItem
,
currentTitle
,
showTypePop
}
=
this
.
state
return
(
<
SafeAreaView
style
=
{
styles
.
item_container
}
>
...
...
@@ -1091,12 +1721,12 @@ class SelfOrderPage extends Component {
// })
// }}
// itemIndex={this.state.type}
entityList
=
{
listCurrentOption
}
callback
=
{(
item
,
itemTitle
)
=>
this
.
handleCallBack
(
item
,
itemTitle
)}
show
=
{
showTypePop
}
itemValue
=
{
currentItem
.
value
}
itemTitle
=
{
currentTitle
}
closeModal
=
{(
show
)
=>
this
.
handleCloseModal
(
show
)}
entityList
=
{
listCurrentOption
}
callback
=
{(
item
,
itemTitle
)
=>
this
.
handleCallBack
(
item
,
itemTitle
)}
show
=
{
showTypePop
}
itemValue
=
{
currentItem
.
value
}
itemTitle
=
{
currentTitle
}
closeModal
=
{(
show
)
=>
this
.
handleCloseModal
(
show
)}
/
>
<
/SafeAreaView
>
)
...
...
@@ -1260,136 +1890,6 @@ const styles = StyleSheet.create({
self_main
:
{
padding
:
14
},
// remark_item: {
// minHeight: 80,
// height: 'auto'
// },
// rema_box: {
// paddingVertical: 16
// },
// rema_tit: {
// fontSize: second_text_size,
// color: first_text_color,
// fontFamily: font_family_regular
// // fontWeight: 'bold'
// },
// rema_Input_outer: {
// height: 120,
// alignItems: 'center',
// // paddingHorizontal: 15,
// paddingBottom: 0
// },
// rema_Input_inner: {
// paddingTop: 10,
// height: 105,
// width: Width() - 38,
// // borderWidth: 1,
// // borderColor: '#eeeeee'
// },
// rema_Input: {
// paddingVertical: 0,
// maxHeight: 105,
// fontSize: second_text_size,
// textAlign:'left',
// textAlignVertical:'top',
// alignSelf:'flex-start',
// justifyContent:'flex-start',
// alignItems:'flex-start',
// fontFamily: font_family_regular
// },
// reco_item: {
// height: 160,
// // height: 340,
// marginBottom: 42
// },
// reco_btn_cont: {
// paddingVertical: 20
// },
// reco_btn_tit: {
// fontSize: second_text_size,
// color: first_text_color,
// fontFamily: font_family_regular
// },
// reco_btn_inner: {
// flex: 1,
// width: Width() - 38,
// // justifyContent: 'flex-end',
// alignItems: 'center',
// paddingTop: 30
// },
// reco_btn_box: {
// backgroundColor: '#EEECEC',
// borderRadius: 30,
// display: 'flex',
// alignItems: 'center',
// justifyContent: 'center',
// flexDirection: 'row',
// height: 50,
// width: pxSize(152)
// },
// reco_img_box: {
// width: pxSize(20),
// height: pxSize(22)
// },
// // reco_img: {
// // width: '100%',
// // height: '100%'
// // },
// reco_text: {
// fontSize: 14,
// marginVertical: 10
// },
// reco_btn_text: {
// fontSize: second_text_size,
// color: first_text_color,
// marginLeft: 6,
// fontFamily: font_family_regular
// },
// reco_play_box: {
// flex: 1,
// width: Width() - 68,
// // justifyContent: 'flex-end',
// // alignItems: 'center'
// },
// play_tit:{
// flexDirection: 'row',
// justifyContent: 'space-around',
// alignItems: 'center',
// height: 60
// },
// play_text: {
// fontSize: second_text_size,
// color: first_text_color,
// fontFamily: font_family_regular
// },
// play_btn:{
// flexDirection: 'row',
// justifyContent: 'space-around',
// alignItems: 'center',
// // height: 80
// },
// reco_list_box:{
// backgroundColor: '#EEECEC',
// borderRadius: 30,
// display: 'flex',
// alignItems: 'center',
// justifyContent: 'center',
// flexDirection: 'row',
// height: 34,
// width: pxSize(100)
// },
// reco_text: {
// fontSize: second_text_size,
// color: first_text_color,
// fontFamily: font_family_regular
// },
// sub_btn_box: {
// backgroundColor: dis_sub_color,
// height: 52,
// display: 'flex',
// alignItems: 'center',
// justifyContent: 'center'
// },
sub_btn_pro
:
{
backgroundColor
:
promary_color
},
...
...
@@ -1412,15 +1912,42 @@ const mapStateToProps = (state) => {
return
{
userInfo
:
state
.
login
.
userInfo
,
token
:
state
.
login
.
token
,
loginState
:
state
.
login
.
loginState
,
self_list_status
:
state
.
selfOrder
.
self_list_status
,
selfOrderOption
:
state
.
selfOrder
.
selfOrderOption
submit_self_order_status
:
state
.
selfOrder
.
submit_self_order_status
,
selfOrderOption
:
state
.
selfOrder
.
selfOrderOption
,
global_domain_config
:
state
.
login
.
global_domain_config
}
}
const
mapDispatchToProps
=
(
dispatch
)
=>
{
return
{
requestOrganizations
:
(
token
)
=>
{
dispatch
(
requestOrganizations
(
token
))
requestSelfOrganizations
:
(
params
)
=>
{
dispatch
(
requestSelfOrganizations
(
params
))
},
requestSelfSurgeryHospital
:
(
params
)
=>
{
dispatch
(
requestSelfSurgeryHospital
(
params
))
},
requestSelfOrderType
:
(
params
)
=>
{
dispatch
(
requestSelfOrderType
(
params
))
},
requestSelfTemplateCollect
:
(
params
)
=>
{
dispatch
(
requestSelfTemplateCollect
(
params
))
},
requestSelfSumbit
:
(
params
)
=>
{
dispatch
(
requestSelfSumbit
(
params
))
},
exitLoginStatus
:
()
=>
{
dispatch
(
exitLoginStatus
())
},
setSelfInitData
:
()
=>
{
dispatch
(
setSelfInitData
())
},
requestListDataSuccess
:
(
data
)
=>
{
dispatch
(
requestListDataSuccess
(
data
))
},
requestSelfSurgeryType
:
(
params
)
=>
{
dispatch
(
requestSelfSurgeryType
(
params
))
}
}
}
...
...
app/containers/selfOrder/module/ChooseProductPage.js
View file @
ea37a4c6
...
...
@@ -62,16 +62,12 @@ class ChooseProductPage extends Component {
leftOptionList
:
[],
// 左侧分类数据
defaultThridShow
:
false
,
// 默认人体髋关节-小类不显示
selectShowPopup
:
false
,
// 共计已选弹窗
// SELECTED_QUQNTITY: 'selectedQuantity', // 中类数量
// SELECTED_DATA_ARR: 'selectedDataArr', // 中类已选元素
// DEFAULT_SECOND_DATA: 'localSecondData', // 中类原本元素
// allCountQuantity: 0
}
}
componentDidMount
()
{
// console.log('本地测试数据====localMockData===', localMockData)
// 赋值测试数据
// 赋值
本地
测试数据
this
.
setState
({
topProcOptionList
:
cloneObject
(
localMockData
.
localTopProcOption
),
leftOptionList
:
cloneObject
(
localMockData
.
localLeftOption
)
...
...
@@ -93,7 +89,6 @@ class ChooseProductPage extends Component {
this
.
setState
({
leftActiveIndex
:
index
,
// rightSecondData: leftOptionList[index][DEFAULT_SECOND_DATA] // 本地数据
// rightSecondData: leftOptionList[index].localSecondData // 本地数据
})
}
...
...
@@ -124,23 +119,9 @@ class ChooseProductPage extends Component {
leItem
[
SELECTED_DATA_ARR
]
=
[]
}
if
(
leIndex
===
leftActiveIndex
)
{
// console.log('外面 childData----', childData)
if
(
leItem
[
DEFAULT_SECOND_DATA
].
length
&&
leItem
[
DEFAULT_SECOND_DATA
][
superIndex
]
&&
childData
.
length
){
// leItem[DEFAULT_SECOND_DATA][superIndex]
// let superTip = ''
let
sumCount
=
0
// console.log('childData----', childData)
childData
.
map
((
chDa
,
chInd
)
=>
{
// let splitStr = ' / '
// if(chInd === childData.length - 1){
// splitStr = ''
// }
// superTip += `${chDa.title}x${chDa.selectedQuantity}${splitStr}`
if
(
!
chDa
[
DEFAULT_FIELD
]){
chDa
[
DEFAULT_FIELD
]
=
0
}
...
...
@@ -159,7 +140,6 @@ class ChooseProductPage extends Component {
lineOptions
:
childData
,
[
DEFAULT_FIELD
]:
sumCount
}
// 初始化
leItem
[
DEFAULT_SECOND_DATA
][
superIndex
][
CHILD_DATA_NAME
]
=
[]
leItem
[
DEFAULT_SECOND_DATA
][
superIndex
][
CHILD_DATA_NAME
].
push
(
curObj
)
...
...
@@ -167,12 +147,9 @@ class ChooseProductPage extends Component {
}
// 初始化
leItem
[
SELECTED_QUQNTITY
]
=
0
leItem
[
SELECTED_DATA_ARR
]
=
[]
if
(
leItem
[
DEFAULT_SECOND_DATA
].
length
){
// 本地测试 localSecondData DEFAULT_SECOND_DATA
leItem
[
DEFAULT_SECOND_DATA
].
forEach
(
function
(
chItem
)
{
if
(
chItem
[
DEFAULT_FIELD
]
>
0
){
...
...
@@ -181,19 +158,6 @@ class ChooseProductPage extends Component {
}
})
}
// // 当前选择项
// leItem[SELECTED_QUQNTITY] = count
// if(leItem[DEFAULT_SECOND_DATA].length){ // 本地测试 localSecondData DEFAULT_SECOND_DATA
// leItem[DEFAULT_SECOND_DATA].forEach(function(chItem) {
// if(chItem[coutFieName]){
// leItem[SELECTED_DATA_ARR].push(chItem)
// }
// })
// }
}
})
// console.log('计算三级之后数据---', leftOptionList)
...
...
@@ -204,9 +168,8 @@ class ChooseProductPage extends Component {
// 计算中级数量回调
handleChangeCount
(
count
,
coutFieName
)
{
let
{
leftActiveIndex
,
leftOptionList
,
defaultThridShow
,
rightSecondData
}
=
this
.
state
console
.
log
(
'计算中级数量回调==='
,
count
,
leftActiveIndex
,
defaultThridShow
,
rightSecondData
,
coutFieName
)
let
{
leftActiveIndex
,
leftOptionList
,
defaultThridShow
}
=
this
.
state
// console.log('计算中级数量回调===', count, leftActiveIndex, defaultThridShow, coutFieName)
leftOptionList
[
leftActiveIndex
][
SELECTED_QUQNTITY
]
=
0
leftOptionList
[
leftActiveIndex
][
SELECTED_DATA_ARR
]
=
[]
...
...
@@ -347,7 +310,7 @@ class ChooseProductPage extends Component {
// 返回右侧二级元素
renderContItem
()
{
let
{
leftOptionList
,
leftActiveIndex
,
defaultThridShow
,
rightSecondData
}
=
this
.
state
let
{
leftOptionList
,
leftActiveIndex
,
defaultThridShow
}
=
this
.
state
let
curRigSecoOption
=
[]
if
(
leftOptionList
[
leftActiveIndex
]){
...
...
@@ -364,7 +327,6 @@ class ChooseProductPage extends Component {
superIndex
=
{
leftActiveIndex
}
defaultThridShow
=
{
defaultThridShow
}
changeThrShow
=
{(
defaultThridShow
)
=>
this
.
handleChangeThrShow
(
defaultThridShow
)}
// superStencilData={rightSecondData}
superStencilData
=
{
curRigSecoOption
}
superCallBack
=
{(
count
,
coutFieName
)
=>
this
.
handleChangeCount
(
count
,
coutFieName
)}
superReduceBack
=
{()
=>
this
.
handleSubSelected
()}
...
...
@@ -378,11 +340,8 @@ class ChooseProductPage extends Component {
// 返回底部按钮
renderFooterBtnItem
()
{
let
{
selectShowPopup
,
leftOptionList
}
=
this
.
state
let
allCountQuantity
=
this
.
getAllCountQuantity
()
console
.
log
(
'左侧数据----'
,
leftOptionList
)
// console.log('左侧数据----', leftOptionList)
return
(
<
View
style
=
{
list_common_item
.
sub_box
}
>
<
View
style
=
{
list_common_item
.
sub_two_btn
}
>
...
...
@@ -416,7 +375,6 @@ class ChooseProductPage extends Component {
render
()
{
let
{
navigation
}
=
this
.
props
let
{
title
}
=
navigation
.
state
.
params
// console.warn('zzxd----', navigation)
return
(
<
View
style
=
{
styles
.
choo_container
}
>
<
StatusBarView
...
...
@@ -429,9 +387,7 @@ class ChooseProductPage extends Component {
<
View
style
=
{
styles
.
choo_main
}
>
{
/* {this.renderSearchItem()} */
}
{
this
.
renderTopProItem
()}
{
this
.
renderContItem
()}
<
/View
>
{
this
.
renderFooterBtnItem
()}
<
/SafeAreaView
>
...
...
@@ -458,13 +414,13 @@ const styles = StyleSheet.create({
borderBottomWidth
:
1
},
top_scroll_cont
:
{},
top_touch_cont
:
{},
//
top_touch_cont: {},
top_inner
:
{
borderBottomColor
:
foundation_color
,
minWidth
:
60
},
top_inner_act
:
{},
top_img_box
:
{},
//
top_img_box: {},
top_tit
:
{},
top_tit_act
:
{},
cont_bom_box
:
{
...
...
app/containers/selfOrder/module/EditThirdLevelPage.js
View file @
ea37a4c6
...
...
@@ -56,7 +56,6 @@ class EditThirdLevelPage extends Component {
let
that
=
this
// console.log('本地测试数据====localMockData===', localMockData)
// console.log('父组件传递的值==', params)
// 赋值测试数据
this
.
setState
({
topProcOptionList
:
cloneObject
(
localMockData
.
localThridOption
)
...
...
@@ -118,11 +117,8 @@ class EditThirdLevelPage extends Component {
handleSubmit
()
{
let
{
topProcOptionList
}
=
this
.
state
let
{
params
}
=
this
.
props
.
navigation
.
state
// console.log('编辑完成====>', topProcOptionList, params.superData)
// console.log(topProcOptionList[0][DEFAULT_SECOND_DATA][0])
params
.
childrenPageCallBack
(
topProcOptionList
,
params
.
superData
.
superIndex
)
this
.
props
.
navigation
.
goBack
()
}
...
...
@@ -154,7 +150,6 @@ class EditThirdLevelPage extends Component {
// 返回底部主要元素
renderContItem
()
{
let
{
topProcOptionList
,
topActiveIndex
}
=
this
.
state
let
curData
=
topProcOptionList
[
topActiveIndex
]
// 本地测试数据
let
localThridContData
=
[]
...
...
@@ -205,7 +200,8 @@ class EditThirdLevelPage extends Component {
titText
=
{
'title'
}
tipTextStr
=
{
'tip1'
}
tipTextOne
=
{
'tip2'
}
listImgIcon
=
{
'imgIcon'
}
// listImgIcon={'imgIcon'}
listImgIcon
=
{
'imgIconArr'
}
listPicType
=
{
'ROUND'
}
listStyleBox
=
{
styles
.
list_style_box
}
/>
...
...
app/containers/selfOrder/module/ProductRightStyle.js
View file @
ea37a4c6
...
...
@@ -50,8 +50,6 @@ class ProductRightStyle extends Component {
this
.
state
=
{
rightSecondData
:
this
.
props
.
superStencilData
,
// 右侧分类数据-模块、螺钉盒、器械包、赋值工具
selectItem
:
[],
// 当前选中模板 -- 之前版本
toolShowPopup
:
false
,
// 螺钉盒等三个弹窗显示 -- 之前版本
// singleHeadData: [], // 人工髋关节假体等数据 -- 大类
rowSingleData
:
[],
// 人工髋关节假体等数据 -- 小类
thridIsVisible
:
false
,
// 小类展示
curThridObj
:
{
...
...
@@ -62,12 +60,11 @@ class ProductRightStyle extends Component {
}
componentDidMount
(){
console
.
log
(
'本地测试数据====localMockData==='
,
localMockData
)
// 赋值测试数据
this
.
setState
({
// singleHeadData: cloneObject(localMockData.localSingleSeleHead),
// rowSingleData: cloneObject(localMockData.localSingleRowData)
})
// console.log('本地测试数据====localMockData===', localMockData)
// // 赋值测试数据
// this.setState({
// // rowSingleData: cloneObject(localMockData.localSingleRowData)
// })
}
componentWillReceiveProps
(
nextProps
)
{
...
...
@@ -79,41 +76,10 @@ class ProductRightStyle extends Component {
}
}
// 点击模板选中 -- 之前版本
handleItemStencil
(
item
,
index
)
{
// console.warn('xuanze', index, item)
// let { rightSecondData, selectItem } = this.state
// let { select, id } = item
// console.warn(selectItem)
// console.warn(selectItem, rightSecondData[id])
// if (select) {
// // 前一次是true,当前变成未选中
// selectItem.splice(selectItem.findIndex(function (x) {
// return x === id;
// }), 1);
// } else {
// selectItem.push(id);
// // 跳转到新页面
// // console.warn('-----navigation', this.props.navigation.navigate)
// // this.props.navigation.navigate('EditThirdLevelPage')
// }
// console.warn(select, rightSecondData[id].select)
// rightSecondData[id].select = !select;
// this.setState({ rightSecondData })
// this.handleRIghtStencil()
}
// handleRIghtStencil() {
// console.warn(`选中了${JSON.stringify(this.state.selectItem)}`)
// }
// 大类右侧标题点击事件
TitleClickEvent
(
item
,
index
)
{
let
{
superIndex
}
=
this
.
props
let
{
rightSecondData
}
=
this
.
state
// console.log('右侧标题点击事件 ', superIndex, index, item, rightSecondData[index])
// console.log('右侧标题点击事件 ', superIndex, index, item)
if
(
superIndex
>=
0
&&
superIndex
<
4
)
{
this
.
props
.
navigation
.
navigate
(
'EditThirdLevelPage'
,
{
title
:
'选择产品 - 编辑模板'
,
...
...
@@ -121,138 +87,75 @@ class ProductRightStyle extends Component {
superItem
:
item
,
superIndex
:
index
},
childrenPageCallBack
:
this
.
childrenPageCallBack
.
bind
(
this
)
// 传递函数,编辑完成时调用
childrenPageCallBack
:
this
.
childrenPageCallBack
.
bind
(
this
)
// 传递函数,编辑完成时调用
})
}
else
{
// 单选耗材中级标题点击之后
// 单选耗材 中级标题点击之后
this
.
changeThrShow
(
true
,
item
,
index
)
}
// else if ( superIndex > 0 && superIndex < 4) {
// this.handleIsShowDialog() // -- 之前版本
// }
}
}
// 大类加减,
整理加一/减一
// 大类加减,
小类所有加1/减1
handleAllPlusReduce
(
curData
,
curIndex
,
isPlus
){
let
{
rightSecondData
}
=
this
.
state
let
{
superLeftData
}
=
this
.
props
// console.log('大类加减,整理加一/减一', curData, curIndex)
// console.log('右侧数据', rightSecondData, curData[CHILD_DATA_NAME])
let
rowData
=
[]
// if(!isPlus){
// 本地测试,获取接口数据(无数据时,加法)
rowData
=
cloneObject
(
localMockData
.
localSingleRowData
)
// 初始化数据
console
.
log
(
'curData[CHILD_DATA_NAME]--本地测试,获取接口数据--'
,
curData
)
if
((
!
curData
[
CHILD_DATA_NAME
]
||
!
curData
[
CHILD_DATA_NAME
].
length
)
&&
isPlus
){
// let chDa = leItem[DEFAULT_SECOND_DATA][superIndex]
let
curObj
=
{
superId
:
curData
[
'id'
],
// 本地测试
superIndex
:
curIndex
,
// 本地测试
superTit
:
superLeftData
[
'title'
],
// 本地测试
superImg
:
curData
[
'imgIcon'
],
// 本地测试
superTip
:
curData
[
'title'
]
,
// 本地测试
curTitle
:
curData
[
'title'
],
// 本地测试
version
:
0
,
lineOptions
:
rowData
,
[
DEFAULT_FIELD
]:
0
}
// 初始化
curData
[
CHILD_DATA_NAME
]
=
[]
curData
[
CHILD_DATA_NAME
].
push
(
curObj
)
curData
[
DEFAULT_FIELD
]
=
0
let
rowData
=
[]
// 本地测试,需要获取接口数据(无数据时,加法)
rowData
=
cloneObject
(
localMockData
.
localSingleRowData
)
// 初始化数据
// console.log('本地测试,获取接口数据--', curData)
if
((
!
curData
[
CHILD_DATA_NAME
]
||
!
curData
[
CHILD_DATA_NAME
].
length
)
&&
isPlus
){
let
curObj
=
{
superId
:
curData
[
'id'
],
// 本地测试
superIndex
:
curIndex
,
// 本地测试
superTit
:
superLeftData
[
'title'
],
// 本地测试
superImg
:
curData
[
'imgIcon'
],
// 本地测试
superTip
:
curData
[
'title'
]
,
// 本地测试
curTitle
:
curData
[
'title'
],
// 本地测试
version
:
0
,
lineOptions
:
rowData
,
[
DEFAULT_FIELD
]:
0
}
// 初始化
curData
[
CHILD_DATA_NAME
]
=
[]
curData
[
CHILD_DATA_NAME
].
push
(
curObj
)
curData
[
DEFAULT_FIELD
]
=
0
}
// 加法/减法
if
(
curData
[
CHILD_DATA_NAME
]
&&
curData
[
CHILD_DATA_NAME
].
length
>
0
){
// rowData = cloneObject(curData[CHILD_DATA_NAME][0].lineOptions)
// if(curData[CHILD_DATA_NAME][0].lineOptions){
let
sumCount
=
0
curData
[
CHILD_DATA_NAME
][
0
].
lineOptions
.
forEach
(
function
(
lineIt
,
lineInd
)
{
if
(
!
lineIt
[
DEFAULT_FIELD
]){
lineIt
[
DEFAULT_FIELD
]
=
0
}
if
(
!
isPlus
){
// 减法
if
(
lineIt
[
DEFAULT_FIELD
]){
lineIt
[
DEFAULT_FIELD
]
-=
1
}
else
{
lineIt
[
DEFAULT_FIELD
]
=
0
}
}
else
{
// 加法
lineIt
[
DEFAULT_FIELD
]
+=
1
}
sumCount
+=
lineIt
[
DEFAULT_FIELD
]
})
if
(
sumCount
){
curData
[
CHILD_DATA_NAME
][
0
][
DEFAULT_FIELD
]
=
sumCount
curData
[
DEFAULT_FIELD
]
=
sumCount
curData
[
CHILD_DATA_NAME
][
0
].
superTip
=
`
${
curData
[
'title'
]}
x
${
sumCount
}
`
// 加法/减法
if
(
curData
[
CHILD_DATA_NAME
]
&&
curData
[
CHILD_DATA_NAME
].
length
>
0
){
let
sumCount
=
0
curData
[
CHILD_DATA_NAME
][
0
].
lineOptions
.
forEach
(
function
(
lineIt
)
{
if
(
!
lineIt
[
DEFAULT_FIELD
]){
lineIt
[
DEFAULT_FIELD
]
=
0
}
if
(
!
isPlus
){
// 减法
if
(
lineIt
[
DEFAULT_FIELD
]){
lineIt
[
DEFAULT_FIELD
]
-=
1
}
else
{
curData
[
DEFAULT_FIELD
]
=
0
delete
curData
[
CHILD_DATA_NAME
]
lineIt
[
DEFAULT_FIELD
]
=
0
}
// rowData = cloneObject(curData[CHILD_DATA_NAME][0].lineOptions)
// }
}
else
{
// 加法
lineIt
[
DEFAULT_FIELD
]
+=
1
}
sumCount
+=
lineIt
[
DEFAULT_FIELD
]
})
if
(
sumCount
){
curData
[
CHILD_DATA_NAME
][
0
][
DEFAULT_FIELD
]
=
sumCount
curData
[
DEFAULT_FIELD
]
=
sumCount
curData
[
CHILD_DATA_NAME
][
0
].
superTip
=
`
${
curData
[
'title'
]}
x
${
sumCount
}
`
}
else
{
curData
[
DEFAULT_FIELD
]
=
0
delete
curData
[
CHILD_DATA_NAME
]
}
// }
// else {
// // 加法
// // 本地测试,获取接口数据
// rowData = cloneObject(localMockData.localSingleRowData)
// if(curData[CHILD_DATA_NAME] && curData[CHILD_DATA_NAME].length > 0 && curData[CHILD_DATA_NAME][0].lineOptions) {
// curData[CHILD_DATA_NAME][0].lineOptions.forEach(function(lineIt) {
// if(!lineIt[DEFAULT_FIELD]){
// lineIt[DEFAULT_FIELD] = 0
// }
// lineIt[DEFAULT_FIELD] += 1
// })
// rowData = cloneObject(curData[CHILD_DATA_NAME][0].lineOptions)
// }
// // if(!curData[CHILD_DATA_NAME]){
// // // 加法需要调用接口
// // // let childData = leItem[DEFAULT_SECOND_DATA][superIndex]
// // // let curObj = {
// // // superId: childData['id'], // 本地测试
// // // superIndex: superIndex, // 本地测试
// // // superTit: leItem['title'], // 本地测试
// // // superImg: childData['imgIcon'], // 本地测试
// // // superTip: childData['title'] , // 本地测试
// // // version: 0,
// // // lineOptions: childData,
// // // [DEFAULT_FIELD]: sumCount
// // // }
// // // curData[CHILD_DATA_NAME]
// // }
// }
}
// console.log('修改后的数据', curData, rowData, curIndex)
// this.props.thirdCallBack(rowData, curIndex)
this
.
handleCalCallBack
(
curData
,
curIndex
,
'rightSecondData'
,
DEFAULT_FIELD
)
this
.
setState
({
rightSecondData
...
...
@@ -260,28 +163,18 @@ class ProductRightStyle extends Component {
}
// 编辑页面的回调
childrenPageCallBack
(
childData
,
index
)
{
let
{
rightSecondData
}
=
this
.
state
console
.
log
(
'编辑页面的回调----'
,
childData
,
index
)
// 本地测试
// let curCalField = 'quantity'
// console.log('编辑页面的回调----', childData, index)
let
that
=
this
rightSecondData
.
forEach
(
function
(
rsdItem
,
rsdIndex
)
{
if
(
!
rsdItem
[
CHILD_DATA_NAME
])
{
rsdItem
[
CHILD_DATA_NAME
]
=
[]
// rsdItem[CHILD_DATA_NAME] = {}
}
if
(
!
rsdItem
[
DEFAULT_FIELD
])
{
rsdItem
[
DEFAULT_FIELD
]
=
0
}
// if(!rsdItem[versionName]) {
// rsdItem[versionName] = 0
// }
if
(
rsdIndex
===
index
)
{
let
superTip
=
''
childData
.
map
((
chDa
,
chInd
)
=>
{
...
...
@@ -301,71 +194,39 @@ class ProductRightStyle extends Component {
lineOptions
:
childData
,
[
DEFAULT_FIELD
]:
1
}
if
(
rsdItem
[
CHILD_DATA_NAME
].
length
!==
0
){
curObj
.
version
=
rsdItem
[
CHILD_DATA_NAME
].
length
}
let
filEquArr
=
rsdItem
[
CHILD_DATA_NAME
].
filter
(
function
(
lineItem
)
{
if
(
_
.
isEqual
(
lineItem
.
lineOptions
,
childData
)){
lineItem
[
DEFAULT_FIELD
]
+=
1
return
lineItem
}
})
// 本地测试
if
(
filEquArr
.
length
===
0
)
{
rsdItem
[
CHILD_DATA_NAME
].
push
(
curObj
)
}
rsdItem
[
DEFAULT_FIELD
]
=
Number
(
rsdItem
[
DEFAULT_FIELD
])
+
1
// console.log('回调后的rsdItem====', rsdItem)
that
.
handleCalCallBack
(
rsdItem
,
rsdIndex
,
'rightSecondData'
,
DEFAULT_FIELD
)
}
})
// console.log('回调后的数组====', rightSecondData)
this
.
setState
({
rightSecondData
})
}
// // 关闭当前弹窗
// handleCloseModal(show) {
// this.setState({
// toolShowPopup: show
// })
// }
// // 螺钉盒、器械包、辅助工具 弹窗显示
// handleIsShowDialog() {
// this.setState({
// toolShowPopup: !this.state.toolShowPopup
// })
// }
// 修改当前小类是否展示
changeThrShow
(
show
,
superItem
,
superIndex
)
{
let
{
curThridObj
,
rowSingleData
}
=
this
.
state
console
.
log
(
'修改当前小类是否展示----'
,
show
,
superItem
,
superIndex
)
// console.log('修改当前小类是否展示----', show, superItem, superIndex)
let
localTestImageUrls
=
localMockData
.
localTestImageUrls
// 本地测试数据
let
curRowData
=
cloneObject
(
localMockData
.
localSingleRowData
)
// 本地测试数据 此处应该要请求接口,获取小类数据
let
curRowData
=
cloneObject
(
localMockData
.
localSingleRowData
)
// if(superItem){
// }else {
// curRowData = cloneObject(localMockData.localSingleRowData)
// }
if
(
superItem
)
{
// curThridObj.title = curItem.title
curThridObj
=
{
superItem
:
superItem
,
superIndex
:
superIndex
,
...
...
@@ -375,71 +236,30 @@ class ProductRightStyle extends Component {
if
(
superItem
[
CHILD_DATA_NAME
]
&&
superItem
[
CHILD_DATA_NAME
].
length
>
0
&&
superItem
[
CHILD_DATA_NAME
][
0
].
lineOptions
)
{
curRowData
=
cloneObject
(
superItem
[
CHILD_DATA_NAME
][
0
].
lineOptions
)
}
// curThridObj = [{
// ...curItem,
// localThridOption:
// }]
// 此处应该要请求接口,获取小类数据
}
this
.
setState
({
thridIsVisible
:
show
,
curThridObj
,
rowSingleData
:
curRowData
})
if
(
!
show
){
// 点击标题时回调函数修改左侧数据
this
.
props
.
thirdCallBack
(
rowSingleData
,
curThridObj
.
superIndex
)
}
// this.props.changeThrShow(show) ============????
}
// 单选耗材 - 头数据
handleHeadCalCallBack
(
item
,
index
)
{
// let { singleHeadData } = this.state
// singleHeadData[index] = item
// this.setState({
// singleHeadData
// })
// console.log('计算==单选耗材行数据===', item, index, rowSingleData)
}
// 单选耗材 - 行数据
handleRowCalCallBack
(
item
,
index
)
{
// let { rowSingleData } = this.state
// rowSingleData[index] = item
// this.setState({
// rowSingleData
// })
// console.log('计算==单选耗材行数据===', item, index, rowSingleData)
}
// 修改列表计算后数据 - 头/行
handleCalCallBack
(
item
,
index
,
dataName
,
coutFieName
){
let
{
rightSecondData
,
rowSingleData
,
curThridObj
}
=
this
.
state
// rowSingleData.localThridContData = item
// if(!dataName){
// }
// console.log('修改列表计算后数据==',item, index, dataName, coutFieName)
if
(
dataName
&&
this
.
state
[
dataName
])
{
let
curDataName
=
this
.
state
[
dataName
]
curDataName
[
index
]
=
item
this
.
setState
({
[
dataName
]:
curDataName
})
// console.log('计算==头/行===', index, dataName, curDataName)
if
(
coutFieName
)
{
// console.log('修改列表计算参数==',item, index, dataName, coutFieName)
// 除了单选耗材小类的回调
// console.log('除了单选耗材的回调==',item, index, dataName, coutFieName)
// 计算==头
let
sumCount
=
0
curDataName
.
map
(
item
=>
{
...
...
@@ -449,101 +269,12 @@ class ProductRightStyle extends Component {
})
// console.log('计算==数量汇总=字段=', sumCount, coutFieName)
this
.
props
.
superCallBack
(
sumCount
,
coutFieName
)
}
else
{
// console.log('修改【单选耗材小类】参数==',item, index, dataName, coutFieName)
// console.log('修改【单选耗材小类】计算后数据==',curDataName)
// console.log('修改【单选耗材小类】计算后父数据==',curThridObj)
// console.log('修改【单选耗材小类】计算后=显示=',this.state.thridIsVisible)
// this.props.thirdCallBack(curDataName, curThridObj.superIndex)
// 计算耗材行, 行数据加起来是头数据
// rightSecondData
// let sumCount = 0
// console.log('中类---', rightSecondData)
// console.log('小类---', curDataName)
// let listItem = rightSecondData[curThridObj.superIndex]
// listItem[CHILD_DATA_NAME]
// listItem[SELECTED_QUQNTITY] = 0
// listItem[SELECTED_DATA_ARR] = []
// listItem[DEFAULT_SECOND_DATA] = curDataName
// listItem[DEFAULT_SECOND_DATA].forEach(function(chItem) {
// if(chItem[DEFAULT_FIELD]){
// listItem[SELECTED_QUQNTITY] += Number(chItem[DEFAULT_FIELD])
// listItem[SELECTED_DATA_ARR].push(chItem)
// }
// })
// let seNum = 0, seArr = []
// curDataName.map(cuDa => {
// if(!cuDa[DEFAULT_FIELD]){
// cuDa[DEFAULT_FIELD] = 0
// }
// seNum += Number(cuDa[DEFAULT_FIELD])
// seArr.push(cuDa)
// })
// let curTempArr = [
// {
// title: '单选耗材',
// iconImg: localMockData.localTestImageUrls,
// localThridContData: curDataName, // push所有
// [SELECTED_QUQNTITY]: seNum,
// [SELECTED_DATA_ARR]: seArr
// }
// ]
// console.log('修改后的中类----', rightSecondData)
// console.log('修改后的小类 curDataName----', curDataName)
// this.childrenPageCallBack(curTempArr, curThridObj.superIndex)
// this.props.superCallBack(listItem[SELECTED_QUQNTITY], DEFAULT_FIELD)
// this.setState({
// rightSecondData
// })
// rightSecondData.map(function(listItem) {
// listItem[SELECTED_QUQNTITY] = 0
// listItem[SELECTED_DATA_ARR] = []
// if(listItem[DEFAULT_SECOND_DATA].length){
// listItem[DEFAULT_SECOND_DATA].forEach(function(chItem) {
// if(chItem[DEFAULT_FIELD]){
// listItem[SELECTED_QUQNTITY] += Number(chItem[DEFAULT_FIELD])
// listItem[SELECTED_DATA_ARR].push(chItem)
// }
// })
// }
// })
// rightSecondData.map(item => {
// if(!item[DEFAULT_FIELD]){
// item[DEFAULT_FIELD] = 0
// }
// // curDataName
// if(item[DEFAULT_FIELD]){
// sumCount += Number(item[DEFAULT_FIELD])
// }
// })
// console.log('计算==数量汇总=字段=', coutFieName, sumCount)
// this.props.superCallBack(sumCount, DEFAULT_FIELD)
}
}
}
// 返回右侧二级每一列(单选耗材以上)
renderSecondtem
(
item
,
index
)
{
// let { toolShowPopup } = this.state
// let curCalField = 'quantity'
return
(
<
SafeAreaView
style
=
{
styles
.
ri_container
}
>
<
PicTitDetaiCalcu
...
...
@@ -555,7 +286,8 @@ class ProductRightStyle extends Component {
titText
=
{
'title'
}
tipTextOne
=
{
'tip1'
}
tipTextTwo
=
{
'tip2'
}
listImgIcon
=
{
'imgIcon'
}
// listImgIcon={'imgIcon'}
listImgIcon
=
{
'imgIconArr'
}
listPicType
=
{
'SQUARE'
}
plusCallBack
=
{(
item
,
index
)
=>
this
.
TitleClickEvent
(
item
,
index
)}
reduceCallBack
=
{()
=>
this
.
props
.
superReduceBack
()}
...
...
@@ -581,7 +313,6 @@ class ProductRightStyle extends Component {
// 单选耗材 -- 小类每一列
renderThridItem
(
item
,
index
)
{
// let curCalField = 'quantity'
return
(
<
SafeAreaView
style
=
{
styles
.
thr_container
}
>
<
PicTitDetaiCalcu
...
...
@@ -615,7 +346,6 @@ class ProductRightStyle extends Component {
// 单选耗材 -- 大类每一列
renderOtherListItem
(
item
,
index
)
{
// let curCalField = 'quantity'
return
(
<
SafeAreaView
style
=
{
styles
.
oth_container
}
>
<
PicTitDetaiCalcu
...
...
@@ -623,11 +353,13 @@ class ProductRightStyle extends Component {
listIndex
=
{
index
}
calField
=
{
DEFAULT_FIELD
}
listPicType
=
{
'ROUND'
}
// subCalCallBack={(item,index) => this.handleCalCallBack(item, index, 'singleHeadData', DEFAULT_FIELD)}
subCalCallBack
=
{(
item
,
index
)
=>
this
.
handleCalCallBack
(
item
,
index
,
'rightSecondData'
,
DEFAULT_FIELD
)}
titCallBack
=
{(
item
,
index
)
=>
this
.
TitleClickEvent
(
item
,
index
)}
titText
=
{
'title'
}
listImgIcon
=
{
'imgIcon'
}
// listImgIcon={'imgIcon'}
listImgIcon
=
{
'imgIconArr'
}
tipTextOne
=
{
'tip1'
}
tipTextTwo
=
{
'tip2'
}
plusCallBack
=
{(
item
,
index
)
=>
this
.
handleAllPlusReduce
(
item
,
index
,
true
)}
reduceCallBack
=
{(
item
,
index
)
=>
this
.
handleAllPlusReduce
(
item
,
index
)}
/
>
...
...
@@ -642,7 +374,6 @@ class ProductRightStyle extends Component {
<
FlatList
style
=
{
styles
.
cont_other_list
}
keyExtractor
=
{
item
=>
item
.
id
}
// data={this.state.singleHeadData}
data
=
{
this
.
state
.
rightSecondData
}
extraData
=
{
this
.
state
}
renderItem
=
{({
item
,
index
})
=>
this
.
renderOtherListItem
(
item
,
index
)}
...
...
@@ -669,13 +400,6 @@ class ProductRightStyle extends Component {
// 返回右侧单选耗材 -- 三级顶部标题和图片
renderThrHeadStyle
()
{
let
{
thridIsVisible
,
curThridObj
}
=
this
.
state
// let localTestImageUrls = localMockData.localTestImageUrls // 本地测试数据
// // let testObj = {
// // title: '测试标题__',
// // image: localTestImageUrls
// // }
// curThridObj.image = localTestImageUrls
if
(
thridIsVisible
)
{
return
(
<
View
>
...
...
@@ -686,7 +410,7 @@ class ProductRightStyle extends Component {
>
<
View
style
=
{
styles
.
thr_head_back
}
>
<
View
style
=
{
styles
.
thr_icon_box
}
>
<
Image
source
=
{
require
(
'../../../images/arr_left.png'
)}
style
=
{
styles
.
thr_icon
}
><
/Image
>
<
Image
source
=
{
require
(
'../../../images/arr_left.png'
)}
style
=
{
icon_style
}
><
/Image
>
<
/View
>
<
Text
style
=
{
styles
.
thr_head_tit
}
>
{
curThridObj
.
title
}
<
/Text
>
<
/View
>
...
...
@@ -730,99 +454,92 @@ const styles = StyleSheet.create({
cont_right_scroll_cont
:
{},
cont_right_list
:
{},
ri_container
:
{},
ri_tou_box
:
{},
ri_inner
:
{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,
paddingVertical
:
14
},
ri_text_box
:
{},
ri_te_tit
:
{
fontSize
:
18
,
color
:
first_text_color
,
// fontWeight: 'bold',
fontFamily
:
font_family_medium
},
ri_te_ot
:
{
fontSize
:
14
,
color
:
third_text_color
,
fontFamily
:
font_family_light
},
ri_img_box
:
{
width
:
18
,
height
:
18
},
//
ri_tou_box: {},
//
ri_inner: {
//
flexDirection: 'row',
//
justifyContent: 'space-between',
//
alignItems: 'center',
//
paddingVertical: 14
//
},
//
ri_text_box: {},
//
ri_te_tit: {
//
fontSize: 18,
//
color: first_text_color,
//
// fontWeight: 'bold',
//
fontFamily: font_family_medium
//
},
//
ri_te_ot: {
//
fontSize: 14,
//
color: third_text_color,
//
fontFamily: font_family_light
//
},
//
ri_img_box: {
//
width: 18,
//
height: 18
//
},
// ri_img_check: {
// width: '100%',
// height: '100%'
// },
model_cont
:
{},
model_cont_inner
:
{
marginBottom
:
48
},
mo_cont_title
:
{
color
:
first_text_color
,
// fontWeight: 'bold',
fontSize
:
14
,
lineHeight
:
24
,
fontFamily
:
font_family_medium
},
mo_cont_tip
:
{
color
:
second_text_color
,
fontSize
:
14
,
lineHeight
:
24
,
fontFamily
:
font_family_regular
},
mo_img_box
:
{
flex
:
1
,
borderWidth
:
1
,
borderColor
:
'#E1E1E1'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
height
:
pxSize
(
120
)
},
mo_img
:
{
width
:
pxSize
(
100
),
height
:
'100%'
},
//
model_cont_inner: {
//
marginBottom: 48
//
},
//
mo_cont_title: {
//
color: first_text_color,
//
// fontWeight: 'bold',
//
fontSize: 14,
//
lineHeight: 24,
//
fontFamily: font_family_medium
//
},
//
mo_cont_tip: {
//
color: second_text_color,
//
fontSize: 14,
//
lineHeight: 24,
//
fontFamily: font_family_regular
//
},
//
mo_img_box: {
//
flex: 1,
//
borderWidth: 1,
//
borderColor: '#E1E1E1',
//
justifyContent: 'center',
//
alignItems: 'center',
//
height: pxSize(120)
//
},
//
mo_img: {
//
width: pxSize(100),
//
height: '100%'
//
},
// other right
cont_other_cont
:
{},
cont_other_list
:
{
// paddingTop: 14
},
oth_container
:
{
// flex: 1,
// marginBottom: 14
// paddingTop: 0,
// marginTop: 0
},
oth_inner
:
{},
oth_box
:
{},
oth_box_item
:
{
flexDirection
:
'row'
,
justifyContent
:
'flex-start'
,
alignItems
:
'center'
},
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%'
},
oth_tit
:
{
textAlign
:
'left'
,
paddingLeft
:
10
,
fontSize
:
second_text_size
,
fontFamily
:
font_family_regular
},
cont_other_list
:
{},
oth_container
:
{},
// oth_inner: {},
// oth_box: {},
// oth_box_item: {
// flexDirection: 'row',
// justifyContent: 'flex-start',
// alignItems: 'center'
// },
// 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%'
// },
// oth_tit: {
// textAlign: 'left',
// paddingLeft: 10,
// fontSize: second_text_size,
// fontFamily: font_family_regular
// },
stencil_cont
:
{},
thr_head_inner
:
{},
thr_head_back
:
{
...
...
@@ -834,10 +551,10 @@ const styles = StyleSheet.create({
width
:
pxSize
(
14
),
height
:
pxSize
(
18
)
},
thr_icon
:
{
width
:
'100%'
,
height
:
'100%'
},
//
thr_icon: {
//
width: '100%',
//
height: '100%'
//
},
thr_head_tit
:
{
color
:
third_text_color
,
paddingLeft
:
6
,
...
...
@@ -850,53 +567,7 @@ const styles = StyleSheet.create({
marginBottom
:
10
},
cont_thr_list
:
{},
thr_container
:
{},
// thr_inner: {
// paddingVertical: 0,
// paddingBottom: 26
// },
// thr_ot: {
// fontFamily: font_family_regular,
// fontSize: second_text_size,
// color: first_text_color
// },
// ri_num_box: {
// flexDirection: 'row',
// alignItems: 'center'
// },
// thr_num_btn: {
// width: pxSize(24),
// height: pxSize(24),
// // justifyContent: 'center',
// // alignItems: 'center',
// // borderRadius: 50,
// // borderWidth: 1
// },
// thr_btn_left: {
// // borderColor: '#E6E6E6'
// marginRight: 4
// },
// thr_btn_right: {
// // borderColor: foundation_color,
// // backgroundColor: promary_color
// marginLeft: 4
// },
// thr_num_icon: {
// // fontSize: 16
// width: '100%',
// height: '100%'
// },
// thr_icon_left: {
// // color: third_text_color
// },
// thr_icon_right: {
// // color: title_text_color
// },
// btn_inner: {},
// thr_num: {
// minWidth: pxSize(20),
// textAlign: 'center'
// },
thr_container
:
{}
})
export
default
ProductRightStyle
;
\ No newline at end of file
app/containers/selfOrder/module/mock/sen_mock.js
View file @
ea37a4c6
...
...
@@ -40,11 +40,13 @@ const localTopProcOption = [
// 多张图片放大
const
localTestImageUrls
=
[{
url
:
'https://obs.uat.sfrx.guke.tech/
upload/dingding/image/QDw05sTo
.jpg'
url
:
'https://obs.uat.sfrx.guke.tech/
jeecg-boot/sys/common/view/files/20200731/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20200731113857_1596166761793_1596184849964
.jpg'
},{
url
:
'https://obs.uat.sfrx.guke.tech/
upload/dingding/image/QDw05sTo
.jpg'
url
:
'https://obs.uat.sfrx.guke.tech/
jeecg-boot/sys/common/view/files/20200921/5_1599645385381_1600672374371
.jpg'
},{
url
:
'https://obs.uat.sfrx.guke.tech/jeecg-boot/sys/common/view/upload/dingding/image/8V4599aH.jpg'
url
:
'https://obs.uat.sfrx.guke.tech/jeecg-boot/sys/common/view/files/20200921/4_1599645381425_1600672375091.jpg'
},{
url
:
'https://obs.uat.sfrx.guke.tech/jeecg-boot/sys/common/view/files/20200921/3_1599645381259_1600672375488.jpg'
}]
// 手术模板 -- 大类
...
...
@@ -52,6 +54,7 @@ const localSingleSeleHead_1 = [{
"id"
:
"0"
,
title
:
'手术模板'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -61,6 +64,7 @@ const localSingleSeleHead_1 = [{
"id"
:
"1"
,
title
:
'内衬Harmony 28/10°OD(P 2'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -70,6 +74,7 @@ const localSingleSeleHead_1 = [{
"id"
:
"2"
,
title
:
'内衬Harmony 28/10°OD(P'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -81,6 +86,7 @@ const localSingleSeleHead_2 = [{
"id"
:
"0"
,
title
:
'钉盒'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -90,6 +96,7 @@ const localSingleSeleHead_2 = [{
"id"
:
"1"
,
title
:
'内衬Harmony 28/10°OD(P 2'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -99,6 +106,7 @@ const localSingleSeleHead_2 = [{
"id"
:
"2"
,
title
:
'内衬Harmony 28/10°OD(P'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -111,6 +119,7 @@ const localSingleSeleHead_3 = [{
"id"
:
"0"
,
title
:
'器械包'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -120,6 +129,7 @@ const localSingleSeleHead_3 = [{
"id"
:
"1"
,
title
:
'内衬Harmony 28/10°OD(P 2'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -129,6 +139,7 @@ const localSingleSeleHead_3 = [{
"id"
:
"2"
,
title
:
'内衬Harmony 28/10°OD(P'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -140,6 +151,7 @@ const localSingleSeleHead_4 = [{
"id"
:
"0"
,
title
:
'零散器械'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -149,6 +161,7 @@ const localSingleSeleHead_4 = [{
"id"
:
"1"
,
title
:
'内衬Harmony 28/10°OD(P 2'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -158,6 +171,7 @@ const localSingleSeleHead_4 = [{
"id"
:
"2"
,
title
:
'内衬Harmony 28/10°OD(P'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -169,6 +183,7 @@ const localSingleSeleHead_5 = [{
"id"
:
"0"
,
title
:
'中置器(PE)'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -178,6 +193,7 @@ const localSingleSeleHead_5 = [{
"id"
:
"1"
,
title
:
'内衬Harmony---'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -187,6 +203,7 @@ const localSingleSeleHead_5 = [{
"id"
:
"2"
,
title
:
'内衬Harmony 28/10°OD'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -196,6 +213,7 @@ const localSingleSeleHead_5 = [{
"id"
:
"3"
,
title
:
'中置器(PE)4'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -205,6 +223,7 @@ const localSingleSeleHead_5 = [{
"id"
:
"4"
,
title
:
'中置器(PE)5'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -214,6 +233,7 @@ const localSingleSeleHead_5 = [{
"id"
:
"5"
,
title
:
'中置器(PE)6'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -223,6 +243,7 @@ const localSingleSeleHead_5 = [{
"id"
:
"6"
,
title
:
'中置器(PE)7'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -232,6 +253,7 @@ const localSingleSeleHead_5 = [{
"id"
:
"7"
,
title
:
'中置器(PE)8'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -241,8 +263,9 @@ const localSingleSeleHead_5 = [{
const
localSingleSeleHead_6
=
[{
"id"
:
"0"
,
title
:
'
6
-中置器(PE)11'
,
title
:
'
膝
-中置器(PE)11'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -250,8 +273,9 @@ const localSingleSeleHead_6= [{
},
{
"id"
:
"1"
,
title
:
'
6
-中置器(PE)22'
,
title
:
'
膝
-中置器(PE)22'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -259,8 +283,9 @@ const localSingleSeleHead_6= [{
},
{
"id"
:
"2"
,
title
:
'
6
-中置器(PE)33'
,
title
:
'
膝
-中置器(PE)33'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -270,8 +295,9 @@ const localSingleSeleHead_6= [{
const
localSingleSeleHead_7
=
[{
"id"
:
"0"
,
title
:
'
h7-中置器(PE)11
11'
,
title
:
'
骨-中置器(PE)
11'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -279,8 +305,9 @@ const localSingleSeleHead_7 = [{
},
{
"id"
:
"1"
,
title
:
'
h7-中置器(PE)22
22'
,
title
:
'
骨-中置器(PE)
22'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -288,8 +315,9 @@ const localSingleSeleHead_7 = [{
},
{
"id"
:
"2"
,
title
:
'
h7-中置器(PE)33
33'
,
title
:
'
骨-中置器(PE)
33'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -299,8 +327,9 @@ const localSingleSeleHead_7 = [{
const
localSingleSeleHead_8
=
[{
"id"
:
"0"
,
title
:
'
h8
-中置器(PE)11'
,
title
:
'
骨
-中置器(PE)11'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -310,8 +339,9 @@ const localSingleSeleHead_8 = [{
const
localSingleSeleHead_9
=
[{
"id"
:
"0"
,
title
:
'
h9
-中置器(PE)'
,
title
:
'
骨
-中置器(PE)'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -322,8 +352,9 @@ const localSingleSeleHead_9 = [{
const
localSingleSeleHead_10
=
[{
"id"
:
"0"
,
title
:
'
h10
-中置器(PE)11'
,
title
:
'
骨
-中置器(PE)11'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -334,8 +365,9 @@ const localSingleSeleHead_10 = [{
const
localSingleSeleHead_11
=
[{
"id"
:
"0"
,
title
:
'
h11
-中置器'
,
title
:
'
关
-中置器'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
tip1
:
'创建人:金城武'
,
tip2
:
'创建时间:2020.03.01'
,
select
:
false
,
...
...
@@ -450,6 +482,7 @@ const localThridContData_1 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
2
},
{
...
...
@@ -458,6 +491,7 @@ const localThridContData_1 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
1
},
{
...
...
@@ -466,6 +500,7 @@ const localThridContData_1 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
1
},
{
...
...
@@ -474,6 +509,7 @@ const localThridContData_1 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
0
},
{
...
...
@@ -482,6 +518,7 @@ const localThridContData_1 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
0
},
{
...
...
@@ -490,6 +527,7 @@ const localThridContData_1 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
0
},
{
...
...
@@ -498,6 +536,7 @@ const localThridContData_1 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
0
},
{
...
...
@@ -506,6 +545,7 @@ const localThridContData_1 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
0
},
{
...
...
@@ -514,6 +554,7 @@ const localThridContData_1 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
0
}
]
...
...
@@ -526,6 +567,7 @@ const localThridContData_2 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
1
},
{
...
...
@@ -534,6 +576,7 @@ const localThridContData_2 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
0
},
{
...
...
@@ -542,6 +585,7 @@ const localThridContData_2 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
0
}
]
...
...
@@ -554,6 +598,7 @@ const localThridContData_3 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
0
},
{
...
...
@@ -562,6 +607,7 @@ const localThridContData_3 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
2
},
{
...
...
@@ -570,6 +616,7 @@ const localThridContData_3 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
0
}
]
...
...
@@ -582,6 +629,7 @@ const localThridContData_4 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
0
},
{
...
...
@@ -590,6 +638,7 @@ const localThridContData_4 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
3
},
{
...
...
@@ -598,6 +647,7 @@ const localThridContData_4 = [
tip1
:
'型号:10'
,
tip2
:
'物料代码:JUST00000104'
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
quantity
:
0
}
]
...
...
@@ -639,6 +689,7 @@ const localBottomOption = [
tip2
:
'物料代码:JUST00000104'
,
value
:
0
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
select
:
false
,
quantity
:
1
}
...
...
@@ -655,6 +706,7 @@ const localBottomOption = [
tip2
:
'物料代码:JUST00000104'
,
value
:
0
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
select
:
false
,
quantity
:
2
}
...
...
@@ -671,6 +723,7 @@ const localBottomOption = [
tip2
:
'物料代码:JUST00000104'
,
value
:
0
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
select
:
false
,
quantity
:
3
}
...
...
@@ -687,6 +740,7 @@ const localBottomOption = [
tip2
:
'物料代码:JUST00000104'
,
value
:
0
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
imgIconArr
:
localTestImageUrls
,
select
:
false
,
quantity
:
4
}
...
...
@@ -703,6 +757,7 @@ const localBottomOption = [
tip2
:
'物料代码:JUST00000104'
,
value
:
0
,
imgIcon
:
require
(
'../../../../images/model_test.png'
),
iconImg
:
localTestImageUrls
,
select
:
false
,
quantity
:
3
}
...
...
app/reducers/module/selfOrder.js
View file @
ea37a4c6
...
...
@@ -48,8 +48,8 @@ export default selfOrder = (state = defaultState, action) => {
case
SELF_INIT_DATA
:
return
Object
.
assign
({},
state
,
{
// 初始化数据
self_list_status
:
QUICK
_ORDER_LIST_NO
,
submit_self_order_status
:
QUICK
_SUBMIT_NO
,
self_list_status
:
SELF
_ORDER_LIST_NO
,
submit_self_order_status
:
SELF
_SUBMIT_NO
,
selfOrderOption
:
{}
})
default
:
...
...
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