From 102c74e57929b9ef97bca5554599784179716daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=BB=B6=E7=A6=8F?= <> Date: Fri, 8 Sep 2023 11:55:44 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=E4=BF=AE=E5=A4=8D=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=9C=AA=E6=9F=A5=E8=AF=A2=E6=89=80=E9=9C=80=E5=8D=95=E5=85=83?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hiddenDanger/safe/plan.component.vue | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/views/hiddenDanger/safe/plan.component.vue b/src/views/hiddenDanger/safe/plan.component.vue index 64bc938..be9ae04 100644 --- a/src/views/hiddenDanger/safe/plan.component.vue +++ b/src/views/hiddenDanger/safe/plan.component.vue @@ -346,17 +346,22 @@ export default class PlanComponent extends BaseRecordComponent { } // 加载单元列表 public loadUnitData(ids?) { - this.unitService.getListByIds({ areaIds: ids }, false).then((res: any) => { - this.unitList = res.data.map(item => { - this.unitMap[item.id] = item.name; - return { - name: item.name, - value: item.id + return new Promise((resove, reject) => { + this.unitService.getListByIds({ areaIds: ids }, false).then((res: any) => { + this.unitList = res.data.map(item => { + this.unitMap[item.id] = item.name; + return { + name: item.name, + value: item.id + } + }); + const option = this.updateOptions.find(item => item.key === "unitIds") as any; + if (option) { + option.datas = this.unitList; } - }); - const option = this.updateOptions.find(item => item.key === "unitIds") as any; - option.datas = this.unitList; - // this.buildUpdateForm() + resove() + // this.buildUpdateForm() + }) }) } @@ -537,10 +542,11 @@ export default class PlanComponent extends BaseRecordComponent { // 打开增改查弹窗 - public showUpdateModel(row?, isRead?) { + public async showUpdateModel(row?, isRead?) { this.updateActions[2].hide = false; this.isReadonly = !!isRead; if (row) { + await this.loadUnitData(row.areaIds) this.updateParams = Object.assign({ planTypeName: this.planTypeMap[row.planType], areaNames: row.areaIds.map(item => this.areaMap[item]).join(","),