Commit b47c16e1 authored by 罗超's avatar 罗超

地区管理优化

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