fix bug
This commit is contained in:
@ -103,8 +103,22 @@ export class WaybillManagementVehicleComponent implements OnInit {
|
||||
return of([]);
|
||||
}
|
||||
},
|
||||
change: (q: any) => {
|
||||
this.getRegionCode(q);
|
||||
}
|
||||
} as SFSelectWidgetSchema,
|
||||
},
|
||||
enterpriseProjectId: {
|
||||
type: 'string',
|
||||
title: '所属项目',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value
|
||||
},
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
loadingPlace: {
|
||||
type: 'string',
|
||||
title: '装货地',
|
||||
@ -123,18 +137,7 @@ export class WaybillManagementVehicleComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
},
|
||||
enterpriseProjectId: {
|
||||
type: 'string',
|
||||
title: '所属项目',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value
|
||||
},
|
||||
allowClear: true,
|
||||
asyncData: () => this.shipperservice.getEnterpriseProject()
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
|
||||
driverName: {
|
||||
title: '承运司机',
|
||||
type: 'string',
|
||||
@ -235,6 +238,27 @@ export class WaybillManagementVehicleComponent implements OnInit {
|
||||
};
|
||||
this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } };
|
||||
}
|
||||
// 获取城市列表
|
||||
getRegionCode(regionCode: any) {
|
||||
console.log(regionCode);
|
||||
return this.service
|
||||
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||
.pipe(
|
||||
map(res =>
|
||||
res.map((item: any) => ({
|
||||
label: item.projectName,
|
||||
value: item.id
|
||||
}))
|
||||
)
|
||||
)
|
||||
.subscribe(res => {
|
||||
this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res;
|
||||
this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res);
|
||||
// if (this.enterpriseProjectIds) {
|
||||
// this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据列表
|
||||
|
||||
Reference in New Issue
Block a user