Commit 4c619660 authored by zhengke's avatar zhengke

修改

parent 3ebcfff5
......@@ -251,12 +251,28 @@
</el-input>
</span>
</li>
<li>
<span>
<em>{{$t('system.quety_area')}}</em>
<el-select v-model="msg.CountryId" clearable class="w150" filterable
@change="getProvinceList(msg.CountryId,1)" :placeholder="$t('hotel.hotel_country')">
<el-option v-for="item in countryList" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
</el-select>
<el-select v-model="msg.ProviceId" class="w150" filterable @change="getProvinceList(msg.ProviceId,2)"
:placeholder="$t('hotel.hotel_province')">
<el-option v-for="item in provinceList" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
</el-select>
<el-select v-model="msg.CityId" class="w150" filterable
:placeholder="$t('hotel.hotel_city')">
<el-option v-for="item in cityList" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
</el-select>
</span>
</li>
<li>
<button class="hollowFixedBtn" type="button"
@click="resetPageIndex(),getList()">{{$t('pub.searchBtn')}}</button>
<button class="normalBtn" type="button"
@click="outerVisible=true,initMsg()">{{$t('pub.addBtn')}}</button>
</li>
</ul>
</div>
......@@ -269,6 +285,15 @@
<th width="150">
名称
</th>
<th>
国家名称
</th>
<th>
省份名称
</th>
<th>
城市名称
</th>
<th width="150">
封面
</th>
......@@ -289,6 +314,15 @@
<td>
{{item.Name}}
</td>
<td>
{{item.CountryName}}
</td>
<td>
{{item.ProviceName}}
</td>
<td>
{{item.CityName}}
</td>
<td>
<img :src="item.ImgCover" style="width:50px;height:30px"/>
</td>
......@@ -309,7 +343,7 @@
</td>
</tr>
<tr v-if="!(DataList && DataList.length>0)">
<td colspan="6">
<td colspan="9">
暂无数据...
</td>
</tr>
......@@ -340,6 +374,25 @@
</div>
</div>
</el-form-item>
<el-form-item label="国家">
<el-select v-model="addMsg.CountryId" clearable class="w217" filterable
@change="getProvinceListTwo(addMsg.CountryId,1)" :placeholder="$t('hotel.hotel_country')">
<el-option v-for="item in countryList" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
</el-select>
</el-form-item>
<el-form-item label="省">
<el-select v-model="addMsg.ProviceId" class="w217" filterable @change="getProvinceListTwo(addMsg.ProviceId,2)"
:placeholder="$t('hotel.hotel_province')">
<el-option v-for="item in provinceList2" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
</el-select>
</el-form-item>
<el-form-item label="市">
<el-select v-model="addMsg.CityId" class="w217" filterable
:placeholder="$t('hotel.hotel_city')">
<el-option v-for="item in cityList2" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
</el-select>
</el-form-item>
<el-form-item label="攻略内容" prop="lotteryRules">
<quill-editor class="w595" :options="editorOption" v-model="addMsg.Content"></quill-editor>
</el-form-item>
......@@ -360,21 +413,24 @@
export default {
data() {
return {
countryList: "",
provinceList: "",
cityList: "",
DataList: "",
noData: false,
loading: true,
outerVisible: false,
defaultImg: 'this.src="' + require("../../assets/img/bg_z1@2x.png") + '"',
countryList: [],
provinceList: [],
cityList: [],
provinceList2:[],
cityList2: [],
msg: {
pageIndex: 1,
pageSize: 14,
Name: "",
QCountry: 0,
QProvince: 0,
QCity: 0,
CountryId: 651,
ProviceId: '',
CityId: '',
total: 0,
currentPage: 1,
Id: 0
......@@ -383,7 +439,10 @@
Id: 0,
Name: '',
ImgCover: '',
Content: ''
Content: '',
CountryId:0,
ProviceId:0,
CityId:0
},
editorOption: {
modules: {
......@@ -548,9 +607,73 @@
null
);
},
//获取国家
getCountryList() {
this.apipost(
"dict_post_Destination_GetCountry", {},
res => {
this.countryList = res.data.data;
},
err => {}
);
},
getProvinceList(ID, type) {
//根据省份获取城市
let msg = {
Id: ID
};
if (type == 1) {
this.msg.ProviceId = "";
this.msg.CityId = "";
} else if (type == 2) {
this.msg.CityId = "";
}
if (this.msg.CountryId !== "") {
this.apipost(
"dict_post_Destination_GetChildList",
msg,
res => {
if (type == 1) {
this.provinceList = res.data.data;
} else if (type == 2) {
this.cityList = res.data.data;
}
},
err => {}
);
}
},
getProvinceListTwo(ID, type){
//根据省份获取城市
let msg = {
Id: ID
};
if (type == 1) {
this.addMsg.ProviceId = "";
this.addMsg.CityId = "";
} else if (type == 2) {
this.addMsg.CityId = "";
}
if (this.addMsg.CountryId !== "") {
this.apipost(
"dict_post_Destination_GetChildList",
msg,
res => {
if (type == 1) {
this.provinceList2 = res.data.data;
} else if (type == 2) {
this.cityList2 = res.data.data;
console.log(this.cityList2,'this.cityList2');
}
},
err => {}
);
}
}
},
mounted() {
//this.getCountryList();
this.getCountryList();
this.getProvinceList(651,1);
},
created() {
if (this.$route.query.hasOwnProperty("cache")) {
......
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