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
cd688100
authored
Nov 28, 2021
by
peii
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
消耗数量字义
parent
66740df1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
14 deletions
app/containers/equipConsu/EquipConsuPage.js
app/containers/equipConsu/module/ConsumDetailsPage.js
app/containers/equipConsu/module/FillUnitPricePage.js
app/containers/equipConsu/EquipConsuPage.js
View file @
cd688100
...
@@ -1369,12 +1369,12 @@ class EquipConsuPage extends Component {
...
@@ -1369,12 +1369,12 @@ class EquipConsuPage extends Component {
R
.
pathOr
([],
[
'listOptionData'
,
13
,
'subOption'
])
R
.
pathOr
([],
[
'listOptionData'
,
13
,
'subOption'
])
)(
state
)
)(
state
)
}
}
if
(
tempSubOption
.
lines
.
length
)
{
//
if( tempSubOption.lines.length ) {
tempSubOption
.
lines
=
tempSubOption
.
lines
.
map
(
item
=>
{
//
tempSubOption.lines = tempSubOption.lines.map(item => {
item
[
'consumed_quantity'
]
=
1
//
item['consumed_quantity'] = 1
return
item
//
return item
})
//
})
}
//
}
tempSubOption
.
img_url
=
state
.
listOptionData
[
14
].
uploadImgArr
.
join
(
','
)
tempSubOption
.
img_url
=
state
.
listOptionData
[
14
].
uploadImgArr
.
join
(
','
)
let
params
=
{
let
params
=
{
access_token
:
props
.
token
,
access_token
:
props
.
token
,
...
@@ -1464,7 +1464,19 @@ class EquipConsuPage extends Component {
...
@@ -1464,7 +1464,19 @@ class EquipConsuPage extends Component {
consumeSum
()
{
consumeSum
()
{
try
{
try
{
const
{
listOptionData
}
=
this
.
state
const
{
listOptionData
}
=
this
.
state
return
R
.
compose
(
R
.
sum
,
R
.
pluck
(
'local_add_price'
),
R
.
pathOr
([],
[
12
,
'subOption'
]))(
listOptionData
)
return
R
.
compose
(
R
.
sum
,
R
.
map
(
R
.
converge
(
R
.
multiply
,
[
R
.
prop
(
'consumed_quantity'
),
R
.
compose
(
x
=>
isNaN
(
x
)
?
0
:
x
,
R
.
prop
(
'local_add_price'
))
]
)
),
R
.
pathOr
([],
[
12
,
'subOption'
])
)(
listOptionData
)
}
catch
(
error
)
{
}
catch
(
error
)
{
return
0
return
0
}
}
...
@@ -1773,7 +1785,7 @@ class EquipConsuPage extends Component {
...
@@ -1773,7 +1785,7 @@ class EquipConsuPage extends Component {
style
=
{
list_common_item
.
detail_sub_cont
}
>
style
=
{
list_common_item
.
detail_sub_cont
}
>
<
View
style
=
{
list_common_item
.
detail_sub_tit
}
>
<
View
style
=
{
list_common_item
.
detail_sub_tit
}
>
<
Text
style
=
{
list_common_item
.
detail_tit_text
}
>
<
Text
style
=
{
list_common_item
.
detail_tit_text
}
>
耗材(
{
state
.
listOptionData
[
12
].
subOption
.
length
}
)
耗材(
{
R
.
compose
(
R
.
sum
,
R
.
filter
(
isNotBlank
),
R
.
pluck
(
'consumed_quantity'
))(
state
.
listOptionData
[
12
].
subOption
)
}
)
<
/Text
>
<
/Text
>
{
{
userEnteredPrice
!==
'N'
&&
<
Text
style
=
{
list_common_item
.
detail_tit_text
}
>
耗材总金额:
{
sum
}
<
/Text
>
userEnteredPrice
!==
'N'
&&
<
Text
style
=
{
list_common_item
.
detail_tit_text
}
>
耗材总金额:
{
sum
}
<
/Text
>
...
@@ -1815,10 +1827,14 @@ class EquipConsuPage extends Component {
...
@@ -1815,10 +1827,14 @@ class EquipConsuPage extends Component {
<
Text
style
=
{
list_common_item
.
de_tip
}
>
<
Text
style
=
{
list_common_item
.
de_tip
}
>
序列号:
{
item
.
serial_number
?
item
.
serial_number
:
'无'
}
序列号:
{
item
.
serial_number
?
item
.
serial_number
:
'无'
}
<
/Text
>
<
/Text
>
{
OBS_MOBILE_EQU_CON_DISPLAY_PRICE
===
'Y'
&&
userEnteredPrice
!==
'N'
?
<
Text
style
=
{
list_common_item
.
de_tip
}
>
消耗数量:
{
item
.
consumed_quantity
}
<
/Text
>
{
OBS_MOBILE_EQU_CON_DISPLAY_PRICE
===
'Y'
&&
userEnteredPrice
!==
'N'
&&
(
<
Text
style
=
{
list_common_item
.
de_tip
}
>
<
Text
style
=
{
list_common_item
.
de_tip
}
>
单价
(
¥
)
:
{
item
.
sale_price
}
单价
(
¥
)
:
{
item
.
sale_price
}
<
/Text> : null
}
<
/Text>
)
}
<
/View
>
<
/View
>
)
)
}
}
...
...
app/containers/equipConsu/module/ConsumDetailsPage.js
View file @
cd688100
...
@@ -6,12 +6,13 @@ import HeadBackItem from '../../common/HeadBackItem';
...
@@ -6,12 +6,13 @@ import HeadBackItem from '../../common/HeadBackItem';
import
DetailsModel
from
'./DetailsModel'
;
import
DetailsModel
from
'./DetailsModel'
;
import
{
requestEquipDetails
}
from
'../../../action/EquipAction'
;
import
{
requestEquipDetails
}
from
'../../../action/EquipAction'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
show
}
from
'../../../utils/Utils'
;
import
{
isBlank
,
show
}
from
'../../../utils/Utils'
;
import
LodingModel
from
'../../common/LodingModel'
;
import
LodingModel
from
'../../common/LodingModel'
;
import
{
exitLoginStatus
}
from
'../../../action/LoginAction'
;
import
{
exitLoginStatus
}
from
'../../../action/LoginAction'
;
import
{
OBS_MOBILE_EQU_CON_DISPLAY_PRICE
}
from
'../../../base/BaseConstants'
;
import
{
OBS_MOBILE_EQU_CON_DISPLAY_PRICE
}
from
'../../../base/BaseConstants'
;
import
{
LOGIN_NO
}
from
'../../../base/ActionTypes'
;
import
{
LOGIN_NO
}
from
'../../../base/ActionTypes'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
*
as
R
from
'ramda'
;
const
CONSUM_SEARCH_VALUE_BAR_CODE
=
'CONSUM_SEARCH_VALUE_BAR_CODE'
;
const
CONSUM_SEARCH_VALUE_BAR_CODE
=
'CONSUM_SEARCH_VALUE_BAR_CODE'
;
...
@@ -204,6 +205,16 @@ class ConsumDetailsPage extends Component {
...
@@ -204,6 +205,16 @@ class ConsumDetailsPage extends Component {
})
})
}
}
onChangeConsumeNumber
(
val
,
item
)
{
if
(
isNaN
(
val
))
{
return
show
(
'请输入整数'
)
}
if
(
item
.
collected_quantity
<
Number
(
val
))
{
show
(
`最大可消耗数量为
${
item
.
collected_quantity
}
`
)
}
item
.
consumed_quantity
=
Number
(
val
)
}
// 打开/关闭 共计已选弹窗
// 打开/关闭 共计已选弹窗
handleCloseSelectModal
(
show
)
{
handleCloseSelectModal
(
show
)
{
this
.
setState
({
this
.
setState
({
...
@@ -221,9 +232,19 @@ class ConsumDetailsPage extends Component {
...
@@ -221,9 +232,19 @@ class ConsumDetailsPage extends Component {
this
.
handleCloseSelectModal
(
false
)
this
.
handleCloseSelectModal
(
false
)
let
{
localSelectOption
,
userEnteredPrice
}
=
this
.
state
let
{
localSelectOption
,
userEnteredPrice
}
=
this
.
state
if
(
!
localSelectOption
.
length
)
{
if
(
!
localSelectOption
.
length
)
{
show
(
'请选择耗材'
)
return
show
(
'请选择耗材'
)
return
}
}
const
setConsumeQuantity
=
it
=>
isBlank
(
it
.
consumed_quantity
)
&&
(
it
.
consumed_quantity
=
it
.
collected_quantity
)
R
.
map
(
setConsumeQuantity
,
localSelectOption
)
const
pred
=
item
=>
{
let
n
=
item
.
consumed_quantity
if
(
isBlank
(
n
)
||
isNaN
(
n
))
return
false
n
=
Number
(
n
)
return
n
>
0
&&
n
<=
item
.
collected_quantity
}
localSelectOption
=
R
.
filter
(
pred
)(
localSelectOption
)
if
(
OBS_MOBILE_EQU_CON_DISPLAY_PRICE
===
'Y'
&&
userEnteredPrice
!==
'N'
){
if
(
OBS_MOBILE_EQU_CON_DISPLAY_PRICE
===
'Y'
&&
userEnteredPrice
!==
'N'
){
this
.
props
.
navigation
.
navigate
(
'FillUnitPricePage'
,
{
this
.
props
.
navigation
.
navigate
(
'FillUnitPricePage'
,
{
title
:
'器械消耗 - 填写单价'
,
title
:
'器械消耗 - 填写单价'
,
...
@@ -329,6 +350,22 @@ class ConsumDetailsPage extends Component {
...
@@ -329,6 +350,22 @@ class ConsumDetailsPage extends Component {
<
Text
style
=
{[
styles
.
rig_ser
,
styles
.
te_ot_thr
]}
numberOfLines
=
{
1
}
>
<
Text
style
=
{[
styles
.
rig_ser
,
styles
.
te_ot_thr
]}
numberOfLines
=
{
1
}
>
过期日期:
{
item
.
expiration_date
&&
moment
(
item
.
expiration_date
).
format
(
'YYYY-MM-DD'
)
||
'无'
}
过期日期:
{
item
.
expiration_date
&&
moment
(
item
.
expiration_date
).
format
(
'YYYY-MM-DD'
)
||
'无'
}
<
/Text
>
<
/Text
>
<
View
style
=
{
styles
.
input_number_box
}
>
<
Text
style
=
{[
styles
.
rig_ser
,
styles
.
te_ot_thr
]}
numberOfLines
=
{
1
}
>
消耗数量:
<
/Text
>
<
TextInput
placeholder
=
"数量"
underlineColorAndroid
=
"transparent"
style
=
{
styles
.
input_number
}
ref
=
{
textInput
=>
this
.
TextInput
=
textInput
}
onChangeText
=
{(
text
)
=>
this
.
onChangeConsumeNumber
(
text
,
item
)}
defaultValue
=
{
R
.
toString
(
item
.
collected_quantity
)}
/>
<
Text
style
=
{[
styles
.
rig_ser
,
styles
.
te_ot_thr
]}
numberOfLines
=
{
1
}
>
/ {item.collected_quantity
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
)
)
...
@@ -447,6 +484,17 @@ const styles = StyleSheet.create({
...
@@ -447,6 +484,17 @@ const styles = StyleSheet.create({
fontSize
:
third_text_size
,
fontSize
:
third_text_size
,
fontFamily
:
font_family_regular
,
fontFamily
:
font_family_regular
,
},
},
input_number_box
:
{
flexDirection
:
'row'
,
},
input_number
:
{
width
:
pxSize
(
40
),
borderWidth
:
pxSize
(
1
),
borderColor
:
'#999'
,
textAlign
:
'right'
,
paddingRight
:
pxSize
(
5
),
paddingLeft
:
pxSize
(
5
),
},
te_ot_str
:
{
te_ot_str
:
{
fontFamily
:
font_family_semibold
,
fontFamily
:
font_family_semibold
,
color
:
list_str_color
color
:
list_str_color
...
...
app/containers/equipConsu/module/FillUnitPricePage.js
View file @
cd688100
...
@@ -23,7 +23,18 @@ class FillUnitPricePage extends Component {
...
@@ -23,7 +23,18 @@ class FillUnitPricePage extends Component {
feeSum
()
{
feeSum
()
{
const
{
unitPriceOption
}
=
this
.
state
const
{
unitPriceOption
}
=
this
.
state
return
R
.
compose
(
R
.
sum
,
R
.
map
(
x
=>
isNaN
(
x
)
?
0
:
x
),
R
.
pluck
(
'local_add_price'
))(
unitPriceOption
)
return
R
.
compose
(
R
.
sum
,
R
.
map
(
R
.
converge
(
R
.
multiply
,
[
R
.
prop
(
'consumed_quantity'
),
R
.
compose
(
x
=>
isNaN
(
x
)
?
0
:
x
,
R
.
prop
(
'local_add_price'
))
]
)
)
)(
unitPriceOption
)
}
}
// 获取选择的数据
// 获取选择的数据
...
@@ -120,6 +131,9 @@ class FillUnitPricePage extends Component {
...
@@ -120,6 +131,9 @@ class FillUnitPricePage extends Component {
<
Text
style
=
{[
styles
.
cont_ser
,
styles
.
te_ot_thr
]}
>
<
Text
style
=
{[
styles
.
cont_ser
,
styles
.
te_ot_thr
]}
>
序列号:
{
item
.
serial_number
?
item
.
serial_number
:
'无'
}
序列号:
{
item
.
serial_number
?
item
.
serial_number
:
'无'
}
<
/Text
>
<
/Text
>
<
Text
style
=
{[
styles
.
cont_ser
,
styles
.
te_ot_thr
]}
>
数量:
{
item
.
consumed_quantity
}
<
/Text
>
<
View
style
=
{
styles
.
cont_pri
}
>
<
View
style
=
{
styles
.
cont_pri
}
>
<
Text
style
=
{
styles
.
pri_icon
}
>*<
/Text
>
<
Text
style
=
{
styles
.
pri_icon
}
>*<
/Text
>
<
Text
style
=
{
styles
.
pri_inner
}
>
单价:
<
/Text
>
<
Text
style
=
{
styles
.
pri_inner
}
>
单价:
<
/Text
>
...
...
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