1. 推广员功能增强
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled

This commit is contained in:
李琦
2026-06-04 16:05:02 +08:00
parent ee25ed00fb
commit b40c7402aa
62 changed files with 4373 additions and 467 deletions

View File

@@ -0,0 +1,60 @@
/**
* 中药处方毛利率计算(仅商品计费,不含诊疗费/加工费)
*/
export function isSeeRateEnabled(seeRate: unknown): boolean {
return Number(seeRate) === 1;
}
function isValidBuyPrice(value: unknown): boolean {
if (value === null || value === undefined || value === '') {
return false;
}
const n = Number(value);
return !Number.isNaN(n);
}
export function calcItemMarginPercent(
price: number | string | undefined,
buyPrice: number | string | undefined,
): string {
const p = Number(price);
if (!p || p <= 0 || !isValidBuyPrice(buyPrice)) {
return '--';
}
const b = Number(buyPrice);
return (((p - b) / p) * 100).toFixed(2);
}
export interface ChineseDrugMarginRow {
price?: number | string;