feat: 1. 重构交叉评查任务的文档列表的显示,对接接口查询当前任务的文档相关信息。
2.文档上传通过接口去查询是否存在同名的文件,做上传前拦截提示。 3.交叉评查的评查结果也同步添加企查查的企业信息查询模块。 4. 封装上传附件和上传模板的模态框的组件,在交叉评查的文档列表中引入显示。 5. 交叉评查的评查结果中关于合同类型的文档同步加入结构比对的功能。
This commit is contained in:
@@ -33,6 +33,9 @@ import {
|
||||
type SubmitOpinionRequest
|
||||
} from '../../api/cross-checking/cross-file-result';
|
||||
import { useFetcher, useNavigate } from '@remix-run/react';
|
||||
import { CorporateInfoModal } from '../corporate-information';
|
||||
import type { BusinessInfoResult, DishonestyResult } from '../corporate-information';
|
||||
import { queryCompanyInfo } from '~/api/corporate-information/qichacha';
|
||||
// import '../../styles/components/TooltipStyles.css';
|
||||
|
||||
/**
|
||||
@@ -576,6 +579,80 @@ export function ReviewPointsList({
|
||||
// 存放评查点ID与有效页码的映射
|
||||
const [effectivePages, setEffectivePages] = useState<Record<string, number>>({});
|
||||
|
||||
// 企业信息模态框状态
|
||||
const [corporateModalVisible, setCorporateModalVisible] = useState(false);
|
||||
const [corporateCompanyName, setCorporateCompanyName] = useState('');
|
||||
const [corporateBusinessInfo, setCorporateBusinessInfo] = useState<BusinessInfoResult | null>(null);
|
||||
const [corporateDishonestyInfo, setCorporateDishonestyInfo] = useState<DishonestyResult | null>(null);
|
||||
const [corporateLoading, setCorporateLoading] = useState(false);
|
||||
const [corporateError, setCorporateError] = useState<string | null>(null);
|
||||
const [corporateUpdatedAt, setCorporateUpdatedAt] = useState<string | null>(null);
|
||||
|
||||
/**
|
||||
* 处理企业信息按钮点击
|
||||
* @param companyName 企业名称(乙方名称)
|
||||
* @param forceRefresh 是否强制刷新(对接企查查重新查询)
|
||||
*/
|
||||
const handleCorporateInfoClick = async (companyName: string, forceRefresh = false) => {
|
||||
if (!companyName) {
|
||||
toastService.warning('企业名称为空,无法查询');
|
||||
return;
|
||||
}
|
||||
|
||||
// 打开模态框并设置加载状态
|
||||
setCorporateModalVisible(true);
|
||||
setCorporateCompanyName(companyName);
|
||||
setCorporateLoading(true);
|
||||
setCorporateError(null);
|
||||
setCorporateBusinessInfo(null);
|
||||
setCorporateDishonestyInfo(null);
|
||||
setCorporateUpdatedAt(null);
|
||||
|
||||
try {
|
||||
const response = await queryCompanyInfo({ keyword: companyName, force_refresh: forceRefresh });
|
||||
|
||||
if (response.success && response.data) {
|
||||
setCorporateBusinessInfo(response.data.enterprise);
|
||||
setCorporateUpdatedAt(response.data.updated_at);
|
||||
// 转换失信数据格式
|
||||
if (response.data.dishonesty) {
|
||||
setCorporateDishonestyInfo({
|
||||
VerifyResult: response.data.dishonesty.VerifyResult,
|
||||
Data: response.data.dishonesty.Data || [],
|
||||
});
|
||||
}
|
||||
} else {
|
||||
setCorporateError(response.message || '查询失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('查询企业信息失败:', error);
|
||||
setCorporateError(error instanceof Error ? error.message : '查询失败');
|
||||
} finally {
|
||||
setCorporateLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 处理强制刷新(对接企查查重新查询)
|
||||
*/
|
||||
const handleCorporateForceRefresh = async () => {
|
||||
if (corporateCompanyName) {
|
||||
await handleCorporateInfoClick(corporateCompanyName, true);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 关闭企业信息模态框
|
||||
*/
|
||||
const handleCloseCorporateModal = () => {
|
||||
setCorporateModalVisible(false);
|
||||
setCorporateCompanyName('');
|
||||
setCorporateBusinessInfo(null);
|
||||
setCorporateDishonestyInfo(null);
|
||||
setCorporateError(null);
|
||||
setCorporateUpdatedAt(null);
|
||||
};
|
||||
|
||||
/**
|
||||
* 打开提出意见模态框
|
||||
*/
|
||||
@@ -2610,7 +2687,50 @@ export function ReviewPointsList({
|
||||
{/* 评查点名称 pointName*/}
|
||||
<div className="flex justify-between items-center mb-2">
|
||||
{/* <div className='flex flex-col'> */}
|
||||
<div className="review-point-title text-left text-blue-500 max-w-[75%] break-all">{reviewPoint.pointName}</div>
|
||||
<div className="flex items-center gap-2 max-w-[75%]">
|
||||
<div className="review-point-title text-left text-blue-500 break-all">{reviewPoint.pointName}</div>
|
||||
{reviewPoint.pointName === '签署乙方详细信息校验' && (
|
||||
<button
|
||||
className="enterprise-info-btn"
|
||||
style={{
|
||||
padding: '2px 8px',
|
||||
fontSize: '12px',
|
||||
borderRadius: '4px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: '4px',
|
||||
flexShrink: 0,
|
||||
transition: 'all 0.2s',
|
||||
border: 'none',
|
||||
cursor: reviewPoint.content?.['合同主体信息-乙方-名称']?.value ? 'pointer' : 'not-allowed',
|
||||
backgroundColor: reviewPoint.content?.['合同主体信息-乙方-名称']?.value ? '#00684a' : '#e5e7eb',
|
||||
color: reviewPoint.content?.['合同主体信息-乙方-名称']?.value ? '#ffffff' : '#9ca3af',
|
||||
}}
|
||||
disabled={!reviewPoint.content?.['合同主体信息-乙方-名称']?.value}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
const companyNameValue = reviewPoint.content?.['合同主体信息-乙方-名称']?.value;
|
||||
const companyName = typeof companyNameValue === 'string' ? companyNameValue : String(companyNameValue || '');
|
||||
if (companyName) {
|
||||
handleCorporateInfoClick(companyName);
|
||||
}
|
||||
}}
|
||||
onMouseEnter={(e) => {
|
||||
if (reviewPoint.content?.['合同主体信息-乙方-名称']?.value) {
|
||||
e.currentTarget.style.backgroundColor = '#005a3f';
|
||||
}
|
||||
}}
|
||||
onMouseLeave={(e) => {
|
||||
if (reviewPoint.content?.['合同主体信息-乙方-名称']?.value) {
|
||||
e.currentTarget.style.backgroundColor = '#00684a';
|
||||
}
|
||||
}}
|
||||
>
|
||||
<i className="ri-eye-line"></i>
|
||||
企业信息
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
{/* <div className="review-point-header flex justify-between items-start">
|
||||
<div className="flex-1 text-left min-w-[25%] font-medium text-[13px]">{reviewPoint.title}</div>
|
||||
//评查点分组显示
|
||||
@@ -2988,6 +3108,21 @@ export function ReviewPointsList({
|
||||
)}
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
{/* 企业信息模态框 */}
|
||||
<CorporateInfoModal
|
||||
visible={corporateModalVisible}
|
||||
onClose={handleCloseCorporateModal}
|
||||
companyName={corporateCompanyName}
|
||||
businessInfo={corporateBusinessInfo}
|
||||
dishonestyInfo={corporateDishonestyInfo}
|
||||
businessLoading={corporateLoading}
|
||||
dishonestyLoading={corporateLoading}
|
||||
businessError={corporateError}
|
||||
dishonestyError={corporateError}
|
||||
updatedAt={corporateUpdatedAt}
|
||||
onForceRefresh={handleCorporateForceRefresh}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user