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,17 +346,22 @@ export default class PlanComponent extends BaseRecordComponent<any> {
} }
// //
public loadUnitData(ids?) { public loadUnitData(ids?) {
this.unitService.getListByIds({ areaIds: ids }, false).then((res: any) => { return new Promise<void>((resove, reject) => {
this.unitList = res.data.map(item => { this.unitService.getListByIds({ areaIds: ids }, false).then((res: any) => {
this.unitMap[item.id] = item.name; this.unitList = res.data.map(item => {
return { this.unitMap[item.id] = item.name;
name: item.name, return {
value: item.id name: item.name,
value: item.id
}
});
const option = this.updateOptions.find(item => item.key === "unitIds") as any;
if (option) {
option.datas = this.unitList;
} }
}); resove()
const option = this.updateOptions.find(item => item.key === "unitIds") as any; // this.buildUpdateForm()
option.datas = this.unitList; })
// 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.updateActions[2].hide = false;
this.isReadonly = !!isRead; this.isReadonly = !!isRead;
if (row) { if (row) {
await this.loadUnitData(row.areaIds)
this.updateParams = Object.assign({ this.updateParams = Object.assign({
planTypeName: this.planTypeMap[row.planType], planTypeName: this.planTypeMap[row.planType],
areaNames: row.areaIds.map(item => this.areaMap[item]).join(","), areaNames: row.areaIds.map(item => this.areaMap[item]).join(","),