添加挂账公司清除按钮

This commit is contained in:
xianyi
2026-01-08 16:57:29 +08:00
parent 2dbba9e708
commit 1bc48330cd

View File

@@ -316,6 +316,13 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
setIsAccountCompanyDropdownOpen(false);
};
// 清空挂账公司
const handleClearAccountCompany = () => {
setAccountCompany('');
setAccountCompanySearch('');
setIsAccountCompanyDropdownOpen(false);
};
// 结算方式选项
const paymentMethodOptions: Array<{ value: 'self' | 'account'; label: string }> = [
{ value: 'self', label: '自费' },
@@ -838,11 +845,26 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
}}
placeholder={'请输入公司名称'}
className='w-full outline-none text-xs bg-transparent'
onClick={(e) => e.stopPropagation()}
/>
<div className='flex items-center gap-1'>
{accountCompanySearch && (
<button
type='button'
onClick={(e) => {
e.stopPropagation();
handleClearAccountCompany();
}}
className='text-gray-400 hover:text-gray-600 transition-colors text-sm leading-none w-4 h-4 flex items-center justify-center'
>
×
</button>
)}
<span className={cls('text-gray-400 transition-transform text-[10px]', isAccountCompanyDropdownOpen && 'rotate-180')}>
</span>
</div>
</div>
{isAccountCompanyDropdownOpen && (
<div className='absolute z-50 w-full bottom-full mb-1 bg-white border border-gray-300 rounded-lg shadow-lg overflow-hidden max-h-[320px] overflow-y-auto'>
{filteredAccountCompanyOptions.length === 0 && (