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
fd8da620
authored
Oct 27, 2022
by
peii
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
【FIX】修复部分bug及滑动优化体验
parent
a36be8c0
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
48 additions
and
48 deletions
src/components/form/image.tsx
src/components/form/index.styl
src/components/form/index.tsx
src/components/form/input.tsx
src/pages/mix_consume/consumeItems.tsx
src/pages/mix_consume/form.tsx
src/services/api.ts
src/services/baseApi.ts
src/services/service.ts
src/components/form/image.tsx
View file @
fd8da620
/*
* @FilePath: /BoneHouse_Business_APP/src/components/form/image.tsx
* @Author: PEII
* @Date: 2022-08-02 16:15:54
* @LastEditTime: 2022-10-27 11:02:31
* @LastEditors: PEII
* @Vision: 1.0
* @Description:
*/
// @ts-nocheck
import
React
,
{
Component
}
from
'react'
import
{
View
,
Text
,
Image
,
TouchableOpacity
,
ScrollView
,
Alert
,
Linking
,
Platform
,
}
from
'react-native'
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'
import
Toast
,
{
Positions
}
from
'react-native-root-toast'
import
{
isBlank
,
show
,
isRequired
,
isNotBlank
,
g
}
from
'../../utils/utils'
import
styles
from
'./image.styl'
// import Container from '../../inversify'
// import { TYPES } from '../../inversify/types'
// import Service from '../../services/service'
// const service: Service = Container.get(TYPES.Service)
import
service
from
'../../services/service'
type
IProps
=
{
item
:
IFormField
...
...
@@ -72,10 +69,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
)
{
...
...
@@ -106,7 +100,7 @@ export default class ImageForm extends React.Component<IProps> {
formData
.
append
(
'file'
,
file
)
try
{
const
loading
=
Toast
.
show
(
'上传中'
,
{
duration
:
60000
,
position
:
Toast
.
positions
.
CENTER
})
//
const result = await service.uploadImg(formData)
const
result
=
await
service
.
uploadImg
(
formData
)
Toast
.
hide
(
loading
)
let
value
=
this
.
props
.
value
||
[]
...
...
src/components/form/index.styl
View file @
fd8da620
...
...
@@ -41,6 +41,7 @@
flex-direction row
align-items center
justify-content flex-end
flex 1
&__placeholder
@extend .text
...
...
src/components/form/index.tsx
View file @
fd8da620
...
...
@@ -10,14 +10,7 @@
*/
// @ts-nocheck
import
React
,
{
Component
}
from
'react'
import
{
View
,
Text
,
ScrollView
,
TouchableOpacity
,
ActivityIndicator
,
KeyboardAvoidingView
,
}
from
'react-native'
import
{
View
,
Text
,
ScrollView
,
TouchableOpacity
,
ActivityIndicator
,
KeyboardAvoidingView
}
from
'react-native'
import
{
IFormField
}
from
'bonehouse'
import
*
as
R
from
'ramda'
import
{
FieldType
}
from
'../../enums'
...
...
@@ -57,7 +50,7 @@ export default class Form extends Component<IProps> {
}
componentDidMount
()
{
this
.
checkCanSubmit
=
debounce
(
this
.
check
Can
Submit
.
bind
(
this
))
this
.
checkCanSubmit
=
debounce
(
this
.
checkSubmit
.
bind
(
this
))
this
.
submitHandler
=
debounce
(
this
.
submitHandler
.
bind
(
this
),
200
)
}
...
...
@@ -81,7 +74,7 @@ export default class Form extends Component<IProps> {
/**
* @description: 是否可以提交
*/
check
Can
Submit
()
{
checkSubmit
()
{
const
{
fields
,
data
}
=
this
.
props
for
(
const
item
of
fields
)
{
if
(
isBlank
(
item
.
rules
))
continue
...
...
src/components/form/input.tsx
View file @
fd8da620
...
...
@@ -60,7 +60,7 @@ export default class Input extends Component<IProps> {
autoCapitalize=
"none"
placeholder=
{
item
.
placeholder
||
'请输入'
}
onChangeText=
{
this
.
onChangeText
}
multiline=
{
item
.
multilin
e
}
multiline=
{
tru
e
}
numberOfLines=
{
item
.
numberOfLines
||
4
}
maxLength=
{
140
}
placeholderTextColor=
{
placehold_text_color
}
...
...
src/pages/mix_consume/consumeItems.tsx
View file @
fd8da620
...
...
@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/mix_consume/consumeItems.tsx
* @Author: PEII
* @Date: 2022-10-10 14:09:04
* @LastEditTime: 2022-10-2
1 14:57:58
* @LastEditTime: 2022-10-2
7 11:55:34
* @LastEditors: PEII
* @Vision: 1.0
* @Description: 扫码消耗项
...
...
@@ -82,12 +82,16 @@ class ConsumeItems extends React.Component<IProps> {
if
(
isBlank
(
list
))
{
return
show
(
'该条码无法找到物料'
)
}
list
=
R
.
filter
(
R
.
propEq
(
'customer_code'
,
order
.
customer_code
))(
list
)
if
(
isBlank
(
list
))
{
return
show
(
`该物料借货客户【
${
list
[
0
].
customer_name
}
】与您选择的客户不一致,请检查`
)
const
items
=
R
.
filter
(
R
.
propEq
(
'customer_code'
,
order
.
customer_code
))(
list
)
if
(
isBlank
(
items
))
{
return
show
(
`该物料借货客户【
${
list
[
0
].
customer_name
}
】与您选择的客户【
${
order
.
customer_name
||
order
.
customer_code
}
】不一致,请检查`
,
)
}
lines
=
R
.
compose
(
R
.
uniqBy
(
R
.
prop
(
'serial_number'
)),
R
.
concat
(
lines
),
R
.
map
(
R
.
assoc
(
'consumed_quantity'
,
1
)))(
list
)
lines
=
R
.
compose
(
R
.
uniqBy
(
R
.
prop
(
'serial_number'
)),
R
.
concat
(
lines
),
R
.
map
(
R
.
assoc
(
'consumed_quantity'
,
1
)))(
items
)
this
.
setState
({
lines
})
}
...
...
src/pages/mix_consume/form.tsx
View file @
fd8da620
...
...
@@ -422,12 +422,12 @@ class ConsumeForm extends Component<IProps, IState> {
data
.
lines
=
lines
this
.
setState
({
data
},
()
=>
{
this
.
saveHandler
()
const
canSubmit
=
this
.
formRef
.
checkCanSubmit
()
if
(
!
submit
)
return
const
canSubmit
=
this
.
formRef
.
checkSubmit
()
if
(
!
submit
)
return
if
(
!
canSubmit
)
return
show
(
'请完善必填信息再提交'
)
this
.
submitHandler
()
this
.
formRef
.
submitHandler
()
})
},
})
...
...
src/services/api.ts
View file @
fd8da620
...
...
@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/services/api.ts
* @Author: peii
* @Date: 2021-12-19 16:06:26
* @LastEditTime: 2022-10-
13 17:30:11
* @LastEditTime: 2022-10-
27 11:20:09
* @LastEditors: PEII
* @Vision: 1.0
* @Description: 未重构完全暂用的所有请求
...
...
@@ -173,7 +173,11 @@ export default {
* @param {object} data
* @return {*}
*/
getCollectOrderLines
(
data
:
{
serial_number
?:
string
;
raised_consume
?:
'Y'
|
'N'
,
surgery_collected_number
?:
string
})
{
getCollectOrderLines
(
data
:
{
serial_number
?:
string
raised_consume
?:
'Y'
|
'N'
surgery_collected_number
?:
string
})
{
return
request
({
url
:
`
${
v
}
/surgery/collected_order_line/search`
,
data
})
},
...
...
@@ -183,6 +187,6 @@ export default {
* @return {*}
*/
createGroupComsumeOrder
(
data
:
any
)
{
return
request
({
url
:
`
${
v
}
/surgery/consume_group_order/create`
,
data
,
method
:
'POST'
})
}
return
request
({
url
:
`
${
v
}
/surgery/consume_group_order/create`
,
data
,
method
:
'POST'
})
}
,
}
src/services/baseApi.ts
View file @
fd8da620
...
...
@@ -13,6 +13,7 @@ import * as R from 'ramda'
import
{
isBlank
,
show
,
genPid
}
from
'../utils/utils'
import
{
stringify
}
from
'querystring'
import
store
from
'../../app/store/configureStore'
import
{
transformObject
}
from
'../utils/transform'
interface
RequestConfig
{
url
:
string
...
...
@@ -64,7 +65,7 @@ export const request = (args: Partial<RequestConfig>) => {
options
.
url
+=
R
.
ifElse
(
R
.
includes
(
'?'
),
R
.
always
(
'&'
+
accessToken
),
R
.
always
(
'?'
+
accessToken
))(
options
.
url
)
}
}
//
args.data = transformObject(options.data, 'toLine')
args
.
data
=
transformObject
(
options
.
data
,
'toLine'
)
args
.
data
=
options
.
data
options
=
R
.
cond
([
...
...
src/services/service.ts
View file @
fd8da620
...
...
@@ -7,13 +7,13 @@
*
*/
// @ts-nocheck
import
{
request
}
from
'./
request
'
import
{
injectable
}
from
'inversify'
import
{
request
}
from
'./
baseApi
'
//
import { injectable } from 'inversify'
const
ctx
=
'/api/latest'
@
injectable
()
export
default
class
Service
{
//
@injectable()
class
Service
{
/**
* 获取系统配置
*/
...
...
@@ -119,3 +119,5 @@ export default class Service {
return
request
({
url
:
`
${
ctx
}
/surgery/consume_order/create`
,
data
,
method
:
'post'
})
}
}
export
default
new
Service
()
\ No newline at end of file
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