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
bb9144f8
Commit
bb9144f8
authored
Aug 13, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into v2
parents
7d54e0c7
3555a3d1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
8 deletions
+50
-8
index.tsx
...ransaction/dealAbility/confirmOffer/offerSearch/index.tsx
+2
-1
index.tsx
...nsaction/dealAbility/inquiryOffer/inquirySearch/index.tsx
+24
-3
add.tsx
...saction/dealAbility/productInquiry/waitAddInquiry/add.tsx
+4
-0
inquiryProduct.tsx
...oductInquiry/waitAddInquiry/components/inquiryProduct.tsx
+3
-0
auth.ts
src/utils/auth.ts
+13
-0
request.ts
src/utils/request.ts
+4
-4
No files found.
src/pages/transaction/dealAbility/confirmOffer/offerSearch/index.tsx
View file @
bb9144f8
import
React
,
{
useRef
}
from
'react'
;
import
Table
from
'@/pages/transaction/components/TableLayout'
;
import
{
history
}
from
'umi'
;
import
{
Tag
,
Badge
}
from
'antd'
;
import
{
Tag
,
Badge
,
Button
}
from
'antd'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
moment
from
'moment'
;
...
...
@@ -70,6 +70,7 @@ const OfferSearch = () => {
title
:
'操作'
,
key
:
'operate'
,
dataIndex
:
'operate'
,
render
:
(
_
,
record
)
=>
record
.
isShowPurchaseOrder
&&
<
Button
type=
'link'
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/b2b/add?modelType=3`
)
}
>
创建采购订单
</
Button
>
}
];
...
...
src/pages/transaction/dealAbility/inquiryOffer/inquirySearch/index.tsx
View file @
bb9144f8
...
...
@@ -8,6 +8,7 @@ import moment from 'moment';
import
{
PublicApi
}
from
'@/services/api'
;
import
{
INQUIRYSEARCHSCHEMA
}
from
'./schema'
;
import
{
EXTERNALSTATE_COLOR
}
from
'@/pages/transaction/components/stateColor'
;
import
{
setAuth
,
setRouters
}
from
'@/utils/auth'
;
const
InquirySearch
=
()
=>
{
...
...
@@ -17,6 +18,22 @@ const InquirySearch = () => {
return
<>
{
moment
(
text
).
format
(
fmt
||
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
/** 二次询价 */
const
secondInquiry
=
(
id
)
=>
{
PublicApi
.
postMemberLoginSwitchrole
({
memberRoleId
:
11
,
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
}
setAuth
(
res
.
data
);
setRouters
(
res
.
data
.
urls
);
setTimeout
(()
=>
{
window
.
location
.
replace
(
`/memberCenter/tranactionAbility/productInquiry/waitAddInquiry/add?id=
${
id
}
`
);
},
800
);
}).
catch
(
err
=>
{})
}
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'询价单号'
,
...
...
@@ -63,9 +80,13 @@ const InquirySearch = () => {
title
:
'操作'
,
key
:
'options'
,
dataIndex
:
'options'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<>
<
Button
disabled=
{
record
.
isQuoted
===
1
}
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/inquiryOffer/waitAddOffer/offer?id=${record.id}`
)
}
type=
'link'
>
报价
</
Button
>
<
Button
disabled=
{
record
.
isQuoted
===
1
}
type=
'link'
>
二次询价
</
Button
>
render
:
(
_text
:
any
,
record
:
any
)
=>
<>
{
record
.
isShowQuote
&&
(
<
Button
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/inquiryOffer/waitAddOffer/offer?id=${record.id}`
)
}
type=
'link'
>
报价
</
Button
>
)
}
{
record
.
isShowSecondInquiry
&&
(
<
Button
type=
'link'
onClick=
{
()
=>
secondInquiry
(
record
.
id
)
}
>
二次询价
</
Button
>
)
}
</>
}
];
...
...
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/add.tsx
View file @
bb9144f8
import
React
from
'react'
;
import
AddForm
from
'./addForm'
;
import
{
history
}
from
'umi'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
AddEnquiryOrder
=
(
props
:
any
)
=>
{
const
{
id
}
=
history
.
location
.
query
;
return
(
<
AddForm
id=
{
id
}
isEdit=
{
id
&&
true
}
title=
{
props
.
route
.
name
}
fetchRequest=
{
PublicApi
.
postTransactionInquiryListAdd
}
/>
...
...
src/pages/transaction/dealAbility/productInquiry/waitAddInquiry/components/inquiryProduct.tsx
View file @
bb9144f8
...
...
@@ -143,6 +143,9 @@ const InquiryProductLayout: React.FC<InquiryProductLayoutProps> = (props: any) =
memberRoleId
:
v
.
memberRoleId
,
imgUrl
:
v
.
mainPic
,
taxRate
:
v
.
taxRate
,
upperCommoditySkuId
:
v
.
commodityUnitPriceAndPicId
,
upperMemberId
:
v
.
upperMemberId
,
upperMemberRoleId
:
v
.
upperMemberRoleId
,
})
})
resolve
({
...
...
src/utils/auth.ts
View file @
bb9144f8
...
...
@@ -47,6 +47,19 @@ export const setLocalAuth = (info: AuthInfo) => {
window
.
localStorage
.
setItem
(
AUTH_KEY
,
JSON
.
stringify
(
info
))
}
export
const
getCookieAuth
=
():
AuthInfo
=>
{
try
{
const
cookieAuth
:
AuthInfo
=
getCookie
(
AUTH_KEY
)
as
unknown
as
AuthInfo
// return (localAuth || {}) as AuthInfo
if
(
cookieAuth
)
{
return
cookieAuth
}
return
null
}
catch
(
error
)
{
return
null
as
AuthInfo
}
}
export
const
getAuth
=
():
AuthInfo
=>
{
try
{
const
cookieAuth
:
AuthInfo
=
getCookie
(
AUTH_KEY
)
as
unknown
as
AuthInfo
...
...
src/utils/request.ts
View file @
bb9144f8
...
...
@@ -3,7 +3,7 @@ import responseCode from '@/constants/responseCode'
import
{
IRequestError
,
IRequestSuccess
}
from
'..'
;
import
{
history
}
from
'umi'
import
{
message
}
from
'antd'
import
{
getAuth
,
removeAuth
}
from
'./auth'
;
import
{
get
Cookie
Auth
,
removeAuth
}
from
'./auth'
;
import
{
GlobalConfig
}
from
'@/global/config'
;
import
qs
from
'qs'
...
...
@@ -80,7 +80,7 @@ const cache = {}
// 请求拦截器
baseRequest
.
interceptors
.
request
.
use
((
url
:
string
,
options
:
RequestOptionsInit
):
{
url
:
string
,
options
:
RequestOptionsInit
}
=>
{
// 判断是否有权限
const
{
userId
,
memberId
,
token
}
=
getAuth
()
||
{}
const
{
userId
,
memberId
,
token
}
=
get
Cookie
Auth
()
||
{}
const
headers
:
any
=
{
...
options
.
headers
}
...
...
@@ -121,8 +121,8 @@ class ApiRequest {
baseRequest
<
IRequestSuccess
<
T
>>
(
url
,
options
).
then
(
res
=>
{
// 登录验证
if
(
res
.
code
===
1101
)
{
removeAuth
()
window
.
location
.
replace
(
`/user/login?redirect=
${
btoa
(
encodeURIComponent
(
String
(
window
.
location
)))}
`
)
//
removeAuth()
//
window.location.replace(`/user/login?redirect=${btoa(encodeURIComponent(String(window.location)))}`)
message
.
destroy
()
message
.
error
(
res
.
message
)
reject
(
res
)
...
...
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