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
273c8399
authored
Nov 19, 2021
by
peii
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
通过配置文件控制组织显示和隐藏
parent
8ac15a0d
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
249 additions
and
82 deletions
app/action/LoginAction.js
app/base/ActionTypes.js
app/containers/equipConsu/EquipConsuPage.js
app/containers/historicalOrder/module/FilterModel.js
app/containers/quickOrder/QuickOrderPage.js
app/containers/selfOrder/SelfOrderPage.js
app/containers/transOrder/TransOrderPage.js
app/reducers/module/login.js
app/action/LoginAction.js
View file @
273c8399
import
*
as
R
from
'ramda'
;
import
{
LOGIN_DOING
,
LOGIN_SUCCESS
,
...
...
@@ -7,7 +8,8 @@ import {
AUTO_LOGIN_FAILURE
,
SET_DOMAIN_CONFIGURATE
,
SET_VERSION_APK
,
SET_DOMAIN_FROM_ORIGIN
SET_DOMAIN_FROM_ORIGIN
,
SET_SYSPROFILE
}
from
'../base/ActionTypes'
;
import
{
GetRequest
,
PostRequest
}
from
'../network/RequestUtils'
;
import
{
getUrlParams
,
show
,
showWarnErrorMessage
,
showErrorMessage
}
from
'../utils/Utils'
;
...
...
@@ -22,6 +24,7 @@ export function requestLogin(params) {
if
(
res
.
functions
&&
res
.
functions
.
length
)
{
show
(
'登录成功'
);
dispatch
(
loginSuccess
(
res
,
params
.
data
.
user_name
,
params
.
data
.
user_password
));
dispatch
(
getSysProfiles
())
}
else
{
show
(
`当前用户没有菜单权限,\n请联系管理员配置!`
)
dispatch
(
loginFailure
())
...
...
@@ -156,3 +159,44 @@ export function setVersionApk(versionApk) {
local_version_apk
:
versionApk
}
}
/**
* @description: 获取系统配置
* @param {*} access_token
* @return {*}
*/
export
function
getSysProfiles
()
{
return
(
dispatch
,
getState
)
=>
{
let
{
global_domain_config
,
token
,
originSysProfiles
}
=
getState
().
login
function
getSysProfile
(
profile_code
)
{
const
params
=
{
access_token
:
token
,
profile_code
}
requestSysProfile
(
global_domain_config
,
params
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
error_code
===
0
)
{
const
value
=
R
.
pathOr
(
originSysProfiles
[
profile_code
],
[
'data'
,
'profile_value'
])(
res
)
dispatch
(
setSysProfiles
(
profile_code
,
value
))
}
})
}
R
.
compose
(
R
.
map
(
getSysProfile
),
R
.
keys
)(
originSysProfiles
)
}
}
/**
* @description: 设置系统配置
* @param {*} code
* @param {*} value
* @return {*}
*/
export
function
setSysProfiles
(
code
,
value
)
{
return
{
type
:
SET_SYSPROFILE
,
code
,
value
}
}
\ No newline at end of file
app/base/ActionTypes.js
View file @
273c8399
...
...
@@ -9,6 +9,8 @@ export const AUTO_LOGIN_FAILURE = "AUTO_LOGIN_FAILURE"
export
const
SET_DOMAIN_CONFIGURATE
=
"SET_DOMAIN_CONFIGURATE"
export
const
SET_DOMAIN_FROM_ORIGIN
=
'SET_DOMAIN_FROM_ORIGIN'
export
const
SET_VERSION_APK
=
"SET_VERSION_APK"
export
const
GET_SYSPROFILE
=
"GET_SYSPROFILE"
export
const
SET_SYSPROFILE
=
"SET_SYSPROFILE"
//-----------self order---------------------
export
const
SELF_ORDER_LIST_NO
=
"SELF_ORDER_LIST_NO"
export
const
SELF_ORDER_LIST_DOING
=
"SELF_ORDER_LIST_DOING"
...
...
app/containers/equipConsu/EquipConsuPage.js
View file @
273c8399
...
...
@@ -638,7 +638,7 @@ class EquipConsuPage extends Component {
let
orgResult
=
await
reqEquipOrganizations
(
global_domain_config
,
params
);
if
(
orgResult
.
error_code
==
0
)
{
let
{
data
:
{
organizations
}
}
=
orgResult
let
{
listOptionData
}
=
state
let
{
listOptionData
,
sysValues
}
=
state
// props.requestListDataSuccess(organizations)
let
filterOpt
=
dedupQuoteArray
(
organizations
,
'org_code'
)
if
(
filterOpt
.
length
===
0
)
{
...
...
@@ -652,9 +652,19 @@ class EquipConsuPage extends Component {
listOptionData
},
()
=>
{
that
.
organizationGetCustomerData
()
that
.
getDepartmentsByOrg
(
listOptionData
[
1
].
value
)
setTimeout
(()
=>
{
if
(
sysValues
.
OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY
>
0
)
{
that
.
getDepartmentsByOrg
(
listOptionData
[
1
].
value
)
}
},
1000
)
})
}
// 贵州需要不显示组织, 所以只能每个用户只能授权1个组织
const
isShowOrg
=
R
.
compose
(
R
.
equals
(
'Y'
),
R
.
prop
(
'OBS_SHOW_ORG_FLAG'
))(
this
.
props
.
sysProfiles
)
if
(
!
isShowOrg
&&
filterOpt
.
length
>
1
)
{
show
(
`请先选择组织`
)
}
}
else
if
(
orgResult
.
error_code
==
41006
)
{
show
(
'登录过期,请重新登录'
);
props
.
exitLoginStatus
();
...
...
@@ -1479,6 +1489,8 @@ class EquipConsuPage extends Component {
// 返回备注以上的元素
renderListItem
()
{
let
{
listOptionData
,
dateModelPop
,
sysValues
}
=
this
.
state
const
isShowOrg
=
R
.
compose
(
R
.
equals
(
'Y'
),
R
.
prop
(
'OBS_SHOW_ORG_FLAG'
))(
this
.
props
.
sysProfiles
)
return
(
<
View
style
=
{
styles
.
list_cont
}
>
<
PageListArrow
...
...
@@ -1489,15 +1501,19 @@ class EquipConsuPage extends Component {
listDefaValue
=
{
'name'
}
listTitle
=
{
'title'
}
/
>
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
1
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleOrganizationCheck
(
listOptionData
[
1
])}
listHasArrow
=
{
true
}
/
>
{
isShowOrg
&&
(
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
1
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleOrganizationCheck
(
listOptionData
[
1
])}
listHasArrow
=
{
true
}
/
>
)
}
{
sysValues
.
OBS_MOBILE_CONSU_DEPARTMENT_DISPLAY
>
0
&&
(
<
PageListArrow
...
...
@@ -2055,6 +2071,7 @@ const mapStateToProps = (state) => {
equipOrderOption
:
state
.
equip
.
equipOrderOption
,
subDetOption
:
state
.
equip
.
subDetOption
,
charDetailOption
:
state
.
equip
.
charDetailOption
,
sysProfiles
:
state
.
login
.
sysProfiles
,
global_domain_config
:
state
.
login
.
global_domain_config
}
}
...
...
app/containers/historicalOrder/module/FilterModel.js
View file @
273c8399
...
...
@@ -333,6 +333,7 @@ class FilterModel extends Component {
this
.
getSellerName
()
this
.
initSelectPickerData
()
this
.
getSysConfigValue
()
this
.
getOrganizations
()
}
// 赋值销售员 初始化数据
...
...
@@ -442,6 +443,35 @@ class FilterModel extends Component {
R
.
compose
(
R
.
map
(
getSysProfile
),
R
.
keys
)(
sysValues
)
}
/**
* @description: 不显示组织的话一开始就请求
* @param {*}
* @return {*}
*/
async
getOrganizations
()
{
const
{
global_domain_config
,
token
,
sysProfiles
}
=
this
.
props
const
params
=
{
access_token
:
token
}
const
isShowOrg
=
R
.
compose
(
R
.
equals
(
'Y'
),
R
.
prop
(
'OBS_SHOW_ORG_FLAG'
))(
sysProfiles
)
if
(
isShowOrg
)
return
let
res
=
await
requestHistorOrganizations
(
global_domain_config
,
params
)
if
(
res
.
error_code
!==
0
)
return
const
organizations
=
R
.
pathOr
([],
[
'data'
,
'organizations'
])(
res
)
if
(
R
.
length
(
organizations
)
!==
1
)
return
const
orgCode
=
R
.
path
([
0
,
'org_code'
])(
organizations
)
const
{
borrowListOptionData
,
consumeListOptionData
,
transferListOptionData
}
=
this
.
state
borrowListOptionData
[
2
].
value
=
orgCode
consumeListOptionData
[
2
].
value
=
orgCode
transferListOptionData
[
2
].
value
=
orgCode
this
.
setState
({
borrowListOptionData
,
consumeListOptionData
,
transferListOptionData
})
}
// 修改选择器为属性 name 和 value
changeNameAndValue
(
data
,
nameType
,
valueType
)
{
let
result
=
[]
...
...
@@ -907,7 +937,7 @@ class FilterModel extends Component {
// 修改当前选择器数据
let
{
data
:
{
customers
}
}
=
orgResult
if
(
customers
.
length
===
0
)
{
//
show
(`当前客户名称为空`)
// (`当前客户名称为空`)
that
.
showErrorModel
(
`当前客户名称为空`
)
return
}
...
...
@@ -1776,6 +1806,8 @@ class FilterModel extends Component {
// 返回筛选
renderTopSelectItem
()
{
let
{
topActiveIndex
,
borrowListOptionData
,
consumeListOptionData
,
transferListOptionData
,
sysValues
,
sellers
}
=
this
.
state
const
isShowOrg
=
R
.
compose
(
R
.
equals
(
'Y'
),
R
.
prop
(
'OBS_SHOW_ORG_FLAG'
))(
this
.
props
.
sysProfiles
)
return
(
<
View
style
=
{
styles
.
sea_container
}
>
<
View
style
=
{
styles
.
sea_scr_box
}
>
...
...
@@ -1818,19 +1850,21 @@ class FilterModel extends Component {
// 兼容旧版本的
sysValues
.
OBS_MOBILE_COLL_DEPARTMENT
===
'Y'
&&
(
<>
<
View
style
=
{
styles
.
qui_cell
}
>
<
Text
style
=
{
styles
.
qui_cell_tit
}
>
组织
<
/Text
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
style
=
{
styles
.
qui_cell_rig
}
onPress
=
{()
=>
this
.
handleOrganizationCheck
()
}
>
<
Text
style
=
{
styles
.
cell_rig_sel
}
>
{
borrowListOptionData
[
2
].
name
}
<
/Text
>
<
View
style
=
{
styles
.
arr_icon_box
}
>
<
Image
source
=
{
require
(
'../../../images/arr_rig.png'
)}
style
=
{
icon_style
}
/
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
{
isShowOrg
&&
(
<
View
style
=
{
styles
.
qui_cell
}
>
<
Text
style
=
{
styles
.
qui_cell_tit
}
>
组织
<
/Text
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
style
=
{
styles
.
qui_cell_rig
}
onPress
=
{()
=>
this
.
handleOrganizationCheck
()
}
>
<
Text
style
=
{
styles
.
cell_rig_sel
}
>
{
borrowListOptionData
[
2
].
name
}
<
/Text
>
<
View
style
=
{
styles
.
arr_icon_box
}
>
<
Image
source
=
{
require
(
'../../../images/arr_rig.png'
)}
style
=
{
icon_style
}
/
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
)}
<
View
style
=
{
styles
.
qui_cell
}
>
<
Text
style
=
{
styles
.
qui_cell_tit
}
>
部门
<
/Text
>
<
TouchableOpacity
...
...
@@ -1907,19 +1941,23 @@ class FilterModel extends Component {
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
qui_cell
}
>
<
Text
style
=
{
styles
.
qui_cell_tit
}
>
组织
<
/Text
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
style
=
{
styles
.
qui_cell_rig
}
onPress
=
{()
=>
this
.
handleOrganizationCheck
()
}
>
<
Text
style
=
{
styles
.
cell_rig_sel
}
>
{
borrowListOptionData
[
2
].
name
}
<
/Text
>
<
View
style
=
{
styles
.
arr_icon_box
}
>
<
Image
source
=
{
require
(
'../../../images/arr_rig.png'
)}
style
=
{
icon_style
}
/
>
{
isShowOrg
&&
(
<
View
style
=
{
styles
.
qui_cell
}
>
<
Text
style
=
{
styles
.
qui_cell_tit
}
>
组织
<
/Text
>
<
TouchableOpacity
activeOpacity
=
{.
8
}
style
=
{
styles
.
qui_cell_rig
}
onPress
=
{()
=>
this
.
handleOrganizationCheck
()
}
>
<
Text
style
=
{
styles
.
cell_rig_sel
}
>
{
borrowListOptionData
[
2
].
name
}
<
/Text
>
<
View
style
=
{
styles
.
arr_icon_box
}
>
<
Image
source
=
{
require
(
'../../../images/arr_rig.png'
)}
style
=
{
icon_style
}
/
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
)
}
<
/
>
)
}
...
...
@@ -2843,7 +2881,8 @@ const mapStateToProps = (state) => {
userInfo
:
state
.
login
.
userInfo
,
token
:
state
.
login
.
token
,
loginState
:
state
.
login
.
loginState
,
global_domain_config
:
state
.
login
.
global_domain_config
global_domain_config
:
state
.
login
.
global_domain_config
,
sysProfiles
:
state
.
login
.
sysProfiles
,
}
}
...
...
app/containers/quickOrder/QuickOrderPage.js
View file @
273c8399
...
...
@@ -911,7 +911,7 @@ class EquipConsuPage extends Component {
let
orgResult
=
await
reqQuickOrganizations
(
global_domain_config
,
params
);
if
(
orgResult
.
error_code
==
0
)
{
let
{
data
:
{
organizations
}
}
=
orgResult
let
{
listOptionData
}
=
state
let
{
listOptionData
,
sysValues
}
=
state
// props.requestListDataSuccess(organizations)
let
filterOpt
=
dedupQuoteArray
(
organizations
,
'org_code'
)
if
(
filterOpt
.
length
===
0
)
{
...
...
@@ -925,9 +925,19 @@ class EquipConsuPage extends Component {
listOptionData
},
()
=>
{
that
.
organizationGetCustomerData
()
that
.
getDepartmentsByOrg
(
listOptionData
[
1
].
value
)
setTimeout
(()
=>
{
if
(
sysValues
.
OBS_MOBILE_DEPARTMENT_DISPLAY
>
0
)
{
that
.
getDepartmentsByOrg
(
listOptionData
[
1
].
value
)
}
},
1000
);
})
}
// 贵州需要不显示组织, 所以只能每个用户只能授权1个组织
const
isShowOrg
=
R
.
compose
(
R
.
equals
(
'Y'
),
R
.
prop
(
'OBS_SHOW_ORG_FLAG'
))(
this
.
props
.
sysProfiles
)
if
(
!
isShowOrg
&&
filterOpt
.
length
>
1
)
{
show
(
`请先选择组织`
)
}
}
else
{
this
.
showWarnError
(
orgResult
)
}
...
...
@@ -1648,6 +1658,8 @@ class EquipConsuPage extends Component {
// 返回备注以上的元素
renderListItem
()
{
let
{
listOptionData
,
dateModelPop
,
sysValues
}
=
this
.
state
const
isShowOrg
=
R
.
compose
(
R
.
equals
(
'Y'
),
R
.
prop
(
'OBS_SHOW_ORG_FLAG'
))(
this
.
props
.
sysProfiles
)
return
(
<
View
style
=
{
styles
.
list_cont
}
>
<
PageListArrow
...
...
@@ -1658,15 +1670,19 @@ class EquipConsuPage extends Component {
listDefaValue
=
{
'name'
}
listTitle
=
{
'title'
}
/
>
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
1
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleOrganizationCheck
(
listOptionData
[
1
])}
listHasArrow
=
{
true
}
/
>
{
isShowOrg
&&
(
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
1
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleOrganizationCheck
(
listOptionData
[
1
])}
listHasArrow
=
{
true
}
/
>
)
}
{
sysValues
.
OBS_MOBILE_DEPARTMENT_DISPLAY
>
1
&&
(
...
...
@@ -2021,7 +2037,8 @@ const mapStateToProps = (state) => {
quick_list_status
:
state
.
quick
.
quick_list_status
,
submit_quick_order_status
:
state
.
quick
.
submit_quick_order_status
,
quickOrderOption
:
state
.
quick
.
quickOrderOption
,
global_domain_config
:
state
.
login
.
global_domain_config
global_domain_config
:
state
.
login
.
global_domain_config
,
sysProfiles
:
state
.
login
.
sysProfiles
,
}
}
...
...
app/containers/selfOrder/SelfOrderPage.js
View file @
273c8399
...
...
@@ -805,7 +805,7 @@ class SelfOrderPage extends Component {
let
orgResult
=
await
reqSelfOrganizations
(
global_domain_config
,
params
);
if
(
orgResult
.
error_code
==
0
)
{
let
{
data
:
{
organizations
}
}
=
orgResult
let
{
listOptionData
}
=
state
let
{
listOptionData
,
sysValues
}
=
state
// props.requestListDataSuccess(organizations)
let
filterOpt
=
dedupQuoteArray
(
organizations
,
'org_code'
)
if
(
filterOpt
.
length
===
0
)
{
...
...
@@ -819,9 +819,19 @@ class SelfOrderPage extends Component {
listOptionData
},
()
=>
{
that
.
organizationGetCustomerData
()
that
.
getDepartmentsByOrg
(
listOptionData
[
1
].
value
)
setTimeout
(()
=>
{
if
(
sysValues
.
OBS_MOBILE_DEPARTMENT_DISPLAY
>
0
)
{
that
.
getDepartmentsByOrg
(
listOptionData
[
1
].
value
)
}
},
1000
);
})
}
// 贵州需要不显示组织, 所以只能每个用户只能授权1个组织
const
isShowOrg
=
R
.
compose
(
R
.
equals
(
'Y'
),
R
.
prop
(
'OBS_SHOW_ORG_FLAG'
))(
this
.
props
.
sysProfiles
)
if
(
!
isShowOrg
&&
filterOpt
.
length
>
1
)
{
show
(
`请先选择组织`
)
}
}
else
if
(
orgResult
.
error_code
==
41006
)
{
show
(
'登录过期,请重新登录'
);
props
.
exitLoginStatus
();
...
...
@@ -1860,6 +1870,8 @@ class SelfOrderPage extends Component {
// 返回备注以上的元素
renderListItem
()
{
let
{
listOptionData
,
dateModelPop
,
sysValues
}
=
this
.
state
const
isShowOrg
=
R
.
compose
(
R
.
equals
(
'Y'
),
R
.
prop
(
'OBS_SHOW_ORG_FLAG'
))(
this
.
props
.
sysProfiles
)
return
(
<
View
style
=
{
styles
.
list_cont
}
>
<
PageListArrow
...
...
@@ -1870,15 +1882,19 @@ class SelfOrderPage extends Component {
listDefaValue
=
{
'name'
}
listTitle
=
{
'title'
}
/
>
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
1
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleOrganizationCheck
(
listOptionData
[
1
])}
listHasArrow
=
{
true
}
/
>
{
isShowOrg
&&
(
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
1
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleOrganizationCheck
(
listOptionData
[
1
])}
listHasArrow
=
{
true
}
/
>
)
}
{
sysValues
.
OBS_MOBILE_DEPARTMENT_DISPLAY
>
1
&&
(
<
PageListArrow
...
...
@@ -2372,7 +2388,8 @@ const mapStateToProps = (state) => {
submit_self_order_status
:
state
.
selfOrder
.
submit_self_order_status
,
selfOrderOption
:
state
.
selfOrder
.
selfOrderOption
,
global_domain_config
:
state
.
login
.
global_domain_config
,
local_sele_pro_options
:
state
.
selfOrder
.
local_sele_pro_options
local_sele_pro_options
:
state
.
selfOrder
.
local_sele_pro_options
,
sysProfiles
:
state
.
login
.
sysProfiles
}
}
...
...
app/containers/transOrder/TransOrderPage.js
View file @
273c8399
...
...
@@ -502,7 +502,7 @@ class TransOrderPage extends Component {
// 清空当前项以下的值
clearInitNameAndValue
(
startIndex
,
endIndex
=
5
)
{
let
{
listOptionData
,
localOtherObj
}
=
this
.
state
let
{
listOptionData
,
localOtherObj
,
sysValues
}
=
this
.
state
let
that
=
this
this
.
setState
({
listOptionData
:
listOptionData
.
map
(
async
(
item
,
index
)
=>
{
...
...
@@ -510,7 +510,9 @@ class TransOrderPage extends Component {
item
.
name
=
localOtherObj
.
name
item
.
value
=
localOtherObj
.
value
if
(
listOptionData
[
1
].
value
&&
item
.
title
==
'客户名称'
)
{
await
that
.
getDepartmentsByOrg
(
listOptionData
[
1
].
value
)
if
(
sysValues
.
OBS_MOBILE_TRANS_DEPARTMENT_DISPLAY
>
0
)
{
that
.
getDepartmentsByOrg
(
listOptionData
[
1
].
value
)
}
setTimeout
(()
=>
{
that
.
organizationGetCustomerData
()
},
0
);
...
...
@@ -687,7 +689,7 @@ class TransOrderPage extends Component {
let
orgResult
=
await
reqTransOrganizations
(
global_domain_config
,
params
);
if
(
orgResult
.
error_code
==
0
)
{
let
{
data
:
{
organizations
}
}
=
orgResult
let
{
listOptionData
}
=
state
let
{
listOptionData
,
sysValues
}
=
state
// props.requestListDataSuccess(organizations)
let
filterOpt
=
dedupQuoteArray
(
organizations
,
'org_code'
)
if
(
filterOpt
.
length
===
0
)
{
...
...
@@ -700,12 +702,20 @@ class TransOrderPage extends Component {
that
.
setState
({
listOptionData
},
async
()
=>
{
await
that
.
getDepartmentsByOrg
(
listOptionData
[
1
].
value
)
setTimeout
(()
=>
{
that
.
organizationGetCustomerData
()
},
0
);
if
(
sysValues
.
OBS_MOBILE_TRANS_DEPARTMENT_DISPLAY
>
0
)
{
that
.
getDepartmentsByOrg
(
listOptionData
[
1
].
value
)
}
},
1000
)
})
}
// 贵州需要不显示组织, 所以只能每个用户只能授权1个组织
const
isShowOrg
=
R
.
compose
(
R
.
equals
(
'Y'
),
R
.
prop
(
'OBS_SHOW_ORG_FLAG'
))(
this
.
props
.
sysProfiles
)
if
(
!
isShowOrg
&&
filterOpt
.
length
>
1
)
{
show
(
`请先选择组织`
)
}
}
else
{
this
.
showWarnError
(
orgResult
)
}
...
...
@@ -1311,6 +1321,8 @@ class TransOrderPage extends Component {
// 返回备注以上的元素
renderListItem
()
{
let
{
listOptionData
,
sysValues
}
=
this
.
state
const
isShowOrg
=
R
.
compose
(
R
.
equals
(
'Y'
),
R
.
prop
(
'OBS_SHOW_ORG_FLAG'
))(
this
.
props
.
sysProfiles
)
return
(
<
View
style
=
{
styles
.
list_cont
}
>
<
PageListArrow
...
...
@@ -1321,15 +1333,19 @@ class TransOrderPage extends Component {
listDefaValue
=
{
'name'
}
listTitle
=
{
'title'
}
/
>
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
1
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleOrganizationCheck
(
listOptionData
[
1
])}
listHasArrow
=
{
true
}
/
>
{
isShowOrg
&&
(
<
PageListArrow
listActOpa
=
{.
8
}
listHasAster
=
{
true
}
listItem
=
{
listOptionData
[
1
]}
listName
=
{
'name'
}
listTitle
=
{
'title'
}
listCallBack
=
{()
=>
this
.
handleOrganizationCheck
(
listOptionData
[
1
])}
listHasArrow
=
{
true
}
/
>
)
}
{
sysValues
.
OBS_MOBILE_TRANS_DEPARTMENT_DISPLAY
>
1
&&
(
<
PageListArrow
...
...
@@ -1737,7 +1753,8 @@ const mapStateToProps = (state) => {
submit_trans_order_status
:
state
.
trans
.
submit_trans_order_status
,
transOrderOption
:
state
.
trans
.
transOrderOption
,
subTransDetOption
:
state
.
trans
.
subTransDetOption
,
global_domain_config
:
state
.
login
.
global_domain_config
global_domain_config
:
state
.
login
.
global_domain_config
,
sysProfiles
:
state
.
login
.
sysProfiles
,
}
}
...
...
app/reducers/module/login.js
View file @
273c8399
...
...
@@ -8,7 +8,8 @@ import {
AUTO_LOGIN_FAILURE
,
SET_DOMAIN_CONFIGURATE
,
SET_VERSION_APK
,
SET_DOMAIN_FROM_ORIGIN
SET_DOMAIN_FROM_ORIGIN
,
SET_SYSPROFILE
}
from
'../../base/ActionTypes'
;
// 登录状态
...
...
@@ -21,9 +22,14 @@ const defaultState = {
global_domain_config
:
'https://obs.uat.guke.tech'
,
hasSetDomainFromOrigin
:
false
,
local_version_apk
:
''
,
// 默认【深圳仓】https://obs.uat.guke.tech;【十方uat】https://obs.uat.sfrx.guke.tech;【十方pro】https://obs.sfrx.orth.tech
// 【国药dev】https://obs.dev.guke.tech;【国药pro】https://obs-pro.gyjtsx.com
// 【国药uat】https://obs-dev.gyjtsx.com
originSysProfiles
:
{
OBS_SHOW_ORG_FLAG
:
'Y'
,
SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG
:
'Y'
},
sysProfiles
:
{
OBS_SHOW_ORG_FLAG
:
'Y'
,
SUR_MOBILE_HISTORY_SALE_PRICE_SHOW_FLAG
:
'Y'
}
}
export
default
login
=
(
state
=
defaultState
,
action
)
=>
{
...
...
@@ -73,6 +79,13 @@ export default login = (state = defaultState, action) => {
return
Object
.
assign
({},
state
,
{
local_version_apk
:
action
.
local_version_apk
})
case
SET_SYSPROFILE
:
return
Object
.
assign
({},
state
,
{
sysProfiles
:
{
...
state
.
sysProfiles
,
[
action
.
code
]:
action
.
value
}
})
default
:
// need this for default case
return
state
}
...
...
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