Commit b47c16e1 authored by 罗超's avatar 罗超

地区管理优化

parent cc89c85b
......@@ -76,6 +76,17 @@
</el-table-column>
<el-table-column prop="ParentName" label="上级名称" header-align="center" align="center">
</el-table-column>
<el-table-column prop="ParentName" label="目的地" header-align="center" align="center">
<template slot-scope="scope">
<span>{{ getAreaShow(scope) }}</span>
</template>
</el-table-column>
<el-table-column prop="ParentName" label="封面图" header-align="center" align="center">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.date }}</span>
</template>
</el-table-column>
<el-table-column label="操作" header-align="center" align="center">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="$t('system.table_edit')" placement="top-start">
......@@ -250,9 +261,11 @@ import uploadImg from '../../pubComponents/uploadImg'
this.financeinfo_post_GetList()
},
methods: {
getAreaShow(scope) {
return scope.row.DestinationList ? scope.row.DestinationList.map(item => item.Name).join(',') : ''
},
areaLevelChange() {
const level = this.addMsg.Level;
this.level = level
if(level === 1) {
this.showAddArea = false
this.addMsg.DestinationList = []
......@@ -323,10 +336,19 @@ import uploadImg from '../../pubComponents/uploadImg'
res => {
if (res.data.resultCode == 1) {
var tempData = res.data.data;
this.addMsg.Id = tempData.Id;
this.addMsg.Level = tempData.Level;
this.addMsg.ParentId = tempData.ParentId;
this.addMsg.AreaName = tempData.AreaName;
this.addMsg = tempData;
// this.addMsg.Id = tempData.Id;
// this.addMsg.Level = tempData.Level;
// this.addMsg.ParentId = tempData.ParentId;
// this.addMsg.AreaName = tempData.AreaName;
if(!this.addMsg.BestTravelTimeList || !this.addMsg.BestTravelTimeList.length) {
this.addMsg.BestTravelTimeList = [{
Month: '',
Description: ''
}]
}
this.areaLevelChange()
this.$refs.uploadImg.ImageList = tempData.ImageList || []
} else {
this.Error(res.data.message);
}
......@@ -356,10 +378,18 @@ import uploadImg from '../../pubComponents/uploadImg'
},
//清空数据
clearMsg() {
this.addMsg.Id = 0;
this.addMsg.Level = 0;
this.addMsg.ParentId = 0;
this.addMsg.AreaName = "";
this.addMsg = {
Id: 0, //编号
Level: 0, //等级
ParentId: 0, //父节点编号
AreaName: '', //名称
BestTravelTimeList: [{
Month: '',
Description: ''
}],
DestinationList: [],
}
this.$refs.uploadImg.ImageList = []
},
//新增、修改广告
submitForm(formName) {
......@@ -371,7 +401,7 @@ import uploadImg from '../../pubComponents/uploadImg'
this.$message.error('请上传图片!');
return
}
if(this.level !== 1 && !this.addMsg.DestinationList.length) {
if(this.addMsg.Level !== 1 && !this.addMsg.DestinationList.length) {
this.$message.error('请添加目的地!');
return
}
......@@ -412,7 +442,7 @@ import uploadImg from '../../pubComponents/uploadImg'
this.areaVisible = true
} else {
this.addMsg.DestinationList.splice(index, 1)
if(this.level === 2 && this.addMsg.DestinationList.length < 1) {
if(this.addMsg.Level === 2 && this.addMsg.DestinationList.length < 1) {
this.showAddArea = true
}
}
......
......@@ -17,9 +17,7 @@
</div>
</div>
</div>
</div>
<div class="add-img">
<div class="reimg-add">
<div><div class="reimg-add">
<i class="iconfont icon-img_haha bigAdd"></i>
<div class="ad-one">
<div class="re-upload">
......@@ -31,7 +29,7 @@
<!-- 选择系统图片 -->
<!-- <div class="re-find" @click="addImgOpen"><i class="iconfont icon-img_cz"></i></div> -->
</div>
</div>
</div></div>
</div>
</div>
<!-- <el-upload class="upload-demo" :http-request="UploadImage" :multiple="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