edit
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form';
|
||||
import { SFComponent, SFSchema, SFDateWidgetSchema, SFAutoCompleteWidgetSchema, SFSelectWidgetSchema } from '@delon/form';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { of } from 'rxjs';
|
||||
import { AddCollectionInvoiceModalComponent } from 'src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component';
|
||||
|
||||
import { PartnerListService } from '../../services/partner-list.service';
|
||||
@ -241,11 +242,22 @@ export class PartnerListComponent {
|
||||
type: 'string',
|
||||
title: '渠道销售',
|
||||
ui: {
|
||||
placeholder: '请输入姓名或者手机号',
|
||||
widget: 'select',
|
||||
searchDebounceTime: 300,
|
||||
searchLoadingText: '搜索中...',
|
||||
allowClear: true,
|
||||
visibleIf: {
|
||||
expand: (value: boolean) => value
|
||||
},
|
||||
onSearch: (q: any) => {
|
||||
let str = q.replace(/^\s+|\s+$/g, '');
|
||||
if (str) {
|
||||
return this.service.getChannel({ enterpriseName: str }).toPromise();
|
||||
} else {
|
||||
return of([]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
partnerType: {
|
||||
type: 'string',
|
||||
|
||||
@ -176,21 +176,23 @@ export class ShipperBaseService extends BaseService {
|
||||
getEnterpriceList(params = { enterpriseName: '' }, containerAll = false) {
|
||||
let str = params.enterpriseName.replace(/^\s+|\s+$/g, '');
|
||||
if (str) {
|
||||
return this.request(this.$api_enterpriceList, params).pipe(
|
||||
map((res: any) => {
|
||||
if (!res) {
|
||||
return [];
|
||||
}
|
||||
const list = res.map((item: any) => {
|
||||
return { label: item.enterpriseName, value: item.id };
|
||||
});
|
||||
const obj = [];
|
||||
if (containerAll) {
|
||||
obj.push({ label: '全部', value: '' });
|
||||
}
|
||||
return [...obj, ...list];
|
||||
})
|
||||
).toPromise();;
|
||||
return this.request(this.$api_enterpriceList, params)
|
||||
.pipe(
|
||||
map((res: any) => {
|
||||
if (!res) {
|
||||
return [];
|
||||
}
|
||||
const list = res.map((item: any) => {
|
||||
return { label: item.enterpriseName, value: item.id };
|
||||
});
|
||||
const obj = [];
|
||||
if (containerAll) {
|
||||
obj.push({ label: '全部', value: '' });
|
||||
}
|
||||
return [...obj, ...list];
|
||||
})
|
||||
)
|
||||
.toPromise();
|
||||
} else {
|
||||
return of([]);
|
||||
}
|
||||
@ -291,14 +293,15 @@ export class ShipperBaseService extends BaseService {
|
||||
* 获取渠道销售管理集合
|
||||
* @returns
|
||||
*/
|
||||
getChannel() {
|
||||
const params = {};
|
||||
getChannel(params = {}, containerAll = false) {
|
||||
return this.request(this.$api_get_channel, params, 'POST').pipe(
|
||||
map(res => {
|
||||
if (res) {
|
||||
return res.map((m: any) => {
|
||||
return { label: `${m.employeeVO?.empName}/${m.employeeVO?.mobile}`, value: m.id };
|
||||
});
|
||||
const obj = [];
|
||||
if (containerAll) {
|
||||
obj.push({ label: '全部', value: '' });
|
||||
}
|
||||
return [...obj, ...res.map((m: any) => ({ label: `${m.employeeVO?.empName}/${m.employeeVO?.mobile}`, value: m.id }))];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user