forked from xxhjsb/hbt-prevention-ui
fixed:修复弹窗未查询所需单元的问题
parent
444a52ef1a
commit
102c74e579
|
@ -346,17 +346,22 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
// 加载单元列表
|
||||
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<void>((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<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(","),
|
||||
|
|
Loading…
Reference in New Issue