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?) {
|
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(","),
|
||||||
|
|
Loading…
Reference in New Issue