添加接口

This commit is contained in:
xianyi
2026-01-26 09:56:16 +08:00
parent fccb014054
commit 70e42cf33b
3 changed files with 125 additions and 4 deletions

View File

@@ -63,6 +63,8 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
customer_name?: string | null;
phone?: string | null;
patient_id?: number | null;
scrm_account_id?: string | null;
scrm_account_name?: string | null;
} | null>(null);
// 支付相关状态
const [showQrcodeModal, setShowQrcodeModal] = useState(false);
@@ -105,10 +107,22 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
if (res.Status === 200) {
// 保存客户信息
if (res.Data?.customerInfo) {
const channelInfo = res.Data.listChannelDiscount?.[0];
const scrm_account_id =
res.Data.customerInfo.scrm_account_id ??
channelInfo?.channel_id ??
null;
const scrm_account_name =
res.Data.customerInfo.scrm_account_name ??
channelInfo?.channel_name ??
null;
setCustomerInfo({
patient_id: res.Data.customerInfo.patient_id,
customer_name: res.Data.customerInfo.customer_name,
phone: res.Data.customerInfo.phone,
scrm_account_id,
scrm_account_name,
});
// 设置挂账公司默认值
const companyName = res.Data.customerInfo.company_name;
@@ -197,7 +211,8 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
try {
const res = await searchPhysicalExamAddItem({
physical_exam_id: Number(client.id),
discount_ratio: discountRatio || 1,
scrm_account_id: customerInfo?.scrm_account_id || null,
scrm_account_name: customerInfo?.scrm_account_name || null,
item_name: debouncedAddonSearch.trim() || "",
});
if (res.Status === 200 && Array.isArray(res.Data)) {
@@ -234,7 +249,7 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
}
};
fetchList();
}, [debouncedAddonSearch, discountRatio]);
}, [debouncedAddonSearch, customerInfo?.scrm_account_id, customerInfo?.scrm_account_name, client.id]);
const allAddons = useMemo(() => addonList, [addonList]);