This commit is contained in:
xx
2026-03-12 17:17:58 +08:00
parent e420897878
commit 7100396cd1
3 changed files with 29 additions and 7 deletions

View File

@@ -550,6 +550,8 @@ export interface InputPhysicalExamAddItem {
item_name?: string;
/** 折扣率 */
discount_rate?: number | null;
/** 是否肠本 1-是 0-否) */
is_intestinal?: number | null;
}
/**

View File

@@ -51,6 +51,7 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
const debounceTimerRef = useRef<number | null>(null);
const [addonLoading, setAddonLoading] = useState(false);
const [addonError, setAddonError] = useState<string | null>(null);
const [isIntestinal, setIsIntestinal] = useState<1 | 0>(1);
// 折扣比例1 = 100%
const [discountRatio, setDiscountRatio] = useState<number>(1);
// 渠道折扣列表
@@ -292,6 +293,7 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
scrm_account_name: customerInfo?.scrm_account_name || null,
item_name: debouncedAddonSearch.trim() || "",
discount_rate: discountRate,
is_intestinal: isIntestinal,
});
if (res.Status === 200 && Array.isArray(res.Data)) {
const list: AddonItem[] = res.Data.map((item) => ({
@@ -326,7 +328,7 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
}
};
fetchList();
}, [debouncedAddonSearch, customerInfo?.scrm_account_id, customerInfo?.scrm_account_name, client.id, customerInfo, channelDiscounts, discountRatio]);
}, [debouncedAddonSearch, customerInfo?.scrm_account_id, customerInfo?.scrm_account_name, client.id, customerInfo, channelDiscounts, discountRatio, isIntestinal]);
const maxSelect = 15;
const selectedCount = selectedIds.size;
@@ -1120,6 +1122,16 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
</div>
</div>
<label className='w-[260px] flex items-center gap-2 text-xs text-gray-700 cursor-pointer select-none'>
<input
type='checkbox'
className='w-4 h-4'
checked={isIntestinal === 1}
onChange={() => setIsIntestinal(prev => (prev === 1 ? 0 : 1))}
/>
<span></span>
</label>
<div className='w-[260px] flex items-center gap-2'>
<Input
placeholder='搜索 加项名称'

View File

@@ -1644,18 +1644,26 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
}
};
// 检查所有文档是否都已签名
const checkAllSigned = () => {
// 检查所有知情同意书是否都已签名
const allConsentsSigned = consentList.every((item) => {
if (item.combination_code === undefined || item.combination_code === null) return true;
return signedCombinationCodes.includes(Number(item.combination_code));
});
// 检查导检单是否已签名(只有 localStorage 中的或签名后的才是已签名的)
consentList.filter((item) => {
if (item.combination_code === undefined || item.combination_code === null) return false;
return !signedCombinationCodes.includes(Number(item.combination_code));
});
const allAddItemsSigned = addItemBillList.every((bill) => bill.is_signed === true);
const daojiandanSigned = isDaojiandanSigned;
return allConsentsSigned && consentList.length > 0 && daojiandanSigned;
const result =
daojiandanSigned &&
allAddItemsSigned &&
(consentList.length === 0 || allConsentsSigned);
return result;
};
// 一键打印所有文档
@@ -1901,7 +1909,7 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
return (
<div className='grid grid-cols-2 gap-4 text-sm'>
<div className='grid grid-cols-2 gap-4 text-sm pb-3'>
<div className='p-4 rounded-2xl border bg-gray-50/60 flex flex-col gap-3'>
<div className='font-medium'></div>
<div className='text-xs text-gray-500'></div>
@@ -2042,7 +2050,7 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
)}
</div>
{/* <div className='text-xs text-gray-500'>点击后弹出知情同意书全文及签名区域,签署完成后回到签到页面。</div> */}
<div className='flex flex-col gap-2 max-h-96 overflow-y-auto custom-scroll'>
<div className='flex flex-col gap-2 max-h-96 overflow-y-auto custom-scroll pb-4'>
{consentLoading && <div className='text-xs text-gray-500'>...</div>}
{/* {!consentLoading && consentMessage && <div className='text-xs text-amber-600'>{consentMessage}</div>} */}
{!consentLoading && (consentList.length > 0 || true) && (