|
@@ -94,6 +94,7 @@
|
|
|
placeholder="选择区"
|
|
|
clearable
|
|
|
size="small"
|
|
|
+ @change="getAreaName()"
|
|
|
style="width: 100%;margin-right: 1px;">
|
|
|
<el-option
|
|
|
v-for="item in areaList"
|
|
@@ -147,11 +148,6 @@ export default {
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
detail: {},
|
|
|
- feeItems: [],
|
|
|
- checkedItems: [],
|
|
|
- custOptions: [],
|
|
|
- storeOptions: [],
|
|
|
- typeOptions: [],
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
name: [
|
|
@@ -234,26 +230,66 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ getProvinceName(){
|
|
|
+ let val = this.form.provinceId
|
|
|
+ if(val){
|
|
|
+ let nameObj = this.provinceList.find(item => {
|
|
|
+ return item.areaId == val;
|
|
|
+ })
|
|
|
+ return nameObj && nameObj.areaName
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
getCityList(){
|
|
|
this.cityList = []
|
|
|
this.areaList = []
|
|
|
this.form.cityId = ""
|
|
|
+ this.form.city = ""
|
|
|
this.form.areaId = ""
|
|
|
+ this.form.area = ""
|
|
|
var provinceId = this.form.provinceId
|
|
|
+ this.form.province = this.getProvinceName()
|
|
|
listAreaByPid(provinceId).then(response => {
|
|
|
console.log("getCityList"+JSON.stringify(response))
|
|
|
this.cityList = response || [];
|
|
|
});
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ getCityName(){
|
|
|
+ let val = this.form.cityId
|
|
|
+ if(val){
|
|
|
+ let nameObj = this.cityList.find(item => {
|
|
|
+ return item.areaId == val;
|
|
|
+ })
|
|
|
+ return nameObj && nameObj.areaName
|
|
|
+ }
|
|
|
+ return ""
|
|
|
},
|
|
|
|
|
|
getAreaList(){
|
|
|
var cityId = this.form.cityId
|
|
|
+ this.form.city = this.getCityName();
|
|
|
listAreaByPid(cityId).then(response => {
|
|
|
console.log("getAreaList"+JSON.stringify(response))
|
|
|
this.areaList = response || [];
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ getAreaName(){
|
|
|
+ let val = this.form.areaId
|
|
|
+ if(val){
|
|
|
+ let nameObj = this.areaList.find(item => {
|
|
|
+ return item.areaId == val;
|
|
|
+ })
|
|
|
+ this.form.area = nameObj && nameObj.areaName
|
|
|
+ }else{
|
|
|
+ this.form.area = "";
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
dataFilter(val) {
|
|
|
this.value = val;
|
|
|
if (val) { //val存在
|