This commit is contained in:
Taric Xin
2022-02-16 15:31:37 +08:00
parent af9a1c4bf4
commit a42498eb2b
17 changed files with 197 additions and 113 deletions

View File

@ -12,6 +12,8 @@ export class ShipperBaseService extends BaseService {
$api_get_enterprise_project = `/api/mdc/cuc/enterpriseProject/getEnterpriseProjectList `; // 所属项目列表
$api_get_staff_list = `/api/mdc/cuc/userApp/getStaffList`; //查询企业项目员工列表(录单员)
$api_get_network_freight_forwarder_list = `/api/mdc/cuc/networkTransporter/findAll`; // 获取网络货运人
$api_get_settlement_customer_list = `/api/mdc/cuc/settlementCustomer/findAll`; // 查找所有结算客户信息(下拉)
$api_get_crm_customer_list = `/api/mdc/cuc/crmCustomer/findAll`; // 查找所有Crm客户信息(下拉)
$api_get_network_freight_forwarder_one = `/api/mdc/cuc/networkTransporter/get`; // 获取网络货运人
// 根据FullKey获取系统子配置(树)
$api_getSysConfigTreeByParentFullKey = `/api/mdc/pbc/sysConfig/getSysConfigTreeByParentFullKey`;
@ -26,20 +28,18 @@ export class ShipperBaseService extends BaseService {
* @returns
*/
getCarlessCarrier() {
const params = {
};
const params = {};
return this.request(this.$api_get_carless_carrier, params, 'POST').pipe(
map((res) => {
map(res => {
if (res) {
res.map((m: any) => {
return { label: m.platformName, value: m.operationId };
});
}
}),
})
);
}
/**
* 获取所属项目
* @returns
@ -50,99 +50,149 @@ export class ShipperBaseService extends BaseService {
if (!res) {
return [];
}
const list = res.map(((item: any) => {
const list = res.map((item: any) => {
return {
label: item.projectName,
value: item.enterpriseId
}
}))
};
});
const obj = [{ value: '', label: '全部' }];
return [...obj, ...list];
})
)
);
}
/**
* 获取录单员
* @returns
*/
getStaffList(params = {},containerAll = true) {
getStaffList(params = {}, containerAll = true) {
return this.request(this.$api_get_staff_list, params).pipe(
map((res: any) => {
if (!res) {
return [];
}
const list = res.map(((item: any) => {
const list = res.map((item: any) => {
return {
label: item.name,
value: item.appUserId
}
}))
};
});
const obj = [];
if (containerAll) {
obj.push({ label: '全部', value: '' })
obj.push({ label: '全部', value: '' });
}
return [...obj, ...list];
})
)
);
}
/**
/**
* 获取调度员
* @returns
*/
getStaffList2(params = {}) {
return this.request(this.$api_get_staff_list, params).pipe(
map((res: any) => {
if (!res) {
return [];
}
const list = res.map(((item: any) => {
return {
label: `${item.name}/${item.telephone}`,
value: item.appUserId
}
}))
return [...list];
})
)
}
getStaffList2(params = {}) {
return this.request(this.$api_get_staff_list, params).pipe(
map((res: any) => {
if (!res) {
return [];
}
const list = res.map((item: any) => {
return {
label: `${item.name}/${item.telephone}`,
value: item.appUserId
};
});
return [...list];
})
);
}
/**
* 获取网络货运人
* @returns
*/
* 获取网络货运人
* @returns
*/
getNetworkFreightForwarder(params = {}, containerAll = false) {
return this.request(this.$api_get_network_freight_forwarder_list, params).pipe(
map((res: any) => {
if (!res) {
return [];
}
const list = res.map(((item: any) => {
const list = res.map((item: any) => {
return {
label: item.enterpriseName,
value: item.id
}
}))
};
});
const obj = [];
if (containerAll) {
obj.push({ label: '全部', value: '' })
obj.push({ label: '全部', value: '' });
}
return [...obj, ...list];
})
)
);
}
/**
* 根据ID获取网络货运人
* @returns
*/
* 获取CRM客户
* @returns
*/
getCRM(params = {}, containerAll = false) {
return this.request(this.$api_get_crm_customer_list, params).pipe(
map((res: any) => {
if (!res) {
return [];
}
const list = res.map((item: any) => {
return {
label: item.customerName,
value: item.id
};
});
const obj = [];
if (containerAll) {
obj.push({ label: '全部', value: '' });
}
return [...obj, ...list];
})
);
}
/**
* 获取结算客户
* @returns
*/
getCloseAccount(params = {}, containerAll = false) {
return this.request(this.$api_get_settlement_customer_list, params).pipe(
map((res: any) => {
if (!res) {
return [];
}
const list = res.map((item: any) => {
return {
label: item.customerName,
value: item.id
};
});
const obj = [];
if (containerAll) {
obj.push({ label: '全部', value: '' });
}
return [...obj, ...list];
})
);
}
/**
* 根据ID获取网络货运人
* @returns
*/
getNetworkTransporterById(id: string) {
return this.request(this.$api_get_network_freight_forwarder_one, { id });
}
// 根据FullKey获取系统子配置(树)
loadConfigByKey(configFullKey:string ='') {
loadConfigByKey(configFullKey: string = '') {
return this.http.post(this.$api_getSysConfigTreeByParentFullKey, { configFullKey }).pipe(
map((m: any) => {
if (m.success === true) {
@ -151,7 +201,7 @@ export class ShipperBaseService extends BaseService {
this.msgSrv.warning(m.msg);
return [];
}
}),
})
);
}
}