From 64a6a81753abfc712b1ab384de0f7afb87f4fb23 Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期四, 18 七月 2024 17:02:52 +0800 Subject: [PATCH] 提交 --- admin/src/components/business/OperaShopWindow.vue | 27 ++++++++++++++++++--------- 1 files changed, 18 insertions(+), 9 deletions(-) diff --git a/admin/src/components/business/OperaShopWindow.vue b/admin/src/components/business/OperaShopWindow.vue index aacc499..547c708 100644 --- a/admin/src/components/business/OperaShopWindow.vue +++ b/admin/src/components/business/OperaShopWindow.vue @@ -167,9 +167,12 @@ .then(res => { this.provinces = res }) + if(this.form.provinceCode){ + this.selectProvince(this.form.provinceCode,true) + } }, // 閫夋嫨鐪佷唤 - selectProvince (val) { + selectProvince (val,isInit) { this.provinces.forEach(item => { if (item.id == val) { this.form.provinceName = item.name @@ -177,29 +180,35 @@ }) this.cities = [] this.areas = [] - this.form.cityName = '' - this.form.areaCode = '' - this.form.cityCode = '' - this.form.areaName = '' + if(!isInit){ + this.form.cityName = '' + this.form.areaCode = '' + this.form.cityCode = '' + this.form.areaName = '' + } if(!val || val ==''){ return } this.api.areaList({ pid: val }) .then(res => { this.cities = res - this.selectCity(this.form.cityId) + if(isInit){ + this.selectCity(this.form.cityCode,isInit) + } }) }, // 閫夋嫨鍩庡競 - selectCity (val) { + selectCity (val,isInit) { this.cities.forEach(item => { if (item.id == val) { this.form.cityName = item.name } }) this.areas = [] - this.form.areaCode = '' - this.form.areaName = '' + if(!isInit){ + this.form.areaCode = '' + this.form.areaName = '' + } if(!val || val ==''){ return } -- Gitblit v1.9.3