16 lines
503 B
TypeScript
16 lines
503 B
TypeScript
/**
|
||
* 在线处方诊所名追加「(互)」:is_online 为 1/2/3(问诊/复诊等),线下 0 不加
|
||
*/
|
||
export function formatStoreNameWithHu(
|
||
storeName: string | null | undefined,
|
||
isOnline: number | string | null | undefined,
|
||
): string {
|
||
const name = String(storeName ?? '').trim();
|
||
if (!name) return '';
|
||
const online = Number(isOnline);
|
||
if (online === 1 || online === 2 || online === 3) {
|
||
return name.endsWith('(互)') ? name : `${name}(互)`;
|
||
}
|
||
return name;
|
||
}
|