Commit db766895 authored by 罗超's avatar 罗超

地区设置优化功能开发

parent fa43d232
......@@ -7,7 +7,26 @@
color: #409eff;
text-decoration: underline
}
.addlist {
position: absolute;
right: 158px;
top: 6px;
cursor: pointer;
color: #E95252;
width: 30px;
height: 30px;
display: inline-block;
text-align: center;
line-height: 30px;
border-radius: 50%;
font-size: 22px;
}
.relative {
position: relative;
}
.flex {
display: flex;
}
</style>
<template>
<!--契约管理-->
......@@ -16,9 +35,22 @@
<ul>
<li>
<label>名称</label>
<el-input v-model="msg.Name" :placeholder="$t('system.ph_in')" @keyup.native.enter="getData" class="w210">
<el-input v-model="msg.CategoryName" :placeholder="$t('system.ph_in')" @keyup.native.enter="getData" class="w210">
</el-input>
</li>
<li>
<label>层级</label>
<el-select v-model="msg.Level" placeholder="请选择">
<el-option label="请选择" :value="0"></el-option>
<el-option label="洲" :value="1"></el-option>
<el-option label="国家" :value="2"></el-option>
<el-option label="地区/省市" :value="3"></el-option>
</el-select>
</li>
<li>
<label>启用状态</label>
<el-switch v-model="msg.Enable"></el-switch>
</li>
<li>
<input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')"
@click="resetPageIndex(),getData()" />
......@@ -52,7 +84,7 @@
</el-pagination>
</div>
<el-dialog title="地区设置" :visible.sync="outerVisible" center width="400px">
<el-dialog title="地区设置" :visible.sync="outerVisible" center width="1000px">
<el-form :model="addMsg" ref="addMsg" label-width="120px">
<el-row>
<el-col :span="24">
......@@ -76,6 +108,46 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="目的地信息">
<div class="relative">
<div>目的地信息</div>
<i class="el-icon-circle-plus addlist" @click="clickArea(0, 1)"></i>
</div>
<div class="relative" v-for="(item, index) in addMsg.areaList" :key="index">
<span>{{item.Name}}</span>
<i class="el-icon-delete addlist" @click="clickArea(index)"></i>
</div>
</el-form-item>
<el-form-item label="介绍">
<el-input v-model="addMsg.Introduction" />
</el-form-item>
<el-form-item label="时区">
<el-input v-model="addMsg.TimeZones" />
</el-form-item>
<el-form-item label="币种">
<el-select filterable v-model='addMsg.CurrencyId' placeholder="选择币种" class=" _border_b_1">
<el-option v-for='item in coinGetList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="电压">
<el-input v-model="addMsg.Voltage" />
</el-form-item>
<el-form-item label="最佳旅行时间">
<div class="relative" v-for="(item, index) in addMsg.BestTravelTimeList" :key="index">
<div class="flex"><span>月份说明</span><el-input style="width: 220px" v-model="item.Month" /></div>
<div class=flex><span>理由说明</span><el-input style="width: 620px" v-model="item.Description" /></div>
<i v-if="index == 0" class="el-icon-circle-plus addlist" @click="clickTime(index, 1)"></i>
<i v-else class="el-icon-delete addlist" @click="clickTime(index)"></i>
</div>
</el-form-item>
<el-form-item label="图片">
<!-- <el-input v-model="addMsg.ImageList" /> -->
<uploadImg ref="uploadImg"></uploadImg>
</el-form-item>
</el-col>
</el-row>
</el-form>
......@@ -84,13 +156,33 @@
<button class="hollowFixedBtn" @click="outerVisible = false">{{$t('pub.cancelBtn')}}</button>
</div>
</el-dialog>
<el-dialog title="选择目的地" :visible.sync="areaVisible" @close="addArea" center width="600px">
<area-select @change="changeSelectArea"></area-select>
</el-dialog>
</div>
</template>
<script>
import AreaSelect from '../../pubComponents/areaSelect'
import uploadImg from '../../pubComponents/uploadImg'
export default {
components: {
AreaSelect,
uploadImg
},
data() {
return {
//币种下拉
coinGetList:[],
areaVisible: false,
loading: false,
areaItem:{
ID: '',
Name: ''
},
timeItem: {
Month: '',
Description: ''
},
msg: {
Name: '', //名称
pageSize: 15,
......@@ -106,12 +198,18 @@
Level: 0, //等级
ParentId: 0, //父节点编号
AreaName: '', //名称
BestTravelTimeList: [{
Month: '',
Description: ''
}],
areaList: [],
},
AreaList: [], //地区列表
}
},
mounted() {
this.getData();
this.financeinfo_post_GetList()
},
methods: {
getAreaList() {
......@@ -209,6 +307,9 @@
},
//新增、修改广告
submitForm(addMsg) {
const imageList = this.$refs.uploadImg.ImageList
console.log('submitForm', this.addMsg, imageList)
this.addMsg.ImageList = imageList
this.apipost(
"ws_post_SetArea", this.addMsg,
res => {
......@@ -224,6 +325,39 @@
err => {}
);
},
//获取币种
financeinfo_post_GetList(){
this.apipost('financeinfo_post_GetList',{Name:''}, res => {
if(res.data.resultCode == 1) {
this.coinGetList = res.data.data;
}
}, err => {})
},
clickArea(index, type) {
if (type) {
this.areaVisible = true
} else {
this.addMsg.areaList.splice(index, 1)
}
},
clickTime(index, type) {
if (type) {
this.addMsg.BestTravelTimeList.push(JSON.parse(JSON.stringify(this.timeItem)))
} else {
this.addMsg.BestTravelTimeList.splice(index, 1)
}
},
addArea() {
if(this.areaInfo) {
this.addMsg.areaList.push(this.areaInfo)
}
console.log('addArea', this.areaInfo, this.addMsg)
this.areaInfo = null
},
changeSelectArea(area) {
console.log('changeSelectArea', area)
this.areaInfo = area
}
}
}
......
<template>
<div>
<el-select placeholder="国家" filterable v-model="addMsg.Country" class='multiple_input w100'
@change="GetSubAreaList(addMsg.Country, 1), addMsg.Province = '', addMsg.City = '', addMsg.District = ''">
<el-option v-for="childItem in CountryList" :key="childItem.ID" :label="childItem.Name"
:value="childItem.ID">
</el-option>
</el-select>
<el-select placeholder="省" filterable class='multiple_input w100' v-model="addMsg.Province"
@change="GetSubAreaList(addMsg.Province, 2), addMsg.City = '', addMsg.District = ''">
<el-option v-for="childItem in ProvinceList" :key="childItem.ID" :label="childItem.Name"
:value="childItem.ID">
</el-option>
</el-select>
<el-select placeholder="市" filterable @change="emitChange(addMsg.City, 3)"
class='multiple_input w100' v-model="addMsg.City">
<el-option v-for="childItem in CityList" :key="childItem.ID" :label="childItem.Name"
:value="childItem.ID">
</el-option>
</el-select>
</div>
</template>
<style scoped>
</style>
<script>
export default {
data() {
return {
addMsg: {},
CountryList: [],
ProvinceList: [],
CityList: [],
district: [],
}
},
mounted() {
this.GetCounrty();
},
methods: {
//获取国家
GetCounrty() {
this.apipost(
"dict_post_Destination_GetCountry", {},
res => {
this.CountryList = res.data.data;
},
err => { }
);
},
//获取省份和城市
GetSubAreaList(ID, type) {
let msg = {
Id: ID
};
if (this.addMsg.Country != 0) {
this.apipost(
"dict_post_Destination_GetChildList",
msg,
res => {
if (type == 1) {
this.ProvinceList = res.data.data;
this.CityList = [];
this.district = [];
} else if (type == 2) {
this.CityList = res.data.data;
this.district = [];
} else if (type == 3) {
this.district = res.data.data;
}
},
err => { }
);
}
this.emitChange(ID, type)
},
emitChange(ID, type) {
let info
if(type === 1) {
info = this.CountryList.find(item => item.ID === ID)
} else if(type === 2) {
info = this.ProvinceList.find(item => item.ID === ID)
} else {
info= this.CityList.find(item => item.ID === ID)
}
this.$emit('change', info)
}
}
}
</script>
\ No newline at end of file
This diff is collapsed.
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