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
843e1828
authored
Jul 08, 2021
by
peii
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加部门信息
parent
ec53b230
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
235 additions
and
8 deletions
app/containers/equipConsu/module/OrdersPage.js
src/pages/order/quick.tsx
src/stores/organization.ts
app/containers/equipConsu/module/OrdersPage.js
0 → 100644
View file @
843e1828
/*
* @FilePath: /BoneHouse_Business_APP/app/containers/equipConsu/module/OrdersPage.js
* @Author: peii
* @Date: 2021-07-06 15:29:45
* @LastEditTime: 2021-07-06 18:12:29
* @LastEditors: peii
* @Vision: 1.0
* @Description:
*/
import
React
,
{
Component
}
from
'react'
import
{
View
,
Text
,
StyleSheet
,
SafeAreaView
,
ScrollView
,
TouchableOpacity
,
FlatList
}
from
'react-native'
import
{
home_background_color
,
promary_color
,
safe_view
,
icon_style
,
placehold_text_color
,
first_text_color
,
font_family_regular
,
pxSize
,
list_common_item
,
}
from
'../../../base/BaseStyle'
import
StatusBarView
from
'../../common/StatusBarView'
import
HeadBackItem
from
'../../common/HeadBackItem'
import
{
isBlank
,
isNotBlank
,
changeDateFormat
}
from
'../../../utils/Utils'
import
*
as
R
from
'ramda'
export
default
class
CollectOrder
extends
Component
{
state
=
{}
constructor
(
props
)
{
super
(
props
)
this
.
renderItem
=
this
.
renderItem
.
bind
(
this
)
this
.
selectHandler
=
this
.
selectHandler
.
bind
(
this
)
}
/**
* @description: 选择操作
* @param {*} item
* @return {*}
*/
selectHandler
(
item
)
{
const
{
navigation
}
=
this
.
props
const
{
selectCallback
}
=
navigation
.
state
.
params
selectCallback
&&
selectCallback
(
item
)
navigation
.
goBack
()
}
/**
* @description: 渲染单个
* @param {*} item
* @param {*} index
* @return {*}
*/
renderItem
({
item
,
index
})
{
return
(
<
TouchableOpacity
style
=
{
styles
.
item
}
activeOpacity
=
{
0.8
}
onPress
=
{()
=>
this
.
selectHandler
(
item
)}
>
<
Text
style
=
{
styles
.
item_text
}
>
借货订单号
:
{
item
.
collect_number
}
<
/Text
>
<
Text
style
=
{
styles
.
item_text
}
>
业务员
:
{
item
.
seller_name
||
'无'
}
<
/Text
>
<
Text
style
=
{
styles
.
item_text
}
>
主治医生
:
{
item
.
doctor_name
||
'无'
}
<
/Text
>
<
Text
style
=
{
styles
.
item_text
}
>
手术日期
:
{(
item
.
surgery_date
&&
changeDateFormat
(
item
.
surgery_date
,
'yyyy-MM-dd'
))
||
'无'
}
<
/Text
>
<
Text
style
=
{
styles
.
item_text
}
>
手术说明
:
{
item
.
surgery_desc
||
'无'
}
<
/Text
>
{
!!
item
.
remark
&&
(
<
Text
style
=
{
styles
.
item_text
}
numberOfLines
=
{
3
}
>
{
item
.
remark
}
<
/Text
>
)}
<
/TouchableOpacity
>
)
}
render
()
{
const
{
navigation
}
=
this
.
props
const
{
orders
,
title
}
=
navigation
.
state
.
params
return
(
<
View
style
=
{
styles
.
container
}
>
<
StatusBarView
isReactStackNavigator
=
{
true
}
backgroundColor
=
{
promary_color
}
barStyle
=
"light-content"
/>
<
View
style
=
{
safe_view
}
>
<
HeadBackItem
title
=
{
title
}
navigation
=
{
navigation
}
/
>
<
FlatList
style
=
{
styles
.
list
}
data
=
{
orders
}
renderItem
=
{
this
.
renderItem
}
keyExtractor
=
{
item
=>
item
.
collect_number
}
/
>
<
/View
>
<
/View
>
)
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
backgroundColor
:
home_background_color
,
},
list
:
{
flex
:
1
,
padding
:
16
,
marginBottom
:
16
,
},
item
:
{
marginBottom
:
16
,
padding
:
15
,
backgroundColor
:
'#fff'
,
},
item_text
:
{
fontSize
:
16
,
fontFamily
:
font_family_regular
,
},
})
src/pages/order/quick.tsx
View file @
843e1828
...
...
@@ -52,6 +52,8 @@ type IProps = {
getDepartmentsBySellerAndOrg
:
Function
departments
:
Function
followers
:
Function
businessManagers
:
Function
delivermen
:
Function
}
orderStore
:
{
surgeryTemplates
:
[]
...
...
@@ -196,8 +198,6 @@ class QuickOrder extends Component<IProps> {
componentDidMount
()
{
this
.
setOptionsFormItems
()
console
.
log
(
toJS
(
this
.
props
.
sysStore
.
sysValueSets
.
ORTHOPEDICS_PRODUCT_CLASS
))
}
/**
...
...
@@ -220,6 +220,7 @@ class QuickOrder extends Component<IProps> {
options
:
[],
rules
:
[{
required
:
dep
.
required
,
message
:
'请选择客户'
}],
refrence
:
[
'orgCode'
],
callback
:
this
.
setDepartmentCallback
.
bind
(
this
),
},
formItems
,
)
...
...
@@ -228,16 +229,55 @@ class QuickOrder extends Component<IProps> {
// 业务经理(00)第一位显示、第二位必需
let
businessManager
=
translateSysprofile
(
sysProfiles
.
OBS_MOBILE_DEPARTMENT_DISPLAY
)
if
(
businessManager
.
show
)
{
formItems
=
R
.
insert
(
3
,
{
field
:
'businessManagerCode'
,
label
:
'业务经理'
,
type
:
FieldType
.
SELECT
,
placeholder
:
'请选择'
,
options
:
[],
rules
:
[{
required
:
businessManager
.
required
,
message
:
'请选择业务经理'
}],
refrence
:
[
'orgCode'
,
'departmentCode'
],
},
formItems
,
)
}
// 跟台员(00)第一位显示、第二位必需
let
follower
=
translateSysprofile
(
sysProfiles
.
OBS_MOBILE_SUR_FOLLOWER_DISPLAY
)
if
(
follower
.
show
)
{
formItems
=
R
.
insert
(
4
,
{
field
:
'surgeryFollowerCode'
,
label
:
'跟台员'
,
type
:
FieldType
.
SELECT
,
placeholder
:
'请选择'
,
options
:
[],
rules
:
[{
required
:
follower
.
required
,
message
:
'请选择跟台员'
}],
refrence
:
[
'orgCode'
,
'departmentCode'
],
},
formItems
,
)
}
// 送货员(00)第一位显示、第二位必需
let
deliver
=
translateSysprofile
(
sysProfiles
.
OBS_MOBILE_DELIVERYMAN_DISPLAY
)
if
(
deliver
.
show
)
{
formItems
=
R
.
insert
(
5
,
{
field
:
'deliverymanCode'
,
label
:
'送货员'
,
type
:
FieldType
.
SELECT
,
placeholder
:
'请选择'
,
options
:
[],
rules
:
[{
required
:
follower
.
required
,
message
:
'请选择送货员'
}],
refrence
:
[
'orgCode'
,
'departmentCode'
],
},
formItems
,
)
}
this
.
setState
({
formItems
})
...
...
@@ -268,7 +308,7 @@ class QuickOrder extends Component<IProps> {
*/
async
setOrgCallback
()
{
const
sysProfiles
=
this
.
props
.
sysStore
.
sysProfiles
const
{
show
,
required
}
=
translateSysprofile
(
sysProfiles
.
OBS_MOBILE_DEPARTMENT_DISPLAY
)
const
{
show
}
=
translateSysprofile
(
sysProfiles
.
OBS_MOBILE_DEPARTMENT_DISPLAY
)
if
(
show
)
{
this
.
getDepartments
.
call
(
this
)
}
...
...
@@ -297,6 +337,36 @@ class QuickOrder extends Component<IProps> {
}
/**
* @description: 设置部门后回调
* @param {*}
* @return {*}
*/
async
setDepartmentCallback
()
{
const
{
data
,
formItems
}
=
this
.
state
const
{
orgCode
,
sellerCode
,
departmentCode
}
=
data
// 设置业务经理
const
bmItem
=
getFormItem
(
formItems
,
'businessManagerCode'
)
if
(
isNotBlank
(
bmItem
))
{
bmItem
.
options
=
this
.
props
.
orgStore
.
businessManagers
(
sellerCode
,
orgCode
,
departmentCode
)
}
// 设置跟台员
const
followerItem
=
getFormItem
(
formItems
,
'surgeryFollowerCode'
)
if
(
isNotBlank
(
followerItem
))
{
followerItem
.
options
=
this
.
props
.
orgStore
.
followers
(
sellerCode
,
orgCode
,
departmentCode
)
}
// 设置送货员
const
item
=
getFormItem
(
formItems
,
'deliverymanCode'
)
if
(
isNotBlank
(
item
))
{
item
.
options
=
this
.
props
.
orgStore
.
delivermen
(
sellerCode
,
orgCode
,
departmentCode
)
}
this
.
setState
({
formItems
})
}
/**
* @description: 获取客户列表
* @param {*}
* @return {*}
...
...
@@ -375,9 +445,9 @@ class QuickOrder extends Component<IProps> {
const
item
=
getFormItem
(
formItems
,
'templateCollectNumber'
)
let
templates
=
this
.
props
.
orderStore
.
surgeryTemplates
// if (isBlank(templates)) {
item
.
loading
=
true
await
this
.
props
.
orderStore
.
getTemplates
(
sellerCode
,
orgCode
,
customerCode
,
surgeryType
,
doctorName
)
item
.
loading
=
false
item
.
loading
=
true
await
this
.
props
.
orderStore
.
getTemplates
(
sellerCode
,
orgCode
,
customerCode
,
surgeryType
,
doctorName
)
item
.
loading
=
false
// }
// templates = this.props.orderStore.surgeryTemplates
...
...
src/stores/organization.ts
View file @
843e1828
...
...
@@ -172,7 +172,28 @@ export default class Organization {
}
/**
* @description: 跟台员
* @description: 业务经理
* @param {string} sellerCode
* @param {string} orgCode
* @param {string} departmentCode
* @return {*}
*/
businessManagers
(
sellerCode
:
string
,
orgCode
:
string
,
departmentCode
:
string
)
{
const
deps
=
this
.
_departments
[
`
${
sellerCode
}
_
${
orgCode
}
`
]
||
[]
const
dep
=
R
.
find
(
R
.
propEq
(
'departmentCode'
,
departmentCode
))(
deps
)
return
R
.
compose
(
R
.
map
(
R
.
applySpec
({
label
:
R
.
prop
(
'businessManagerName'
),
value
:
R
.
prop
(
'businessManagerCode'
),
}),
),
R
.
propOr
([],
'businessManagerList'
),
)(
dep
)
}
/**
* @description: 跟台员列表
* @param {string} sellerCode
* @param {string} orgCode
* @param {string} departmentCode
...
...
@@ -192,6 +213,27 @@ export default class Organization {
)(
dep
)
}
/**
* @description: 送货员列表
* @param {string} sellerCode
* @param {string} orgCode
* @param {string} departmentCode
* @return {*}
*/
delivermen
(
sellerCode
:
string
,
orgCode
:
string
,
departmentCode
:
string
)
{
const
deps
=
this
.
_departments
[
`
${
sellerCode
}
_
${
orgCode
}
`
]
||
[]
const
dep
=
R
.
find
(
R
.
propEq
(
'departmentCode'
,
departmentCode
))(
deps
)
return
R
.
compose
(
R
.
map
(
R
.
applySpec
({
label
:
R
.
prop
(
'deliverymanName'
),
value
:
R
.
prop
(
'deliverymanCode'
),
}),
),
R
.
propOr
([],
'deliverymanList'
),
)(
dep
)
}
@
action
resetCustomers
()
{
this
.
_customers
=
{}
...
...
@@ -204,7 +246,7 @@ export default class Organization {
getOrganizations
=
flow
(
function
*
(
this
:
Organization
)
{
const
res
=
yield
this
.
service
.
getOrganizations
()
if
(
res
.
errorCode
)
return
this
.
organizations
=
R
.
compose
(
R
.
uniqBy
(
R
.
prop
(
'orgCode'
)),
R
.
pathOr
([],
[
'data'
,
'organizations'
]))(
res
)
this
.
inventories
=
res
.
data
.
inventories
})
...
...
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