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
e6f90090
authored
Jul 14, 2021
by
peii
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
快速下单和消耗确认小调整
parent
a124115d
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
181 additions
and
46 deletions
src/components/form/image.styl
src/components/form/image.tsx
src/components/form/index.styl
src/pages/consume/consumables.tsx
src/pages/consume/consume.tsx
src/pages/order/quick.tsx
src/services/service.ts
src/stores/order.ts
src/components/form/image.styl
View file @
e6f90090
...
...
@@ -14,7 +14,6 @@
width 378px
height 172px
background-color rgba(255, 255, 255, 1)
padding 16px
&__inner
width 378px
...
...
@@ -28,8 +27,9 @@
border-radius 6px
background-color rgba(255, 255, 255, 1)
border 1px solid rgba(221, 221, 221, 1)
margin-bottom 15px
margin-right 15px
margin 15px
margin-right 0
z-index 99
@extend .center
@extend .middle
...
...
src/components/form/image.tsx
View file @
e6f90090
import
React
,
{
Component
}
from
'react'
import
{
View
,
Text
,
Image
,
TouchableOpacity
,
ScrollView
,
Alert
,
Linking
,
Platform
,
}
from
'react-native'
// @ts-nocheck
import
React
from
'react'
import
{
View
,
Text
,
Image
,
TouchableOpacity
,
ScrollView
,
Alert
,
Linking
,
Platform
}
from
'react-native'
import
{
IFormField
,
IOption
}
from
'bonehouse'
import
*
as
R
from
'ramda'
import
ImagePicker
from
'react-native-image-picker'
...
...
@@ -72,10 +64,7 @@ export default class ImageForm extends React.Component<IProps> {
if
(
res
.
error
)
{
const
errMsgs
=
[
'Camera permissions not granted'
,
'Photo library permissions not granted'
]
const
errTips
=
[
'APP需要使用相机,请打开相机权限允许APP使用'
,
'APP需要使用相册,请打开相册权限允许APP使用'
,
]
const
errTips
=
[
'APP需要使用相机,请打开相机权限允许APP使用'
,
'APP需要使用相册,请打开相册权限允许APP使用'
]
for
(
const
[
idx
,
msg
]
of
Object
.
entries
(
errMsgs
))
{
if
(
R
.
indexOf
(
res
.
error
,
msg
)
>
-
1
)
{
...
...
@@ -104,8 +93,8 @@ export default class ImageForm extends React.Component<IProps> {
const
formData
=
new
FormData
()
let
file
=
{
uri
:
source
,
type
:
'multipart/form-data'
,
name
:
res
.
fileName
}
formData
.
append
(
'file'
,
file
)
const
loading
=
Toast
.
show
(
'上传中'
,
{
duration
:
60000
,
position
:
Toast
.
positions
.
CENTER
})
try
{
const
loading
=
Toast
.
show
(
'上传中'
,
{
duration
:
60000
,
position
:
Toast
.
positions
.
CENTER
})
const
result
=
await
service
.
uploadImg
(
formData
)
Toast
.
hide
(
loading
)
...
...
src/components/form/index.styl
View file @
e6f90090
...
...
@@ -68,6 +68,7 @@
&__multi
text-align left
flex 1
width 100%
.red
color #f00
...
...
src/pages/consume/consumables.tsx
View file @
e6f90090
...
...
@@ -5,9 +5,8 @@
* @Vision: 1.0
* @Description: 借货订单明细页面
*
* @Revision:
*
*/
// @ts-nocheck
import
React
,
{
Component
}
from
'react'
import
{
View
,
...
...
@@ -19,7 +18,7 @@ import {
TouchableOpacity
,
}
from
'react-native'
import
{
inject
,
observer
}
from
'mobx-react'
import
{
I
FormField
,
I
SurgeryCollectLine
}
from
'bonehouse'
import
{
ISurgeryCollectLine
}
from
'bonehouse'
import
*
as
R
from
'ramda'
import
dayjs
from
'dayjs'
import
{
ConsumablesModal
}
from
'./components/consumables-modal'
...
...
src/pages/consume/consume.tsx
View file @
e6f90090
...
...
@@ -517,7 +517,7 @@ class Consume extends Component<IProps> {
}
render
()
{
const
{
formItems
,
data
,
scrollable
}
=
this
.
state
const
{
formItems
,
data
}
=
this
.
state
const
{
navigation
}
=
this
.
props
const
title
=
navigation
.
getParam
(
'title'
,
'骨科智慧仓'
)
...
...
src/pages/order/quick.tsx
View file @
e6f90090
...
...
@@ -10,13 +10,12 @@
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
,
translateSysprofile
}
from
'../../utils/utils'
import
{
g
,
getFormItem
,
isBlank
,
isNotBlank
,
show
,
translateSysprofile
,
debounce
}
from
'../../utils/utils'
import
styles
from
'./quick.styl'
type
IProps
=
{
...
...
@@ -56,8 +55,11 @@ type IProps = {
delivermen
:
Function
}
orderStore
:
{
surgeryTemplates
:
[]
templates
:
Function
getTemplates
:
Function
invs
:
Function
getInventories
:
Function
submit
:
Function
}
}
...
...
@@ -132,9 +134,7 @@ class QuickOrder extends Component<IProps> {
type
:
FieldType
.
SELECT
,
options
:
[],
placeholder
:
'请选择'
,
// rules: [{ required: true, message: '请选择主治医生' }],
refrence
:
[
'orgCode'
,
'customerCode'
,
'billToSiteCode'
,
'shipToSiteCode'
],
// callback: this.setCustomerCallback.bind(this),
},
{
field
:
'surgeryType'
,
...
...
@@ -144,7 +144,7 @@ class QuickOrder extends Component<IProps> {
R
.
map
(
R
.
applySpec
({
label
:
R
.
prop
(
'valueName'
),
value
:
R
.
prop
(
'value
Cod
e'
),
value
:
R
.
prop
(
'value
Nam
e'
),
}),
),
R
.
pathOr
([],
[
'sysStore'
,
'sysValueSets'
,
'ORTHOPEDICS_PRODUCT_CLASS'
]),
...
...
@@ -212,6 +212,7 @@ class QuickOrder extends Component<IProps> {
}
componentDidMount
()
{
this
.
getInventories
=
debounce
(
this
.
getInventories
.
bind
(
this
),
500
)
this
.
setOptionsFormItems
()
}
...
...
@@ -433,19 +434,23 @@ class QuickOrder extends Component<IProps> {
}
/**
* @description: 收货地点
* @description: 收货地点
选择完回调
* @param {*}
* @return {*}
*/
setShipToSiteCallback
()
{
const
{
formItems
,
data
}
=
this
.
state
const
{
sellerCode
,
orgCode
,
customerCode
,
billToSiteCode
}
=
data
const
{
sellerCode
,
orgCode
,
customerCode
,
billToSiteCode
,
shipToSiteCode
}
=
data
const
doctors
=
this
.
props
.
orgStore
.
doctors
(
sellerCode
,
orgCode
,
customerCode
,
billToSiteCode
)
const
item
=
getFormItem
(
formItems
,
'doctorName'
)
item
.
options
=
doctors
this
.
setState
({
formItems
})
if
(
isNotBlank
(
shipToSiteCode
))
{
this
.
getInventories
()
}
}
/**
...
...
@@ -458,18 +463,78 @@ class QuickOrder extends Component<IProps> {
const
{
sellerCode
,
orgCode
,
customerCode
,
surgeryType
,
doctorName
}
=
data
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
// }
// templates = this.props.orderStore.surgeryTemplates
// console.log(templates)
let
templates
=
this
.
props
.
orderStore
.
templates
(
sellerCode
,
orgCode
,
customerCode
,
surgeryType
,
doctorName
)
if
(
isBlank
(
templates
))
{
item
.
loading
=
true
await
this
.
props
.
orderStore
.
getTemplates
(
sellerCode
,
orgCode
,
customerCode
,
surgeryType
,
doctorName
)
item
.
loading
=
false
}
templates
=
this
.
props
.
orderStore
.
templates
(
sellerCode
,
orgCode
,
customerCode
,
surgeryType
,
doctorName
)
item
.
options
=
R
.
map
(
R
.
applySpec
({
value
:
R
.
prop
(
'templateNumber'
),
label
:
item
=>
R
.
ifElse
(
isBlank
,
R
.
always
(
item
.
templateName
),
R
.
always
(
item
.
templateName
+
'--'
+
item
.
doctorName
),
)(
item
.
doctorName
),
}),
)(
templates
)
this
.
setState
({
formItems
})
}
/**
* @description: 获取借货仓库
* @param {*}
* @return {*}
*/
async
getInventories
()
{
const
{
formItems
,
data
}
=
this
.
state
const
{
orgCode
,
customerCode
,
billToSiteCode
,
shipToSiteCode
}
=
data
const
item
=
getFormItem
(
formItems
,
'collectSrcInvCode'
)
let
invs
=
this
.
props
.
orderStore
.
invs
(
orgCode
,
customerCode
,
billToSiteCode
,
shipToSiteCode
)
if
(
isBlank
(
invs
))
{
item
.
loading
=
true
await
this
.
props
.
orderStore
.
getInventories
(
orgCode
,
customerCode
,
billToSiteCode
,
shipToSiteCode
)
item
.
loading
=
false
}
invs
=
this
.
props
.
orderStore
.
invs
(
orgCode
,
customerCode
,
billToSiteCode
,
shipToSiteCode
)
item
.
options
=
R
.
map
(
R
.
applySpec
({
value
:
R
.
prop
(
'sourceInvCode'
),
label
:
R
.
prop
(
'sourceInvName'
),
}),
)(
invs
)
this
.
setState
({
formItems
})
}
submitHandler
()
{}
/**
* @description: 提交
* @param {*}
* @return {*}
*/
async
submitHandler
(
forceBalanceCheckFlag
=
'Y'
)
{
const
{
data
}
=
this
.
state
try
{
const
res
=
await
this
.
props
.
orderStore
.
submit
({
data
:
{
...
data
,
forceBalanceCheckFlag
,
orderCurrency
:
'CNY'
}
})
if
(
res
.
errorCode
===
0
&&
res
.
data
.
createSuccess
===
'Y'
)
{
this
.
props
.
navigation
.
navigate
(
'Success'
,
{
orderNumber
:
res
.
data
.
surveyCollectNumber
,
title
:
'借货订单'
,
})
}
else
{
show
(
res
.
errorMsg
)
}
}
catch
(
error
)
{
console
.
log
(
error
)
}
}
render
()
{
const
{
formItems
,
data
}
=
this
.
state
...
...
src/services/service.ts
View file @
e6f90090
...
...
@@ -17,7 +17,7 @@ export default class Service {
* 获取系统配置
*/
getSysProfile
(
data
:
any
)
{
return
request
({
url
:
`
${
ctx
}
/system/sys_profile/search`
,
data
,
noTip
:
true
})
return
request
({
url
:
`
${
ctx
}
/system/sys_profile/search`
,
data
,
noTip
:
true
})
}
/**
...
...
@@ -126,4 +126,22 @@ export default class Service {
getSurgeryTemplates
(
data
:
any
)
{
return
request
({
url
:
`
${
ctx
}
/surgery/template_header/search`
,
data
})
}
/**
* @description: 请求借货仓库
* @param {any} data
* @return {*}
*/
getInventories
(
data
:
any
)
{
return
request
({
url
:
`
${
ctx
}
/surgery/collect_setting/search`
,
data
})
}
/**
* @description: 创建借货订单
* @param {any} data
* @return {*}
*/
createCollectOrder
(
data
:
any
)
{
return
request
({
url
:
`
${
ctx
}
/surgery/collect_order/via_data/create`
,
data
,
method
:
'post'
})
}
}
src/stores/order.ts
View file @
e6f90090
...
...
@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/stores/order.ts
* @Author: peii
* @Date: 2021-07-04 14:52:03
* @LastEditTime: 2021-07-
04 18:02:51
* @LastEditTime: 2021-07-
14 16:14:00
* @LastEditors: peii
* @Vision: 1.0
* @Description: 订单store
...
...
@@ -23,7 +23,34 @@ export default class Order {
@
inject
(
TYPES
.
Service
)
private
service
!
:
Service
@
observable
surgeryTemplates
:
{
[
key
:
string
]:
any
[]
}
@
observable
surgeryTemplates
:
{
[
key
:
string
]:
any
[]
}
=
{}
@
observable
inventories
:
{
[
key
:
string
]:
any
[]
}
=
{}
/**
* @description: 模板列表
* @param {string} sellerCode
* @param {string} orgCode
* @param {string} customerCode
* @param {string} surgeryType
* @param {string} doctorName
* @return {*}
*/
templates
(
sellerCode
:
string
,
orgCode
:
string
,
customerCode
:
string
,
surgeryType
:
string
,
doctorName
?:
string
)
{
return
this
.
surgeryTemplates
[
`
${
sellerCode
}
_
${
orgCode
}
_
${
customerCode
}
_
${
surgeryType
}
_
${
doctorName
}
`
]
}
/**
* @description: 借货仓库列表
* @param {*} orgCode
* @param {*} customerCode
* @param {*} billToSiteCode
* @param {*} shipToSiteCode
* @return {*}
*/
invs
(
orgCode
,
customerCode
,
billToSiteCode
,
shipToSiteCode
)
{
return
this
.
inventories
[
`
${
orgCode
}
_
${
customerCode
}
_
${
billToSiteCode
}
_
${
shipToSiteCode
}
`
]
}
/**
* @description: 请求手术模板
...
...
@@ -48,7 +75,43 @@ export default class Order {
const
res
=
yield
this
.
service
.
getSurgeryTemplates
(
params
)
if
(
res
.
errorCode
)
return
console
.
log
(
res
)
this
.
surgeryTemplates
[
`
${
sellerCode
}
_
${
orgCode
}
_
${
customerCode
}
_
${
surgeryType
}
_
${
doctorName
}
`
]
=
res
.
data
.
surgeryTemplateHeaders
})
/**
* @description: 获取组织客户下的仓库
* @param {*}
* @return {*}
*/
getInventories
=
flow
(
function
*
(
this
:
Order
,
orgCode
:
string
,
customerCode
:
string
,
billToSiteCode
:
string
,
shipToSiteCode
:
string
,
processCode
=
'COLLECT'
,
)
{
const
res
=
yield
this
.
service
.
getInventories
({
orgCode
,
customerCode
,
billToSiteCode
,
shipToSiteCode
,
processCode
,
})
if
(
res
.
errorCode
)
return
const
list
=
R
.
uniqBy
(
R
.
prop
(
'sourceInvCode'
))(
res
.
data
)
this
.
inventories
[
`
${
orgCode
}
_
${
customerCode
}
_
${
billToSiteCode
}
_
${
shipToSiteCode
}
`
]
=
list
})
/**
* @description: 提交创建借货单
* @param {any} data
* @return {*}
*/
async
submit
(
data
:
any
)
{
return
await
this
.
service
.
createCollectOrder
(
data
)
}
}
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