This commit is contained in:
wangshiming
2022-02-22 10:59:05 +08:00
parent 7df2419c7e
commit 29da0fbb41

View File

@ -134,6 +134,9 @@ export class WaybillManagementAbnormalAppearComponent implements OnInit {
return of([]); return of([]);
} }
}, },
change: (q: any) => {
this.getRegionCode(q);
},
visibleIf: { visibleIf: {
_$expand: (value: boolean) => value, _$expand: (value: boolean) => value,
}, },
@ -144,13 +147,11 @@ export class WaybillManagementAbnormalAppearComponent implements OnInit {
title: '所属项目', title: '所属项目',
ui: { ui: {
widget: 'select', widget: 'select',
allowClear: true, placeholder: '请选择',
visibleIf: { visibleIf: {
_$expand: (value: boolean) => value, _$expand: (value: boolean) => value
}, },
asyncData: () => } as SFSelectWidgetSchema
this.shipperSrv.getEnterpriseProject()
} as SFSelectWidgetSchema,
}, },
driverName: { driverName: {
title: '承运司机', title: '承运司机',
@ -214,4 +215,25 @@ export class WaybillManagementAbnormalAppearComponent implements OnInit {
resetSF() { resetSF() {
this.sf.reset(); this.sf.reset();
} }
// 获取城市列表
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);
// }
});
}
} }