|
@@ -5,6 +5,7 @@ import { useNavigate, useParams, useSearchParams } from "react-router";
|
|
|
import { Button } from "../components/ui/button";
|
|
import { Button } from "../components/ui/button";
|
|
|
import { Input } from "../components/ui/input";
|
|
import { Input } from "../components/ui/input";
|
|
|
import { TreeSelect } from "../components/ui/tree-select";
|
|
import { TreeSelect } from "../components/ui/tree-select";
|
|
|
|
|
+import { FieldHint } from "../components/ui/field-hint";
|
|
|
import { CustomerTeamSelect } from "../components/CustomerTeamSelect";
|
|
import { CustomerTeamSelect } from "../components/CustomerTeamSelect";
|
|
|
import { contractRawByParam } from "../lib/contract-demo";
|
|
import { contractRawByParam } from "../lib/contract-demo";
|
|
|
import { contractAttachmentDiscard, contractCreate, contractCustomerLookup, contractGet, contractGetList, contractUpdate, orderGetList, rowsOf, subscriptionReplacementCandidates } from "../lib/api/bos";
|
|
import { contractAttachmentDiscard, contractCreate, contractCustomerLookup, contractGet, contractGetList, contractUpdate, orderGetList, rowsOf, subscriptionReplacementCandidates } from "../lib/api/bos";
|
|
@@ -937,9 +938,8 @@ export function ContractEditorPage() {
|
|
|
{inlineSubjectOptions.map((item) => <option key={item.code} value={item.code}>{item.name}</option>)}
|
|
{inlineSubjectOptions.map((item) => <option key={item.code} value={item.code}>{item.name}</option>)}
|
|
|
</select>
|
|
</select>
|
|
|
</label>
|
|
</label>
|
|
|
- <label htmlFor="inline-id"><span className="ops-field-title">客户识别号 <b title="必填">*</b></span>
|
|
|
|
|
|
|
+ <label htmlFor="inline-id"><span className="ops-field-title">客户识别号 <b title="必填">*</b><FieldHint label="客户识别号说明">18 位统一社会信用代码 / 15 位旧执照号。同时是查重与重试幂等键:合同保存失败后重新保存会按它命中已建客户。</FieldHint></span>
|
|
|
<Input id="inline-id" placeholder="18 位统一社会信用代码 / 15 位旧执照号" value={inline.idNo} onChange={(event) => setInlineField("idNo", event.target.value)} />
|
|
<Input id="inline-id" placeholder="18 位统一社会信用代码 / 15 位旧执照号" value={inline.idNo} onChange={(event) => setInlineField("idNo", event.target.value)} />
|
|
|
- <small>同时是查重与重试幂等键:合同保存失败后重新保存会按它命中已建客户。</small>
|
|
|
|
|
</label>
|
|
</label>
|
|
|
<label htmlFor="inline-contact"><span className="ops-field-title">经办联系人</span><Input id="inline-contact" placeholder="客户方经办人" value={inline.contact} onChange={(event) => setInlineField("contact", event.target.value)} /></label>
|
|
<label htmlFor="inline-contact"><span className="ops-field-title">经办联系人</span><Input id="inline-contact" placeholder="客户方经办人" value={inline.contact} onChange={(event) => setInlineField("contact", event.target.value)} /></label>
|
|
|
<label htmlFor="inline-phone"><span className="ops-field-title">联系电话</span><Input id="inline-phone" placeholder="支持固定电话或手机号" value={inline.phone} onChange={(event) => setInlineField("phone", event.target.value)} /></label>
|
|
<label htmlFor="inline-phone"><span className="ops-field-title">联系电话</span><Input id="inline-phone" placeholder="支持固定电话或手机号" value={inline.phone} onChange={(event) => setInlineField("phone", event.target.value)} /></label>
|
|
@@ -947,16 +947,14 @@ export function ContractEditorPage() {
|
|
|
<label htmlFor="inline-region" className="ops-form-span-2"><span className="ops-field-title">挂载区域 <b title="必填">*</b></span>
|
|
<label htmlFor="inline-region" className="ops-form-span-2"><span className="ops-field-title">挂载区域 <b title="必填">*</b></span>
|
|
|
<TreeSelect treeData={regionTree} value={inline.regionId} onChange={(value) => setInlineField("regionId", value)} ariaLabel="挂载区域" placeholder="请选择区域节点" name="inline-region" />
|
|
<TreeSelect treeData={regionTree} value={inline.regionId} onChange={(value) => setInlineField("regionId", value)} ariaLabel="挂载区域" placeholder="请选择区域节点" name="inline-region" />
|
|
|
</label>
|
|
</label>
|
|
|
- <label htmlFor="inline-operator"><span className="ops-field-title">运营商 <b title="必填">*</b></span>
|
|
|
|
|
|
|
+ <label htmlFor="inline-operator"><span className="ops-field-title">运营商 <b title="必填">*</b><FieldHint label="运营商说明">{provinceId ? "候选=所挂区域省份下可见的运营商档案(按需预选第一个,可改)。" : "先选挂载区域:运营商档案须与该区域同省,否则建档会被省份一致性校验拦下。"}</FieldHint></span>
|
|
|
<select id="inline-operator" value={inline.operatorId} onChange={(event) => setInlineField("operatorId", event.target.value)}>
|
|
<select id="inline-operator" value={inline.operatorId} onChange={(event) => setInlineField("operatorId", event.target.value)}>
|
|
|
<option value="">请选择运营商</option>
|
|
<option value="">请选择运营商</option>
|
|
|
{operatorOptions.map((item) => <option key={item.id} value={item.id}>{item.name}</option>)}
|
|
{operatorOptions.map((item) => <option key={item.id} value={item.id}>{item.name}</option>)}
|
|
|
</select>
|
|
</select>
|
|
|
- <small>{provinceId ? "候选=所挂区域省份下可见的运营商档案(按需预选第一个,可改)。" : "先选挂载区域:运营商档案须与该区域同省,否则建档会被省份一致性校验拦下。"}</small>
|
|
|
|
|
</label>
|
|
</label>
|
|
|
- <div className="customer-team-field"><span className="ops-field-title">运维团队 <b title="必填">*</b></span>
|
|
|
|
|
|
|
+ <div className="customer-team-field"><span className="ops-field-title">运维团队 <b title="必填">*</b><FieldHint label="运维团队说明">单支定案:一个客户同一时刻恰好挂 1 支运维团队;默认预选范围内的第一支,可改。</FieldHint></span>
|
|
|
<CustomerTeamSelect options={org.maintenanceTeams.map((item) => ({ id: item.id, name: item.name, hint: (item.ticketTypes ?? []).join("、") }))} value={inline.teamId} onChange={(id) => setInlineField("teamId", id)} />
|
|
<CustomerTeamSelect options={org.maintenanceTeams.map((item) => ({ id: item.id, name: item.name, hint: (item.ticketTypes ?? []).join("、") }))} value={inline.teamId} onChange={(id) => setInlineField("teamId", id)} />
|
|
|
- <small>单支定案:一个客户同一时刻恰好挂 1 支运维团队;默认预选范围内的第一支,可改。</small>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
<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-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>
|
|
<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>
|
|
@@ -981,7 +979,7 @@ export function ContractEditorPage() {
|
|
|
<div className="customer-form-section-title"><span>02</span><div><h2>合同基本要素</h2><p>必填。金额与付款周期确定期间,结束日由生效日自动推算、不可手改。</p></div></div>
|
|
<div className="customer-form-section-title"><span>02</span><div><h2>合同基本要素</h2><p>必填。金额与付款周期确定期间,结束日由生效日自动推算、不可手改。</p></div></div>
|
|
|
{!editing && customerId && (
|
|
{!editing && customerId && (
|
|
|
<div className="contract-renew-block">
|
|
<div className="contract-renew-block">
|
|
|
- <label htmlFor="renew-from"><span className="ops-field-title">续签自旧合同 <small>可选</small></span>
|
|
|
|
|
|
|
+ <label htmlFor="renew-from"><span className="ops-field-title">续签自旧合同 <small>可选</small><FieldHint label="续签自旧合同说明">选中即带出旧合同的合同金额、付款周期、服务条目与运营商经办人三件套,并把<b>合同生效日自动推为旧合同结束日的次日</b>(该日已早于今天时取今天,结束日再按付款周期推算);合同编号/外部单号/附件/交接日期仍按本合同填写(交接日期默认录入当日)。续签按「新订阅开通」落库:不截原、不挂替换边、不出第七类工单;<b>服务条目与旧合同逐条一致(形式/档位/份数/席位/带宽/出口,价格不算)时视为无需施工,不出开通工单</b>,新订阅按续签开始日记为已交付。</FieldHint></span>
|
|
|
<select id="renew-from" value={renewFrom} disabled={renewLoading || submitting} onChange={(event) => void pickRenewal(event.target.value)}>
|
|
<select id="renew-from" value={renewFrom} disabled={renewLoading || submitting} onChange={(event) => void pickRenewal(event.target.value)}>
|
|
|
<option value="">不续签(手工录入)</option>
|
|
<option value="">不续签(手工录入)</option>
|
|
|
{/* 深链续签源若不在客户合同列表里(已归档等),补一个同文案的选项,⛔ 让下拉空着。 */}
|
|
{/* 深链续签源若不在客户合同列表里(已归档等),补一个同文案的选项,⛔ 让下拉空着。 */}
|
|
@@ -989,7 +987,6 @@ export function ContractEditorPage() {
|
|
|
{renewalOptions.map((row) => <option key={row.contract_id} value={row.contract_id}>{renewalOptionLabel(row)}</option>)}
|
|
{renewalOptions.map((row) => <option key={row.contract_id} value={row.contract_id}>{renewalOptionLabel(row)}</option>)}
|
|
|
</select>
|
|
</select>
|
|
|
</label>
|
|
</label>
|
|
|
- <p className="contract-form-summary">选中即带出旧合同的合同金额、付款周期、服务条目与运营商经办人三件套,并把<b>合同生效日自动推为旧合同结束日的次日</b>(该日已早于今天时取今天,结束日再按付款周期推算);合同编号/外部单号/附件/交接日期仍按本合同填写(交接日期默认录入当日)。续签按「新订阅开通」落库:不截原、不挂替换边、不出第七类工单;<b>服务条目与旧合同逐条一致(形式/档位/份数/席位/带宽/出口,价格不算)时视为无需施工,不出开通工单</b>,新订阅按续签开始日记为已交付。</p>
|
|
|
|
|
{renewalList.loading && <p className="contract-form-summary">正在读取该客户的合同…</p>}
|
|
{renewalList.loading && <p className="contract-form-summary">正在读取该客户的合同…</p>}
|
|
|
{renewalList.error && <p className="ops-form-error" role="alert">{renewalList.error.message}</p>}
|
|
{renewalList.error && <p className="ops-form-error" role="alert">{renewalList.error.message}</p>}
|
|
|
{renewLoading && <p className="contract-form-summary">正在读取旧合同条目…</p>}
|
|
{renewLoading && <p className="contract-form-summary">正在读取旧合同条目…</p>}
|
|
@@ -1002,14 +999,14 @@ export function ContractEditorPage() {
|
|
|
<label htmlFor="contract-amount"><span className="ops-field-title">合同金额(元) <b title="必填">*</b></span><Input id="contract-amount" inputMode="decimal" placeholder="0.00" aria-invalid={invalidOf("amount")} value={draft.amount} onChange={(event) => set("amount", event.target.value)} />{requiredErrorOf("amount")}</label>
|
|
<label htmlFor="contract-amount"><span className="ops-field-title">合同金额(元) <b title="必填">*</b></span><Input id="contract-amount" inputMode="decimal" placeholder="0.00" aria-invalid={invalidOf("amount")} value={draft.amount} onChange={(event) => set("amount", event.target.value)} />{requiredErrorOf("amount")}</label>
|
|
|
<label htmlFor="pay-cycle"><span className="ops-field-title">付款周期 <b title="必填">*</b></span><select id="pay-cycle" aria-invalid={invalidOf("payCycle")} value={draft.payCycle} onChange={(event) => set("payCycle", event.target.value)}><option value="">未配置</option>{OPTIONS.pay_cycle.map((item) => <option key={item.value} value={item.value}>{item.label}</option>)}</select>{requiredErrorOf("payCycle")}</label>
|
|
<label htmlFor="pay-cycle"><span className="ops-field-title">付款周期 <b title="必填">*</b></span><select id="pay-cycle" aria-invalid={invalidOf("payCycle")} value={draft.payCycle} onChange={(event) => set("payCycle", event.target.value)}><option value="">未配置</option>{OPTIONS.pay_cycle.map((item) => <option key={item.value} value={item.value}>{item.label}</option>)}</select>{requiredErrorOf("payCycle")}</label>
|
|
|
<label htmlFor="start-date"><span className="ops-field-title">合同生效日 <b title="必填">*</b></span><Input id="start-date" type="date" 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></span><Input id="start-date" type="date" 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">合同结束日 <small>自动推算</small></span><Input id="end-date" type="date" value={draft.end} readOnly aria-readonly="true" className="cursor-not-allowed bg-muted/40" /><span className="ops-field-note">{draft.start && draft.payCycle ? <>=生效日+付款周期(年付 12/季付 3/月付 1 个月)再减一天,该月无对应日先取月末;<b>不可手改</b>,改生效日或付款周期即自动重算。</> : <>先填「合同生效日」与「付款周期」,结束日自动算出,<b>不可手改</b>。</>}</span></label>
|
|
|
|
|
|
|
+ <label htmlFor="end-date"><span className="ops-field-title">合同结束日 <small>自动推算</small><FieldHint label="合同结束日说明">{draft.start && draft.payCycle ? <>=生效日+付款周期(年付 12/季付 3/月付 1 个月)再减一天,该月无对应日先取月末;<b>不可手改</b>,改生效日或付款周期即自动重算。</> : <>先填「合同生效日」与「付款周期」,结束日自动算出,<b>不可手改</b>。</>}</FieldHint></span><Input id="end-date" type="date" value={draft.end} readOnly aria-readonly="true" className="cursor-not-allowed bg-muted/40" /></label>
|
|
|
{/* 运营商经办人=交接单口径的三段,独占一行(机构/姓名/联系方式),⛔ 与上面六个商务格混排。 */}
|
|
{/* 运营商经办人=交接单口径的三段,独占一行(机构/姓名/联系方式),⛔ 与上面六个商务格混排。 */}
|
|
|
<div className="ops-form-span-full contract-agent-block">
|
|
<div className="ops-form-span-full contract-agent-block">
|
|
|
<span className="ops-field-title">运营商经办人</span>
|
|
<span className="ops-field-title">运营商经办人</span>
|
|
|
<div className="ops-form-grid contract-agent-grid">
|
|
<div className="ops-form-grid contract-agent-grid">
|
|
|
- <label htmlFor="agent-org"><span className="ops-field-title">机构 <small>选填</small></span><Input id="agent-org" placeholder="经办人所属机构" value={draft.agentOrg} onChange={(event) => set("agentOrg", event.target.value)} /><span className="ops-field-note">选填,不填也可提交;清空后保存即清除已记录的机构。</span></label>
|
|
|
|
|
|
|
+ <label htmlFor="agent-org"><span className="ops-field-title">机构 <small>选填</small><FieldHint label="经办人机构说明">选填,不填也可提交;清空后保存即清除已记录的机构。</FieldHint></span><Input id="agent-org" placeholder="经办人所属机构" value={draft.agentOrg} onChange={(event) => set("agentOrg", event.target.value)} /></label>
|
|
|
<label htmlFor="agent-name"><span className="ops-field-title">姓名 <b title="必填">*</b></span><Input id="agent-name" aria-invalid={invalidOf("agent")} value={draft.agent} onChange={(event) => set("agent", event.target.value)} />{requiredErrorOf("agent")}</label>
|
|
<label htmlFor="agent-name"><span className="ops-field-title">姓名 <b title="必填">*</b></span><Input id="agent-name" aria-invalid={invalidOf("agent")} value={draft.agent} onChange={(event) => set("agent", event.target.value)} />{requiredErrorOf("agent")}</label>
|
|
|
- <label htmlFor="agent-phone"><span className="ops-field-title">联系方式 <b title="必填">*</b></span><Input id="agent-phone" inputMode="numeric" aria-invalid={invalidOf("agentPhone")} value={draft.agentPhone} onChange={(event) => set("agentPhone", event.target.value)} />{requiredErrorOf("agentPhone")}<span className="ops-field-note">必填。当前登录身份未提供手机号时留空,请手工录入经办人实际联系电话。</span></label>
|
|
|
|
|
|
|
+ <label htmlFor="agent-phone"><span className="ops-field-title">联系方式 <b title="必填">*</b><FieldHint label="经办人联系方式说明">必填。当前登录身份未提供手机号时留空,请手工录入经办人实际联系电话。</FieldHint></span><Input id="agent-phone" inputMode="numeric" aria-invalid={invalidOf("agentPhone")} value={draft.agentPhone} onChange={(event) => set("agentPhone", event.target.value)} />{requiredErrorOf("agentPhone")}</label>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
{/*
|
|
{/*
|
|
@@ -1019,13 +1016,12 @@ export function ContractEditorPage() {
|
|
|
* 独占一行(`ops-form-span-full`),⛔ 与运营商经办人挤在同一行。
|
|
* 独占一行(`ops-form-span-full`),⛔ 与运营商经办人挤在同一行。
|
|
|
*/}
|
|
*/}
|
|
|
<div className="ops-form-span-full contract-agent-readonly">
|
|
<div className="ops-form-span-full contract-agent-readonly">
|
|
|
- <span className="ops-field-title">录入经办人 <small>=当前录入账号,提交时自动带入</small></span>
|
|
|
|
|
|
|
+ <span className="ops-field-title">录入经办人 <small>=当前录入账号,提交时自动带入</small><FieldHint label="录入经办人说明">这三段由录入时账号自动带入,建后恒只读(KLT-L221),不得手工改。</FieldHint></span>
|
|
|
<div className="contract-inline-group">
|
|
<div className="contract-inline-group">
|
|
|
<span className="contract-inline-seg"><small>机构</small><span className="contract-inline-readonly">{editing ? record.data?.created_by_org || "未记录" : "取账号绑定团队"}</span></span>
|
|
<span className="contract-inline-seg"><small>机构</small><span className="contract-inline-readonly">{editing ? record.data?.created_by_org || "未记录" : "取账号绑定团队"}</span></span>
|
|
|
<span className="contract-inline-seg"><small>姓名</small><span className="contract-inline-readonly">{editing ? record.data?.created_by_name || record.data?.created_by || "未记录" : identity?.name || "未登录"}</span></span>
|
|
<span className="contract-inline-seg"><small>姓名</small><span className="contract-inline-readonly">{editing ? record.data?.created_by_name || record.data?.created_by || "未记录" : identity?.name || "未登录"}</span></span>
|
|
|
<span className="contract-inline-seg"><small>联系方式</small><span className="contract-inline-readonly">{editing ? record.data?.created_by_mobile || "未绑定" : identity?.phone || "账号未绑手机号"}</span></span>
|
|
<span className="contract-inline-seg"><small>联系方式</small><span className="contract-inline-readonly">{editing ? record.data?.created_by_mobile || "未绑定" : identity?.phone || "账号未绑手机号"}</span></span>
|
|
|
</div>
|
|
</div>
|
|
|
- <span className="ops-field-note">这三段由录入时账号自动带入,建后恒只读(KLT-L221),不得手工改。</span>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
<label htmlFor="handover-on"><span className="ops-field-title">交接日期 <b title="必填">*</b></span><Input id="handover-on" type="date" aria-invalid={invalidOf("handoverOn")} value={draft.handoverOn} onChange={(event) => set("handoverOn", event.target.value)} />{requiredErrorOf("handoverOn")}</label>
|
|
<label htmlFor="handover-on"><span className="ops-field-title">交接日期 <b title="必填">*</b></span><Input id="handover-on" type="date" aria-invalid={invalidOf("handoverOn")} value={draft.handoverOn} onChange={(event) => set("handoverOn", event.target.value)} />{requiredErrorOf("handoverOn")}</label>
|
|
|
</div>
|
|
</div>
|
|
@@ -1042,27 +1038,21 @@ export function ContractEditorPage() {
|
|
|
*/}
|
|
*/}
|
|
|
{!editing && (
|
|
{!editing && (
|
|
|
<div className="ops-form-span-full contract-increment-mode">
|
|
<div className="ops-form-span-full contract-increment-mode">
|
|
|
- <label className="ops-field-title">合同类型</label>
|
|
|
|
|
|
|
+ <label className="ops-field-title">合同类型<FieldHint label="合同类型说明">{draft.increment ? "增量合同⛔ 新建链路:只能引用本客户一条在期跨境链路订阅(可跨合同),并在其下叠加附加项(D-9)。" : "普通合同可新建跨境链路,并在任意链路节点下挂附加项(D-7)。"}</FieldHint></label>
|
|
|
<div className="contract-increment-switch">
|
|
<div className="contract-increment-switch">
|
|
|
<Button type="button" variant={draft.increment ? "default" : "outline"} size="sm" aria-pressed={!draft.increment} onClick={() => toggleIncrement(false)}>普通合同(新建链路)</Button>
|
|
<Button type="button" variant={draft.increment ? "default" : "outline"} size="sm" aria-pressed={!draft.increment} onClick={() => toggleIncrement(false)}>普通合同(新建链路)</Button>
|
|
|
<Button type="button" variant={draft.increment ? "default" : "outline"} size="sm" aria-pressed={draft.increment} onClick={() => toggleIncrement(true)}>增量合同(链路已在用、只补附加项)</Button>
|
|
<Button type="button" variant={draft.increment ? "default" : "outline"} size="sm" aria-pressed={draft.increment} onClick={() => toggleIncrement(true)}>增量合同(链路已在用、只补附加项)</Button>
|
|
|
</div>
|
|
</div>
|
|
|
- <span className="ops-field-note">
|
|
|
|
|
- {draft.increment
|
|
|
|
|
- ? "增量合同⛔ 新建链路:只能引用本客户一条在期跨境链路订阅(可跨合同),并在其下叠加附加项(D-9)。"
|
|
|
|
|
- : "普通合同可新建跨境链路,并在任意链路节点下挂附加项(D-7)。"}
|
|
|
|
|
- </span>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
|
{draft.increment && !editing && (
|
|
{draft.increment && !editing && (
|
|
|
<div className="ops-form-span-full">
|
|
<div className="ops-form-span-full">
|
|
|
- <label htmlFor="increment-link"><span className="ops-field-title">引用既有跨境链路订阅 <b title="必填">*</b></span></label>
|
|
|
|
|
|
|
+ <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="引用既有跨境链路订阅" value="" onChange={(event) => { addIncrementItem(event.target.value); event.target.value = ""; }} disabled={!customerId || linkSubscriptions.loading}>
|
|
<select id="increment-link" aria-label="引用既有跨境链路订阅" value="" onChange={(event) => { addIncrementItem(event.target.value); event.target.value = ""; }} disabled={!customerId || linkSubscriptions.loading}>
|
|
|
<option value="">{!customerId ? "请先选定签约客户" : linkSubscriptions.loading ? "正在读取该客户在期链路订阅…" : linkOptions.length ? "选择本客户在期链路订阅(可跨合同)" : "该客户没有在期的跨境链路订阅"}</option>
|
|
<option value="">{!customerId ? "请先选定签约客户" : linkSubscriptions.loading ? "正在读取该客户在期链路订阅…" : linkOptions.length ? "选择本客户在期链路订阅(可跨合同)" : "该客户没有在期的跨境链路订阅"}</option>
|
|
|
{linkOptions.map((row) => <option key={row.subscription_id} value={row.subscription_id}>{[row.subscription_id, row.plan_name, row.contract_no, row.start_date && row.end_date ? `${row.start_date} 至 ${row.end_date}` : null, (row.line_exits ?? []).join("、")].filter(Boolean).join(" · ")}</option>)}
|
|
{linkOptions.map((row) => <option key={row.subscription_id} value={row.subscription_id}>{[row.subscription_id, row.plan_name, row.contract_no, row.start_date && row.end_date ? `${row.start_date} 至 ${row.end_date}` : null, (row.line_exits ?? []).join("、")].filter(Boolean).join(" · ")}</option>)}
|
|
|
</select>
|
|
</select>
|
|
|
{linkSubscriptions.error && <span className="ops-field-error">{linkSubscriptions.error.message}</span>}
|
|
{linkSubscriptions.error && <span className="ops-field-error">{linkSubscriptions.error.message}</span>}
|
|
|
- <span className="ops-field-note">只列本客户 `status=active`、未到期、`plan_family=link` 的订阅;引用后该节点只读,要换链路请另开一份增量合同,⛔ 在原合同上改引。</span>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
|
{(() => {
|
|
{(() => {
|
|
@@ -1101,13 +1091,19 @@ export function ContractEditorPage() {
|
|
|
<div className="ops-form-grid ops-form-grid--business">
|
|
<div className="ops-form-grid ops-form-grid--business">
|
|
|
<label><span className="ops-field-title">套餐档位 <small>{child || item.itemMode === "increment" ? "附加项" : "跨境链路"}</small></span><select value={item.planId} onChange={(event) => pickPlan(index, event.target.value)}><option value="">{catalog.loading ? "载入中…" : WORD_UNCONFIGURED}</option>{planOptions.map((plan) => <option key={plan.plan_id} value={plan.plan_id}>{plan.plan_name}{plan.plan_family ? `(${label(PLAN_FAMILY, plan.plan_family)})` : ""}</option>)}</select></label>
|
|
<label><span className="ops-field-title">套餐档位 <small>{child || item.itemMode === "increment" ? "附加项" : "跨境链路"}</small></span><select value={item.planId} onChange={(event) => pickPlan(index, event.target.value)}><option value="">{catalog.loading ? "载入中…" : WORD_UNCONFIGURED}</option>{planOptions.map((plan) => <option key={plan.plan_id} value={plan.plan_id}>{plan.plan_name}{plan.plan_family ? `(${label(PLAN_FAMILY, plan.plan_family)})` : ""}</option>)}</select></label>
|
|
|
{/* ⛔ 编辑态不再给「交付形态」格(2026-11-19):形态只由所引档位带入(D-15)。 */}
|
|
{/* ⛔ 编辑态不再给「交付形态」格(2026-11-19):形态只由所引档位带入(D-15)。 */}
|
|
|
- {stackablePlan(item.planId) && <label><span className="ops-field-title">份数 <small>=IP 个数</small></span><Input type="number" min={1} disabled={Boolean(item.replacesSubscriptionId)} value={item.quantity} onChange={(event) => patchItem(index, { quantity: Number(event.target.value) })} /><span className="ops-field-note">{item.replacesSubscriptionId ? "替换时一条条目只生一份订阅,份数固定为 1。" : "附加项按份计价(例如「单独境外 IP」按个);跨境链路档份数恒 1。"}</span></label>}
|
|
|
|
|
|
|
+ {stackablePlan(item.planId) && <label><span className="ops-field-title">份数 <small>=IP 个数</small><FieldHint label="份数说明">{item.replacesSubscriptionId ? "替换时一条条目只生一份订阅,份数固定为 1。" : "附加项按份计价(例如「单独境外 IP」按个);跨境链路档份数恒 1。"}</FieldHint></span><Input type="number" min={1} disabled={Boolean(item.replacesSubscriptionId)} value={item.quantity} onChange={(event) => patchItem(index, { quantity: Number(event.target.value) })} /></label>}
|
|
|
<div className="ops-form-span-full">
|
|
<div className="ops-form-span-full">
|
|
|
<Button type="button" variant="outline" size="sm" disabled={!customerId} title={customerId ? "为当前客户新建一个自定义档并直接选中" : "请先选定签约客户"} onClick={() => { setPlanEditorFor(index); setPlanEditor({ owner: customerId, planKind: "custom", lockOwner: true }); }}><Plus size={15} />新建本客户自定义档</Button>
|
|
<Button type="button" variant="outline" size="sm" disabled={!customerId} title={customerId ? "为当前客户新建一个自定义档并直接选中" : "请先选定签约客户"} onClick={() => { setPlanEditorFor(index); setPlanEditor({ owner: customerId, planKind: "custom", lockOwner: true }); }}><Plus size={15} />新建本客户自定义档</Button>
|
|
|
{!customerId && <span className="ops-field-note">选定客户后才能就地新建自定义档(自定义档必须归属一个客户)。</span>}
|
|
{!customerId && <span className="ops-field-note">选定客户后才能就地新建自定义档(自定义档必须归属一个客户)。</span>}
|
|
|
</div>
|
|
</div>
|
|
|
<fieldset className="ops-form-span-full ops-contract-exit-fieldset">
|
|
<fieldset className="ops-form-span-full ops-contract-exit-fieldset">
|
|
|
- <legend>线路出口(从套餐配置选择,{LINE_EXIT_MAX} 个)</legend>
|
|
|
|
|
|
|
+ <legend>线路出口(从套餐配置选择,{LINE_EXIT_MAX} 个)<FieldHint label="线路出口说明">
|
|
|
|
|
+ {item.exits.length > 1
|
|
|
|
|
+ ? `历史多出口条目只读(${item.exits.join("、")}):出口已改为单选,存量条目不做迁移;如需调整请新建条目。`
|
|
|
|
|
+ : child
|
|
|
|
|
+ ? `已选 ${item.exits.length}/${LINE_EXIT_MAX},候选只在父条目出口内(${options.join("、") || "父行尚未选"})。`
|
|
|
|
|
+ : `已选 ${item.exits.length}/${LINE_EXIT_MAX}。线路出口在「套餐配置 → 线路出口」统一维护,此处只做选择;再点已选项即清空。`}
|
|
|
|
|
+ </FieldHint></legend>
|
|
|
{exitCatalog.error && <FetchError message={exitCatalog.error.message} onRetry={exitCatalog.reload} />}
|
|
{exitCatalog.error && <FetchError message={exitCatalog.error.message} onRetry={exitCatalog.reload} />}
|
|
|
{!child && !exitCatalog.error && !exitOptions.length && !exitCatalog.loading && <p className="contract-form-summary">套餐配置尚未配置线路出口;请先到「套餐配置 → 线路出口」维护。</p>}
|
|
{!child && !exitCatalog.error && !exitOptions.length && !exitCatalog.loading && <p className="contract-form-summary">套餐配置尚未配置线路出口;请先到「套餐配置 → 线路出口」维护。</p>}
|
|
|
{item.exits.length > 1 ? (
|
|
{item.exits.length > 1 ? (
|
|
@@ -1125,13 +1121,6 @@ export function ContractEditorPage() {
|
|
|
const active = item.exits.includes(exit);
|
|
const active = item.exits.includes(exit);
|
|
|
return <button type="button" key={exit} className={active ? "ops-contract-exit is-active" : "ops-contract-exit"} aria-pressed={active} onClick={() => toggleExit(index, exit)}>{exit}{active ? <X size={13} /> : <Plus size={13} />}</button>;
|
|
return <button type="button" key={exit} className={active ? "ops-contract-exit is-active" : "ops-contract-exit"} aria-pressed={active} onClick={() => toggleExit(index, exit)}>{exit}{active ? <X size={13} /> : <Plus size={13} />}</button>;
|
|
|
})}</div>}
|
|
})}</div>}
|
|
|
- <span className="ops-field-note">
|
|
|
|
|
- {item.exits.length > 1
|
|
|
|
|
- ? `历史多出口条目只读(${item.exits.join("、")}):出口已改为单选,存量条目不做迁移;如需调整请新建条目。`
|
|
|
|
|
- : child
|
|
|
|
|
- ? `已选 ${item.exits.length}/${LINE_EXIT_MAX},候选只在父条目出口内(${options.join("、") || "父行尚未选"})。`
|
|
|
|
|
- : `已选 ${item.exits.length}/${LINE_EXIT_MAX}。线路出口在「套餐配置 → 线路出口」统一维护,此处只做选择;再点已选项即清空。`}
|
|
|
|
|
- </span>
|
|
|
|
|
</fieldset>
|
|
</fieldset>
|
|
|
{/**
|
|
{/**
|
|
|
* 逐条替换(2026-11-17):仅新建态、已选客户、条目档位/分类与出口齐全时请求候选。
|
|
* 逐条替换(2026-11-17):仅新建态、已选客户、条目档位/分类与出口齐全时请求候选。
|
|
@@ -1308,7 +1297,7 @@ function ReplacementBlock({
|
|
|
</label>
|
|
</label>
|
|
|
</> : <>
|
|
</> : <>
|
|
|
<label className="ops-form-span-full">
|
|
<label className="ops-form-span-full">
|
|
|
- <span className="ops-field-title">选择要替换的原订阅</span>
|
|
|
|
|
|
|
+ <span className="ops-field-title">选择要替换的原订阅<FieldHint label="选择要替换的原订阅说明">找到 {candidates.length} 份可选原订阅:必须显式选择,页面不预选。</FieldHint></span>
|
|
|
<select
|
|
<select
|
|
|
aria-label={`条目 ${index + 1} 替换原订阅`}
|
|
aria-label={`条目 ${index + 1} 替换原订阅`}
|
|
|
value={item.replacesSubscriptionId}
|
|
value={item.replacesSubscriptionId}
|
|
@@ -1320,7 +1309,6 @@ function ReplacementBlock({
|
|
|
</option>)}
|
|
</option>)}
|
|
|
</select>
|
|
</select>
|
|
|
</label>
|
|
</label>
|
|
|
- <span className="ops-field-note">找到 {candidates.length} 份可选原订阅:必须显式选择,页面不预选。</span>
|
|
|
|
|
</>}
|
|
</>}
|
|
|
{selected && <>
|
|
{selected && <>
|
|
|
<p className="contract-form-summary">
|
|
<p className="contract-form-summary">
|