Commit 1d599a74 authored by 黄奎's avatar 黄奎

111

parent bca0a77b
...@@ -113,23 +113,48 @@ ...@@ -113,23 +113,48 @@
<template v-if="orderId>0"> <template v-if="orderId>0">
<el-button type="primary" size="medium" @click="toPDF_2023()"> <el-button type="primary" size="medium" @click="toPDF_2023()">
出团通知书下载</el-button> 出团通知书下载</el-button>
<template v-if="lineId==119||lineId==168">
<el-dropdown trigger="click" type="primary" style="margin-left:20px;">
<span class="el-dropdown-link">出团通知书
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown" class="TC-dropdown">
<el-dropdown-item @click.native="ToWord_2023()">
出团通知书WORD
</el-dropdown-item>
<el-dropdown-item @click.native="OuZhouPdf2024()">
出团通知书(欧洲PDF)
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<template v-else>
<el-button type="primary" size="medium" @click="ToWord_2023()"> <el-button type="primary" size="medium" @click="ToWord_2023()">
出团通知书下载WROD</el-button> 出团通知书下载WROD</el-button>
</template>
<el-button type="primary" size="medium" @click="OuZhouPdf2024()" v-if="lineId==119||lineId==168" style="display:none;" >
欧洲出团通知书PDF</el-button>
</template> </template>
<template v-else> <template v-else>
<el-button type="primary" size="medium" @click="toPDF_2023(1)"> <el-button type="primary" size="medium" @click="toPDF_2023(1)">
行程下载</el-button> 行程下载</el-button>
<el-button v-if="isShowAllDownLoad" type="primary" size="medium" @click="toPDF_2023()" <template v-if="lineId==119||lineId==168">
style="margin-left:20px;"> <el-dropdown trigger="click" type="primary" style="margin-left:20px;">
行程下载(N)</el-button> <span class="el-dropdown-link">行程下载WORD
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown" class="TC-dropdown">
<el-dropdown-item @click.native="ToWord_2023()">
行程下载WORD
</el-dropdown-item>
<el-dropdown-item @click.native="OuZhouPdf2024()">
行程下载(欧洲PDF)
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<template v-else>
<el-button type="primary" size="medium" @click="ToWord_2023()" style="margin-left:20px;"> <el-button type="primary" size="medium" @click="ToWord_2023()" style="margin-left:20px;">
行程下载WORD</el-button> 行程下载WORD</el-button>
<el-button type="primary" size="medium" @click="OuZhouPdf2024()" style="margin-left:20px;display:none;" </template>
v-if="lineId==119||lineId==168">
欧洲行程PDF</el-button>
</template> </template>
<!-- 可以让销售修改基本信息--> <!-- 可以让销售修改基本信息-->
<el-button v-if="orderId>0" type="primary" size="medium" value="修改信息" @click="editMsgShow=true"> <el-button v-if="orderId>0" type="primary" size="medium" value="修改信息" @click="editMsgShow=true">
...@@ -355,14 +380,10 @@ ...@@ -355,14 +380,10 @@
pdfLoading: false, pdfLoading: false,
loadingText: "", //加载文字 loadingText: "", //加载文字
download_timer: null, download_timer: null,
isShowAllDownLoad: false, //是否显示实时下载行程按钮
} }
}, },
mounted() { mounted() {
this.orderId = this.$route.query.orderId; this.orderId = this.$route.query.orderId;
if (this.$route.query.isda && this.$route.query.isda == 1) {
this.isShowAllDownLoad = true;
}
this.getWxCode(); this.getWxCode();
this.getTripDetail(); this.getTripDetail();
this.getAirlines(); this.getAirlines();
...@@ -672,36 +693,15 @@ ...@@ -672,36 +693,15 @@
if (res.data.resultCode === 1) { if (res.data.resultCode === 1) {
this.loadingText = "正在下载pdf文件..."; this.loadingText = "正在下载pdf文件...";
let path = res.data.data; let path = res.data.data;
var ocrUrl = ""; that.downLoadUrl = path;
that.pdfLoading = true; that.pdfLoading = true;
ocrUrl = urlObj.ocrUrl + "/Home/CreateTYPdf?url=" + encodeURIComponent(path); this.download_timer = setInterval(function () {
that.$http({ that.checkFile(msg.configId, fileName)
headers: { }, 2000);
'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 = "";
}).catch(err => {
that.pdfLoading = false
})
this.loadingText = "";
} else { } else {
this.Error('WORD获取失败'); this.Error('WORD获取失败');
} }
this.pdfLoading = false
}).catch(err => { }).catch(err => {
}) })
...@@ -737,7 +737,7 @@ ...@@ -737,7 +737,7 @@
this.pdfDownLoad(fileName, msg); this.pdfDownLoad(fileName, msg);
} else if (command && command == 1) { } else if (command && command == 1) {
this.pdfLoading = true; this.pdfLoading = true;
objFileKey += "/" + msg.configId + "_" + msg.tcid + "_B2B.pdf?d="+Math.random(); objFileKey += "/" + msg.configId + "_" + msg.tcid + "_B2B.pdf?d=" + Math.random();
that.downloadChengDuFileRename(objFileKey, fileName, res => { that.downloadChengDuFileRename(objFileKey, fileName, res => {
this.pdfLoading = false; this.pdfLoading = false;
if (res.resultCode == 0) { if (res.resultCode == 0) {
......
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