Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
罗超
SuperMan
Commits
503bd02f
Commit
503bd02f
authored
Jun 11, 2019
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整行程下载
parent
19562b44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
63 deletions
+65
-63
confirmationOrderDownLoad.vue
src/components/confirmationOrderDownLoad.vue
+65
-63
No files found.
src/components/confirmationOrderDownLoad.vue
View file @
503bd02f
...
...
@@ -682,72 +682,74 @@
let
UploadUrl
=
this
.
domainManager
().
UploadUrl
let
_this
=
this
if
(
this
.
showType
>=
4
)
{
// 判断是否为行程特色
var
apiurl
=
this
.
domainManager
().
UploadUrl
+
'/Upload/GetImage?filePath=Feature/'
+
tcid
;
this
.
$http
.
post
(
apiurl
).
then
(
res
=>
{
let
msg
=
res
.
data
if
(
msg
.
ResultCode
===
1
&&
_this
.
vshowC
)
{
// 已经存在文件 直接调用下载
_this
.
ToWord
(
_this
.
orderMsg
.
startDate
+
_this
.
orderMsg
.
lineteamName
+
_this
.
orderMsg
.
dayNum
+
'日游'
,
isPc
)
}
else
if
(
document
.
querySelector
(
"#gernalCanvas"
))
{
// 不存在图片保存图片后下载
if
(
document
.
querySelector
(
"#gernalCanvas"
).
querySelectorAll
(
'img'
).
length
===
0
)
{
_this
.
ToWord
(
_this
.
orderMsg
.
startDate
+
_this
.
orderMsg
.
lineteamName
+
_this
.
orderMsg
.
dayNum
+
'日游'
,
isPc
)
return
}
let
cName
=
''
if
(
_this
.
showType
==
4
)
{
cName
=
'.feature-box'
}
else
if
(
_this
.
showType
>
4
)
{
cName
=
'.travle_page'
}
if
(
cName
!=
''
)
{
let
allNum
=
1
document
.
querySelectorAll
(
cName
).
forEach
((
x
,
index
)
=>
{
html2Canvas
(
x
,
{
useCORS
:
true
,
scale
:
0.7
,
backgroundColor
:
'#FFFFFF'
,
}).
then
((
canvas
)
=>
{
if
(
canvas
)
{
var
context
=
canvas
.
getContext
(
'2d'
)
context
.
mozImageSmoothingEnabled
=
false
context
.
webkitImageSmoothingEnabled
=
false
context
.
msImageSmoothingEnabled
=
false
context
.
imageSmoothingEnabled
=
false
var
image
=
new
Image
();
image
.
src
=
canvas
.
toDataURL
(
"image/png"
);
$
.
ajax
({
url
:
UploadUrl
+
'/Upload/UploadBase64?fileType=1&fileLimit=5&&filePath=Feature/'
+
tcid
,
type
:
"POST"
,
data
:
{
myfile
:
image
.
src
,
fileIndex
:
index
},
datatype
:
"jsonP"
,
success
:
function
(
data
)
{
//
var apiurl = this.domainManager().UploadUrl + '/Upload/GetImage?filePath=Feature/' + tcid;
//
this.$http.post(apiurl).then(res => {
//
let msg = res.data
//
if (msg.ResultCode === 1 && _this.vshowC) { // 已经存在文件 直接调用下载
//
_this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum +
//
'日游', isPc)
//
} else if (document.querySelector("#gernalCanvas")) { // 不存在图片保存图片后下载
//
if (document.querySelector("#gernalCanvas").querySelectorAll('img').length === 0) {
//
_this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum +
//
'日游', isPc)
//
return
//
}
//
let cName = ''
//
if (_this.showType == 4) {
//
cName = '.feature-box'
//
} else if (_this.showType > 4) {
//
cName = '.travle_page'
//
}
//
if (cName != '') {
//
let allNum = 1
//
document.querySelectorAll(cName).forEach((x, index) => {
//
html2Canvas(x, {
//
useCORS: true,
//
scale: 0.7,
//
backgroundColor: '#FFFFFF',
//
}).then((canvas) => {
//
if (canvas) {
//
var context = canvas.getContext('2d')
//
context.mozImageSmoothingEnabled = false
//
context.webkitImageSmoothingEnabled = false
//
context.msImageSmoothingEnabled = false
//
context.imageSmoothingEnabled = false
//
var image = new Image();
//
image.src = canvas.toDataURL("image/png");
//
$.ajax({
//
url: UploadUrl +
//
'/Upload/UploadBase64?fileType=1&fileLimit=5&&filePath=Feature/' + tcid,
//
type: "POST",
//
data: {
//
myfile: image.src,
//
fileIndex: index
//
},
//
datatype: "jsonP",
//
success: function (data) {
},
error
:
function
()
{
//
},
//
error: function () {
}
});
if
(
allNum
!==
document
.
querySelectorAll
(
cName
).
length
)
{
allNum
+=
1
}
else
{
_this
.
ToWord
(
_this
.
orderMsg
.
startDate
+
_this
.
orderMsg
.
lineteamName
+
_this
.
orderMsg
.
dayNum
+
'日游'
,
isPc
)
}
}
});
});
}
}
else
{
_this
.
ToWord
(
_this
.
orderMsg
.
startDate
+
_this
.
orderMsg
.
lineteamName
+
_this
.
orderMsg
.
dayNum
+
// }
// });
// if (allNum !== document.querySelectorAll(cName).length) {
// allNum += 1
// } else {
// _this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg
// .dayNum + '日游', isPc)
// }
// }
// });
// });
// }
// } else {
// _this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum +
// '日游', isPc)
// }
// }, null)
_this
.
ToWord
(
_this
.
orderMsg
.
startDate
+
_this
.
orderMsg
.
lineteamName
+
_this
.
orderMsg
.
dayNum
+
'日游'
,
isPc
)
}
},
null
)
return
}
else
{
this
.
ToWord
(
this
.
orderMsg
.
startDate
+
this
.
orderMsg
.
lineteamName
+
this
.
orderMsg
.
dayNum
+
'日游'
,
isPc
)
}
...
...
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