Commit 02584cd9 authored by 黄奎's avatar 黄奎

页面修改

parent a06dad31
<style> <style>
@import "../../../assets/css/advert/advmanager"; @import "../../../assets/css/advert/advmanager";
.GroupAdvert .zezhao{left:0!important;top:0!important;bottom:0!important;width:100%;height:100%;z-index:999;}
.GroupAdvert img{width:100%;height:100%;} .GroupAdvert .zezhao {
left: 0 !important;
top: 0 !important;
bottom: 0 !important;
width: 100%;
height: 100%;
z-index: 999;
}
.GroupAdvert img {
width: 100%;
height: 100%;
}
</style> </style>
<template> <template>
<div class="advmanager-box"> <div class="advmanager-box">
<div class="query-box"> <div class="query-box">
<ul> <ul>
<li> <li>
<span> <span>
<em>{{$t('objFill.guangaolx')}}</em> <em>{{$t('objFill.guangaolx')}}</em>
<el-select class='w150' v-model="msg.AdType" filterable :placeholder="$t('pub.pleaseSel')"> <el-select class='w150' v-model="msg.AdType" filterable :placeholder="$t('pub.pleaseSel')">
<el-option :label="$t('pub.unlimitedSel')" :value='SelectDefaultValue'></el-option> <el-option :label="$t('pub.unlimitedSel')" :value='SelectDefaultValue'></el-option>
<el-option v-for="item in AdTypeList" :label='item.name' :value='item.Id' :key='item.Id'> <el-option v-for="item in AdTypeList" :label='item.name' :value='item.Id' :key='item.Id'>
</el-option> </el-option>
</el-select> </el-select>
</span> </span>
</li> </li>
<li> <li>
<span> <span>
<input type="button" class="normalBtn" @click="getaddatas" :value="$t('pub.searchBtn')"/> <input type="button" class="normalBtn" @click="getaddatas" :value="$t('pub.searchBtn')" />
</span> </span>
<span> <span>
<el-upload class="upload-demo" :http-request="UploadAttachment" :multiple="true" accept="image/jpeg,image/gif,image/png,image/bmp" <el-upload class="upload-demo" :http-request="UploadAttachment" :multiple="true"
:show-file-list="false" action=""> accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false" action="">
<input type="button" class="normalBtn" :value="$t('system.up_upImg')"/> <input type="button" class="normalBtn" :value="$t('system.up_upImg')" />
</el-upload> </el-upload>
</span> </span>
<span> <span>
<input type="button" class="normalBtn" @click='goUrl("advert",LineID,msg.TCID,"制作广告")' :value="$t('objFill.zhizuogg')"/> <input type="button" class="normalBtn" @click='goUrl("advert",LineID,msg.TCID,"制作广告")'
</span> :value="$t('objFill.zhizuogg')" />
</li> </span>
</ul> </li>
</div> </ul>
<div class="content GroupAdvert"> </div>
<ul> <div class="content GroupAdvert" v-loading="pdfLoading" :element-loading-text="loadingText">
<li v-for='(item,index) in dataList' :key="item.id" @click="getPicList(index)"> <ul>
<div class="img-box"> <!--@click="getPicList(index)"-->
<img :src="item.AdvertisingPicUrl" /> <li v-for='(item,index) in dataList' :key="item.id+index">
<span class="free" v-if="item.AdType==1">{{$t('Operation.Op_advertising')}}</span> <div class="img-box">
<span class="free" v-if="item.AdType==2">{{$t('objFill.bendi')}}</span> <img :src="item.AdvertisingPicUrl" />
<div class="zezhao"> <span class="free" v-if="item.AdType==1">{{$t('Operation.Op_advertising')}}</span>
<a v-if="item.AdType==1" :href='`/#/advert?id=${item.AdvertId}&TCID=${item.TCID}`'><i class="el-icon-edit" :title="$t('pub.updateMsg')"></i></a> <span class="free" v-if="item.AdType==2">{{$t('objFill.bendi')}}</span>
<a :href='item.AdvertisingPicUrl' :download="$t('salesModule.AdvPic')+'.png'"><i class="el-icon-download" :title="$t('objFill.xz')"></i></a> <div class="zezhao">
<i class="el-icon-delete" :title="$t('system.ph_shanchu')" @click.stop="deleteItem(item.ID)"></i> <!-- <a v-if="item.AdType==1" :href='`/#/advert?id=${item.AdvertId}&TCID=${item.TCID}`'><i class="el-icon-edit"
</div> :title="$t('pub.updateMsg')"></i></a>
</div> <a :href='item.AdvertisingPicUrl' target="_blank" :download="$t('salesModule.AdvPic')+'.png'"><i class="el-icon-download"
</li> :title="$t('objFill.xz')"></i></a> -->
</ul>
<div v-if='dataList.length==0' style='width:100%;margin-top:50px;text-align:center;color: #ccc;'> <span @click="clickDownLoad(item,1)"><i class="el-icon-download" title="旅小友二维码"></i></span>
<i class="iconfont icon-kong" style="font-size: 120px;"></i><br/>
{{$t('objFill.haimeiyggo')}} <span @click="clickDownLoad(item,2)"><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>
</div> </div>
<div v-if='picIsShow' class="viewBigPicLayer" @click="picIsShow=false"> </li>
<i class="el-icon-circle-close-outline clolseViewBigPicLayer" @click="picIsShow=false"></i> </ul>
<el-carousel height="600px" :initial-index='initialIndex' :interval="5000" trigger="click"> <div v-if='dataList.length==0' style='width:100%;margin-top:50px;text-align:center;color: #ccc;'>
<el-carousel-item v-for="(item,index) in picObj" :key="index"> <i class="iconfont icon-kong" style="font-size: 120px;"></i><br />
<div class="inlineDiv ownScrollbarStyle"><img :src="item" /></div> {{$t('objFill.haimeiyggo')}}
</el-carousel-item> </div>
</el-carousel>
</div>
</div> </div>
<div v-if='picIsShow' class="viewBigPicLayer" @click="picIsShow=false">
<i class="el-icon-circle-close-outline clolseViewBigPicLayer" @click="picIsShow=false"></i>
<el-carousel height="600px" :initial-index='initialIndex' :interval="5000" trigger="click">
<el-carousel-item v-for="(item,index) in picObj" :key="index">
<div class="inlineDiv ownScrollbarStyle"><img :src="item" /></div>
</el-carousel-item>
</el-carousel>
</div>
<a id="pdfDownLoad" style="display:none;"></a>
</div>
</template> </template>
<script> <script>
import vueWaterfallEasy from 'vue-waterfall-easy' import vueWaterfallEasy from 'vue-waterfall-easy'
export default { export default {
data(){ data() {
return{ return {
dataList:[], dataList: [],
pageIndex:0, pageIndex: 0,
pageSize:15, pageSize: 15,
picObj:[], picObj: [],
picIsShow:false, picIsShow: false,
initialIndex:0, initialIndex: 0,
total:0, total: 0,
LineID:0, LineID: 0,
msg:{ msg: {
TCID:0, TCID: 0,
AdType:0 AdType: 0
}, },
SelectDefaultValue:0, SelectDefaultValue: 0,
AdTypeList:[{ AdTypeList: [{
Id:1, Id: 1,
name:this.$t('objFill.guanggaozz') name: this.$t('objFill.guanggaozz')
},{ }, {
Id:2, Id: 2,
name:this.$t('objFill.bendisc') name: this.$t('objFill.bendisc')
}], }],
} downLoadMsg: {
Id: 0, //广告Id
Type: 0, //类型(1-旅小友二维码,2-行程文件二维码)
CreateBy: 0, //下载人员
},
download_timer: null,
loadingText: "",
pdfLoading: false,
}
}, },
components: { components: {
vueWaterfallEasy vueWaterfallEasy
}, },
mounted(){ mounted() {
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()
}, },
methods:{ methods: {
//删除广告 clickDownLoad(item, type) {
deleteItem(ID){ this.downLoadMsg.Id = item.ID;
var that = this; this.downLoadMsg.Type = type;
var Ids = []; this.downLoadMsg.CreateBy = this.getLocalStorage().EmployeeId
Ids.push(ID); var that = this;
that.Confirm(that.$t('tips.shifoushanchu'), function() { this.download_timer = setInterval(function () {
var msg = { that.checkFile()
Ids: Ids }, 1000);
}; },
that.apipost( //检查文件是否生成
"travel_post_DeletePriceAdvert", checkFile() {
msg, var that = this;
res => { var downLoadFileName = "广告图.jpg";
if (res.data.resultCode == 1) { let urlObj = this.domainManager();
that.Success(res.data.message); var checkUrl = urlObj.ocrUrl + "/Home/CheckAdFile?Id=" + this.downLoadMsg.Id + "&Type=" + this.downLoadMsg
that.getaddatas(); .Type + "&CreateBy=" + this.downLoadMsg.CreateBy;
} this.pdfLoading = true;
}, this.loadingText = "正在生成广告图...";
null this.$http({
); headers: {
}); 'Content-Type': 'application/json'
}, },
method: 'get',
handleCurrentChange(val) { url: checkUrl,
this.pageIndex++ data: {}
this.getaddatas() }).then(res => {
}, if (res.data == 1) {
getaddatas(){ clearInterval(that.download_timer);
this.apipost("travel_post_GetPriceAdvert", this.msg, res => { that.loadingText = that.$t('objFill.zhengzxzpdf2');
if(res.data.resultCode==1){ var ocrUrl = "";
this.dataList = res.data.data; ocrUrl = urlObj.ocrUrl + "/Home/DownLoadAdFile?Id=" + that.downLoadMsg.Id + "&Type=" + that.downLoadMsg
}else{ .Type + "&CreateBy=" + that.downLoadMsg.CreateBy;
this.Error(res.data.message); that.$http({
} headers: {
},err => {}) 'Content-Type': 'application/json'
}, },
//获取轮播路径 method: 'get',
getPicList(index){ url: ocrUrl,
this.picIsShow=true; data: {},
this.picObj=[]; responseType: 'arraybuffer',
this.initialIndex = index; onDownloadProgress: (progressEvent) => {
this.dataList.forEach((x,index)=>{ const progress = Math.round((progressEvent.loaded / progressEvent.total) * 100);
this.picObj.push(x.AdvertisingPicUrl); 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');
// 在这里处理下载进度, 如更新界面上的进度条
}
}).then(res => {
that.pdfLoading = false;
let blob = new Blob([res.data], {
type: "image/jpeg"
})
let fileUrl = URL.createObjectURL(blob);
let link = document.getElementById('pdfDownLoad');
link.href = fileUrl;
link.setAttribute("download", downLoadFileName);
link.click();
that.loadingText = "";
}).catch(err => {
that.pdfLoading = false
}) })
}, }
//上传广告图片 }).catch(err => {
UploadAttachment(file) { that.loadingText = "";
let newArr = []; that.pdfLoading = false;
newArr.push(file.file); clearInterval(that.download_timer);
let fileName = file.file.name; })
var path = "/Upload/DMC/Price/"; },
var imgArr = []; //删除广告
this.UploadSelfFileT(path, newArr, x => { deleteItem(ID) {
var obj = this.$DMCUtils.DMCImageObj(); var that = this;
var str = x.data.FilePath; var Ids = [];
var imgUrl = this.domainManager().ViittoFileUrl + x.data.FilePath; Ids.push(ID);
obj.Path = str; that.Confirm(that.$t('tips.shifoushanchu'), function () {
obj.ShowPath = imgUrl; var msg = {
imgArr.push(obj.ShowPath); Ids: Ids
let msg = { };
TCID:this.msg.TCID, that.apipost(
AdvertisingPicUrlList:imgArr "travel_post_DeletePriceAdvert",
} msg,
this.apipost("travel_post_AddPriceLocalAdvert", msg, res => { res => {
if(res.data.resultCode==1){ if (res.data.resultCode == 1) {
this.Success(res.data.message); that.Success(res.data.message);
this.getaddatas(); that.getaddatas();
}else{ }
this.Error(res.data.message); },
} null
},err => {}) );
},2); });
}, },
//跳转 handleCurrentChange(val) {
goUrl(path,LineID,TCID, name) { this.pageIndex++
this.$router.push({ this.getaddatas()
name: path, },
query: { LineID: LineID, TCID: TCID ,blank:'y',tab:name} getaddatas() {
}); this.apipost("travel_post_GetPriceAdvert", this.msg, res => {
}, if (res.data.resultCode == 1) {
this.dataList = res.data.data;
} else {
this.Error(res.data.message);
}
}, err => {})
},
//获取轮播路径
getPicList(index) {
this.picIsShow = true;
this.picObj = [];
this.initialIndex = index;
this.dataList.forEach((x, index) => {
this.picObj.push(x.AdvertisingPicUrl);
})
},
//上传广告图片
UploadAttachment(file) {
let newArr = [];
newArr.push(file.file);
let fileName = file.file.name;
var path = "/Upload/DMC/Price/";
var imgArr = [];
this.UploadSelfFileT(path, newArr, x => {
var obj = this.$DMCUtils.DMCImageObj();
var str = x.data.FilePath;
var imgUrl = this.domainManager().ViittoFileUrl + x.data.FilePath;
obj.Path = str;
obj.ShowPath = imgUrl;
imgArr.push(obj.ShowPath);
let msg = {
TCID: this.msg.TCID,
AdvertisingPicUrlList: imgArr
}
this.apipost("travel_post_AddPriceLocalAdvert", msg, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.getaddatas();
} else {
this.Error(res.data.message);
}
}, err => {})
}, 2);
},
//跳转
goUrl(path, LineID, TCID, name) {
this.$router.push({
name: path,
query: {
LineID: LineID,
TCID: TCID,
blank: 'y',
tab: name
}
});
},
} }
} }
</script> </script>
...@@ -3333,7 +3333,8 @@ ...@@ -3333,7 +3333,8 @@
that.Success(res.data.message); that.Success(res.data.message);
that.changePriceMsg.isShowChangePrice = false; that.changePriceMsg.isShowChangePrice = false;
that.changePriceMsg.NewB2BPrice = ""; that.changePriceMsg.NewB2BPrice = "";
that.changePriceMsg.NewB2BPrice = ""; that.changePriceMsg.NewB2CPrice = "";
that.changePriceMsg.ChangeRemark="";
that.changePriceMsg.TCID = 0; that.changePriceMsg.TCID = 0;
that.getControlList(); that.getControlList();
} else { } else {
......
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