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
7d6d2496
Commit
7d6d2496
authored
Aug 20, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat: 二次询价
parent
d8ca1d03
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
154 additions
and
62 deletions
+154
-62
productInquiry.ts
config/routes/dealAbilityRoute/productInquiry.ts
+8
-0
index.ts
config/routes/index.ts
+4
-2
index.tsx
src/components/AddressSelect/index.tsx
+0
-0
index.tsx
...nsaction/dealAbility/inquiryOffer/inquirySearch/index.tsx
+2
-2
addForm.tsx
...ion/dealAbility/productInquiry/waitAddInquiry/addForm.tsx
+100
-55
basicInfo.tsx
...ty/productInquiry/waitAddInquiry/components/basicInfo.tsx
+0
-2
tradeTerms.tsx
...y/productInquiry/waitAddInquiry/components/tradeTerms.tsx
+6
-1
two.tsx
...saction/dealAbility/productInquiry/waitAddInquiry/two.tsx
+34
-0
No files found.
config/routes/dealAbilityRoute/productInquiry.ts
View file @
7d6d2496
...
...
@@ -37,6 +37,14 @@ export default [
hideInMenu
:
true
,
noMargin
:
true
,
},
{
/** 二次询价 */
path
:
'/memberCenter/tranactionAbility/productInquiry/waitAddInquiry/two'
,
name
:
'二次询价'
,
hideInMenu
:
true
,
noMargin
:
true
,
component
:
'@/pages/transaction/dealAbility/productInquiry/waitAddInquiry/two'
},
// 立即询价 - 从商城跳转而来;
{
path
:
'/memberCenter/tranactionAbility/productInquiry/waitAddInquiry/rfq'
,
...
...
config/routes/index.ts
View file @
7d6d2496
...
...
@@ -8,12 +8,13 @@
// import MemberRoute from './memberRoute' // 会员能力路由
// import ShopRoute from './shopRoute' // 店铺能力路由
// import ChannelRoute from './channelRoute' // 渠道能力路由
import
TranactionRoute
from
'./tranactionRoute'
// 交易能力路由
//
import TranactionRoute from './tranactionRoute' // 交易能力路由
// import LogisticsRoute from './logisticsRoutes' // 物流能力路由
import
PayandSettleRoute
from
'./payandSettle'
//支付与结算
//
import PayandSettleRoute from './payandSettle' //支付与结算
// import AuthConfigRoute from './authConfigRoute'
// import AfterService from './afterServiceRoute' // 售后
// import HandlingRoute from './handlingRoute'; // 加工能力
import
DealAbilityRoute
from
'./dealAbilityRoute'
;
//
import
asyncRoutes
from
'../router.config.json'
;
// import ProcurementRoute from './procurementRoute';
// import { callForBidsRoute } from './procurementRoute/callForBids';
...
...
@@ -79,6 +80,7 @@ const memberCenterRoute = {
// HandlingRoute,
// PayandSettleRoute,
// marketingRoute,
DealAbilityRoute
,
...
asyncRoutes
,
{
path
:
'/memberCenter/noAuth'
,
...
...
src/components/AddressSelect/index.tsx
View file @
7d6d2496
This diff is collapsed.
Click to expand it.
src/pages/transaction/dealAbility/inquiryOffer/inquirySearch/index.tsx
View file @
7d6d2496
...
...
@@ -29,7 +29,7 @@ const InquirySearch = () => {
setAuth
(
res
.
data
);
setRouters
(
res
.
data
.
urls
);
setTimeout
(()
=>
{
window
.
location
.
replace
(
`/memberCenter/tranactionAbility/productInquiry/waitAddInquiry/
add
?id=
${
id
}
`
);
window
.
location
.
replace
(
`/memberCenter/tranactionAbility/productInquiry/waitAddInquiry/
two
?id=
${
id
}
`
);
},
800
);
}).
catch
(
err
=>
{})
}
...
...
@@ -84,7 +84,7 @@ const InquirySearch = () => {
{
record
.
isShowQuote
&&
(
<
Button
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/inquiryOffer/waitAddOffer/offer?id=${record.id}`
)
}
type=
'link'
>
报价
</
Button
>
)
}
{
record
.
isShowSecondInquiry
&&
(
{
(
record
.
isShowSecondInquiry
)
&&
(
<
Button
type=
'link'
onClick=
{
()
=>
secondInquiry
(
record
.
id
)
}
>
二次询价
</
Button
>
)
}
</>
...
...
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/addForm.tsx
View file @
7d6d2496
import
React
,
{
useState
,
Fragment
,
useEffect
}
from
"react"
;
import
React
,
{
useState
,
Fragment
,
useEffect
,
useCallback
}
from
"react"
;
import
{
Form
,
Button
,
message
}
from
"antd"
;
import
{
history
,
Prompt
}
from
'umi'
;
import
moment
from
'moment'
;
...
...
@@ -10,6 +10,7 @@ import { SaveOutlined } from "@ant-design/icons";
import
AttachLayout
from
"./components/attach"
;
import
{
getCookie
}
from
'@/utils/cookie'
import
{
PublicApi
}
from
"@/services/api"
;
import
{
isEmpty
}
from
"lodash"
;
const
layout
:
any
=
{
colon
:
false
,
...
...
@@ -28,10 +29,12 @@ interface AddedFormLayoutProps {
spam
?:
string
,
/** 标题 */
title
?:
string
,
/** 二次询价 */
two
?:
boolean
,
}
const
AddedFormLayout
:
React
.
FC
<
AddedFormLayoutProps
>
=
(
props
:
any
)
=>
{
const
{
isEdit
,
id
,
fetchRequest
,
spam
,
title
}
=
props
;
const
{
isEdit
,
id
,
fetchRequest
,
spam
,
title
,
two
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
)
const
[
unsaved
,
setUnsaved
]
=
useState
<
boolean
>
(
false
);
...
...
@@ -61,8 +64,8 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
otherRequire
:
res
.
otherRequire
,
enclosureUrls
:
res
.
enclosureUrls
,
inquiryListProductRequests
:
res
.
inquiryListProductRequests
,
contact
s
:
res
.
contacts
,
contact
sPhone
:
res
.
contacts
Phone
,
contact
Name
:
res
.
contactName
,
contact
Phone
:
res
.
contact
Phone
,
phoneCode
:
res
.
phoneCode
,
shopId
:
res
.
shopId
,
}
...
...
@@ -100,7 +103,6 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
}
const
getFullAddress
=
(
info
)
=>
{
console
.
log
(
info
)
const
address
=
{
fullAddress
:
`
${
info
.
name
}
${
info
.
fullAddress
}
${
info
.
phone
}
`
,
fullAddressId
:
info
.
id
,
...
...
@@ -141,60 +143,96 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
const
getContacts
=
(
value
)
=>
{
form
.
setFieldsValue
({
"contact
s
"
:
value
.
name
,
'contact
s
Phone'
:
value
.
phone
,
'phoneCode'
:
86
,
"contact
Name
"
:
value
.
name
,
'contactPhone'
:
value
.
phone
,
'phoneCode'
:
value
.
phoneCode
,
});
}
const
init
=
async
()
=>
{
if
(
isEdit
&&
spam
)
{
// const data: any = JSON.parse(sessionStorage.getItem(spam));
const
data
:
any
=
await
getCacheOrderInfoByKey
(
spam
)
if
(
!
data
)
return
/** B端跳来询价 */
const
handleB2B
=
async
()
=>
{
const
data
:
any
=
await
getCacheOrderInfoByKey
(
spam
)
if
(
!
data
)
return
const
inquiryListProductRequests
:
any
[]
=
[];
inquiryListProductRequests
.
push
({
commodityId
:
id
,
productId
:
data
.
id
,
imgUrl
:
data
.
imgUrl
,
productName
:
data
.
name
,
category
:
data
.
category
,
brand
:
data
.
brand
.
name
,
unit
:
data
.
unitName
,
purchaseCount
:
1
,
logistics
:
data
.
logistics
,
memberId
:
data
.
memberId
,
memberRoleId
:
data
.
memberRoleId
,
taxRate
:
data
.
taxRate
,
})
setMenberInfo
({
memberId
:
data
.
memberId
,
roleId
:
data
.
memberRoleId
,
roleName
:
data
.
memberName
,
})
form
.
setFieldsValue
({
...
data
,
logistics
:
''
,
"inquiryListProductRequests"
:
inquiryListProductRequests
})
setInquiryProduct
(
inquiryListProductRequests
)
}
/** 二次询价 */
const
handleInquiry
=
async
()
=>
{
await
PublicApi
.
getTransactionInquiryListDetails
({
id
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
}
const
{
data
}
=
res
;
const
inquiryListProductRequests
:
any
[]
=
[];
inquiryListProductRequests
.
push
({
commodityId
:
id
,
productId
:
data
.
id
,
imgUrl
:
data
.
imgUrl
,
productName
:
data
.
name
,
category
:
data
.
category
,
brand
:
data
.
brand
.
name
,
unit
:
data
.
unitName
,
purchaseCount
:
1
,
logistics
:
data
.
logistics
,
memberId
:
data
.
memberId
,
memberRoleId
:
data
.
memberRoleId
,
taxRate
:
data
.
taxRate
,
})
setMenberInfo
({
memberId
:
data
.
memberId
,
roleId
:
data
.
memberRoleId
,
roleName
:
data
.
memberName
,
})
form
.
setFieldsValue
({
...
data
,
logistics
:
''
,
"inquiryListProductRequests"
:
inquiryListProductRequests
})
setInquiryProduct
(
inquiryListProductRequests
)
}
else
if
(
isEdit
)
{
PublicApi
.
getTransactionInquiryListDetails
({
id
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
}
const
{
data
}
=
res
;
setEnclosureUrls
(
data
.
enclosureUrls
)
setFullAddress
()
if
(
two
)
{
PublicApi
.
getTransactionInquiryGetUpperMemberCommodity
({
inquiryId
:
id
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
}
res
.
data
.
commodityList
.
forEach
(
item
=>
{
inquiryListProductRequests
.
push
({
commodityId
:
item
.
commodityId
,
productId
:
item
.
goodsId
,
imgUrl
:
item
.
mainPic
,
productName
:
item
.
name
,
category
:
item
.
customerCategoryName
,
brand
:
item
.
brandName
,
unit
:
item
.
unitName
,
purchaseCount
:
1
,
logistics
:
''
,
memberId
:
item
.
memberId
,
memberRoleId
:
item
.
memberRoleId
,
taxRate
:
item
.
taxRate
})
})
setMenberInfo
({
memberId
:
res
.
data
.
memberId
,
roleId
:
res
.
data
.
memberRoleId
,
roleName
:
res
.
data
.
memberName
,
})
setInquiryProduct
(
inquiryListProductRequests
)
})
form
.
setFieldsValue
({
...
data
,
deliveryTime
:
moment
(
data
.
deliveryTime
),
quotationAsTime
:
moment
(
data
.
quotationAsTime
),
"inquiryListProductRequests"
:
inquiryListProductRequests
,
"enclosureUrls"
:
data
.
enclosureUrls
,
})
}
else
{
setMenberInfo
({
memberId
:
data
.
memberId
,
roleId
:
data
.
memberRoleId
,
roleName
:
data
.
memberName
,
})
setFullAddress
({
fullAddress
:
data
.
fullAddress
,
fullAddressId
:
data
.
fullAddressId
,
})
setInquiryProduct
(
data
.
inquiryListProductRequests
)
setEnclosureUrls
(
data
.
enclosureUrls
)
form
.
setFieldsValue
({
...
res
.
data
,
deliveryTime
:
moment
(
data
.
deliveryTime
),
...
...
@@ -202,14 +240,21 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
"inquiryListProductRequests"
:
data
.
inquiryListProductRequests
,
"enclosureUrls"
:
data
.
enclosureUrls
,
})
}).
catch
(
error
=>
{
console
.
warn
(
error
)
})
}
}
})
}
/** 回显数据 */
const
handleEcho
=
useCallback
(
async
()
=>
{
if
(
isEdit
&&
spam
)
{
handleB2B
();
}
else
if
(
isEdit
)
{
handleInquiry
()
}
},
[
isEdit
])
useEffect
(()
=>
{
init
()
handleEcho
()
},
[
isEdit
])
return
(
...
...
@@ -244,7 +289,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
}
}
}
>
<
BasicInfoLatyout
getMemberInfo=
{
getMemberInfo
}
memb=
{
memberInfo
}
isEdit=
{
spam
}
/>
<
BasicInfoLatyout
getMemberInfo=
{
getMemberInfo
}
memb=
{
memberInfo
}
isEdit=
{
spam
||
two
}
/>
<
InquiryProductLayout
getInquiryProduct=
{
getInquiryProduct
}
member=
{
memberInfo
}
setInquiryProduct=
{
inquiryProduct
}
/>
<
TradeTermsLayout
getFullAddress=
{
getFullAddress
}
getContacts=
{
getContacts
}
fullAddress=
{
fullAddress
}
/>
<
AttachLayout
enclosureUrls=
{
enclosureUrls
}
getEnclosureUrls=
{
getEnclosureUrls
}
removeEnclosureUrls=
{
removeEnclosureUrls
}
/>
...
...
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/components/basicInfo.tsx
View file @
7d6d2496
...
...
@@ -58,7 +58,6 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
let
shopList
=
GlobalConfig
.
web
.
shopInfo
.
filter
(
v
=>
(
v
.
type
==
1
&&
v
.
environment
==
1
)).
map
(
v
=>
v
)
console
.
log
(
shopList
,
962039
)
setStoreList
(
shopList
)
},
[])
...
...
@@ -94,7 +93,6 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
useEffect
(()
=>
{
if
(
!
isEmpty
(
memb
))
{
console
.
log
(
memb
,
'memb'
)
setMember
(
memb
)
}
},
[
memb
])
...
...
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/components/tradeTerms.tsx
View file @
7d6d2496
...
...
@@ -85,6 +85,10 @@ const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
}
useEffect
(()
=>
{
fetchTelCode
()
},
[])
useEffect
(()
=>
{
if
(
!
isEmpty
(
fullAddress
))
{
setaddress
({
id
:
fullAddress
.
fullAddressId
,
...
...
@@ -133,10 +137,11 @@ const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
<
Form
.
Item
name=
'phoneCode'
rules=
{
[{
required
:
true
,
message
:
'请选择'
}]
}
initialValue=
{
telCode
[
0
]
}
>
<
Select
>
{
telCode
.
map
(
item
=>
(
<
Select
.
Option
value=
{
item
}
>
{
item
}
</
Select
.
Option
>
<
Select
.
Option
key=
{
item
}
value=
{
item
}
>
{
item
}
</
Select
.
Option
>
))
}
</
Select
>
</
Form
.
Item
>
...
...
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/two.tsx
0 → 100644
View file @
7d6d2496
import
React
,
{
useCallback
,
useEffect
,
useState
}
from
'react'
;
import
AddForm
from
'./addForm'
;
import
{
history
}
from
'umi'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
isEmpty
}
from
'lodash'
;
const
RfqEnquiryOrder
=
(
props
:
any
)
=>
{
const
{
id
}
=
history
.
location
.
query
;
const
[
spam
,
setSpam
]
=
useState
<
any
>
({});
const
handleGetSpam
=
useCallback
(
async
()
=>
{
await
PublicApi
.
getTransactionInquiryGetUpperMemberCommodity
({
inquiryId
:
id
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
}
setSpam
(
res
.
data
)
})
},
[])
useEffect
(()
=>
{
handleGetSpam
()
},
[])
return
(
<
AddForm
id=
{
id
}
isEdit
title=
{
props
.
route
.
name
}
fetchRequest=
{
PublicApi
.
postTransactionInquiryListAdd
}
two
/>
)
}
export
default
RfqEnquiryOrder
;
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