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
affd9956
authored
Dec 23, 2020
by
Denglingling
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
完善自助下单提交接口需要的数据
parent
9ea2b23d
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
466 additions
and
236 deletions
app/action/SelfAction.js
app/containers/common/LocalVariable.js
app/containers/common/listDataComponent/ChooseCardList.js
app/containers/common/listDataComponent/TipInfoNeedSelect.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/inter_mock.js
app/action/SelfAction.js
View file @
affd9956
...
...
@@ -223,35 +223,35 @@ export function requestSelfSumbit({access_token, ...params}) {
// 选择产品-供应商信息查询接口
export
const
reqPurSupplierSearch
=
async
(
global_domain_config
,
params
)
=>
{
//
return local_inter_mock.inter_1
return
local_inter_mock
.
inter_1
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/order/pur_supplier/search'
,
params
))
}
// 选择产品-产品信息分类查询接口
export
const
reqProCategorySearch
=
async
(
global_domain_config
,
params
)
=>
{
//
return local_inter_mock.inter_2
return
local_inter_mock
.
inter_2
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/order/item/search'
,
params
))
}
// 选择产品-手术模板头查询接口
export
const
reqSurTempHeadSearch
=
async
(
global_domain_config
,
params
)
=>
{
//
return local_inter_mock.inter_3
return
local_inter_mock
.
inter_3
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/template_header/search'
,
params
))
}
// 选择产品-手术模板行查询接口
export
const
reqSurTempLineSearch
=
async
(
global_domain_config
,
params
)
=>
{
//
return local_inter_mock.inter_4
return
local_inter_mock
.
inter_4
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/surgery/template_line/search'
,
params
))
}
// 选择产品-螺钉盒(器械包)头查询接口
export
const
reqNailEquipHeadSearch
=
async
(
global_domain_config
,
params
)
=>
{
//
if(params.category_code === '1301'){
//
return local_inter_mock.inter_5
//
}else {
//
return local_inter_mock.inter_55
//
}
if
(
params
.
category_code
===
'1301'
){
return
local_inter_mock
.
inter_5
}
else
{
return
local_inter_mock
.
inter_55
}
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/inventory/item_package_header/search'
,
params
))
}
...
...
@@ -272,7 +272,7 @@ export const reqEquipPackageLineSearch = async (global_domain_config, params) =>
// 选择产品-零散器械查询接口
export
const
reqScatEquipmentSearch
=
async
(
global_domain_config
,
params
)
=>
{
//
return local_inter_mock.inter_8
return
local_inter_mock
.
inter_8
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/order/tool/search'
,
params
))
}
...
...
app/containers/common/LocalVariable.js
0 → 100644
View file @
affd9956
/**
* 自助下单-本地常用变量名
*/
export
default
class
LocalVariable
{
/**
* 计算数量的字段名
*/
static
QUANTITY_FIELD
=
'quantity'
/**
* 显示的子类数组名
*/
static
CHILDREN_LINE_NAME
=
'childrenLineData'
/**
* 外层已选数量字段名
*/
static
SELECTED_QUQNTITY
=
'selectedQuantity'
/**
* 外层已选数组名
*/
static
SELECTED_DATA_ARR
=
'selectedDataArr'
/**
* 中类原本元素
*/
static
LOCAL_SECOND_DATA
=
'localSecondData'
/**
* 只有两级的耗材
*/
static
ONLY_TWO_LEVELS
=
'onlyTwoLevels'
/**
* 三级原本元素
*/
static
LOCAL_THRID_CONT_DATA
=
'localThridContData'
/**
* 最终子类数组名
*/
static
LINE_OPTIONS
=
'lineOptions'
/**
* 已选展示父级标题名
*/
static
SUPER_TITLE_NAME
=
'super_title_name'
/**
* 已选展示父级提示名
*/
static
SUPER_TITLE_TIP
=
'super_title_tip'
/**
* 计划数量名
*/
static
PLAN_QUANTITY
=
'plan_quantity'
/**
* 手术模板名
*/
static
SURGICAL_TEMPLATE
=
'surg_temp'
/**
* 钉盒名
*/
static
NAIL_BOX
=
'screw_box'
/**
* 器械包名
*/
static
EQUIPMENT_BAG
=
'equip_bag'
/**
* 零散器械名
*/
static
SCATTERED_EQUIPMENT
=
'auxili_tool'
/**
* 单选耗材名
*/
static
SIGN_SELECT_CONSUMABLES
=
'sign_consu'
}
\ No newline at end of file
app/containers/common/listDataComponent/ChooseCardList.js
View file @
affd9956
...
...
@@ -40,6 +40,7 @@ class ChooseCardList extends Component {
cardCouStyle
:
PropTypes
.
object
,
// 指定计数样式
cardShowDefIcon
:
PropTypes
.
bool
,
// 是否显示默认无图
cardKeyName
:
PropTypes
.
string
,
// 关键key值
}
...
...
@@ -54,7 +55,7 @@ class ChooseCardList extends Component {
render
()
{
let
{
cardScrollEnabled
,
cardHorizontal
,
cardShowsHorizontalScrollIndicator
,
cardShowsVerticalScrollIndicator
,
cardStyleBox
,
cardStyleScroll
,
cardListOptions
,
cardItemTitle
,
cardItemIcon
,
cardImgName
,
cardStyleListItem
,
cardStyleListItemAct
,
cardStyleItemIcon
,
cardStyleItemTit
,
cardStyleNotIconTit
,
cardStyleItemTitAct
,
cardCallBack
,
curActIndex
,
cardCountName
,
cardStyleType
,
cardCouStyle
,
global_domain_config
,
cardShowDefIcon
}
=
this
.
props
global_domain_config
,
cardShowDefIcon
,
cardKeyName
}
=
this
.
props
let
{
countStyleType
}
=
this
.
state
...
...
@@ -82,7 +83,7 @@ class ChooseCardList extends Component {
item
[
cardItemIcon
]
=
{
uri
:
global_domain_config
+
'/jeecg-boot/sys/common/view/'
+
item
[
cardItemIcon
][
0
]}
// 正式
}
return
<
View
style
=
{
styles
.
card_list_box
}
>
return
<
View
style
=
{
styles
.
card_list_box
}
key
=
{
'choose_card'
+
index
}
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
style
=
{
styles
.
list_touch_cont
}
...
...
app/containers/common/listDataComponent/TipInfoNeedSelect.js
View file @
affd9956
...
...
@@ -37,7 +37,7 @@ class TipInfoNeedSelect extends Component {
super
(
props
);
this
.
state
=
{
isVisible
:
false
,
title
:
'
愿意自动更换
器械包?'
title
:
'
同意自动更换同品不同
器械包?'
}
}
...
...
@@ -86,14 +86,14 @@ class TipInfoNeedSelect extends Component {
onPress
=
{()
=>
this
.
closeModal
()}
style
=
{[
styles
.
foo_btn
,
styles
.
btn_cel
]}
>
<
Text
style
=
{[
styles
.
btn_tit
,
styles
.
tit_cel
]}
>
取消
<
/Text
>
<
Text
style
=
{[
styles
.
btn_tit
,
styles
.
tit_cel
]}
>
否
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
onPress
=
{()
=>
this
.
submitModal
()}
style
=
{[
styles
.
foo_btn
,
styles
.
btn_sub
]}
>
<
Text
style
=
{
styles
.
btn_tit
}
>
确定
<
/Text
>
<
Text
style
=
{
styles
.
btn_tit
}
>
是
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
...
...
app/containers/selfOrder/SelfOrderPage.js
View file @
affd9956
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
SafeAreaView
,
StyleSheet
,
TouchableOpacity
,
Image
,
ScrollView
,
TextInput
,
Alert
,
Linking
,
NativeModules
,
Platform
,
DeviceEventEmitter
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
home_background_color
,
placehold_text_color
,
promary_color
,
safe_view
,
icon_style
,
list_common_item
}
from
'../../base/BaseStyle'
;
import
{
AsteriskTextStyle
,
...
...
@@ -25,8 +25,11 @@ import { SELF_ORDER_LIST_DOING, SELF_ORDER_LIST_SUCCESS, SELF_ORDER_LIST_FAILURE
import
PageListArrow
from
'../common/listDataComponent/PageListArrow'
;
import
EmitterEvents
from
'../common/EmitterEvents'
;
import
TipInfoNeedSelect
from
'../common/listDataComponent/TipInfoNeedSelect'
;
import
LocalVariable
from
'../common/LocalVariable'
;
const
SELECTED_QUQNTITY
=
'selectedQuantity'
const
SELECTED_DATA_ARR
=
'selectedDataArr'
const
QUANTITY_FIELD
=
'quantity'
// 计算的字段
class
SelfOrderPage
extends
Component
{
constructor
(
props
)
{
...
...
@@ -101,7 +104,11 @@ class SelfOrderPage extends Component {
"id"
:
"10"
,
title
:
'选择产品'
,
name
:
'请选择'
,
value
:
''
value
:
''
,
lines
:
[],
sub_lines
:
[],
replace_item_flag
:
'N'
,
// 器械包
take_cert_flag
:
'N'
// 合格证
},
{
"id"
:
"11"
,
...
...
@@ -159,9 +166,9 @@ class SelfOrderPage extends Component {
stop
:
false
,
//录音是否停止
currentTime
:
0
,
//录音时长
localCustomersOption
:
[],
// 当前医院信息:客户名称、收单地点、收货地点、主治医生
local_tip
:{
will
:
'N'
,
// 器械包
take_cert
:
'N'
// 合格证
local_tip
:
{
replace_item_flag
:
'N'
,
// 器械包
take_cert
_flag
:
'N'
// 合格证
}
}
}
...
...
@@ -184,7 +191,7 @@ class SelfOrderPage extends Component {
this
.
setState
({
subInitListOption
:
cloneObject
(
listOptionData
)
// 存储初始化数据,提交成功后赋此值
})
if
(
state
.
listOptionData
[
0
].
name
!==
props
.
userInfo
.
person_name
)
{
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
({
...
...
@@ -199,15 +206,15 @@ class SelfOrderPage extends Component {
AudioRecorder
.
requestAuthorization
()
.
then
(
isAuthor
=>
{
console
.
log
(
'是否授权: '
+
isAuthor
)
if
(
!
isAuthor
)
{
if
(
!
isAuthor
)
{
// return alert('APP需要使用录音,请打开录音权限允许APP使用')
return
Alert
.
alert
(
'提示信息'
,
'APP需要使用录音,请打开录音权限允许APP使用'
,
[{
text
:
'设置'
,
onPress
:
()
=>
{
if
(
Platform
.
OS
==
'ios'
)
{
if
(
Platform
.
OS
==
'ios'
)
{
Linking
.
openURL
(
'app-settings:'
)
.
catch
(
err
=>
console
.
log
(
'error'
,
err
))
}
else
if
(
Platform
.
OS
==
'android'
)
{
}
else
if
(
Platform
.
OS
==
'android'
)
{
NativeModules
.
OpenSettings
.
openNetworkSettings
(
data
=>
{
console
.
log
(
'call back data'
,
data
)
}).
catch
(
err
=>
console
.
log
(
'android---'
,
err
))
...
...
@@ -217,7 +224,7 @@ class SelfOrderPage extends Component {
text
:
'取消'
,
}])
}
this
.
setState
({
hasPermission
:
isAuthor
})
this
.
setState
({
hasPermission
:
isAuthor
})
this
.
prepareRecordingPath
(
this
.
state
.
audioPath
);
// 录音进展
AudioRecorder
.
onProgress
=
(
data
)
=>
{
...
...
@@ -252,7 +259,7 @@ class SelfOrderPage extends Component {
IncludeBase64
:
true
,
//是否是base64格式
AudioSource
:
0
,
//音频源
}
AudioRecorder
.
prepareRecordingAtPath
(
path
,
option
)
AudioRecorder
.
prepareRecordingAtPath
(
path
,
option
)
}
// 开始录音
...
...
@@ -278,14 +285,14 @@ class SelfOrderPage extends Component {
// console.log(err)
// }
if
(
!
this
.
state
.
hasPermission
)
{
if
(
!
this
.
state
.
hasPermission
)
{
return
Alert
.
alert
(
'提示信息'
,
'APP需要使用录音,请打开录音权限允许APP使用'
,
[{
text
:
'设置'
,
onPress
:
()
=>
{
if
(
Platform
.
OS
==
'ios'
)
{
if
(
Platform
.
OS
==
'ios'
)
{
Linking
.
openURL
(
'app-settings:'
)
.
catch
(
err
=>
console
.
log
(
'error'
,
err
))
}
else
if
(
Platform
.
OS
==
'android'
)
{
}
else
if
(
Platform
.
OS
==
'android'
)
{
NativeModules
.
OpenSettings
.
openNetworkSettings
(
data
=>
{
console
.
log
(
'call back data'
,
data
)
}).
catch
(
err
=>
console
.
log
(
'android---'
,
err
))
...
...
@@ -297,7 +304,7 @@ class SelfOrderPage extends Component {
// return
}
show
(
'录音开始'
)
if
(
this
.
state
.
stop
)
{
if
(
this
.
state
.
stop
)
{
// 初始化录音
this
.
prepareRecordingPath
(
this
.
state
.
audioPath
)
}
...
...
@@ -311,7 +318,7 @@ class SelfOrderPage extends Component {
// 停止录音
_stop
=
async
()
=>
{
console
.
log
(
'----停止录音---'
,
this
.
state
.
hasPermission
)
if
(
!
this
.
state
.
hasPermission
)
{
if
(
!
this
.
state
.
hasPermission
)
{
return
// return alert('没有授权')
}
...
...
@@ -338,14 +345,14 @@ class SelfOrderPage extends Component {
let
self
=
this
show
(
'正在播放'
)
self
.
whoosh
=
new
Sound
(
this
.
state
.
audioPath
,
''
,
(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
show
(
'加载音频失败'
)
return
console
.
log
(
'加载音频失败-->'
,
err
)
return
console
.
log
(
'加载音频失败-->'
,
err
)
}
self
.
whoosh
.
play
(
success
=>
{
if
(
success
)
{
if
(
success
)
{
show
(
'播放完毕'
)
}
else
{
}
else
{
show
(
'播放失败'
)
console
.
log
(
'fail - 播放失败'
)
}
...
...
@@ -381,7 +388,7 @@ class SelfOrderPage extends Component {
_del
=
async
()
=>
{
// 初始化录音
this
.
prepareRecordingPath
(
this
.
state
.
audioPath
)
let
{
listOptionData
}
=
this
.
state
let
{
listOptionData
}
=
this
.
state
listOptionData
[
12
].
value
=
''
this
.
setState
({
currentTime
:
0
,
...
...
@@ -391,9 +398,9 @@ class SelfOrderPage extends Component {
}
componentWillReceiveProps
(
nextProps
)
{
let
{
self_list_status
,
loginState
,
navigation
,
submit_self_order_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
)
{
if
(
self_list_status
!=
nextProps
.
self_list_status
)
{
switch
(
nextProps
.
self_list_status
)
{
case
SELF_ORDER_LIST_DOING
:
this
.
changeSubLoding
(
true
)
...
...
@@ -402,7 +409,7 @@ class SelfOrderPage extends Component {
self
.
setState
({
isSubLoding
:
false
,
lodingTitle
:
'加载中'
},()
=>
{
},
()
=>
{
self
.
changeCurrentOption
()
})
break
;
...
...
@@ -413,8 +420,8 @@ class SelfOrderPage extends Component {
break
;
}
}
if
(
loginState
!=
nextProps
.
loginState
)
{
switch
(
nextProps
.
loginState
)
{
if
(
loginState
!=
nextProps
.
loginState
)
{
switch
(
nextProps
.
loginState
)
{
case
LOGIN_NO
:
navigation
.
navigate
(
'LoginPage'
)
break
;
...
...
@@ -422,7 +429,7 @@ class SelfOrderPage extends Component {
break
;
}
}
if
(
submit_self_order_status
!=
nextProps
.
submit_self_order_status
)
{
if
(
submit_self_order_status
!=
nextProps
.
submit_self_order_status
)
{
switch
(
nextProps
.
submit_self_order_status
)
{
case
SELF_SUBMIT_DOING
:
this
.
changeSubLoding
(
true
,
'提交中'
)
...
...
@@ -431,7 +438,7 @@ class SelfOrderPage extends Component {
self
.
setState
({
isSubLoding
:
false
,
lodingTitle
:
'提交中'
},()
=>
{
},
()
=>
{
self
.
processReturnData
()
})
break
;
...
...
@@ -478,19 +485,19 @@ class SelfOrderPage extends Component {
let
that
=
this
this
.
setState
({
listOptionData
:
listOptionData
.
map
((
item
,
index
)
=>
{
if
(
index
>
curIndex
&&
index
<
12
)
{
if
(
index
>
curIndex
&&
index
<
12
)
{
item
.
name
=
localOtherObj
.
name
item
.
value
=
localOtherObj
.
value
if
(
listOptionData
[
1
].
value
&&
item
.
title
==
'客户名称'
)
{
if
(
listOptionData
[
1
].
value
&&
item
.
title
==
'客户名称'
)
{
that
.
organizationGetCustomerData
()
}
if
(
listOptionData
[
2
].
value
&&
item
.
title
==
'收单地点'
)
{
if
(
listOptionData
[
2
].
value
&&
item
.
title
==
'收单地点'
)
{
that
.
customerGetBill
()
}
if
(
listOptionData
[
2
].
value
&&
item
.
title
==
'收货地点'
)
{
if
(
listOptionData
[
2
].
value
&&
item
.
title
==
'收货地点'
)
{
that
.
customerGetShip
()
}
if
(
item
.
title
==
'主治医生'
)
{
if
(
item
.
title
==
'主治医生'
)
{
item
.
showInput
=
false
,
item
.
inputValue
=
''
}
...
...
@@ -505,21 +512,21 @@ class SelfOrderPage extends Component {
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
//
}
for
(
let
chIndex
in
listOptionData
)
{
if
(
chIndex
>
0
&&
chIndex
<
11
&&
!
listOptionData
[
chIndex
].
value
&&
listOptionData
[
chIndex
].
name
!==
'其他'
)
{
// 不是主治医生
console
.
log
(
'tempTit--'
,
tempTit
)
tempTit
=
listOptionData
[
chIndex
].
title
tempStatus
=
true
break
}
}
this
.
setState
({
canSubFlag
:
!
tempStatus
})
if
(
isSubCheck
&&
tempStatus
)
{
if
(
isSubCheck
&&
tempStatus
)
{
show
(
`
${
tempTit
}
未选择,不能提交`
)
}
}
...
...
@@ -527,20 +534,20 @@ class SelfOrderPage extends Component {
// 选择器弹窗回调函数
handleCallBack
(
item
,
itemTitle
)
{
// console.log('选择器弹窗回调函数-----',itemTitle)
let
{
listOptionData
}
=
this
.
state
let
{
listOptionData
}
=
this
.
state
let
self
=
this
listOptionData
.
map
(
function
(
chItem
,
index
)
{
if
(
chItem
.
title
===
itemTitle
)
{
listOptionData
.
map
(
function
(
chItem
,
index
)
{
if
(
chItem
.
title
===
itemTitle
)
{
chItem
.
name
=
item
.
name
chItem
.
value
=
item
.
value
if
(
itemTitle
===
'组织'
)
{
if
(
itemTitle
===
'组织'
)
{
self
.
clearInitNameAndValue
(
1
)
}
if
(
itemTitle
===
'客户名称'
)
{
if
(
itemTitle
===
'客户名称'
)
{
self
.
clearInitNameAndValue
(
2
)
}
if
(
itemTitle
===
'主治医生'
)
{
if
(
item
.
name
===
'其他'
)
{
if
(
item
.
name
===
'其他'
)
{
chItem
.
showInput
=
true
}
else
{
chItem
.
showInput
=
false
...
...
@@ -548,7 +555,7 @@ class SelfOrderPage extends Component {
}
self
.
clearInitNameAndValue
(
5
)
}
if
(
itemTitle
===
'手术类型'
)
{
if
(
itemTitle
===
'手术类型'
)
{
self
.
clearInitNameAndValue
(
8
)
}
}
...
...
@@ -556,7 +563,7 @@ class SelfOrderPage extends Component {
this
.
setState
({
currentItem
:
item
,
listOptionData
:
listOptionData
},()
=>
{
},
()
=>
{
self
.
changeCanSub
()
})
}
...
...
@@ -574,7 +581,7 @@ class SelfOrderPage extends Component {
let
{
selfOrderOption
}
=
this
.
props
let
tempOption
=
[]
let
that
=
this
if
(
selfOrderOption
.
length
===
0
)
{
if
(
selfOrderOption
.
length
===
0
)
{
show
(
`当前
${
currentTitle
}
为空`
)
return
}
...
...
@@ -587,7 +594,7 @@ class SelfOrderPage extends Component {
// 去重医院数据
let
filterOpt
=
dedupQuoteArray
(
selfOrderOption
,
'customer_code'
)
let
currentArr
=
[]
if
(
filterOpt
.
length
)
{
if
(
filterOpt
.
length
)
{
filterOpt
.
forEach
(
item
=>
{
let
obj
=
{}
obj
.
customer_code
=
item
.
customer_code
...
...
@@ -605,7 +612,7 @@ class SelfOrderPage extends Component {
resultArr
.
push
(
obj
)
})
tempOption
=
[...
resultArr
]
}
else
if
(
currentTitle
===
'订单类型'
)
{
}
else
if
(
currentTitle
===
'订单类型'
)
{
tempOption
=
this
.
changeNameAndValue
(
selfOrderOption
,
'value_name'
,
'value_code'
)
}
this
.
setState
({
...
...
@@ -780,7 +787,7 @@ class SelfOrderPage extends Component {
handleCustomerCheck
(
curData
)
{
// let { state, props } = this
let
self
=
this
if
(
this
.
judgeOrgIsNull
())
{
if
(
this
.
judgeOrgIsNull
())
{
self
.
setState
({
currentTitle
:
curData
.
title
,
currentItem
:
{
...
...
@@ -829,15 +836,15 @@ class SelfOrderPage extends Component {
let
that
=
this
let
{
global_domain_config
}
=
props
let
cusResult
=
await
reqSelfSurgeryHospital
(
global_domain_config
,
params
);
if
(
cusResult
.
error_code
==
0
)
{
if
(
cusResult
.
error_code
==
0
)
{
let
{
data
:
{
customers
}
}
=
cusResult
props
.
requestListDataSuccess
(
customers
)
let
filterOpt
=
dedupQuoteArray
(
customers
,
'customer_code'
)
if
(
filterOpt
.
length
===
0
)
{
if
(
filterOpt
.
length
===
0
)
{
show
(
`当前客户名称为空`
)
return
}
if
(
filterOpt
.
length
===
1
)
{
if
(
filterOpt
.
length
===
1
)
{
let
{
listOptionData
}
=
state
listOptionData
[
2
].
name
=
filterOpt
[
0
].
customer_name
listOptionData
[
2
].
value
=
filterOpt
[
0
].
customer_code
...
...
@@ -849,7 +856,7 @@ class SelfOrderPage extends Component {
that
.
customerGetShip
()
})
}
}
else
if
(
cusResult
.
error_code
==
41006
)
{
}
else
if
(
cusResult
.
error_code
==
41006
)
{
show
(
'登录过期,请重新登录'
);
props
.
exitLoginStatus
();
}
else
{
...
...
@@ -862,7 +869,7 @@ class SelfOrderPage extends Component {
handleBillCheck
(
curData
)
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
currentTitle
:
curData
.
title
,
currentItem
:
{
...
...
@@ -871,9 +878,9 @@ class SelfOrderPage extends Component {
}
},
()
=>
{
let
tempOption
=
[]
if
(
localCustomersOption
.
length
)
{
if
(
localCustomersOption
.
length
)
{
localCustomersOption
.
forEach
((
item
)
=>
{
if
(
item
.
customer_code
===
listOptionData
[
2
].
value
)
{
if
(
item
.
customer_code
===
listOptionData
[
2
].
value
)
{
// 保证是当前客户名称下的地点
let
obj
=
{}
obj
.
value
=
item
.
bill_to_site_code
...
...
@@ -909,11 +916,11 @@ class SelfOrderPage extends Component {
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
)
{
if
(
tempLocalOption
.
length
===
0
)
{
show
(
`当前收单地点为空`
)
return
}
if
(
tempLocalOption
.
length
===
1
)
{
if
(
tempLocalOption
.
length
===
1
)
{
listOptionData
[
3
].
name
=
tempLocalOption
[
0
].
bill_to_site_name
listOptionData
[
3
].
value
=
tempLocalOption
[
0
].
bill_to_site_code
that
.
setState
({
...
...
@@ -926,7 +933,7 @@ class SelfOrderPage extends Component {
handleShipCheck
(
curData
)
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
currentTitle
:
curData
.
title
,
currentItem
:
{
...
...
@@ -935,9 +942,9 @@ class SelfOrderPage extends Component {
}
},
()
=>
{
let
tempOption
=
[]
if
(
localCustomersOption
.
length
)
{
if
(
localCustomersOption
.
length
)
{
localCustomersOption
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
customer_code
===
listOptionData
[
2
].
value
)
{
if
(
item
.
customer_code
===
listOptionData
[
2
].
value
)
{
// 保证是当前客户名称下的地点
let
obj
=
{}
obj
.
value
=
item
.
ship_to_site_code
...
...
@@ -973,11 +980,11 @@ class SelfOrderPage extends Component {
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
)
{
if
(
tempLocalOption
.
length
===
0
)
{
show
(
`当前收货地点为空`
)
return
}
if
(
tempLocalOption
.
length
===
1
)
{
if
(
tempLocalOption
.
length
===
1
)
{
listOptionData
[
4
].
name
=
tempLocalOption
[
0
].
ship_to_site_name
listOptionData
[
4
].
value
=
tempLocalOption
[
0
].
ship_to_site_code
that
.
setState
({
...
...
@@ -990,7 +997,7 @@ class SelfOrderPage extends Component {
handleDoctorCheck
(
curData
)
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
// 点击
self
.
setState
({
currentTitle
:
curData
.
title
,
...
...
@@ -1000,9 +1007,9 @@ class SelfOrderPage extends Component {
}
},
()
=>
{
let
tempOption
=
[]
if
(
localCustomersOption
.
length
)
{
if
(
localCustomersOption
.
length
)
{
localCustomersOption
.
forEach
((
item
)
=>
{
if
(
item
.
customer_code
===
listOptionData
[
2
].
value
)
{
if
(
item
.
customer_code
===
listOptionData
[
2
].
value
)
{
// 保证是当前客户名称下的医生
let
obj
=
{}
obj
.
value
=
item
.
customer_doctor
...
...
@@ -1056,29 +1063,29 @@ class SelfOrderPage extends Component {
// 主治医生 输入
handleDoctorInput
(
text
,
curData
)
{
let
{
listOptionData
}
=
this
.
state
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
item
.
inputValue
=
text
}
})
this
.
setState
({
listOptionData
:
listOptionData
})
console
.
log
(
'手术名称---'
,
text
,
curData
,
listOptionData
[
5
])
console
.
log
(
'手术名称---'
,
text
,
curData
,
listOptionData
[
5
])
}
// 手术名称 输入
handleSurNameInput
(
text
,
curData
)
{
let
{
listOptionData
}
=
this
.
state
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
item
.
value
=
text
}
})
this
.
setState
({
listOptionData
:
listOptionData
})
console
.
log
(
'手术名称---'
,
text
,
curData
,
listOptionData
[
6
])
console
.
log
(
'手术名称---'
,
text
,
curData
,
listOptionData
[
6
])
}
// 手术时间 点击 2020-04-23 17:41
...
...
@@ -1086,9 +1093,9 @@ class SelfOrderPage extends Component {
console
.
log
(
'手术时间 点击 ==='
,
curData
)
let
{
listOptionData
}
=
this
.
state
let
date
=
curData
.
value
if
(
date
)
{
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
if
(
date
)
{
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
item
.
dateValue
=
formatStrForDate
(
date
)
}
})
...
...
@@ -1108,10 +1115,10 @@ class SelfOrderPage extends Component {
// 修改当前日期数据
dateModalCallback
(
date
,
curData
)
{
console
.
log
(
'修改当前日期数据:'
,
date
,
curData
)
console
.
log
(
'修改当前日期数据:'
,
date
,
curData
)
let
{
listOptionData
}
=
this
.
state
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
item
.
name
=
date
item
.
value
=
date
item
.
dateValue
=
formatStrForDate
(
date
)
...
...
@@ -1127,7 +1134,7 @@ class SelfOrderPage extends Component {
handleSurTypeCheck
(
curData
)
{
let
{
props
}
=
this
let
self
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
currentTitle
:
curData
.
title
,
currentItem
:
{
...
...
@@ -1161,7 +1168,7 @@ class SelfOrderPage extends Component {
// 订单类型 点击
handleOrderCheck
(
curData
)
{
let
{
state
,
props
}
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
this
.
setState
({
currentTitle
:
curData
.
title
,
currentItem
:
{
...
...
@@ -1172,7 +1179,7 @@ class SelfOrderPage extends Component {
// 在此修改接口
let
params
=
{
access_token
:
props
.
token
,
value_set_code
:
'SUR_ORDER_TYPE'
value_set_code
:
'SUR_ORDER_TYPE'
}
props
.
requestSelfOrderType
(
params
)
})
...
...
@@ -1195,8 +1202,8 @@ class SelfOrderPage extends Component {
// 选择产品 点击跳转
handleProductCheck
()
{
if
(
this
.
judgeOrgIsNull
())
{
let
{
listOptionData
}
=
this
.
state
if
(
this
.
judgeOrgIsNull
())
{
let
{
listOptionData
}
=
this
.
state
this
.
props
.
navigation
.
navigate
(
'ChooseProductPage'
,
{
title
:
`选择产品`
,
selfData
:
{
...
...
@@ -1208,127 +1215,250 @@ class SelfOrderPage extends Component {
// 选择产品 回调
productCallBack
(
params
)
{
let
{
listOptionData
}
=
this
.
state
let
{
listOptionData
}
=
this
.
state
// console.log('选择产品返回=!!!!=', params)
// console.log('选择产品返回=!!!!=', this)
// console.log('选择产品返回=!!!!=', this.state)
listOptionData
[
10
].
value
=
''
if
(
params
&&
params
.
local_lines
)
{
listOptionData
[
10
].
value
=
'已选'
listOptionData
[
10
].
lines
=
[]
if
(
params
&&
params
.
local_lines
)
{
params
.
local_lines
.
forEach
(
loc_item
=>
{
if
(
loc_item
[
SELECTED_QUQNTITY
]
>
0
)
{
listOptionData
[
10
].
value
+=
`
${
loc_item
.
supplier_short_name
}
x
${
loc_item
[
SELECTED_QUQNTITY
]}
`
if
(
loc_item
[
SELECTED_QUQNTITY
]
>
0
)
{
listOptionData
[
10
].
value
+=
`
【
${
loc_item
.
supplier_short_name
}
】物料
`
}
})
listOptionData
[
10
].
name
=
listOptionData
[
10
].
value
listOptionData
[
10
].
lines
=
cloneObject
(
params
.
local_lines
)
}
// console.log('选择产品返回=!!!=', listOptionData[10])
this
.
setState
({
listOptionData
:
listOptionData
},()
=>
{
this
.
changeCanSub
()
})
}
// 备注 输入
handleRemarkInput
(
text
,
curData
)
{
let
{
listOptionData
}
=
this
.
state
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
listOptionData
.
map
(
function
(
item
)
{
if
(
item
.
title
===
curData
.
title
)
{
item
.
value
=
text
}
})
this
.
setState
({
listOptionData
:
listOptionData
})
console
.
log
(
'备注---'
,
listOptionData
[
11
])
console
.
log
(
'备注---'
,
listOptionData
[
11
])
}
// 生成订单 点击
handleSubmit
()
{
async
handleSubmit
()
{
console
.
log
(
'生成订单'
,
this
.
props
.
navigation
)
let
{
local_tip
,
listOptionData
}
=
this
.
state
this
.
refs
.
PackageModel
.
show
()
//
this.refs.PackageModel.show()
// this.refs.CertModel.show('需要携带
合格
证?')
// this.refs.CertModel.show('需要携带
注册
证?')
// this.getSumLinesOps()
// 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()
// }
// }
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} - 下单成功` })
// 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
// }
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
.
surgery_name
=
state
.
listOptionData
[
6
].
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 }
// }
tempSubOption
.
surgery_date
=
state
.
listOptionData
[
7
].
value
tempSubOption
.
surgery_type_code
=
state
.
listOptionData
[
8
].
value
tempSubOption
.
order_type_code
=
state
.
listOptionData
[
9
].
value
tempSubOption
.
surgery_desc
=
state
.
listOptionData
[
11
].
value
tempSubOption
.
voice_url
=
state
.
listOptionData
[
12
].
value
tempSubOption
.
replace_item_flag
=
state
.
listOptionData
[
10
].
replace_item_flag
tempSubOption
.
take_cert_flag
=
state
.
listOptionData
[
10
].
take_cert_flag
tempSubOption
.
Caller
=
'APP'
tempSubOption
.
lines
=
state
.
listOptionData
[
10
].
sub_lines
let
params
=
{
access_token
:
props
.
token
,
data
:
{
...
tempSubOption
}
}
console
.
log
(
'submitSelfOrder!!!!'
,
params
)
// props.requestSelfSumbit(params)
}
// 获取选择产品提交接口需要的数据
getSumLinesOps
()
{
let
{
local_tip
,
listOptionData
}
=
this
.
state
// 修改提交的行数据
let
local_lines
=
cloneObject
(
listOptionData
[
10
].
lines
)
let
res_lines
=
[]
console
.
log
(
'提交=='
,
local_lines
)
let
showPackageTip
=
false
local_lines
.
forEach
(
sup_item
=>
{
if
(
sup_item
[
SELECTED_QUQNTITY
]
>
0
&&
sup_item
.
leftOptionList
&&
sup_item
.
leftOptionList
.
length
>
0
)
{
sup_item
.
leftOptionList
.
map
(
lef_item
=>
{
let
select_arr
=
lef_item
[
SELECTED_DATA_ARR
]
if
(
lef_item
[
SELECTED_QUQNTITY
]
>
0
&&
select_arr
&&
select_arr
.
length
>
0
)
{
// console.log('lef_item.category_code--', lef_item.category_code)
if
(
lef_item
.
category_code
===
LocalVariable
.
SURGICAL_TEMPLATE
)
{
// 手术模板
select_arr
.
forEach
(
sel_item
=>
{
let
template_number
=
sel_item
.
template_number
// sel_item.childrenLineData[0].lineOptions[0][SELECTED_DATA_ARR]
if
(
sel_item
[
LocalVariable
.
CHILDREN_LINE_NAME
]
&&
sel_item
[
LocalVariable
.
CHILDREN_LINE_NAME
].
length
>
0
)
{
sel_item
[
LocalVariable
.
CHILDREN_LINE_NAME
].
forEach
(
chi_item
=>
{
if
(
chi_item
[
LocalVariable
.
LINE_OPTIONS
]
&&
chi_item
[
LocalVariable
.
LINE_OPTIONS
].
length
>
0
)
{
chi_item
[
LocalVariable
.
LINE_OPTIONS
].
forEach
(
lin_item
=>
{
if
(
lin_item
[
LocalVariable
.
SELECTED_DATA_ARR
]
&&
lin_item
[
LocalVariable
.
SELECTED_DATA_ARR
].
length
>
0
)
{
lin_item
[
LocalVariable
.
SELECTED_DATA_ARR
].
forEach
(
sel_item
=>
{
sel_item
[
'template_number'
]
=
template_number
sel_item
[
LocalVariable
.
PLAN_QUANTITY
]
=
sel_item
[
LocalVariable
.
QUANTITY_FIELD
]
res_lines
.
push
(
sel_item
)
})
}
})
}
})
}
})
}
else
if
(
lef_item
.
category_code
===
LocalVariable
.
NAIL_BOX
||
lef_item
.
category_code
===
LocalVariable
.
EQUIPMENT_BAG
)
{
// 钉盒/器械包
if
(
lef_item
.
category_code
===
LocalVariable
.
EQUIPMENT_BAG
)
{
showPackageTip
=
true
}
select_arr
.
forEach
(
sel_item
=>
{
sel_item
[
'prefer_serial_number'
]
=
sel_item
.
serial_number
sel_item
[
LocalVariable
.
PLAN_QUANTITY
]
=
sel_item
[
LocalVariable
.
QUANTITY_FIELD
]
res_lines
.
push
(
sel_item
)
})
}
else
if
(
lef_item
.
category_code
===
LocalVariable
.
SCATTERED_EQUIPMENT
)
{
// 零散器械
select_arr
.
forEach
(
sel_item
=>
{
sel_item
[
LocalVariable
.
PLAN_QUANTITY
]
=
sel_item
[
LocalVariable
.
QUANTITY_FIELD
]
res_lines
.
push
(
sel_item
)
})
}
else
{
// 单选耗材
if
(
select_arr
[
0
].
details
&&
select_arr
[
0
].
details
.
length
>
0
)
{
// 大-中-小类
select_arr
.
forEach
(
sel_item
=>
{
sel_item
.
details
.
forEach
(
end_item
=>
{
if
(
end_item
[
QUANTITY_FIELD
]
>
0
)
{
end_item
[
LocalVariable
.
PLAN_QUANTITY
]
=
end_item
[
LocalVariable
.
QUANTITY_FIELD
]
res_lines
.
push
(
end_item
)
}
})
})
}
else
{
// 大类-小类
select_arr
.
forEach
(
sel_item
=>
{
sel_item
[
LocalVariable
.
PLAN_QUANTITY
]
=
sel_item
[
LocalVariable
.
QUANTITY_FIELD
]
res_lines
.
push
(
sel_item
)
})
}
}
}
})
}
})
console
.
log
(
'提交=='
,
res_lines
)
let
test_sum_num
=
0
res_lines
.
map
(
line
=>
{
test_sum_num
+=
line
[
LocalVariable
.
PLAN_QUANTITY
]
})
console
.
log
(
'提交=='
,
test_sum_num
)
console
.
log
(
'提交=='
,
showPackageTip
)
console
.
log
(
'提交=='
,
listOptionData
[
10
].
lines
)
listOptionData
[
10
].
sub_lines
=
res_lines
if
(
showPackageTip
){
this
.
refs
.
PackageModel
.
show
()
}
else
{
this
.
refs
.
CertModel
.
show
(
'需要携带注册证?'
)
}
}
// 判断组织是否为空
judgeOrgIsNull
()
{
let
{
listOptionData
}
=
this
.
state
let
orgVal
=
listOptionData
[
1
].
value
if
(
!
orgVal
)
{
if
(
!
orgVal
)
{
show
(
'请先选择组织'
)
return
false
}
else
{
...
...
@@ -1339,7 +1469,7 @@ class SelfOrderPage extends Component {
judgeCustomerIsNull
()
{
let
{
listOptionData
}
=
this
.
state
let
orgVal
=
listOptionData
[
2
].
value
if
(
!
orgVal
)
{
if
(
!
orgVal
)
{
show
(
'请先选择客户名称'
)
return
false
}
else
{
...
...
@@ -1350,8 +1480,8 @@ class SelfOrderPage extends Component {
processReturnData
()
{
let
{
selfOrderOption
}
=
this
.
props
let
that
=
this
if
(
selfOrderOption
.
create_success
)
{
if
(
selfOrderOption
.
create_success
==
'N'
)
{
if
(
selfOrderOption
.
create_success
)
{
if
(
selfOrderOption
.
create_success
==
'N'
)
{
// // 打开库存不足弹窗
// this.setState({
// not_enough_items_list: selfOrderOption.not_enough_items_list
...
...
@@ -1363,7 +1493,7 @@ class SelfOrderPage extends Component {
// })
// }, 500)
// })
}
else
if
(
selfOrderOption
.
create_success
==
'Y'
)
{
}
else
if
(
selfOrderOption
.
create_success
==
'Y'
)
{
// // 打开下单成功页面
// this.clearAllData()
// let { state: { params: { title } } } = this.props.navigation
...
...
@@ -1376,8 +1506,8 @@ class SelfOrderPage extends Component {
}
// 清空数据
clearAllData
()
{
let
{
props
}
=
this
let
{
listOptionData
,
subInitListOption
}
=
this
.
state
let
{
props
}
=
this
let
{
listOptionData
,
subInitListOption
}
=
this
.
state
props
.
setSelfInitData
()
// 清空缓存数据
listOptionData
=
cloneObject
(
subInitListOption
)
// 清空本地数据
this
.
setState
({
...
...
@@ -1388,13 +1518,21 @@ class SelfOrderPage extends Component {
}
// 提交的提示回调函数
modelPackageCertCB
(
typeName
,
nowVal
){
let
{
local_tip
}
=
this
.
state
local_tip
[
typeName
]
=
nowVal
modelPackageCertCB
(
typeName
,
nowVal
)
{
let
{
local_tip
,
listOptionData
}
=
this
.
state
listOptionData
[
10
][
typeName
]
=
nowVal
// local_tip[typeName] = nowVal
this
.
setState
({
local_tip
:
local_tip
listOptionData
:
listOptionData
// local_tip: local_tip
})
console
.
log
(
'local_tip---'
,
local_tip
)
console
.
log
(
'modelPackageCertCB---'
,
listOptionData
[
10
])
if
(
typeName
===
'replace_item_flag'
)
{
this
.
refs
.
CertModel
.
show
(
'需要携带注册证?'
)
}
else
{
console
.
log
(
'请求提交===='
)
this
.
handleSubmit
()
}
}
...
...
@@ -1421,7 +1559,7 @@ class SelfOrderPage extends Component {
// 返回备注以上的元素
renderListItem
()
{
let
{
listOptionData
,
dateModelPop
}
=
this
.
state
return
(
return
(
<
View
style
=
{
styles
.
list_cont
}
>
<
PageListArrow
listActOpa
=
{
1
}
...
...
@@ -1575,6 +1713,7 @@ class SelfOrderPage extends Component {
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
6
]}
listInputPlace
=
{
'请输入'
}
listDefaValue
=
{
'value'
}
...
...
@@ -1601,6 +1740,7 @@ class SelfOrderPage extends Component {
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
7
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
...
...
@@ -1697,9 +1837,9 @@ class SelfOrderPage extends Component {
callback
=
{(
date
)
=>
this
.
dateModalCallback
(
date
,
listOptionData
[
7
])}
/
>
{
this
.
renderPickerModel
()
}
{
this
.
renderTipModelPackage
()
}
{
this
.
renderTipModelCert
()
}
{
this
.
renderPickerModel
()}
{
this
.
renderTipModelPackage
()}
{
this
.
renderTipModelCert
()}
<
/View
>
)
...
...
@@ -1709,7 +1849,7 @@ class SelfOrderPage extends Component {
renderRightArrowItem
()
{
return
(
<
ImageTextStyle
>
<
Image
source
=
{
require
(
'../../images/arr_rig.png'
)}
style
=
{
icon_style
}
/
>
<
Image
source
=
{
require
(
'../../images/arr_rig.png'
)}
style
=
{
icon_style
}
/
>
<
/ImageTextStyle
>
)
}
...
...
@@ -1739,15 +1879,15 @@ class SelfOrderPage extends Component {
<
CellTextStyle
style
=
{
list_common_item
.
remark_item
}
>
<
View
style
=
{
list_common_item
.
rema_box
}
>
<
Text
style
=
{
list_common_item
.
rema_tit
}
>
备注
<
/Text
>
<
View
style
=
{
list_common_item
.
rema_Input_outer
}
>
<
TouchableOpacity
activeOpacity
=
{
1
}
style
=
{
list_common_item
.
rema_Input_inner
}
onPress
=
{()
=>
this
.
TextInput
.
focus
()}
>
<
View
style
=
{
list_common_item
.
rema_Input_outer
}
>
<
TouchableOpacity
activeOpacity
=
{
1
}
style
=
{
list_common_item
.
rema_Input_inner
}
onPress
=
{()
=>
this
.
TextInput
.
focus
()}
>
<
TextInput
placeholder
=
{
'请输入备注信息'
}
placeholderTextColor
=
{
placehold_text_color
}
underlineColorAndroid
=
{
'transparent'
}
multiline
=
{
true
}
ref
=
{
textInput
=>
this
.
TextInput
=
textInput
}
numberOfLines
=
{
8
}
placeholder
=
{
'请输入备注信息'
}
placeholderTextColor
=
{
placehold_text_color
}
underlineColorAndroid
=
{
'transparent'
}
multiline
=
{
true
}
ref
=
{
textInput
=>
this
.
TextInput
=
textInput
}
numberOfLines
=
{
8
}
style
=
{
list_common_item
.
rema_Input
}
maxLength
=
{
140
}
onChangeText
=
{(
text
)
=>
this
.
handleRemarkInput
(
text
,
listOptionData
[
11
])}
...
...
@@ -1766,18 +1906,18 @@ class SelfOrderPage extends Component {
return
(
<
CellTextStyle
style
=
{[
list_common_item
.
reco_item
,
!
stop
?
''
:
list_common_item
.
reco_play_height
]}
>
<
View
style
=
{
list_common_item
.
reco_btn_cont
}
>
{
!
stop
?
<
Text
style
=
{
list_common_item
.
reco_btn_tit
}
>
还有什么要安排的,可录音备注哟!
<
/Text> : null
}
{
!
stop
?
<
Text
style
=
{
list_common_item
.
reco_btn_tit
}
>
还有什么要安排的,可录音备注哟!
<
/Text> : null
}
{
!
stop
?
<
View
style
=
{
list_common_item
.
reco_btn_inner
}
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
activeOpacity
=
{.
8
}
style
=
{
list_common_item
.
reco_btn_box
}
onLongPress
=
{
this
.
_record
}
onPressOut
=
{
this
.
_stop
}
>
<
View
style
=
{
list_common_item
.
reco_img_box
}
>
<
Image
source
=
{
require
(
'../../images/record_icon.png'
)}
style
=
{
icon_style
}
/
>
<
Image
source
=
{
require
(
'../../images/record_icon.png'
)}
style
=
{
icon_style
}
/
>
<
/View
>
<
Text
style
=
{
list_common_item
.
reco_btn_text
}
>
长按录音
<
/Text
>
<
/TouchableOpacity
>
...
...
@@ -1785,14 +1925,14 @@ class SelfOrderPage extends Component {
:
<
View
style
=
{
list_common_item
.
reco_play_box
}
>
<
View
style
=
{
list_common_item
.
play_btn
}
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
activeOpacity
=
{.
8
}
style
=
{[
list_common_item
.
reco_list_box
,
list_common_item
.
reco_del_btn
]}
onPress
=
{
this
.
_del
}
>
<
Text
style
=
{[
list_common_item
.
reco_text
,
list_common_item
.
reco_del_tit
]}
>
删除
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
activeOpacity
=
{.
8
}
style
=
{[
list_common_item
.
reco_list_box
,
list_common_item
.
reco_play_btn
]}
onPress
=
{
this
.
_play
}
>
...
...
@@ -1810,36 +1950,36 @@ class SelfOrderPage extends Component {
// 返回正在加载中
renderLodingItem
()
{
let
{
lodingTitle
,
isSubLoding
}
=
this
.
state
return
(
return
(
<
LodingModel
title
=
{
lodingTitle
}
show
=
{
isSubLoding
}
style_back
=
{
styles
.
loding_back
}
/
>
)
}
// 返回提交器械包提示
renderTipModelPackage
(){
renderTipModelPackage
()
{
return
(
<
TipInfoNeedSelect
ref
=
"PackageModel"
closeCallBack
=
{()
=>
this
.
modelPackageCertCB
(
'
will'
,
'N'
)}
submitCallBack
=
{()
=>
this
.
modelPackageCertCB
(
'will'
,
'Y'
)}
/
>
<
TipInfoNeedSelect
ref
=
"PackageModel"
closeCallBack
=
{()
=>
this
.
modelPackageCertCB
(
'
replace_item_flag'
,
'N'
)}
submitCallBack
=
{()
=>
this
.
modelPackageCertCB
(
'replace_item_flag'
,
'Y'
)}
/
>
)
}
// 返回提交合格证提示
renderTipModelCert
(){
renderTipModelCert
()
{
return
(
<
TipInfoNeedSelect
ref
=
"CertModel"
closeCallBack
=
{()
=>
this
.
modelPackageCertCB
(
'take_cert
'
,
'N'
)}
submitCallBack
=
{()
=>
this
.
modelPackageCertCB
(
'take_cert'
,
'Y'
)}
/
>
<
TipInfoNeedSelect
ref
=
"CertModel"
closeCallBack
=
{()
=>
this
.
modelPackageCertCB
(
'take_cert
_flag'
,
'N'
)}
submitCallBack
=
{()
=>
this
.
modelPackageCertCB
(
'take_cert_flag'
,
'Y'
)}
/
>
)
}
render
()
{
let
{
canSubFlag
}
=
this
.
state
let
{
canSubFlag
}
=
this
.
state
// console.log(this.props)
let
{
navigation
}
=
this
.
props
let
{
title
}
=
navigation
.
state
.
params
let
{
navigation
}
=
this
.
props
let
{
title
}
=
navigation
.
state
.
params
return
(
<
View
style
=
{
styles
.
self_container
}
>
<
StatusBarView
isReactStackNavigator
=
{
true
}
backgroundColor
=
{
promary_color
}
barStyle
=
'light-content'
barStyle
=
'light-content'
/>
<
SafeAreaView
style
=
{
safe_view
}
>
<
HeadBackItem
title
=
{
title
}
navigation
=
{
navigation
}
/
>
...
...
@@ -1857,13 +1997,14 @@ class SelfOrderPage extends Component {
style
=
{
canSubFlag
?
styles
.
sub_btn_pro
:
''
}
activeOpacity
=
{
canSubFlag
?
.
8
:
1
}
title
=
{
'生成订单'
}
textStyle
=
{
styles
.
sub_btn
}
onPress
=
{()
=>
this
.
handleSubmit
()}
textStyle
=
{
styles
.
sub_btn
}
onPress
=
{()
=>
this
.
getSumLinesOps
()}
// onPress={() => this.handleSubmit()}
/
>
<
/ScrollView
>
{
this
.
renderLodingItem
()
}
{
this
.
renderLodingItem
()
}
<
/SafeAreaView
>
<
/View
>
...
...
@@ -1872,11 +2013,11 @@ class SelfOrderPage extends Component {
}
const
styles
=
StyleSheet
.
create
({
self_container
:
{
self_container
:
{
flex
:
1
,
backgroundColor
:
home_background_color
},
self_main
:
{
self_main
:
{
padding
:
14
},
sub_btn_pro
:
{
...
...
app/containers/selfOrder/module/ChooseProductPage.js
View file @
affd9956
...
...
@@ -328,18 +328,21 @@ class ChooseProductPage extends Component {
}
else
if
(
leftIndex
>
3
)
{
let
params
=
{
access_token
:
token
,
category_code
:
leftItem
.
category_code
,
manufacturer_code
:
topItem
.
supplier_code
,
org_code
:
cur_org_code
,
leftIndex
:
leftIndex
,
// 本地测试
}
let
single_all_search
=
await
reqSingleConsumSearch
(
global_domain_config
,
params
)
console
.
log
(
'res_3 : '
,
single_all_search
,
leftIndex
,
leftIndex
%
2
)
if
(
single_all_search
.
error_code
===
0
)
{
let
{
data
}
=
single_all_search
console
.
log
(
'data : '
,
data
,
data
instanceof
Array
)
if
(
data
instanceof
Array
)
{
console
.
log
(
'data : '
,
data
,
data
.
items
)
if
(
data
&&
data
.
items
)
{
// if(leftItem[SELECTED_QUQNTITY] === 0){
//大-中-小类
leftItem
.
localSecondData
=
cloneObject
(
data
)
leftItem
.
localSecondData
=
cloneObject
(
data
.
items
)
leftItem
[
'localSecondData'
].
forEach
(
function
(
righDa
)
{
righDa
[
CHILDREN_LINE_NAME
]
=
[]
// if (!righDa['quantity']) {
...
...
app/containers/selfOrder/module/EditThirdLevelPage.js
View file @
affd9956
...
...
@@ -421,7 +421,7 @@ class EditThirdLevelPage extends Component {
curImgIcon
=
'photos'
return
(
<
SafeAreaView
style
=
{
styles
.
column_container
}
>
<
SafeAreaView
style
=
{
styles
.
column_container
}
key
=
{
'item_code'
+
index
}
>
<
PicTitDetaiCalcu
listItem
=
{
item
}
listIndex
=
{
index
}
...
...
app/containers/selfOrder/module/ProductRightStyle.js
View file @
affd9956
...
...
@@ -4,10 +4,10 @@ import { third_text_color, foundation_color, second_text_size, Width, pxSize, fo
import
PicTitDetaiCalcu
from
'../../common/listDataComponent/PicTitDetaiCalcu'
;
import
PictureZoom
from
'../../common/listDataComponent/PictureZoom'
;
import
{
cloneObject
}
from
'../../../utils/Utils'
;
import
{
PicListNoData
}
from
'../../common/CellTextStyle'
;
import
_
from
"lodash"
;
import
{
connect
}
from
'react-redux'
;
import
localMockData
from
'./mock/sen_mock'
;
import
{
PicListNoData
}
from
'../../common/CellTextStyle'
;
const
PropTypes
=
require
(
'prop-types'
);
const
QUANTITY_FIELD
=
'quantity'
// 计算的字段
...
...
@@ -469,7 +469,7 @@ class ProductRightStyle extends Component {
curReduceCallBack
=
(()
=>
this
.
props
.
superReduceBack
())
}
return
(
<
SafeAreaView
style
=
{
styles
.
ri_container
}
>
<
SafeAreaView
style
=
{
styles
.
ri_container
}
key
=
{
'template_name'
+
index
}
>
<
PicTitDetaiCalcu
listItem
=
{
item
}
listIndex
=
{
index
}
...
...
@@ -516,7 +516,7 @@ class ProductRightStyle extends Component {
// 单选耗材 -- 小类每一列
renderThridItem
(
item
,
index
)
{
return
(
<
SafeAreaView
style
=
{
styles
.
thr_container
}
>
<
SafeAreaView
style
=
{
styles
.
thr_container
}
key
=
{
'item_code'
+
index
}
>
<
PicTitDetaiCalcu
listItem
=
{
item
}
listIndex
=
{
index
}
...
...
@@ -573,7 +573,7 @@ class ProductRightStyle extends Component {
// console.log('大类===', item)
return
(
<
SafeAreaView
style
=
{
styles
.
oth_container
}
>
<
SafeAreaView
style
=
{
styles
.
oth_container
}
key
=
{
'item_code'
+
index
}
>
<
PicTitDetaiCalcu
listItem
=
{
item
}
listIndex
=
{
index
}
...
...
app/containers/selfOrder/module/mock/inter_mock.js
View file @
affd9956
...
...
@@ -508,8 +508,8 @@ const inter_9 = //大-中-小类
{
"error_code"
:
0
,
"error_msg"
:
"成功"
,
"data"
:
[{
"data"
:
{
"items"
:
[{
"category_code"
:
"JSTH-01-01"
,
"category_name"
:
"股骨头"
,
"details"
:
[
...
...
@@ -550,9 +550,8 @@ const inter_9 = //大-中-小类
"photos"
:
local_photos
}
]
}]
}
]
}
//大-小类
...
...
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