23 lines
637 B
TypeScript
23 lines
637 B
TypeScript
import { createCrudApi } from '#/components/crud';
|
||
|
||
export const enterpriseApi = createCrudApi('enterprise');
|
||
|
||
/** 企业下拉;SearchSelect 会带 keyword 做模糊搜索 */
|
||
export async function searchEnterprise(params: {
|
||
keyword: string;
|
||
limit: number;
|
||
}) {
|
||
return (await enterpriseApi.option(params)) ?? [];
|
||
}
|
||
|
||
/** 结算方式字典,列表与表单共用 */
|
||
export const SETTLE_TYPES = [
|
||
{ label: '款到发货', value: 0 },
|
||
{ label: '月结', value: 1 },
|
||
{ label: '账期', value: 2 },
|
||
];
|
||
|
||
export function settleTypeText(value?: number) {
|
||
return SETTLE_TYPES.find((item) => item.value === value)?.label ?? '-';
|
||
}
|