|
|
@@ -298,26 +298,34 @@ export default { |
|
|
|
}, |
|
|
|
/* 选择省市区 */ |
|
|
|
selectArea(value, type, name){ |
|
|
|
this.getListBycode(value, type, name) |
|
|
|
if (type === 'province') { |
|
|
|
this.cityList = [] |
|
|
|
this.districtList = [] |
|
|
|
this.form.cityCode = null |
|
|
|
this.form.cityName = null |
|
|
|
this.form.districtCode = null |
|
|
|
this.form.districtName = null |
|
|
|
} |
|
|
|
if (type === 'city') { |
|
|
|
this.districtList = [] |
|
|
|
this.form.districtCode = null |
|
|
|
this.form.districtName = null |
|
|
|
} |
|
|
|
this.getListBycode(value, type, name) |
|
|
|
}, |
|
|
|
/* 根据选择的选中的code返回子项列表 */ |
|
|
|
getListBycode(code, name, childrenName) { |
|
|
|
this[name + 'List'].forEach((item) => { |
|
|
|
if (item.citycode == code) { |
|
|
|
this[childrenName + 'List'] = item.itemList |
|
|
|
this.form[name+'Name'] = item.name |
|
|
|
} |
|
|
|
}) |
|
|
|
if(code) { |
|
|
|
this[name + 'List'].forEach((item) => { |
|
|
|
if (item.citycode == code) { |
|
|
|
this[childrenName + 'List'] = item.itemList |
|
|
|
this.form[name+'Name'] = item.name |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this[childrenName + 'List'] = [] |
|
|
|
this.form[name+'Name'] = null |
|
|
|
} |
|
|
|
}, |
|
|
|
/* 保存编辑 */ |
|
|
|
save() { |