This commit is contained in:
Taric Xin
2022-04-24 15:28:35 +08:00
parent d8e297a648
commit 77744a68b5
3 changed files with 46 additions and 5 deletions

View File

@ -172,9 +172,15 @@ export class InvoiceDetailComponent implements OnInit {
title: '所属项目', title: '所属项目',
ui: { ui: {
widget: 'select', widget: 'select',
placeholder: '请选择', serverSearch: true,
searchDebounceTime: 300,
searchLoadingText: '搜索中...',
allowClear: true, allowClear: true,
asyncData: () => this.service.getEnterpriseProject({ id: this.ltdId }) onSearch: (q: any) => this.service.getProjectList({ projectName: q, enterpriseId: this.headerInfo?.shipperId })
// widget: 'select',
// placeholder: '请选择',
// allowClear: true,
// asyncData: () => this.service.getEnterpriseProject({ id: this.ltdId })
}, },
default: '' default: ''
} }
@ -303,7 +309,7 @@ export class InvoiceDetailComponent implements OnInit {
width: 140, width: 140,
type: 'widget', type: 'widget',
className: 'text-right', className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatnotax }) } widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatnotax }) }
} }
]; ];
} }

View File

@ -284,10 +284,14 @@ export class InvoiceRequestedDetailComponent implements OnInit {
default: '', default: '',
ui: { ui: {
widget: 'select', widget: 'select',
serverSearch: true,
searchDebounceTime: 300,
searchLoadingText: '搜索中...',
allowClear: true,
onSearch: (q: any) => this.service.getProjectList({ projectName: q, enterpriseId: this.headerInfo?.shipperId }),
visibleIf: { visibleIf: {
expand: (value: boolean) => value expand: (value: boolean) => value
}, }
asyncData: () => this.service.getEnterpriseProject()
} }
} }
} }

View File

@ -26,6 +26,8 @@ export class ShipperBaseService extends BaseService {
// 获取货主企业列表 // 获取货主企业列表
public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList';
// 批量获取项目信息
public $api_get_project_list = '/api/mdc/cuc/enterpriseProject/getProjectList';
constructor(public injector: Injector) { constructor(public injector: Injector) {
super(injector); super(injector);
} }
@ -247,6 +249,35 @@ export class ShipperBaseService extends BaseService {
} }
} }
/**
* 批量获取项目信息
* @returns
*/
getProjectList(params = { projectName: '', enterpriseId: '' }, containerAll = false) {
let str = params.projectName.replace(/^\s+|\s+$/g, '');
if (str) {
return this.request(this.$api_get_project_list, params)
.pipe(
map((res: any) => {
if (!res) {
return [];
}
const list = res.map((item: any) => {
return { label: item.projectName, value: item.id };
});
const obj = [];
if (containerAll) {
obj.push({ label: '全部', value: '' });
}
return [...obj, ...list];
})
)
.toPromise();
} else {
return of([]);
}
}
/** /**
* 获取结算客户 * 获取结算客户
* @returns * @returns