Commit add9dce0 authored by 华国豪's avatar 华国豪 🙄

‘行程特色!@’

parent 1af78c56
......@@ -8,7 +8,7 @@
<div class="travelControlTrip detail-box">
<div class="trip_cover" v-show="pdfLoading" v-loading="pdfLoading"></div>
<input type="button" class="travelControlTripBtn" value="下载PDF" @click="toPDF(orderMsg.startDate + orderMsg.lineteamName+orderMsg.dayNum+'日游')" />
<input type="button" style="width: auto !important;display:none" class="travelControlTripBtn" value="下载手机版WORD" @click="gernalFeature()" />
<input type="button" style="width: auto !important;" class="travelControlTripBtn" value="下载手机版WORD" @click="gernalFeature()" />
<!-- ToWord(orderMsg.startDate + orderMsg.lineteamName+orderMsg.dayNum+'日游') -->
<!--&&isopOperation HK 注释 可以让销售修改基本信息-->
<input type="button" v-if="orderId>0" class="travelControlTripBtn" value="修改信息" @click="editMsgShow=true" />
......@@ -646,79 +646,79 @@
this.pdfLoading = true;
let tcid = this.$route.query.tcid;
let UploadUrl = this.domainManager().UploadUrl
$.ajax({
url: UploadUrl + '/Upload/RemoveImage?fileType=1&fileLimit=5&&filePath=Feature/' + tcid,
type: "POST",
datatype:"jsonP",
success: function (data) {
// console.log("上传成功",data);
},
error: function () {
// console.log("上传失败");
}
});
if (this.showType===4 || this.showType===5) {
document.querySelector("#gernalCanvas").querySelectorAll('img').forEach(x => {
let src = x.src
src = src.replace('https:','http:')
if(src.indexOf('http')!=-1){
x.setAttribute('crossOrigin','anonymous')
}
x.src = src
});
let cName=''
if(this.showType==4){
cName='.feature-box'
}else if(this.showType==5){
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");
// document.body.appendChild(image) upload.oytour.com
$.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) {
// console.log("上传成功",data);
},
error: function () {
// console.log("上传失败");
let _this = this
if (this.showType===4 || this.showType===5) { // 判断是否为行程特色
$.ajax({ //调用是否已经存在文件夹接口判断是否进行上传图片操作
url: UploadUrl + '/Upload/GetImage?filePath=Feature/' + tcid,
type: "POST",
datatype:"jsonP",
success: function (data) {
let msg = JSON.parse(data)
if (msg.ResultCode) { // 已经存在文件 直接调用下载
_this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum + '日游')
} else { // 不存在图片保存图片后下载
document.querySelector("#gernalCanvas").querySelectorAll('img').forEach(x => {
let src = x.src
src = src.replace('https:','http:')
if(src.indexOf('http')!=-1){
x.setAttribute('crossOrigin','anonymous')
}
x.src = src
});
let cName=''
if(_this.showType==4){
cName='.feature-box'
}else if(_this.showType==5){
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");
// document.body.appendChild(image) upload.oytour.com
$.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) {
// console.log("上传成功",data);
},
error: function () {
// console.log("上传失败");
}
});
if (allNum!==document.querySelectorAll(cName).length) {
allNum += 1
} else {
_this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum + '日游')
}
}
});
});
// this.uploadImg(tcid,{'myfile': image.src}, res=>{
// console.log(res)
// }, err=>{
// console.log("GHJK",err);
// })
if (allNum!==document.querySelectorAll(cName).length) {
allNum += 1
} else {
this.ToWord(this.orderMsg.startDate + this.orderMsg.lineteamName + this.orderMsg.dayNum + '日游')
}
}
});
});
}
}else {
}
},
error: function () {
// console.log("上传失败");
}
});
} else {
this.ToWord(this.orderMsg.startDate + this.orderMsg.lineteamName + this.orderMsg.dayNum + '日游')
}
},
......
......@@ -378,6 +378,20 @@
if (SaveType == 1) {
let path = flagWangYue ? 'TravelManager3' : 'TravelManager2';
this.Success("保存成功");
let tcid = this.$route.query.tcid;
let UploadUrl = this.domainManager().UploadUrl
// 每次保存 删除对应文件夹 word 行程特色图片
$.ajax({
url: UploadUrl + '/Upload/RemoveImage?fileType=1&fileLimit=5&&filePath=Feature/' + tcid,
type: "POST",
datatype:"jsonP",
success: function (data) {
// console.log("上传成功",data);
},
error: function () {
// console.log("上传失败");
}
});
if (flagWangYue||this.isNewConfig) {
console.log(66666)
this.$router.push({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment