添加接口
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user