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(","),