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
bf243c27
Commit
bf243c27
authored
Apr 25, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix: 修复采购报价BUG
parent
b3ab0260
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
31 deletions
+61
-31
index.tsx
...seAbility/components/detail/components/bidTable/index.tsx
+1
-1
index.less
...ty/components/detail/components/contrastLyout1/index.less
+0
-0
index.tsx
...ity/components/detail/components/contrastLyout1/index.tsx
+37
-19
index.tsx
...saction/purchaseAbility/components/detail/modal/index.tsx
+5
-6
index.tsx
...ansaction/purchaseAbility/confirmOffer/contrast/index.tsx
+9
-1
index.tsx
...transaction/purchaseAbility/confirmOffer/demand/index.tsx
+2
-2
add.tsx
...ages/transaction/purchaseAbility/offter/addOffter/add.tsx
+5
-0
offer.tsx
...ion/purchaseAbility/offter/addOffter/components/offer.tsx
+2
-2
No files found.
src/pages/transaction/purchaseAbility/components/detail/components/bidTable/index.tsx
View file @
bf243c27
...
...
@@ -203,7 +203,7 @@ const BidTable: React.FC<ReduxProps> = (props: any) => {
style=
{
{
marginBottom
:
0
,
display
:
'none'
}
}
rules=
{
[{
required
:
true
,
message
:
`
`
,
message
:
``
,
}]
}
>
<
InputNumber
...
...
src/pages/transaction/purchaseAbility/components/detail/components/contrastLyout1/index.less
0 → 100644
View file @
bf243c27
src/pages/transaction/purchaseAbility/components/detail/components/contrastLyout1/index.tsx
View file @
bf243c27
...
...
@@ -6,7 +6,6 @@ import { Space, Button, Tabs, message, Row, Col, Typography, Skeleton, Divider,
import
{
FilePdfOutlined
}
from
'@ant-design/icons'
;
import
RowLayout
from
'./rowLayout'
;
import
{
Context
,
BidDetailContext
}
from
'../context'
;
import
{
useBidTable
}
from
'../../../effects/useBidTable'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
ModalOperate
from
'../../../modalOperate'
;
import
BidTable
from
'../bidTable'
;
...
...
@@ -57,7 +56,9 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
const
[
visible
,
setVisible
]
=
useState
<
boolean
>
(
false
);
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
const
[
disabled
,
setDisabled
]
=
useState
<
boolean
>
(
false
);
const
[
rowSource
,
setRowSource
]
=
useState
<
any
>
([]);
/** 当前为 contrast 并且轮数不等于当前报价轮数 */
const
[
bool
,
setBool
]
=
useState
<
boolean
>
(
false
);
const
[
rowSource
,
setRowSource
]
=
useState
<
any
>
({});
/** 当前tab的报价轮次 */
const
[
tabIdx
,
setTabIdx
]
=
useState
<
string
>
(
turn
);
/** 当前报价单是否加密 */
...
...
@@ -80,7 +81,8 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
}
/** 格式化数据 */
const
formatting
=
(
data
:
any
)
=>
{
const
formatting
=
(
data
:
any
,
index
:
number
)
=>
{
console
.
log
(
index
,
10086
)
const
arr
:
any
=
data
[
0
].
awardInfoResponses
.
sort
((
a
,
b
)
=>
{
return
a
.
goodsId
-
b
.
goodsId
})
||
[]
const
params
:
any
=
[];
arr
.
forEach
((
i
:
any
,
index
:
number
)
=>
{
...
...
@@ -125,16 +127,15 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
params
.
push
(
item
);
})
const
dataSoure
=
{
...
soure
}
dataSoure
[
i
d
x
]
=
[...
params
]
dataSoure
[
i
nde
x
]
=
[...
params
]
setSoure
(
dataSoure
);
if
(
preview
)
{
redux
(
params
)
console
.
log
(
params
,
data
)
}
}
/** 点击比价 */
const
offContrastPrice
=
async
(
num
:
string
,
key
:
number
)
=>
{
const
offContrastPrice
=
async
(
num
:
string
,
key
:
number
,
i
:
number
)
=>
{
if
(
key
===
PRICECONTRAST_TYPE
.
UNENCRYPTED
)
{
handleFlag
(
true
)
const
params
=
{
...
...
@@ -145,7 +146,7 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
if
(
res
.
code
===
1000
)
{
const
{
data
}
=
res
;
if
(
data
.
length
>
0
)
{
formatting
(
data
);
formatting
(
data
,
i
);
}
else
{
message
.
error
(
'当前暂无比价信息'
);
setDisabled
(
true
);
...
...
@@ -165,8 +166,12 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
}
}
/** 获取报价会员信息 */
const
fetchTableData
=
async
(
t
:
string
)
=>
{
/** 获取报价会员信息
* t: 轮次
* i: 当前tab 下标
*/
const
fetchTableData
=
async
(
t
:
string
,
i
?:
number
)
=>
{
console
.
log
(
i
)
const
params
=
{
id
,
turn
:
t
,
...
...
@@ -177,25 +182,33 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
return
}
const
{
data
}
=
res
.
data
;
const
params
=
{
...
rowSource
};
params
[
i
]
=
[...
data
]
if
(
data
.
length
>
0
)
{
setEncrypt
(
data
[
0
].
isDecrypt
);
setRowSource
(
data
);
setRowSource
(
params
);
/**
* 1. 比价的 需要 报价轮次不等于当前(表示已经报过假的) 并且preview 为 false 就要显示比价信息
* 2. preview 为 ture 表示查看详情的 立即调用比价接口
*/
const
index
=
i
?
i
:
idx
if
(
t
!==
turn
&&
!
preview
)
{
offContrastPrice
(
t
,
data
[
0
].
isDecrypt
)
offContrastPrice
(
t
,
data
[
0
].
isDecrypt
,
index
)
}
else
if
(
preview
)
{
offContrastPrice
(
t
,
data
[
0
].
isDecrypt
)
offContrastPrice
(
t
,
data
[
0
].
isDecrypt
,
index
)
}
}
else
{
const
param
=
{
...
soure
}
param
[
i
]
=
null
,
setSoure
(
param
);
setRowSource
(
params
);
}
})
}
useEffect
(()
=>
{
if
(
turn
)
{
fetchTableData
(
turn
);
fetchTableData
(
turn
,
idx
);
handleTurn
(
turn
)
}
},
[
turn
])
...
...
@@ -204,12 +217,17 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
const
getQuotedPriceInfo
=
(
item
:
string
)
=>
{
const
num
=
item
.
split
(
'-'
)[
0
];
const
index
=
item
.
split
(
'-'
)[
1
];
setIdx
(
Number
(
index
));
setTabIdx
(
num
);
const
params
=
{
...
soure
};
if
(
!
preview
&&
num
!==
turn
)
{
setBool
(
true
)
}
else
{
setBool
(
false
)
}
if
(
!
params
[
index
])
{
fetchTableData
(
num
);
fetchTableData
(
num
,
Number
(
index
)
);
}
setIdx
(
Number
(
index
));
}
const
handleSubmit
=
(
type
:
string
)
=>
{
...
...
@@ -236,7 +254,7 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
title=
'报价信息'
extra=
{
<>
{
(
tabIdx
===
turn
&&
preview
!==
'preview'
)
&&
{
(
tabIdx
===
turn
&&
!
preview
)
&&
<
Space
>
<
Button
onClick=
{
()
=>
handleSubmit
(
'next'
)
}
>
发起下轮报价
</
Button
>
{
encrypt
===
PRICECONTRAST_TYPE
.
UNDECRYPTED
&&
...
...
@@ -246,7 +264,7 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
<
Button
type=
'primary'
disabled=
{
disabled
}
onClick=
{
()
=>
offContrastPrice
(
tabIdx
,
encrypt
)
}
onClick=
{
()
=>
offContrastPrice
(
tabIdx
,
encrypt
,
idx
)
}
>
立即比价
</
Button
>
...
...
@@ -262,7 +280,7 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
data
-
index=
{
index
}
tab=
{
`第${chNum[item]}轮`
}
>
{
rowSource
.
length
>
0
?
<
RowLayout
rowSource=
{
rowSource
}
/>
:
{
(
rowSource
[
idx
]
&&
rowSource
[
idx
].
length
>
0
)
?
<
RowLayout
rowSource=
{
rowSource
[
idx
]
}
/>
:
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
}
<
Skeleton
...
...
@@ -276,7 +294,7 @@ const ContrastLyout1: React.FC<IProps> = (props: any) => {
<
Divider
type=
'vertical'
className=
{
style
.
vertical
}
/>
比价信息
</
div
>
<
BidTable
preview=
{
preview
}
redux=
{
reduxFetch
}
/>
<
BidTable
preview=
{
bool
?
bool
:
preview
}
redux=
{
reduxFetch
}
/>
</>
)
}
</
Tabs
.
TabPane
>
...
...
src/pages/transaction/purchaseAbility/components/detail/modal/index.tsx
View file @
bf243c27
...
...
@@ -115,12 +115,11 @@ const BidModal: React.FC<IProps> = (props: any) => {
urls
:
files
,
priceParityInfos
,
}
console
.
log
(
priceParityInfos
,
962200
)
// PublicApi.postPurchaseConfirmQuotedPriceSubmitContrastPrice(params).then(res => {
// if (res.code === 1000) {
// handleConfirm();
// }
// })
PublicApi
.
postPurchaseConfirmQuotedPriceSubmitContrastPrice
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
handleConfirm
();
}
})
}
catch
(
errInfo
)
{
console
.
log
(
'Save failed:'
,
errInfo
);
}
...
...
src/pages/transaction/purchaseAbility/confirmOffer/contrast/index.tsx
View file @
bf243c27
...
...
@@ -83,7 +83,15 @@ const ContrastPrice = () => {
{
col
:
[
{
label
:
'单据时间'
,
extra
:
format
(
data
.
createTime
)
},
{
label
:
'适用地市'
,
extra
:
'-'
},
{
label
:
'适用地市'
,
extra
:
(
<
div
>
{
data
.
areas
.
map
((
it
:
any
,
idx
:
number
)
=>
(
<
p
key=
{
`areas${idx + 1}`
}
>
{
`${it.province}/${it.city}`
}
</
p
>
))
}
</
div
>
)
},
]
},
])
...
...
src/pages/transaction/purchaseAbility/confirmOffer/demand/index.tsx
View file @
bf243c27
...
...
@@ -86,8 +86,8 @@ const DemandDetailed = () => {
{
label
:
'适用地市'
,
extra
:
(
<
div
>
{
areas
.
map
((
item
:
any
,
inde
x
:
number
)
=>
(
<
p
key=
{
`areas${i
ndex + 1}`
}
>
{
item
}
</
p
>
{
data
.
areas
.
map
((
it
:
any
,
id
x
:
number
)
=>
(
<
p
key=
{
`areas${i
dx + 1}`
}
>
{
`${it.province}/${it.city}`
}
</
p
>
))
}
</
div
>
)
...
...
src/pages/transaction/purchaseAbility/offter/addOffter/add.tsx
View file @
bf243c27
...
...
@@ -54,6 +54,7 @@ const AddForm = () => {
const
explainInfo
:
any
=
{
...
explain
};
const
fileInfo
:
any
=
{
...
file
};
basicInfo
.
id
=
params
.
purchaseInquiryId
||
params
.
id
;
basicInfo
.
quotedPriceId
=
params
.
quotedPriceId
basicInfo
.
number
=
params
.
purchaseInquiryNo
;
basicInfo
.
contacts
=
params
.
contacts
;
basicInfo
.
purchaseInquiryNo
=
params
.
purchaseInquiryNo
;
...
...
@@ -118,6 +119,10 @@ const AddForm = () => {
}
});
}
else
{
console
.
log
(
basic
)
if
(
basic
.
quotedPriceId
)
{
params
.
quotedPriceId
=
basic
.
quotedPriceId
}
params
.
purchaseInquiryId
=
id
;
params
.
purchaseInquiryNo
=
number
;
params
.
memberName
=
name
;
...
...
src/pages/transaction/purchaseAbility/offter/addOffter/components/offer.tsx
View file @
bf243c27
...
...
@@ -160,7 +160,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
title
:
'金额(含税)'
,
key
:
'taxPrice'
,
dataIndex
:
'taxPrice'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Text
>
{
Number
(
record
.
purchaseCount
)
*
Number
(
record
.
taxUnitPrice
)
}
</
Text
>
render
:
(
text
:
any
,
record
:
any
)
=>
<
Text
>
{
isNaN
(
Number
(
record
.
purchaseCount
)
*
Number
(
record
.
taxUnitPrice
))
?
0
:
Number
(
record
.
purchaseCount
)
*
Number
(
record
.
taxUnitPrice
)
}
</
Text
>
},
{
title
:
'操作'
,
...
...
@@ -259,7 +259,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
aCount
=
1
}
if
(
name
===
'edit'
)
{
aCount
=
fetchdata
.
count
?
(
fetchdata
.
count
+
1
)
:
1
;
aCount
=
fetchdata
.
turn
?
(
fetchdata
.
count
+
1
)
:
1
;
}
form
.
setFieldsValue
({
count
:
aCount
...
...
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