Commit 1e12c2e8 authored by hanfeng's avatar hanfeng

Merge remote-tracking branch 'origin/base-modify' into base-modify

# Conflicts:
#	src/views/vehicleType/modal/oneType.vue
parents 0e988e2b 197f1733
...@@ -6,14 +6,16 @@ ...@@ -6,14 +6,16 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="营地名称" prop="name"> <el-form-item label="营地名称" prop="name">
<el-input v-model="form.name" placeholder="请输入营地名称" @blur="checkName()"></el-input><span v-if="isExist" style="color:red;">标签名已存在</span> <el-input v-model="form.name" placeholder="请输入营地名称" @blur="checkName()"></el-input>
<span v-if="isExist" style="color:red;">标签名已存在</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="营地地址" prop="addressStr"> <el-form-item label="营地地址" prop="addressStr">
<el-input v-model="form.addressStr" readonly placeholder="请输入营地地址" :on-icon-click="selectDestination" icon="edit"></el-input> <el-input v-model="form.addressStr" readonly placeholder="请输入营地地址" :on-icon-click="selectDestination"
icon="edit"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -41,7 +43,9 @@ ...@@ -41,7 +43,9 @@
<el-form-item label="营地类型" prop="approvers"> <el-form-item label="营地类型" prop="approvers">
<span v-for="item in form.campsiteTagListVos" <span v-for="item in form.campsiteTagListVos"
:key="item.id" style="border: 1px solid #ccc; padding: 5px 10px;border-radius: 5px;margin-right: 10px;">{{item.name}}</span> :key="item.id" style="border: 1px solid #ccc; padding: 5px 10px;border-radius: 5px;margin-right: 10px;">{{item.name}}</span>
<el-button size="small" class="el-button el-button--primary" type="button" icon="edit" @click="editLable(form.campsiteTagListVos)">编辑</el-button> <el-button size="small" class="el-button el-button--primary" type="button" icon="edit"
@click="editLable(form.campsiteTagListVos)">编辑
</el-button>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="4"> <el-col :span="4">
...@@ -60,14 +64,37 @@ ...@@ -60,14 +64,37 @@
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
list-type="picture"> list-type="picture">
<div slot="tip" class="el-upload__tip"><span style="color: red;">建议尺寸:485*485px</span></div> <div slot="tip" class="el-upload__tip"><span style="color: red;">建议尺寸:485*485px</span></div>
<img v-if="$utils.isString(form.logo) && !$utils.isEmpty(form.logo)" :src="form.logo" style="width:300px;max-height:300px;"> <img v-if="$utils.isString(form.logo) && !$utils.isEmpty(form.logo)" :src="form.logo"
<i v-else class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> style="width:300px;max-height:300px;">
<i v-else class="el-icon-plus avatar-uploader-icon"
style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="alt"> <el-form-item label="alt">
<el-input v-model="form.alt" type="text" placeholder="请输入描述"></el-input> <el-input v-model="form.alt" type="text" placeholder="请输入替代文本"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="img-title">
<el-input v-model="form.imgTitle" type="text" placeholder="请输入图片title"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="img-keyword">
<el-input v-model="form.imgKeyword" type="text" placeholder="请输入图片关键字"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="img-desc">
<el-input v-model="form.imgDesc" type="text" placeholder="请输入图片描述"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -80,10 +107,13 @@ ...@@ -80,10 +107,13 @@
:on-success="handlePosterSuccess" :on-success="handlePosterSuccess"
:on-progress="uploadPosterProcess" :on-progress="uploadPosterProcess"
list-type="picture"> list-type="picture">
<div slot="tip" class="el-upload__tip"> <span style="color: red;">建议尺寸:485*485px</span></div> <div slot="tip" class="el-upload__tip"><span style="color: red;">建议尺寸:485*485px</span></div>
<el-progress v-show="imgPosterFlag == true" type="circle" :percentage="percent_poster" style="margin-top: 20px"></el-progress> <el-progress v-show="imgPosterFlag == true" type="circle" :percentage="percent_poster"
<img v-if="$utils.isString(form.posterBackground) && !$utils.isEmpty(form.posterBackground)&& !imgPosterFlag" :src="form.posterBackground" style="width:300px;max-height:300px;"> style="margin-top: 20px"></el-progress>
<i v-else-if="!imgPosterFlag" class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> <img v-if="$utils.isString(form.posterBackground) && !$utils.isEmpty(form.posterBackground)&& !imgPosterFlag"
:src="form.posterBackground" style="width:300px;max-height:300px;">
<i v-else-if="!imgPosterFlag" class="el-icon-plus avatar-uploader-icon"
style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="轮播图" :style="{display:'block'}" prop="carouse"> <el-form-item label="轮播图" :style="{display:'block'}" prop="carouse">
...@@ -103,13 +133,15 @@ ...@@ -103,13 +133,15 @@
<el-tab-pane label="营地详情" name="first"> <el-tab-pane label="营地详情" name="first">
<!--<Editor v-if="activeName2=='first'" @input="handelContentIncrease" :value="form.content" :myQuillEditor="'myQuillEditorContent'" :activeName2="activeName2"></Editor>--> <!--<Editor v-if="activeName2=='first'" @input="handelContentIncrease" :value="form.content" :myQuillEditor="'myQuillEditorContent'" :activeName2="activeName2"></Editor>-->
<div class="editor-container" v-if="activeName2=='first'"> <div class="editor-container" v-if="activeName2=='first'">
<UE :editorId="activeName2" :defaultMsg="form.content" :config=config ref="ue" @ready="editorReadyEvent"></UE> <UE :editorId="activeName2" :defaultMsg="form.content" :config=config ref="ue"
@ready="editorReadyEvent"></UE>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="配套&收费" name="second"> <el-tab-pane label="配套&收费" name="second">
<!--<Editor v-if="activeName2=='second'" @input="handelIntroduceIncrease" :value="form.configure" :myQuillEditor="'myQuillEditorIntroduce'" :activeName2="activeName2"></Editor>--> <!--<Editor v-if="activeName2=='second'" @input="handelIntroduceIncrease" :value="form.configure" :myQuillEditor="'myQuillEditorIntroduce'" :activeName2="activeName2"></Editor>-->
<div class="editor-container" v-if="activeName2=='second'"> <div class="editor-container" v-if="activeName2=='second'">
<UE :editorId="activeName2" :defaultMsg="form.configure" :config=config ref="ue" @ready="editorReadyEvent"></UE> <UE :editorId="activeName2" :defaultMsg="form.configure" :config=config ref="ue"
@ready="editorReadyEvent"></UE>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -117,36 +149,43 @@ ...@@ -117,36 +149,43 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
<el-button type="primary" v-if="title=='创建' && !isCreate && campsiteshop_btn_update" @click="create('form')">确 定</el-button> <el-button type="primary" v-if="title=='创建' && !isCreate && campsiteshop_btn_update" @click="create('form')">确 定
<el-button type="primary" v-if="title=='编辑' && !isCreate && campsiteshop_btn_update" @click="update('form')">确 定</el-button> </el-button>
<el-button type="primary" v-if="title=='编辑' && !isCreate && campsiteshop_btn_update" @click="update('form')">确 定
</el-button>
</div> </div>
<!--编辑营地地址--> <!--编辑营地地址-->
<campsiteModal v-if="showCampsiteVisible && campsiteshop_btn_update" :obj="campsiteObj" v-on:campsiteEvent = "campsiteEvent"></campsiteModal> <campsiteModal v-if="showCampsiteVisible && campsiteshop_btn_update" :obj="campsiteObj"
v-on:campsiteEvent="campsiteEvent"></campsiteModal>
<!--编辑营地标签--> <!--编辑营地标签-->
<campsiteLabelModal v-if="editLableVisible && campsiteshop_btn_update" :allLabelList="allLabelList" :checkList="checkList" v-on:tourLabelEvent = "tourLabelEvent"></campsiteLabelModal> <campsiteLabelModal v-if="editLableVisible && campsiteshop_btn_update" :allLabelList="allLabelList"
:checkList="checkList" v-on:tourLabelEvent="tourLabelEvent"></campsiteLabelModal>
</div> </div>
</template> </template>
<style> <style>
textarea{ textarea {
display: none; display: none;
} }
.info{
.info {
border-radius: 10px; border-radius: 10px;
line-height: 20px; line-height: 20px;
padding: 10px; padding: 10px;
margin: 10px; margin: 10px;
background-color: #ffffff; background-color: #ffffff;
} }
.el-upload-list{
.el-upload-list {
display: flex; display: flex;
width: 100px; width: 100px;
} }
.el-upload-list li{
.el-upload-list li {
margin-left: 10px; margin-left: 10px;
} }
</style> </style>
<script> <script>
// import Editor from "../../modal/editorTool";//富文本 // import Editor from "../../modal/editorTool";//富文本
import UE from '../../modal/Ueditor';//百度ue富文本 import UE from '../../modal/Ueditor';//百度ue富文本
import campsiteLabelModal from "../../tourManage/modal/tourLabelModal";//标签 import campsiteLabelModal from "../../tourManage/modal/tourLabelModal";//标签
import campsiteModal from "./campsiteModal";//营地地址 import campsiteModal from "./campsiteModal";//营地地址
...@@ -168,6 +207,7 @@ ...@@ -168,6 +207,7 @@
getToken getToken
} from '../../../utils/auth'; } from '../../../utils/auth';
import {mapGetters} from 'vuex'; import {mapGetters} from 'vuex';
export default { export default {
props: ["oneRow", "title", "campsiteshop_btn_update"], props: ["oneRow", "title", "campsiteshop_btn_update"],
name: 'upkeepDialog', name: 'upkeepDialog',
...@@ -191,24 +231,27 @@ ...@@ -191,24 +231,27 @@
} }
}; };
return { return {
imgPosterFlag:false, imgPosterFlag: false,
percent_poster:0, percent_poster: 0,
BASE_API: process.env.BASE_API, BASE_API: process.env.BASE_API,
defaultMsg: '这里是UE测试', defaultMsg: '这里是UE测试',
config: { config: {
initialFrameWidth: null, initialFrameWidth: null,
initialFrameHeight: 350 initialFrameHeight: 350
}, },
isExist:false,//名称是否已存在 isExist: false,//名称是否已存在
campsiteObj: {},//营地地址 campsiteObj: {},//营地地址
departureList: [],//出发地列表 departureList: [],//出发地列表
departureObj:{name: ""},//出发地 departureObj: {name: ""},//出发地
pathway: [],//途径地 pathway: [],//途径地
isCreate: false,//是否点击了创建-确定 isCreate: false,//是否点击了创建-确定
fileList2:[], fileList2: [],
activeName2: '',//行程亮点 activeName2: '',//行程亮点
form: { form: {
alt:'', alt: '',
imgTitle: undefined,
imgKeyword: undefined,
imgDesc: undefined,
id: undefined, id: undefined,
name: undefined,//营地名称 name: undefined,//营地名称
hot: 0,//营地热度 hot: 0,//营地热度
...@@ -223,40 +266,46 @@ ...@@ -223,40 +266,46 @@
longitude: undefined, longitude: undefined,
content: '',//营地详情 content: '',//营地详情
concat: "",//联系人 concat: "",//联系人
logo:undefined,//封面图 logo: undefined,//封面图
configure: '',//配套&收费 configure: '',//配套&收费
campsiteTagListVos: [],//营地类型 campsiteTagListVos: [],//营地类型
carouse:[],//banner轮播 carouse: [],//banner轮播
posterBackground:'',//海报背景 posterBackground: '',//海报背景
}, },
showCampsiteVisible: false,//编辑营地地址 showCampsiteVisible: false,//编辑营地地址
rules: { rules: {
name:{ name: {
type: 'string', type: 'string',
required: true, required: true,
message: '请输入营地名称', message: '请输入营地名称',
trigger: 'blur' trigger: 'blur'
}, },
servicePhone:{ servicePhone: {
type: 'string', type: 'string',
required: true, required: true,
message: '请输入客服电话', message: '请输入客服电话',
trigger: 'blur' trigger: 'blur'
}, },
phone:{validator: checkPhone, trigger: 'blur',required: true}, phone: {
concat:{ //validator: checkPhone,
type:'string',
trigger: 'blur',
message: '请输入联系电话',
required: true
},
concat: {
type: 'string', type: 'string',
required: true, required: true,
message: '请输入联系人', message: '请输入联系人',
trigger: 'blur' trigger: 'blur'
}, },
addressStr:{ addressStr: {
type: 'string', type: 'string',
required: true, required: true,
message: '请输入营地地址', message: '请输入营地地址',
} }
}, },
checkList:[],//已选中的标签 checkList: [],//已选中的标签
allCompanies: {}, allCompanies: {},
allCompaniesArr: [], allCompaniesArr: [],
oneTourDialogVisible: false, oneTourDialogVisible: false,
...@@ -268,15 +317,15 @@ ...@@ -268,15 +317,15 @@
this.getAllLabelList(); this.getAllLabelList();
}, },
watch: { watch: {
oneTourDialogVisible(newValue, oldValue){ oneTourDialogVisible(newValue, oldValue) {
if(!newValue){ if (!newValue) {
this.cleanForm(); this.cleanForm();
} }
}, },
}, },
mounted() { mounted() {
this.cleanForm(); this.cleanForm();
if(this.title == "编辑"){ if (this.title == "编辑") {
let row = this.oneRow; let row = this.oneRow;
this.getOne(row.id); this.getOne(row.id);
} else { } else {
...@@ -293,15 +342,15 @@ ...@@ -293,15 +342,15 @@
/** /**
* 判断标签名是否已存在 * 判断标签名是否已存在
* */ * */
checkName(){ checkName() {
this.form.name = (this.form.name).trim(); this.form.name = (this.form.name).trim();
if(!this.form.name){ if (!this.form.name) {
return; return;
} }
let params = { let params = {
name: this.form.name name: this.form.name
}; };
if(this.title == "编辑"){ if (this.title == "编辑") {
params.id = this.form.id; params.id = this.form.id;
} }
existCampsiteShop(params).then(response => { existCampsiteShop(params).then(response => {
...@@ -323,14 +372,14 @@ ...@@ -323,14 +372,14 @@
/** /**
* 编辑营地标签 * 编辑营地标签
* */ * */
editLable(list){ editLable(list) {
console.log(list); console.log(list);
this.editLableVisible = true; this.editLableVisible = true;
}, },
/** /**
* 创建 * 创建
* */ * */
create(formName){ create(formName) {
const set = this.$refs; const set = this.$refs;
set[formName].validate(valid => { set[formName].validate(valid => {
if (valid) { if (valid) {
...@@ -367,8 +416,11 @@ ...@@ -367,8 +416,11 @@
address: this.campsiteObj.address,//详细地址 address: this.campsiteObj.address,//详细地址
latitude: this.campsiteObj.latitude, latitude: this.campsiteObj.latitude,
longitude: this.campsiteObj.longitude, longitude: this.campsiteObj.longitude,
posterBackground:this.form.posterBackground,//海报背景 posterBackground: this.form.posterBackground,//海报背景
alt:this.form.alt alt: this.form.alt,
imgTitle: this.form.imgTitle,
imgKeyword: this.form.imgKeyword,
imgDesc: this.form.imgDesc
}; };
console.log(params); console.log(params);
this.isExistCampsiteShop("create", params); this.isExistCampsiteShop("create", params);
...@@ -380,26 +432,26 @@ ...@@ -380,26 +432,26 @@
/** /**
* 判断营地名称是否已存在 * 判断营地名称是否已存在
* */ * */
isExistCampsiteShop(type, datas){ isExistCampsiteShop(type, datas) {
if(!this.form.name){ if (!this.form.name) {
return; return;
} }
let params = { let params = {
name: this.form.name name: this.form.name
}; };
if(type == 'update'){//编辑 if (type == 'update') {//编辑
params.id = this.form.id; params.id = this.form.id;
} }
existCampsiteShop(params).then(response => { existCampsiteShop(params).then(response => {
if (response.status === 200) { if (response.status === 200) {
this.isExist = response.data; this.isExist = response.data;
if(response.data){ if (response.data) {
this.isCreate = false; this.isCreate = false;
} }
if(!response.data && type == "update"){//编辑 if (!response.data && type == "update") {//编辑
this.toUpdate(datas); this.toUpdate(datas);
} }
if(!response.data && type == "create"){ if (!response.data && type == "create") {
//创建 //创建
this.toCreate(datas); this.toCreate(datas);
} }
...@@ -416,7 +468,7 @@ ...@@ -416,7 +468,7 @@
/** /**
* 编辑 * 编辑
* */ * */
update(formName){ update(formName) {
const set = this.$refs; const set = this.$refs;
set[formName].validate(valid => { set[formName].validate(valid => {
if (valid) { if (valid) {
...@@ -455,8 +507,11 @@ ...@@ -455,8 +507,11 @@
address: this.campsiteObj.address,//详细地址 address: this.campsiteObj.address,//详细地址
latitude: this.campsiteObj.latitude, latitude: this.campsiteObj.latitude,
longitude: this.campsiteObj.longitude, longitude: this.campsiteObj.longitude,
posterBackground:this.form.posterBackground,//海报背景 posterBackground: this.form.posterBackground,//海报背景
alt:this.form.alt, alt: this.form.alt,
imgTitle: this.form.imgTitle,
imgKeyword: this.form.imgKeyword,
imgDesc: this.form.imgDesc
}; };
console.log(params); console.log(params);
this.isExistCampsiteShop("update", params); this.isExistCampsiteShop("update", params);
...@@ -468,7 +523,7 @@ ...@@ -468,7 +523,7 @@
/** /**
* 更新 * 更新
* */ * */
toUpdate(params){ toUpdate(params) {
editCampsiteShop(params).then(response => { editCampsiteShop(params).then(response => {
if (response.status === 200) { if (response.status === 200) {
this.$notify({ this.$notify({
...@@ -491,7 +546,7 @@ ...@@ -491,7 +546,7 @@
/** /**
* 创建 * 创建
* */ * */
toCreate(params){ toCreate(params) {
editCampsiteShop(params).then(response => { editCampsiteShop(params).then(response => {
if (response.status === 200) { if (response.status === 200) {
this.$notify({ this.$notify({
...@@ -523,9 +578,9 @@ ...@@ -523,9 +578,9 @@
/** /**
* 关闭营地地址弹框 * 关闭营地地址弹框
* */ * */
campsiteEvent(obj){ campsiteEvent(obj) {
this.showCampsiteVisible = false; this.showCampsiteVisible = false;
if(obj){ if (obj) {
this.campsiteObj = obj; this.campsiteObj = obj;
let provinceObj = getRegionByCodes([obj.province]); let provinceObj = getRegionByCodes([obj.province]);
let cityObj = getRegionByCodes([obj.city]); let cityObj = getRegionByCodes([obj.city]);
...@@ -538,25 +593,25 @@ ...@@ -538,25 +593,25 @@
/** /**
* 编辑营地地址 * 编辑营地地址
* */ * */
selectDestination(){ selectDestination() {
let that = this; let that = this;
this.campsiteObj.showTitle = "营地地址编辑"; this.campsiteObj.showTitle = "营地地址编辑";
this.campsiteObj.eventName ='campsiteEvent'; this.campsiteObj.eventName = 'campsiteEvent';
this.campsiteObj.keyword = this.campsiteObj.address; this.campsiteObj.keyword = this.campsiteObj.address;
this.showCampsiteVisible = true; this.showCampsiteVisible = true;
}, },
/** /**
* 关闭营地标签弹框 * 关闭营地标签弹框
* */ * */
tourLabelEvent(obj){ tourLabelEvent(obj) {
let that = this; let that = this;
this.editLableVisible = false; this.editLableVisible = false;
let arr = []; let arr = [];
let ckeckList = []; let ckeckList = [];
if(obj){ if (obj) {
this.allLabelList.map(function(item){ this.allLabelList.map(function (item) {
obj.map(function(b){ obj.map(function (b) {
if(item.name == b){ if (item.name == b) {
arr.push(item); arr.push(item);
ckeckList.push(b); ckeckList.push(b);
} }
...@@ -570,7 +625,7 @@ ...@@ -570,7 +625,7 @@
/** /**
* 获取一条营地 * 获取一条营地
* */ * */
getOne(id){ getOne(id) {
let that = this; let that = this;
getOneCampsiteShop(id).then(response => { getOneCampsiteShop(id).then(response => {
this.form = response.data; this.form = response.data;
...@@ -585,9 +640,9 @@ ...@@ -585,9 +640,9 @@
}; };
response.data.addressStr = this.campsiteObj.provinceName + this.campsiteObj.cityName + this.campsiteObj.address; response.data.addressStr = this.campsiteObj.provinceName + this.campsiteObj.cityName + this.campsiteObj.address;
let arr = []; let arr = [];
that.allLabelList.map(function(b){ that.allLabelList.map(function (b) {
response.data.campsiteTagListVos.map(function(item){ response.data.campsiteTagListVos.map(function (item) {
if(item.id == b.id){ if (item.id == b.id) {
arr.push(item.name); arr.push(item.name);
} }
}); });
...@@ -617,18 +672,18 @@ ...@@ -617,18 +672,18 @@
/** /**
* 配套&收费 富文本 * 配套&收费 富文本
* */ * */
handelIntroduceIncrease(step){ handelIntroduceIncrease(step) {
this.form.configure = step; this.form.configure = step;
}, },
/** /**
* 富文本 营地详情 * 富文本 营地详情
* */ * */
editorReadyEvent(instance){ editorReadyEvent(instance) {
let t = this; let t = this;
instance.addListener('contentChange', () => { instance.addListener('contentChange', () => {
if(t.activeName2 == "first"){ if (t.activeName2 == "first") {
t.form.content = instance.getContent(); t.form.content = instance.getContent();
} else if(t.activeName2 == "second"){ } else if (t.activeName2 == "second") {
t.form.configure = instance.getContent(); t.form.configure = instance.getContent();
} }
}); });
...@@ -636,17 +691,17 @@ ...@@ -636,17 +691,17 @@
/** /**
* 删除banner * 删除banner
* */ * */
handleRemove(file, fileList){ handleRemove(file, fileList) {
let list = []; let list = [];
fileList.map(function(item){ fileList.map(function (item) {
if(item.url != file.url){ if (item.url != file.url) {
list.push(item); list.push(item);
} }
}); });
this.fileList2 = list; this.fileList2 = list;
let arr = []; let arr = [];
this.form.carouse.map(function(item){ this.form.carouse.map(function (item) {
if(item.imgUrl != file.url){ if (item.imgUrl != file.url) {
arr.push(item); arr.push(item);
} }
}); });
...@@ -655,20 +710,20 @@ ...@@ -655,20 +710,20 @@
/** /**
* 封面图上传 * 封面图上传
* **/ * **/
handleAvatarSuccess(res, file){ handleAvatarSuccess(res, file) {
this.form.logo = res.data; this.form.logo = res.data;
}, },
/** /**
* banner上传 * banner上传
* */ * */
handleBannerSuccess(res, file){ handleBannerSuccess(res, file) {
this.fileList2.push({url:res.data}); this.fileList2.push({url: res.data});
this.form.carouse.push({imgUrl:res.data}); this.form.carouse.push({imgUrl: res.data});
}, },
/** /**
* 海报背景上传 * 海报背景上传
* **/ * **/
handlePosterSuccess(res, file){ handlePosterSuccess(res, file) {
this.percent_poster = 0; this.percent_poster = 0;
this.imgPosterFlag = false; this.imgPosterFlag = false;
this.form.posterBackground = res.data; this.form.posterBackground = res.data;
...@@ -685,9 +740,9 @@ ...@@ -685,9 +740,9 @@
* 清空旅游弹框数据 * 清空旅游弹框数据
*/ */
cleanForm() { cleanForm() {
this.campsiteObj ={name: ""};//营地地址 this.campsiteObj = {name: ""};//营地地址
this.fileList2=[]; this.fileList2 = [];
this.activeName2= '';//营地详情 this.activeName2 = '';//营地详情
this.form = { this.form = {
id: undefined, id: undefined,
name: undefined,//营地名称 name: undefined,//营地名称
...@@ -703,14 +758,17 @@ ...@@ -703,14 +758,17 @@
longitude: undefined, longitude: undefined,
content: '',//营地详情 content: '',//营地详情
concat: "",//联系人 concat: "",//联系人
logo:undefined,//封面图 logo: undefined,//封面图
configure: '',//配套&收费 configure: '',//配套&收费
campsiteTagListVos: [],//营地类型 campsiteTagListVos: [],//营地类型
carouse:[],//banner轮播 carouse: [],//banner轮播
posterBackground:'', posterBackground: '',
alt:'', alt: '',
imgTitle:undefined,
imgKeyword:undefined,
imgDesc:undefined
}; };
this.showCampsiteVisible= false;//编辑营地地址 this.showCampsiteVisible = false;//编辑营地地址
} }
} }
} }
......
...@@ -57,9 +57,12 @@ ...@@ -57,9 +57,12 @@
<el-row> <el-row>
<!--<el-col :span="24">--> <!--<el-col :span="24">-->
<el-form-item label="出发地"> <el-form-item label="出发地">
<el-input style="display: inline-block;margin-right: 10px;width: 240px;" v-model="item.name" v-for="item in departureList" <el-input style="display: inline-block;margin-right: 10px;width: 240px;" v-model="item.name"
v-for="item in departureList"
:key="item.id" readonly placeholder="请输入内容"></el-input> :key="item.id" readonly placeholder="请输入内容"></el-input>
<el-button size="small" class="el-button el-button--primary" type="button" icon="edit" @click="editDeparture(departureList)">编辑</el-button> <el-button size="small" class="el-button el-button--primary" type="button" icon="edit"
@click="editDeparture(departureList)">编辑
</el-button>
<!--<el-autocomplete--> <!--<el-autocomplete-->
<!--v-for="item in departureList"--> <!--v-for="item in departureList"-->
<!--:key="item.id"--> <!--:key="item.id"-->
...@@ -76,7 +79,8 @@ ...@@ -76,7 +79,8 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="目的地"> <el-form-item label="目的地">
<el-input v-model="destinationObj.address" readonly placeholder="请选择目的地" :on-icon-click="selectDestination" icon="edit"></el-input> <el-input v-model="destinationObj.address" readonly placeholder="请选择目的地" :on-icon-click="selectDestination"
icon="edit"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -86,8 +90,11 @@ ...@@ -86,8 +90,11 @@
<!--<el-input v-for="item in pathway" style="display: inline-block;margin-right: 10px;width: 240px;"--> <!--<el-input v-for="item in pathway" style="display: inline-block;margin-right: 10px;width: 240px;"-->
<!--:key="item.id" v-model="item.name" readonly placeholder="请选择途径地" :data-rowId="item.id" :on-icon-click="selectPathway" icon="edit"></el-input>--> <!--:key="item.id" v-model="item.name" readonly placeholder="请选择途径地" :data-rowId="item.id" :on-icon-click="selectPathway" icon="edit"></el-input>-->
<el-button v-for="item in pathway" <el-button v-for="item in pathway"
:key="item.id" size="small" class="el-button el-button--primary" type="button" @click="editPathway(item)">{{item.name}}<i class="el-icon-edit el-icon--right"></i></el-button> :key="item.id" size="small" class="el-button el-button--primary" type="button"
<el-button size="small" class="el-button el-button--primary" type="button" icon="plus" @click="addPathway()">添加</el-button> @click="editPathway(item)">{{item.name}}<i class="el-icon-edit el-icon--right"></i></el-button>
<el-button size="small" class="el-button el-button--primary" type="button" icon="plus" @click="addPathway()">
添加
</el-button>
</el-form-item> </el-form-item>
<!--</el-col>--> <!--</el-col>-->
</el-row> </el-row>
...@@ -95,9 +102,13 @@ ...@@ -95,9 +102,13 @@
<el-form-item prop="operator" label="活动日期"> <el-form-item prop="operator" label="活动日期">
<!--tourDepartTimeVo--> <!--tourDepartTimeVo-->
<el-button v-for="item in form.tourDepartTimeVo" disabled <el-button v-for="item in form.tourDepartTimeVo" disabled
:key="item.id" class="el-button el-button--default" type="button">{{item.startTime}}~{{item.endTime}}</el-button> :key="item.id" class="el-button el-button--default" type="button">
{{item.startTime}}~{{item.endTime}}
</el-button>
<el-button size="small" class="el-button el-button--primary" type="button" icon="edit" @click="editTime()">编辑</el-button> <el-button size="small" class="el-button el-button--primary" type="button" icon="edit" @click="editTime()">
编辑
</el-button>
<!--<el-input v-model="form.operator" placeholder="请选择活动日期"></el-input>--> <!--<el-input v-model="form.operator" placeholder="请选择活动日期"></el-input>-->
</el-form-item> </el-form-item>
</el-row> </el-row>
...@@ -108,7 +119,9 @@ ...@@ -108,7 +119,9 @@
<!--<el-checkbox v-for="item in allLabelList"--> <!--<el-checkbox v-for="item in allLabelList"-->
<!--:key="item.id" :label="item.name"></el-checkbox>--> <!--:key="item.id" :label="item.name"></el-checkbox>-->
<!--</el-checkbox-group>--> <!--</el-checkbox-group>-->
<el-button size="small" class="el-button el-button--primary" type="button" icon="edit" @click="editLable(form.tagDTOS)">编辑</el-button> <el-button size="small" class="el-button el-button--primary" type="button" icon="edit"
@click="editLable(form.tagDTOS)">编辑
</el-button>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="4"> <el-col :span="4">
...@@ -142,16 +155,40 @@ ...@@ -142,16 +155,40 @@
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:on-progress="uploadProcess" :on-progress="uploadProcess"
list-type="picture"> list-type="picture">
<div slot="tip" class="el-upload__tip"> <span style="color: red;">建议尺寸:320*228px</span></div> <div slot="tip" class="el-upload__tip"><span style="color: red;">建议尺寸:320*228px</span></div>
<el-progress v-show="imgFlag == true" type="circle" :percentage="percent" style="margin-top: 20px"></el-progress> <el-progress v-show="imgFlag == true" type="circle" :percentage="percent"
<img v-if="$utils.isString(form.cover) && !$utils.isEmpty(form.cover) && !imgFlag" :src="form.cover" style="width:300px;max-height:300px;"> style="margin-top: 20px"></el-progress>
<i v-else-if="!imgFlag" class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> <img v-if="$utils.isString(form.cover) && !$utils.isEmpty(form.cover) && !imgFlag" :src="form.cover"
style="width:300px;max-height:300px;">
<i v-else-if="!imgFlag" class="el-icon-plus avatar-uploader-icon"
style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="alt"> <el-form-item label="alt">
<el-input v-model="form.alt" type="text" placeholder="请输入描述"></el-input> <el-input v-model="form.alt" type="text" placeholder="请输入替代文本"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="img-title">
<el-input v-model="form.imgTitle" type="text" placeholder="请输入图片title"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="img-keyword">
<el-input v-model="form.imgKeyword" type="text" placeholder="请输入图片关键字"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="img-desc">
<el-input v-model="form.imgDesc" type="text" placeholder="请输入图片描述"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -164,10 +201,13 @@ ...@@ -164,10 +201,13 @@
:on-success="handlePosterSuccess" :on-success="handlePosterSuccess"
:on-progress="uploadPosterProcess" :on-progress="uploadPosterProcess"
list-type="picture"> list-type="picture">
<div slot="tip" class="el-upload__tip"> <span style="color: red;">建议尺寸:320*228px</span></div> <div slot="tip" class="el-upload__tip"><span style="color: red;">建议尺寸:320*228px</span></div>
<el-progress v-show="imgPosterFlag == true" type="circle" :percentage="percent_poster" style="margin-top: 20px"></el-progress> <el-progress v-show="imgPosterFlag == true" type="circle" :percentage="percent_poster"
<img v-if="$utils.isString(form.posterBackground) && !$utils.isEmpty(form.posterBackground)&& !imgPosterFlag" :src="form.posterBackground" style="width:300px;max-height:300px;"> style="margin-top: 20px"></el-progress>
<i v-else-if="!imgPosterFlag" class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> <img v-if="$utils.isString(form.posterBackground) && !$utils.isEmpty(form.posterBackground)&& !imgPosterFlag"
:src="form.posterBackground" style="width:300px;max-height:300px;">
<i v-else-if="!imgPosterFlag" class="el-icon-plus avatar-uploader-icon"
style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="轮播图" :style="{display:'block'}"> <el-form-item label="轮播图" :style="{display:'block'}">
...@@ -186,19 +226,22 @@ ...@@ -186,19 +226,22 @@
<el-tabs v-model="activeName2" type="card" @tab-click="handleClick"> <el-tabs v-model="activeName2" type="card" @tab-click="handleClick">
<el-tab-pane label="行程亮点" name="first"> <el-tab-pane label="行程亮点" name="first">
<div class="editor-container" v-if="activeName2=='first'"> <div class="editor-container" v-if="activeName2=='first'">
<UE :editorId="activeName2" :defaultMsg="form.content" :config=config ref="ue" @ready="editorReadyEvent"></UE> <UE :editorId="activeName2" :defaultMsg="form.content" :config=config ref="ue"
@ready="editorReadyEvent"></UE>
</div> </div>
<!--<Editor v-if="activeName2=='first'" @input="handelContentIncrease" :value="form.content" :myQuillEditor="'myQuillEditorContent'" :activeName2="activeName2"></Editor>--> <!--<Editor v-if="activeName2=='first'" @input="handelContentIncrease" :value="form.content" :myQuillEditor="'myQuillEditorContent'" :activeName2="activeName2"></Editor>-->
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="行程介绍" name="second"> <el-tab-pane label="行程介绍" name="second">
<div class="editor-container" v-if="activeName2=='second'"> <div class="editor-container" v-if="activeName2=='second'">
<UE :editorId="activeName2" :defaultMsg="form.introduce" :config=config ref="ue" @ready="editorReadyEvent"></UE> <UE :editorId="activeName2" :defaultMsg="form.introduce" :config=config ref="ue"
@ready="editorReadyEvent"></UE>
</div> </div>
<!--<Editor v-if="activeName2=='second'" @input="handelIntroduceIncrease" :value="form.introduce" :myQuillEditor="'myQuillEditorIntroduce'" :activeName2="activeName2"></Editor>--> <!--<Editor v-if="activeName2=='second'" @input="handelIntroduceIncrease" :value="form.introduce" :myQuillEditor="'myQuillEditorIntroduce'" :activeName2="activeName2"></Editor>-->
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="费用说明" name="third"> <el-tab-pane label="费用说明" name="third">
<div class="editor-container" v-if="activeName2=='third'"> <div class="editor-container" v-if="activeName2=='third'">
<UE :editorId="activeName2" :defaultMsg="form.explain" :config=config ref="ue" @ready="editorReadyEvent"></UE> <UE :editorId="activeName2" :defaultMsg="form.explain" :config=config ref="ue"
@ready="editorReadyEvent"></UE>
</div> </div>
<!--<Editor v-if="activeName2=='third'" @input="handelExplainIncrease" :value="form.explain" :myQuillEditor="'myQuillEditorExplain'" :activeName2="activeName2"></Editor>--> <!--<Editor v-if="activeName2=='third'" @input="handelExplainIncrease" :value="form.explain" :myQuillEditor="'myQuillEditorExplain'" :activeName2="activeName2"></Editor>-->
</el-tab-pane> </el-tab-pane>
...@@ -210,32 +253,38 @@ ...@@ -210,32 +253,38 @@
<el-button type="primary" v-if="title=='编辑' && !isCreate&&good_btn_update" @click="update('form')">确 定</el-button> <el-button type="primary" v-if="title=='编辑' && !isCreate&&good_btn_update" @click="update('form')">确 定</el-button>
</div> </div>
<!--编辑出发地--> <!--编辑出发地-->
<departureModal v-if="editDepartureVisible" :list="departureList" v-on:departureEvent = "departureEvent"></departureModal> <departureModal v-if="editDepartureVisible" :list="departureList"
v-on:departureEvent="departureEvent"></departureModal>
<!--编辑目的地--> <!--编辑目的地-->
<destination v-if="showDestinationVisible" :obj="destinationObj" v-on:destinationEvent = "destinationEvent"></destination> <destination v-if="showDestinationVisible" :obj="destinationObj"
v-on:destinationEvent="destinationEvent"></destination>
<!--编辑途径地--> <!--编辑途径地-->
<destination v-if="showPathWayVisible" :obj="onePathObj" v-on:pathWayEvent = "pathWayEvent"></destination> <destination v-if="showPathWayVisible" :obj="onePathObj" v-on:pathWayEvent="pathWayEvent"></destination>
<!--编辑活动时间--> <!--编辑活动时间-->
<tourTime v-if="showTimeVisible" :list="form.tourDepartTimeVo" :number="form.number" v-on:tourDepartTimeEvent = "tourDepartTimeEvent"></tourTime> <tourTime v-if="showTimeVisible" :list="form.tourDepartTimeVo" :number="form.number"
v-on:tourDepartTimeEvent="tourDepartTimeEvent"></tourTime>
<!--编辑旅游标签--> <!--编辑旅游标签-->
<tourLabelModal v-if="editLableVisible" :allLabelList="allLabelList" :checkList="checkList" v-on:tourLabelEvent = "tourLabelEvent"></tourLabelModal> <tourLabelModal v-if="editLableVisible" :allLabelList="allLabelList" :checkList="checkList"
v-on:tourLabelEvent="tourLabelEvent"></tourLabelModal>
</div> </div>
</template> </template>
<style> <style>
textarea{ textarea {
display: none; display: none;
} }
.el-upload-list{
.el-upload-list {
display: flex; display: flex;
width: 100px; width: 100px;
} }
.el-upload-list li{
.el-upload-list li {
margin-left: 10px; margin-left: 10px;
} }
</style> </style>
<script> <script>
// import Editor from "../../modal/editorTool";//富文本 // import Editor from "../../modal/editorTool";//富文本
import UE from '../../modal/Ueditor';//百度ue富文本 import UE from '../../modal/Ueditor';//百度ue富文本
import Destination from "./destinationModal";//目的地弹框 import Destination from "./destinationModal";//目的地弹框
import tourTime from "./tourTime";//活动时间 import tourTime from "./tourTime";//活动时间
import tourLabelModal from "./tourLabelModal";//旅游标签 import tourLabelModal from "./tourLabelModal";//旅游标签
...@@ -264,9 +313,10 @@ import UE from '../../modal/Ueditor';//百度ue富文本 ...@@ -264,9 +313,10 @@ import UE from '../../modal/Ueditor';//百度ue富文本
getTourTagList, getTourTagList,
getAllTourTag getAllTourTag
} from 'api/tourManage'; } from 'api/tourManage';
import ElRow from "element-ui/packages/row/src/row"; import ElRow from "element-ui/packages/row/src/row";
export default { export default {
props: ["oneTourRow", "title","good_btn_update"], props: ["oneTourRow", "title", "good_btn_update"],
name: 'upkeepDialog', name: 'upkeepDialog',
components: { components: {
// Editor, // Editor,
...@@ -279,8 +329,8 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -279,8 +329,8 @@ import ElRow from "element-ui/packages/row/src/row";
}, },
data() { data() {
return { return {
imgPosterFlag:false, imgPosterFlag: false,
percent_poster:0, percent_poster: 0,
BASE_API: process.env.BASE_API, BASE_API: process.env.BASE_API,
config: { config: {
initialFrameWidth: null, initialFrameWidth: null,
...@@ -288,21 +338,24 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -288,21 +338,24 @@ import ElRow from "element-ui/packages/row/src/row";
}, },
percent: 0,//上传进度 percent: 0,//上传进度
imgFlag: false, imgFlag: false,
onePathObj:{name: ""},//待编辑的途径地 onePathObj: {name: ""},//待编辑的途径地
destinationObj:{},//目的地 destinationObj: {},//目的地
departureList: [],//出发地列表 departureList: [],//出发地列表
departureObj:{name: ""},//出发地 departureObj: {name: ""},//出发地
pathway: [],//途径地 pathway: [],//途径地
isCreate: false,//是否点击了创建-确定 isCreate: false,//是否点击了创建-确定
fileList2:[], fileList2: [],
activeName2: '',//行程亮点 activeName2: '',//行程亮点
form: { form: {
alt:undefined, alt: undefined,
imgTitle: undefined,
imgKeyword: undefined,
imgDesc: undefined,
childPrice: undefined,//儿童价 childPrice: undefined,//儿童价
isOutside:"0", isOutside: "0",
tourDepartVo:undefined,//type:0出发地 1途径地 2目的地 tourDepartVo: undefined,//type:0出发地 1途径地 2目的地
content: "",//行程亮点 content: "",//行程亮点
cover:undefined,//封面图 cover: undefined,//封面图
describe: undefined,//描述 describe: undefined,//描述
introduce: "",//行程介绍 introduce: "",//行程介绍
crtTime: undefined, crtTime: undefined,
...@@ -319,8 +372,8 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -319,8 +372,8 @@ import ElRow from "element-ui/packages/row/src/row";
viewCount: undefined,//浏览量 viewCount: undefined,//浏览量
isMember: "0",//是否是会员商品 isMember: "0",//是否是会员商品
tagDTOS: [],//旅行标签 tagDTOS: [],//旅行标签
bannerDTOS:[],//banner轮播 bannerDTOS: [],//banner轮播
posterBackground:'',//海报背景 posterBackground: '',//海报背景
}, },
showDestinationVisible: false,//编辑目的地 showDestinationVisible: false,//编辑目的地
showPathWayVisible: false,//编辑途径地 showPathWayVisible: false,//编辑途径地
...@@ -345,7 +398,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -345,7 +398,7 @@ import ElRow from "element-ui/packages/row/src/row";
message: '请输入库存' message: '请输入库存'
} }
}, },
checkList:[],//已选中的标签 checkList: [],//已选中的标签
allCompanies: {}, allCompanies: {},
allCompaniesArr: [], allCompaniesArr: [],
oneTourDialogVisible: false, oneTourDialogVisible: false,
...@@ -367,18 +420,18 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -367,18 +420,18 @@ import ElRow from "element-ui/packages/row/src/row";
this.getAllLabelList(); this.getAllLabelList();
}, },
watch: { watch: {
oneTourDialogVisible(newValue, oldValue){ oneTourDialogVisible(newValue, oldValue) {
if(!newValue){ if (!newValue) {
this.cleanForm(); this.cleanForm();
} }
}, },
}, },
mounted() { mounted() {
this.cleanForm(); this.cleanForm();
if(this.title == "编辑"){ if (this.title == "编辑") {
let row = this.oneTourRow; let row = this.oneTourRow;
this.getOneGoods(row.id); this.getOneGoods(row.id);
} else{ } else {
this.activeName2 = "first"; this.activeName2 = "first";
} }
this.oneTourDialogVisible = true; this.oneTourDialogVisible = true;
...@@ -400,7 +453,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -400,7 +453,7 @@ import ElRow from "element-ui/packages/row/src/row";
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event); console.log(tab, event);
}, },
getWeek(week, name){ getWeek(week, name) {
let weekStr = ""; let weekStr = "";
switch (week) { switch (week) {
case 0: case 0:
...@@ -430,16 +483,16 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -430,16 +483,16 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 编辑出发地 * 编辑出发地
* */ * */
editDeparture(list){ editDeparture(list) {
console.log(list); console.log(list);
this.editDepartureVisible = true; this.editDepartureVisible = true;
}, },
/** /**
* 关闭出发地弹框 * 关闭出发地弹框
* */ * */
departureEvent(obj){ departureEvent(obj) {
this.editDepartureVisible = false; this.editDepartureVisible = false;
if(obj){ if (obj) {
this.departureList = obj; this.departureList = obj;
console.log(obj); console.log(obj);
} }
...@@ -447,21 +500,21 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -447,21 +500,21 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 编辑旅游标签 * 编辑旅游标签
* */ * */
editLable(list){ editLable(list) {
console.log(list); console.log(list);
this.editLableVisible = true; this.editLableVisible = true;
}, },
/** /**
* 创建 * 创建
* */ * */
create(formName){ create(formName) {
const set = this.$refs; const set = this.$refs;
set[formName].validate(valid => { set[formName].validate(valid => {
if (valid) { if (valid) {
//旅游标签 //旅游标签
let tagDTOS = []; let tagDTOS = [];
this.form.tagDTOS.map(function(item){ this.form.tagDTOS.map(function (item) {
if(item.tagId){ if (item.tagId) {
tagDTOS.push({tagId: item.tagId}); tagDTOS.push({tagId: item.tagId});
} else { } else {
tagDTOS.push({tagId: item.id}); tagDTOS.push({tagId: item.id});
...@@ -469,20 +522,20 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -469,20 +522,20 @@ import ElRow from "element-ui/packages/row/src/row";
}); });
let siteDTOS = []; let siteDTOS = [];
//出发地 //出发地
this.departureList.map(function(item){ this.departureList.map(function (item) {
let pp = item.province?item.province:item.addrProvince; let pp = item.province ? item.province : item.addrProvince;
let c = item.addrCity?item.addrCity: item.city; let c = item.addrCity ? item.addrCity : item.city;
let provinceObj = pp?getRegionByCodes([pp]): [{name:""}]; let provinceObj = pp ? getRegionByCodes([pp]) : [{name: ""}];
let cityObj = c?getRegionByCodes([c]):[{name:""}]; let cityObj = c ? getRegionByCodes([c]) : [{name: ""}];
let p = { let p = {
name: item.name, name: item.name,
departTime:item.departTime?item.departTime:0, departTime: item.departTime ? item.departTime : 0,
address: item.addrDetail?item.addrDetail: item.address, address: item.addrDetail ? item.addrDetail : item.address,
companyId: item.companyId, companyId: item.companyId,
province: item.addrProvince?item.addrProvince:item.province, province: item.addrProvince ? item.addrProvince : item.province,
provinceName:provinceObj[0].name, provinceName: provinceObj[0].name,
cityName: cityObj[0].name, cityName: cityObj[0].name,
city: item.addrCity?item.addrCity: item.city, city: item.addrCity ? item.addrCity : item.city,
longitude: item.longitude, longitude: item.longitude,
latitude: item.latitude, latitude: item.latitude,
type: 0, type: 0,
...@@ -490,7 +543,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -490,7 +543,7 @@ import ElRow from "element-ui/packages/row/src/row";
}; };
siteDTOS.push(p); siteDTOS.push(p);
}); });
if(this.departureList.length<=0){ if (this.departureList.length <= 0) {
this.$notify({ this.$notify({
title: '警告', title: '警告',
message: '请选择出发地', message: '请选择出发地',
...@@ -500,19 +553,19 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -500,19 +553,19 @@ import ElRow from "element-ui/packages/row/src/row";
return; return;
} }
//途径地 //途径地
this.pathway.map(function(item){ this.pathway.map(function (item) {
let provinceObj = item.province?getRegionByCodes([item.province]): [{name:""}]; let provinceObj = item.province ? getRegionByCodes([item.province]) : [{name: ""}];
let cityObj = item.city?getRegionByCodes([item.city]):[{name:""}]; let cityObj = item.city ? getRegionByCodes([item.city]) : [{name: ""}];
// let provinceObj = getRegionByCodes([item.province]); // let provinceObj = getRegionByCodes([item.province]);
// let cityObj = getRegionByCodes([item.city]); // let cityObj = getRegionByCodes([item.city]);
let p = { let p = {
name: item.name, name: item.name,
address: item.addrDetail?item.addrDetail: item.address, address: item.addrDetail ? item.addrDetail : item.address,
// companyId: item.id, // companyId: item.id,
province: item.addrProvince?item.addrProvince:item.province, province: item.addrProvince ? item.addrProvince : item.province,
provinceName:provinceObj[0].name, provinceName: provinceObj[0].name,
cityName: cityObj[0].name, cityName: cityObj[0].name,
city: item.addrCity?item.addrCity: item.city, city: item.addrCity ? item.addrCity : item.city,
longitude: item.longitude, longitude: item.longitude,
latitude: item.latitude, latitude: item.latitude,
type: 1, type: 1,
...@@ -522,7 +575,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -522,7 +575,7 @@ import ElRow from "element-ui/packages/row/src/row";
}); });
//destinationObj目的地 //destinationObj目的地
let destinationObj = this.destinationObj; let destinationObj = this.destinationObj;
if(!destinationObj.name){ if (!destinationObj.name) {
this.$notify({ this.$notify({
title: '警告', title: '警告',
message: '请选择目的地', message: '请选择目的地',
...@@ -531,15 +584,15 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -531,15 +584,15 @@ import ElRow from "element-ui/packages/row/src/row";
}); });
return; return;
} }
let provinceObj = destinationObj.province?getRegionByCodes([destinationObj.province]):[{name:""}]; let provinceObj = destinationObj.province ? getRegionByCodes([destinationObj.province]) : [{name: ""}];
let cityObj = destinationObj.city?getRegionByCodes([destinationObj.city]):[{name:""}]; let cityObj = destinationObj.city ? getRegionByCodes([destinationObj.city]) : [{name: ""}];
let p = { let p = {
name: destinationObj.name, name: destinationObj.name,
address: destinationObj.addrDetail?destinationObj.addrDetail: destinationObj.address, address: destinationObj.addrDetail ? destinationObj.addrDetail : destinationObj.address,
province: destinationObj.addrProvince?destinationObj.addrProvince:destinationObj.province, province: destinationObj.addrProvince ? destinationObj.addrProvince : destinationObj.province,
provinceName:provinceObj[0].name, provinceName: provinceObj[0].name,
cityName: cityObj[0].name, cityName: cityObj[0].name,
city: destinationObj.addrCity?destinationObj.addrCity: destinationObj.city, city: destinationObj.addrCity ? destinationObj.addrCity : destinationObj.city,
longitude: destinationObj.longitude, longitude: destinationObj.longitude,
latitude: destinationObj.latitude, latitude: destinationObj.latitude,
type: 2 type: 2
...@@ -568,8 +621,11 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -568,8 +621,11 @@ import ElRow from "element-ui/packages/row/src/row";
siteDTOS: siteDTOS,//出发地type=0,途径地type=1,目的地type=2 siteDTOS: siteDTOS,//出发地type=0,途径地type=1,目的地type=2
priceDTOS: this.form.tourDepartTimeVo,//活动日期 priceDTOS: this.form.tourDepartTimeVo,//活动日期
tagDTOS: tagDTOS,//旅游标签 tagDTOS: tagDTOS,//旅游标签
posterBackground:this.form.posterBackground,//海报背景 posterBackground: this.form.posterBackground,//海报背景
alt: this.form.alt, //seo 标签优化 alt: this.form.alt, //seo 标签优化
imgTitle: this.form.imgTitle,
imgKeyword: this.form.imgKeyword,
imgDesc: this.form.imgDesc
}; };
console.log(params); console.log(params);
goodsEdit(params).then(response => { goodsEdit(params).then(response => {
...@@ -599,14 +655,14 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -599,14 +655,14 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 编辑 * 编辑
* */ * */
update(formName){ update(formName) {
//旅游标签 //旅游标签
const set = this.$refs; const set = this.$refs;
set[formName].validate(valid => { set[formName].validate(valid => {
if (valid) { if (valid) {
let tagDTOS = []; let tagDTOS = [];
this.form.tagDTOS.map(function(item){ this.form.tagDTOS.map(function (item) {
if(item.tagId){ if (item.tagId) {
tagDTOS.push({tagId: item.tagId}); tagDTOS.push({tagId: item.tagId});
} else { } else {
tagDTOS.push({tagId: item.id}); tagDTOS.push({tagId: item.id});
...@@ -614,21 +670,21 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -614,21 +670,21 @@ import ElRow from "element-ui/packages/row/src/row";
}); });
let siteDTOS = []; let siteDTOS = [];
//出发地 //出发地
this.departureList.map(function(item){ this.departureList.map(function (item) {
let pp = item.province?item.province:item.addrProvince; let pp = item.province ? item.province : item.addrProvince;
let c = item.addrCity?item.addrCity: item.city; let c = item.addrCity ? item.addrCity : item.city;
let provinceObj = pp?getRegionByCodes([pp]): [{name:""}]; let provinceObj = pp ? getRegionByCodes([pp]) : [{name: ""}];
let cityObj = c?getRegionByCodes([c]):[{name:""}]; let cityObj = c ? getRegionByCodes([c]) : [{name: ""}];
let p = { let p = {
id: item.id, id: item.id,
name: item.name, name: item.name,
departTime:item.departTime?item.departTime:0, departTime: item.departTime ? item.departTime : 0,
address: item.addrDetail?item.addrDetail: item.address, address: item.addrDetail ? item.addrDetail : item.address,
companyId: item.companyId, companyId: item.companyId,
province: item.addrProvince?item.addrProvince:item.province, province: item.addrProvince ? item.addrProvince : item.province,
provinceName:provinceObj[0].name, provinceName: provinceObj[0].name,
cityName: cityObj[0].name, cityName: cityObj[0].name,
city: item.addrCity?item.addrCity: item.city, city: item.addrCity ? item.addrCity : item.city,
longitude: item.longitude, longitude: item.longitude,
latitude: item.latitude, latitude: item.latitude,
type: 0, type: 0,
...@@ -636,7 +692,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -636,7 +692,7 @@ import ElRow from "element-ui/packages/row/src/row";
}; };
siteDTOS.push(p); siteDTOS.push(p);
}); });
if(this.departureList.length<=0){ if (this.departureList.length <= 0) {
this.$notify({ this.$notify({
title: '警告', title: '警告',
message: '请选择出发地', message: '请选择出发地',
...@@ -646,18 +702,18 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -646,18 +702,18 @@ import ElRow from "element-ui/packages/row/src/row";
return; return;
} }
//途径地 //途径地
this.pathway.map(function(item){ this.pathway.map(function (item) {
let provinceObj = item.province?getRegionByCodes([item.province]): [{name:""}]; let provinceObj = item.province ? getRegionByCodes([item.province]) : [{name: ""}];
let cityObj = item.city?getRegionByCodes([item.city]):[{name:""}]; let cityObj = item.city ? getRegionByCodes([item.city]) : [{name: ""}];
let p = { let p = {
id: item.id, id: item.id,
name: item.name, name: item.name,
address: item.addrDetail?item.addrDetail: item.address, address: item.addrDetail ? item.addrDetail : item.address,
// companyId: item.id, // companyId: item.id,
province: item.addrProvince?item.addrProvince:item.province, province: item.addrProvince ? item.addrProvince : item.province,
provinceName: provinceObj[0].name, provinceName: provinceObj[0].name,
cityName: cityObj[0].name, cityName: cityObj[0].name,
city: item.addrCity?item.addrCity: item.city, city: item.addrCity ? item.addrCity : item.city,
longitude: item.longitude, longitude: item.longitude,
latitude: item.latitude, latitude: item.latitude,
type: 1, type: 1,
...@@ -667,7 +723,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -667,7 +723,7 @@ import ElRow from "element-ui/packages/row/src/row";
}); });
//destinationObj目的地 //destinationObj目的地
let destinationObj = this.destinationObj; let destinationObj = this.destinationObj;
if(!destinationObj.name){ if (!destinationObj.name) {
this.$notify({ this.$notify({
title: '警告', title: '警告',
message: '请选择目的地', message: '请选择目的地',
...@@ -676,16 +732,16 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -676,16 +732,16 @@ import ElRow from "element-ui/packages/row/src/row";
}); });
return; return;
} }
let provinceObj = destinationObj.province?getRegionByCodes([destinationObj.province]):[{name:""}]; let provinceObj = destinationObj.province ? getRegionByCodes([destinationObj.province]) : [{name: ""}];
let cityObj = destinationObj.city?getRegionByCodes([destinationObj.city]):[{name:""}]; let cityObj = destinationObj.city ? getRegionByCodes([destinationObj.city]) : [{name: ""}];
let p = { let p = {
id: destinationObj.id, id: destinationObj.id,
name: destinationObj.name, name: destinationObj.name,
address: destinationObj.addrDetail?destinationObj.addrDetail: destinationObj.address, address: destinationObj.addrDetail ? destinationObj.addrDetail : destinationObj.address,
province: destinationObj.addrProvince?destinationObj.addrProvince:destinationObj.province, province: destinationObj.addrProvince ? destinationObj.addrProvince : destinationObj.province,
provinceName: provinceObj[0].name, provinceName: provinceObj[0].name,
cityName: cityObj[0].name, cityName: cityObj[0].name,
city: destinationObj.addrCity?destinationObj.addrCity: destinationObj.city, city: destinationObj.addrCity ? destinationObj.addrCity : destinationObj.city,
longitude: destinationObj.longitude, longitude: destinationObj.longitude,
latitude: destinationObj.latitude, latitude: destinationObj.latitude,
type: 2 type: 2
...@@ -714,8 +770,11 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -714,8 +770,11 @@ import ElRow from "element-ui/packages/row/src/row";
siteDTOS: siteDTOS,//出发地type=0,途径地type=1,目的地type=2 siteDTOS: siteDTOS,//出发地type=0,途径地type=1,目的地type=2
priceDTOS: this.form.tourDepartTimeVo,//活动日期 priceDTOS: this.form.tourDepartTimeVo,//活动日期
tagDTOS: tagDTOS,//旅游标签 tagDTOS: tagDTOS,//旅游标签
posterBackground:this.form.posterBackground,//海报背景 posterBackground: this.form.posterBackground,//海报背景
alt:this.form.alt, //seo 标签优化 alt: this.form.alt, //seo 标签优化
imgTitle: this.form.imgTitle,
imgKeyword: this.form.imgKeyword,
imgDesc: this.form.imgDesc
}; };
console.log(params); console.log(params);
this.isCreate = true; this.isCreate = true;
...@@ -756,9 +815,9 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -756,9 +815,9 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 关闭目的地弹框 * 关闭目的地弹框
* */ * */
destinationEvent(obj){ destinationEvent(obj) {
this.showDestinationVisible = false; this.showDestinationVisible = false;
if(obj){ if (obj) {
this.destinationObj = obj; this.destinationObj = obj;
console.log(obj); console.log(obj);
} }
...@@ -766,20 +825,20 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -766,20 +825,20 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 选择目的地 * 选择目的地
* */ * */
selectDestination(){ selectDestination() {
let that = this; let that = this;
this.destinationObj.showTitle = "目的地编辑"; this.destinationObj.showTitle = "目的地编辑";
this.destinationObj.headTitle = "目的地名称"; this.destinationObj.headTitle = "目的地名称";
this.destinationObj.eventName ='destinationEvent'; this.destinationObj.eventName = 'destinationEvent';
this.destinationObj.keyword = this.destinationObj.address; this.destinationObj.keyword = this.destinationObj.address;
this.showDestinationVisible = true; this.showDestinationVisible = true;
}, },
/** /**
* 关闭活动日期 * 关闭活动日期
* */ * */
tourDepartTimeEvent(params){ tourDepartTimeEvent(params) {
this.showTimeVisible = false; this.showTimeVisible = false;
if(params){ if (params) {
this.form.number = params.num; this.form.number = params.num;
this.form.tourDepartTimeVo = params.priceDTOS; this.form.tourDepartTimeVo = params.priceDTOS;
console.log(params); console.log(params);
...@@ -788,11 +847,11 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -788,11 +847,11 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 关闭途径地弹框 * 关闭途径地弹框
* */ * */
pathWayEvent(obj){ pathWayEvent(obj) {
this.showPathWayVisible = false; this.showPathWayVisible = false;
if(obj){ if (obj) {
if(obj.showTitle == "途径地编辑"){ if (obj.showTitle == "途径地编辑") {
if(obj.method == "delete"){ if (obj.method == "delete") {
//删除当前路径 //删除当前路径
this.pathway.splice(obj, 1); this.pathway.splice(obj, 1);
} else { } else {
...@@ -807,7 +866,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -807,7 +866,7 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 编辑一条途径地数据 * 编辑一条途径地数据
* */ * */
selectPathway(obj){ selectPathway(obj) {
let that = this; let that = this;
console.log(obj); console.log(obj);
this.onePathObj = obj; this.onePathObj = obj;
...@@ -817,15 +876,15 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -817,15 +876,15 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 关闭旅游标签弹框 * 关闭旅游标签弹框
* */ * */
tourLabelEvent(obj){ tourLabelEvent(obj) {
let that = this; let that = this;
this.editLableVisible = false; this.editLableVisible = false;
let arr = []; let arr = [];
let ckeckList = []; let ckeckList = [];
if(obj){ if (obj) {
this.allLabelList.map(function(item){ this.allLabelList.map(function (item) {
obj.map(function(b){ obj.map(function (b) {
if(item.name == b){ if (item.name == b) {
arr.push(item); arr.push(item);
ckeckList.push(b); ckeckList.push(b);
} }
...@@ -839,7 +898,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -839,7 +898,7 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 编辑一条途径地 * 编辑一条途径地
**/ **/
editPathway(item){ editPathway(item) {
this.onePathObj = item; this.onePathObj = item;
this.onePathObj.showTitle = "途径地编辑";//弹框名称 this.onePathObj.showTitle = "途径地编辑";//弹框名称
this.onePathObj.headTitle = "途径地名称"; this.onePathObj.headTitle = "途径地名称";
...@@ -850,16 +909,16 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -850,16 +909,16 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 添加途径地 * 添加途径地
* */ * */
addPathway(){ addPathway() {
let that = this; let that = this;
this.onePathObj = { this.onePathObj = {
showTitle: "途径地添加",//弹框名称 showTitle: "途径地添加",//弹框名称
headTitle: "途径地名称", headTitle: "途径地名称",
name: undefined,//地址名称 name: undefined,//地址名称
keyword:"东莞市",//根据关键词查找经纬度 keyword: "东莞市",//根据关键词查找经纬度
address:undefined,//详细地址 address: undefined,//详细地址
longitude: 113.758993, longitude: 113.758993,
latitude:23.031565, latitude: 23.031565,
eventName: "pathWayEvent" eventName: "pathWayEvent"
}; };
this.showPathWayVisible = true; this.showPathWayVisible = true;
...@@ -867,38 +926,38 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -867,38 +926,38 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 添加时间 * 添加时间
* */ * */
editTime(){ editTime() {
this.showTimeVisible = true; this.showTimeVisible = true;
}, },
/** /**
* 获取一条旅游路线 * 获取一条旅游路线
* */ * */
getOneGoods(id){ getOneGoods(id) {
let params = { let params = {
id: id id: id
}; };
let that = this; let that = this;
getOneGoodsById(params).then(response => { getOneGoodsById(params).then(response => {
that.pathway = []; that.pathway = [];
response.data.tourDepartVo.map(function(item){ response.data.tourDepartVo.map(function (item) {
if(item.type == 0){ if (item.type == 0) {
//出发地 //出发地
that.departureList.push(item); that.departureList.push(item);
} }
if(item.type == 2 && that.destinationObj.name == ""){ if (item.type == 2 && that.destinationObj.name == "") {
//目的地 //目的地
that.destinationObj = item; that.destinationObj = item;
} }
if(item.type==1){ if (item.type == 1) {
//途径地 //途径地
that.pathway.push(item); that.pathway.push(item);
} }
}); });
let arr = []; let arr = [];
this.form = response.data; this.form = response.data;
this.allLabelList.map(function(b){ this.allLabelList.map(function (b) {
response.data.tagDTOS.map(function(item){ response.data.tagDTOS.map(function (item) {
if(item.tagId == b.id){ if (item.tagId == b.id) {
arr.push(item.name); arr.push(item.name);
} }
}); });
...@@ -907,22 +966,22 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -907,22 +966,22 @@ import ElRow from "element-ui/packages/row/src/row";
//轮播 //轮播
let fileList2 = []; let fileList2 = [];
response.data.bannerDTOS.map(function(item){ response.data.bannerDTOS.map(function (item) {
let p = { let p = {
url: item.cover url: item.cover
}; };
fileList2.push(p); fileList2.push(p);
}); });
this.fileList2 = fileList2; this.fileList2 = fileList2;
this.form.isMember = this.form.isMember+""; this.form.isMember = this.form.isMember + "";
this.form.recommend = this.form.recommend+""; this.form.recommend = this.form.recommend + "";
this.form.isOutside = this.form.isOutside+""; this.form.isOutside = this.form.isOutside + "";
this.activeName2 = "first"; this.activeName2 = "first";
}) })
}, },
querySearch(queryString, cb) { querySearch(queryString, cb) {
let selectArry = []; let selectArry = [];
this.allCompaniesArr.map(function(item){ this.allCompaniesArr.map(function (item) {
item.value = item.name; item.value = item.name;
selectArry.push(item); selectArry.push(item);
}); });
...@@ -950,14 +1009,14 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -950,14 +1009,14 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 富文本 旅游 * 富文本 旅游
* */ * */
editorReadyEvent(instance){ editorReadyEvent(instance) {
let t = this; let t = this;
instance.addListener('contentChange', () => { instance.addListener('contentChange', () => {
if(t.activeName2 == "first"){ if (t.activeName2 == "first") {
t.form.content = instance.getContent(); t.form.content = instance.getContent();
} else if(t.activeName2 == "second"){ } else if (t.activeName2 == "second") {
t.form.introduce = instance.getContent(); t.form.introduce = instance.getContent();
} else if(t.activeName2 == "third"){ } else if (t.activeName2 == "third") {
t.form.explain = instance.getContent(); t.form.explain = instance.getContent();
} }
}); });
...@@ -984,17 +1043,17 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -984,17 +1043,17 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 删除banner * 删除banner
* */ * */
handleRemove(file, fileList){ handleRemove(file, fileList) {
let list = []; let list = [];
fileList.map(function(item){ fileList.map(function (item) {
if(item.url != file.url){ if (item.url != file.url) {
list.push(item); list.push(item);
} }
}); });
this.fileList2 = list; this.fileList2 = list;
let arr = []; let arr = [];
this.form.bannerDTOS.map(function(item){ this.form.bannerDTOS.map(function (item) {
if(item.cover != file.url){ if (item.cover != file.url) {
arr.push(item); arr.push(item);
} }
}); });
...@@ -1003,7 +1062,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -1003,7 +1062,7 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 封面图上传 * 封面图上传
* **/ * **/
handleAvatarSuccess(res, file){ handleAvatarSuccess(res, file) {
this.percent = 0; this.percent = 0;
this.imgFlag = false; this.imgFlag = false;
this.form.cover = res.data; this.form.cover = res.data;
...@@ -1011,7 +1070,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -1011,7 +1070,7 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* 海报背景上传 * 海报背景上传
* **/ * **/
handlePosterSuccess(res, file){ handlePosterSuccess(res, file) {
this.percent_poster = 0; this.percent_poster = 0;
this.imgPosterFlag = false; this.imgPosterFlag = false;
this.form.posterBackground = res.data; this.form.posterBackground = res.data;
...@@ -1027,27 +1086,27 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -1027,27 +1086,27 @@ import ElRow from "element-ui/packages/row/src/row";
/** /**
* banner上传 * banner上传
* */ * */
handleBannerSuccess(res, file){ handleBannerSuccess(res, file) {
this.fileList2.push({url:res.data}); this.fileList2.push({url: res.data});
this.form.bannerDTOS.push({cover:res.data}); this.form.bannerDTOS.push({cover: res.data});
}, },
/** /**
* 清空旅游弹框数据 * 清空旅游弹框数据
*/ */
cleanForm() { cleanForm() {
this.onePathObj = {name: ""};//待编辑的途径地 this.onePathObj = {name: ""};//待编辑的途径地
this.destinationObj ={name: ""},//目的地 this.destinationObj = {name: ""},//目的地
this.departureList= [],//出发地列表 this.departureList = [],//出发地列表
this.departureObj={name: ""},//出发地 this.departureObj = {name: ""},//出发地
this.pathway= [],//途径地 this.pathway = [],//途径地
this.fileList2=[], this.fileList2 = [],
this.activeName2= '',//行程亮点 this.activeName2 = '',//行程亮点
this.form= { this.form = {
isOutside: "0",//省内、省外 isOutside: "0",//省内、省外
childPrice: undefined,//儿童价 childPrice: undefined,//儿童价
tourDepartVo:undefined,//type:0出发地 1途径地 2目的地 tourDepartVo: undefined,//type:0出发地 1途径地 2目的地
content: "",//行程亮点 content: "",//行程亮点
cover:undefined,//封面图 cover: undefined,//封面图
describe: undefined,//描述 describe: undefined,//描述
introduce: "",//行程介绍 introduce: "",//行程介绍
crtTime: undefined, crtTime: undefined,
...@@ -1064,14 +1123,17 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -1064,14 +1123,17 @@ import ElRow from "element-ui/packages/row/src/row";
viewCount: undefined,//浏览量 viewCount: undefined,//浏览量
isMember: "0",//是否是会员商品0不启用,1启用 isMember: "0",//是否是会员商品0不启用,1启用
tagDTOS: [],//旅行标签 tagDTOS: [],//旅行标签
bannerDTOS:[],//banner轮播 bannerDTOS: [],//banner轮播
tourDepartTimeVo:[],//活动时间 tourDepartTimeVo: [],//活动时间
posterBackground:'',//海报背景 posterBackground: '',//海报背景
alt:'', alt: '',
imgTitle: undefined,
imgKeyword: undefined,
imgDesc: undefined
}, },
this.showDestinationVisible= false,//编辑目的地 this.showDestinationVisible = false,//编辑目的地
this.showPathWayVisible= false,//编辑途径地 this.showPathWayVisible = false,//编辑途径地
this.showTimeVisible= false;//编辑时间 this.showTimeVisible = false;//编辑时间
this.activeName2 = ""; this.activeName2 = "";
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="车型名称" prop="name"> <el-form-item label="车型名称" prop="name">
<el-input v-model="form.name" placeholder="请输入车型名称" ></el-input> <el-input v-model="form.name" placeholder="请输入车型名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -96,8 +96,10 @@ ...@@ -96,8 +96,10 @@
<el-row> <el-row>
<el-col :span="8" v-for="(item, index) in labelList" :key="item.id"> <el-col :span="8" v-for="(item, index) in labelList" :key="item.id">
<el-form-item> <el-form-item>
<span style="width: 150px;text-align:right;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;padding-right: 10px;">{{item.parent.name}}</span> <span
<el-input v-model="item.selectChild" readonly icon="edit" @click="editConfig(item)" style="width: 70%;"></el-input> style="width: 150px;text-align:right;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;padding-right: 10px;">{{item.parent.name}}</span>
<el-input v-model="item.selectChild" readonly icon="edit" @click="editConfig(item)"
style="width: 70%;"></el-input>
<!--<el-select v-model="item.childNameLists" style="width: 80%" v-if="item.parent.isMore==1" multiple placeholder="请选择" @change = "selectItem">--> <!--<el-select v-model="item.childNameLists" style="width: 80%" v-if="item.parent.isMore==1" multiple placeholder="请选择" @change = "selectItem">-->
<!--<el-option--> <!--<el-option-->
<!--v-for="iitem in item.children"--> <!--v-for="iitem in item.children"-->
...@@ -134,7 +136,9 @@ ...@@ -134,7 +136,9 @@
</el-row> </el-row>
<el-form-item label="房车参数"> <el-form-item label="房车参数">
<el-button size="small" class="el-button el-button--primary" type="button" icon="plus" @click="addModelParam()">添加</el-button> <el-button size="small" class="el-button el-button--primary" type="button" icon="plus" @click="addModelParam()">
添加
</el-button>
<el-col v-for="(item, index) in form.modelParam" :key="index"> <el-col v-for="(item, index) in form.modelParam" :key="index">
<el-form-item label="参数名称" style="margin: 10px 5px;"> <el-form-item label="参数名称" style="margin: 10px 5px;">
<el-input style="width: 30%;" v-model="item.key"></el-input> <el-input style="width: 30%;" v-model="item.key"></el-input>
...@@ -924,11 +928,4 @@ import UE from '../../modal/Ueditor';//百度ue富文本 ...@@ -924,11 +928,4 @@ import UE from '../../modal/Ueditor';//百度ue富文本
border-bottom: 1px solid #999; border-bottom: 1px solid #999;
padding: 3px; padding: 3px;
} }
.cx{
margin-top: 0px;
margin-bottom: 0px;
height: 180px;
}
</style> </style>
<template> <template>
<!-- 营地:创建、编辑 --> <!-- 营地:创建、编辑 -->
<div class = "activity"> <div class="activity">
<h4>{{title}}</h4> <h4>{{title}}</h4>
<el-form :model="form" :rules="rules" ref="form" label-width="90px"> <el-form :model="form" :rules="rules" ref="form" label-width="90px">
<el-row> <el-row>
...@@ -26,14 +26,37 @@ ...@@ -26,14 +26,37 @@
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
list-type="picture"> list-type="picture">
<div slot="tip" class="el-upload__tip"><span style="color: red;">建议尺寸:485*485px</span></div> <div slot="tip" class="el-upload__tip"><span style="color: red;">建议尺寸:485*485px</span></div>
<img v-if="$utils.isString(form.banner) && !$utils.isEmpty(form.banner)" :src="form.banner" style="width:300px;max-height:300px;"> <img v-if="$utils.isString(form.banner) && !$utils.isEmpty(form.banner)" :src="form.banner"
<i v-else class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> style="width:300px;max-height:300px;">
<i v-else class="el-icon-plus avatar-uploader-icon"
style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="alt"> <el-form-item label="alt">
<el-input v-model="form.alt" type="text" placeholder="请输入描述"></el-input> <el-input v-model="form.alt" type="text" placeholder="请输入替代文本"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="img-title">
<el-input v-model="form.imgTitle" type="text" placeholder="请输入图片title"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="img-keyword">
<el-input v-model="form.imgKeyword" type="text" placeholder="请输入图片关键字"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="img-desc">
<el-input v-model="form.imgDesc" type="text" placeholder="请输入图片描述"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -47,19 +70,22 @@ ...@@ -47,19 +70,22 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="开始时间" prop="startTime"> <el-form-item label="开始时间" prop="startTime">
<el-date-picker v-model="form.startTime" type="datetime" :editable="true" format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"></el-date-picker> <el-date-picker v-model="form.startTime" type="datetime" :editable="true" format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期"></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="结束时间" prop="endTime"> <el-form-item label="结束时间" prop="endTime">
<el-date-picker v-model="form.endTime" type="datetime" :editable="true" format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"></el-date-picker> <el-date-picker v-model="form.endTime" type="datetime" :editable="true" format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期"></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="报名时间" prop="regCloseTime"> <el-form-item label="报名时间" prop="regCloseTime">
<el-date-picker v-model="form.regCloseTime" type="datetime" :editable="true" format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"></el-date-picker> <el-date-picker v-model="form.regCloseTime" type="datetime" :editable="true" format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期"></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -80,7 +106,8 @@ ...@@ -80,7 +106,8 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="活动地址" prop="address"> <el-form-item label="活动地址" prop="address">
<el-input v-model="form.addressStr" readonly placeholder="请输入活动地址" :on-icon-click="selectDestination" icon="edit"></el-input> <el-input v-model="form.addressStr" readonly placeholder="请输入活动地址" :on-icon-click="selectDestination"
icon="edit"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -100,7 +127,8 @@ ...@@ -100,7 +127,8 @@
<el-tab-pane label="活动图文内容" name="first"> <el-tab-pane label="活动图文内容" name="first">
<!--<Editor v-if="activeName2=='first'" @input="handelContentIncrease" :value="form.content" :myQuillEditor="'myQuillEditorContent'" :activeName2="activeName2"></Editor>--> <!--<Editor v-if="activeName2=='first'" @input="handelContentIncrease" :value="form.content" :myQuillEditor="'myQuillEditorContent'" :activeName2="activeName2"></Editor>-->
<div class="editor-container" v-if="activeName2=='first'"> <div class="editor-container" v-if="activeName2=='first'">
<UE :editorId="activeName2" :defaultMsg="form.content" :config=config ref="ue" @ready="editorReadyEvent"></UE> <UE :editorId="activeName2" :defaultMsg="form.content" :config=config ref="ue"
@ready="editorReadyEvent"></UE>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -108,36 +136,43 @@ ...@@ -108,36 +136,43 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
<el-button type="primary" v-if="title=='创建' && !isCreate && campsiteshop_btn_update" @click="create('form')">确 定</el-button> <el-button type="primary" v-if="title=='创建' && !isCreate && campsiteshop_btn_update" @click="create('form')">确 定
<el-button type="primary" v-if="title=='编辑' && !isCreate && campsiteshop_btn_update" @click="update('form')">确 定</el-button> </el-button>
<el-button type="primary" v-if="title=='编辑' && !isCreate && campsiteshop_btn_update" @click="update('form')">确 定
</el-button>
</div> </div>
<!--编辑营地地址--> <!--编辑营地地址-->
<campsiteModal v-if="showCampsiteVisible && campsiteshop_btn_update" :obj="campsiteObj" v-on:campsiteEvent = "campsiteEvent"></campsiteModal> <campsiteModal v-if="showCampsiteVisible && campsiteshop_btn_update" :obj="campsiteObj"
v-on:campsiteEvent="campsiteEvent"></campsiteModal>
<!--编辑营地标签--> <!--编辑营地标签-->
<campsiteLabelModal v-if="editLableVisible && campsiteshop_btn_update" :allLabelList="allLabelList" :checkList="checkList" v-on:tourLabelEvent = "tourLabelEvent"></campsiteLabelModal> <campsiteLabelModal v-if="editLableVisible && campsiteshop_btn_update" :allLabelList="allLabelList"
:checkList="checkList" v-on:tourLabelEvent="tourLabelEvent"></campsiteLabelModal>
</div> </div>
</template> </template>
<style> <style>
textarea{ textarea {
display: none; display: none;
} }
.info{
.info {
border-radius: 10px; border-radius: 10px;
line-height: 20px; line-height: 20px;
padding: 10px; padding: 10px;
margin: 10px; margin: 10px;
background-color: #ffffff; background-color: #ffffff;
} }
.el-upload-list{
.el-upload-list {
display: flex; display: flex;
width: 100px; width: 100px;
} }
.el-upload-list li{
.el-upload-list li {
margin-left: 10px; margin-left: 10px;
} }
</style> </style>
<script> <script>
// import Editor from "../../modal/editorTool";//富文本 // import Editor from "../../modal/editorTool";//富文本
import UE from '../../modal/Ueditor';//百度ue富文本 import UE from '../../modal/Ueditor';//百度ue富文本
import campsiteLabelModal from "../../tourManage/modal/tourLabelModal";//标签 import campsiteLabelModal from "../../tourManage/modal/tourLabelModal";//标签
import campsiteModal from "./campsiteModal";//营地地址 import campsiteModal from "./campsiteModal";//营地地址
...@@ -162,6 +197,7 @@ ...@@ -162,6 +197,7 @@
getToken getToken
} from '../../../utils/auth'; } from '../../../utils/auth';
import {mapGetters} from 'vuex'; import {mapGetters} from 'vuex';
export default { export default {
props: ["oneRow", "title", "campsiteshop_btn_update"], props: ["oneRow", "title", "campsiteshop_btn_update"],
name: 'upkeepDialog', name: 'upkeepDialog',
...@@ -185,24 +221,27 @@ ...@@ -185,24 +221,27 @@
} }
}; };
return { return {
imgPosterFlag:false, imgPosterFlag: false,
percent_poster:0, percent_poster: 0,
BASE_API: process.env.BASE_API, BASE_API: process.env.BASE_API,
defaultMsg: '这里是UE测试', defaultMsg: '这里是UE测试',
config: { config: {
initialFrameWidth: null, initialFrameWidth: null,
initialFrameHeight: 350 initialFrameHeight: 350
}, },
isExist:false,//名称是否已存在 isExist: false,//名称是否已存在
campsiteObj: {},//营地地址 campsiteObj: {},//营地地址
departureList: [],//出发地列表 departureList: [],//出发地列表
departureObj:{name: ""},//出发地 departureObj: {name: ""},//出发地
pathway: [],//途径地 pathway: [],//途径地
isCreate: false,//是否点击了创建-确定 isCreate: false,//是否点击了创建-确定
fileList2:[], fileList2: [],
activeName2: '',//行程亮点 activeName2: '',//行程亮点
form: { form: {
alt:undefined, alt: undefined,
imgTitle: undefined,
imgKeyword: undefined,
imgDesc: undefined,
id: undefined, id: undefined,
title: undefined,//营地名称 title: undefined,//营地名称
subtitle: undefined,//营地热度 subtitle: undefined,//营地热度
...@@ -213,63 +252,63 @@ ...@@ -213,63 +252,63 @@
province: undefined,//市编号 province: undefined,//市编号
cityName: undefined,//市名称 cityName: undefined,//市名称
cityCode: undefined,//详细地址 cityCode: undefined,//详细地址
city:undefined, city: undefined,
townCode:undefined, townCode: undefined,
town:undefined, town: undefined,
address:undefined, address: undefined,
latitude: undefined, latitude: undefined,
longitude: undefined, longitude: undefined,
limitNum:0, limitNum: 0,
isShow:0, isShow: 0,
isOpenReg:0, isOpenReg: 0,
isDel:0, isDel: 0,
isPublish:0, isPublish: 0,
isHomePage:0, isHomePage: 0,
crtUser:undefined, crtUser: undefined,
crtName:undefined, crtName: undefined,
crtTime:undefined, crtTime: undefined,
actDesc:undefined, actDesc: undefined,
willNum:undefined, willNum: undefined,
location:0, location: 0,
rank:0, rank: 0,
type:undefined, type: undefined,
banner:undefined, banner: undefined,
content: '',//营地详情 content: '',//营地详情
concat: "",//联系人 concat: "",//联系人
logo:undefined,//封面图 logo: undefined,//封面图
configure: '',//配套&收费 configure: '',//配套&收费
campsiteTagListVos: [],//营地类型 campsiteTagListVos: [],//营地类型
carouse:[],//banner轮播 carouse: [],//banner轮播
posterBackground:'',//海报背景 posterBackground: '',//海报背景
}, },
showCampsiteVisible: false,//编辑营地地址 showCampsiteVisible: false,//编辑营地地址
rules: { rules: {
name:{ name: {
type: 'string', type: 'string',
required: true, required: true,
message: '请输入营地名称', message: '请输入营地名称',
trigger: 'blur' trigger: 'blur'
}, },
servicePhone:{ servicePhone: {
type: 'string', type: 'string',
required: true, required: true,
message: '请输入客服电话', message: '请输入客服电话',
trigger: 'blur' trigger: 'blur'
}, },
phone:{validator: checkPhone, trigger: 'blur',required: true}, phone: {validator: checkPhone, trigger: 'blur', required: true},
concat:{ concat: {
type: 'string', type: 'string',
required: true, required: true,
message: '请输入联系人', message: '请输入联系人',
trigger: 'blur' trigger: 'blur'
}, },
addressStr:{ addressStr: {
type: 'string', type: 'string',
required: true, required: true,
message: '请输入活动地址', message: '请输入活动地址',
} }
}, },
checkList:[],//已选中的标签 checkList: [],//已选中的标签
allCompanies: {}, allCompanies: {},
allCompaniesArr: [], allCompaniesArr: [],
oneTourDialogVisible: false, oneTourDialogVisible: false,
...@@ -280,15 +319,15 @@ ...@@ -280,15 +319,15 @@
created() { created() {
}, },
watch: { watch: {
oneTourDialogVisible(newValue, oldValue){ oneTourDialogVisible(newValue, oldValue) {
if(!newValue){ if (!newValue) {
this.cleanForm(); this.cleanForm();
} }
}, },
}, },
mounted() { mounted() {
this.cleanForm(); this.cleanForm();
if(this.title == "编辑"){ if (this.title == "编辑") {
let row = this.oneRow; let row = this.oneRow;
this.getOne(row.id); this.getOne(row.id);
} else { } else {
...@@ -312,17 +351,17 @@ ...@@ -312,17 +351,17 @@
/** /**
* 编辑营地标签 * 编辑营地标签
* */ * */
editLable(list){ editLable(list) {
console.log(list); console.log(list);
this.editLableVisible = true; this.editLableVisible = true;
}, },
isExistCampsiteShop(type, datas){ isExistCampsiteShop(type, datas) {
console.log(datas) console.log(datas)
if(type == "update"){//编辑 if (type == "update") {//编辑
this.toUpdate(datas); this.toUpdate(datas);
} }
if(type == "create"){ if (type == "create") {
//创建 //创建
this.toCreate(datas); this.toCreate(datas);
} }
...@@ -330,21 +369,24 @@ isExistCampsiteShop(type, datas){ ...@@ -330,21 +369,24 @@ isExistCampsiteShop(type, datas){
/** /**
* 创建 * 创建
* */ * */
create(formName){ create(formName) {
const set = this.$refs; const set = this.$refs;
if(this.form.startTime && (typeof this.form.startTime == "object")){ if (this.form.startTime && (typeof this.form.startTime == "object")) {
this.form.startTime = this.form.startTime.getTime(); this.form.startTime = this.form.startTime.getTime();
} }
if(this.form.endTime && (typeof this.form.endTime == "object")){ if (this.form.endTime && (typeof this.form.endTime == "object")) {
this.form.endTime = this.form.endTime.getTime(); this.form.endTime = this.form.endTime.getTime();
} }
if(this.form.regCloseTime && (typeof this.form.regCloseTime == "object")){ if (this.form.regCloseTime && (typeof this.form.regCloseTime == "object")) {
this.form.regCloseTime = this.form.regCloseTime.getTime(); this.form.regCloseTime = this.form.regCloseTime.getTime();
} }
set[formName].validate(valid => { set[formName].validate(valid => {
if (valid) { if (valid) {
let params = { let params = {
alt:this.form.alt, alt: this.form.alt,
imgTitle:this.form.imgTitle,
imgKeyword:this.form.imgKeyword,
imgDesc:this.form.imgDesc,
id: this.form.id, id: this.form.id,
title: this.form.title,//营地名称 title: this.form.title,//营地名称
subtitle: this.form.subtitle,//营地热度 subtitle: this.form.subtitle,//营地热度
...@@ -355,27 +397,27 @@ create(formName){ ...@@ -355,27 +397,27 @@ create(formName){
province: this.campsiteObj.provinceName,//市编号 province: this.campsiteObj.provinceName,//市编号
cityName: this.campsiteObj.cityName,//市名称 cityName: this.campsiteObj.cityName,//市名称
cityCode: this.campsiteObj.city,//详细地址 cityCode: this.campsiteObj.city,//详细地址
city:this.campsiteObj.cityName, city: this.campsiteObj.cityName,
townCode:this.campsiteObj.townCode, townCode: this.campsiteObj.townCode,
town:this.campsiteObj.town, town: this.campsiteObj.town,
address:this.campsiteObj.address, address: this.campsiteObj.address,
latitude: this.campsiteObj.latitude, latitude: this.campsiteObj.latitude,
longitude: this.campsiteObj.longitude, longitude: this.campsiteObj.longitude,
limitNum:this.form.limitNum, limitNum: this.form.limitNum,
isShow:this.form.isShow, isShow: this.form.isShow,
isOpenReg:this.form.isOpenReg, isOpenReg: this.form.isOpenReg,
isDel:this.form.isDel, isDel: this.form.isDel,
isHomePage:this.form.isHomePage, isHomePage: this.form.isHomePage,
isHomePage:this.form.isHomePage, isHomePage: this.form.isHomePage,
crtUser:this.form.crtUser, crtUser: this.form.crtUser,
crtName:this.form.crtName, crtName: this.form.crtName,
crtTime:this.form.crtTime, crtTime: this.form.crtTime,
actDesc:this.form.actDesc, actDesc: this.form.actDesc,
banner:this.form.banner, banner: this.form.banner,
willNum:this.form.willNum, willNum: this.form.willNum,
location:this.form.location, location: this.form.location,
rank:this.form.rank, rank: this.form.rank,
type:this.form.type, type: this.form.type,
content: this.form.content,//营地详情 content: this.form.content,//营地详情
}; };
console.log(params); console.log(params);
...@@ -384,27 +426,30 @@ create(formName){ ...@@ -384,27 +426,30 @@ create(formName){
return; return;
} }
}); });
}, },
/** /**
* 编辑 * 编辑
* */ * */
update(formName){ update(formName) {
const set = this.$refs; const set = this.$refs;
if(this.form.startTime && (typeof this.form.startTime == "object")){ if (this.form.startTime && (typeof this.form.startTime == "object")) {
this.form.startTime = this.form.startTime.getTime(); this.form.startTime = this.form.startTime.getTime();
} }
if(this.form.endTime && (typeof this.form.endTime == "object")){ if (this.form.endTime && (typeof this.form.endTime == "object")) {
this.form.endTime = this.form.endTime.getTime(); this.form.endTime = this.form.endTime.getTime();
} }
if(this.form.regCloseTime && (typeof this.form.regCloseTime == "object")){ if (this.form.regCloseTime && (typeof this.form.regCloseTime == "object")) {
this.form.regCloseTime = this.form.regCloseTime.getTime(); this.form.regCloseTime = this.form.regCloseTime.getTime();
} }
set[formName].validate(valid => { set[formName].validate(valid => {
if (valid) { if (valid) {
this.isCreate = true; this.isCreate = true;
let params = { let params = {
alt:this.form.alt, alt: this.form.alt,
imgTitle:this.form.imgTitle,
imgKeyword:this.form.imgKeyword,
imgDesc:this.form.imgDesc,
id: this.form.id, id: this.form.id,
title: this.form.title,//营地名称 title: this.form.title,//营地名称
subtitle: this.form.subtitle,//营地热度 subtitle: this.form.subtitle,//营地热度
...@@ -415,27 +460,27 @@ create(formName){ ...@@ -415,27 +460,27 @@ create(formName){
province: this.campsiteObj.provinceName,//市编号 province: this.campsiteObj.provinceName,//市编号
cityName: this.campsiteObj.cityName,//市名称 cityName: this.campsiteObj.cityName,//市名称
cityCode: this.campsiteObj.city,//详细地址 cityCode: this.campsiteObj.city,//详细地址
city:this.campsiteObj.cityName, city: this.campsiteObj.cityName,
townCode:this.campsiteObj.townCode, townCode: this.campsiteObj.townCode,
town:this.campsiteObj.town, town: this.campsiteObj.town,
address:this.campsiteObj.address, address: this.campsiteObj.address,
latitude: this.campsiteObj.latitude, latitude: this.campsiteObj.latitude,
longitude: this.campsiteObj.longitude, longitude: this.campsiteObj.longitude,
limitNum:this.form.limitNum, limitNum: this.form.limitNum,
isShow:this.form.isShow, isShow: this.form.isShow,
banner:this.form.banner, banner: this.form.banner,
isOpenReg:this.form.isOpenReg, isOpenReg: this.form.isOpenReg,
isDel:this.form.isDel, isDel: this.form.isDel,
isHomePage:this.form.isHomePage, isHomePage: this.form.isHomePage,
isHomePage:this.form.isHomePage, isHomePage: this.form.isHomePage,
crtUser:this.form.crtUser, crtUser: this.form.crtUser,
crtName:this.form.crtName, crtName: this.form.crtName,
crtTime:this.form.crtTime, crtTime: this.form.crtTime,
actDesc:this.form.actDesc, actDesc: this.form.actDesc,
willNum:this.form.willNum, willNum: this.form.willNum,
location:this.form.location, location: this.form.location,
rank:this.form.rank, rank: this.form.rank,
type:this.form.type, type: this.form.type,
content: this.form.content,//营地详情 content: this.form.content,//营地详情
}; };
this.isExistCampsiteShop("update", params); this.isExistCampsiteShop("update", params);
...@@ -447,7 +492,7 @@ create(formName){ ...@@ -447,7 +492,7 @@ create(formName){
/** /**
* 更新 * 更新
* */ * */
toUpdate(params){ toUpdate(params) {
console.log("............修改") console.log("............修改")
editActivity(params).then(response => { editActivity(params).then(response => {
if (response.status === 200) { if (response.status === 200) {
...@@ -471,7 +516,7 @@ create(formName){ ...@@ -471,7 +516,7 @@ create(formName){
/** /**
* 创建 * 创建
* */ * */
toCreate(params){ toCreate(params) {
editActivity(params).then(response => { editActivity(params).then(response => {
if (response.status === 200) { if (response.status === 200) {
this.$notify({ this.$notify({
...@@ -494,9 +539,9 @@ create(formName){ ...@@ -494,9 +539,9 @@ create(formName){
/** /**
* 关闭营地地址弹框 * 关闭营地地址弹框
* */ * */
campsiteEvent(obj){ campsiteEvent(obj) {
this.showCampsiteVisible = false; this.showCampsiteVisible = false;
if(obj){ if (obj) {
this.campsiteObj = obj; this.campsiteObj = obj;
console.log(obj) console.log(obj)
let provinceObj = getRegionByCodes([obj.province]); let provinceObj = getRegionByCodes([obj.province]);
...@@ -513,18 +558,18 @@ create(formName){ ...@@ -513,18 +558,18 @@ create(formName){
/** /**
* 编辑营地地址 * 编辑营地地址
* */ * */
selectDestination(){ selectDestination() {
let that = this; let that = this;
console.log(this.campsiteObj) console.log(this.campsiteObj)
this.campsiteObj.showTitle = "活动地址编辑"; this.campsiteObj.showTitle = "活动地址编辑";
this.campsiteObj.eventName ='campsiteEvent'; this.campsiteObj.eventName = 'campsiteEvent';
this.campsiteObj.keyword = this.campsiteObj.address; this.campsiteObj.keyword = this.campsiteObj.address;
this.showCampsiteVisible = true; this.showCampsiteVisible = true;
}, },
/** /**
* 获取一条营地 * 获取一条营地
* */ * */
getOne(id){ getOne(id) {
let that = this; let that = this;
getOneActivityShop(id).then(response => { getOneActivityShop(id).then(response => {
this.form = response.data; this.form = response.data;
...@@ -536,8 +581,8 @@ create(formName){ ...@@ -536,8 +581,8 @@ create(formName){
cityName: response.data.city, cityName: response.data.city,
latitude: response.data.latitude, latitude: response.data.latitude,
longitude: response.data.longitude, longitude: response.data.longitude,
townCode:response.data.townCode, townCode: response.data.townCode,
town:response.data.town town: response.data.town
}; };
response.data.addressStr = this.campsiteObj.provinceName + this.campsiteObj.cityName + this.campsiteObj.town + this.campsiteObj.address; response.data.addressStr = this.campsiteObj.provinceName + this.campsiteObj.cityName + this.campsiteObj.town + this.campsiteObj.address;
}) })
...@@ -552,18 +597,18 @@ create(formName){ ...@@ -552,18 +597,18 @@ create(formName){
/** /**
* 配套&收费 富文本 * 配套&收费 富文本
* */ * */
handelIntroduceIncrease(step){ handelIntroduceIncrease(step) {
this.form.configure = step; this.form.configure = step;
}, },
/** /**
* 富文本 营地详情 * 富文本 营地详情
* */ * */
editorReadyEvent(instance){ editorReadyEvent(instance) {
let t = this; let t = this;
instance.addListener('contentChange', () => { instance.addListener('contentChange', () => {
if(t.activeName2 == "first"){ if (t.activeName2 == "first") {
t.form.content = instance.getContent(); t.form.content = instance.getContent();
} else if(t.activeName2 == "second"){ } else if (t.activeName2 == "second") {
t.form.actDesc = instance.getContent(); t.form.actDesc = instance.getContent();
} }
}); });
...@@ -571,7 +616,7 @@ create(formName){ ...@@ -571,7 +616,7 @@ create(formName){
/** /**
* 封面图上传 * 封面图上传
* **/ * **/
handleAvatarSuccess(res, file){ handleAvatarSuccess(res, file) {
console.log(res.data) console.log(res.data)
this.form.banner = res.data; this.form.banner = res.data;
}, },
...@@ -580,11 +625,14 @@ create(formName){ ...@@ -580,11 +625,14 @@ create(formName){
* 清空旅游弹框数据 * 清空旅游弹框数据
*/ */
cleanForm() { cleanForm() {
this.campsiteObj ={name: ""};//营地地址 this.campsiteObj = {name: ""};//营地地址
this.fileList2=[]; this.fileList2 = [];
this.activeName2= '';//营地详情 this.activeName2 = '';//营地详情
this.form = { this.form = {
alt:undefined, alt: undefined,
imgTitle:undefined,
imgKeyword:undefined,
imgDesc:undefined,
id: undefined, id: undefined,
title: undefined,//营地名称 title: undefined,//营地名称
subtitle: undefined,//营地热度 subtitle: undefined,//营地热度
...@@ -595,36 +643,36 @@ create(formName){ ...@@ -595,36 +643,36 @@ create(formName){
province: undefined,//市编号 province: undefined,//市编号
cityName: undefined,//市名称 cityName: undefined,//市名称
cityCode: undefined,//详细地址 cityCode: undefined,//详细地址
city:undefined, city: undefined,
townCode:undefined, townCode: undefined,
town:undefined, town: undefined,
address:undefined, address: undefined,
latitude: undefined, latitude: undefined,
longitude: undefined, longitude: undefined,
limitNum:0, limitNum: 0,
isShow:0, isShow: 0,
isOpenReg:0, isOpenReg: 0,
isDel:0, isDel: 0,
banner:undefined, banner: undefined,
isPublish:0, isPublish: 0,
isHomePage:0, isHomePage: 0,
crtUser:undefined, crtUser: undefined,
crtName:undefined, crtName: undefined,
crtTime:undefined, crtTime: undefined,
actDesc:undefined, actDesc: undefined,
willNum:undefined, willNum: undefined,
location:0, location: 0,
rank:undefined, rank: undefined,
type:undefined, type: undefined,
content: '',//营地详情 content: '',//营地详情
concat: "",//联系人 concat: "",//联系人
logo:undefined,//封面图 logo: undefined,//封面图
configure: '',//配套&收费 configure: '',//配套&收费
campsiteTagListVos: [],//营地类型 campsiteTagListVos: [],//营地类型
carouse:[],//banner轮播 carouse: [],//banner轮播
posterBackground:'',//海报背景 posterBackground: '',//海报背景
}; };
this.showCampsiteVisible= false;//编辑营地地址 this.showCampsiteVisible = false;//编辑营地地址
} }
} }
} }
......
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