From 70e42cf33b3a0934ef4c0c1ffd578b028610e642 Mon Sep 17 00:00:00 2001 From: xianyi Date: Mon, 26 Jan 2026 09:56:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/his.ts | 28 +++++++++ src/api/types.ts | 82 +++++++++++++++++++++++++- src/components/exam/ExamAddonPanel.tsx | 19 +++++- 3 files changed, 125 insertions(+), 4 deletions(-) diff --git a/src/api/his.ts b/src/api/his.ts index 5a882ab..16c5c28 100644 --- a/src/api/his.ts +++ b/src/api/his.ts @@ -78,6 +78,10 @@ import type { TijianOptionItemRecordListResponse, InputPhysicalExamTaipingInfo, IsTaipingVipResponse, + InputCustomSettlementApplyApprove, + CustomSettlementApproveStatusGetResponse, + InputCustomSettlementApply, + CustomSettlementApplyResponse, } from './types'; /** @@ -605,3 +609,27 @@ export const isTaipingVip = ( data ).then(res => res.data); }; + +/** + * 获取体检加项自定义结算申请审批状态 + */ +export const getCustomSettlementApproveStatus = ( + data: InputCustomSettlementApplyApprove +): Promise => { + return request.post( + `${MEDICAL_EXAM_BASE_PATH}/custom-settlement-approve-status-get`, + data + ).then(res => res.data); +}; + +/** + * 体检加项自定义结算申请 + */ +export const customSettlementApply = ( + data: InputCustomSettlementApply +): Promise => { + return request.post( + `${MEDICAL_EXAM_BASE_PATH}/custom-settlement-apply`, + data + ).then(res => res.data); +}; diff --git a/src/api/types.ts b/src/api/types.ts index 22e48e5..716b587 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -542,8 +542,10 @@ export type CustomerDetailEditResponse = CommonActionResult; + +/** + * 体检加项自定义结算申请状态编辑入参 + */ +export interface InputCustomSettlementApplyApprove { + /** 体检ID */ + physical_exam_id?: number; + /** 体检加项组合ID(多个逗号分隔,例如:123,456) */ + add_item_id?: string; +} + +/** + * 体检加项自定义结算申请状态编辑出参 + */ +export interface OutputCustomSettlementApplyApprove { + /** 是否成功(1-成功 0-失败) */ + is_success?: number; + /** 申请状态(1-审核中 2-取消申请 3-审核通过 4-审核不通过) */ + apply_status?: number; + /** 申请状态名称 */ + apply_status_name?: string | null; + /** 最终结算金额 */ + final_settlement_price?: number | null; +} + +/** + * 获取体检加项自定义结算申请审批状态响应 + */ +export type CustomSettlementApproveStatusGetResponse = CommonActionResult; + +/** + * 加项项目明细信息 + */ +export interface InputAddItemCustomSettlementDetail { + /** 加项项目代码 */ + combination_item_code: string; + /** 加项项目名称 */ + combination_item_name: string; + /** 原价金额 */ + original_price: number; + /** 结算金额 */ + settlement_price: number; +} + +/** + * 体检加项自定义结算申请入参 + */ +export interface InputCustomSettlementApply { + /** 体检ID */ + physical_exam_id?: number; + /** 加项项目明细信息列表 */ + listAddItemDetail?: InputAddItemCustomSettlementDetail[]; + /** 原结算价 */ + original_settlement_price?: number; + /** 结算方式(1-按比例折扣 2-自定义结算价) */ + settlement_type?: number; + /** 折扣比例(如'85'代表8.5折) */ + discount_ratio?: number; + /** 最终结算价 */ + final_settlement_price?: number; + /** 申请理由 */ + apply_reason?: string; +} + +/** + * 体检加项自定义结算申请出参 + */ +export interface OutputCustomSettlementApply { + /** 申请唯一编码 */ + guid?: string | null; +} + +/** + * 体检加项自定义结算申请响应 + */ +export type CustomSettlementApplyResponse = CommonActionResult; diff --git a/src/components/exam/ExamAddonPanel.tsx b/src/components/exam/ExamAddonPanel.tsx index f72c8a2..d9aa13b 100644 --- a/src/components/exam/ExamAddonPanel.tsx +++ b/src/components/exam/ExamAddonPanel.tsx @@ -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]);