Commit 577f5ec5 authored by 黄奎's avatar 黄奎

页面修改

parent 1567e5cd
......@@ -820,7 +820,6 @@
<td>签约地点:</td>
<td colspan="3">{{dataList.contractPlace}}</td>
</tr>
<tr>
<td>出境社监督、投诉电话:</td>
<td colspan="3">{{dataList.regulatorComplainCall}}</td>
......
<style>
@import url('../assets/css/tripIndex.css');
@import url("../assets/css/UpgradedVersion.css");
@import url("../assets/css/tripIndexNew2.css");
@import url('../assets/css/detail.css');
@import url('../assets/css/tripIndexNewHV.css');
.confirmOrder {
width: 950px;
}
......@@ -14,39 +20,114 @@
top: 55px;
}
.edit_form_box {
display: flex;
justify-content: space-around;
}
.edit_form_box_tit {
color: #000000;
text-align: left;
margin-top: 0;
border-left: 2px solid #e95252;
padding-left: 25px;
}
.TravelFlightList {
width: 100%;
background-color: #fff;
}
.TravelFlightList table {
width: 100%;
}
.guoneiLine tbody td {
font-size: 17px;
.TFTable .el-button.is-circle {
padding: 5px;
}
</style>
.TFTable .el-form-item {
margin: 10px;
}
.TFTable i {
font-size: 14px;
}
.TFTable .el-input--prefix .el-input__inner {
padding-right: 0;
}
.TFAddFlight {
width: 100%;
height: 40px;
text-align: center;
line-height: 40px;
color: #333;
margin-top: 5px;
background-color: #f1f1f1;
font-size: 12px;
border: 1px dashed #dcdcdc;
cursor: pointer;
}
.w110 {
width: 110px !important;
}
.w120 {
width: 120px !important;
}
.normalBtn {
color: #fff;
padding: 0 15px;
height: 30px;
background: #E95252;
border: 1px solid #E95252;
cursor: pointer;
border-radius: 15px;
margin-left: 10px;
}
.hollowFixedBtn {
background: #fff;
color: #E95252;
padding: 0 15px;
height: 30px;
border: 1px solid #E95252;
cursor: pointer;
border-radius: 15px;
margin-left: 10px;
}
</style>
<template>
<div class="travelControlTrip" :style="{'width':dataAll&&dataAll.featurePageType==2?'1240px':'1754px'}"
:class="[dataAll&& dataAll.feature&& dataAll.feature.featureType==9?'VerticalBjNew':'']">
<div class="trip_cover" v-show="pdfLoading" v-loading="pdfLoading"></div>
<div class="trip_cover" v-show="pdfLoading" v-loading="pdfLoading" :element-loading-text="loadingText"></div>
<el-row style="padding: 0 0 20px 0;box-shadow: 1px 10px 10px#e6e6e6;">
<el-col :span="14" class="row-aic">
<a id="pdfDownLoad" style="display:none;" target="_blank" href="http://www.baidu.com" download="xx.pdf">页面跳转</a>
<template v-if="orderId>0">
<el-button type="primary" size="medium" @click="toPDF_2023()">
出团通知书下载</el-button>
<el-button type="primary" size="medium" @click="gernalFeature(1)">
<el-button type="primary" size="medium" @click="ToWord_2023()">
出团通知书下载WROD</el-button>
</template>
<template v-else>
<el-button type="primary" size="medium" @click="toPDF_2023()">
<el-button type="primary" size="medium" @click="toPDF_2023(1)">
行程下载</el-button>
<el-button type="primary" size="medium" @click="toPDF_2023(1)" style="margin-left:20px;">
行程下载(云盘)</el-button>
<el-button type="primary" size="medium" @click="gernalFeature(1)" style="margin-left:20px;">
<el-button v-if="isShowAllDownLoad" type="primary" size="medium" @click="toPDF_2023()"
style="margin-left:20px;">
行程下载(N)</el-button>
<el-button type="primary" size="medium" @click="ToWord_2023()" style="margin-left:20px;">
行程下载WORD</el-button>
</template>
<!-- 可以让销售修改基本信息-->
<el-button v-if="orderId>0" type="primary" size="medium" value="修改信息" @click="editMsgShow=true">
修改信息</el-button>
<el-checkbox class="marginL11" style="display:none;" v-model="isShowTime">显示行程日期</el-checkbox>
</el-col>
<el-col v-if="orderId<=0">
<span style="color:red;padding-left:10px;">温馨提示:OP保存行程后请等待1-2分钟后再下载行程。</span>
......@@ -197,7 +278,8 @@
import OrderNotice from './LeaveGroupDownload/OrderNotice'
import VisaInformation from './LeaveGroupDownload/VisaInformation'
import {
setTimeout
setInterval,
clearInterval
} from 'timers';
export default {
......@@ -213,14 +295,6 @@
data() {
return {
dataAll: null,
isShowTime: true,
CurrentUserInfo: {}, //当前用户信息
Typevalue: -1,
titleList: [],
listMsg: {
pageSize: 1000,
pageIndex: 1,
},
//微信分享图片
WeiXinShareImgSrc: "",
//下拉框默认值
......@@ -229,10 +303,7 @@
airLineList: [],
//orderId和是否op操作控制按钮显示
orderId: 0,
isopOperation: '',
editForm: {
},
editForm: {},
//团源基础数据
SourceData: {
orderId: 0,
......@@ -246,7 +317,6 @@
travelOrderFlightList: []
},
editMsgShow: false,
pdfLoading: true,
vshowA: this.$route.query.vshowA === undefined ? true : this.$route.query.vshowA === 'true',
vshowB: this.$route.query.vshowB === undefined ? true : this.$route.query.vshowB === 'true',
vshowC: this.$route.query.vshowC === undefined ? true : this.$route.query.vshowC === 'true',
......@@ -269,26 +339,27 @@
feature: {},
dataList: {},
showType: -1,
loadNone: false,
orderMsg: {},
//订单不同数据
orderTripdiff: {},
title: '',
isDirect: 1, //是否是直采 0:否,1:是
isClick: this.$route.query.isClick === undefined ? 0 : 1, //不算统计
lineId: 0
lineId: 0,
downLoadUrl: "", //文件下载
pdfLoading: false,
loadingText: "", //加载文字
download_timer: null,
isShowAllDownLoad: false, //是否显示实时下载行程按钮
}
},
mounted() {
this.CurrentUserInfo = this.getLocalStorage();;
this.orderId = this.$route.query.orderId;
this.isopOperation = this.$route.query.isopOperation;
if (this.$route.query.isda && this.$route.query.isda == 1) {
this.isShowAllDownLoad = true;
}
this.getWxCode();
this.init();
this.initAirlines();
setTimeout(() => {
this.appendParent()
}, 2000)
this.getTripDetail();
this.getAirlines();
},
methods: {
//获取微信二维码
......@@ -299,7 +370,7 @@
if (res.data.resultCode == 1) {
this.WeiXinShareImgSrc = res.data.data;
}
}, err => {})
})
},
//还原表单
backForm() {
......@@ -351,9 +422,7 @@
if (res.data.resultCode == 1) {
item.airportNameList = res.data.data;
}
},
err => {}
)
})
this.$forceUpdate();
},
flightSelectChange(flightId, item) {
......@@ -368,16 +437,13 @@
});
},
//初始化航空公司下拉
initAirlines: function () {
this.apipost(
'airline_post_GetList', {},
getAirlines() {
this.apipost('airline_post_GetList', {},
res => {
if (res.data.resultCode == 1) {
this.airLineList = res.data.data
}
},
err => {}
)
})
},
addFlight: function () {
let obj = {
......@@ -419,17 +485,68 @@
}
}
},
appendParent() {
var lables = document.querySelectorAll('#pdf_2 .zidingyi img');
if (lables != null && lables.length > 0) {
let parent = lables[0].parentElement;
lables.forEach(function (lable, index) {
var ele = document.createElement('div')
ele.className = 'u-box';
ele.appendChild(lable)
parent.appendChild(ele)
//检查文件是否生成
checkFile(configId, fileName) {
var that = this;
let urlObj = this.domainManager();
var checkUrl = urlObj.ocrUrl + "/Home/CheckFile?configId=" + configId + "&url=" +
encodeURIComponent(this.downLoadUrl);
this.loadingText = "正在生成PDF文件...";
this.$http({
headers: {
'Content-Type': 'application/json'
},
method: 'get',
url: checkUrl,
data: {}
}).then(res => {
if (res.data == 1) {
clearInterval(this.download_timer);
this.loadingText = "正在下载PDF文件...";
var ocrUrl = "";
ocrUrl = urlObj.ocrUrl + "/Home/DownloadFileForPdfERP?configId=" + configId + "&url=" +
encodeURIComponent(that.downLoadUrl);
that.$http({
headers: {
'Content-Type': 'application/json'
},
method: 'get',
url: ocrUrl,
data: {},
responseType: 'arraybuffer'
}).then(res => {
that.pdfLoading = false;
let blob = new Blob([res.data], {
type: "application/pdf"
})
let fileUrl = URL.createObjectURL(blob);
let link = document.getElementById('pdfDownLoad');
link.href = fileUrl;
link.setAttribute("download", fileName);
link.click();
that.loadingText = "";
//删除缓存的Key
var deleteUrl = urlObj.ocrUrl + "/Home/DeteleKey?configId=" + configId + "&url=" +
encodeURIComponent(this.downLoadUrl);
that.$http({
headers: {
'Content-Type': 'application/json'
},
method: 'get',
url: deleteUrl,
data: {},
}).then(dRes => {
console.log("dRes", dRes);
});
}).catch(err => {
that.pdfLoading = false
})
}
}).catch(err => {
that.loadingText = "";
that.pdfLoading = false;
clearInterval(that.download_timer);
})
},
//获取参数
getPostMsg() {
......@@ -478,16 +595,10 @@
}
return postData;
},
gernalFeature(isPc) {
ToWord_2023: function (title) {
var title = this.orderMsg.startDate + this.orderMsg.lineteamName + this.orderMsg.dayNum + '日游'
if (this.showType >= 4) { // 判断是否为行程特色
this.ToWord_2023(title, isPc)
} else {
this.ToWord_2023(title, isPc)
}
},
ToWord_2023: function (title, isPc) {
this.pdfLoading = true
this.pdfLoading = true;
this.loadingText = "正在生成Word文件...";
let msg = this.getPostMsg();
let urlObj = this.domainManager();
this.$http({
......@@ -501,12 +612,14 @@
}
}).then(res => {
if (res.data.resultCode === 1) {
let sign = title + "V2"
this.loadingText = "正在下载Word文件...";
let sign = title;
const a = document.createElement('a');
a.setAttribute('download', '');
a.setAttribute('href', urlObj.DomainUrl + '/api/file/DownloadFileForPdf?fileName=' + sign +
'.doc&&fPath=' + res.data.data);
a.click();
this.loadingText = "";
} else {
this.Error('WORD获取失败');
}
......@@ -517,9 +630,7 @@
},
// 生成pdf
toPDF_2023: function (command) {
this.pdfLoading = true;
var that = this;
let urlObj = this.domainManager();
let msg = this.getPostMsg();
var title = "";
if (this.priceList && this.priceList.length > 0 && this.priceList[0].priceFlight && this.priceList[0]
......@@ -539,37 +650,31 @@
} else {
title += this.orderMsg.lineteamName + this.orderMsg.dayNum + '日游';
}
//阿里云行程下载
var objFileKey = "TripDownLoad"
objFileKey += "/" + msg.configId + "_" + msg.tcid;
var fileName = title + ".pdf";
if (this.orderId && this.orderId > 0) {
//出团通知书下载
this.pdfDownLoad(fileName, msg);
} else if (urlObj.IsOnline == 0) {
//本地行程下载
this.pdfDownLoad(fileName, msg);
} else if (command && command == 1) {
//阿里云行程下载
var objFileKey = "TripDownLoad"
objFileKey += "/" + msg.configId + "_" + msg.tcid;
this.pdfLoading = true;
objFileKey += "/" + msg.configId + "_" + msg.tcid + "_B2B.pdf";
that.downloadChengDuFileRename(objFileKey, fileName, res => {
this.pdfLoading = false;
if (res.resultCode == 0) {
msg.isShowB2B = 1;
that.pdfDownLoad(fileName, msg);
} else {
that.pdfLoading = false;
}
})
} else if (command && command == 2) {
//阿里云行程下载
var objFileKey = "TripDownLoad"
objFileKey += "/" + msg.configId + "_" + msg.tcid;
objFileKey += "/" + msg.configId + "_" + msg.tcid + ".pdf";
this.pdfLoading = true;
that.downloadChengDuFileRename(objFileKey, fileName, res => {
this.pdfLoading = false;
if (res.resultCode == 0) {
msg.isShowB2B = 0;
that.pdfDownLoad(fileName, msg);
} else {
that.pdfLoading = false;
}
})
} else {
......@@ -577,6 +682,7 @@
}
},
pdfDownLoad: function (fileName, msg) {
var that = this;
let urlObj = this.domainManager();
this.$http({
headers: {
......@@ -590,36 +696,14 @@
}).then(res => {
if (res.data.resultCode === 1 && res.data.data) {
let path = res.data.data;
this.pdfLoading = false;
this.pdfLoading = true;
let urlObj = this.domainManager();
var ocrUrl = "";
ocrUrl = urlObj.ocrUrl + "/Home/DownloadFileForPdfERP?configId=" + msg.configId + "&url=" +
encodeURIComponent(path);
this.$http({
headers: {
'Content-Type': 'application/json'
},
method: 'get',
url: ocrUrl,
data: {},
responseType: 'arraybuffer'
}).then(res => {
this.pdfLoading = false;
let blob = new Blob([res.data], {
type: "application/pdf"
})
let url = URL.createObjectURL(blob);
let link = document.getElementById('pdfDownLoad');
link.href = url;
link.setAttribute("download", fileName);
link.click();
}).catch(err => {
this.pdfLoading = false
})
that.downLoadUrl = path;
that.pdfLoading = true;
this.download_timer = setInterval(function () {
that.checkFile(msg.configId, fileName)
}, 2000);
} else {
this.pdfLoading = false
this.$message.error('PDF获取失败');
that.pdfLoading = false
that.$message.error('PDF获取失败');
}
}).catch(err => {
......@@ -638,13 +722,11 @@
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.editMsgShow = false;
this.init();
this.getTripDetail();
} else {
this.Error(res.data.message);
}
},
err => {}
)
});
},
DateDiff(sDate1, sDate2) { //sDate1和sDate2是2002-12-18格式
var aDate, oDate1, oDate2, iDays
......@@ -655,11 +737,13 @@
iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) //把相差的毫秒数转换为天数
return iDays
},
init() {
getTripDetail() {
var unionfid = 0;
if (this.$route.query.unionfid) {
unionfid = this.$route.query.unionfid;
}
this.pdfLoading = true;
this.loadingText = "正在获取行程信息...";
this.apipost('b2b_get_GetB2BTravelInfoNoDes', {
configId: this.$route.query.configId,
cityId: this.$route.query.cityId,
......@@ -668,6 +752,8 @@
isClick: this.isClick, //不算统计
unionfid: unionfid,
}, res => {
this.pdfLoading = false;
this.loadingText = "";
if (res.data.resultCode == 1) {
let data = (res.data.data);
this.dataAll = data;
......@@ -716,7 +802,6 @@
airportNameList: [],
});
});
}
if (this.orderTripdiff) {
this.editForm = JSON.parse(JSON.stringify(this.orderTripdiff));
......@@ -736,14 +821,7 @@
//初始化行程
this.initTrip(res, data);
}
this.$nextTick(function () {
this.pdfLoading = false;
let imgs = document.getElementsByTagName('img');
for (let i = 0; i < imgs.length; i++) {
document.getElementsByTagName('img')[i].removeAttribute('crossOrigin')
}
})
}, err => {})
});
},
//上移下移(IsUp:0上移,1下移)
MoveItem(item, subIndex, IsUp) {
......@@ -771,7 +849,6 @@
this.tripList = res.data.data.dayList;
this.feature = res.data.data.feature
this.showType = this.feature.featureType;
this.isDirect = res.data.data.isDirect;
if (data.priceList.length > 0) {
data.priceList[0].priceFlight.forEach((x, i) => {
if (i == 0) {
......@@ -1013,135 +1090,3 @@
}
</script>
<style>
@import url('../assets/css/tripIndex.css');
@import url("../assets/css/UpgradedVersion.css");
@import url("../assets/css/tripIndexNew2.css");
@import url('../assets/css/detail.css');
@import url('../assets/css/tripIndexNewHV.css');
.edit_form_box {
display: flex;
justify-content: space-around;
}
.edit_form_box_tit {
color: #000000;
text-align: left;
margin-top: 0;
border-left: 2px solid #e95252;
padding-left: 25px;
}
.TravelFlightList {
width: 100%;
background-color: #fff;
}
.TravelFlightList table {
width: 100%;
}
.TFflightName {
padding: 3px 5px;
display: inline-block;
background-color: #ff9c00;
color: #fff;
border-radius: 4px;
margin-left: 10px;
}
.TFTable .el-button.is-circle {
padding: 5px;
}
.TFTable .el-form-item {
margin: 10px;
}
.TFTable i {
font-size: 14px;
}
.TFTable .el-input--prefix .el-input__inner {
padding-right: 0;
}
.TFAddFlight {
width: 100%;
height: 40px;
text-align: center;
line-height: 40px;
color: #333;
margin-top: 5px;
background-color: #f1f1f1;
font-size: 12px;
border: 1px dashed #dcdcdc;
cursor: pointer;
}
.w110 {
width: 110px !important;
}
.w120 {
width: 120px !important;
}
.normalBtn {
color: #fff;
padding: 0 15px;
height: 30px;
background: #E95252;
border: 1px solid #E95252;
cursor: pointer;
border-radius: 15px;
margin-left: 10px;
}
.hollowFixedBtn {
background: #fff;
color: #E95252;
padding: 0 15px;
height: 30px;
border: 1px solid #E95252;
cursor: pointer;
border-radius: 15px;
margin-left: 10px;
}
@media print {
html,
sbody {
background: none !important;
}
.travelControlTrip {
margin: 0px !important;
padding: 0px !important;
}
.travelControlTripBtn {
display: none !important;
}
.travelControlTripLayer {
display: none !important;
}
#pdfNode {
margin: 0px !important;
}
.trip-block {
border: none !important;
}
@page {
margin: 6.5mm;
}
}
</style>
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