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
5368354a
Commit
5368354a
authored
May 24, 2021
by
卢均锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 采购竞价 增加规则&报价数字输入框限制
parent
13aa9fff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
10 deletions
+36
-10
bidRules.tsx
...chaseAbility/purchaseBid/readyAdd/components/bidRules.tsx
+30
-6
index.tsx
...agement/components/statusBox/detailBottomDrawer/index.tsx
+6
-4
No files found.
src/pages/transaction/purchaseAbility/purchaseBid/readyAdd/components/bidRules.tsx
View file @
5368354a
...
...
@@ -32,6 +32,10 @@ const BidRules: React.FC<Iprops> = (props: any) => {
const
[
isMinPrice
,
setIsMinPrice
]
=
useState
<
boolean
>
(
true
)
const
[
isOpenPurchase
,
setIsOpenPurchase
]
=
useState
<
boolean
>
(
false
)
const
[
isOpenRanking
,
setIsOpenRanking
]
=
useState
<
boolean
>
(
false
)
const
[
startingPrice
,
setStartingPrice
]
=
useState
<
any
>
(
''
);
const
[
targetPrice
,
setTargetPrice
]
=
useState
<
any
>
(
''
);
const
[
minPrice
,
setMinPrice
]
=
useState
<
any
>
(
''
);
const
[
allowPurchaseCount
,
setAllowPurchaseCount
]
=
useState
<
any
>
(
''
);
const
[
form
]
=
Form
.
useForm
();
useEffect
(()
=>
{
currentRef
.
current
=
{
...
...
@@ -72,6 +76,10 @@ const BidRules: React.FC<Iprops> = (props: any) => {
fetchdata
.
isMinPrice
!=
undefined
&&
setIsMinPrice
(
!!
fetchdata
.
isMinPrice
);
setIsOpenPurchase
(
!!
fetchdata
.
isOpenPurchase
);
setIsOpenRanking
(
!!
fetchdata
.
isOpenRanking
);
setStartingPrice
(
fetchdata
.
startingPrice
);
setTargetPrice
(
fetchdata
.
targetPrice
);
setMinPrice
(
fetchdata
.
minPrice
);
setAllowPurchaseCount
(
fetchdata
.
allowPurchaseCount
);
form
.
setFieldsValue
({
biddingTime
:
[
fetchdata
.
biddingStartTime
?
moment
(
fetchdata
.
biddingStartTime
)
:
''
,
fetchdata
.
biddingEndTime
?
moment
(
fetchdata
.
biddingEndTime
)
:
''
],
isStartingPrice
:
!!
fetchdata
.
isStartingPrice
,
...
...
@@ -104,9 +112,9 @@ const BidRules: React.FC<Iprops> = (props: any) => {
label=
'竞价时间'
name=
'biddingTime'
rules=
{
[
{
required
:
true
,
message
:
'请选择竞价时间'
},
()
=>
({
{
required
:
true
,
message
:
'请选择竞价时间'
},
()
=>
({
async
validator
(
_
,
value
)
{
let
_exVal
=
await
exRef
.
current
.
signUpTime
();
let
_exVal
=
await
exRef
.
current
.
signUpTime
();
if
(
_exVal
[
1
]
&&
moment
(
value
[
0
]).
isBefore
(
_exVal
[
1
]))
{
return
Promise
.
reject
(
new
Error
(
'竞价开始时间需要晚于报名截止时间'
));
}
...
...
@@ -159,7 +167,11 @@ const BidRules: React.FC<Iprops> = (props: any) => {
})
]
}
>
<
Input
addonBefore=
{
'¥'
}
/>
<
Input
addonBefore=
{
'¥'
}
value=
{
startingPrice
}
onChange=
{
(
e
)
=>
{
let
_val
=
e
.
target
.
value
.
replace
(
/^
\D
*
(\d
*
(?:\.\d
{0,2}
)?)
.*$/g
,
'$1'
);
setStartingPrice
(
_val
);
form
.
setFieldsValue
({
startingPrice
:
_val
});
}
}
/>
</
Form
.
Item
>)
}
<
Form
.
Item
label=
{
<
Tooltip
placement=
"right"
title=
'期望成交价格'
>
目标价
<
QuestionCircleOutlined
style=
{
{
marginLeft
:
'5px'
}
}
/></
Tooltip
>
}
...
...
@@ -192,7 +204,11 @@ const BidRules: React.FC<Iprops> = (props: any) => {
})
]
}
>
<
Input
addonBefore=
{
'¥'
}
/>
<
Input
addonBefore=
{
'¥'
}
value=
{
targetPrice
}
onChange=
{
(
e
)
=>
{
let
_val
=
e
.
target
.
value
.
replace
(
/^
\D
*
(\d
*
(?:\.\d
{0,2}
)?)
.*$/g
,
'$1'
);
setTargetPrice
(
_val
);
form
.
setFieldsValue
({
targetPrice
:
_val
});
}
}
/>
</
Form
.
Item
>)
}
<
Form
.
Item
label=
{
<
Tooltip
placement=
"right"
title=
'每次报价降价幅度须大于或等于最小价差'
>
最小价差
<
QuestionCircleOutlined
style=
{
{
marginLeft
:
'5px'
}
}
/></
Tooltip
>
}
...
...
@@ -225,7 +241,11 @@ const BidRules: React.FC<Iprops> = (props: any) => {
})
]
}
>
<
Input
addonBefore=
{
'¥'
}
/>
<
Input
addonBefore=
{
'¥'
}
value=
{
minPrice
}
onChange=
{
(
e
)
=>
{
let
_val
=
e
.
target
.
value
.
replace
(
/^
\D
*
(\d
*
(?:\.\d
{0,2}
)?)
.*$/g
,
'$1'
);
setMinPrice
(
_val
);
form
.
setFieldsValue
({
minPrice
:
_val
});
}
}
/>
</
Form
.
Item
>)
}
<
Form
.
Item
label=
{
<
Tooltip
placement=
"right"
title=
'允许每个供应商最多可以报价的次数'
>
允许报价次数
<
QuestionCircleOutlined
style=
{
{
marginLeft
:
'5px'
}
}
/></
Tooltip
>
}
...
...
@@ -252,7 +272,11 @@ const BidRules: React.FC<Iprops> = (props: any) => {
})
]
}
>
<
Input
/>
<
Input
value=
{
allowPurchaseCount
}
onChange=
{
(
e
)
=>
{
let
_val
=
e
.
target
.
value
.
replace
(
/
[^\d]
/g
,
''
).
replace
(
/^0{1,}/g
,
''
);
setAllowPurchaseCount
(
_val
);
form
.
setFieldsValue
({
allowPurchaseCount
:
_val
});
}
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
{
<
Tooltip
placement=
"right"
title=
'选择公开当前最低报价,竞价过程中将供应商所报当前最低价在竞价页面即时公开。'
>
公开当前最低报价
<
QuestionCircleOutlined
style=
{
{
marginLeft
:
'5px'
}
}
/></
Tooltip
>
}
...
...
src/pages/transaction/purchaseAbility/purchaseBid/readyBid/management/components/statusBox/detailBottomDrawer/index.tsx
View file @
5368354a
...
...
@@ -73,22 +73,24 @@ const DetailBottomDrawer: React.FC<DetailBottomDrawerProps> = (props: any) => {
]
const
_changeTax
=
(
record
:
any
,
value
:
any
)
=>
{
let
_val
=
value
.
replace
(
/^
\D
*
(\d
*
(?:\.\d{0,2})?)
.*$/g
,
'$1'
);
let
_dataSource
=
[...
dataSource2
];
const
_i
=
_dataSource
.
findIndex
((
item
)
=>
item
.
id
===
record
.
id
);
let
_item
=
{
...
_dataSource
[
_i
]
};
_item
.
taxRate
=
value
;
_item
.
isTax
=
value
!=
0
?
1
:
0
;
_item
.
taxRate
=
_val
;
_item
.
isTax
=
_val
!=
0
?
1
:
0
;
_dataSource
[
_i
]
=
_item
;
setDataSource
(
_dataSource
);
setDataSource2
(
_dataSource
)
}
const
_changeUnitPrice
=
(
record
:
any
,
value
:
any
)
=>
{
let
_val
=
value
.
replace
(
/^
\D
*
(\d
*
(?:\.\d{0,3})?)
.*$/g
,
'$1'
);
let
_dataSource
=
[...
dataSource2
];
const
_i
=
_dataSource
.
findIndex
((
item
)
=>
item
.
id
===
record
.
id
);
let
_item
=
{
...
_dataSource
[
_i
]
};
_item
.
unitPrice
=
value
;
_item
.
price
=
_calcTotal
(
value
,
_dataSource
[
_i
].
purchaseCount
);
_item
.
unitPrice
=
_val
;
_item
.
price
=
_calcTotal
(
_val
,
_dataSource
[
_i
].
purchaseCount
);
_dataSource
[
_i
]
=
_item
;
setDataSource
(
_dataSource
);
setDataSource2
(
_dataSource
)
...
...
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