Jelajahi Sumber

合并营业执照影像和上传区域

sy 2 jam lalu
induk
melakukan
4d0b8f375c

+ 38 - 40
web-scaffold/src/pages/CustomerWorkspacePage.tsx

@@ -719,47 +719,45 @@ export function CustomerWorkspacePage() {
     <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">
         <h3>登记材料 · 营业执照影像</h3>
-        <div className="customer-license-row">
-          <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>
-              </>}
-            </div>
+        <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>
+            </div>}
           </div>
-          {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>}
         </div>
         {licenseError && <p className="ops-form-error" role="alert">{licenseError}</p>}
       </div>

+ 2 - 15
web-scaffold/src/styles/record-detail.css

@@ -233,16 +233,9 @@
   background: var(--card);
 }
 
-.customer-license-row {
-  display: flex;
-  flex-wrap: wrap;
-  gap: 12px;
-}
-
 .customer-license-document {
   display: flex;
-  align-items: center;
-  flex: 1 1 min(100%, 320px);
+  align-items: flex-start;
   min-width: 0;
   gap: 12px;
   padding: 14px;
@@ -293,14 +286,9 @@
 
 .customer-license-upload {
   display: grid;
-  flex: 0 1 17rem;
-  align-content: center;
   justify-items: start;
   gap: 7px;
-  min-width: 0;
-  padding: 12px 14px;
-  border-radius: var(--radius-control);
-  background: var(--primary-soft);
+  margin-top: 12px;
 }
 
 .customer-license-upload .customer-license-button {
@@ -379,7 +367,6 @@
 }
 
 @media (max-width: 600px) {
-  .customer-license-upload { flex-basis: 100%; }
   .customer-record-metrics > div { padding-inline: 12px; }
   .record-detail .customer-workspace-panel > .ops-record-summary,
   .record-detail .customer-panel-grid { grid-template-columns: minmax(0, 1fr); }