Commit c69f74d0 authored by 黄奎's avatar 黄奎

11

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