From 2023fd2b751de1a88e77a333d2edc00d34922d2c Mon Sep 17 00:00:00 2001 From: wangshiming Date: Wed, 23 Mar 2022 19:22:24 +0800 Subject: [PATCH] fix bug --- .../components/bulk/bulk.component.ts | 2 +- .../receipts-audit.component.ts | 31 ++++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/app/routes/order-management/components/bulk/bulk.component.ts b/src/app/routes/order-management/components/bulk/bulk.component.ts index cb92206a..6f559e19 100644 --- a/src/app/routes/order-management/components/bulk/bulk.component.ts +++ b/src/app/routes/order-management/components/bulk/bulk.component.ts @@ -392,7 +392,7 @@ export class OrderManagementBulkComponent implements OnInit { }; this.uiView = { '*': { spanLabelFixed: 80, grid: { span: 12, gutter: 4 } } }; } - // 获取城市列表 + // 获取所属项目 getRegionCode(regionCode: any) { console.log(regionCode); return this.service diff --git a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts index bb688611..1f14ce54 100644 --- a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts +++ b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts @@ -143,6 +143,9 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { } else { return of([]); } + }, + change: (q: any) => { + this.getRegionCode(q); } } as SFSelectWidgetSchema }, @@ -152,13 +155,10 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { ui: { widget: 'select', placeholder: '请选择', - allowClear: true, - asyncData: () => this.service.getEnterpriseProject(), visibleIf: { _$expand: (value: boolean) => value - } - }, - default: '' + }, + } as SFSelectWidgetSchema }, loadingPlace: { type: 'string', @@ -498,4 +498,25 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { }) }); } + // 获取所属项目 + 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); + // } + }); + } }