Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
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
罗超
confucius
Commits
a180273a
Commit
a180273a
authored
Dec 18, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
894fb62f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
10 deletions
+35
-10
common.js
src/api/common/common.js
+29
-3
paymentDetail.vue
src/pages/course/paymentDetail.vue
+4
-6
request.js
src/utils/request.js
+2
-1
No files found.
src/api/common/common.js
View file @
a180273a
...
...
@@ -37,9 +37,9 @@ export function UploadSelfFile(path, file, callback) {
})
var
newPath
=
'/Upload/'
+
path
+
"/"
;
let
url
=
uploadMsg
.
uploadUrl
+
"/Upload?filePath="
+
newPath
;
// if (isTrans && isTrans == 1) {
// url += "&isTrans=1"
// }
// if (isTrans && isTrans == 1) {
// url += "&isTrans=1"
// }
let
formData
=
new
FormData
()
formData
.
append
(
'myfile'
,
file
)
let
xhr
=
new
XMLHttpRequest
()
...
...
@@ -97,3 +97,29 @@ export function getFileExt(filename) {
var
suffix
=
filename
.
substr
(
index
+
1
);
return
suffix
}
/**
*
* 教育文件下载
*/
export
function
EduDownLoad
(
cmd
,
msg
,
fileName
)
{
return
request
({
url
:
cmd
,
method
:
'post'
,
data
:
msg
,
headers
:{
'Content-Type'
:
'application/octet-stream;charset=utf-8'
}
}).
then
(
res
=>
{
let
blob
=
new
Blob
([
res
.
data
],
{
type
:
"application/vnd.ms-excel;charset=utf-8"
})
let
url
=
URL
.
createObjectURL
(
blob
);
let
link
=
document
.
createElement
(
'a'
);
link
.
href
=
url
;
link
.
setAttribute
(
"download"
,
fileName
);
document
.
body
.
appendChild
(
link
);
link
.
click
();
})
}
src/pages/course/paymentDetail.vue
View file @
a180273a
...
...
@@ -442,7 +442,9 @@
GetClassBalanceSheet
,
GetClassBalanceSheetToExcel
}
from
'../../api/finance/index'
;
import
{
EduDownLoad
,
}
from
'../../api/common/common'
;
export
default
{
props
:
{},
components
:
{},
...
...
@@ -493,11 +495,7 @@
//导出单据
exportOrder
()
{
var
msg
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
msg
));
this
.
GetLocalFile
(
"/api/Finance/GetClassBalanceSheetToExcel"
,
msg
,
"收支明细.xls"
);
EduDownLoad
(
"/Finance/GetClassBalanceSheetToExcel"
,
msg
,
"收支明细.xls"
)
},
//跳转到收款单
goShoukuan
(
type
)
{
...
...
src/utils/request.js
View file @
a180273a
...
...
@@ -48,8 +48,9 @@ service.interceptors.request.use(
service
.
interceptors
.
response
.
use
(
response
=>
{
const
res
=
response
.
data
;
console
.
log
(
" response"
,
response
)
// TODO 确定后台的CODE码
if
(
response
.
status
===
200
&&
response
.
config
.
responseType
===
"blob
"
)
{
if
(
response
.
status
===
200
&&
response
.
headers
[
"content-type"
]
===
"application/octet-stream
"
)
{
// 文件类型特殊处理
return
response
;
}
else
if
(
res
.
Code
!=
1
)
{
...
...
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