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
shenshaokai
jinfa-platform
Commits
54b8379f
Commit
54b8379f
authored
Jan 03, 2023
by
shenshaokai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: bugID=36966 框架合同变更-补充合同数量校验
parent
54c39020
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
10 deletions
+32
-10
index.tsx
src/pages/contract/manage/QueryList/index.tsx
+1
-1
index.tsx
src/pages/contract/manage/details/index.tsx
+1
-0
FormList.tsx
src/pages/contract/manage/editing/components/FormList.tsx
+28
-9
index.tsx
src/pages/contract/manage/editing/index.tsx
+2
-0
No files found.
src/pages/contract/manage/QueryList/index.tsx
View file @
54b8379f
...
...
@@ -171,7 +171,7 @@ const QueryList = () => {
};
const
like
=
(
record
)
=>
{
history
.
push
(
`/memberCenter/contract/manage/QueryList/editing?contractId=
${
record
.
id
}
&oldContractId=1`
)
history
.
push
(
`/memberCenter/contract/manage/QueryList/editing?contractId=
${
record
.
id
}
&oldContractId=1
&contractChange=
${
record
.
sourceType
}
`
)
};
const
[
form
]
=
Form
.
useForm
();
const
[
id
,
setId
]
=
useState
(
''
);
...
...
src/pages/contract/manage/details/index.tsx
View file @
54b8379f
...
...
@@ -725,6 +725,7 @@ const Details = (props: any) => {
style={{
width: '100%',
}}
scroll={{ x: 1800 }}
pagination={{
current: current,
pageSize: 10,
...
...
src/pages/contract/manage/editing/components/FormList.tsx
View file @
54b8379f
...
...
@@ -23,7 +23,7 @@ const { Option } = Select;
const
{
Text
}
=
Typography
;
const
intl
=
getIntl
();
const
FormList
=
(
props
:
any
)
=>
{
const
{
currentRef
,
purchaseMaterielList
,
sourceType
,
form
,
deliveryType
,
totalAmountChange
}
=
props
;
const
{
currentRef
,
purchaseMaterielList
,
sourceType
,
form
,
deliveryType
,
totalAmountChange
,
contractChange
}
=
props
;
const
[
dataList
,
setData
]
=
useState
([])
const
[
selectData
,
setSelectData
]
=
useState
<
any
>
([])
const
[
isPurchaseModalVisible
,
setIsPurchaseModalVisible
]
=
useState
(
false
);
// 显示模态框
...
...
@@ -102,7 +102,7 @@ const FormList = (props: any) => {
placeholder=
""
onChange=
{
(
e
)
=>
setInput
(
e
,
'purchaseCount'
,
index
)
}
defaultValue=
{
record
.
purchaseCount
}
disabled=
{
[
1
,
2
,
3
].
includes
(
sourceType
)
}
//询价/招标/竞价不能改
disabled=
{
[
1
,
2
,
3
].
includes
(
sourceType
)
}
//询价/招标/竞价不能改
/>
</
Form
.
Item
>
},
...
...
@@ -119,7 +119,7 @@ const FormList = (props: any) => {
style=
{
{
width
:
80
}
}
defaultValue=
{
text
===
0
||
text
===
1
?
text
.
toString
()
:
''
}
onChange=
{
(
e
)
=>
setInput
(
e
,
'isHasTax'
,
index
)
}
disabled=
{
[
1
,
2
,
3
].
includes
(
sourceType
)
}
//询价/招标/竞价不能改
disabled=
{
[
1
,
2
,
3
].
includes
(
sourceType
)
}
//询价/招标/竞价不能改
>
<
Option
value=
"0"
key=
{
0
}
>
{
intl
.
formatMessage
({
id
:
'contract.fou'
})
}
</
Option
>
...
...
@@ -146,7 +146,7 @@ const FormList = (props: any) => {
defaultValue=
{
text
}
onChange=
{
(
e
)
=>
setInput
(
e
,
'taxRate'
,
index
)
}
addonAfter=
"%"
disabled=
{
[
1
,
2
,
3
].
includes
(
sourceType
)
}
//询价/招标/竞价不能改
disabled=
{
[
1
,
2
,
3
].
includes
(
sourceType
)
}
//询价/招标/竞价不能改
/>
</
Form
.
Item
>
...
...
@@ -170,7 +170,7 @@ const FormList = (props: any) => {
onChange=
{
(
e
)
=>
setInput
(
e
,
'price'
,
index
)
}
// addonBefore={intl.formatMessage({id: 'common.money'})}
defaultValue=
{
text
}
disabled=
{
[
1
,
2
,
3
].
includes
(
sourceType
)
}
//询价/招标/竞价不能改
disabled=
{
[
1
,
2
,
3
].
includes
(
sourceType
)
}
//询价/招标/竞价不能改
/>
</
Form
.
Item
>
...
...
@@ -183,7 +183,21 @@ const FormList = (props: any) => {
:
<
Form
.
Item
name=
{
`bidCount${record.id}${index}`
}
rules=
{
[{
required
:
true
,
message
:
intl
.
formatMessage
({
id
:
'contract.qingshuru'
})
}]
}
rules=
{
[
{
validator
(
rule
,
value
,
callback
)
{
if
(
!
value
)
{
callback
(
intl
.
formatMessage
({
id
:
'contract.qingshuru'
}))
}
// 框架合同变更需要做一下前端校验
if
(
contractChange
==
5
&&
Number
(
value
)
<
(
Number
(
record
.
oldBidCount
)
-
Number
(
record
.
quantity
)))
{
callback
(
`不能小于已生成订单数量${Number(record.oldBidCount) - Number(record.quantity)}`
)
return
;
}
callback
()
},
}
]
}
initialValue=
{
text
||
text
==
0
?
text
==
0
?
'0'
:
text
.
toString
()
:
''
}
>
<
Input
...
...
@@ -192,7 +206,7 @@ const FormList = (props: any) => {
}
}
onChange=
{
(
e
)
=>
setInput
(
e
,
'bidCount'
,
index
)
}
defaultValue=
{
text
?
text
:
''
}
disabled=
{
[
1
,
2
,
3
].
includes
(
sourceType
)
}
//询价/招标/竞价不能改
disabled=
{
[
1
,
2
,
3
].
includes
(
sourceType
)
}
//询价/招标/竞价不能改
/>
</
Form
.
Item
>
},
...
...
@@ -323,6 +337,12 @@ const FormList = (props: any) => {
i
.
deliveryMethodName
=
i
.
deliveryTypeName
i
.
deliveryMethod
=
i
.
deliveryType
i
.
materielNo
=
i
.
productNo
// 框架合同变更需要缓存一下数量字段,方便做校验
// oldBidCount字段是为了缓存一下bidCount值定义的,假如跟后端返回的字段冲突了,可以改成其他的
if
(
contractChange
==
5
)
{
i
.
oldBidCount
=
Number
(
i
.
bidCount
)
i
.
bidCount
=
Number
(
i
.
bidCount
)
-
Number
(
i
.
quantity
)
}
i
.
requisitionList
?.
map
(
ii
=>
{
ii
.
label
=
'old'
...
...
@@ -415,7 +435,7 @@ const FormList = (props: any) => {
const
setInput
=
(
e
,
name
,
idx
)
=>
{
let
flag
:
boolean
=
false
// 是否触发金额总值变化
let
item
:
any
=
[...
dataList
];
item
[
idx
][
name
]
=
e
?.
target
?.
value
||
e
item
[
idx
][
name
]
=
e
?.
target
?.
value
??
e
item
[
idx
].
bidAmount
=
item
[
idx
].
bidCount
&&
item
[
idx
].
price
?
(
Number
(
item
[
idx
].
bidCount
)
*
Number
(
item
[
idx
].
price
)).
toFixed
(
2
)
:
0
;
setData
(
item
)
...
...
@@ -548,7 +568,6 @@ const FormList = (props: any) => {
let
res
=
newoldData
.
concat
(
handlePurchaseData
(
newData
.
filter
(
i
=>
!
i
.
existed
)))
let
nowList
=
list
?.
length
>
0
?
res
:
newoldData
console
.
log
(
list
,
'list'
);
nowList
.
map
((
i
,
k
)
=>
{
i
.
newId
=
i
.
newId
||
i
.
prpId
...
...
src/pages/contract/manage/editing/index.tsx
View file @
54b8379f
...
...
@@ -31,6 +31,7 @@ const Editing: React.FC<{}> = (props: any) => {
query
:
{
contractId
,
// 寻源类型
oldContractId
,
contractChange
}
}
}
=
props
;
const
currentBasic
=
useRef
<
any
>
({});
const
purchaseMate
=
useRef
<
any
>
([])
...
...
@@ -287,6 +288,7 @@ const Editing: React.FC<{}> = (props: any) => {
purchaseMaterielList=
{
purchaseMaterielList
}
deliveryType=
{
deliveryType
}
totalAmountChange=
{
(
num
)
=>
setPrice
(
num
)
}
contractChange=
{
contractChange
}
/>
},
{
...
...
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