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
04f673b6
authored
Jan 29, 2021
by
Denglingling
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化【快速下单】,新增多仓模块
parent
d9584521
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
264 additions
and
77 deletions
app/containers/quickOrder/QuickOrderPage.js
app/containers/quickOrder/module/surgeryTemplatePage.js
app/containers/quickOrder/QuickOrderPage.js
View file @
04f673b6
...
@@ -50,9 +50,12 @@ import {
...
@@ -50,9 +50,12 @@ import {
setQuickInitData
,
setQuickInitData
,
reqQuickSurgeryHospital
,
reqQuickSurgeryHospital
,
requestListDataSuccess
,
requestListDataSuccess
,
requestQuickSurgeryType
requestQuickSurgeryType
,
reqQuickOrganizations
,
requestQuickSurColSetting
,
reqQuickTemplateCollect
}
from
'../../action/QuickAction'
;
}
from
'../../action/QuickAction'
;
import
{
exitLoginStatus
}
from
'../../action/LoginAction'
;
import
{
exitLoginStatus
,
requestSysProfile
}
from
'../../action/LoginAction'
;
import
{
import
{
QUICK_ORDER_LIST_DOING
,
QUICK_ORDER_LIST_DOING
,
QUICK_ORDER_LIST_SUCCESS
,
QUICK_ORDER_LIST_SUCCESS
,
...
@@ -62,6 +65,7 @@ import {
...
@@ -62,6 +65,7 @@ import {
QUICK_SUBMIT_SUCCESS
,
QUICK_SUBMIT_SUCCESS
,
QUICK_SUBMIT_FAILURE
QUICK_SUBMIT_FAILURE
}
from
'../../base/ActionTypes'
;
}
from
'../../base/ActionTypes'
;
import
moment
from
'moment'
;
class
EquipConsuPage
extends
Component
{
class
EquipConsuPage
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -122,8 +126,8 @@ class EquipConsuPage extends Component {
...
@@ -122,8 +126,8 @@ class EquipConsuPage extends Component {
{
{
"id"
:
"8"
,
"id"
:
"8"
,
title
:
'手术时间'
,
title
:
'手术时间'
,
name
:
'请选择'
,
name
:
moment
(
new
Date
()).
format
(
"YYYY-MM-DD HH:mm"
)
,
value
:
''
,
value
:
moment
(
new
Date
()).
format
(
"YYYY-MM-DD HH:mm"
)
,
dateValue
:
new
Date
(),
dateValue
:
new
Date
(),
showDatePicker
:
true
showDatePicker
:
true
},
},
...
@@ -135,12 +139,18 @@ class EquipConsuPage extends Component {
...
@@ -135,12 +139,18 @@ class EquipConsuPage extends Component {
},
},
{
{
"id"
:
"10"
,
"id"
:
"10"
,
title
:
'借货仓库'
,
name
:
'请选择'
,
value
:
''
},
{
"id"
:
"11"
,
title
:
'备注'
,
title
:
'备注'
,
value
:
''
,
value
:
''
,
isRemark
:
true
// 备注
isRemark
:
true
// 备注
},
},
{
{
"id"
:
"1
1
"
,
"id"
:
"1
2
"
,
title
:
'还有什么要安排的,可录音备注哟!'
,
title
:
'还有什么要安排的,可录音备注哟!'
,
value
:
''
,
value
:
''
,
isRecode
:
true
// 录音
isRecode
:
true
// 录音
...
@@ -178,10 +188,6 @@ class EquipConsuPage extends Component {
...
@@ -178,10 +188,6 @@ class EquipConsuPage extends Component {
isSubLoding
:
false
,
// 加载中弹窗
isSubLoding
:
false
,
// 加载中弹窗
lodingTitle
:
'加载中'
,
lodingTitle
:
'加载中'
,
listCurrentOption
:
[
// 当前选择器数据
listCurrentOption
:
[
// 当前选择器数据
// {
// name: '男',
// value: 'boy'
// }
],
],
dateModelPop
:
false
,
// 日期选择器
dateModelPop
:
false
,
// 日期选择器
hasPermission
:
undefined
,
//录音 授权状态
hasPermission
:
undefined
,
//录音 授权状态
...
@@ -208,12 +214,15 @@ class EquipConsuPage extends Component {
...
@@ -208,12 +214,15 @@ class EquipConsuPage extends Component {
// ],
// ],
showNotEnogPop
:
false
,
// 库存不足弹窗
showNotEnogPop
:
false
,
// 库存不足弹窗
not_enough_items_list
:[],
// 库存不足数据
not_enough_items_list
:[],
// 库存不足数据
bor_ware_required
:
''
,
// APP借货仓库必填权限
}
}
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
getSellerName
()
this
.
getSellerName
()
this
.
getAudioAuthorize
()
this
.
getAudioAuthorize
()
this
.
getOrganizationData
()
this
.
getSysConfigValue
()
}
}
// 赋值销售员 初始化数据
// 赋值销售员 初始化数据
...
@@ -411,14 +420,14 @@ class EquipConsuPage extends Component {
...
@@ -411,14 +420,14 @@ class EquipConsuPage extends Component {
// 播放录音
// 播放录音
_play
=
async
()
=>
{
_play
=
async
()
=>
{
let
self
=
this
let
that
=
this
show
(
'正在播放'
)
show
(
'正在播放'
)
self
.
whoosh
=
new
Sound
(
this
.
state
.
audioPath
,
''
,
(
err
)
=>
{
that
.
whoosh
=
new
Sound
(
this
.
state
.
audioPath
,
''
,
(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
show
(
'加载音频失败'
)
show
(
'加载音频失败'
)
return
console
.
log
(
'加载音频失败-->'
,
err
)
return
console
.
log
(
'加载音频失败-->'
,
err
)
}
}
self
.
whoosh
.
play
(
success
=>
{
that
.
whoosh
.
play
(
success
=>
{
if
(
success
)
{
if
(
success
)
{
show
(
'播放完毕'
)
show
(
'播放完毕'
)
}
else
{
}
else
{
...
@@ -434,7 +443,7 @@ class EquipConsuPage extends Component {
...
@@ -434,7 +443,7 @@ class EquipConsuPage extends Component {
// 初始化录音
// 初始化录音
this
.
prepareRecordingPath
(
this
.
state
.
audioPath
)
this
.
prepareRecordingPath
(
this
.
state
.
audioPath
)
let
{
listOptionData
}
=
this
.
state
let
{
listOptionData
}
=
this
.
state
listOptionData
[
1
1
].
value
=
''
listOptionData
[
1
2
].
value
=
''
this
.
setState
({
this
.
setState
({
currentTime
:
0
,
currentTime
:
0
,
stop
:
false
,
stop
:
false
,
...
@@ -444,18 +453,18 @@ class EquipConsuPage extends Component {
...
@@ -444,18 +453,18 @@ class EquipConsuPage extends Component {
componentWillReceiveProps
(
nextProps
)
{
componentWillReceiveProps
(
nextProps
)
{
let
{
quick_list_status
,
loginState
,
navigation
,
submit_quick_order_status
}
=
this
.
props
let
{
quick_list_status
,
loginState
,
navigation
,
submit_quick_order_status
}
=
this
.
props
let
self
=
this
let
that
=
this
if
(
quick_list_status
!=
nextProps
.
quick_list_status
)
{
if
(
quick_list_status
!=
nextProps
.
quick_list_status
)
{
switch
(
nextProps
.
quick_list_status
)
{
switch
(
nextProps
.
quick_list_status
)
{
case
QUICK_ORDER_LIST_DOING
:
case
QUICK_ORDER_LIST_DOING
:
this
.
changeSubLoding
(
true
)
this
.
changeSubLoding
(
true
)
break
;
break
;
case
QUICK_ORDER_LIST_SUCCESS
:
case
QUICK_ORDER_LIST_SUCCESS
:
self
.
setState
({
that
.
setState
({
isSubLoding
:
false
,
isSubLoding
:
false
,
lodingTitle
:
'加载中'
lodingTitle
:
'加载中'
},()
=>
{
},()
=>
{
self
.
changeCurrentOption
()
that
.
changeCurrentOption
()
})
})
break
;
break
;
case
QUICK_ORDER_LIST_FAILURE
:
case
QUICK_ORDER_LIST_FAILURE
:
...
@@ -480,12 +489,20 @@ class EquipConsuPage extends Component {
...
@@ -480,12 +489,20 @@ class EquipConsuPage extends Component {
this
.
changeSubLoding
(
true
,
'提交中'
)
this
.
changeSubLoding
(
true
,
'提交中'
)
break
;
break
;
case
QUICK_SUBMIT_SUCCESS
:
case
QUICK_SUBMIT_SUCCESS
:
self
.
setState
({
// that.setState({
isSubLoding
:
false
,
// isSubLoding: false,
lodingTitle
:
'提交中'
// lodingTitle: '提交中'
},()
=>
{
// },() => {
self
.
processReturnData
()
// that.processReturnData()
})
// })
setTimeout
(()
=>
{
that
.
setState
({
isSubLoding
:
false
,
lodingTitle
:
'提交中'
},
()
=>
{
that
.
processReturnData
()
})
},
500
)
break
;
break
;
case
QUICK_SUBMIT_FAILURE
:
case
QUICK_SUBMIT_FAILURE
:
this
.
changeSubLoding
(
false
,
'提交中'
)
this
.
changeSubLoding
(
false
,
'提交中'
)
...
@@ -510,7 +527,7 @@ class EquipConsuPage extends Component {
...
@@ -510,7 +527,7 @@ class EquipConsuPage extends Component {
let
that
=
this
let
that
=
this
this
.
setState
({
this
.
setState
({
listOptionData
:
listOptionData
.
map
((
item
,
index
)
=>
{
listOptionData
:
listOptionData
.
map
((
item
,
index
)
=>
{
if
(
index
>
curIndex
&&
index
<
1
1
)
{
if
(
index
>
curIndex
&&
index
<
1
2
)
{
item
.
name
=
localOtherObj
.
name
item
.
name
=
localOtherObj
.
name
item
.
value
=
localOtherObj
.
value
item
.
value
=
localOtherObj
.
value
if
(
listOptionData
[
1
].
value
&&
item
.
title
==
'客户名称'
)
{
if
(
listOptionData
[
1
].
value
&&
item
.
title
==
'客户名称'
)
{
...
@@ -523,9 +540,12 @@ class EquipConsuPage extends Component {
...
@@ -523,9 +540,12 @@ class EquipConsuPage extends Component {
that
.
customerGetShip
()
that
.
customerGetShip
()
}
}
if
(
item
.
title
==
'主治医生'
)
{
if
(
item
.
title
==
'主治医生'
)
{
item
.
showInput
=
false
,
item
.
showInput
=
false
item
.
inputValue
=
''
item
.
inputValue
=
''
}
}
if
((
listOptionData
[
5
].
value
||
listOptionData
[
5
].
inputValue
)
&&
item
.
title
===
'手术模板'
){
that
.
getMatchTempData
()
}
}
}
return
item
return
item
})
})
...
@@ -534,11 +554,15 @@ class EquipConsuPage extends Component {
...
@@ -534,11 +554,15 @@ class EquipConsuPage extends Component {
// 判断是否都有值,修改提交按钮的颜色
// 判断是否都有值,修改提交按钮的颜色
changeCanSub
(
isSubCheck
)
{
changeCanSub
(
isSubCheck
)
{
let
{
listOptionData
}
=
this
.
state
let
{
listOptionData
,
bor_ware_required
}
=
this
.
state
let
tempStatus
=
false
let
tempStatus
=
false
let
tempTit
=
''
let
tempTit
=
''
let
maxIndex
=
10
if
(
bor_ware_required
===
'Y'
){
maxIndex
=
11
}
for
(
let
chIndex
in
listOptionData
)
{
for
(
let
chIndex
in
listOptionData
)
{
if
(
chIndex
>
0
&&
chIndex
<
10
if
(
chIndex
>
0
&&
chIndex
<
maxIndex
&&
chIndex
!=
6
&&
chIndex
!=
8
&&
chIndex
!=
6
&&
chIndex
!=
8
&&
!
listOptionData
[
chIndex
].
value
&&
!
listOptionData
[
chIndex
].
value
&&
listOptionData
[
chIndex
].
name
!==
'其他'
)
{
&&
listOptionData
[
chIndex
].
name
!==
'其他'
)
{
...
@@ -559,32 +583,32 @@ class EquipConsuPage extends Component {
...
@@ -559,32 +583,32 @@ class EquipConsuPage extends Component {
// 选择器弹窗回调函数
// 选择器弹窗回调函数
handleCallBack
(
item
,
itemTitle
)
{
handleCallBack
(
item
,
itemTitle
)
{
let
{
listOptionData
}
=
this
.
state
let
{
listOptionData
}
=
this
.
state
let
self
=
this
let
that
=
this
listOptionData
.
map
(
function
(
chItem
,
index
){
listOptionData
.
map
(
function
(
chItem
,
index
){
if
(
chItem
.
title
===
itemTitle
)
{
if
(
chItem
.
title
===
itemTitle
)
{
chItem
.
name
=
item
.
name
chItem
.
name
=
item
.
name
chItem
.
value
=
item
.
value
chItem
.
value
=
item
.
value
if
(
itemTitle
===
'组织'
)
{
if
(
itemTitle
===
'组织'
)
{
self
.
clearInitNameAndValue
(
1
)
that
.
clearInitNameAndValue
(
1
)
}
}
if
(
itemTitle
===
'客户名称'
)
{
if
(
itemTitle
===
'客户名称'
)
{
self
.
clearInitNameAndValue
(
2
)
that
.
clearInitNameAndValue
(
2
)
}
}
if
(
itemTitle
===
'主治医生'
)
{
if
(
itemTitle
===
'主治医生'
)
{
if
(
item
.
name
===
'其他'
)
{
if
(
item
.
name
===
'其他'
)
{
chItem
.
showInput
=
true
chItem
.
showInput
=
true
}
else
{
}
else
{
chItem
.
showInput
=
false
chItem
.
showInput
=
false
chItem
.
inputValue
=
''
chItem
.
inputValue
=
''
}
}
self
.
clearInitNameAndValue
(
5
)
that
.
clearInitNameAndValue
(
5
)
}
}
if
(
itemTitle
===
'手术类型'
)
{
if
(
itemTitle
===
'手术类型'
)
{
self
.
clearInitNameAndValue
(
6
)
that
.
clearInitNameAndValue
(
6
)
}
if
(
itemTitle
===
'手术模板'
)
{
listOptionData
[
11
].
value
=
item
.
desc
}
}
if
(
itemTitle
===
'手术模板'
)
{
listOptionData
[
10
].
value
=
item
.
desc
}
}
}
})
})
...
@@ -592,7 +616,7 @@ class EquipConsuPage extends Component {
...
@@ -592,7 +616,7 @@ class EquipConsuPage extends Component {
currentItem
:
item
,
currentItem
:
item
,
listOptionData
:
listOptionData
listOptionData
:
listOptionData
},()
=>
{
},()
=>
{
self
.
changeCanSub
()
that
.
changeCanSub
()
})
})
}
}
...
@@ -657,6 +681,9 @@ class EquipConsuPage extends Component {
...
@@ -657,6 +681,9 @@ class EquipConsuPage extends Component {
tempOption
=
[...
resultArr
]
tempOption
=
[...
resultArr
]
}
else
if
(
currentTitle
===
'订单类型'
)
{
}
else
if
(
currentTitle
===
'订单类型'
)
{
tempOption
=
this
.
changeNameAndValue
(
quickOrderOption
,
'value_name'
,
'value_code'
)
tempOption
=
this
.
changeNameAndValue
(
quickOrderOption
,
'value_name'
,
'value_code'
)
}
else
if
(
currentTitle
===
'借货仓库'
)
{
let
filterOpt
=
dedupQuoteArray
(
quickOrderOption
,
'source_inv_code'
)
tempOption
=
this
.
changeNameAndValue
(
filterOpt
,
'source_inv_name'
,
'source_inv_code'
)
}
}
this
.
setState
({
this
.
setState
({
listCurrentOption
:
[...
tempOption
]
listCurrentOption
:
[...
tempOption
]
...
@@ -697,12 +724,49 @@ class EquipConsuPage extends Component {
...
@@ -697,12 +724,49 @@ class EquipConsuPage extends Component {
props
.
requestQuickOrganizations
(
params
)
props
.
requestQuickOrganizations
(
params
)
})
})
}
}
async
getOrganizationData
()
{
let
{
state
,
props
}
=
this
let
params
=
{
access_token
:
props
.
token
}
let
that
=
this
let
{
global_domain_config
}
=
props
let
orgResult
=
await
reqQuickOrganizations
(
global_domain_config
,
params
);
if
(
orgResult
.
error_code
==
0
)
{
let
{
data
:
{
organizations
}
}
=
orgResult
let
{
listOptionData
}
=
state
// props.requestListDataSuccess(organizations)
let
filterOpt
=
dedupQuoteArray
(
organizations
,
'org_code'
)
if
(
filterOpt
.
length
===
0
)
{
show
(
`当前
${
listOptionData
[
1
].
title
}
为空`
)
return
}
if
(
filterOpt
.
length
===
1
)
{
listOptionData
[
1
].
name
=
filterOpt
[
0
].
org_name
listOptionData
[
1
].
value
=
filterOpt
[
0
].
org_code
that
.
setState
({
listOptionData
},
()
=>
{
that
.
organizationGetCustomerData
()
})
}
}
else
{
this
.
showWarnError
(
orgResult
)
}
// else if (orgResult.error_code == 41006) {
// show('登录过期,请重新登录');
// props.exitLoginStatus();
// } else {
// let error_msg = orgResult.error_msg || orgResult.message
// show(error_msg);
// }
}
// 客户名称 点击
// 客户名称 点击
handleCustomerCheck
()
{
handleCustomerCheck
()
{
let
{
state
}
=
this
let
{
state
}
=
this
let
self
=
this
let
that
=
this
if
(
this
.
judgeOrgIsNull
())
{
if
(
this
.
judgeOrgIsNull
())
{
self
.
setState
({
that
.
setState
({
currentTitle
:
'客户名称'
,
currentTitle
:
'客户名称'
,
currentItem
:
{
currentItem
:
{
name
:
state
.
listOptionData
[
2
].
name
,
name
:
state
.
listOptionData
[
2
].
name
,
...
@@ -710,7 +774,7 @@ class EquipConsuPage extends Component {
...
@@ -710,7 +774,7 @@ class EquipConsuPage extends Component {
}
}
},
()
=>
{
},
()
=>
{
// 在此修改接口
// 在此修改接口
self
.
getCustomerData
()
that
.
getCustomerData
()
})
})
}
}
}
}
...
@@ -737,14 +801,14 @@ class EquipConsuPage extends Component {
...
@@ -737,14 +801,14 @@ class EquipConsuPage extends Component {
let
cusResult
=
await
reqQuickSurgeryHospital
(
global_domain_config
,
params
);
let
cusResult
=
await
reqQuickSurgeryHospital
(
global_domain_config
,
params
);
if
(
cusResult
.
error_code
==
0
)
{
if
(
cusResult
.
error_code
==
0
)
{
let
{
data
:
{
customers
}
}
=
cusResult
let
{
data
:
{
customers
}
}
=
cusResult
props
.
requestListDataSuccess
(
customers
)
let
{
listOptionData
}
=
state
// props.requestListDataSuccess(customers)
let
filterOpt
=
dedupQuoteArray
(
customers
,
'customer_code'
)
let
filterOpt
=
dedupQuoteArray
(
customers
,
'customer_code'
)
if
(
filterOpt
.
length
===
0
)
{
if
(
filterOpt
.
length
===
0
)
{
show
(
`当前
客户名称
为空`
)
show
(
`当前
${
listOptionData
[
2
].
title
}
为空`
)
return
return
}
}
if
(
filterOpt
.
length
===
1
)
{
if
(
filterOpt
.
length
===
1
)
{
let
{
listOptionData
}
=
state
listOptionData
[
2
].
name
=
filterOpt
[
0
].
customer_name
listOptionData
[
2
].
name
=
filterOpt
[
0
].
customer_name
listOptionData
[
2
].
value
=
filterOpt
[
0
].
customer_code
listOptionData
[
2
].
value
=
filterOpt
[
0
].
customer_code
that
.
setState
({
that
.
setState
({
...
@@ -755,20 +819,23 @@ class EquipConsuPage extends Component {
...
@@ -755,20 +819,23 @@ class EquipConsuPage extends Component {
that
.
customerGetShip
()
that
.
customerGetShip
()
})
})
}
}
}
else
if
(
cusResult
.
error_code
==
41006
)
{
}
else
{
show
(
'登录过期,请重新登录'
);
this
.
showWarnError
(
cusResult
)
props
.
exitLoginStatus
();
}
else
{
let
error_msg
=
cusResult
.
error_msg
||
cusResult
.
message
show
(
error_msg
);
}
}
// else if(cusResult.error_code == 41006) {
// show('登录过期,请重新登录');
// props.exitLoginStatus();
// } else {
// let error_msg = cusResult.error_msg || cusResult.message
// show(error_msg);
// }
}
}
// 收单地点 点击
// 收单地点 点击
handleBillCheck
()
{
handleBillCheck
()
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
let
that
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
that
.
setState
({
currentTitle
:
'收单地点'
,
currentTitle
:
'收单地点'
,
currentItem
:
{
currentItem
:
{
name
:
listOptionData
[
3
].
name
,
name
:
listOptionData
[
3
].
name
,
...
@@ -788,7 +855,7 @@ class EquipConsuPage extends Component {
...
@@ -788,7 +855,7 @@ class EquipConsuPage extends Component {
})
})
}
}
tempOption
=
dedupQuoteArray
(
tempOption
,
'name'
)
tempOption
=
dedupQuoteArray
(
tempOption
,
'name'
)
self
.
setState
({
that
.
setState
({
showTypePop
:
true
,
showTypePop
:
true
,
listCurrentOption
:
[...
tempOption
]
listCurrentOption
:
[...
tempOption
]
})
})
...
@@ -801,7 +868,7 @@ class EquipConsuPage extends Component {
...
@@ -801,7 +868,7 @@ class EquipConsuPage extends Component {
let
tempLocalOption
=
localCustomersOption
.
filter
(
item
=>
item
.
customer_code
===
listOptionData
[
2
].
value
)
let
tempLocalOption
=
localCustomersOption
.
filter
(
item
=>
item
.
customer_code
===
listOptionData
[
2
].
value
)
tempLocalOption
=
dedupQuoteArray
(
tempLocalOption
,
'bill_to_site_code'
)
tempLocalOption
=
dedupQuoteArray
(
tempLocalOption
,
'bill_to_site_code'
)
if
(
tempLocalOption
.
length
===
0
)
{
if
(
tempLocalOption
.
length
===
0
)
{
show
(
`当前
收单地点
为空`
)
show
(
`当前
${
listOptionData
[
3
].
title
}
为空`
)
return
return
}
}
if
(
tempLocalOption
.
length
===
1
)
{
if
(
tempLocalOption
.
length
===
1
)
{
...
@@ -815,9 +882,9 @@ class EquipConsuPage extends Component {
...
@@ -815,9 +882,9 @@ class EquipConsuPage extends Component {
// 收货地点 点击
// 收货地点 点击
handleShipCheck
()
{
handleShipCheck
()
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
let
that
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
that
.
setState
({
currentTitle
:
'收货地点'
,
currentTitle
:
'收货地点'
,
currentItem
:
{
currentItem
:
{
name
:
listOptionData
[
4
].
name
,
name
:
listOptionData
[
4
].
name
,
...
@@ -837,7 +904,7 @@ class EquipConsuPage extends Component {
...
@@ -837,7 +904,7 @@ class EquipConsuPage extends Component {
})
})
}
}
tempOption
=
dedupQuoteArray
(
tempOption
,
'name'
)
tempOption
=
dedupQuoteArray
(
tempOption
,
'name'
)
self
.
setState
({
that
.
setState
({
showTypePop
:
true
,
showTypePop
:
true
,
listCurrentOption
:
[...
tempOption
]
listCurrentOption
:
[...
tempOption
]
})
})
...
@@ -850,7 +917,7 @@ class EquipConsuPage extends Component {
...
@@ -850,7 +917,7 @@ class EquipConsuPage extends Component {
let
tempLocalOption
=
localCustomersOption
.
filter
(
item
=>
item
.
customer_code
===
listOptionData
[
2
].
value
)
let
tempLocalOption
=
localCustomersOption
.
filter
(
item
=>
item
.
customer_code
===
listOptionData
[
2
].
value
)
tempLocalOption
=
dedupQuoteArray
(
tempLocalOption
,
'ship_to_site_code'
)
tempLocalOption
=
dedupQuoteArray
(
tempLocalOption
,
'ship_to_site_code'
)
if
(
tempLocalOption
.
length
===
0
)
{
if
(
tempLocalOption
.
length
===
0
)
{
show
(
`当前
收货地点
为空`
)
show
(
`当前
${
listOptionData
[
4
].
title
}
为空`
)
return
return
}
}
if
(
tempLocalOption
.
length
===
1
)
{
if
(
tempLocalOption
.
length
===
1
)
{
...
@@ -864,10 +931,10 @@ class EquipConsuPage extends Component {
...
@@ -864,10 +931,10 @@ class EquipConsuPage extends Component {
// 主治医生 点击
// 主治医生 点击
handleDoctorCheck
()
{
handleDoctorCheck
()
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
self
=
this
let
that
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
// 点击
// 点击
self
.
setState
({
that
.
setState
({
currentTitle
:
'主治医生'
,
currentTitle
:
'主治医生'
,
currentItem
:
{
currentItem
:
{
name
:
listOptionData
[
5
].
name
,
name
:
listOptionData
[
5
].
name
,
...
@@ -892,7 +959,7 @@ class EquipConsuPage extends Component {
...
@@ -892,7 +959,7 @@ class EquipConsuPage extends Component {
}
}
tempOption
.
push
(
othObj
)
tempOption
.
push
(
othObj
)
tempOption
=
dedupQuoteArray
(
tempOption
,
'name'
)
tempOption
=
dedupQuoteArray
(
tempOption
,
'name'
)
self
.
setState
({
that
.
setState
({
showTypePop
:
true
,
showTypePop
:
true
,
listCurrentOption
:
[...
tempOption
]
listCurrentOption
:
[...
tempOption
]
})
})
...
@@ -915,9 +982,9 @@ class EquipConsuPage extends Component {
...
@@ -915,9 +982,9 @@ class EquipConsuPage extends Component {
handleSurTypeCheck
()
{
handleSurTypeCheck
()
{
let
{
listOptionData
}
=
this
.
state
let
{
listOptionData
}
=
this
.
state
let
{
props
}
=
this
let
{
props
}
=
this
let
self
=
this
let
that
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
self
.
setState
({
that
.
setState
({
currentTitle
:
'手术类型'
,
currentTitle
:
'手术类型'
,
currentItem
:
{
currentItem
:
{
name
:
listOptionData
[
6
].
name
,
name
:
listOptionData
[
6
].
name
,
...
@@ -948,18 +1015,59 @@ class EquipConsuPage extends Component {
...
@@ -948,18 +1015,59 @@ class EquipConsuPage extends Component {
if
(
state
.
listOptionData
[
5
].
name
!==
'其他'
)
{
if
(
state
.
listOptionData
[
5
].
name
!==
'其他'
)
{
tempDoctorName
=
state
.
listOptionData
[
5
].
value
tempDoctorName
=
state
.
listOptionData
[
5
].
value
}
}
let
cur_surgery_type
=
state
.
listOptionData
[
6
].
name
===
'请选择'
?
''
:
state
.
listOptionData
[
6
].
name
let
params
=
{
let
params
=
{
access_token
:
props
.
token
,
access_token
:
props
.
token
,
org_code
:
state
.
listOptionData
[
1
].
value
,
org_code
:
state
.
listOptionData
[
1
].
value
,
seller_code
:
props
.
userInfo
.
user_name
,
seller_code
:
props
.
userInfo
.
user_name
,
customer_code
:
state
.
listOptionData
[
2
].
value
,
customer_code
:
state
.
listOptionData
[
2
].
value
,
surgery_type
:
state
.
listOptionData
[
6
].
valu
e
,
surgery_type
:
cur_surgery_typ
e
,
doctor_name
:
tempDoctorName
doctor_name
:
tempDoctorName
}
}
props
.
requestQuickTemplateCollect
(
params
)
props
.
requestQuickTemplateCollect
(
params
)
})
})
}
}
}
}
async
getMatchTempData
()
{
let
{
state
,
props
}
=
this
let
tempDoctorName
=
''
if
(
state
.
listOptionData
[
5
].
name
!==
'其他'
)
{
tempDoctorName
=
state
.
listOptionData
[
5
].
value
}
let
cur_surgery_type
=
state
.
listOptionData
[
6
].
name
===
'请选择'
?
''
:
state
.
listOptionData
[
6
].
name
let
params
=
{
access_token
:
props
.
token
,
org_code
:
state
.
listOptionData
[
1
].
value
,
seller_code
:
props
.
userInfo
.
user_name
,
customer_code
:
state
.
listOptionData
[
2
].
value
,
surgery_type
:
cur_surgery_type
,
doctor_name
:
tempDoctorName
}
console
.
log
(
'params====='
,
params
)
let
that
=
this
let
{
global_domain_config
}
=
props
let
tempResult
=
await
reqQuickTemplateCollect
(
global_domain_config
,
params
);
if
(
tempResult
.
error_code
==
0
)
{
let
{
data
:
{
surgery_template_headers
}
}
=
tempResult
let
{
listOptionData
}
=
state
props
.
requestListDataSuccess
(
surgery_template_headers
)
let
filterOpt
=
dedupQuoteArray
(
surgery_template_headers
,
'template_number'
)
if
(
filterOpt
.
length
===
0
)
{
show
(
`当前
${
listOptionData
[
7
].
title
}
为空`
)
return
}
if
(
filterOpt
.
length
===
1
)
{
listOptionData
[
7
].
name
=
filterOpt
[
0
].
template_name
listOptionData
[
7
].
value
=
filterOpt
[
0
].
template_number
listOptionData
[
11
].
value
=
filterOpt
[
0
].
template_desc
that
.
setState
({
listOptionData
})
}
}
else
{
this
.
showWarnError
(
tempResult
)
}
}
// 手术时间 点击 2020-04-23 17:41
// 手术时间 点击 2020-04-23 17:41
handleSurDateCheck
()
{
handleSurDateCheck
()
{
let
{
listOptionData
}
=
this
.
state
let
{
listOptionData
}
=
this
.
state
...
@@ -1016,6 +1124,30 @@ class EquipConsuPage extends Component {
...
@@ -1016,6 +1124,30 @@ class EquipConsuPage extends Component {
})
})
}
}
}
}
// 借货仓库 点击
handleWareCheck
(){
let
{
state
,
props
}
=
this
if
(
this
.
judgeOrgIsNull
()
&&
this
.
judgeCustomerIsNull
())
{
this
.
setState
({
currentTitle
:
state
.
listOptionData
[
10
].
title
,
currentItem
:
{
name
:
state
.
listOptionData
[
10
].
name
,
value
:
state
.
listOptionData
[
10
].
value
}
},
()
=>
{
// 在此修改接口
let
params
=
{
access_token
:
props
.
token
,
org_code
:
state
.
listOptionData
[
1
].
value
,
customer_code
:
state
.
listOptionData
[
2
].
value
,
bill_to_site_code
:
state
.
listOptionData
[
3
].
value
,
ship_to_site_code
:
state
.
listOptionData
[
4
].
value
,
process_code
:
'COLLECT'
}
props
.
requestQuickSurColSetting
(
params
)
})
}
}
// 备注 输入
// 备注 输入
handleRemarkInput
(
text
)
{
handleRemarkInput
(
text
)
{
let
{
listOptionData
}
=
this
.
state
let
{
listOptionData
}
=
this
.
state
...
@@ -1048,7 +1180,7 @@ class EquipConsuPage extends Component {
...
@@ -1048,7 +1180,7 @@ class EquipConsuPage extends Component {
// 提交订单
// 提交订单
that
.
setState
({
that
.
setState
({
listOptionData
:
state
.
listOptionData
.
map
((
item
,
index
)
=>
{
listOptionData
:
state
.
listOptionData
.
map
((
item
,
index
)
=>
{
if
(
index
==
1
1
)
{
if
(
index
==
1
2
)
{
item
.
value
=
audioResult
.
data
.
url
item
.
value
=
audioResult
.
data
.
url
}
}
return
item
return
item
...
@@ -1060,12 +1192,14 @@ class EquipConsuPage extends Component {
...
@@ -1060,12 +1192,14 @@ class EquipConsuPage extends Component {
}
else
if
(
audioResult
.
error_code
==
41006
)
{
}
else
if
(
audioResult
.
error_code
==
41006
)
{
that
.
changeSubLoding
(
false
)
that
.
changeSubLoding
(
false
)
show
(
'登录过期,请重新登录'
);
this
.
showWarnError
(
audioResult
)
props
.
exitLoginStatus
();
// show('登录过期,请重新登录');
// props.exitLoginStatus();
}
else
{
}
else
{
// that.changeSubLoding(false)
that
.
changeSubLoding
(
false
)
let
error_msg
=
audioResult
.
error_msg
||
audioResult
.
message
this
.
showWarnError
(
audioResult
)
show
(
error_msg
);
// let error_msg = audioResult.error_msg || audioResult.message
// show(error_msg);
that
.
submitQuickOrder
()
that
.
submitQuickOrder
()
}
}
}
else
{
}
else
{
...
@@ -1090,12 +1224,14 @@ class EquipConsuPage extends Component {
...
@@ -1090,12 +1224,14 @@ class EquipConsuPage extends Component {
tempSubOption
.
template_collect_number
=
state
.
listOptionData
[
7
].
value
tempSubOption
.
template_collect_number
=
state
.
listOptionData
[
7
].
value
tempSubOption
.
surgery_date
=
state
.
listOptionData
[
8
].
value
tempSubOption
.
surgery_date
=
state
.
listOptionData
[
8
].
value
tempSubOption
.
order_type_code
=
state
.
listOptionData
[
9
].
value
tempSubOption
.
order_type_code
=
state
.
listOptionData
[
9
].
value
tempSubOption
.
surgery_desc
=
state
.
listOptionData
[
10
].
value
tempSubOption
.
collect_src_inv_code
=
state
.
listOptionData
[
10
].
value
tempSubOption
.
voice_url
=
state
.
listOptionData
[
11
].
value
tempSubOption
.
surgery_desc
=
state
.
listOptionData
[
11
].
value
tempSubOption
.
voice_url
=
state
.
listOptionData
[
12
].
value
let
params
=
{
let
params
=
{
access_token
:
props
.
token
,
access_token
:
props
.
token
,
data
:
{
...
tempSubOption
}
data
:
{
...
tempSubOption
}
}
}
console
.
log
(
'params----'
,
params
)
props
.
requestQuickSumbit
(
params
)
props
.
requestQuickSumbit
(
params
)
}
}
// 判断组织是否为空
// 判断组织是否为空
...
@@ -1163,14 +1299,14 @@ class EquipConsuPage extends Component {
...
@@ -1163,14 +1299,14 @@ class EquipConsuPage extends Component {
// 库存不足弹窗回调 -- 确定
// 库存不足弹窗回调 -- 确定
handleNotEnoughCallBack
()
{
handleNotEnoughCallBack
()
{
let
{
submitOption
}
=
this
.
state
let
{
submitOption
}
=
this
.
state
let
self
=
this
let
that
=
this
this
.
setState
({
this
.
setState
({
submitOption
:
{
submitOption
:
{
...
submitOption
,
...
submitOption
,
force_balance_check_flag
:
'N'
force_balance_check_flag
:
'N'
}
}
},
()
=>
{
},
()
=>
{
self
.
handleSubmit
()
that
.
handleSubmit
()
})
})
}
}
// 库存不足弹窗关闭
// 库存不足弹窗关闭
...
@@ -1178,10 +1314,44 @@ class EquipConsuPage extends Component {
...
@@ -1178,10 +1314,44 @@ class EquipConsuPage extends Component {
this
.
setState
({
this
.
setState
({
showNotEnogPop
:
show
showNotEnogPop
:
show
})
})
}
}
// 获取配置值
async
getSysConfigValue
()
{
let
{
global_domain_config
,
token
}
=
this
.
props
const
params
=
{
access_token
:
token
,
profile_code
:
'OBS_MOBILE_BOR_WARE_REQUIRED'
}
let
sysRes
=
await
requestSysProfile
(
global_domain_config
,
params
)
console
.
log
(
'sysRes:=='
,
sysRes
)
if
(
sysRes
.
error_code
===
0
){
this
.
setState
({
bor_ware_required
:
sysRes
.
data
.
profile_value
})
}
else
{
this
.
showWarnError
(
sysRes
)
}
// else if(sysRes.error_code == 41006) {
// show('登录过期,请重新登录');
// this.props.exitLoginStatus();
// } else {
// let error_msg = sysRes.error_msg || sysRes.message
// show(error_msg);
// }
}
showWarnError
(
res
){
if
(
res
.
error_code
==
41006
)
{
show
(
'登录过期,请重新登录'
);
this
.
props
.
exitLoginStatus
();
}
else
{
let
error_msg
=
res
.
error_msg
||
res
.
message
show
(
error_msg
);
}
}
// 返回备注以上的元素
// 返回备注以上的元素
renderListItem
()
{
renderListItem
()
{
let
{
listOptionData
,
dateModelPop
}
=
this
.
state
let
{
listOptionData
,
dateModelPop
,
bor_ware_required
}
=
this
.
state
return
(
return
(
<
View
style
=
{
styles
.
list_cont
}
>
<
View
style
=
{
styles
.
list_cont
}
>
<
View
style
=
{
styles
.
item_container
}
>
<
View
style
=
{
styles
.
item_container
}
>
...
@@ -1325,7 +1495,20 @@ class EquipConsuPage extends Component {
...
@@ -1325,7 +1495,20 @@ class EquipConsuPage extends Component {
{
this
.
renderRightArrowItem
()
}
{
this
.
renderRightArrowItem
()
}
<
/CellTextStyle
>
<
/CellTextStyle
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View>
<
/View
>
<
View
style
=
{
styles
.
item_container
}
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
onPress
=
{()
=>
this
.
handleWareCheck
()}
>
<
CellTextStyle
>
{
bor_ware_required
===
'Y'
?
<
AsteriskTextStyle
>*<
/AsteriskTextStyle> : null
}
<
TitleTextStyle
>
{
listOptionData
[
10
].
title
}
<
/TitleTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
10
].
name
}
<
/ContTextStyle
>
{
this
.
renderRightArrowItem
()
}
<
/CellTextStyle
>
<
/TouchableOpacity
>
<
/View
>
{
this
.
renderPickerModel
()
}
{
this
.
renderPickerModel
()
}
<
/View
>
<
/View
>
)
)
...
@@ -1379,7 +1562,7 @@ class EquipConsuPage extends Component {
...
@@ -1379,7 +1562,7 @@ class EquipConsuPage extends Component {
style
=
{
list_common_item
.
rema_Input
}
style
=
{
list_common_item
.
rema_Input
}
maxLength
=
{
140
}
maxLength
=
{
140
}
onChangeText
=
{(
text
)
=>
this
.
handleRemarkInput
(
text
)}
onChangeText
=
{(
text
)
=>
this
.
handleRemarkInput
(
text
)}
defaultValue
=
{
state
.
listOptionData
[
1
0
].
value
}
defaultValue
=
{
state
.
listOptionData
[
1
1
].
value
}
/
>
/
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
...
@@ -1563,6 +1746,9 @@ const mapDispatchToProps = (dispatch) => {
...
@@ -1563,6 +1746,9 @@ const mapDispatchToProps = (dispatch) => {
},
},
requestQuickSurgeryType
:
(
params
)
=>
{
requestQuickSurgeryType
:
(
params
)
=>
{
dispatch
(
requestQuickSurgeryType
(
params
))
dispatch
(
requestQuickSurgeryType
(
params
))
},
requestQuickSurColSetting
:
(
params
)
=>
{
dispatch
(
requestQuickSurColSetting
(
params
))
}
}
}
}
}
}
...
...
app/containers/quickOrder/module/surgeryTemplatePage.js
View file @
04f673b6
...
@@ -523,13 +523,14 @@ class surgeryTemplatePage extends Component {
...
@@ -523,13 +523,14 @@ class surgeryTemplatePage extends Component {
}
else
{
}
else
{
tempDoctorName
=
state
.
listOptionData
[
2
].
inputValue
tempDoctorName
=
state
.
listOptionData
[
2
].
inputValue
}
}
let
cur_surgery_type
=
state
.
listOptionData
[
3
].
name
===
'请选择'
?
''
:
state
.
listOptionData
[
3
].
name
let
params
=
{
let
params
=
{
access_token
:
props
.
token
,
access_token
:
props
.
token
,
org_code
:
state
.
listOptionData
[
0
].
value
,
org_code
:
state
.
listOptionData
[
0
].
value
,
seller_code
:
props
.
userInfo
.
user_name
,
seller_code
:
props
.
userInfo
.
user_name
,
customer_code
:
state
.
listOptionData
[
1
].
value
,
customer_code
:
state
.
listOptionData
[
1
].
value
,
doctor_name
:
tempDoctorName
,
doctor_name
:
tempDoctorName
,
surgery_type
:
state
.
listOptionData
[
3
].
valu
e
,
surgery_type
:
cur_surgery_typ
e
,
}
}
props
.
requestQuickTemplateCollect
(
params
)
props
.
requestQuickTemplateCollect
(
params
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment