Commit b5380156 authored by 罗超's avatar 罗超

1

parent f2de6bc5
...@@ -535,6 +535,9 @@ input:-webkit-autofill { ...@@ -535,6 +535,9 @@ input:-webkit-autofill {
.w780 { .w780 {
width: 780px!important; width: 780px!important;
} }
.w1000 {
width: 1000px!important;
}
.w50 { .w50 {
width: 50px !important; width: 50px !important;
......
<style> <style>
@import "../../assets/css/advert/advmanager"; @import "../../assets/css/advert/advmanager";
</style> </style>
<template> <template>
<div class="advmanager-box"> <div class="advmanager-box">
<div class="content" style="top: 50px">
<div class="content" style="top:50px;">
<!-- <ul> <!-- <ul>
<li v-for='item in addatas' :key="item.id"> <li v-for='item in addatas' :key="item.id">
<div class="img-box"> <div class="img-box">
...@@ -18,139 +17,189 @@ ...@@ -18,139 +17,189 @@
</div> </div>
</li> </li>
</ul> --> </ul> -->
<vueWaterfallEasy v-if='addatas.length!=0' ref="waterfall" :imgsArr="addatas" @scrollReachBottom="handleCurrentChange" :maxCols='7' :imgWidth='208' :enablePullDownEvent='true'> <vueWaterfallEasy
v-if="addatas.length != 0"
ref="waterfall"
:imgsArr="addatas"
@scrollReachBottom="handleCurrentChange"
:maxCols="7"
:imgWidth="208"
:enablePullDownEvent="true"
>
<template slot-scope="props"> <template slot-scope="props">
<span class="free"><i class="el-icon-share"></i> 0</span> <span class="free"><i class="el-icon-share"></i> 0</span>
<div class="zezhao"> <div class="zezhao">
<a :href='`/#/advert?id=${props.value.id}`'><i class="el-icon-edit" title="修改"></i></a> <a :href="`/#/advert?id=${props.value.id}`"
<a :href='props.value.advertisingPicUrlStr' download="广告图.png"><i class="el-icon-download" title="下载"></i></a> ><i class="el-icon-edit" title="修改"></i
<i class="el-icon-delete" title="删除" @click="deleteItem(props.value)"></i> ></a>
<a :href="props.value.advertisingPicUrlStr" download="广告图.png"
><i class="el-icon-download" title="下载"></i
></a>
<i
class="el-icon-delete"
title="删除"
@click="deleteItem(props.value)"
></i>
</div> </div>
</template> </template>
</vueWaterfallEasy> </vueWaterfallEasy>
<div v-if='addatas.length==0' style='width:100%;margin-top:50px;text-align:center;color: #ccc;'> <div
<i class="iconfont icon-kong" style="font-size: 120px;"></i><br/> v-if="addatas.length == 0"
还没有广告哦,<a href='/#/advert' style="color:rgb(0, 129, 255)">立即制作</a> style="width: 100%; margin-top: 50px; text-align: center; color: #ccc"
>
<i class="iconfont icon-kong" style="font-size: 120px"></i><br />
还没有广告哦,<a href="/#/advert" style="color: rgb(0, 129, 255)"
>立即制作</a
>
</div> </div>
</div> </div>
</div> </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 {
lines:[], lines: [],
teams:[], teams: [],
modelTeams:[], modelTeams: [],
countrys:[], countrys: [],
addatas:[], addatas: [],
pageIndex:0, pageIndex: 0,
pageSize:15, pageSize: 15,
total:0, total: 0,
msg:{ msg: {
lineId:'0', lineId: "0",
teamId:'0', teamId: "0",
countryId:'0', countryId: "0",
type:'0' type: "0",
}, },
user:{}, user: {},
model:{}, model: {},
isAdd:false, isAdd: false,
uploadType:0, uploadType: 0,
} };
}, },
components: { components: {
vueWaterfallEasy vueWaterfallEasy,
}, },
mounted(){ mounted() {
this.user=JSON.parse(window.localStorage.userInfo) this.user = JSON.parse(window.localStorage.userInfo);
this.getline() this.getline();
this.getcountry() this.getcountry();
this.getaddatas(0) this.getaddatas(0);
}, },
methods:{ methods: {
deleteItem(x){ deleteItem(x) {
this.apipost("Advertising_post_Remove", {'ID':x.id}, x => { this.apipost(
if(x.data.resultCode==1){ "Advertising_post_Remove",
this.$message.success('删除成功') { ID: x.id },
this.getaddatas(0) (x) => {
}else{ if (x.data.resultCode == 1) {
this.$message.error(x.data.message) this.$message.success("删除成功");
this.getaddatas(0);
} else {
this.$message.error(x.data.message);
} }
},err => {}) },
(err) => {}
);
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageIndex++ this.pageIndex++;
this.getaddatas(1) this.getaddatas(1);
}, },
getaddatas(type){ getaddatas(type) {
if(type==0){ if (type == 0) {
this.pageIndex=0 this.pageIndex = 0;
} }
let msg={ let msg = {
pageIndex:this.pageIndex, pageIndex: this.pageIndex,
pageSize:this.pageSize pageSize: this.pageSize,
} };
this.apipost("Advertising_post_GetPageList", msg, x => { this.apipost(
x.data.data.pageData.forEach(x=>{ "Advertising_post_GetPageList",
x.src=`${x.advertisingPicUrlStr}?x-oss-process=image/resize,w_200` msg,
}) (x) => {
if(x.data.data.pageData.length==0){ x.data.data.pageData.forEach((x) => {
this.$refs.waterfall.waterfallOver() x.src = `${x.advertisingPicUrlStr}?x-oss-process=image/resize,w_200`;
} });
this.addatas=[]; if (x.data.data.pageData.length == 0) {
this.addatas=this.addatas.concat(x.data.data.pageData) this.$refs.waterfall.waterfallOver();
this.total=x.data.data.pageCount
},err => {})
},
getcountry(){
this.apipost("dict_post_Destination_GetCountry", {}, x => {
this.countrys=x.data.data
},err => {})
},
getteam(){
let msg={
'RB_Branch_id':this.user.RB_Branch_id,
'isTOOP':1,
'lineID':this.msg.lineId
}
this.apipost("team_post_GetList", msg, x => {
this.teams=x.data.data
if(x.data.data.length>0)
this.msg.teamId=x.data.data[0].LtID
},err => {})
},
changeLine(){
this.teams.splice(0,this.teams.length-1)
if(this.msg.lineId!==0){
this.getteam()
} }
this.addatas = [];
this.addatas = this.addatas.concat(x.data.data.pageData);
this.total = x.data.data.pageCount;
}, },
changeLineForm(){ (err) => {}
this.modelTeams.splice(0,this.modelTeams.length-1) );
if(this.model.LineID!==0&&this.model.LineID!=''){
let msg={
'RB_Branch_id':this.user.RB_Branch_id,
'isTOOP':1,
'lineID':this.model.LineID
}
this.apipost("team_post_GetList", msg, x => {
this.modelTeams=x.data.data
if(x.data.data.length>0)
this.model.SeriesID=x.data.data[0].LtID
},err => {})
}
}, },
getline(){ getcountry() {
let msg={'pageIndex':0,'pageSize':100} this.apipost(
this.apipost("line_post_GetPageList", msg, x => { "dict_post_Destination_GetCountry",
this.lines=x.data.data.pageData {},
},err => {}) (x) => {
this.countrys = x.data.data;
},
(err) => {}
);
},
getteam() {
let msg = {
RB_Branch_id: this.user.RB_Branch_id,
isTOOP: 1,
lineID: this.msg.lineId,
};
this.apipost(
"team_post_GetList",
msg,
(x) => {
this.teams = x.data.data;
if (x.data.data.length > 0) this.msg.teamId = x.data.data[0].LtID;
},
(err) => {}
);
},
changeLine() {
this.teams.splice(0, this.teams.length - 1);
if (this.msg.lineId !== 0) {
this.getteam();
} }
},
changeLineForm() {
this.modelTeams.splice(0, this.modelTeams.length - 1);
if (this.model.LineID !== 0 && this.model.LineID != "") {
let msg = {
RB_Branch_id: this.user.RB_Branch_id,
isTOOP: 1,
lineID: this.model.LineID,
};
this.apipost(
"team_post_GetList",
msg,
(x) => {
this.modelTeams = x.data.data;
if (x.data.data.length > 0)
this.model.SeriesID = x.data.data[0].LtID;
},
(err) => {}
);
} }
} },
getline() {
let msg = { pageIndex: 0, pageSize: 100 };
this.apipost(
"line_post_GetPageList",
msg,
(x) => {
this.lines = x.data.data.pageData;
},
(err) => {}
);
},
},
};
</script> </script>
\ No newline at end of file
<style> <style>
@import "../../assets/css/advert/advmanager"; @import "../../assets/css/advert/advmanager";
</style> </style>
<template> <template>
<div class="advmanager-box"> <div class="advmanager-box">
...@@ -28,41 +28,67 @@ ...@@ -28,41 +28,67 @@
</el-select> </el-select>
</li> --> </li> -->
<li> <li>
<span>{{$t('advmanager.v_country')}}</span> <span>{{ $t("advmanager.v_country") }}</span>
<el-select v-model="msg.countryId" clearable class="w150" filterable> <el-select v-model="msg.countryId" clearable class="w150" filterable>
<el-option :label="$t('advmanager.v_all')" value='0'></el-option> <el-option :label="$t('advmanager.v_all')" value="0"></el-option>
<el-option v-for='item in countrys' <el-option
v-for="item in countrys"
:key="item.ID" :key="item.ID"
:label="item.Name" :label="item.Name"
:value="item.ID"> :value="item.ID"
>
</el-option> </el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<span>{{$t('advmanager.v_type')}}</span> <span>{{ $t("advmanager.v_type") }}</span>
<el-select v-model="msg.type" class="w150" clearable filterable> <el-select v-model="msg.type" class="w150" clearable filterable>
<el-option :label="$t('advmanager.v_all')" value='0'></el-option> <el-option :label="$t('advmanager.v_all')" value="0"></el-option>
<el-option :label="$t('advmanager.v_shoufei')" value='1'></el-option> <el-option
<el-option :label="$t('advmanager.v_free')" value='2'></el-option> :label="$t('advmanager.v_shoufei')"
value="1"
></el-option>
<el-option :label="$t('advmanager.v_free')" value="2"></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<button class="normalBtn" type="button" @click="openaddbox">{{$t('pub.addBtn')}}</button> <button class="normalBtn" type="button" @click="openaddbox">
<button class="hollowFixedBtn" type="button" @click="getaddatas(0)">{{$t('pub.searchBtn')}}</button> {{ $t("pub.addBtn") }}
</button>
<button class="hollowFixedBtn" type="button" @click="getaddatas(0)">
{{ $t("pub.searchBtn") }}
</button>
</li> </li>
</ul> </ul>
</div> </div>
<div class="content" :class="{showAddBox:isAdd}" > <div class="content" :class="{ showAddBox: isAdd }">
<vueWaterfallEasy :imgsArr="addatas" @scrollReachBottom="handleCurrentChange" :maxCols='7' :imgWidth='208' :enablePullDownEvent='true'> <vueWaterfallEasy
:imgsArr="addatas"
@scrollReachBottom="handleCurrentChange"
:maxCols="7"
:imgWidth="208"
:enablePullDownEvent="true"
>
<template slot-scope="props"> <template slot-scope="props">
<span class="money" v-if="props.value.IsFee==1">{{props.value.ChargeAmount.toFixed(2)}}</span> <span class="money" v-if="props.value.IsFee == 1"
<span class="free" v-else>{{$t('advmanager.v_free')}}</span> >{{ props.value.ChargeAmount.toFixed(2) }}</span
>
<span class="free" v-else>{{ $t("advmanager.v_free") }}</span>
<div class="star-box"> <div class="star-box">
<i class="iconfont icon-star star"></i>&nbsp; {{props.value.AdvertisingCount}} <i class="iconfont icon-star star"></i>&nbsp;
{{ props.value.AdvertisingCount }}
</div> </div>
<div class="zezhao"> <div class="zezhao">
<i class="el-icon-edit" :title="$t('pub.updateMsg')" @click="update(props.value)"></i> <i
<i class="el-icon-delete" :title="$t('system.table_delete')" @click="deleteItem(props.value)" ></i> class="el-icon-edit"
:title="$t('pub.updateMsg')"
@click="update(props.value)"
></i>
<i
class="el-icon-delete"
:title="$t('system.table_delete')"
@click="deleteItem(props.value)"
></i>
</div> </div>
</template> </template>
</vueWaterfallEasy> </vueWaterfallEasy>
...@@ -90,56 +116,89 @@ ...@@ -90,56 +116,89 @@
</el-select> </el-select>
</li> --> </li> -->
<li> <li>
<span>{{$t('advmanager.v_type')}}:</span> <span>{{ $t("advmanager.v_type") }}:</span>
<el-select v-model="model.IsFee" class="w150" clearable filterable> <el-select v-model="model.IsFee" class="w150" clearable filterable>
<el-option :label="$t('advmanager.v_shoufei')" value='1'></el-option> <el-option
<el-option :label="$t('advmanager.v_free')" value='2'></el-option> :label="$t('advmanager.v_shoufei')"
value="1"
></el-option>
<el-option :label="$t('advmanager.v_free')" value="2"></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<span>{{$t('advmanager.v_country')}}:</span> <span>{{ $t("advmanager.v_country") }}:</span>
<el-select v-model="CountryID" multiple collapse-tags clearable class="w240" filterable> <el-select
<el-option v-for='item in countrys' v-model="CountryID"
multiple
collapse-tags
clearable
class="w240"
filterable
>
<el-option
v-for="item in countrys"
:key="item.ID" :key="item.ID"
:label="item.Name" :label="item.Name"
:value="item.ID"> :value="item.ID"
>
</el-option> </el-option>
</el-select> </el-select>
</li> </li>
<li v-show='model.IsFee=="1"'> <li v-show="model.IsFee == '1'">
<span>收费金额:</span> <span>收费金额:</span>
<el-input v-model="model.ChargeAmount" class="w150" clearable filterable></el-input> <el-input
</li> v-model="model.ChargeAmount"
<li> class="w150"
clearable
filterable
></el-input>
</li> </li>
<li></li>
</ul> </ul>
<div class="upload-box"> <div class="upload-box">
<input type="file" value="" ref="loadFile" @change="upload" style="display:none;"/> <input
type="file"
value=""
ref="loadFile"
@change="upload"
style="display: none"
/>
<label>底图:</label> <label>底图:</label>
<div class="upload-box-normal" v-if='model.PictureUrl==""' @click="openupload(0)" > <div
class="upload-box-normal"
v-if="model.PictureUrl == ''"
@click="openupload(0)"
>
<i class="iconfont icon-img_jiahao_big"></i> <i class="iconfont icon-img_jiahao_big"></i>
</div> </div>
<div class="upload-box-img" v-else> <div class="upload-box-img" v-else>
<img :src='model.PictureUrl'> <img :src="model.PictureUrl" />
<div class="zezhao"> <div class="zezhao">
<i class="el-icon-delete" title="删除" @click="deletePic(0)"></i> <i class="el-icon-delete" title="删除" @click="deletePic(0)"></i>
</div> </div>
</div> </div>
<label>原图:</label> <label>原图:</label>
<div class="upload-box-normal" v-if='model.SamplePicturesUrl==""' @click="openupload(1)" > <div
class="upload-box-normal"
v-if="model.SamplePicturesUrl == ''"
@click="openupload(1)"
>
<i class="iconfont icon-img_jiahao_big"></i> <i class="iconfont icon-img_jiahao_big"></i>
</div> </div>
<div class="upload-box-img" v-else> <div class="upload-box-img" v-else>
<img :src='model.SamplePicturesUrl'> <img :src="model.SamplePicturesUrl" />
<div class="zezhao"> <div class="zezhao">
<i class="el-icon-delete" title="删除" @click="deletePic(1)"></i> <i class="el-icon-delete" title="删除" @click="deletePic(1)"></i>
</div> </div>
</div> </div>
</div> </div>
<div class="opera-btn-box"> <div class="opera-btn-box">
<button class="normalBtn" type="button" @click="save">{{$t('pub.saveBtn')}}</button> <button class="normalBtn" type="button" @click="save">
<button class="hollowFixedBtn" type="button" @click="close">{{$t('pub.cancelBtn')}}</button> {{ $t("pub.saveBtn") }}
</button>
<button class="hollowFixedBtn" type="button" @click="close">
{{ $t("pub.cancelBtn") }}
</button>
</div> </div>
</div> </div>
<!-- <el-pagination background @current-change="handleCurrentChange" :current-page.sync="pageIndex" layout="total,prev, pager, next, jumper" :page-size="pageSize" :total="total"> <!-- <el-pagination background @current-change="handleCurrentChange" :current-page.sync="pageIndex" layout="total,prev, pager, next, jumper" :page-size="pageSize" :total="total">
...@@ -148,100 +207,109 @@ ...@@ -148,100 +207,109 @@
</template> </template>
<script> <script>
import vueWaterfallEasy from 'vue-waterfall-easy' import vueWaterfallEasy from "vue-waterfall-easy";
export default { export default {
data(){ data() {
return{ return {
lines:[], lines: [],
teams:[], teams: [],
modelTeams:[], modelTeams: [],
countrys:[], countrys: [],
addatas:[], addatas: [],
CountryID:[], CountryID: [],
pageIndex:0, pageIndex: 0,
pageSize:50, pageSize: 50,
total:0, total: 0,
msg:{ msg: {
lineId:'0', lineId: "0",
teamId:'0', teamId: "0",
countryId:'0', countryId: "0",
type:'0' type: "0",
},
user:{},
model:{},
isAdd:false,
uploadType:0
}
}, },
mounted(){ user: {},
this.user=JSON.parse(window.localStorage.userInfo) model: {},
this.getline() isAdd: false,
this.getcountry() uploadType: 0,
this.getaddatas(0) };
},
mounted() {
this.user = JSON.parse(window.localStorage.userInfo);
this.getline();
this.getcountry();
this.getaddatas(0);
}, },
components: { components: {
vueWaterfallEasy vueWaterfallEasy,
}, },
methods:{ methods: {
deleteItem(x){ deleteItem(x) {
this.apipost("Advertising_post_DelAdvertising", {'BAID':x.ID}, x => { this.apipost(
if(x.data.resultCode==1){ "Advertising_post_DelAdvertising",
this.$message.success('删除成功') { BAID: x.ID },
this.getaddatas(0) (x) => {
}else{ if (x.data.resultCode == 1) {
this.$message.error(x.data.message) this.$message.success("删除成功");
this.getaddatas(0);
} else {
this.$message.error(x.data.message);
} }
},err => {})
}, },
update(x){ (err) => {}
this.CountryID=[]; );
},
update(x) {
this.CountryID = [];
this.getmodelTeams(x.LineID); this.getmodelTeams(x.LineID);
x.CountryIds.forEach(y=>{ x.CountryIds.forEach((y) => {
this.CountryID.push(y.CountryID); this.CountryID.push(y.CountryID);
}) });
this.model={ this.model = {
ID:x.ID, ID: x.ID,
LineID:x.LineID, LineID: x.LineID,
SeriesID:x.SeriesID, SeriesID: x.SeriesID,
CountryID:x.CountryID, CountryID: x.CountryID,
ScenicSpotID:x.ScenicSpotID, ScenicSpotID: x.ScenicSpotID,
PictureUrl:x.PictureUrl, PictureUrl: x.PictureUrl,
SamplePicturesUrl:x.SamplePicturesUrl, SamplePicturesUrl: x.SamplePicturesUrl,
Title:x.Title, Title: x.Title,
ChargeAmount:x.ChargeAmount, ChargeAmount: x.ChargeAmount,
IsFee:x.IsFee.toString() IsFee: x.IsFee.toString(),
} };
this.isAdd=true this.isAdd = true;
}, },
close(){ close() {
this.isAdd=false this.isAdd = false;
}, },
save(){ save() {
if(this.model.LineID==''){ if (this.model.LineID == "") {
this.$message.error('请选择线路') this.$message.error("请选择线路");
}else if(this.model.SeriesID===''){ } else if (this.model.SeriesID === "") {
this.$message.error('请选择系列') this.$message.error("请选择系列");
}else if(this.CountryID.length==0){ } else if (this.CountryID.length == 0) {
this.$message.error('请选择国家') this.$message.error("请选择国家");
}else if(this.model.IsFee==''){ } else if (this.model.IsFee == "") {
this.$message.error('请选择类型') this.$message.error("请选择类型");
}else if(this.model.ChargeAmount==''&&this.model.IsFee=='1'){ } else if (this.model.ChargeAmount == "" && this.model.IsFee == "1") {
this.$message.error('请填写金额') this.$message.error("请填写金额");
}else if(Number.isNaN(this.model.ChargeAmount)&&this.model.IsFee=='1'){ } else if (
this.$message.error('填写金额非法') Number.isNaN(this.model.ChargeAmount) &&
}else if(this.model.PictureUrl==''){ this.model.IsFee == "1"
this.$message.error('请选择广告图') ) {
}else if(this.model.SamplePicturesUrl==''){ this.$message.error("填写金额非法");
this.$message.error('请选择原图') } else if (this.model.PictureUrl == "") {
}else{ this.$message.error("请选择广告图");
} else if (this.model.SamplePicturesUrl == "") {
this.$message.error("请选择原图");
} else {
this.model.CountryIDs = this.CountryID; this.model.CountryIDs = this.CountryID;
this.model.ChargeAmount=this.model.IsFee=='1'?this.model.ChargeAmount:'0' this.model.ChargeAmount =
this.uploadImage(0) this.model.IsFee == "1" ? this.model.ChargeAmount : "0";
this.uploadImage(0);
} }
}, },
base64ToBlob(code) { base64ToBlob(code) {
let parts = code.split(';base64,'); let parts = code.split(";base64,");
let contentType = parts[0].split(':')[1]; let contentType = parts[0].split(":")[1];
let raw = window.atob(parts[1]); let raw = window.atob(parts[1]);
let rawLength = raw.length; let rawLength = raw.length;
...@@ -250,197 +318,238 @@ export default { ...@@ -250,197 +318,238 @@ export default {
for (let i = 0; i < rawLength; ++i) { for (let i = 0; i < rawLength; ++i) {
uInt8Array[i] = raw.charCodeAt(i); uInt8Array[i] = raw.charCodeAt(i);
} }
return new Blob([uInt8Array], {type: contentType}); return new Blob([uInt8Array], { type: contentType });
}, },
uploadImage(cnt) { uploadImage(cnt) {
if(cnt==2){ if (cnt == 2) {
this.apipost("Advertising_post_SetAdvertising", this.model, x => { this.apipost(
if(x.data.resultCode==1){ "Advertising_post_SetAdvertising",
this.$message.success('保存成功'); this.model,
this.isAdd=false; (x) => {
if (x.data.resultCode == 1) {
this.$message.success("保存成功");
this.isAdd = false;
this.CountryID = []; this.CountryID = [];
this.getaddatas(0); this.getaddatas(0);
}else{ } else {
this.$message.error(x.data.message) this.$message.error(x.data.message);
} }
},err => {}) },
(err) => {}
);
} else {
let dataUrl =
cnt == 0 ? this.model.PictureUrl : this.model.SamplePicturesUrl;
if (dataUrl.indexOf("base64") == -1) {
if (cnt == 0) {
this.model.PictureUrl = `/Adv${
this.model.PictureUrl.split("/Adv")[1]
}`;
} else { } else {
let dataUrl=cnt==0?this.model.PictureUrl:this.model.SamplePicturesUrl this.model.SamplePicturesUrl = `/Adv${
if(dataUrl.indexOf('base64')==-1){ this.model.SamplePicturesUrl.split("/Adv")[1]
if(cnt==0){ }`;
this.model.PictureUrl=`/Adv${this.model.PictureUrl.split('/Adv')[1]}`
}else{
this.model.SamplePicturesUrl=`/Adv${this.model.SamplePicturesUrl.split('/Adv')[1]}`
} }
this.uploadImage(cnt+1) this.uploadImage(cnt + 1);
} else { } else {
let file=this.base64ToBlob(dataUrl) let file = this.base64ToBlob(dataUrl);
let newArr = [] let newArr = [];
newArr.push(file) newArr.push(file);
var path = `/Adv/template/${this.uuid(10,10)}.jpg` var path = `/Adv/template/${this.uuid(10, 10)}.jpg`;
let that=this let that = this;
this.uploadBlob(path, newArr, x => { this.uploadBlob(path, newArr, (x) => {
if(cnt==0){ if (cnt == 0) {
that.model.PictureUrl=path that.model.PictureUrl = path;
that.uploadImage(1) that.uploadImage(1);
}else{ } else {
that.model.SamplePicturesUrl=path that.model.SamplePicturesUrl = path;
that.uploadImage(2) that.uploadImage(2);
} }
}) });
} }
} }
}, },
uuid(len, radix) { uuid(len, radix) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); var chars =
var uuid = [], i; "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(
""
);
var uuid = [],
i;
radix = radix || chars.length; radix = radix || chars.length;
if (len) { if (len) {
// Compact form // Compact form
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random()*radix]; for (i = 0; i < len; i++) uuid[i] = chars[0 | (Math.random() * radix)];
} else { } else {
var r; var r;
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-'; uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
uuid[14] = '4'; uuid[14] = "4";
for (i = 0; i < 36; i++) { for (i = 0; i < 36; i++) {
if (!uuid[i]) { if (!uuid[i]) {
r = 0 | Math.random()*16; r = 0 | (Math.random() * 16);
uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r]; uuid[i] = chars[i == 19 ? (r & 0x3) | 0x8 : r];
}
} }
} }
return uuid.join('');
},
deletePic(type){
if(type==0)
this.model.PictureUrl=''
else
this.model.SamplePicturesUrl=''
},
upload(){
if(this.$refs.loadFile.files.length>0 && this.$refs.loadFile.files[0].size>0){
let reader = new FileReader()
let that=this
reader.readAsDataURL(this.$refs.loadFile.files[0])
reader.onload=function(e) {
if(that.uploadType==0)
that.model.PictureUrl=e.target.result
else
that.model.SamplePicturesUrl=e.target.result
} }
return uuid.join("");
},
deletePic(type) {
if (type == 0) this.model.PictureUrl = "";
else this.model.SamplePicturesUrl = "";
},
upload() {
if (
this.$refs.loadFile.files.length > 0 &&
this.$refs.loadFile.files[0].size > 0
) {
let reader = new FileReader();
let that = this;
reader.readAsDataURL(this.$refs.loadFile.files[0]);
reader.onload = function (e) {
if (that.uploadType == 0) that.model.PictureUrl = e.target.result;
else that.model.SamplePicturesUrl = e.target.result;
};
this.$refs.loadFile.value = ""; this.$refs.loadFile.value = "";
} }
}, },
openupload(t){ openupload(t) {
this.uploadType=t this.uploadType = t;
this.$refs.loadFile.click() this.$refs.loadFile.click();
}, },
getmodelTeams(t){ getmodelTeams(t) {
let msg={ let msg = {
'RB_Branch_id':this.user.RB_Branch_id, RB_Branch_id: this.user.RB_Branch_id,
'isTOOP':1, isTOOP: 1,
'lineID':t==0?this.lines[0].lineID:t lineID: t == 0 ? this.lines[0].lineID : t,
} };
this.apipost("team_post_GetList", msg, x => { this.apipost(
this.modelTeams=x.data.data "team_post_GetList",
if(t==0) msg,
(x) => {
this.modelTeams = x.data.data;
if (t == 0)
// this.model.SeriesID=this.modelTeams[0].LtID 没这LtID 要报错 // this.model.SeriesID=this.modelTeams[0].LtID 没这LtID 要报错
this.model.SeriesID = 0; this.model.SeriesID = 0;
},err => {})
}, },
openaddbox(){ (err) => {}
);
},
openaddbox() {
this.CountryID = []; this.CountryID = [];
this.getmodelTeams(0) this.getmodelTeams(0);
this.model={ this.model = {
ID:0, ID: 0,
LineID:this.lines[0].lineID, LineID: this.lines[0].lineID,
SeriesID:0, SeriesID: 0,
CountryID:this.countrys[0].ID, CountryID: this.countrys[0].ID,
ScenicSpotID:0, ScenicSpotID: 0,
PictureUrl:'', PictureUrl: "",
SamplePicturesUrl:'', SamplePicturesUrl: "",
Title:'无', Title: "无",
ChargeAmount:'1.00', ChargeAmount: "1.00",
IsFee:'2' IsFee: "2",
} };
this.isAdd=true this.isAdd = true;
}, },
handleCurrentChange() { handleCurrentChange() {
this.pageIndex++ this.pageIndex++;
this.getaddatas(1) this.getaddatas(1);
}, },
getaddatas(type){ getaddatas(type) {
if(type==0){ if (type == 0) {
this.pageIndex=0 this.pageIndex = 0;
}
let msg={
pageIndex:this.pageIndex,
pageSize:this.pageSize,
lineId:this.msg.lineId,
SeriesId:this.msg.teamId,
CountryId:this.msg.countryId,
AdvName:'',
IsFee:this.msg.type
} }
this.apipost("Advertising_get_GetAdvertisingList", msg, x => { let msg = {
pageIndex: this.pageIndex,
x.data.data.pageData.forEach(x=>{ pageSize: this.pageSize,
x.src=`${x.SamplePicturesUrl}?x-oss-process=image/resize,w_200` lineId: this.msg.lineId,
x.id=x.ID SeriesId: this.msg.teamId,
}) CountryId: this.msg.countryId,
if(type==0){ AdvName: "",
this.addatas=x.data.data.pageData IsFee: this.msg.type,
}else{ };
this.addatas=this.addatas.concat(x.data.data.pageData) this.apipost(
} "Advertising_get_GetAdvertisingList",
this.total=x.data.data.count msg,
},err => {}) (x) => {
}, x.data.data.pageData.forEach((x) => {
getcountry(){ x.src = `${x.SamplePicturesUrl}?x-oss-process=image/resize,w_200`;
this.apipost("dict_post_Destination_GetCountry", {}, x => { x.id = x.ID;
this.countrys=x.data.data });
},err => {}) if (type == 0) {
}, this.addatas = x.data.data.pageData;
getteam(){ } else {
let msg={ this.addatas = this.addatas.concat(x.data.data.pageData);
'RB_Branch_id':this.user.RB_Branch_id,
'isTOOP':1,
'lineID':this.msg.lineId
}
this.apipost("team_post_GetList", msg, x => {
this.teams=x.data.data
if(x.data.data.length>0)
this.msg.teamId=x.data.data[0].LtID
},err => {})
},
changeLine(){
this.teams.splice(0,this.teams.length-1)
if(this.msg.lineId!==0){
this.getteam()
} }
this.total = x.data.data.count;
}, },
changeLineForm(){ (err) => {}
this.modelTeams.splice(0,this.modelTeams.length-1) );
if(this.model.LineID!==0&&this.model.LineID!=''){ },
let msg={ getcountry() {
'RB_Branch_id':this.user.RB_Branch_id, this.apipost(
'isTOOP':1, "dict_post_Destination_GetCountry",
'lineID':this.model.LineID {},
} (x) => {
this.apipost("team_post_GetList", msg, x => { this.countrys = x.data.data;
this.modelTeams=x.data.data },
if(x.data.data.length>0) (err) => {}
this.model.SeriesID=x.data.data[0].LtID );
},err => {})
}
}, },
getline(){ getteam() {
let msg={'pageIndex':0,'pageSize':100} let msg = {
this.apipost("line_post_GetPageList", msg, x => { RB_Branch_id: this.user.RB_Branch_id,
this.lines=x.data.data.pageData isTOOP: 1,
},err => {}) lineID: this.msg.lineId,
};
this.apipost(
"team_post_GetList",
msg,
(x) => {
this.teams = x.data.data;
if (x.data.data.length > 0) this.msg.teamId = x.data.data[0].LtID;
},
(err) => {}
);
},
changeLine() {
this.teams.splice(0, this.teams.length - 1);
if (this.msg.lineId !== 0) {
this.getteam();
} }
},
changeLineForm() {
this.modelTeams.splice(0, this.modelTeams.length - 1);
if (this.model.LineID !== 0 && this.model.LineID != "") {
let msg = {
RB_Branch_id: this.user.RB_Branch_id,
isTOOP: 1,
lineID: this.model.LineID,
};
this.apipost(
"team_post_GetList",
msg,
(x) => {
this.modelTeams = x.data.data;
if (x.data.data.length > 0)
this.model.SeriesID = x.data.data[0].LtID;
},
(err) => {}
);
} }
} },
getline() {
let msg = { pageIndex: 0, pageSize: 100 };
this.apipost(
"line_post_GetPageList",
msg,
(x) => {
this.lines = x.data.data.pageData;
},
(err) => {}
);
},
},
};
</script> </script>
...@@ -37,33 +37,35 @@ import pinyin from 'pinyin' ...@@ -37,33 +37,35 @@ import pinyin from 'pinyin'
// import JsPDF from 'jspdf' // import JsPDF from 'jspdf'
import lrz from 'lrz' import lrz from 'lrz'
import 'vue-easytable/libs/themes-base/index.css' import 'vue-easytable/libs/themes-base/index.css'
import {VTable,VPagination} from 'vue-easytable' import { VTable, VPagination } from 'vue-easytable'
import 'viewerjs/dist/viewer.css' import 'viewerjs/dist/viewer.css'
import Viewer from 'v-viewer' import Viewer from 'v-viewer'
Vue.component(VTable.name, VTable) Vue.component(VTable.name, VTable)
Vue.component(VPagination.name, VPagination) Vue.component(VPagination.name, VPagination)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.http = Vue.prototype.$http = axios Vue.http = Vue.prototype.$http = axios
Vue.cookie = Vue.prototype.$cookie=cookie Vue.cookie = Vue.prototype.$cookie = cookie
Vue.commonUtils = Vue.prototype.$commonUtils=commonUtils Vue.commonUtils = Vue.prototype.$commonUtils = commonUtils
Vue.tripUtils=Vue.prototype.$tripUtils=tripUtils Vue.tripUtils = Vue.prototype.$tripUtils = tripUtils
Vue.DMCUtils=Vue.prototype.$DMCUtils=DMCUtils Vue.DMCUtils = Vue.prototype.$DMCUtils = DMCUtils
Vue.languageUtils=Vue.prototype.$languageUtils=languageUtils Vue.languageUtils = Vue.prototype.$languageUtils = languageUtils
Vue.calendarUtils=Vue.prototype.$calendarUtils=calendarUtils Vue.calendarUtils = Vue.prototype.$calendarUtils = calendarUtils
Vue.lunarCalendar=Vue.prototype.$lunarCalendar=lunarCalendar Vue.lunarCalendar = Vue.prototype.$lunarCalendar = lunarCalendar
Vue.googleMap=Vue.prototype.$googleMap=googleMap Vue.googleMap = Vue.prototype.$googleMap = googleMap
Vue.AuthCode=Vue.prototype.$AuthCode=AuthCode Vue.AuthCode = Vue.prototype.$AuthCode = AuthCode
Vue.prototype.$echarts = echarts Vue.prototype.$echarts = echarts
Vue.chartsUtils=Vue.prototype.$chartsUtils=chartsUtils Vue.chartsUtils = Vue.prototype.$chartsUtils = chartsUtils
Vue.prototype.$VueBarcode = VueBarcode Vue.prototype.$VueBarcode = VueBarcode
// Vue.prototype.GLOBAL = global_ // Vue.prototype.GLOBAL = global_
// Vue.component('barcode', VueBarcode); // Vue.component('barcode', VueBarcode);
Vue.prototype.pinyin = pinyin Vue.prototype.pinyin = pinyin
// Vue.prototype.h2c=h2c // Vue.prototype.h2c=h2c
Vue.prototype.lrz=lrz Vue.prototype.lrz = lrz
/* eslint-disable no-new */ /* eslint-disable no-new */
// Vue.use(htmlToPdf) // Vue.use(htmlToPdf)
...@@ -74,7 +76,7 @@ Vue.use(vueQuillEditor) ...@@ -74,7 +76,7 @@ Vue.use(vueQuillEditor)
//Vue.use(VueAMap); //Vue.use(VueAMap);
Vue.use(VueBarcode); //声明条形码组件 Vue.use(VueBarcode); //声明条形码组件
Vue.use(store); Vue.use(store);
Vue.use(Viewer,{ Vue.use(Viewer, {
defaultOptions: { defaultOptions: {
zIndex: 9999 zIndex: 9999
} }
...@@ -93,10 +95,10 @@ Date.prototype.Format = function (fmt) { ...@@ -93,10 +95,10 @@ Date.prototype.Format = function (fmt) {
"m+": this.getMinutes(), //分 "m+": this.getMinutes(), //分
"s+": this.getSeconds() //秒 "s+": this.getSeconds() //秒
}; };
if (/(y+)/.test(fmt)){ //根据y的长度来截取年 if (/(y+)/.test(fmt)) { //根据y的长度来截取年
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
} }
for (var k in o){ for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
} }
return fmt; return fmt;
...@@ -107,7 +109,7 @@ Vue.prototype.DateDiff = function (sDate1, sDate2) { ...@@ -107,7 +109,7 @@ Vue.prototype.DateDiff = function (sDate1, sDate2) {
oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
aDate = sDate2.split("-") aDate = sDate2.split("-")
oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 /24) //把相差的毫秒数转换为天数 iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) //把相差的毫秒数转换为天数
return iDays return iDays
} }
...@@ -155,7 +157,7 @@ const i18n = new VueI18n({ ...@@ -155,7 +157,7 @@ const i18n = new VueI18n({
'zh-CN': require('./assets/common/lang/zh'), // 中文语言包 'zh-CN': require('./assets/common/lang/zh'), // 中文语言包
'en-US': require('./assets/common/lang/en'), // 英文语言包 'en-US': require('./assets/common/lang/en'), // 英文语言包
'zh-TW': require('./assets/common/lang/zh-tw'), // 台湾语言包 'zh-TW': require('./assets/common/lang/zh-tw'), // 台湾语言包
'Japanese' : require('./assets/common/lang/jp') // 日本语言包 'Japanese': require('./assets/common/lang/jp') // 日本语言包
} }
}) })
......
...@@ -2564,7 +2564,7 @@ export default { ...@@ -2564,7 +2564,7 @@ export default {
meta: { meta: {
title: '产品列表' title: '产品列表'
}, },
},{ }, {
path: '/directorGoodsEdit', //司导专区=>产品编辑 path: '/directorGoodsEdit', //司导专区=>产品编辑
name: 'directorGoodsEdit', name: 'directorGoodsEdit',
component: resolve => require(['@/components/TravelManager/Lxy/directorGoodsEdit'], resolve), component: resolve => require(['@/components/TravelManager/Lxy/directorGoodsEdit'], resolve),
...@@ -2579,70 +2579,70 @@ export default { ...@@ -2579,70 +2579,70 @@ export default {
meta: { meta: {
title: '产品列表' title: '产品列表'
}, },
},{ }, {
path: '/directorOrderDetails', //司导专区=>订单详情 path: '/directorOrderDetails', //司导专区=>订单详情
name: 'directorOrderDetails', name: 'directorOrderDetails',
component: resolve => require(['@/components/TravelManager/Lxy/directorOrderDetails'], resolve), component: resolve => require(['@/components/TravelManager/Lxy/directorOrderDetails'], resolve),
meta: { meta: {
title: '订单详情' title: '订单详情'
}, },
},{ }, {
path: '/directorSetting', //司导专区=>基础设置 path: '/directorSetting', //司导专区=>基础设置
name: 'directorSetting', name: 'directorSetting',
component: resolve => require(['@/components/TravelManager/Lxy/directorSetting'], resolve), component: resolve => require(['@/components/TravelManager/Lxy/directorSetting'], resolve),
meta: { meta: {
title: '基础设置' title: '基础设置'
}, },
},{ }, {
path: '/guideCarSiteList', //司导专区=>站点管理 path: '/guideCarSiteList', //司导专区=>站点管理
name: 'guideCarSiteList', name: 'guideCarSiteList',
component: resolve => require(['@/components/TravelManager/Lxy/guideCarSiteList'], resolve), component: resolve => require(['@/components/TravelManager/Lxy/guideCarSiteList'], resolve),
meta: { meta: {
title: '站点管理' title: '站点管理'
}, },
},{ }, {
path: '/addSite', //司导专区=>站点管理 path: '/addSite', //司导专区=>站点管理
name: 'addSite', name: 'addSite',
component: resolve => require(['@/components/TravelManager/Lxy/addSite'], resolve), component: resolve => require(['@/components/TravelManager/Lxy/addSite'], resolve),
meta: { meta: {
title: '站点管理' title: '站点管理'
}, },
},{ }, {
path: '/directorGuideList', //司导专区=>导游管理 path: '/directorGuideList', //司导专区=>导游管理
name: 'directorGuideList', name: 'directorGuideList',
component: resolve => require(['@/components/TravelManager/Lxy/directorGuideList'], resolve), component: resolve => require(['@/components/TravelManager/Lxy/directorGuideList'], resolve),
meta: { meta: {
title: '导游管理' title: '导游管理'
}, },
},{ }, {
path: '/addGuide', //司导专区=>导游管理 path: '/addGuide', //司导专区=>导游管理
name: 'addGuide', name: 'addGuide',
component: resolve => require(['@/components/TravelManager/Lxy/addGuide'], resolve), component: resolve => require(['@/components/TravelManager/Lxy/addGuide'], resolve),
meta: { meta: {
title: '导游管理' title: '导游管理'
}, },
},{ }, {
path: '/directorCarList', //司导专区=>车辆管理 path: '/directorCarList', //司导专区=>车辆管理
name: 'directorCarList', name: 'directorCarList',
component: resolve => require(['@/components/TravelManager/Lxy/directorCarList'], resolve), component: resolve => require(['@/components/TravelManager/Lxy/directorCarList'], resolve),
meta: { meta: {
title: '车辆管理' title: '车辆管理'
}, },
},{ }, {
path: '/addCar', //司导专区=>车辆管理 path: '/addCar', //司导专区=>车辆管理
name: 'addCar', name: 'addCar',
component: resolve => require(['@/components/TravelManager/Lxy/addCar'], resolve), component: resolve => require(['@/components/TravelManager/Lxy/addCar'], resolve),
meta: { meta: {
title: '车辆管理' title: '车辆管理'
}, },
},{ }, {
path: '/directorCarBrandList', //司导专区=>车辆品牌管理 path: '/directorCarBrandList', //司导专区=>车辆品牌管理
name: 'directorCarBrandList', name: 'directorCarBrandList',
component: resolve => require(['@/components/TravelManager/Lxy/directorCarBrandList'], resolve), component: resolve => require(['@/components/TravelManager/Lxy/directorCarBrandList'], resolve),
meta: { meta: {
title: '车辆品牌管理' title: '车辆品牌管理'
}, },
},{ }, {
path: '/addCarBrand', //司导专区=>车辆品牌管理 path: '/addCarBrand', //司导专区=>车辆品牌管理
name: 'addCarBrand', name: 'addCarBrand',
component: resolve => require(['@/components/TravelManager/Lxy/addCarBrand'], resolve), component: resolve => require(['@/components/TravelManager/Lxy/addCarBrand'], resolve),
...@@ -4832,6 +4832,7 @@ export default { ...@@ -4832,6 +4832,7 @@ export default {
title: '商品活动' title: '商品活动'
} }
}, },
{ {
path: "/OrderManagement", path: "/OrderManagement",
name: "OrderManagement", name: "OrderManagement",
......
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