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
d7704f9d
authored
Jun 01, 2021
by
wong.peiyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
快速下单
parent
c45a3cef
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
254 additions
and
11 deletions
src/components/form/index.tsx
src/components/form/select.tsx
src/enums/index.ts
src/pages/index/index.tsx
src/pages/order/quick.styl
src/pages/order/quick.tsx
src/router.tsx
src/stores/organization.ts
src/components/form/index.tsx
View file @
d7704f9d
...
...
@@ -25,7 +25,6 @@ import { ActivityIndicator } from '@ant-design/react-native'
type
IProps
=
{
fields
:
IFromField
[]
data
:
{
[
key
:
string
]:
any
}
modalCallback
:
Function
}
const
formComponents
=
{
...
...
@@ -46,7 +45,6 @@ export default class Form extends Component<IProps> {
componentDidMount
()
{
this
.
onChange
=
this
.
onChange
.
bind
(
this
)
this
.
modalCallback
=
this
.
modalCallback
.
bind
(
this
)
this
.
checkCanSubmit
=
debounce
(
this
.
checkCanSubmit
.
bind
(
this
))
this
.
submitHandler
=
debounce
(
this
.
submitHandler
.
bind
(
this
),
500
)
}
...
...
@@ -126,7 +124,7 @@ export default class Form extends Component<IProps> {
data=
{
data
}
fields=
{
fields
}
onChange=
{
this
.
onChange
}
modalCallback=
{
this
.
modalCallback
}
modalCallback=
{
this
.
modalCallback
.
bind
(
this
)
}
/>
)
})
}
...
...
src/components/form/select.tsx
View file @
d7704f9d
...
...
@@ -50,10 +50,6 @@ export default class Select extends Component<IProps> {
this
.
onChange
=
this
.
onChange
.
bind
(
this
)
}
shouldComponentUpdate
(
nextProps
:
IProps
)
{
return
true
}
componentWillReceiveProps
(
nextProps
,
nextState
)
{
const
{
item
,
value
}
=
nextProps
const
{
visible
,
loading
}
=
this
.
state
...
...
src/enums/index.ts
View file @
d7704f9d
...
...
@@ -23,5 +23,6 @@ export enum FieldType {
CHECKBOX
,
RADIO
,
IMAGE
,
CUSTOM
VOICE
,
CUSTOM
,
}
src/pages/index/index.tsx
View file @
d7704f9d
...
...
@@ -72,8 +72,8 @@ class Index extends Component<IProps> {
*/
navigateToBizPage
(
fun
:
IFunction
)
{
const
pages
=
{
MOBILE_BORROW_ORDER
:
''
,
MOBILE_SELF_HELP_ORDER
:
'
Success
'
,
MOBILE_BORROW_ORDER
:
'
QuickOrder
'
,
MOBILE_SELF_HELP_ORDER
:
''
,
MOBILE_CONSUMP_CONFIRMA
:
'Consume'
,
MOBILE_DEVICE_INFORMATION
:
''
,
MOBILE_TRANSFER_APPLICATION
:
''
,
...
...
src/pages/order/quick.styl
View file @
d7704f9d
@import '../../assets/styles/base.styl'
@import '../../assets/styles/variable.styl'
src/pages/order/quick.tsx
View file @
d7704f9d
/*
* @FilePath: /BoneHouse_Business_APP/src/pages/order/quick.tsx
* @Author: peii
* @Date: 2021-05-30 14:38:19
* @Vision: 1.0
* @Description: 快速下单页面
*
* @Revision:
*
*/
import
React
,
{
Component
}
from
'react'
import
{
View
,
Text
,
ScrollView
}
from
'react-native'
import
{
inject
,
observer
}
from
'mobx-react'
import
{
toJS
}
from
'mobx'
import
{
IOrganization
,
ISurgeryCollectHeader
,
IFee
}
from
'bonehouse'
import
*
as
R
from
'ramda'
import
Form
from
'../../components/form'
import
{
FieldType
}
from
'../../enums'
import
Header
from
'../../components/header/header'
import
{
g
,
getFormItem
,
isBlank
,
isNotBlank
,
show
}
from
'../../utils/utils'
import
styles
from
'./quick.styl'
type
IProps
=
{
sysStore
:
{
sysProfiles
:
{
// APP下单是否显示部门权限
OBS_MOBILE_DEPARTMENT_DISPLAY
:
string
// APP下单是否显示业务经理权限
OBS_MOBILE_BM_DISPLAY
:
string
// APP下单是否显示跟台员权限
OBS_MOBILE_SUR_FOLLOWER_DISPLAY
:
string
// APP下单是否显示送货员权限
OBS_MOBILE_DELIVERYMAN_DISPLAY
:
string
}
}
userStore
:
{
userName
:
string
personName
:
string
}
orgStore
:
{
organizations
:
IOrganization
[]
orgs
:
Function
getCustomers
:
Function
customers
:
Function
getDepartmentsBySellerAndOrg
:
Function
departments
:
Function
followers
:
Function
}
}
class
QuickOrder
extends
Component
<
IProps
>
{
constructor
(
props
)
{
super
(
props
)
this
.
setData
=
this
.
setData
.
bind
(
this
)
this
.
submitHandler
=
this
.
submitHandler
.
bind
(
this
)
}
state
=
{
data
:
{
sellerCode
:
this
.
props
.
userStore
.
userName
,
},
formItems
:
[
{
field
:
'sellerCode'
,
label
:
'销售员'
,
type
:
FieldType
.
SELECT
,
options
:
[
{
label
:
this
.
props
.
userStore
.
personName
,
value
:
this
.
props
.
userStore
.
userName
,
},
],
placeholder
:
'请选择'
,
rules
:
[{
required
:
true
,
message
:
'请选择销售员'
}],
disabled
:
true
,
},
{
field
:
'orgCode'
,
label
:
'组织'
,
type
:
FieldType
.
SELECT
,
options
:
this
.
props
.
orgStore
.
orgs
(),
placeholder
:
'请选择'
,
rules
:
[{
required
:
true
,
message
:
'请选择组织'
}],
callback
:
this
.
setOrgCallback
.
bind
(
this
),
},
{
field
:
'customerCode'
,
label
:
'客户'
,
type
:
FieldType
.
SELECT
,
options
:
[],
placeholder
:
'请选择'
,
rules
:
[{
required
:
true
,
message
:
'请选择客户'
}],
refrence
:
[
'orgCode'
],
callback
:
this
.
setCustomerCallback
.
bind
(
this
),
},
{
field
:
'billToSiteCode'
,
label
:
'收单地点'
,
type
:
FieldType
.
SELECT
,
options
:
[],
placeholder
:
'请选择'
,
rules
:
[{
required
:
true
,
message
:
'请选择收单地点'
}],
refrence
:
[
'orgCode'
,
'customerCode'
],
callback
:
this
.
setCustomerCallback
.
bind
(
this
),
},
{
field
:
'shipToSiteCode'
,
label
:
'收货地点'
,
type
:
FieldType
.
SELECT
,
options
:
[],
placeholder
:
'请选择'
,
rules
:
[{
required
:
true
,
message
:
'请选择收货地点'
}],
refrence
:
[
'orgCode'
,
'customerCode'
],
// callback: this.setCustomerCallback.bind(this),
},
{
field
:
'doctorName'
,
label
:
'主治医生'
,
type
:
FieldType
.
SELECT
,
options
:
[],
placeholder
:
'请选择'
,
rules
:
[{
required
:
true
,
message
:
'请选择主治医生'
}],
refrence
:
[
'orgCode'
,
'customerCode'
],
// callback: this.setCustomerCallback.bind(this),
},
{
field
:
'surgeryTypeName'
,
label
:
'手术类型'
,
type
:
FieldType
.
SELECT
,
options
:
[],
placeholder
:
'请选择'
,
rules
:
[],
refrence
:
[
'orgCode'
,
'customerCode'
],
// callback: this.setCustomerCallback.bind(this),
},
{
field
:
'templateCollectNumber'
,
label
:
'手术模板'
,
type
:
FieldType
.
SELECT
,
options
:
[],
placeholder
:
'请选择'
,
rules
:
[{
required
:
true
,
message
:
'请选择手术模板'
}],
refrence
:
[
'orgCode'
,
'customerCode'
],
},
{
field
:
'surgeryDate'
,
label
:
'手术时间'
,
type
:
FieldType
.
DATE
,
dateMode
:
'datetime'
,
placeholder
:
'请选择'
,
rules
:
[{
required
:
true
,
message
:
'请选择手术时间'
}],
refrence
:
[
'orgCode'
],
},
{
field
:
'orderTypeCode'
,
label
:
'订单类型'
,
type
:
FieldType
.
SELECT
,
placeholder
:
'请选择'
,
rules
:
[{
required
:
true
,
message
:
'请选择订单类型'
}],
refrence
:
[
'orgCode'
],
},
{
field
:
'surgeryDesc'
,
label
:
'备注'
,
type
:
FieldType
.
TEXT
,
placeholder
:
'请输入备注'
,
multiline
:
true
,
rules
:
[],
},
{
field
:
'voiceUrl'
,
label
:
'录音'
,
type
:
FieldType
.
VOICE
,
placeholder
:
'还有什么要安排的,可录音备注哟!'
,
},
],
}
componentDidMount
()
{
this
.
setOptionsFormItems
()
}
/**
* @description: 设置配置性的表单字段
*/
setOptionsFormItems
()
{
const
{
sysProfiles
}
=
this
.
props
.
sysStore
}
/**
* @description: 设置修改值
* @param {*} key
* @param {*} vlaue
* @return {*}
*/
setData
(
key
:
string
,
value
:
any
)
{
return
new
Promise
<
any
>
((
resolve
,
reject
)
=>
{
const
{
data
,
formItems
}
=
this
.
state
data
[
key
]
=
value
this
.
setState
({
data
},
()
=>
{
const
item
=
getFormItem
(
formItems
,
key
)
item
&&
item
.
callback
&&
item
.
callback
()
resolve
()
})
})
}
setOrgCallback
()
{}
setCustomerCallback
()
{}
submitHandler
()
{}
render
()
{
const
{
formItems
,
data
}
=
this
.
state
const
{
navigation
}
=
this
.
props
const
title
=
navigation
.
getParam
(
'title'
,
'骨科智慧仓'
)
return
(
<
View
style=
{
g
(
styles
,
'container'
,
'bg-gray'
)
}
>
<
Header
title=
{
title
}
backCallback=
{
()
=>
{
navigation
.
goBack
()
}
}
/>
{
/* form表单 */
}
<
Form
fields=
{
formItems
}
data=
{
data
}
onChange=
{
this
.
setData
}
ref=
{
ref
=>
(
this
.
formRef
=
ref
)
}
submitHandler=
{
this
.
submitHandler
}
/>
</
View
>
)
}
}
export
default
inject
(
'sysStore'
,
'userStore'
,
'orgStore'
)(
observer
(
QuickOrder
))
src/router.tsx
View file @
d7704f9d
...
...
@@ -14,6 +14,7 @@ import Signin from './pages/signin/signin'
import
Consume
from
'./pages/consume/consume'
import
Consumables
from
'./pages/consume/consumables'
import
ConsumeFee
from
'./pages/consume/fee'
import
QuickOrder
from
'./pages/order/quick'
import
Success
from
'./pages/success/success'
function
createNavigator
()
{
...
...
@@ -89,6 +90,7 @@ function createNavigator() {
Consume
:
{
screen
:
Consume
},
Consumables
:
{
screen
:
Consumables
},
ConsumeFee
:
{
screen
:
ConsumeFee
},
QuickOrder
:
{
screen
:
QuickOrder
},
Success
:
{
screen
:
Success
},
},
{
initialRouteName
:
'Main'
,
...
options
},
...
...
src/stores/organization.ts
View file @
d7704f9d
...
...
@@ -108,7 +108,10 @@ export default class Organization {
*/
getOrganizations
=
flow
(
function
*
(
this
:
Organization
)
{
const
res
=
yield
this
.
service
.
getOrganizations
()
this
.
organizations
=
res
.
data
.
organizations
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