Commit 37cad693 authored by 黄奎's avatar 黄奎

行程下载修改

parent 13489e17
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
<input type="button" style="width: auto !important;" class="travelControlTripBtn" value="下载手机版WORD" @click="gernalFeature(0)" /> <input type="button" style="width: auto !important;" class="travelControlTripBtn" value="下载手机版WORD" @click="gernalFeature(0)" />
<input type="button" style="width: auto !important;" class="travelControlTripBtn" value="下载电脑版WORD" @click="gernalFeature(1)" /> <input type="button" style="width: auto !important;" class="travelControlTripBtn" value="下载电脑版WORD" @click="gernalFeature(1)" />
<a class="travelControlTripBtn" v-if="priceList!=null&& priceList[0]!=null && priceList[0].wordPath!=''" style="display:inline-block;text-decoration:none; <a class="travelControlTripBtn" v-if="priceList!=null&& priceList[0]!=null && priceList[0].wordPath!=''" style="display:inline-block;text-decoration:none;
width:135px;text-align:center;line-height:30px;font-size:13px;position:relative;top:2px;" :href="domainManager().ViittoFileUrl+priceList[0].wordPath">下载WORD行程</a> width:135px;text-align:center;line-height:30px;font-size:13px;position:relative;top:2px;"
:href="domainManager().ViittoFileUrl+priceList[0].wordPath">下载WORD行程</a>
<!-- ToWord(orderMsg.startDate + orderMsg.lineteamName+orderMsg.dayNum+'日游') --> <!-- ToWord(orderMsg.startDate + orderMsg.lineteamName+orderMsg.dayNum+'日游') -->
<!--&&isopOperation HK 注释 可以让销售修改基本信息--> <!--&&isopOperation HK 注释 可以让销售修改基本信息-->
<input type="button" v-if="orderId>0" class="travelControlTripBtn" value="修改信息" @click="editMsgShow=true" /> <input type="button" v-if="orderId>0" class="travelControlTripBtn" value="修改信息" @click="editMsgShow=true" />
...@@ -465,7 +466,7 @@ ...@@ -465,7 +466,7 @@
</div> </div>
</div> </div>
</div> </div>
<el-dialog title="修改信息" custom-class="confirmOrder" :visible.sync="editMsgShow" center> <el-dialog title="修改信息" custom-class="confirmOrder" :visible.sync="editMsgShow" center>
<el-form :model="editForm" label-width="100px"> <el-form :model="editForm" label-width="100px">
<p class="edit_form_box_tit">集合地点&联系人</p> <p class="edit_form_box_tit">集合地点&联系人</p>
<div class="edit_form_box"> <div class="edit_form_box">
...@@ -539,12 +540,11 @@ ...@@ -539,12 +540,11 @@
circle></el-button> circle></el-button>
</el-tooltip> </el-tooltip>
<el-tooltip class="item" v-if="index!=0" style="margin-left:0" effect="dark" content="上移" placement="top-start"> <el-tooltip class="item" v-if="index!=0" style="margin-left:0" effect="dark" content="上移" placement="top-start">
<el-button type="danger" icon="iconfont icon-shangyi" @click="MoveItem(priceFlight,index,0)" <el-button type="danger" icon="iconfont icon-shangyi" @click="MoveItem(priceFlight,index,0)" circle></el-button>
circle></el-button>
</el-tooltip> </el-tooltip>
<el-tooltip class="item" v-if="index!=editForm.travelOrderFlightList.length-1" style="margin-left:0" effect="dark" content="下移" placement="top-start"> <el-tooltip class="item" v-if="index!=editForm.travelOrderFlightList.length-1" style="margin-left:0"
<el-button type="danger" icon="iconfont icon-xiayi1" @click="MoveItem(priceFlight,index,1)" effect="dark" content="下移" placement="top-start">
circle></el-button> <el-button type="danger" icon="iconfont icon-xiayi1" @click="MoveItem(priceFlight,index,1)" circle></el-button>
</el-tooltip> </el-tooltip>
</td> </td>
</tr> </tr>
...@@ -645,48 +645,50 @@ ...@@ -645,48 +645,50 @@
}, 2000) }, 2000)
}, },
methods: { methods: {
gernalFeature(isPc){ gernalFeature(isPc) {
this.pdfLoading = true; this.pdfLoading = true;
let tcid = this.$route.query.tcid; let tcid = this.$route.query.tcid;
let UploadUrl = this.domainManager().UploadUrl let UploadUrl = this.domainManager().UploadUrl
let _this = this let _this = this
if (this.showType>=4) { // 判断是否为行程特色 if (this.showType >= 4) { // 判断是否为行程特色
$.ajax({ //调用是否已经存在文件夹接口判断是否进行上传图片操作 $.ajax({ //调用是否已经存在文件夹接口判断是否进行上传图片操作
url: UploadUrl + '/Upload/GetImage?filePath=Feature/' + tcid, url: UploadUrl + '/Upload/GetImage?filePath=Feature/' + tcid,
type: "POST", type: "POST",
datatype:"jsonP", datatype: "jsonP",
success: function (data) { success: function (data) {
let msg = JSON.parse(data) let msg = JSON.parse(data)
if (msg.ResultCode) { // 已经存在文件 直接调用下载 if (msg.ResultCode) { // 已经存在文件 直接调用下载
_this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum + '日游',isPc) _this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum +
} else if (document.querySelector("#gernalCanvas")){ // 不存在图片保存图片后下载 '日游', isPc)
} else if (document.querySelector("#gernalCanvas")) { // 不存在图片保存图片后下载
if (document.querySelector("#gernalCanvas").querySelectorAll('img').length === 0) { if (document.querySelector("#gernalCanvas").querySelectorAll('img').length === 0) {
_this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum + '日游',isPc) _this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum +
'日游', isPc)
return return
} }
document.querySelector("#gernalCanvas").querySelectorAll('img').forEach(x => { document.querySelector("#gernalCanvas").querySelectorAll('img').forEach(x => {
let src = x.src let src = x.src
src = src.replace('https:','http:') src = src.replace('https:', 'http:')
if(src.indexOf('http')!=-1){ if (src.indexOf('http') != -1) {
x.setAttribute('crossOrigin','anonymous') x.setAttribute('crossOrigin', 'anonymous')
} }
x.src = src x.src = src
}); });
let cName='' let cName = ''
if(_this.showType==4){ if (_this.showType == 4) {
cName='.feature-box' cName = '.feature-box'
}else if(_this.showType>4){ } else if (_this.showType > 4) {
cName='.travle_page' cName = '.travle_page'
} }
if(cName!=''){ if (cName != '') {
let allNum = 1 let allNum = 1
document.querySelectorAll(cName).forEach((x, index) => { document.querySelectorAll(cName).forEach((x, index) => {
html2Canvas(x,{ html2Canvas(x, {
useCORS:true, useCORS: true,
scale:0.7, scale: 0.7,
backgroundColor:'#FFFFFF', backgroundColor: '#FFFFFF',
}).then((canvas) => { }).then((canvas) => {
if(canvas){ if (canvas) {
var context = canvas.getContext('2d') var context = canvas.getContext('2d')
context.mozImageSmoothingEnabled = false context.mozImageSmoothingEnabled = false
context.webkitImageSmoothingEnabled = false context.webkitImageSmoothingEnabled = false
...@@ -695,39 +697,42 @@ ...@@ -695,39 +697,42 @@
var image = new Image(); var image = new Image();
image.src = canvas.toDataURL("image/png"); image.src = canvas.toDataURL("image/png");
$.ajax({ $.ajax({
url: UploadUrl + '/Upload/UploadBase64?fileType=1&fileLimit=5&&filePath=Feature/' + tcid, url: UploadUrl +
type: "POST", '/Upload/UploadBase64?fileType=1&fileLimit=5&&filePath=Feature/' + tcid,
data: { type: "POST",
myfile: image.src, data: {
fileIndex: index myfile: image.src,
}, fileIndex: index
datatype:"jsonP", },
success: function (data) { datatype: "jsonP",
//console.log("上传成功",data); success: function (data) {
}, //console.log("上传成功",data);
error: function () { },
//console.log("上传失败"); error: function () {
} //console.log("上传失败");
}
}); });
if (allNum!==document.querySelectorAll(cName).length) { if (allNum !== document.querySelectorAll(cName).length) {
allNum += 1 allNum += 1
} else { } else {
_this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum + '日游',isPc) _this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg
.dayNum + '日游', isPc)
} }
} }
}); });
}); });
} }
} else { } else {
_this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum + '日游',isPc) _this.ToWord(_this.orderMsg.startDate + _this.orderMsg.lineteamName + _this.orderMsg.dayNum +
'日游', isPc)
} }
}, },
error: function () { error: function () {
// console.log("上传失败"); // console.log("上传失败");
} }
}); });
} else { } else {
this.ToWord(this.orderMsg.startDate + this.orderMsg.lineteamName + this.orderMsg.dayNum + '日游',isPc) this.ToWord(this.orderMsg.startDate + this.orderMsg.lineteamName + this.orderMsg.dayNum + '日游', isPc)
} }
}, },
//保存基础数据 //保存基础数据
...@@ -907,51 +912,50 @@ ...@@ -907,51 +912,50 @@
console.log(err) console.log(err)
}) })
}, },
ToWord:function(title,isPc) ToWord: function (title, isPc) {
{
let msg = { let msg = {
configId: this.$route.query.configId, configId: this.$route.query.configId,
cityId: this.$route.query.cityId, cityId: this.$route.query.cityId,
tcid: this.$route.query.tcid, tcid: this.$route.query.tcid,
orderId: this.$route.query.orderId, orderId: this.$route.query.orderId,
FileName:title, FileName: title,
//是否显示基础信息 //是否显示基础信息
isShowBase:this.vshowA?1:0, isShowBase: this.vshowA ? 1 : 0,
//是否显示航班 //是否显示航班
isShowFlight:this.vshowB?1:0, isShowFlight: this.vshowB ? 1 : 0,
//是否显示行程特色 //是否显示行程特色
isShowFeature:this.vshowC?1:0, isShowFeature: this.vshowC ? 1 : 0,
//自费、费用包含、费用不含 //自费、费用包含、费用不含
isShowFee:this.vshowE?1:0, isShowFee: this.vshowE ? 1 : 0,
//购物说明,购物安排 //购物说明,购物安排
isShowShop:this.vshowF?1:0, isShowShop: this.vshowF ? 1 : 0,
//重要提示、温馨提示 [订单须知] //重要提示、温馨提示 [订单须知]
isShowTip:this.vshowG?1:0, isShowTip: this.vshowG ? 1 : 0,
//是否显示同行备注 //是否显示同行备注
isShowB2B:this.vshowI?1:0, isShowB2B: this.vshowI ? 1 : 0,
//是否显示行程 //是否显示行程
isShowTrip:this.vshowD?1:0, isShowTrip: this.vshowD ? 1 : 0,
//是否显示标题 //是否显示标题
isShowTitle:this.vshowL?1:0, isShowTitle: this.vshowL ? 1 : 0,
//是否显示旅客名单 //是否显示旅客名单
isShowGuest:this.vshowM?1:0, isShowGuest: this.vshowM ? 1 : 0,
//是否显示紧急联系人 //是否显示紧急联系人
isShowMan:this.vshowLLR?1:0, isShowMan: this.vshowLLR ? 1 : 0,
//是否显示团号 //是否显示团号
isShowTCNUM:this.vshowTCNUM?1:0, isShowTCNUM: this.vshowTCNUM ? 1 : 0,
//是否显示行程图片 //是否显示行程图片
isShowTripImage:this.vshowK?1:0, isShowTripImage: this.vshowK ? 1 : 0,
//是否显示签证信息 //是否显示签证信息
isShowVisa:this.vshowH?1:0, isShowVisa: this.vshowH ? 1 : 0,
//isPc是否PC下载 //isPc是否PC下载
isPc: isPc, isPc: isPc,
//模板参数 //模板参数
templateId: this.showType, templateId: this.showType,
}; };
this.GetLocalFile("DownLoadTripWord", msg,title+ ".doc", res=>{ this.GetLocalFile("DownLoadTripWord", msg, title + ".doc", res => {
this.pdfLoading = false this.pdfLoading = false
}); });
}, },
DateDiff(sDate1, sDate2) { //sDate1和sDate2是2002-12-18格式 DateDiff(sDate1, sDate2) { //sDate1和sDate2是2002-12-18格式
var aDate, oDate1, oDate2, iDays var aDate, oDate1, oDate2, iDays
...@@ -995,7 +999,7 @@ ...@@ -995,7 +999,7 @@
this.SourceData.gatheringAddress = this.orderMsg.gatheringAddress; this.SourceData.gatheringAddress = this.orderMsg.gatheringAddress;
if (data.priceList != null && data.priceList.length > 0) { if (data.priceList != null && data.priceList.length > 0) {
var array = JSON.parse(JSON.stringify(data.priceList[0].priceFlight)); var array = JSON.parse(JSON.stringify(data.priceList[0].priceFlight));
this.SourceData.travelOrderFlightList=[]; this.SourceData.travelOrderFlightList = [];
array.forEach(fItem => { array.forEach(fItem => {
this.SourceData.travelOrderFlightList.push({ this.SourceData.travelOrderFlightList.push({
airLineID: fItem.airLineID, airLineID: fItem.airLineID,
......
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