Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jijin
/
dance-pc
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
82d4fb2e
authored
2025-07-22 11:49:03 +0800
by
zhangmeng
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
旅游
1 parent
1689e66e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
30 deletions
package.json
src/utils/request.js
src/viewsPc/booking/pay.vue
src/viewsPc/match/pay.vue
package.json
View file @
82d4fb2
...
...
@@ -22,7 +22,7 @@
"echarts"
:
"5.4.0"
,
"echarts-wordcloud"
:
"^2.1.0"
,
"element-plus"
:
"2.6.1"
,
"file-saver"
:
"2.0.5"
,
"file-saver"
:
"
^
2.0.5"
,
"flag-icon-css"
:
"^4.1.7"
,
"fuse.js"
:
"6.6.2"
,
"guid"
:
"^0.0.12"
,
...
...
src/utils/request.js
View file @
82d4fb2
...
...
@@ -16,6 +16,7 @@ import { sendNotification } from '@/assets/lib/extend'
import
_
from
'lodash'
// const language = cache.local.get('language') || 0
import
{
useStorage
}
from
'@vueuse/core/index'
const
language
=
useStorage
(
'language'
,
0
)
let
downloadLoadingInstance
// 是否显示重新登录
...
...
@@ -42,7 +43,7 @@ service.interceptors.request.use(
if
(
config
.
method
.
toLowerCase
()
!==
'get'
&&
!
_
.
some
(
noModal
,
(
m
)
=>
config
.
url
.
indexOf
(
m
)
>
-
1
))
{
modal
.
loading
()
}
// 是否需要设置 token
const
isToken
=
(
config
.
headers
||
{}).
isToken
===
false
// 是否需要防止数据重复提交
...
...
@@ -53,7 +54,7 @@ service.interceptors.request.use(
if
(
_
.
some
(
otherWeb
,
(
w
)
=>
config
.
url
.
indexOf
(
w
)
>
-
1
))
{
config
.
headers
[
'Ztx-Per-Id'
]
=
useUserStore
().
perId
||
-
1
}
// get请求映射params参数
if
(
config
.
method
===
'get'
)
{
if
(
!
config
.
params
)
{
...
...
@@ -63,7 +64,7 @@ service.interceptors.request.use(
}
else
{
config
.
params
.
t
=
new
Date
().
valueOf
()
}
let
url
=
config
.
url
+
'?'
+
tansParams
(
config
.
params
)
url
=
url
.
slice
(
0
,
-
1
)
config
.
params
=
{}
...
...
@@ -129,14 +130,14 @@ service.interceptors.response.use(
// const msg = errorCode[code] || res.data.msg || errorCode['default']
// 二进制数据则直接返回
// debugger
if
(
res
.
request
.
responseType
===
'blob'
||
res
.
request
.
responseType
===
'arraybuffer'
)
{
return
res
}
if
(
_
.
some
(
excludeUrl
,
(
m
)
=>
res
.
config
.
url
.
indexOf
(
m
)
>
-
1
))
{
return
Promise
.
resolve
(
res
.
data
)
}
...
...
@@ -184,6 +185,7 @@ service.interceptors.response.use(
},
(
error
)
=>
{
console
.
log
(
'err'
+
error
)
alert
(
error
)
let
{
message
}
=
error
if
(
message
===
'Network Error'
)
{
message
=
'后端接口连接异常'
...
...
@@ -200,7 +202,7 @@ service.interceptors.response.use(
)
// 通用下载方法
export
function
download
(
url
,
params
,
filename
,
config
)
{
export
function
download
(
url
,
params
,
filename
,
config
,
mimeType
)
{
downloadLoadingInstance
=
ElLoading
.
service
({
text
:
'正在下载数据,请稍候'
,
background
:
'rgba(0, 0, 0, 0.7)'
...
...
@@ -230,16 +232,38 @@ export function download(url, params, filename, config) {
const
index
=
res
.
headers
[
'content-disposition'
].
indexOf
(
'='
)
hz
=
res
.
headers
[
'content-disposition'
].
substr
(
index
+
1
,
res
.
headers
[
'content-disposition'
].
length
)
}
const
blob
=
new
Blob
([
data
])
let
blob
if
(
mimeType
)
{
blob
=
new
Blob
([
data
],
{
type
:
mimeType
})
}
else
{
blob
=
new
Blob
([
data
])
}
saveAs
(
blob
,
hz
?
filename
=
decodeURIComponent
(
hz
)
:
filename
)
// // 创建一个指向该 Blob 的 URL
// const url = URL.createObjectURL(blob)
// // 创建一个临时的 <a> 元素来触发下载
// const a = document.createElement('a')
//
// a.href = url
// a.download = filename
// document.body.appendChild(a)
// a.click()
// // 清理并移除 <a> 元素
// document.body.removeChild(a)
// // 释放 Blob URL 占用的内存
// URL.revokeObjectURL(url)
}
else
{
const
resText
=
await
data
.
text
()
const
rspObj
=
JSON
.
parse
(
resText
)
const
errMsg
=
errorCode
[
rspObj
.
code
]
||
rspObj
.
msg
||
errorCode
[
'default'
]
ElMessage
.
error
(
errMsg
)
downloadLoadingInstance
.
close
()
return
Promise
.
resolve
(
true
)
}
downloadLoadingInstance
.
close
()
return
Promise
.
resolve
(
true
)
})
.
catch
((
r
)
=>
{
console
.
error
(
r
)
...
...
src/viewsPc/booking/pay.vue
View file @
82d4fb2
...
...
@@ -676,6 +676,7 @@ function getData() {
form
.
value
=
{
pickUpBo
:
{}
}
booking
.
getCarBilldetailbyId
({
orderId
:
orderId
.
value
}).
then
(
res
=>
{
form
.
value
=
res
.
data
matchId
.
value
=
res
.
data
.
activeId
...
...
@@ -908,7 +909,6 @@ function ScenicInfo() {
})
}
function
photographyOrder
()
{
return
booking
.
getPhotoOrderInfo
({
orderId
:
orderId
.
value
}).
then
(
res
=>
{
form
.
value
=
res
.
data
...
...
@@ -920,14 +920,9 @@ function photographyOrder() {
})
}
function
photographyInfo
()
{
booking
.
getPhotoOrderInfoByLogex
({
aspId
:
form
.
value
.
aspId
}).
then
(
res
=>
{
formInfo
.
value
=
res
.
data
})
// .catch((e) => {
// console.log(e)
// errorBox.value = true
// })
async
function
photographyInfo
()
{
const
res
=
await
booking
.
getPhotoOrderInfoByLogex
({
aspId
:
form
.
value
.
aspId
})
formInfo
.
value
=
res
.
data
}
const
cancel
=
()
=>
{
...
...
@@ -961,11 +956,11 @@ function exportPdf() {
if
(
language
.
value
==
0
)
{
proxy
.
download
(
'/ota/orderRoom/downRoomConfirmation'
,
{
...
obj
},
`订房确认书.pdf`
)
},
`订房确认书.pdf`
,
{},
'application/pdf'
)
}
else
{
proxy
.
download
(
'/ota/orderRoom/downRoomConfirmation'
,
{
...
obj
},
`Hotel Reservation`
)
},
`Hotel Reservation`
,
{},
'application/pdf'
)
}
}
...
...
@@ -1003,11 +998,12 @@ function submitSJ() {
cancelButtonText
:
language
.
value
==
0
?
'取消'
:
'Cancel'
,
type
:
'warning'
}).
then
(()
=>
{
form
.
value
.
receiptFlag
=
'0'
showSJ
()
})
}
const
showSJ
=
()
=>
{
const
showSJ
=
async
()
=>
{
// 查看电子收据预览信息
var
obj
=
{
orderId
:
orderId
.
value
,
...
...
@@ -1020,13 +1016,11 @@ const showSJ = () => {
// proxy.download(`/ota/norder/getReceipt/${obj.orderId}`, {
// ...obj
// }, `Receipt_${new Date().getTime()}.pdf`)
// 报名
proxy
.
download
(
`/ota/norder/getReceipt/
${
obj
.
orderId
}
`
,
{
await
proxy
.
download
(
`/ota/norder/getReceipt/
${
obj
.
orderId
}
`
,
{
...
obj
},
`Receipt
_
${
new
Date
().
getTime
()}
.pdf`
)
},
`Receipt
.pdf`
,
{},
'application/pdf'
)
showSJDialog
.
value
=
false
getData
()
}
</
script
>
...
...
src/viewsPc/match/pay.vue
View file @
82d4fb2
...
...
@@ -689,7 +689,7 @@ function exportSignList(n) {
}
proxy
.
download
(
'/league/sign/exportCn'
,
{
...
obj
},
`
${
fileName
}
_
${
new
Date
().
getTime
()}
.xlsx`
)
},
`
${
fileName
}
_
${
new
Date
().
getTime
()}
.xlsx`
,
{},
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
)
}
else
{
if
(
n
==
1
)
{
fileName
=
'Participant List'
...
...
@@ -698,7 +698,7 @@ function exportSignList(n) {
}
proxy
.
download
(
'/league/sign/exportEn'
,
{
...
obj
},
`
${
fileName
}
_
${
new
Date
().
getTime
()}
.xlsx`
)
},
`
${
fileName
}
_
${
new
Date
().
getTime
()}
.xlsx`
,
{},
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
)
}
}
...
...
@@ -713,12 +713,12 @@ function exportPdf() {
fileName
=
'设项报名清单'
proxy
.
download
(
'/pdf/exportMySignInfoList'
,
{
...
obj
},
`
${
fileName
}
_
${
new
Date
().
getTime
()}
.pdf`
)
},
`
${
fileName
}
_
${
new
Date
().
getTime
()}
.pdf`
,
{},
'application/pdf'
)
}
else
{
fileName
=
'LIST OF REGISTERED COMPETITIONS'
proxy
.
download
(
'/pdf/exportMySignInfoList'
,
{
...
obj
},
`
${
fileName
}
_
${
new
Date
().
getTime
()}
.pdf`
)
},
`
${
fileName
}
_
${
new
Date
().
getTime
()}
.pdf`
,
{},
'application/pdf'
)
}
}
...
...
@@ -756,6 +756,7 @@ function submitSJ() {
cancelButtonText
:
language
.
value
==
0
?
'取消'
:
'Cancel'
,
type
:
'warning'
}).
then
(()
=>
{
form
.
value
.
receiptFlag
=
'0'
showSJ
()
})
}
...
...
@@ -794,9 +795,8 @@ const showSJ = () => {
// 报名
proxy
.
download
(
`/league/signOrder/getReceipt/
${
obj
.
orderId
}
`
,
{
...
obj
},
`Receipt_
${
new
Date
().
getTime
()}
.pdf`
)
},
`Receipt_
${
new
Date
().
getTime
()}
.pdf`
,
{},
'application/pdf'
)
showSJDialog
.
value
=
false
getData
()
}
</
script
>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment