fixed:修复弹窗未查询所需单元的问题

dev
吴延福 2023-09-08 11:55:44 +08:00
parent 444a52ef1a
commit 102c74e579
1 changed files with 17 additions and 11 deletions

View File

@ -346,6 +346,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
}
//
public loadUnitData(ids?) {
return new Promise<void>((resove, reject) => {
this.unitService.getListByIds({ areaIds: ids }, false).then((res: any) => {
this.unitList = res.data.map(item => {
this.unitMap[item.id] = item.name;
@ -355,9 +356,13 @@ export default class PlanComponent extends BaseRecordComponent<any> {
}
});
const option = this.updateOptions.find(item => item.key === "unitIds") as any;
if (option) {
option.datas = this.unitList;
}
resove()
// this.buildUpdateForm()
})
})
}
@ -537,10 +542,11 @@ export default class PlanComponent extends BaseRecordComponent<any> {
//
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(","),