瀏覽代碼

feat(web): 重设计新增合同页面并使用默认表单样式

sy 9 小時之前
父節點
當前提交
fa1c657ad0
共有 2 個文件被更改,包括 148 次插入 和 149 次删除
  1. 66 66
      web-scaffold/src/pages/ContractDetailPages.tsx
  2. 82 83
      web-scaffold/src/styles/contract-editor.css

+ 66 - 66
web-scaffold/src/pages/ContractDetailPages.tsx

@@ -1278,9 +1278,9 @@ export function ContractEditorPage() {
   return <section className="ops-page ops-record-page contract-editor">
     <header className="ops-page-head">
       <div>
-        <p className="ops-eyebrow"><span /> 合同管理 · {editing ? "编辑" : "签订"}</p>
-        <h1>{editing ? "编辑合同" : "合同签订表单"}</h1>
-        <p>{editing ? `合同 ${no}` : "采集客户、商务、订购额度与合规信息,用于生成合同快照、资源额度和后续工单的授权依据。"}</p>
+        <p className="contract-editor-eyebrow">CONTRACT / {editing ? "EDIT" : "CREATE"}</p>
+        <h1>{editing ? "编辑合同" : "新增合同"}</h1>
+        <p>{editing ? `合同 ${no}` : "完善签约客户与商务约定,配置本次订购的链路和服务。"}</p>
       </div>
       <div className="ops-head-actions">
         <Button variant="outline" size="sm" onClick={() => navigate("/contracts")}><ArrowLeft size={15} />返回合同台账</Button>
@@ -1291,8 +1291,15 @@ export function ContractEditorPage() {
     {!record.loading && !record.error && editing && !record.data && <div className="ops-record-layout"><section className="ops-record-card ops-record-card-full"><h2>合同资料</h2><p className="contract-form-summary">未找到合同 {no},可能已被删除。请从合同台账重新进入,或返回台账检索。</p><div className="ops-form-actions"><Button variant="outline" size="sm" onClick={() => navigate("/contracts")}>返回合同台账</Button></div></section></div>}
     {(!editing || record.data) && <div className="ops-record-layout">
       <div className="ops-record-stack">
-        <section className="ops-record-card">
-          <div className="customer-form-section-title"><span>01</span><div><h2>客户资料</h2><p>必填。客户名称输入文字检索已有客户;未命中时完善客户资料,随合同先建档再签约。</p></div></div>
+        <nav className="contract-editor-nav" aria-label="合同表单分区">
+          {[['customer', '客户资料', '确认签约主体'], ['business', '商务信息', '约定价格与期间'], ['services', '服务构成', '配置链路与服务']].map(([id, title, description], index) => (
+            <button key={id} type="button" onClick={() => { const section = document.getElementById(`contract-editor-${id}`); section?.focus({ preventScroll: true }); section?.scrollIntoView({ block: 'start' }); }}>
+              <span>0{index + 1}</span><div><strong>{title}</strong><small>{description}</small></div>
+            </button>
+          ))}
+        </nav>
+        <section id="contract-editor-customer" tabIndex={-1} aria-labelledby="contract-editor-customer-title" className="ops-record-card">
+          <div className="customer-form-section-title"><span>01</span><div><h2 id="contract-editor-customer-title">客户资料</h2><p>搜索已有客户,或直接填写资料建立新档案。</p></div></div>
           {editing ? (
             <div className="ops-form-grid ops-form-grid--business">
               <label htmlFor="contract-customer"><span className="ops-field-title">所属客户</span><Input id="contract-customer" value={customerLabel} readOnly disabled /></label>
@@ -1364,6 +1371,7 @@ export function ContractEditorPage() {
             */}
           {!editing && (
             <div className="ops-form-grid ops-form-grid--business contract-customer-fields">
+              <h3 className="contract-editor-group ops-form-span-full">归属与服务团队</h3>
               <label htmlFor="inline-region"><span className="ops-field-title">所属区域 <b title="必填">*</b><FieldHint label="所属区域说明">客户挂载的区域节点,从省一级开始选(「全网」是平台虚根,不下拉)。选定后才反查运营商、合伙人、运营团队与运维团队。命中已有客户时只读。</FieldHint></span>
                 <TreeSelect treeData={regionTreeShown} value={inline.regionId} onChange={(value) => setInlineField("regionId", value)} ariaLabel="所属区域" placeholder={lockedIdentityFields ? "客户档案未挂载区域" : "请选择区域节点"} name="inline-region" disabled={lockedIdentityFields} />
               </label>
@@ -1376,28 +1384,6 @@ export function ContractEditorPage() {
                   </select>
                 </RegionGate>
               </label>
-              <label htmlFor="inline-address"><span className="ops-field-title">客户地址 <FieldHint label="客户地址说明">{matchedCustomer ? "可改;随合同保存写回客户档案。" : "客户地址(含楼栋与房间号);随客户建档写入。"}</FieldHint></span><Input id="inline-address" placeholder="客户地址(含楼栋与房间号)" value={inline.address} onChange={(event) => setInlineField("address", event.target.value)} /></label>
-              <div className="contract-contact-field">
-                <span className="ops-field-title">商务联系人 <FieldHint label="商务联系人说明">客户方商务对接人:姓名与手机号成对填写,如 张伟 13800000000;可留空。{matchedCustomer ? "可改,随合同保存写回客户档案。" : ""}</FieldHint></span>
-                <div className="contract-contact-pair">
-                  <Input aria-label="商务联系人姓名" placeholder="姓名" value={inline.businessName} onChange={(event) => setInlineField("businessName", event.target.value)} />
-                  <Input aria-label="商务联系人电话" inputMode="tel" placeholder="手机号" value={inline.businessPhone} onChange={(event) => setInlineField("businessPhone", event.target.value)} />
-                </div>
-              </div>
-              <div className="contract-contact-field">
-                <span className="ops-field-title">技术联系人 <FieldHint label="技术联系人说明">客户方技术对接人:姓名与手机号成对填写,如 张伟 13800000000;可留空。{matchedCustomer ? "可改,随合同保存写回客户档案。" : ""}</FieldHint></span>
-                <div className="contract-contact-pair">
-                  <Input aria-label="技术联系人姓名" placeholder="姓名" value={inline.techName} onChange={(event) => setInlineField("techName", event.target.value)} />
-                  <Input aria-label="技术联系人电话" inputMode="tel" placeholder="手机号" value={inline.techPhone} onChange={(event) => setInlineField("techPhone", event.target.value)} />
-                </div>
-              </div>
-              <div className="contract-contact-field">
-                <span className="ops-field-title">财务联系人 <FieldHint label="财务联系人说明">客户方财务对接人:姓名与手机号成对填写,如 张伟 13800000000;可留空。{matchedCustomer ? "可改,随合同保存写回客户档案。" : ""}</FieldHint></span>
-                <div className="contract-contact-pair">
-                  <Input aria-label="财务联系人姓名" placeholder="姓名" value={inline.financeName} onChange={(event) => setInlineField("financeName", event.target.value)} />
-                  <Input aria-label="财务联系人电话" inputMode="tel" placeholder="手机号" value={inline.financePhone} onChange={(event) => setInlineField("financePhone", event.target.value)} />
-                </div>
-              </div>
               <label htmlFor="inline-partner">
                 <RegionGate gated={!inline.regionId}>
                   <span className="ops-field-title">合伙人 <FieldHint label="合伙人说明">{matchedCustomer ? "按所挂区域负责范围自动算出(唯一候选自动选中,0/多个留空),只读;不随本合同改写客户归属。" : "候选=负责范围覆盖所挂区域的合伙人;唯一候选自动选中,录入人身份命中时自动选中并只读,多个候选需手选。"}</FieldHint></span>
@@ -1428,6 +1414,29 @@ export function ContractEditorPage() {
                   />
                 </RegionGate>
               </div>
+              <h3 className="contract-editor-group ops-form-span-full">联系信息</h3>
+              <label htmlFor="inline-address" className="ops-form-span-full"><span className="ops-field-title">客户地址 <FieldHint label="客户地址说明">{matchedCustomer ? "可改;随合同保存写回客户档案。" : "客户地址(含楼栋与房间号);随客户建档写入。"}</FieldHint></span><Input id="inline-address" placeholder="客户地址(含楼栋与房间号)" value={inline.address} onChange={(event) => setInlineField("address", event.target.value)} /></label>
+              <div className="contract-contact-field">
+                <span className="ops-field-title">商务联系人 <FieldHint label="商务联系人说明">客户方商务对接人:姓名与手机号成对填写,如 张伟 13800000000;可留空。{matchedCustomer ? "可改,随合同保存写回客户档案。" : ""}</FieldHint></span>
+                <div className="contract-contact-pair">
+                  <Input aria-label="商务联系人姓名" placeholder="姓名" value={inline.businessName} onChange={(event) => setInlineField("businessName", event.target.value)} />
+                  <Input aria-label="商务联系人电话" inputMode="tel" placeholder="手机号" value={inline.businessPhone} onChange={(event) => setInlineField("businessPhone", event.target.value)} />
+                </div>
+              </div>
+              <div className="contract-contact-field">
+                <span className="ops-field-title">技术联系人 <FieldHint label="技术联系人说明">客户方技术对接人:姓名与手机号成对填写,如 张伟 13800000000;可留空。{matchedCustomer ? "可改,随合同保存写回客户档案。" : ""}</FieldHint></span>
+                <div className="contract-contact-pair">
+                  <Input aria-label="技术联系人姓名" placeholder="姓名" value={inline.techName} onChange={(event) => setInlineField("techName", event.target.value)} />
+                  <Input aria-label="技术联系人电话" inputMode="tel" placeholder="手机号" value={inline.techPhone} onChange={(event) => setInlineField("techPhone", event.target.value)} />
+                </div>
+              </div>
+              <div className="contract-contact-field">
+                <span className="ops-field-title">财务联系人 <FieldHint label="财务联系人说明">客户方财务对接人:姓名与手机号成对填写,如 张伟 13800000000;可留空。{matchedCustomer ? "可改,随合同保存写回客户档案。" : ""}</FieldHint></span>
+                <div className="contract-contact-pair">
+                  <Input aria-label="财务联系人姓名" placeholder="姓名" value={inline.financeName} onChange={(event) => setInlineField("financeName", event.target.value)} />
+                  <Input aria-label="财务联系人电话" inputMode="tel" placeholder="手机号" value={inline.financePhone} onChange={(event) => setInlineField("financePhone", event.target.value)} />
+                </div>
+              </div>
               <label htmlFor="inline-remark" className="ops-form-span-full"><span className="ops-field-title">客户备注 <small>选填</small><FieldHint label="客户备注说明">多行文本,≤512 字。{matchedCustomer ? "可改;随合同保存写回客户档案。" : "随客户建档写入客户档案的备注列。"}</FieldHint></span>
                 <textarea id="inline-remark" rows={3} maxLength={512} placeholder="补充说明(≤512 字)" value={inline.remark} onChange={(event) => setInlineField("remark", event.target.value)} />
               </label>
@@ -1478,7 +1487,7 @@ export function ContractEditorPage() {
               ) : null}
               {/* 客户主账号只在建档时录入:命中已有客户时它已经存在,⛔ 显示成「沿用已有客户档案」的空输入框。 */}
               {!matchedCustomer && <>
-                <div className="ops-form-span-full contract-inline-account-head"><strong>客户主账号 <small>选填</small></strong><span>建档即开通;登录名留空按客户号派生,手机号选填。</span></div>
+                <h3 className="contract-editor-group ops-form-span-full">客户主账号 <small>选填 · 登录名留空将自动生成</small></h3>
                 <label htmlFor="inline-login"><span className="ops-field-title">主账号登录名 <small>选填</small></span><Input id="inline-login" placeholder="留空按客户号派生" value={inline.login} onChange={(event) => setInlineField("login", event.target.value)} /></label>
                 <label htmlFor="inline-mobile"><span className="ops-field-title">主账号绑定手机号 <small>选填</small></span><Input id="inline-mobile" inputMode="numeric" maxLength={11} placeholder="11 位手机号" value={inline.mobile} onChange={(event) => setInlineField("mobile", event.target.value)} /></label>
               </>}
@@ -1487,10 +1496,10 @@ export function ContractEditorPage() {
           {editing && <p className="contract-form-summary">修改合同的客户归属需要后端提供迁移接口,此处不提供换客户。</p>}
         </section>
 
-        <section className="ops-record-card">
+        <section id="contract-editor-business" tabIndex={-1} aria-labelledby="contract-editor-business-title" className="ops-record-card">
           <div className="customer-form-section-title">
             <span>02</span>
-            <div><h2>合同基本信息</h2><p>商务归档口径,用于对账、到期提醒与版本追溯</p></div>
+            <div><h2 id="contract-editor-business-title">商务信息</h2><p>确认合同类型、经办人及服务期间。</p></div>
             {/**
               * 合同金额=自动汇总、不可手改:去掉输入框形态,挂在分区标题行右侧(与侧栏「最终合同金额」同口径)。
               * `id="contract-amount"` 保留给必填红显/断言锚点;`aria-invalid` 仍走 `invalidOf("amount")`。
@@ -1507,7 +1516,7 @@ export function ContractEditorPage() {
             * 变更=沿用旧期间+全量带出(期间可改)。
             */}
           {!editing && draft.contractType !== "new" && (
-            <div className="contract-renew-block">
+            <div className="ops-form-grid contract-renew-block">
               <label htmlFor="renew-from"><span className="ops-field-title">{carryLabel}{draft.contractType === "renew" ? <b title="必填">*</b> : <small>可选</small>}<FieldHint label={`${carryLabel}说明`}>{carryHint}</FieldHint></span>
                 <select id="renew-from" data-placeholder={!renewFrom} value={renewFrom} disabled={renewLoading || submitting || !customerId} onChange={(event) => void pickRenewal(event.target.value)}>
                   <option value="">{customerId ? "请选择旧合同" : "先在上方 01 选定客户,再选旧合同"}</option>
@@ -1547,23 +1556,23 @@ export function ContractEditorPage() {
             <label htmlFor="sign-date"><span className="ops-field-title">签署日期 <b title="必填">*</b><FieldHint label="签署日期说明">交接日期即签署日期(2026-11-19 定案),表单只留这一格;提交时同值写入合同的签署日期与交接日期两列。新建默认录入当日。</FieldHint></span><Input id="sign-date" type="date" aria-invalid={invalidOf("signDate")} value={draft.signDate} onChange={(event) => set("signDate", event.target.value)} />{requiredErrorOf("signDate")}</label>
             <label htmlFor="contract-discount"><span className="ops-field-title">折扣率(%) <b title="必填">*</b><FieldHint label="折扣率说明">默认 100,取值 1~100(最多两位小数)。最终合同金额=套餐总金额×折扣率/100;套餐总=Σ(档位年价×份数×计费系数)。折扣只改合同总额,不进订阅冻结价。折后金额见本卡片标题行右侧。</FieldHint></span><Input id="contract-discount" type="number" min={1} max={100} step={0.01} inputMode="decimal" placeholder="100" aria-invalid={parseDiscountRate(draft.discountRate) === null ? true : undefined} value={draft.discountRate} onChange={(event) => set("discountRate", event.target.value)} /></label>
 
-            {/* 服务期(月):替代原「付款周期」,标题右侧挂月/季/年/3 年快捷档(点一下直接填月数)。 */}
+            {/* 服务期(月):替代原「付款周期」,输入框下方提供月/季/年/3 年快捷档(点一下直接填月数)。 */}
             <div className="contract-months-cell">
               <span className="ops-field-title">服务期(月) <b title="必填">*</b>
-                {!monthsLocked && <span className="contract-months-presets" role="group" aria-label="服务期快捷档">
-                  {SERVICE_MONTH_PRESETS.map((preset) => {
-                    const active = draft.serviceMonths.trim() === String(preset.months);
-                    return <button key={preset.months} type="button" className={active ? "is-active" : ""} aria-pressed={active} onClick={() => set("serviceMonths", String(preset.months))}>{preset.label}</button>;
-                  })}
-                </span>}
                 <FieldHint label="服务期说明">{monthsLocked
                   ? "扩容补充协议:到期日锁在原合同止期 ⇒ 服务期=所选生效日撑到止期的月数,随生效日自动换算,不可手填。"
-                  : "可填 1~600 的整数月;也可点标题右侧的快捷档(月 1/季 3/年 12/3 年 36)。到期日期=生效日+服务期(月)−1 天,该月无对应日先取月末,不可手改。"}</FieldHint>
+                  : "可填 1~600 的整数月;也可使用下方快捷档(月 1/季 3/年 12/3 年 36)。到期日期=生效日+服务期(月)−1 天,该月无对应日先取月末,不可手改。"}</FieldHint>
               </span>
-              <Input id="service-months" type="number" min={1} max={600} step={1} inputMode="numeric" placeholder="1~600" readOnly={monthsLocked} aria-readonly={monthsLocked || undefined} className={monthsLocked ? "cursor-not-allowed bg-muted/40" : undefined} aria-invalid={invalidOf("serviceMonths")} value={draft.serviceMonths} onChange={(event) => set("serviceMonths", event.target.value)} />
+              <Input id="service-months" aria-label="服务期(月)" type="number" min={1} max={600} step={1} inputMode="numeric" placeholder="1~600" readOnly={monthsLocked} aria-readonly={monthsLocked || undefined} aria-invalid={invalidOf("serviceMonths")} value={draft.serviceMonths} onChange={(event) => set("serviceMonths", event.target.value)} />
+                {!monthsLocked && <div className="contract-editor-presets" role="group" aria-label="服务期快捷档">
+                  {SERVICE_MONTH_PRESETS.map((preset) => {
+                    const active = draft.serviceMonths.trim() === String(preset.months);
+                    return <Button key={preset.months} type="button" size="sm" variant={active ? "secondary" : "outline"} aria-pressed={active} onClick={() => set("serviceMonths", String(preset.months))}>{preset.label}</Button>;
+                  })}
+                </div>}
               {requiredErrorOf("serviceMonths")}
             </div>
-            <label htmlFor="start-date"><span className="ops-field-title">生效日期 <b title="必填">*</b>{startLocked && <FieldHint label="生效日期说明">{draft.contractType === "change" ? "变更协议:生效日锁定在原合同生效日(期间沿用原合同)。" : "续签:生效日期=旧合同结束日的次日(该日早于今天时取今天),锁定不可改;改服务期只会重算到期日期。"}</FieldHint>}{monthsLocked && <FieldHint label="生效日期说明">扩容补充协议:默认业务当天,可调整;到期日锁在原合同止期,服务期随生效日自动换算。</FieldHint>}</span><Input id="start-date" type="date" readOnly={startLocked} aria-readonly={startLocked || undefined} className={startLocked ? "cursor-not-allowed bg-muted/40" : undefined} aria-invalid={invalidOf("start")} value={draft.start} onChange={(event) => set("start", event.target.value)} />{requiredErrorOf("start")}</label>
+            <label htmlFor="start-date"><span className="ops-field-title">生效日期 <b title="必填">*</b>{startLocked && <FieldHint label="生效日期说明">{draft.contractType === "change" ? "变更协议:生效日锁定在原合同生效日(期间沿用原合同)。" : "续签:生效日期=旧合同结束日的次日(该日早于今天时取今天),锁定不可改;改服务期只会重算到期日期。"}</FieldHint>}{monthsLocked && <FieldHint label="生效日期说明">扩容补充协议:默认业务当天,可调整;到期日锁在原合同止期,服务期随生效日自动换算。</FieldHint>}</span><Input id="start-date" type="date" readOnly={startLocked} aria-readonly={startLocked || undefined} aria-invalid={invalidOf("start")} value={draft.start} onChange={(event) => set("start", event.target.value)} />{requiredErrorOf("start")}</label>
             <label htmlFor="end-date"><span className="ops-field-title">到期日期 {endLocked ? <small>承接原合同</small> : draft.contractType === "change" ? <small>带入原到期,可改</small> : <small>自动推算</small>}<FieldHint label="到期日期说明">{monthsLocked
               ? <>扩容补充协议:到期日锁定在原合同的止期,<b>不可手改</b>;改生效日期只换算服务期。</>
               : draft.contractType === "renew" && endLocked
@@ -1573,7 +1582,7 @@ export function ContractEditorPage() {
                   : draft.start && draft.serviceMonths ? <>=生效日+服务期(月)再减一天,该月无对应日先取月末;<b>不可手改</b>,改生效日或服务期即自动重算。</> : <>先填「生效日期」与「服务期(月)」,到期日期自动算出,<b>不可手改</b>。</>}</FieldHint></span>{(() => {
               /** 只有变更协议放开手改;其余类型(含承接续签/扩容)到期日恒不可手填。 */
               const editable = draft.contractType === "change";
-              return <Input id="end-date" type="date" value={draft.end} readOnly={!editable} aria-readonly={!editable} className={editable ? undefined : "cursor-not-allowed bg-muted/40"} onChange={(event) => set("end", event.target.value)} />;
+              return <Input id="end-date" type="date" value={draft.end} readOnly={!editable} aria-readonly={!editable} onChange={(event) => set("end", event.target.value)} />;
             })()}</label>
           </div>
           {draft.contractType === "expand" && <p className="ops-field-note contract-type-hint">合同类型为「扩容补充协议」:03 服务构成须全部为增量叠加服务(引用本客户既有跨境链路订阅,不新开链路)。</p>}
@@ -1623,8 +1632,8 @@ export function ContractEditorPage() {
           {attachmentError && <small className="customer-field-error">{attachmentError}</small>}
         </section>
 
-        <section className="ops-record-card">
-          <div className="customer-form-section-title"><span>03</span><div><h2>服务构成</h2><p>按目录档位选择(跨境链路 × 1/叠加服务 × 份数)。</p></div></div>
+        <section id="contract-editor-services" tabIndex={-1} aria-labelledby="contract-editor-services-title" className="ops-record-card">
+          <div className="customer-form-section-title"><span>03</span><div><h2 id="contract-editor-services-title">服务构成</h2><p>选择套餐与线路出口,在链路下添加所需的叠加服务。</p></div></div>
           {!plans.length && <p className="contract-form-summary">{catalog.error ? <>套餐配置取数失败:{catalog.error.message}</> : catalog.loading ? "正在载入套餐配置…" : "套餐配置暂无可选档位。"}</p>}
           {exitCatalog.error && <FetchError message={exitCatalog.error.message} onRetry={exitCatalog.reload} />}
           {!exitCatalog.loading && !exitCatalog.error && !exitOptions.length && <p className="contract-form-summary">套餐配置尚未配置线路出口;请先到「套餐配置 → 线路出口」维护。</p>}
@@ -1636,7 +1645,7 @@ export function ContractEditorPage() {
             {/* 合同类型已上移到 02 合同基本信息(2026-11-19):此处只按类型呈现录入模式,⛔ 再给一套并行的类型开关。 */}
             {draft.increment && !editing && <p className="ops-form-span-full contract-form-summary">合同类型为「扩容补充协议」:不新建链路,只引用本客户一条在期跨境链路订阅并叠加叠加服务(D-9)。</p>}
             {draft.increment && !editing && (
-              <div className="ops-form-span-full">
+              <div className="ops-form-grid contract-reference-picker ops-form-span-full">
                 <label htmlFor="increment-link"><span className="ops-field-title">引用既有跨境链路订阅 <b title="必填">*</b><FieldHint label="引用既有跨境链路订阅说明">只列本客户 status=active、未到期、plan_family=link 的订阅;引用后该节点只读,要换链路请另开一份增量合同,⛔ 在原合同上改引。</FieldHint></span></label>
                 <select id="increment-link" aria-label="引用既有跨境链路订阅" data-placeholder value="" onChange={(event) => { addIncrementItem(event.target.value); event.target.value = ""; }} disabled={!customerId || linkSubscriptions.loading}>
                   <option value="">{!customerId ? "请先选定签约客户" : linkSubscriptions.loading ? "正在读取该客户在期链路订阅…" : linkOptions.length ? "选择本客户在期链路订阅(可跨合同)" : "该客户没有在期的跨境链路订阅"}</option>
@@ -1687,7 +1696,7 @@ export function ContractEditorPage() {
                     <span className="ops-contract-index">{roleMark}</span>
                     <Button variant="ghost" size="sm" className="ops-contract-item-remove" aria-label={`删除${roleMark}`} title={child ? "删除该叠加服务(父行保留)" : "删除该条目(其下叠加服务一并删除)"} onClick={() => removeItem(index)}><Trash2 size={15} /></Button>
                   </header>
-                  <div className={`ops-contract-item-grid${stackable ? " has-qty" : ""}`}>
+                  <div className={`ops-form-grid ops-contract-item-grid${stackable ? " has-qty" : ""}`}>
                     <div className="ops-contract-plan-cell">
                       <div className="ops-contract-plan-title">
                         <span className="ops-field-title">套餐档位 <b title="必填">*</b></span>
@@ -1718,7 +1727,7 @@ export function ContractEditorPage() {
                     {inheritsExit ? (
                       <div className="ops-contract-exit-cell">
                         <span className="ops-field-title">线路出口 <small>{item.itemMode === "increment" ? "依从引用" : "依从父行"}</small></span>
-                        <span className="ops-contract-exit-inherited" data-placeholder={!inheritedExits.length} title="叠加服务不单独选线路出口:恒依从所挂跨境链路的出口">{inheritedExits.join("、") || (item.itemMode === "increment" ? "引用链路未登记出口" : "父条目尚未选择")}</span>
+                        <Input aria-label="继承的线路出口" readOnly value={inheritedExits.join("、")} placeholder={item.itemMode === "increment" ? "引用链路未登记出口" : "父条目尚未选择"} title="叠加服务沿用所挂链路的线路出口" />
                       </div>
                     ) : legacyMultiExit ? (
                       /* 2026-11-17 出口改单选后的历史多出口条目:只读呈现,⛔ 可改。 */
@@ -1778,34 +1787,25 @@ export function ContractEditorPage() {
 
       </div>
 
-      <aside className="ops-record-side">
-        {/* 业务口径摘要(原型同款):随所选档位×份数实时汇总,⛔ 手填。 */}
-        <section className="ops-record-card">
-          <h2>业务口径摘要</h2>
+      <aside className="ops-record-side" aria-label="合同确认">
+        <section className="ops-record-card contract-editor-review">
+          <div className="contract-editor-review-head"><span>签约预览</span><h2>{editing ? customerLabel : customerTerm || "待选择客户"}</h2><p>{CONTRACT_TYPES.find((item) => item.value === draft.contractType)?.label}</p></div>
+          <div className="contract-editor-total"><span>合同金额</span><strong aria-live="polite">{sideMetrics.finalAmount}</strong></div>
           <div className="ops-contract-summary contract-side-kv">
             <div><span>订购项</span><strong>{sideMetrics.items} 条</strong></div>
             <div><span>服务期</span><strong>{sideMetrics.serviceMonths}</strong></div>
             <div><span>月度费用合计</span><strong>{sideMetrics.fee}</strong></div>
             <div><span>套餐总金额</span><strong>{sideMetrics.packageTotal}</strong></div>
             <div><span>折扣率</span><strong>{sideMetrics.discountRate}</strong></div>
-            <div><span>最终合同金额</span><strong>{sideMetrics.finalAmount}</strong></div>
           </div>
-        </section>
-
-        <section className="ops-record-card">
-          <h2>必填完成度</h2>
-          <div className="contract-progress" role="progressbar" aria-valuemin={0} aria-valuemax={100} aria-valuenow={requiredProgress.pct} aria-label="必填完成度"><i style={{ width: `${requiredProgress.pct}%` }} /></div>
-          <div className="ops-contract-summary contract-side-kv">
-            <div><span>已填 / 必填</span><strong>{requiredProgress.done} / {requiredProgress.total}</strong></div>
+          <div className="contract-editor-completion">
+            <div><span>必填完成度</span><strong>{requiredProgress.done} / {requiredProgress.total}</strong></div>
+            <div className="contract-progress" role="progressbar" aria-valuemin={0} aria-valuemax={100} aria-valuenow={requiredProgress.pct} aria-label="必填完成度"><i style={{ width: `${requiredProgress.pct}%` }} /></div>
           </div>
-        </section>
-
-        {/* 动作区(2026-11-19):不再列「提交后系统生成」说明,只留提交与取消。 */}
-        <section className="ops-record-card">
           {error && <p className="ops-form-error" role="alert">{error}</p>}
-          <div className="ops-form-actions">
-            <Button size="sm" disabled={submitting || replacementBusy || (editing && record.loading)} onClick={save}>{submitting ? "正在提交…" : replacementBusy ? "正在比对替换候选…" : editing ? "保存修改" : "校验并提交"}</Button>
-            <Button size="sm" variant="outline" onClick={() => navigate(-1)}>取消</Button>
+          <div className="contract-editor-submit">
+            <Button disabled={submitting || replacementBusy || (editing && record.loading)} onClick={save}>{submitting ? "正在提交…" : replacementBusy ? "正在比对替换候选…" : editing ? "保存修改" : "创建合同"}</Button>
+            <Button variant="outline" onClick={() => navigate(-1)}>取消</Button>
           </div>
         </section>
       </aside>

+ 82 - 83
web-scaffold/src/styles/contract-editor.css

@@ -1,88 +1,87 @@
-.contract-editor :is(.ops-field-title, .customer-team-field > span) {
-  display: inline-flex;
-  align-items: center;
-  gap: 3px;
-  min-height: 20px;
-  color: var(--field-label);
-  font: 400 var(--type-support)/1.5 var(--font-sans);
-}
+/* Page layout; form controls inherit the shared defaults from operations.css. */
+.contract-editor { min-width: 0; }
+.contract-editor .contract-editor-eyebrow { margin: 0 0 8px; color: var(--primary); font: 500 var(--type-meta)/1.4 var(--font-mono); letter-spacing: .12em; }
+.contract-editor > .ops-page-head { align-items: center; margin-bottom: 24px; }
+.contract-editor > .ops-record-layout { grid-template-columns: minmax(0, 1fr) 292px; gap: 24px; }
+.contract-editor .ops-record-stack { gap: 20px; }
+.contract-editor .ops-record-card { padding: 24px; box-shadow: none; }
+.contract-editor .ops-record-stack > section { scroll-margin-top: 24px; }
+.contract-editor .ops-record-stack > section:focus { outline: none; }
+.contract-editor .ops-record-stack > section:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
+.contract-editor-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
+.contract-editor-nav > button { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 15px 16px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); text-align: left; cursor: pointer; transition: border-color .15s; }
+.contract-editor-nav > button:hover { border-color: var(--primary); }
+.contract-editor-nav > button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
+.contract-editor-nav > button > span { color: var(--primary); font: 500 18px/1 var(--font-mono); }
+.contract-editor-nav > button > div { display: grid; min-width: 0; gap: 4px; }
+.contract-editor-nav strong { color: var(--foreground); font-size: var(--type-support); font-weight: 500; }
+.contract-editor-nav small { color: var(--muted-foreground); font-size: var(--type-meta); }
+.contract-editor .customer-form-section-title { align-items: center; gap: 12px; margin: 0 0 24px; padding: 0 0 20px; border-radius: 0; border-bottom: 1px solid var(--border-subtle); background: none; }
+.contract-editor .customer-form-section-title > span { margin: 0; background: var(--surface-subtle); color: var(--text-secondary); font-weight: 500; }
+.contract-editor .customer-form-section-title > div:not(.contract-section-amount) { min-width: 0; }
+.contract-editor .customer-form-section-title h2 { font-size: 15px; font-weight: 600; }
+.contract-editor .ops-record-card .ops-form-grid--business { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
+.contract-editor .contract-editor-group { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin: 6px 0 0; padding-top: 20px; border-top: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: var(--type-support); font-weight: 500; }
+.contract-editor-group small { color: var(--muted-foreground); font-size: var(--type-meta); font-weight: 400; }
+.contract-editor .contract-customer-fields { margin-top: 18px; }
+.contract-editor .ops-field-title { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px; white-space: normal; font-weight: 400; }
 .contract-editor .field-hint { flex: none; }
-.contract-editor :is(.ops-form-grid label, .ops-contract-item-grid label) {
-  gap: 6px;
-  color: var(--field-label);
-  font: 400 var(--type-support)/1.5 var(--font-sans);
-}
-.contract-editor :is(
-  input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
-  select,
-  .ui-tree-select-trigger,
-  .customer-team-multi > summary,
-  .ops-contract-exit-inherited
-) {
-  box-sizing: border-box;
-  width: 100%;
-  min-width: 0;
-  height: 37px;
-  min-height: 37px;
-  padding: 0 10px;
-  border: 1px solid var(--border);
-  border-radius: var(--radius-control);
-  background-color: var(--card);
-  color: var(--foreground);
-  font: 400 var(--type-support)/1.5 var(--font-sans);
-}
-.contract-editor select {
-  padding-right: 32px;
-  appearance: none;
-  background-image: var(--select-chevron);
-  background-repeat: no-repeat;
-  background-size: 16px;
-  background-position: right 10px center;
-  white-space: nowrap;
-  text-overflow: ellipsis;
-}
-.contract-editor textarea {
-  width: 100%;
-  min-height: 76px;
-  padding: 8px 10px;
-  border: 1px solid var(--border);
-  border-radius: var(--radius-control);
-  background: var(--card);
-  color: var(--foreground);
-  font: 400 var(--type-support)/1.5 var(--font-sans);
-}
-.contract-editor :is(input, textarea)::placeholder,
-.contract-editor select[data-placeholder="true"] {
-  color: color-mix(in oklab, var(--muted-foreground) 70%, transparent);
-  font-weight: 400;
-  opacity: 1;
-}
-.contract-editor .ui-tree-select-value.is-placeholder { color: color-mix(in oklab, var(--muted-foreground) 70%, transparent); font-weight: 400; }
-.contract-editor :is(input, select, textarea):is([readonly], :disabled),
-.contract-editor .ops-contract-exit-inherited {
-  background-color: var(--surface-subtle);
-  color: var(--muted-foreground);
-}
-.contract-editor select[data-placeholder="true"]:is(:disabled, :enabled) {
-  color: color-mix(in oklab, var(--muted-foreground) 70%, transparent);
-  font: 400 var(--type-support)/1.5 var(--font-sans);
-}
+.contract-editor .contract-customer-combobox > label { flex-direction: row; }
+.contract-editor .contract-renew-block { grid-template-columns: minmax(0, 1fr); margin-bottom: 20px; }
+.contract-editor-presets { display: flex; flex-wrap: wrap; gap: 6px; }
+.contract-editor .contract-reference-picker { grid-template-columns: minmax(0, 1fr); gap: 6px; }
+.contract-editor .ops-contract-item-group { gap: 12px; }
+.contract-editor .ops-contract-item { padding: 16px; gap: 12px; background: var(--card); border-radius: var(--radius-control); }
+.contract-editor .ops-contract-item.is-child { margin-left: 20px; border-left: 2px solid var(--primary-border); }
+.contract-editor .ops-contract-item-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
+.contract-editor .ops-contract-item-grid.has-qty { grid-template-columns: minmax(0, 1.6fr) 84px minmax(0, 1fr); }
+.contract-editor .ops-contract-plan-cell, .contract-editor .ops-contract-qty-cell, .contract-editor .ops-contract-exit-cell { gap: 6px; }
+.contract-editor .ops-contract-plan-title { flex-wrap: wrap; }
+.contract-editor .ops-contract-item-actions { padding-top: 16px; border-top: 1px solid var(--border-subtle); }
+.contract-editor .contract-license-drop { padding: 16px; background: var(--card); }
+.contract-editor .contract-license-drop:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px var(--ring-glow); }
+.contract-editor .contract-license-drop.is-dragging { border-color: var(--primary); background: var(--primary-soft); }
+.contract-editor .contract-license-drop-body { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 5px 10px; }
+.contract-editor .contract-license-drop-body > svg { grid-row: span 2; align-self: center; }
+.contract-editor .contract-license-drop-body > strong { font-size: var(--type-support); }
+.contract-editor .contract-license-drop-body > span { grid-column: 2; white-space: normal; overflow-wrap: anywhere; font-size: var(--type-meta); }
+.contract-editor .ops-record-side { top: 20px; }
+.contract-editor .contract-editor-review { padding: 22px; }
+.contract-editor-review-head > span { color: var(--muted-foreground); font-size: var(--type-meta); }
+.contract-editor .contract-editor-review-head h2 { display: block; margin: 10px 0 6px; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
+.contract-editor-review-head p { margin: 0; font-size: var(--type-meta); color: var(--text-secondary); }
+.contract-editor-total { display: grid; gap: 8px; margin: 20px 0; padding: 18px 0; border-block: 1px solid var(--border-subtle); }
+.contract-editor-total > span { color: var(--text-secondary); font-size: var(--type-support); }
+.contract-editor-total strong { color: var(--primary); font-size: 25px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
+.contract-editor .contract-side-kv { gap: 14px; }
+.contract-editor .contract-side-kv > div { align-items: baseline; gap: 12px; }
+.contract-editor .contract-side-kv strong { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
+.contract-editor-completion { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-subtle); }
+.contract-editor-completion > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: var(--type-meta); color: var(--text-secondary); }
+.contract-editor-completion strong { color: var(--primary); font-weight: 500; }
+.contract-editor .contract-progress { height: 4px; margin-top: 10px; }
+.contract-editor-submit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 22px; }
+/* Empty values in native and composite selects use the Input placeholder token. */
+.contract-editor select[data-placeholder="true"]:is(:disabled, :enabled),
+.contract-editor select[data-placeholder="true"]:not(:open) option:checked,
+.contract-editor .ui-tree-select-value.is-placeholder,
+.contract-editor .customer-team-multi.is-placeholder > summary > span { color: color-mix(in oklab, var(--muted-foreground) 70%, transparent); font-weight: 400; }
 .contract-editor select[data-placeholder="true"] option { color: var(--foreground); }
-.contract-editor select[data-placeholder="true"]:not(:open) option:checked {
-  color: color-mix(in oklab, var(--muted-foreground) 70%, transparent);
-  font: 400 var(--type-support)/1.5 var(--font-sans);
+@media (min-width: 1640px) {
+  .contract-editor .ops-record-card .ops-form-grid--business { grid-template-columns: repeat(3, minmax(0, 1fr)); }
 }
-.contract-editor .customer-team-multi.is-placeholder > summary > span { color: color-mix(in oklab, var(--muted-foreground) 70%, transparent); }
-.contract-editor :is(input, select, textarea):focus-visible {
-  outline: none;
-  border-color: var(--ring);
-  box-shadow: 0 0 0 3px var(--ring-glow);
+@media (max-width: 1180px) {
+  .contract-editor > .ops-record-layout { grid-template-columns: minmax(0, 1fr); }
+  .contract-editor .ops-record-side { position: static; }
 }
-.contract-editor :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--destructive); }
-.contract-editor .ops-contract-plan-cell,
-.contract-editor .ops-contract-qty-cell,
-.contract-editor .ops-contract-exit-cell { gap: 6px; }
-
-.contract-editor .ops-contract-exit-inherited[data-placeholder="true"] {
-  color: color-mix(in oklab, var(--muted-foreground) 70%, transparent);
+@media (max-width: 600px) {
+  .contract-editor > .ops-page-head { align-items: flex-start; flex-direction: column; }
+  .contract-editor .ops-record-card { padding: 18px; }
+  .contract-editor-nav { gap: 6px; }
+  .contract-editor-nav > button { padding: 12px 8px; flex-direction: column; align-items: flex-start; gap: 8px; }
+  .contract-editor-nav small { display: none; }
+  .contract-editor .customer-form-section-title { flex-wrap: wrap; }
+  .contract-editor .contract-section-amount { flex-basis: 100%; align-items: flex-start; text-align: left; margin-left: 38px; }
+  .contract-editor .ops-record-card .ops-form-grid--business, .contract-editor .ops-contract-item-grid, .contract-editor .ops-contract-item-grid.has-qty { grid-template-columns: minmax(0, 1fr); }
+  .contract-editor .ops-contract-item.is-child { margin-left: 10px; }
 }