|
|
@@ -108,6 +108,13 @@ function metricCount(value: number | undefined, loading: boolean, error: ApiErro
|
|
|
return <TextCell value={value} />;
|
|
|
}
|
|
|
|
|
|
+function CustomerMaterialCard({ children }: { children: ReactNode }) {
|
|
|
+ return <div className="customer-material-card">
|
|
|
+ <span className="customer-file-thumb" aria-hidden="true"><FileText size={20} /></span>
|
|
|
+ <div className="customer-material-description">{children}</div>
|
|
|
+ </div>;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 详情里的单个可编辑项(与合同详情同一交互):非编辑态只渲染值,鼠标移入才显出铅笔;点铅笔切到输入态。
|
|
|
* 改完点对号(或按 Enter)即提交**该项**:客户写口按字段可选,⛔ 攒到底部统一保存。
|
|
|
@@ -564,7 +571,9 @@ export function CustomerWorkspacePage() {
|
|
|
<strong>{metricCount(accounts.data?.total, accounts.loading, accounts.error)}</strong>
|
|
|
<small>
|
|
|
在用分账号{(accounts.data?.total ?? 0) > accountRows.length ? "(已加载)" : ""}{" "}
|
|
|
- {metricCount(accounts.data ? accountRows.filter((row) => row.status === "in_use").length : undefined, accounts.loading, accounts.error)}
|
|
|
+ <span className="customer-record-active-count">
|
|
|
+ {metricCount(accounts.data ? accountRows.filter((row) => row.status === "in_use").length : undefined, accounts.loading, accounts.error)}
|
|
|
+ </span>
|
|
|
</small>
|
|
|
</dd>
|
|
|
</div>
|
|
|
@@ -717,51 +726,67 @@ export function CustomerWorkspacePage() {
|
|
|
</section>
|
|
|
|
|
|
<section className="ops-record-card customer-workspace-panel" id="customer-panel-materials" role="tabpanel" aria-labelledby="customer-tab-materials" hidden={tab !== "materials"}>
|
|
|
- <div className="customer-panel customer-license-panel">
|
|
|
+ <div className="customer-panel customer-material-panel">
|
|
|
<h3>登记材料 · 营业执照影像</h3>
|
|
|
- <div className="customer-license-document">
|
|
|
- <span className="customer-file-thumb" aria-hidden="true"><FileText size={20} /></span>
|
|
|
- <div className="customer-license-description">
|
|
|
- {!licenseApplicable ? <>
|
|
|
- <strong>不适用</strong>
|
|
|
- <p>个人和个体工商户无需登记营业执照影像。</p>
|
|
|
- </> : license?.status === "viewable" ? <>
|
|
|
- <div className="customer-license-filename"><strong>{license.file_name ?? "营业执照影像"}</strong><OpsStatus tone="success">已登记</OpsStatus></div>
|
|
|
- <p>{license.view_url ? "查看链接短期有效,失效后请刷新页面。" : "查看链接暂不可用,请刷新页面。"}</p>
|
|
|
- {license.view_url && <div className="customer-license-links">
|
|
|
- <a href={license.view_url} target="_blank" rel="noopener noreferrer">查看影像</a>
|
|
|
- <a href={license.view_url} download={license.file_name ?? ""} target="_blank" rel="noopener noreferrer">下载</a>
|
|
|
- </div>}
|
|
|
- </> : license?.status === "expired" ? <>
|
|
|
- <strong>已超期</strong>
|
|
|
- <p>影像留存期已满,无法查看或下载。</p>
|
|
|
- </> : <>
|
|
|
- <strong>{license ? "未登记影像" : MISSING}</strong>
|
|
|
- <p>{license ? "营业执照影像为选填材料,可在此补传。" : "暂未获取影像登记状态。"}</p>
|
|
|
- </>}
|
|
|
- {licenseApplicable && license?.status !== "expired" && <div className="customer-license-upload">
|
|
|
- <label className="customer-upload-button customer-license-button">
|
|
|
- <Upload size={15} aria-hidden="true" />
|
|
|
- {licenseBusy ? "正在上传…" : license?.status === "viewable" ? "替换影像" : "上传影像"}
|
|
|
- <input
|
|
|
- aria-label="上传营业执照影像"
|
|
|
- aria-describedby="customer-license-upload-note"
|
|
|
- type="file"
|
|
|
- disabled={licenseBusy || busy}
|
|
|
- onChange={(event) => {
|
|
|
- const file = event.target.files?.[0] ?? null;
|
|
|
- event.target.value = "";
|
|
|
- void replaceLicense(file);
|
|
|
- }}
|
|
|
- />
|
|
|
- </label>
|
|
|
- <small id="customer-license-upload-note">格式和大小以平台限制为准。替换影像后,留存期限仍从建档日起算。</small>
|
|
|
+ <CustomerMaterialCard>
|
|
|
+ {!licenseApplicable ? <>
|
|
|
+ <strong>不适用</strong>
|
|
|
+ <p>个人和个体工商户无需登记营业执照影像。</p>
|
|
|
+ </> : license?.status === "viewable" ? <>
|
|
|
+ <div className="customer-license-filename"><strong>{license.file_name ?? "营业执照影像"}</strong><OpsStatus tone="success">已登记</OpsStatus></div>
|
|
|
+ <p>{license.view_url ? "查看链接短期有效,失效后请刷新页面。" : "查看链接暂不可用,请刷新页面。"}</p>
|
|
|
+ {license.view_url && <div className="customer-material-links">
|
|
|
+ <a href={license.view_url} target="_blank" rel="noopener noreferrer">查看影像</a>
|
|
|
+ <a href={license.view_url} download={license.file_name ?? ""} target="_blank" rel="noopener noreferrer">下载</a>
|
|
|
</div>}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </> : license?.status === "expired" ? <>
|
|
|
+ <strong>已超期</strong>
|
|
|
+ <p>影像留存期已满,无法查看或下载。</p>
|
|
|
+ </> : <>
|
|
|
+ <strong>{license ? "未登记影像" : MISSING}</strong>
|
|
|
+ <p>{license ? "营业执照影像为选填材料,可在此补传。" : "暂未获取影像登记状态。"}</p>
|
|
|
+ </>}
|
|
|
+ {licenseApplicable && license?.status !== "expired" && <div className="customer-license-upload">
|
|
|
+ <label className="customer-upload-button customer-license-button">
|
|
|
+ <Upload size={15} aria-hidden="true" />
|
|
|
+ {licenseBusy ? "正在上传…" : license?.status === "viewable" ? "替换影像" : "上传影像"}
|
|
|
+ <input
|
|
|
+ aria-label="上传营业执照影像"
|
|
|
+ aria-describedby="customer-license-upload-note"
|
|
|
+ type="file"
|
|
|
+ disabled={licenseBusy || busy}
|
|
|
+ onChange={(event) => {
|
|
|
+ const file = event.target.files?.[0] ?? null;
|
|
|
+ event.target.value = "";
|
|
|
+ void replaceLicense(file);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </label>
|
|
|
+ <small id="customer-license-upload-note">格式和大小以平台限制为准。替换影像后,留存期限仍从建档日起算。</small>
|
|
|
+ </div>}
|
|
|
+ </CustomerMaterialCard>
|
|
|
{licenseError && <p className="ops-form-error" role="alert">{licenseError}</p>}
|
|
|
</div>
|
|
|
- <div className="customer-panel"><h3>合同文档</h3>{contractFiles.length ? <div className="customer-file-list">{contractFiles.map((document) => <div key={`${document.contractNo}-${document.name}`}><span className="customer-file-thumb"><FileText size={16} /></span><div><strong>{document.name}</strong><p>{document.contractNo}</p></div><Button variant="ghost" onClick={() => navigate(`/contracts/${encodeURIComponent(document.contractNo)}?download=${encodeURIComponent(document.name)}`, { state: outgoingState })}>预览</Button></div>)}</div> : <p className="ops-muted">暂无文档,合同文档随合同登记上传。</p>}</div>
|
|
|
+ <div className="customer-panel customer-material-panel">
|
|
|
+ <h3>合同文档</h3>
|
|
|
+ {contractsLoad.error ? <CustomerMaterialCard>
|
|
|
+ <strong>合同文档读取失败</strong>
|
|
|
+ <FetchError message={contractsLoad.error.message} onRetry={contractsLoad.reload} />
|
|
|
+ </CustomerMaterialCard> : contractsLoad.loading ? <CustomerMaterialCard>
|
|
|
+ <strong>正在读取合同文档…</strong>
|
|
|
+ </CustomerMaterialCard> : contractFiles.length ? <div className="customer-material-list">
|
|
|
+ {contractFiles.map((document) => <CustomerMaterialCard key={`${document.contractNo}-${document.name}`}>
|
|
|
+ <strong>{document.name}</strong>
|
|
|
+ <p>{document.contractNo}</p>
|
|
|
+ <div className="customer-material-links">
|
|
|
+ <Link to={`/contracts/${encodeURIComponent(document.contractNo)}?download=${encodeURIComponent(document.name)}`} state={outgoingState}>预览</Link>
|
|
|
+ </div>
|
|
|
+ </CustomerMaterialCard>)}
|
|
|
+ </div> : <CustomerMaterialCard>
|
|
|
+ <strong>暂无合同文档</strong>
|
|
|
+ <p>文档随合同登记上传。</p>
|
|
|
+ </CustomerMaterialCard>}
|
|
|
+ </div>
|
|
|
<p className="customer-form-note">应备材料(按主体类型):{subjectText ? customerMaterials(subjectText as "企业" | "个体工商户" | "个人") : <Tri tone="missing" text={MISSING} title={MISSING + ":subject_type"} />};合同文档:{CONTRACT_DOC_NOTE}。</p>
|
|
|
</section>
|
|
|
|