Commit c69f74d0 authored by 黄奎's avatar 黄奎

11

parent 02584cd9
...@@ -64,6 +64,8 @@ ...@@ -64,6 +64,8 @@
<span @click="clickDownLoad(item,1)"><i class="el-icon-download" title="旅小友二维码"></i></span> <span @click="clickDownLoad(item,1)"><i class="el-icon-download" title="旅小友二维码"></i></span>
<span @click="clickDownLoad(item,2)"><i class="el-icon-download" title="行程二维码"></i></span> <span @click="clickDownLoad(item,2)"><i class="el-icon-download" title="行程二维码"></i></span>
<span @click="clickDownLoad(item,3)"><i class="el-icon-download" title="原图下载"></i></span>
<i class="el-icon-delete" :title="$t('system.ph_shanchu')" @click.stop="deleteItem(item.ID)"></i> <i class="el-icon-delete" :title="$t('system.ph_shanchu')" @click.stop="deleteItem(item.ID)"></i>
</div> </div>
</div> </div>
...@@ -87,7 +89,11 @@ ...@@ -87,7 +89,11 @@
</template> </template>
<script> <script>
import vueWaterfallEasy from 'vue-waterfall-easy' import vueWaterfallEasy from 'vue-waterfall-easy';
import {
setInterval,
clearInterval
} from 'timers';
export default { export default {
data() { data() {
return { return {
...@@ -119,6 +125,7 @@ ...@@ -119,6 +125,7 @@
download_timer: null, download_timer: null,
loadingText: "", loadingText: "",
pdfLoading: false, pdfLoading: false,
priceObj: {},
} }
}, },
components: { components: {
...@@ -128,9 +135,22 @@ ...@@ -128,9 +135,22 @@
this.msg.TCID = this.$route.query.TCID; this.msg.TCID = this.$route.query.TCID;
this.LineID = this.$route.query.LineID this.LineID = this.$route.query.LineID
this.user = JSON.parse(window.localStorage.userInfo) this.user = JSON.parse(window.localStorage.userInfo)
this.getaddatas() this.getaddatas();
this.getPriceInfo();
}, },
methods: { methods: {
getPriceInfo() {
this.apipost(
"travel_get_GetTravelConfigTCID", {
TCID: this.msg.TCID,
},
(res) => {
if (res.data.resultCode == 1) {
this.priceObj = res.data.data.config;
}
}
);
},
clickDownLoad(item, type) { clickDownLoad(item, type) {
this.downLoadMsg.Id = item.ID; this.downLoadMsg.Id = item.ID;
this.downLoadMsg.Type = type; this.downLoadMsg.Type = type;
...@@ -138,12 +158,30 @@ ...@@ -138,12 +158,30 @@
var that = this; var that = this;
this.download_timer = setInterval(function () { this.download_timer = setInterval(function () {
that.checkFile() that.checkFile()
}, 1000); }, 2000);
}, },
//检查文件是否生成 //检查文件是否生成
checkFile() { checkFile() {
var that = this; var that = this;
var downLoadFileName = "广告图.jpg"; var downLoadFileName = "";
if (this.priceObj) {
if (this.priceObj.LtName) {
downLoadFileName += this.priceObj.LtName;
}
if (this.priceObj.StartDate) {
downLoadFileName += "_" + this.priceObj.StartDate;
}
}
if (this.downLoadMsg.Type == 1) {
downLoadFileName += "旅小友广告";
}
if (this.downLoadMsg.Type == 2) {
downLoadFileName += "行程广告";
}
if (this.downLoadMsg.Type == 3) {
downLoadFileName += "原广告图";
}
downLoadFileName += ".jpg";
let urlObj = this.domainManager(); let urlObj = this.domainManager();
var checkUrl = urlObj.ocrUrl + "/Home/CheckAdFile?Id=" + this.downLoadMsg.Id + "&Type=" + this.downLoadMsg var checkUrl = urlObj.ocrUrl + "/Home/CheckAdFile?Id=" + this.downLoadMsg.Id + "&Type=" + this.downLoadMsg
.Type + "&CreateBy=" + this.downLoadMsg.CreateBy; .Type + "&CreateBy=" + this.downLoadMsg.CreateBy;
...@@ -173,10 +211,7 @@ ...@@ -173,10 +211,7 @@
responseType: 'arraybuffer', responseType: 'arraybuffer',
onDownloadProgress: (progressEvent) => { onDownloadProgress: (progressEvent) => {
const progress = Math.round((progressEvent.loaded / progressEvent.total) * 100); const progress = Math.round((progressEvent.loaded / progressEvent.total) * 100);
that.loadingText = that.$t('objFill.v101.zhengzxiaz') + (that.orderId > 0 ? that.$t( that.loadingText = "正在下载广告图 已完成" + progress + "%";
'Operation.Op_teamNotice') : that.$t('Airticket.Air_Trip')) + that.$t(
'objFill.v101.hote.wenjian') + progress +
that.$t('objFill.v101.qingwugbhsxyem');
// 在这里处理下载进度, 如更新界面上的进度条 // 在这里处理下载进度, 如更新界面上的进度条
} }
}).then(res => { }).then(res => {
...@@ -193,6 +228,11 @@ ...@@ -193,6 +228,11 @@
}).catch(err => { }).catch(err => {
that.pdfLoading = false that.pdfLoading = false
}) })
} else if (res.data == 2) {
clearInterval(that.download_timer);
that.loadingText = "";
that.pdfLoading = false;
that.Error("未检测到二维码区域");
} }
}).catch(err => { }).catch(err => {
that.loadingText = ""; that.loadingText = "";
......
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