This commit is contained in:
Taric Xin
2022-03-25 17:44:53 +08:00
parent c00d41c25e
commit 07638e9ee2
7 changed files with 56 additions and 15 deletions

View File

@ -23,6 +23,9 @@ export class ShipperBaseService extends BaseService {
$api_get_rebate_config = `/api/mdc/rebateConfig/list/listRebateConfig`;
// 获取渠道销售管理集合
$api_get_channel = `/api/mdc/channelSalesManagement/list/listChannelSalesManagement`;
// 获取货主企业列表
public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList';
constructor(public injector: Injector) {
super(injector);
}
@ -166,6 +169,33 @@ export class ShipperBaseService extends BaseService {
);
}
/**
* 获取货主企业列表
* @returns
*/
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();;
} else {
return of([]);
}
}
/**
* 获取结算客户
* @returns