添加接口
This commit is contained in:
@@ -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<CustomSettlementApproveStatusGetResponse> => {
|
||||
return request.post<CustomSettlementApproveStatusGetResponse>(
|
||||
`${MEDICAL_EXAM_BASE_PATH}/custom-settlement-approve-status-get`,
|
||||
data
|
||||
).then(res => res.data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 体检加项自定义结算申请
|
||||
*/
|
||||
export const customSettlementApply = (
|
||||
data: InputCustomSettlementApply
|
||||
): Promise<CustomSettlementApplyResponse> => {
|
||||
return request.post<CustomSettlementApplyResponse>(
|
||||
`${MEDICAL_EXAM_BASE_PATH}/custom-settlement-apply`,
|
||||
data
|
||||
).then(res => res.data);
|
||||
};
|
||||
|
||||
@@ -542,8 +542,10 @@ export type CustomerDetailEditResponse = CommonActionResult<OutputCustomerDetail
|
||||
export interface InputPhysicalExamAddItem {
|
||||
/** 体检ID */
|
||||
physical_exam_id: number;
|
||||
/** 折扣率 */
|
||||
discount_ratio: number;
|
||||
/** 渠道ID */
|
||||
scrm_account_id?: string | null;
|
||||
/** 渠道名称 */
|
||||
scrm_account_name?: string | null;
|
||||
/** 项目名称(默认空值,传入项目名称过滤数据) */
|
||||
item_name?: string;
|
||||
}
|
||||
@@ -1383,3 +1385,79 @@ export interface OutputSelfServiceTaipingInfo {
|
||||
* 获取太平VIP客户认证结果响应
|
||||
*/
|
||||
export type IsTaipingVipResponse = CommonActionResult<OutputSelfServiceTaipingInfo>;
|
||||
|
||||
/**
|
||||
* 体检加项自定义结算申请状态编辑入参
|
||||
*/
|
||||
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<OutputCustomSettlementApplyApprove>;
|
||||
|
||||
/**
|
||||
* 加项项目明细信息
|
||||
*/
|
||||
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<OutputCustomSettlementApply>;
|
||||
|
||||
@@ -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