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
60fa204b
authored
Aug 10, 2020
by
Denglingling
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化【借货订单】联动信息选择后,查询出联动字段只有一条数据时,给联动字段赋值这条数据;
如选择【组织】后,调用查询【客户名称】只有一条数据,给【客户名称】赋值这条数据;
parent
9558debf
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
15 deletions
app/action/EquipAction.js
app/action/HistorAction.js
app/action/QuickAction.js
app/action/TransAction.js
app/containers/quickOrder/QuickOrderPage.js
app/containers/selfOrder/SelfOrderPage.js
app/containers/selfOrder/module/listTagData.js
app/action/EquipAction.js
View file @
60fa204b
...
...
@@ -40,7 +40,7 @@ export function requestEquipOrganizations(params) {
}
}
// 获取
手术医院
params={access_token:'', org_code:'', seller_code:''}
// 获取
客户名称
params={access_token:'', org_code:'', seller_code:''}
export
function
requestEquipSurgeryHospital
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestListDataing
());
...
...
app/action/HistorAction.js
View file @
60fa204b
...
...
@@ -12,7 +12,7 @@ export const requestHistorOrganizations = async (global_domain_config, params) =
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/authorized_inventory/search'
,
params
))
}
// 获取
手术医院
params={access_token:'', org_code:'', seller_code:''}
// 获取
客户名称
params={access_token:'', org_code:'', seller_code:''}
export
const
requestHistorSurgeryHospital
=
async
(
global_domain_config
,
params
)
=>
{
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/sale/seller_customer/search'
,
params
))
}
...
...
app/action/QuickAction.js
View file @
60fa204b
...
...
@@ -39,7 +39,7 @@ export function requestQuickOrganizations(params) {
}
}
// 获取
手术医院
params={access_token:'', org_code:'', seller_code:''}
// 获取
客户名称
params={access_token:'', org_code:'', seller_code:''}
export
function
requestQuickSurgeryHospital
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestListDataing
());
...
...
@@ -66,6 +66,10 @@ export function requestQuickSurgeryHospital(params) {
}
}
export
const
reqQuickSurgeryHospital
=
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
requestQuickOrderType
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
...
...
@@ -126,7 +130,7 @@ function requestListDataing() {
}
}
function
requestListDataSuccess
(
data
)
{
export
function
requestListDataSuccess
(
data
)
{
return
{
type
:
QUICK_ORDER_LIST_SUCCESS
,
rawData
:
data
...
...
app/action/TransAction.js
View file @
60fa204b
...
...
@@ -39,7 +39,7 @@ export function requestTransOrganizations(params) {
}
}
// 获取
手术医院
params={access_token:'', org_code:'', seller_code:''}
// 获取
客户名称
params={access_token:'', org_code:'', seller_code:''}
export
function
requestTransSurgeryHospital
(
params
)
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
requestListDataing
());
...
...
app/containers/quickOrder/QuickOrderPage.js
View file @
60fa204b
...
...
@@ -47,7 +47,9 @@ import {
requestQuickTemplateCollect
,
requestQuickAudio
,
requestQuickSumbit
,
setQuickInitData
setQuickInitData
,
reqQuickSurgeryHospital
,
requestListDataSuccess
}
from
'../../action/QuickAction'
;
import
{
exitLoginStatus
}
from
'../../action/LoginAction'
;
import
{
...
...
@@ -506,12 +508,22 @@ class EquipConsuPage extends Component {
// 清空当前项以下的值
clearInitNameAndValue
(
curIndex
)
{
let
{
listOptionData
,
localOtherObj
}
=
this
.
state
let
that
=
this
this
.
setState
({
listOptionData
:
listOptionData
.
map
((
item
,
index
)
=>
{
if
(
index
>
curIndex
&&
index
<
11
)
{
// console.log('----优化,客户名称选择之后,收单地点、收货地点只有一个时,赋值第一个--', this.state.localCustomersOption)
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
=
''
...
...
@@ -706,6 +718,41 @@ class EquipConsuPage extends Component {
}
props
.
requestQuickSurgeryHospital
(
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
reqQuickSurgeryHospital
(
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
===
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
{
localCustomersOption
,
listOptionData
}
=
this
.
state
...
...
@@ -738,6 +785,18 @@ class EquipConsuPage extends Component {
})
}
}
customerGetBill
()
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
that
=
this
let
tempLocalOption
=
localCustomersOption
.
filter
(
item
=>
item
.
customer_code
===
listOptionData
[
2
].
value
)
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
{
localCustomersOption
,
listOptionData
}
=
this
.
state
...
...
@@ -770,6 +829,18 @@ class EquipConsuPage extends Component {
})
}
}
customerGetShip
()
{
let
{
localCustomersOption
,
listOptionData
}
=
this
.
state
let
that
=
this
let
tempLocalOption
=
localCustomersOption
.
filter
(
item
=>
item
.
customer_code
===
listOptionData
[
2
].
value
)
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
{
localCustomersOption
,
listOptionData
}
=
this
.
state
...
...
@@ -1459,6 +1530,9 @@ const mapDispatchToProps = (dispatch) => {
},
setQuickInitData
:
()
=>
{
dispatch
(
setQuickInitData
())
},
requestListDataSuccess
:
(
data
)
=>
{
dispatch
(
requestListDataSuccess
(
data
))
}
}
}
...
...
app/containers/selfOrder/SelfOrderPage.js
View file @
60fa204b
...
...
@@ -73,7 +73,7 @@ class SelfOrderPage extends Component {
},
{
"id"
:
"2"
,
title
:
'
手术医院
'
,
title
:
'
客户名称
'
,
name
:
'请选择'
,
value
:
''
,
isPicker
:
true
,
...
...
@@ -167,7 +167,7 @@ class SelfOrderPage extends Component {
submitOption
:
{
// 提交的信息
seller_code
:
''
,
// 用户名username
org_code
:
''
,
// 组织
customer_code
:
''
,
//
手术医院
customer_code
:
''
,
//
客户名称
bill_to_site_code
:
''
,
// 收单地点
ship_to_site_code
:
''
,
// 收货地点
doctor_name
:
''
,
// 主治医生
...
...
@@ -439,7 +439,7 @@ class SelfOrderPage extends Component {
this
.
setState
({
currentItem
:
item
,
})
// if(itemTitle === '组织' || itemTitle === '
手术医院
') {
// if(itemTitle === '组织' || itemTitle === '
客户名称
') {
this
.
setState
({
listOptionData
:
listOptionData
.
map
((
chItem
,
index
)
=>
{
if
(
chItem
.
title
===
itemTitle
)
{
...
...
@@ -473,7 +473,7 @@ class SelfOrderPage extends Component {
let
tempOption
=
[]
if
(
currentTitle
===
'组织'
)
{
tempOption
=
this
.
changeNameAndValue
(
selfOrderOption
,
'org_name'
,
'org_code'
)
}
else
if
(
currentTitle
===
'
手术医院
'
)
{
}
else
if
(
currentTitle
===
'
客户名称
'
)
{
tempOption
=
[
{
customer_name
:
'医院-4'
,
...
...
@@ -640,15 +640,15 @@ class SelfOrderPage extends Component {
// })
}
//
手术医院
点击
//
客户名称
点击
handleCustomerCheck
()
{
let
{
listOptionData
}
=
this
.
state
let
{
token
,
requestOrganizations
}
=
this
.
props
console
.
warn
(
'
手术医院
------check'
,
token
,
requestOrganizations
)
console
.
warn
(
'
客户名称
------check'
,
token
,
requestOrganizations
)
let
self
=
this
this
.
setState
({
currentTitle
:
'
手术医院
'
,
currentTitle
:
'
客户名称
'
,
currentItem
:
{
name
:
listOptionData
[
2
].
name
,
value
:
listOptionData
[
2
].
value
...
...
@@ -919,7 +919,7 @@ class SelfOrderPage extends Component {
>
<
CellTextStyle
>
<
AsteriskTextStyle
>*<
/AsteriskTextStyle
>
<
TitleTextStyle
>
{
'
手术医院
'
}
<
/TitleTextStyle
>
<
TitleTextStyle
>
{
'
客户名称
'
}
<
/TitleTextStyle
>
<
ContTextStyle
>
{
listOptionData
[
2
].
name
}
--
{
listOptionData
[
2
].
value
}
<
/ContTextStyle
>
{
this
.
renderRightArrowItem
()
}
<
/CellTextStyle
>
...
...
app/containers/selfOrder/module/listTagData.js
View file @
60fa204b
...
...
@@ -14,7 +14,7 @@ export default [
},
{
isRequest
:
true
,
title
:
'
手术医院
'
,
title
:
'
客户名称
'
,
value
:
'请选择'
,
isPicker
:
true
},
...
...
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