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
linweijiong
jinfa-platform
Commits
3efe3d57
Commit
3efe3d57
authored
Aug 18, 2022
by
wzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 预付未空,向下取整
parent
b1f56aa4
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
11 deletions
+15
-11
FormList.tsx
src/pages/contract/manage/add/components/FormList.tsx
+2
-4
index.tsx
src/pages/member/components/MemberDocCategoryPro/index.tsx
+3
-2
index.tsx
...nsaction/purchaseOrder/orderCollectSrm/constant/index.tsx
+3
-3
index.tsx
...pages/transaction/purchaseOrder/orderCollectSrm/index.tsx
+2
-1
useMaterialTable.tsx
.../purchaseOrder/orderCollectSrm/model/useMaterialTable.tsx
+2
-1
index.tsx
src/utils/index.tsx
+3
-0
No files found.
src/pages/contract/manage/add/components/FormList.tsx
View file @
3efe3d57
...
...
@@ -24,6 +24,7 @@ import Submit from '@/components/NiceForm/components/Submit'
import
BigNumber
from
'bignumber.js'
;
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
import
moment
from
'moment'
;
import
{
math
}
from
'@/utils'
;
const
intl
=
getIntl
();
...
...
@@ -102,12 +103,9 @@ const FormList = (props: any) => {
}
}
const
val_taxPoint
=
(
i
)
=>
{
function
round
(
number
,
precision
)
{
return
Math
.
round
(
+
number
+
'e'
+
precision
)
/
Math
.
pow
(
10
,
precision
);
}
i
.
isHasTax
=
!!
i
.
taxPoint
?
1
:
0
i
.
taxRate
=
(
i
.
taxPoint
||
0
)
*
100
i
.
bidAmount
=
round
(
new
BigNumber
(
+
i
.
bidCount
||
i
.
quantity
||
0
).
multipliedBy
(
i
.
price
||
0
).
toNumber
(),
2
)
i
.
bidAmount
=
math
(
'round'
,
new
BigNumber
(
+
i
.
bidCount
||
i
.
quantity
||
0
).
multipliedBy
(
i
.
price
||
0
).
toNumber
(),
2
)
}
/* 确定 */
const
handleOk
=
()
=>
{
...
...
src/pages/member/components/MemberDocCategoryPro/index.tsx
View file @
3efe3d57
...
...
@@ -364,7 +364,6 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR
classifyAreas
:
classifyAreas
?.
join
(
';'
),
bankInfos
:
[...
bankInfos
]
||
[...
bankInfosList
]
});
console
.
log
(
'123'
,
value
);
}
if
(
isEditable
)
getClassifyRecord
()
...
...
@@ -398,7 +397,9 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR
// days: days ? `${days}` : '',
// },
taxPoint
:
+
taxPoint
*
100
,
...
rest
...
rest
,
advanceCharge
:
rest
.
advanceCharge
||
undefined
,
advanceChargeName
:
rest
.
advanceChargeName
!==
'未知'
?
rest
.
advanceChargeName
:
undefined
}))
:
[]
setClassifyInfo
({
code
:
res
.
data
?.
code
,
...
...
src/pages/transaction/purchaseOrder/orderCollectSrm/constant/index.tsx
View file @
3efe3d57
import
{
formatTimeString
}
from
'@/utils'
import
{
formatTimeString
,
math
}
from
'@/utils'
import
{
Row
,
TableColumnsType
}
from
'antd'
import
{
OrderModalType
}
from
'@/constants/order'
import
{
getIntl
}
from
'umi'
...
...
@@ -343,7 +343,7 @@ export const materialInfoColumns: any[] = [
dataIndex
:
'amount'
,
key
:
'amount'
,
width
:
COLUMNS_ACTION_WIDTH
,
render
:
(
t
,
r
)
=>
t
?
`
${
Number
(
t
).
toFixed
(
2
)}
`
:
null
render
:
(
t
,
r
)
=>
t
?
`
${
math
(
'ceil'
,
Number
(
t
),
2
)}
`
:
null
},
// 接口调用
{
...
...
@@ -448,7 +448,7 @@ export const materialInfoColumnsByRequisition: any[] = [
dataIndex
:
'amount'
,
key
:
'amount'
,
width
:
COLUMNS_ACTION_WIDTH
,
render
:
(
t
,
r
)
=>
t
?
`
${
Number
(
t
).
toFixed
(
2
)}
`
:
null
render
:
(
t
,
r
)
=>
t
?
`
${
math
(
'floor'
,
Number
(
t
),
2
)}
`
:
null
},
// 接口调用
// {
...
...
src/pages/transaction/purchaseOrder/orderCollectSrm/index.tsx
View file @
3efe3d57
...
...
@@ -32,6 +32,7 @@ import { getLogisticsReceiverAddressGet, getLogisticsSelectListMemberShipperAddr
import
{
getContractSelectCurrencyList
}
from
'@/services/ContractV2Api'
import
AuthButton
from
'@/components/AuthButton'
import
{
PostOrderMaterialData
}
from
'./interface'
import
{
math
}
from
'@/utils'
export
interface
PurchaseOrderDetailProps
{
}
...
...
@@ -401,7 +402,7 @@ const PurchaseOrderDetail: React.FC<PurchaseOrderDetailProps> = (props) => {
logistics
:
item
.
deliveryType
||
1
,
memberId
:
contractValue
.
partyBMemberId
,
memberRoleId
:
contractValue
.
partyBRoleId
,
amount
:
+
(
item
.
price
*
item
.
quantity
).
toFixed
(
2
),
// 这里应该会出现计算不准的问题
amount
:
math
(
'floor'
,
+
(
item
.
price
*
item
.
quantity
),
2
),
// 这里应该会出现计算不准的问题
}))
addSchemaAction
.
setFieldValue
(
'products'
,
mergeArr
);
};
...
...
src/pages/transaction/purchaseOrder/orderCollectSrm/model/useMaterialTable.tsx
View file @
3efe3d57
...
...
@@ -11,6 +11,7 @@ import { RequisitionModalTableRef } from '../components/requisitionModalTable';
import
{
CaretRightOutlined
}
from
'@ant-design/icons'
;
import
ExpandedRowRender
from
'../components/expandedRowRender'
;
import
plusIcon
from
'../images/plus.png'
;
import
{
math
}
from
'@/utils'
;
// 对象按key排序(运用于商城传过来的阶梯价格排序)
export
const
sortByKey
=
(
params
)
=>
{
...
...
@@ -24,7 +25,7 @@ export const sortByKey = (params) => {
export
const
getUnitPriceTotal
=
(
record
)
=>
{
const
purchaseCount
=
Number
(
record
[
'quantity'
])
||
0
return
Number
((
record
.
price
*
purchaseCount
).
toFixed
(
2
)
)
return
math
(
'floor'
,
Number
((
record
.
price
*
purchaseCount
)),
2
)
}
/**
...
...
src/utils/index.tsx
View file @
3efe3d57
...
...
@@ -745,6 +745,9 @@ export const isJSONString = (str) => {
return
false
}
export
function
math
(
fn
,
number
,
precision
)
{
return
Math
[
fn
](
+
number
+
'e'
+
precision
)
/
Math
.
pow
(
10
,
precision
);
}
export
default
{
isArray
,
isObject
,
...
...
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