diff --git a/src/app/routes/financial-management/components/cost-management/cost-management.component.ts b/src/app/routes/financial-management/components/cost-management/cost-management.component.ts index 6a1c6ebf..756639a0 100644 --- a/src/app/routes/financial-management/components/cost-management/cost-management.component.ts +++ b/src/app/routes/financial-management/components/cost-management/cost-management.component.ts @@ -1,8 +1,10 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st'; -import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { SFComponent, SFSchema, SFDateWidgetSchema, SFSelectWidgetSchema, SFSchemaEnum } from '@delon/form'; import { NzModalService } from 'ng-zorro-antd/modal'; +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; import { FreightAccountService } from '../../services/freight-account.service'; @Component({ @@ -179,26 +181,50 @@ export class CostManagementComponent implements OnInit { hrto: { type: 'string', title: '应付对象', - enum: [{ label: '全部', value: '全部' }], ui: { widget: 'select', - placeholder: '请选择', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => { + if (!!q) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, visibleIf: { expand: (value: boolean) => value } - } + } as SFSelectWidgetSchema }, arto: { type: 'string', title: '应收对象', - enum: [{ label: '全部', value: '全部' }], ui: { widget: 'select', - placeholder: '请选择', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, + onSearch: (q: any) => { + if (!!q) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: q }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, visibleIf: { expand: (value: boolean) => value } - } + } as SFSelectWidgetSchema }, createTime: { title: '创建时间', diff --git a/src/app/routes/financial-management/services/freight-account.service.ts b/src/app/routes/financial-management/services/freight-account.service.ts index d473206f..a62327d7 100644 --- a/src/app/routes/financial-management/services/freight-account.service.ts +++ b/src/app/routes/financial-management/services/freight-account.service.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-01-18 15:57:44 * @LastEditors : Shiming - * @LastEditTime : 2022-01-18 19:05:23 + * @LastEditTime : 2022-01-26 16:53:11 * @FilePath : \\tms-obc-web\\src\\app\\routes\\financial-management\\services\\freight-account.service.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -118,7 +118,8 @@ export class FreightAccountService extends ShipperBaseService { }); } } - + // 获取货主企业列表 + public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; reviewPDF(url: string) { if (!url) { return;