Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
80d3df0c
Commit
80d3df0c
authored
Dec 07, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理intl影响阶梯价格校验问题
parent
c839e734
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
index.tsx
src/pages/commodity/products/constant/index.tsx
+3
-4
index.tsx
...saction/purchaseOrder/orderCollectCash/constant/index.tsx
+1
-1
No files found.
src/pages/commodity/products/constant/index.tsx
View file @
80d3df0c
...
...
@@ -4,7 +4,6 @@ import { ISchema } from '@formily/antd';
import
{
Badge
}
from
'antd'
;
import
{
ColumnType
}
from
'antd/lib/table'
;
import
moment
from
'moment'
;
import
React
,
{
ReactNode
}
from
'react'
/** 商品 渠道商品 快捷修改单价 共用常量 */
...
...
@@ -152,7 +151,6 @@ export const orderlyLadderPrice = (data) => {
/** 校验阶梯价格函数 min参数判断是否校验最小起订 */
export
const
validatorNumberRange
=
(
rule
:
any
,
value
:
any
,
callback
:
any
,
min
?:
any
)
=>
{
const
intl
=
useIntl
();
try
{
if
(
Array
.
isArray
(
value
))
{
let
range
=
value
.
map
(
item
=>
{
...
...
@@ -165,8 +163,9 @@ export const validatorNumberRange = (rule: any, value: any, callback: any, min?:
[]
)
let
result
=
range
.
map
(
Number
).
reduce
((
a
,
b
)
=>
{
if
(
a
<
b
)
return
b
})
if
(
!
result
)
throw
new
Error
(
intl
.
formatMessage
({
id
:
'commodity.products.constant.validatorNumberRange.error.1'
}));
if
(
min
&&
(
Number
(
range
[
0
])
!==
Number
(
min
)))
throw
new
Error
(
intl
.
formatMessage
({
id
:
'commodity.products.constant.validatorNumberRange.error.2'
}));
console
.
log
(
result
,
'result'
,
range
)
if
(
!
result
)
throw
new
Error
(
getIntl
().
formatMessage
({
id
:
'commodity.products.constant.validatorNumberRange.error.1'
}));
if
(
min
&&
(
Number
(
range
[
0
])
!==
Number
(
min
)))
throw
new
Error
(
getIntl
().
formatMessage
({
id
:
'commodity.products.constant.validatorNumberRange.error.2'
}));
callback
()
}
}
catch
(
err
)
{
...
...
src/pages/transaction/purchaseOrder/orderCollectCash/constant/index.tsx
View file @
80d3df0c
...
...
@@ -103,7 +103,7 @@ export const procurementProcessField = (value) => {
weight
:
item
.
logistics
.
weight
,
stock
:
item
.
stockCount
,
discount
:
item
.
isMemberPrice
?
item
.
memberPrice
:
1
,
// 字段需求 无折扣为1
price
:
item
.
isMemberPrice
?
Number
((
item
.
money
/
item
.
purchaseCount
/
item
.
memberPrice
).
toFixed
(
2
))
:
Number
((
item
.
money
/
item
.
purchaseCoun
).
toFixed
(
2
)),
price
:
item
.
isMemberPrice
?
Number
((
item
.
money
/
item
.
purchaseCount
/
item
.
memberPrice
).
toFixed
(
2
))
:
Number
((
item
.
money
/
item
.
purchaseCoun
t
).
toFixed
(
2
)),
tax
:
item
.
taxRate
>
0
,
vendorMemberId
:
item
.
memberId
,
vendorRoleId
:
item
.
memberRoleId
,
...
...
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