fix(contract-plan): 合同付款预警待确认合同增加人工复核功能
This commit is contained in:
1 parent
d13c881efb
commit
6867aeb90c
17 files changed
+1157
-43
No files matched your search
@@ -5,6 +5,7 @@ backend/app/api/contract_payment.py
|
||||
依赖:JWT 当前用户、统一响应 envelope、ForbiddenError、Agent 授权、contract_payment 服务和通用 Job 队列。
|
||||
逻辑:页面查询合同、节点、本周待发送摘要、四张汇总卡和周汇总批次;失败批次返回可展示原因。同步和预警操作入队,避免请求线程执行外部系统和企微调用;发送后可按 Job 查询是否真正完成。
|
||||
下载和单合同重解析走 read_contract_attachment_bytes:原文还在则直接读,被临时清理删掉则按附件 ID 从 OA/DMS 重新下载。
|
||||
待确认合同的人工复核走 apply_manual_review:比例合计 100% 后改为已解析并进入台账。
|
||||
合同序列化时对 parse_issues 去重,避免 MinerU 重复抽取把同一原因展示多遍。
|
||||
鉴权:查询接口要求平台 admin 或持有 `agent_code=contract_payment` 的 Agent 授权;
|
||||
同步/扫描/周汇总发送仅 `role=admin`。
|
||||
@@ -38,6 +39,7 @@ from app.services.contract_payment.ledger_focus import (
|
||||
ledger_focus_counts,
|
||||
)
|
||||
from app.services.contract_payment.parse_service import unique_parse_issues
|
||||
from app.services.contract_payment.review_service import apply_manual_review
|
||||
from app.services.contract_payment.sync_service import (
|
||||
build_payment_plan,
|
||||
build_payment_plan_from_bytes,
|
||||
@@ -606,3 +608,27 @@ def reparse_contract_attachment(contract_id: int):
|
||||
"parse_result": result,
|
||||
"attachment_name": attachment.file_name,
|
||||
}, request_id=getattr(g, "request_id", None))
|
||||
|
||||
|
||||
@contract_payment_bp.route("/contracts/<int:contract_id>/manual-review", methods=["POST"])
|
||||
def manual_review_contract(contract_id: int):
|
||||
"""
|
||||
保存待确认合同的人工复核,并在校验通过后放入合同台账。
|
||||
|
||||
核心逻辑:与单合同重解析一样,持有合同付款 Agent 的用户即可提交,不要求平台管理员。
|
||||
服务层负责比例合计、金额核对和必填日期;本接口只转交请求体并返回更新后的合同。
|
||||
|
||||
Args:
|
||||
contract_id: 合同付款台账主键。
|
||||
|
||||
Returns:
|
||||
标准成功 envelope,含复核后的合同详情。
|
||||
|
||||
Raises:
|
||||
NotFoundError: 合同不存在。
|
||||
ValidationError: 采购单号、金额、比例或日期不满足进入台账的条件。
|
||||
"""
|
||||
user = _require_contract_payment_access()
|
||||
data = request.get_json() or {}
|
||||
row = apply_manual_review(contract_id, data, operator_id=getattr(user, "id", None))
|
||||
return ok({"contract": _serialize_contract(row)}, request_id=getattr(g, "request_id", None))
|
||||
@@ -0,0 +1,364 @@
|
||||
"""
|
||||
services/contract_payment/review_service.py
|
||||
|
||||
用途:把待确认合同的人工复核结果写入台账,使其可以进入付款预警。
|
||||
依赖:ContractPaymentContract、ContractPaymentNode、ContractPaymentEvent、ValidationError。
|
||||
逻辑:由 api/contract_payment 的 manual-review 路由调用。校验通过后覆盖四阶段节点,
|
||||
合同改为 parsed / active;勾选无此阶段的节点状态为 not_applicable,扫描预警时会被跳过。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import date, datetime, time
|
||||
from decimal import Decimal, InvalidOperation, ROUND_HALF_UP
|
||||
from typing import Any
|
||||
|
||||
from app import db
|
||||
from app.core.errors import NotFoundError, ValidationError
|
||||
from app.models import ContractPaymentContract, ContractPaymentEvent, ContractPaymentNode
|
||||
|
||||
_STAGE_TYPES = ("prepayment", "shipment", "acceptance", "warranty")
|
||||
_DATE_REQUIRED = {"prepayment", "shipment"}
|
||||
_PERCENT_SUM = Decimal("100")
|
||||
_SUM_TOLERANCE = Decimal("0.001")
|
||||
_AMOUNT_TOLERANCE = Decimal("0.02")
|
||||
_MANUAL_ACCEPTANCE_PREFIX = "manual-review:"
|
||||
|
||||
|
||||
def apply_manual_review(
|
||||
contract_id: int,
|
||||
payload: dict[str, Any],
|
||||
*,
|
||||
operator_id: int | None = None,
|
||||
) -> ContractPaymentContract:
|
||||
"""
|
||||
用人工填写的金额、比例和日期依据确认一份合同,并放入合同台账。
|
||||
|
||||
核心逻辑:先完整校验再落库。启用阶段的比例不能留空,合计须为 100%,金额须等于合同金额乘比例。
|
||||
预付款、出货款必须有日期依据;验收款、质保款日期可空。无此阶段写成 0 且不参与预警。
|
||||
预付款日期写入节点,合同归档日写入 oa_archive_at,供首轮预警按归档日加 7 天计算。
|
||||
|
||||
Args:
|
||||
contract_id: 合同台账主键。
|
||||
payload: 采购单号、合同金额、可选合同编号、归档日,以及四个阶段。
|
||||
operator_id: 当前操作人用户主键,写入复核审计;缺失时只记录复核事实。
|
||||
|
||||
Returns:
|
||||
已提交并刷新后的合同记录。
|
||||
|
||||
Raises:
|
||||
NotFoundError: 合同不存在。
|
||||
ValidationError: 采购单号、金额、比例合计、金额核对或必填日期不满足进入台账的条件。
|
||||
"""
|
||||
contract = db.session.get(ContractPaymentContract, contract_id)
|
||||
if contract is None:
|
||||
raise NotFoundError("合同不存在")
|
||||
# [STEP 1] 先把请求整理成可比较的数字和日期,失败时不改台账。
|
||||
review = _normalize_review(contract, payload)
|
||||
# [STEP 2] 主表进入台账。人工确认的金额允许覆盖原来的 0 或错误正数,这是复核本身的目的。
|
||||
contract.purchase_order_no = review["purchase_order_no"]
|
||||
contract.contract_no = review["contract_no"]
|
||||
contract.total_amount = review["total_amount"]
|
||||
if review["archive_date"] is not None:
|
||||
contract.oa_archive_at = datetime.combine(review["archive_date"], time.min)
|
||||
elif review["prepayment_date"] is not None:
|
||||
contract.oa_archive_at = datetime.combine(review["prepayment_date"], time.min)
|
||||
previous = dict(contract.parse_result_json or {})
|
||||
contract.parse_result_json = {
|
||||
**previous,
|
||||
"status": "parsed",
|
||||
"issues": [],
|
||||
"manual_review": {
|
||||
"operator_id": operator_id,
|
||||
"reviewed_at": datetime.utcnow().replace(microsecond=0).isoformat() + "Z",
|
||||
"previous_issues": list(previous.get("issues") or []),
|
||||
},
|
||||
}
|
||||
contract.parse_status = "parsed"
|
||||
contract.plan_status = "active"
|
||||
kept_ids: set[int] = set()
|
||||
for stage in review["stages"]:
|
||||
node = _upsert_stage_node(contract, stage)
|
||||
kept_ids.add(node.id)
|
||||
if stage["node_type"] == "shipment" and not stage["skipped"] and stage["basis_date"] is not None:
|
||||
contract.delivery_due_date = stage["basis_date"]
|
||||
for stale in db.session.query(ContractPaymentNode).filter_by(contract_id=contract.id).all():
|
||||
if stale.id in kept_ids:
|
||||
continue
|
||||
# 同类型重复节点或历史淘汰节点不再参与预警,避免复核后仍扫到旧阶段。
|
||||
stale.amount = None
|
||||
stale.percentage = None
|
||||
stale.anchor_date = None
|
||||
stale.due_date = None
|
||||
stale.status = "not_applicable"
|
||||
stale.evidence_json = {**(stale.evidence_json or {}), "manual_review": "未纳入本次复核"}
|
||||
_sync_manual_acceptance_event(contract, review["acceptance_date"], operator_id=operator_id)
|
||||
db.session.commit()
|
||||
db.session.refresh(contract)
|
||||
return contract
|
||||
|
||||
|
||||
def _normalize_review(contract: ContractPaymentContract, payload: dict[str, Any]) -> dict[str, Any]:
|
||||
"""
|
||||
把复核请求整理成四个阶段的金额、比例和日期。
|
||||
|
||||
核心逻辑:启用阶段空比例不算 0;合计须为 100%;金额与合同金额乘比例的差额不超过 0.02。
|
||||
合同编号留空时不覆盖成空字符串,以免撞上唯一约束。
|
||||
|
||||
Args:
|
||||
contract: 当前合同,用于合同编号冲突检查。
|
||||
payload: 原始 JSON。
|
||||
|
||||
Returns:
|
||||
可直接落库的采购单号、金额、归档日和阶段列表。
|
||||
|
||||
Raises:
|
||||
ValidationError: 任一进入台账的条件不满足。
|
||||
"""
|
||||
purchase_order_no = str(payload.get("purchase_order_no") or "").strip()
|
||||
if not purchase_order_no:
|
||||
raise ValidationError("请填写采购单号")
|
||||
if len(purchase_order_no) > 128:
|
||||
raise ValidationError("采购单号过长")
|
||||
total_amount = _parse_decimal(payload.get("total_amount"), "合同金额")
|
||||
if total_amount is None or total_amount <= 0:
|
||||
raise ValidationError("请填写大于 0 的合同金额")
|
||||
total_amount = total_amount.quantize(Decimal("0.01"), rounding=ROUND_HALF_UP)
|
||||
|
||||
contract_no = str(payload.get("contract_no") or "").strip() or None
|
||||
if contract_no and len(contract_no) > 128:
|
||||
raise ValidationError("合同编号过长")
|
||||
if contract_no and contract_no != contract.contract_no:
|
||||
conflict = db.session.query(ContractPaymentContract).filter(
|
||||
ContractPaymentContract.contract_no == contract_no,
|
||||
ContractPaymentContract.id != contract.id,
|
||||
).first()
|
||||
if conflict:
|
||||
raise ValidationError("合同编号与另一条合同台账冲突")
|
||||
|
||||
raw_stages = payload.get("stages")
|
||||
if not isinstance(raw_stages, list):
|
||||
raise ValidationError("请提交四个付款阶段")
|
||||
by_type: dict[str, dict[str, Any]] = {}
|
||||
for item in raw_stages:
|
||||
if not isinstance(item, dict):
|
||||
raise ValidationError("付款阶段格式不正确")
|
||||
node_type = str(item.get("node_type") or "").strip()
|
||||
if node_type not in _STAGE_TYPES or node_type in by_type:
|
||||
raise ValidationError("请提交预付款、出货款、验收款、质保款各一次")
|
||||
by_type[node_type] = item
|
||||
if set(by_type) != set(_STAGE_TYPES):
|
||||
raise ValidationError("请提交预付款、出货款、验收款、质保款各一次")
|
||||
|
||||
stages: list[dict[str, Any]] = []
|
||||
enabled_percent = Decimal("0")
|
||||
enabled_count = 0
|
||||
for node_type in _STAGE_TYPES:
|
||||
item = by_type[node_type]
|
||||
skipped = bool(item.get("skipped"))
|
||||
if skipped:
|
||||
stages.append({
|
||||
"node_type": node_type,
|
||||
"skipped": True,
|
||||
"percentage": Decimal("0"),
|
||||
"amount": Decimal("0.00"),
|
||||
"basis_date": None,
|
||||
})
|
||||
continue
|
||||
percentage = _parse_decimal(item.get("percentage"), f"{_stage_label(node_type)}比例")
|
||||
amount = _parse_decimal(item.get("amount"), f"{_stage_label(node_type)}金额")
|
||||
if percentage is None:
|
||||
raise ValidationError("启用阶段的付款比例不能为空")
|
||||
if percentage < 0 or percentage > _PERCENT_SUM:
|
||||
raise ValidationError("启用阶段的付款比例须在 0 到 100 之间")
|
||||
if amount is None:
|
||||
raise ValidationError("启用阶段的金额不能为空")
|
||||
percentage = percentage.quantize(Decimal("0.0001"), rounding=ROUND_HALF_UP)
|
||||
amount = amount.quantize(Decimal("0.01"), rounding=ROUND_HALF_UP)
|
||||
expected = (total_amount * percentage / _PERCENT_SUM).quantize(Decimal("0.01"), rounding=ROUND_HALF_UP)
|
||||
if abs(amount - expected) > _AMOUNT_TOLERANCE:
|
||||
raise ValidationError("阶段金额须等于合同金额乘以比例")
|
||||
basis_date = _parse_date(item.get("basis_date"), f"{_stage_label(node_type)}日期依据")
|
||||
if node_type in _DATE_REQUIRED and basis_date is None:
|
||||
raise ValidationError("预付款、出货款须填写日期依据")
|
||||
enabled_percent += percentage
|
||||
enabled_count += 1
|
||||
stages.append({
|
||||
"node_type": node_type,
|
||||
"skipped": False,
|
||||
"percentage": percentage,
|
||||
"amount": amount,
|
||||
"basis_date": basis_date,
|
||||
})
|
||||
if enabled_count == 0 or abs(enabled_percent - _PERCENT_SUM) > _SUM_TOLERANCE:
|
||||
raise ValidationError("启用阶段的付款比例合计须为 100%")
|
||||
|
||||
prepayment = next(stage for stage in stages if stage["node_type"] == "prepayment")
|
||||
acceptance = next(stage for stage in stages if stage["node_type"] == "acceptance")
|
||||
return {
|
||||
"purchase_order_no": purchase_order_no,
|
||||
"contract_no": contract_no,
|
||||
"total_amount": total_amount,
|
||||
"archive_date": _parse_date(payload.get("archive_date"), "合同归档日"),
|
||||
"prepayment_date": None if prepayment["skipped"] else prepayment["basis_date"],
|
||||
"acceptance_date": None if acceptance["skipped"] else acceptance["basis_date"],
|
||||
"stages": stages,
|
||||
}
|
||||
|
||||
|
||||
def _upsert_stage_node(contract: ContractPaymentContract, stage: dict[str, Any]) -> ContractPaymentNode:
|
||||
"""
|
||||
按阶段类型覆盖或新建付款节点。
|
||||
|
||||
核心逻辑:已有 ERP 已付事实且本次仍启用该阶段时保留 paid 和付款日。无此阶段改为 not_applicable。
|
||||
预付款的到期判断用复核填入的日期依据;出货款同时作为交货期限。
|
||||
|
||||
Args:
|
||||
contract: 当前合同。
|
||||
stage: 已规范化的单个阶段。
|
||||
|
||||
Returns:
|
||||
已挂到会话上的节点。节点主键在 flush 后可用于排除陈旧行。
|
||||
"""
|
||||
node = (
|
||||
db.session.query(ContractPaymentNode)
|
||||
.filter_by(contract_id=contract.id, node_type=stage["node_type"])
|
||||
.order_by(ContractPaymentNode.id.asc())
|
||||
.first()
|
||||
)
|
||||
if node is None:
|
||||
node = ContractPaymentNode(
|
||||
contract_id=contract.id,
|
||||
node_code=stage["node_type"],
|
||||
node_type=stage["node_type"],
|
||||
reminder_days=0,
|
||||
offset_days=0,
|
||||
)
|
||||
db.session.add(node)
|
||||
db.session.flush()
|
||||
was_paid = str(node.status or "").strip().lower() == "paid"
|
||||
evidence = dict(node.evidence_json or {})
|
||||
evidence["manual_review"] = True
|
||||
node.amount = stage["amount"]
|
||||
node.percentage = stage["percentage"]
|
||||
node.reminder_days = 0
|
||||
node.offset_days = 0
|
||||
if stage["skipped"]:
|
||||
node.anchor_type = None
|
||||
node.anchor_date = None
|
||||
node.due_date = None
|
||||
node.status = "not_applicable"
|
||||
else:
|
||||
node.anchor_type = "acceptance_archive" if stage["node_type"] == "acceptance" else (
|
||||
"warranty_expiry" if stage["node_type"] == "warranty" else "erp_payment"
|
||||
)
|
||||
node.anchor_date = stage["basis_date"]
|
||||
node.due_date = stage["basis_date"]
|
||||
node.status = "paid" if was_paid else "active"
|
||||
node.evidence_json = evidence
|
||||
return node
|
||||
|
||||
|
||||
def _sync_manual_acceptance_event(
|
||||
contract: ContractPaymentContract,
|
||||
basis_date: date | None,
|
||||
*,
|
||||
operator_id: int | None,
|
||||
) -> None:
|
||||
"""
|
||||
在还没有 OA 验收归档时,用复核填入的日期补一条验收事件。
|
||||
|
||||
核心逻辑:验收款预警读取最早的 acceptance_archive,不读节点上的日期。
|
||||
仅维护 source_event_id 为人工复核的那一条;已有 OA 事件时不另造,避免改写归档日。
|
||||
日期清空或阶段被跳过时删掉人工事件。
|
||||
|
||||
Args:
|
||||
contract: 当前合同。
|
||||
basis_date: 复核填入的验收单归档日;空表示不补事件。
|
||||
operator_id: 写入事件载荷的操作人。
|
||||
|
||||
Returns:
|
||||
None。
|
||||
"""
|
||||
source_event_id = f"{_MANUAL_ACCEPTANCE_PREFIX}{contract.id}"
|
||||
manual = db.session.query(ContractPaymentEvent).filter_by(
|
||||
contract_id=contract.id,
|
||||
event_type="acceptance_archive",
|
||||
source_event_id=source_event_id,
|
||||
).first()
|
||||
if basis_date is None:
|
||||
if manual is not None:
|
||||
db.session.delete(manual)
|
||||
return
|
||||
official = db.session.query(ContractPaymentEvent).filter(
|
||||
ContractPaymentEvent.contract_id == contract.id,
|
||||
ContractPaymentEvent.event_type == "acceptance_archive",
|
||||
ContractPaymentEvent.source_event_id != source_event_id,
|
||||
).first()
|
||||
if official is not None:
|
||||
return
|
||||
if manual is None:
|
||||
manual = ContractPaymentEvent(
|
||||
contract_id=contract.id,
|
||||
event_type="acceptance_archive",
|
||||
event_date=basis_date,
|
||||
source_event_id=source_event_id,
|
||||
)
|
||||
db.session.add(manual)
|
||||
manual.event_date = basis_date
|
||||
manual.payload_json = {"source": "manual_review", "operator_id": operator_id}
|
||||
|
||||
|
||||
def _parse_decimal(value: Any, label: str) -> Decimal | None:
|
||||
"""
|
||||
把请求中的金额或比例转成 Decimal。
|
||||
|
||||
Args:
|
||||
value: 原始字段,允许空。
|
||||
label: 出错时展示的字段名。
|
||||
|
||||
Returns:
|
||||
空值返回 None,否则返回 Decimal。
|
||||
|
||||
Raises:
|
||||
ValidationError: 字段不是数字。
|
||||
"""
|
||||
if value is None:
|
||||
return None
|
||||
raw = str(value).strip()
|
||||
if not raw:
|
||||
return None
|
||||
try:
|
||||
return Decimal(raw)
|
||||
except InvalidOperation as exc:
|
||||
raise ValidationError(f"{label}不是有效数字") from exc
|
||||
|
||||
|
||||
def _parse_date(value: Any, label: str) -> date | None:
|
||||
"""
|
||||
把 YYYY-MM-DD 转成日期。
|
||||
|
||||
Args:
|
||||
value: 原始字段,允许空。
|
||||
label: 出错时展示的字段名。
|
||||
|
||||
Returns:
|
||||
空值返回 None。
|
||||
|
||||
Raises:
|
||||
ValidationError: 日期格式不正确。
|
||||
"""
|
||||
if value is None:
|
||||
return None
|
||||
raw = str(value).strip()
|
||||
if not raw:
|
||||
return None
|
||||
try:
|
||||
return date.fromisoformat(raw[:10])
|
||||
except ValueError as exc:
|
||||
raise ValidationError(f"{label}格式应为 YYYY-MM-DD") from exc
|
||||
|
||||
|
||||
def _stage_label(node_type: str) -> str:
|
||||
"""返回校验文案里的阶段名称。"""
|
||||
return {"prepayment": "预付款", "shipment": "出货款", "acceptance": "验收款", "warranty": "质保款"}.get(node_type, node_type)
|
||||
@@ -0,0 +1,196 @@
|
||||
"""
|
||||
backend/tests/test_contract_payment_manual_review.py
|
||||
|
||||
用途:验收待确认合同人工复核进入台账的校验与落库。
|
||||
依赖:Flask test client、合同付款模型、Agent 授权。
|
||||
逻辑:构造 needs_review 合同,提交四阶段复核;合计不为 100% 或空比例时不得改解析状态。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import date
|
||||
from decimal import Decimal
|
||||
|
||||
from app import db
|
||||
from app.core.errors import ValidationError
|
||||
from app.models import Agent, ContractPaymentContract, ContractPaymentEvent, ContractPaymentNode, User
|
||||
from app.services.contract_payment.review_service import apply_manual_review
|
||||
|
||||
|
||||
def _create_user(*, username: str) -> User:
|
||||
"""创建已授予合同付款预警 Agent 的用户,供复核接口走 legacy header 认证。"""
|
||||
user = User(
|
||||
username=username,
|
||||
email=f"{username}@example.com",
|
||||
role="user",
|
||||
status="active",
|
||||
real_name=f"{username}-实名",
|
||||
employee_id=f"{username.upper()}-EMP",
|
||||
department="采购部",
|
||||
)
|
||||
user.set_password("password123")
|
||||
db.session.add(user)
|
||||
db.session.flush()
|
||||
agent = Agent.query.filter_by(agent_code="contract_payment", is_active=True).first()
|
||||
if not agent:
|
||||
agent = Agent(
|
||||
name="合同付款预警",
|
||||
agent_code="contract_payment",
|
||||
runtime_provider="builtin",
|
||||
conversation_mode="task_chat",
|
||||
type="api",
|
||||
is_active=True,
|
||||
)
|
||||
db.session.add(agent)
|
||||
db.session.flush()
|
||||
user.agents.append(agent)
|
||||
db.session.commit()
|
||||
db.session.refresh(user)
|
||||
db.session.expunge(user)
|
||||
return user
|
||||
|
||||
|
||||
def _auth_headers(user: User) -> dict[str, str]:
|
||||
"""生成测试鉴权头。"""
|
||||
return {
|
||||
"X-User-Id": str(user.id),
|
||||
"X-Username": user.username,
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
|
||||
def _review_payload(**overrides) -> dict:
|
||||
"""南通锻压样本:30/60/10,质保款无此阶段。"""
|
||||
payload = {
|
||||
"purchase_order_no": "5203-2609080001",
|
||||
"contract_no": "",
|
||||
"total_amount": "1550000",
|
||||
"archive_date": "2026-09-19",
|
||||
"stages": [
|
||||
{"node_type": "prepayment", "skipped": False, "percentage": "30", "amount": "465000", "basis_date": "2026-09-19"},
|
||||
{"node_type": "shipment", "skipped": False, "percentage": "60", "amount": "930000", "basis_date": "2027-01-31"},
|
||||
{"node_type": "acceptance", "skipped": False, "percentage": "10", "amount": "155000", "basis_date": ""},
|
||||
{"node_type": "warranty", "skipped": True, "percentage": "0", "amount": "0", "basis_date": ""},
|
||||
],
|
||||
}
|
||||
payload.update(overrides)
|
||||
return payload
|
||||
|
||||
|
||||
def _seed_review_contract() -> ContractPaymentContract:
|
||||
"""写入一份待确认合同,并带上已识别的出货款、验收款。"""
|
||||
contract = ContractPaymentContract(
|
||||
purchase_order_no="5203-2609080001",
|
||||
supplier_name="南通锻压设备如皋有限公司",
|
||||
total_amount=Decimal("1550000.00"),
|
||||
parse_status="needs_review",
|
||||
plan_status="needs_review",
|
||||
status="active",
|
||||
parse_result_json={"status": "needs_review", "issues": ["付款阶段比例无法识别:预付款、质保款"]},
|
||||
)
|
||||
db.session.add(contract)
|
||||
db.session.flush()
|
||||
db.session.add_all([
|
||||
ContractPaymentNode(
|
||||
contract_id=contract.id, node_code="shipment", node_type="shipment",
|
||||
amount=Decimal("930000.00"), percentage=Decimal("60"), status="needs_review",
|
||||
),
|
||||
ContractPaymentNode(
|
||||
contract_id=contract.id, node_code="acceptance", node_type="acceptance",
|
||||
amount=Decimal("155000.00"), percentage=Decimal("10"), status="needs_review",
|
||||
),
|
||||
])
|
||||
db.session.commit()
|
||||
return contract
|
||||
|
||||
|
||||
def test_manual_review_promotes_contract_into_ledger(client, app):
|
||||
"""比例合计 100% 且必填日期齐全时,合同离开待确认并写入四阶段。"""
|
||||
with app.app_context():
|
||||
user = _create_user(username="cp_review_ok")
|
||||
contract = _seed_review_contract()
|
||||
contract_id = contract.id
|
||||
|
||||
res = client.post(
|
||||
f"/api/contract-payment/contracts/{contract_id}/manual-review",
|
||||
json=_review_payload(),
|
||||
headers=_auth_headers(user),
|
||||
)
|
||||
assert res.status_code == 200
|
||||
body = res.get_json()["data"]["contract"]
|
||||
# 关键断言:复核通过后进入台账,质保款不参与预警,出货款日期写到交货期限。
|
||||
assert body["parse_status"] == "parsed"
|
||||
assert body["plan_status"] == "active"
|
||||
assert body["parse_issues"] == []
|
||||
assert body["delivery_due_date"] == "2027-01-31"
|
||||
by_type = {node["node_type"]: node for node in body["nodes"]}
|
||||
assert by_type["prepayment"]["status"] == "active"
|
||||
assert by_type["prepayment"]["due_date"] == "2026-09-19"
|
||||
assert by_type["warranty"]["status"] == "not_applicable"
|
||||
assert by_type["acceptance"]["due_date"] is None
|
||||
|
||||
|
||||
def test_manual_review_rejects_blank_percent_without_promoting(app):
|
||||
"""启用阶段留空比例时不得把空值当成 0,合同仍停留在待确认。"""
|
||||
with app.app_context():
|
||||
contract = _seed_review_contract()
|
||||
payload = _review_payload()
|
||||
payload["stages"][0]["percentage"] = ""
|
||||
payload["stages"][0]["amount"] = ""
|
||||
try:
|
||||
apply_manual_review(contract.id, payload, operator_id=1)
|
||||
raised = False
|
||||
except ValidationError:
|
||||
raised = True
|
||||
db.session.rollback()
|
||||
fresh = db.session.get(ContractPaymentContract, contract.id)
|
||||
# 关键断言:空比例被拒绝,解析状态不被改成 parsed。
|
||||
assert raised is True
|
||||
assert fresh.parse_status == "needs_review"
|
||||
|
||||
|
||||
def test_manual_review_rejects_duplicate_contract_no(app):
|
||||
"""合同编号与另一条台账冲突时拒绝复核。"""
|
||||
with app.app_context():
|
||||
contract = _seed_review_contract()
|
||||
db.session.add(ContractPaymentContract(contract_no="HT-EXISTING", parse_status="parsed", status="active"))
|
||||
db.session.commit()
|
||||
payload = _review_payload(contract_no="HT-EXISTING")
|
||||
try:
|
||||
apply_manual_review(contract.id, payload)
|
||||
raised = False
|
||||
except ValidationError as exc:
|
||||
raised = "冲突" in str(exc)
|
||||
# 关键断言:冲突编号不会写入当前合同。
|
||||
assert raised is True
|
||||
assert db.session.get(ContractPaymentContract, contract.id).contract_no is None
|
||||
|
||||
|
||||
def test_manual_review_keeps_paid_fact_and_acceptance_event(app):
|
||||
"""已付的预付款保持 paid;手填验收日且没有 OA 事件时补人工归档事件。"""
|
||||
with app.app_context():
|
||||
contract = _seed_review_contract()
|
||||
db.session.add(ContractPaymentNode(
|
||||
contract_id=contract.id,
|
||||
node_code="prepayment",
|
||||
node_type="prepayment",
|
||||
amount=Decimal("465000.00"),
|
||||
percentage=Decimal("30"),
|
||||
status="paid",
|
||||
evidence_json={"paid_at": "2026-09-20"},
|
||||
))
|
||||
db.session.commit()
|
||||
payload = _review_payload()
|
||||
payload["stages"][2]["basis_date"] = "2026-10-01"
|
||||
apply_manual_review(contract.id, payload, operator_id=7)
|
||||
nodes = {
|
||||
node.node_type: node
|
||||
for node in db.session.query(ContractPaymentNode).filter_by(contract_id=contract.id).all()
|
||||
}
|
||||
event = db.session.query(ContractPaymentEvent).filter_by(contract_id=contract.id, event_type="acceptance_archive").one()
|
||||
# 关键断言:ERP 已付事实保留;验收日成为预警锚点;跳过的质保款不是 active。
|
||||
assert nodes["prepayment"].status == "paid"
|
||||
assert nodes["prepayment"].evidence_json["paid_at"] == "2026-09-20"
|
||||
assert nodes["warranty"].status == "not_applicable"
|
||||
assert event.event_date == date(2026, 10, 1)
|
||||
assert event.source_event_id == f"manual-review:{contract.id}"
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
- 每日定时扫描仅生成待发送预警;每周五 18:00 按收件人归并发送一条企业微信汇总。消息仅展示总笔数及阶段数量;每位收件人附件一份 Excel,列明需付款合同及付款明细。
|
||||
- 工作台入口已迁入 Chat:合同付款预警作为 builtin Agent(`agent_code=contract_payment`),主区以 Tab 嵌入合同台账、待确认合同、周汇总批次(发送失败可点击图标查看原因);点击合同在当前 Tab 内下钻详情。第一期隐藏对话输入框与历史会话,不接 Dify。旧地址 `/workspace/contract-payment*` 重定向到对应 Chat 深链。平台 admin 或被授予该 Agent 的用户可访问;同步 OA、强制覆盖、批量重解析、扫描预警和发送预警仅管理员可见。点击合同可查看详情、解析原因和原文附件。合同台账四张汇总卡为即将到期(7 日内)、逾期未付、未到期(7 日外)、本月应付。关键词可搜申请人。
|
||||
- OA 合同申请单同时存在“合同附件”和“盖章完成合同上传”时,必须优先下载并解析后者;普通合同附件仅在盖章完成合同缺失或下载失败时作为备用。
|
||||
- OA 下载的扫描版 PDF 先通过 MinerU 转为保留标题、表格和阅读顺序的 Markdown,再运行合同付款条款规则;MinerU 失败或无结果时回退原 PDF 文字层/OCR,仍无法确认的合同保留在“待确认合同”。
|
||||
- OA 下载的扫描版 PDF 先通过 MinerU 转为保留标题、表格和阅读顺序的 Markdown,再运行合同付款条款规则;MinerU 失败或无结果时回退原 PDF 文字层/OCR,仍无法确认的合同保留在“待确认合同”。待确认合同可人工复核付款阶段,启用阶段比例合计 100% 后进入合同台账;无此阶段的节点不参与预警。
|
||||
|
||||
## 货代收料 RPA(2026-08)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
| [accounting-voucher-check](accounting-voucher-check/README.md) | 立账凭证资料检核(Chat Agent) | [需求说明](accounting-voucher-check/demand.md) · [技术设计](accounting-voucher-check/technical-design.md) · [OA 销货放行 E10](accounting-voucher-check/oa-sales-release-e10.md) · [原型](accounting-voucher-check/accounting-voucher-check-prototype.html) |
|
||||
| [fixed-assets](fixed-assets/README.md) | 固资快照同步与本地查询 | [technical.md](fixed-assets/technical.md) · [履历挂载命令](fixed-assets/history-share-mount.md) |
|
||||
| [procurement-contract](procurement-contract/README.md) | 采购合同审查 Agent(模板比对 / 单份审核) | [用户操作手册](procurement-contract/用户操作手册.md) · [demand.md](procurement-contract/demand.md) · [comprehensive-review-technical.md](procurement-contract/comprehensive-review-technical.md) · [原型](procurement-contract/procurement-contract-review-prototype.html) |
|
||||
| [contract-payment-plan](contract-payment-plan/) | 合同付款计划 / 预警 Agent | [方案 V3](contract-payment-plan/contract-payment-warning-proposal-v3.md) · [工作台原型](contract-payment-plan/contract-payment-plan-workspace-prototype-v2.html) · [Chat Agent 原型](contract-payment-plan/contract-payment-chat-agent-prototype.html) |
|
||||
| [contract-payment-plan](contract-payment-plan/) | 合同付款计划 / 预警 Agent | [方案 V3](contract-payment-plan/contract-payment-warning-proposal-v3.md) · [工作台原型](contract-payment-plan/contract-payment-plan-workspace-prototype-v2.html) · [人工复核原型](contract-payment-plan/contract-payment-review-prototype.html) · [Chat Agent 原型](contract-payment-plan/contract-payment-chat-agent-prototype.html) |
|
||||
| [equipment-maintenance](equipment-maintenance/README.md) | 设备维保助手 | [聊天原型](equipment-maintenance/equipment-maintenance-agent-chat-lofi.html) |
|
||||
|
||||
**平台级**设计与跨域原型见 [platform/](../platform/README.md)。
|
||||
|
||||
@@ -125,6 +125,7 @@ OA“厂商预付款请款作业”的流程状态不作为付款完成依据;
|
||||
- 系统应以归档合同为主体,保存合同编号、采购单号、供应商、采购负责人、合同归档日、交货期限和付款节点。
|
||||
- 系统应支持预付款、出货款、验收款、质保款四类节点;合同条款或关键日期缺失时应进入待复核,不生成不可靠预警。
|
||||
- 合同付款预警不再以设备采购合同(项目型 V4)或任何固定模板作为准入条件。只要能识别合同号、合同金额、交货期限、预付款/出货款/验收款/质保款四阶段比例,且比例完整、无重复、合计为 100%,并且采购单号非空(用于 ERP 付款事实回查),即可进入合同台账;付款阶段比例缺失/重复/合计不为 100%、采购单号缺失,以及关键事实无法识别或与 OA 字段冲突时,进入“待确认合同”。
|
||||
- 待确认合同支持人工复核。复核人可修改合同金额、采购单号、可选合同编号、合同归档日,以及四个阶段的比例、金额和日期依据。启用阶段的比例不能留空,合计须为 100%,金额须等于合同金额乘以比例;预付款和出货款必须有日期依据,验收款和质保款日期可空。勾选“无此阶段”的节点比例和金额为 0,状态为不适用,不生成预警。校验通过后合同进入合同台账。这是人工确认,不改变自动解析规则。
|
||||
- OA 下载的 PDF 合同优先提交采购合同审核已配置的 MinerU `POST /file_parse`,以返回的 Markdown(标题、表格和阅读顺序)作为合同号、金额、付款阶段和交期的解析输入;MinerU 未配置、调用失败或未返回 Markdown 时才回退既有 PDF 文字层与 OCR,解析失败仍进入“待确认合同”。两处固定共用 `PROCUREMENT_CONTRACT_MINERU_*` 配置,不维护付款预警专属地址。
|
||||
|
||||
### FR-02 OA 数据同步
|
||||
|
||||
+2
-2
@@ -7,8 +7,8 @@
|
||||
| OA 合同与请款同步 | 已实现 | 合同申请单走 HTTP 待办/已办;验收归档查 OA SQL(`formtable_main_324.cgdh` × `workflow_requestbase.currentnodetype=3`)按采购单号落事件;普通同步只补空字段,管理员可强制覆盖 OA 非空字段并保留变更审计。 |
|
||||
| 四阶段三轮预警扫描 | 已实现 | 每日扫描只生成 pending 预警;第一轮按台账申请人真实姓名匹配系统用户,第二、三轮按申请人部门查 OA `HrmResource` + `Matrixtable_3`(`zz`/`jfl` 即企微 userid)。 |
|
||||
| 企业微信周汇总 | 已实现 | 每周五 18:00 按收件人发一条汇总卡片及逐笔 Excel 附件;Excel「收件人」列为系统用户真实姓名;“周汇总批次”保留批次审计,发送失败可点击图标查看原因。 |
|
||||
| 合同付款台账与详情 | 已实现 | Chat Agent「合同付款预警」以 Tab 展示合同台账:服务端分页展示合同、流程、采购、供应商、四阶段金额比例日期、申请人和简洁状态标签;关键词同时匹配合同号、流程号、采购单号、供应商和申请人;四张汇总卡按合同统计即将到期(7日内)、逾期未付、未到期(7日外)、本月应付(全量台账),点击过滤列表;点击合同在当前 Tab 内查看概览、原文附件、付款计划和预警记录。 |
|
||||
| 通用合同解析与待确认合同 | 已实现 | 不再校验 V4 或其他固定模板;只校验合同号、金额、交期、采购单号及四阶段付款比例完整、无重复、合计 100%。关键事实或比例校验失败合同归入 Chat「待确认」Tab,不得触发自动预警。 |
|
||||
| 合同付款台账与详情 | 已实现 | Chat Agent「合同付款预警」以 Tab 展示合同台账:服务端分页展示合同、采购单号、供应商、四阶段列、申请人和简洁状态标签,列表不展示流程编号。阶段列只显示阶段名;预付款和出货款以已付(付款日)或已逾期、即将到期、未到期区分,验收款和质保款只显示金额比例与日期依据;关键词同时匹配合同号、流程号、采购单号、供应商和申请人;四张汇总卡按合同统计即将到期(7日内)、逾期未付、未到期(7日外)、本月应付(全量台账),点击过滤列表;点击合同在当前 Tab 内查看概览、原文附件、付款计划和预警记录。 |
|
||||
| 通用合同解析与待确认合同 | 已实现 | 不再校验 V4 或其他固定模板;只校验合同号、金额、交期、采购单号及四阶段付款比例完整、无重复、合计 100%。关键事实或比例校验失败合同归入 Chat「待确认」Tab,不得触发自动预警。待确认合同可人工复核:补齐采购单号、合同金额和四阶段比例、金额、日期依据,启用阶段合计 100% 后进入合同台账;勾选无此阶段的节点不参与预警。 |
|
||||
| 扫描版合同 MinerU 解析 | 已实现 | OA PDF 附件优先经 MinerU 生成 Markdown 后再解析合同号、金额、交期与四阶段付款比例;服务未配置、失败或空结果时安全回退既有文字层/OCR,历史合同可用“批量重新解析存量合同”刷新。 |
|
||||
| 存量合同批量重解析 | 已实现 | 管理员可直接用已归档附件批量刷新历史解析结果,不覆盖 OA 字段。原文若已被临时文件清理删除,则按附件 ID 从 OA 或 DMS 重新下载后再解析。 |
|
||||
| 合同付款 Agent 授权 | 已实现 | 入口为 Chat builtin Agent `contract_payment`:平台 admin 默认可访问,普通用户需在用户管理授予该 Agent。旧功能权限 `contract_payment.access` 由迁移写入 Agent 授权后删除。无授权直链提示并回应用管理,API 返回 403。同步 OA、强制覆盖、批量重解析、扫描预警和发送预警仅平台管理员可见并可调用。 |
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* 合同付款预警 API 类型与请求封装。
|
||||
* 依赖:统一 requestJson;后端 /api/contract-payment。
|
||||
* 逻辑:台账/合同详情查询、汇总卡统计、待发送摘要、每日扫描入队、周五汇总入队、批次附件下载、失败原因及后台任务状态。
|
||||
* 待确认合同的人工复核提交到 manual-review,通过后合同进入台账。
|
||||
*/
|
||||
import { requestBlob, requestJson } from '@/shared/api/client';
|
||||
|
||||
@@ -49,6 +50,32 @@ export const listContractPaymentContracts = (params?: { keyword?: string; parse_
|
||||
export const getContractPaymentContract = (contractId: number) => requestJson<ContractPaymentContract>(`/api/contract-payment/contracts/${contractId}`);
|
||||
/** 用已归档的盖章合同原文重新解析,并返回覆盖后的合同详情。 */
|
||||
export const reparseContractPaymentContract = (contractId: number) => requestJson<{ contract: ContractPaymentContract; parse_result: { status: string }; attachment_name: string }>(`/api/contract-payment/contracts/${contractId}/reparse`, { method: 'POST' });
|
||||
|
||||
export interface ManualReviewStageInput {
|
||||
node_type: string;
|
||||
skipped: boolean;
|
||||
percentage: string;
|
||||
amount: string;
|
||||
basis_date: string;
|
||||
}
|
||||
export interface ManualReviewInput {
|
||||
purchase_order_no: string;
|
||||
contract_no: string;
|
||||
total_amount: string;
|
||||
archive_date: string;
|
||||
stages: ManualReviewStageInput[];
|
||||
}
|
||||
/**
|
||||
* 提交待确认合同的人工复核。
|
||||
* 核心逻辑:后端校验比例合计、金额和必填日期;通过后合同 parse_status 变为 parsed。
|
||||
* @param contractId - 合同台账主键。
|
||||
* @param payload - 采购单号、合同金额和四个付款阶段。
|
||||
* @returns 复核后的合同详情。
|
||||
*/
|
||||
export const submitContractPaymentManualReview = (contractId: number, payload: ManualReviewInput) => requestJson<{ contract: ContractPaymentContract }>(`/api/contract-payment/contracts/${contractId}/manual-review`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
/** 下载当前登录用户有权限访问的合同原文附件。 */
|
||||
export const downloadContractPaymentAttachment = (contractId: number, attachmentId: number) => requestBlob(`/api/contract-payment/contracts/${contractId}/attachments/${attachmentId}/download`);
|
||||
/** 提交 OA 合同同步;force 为 true 时由后端显式覆盖本次 OA 返回的非空主表字段。 */
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
列表 Tab 内容区 overflow-hidden,把纵向滚动交给子页表格区域;Chat 顶栏仅保留标题。
|
||||
管理员顶栏顺序:同步 OA → 发送预警 → 更多;前两者常显,低频操作收进「更多」以节省小屏高度。
|
||||
发送预警结束后重新拉取周汇总批次,避免列表停在点击前的失败记录。
|
||||
待确认与台账点进合同都打开原来的详情。待复核详情上的人工复核确认后回到合同台账并刷新角标。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
@@ -93,12 +94,21 @@ function openDetail(contractId: number): void {
|
||||
}
|
||||
|
||||
/**
|
||||
* 从详情返回当前 Tab 列表。
|
||||
* 从详情或复核返回当前 Tab 列表。
|
||||
*/
|
||||
function closeDetail(): void {
|
||||
void syncQuery(activeView.value, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人工复核通过后回到合同台账,并刷新待确认角标。
|
||||
* 核心逻辑:合同已离开 needs_review,停在待确认会看到空行;台账才是复核结果的落点。
|
||||
*/
|
||||
async function onReviewConfirmed(): Promise<void> {
|
||||
await syncQuery('ledger', null);
|
||||
await loadReviewCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取待确认合同数量,供 Tab 角标展示。
|
||||
* 核心逻辑:只取 total,不拉列表正文,失败时角标归零不打断主区。
|
||||
@@ -254,6 +264,7 @@ watch(
|
||||
:contract-id="detailId"
|
||||
embedded
|
||||
@close="closeDetail"
|
||||
@reviewed="onReviewConfirmed"
|
||||
/>
|
||||
<ContractPaymentPage
|
||||
v-else-if="activeView === 'ledger'"
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
features/contract-payment/views/ContractPaymentDetailPage.vue
|
||||
用途:展示单份采购合同的概览、原文附件、付款计划及企业微信预警审计。
|
||||
依赖:contract-payment.api、统一消息提示;由 Chat 台账/待确认行点击在当前 Tab 内下钻。
|
||||
逻辑:以合同 ID 调用已有详情接口,所有付款任务按付款节点和预警轮次聚合呈现。
|
||||
逻辑:以合同 ID 调用已有详情接口,付款任务按节点和预警轮次聚合;原文附件可在线预览 PDF/图片,或继续下载。
|
||||
待复核合同时,解析提示右侧用主按钮放「人工复核」,弹窗里填写阶段后再进入台账。合同概览和页头其余内容保持原样。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { ArrowLeft, CircleHelp, Download, FileText, RefreshCw } from 'lucide-vue-next';
|
||||
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||
import { ArrowLeft, CircleHelp, Download, Eye, FileText, RefreshCw } from 'lucide-vue-next';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
import { formatLocalDateTime, formatNaiveDate, formatNaiveDateTime } from '@/shared/utils/dateTime';
|
||||
@@ -21,6 +22,7 @@ import {
|
||||
} from '../api/contract-payment.api';
|
||||
import { displayCurrency } from '../utils/currency';
|
||||
import { isNodeNearDue, isNodeOverdue, nodeDueReference } from '../utils/paymentStatus';
|
||||
import ContractPaymentManualReviewPage from './ContractPaymentManualReviewPage.vue';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
contractId: number;
|
||||
@@ -29,6 +31,7 @@ const props = withDefaults(defineProps<{
|
||||
|
||||
const emit = defineEmits<{
|
||||
close: [];
|
||||
reviewed: [];
|
||||
}>();
|
||||
|
||||
const { t, te } = useI18n();
|
||||
@@ -36,7 +39,13 @@ const msg = useMessage();
|
||||
const contract = ref<ContractPaymentContract | null>(null);
|
||||
const loading = ref(false);
|
||||
const downloadingId = ref<number | null>(null);
|
||||
const previewingId = ref<number | null>(null);
|
||||
const previewOpen = ref(false);
|
||||
const previewName = ref('');
|
||||
const previewUrl = ref('');
|
||||
const previewKind = ref<'pdf' | 'image' | 'unsupported' | ''>('');
|
||||
const reparsing = ref(false);
|
||||
const reviewOpen = ref(false);
|
||||
const activeTab = ref<'plan' | 'attachments' | 'alerts'>('plan');
|
||||
const contractId = computed(() => Number(props.contractId));
|
||||
const orderedNodes = computed(() => {
|
||||
@@ -137,7 +146,7 @@ const currentActiveNodeId = computed(() => {
|
||||
|
||||
/**
|
||||
* 推导付款节点的展示状态与时间线色调。
|
||||
* 核心逻辑:已付/待复核沿用后端明确状态;未完成时按“无到期事实→待起算、临近到期→即将到期、
|
||||
* 核心逻辑:已付/待复核/无此阶段沿用后端明确状态;未完成时按“无到期事实→待起算、临近到期→即将到期、
|
||||
* 当前阶段→进行中、其余→待处理”分层,避免同页多阶段都误标为进行中。
|
||||
* @param node - 当前付款节点。
|
||||
* @returns 用户可见的状态文本与对应色调。
|
||||
@@ -145,6 +154,7 @@ const currentActiveNodeId = computed(() => {
|
||||
function nodeStatusInfo(node: PaymentNode): { label: string; tone: 'paid' | 'current' | 'due' | 'overdue' | 'pending' | 'review' } {
|
||||
const state = String(node.status || '').trim().toLowerCase();
|
||||
if (state === 'paid') return { label: t('admin.contractPayment.nodeStatus.paid'), tone: 'paid' };
|
||||
if (state === 'not_applicable') return { label: t('admin.contractPayment.nodeStatus.notApplicable'), tone: 'pending' };
|
||||
if (state === 'needs_review') return { label: t('admin.contractPayment.nodeStatus.review'), tone: 'review' };
|
||||
const isCurrent = node.id === currentActiveNodeId.value;
|
||||
if (!node.due_date && !node.anchor_date) return { label: t('admin.contractPayment.nodeStatus.notStarted'), tone: 'pending' };
|
||||
@@ -213,6 +223,65 @@ async function load(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断附件能否在页面内预览。
|
||||
* 核心逻辑:PDF 用内嵌框,常见图片用 img;其余格式只提示下载,避免浏览器把未知二进制当成下载。
|
||||
* @param attachment - 当前合同附件。
|
||||
* @param blob - 已拉取的文件内容,mime 缺失时用来补判断。
|
||||
* @returns pdf、image 或 unsupported。
|
||||
*/
|
||||
function attachmentPreviewKind(attachment: ContractAttachment, blob: Blob): 'pdf' | 'image' | 'unsupported' {
|
||||
const mime = `${attachment.mime_type || ''} ${blob.type || ''}`.toLowerCase();
|
||||
const name = (attachment.file_name || '').toLowerCase();
|
||||
if (mime.includes('pdf') || name.endsWith('.pdf')) return 'pdf';
|
||||
if (mime.includes('image/') || /\.(png|jpe?g|gif|webp|bmp)$/.test(name)) return 'image';
|
||||
return 'unsupported';
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭附件预览并释放临时地址。
|
||||
* 核心逻辑:blob URL 不随弹窗卸载自动回收,关闭、切换合同和离开页面时都要 revoke。
|
||||
*/
|
||||
function closeAttachmentPreview(): void {
|
||||
if (previewUrl.value) URL.revokeObjectURL(previewUrl.value);
|
||||
previewUrl.value = '';
|
||||
previewOpen.value = false;
|
||||
previewKind.value = '';
|
||||
previewName.value = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 在弹窗中预览合同原文附件。
|
||||
* 核心逻辑:复用受控下载接口取 Blob,PDF/图片转成临时地址展示;不支持的格式仍打开弹窗并提示下载。
|
||||
* @param attachment - 当前合同的附件记录。
|
||||
* @returns 预览打开后结束;失败时保留原页面并提示原因。
|
||||
*/
|
||||
async function previewAttachment(attachment: ContractAttachment): Promise<void> {
|
||||
if (!contract.value || previewingId.value) return;
|
||||
previewingId.value = attachment.id;
|
||||
try {
|
||||
const { blob, filename } = await downloadContractPaymentAttachment(contract.value.id, attachment.id);
|
||||
const kind = attachmentPreviewKind(attachment, blob);
|
||||
if (previewUrl.value) URL.revokeObjectURL(previewUrl.value);
|
||||
previewName.value = filename || attachment.file_name;
|
||||
previewKind.value = kind;
|
||||
if (kind === 'pdf') {
|
||||
const typed = blob.type.toLowerCase().includes('pdf') ? blob : new Blob([blob], { type: 'application/pdf' });
|
||||
previewUrl.value = URL.createObjectURL(typed);
|
||||
} else if (kind === 'image') {
|
||||
const typed = blob.type.toLowerCase().startsWith('image/') ? blob : new Blob([blob], { type: attachment.mime_type || 'image/png' });
|
||||
previewUrl.value = URL.createObjectURL(typed);
|
||||
} else {
|
||||
previewUrl.value = '';
|
||||
}
|
||||
previewOpen.value = true;
|
||||
} catch (error) {
|
||||
msg.error(error instanceof BusinessError ? error.message : t('admin.contractPayment.attachmentPreviewFailed'));
|
||||
} finally {
|
||||
previewingId.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载合同详情中的原文附件。
|
||||
* 核心逻辑:经合同附件专用受控接口取 Blob,再由浏览器保存,避免直接暴露存储地址。
|
||||
@@ -266,11 +335,23 @@ function backToLedger(): void {
|
||||
emit('close');
|
||||
}
|
||||
|
||||
/**
|
||||
* 人工复核通过后关掉弹窗,并交给 Chat 父级切到合同台账。
|
||||
* 核心逻辑:详情页本身不改成表单;确认成功后合同已离开待确认。
|
||||
*/
|
||||
function onReviewConfirmed(): void {
|
||||
reviewOpen.value = false;
|
||||
emit('reviewed');
|
||||
}
|
||||
|
||||
watch(contractId, () => {
|
||||
closeAttachmentPreview();
|
||||
reviewOpen.value = false;
|
||||
void load();
|
||||
});
|
||||
|
||||
onMounted(() => void load());
|
||||
onBeforeUnmount(() => closeAttachmentPreview());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -301,9 +382,12 @@ onMounted(() => void load());
|
||||
<div><dt><span class="help-label" :data-help="t('admin.contractPayment.archiveDateHint')">{{ t('admin.contractPayment.archiveDate') }}<CircleHelp class="ml-1 inline h-3.5 w-3.5 align-middle" /></span></dt><dd>{{ contract.oa_archive_at ? formatNaiveDate(contract.oa_archive_at) : '—' }}</dd></div>
|
||||
<div><dt>{{ t('admin.contractPayment.deliveryDate') }}</dt><dd>{{ contract.delivery_due_date || '—' }}</dd></div>
|
||||
</dl>
|
||||
<div v-if="contract.parse_issues?.length" class="detail-parse-issues">
|
||||
<strong>{{ t('admin.contractPayment.parseIssueTitle') }}</strong>
|
||||
<ul><li v-for="issue in contract.parse_issues" :key="issue">{{ issue }}</li></ul>
|
||||
<div v-if="contract.parse_issues?.length || contract.parse_status === 'needs_review'" class="detail-parse-issues">
|
||||
<div class="min-w-0">
|
||||
<strong>{{ t('admin.contractPayment.parseIssueTitle') }}</strong>
|
||||
<ul v-if="contract.parse_issues?.length"><li v-for="issue in contract.parse_issues" :key="issue">{{ issue }}</li></ul>
|
||||
</div>
|
||||
<button v-if="contract.parse_status === 'needs_review'" class="btn-primary detail-parse-review" type="button" @click="reviewOpen = true">{{ t('admin.contractPaymentReview.manualAction') }}</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -319,17 +403,20 @@ onMounted(() => void load());
|
||||
<div v-for="attachment in contract.attachments" :key="attachment.id" class="attachment-row">
|
||||
<FileText class="h-5 w-5 text-blue-500" />
|
||||
<div class="min-w-0 flex-1"><strong class="block truncate">{{ attachment.file_name }}</strong></div>
|
||||
<button class="btn-secondary-ds" :disabled="previewingId === attachment.id || !attachment.asset_no" @click="previewAttachment(attachment)"><Eye class="h-4 w-4" />{{ t('admin.contractPayment.previewAttachment') }}</button>
|
||||
<button class="btn-secondary-ds" :disabled="downloadingId === attachment.id || !attachment.asset_no" @click="downloadAttachment(attachment)"><Download class="h-4 w-4" />{{ t('admin.contractPayment.downloadAttachment') }}</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section v-else-if="activeTab === 'plan'" class="detail-panel mt-4">
|
||||
<h3>{{ t('admin.contractPayment.detailPaymentPlan') }}</h3>
|
||||
<h3>
|
||||
<span class="help-label help-wide" :data-help="t('admin.contractPayment.alertRuleHint')">{{ t('admin.contractPayment.detailPaymentPlan') }}<CircleHelp class="ml-1 inline h-3.5 w-3.5 align-middle" /></span>
|
||||
</h3>
|
||||
<div v-if="!orderedNodes.length" class="detail-empty">{{ t('admin.contractPayment.paymentPlanEmpty') }}</div>
|
||||
<div v-for="node in orderedNodes" :key="node.id" class="payment-node-row">
|
||||
<span class="timeline-dot" :class="`dot-${nodeStatusInfo(node).tone}`"></span>
|
||||
<div class="payment-node-card">
|
||||
<div class="flex flex-wrap items-center justify-between gap-2"><strong>{{ displayNodeType(node.node_type) }} · {{ node.amount || '—' }} / {{ displayPercentage(node.percentage) }}%</strong><span class="node-status" :class="`status-${nodeStatusInfo(node).tone}`">{{ nodeStatusInfo(node).label }}</span></div>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2"><strong>{{ displayNodeType(node.node_type) }} · <template v-if="String(node.status || '').toLowerCase() === 'not_applicable'">—</template><template v-else>{{ node.amount || '—' }} / {{ displayPercentage(node.percentage) }}%</template></strong><span class="node-status" :class="`status-${nodeStatusInfo(node).tone}`">{{ nodeStatusInfo(node).label }}</span></div>
|
||||
<p class="payment-node-pay-line">{{ t('admin.contractPayment.payDate') }}:{{ nodePayDateText(node) }}</p>
|
||||
<p>{{ t('admin.contractPayment.anchorDate') }}:{{ node.anchor_date || '—' }} · {{ t('admin.contractPayment.alertDate') }}:{{ displayAlertDate(node) }}</p>
|
||||
<div v-if="alertsForNode(node).length" class="node-alert-list"><span v-for="alert in alertsForNode(node)" :key="alert.id">{{ t('admin.contractPayment.alertRound', { round: alert.alert_round }) }} · {{ displayScheduledAt(alert.scheduled_at) }} · {{ displayAlertStatus(alert.status) }}</span></div>
|
||||
@@ -349,12 +436,37 @@ onMounted(() => void load());
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
<ContractPaymentManualReviewPage
|
||||
v-if="reviewOpen && contract"
|
||||
:contract-id="contract.id"
|
||||
@close="reviewOpen = false"
|
||||
@confirmed="onReviewConfirmed"
|
||||
/>
|
||||
<Teleport to="body">
|
||||
<div v-if="previewOpen" class="dialog-overlay z-[160] items-center" @click.self="closeAttachmentPreview">
|
||||
<div class="dialog-panel max-w-5xl h-[85vh] overflow-hidden" role="dialog" aria-modal="true">
|
||||
<div class="dialog-header dialog-header--compact">
|
||||
<div class="min-w-0">
|
||||
<div class="text-sm font-medium text-slate-500">{{ t('filePreview.title') }}</div>
|
||||
<div class="mt-1 font-semibold text-slate-900 break-words">{{ previewName }}</div>
|
||||
</div>
|
||||
<button type="button" class="btn-secondary shrink-0" @click="closeAttachmentPreview">{{ t('common.close') }}</button>
|
||||
</div>
|
||||
<div class="dialog-preview-body attachment-preview-body">
|
||||
<iframe v-if="previewKind === 'pdf' && previewUrl" class="attachment-preview-frame" :src="previewUrl" :title="previewName"></iframe>
|
||||
<img v-else-if="previewKind === 'image' && previewUrl" class="attachment-preview-image" :src="previewUrl" :alt="previewName" />
|
||||
<div v-else class="detail-empty">{{ t('admin.contractPayment.attachmentPreviewUnsupported') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Teleport>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* 四张概要卡按详情区域宽度排:够宽时一行,窄于 640px 再折成两行。 */
|
||||
.contract-detail { container-type: inline-size; }.detail-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }.detail-summary-card { min-width: 0; min-height: 82px; padding: 14px; border: 1px solid #d7e1ef; border-radius: 12px; background: #f8fbff; }.detail-summary-card span { display: block; color: #58749f; font-size: 12px; }.detail-summary-card strong { display: block; margin-top: 6px; color: #102d59; font-size: 14px; word-break: break-word; }.detail-tabs { display: flex; width: fit-content; max-width: 100%; overflow-x: auto; border: 1px solid #d7e1ef; border-radius: 999px; background: #f1f5fb; padding: 4px; }.detail-tabs button { flex: none; border-radius: 999px; padding: 8px 14px; color: #58749f; font-size: 13px; font-weight: 700; }.detail-tabs button.active { background: #fff; color: #2875d5; box-shadow: 0 1px 3px rgba(35, 68, 113, .12); }.detail-panel { border: 1px dashed #b9cbe2; border-radius: 12px; background: #fff; padding: 18px; }.detail-panel h3 { margin-bottom: 14px; color: #102d59; font-size: 16px; font-weight: 750; }.detail-description-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 28px; font-size: 13px; }.detail-description-list div { display: flex; gap: 8px; min-width: 0; }.detail-description-list dt { flex: none; color: #58749f; }.detail-description-list dd { min-width: 0; color: #102d59; font-weight: 650; white-space: nowrap; }.detail-note { margin-top: 16px; border-radius: 8px; background: #f7faff; padding: 10px 12px; color: #58749f; font-size: 13px; }.attachment-row { display: flex; align-items: center; gap: 12px; border-top: 1px solid #e4ecf6; padding: 13px 0; }.attachment-row:first-of-type { border-top: 0; }.attachment-row span { color: #58749f; font-size: 12px; }.payment-node-row { position: relative; display: flex; gap: 14px; padding: 0 0 18px 6px; }.payment-node-row::before { position: absolute; top: 18px; bottom: -2px; left: 12px; width: 2px; background: #d7e1ef; content: ''; }.payment-node-row:last-child::before { display: none; }.timeline-dot { z-index: 1; width: 14px; height: 14px; margin-top: 8px; flex: none; border-radius: 999px; background: #fff; border: 2px solid #3b82e5; }.payment-node-card { flex: 1; border: 1px solid #d7e1ef; border-radius: 12px; padding: 13px 15px; }.payment-node-card strong { color: #102d59; }.payment-node-card p { margin-top: 5px; color: #58749f; font-size: 13px; }.node-status { display: inline-flex; min-height: 22px; align-items: center; border-radius: 999px; background: #edf5ff; padding: 2px 8px; color: #2563eb; font-size: 12px; font-weight: 700; }.node-alert-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }.node-alert-list span { border-radius: 6px; background: #f7faff; padding: 4px 7px; color: #58749f; font-size: 12px; }.alert-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; border-top: 1px solid #e4ecf6; padding: 12px 0; color: #58749f; font-size: 13px; }.alert-row:first-of-type { border-top: 0; }.alert-row strong { color: #102d59; }.detail-empty { padding: 38px; color: var(--text-muted); text-align: center; } @container (max-width: 640px) { .detail-summary-grid, .detail-description-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } } @media (max-width: 640px) { .detail-description-list { grid-template-columns: 1fr; }.attachment-row { align-items: flex-start; flex-wrap: wrap; }.attachment-row button { margin-left: 32px; } }
|
||||
.help-label { position: relative; cursor: help; }.help-label::after { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: max-content; max-width: min(280px, 70vw); padding: 7px 9px; border-radius: 6px; background: #334155; color: #fff; content: attr(data-help); font-size: 11px; font-weight: 400; line-height: 1.45; opacity: 0; pointer-events: none; transition: opacity .15s ease; white-space: normal; }.help-label:hover::after { opacity: 1; }.detail-parse-issues { margin-top: 14px; border-radius: 8px; background: #fff7ed; padding: 10px 12px; color: #9a3412; font-size: 13px; }.detail-parse-issues strong { display: block; margin-bottom: 4px; font-weight: 700; }.detail-parse-issues ul { margin: 0; padding-left: 16px; }.detail-parse-issues li { line-height: 1.6; }
|
||||
.help-label { position: relative; cursor: help; }.help-label::after { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: max-content; max-width: min(280px, 70vw); padding: 7px 9px; border-radius: 6px; background: #334155; color: #fff; content: attr(data-help); font-size: 11px; font-weight: 400; line-height: 1.45; opacity: 0; pointer-events: none; transition: opacity .15s ease; white-space: normal; }.help-label.help-wide::after { max-width: min(420px, 78vw); white-space: pre-line; }.help-label:hover::after { opacity: 1; }.detail-parse-issues { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; border-radius: 8px; background: #fff7ed; padding: 10px 12px; color: #9a3412; font-size: 13px; }.detail-parse-issues strong { display: block; margin-bottom: 4px; font-weight: 700; }.detail-parse-review { flex: none; height: 34px; padding: 0 16px; }.detail-parse-issues ul { margin: 0; padding-left: 16px; }.detail-parse-issues li { line-height: 1.6; }
|
||||
.attachment-preview-body { position: relative; min-height: 0; padding: 0; }.attachment-preview-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }.attachment-preview-image { display: block; max-width: 100%; max-height: 100%; margin: 0 auto; object-fit: contain; }
|
||||
.timeline-dot.dot-paid, .timeline-dot.dot-current { background: #16a34a; border-color: #16a34a; }.timeline-dot.dot-due { background: #ea580c; border-color: #ea580c; }.timeline-dot.dot-overdue { background: #dc2626; border-color: #dc2626; }.timeline-dot.dot-pending { background: #fff; border-color: #93a7c8; }.timeline-dot.dot-review { background: #f59e0b; border-color: #f59e0b; }.node-status.status-paid { background: #e8f7ee; color: #16a34a; }.node-status.status-current { background: #e8f7ee; color: #16a34a; }.node-status.status-due { background: #fff4e8; color: #ea580c; }.node-status.status-overdue { background: #fee2e2; color: #dc2626; }.node-status.status-pending { background: #eef3fa; color: #5c76a0; }.node-status.status-review { background: #fff7ed; color: #c2410c; }.payment-node-pay-line { margin-top: 6px; color: #102d59; font-weight: 650; }
|
||||
</style>
|
||||
@@ -0,0 +1,349 @@
|
||||
<!--
|
||||
features/contract-payment/views/ContractPaymentManualReviewPage.vue
|
||||
用途:待确认合同的人工复核弹窗。补齐阶段金额、比例和日期依据后进入合同台账。
|
||||
依赖:contract-payment.api、统一消息提示、admin.contractPaymentReview 文案。
|
||||
逻辑:由合同详情页的「人工复核」按钮打开。合同详情本身不改;已识别阶段预填。
|
||||
勾选无此阶段则该阶段按 0 且不预警。底部四条是填写提示。确认按钮在规则满足前不可点,后端仍是最终校验。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import {
|
||||
getContractPaymentContract,
|
||||
submitContractPaymentManualReview,
|
||||
type ContractPaymentContract,
|
||||
} from '../api/contract-payment.api';
|
||||
|
||||
const props = defineProps<{
|
||||
contractId: number;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
close: [];
|
||||
confirmed: [];
|
||||
}>();
|
||||
|
||||
const STAGE_TYPES = ['prepayment', 'shipment', 'acceptance', 'warranty'] as const;
|
||||
type StageType = typeof STAGE_TYPES[number];
|
||||
|
||||
interface StageForm {
|
||||
nodeType: StageType;
|
||||
skipped: boolean;
|
||||
percent: string;
|
||||
amount: string;
|
||||
basisDate: string;
|
||||
}
|
||||
|
||||
const { t } = useI18n();
|
||||
const msg = useMessage();
|
||||
const loading = ref(false);
|
||||
const submitting = ref(false);
|
||||
const contract = ref<ContractPaymentContract | null>(null);
|
||||
const totalAmount = ref('');
|
||||
const purchaseOrderNo = ref('');
|
||||
const contractNo = ref('');
|
||||
const archiveDate = ref('');
|
||||
const stages = ref<StageForm[]>([]);
|
||||
const contractId = computed(() => Number(props.contractId));
|
||||
|
||||
/**
|
||||
* 按合同金额和比例计算阶段金额,四舍五入到分。
|
||||
* 核心逻辑:与后端 Decimal 半分向上的结果对齐,差额在 0.02 以内才允许确认。
|
||||
* @param percentRaw - 当前阶段比例文本。
|
||||
* @returns 金额;合同金额或比例还不是数字时返回 null。
|
||||
*/
|
||||
function expectedAmount(percentRaw: string): number | null {
|
||||
const total = Number(totalAmount.value);
|
||||
const percent = Number(percentRaw);
|
||||
if (!Number.isFinite(total) || !Number.isFinite(percent) || percentRaw.trim() === '') return null;
|
||||
return Math.round(total * percent) / 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* 把金额格式化成两位小数,供输入框展示。
|
||||
* @param value - 已算出的金额。
|
||||
* @returns 固定两位小数字符串。
|
||||
*/
|
||||
function formatAmount(value: number): string {
|
||||
return value.toFixed(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用合同详情预填复核表单。
|
||||
* 核心逻辑:已有节点带出比例、金额和日期依据;没有节点的阶段留空,不能把空比例当成 0。
|
||||
* 预付款没有日期时用合同归档日,因为预付款的日期依据就是归档日。
|
||||
* @param row - 合同详情。
|
||||
*/
|
||||
function prefill(row: ContractPaymentContract): void {
|
||||
totalAmount.value = row.total_amount || '';
|
||||
purchaseOrderNo.value = row.purchase_order_no || '';
|
||||
contractNo.value = row.contract_no || '';
|
||||
archiveDate.value = (row.oa_archive_at || '').slice(0, 10);
|
||||
stages.value = STAGE_TYPES.map((nodeType) => {
|
||||
const node = (row.nodes || []).find((item) => item.node_type === nodeType);
|
||||
const skipped = String(node?.status || '').trim().toLowerCase() === 'not_applicable';
|
||||
const percentValue = Number(node?.percentage);
|
||||
const percent = node?.percentage != null && node.percentage !== '' && Number.isFinite(percentValue) ? String(percentValue) : '';
|
||||
const basisDate = node?.due_date || node?.anchor_date || (nodeType === 'prepayment' ? archiveDate.value : '');
|
||||
const amount = percent === '' ? '' : (node?.amount || '');
|
||||
return {
|
||||
nodeType,
|
||||
skipped,
|
||||
percent: skipped ? '0' : percent,
|
||||
amount: skipped ? '0' : amount,
|
||||
basisDate: skipped ? '' : basisDate,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载待复核合同。
|
||||
* 核心逻辑:失败时保留空表单并提示,避免把上一份合同的数字提交到新主键。
|
||||
*/
|
||||
async function load(): Promise<void> {
|
||||
loading.value = true;
|
||||
contract.value = null;
|
||||
try {
|
||||
const row = await getContractPaymentContract(contractId.value);
|
||||
contract.value = row;
|
||||
prefill(row);
|
||||
} catch (error) {
|
||||
msg.error(error instanceof BusinessError ? error.message : t('admin.contractPaymentReview.formLoadFailed'));
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 比例变化时按合同金额重算该阶段金额。
|
||||
* @param stage - 正在编辑的阶段。
|
||||
*/
|
||||
function onPercentInput(stage: StageForm): void {
|
||||
if (stage.skipped) return;
|
||||
const expected = expectedAmount(stage.percent);
|
||||
stage.amount = expected == null ? '' : formatAmount(expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* 合同金额变化时重算所有未跳过且已填比例的阶段金额。
|
||||
*/
|
||||
function onTotalInput(): void {
|
||||
stages.value.forEach((stage) => {
|
||||
if (stage.skipped || stage.percent.trim() === '') return;
|
||||
const expected = expectedAmount(stage.percent);
|
||||
if (expected != null) stage.amount = formatAmount(expected);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 归档日仍空着预付款日期时,把归档日带入预付款。
|
||||
* 核心逻辑:预付款日期依据就是合同归档日;用户已经手改过预付款日期时不覆盖。
|
||||
*/
|
||||
function onArchiveInput(): void {
|
||||
const prepayment = stages.value.find((stage) => stage.nodeType === 'prepayment');
|
||||
if (prepayment && !prepayment.skipped && !prepayment.basisDate) prepayment.basisDate = archiveDate.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换无此阶段。勾选后比例和金额记 0 并停用输入。
|
||||
* @param stage - 被勾选的阶段。
|
||||
*/
|
||||
function onSkipChange(stage: StageForm): void {
|
||||
if (!stage.skipped) return;
|
||||
stage.percent = '0';
|
||||
stage.amount = '0';
|
||||
stage.basisDate = '';
|
||||
}
|
||||
|
||||
const enabledStages = computed(() => stages.value.filter((stage) => !stage.skipped));
|
||||
|
||||
const rules = computed(() => {
|
||||
const total = Number(totalAmount.value);
|
||||
const poOk = purchaseOrderNo.value.trim().length > 0 && Number.isFinite(total) && total > 0;
|
||||
const percentOk = enabledStages.value.length > 0 && enabledStages.value.every((stage) => {
|
||||
const value = Number(stage.percent);
|
||||
return stage.percent.trim() !== '' && Number.isFinite(value) && value >= 0;
|
||||
}) && Math.abs(enabledStages.value.reduce((sum, stage) => sum + Number(stage.percent), 0) - 100) < 0.001;
|
||||
const amountOk = percentOk && enabledStages.value.every((stage) => {
|
||||
const expected = expectedAmount(stage.percent);
|
||||
const input = Number(stage.amount);
|
||||
return expected != null && Number.isFinite(input) && Math.abs(input - expected) < 0.02;
|
||||
});
|
||||
const dateOk = enabledStages.value
|
||||
.filter((stage) => stage.nodeType === 'prepayment' || stage.nodeType === 'shipment')
|
||||
.every((stage) => !!stage.basisDate);
|
||||
return [
|
||||
{ ok: poOk, text: t('admin.contractPaymentReview.ruleIdentity') },
|
||||
{ ok: percentOk, text: t('admin.contractPaymentReview.rulePercent') },
|
||||
{ ok: amountOk, text: t('admin.contractPaymentReview.ruleAmount') },
|
||||
{ ok: dateOk, text: t('admin.contractPaymentReview.ruleDate') },
|
||||
];
|
||||
});
|
||||
|
||||
const canSubmit = computed(() => !loading.value && !submitting.value && rules.value.every((rule) => rule.ok));
|
||||
|
||||
const fillHints = computed(() => [
|
||||
t('admin.contractPaymentReview.ruleIdentity'),
|
||||
t('admin.contractPaymentReview.rulePercent'),
|
||||
t('admin.contractPaymentReview.ruleAmount'),
|
||||
t('admin.contractPaymentReview.ruleDate'),
|
||||
]);
|
||||
|
||||
/**
|
||||
* 返回阶段输入框下的说明。
|
||||
* @param nodeType - 付款阶段。
|
||||
* @returns 该阶段日期依据的含义。
|
||||
*/
|
||||
function stageHint(nodeType: StageType): string {
|
||||
const key = {
|
||||
prepayment: 'hintPrepayment',
|
||||
shipment: 'hintShipment',
|
||||
acceptance: 'hintAcceptance',
|
||||
warranty: 'hintWarranty',
|
||||
}[nodeType];
|
||||
return t(`admin.contractPaymentReview.${key}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交复核。通过后通知父级切到合同台账。
|
||||
* 核心逻辑:请求体带上四个阶段;无此阶段仍传 skipped,由后端写成不预警。
|
||||
*/
|
||||
async function submitReview(): Promise<void> {
|
||||
if (!canSubmit.value || !contract.value) return;
|
||||
submitting.value = true;
|
||||
try {
|
||||
await submitContractPaymentManualReview(contract.value.id, {
|
||||
purchase_order_no: purchaseOrderNo.value.trim(),
|
||||
contract_no: contractNo.value.trim(),
|
||||
total_amount: totalAmount.value.trim(),
|
||||
archive_date: archiveDate.value,
|
||||
stages: stages.value.map((stage) => ({
|
||||
node_type: stage.nodeType,
|
||||
skipped: stage.skipped,
|
||||
percentage: stage.skipped ? '0' : stage.percent.trim(),
|
||||
amount: stage.skipped ? '0' : stage.amount.trim(),
|
||||
basis_date: stage.skipped ? '' : stage.basisDate,
|
||||
})),
|
||||
});
|
||||
msg.success(t('admin.contractPaymentReview.confirmSuccess'));
|
||||
emit('confirmed');
|
||||
} catch (error) {
|
||||
msg.error(error instanceof BusinessError ? error.message : t('admin.contractPaymentReview.submitFailed'));
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
watch(contractId, () => void load());
|
||||
onMounted(() => void load());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport to="body">
|
||||
<div class="dialog-overlay z-[160] items-center" @click.self="emit('close')">
|
||||
<div class="dialog-panel review-dialog" role="dialog" aria-modal="true" :aria-label="t('admin.contractPaymentReview.manualAction')">
|
||||
<div class="dialog-header dialog-header--compact">
|
||||
<div class="min-w-0">
|
||||
<div class="text-base font-semibold text-slate-900">{{ t('admin.contractPaymentReview.manualAction') }}</div>
|
||||
<p v-if="contract" class="mt-1 text-sm text-muted">{{ t('admin.contractPaymentReview.manualSubtitle', { supplier: contract.supplier_name || '—', purchaseOrder: contract.purchase_order_no || '—' }) }}</p>
|
||||
</div>
|
||||
<button type="button" class="btn-secondary shrink-0" @click="emit('close')">{{ t('common.close') }}</button>
|
||||
</div>
|
||||
<div class="dialog-body">
|
||||
<p v-if="loading && !contract" class="review-empty">{{ t('admin.contractPayment.detailLoading') }}</p>
|
||||
<template v-else-if="contract">
|
||||
<div class="review-cards">
|
||||
<label>
|
||||
<span>{{ t('admin.contractPayment.amount') }}</span>
|
||||
<input v-model="totalAmount" type="number" min="0" step="0.01" @input="onTotalInput" />
|
||||
</label>
|
||||
<label>
|
||||
<span>{{ t('admin.contractPayment.purchaseOrder') }}</span>
|
||||
<input v-model="purchaseOrderNo" type="text" />
|
||||
</label>
|
||||
<label>
|
||||
<span>{{ t('admin.contractPaymentReview.contractNoOptional') }}</span>
|
||||
<input v-model="contractNo" type="text" :placeholder="t('admin.contractPaymentReview.contractNoPlaceholder')" />
|
||||
</label>
|
||||
<label>
|
||||
<span>{{ t('admin.contractPayment.archiveDate') }}</span>
|
||||
<input v-model="archiveDate" type="date" @input="onArchiveInput" />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="review-stage">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ t('admin.contractPayment.detailPaymentPlan') }}</th>
|
||||
<th>{{ t('admin.contractPaymentReview.percentage') }}</th>
|
||||
<th>{{ t('admin.contractPaymentReview.stageAmount') }}</th>
|
||||
<th>{{ t('admin.contractPaymentReview.basisDate') }}</th>
|
||||
<th>{{ t('admin.contractPaymentReview.noStage') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="stage in stages" :key="stage.nodeType">
|
||||
<td>
|
||||
<strong>{{ t(`admin.contractPayment.nodeType.${stage.nodeType}`) }}</strong>
|
||||
<span>{{ stageHint(stage.nodeType) }}</span>
|
||||
</td>
|
||||
<td><input v-model="stage.percent" type="number" min="0" max="100" step="0.01" :disabled="stage.skipped" @input="onPercentInput(stage)" /></td>
|
||||
<td><input v-model="stage.amount" type="number" min="0" step="0.01" :disabled="stage.skipped" /></td>
|
||||
<td><input v-model="stage.basisDate" type="date" :disabled="stage.skipped" /></td>
|
||||
<td>
|
||||
<label class="review-check">
|
||||
<input v-model="stage.skipped" type="checkbox" @change="onSkipChange(stage)" />
|
||||
{{ t('admin.contractPaymentReview.noStage') }}
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="review-hint">
|
||||
<strong>{{ t('admin.contractPaymentReview.fillHintTitle') }}</strong>
|
||||
<p v-for="hint in fillHints" :key="hint">{{ hint }}</p>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="dialog-footer">
|
||||
<button type="button" class="btn-secondary" @click="emit('close')">{{ t('common.cancel') }}</button>
|
||||
<button type="button" class="btn-primary" :disabled="!canSubmit" @click="submitReview">
|
||||
{{ t('admin.contractPaymentReview.confirmLedger') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.review-dialog { width: min(1080px, 100%); max-height: min(85vh, 900px); }
|
||||
.review-empty { padding: 28px 0; color: #58749f; }
|
||||
.review-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
|
||||
.review-cards label, .review-stage { border: 1px solid #d7e1ef; border-radius: 12px; background: #fff; }
|
||||
.review-cards label { display: block; padding: 12px; background: #f8fbff; }
|
||||
.review-cards span, .review-stage th { color: #58749f; font-size: 12px; }
|
||||
.review-cards input, .review-stage input[type="number"], .review-stage input[type="text"], .review-stage input[type="date"] {
|
||||
width: 100%; height: 32px; margin-top: 6px; border: 1px solid #d7e1ef; border-radius: 8px; padding: 0 8px; background: #fff; color: #102d59; font-weight: 650;
|
||||
}
|
||||
.review-cards input { border: 0; background: transparent; padding: 0; font-size: 15px; }
|
||||
.review-cards input:focus { background: #fff; }
|
||||
.review-stage { overflow: auto; }
|
||||
.review-stage table { width: 100%; border-collapse: collapse; }
|
||||
.review-stage th, .review-stage td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #e4ecf6; vertical-align: top; }
|
||||
.review-stage th { background: #f7faff; }
|
||||
.review-stage td span { display: block; margin-top: 4px; color: #58749f; font-size: 12px; }
|
||||
.review-stage input:disabled { background: #f3f6fb; color: #8aa0bd; }
|
||||
.review-check { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
|
||||
.review-hint { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #f7faff; color: #58749f; }
|
||||
.review-hint strong { display: block; margin-bottom: 4px; color: #426493; font-size: 13px; }
|
||||
.review-hint p { margin: 0; font-size: 13px; line-height: 1.6; }
|
||||
@media (max-width: 900px) {
|
||||
.review-cards { grid-template-columns: 1fr 1fr; }
|
||||
}
|
||||
</style>
|
||||
@@ -3,6 +3,7 @@
|
||||
用途:合同付款预警台账列表、汇总卡与本周待发送摘要。
|
||||
依赖:contract-payment.api、PaginationBar、统一消息提示。
|
||||
逻辑:Chat Tab 以 embedded 嵌入时隐藏页头;点行通过 open-detail 交给父级下钻详情;关键词可搜合同号、流程号、采购单号、供应商和申请人。
|
||||
四阶段列只显示阶段名。预付款、出货款按 ERP 付款事实标已付或逾期/即将到期/未到期;验收款、质保款只展示金额比例和日期依据。
|
||||
嵌入布局为上半汇总卡/搜索与底部分页固定,仅表格区域双向滚动;汇总卡采用紧凑尺寸以留出小屏列表高度。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
@@ -22,7 +23,7 @@ import {
|
||||
type LedgerSummary,
|
||||
} from '../api/contract-payment.api';
|
||||
import { displayCurrency } from '../utils/currency';
|
||||
import { aggregateContractNodeStatus, type ContractNodeStatusCode } from '../utils/paymentStatus';
|
||||
import { aggregateContractNodeStatus, isNodeNearDue, isNodeOverdue, nodeDueReference, type ContractNodeStatusCode } from '../utils/paymentStatus';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
embedded?: boolean;
|
||||
@@ -57,19 +58,47 @@ const displayPercentage = (percentage?: string | null): string => {
|
||||
const value = Number(percentage);
|
||||
return Number.isFinite(value) ? String(Math.round(value)) : String(percentage);
|
||||
};
|
||||
const stageTypes = ['prepayment', 'shipment', 'acceptance', 'warranty'] as const;
|
||||
type StagePayTone = '' | 'paid' | 'overdue' | 'due' | 'normal';
|
||||
/**
|
||||
* 将付款节点拆为原型表格需要的金额比例行和日期行。
|
||||
* 核心逻辑:节点不存在时显示短横线;存在但日期未明确时仅显示“待补充日期”,避免把锚点日期误当付款日期。
|
||||
* 组装一个付款阶段格子:金额比例、日期,以及预付款/出货款的付款状态。
|
||||
* 核心逻辑:预付款、出货款有 ERP 付款事实。已付显示付款日;未付按日期依据标已逾期、即将到期或未到期,日期仍是依据日。
|
||||
* 验收款、质保款没有付款回写,不标已付或未付。没有日期依据时显示待补充日期。
|
||||
* 人工复核标成无此阶段,或比例和金额都是 0 的阶段,显示为横线,不参与这一格的状态。
|
||||
* @param item - 合同台账行。
|
||||
* @param name - 付款节点类型。
|
||||
* @returns 表格单元格展示所需的金额比例、日期及是否为待补充状态。
|
||||
* @returns 金额比例、日期文本、是否待补充,以及状态标签和色调。
|
||||
*/
|
||||
const paymentCell = (item: ContractPaymentContract, name: string) => {
|
||||
const node = stage(item, name);
|
||||
if (!node) return { amountRatio: '—', date: '', missingDate: false };
|
||||
const empty = { amountRatio: '—', dateText: '', missingDate: false, payLabel: '', payTone: '' as StagePayTone };
|
||||
if (!node) return empty;
|
||||
const status = String(node.status || '').trim().toLowerCase();
|
||||
const percentValue = Number(node.percentage);
|
||||
const amountValue = Number(node.amount);
|
||||
const absent = status === 'not_applicable' || (
|
||||
status !== 'paid'
|
||||
&& Number.isFinite(percentValue)
|
||||
&& percentValue === 0
|
||||
&& (node.amount == null || node.amount === '' || amountValue === 0)
|
||||
);
|
||||
if (absent) return empty;
|
||||
const amountRatio = node.amount || node.percentage ? `${node.amount || '—'} / ${displayPercentage(node.percentage)}%` : '—';
|
||||
const date = node.due_date || node.anchor_date || '';
|
||||
return { amountRatio, date, missingDate: !date };
|
||||
const basis = nodeDueReference(node) || '';
|
||||
const payable = name === 'prepayment' || name === 'shipment';
|
||||
const paid = String(node.status || '').trim().toLowerCase() === 'paid';
|
||||
if (payable && paid) {
|
||||
return { amountRatio, dateText: node.paid_at || '—', missingDate: false, payLabel: t('admin.contractPayment.stagePaid'), payTone: 'paid' as StagePayTone };
|
||||
}
|
||||
if (!basis) return { amountRatio, dateText: '', missingDate: true, payLabel: '', payTone: '' as StagePayTone };
|
||||
if (!payable) return { amountRatio, dateText: basis, missingDate: false, payLabel: '', payTone: '' as StagePayTone };
|
||||
if (isNodeOverdue(basis)) {
|
||||
return { amountRatio, dateText: basis, missingDate: false, payLabel: t('admin.contractPayment.statusOverdue'), payTone: 'overdue' as StagePayTone };
|
||||
}
|
||||
if (isNodeNearDue(basis)) {
|
||||
return { amountRatio, dateText: basis, missingDate: false, payLabel: t('admin.contractPayment.statusUpcoming'), payTone: 'due' as StagePayTone };
|
||||
}
|
||||
return { amountRatio, dateText: basis, missingDate: false, payLabel: t('admin.contractPayment.statusActive'), payTone: 'normal' as StagePayTone };
|
||||
};
|
||||
/**
|
||||
* 按付款节点聚合台账状态:未到期 / 即将到期 / 已逾期 / 已完成 / 待补充。
|
||||
@@ -231,14 +260,14 @@ onMounted(() => void load());
|
||||
<table class="contract-ledger-table text-sm">
|
||||
<thead><tr>
|
||||
<th>{{ t('admin.contractPayment.contractSupplier') }}</th><th>{{ t('admin.contractPayment.amount') }}</th>
|
||||
<th v-for="nodeType in ['prepayment', 'shipment', 'acceptance', 'warranty']" :key="nodeType"><span>{{ t(`admin.contractPayment.nodeType.${nodeType}`) }}</span><small>{{ t('admin.contractPayment.amountRatioDate') }}</small></th>
|
||||
<th v-for="nodeType in stageTypes" :key="nodeType">{{ t(`admin.contractPayment.nodeType.${nodeType}`) }}</th>
|
||||
<th>{{ t('admin.contractPayment.applicant') }}</th><th>{{ t('admin.contractPayment.statusLabel') }}</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr v-for="item in contracts" :key="item.id" class="contract-ledger-row" @click="openContractDetail(item.id)">
|
||||
<td class="contract-identify"><strong>{{ t('admin.contractPayment.contractPrefix') }}:{{ item.contract_no || t('admin.contractPayment.contractNoPending') }}</strong><span>{{ t('admin.contractPayment.workflowNo') }}:{{ item.workflow_no || '—' }}</span><span>{{ t('admin.contractPayment.purchaseOrder') }}:{{ item.purchase_order_no || '—' }}</span><span>{{ item.supplier_name || '—' }}</span></td>
|
||||
<td class="contract-identify"><strong>{{ t('admin.contractPayment.contractPrefix') }}:{{ item.contract_no || t('admin.contractPayment.contractNoPending') }}</strong><span>{{ t('admin.contractPayment.purchaseOrder') }}:{{ item.purchase_order_no || '—' }}</span><span>{{ item.supplier_name || '—' }}</span></td>
|
||||
<td class="contract-money">{{ item.total_amount || '—' }}<span v-if="displayCurrency(item.currency)"> {{ displayCurrency(item.currency) }}</span></td>
|
||||
<td v-for="nodeType in ['prepayment', 'shipment', 'acceptance', 'warranty']" :key="nodeType" class="contract-payment-cell"><template v-if="paymentCell(item, nodeType).amountRatio !== '—'"><strong>{{ paymentCell(item, nodeType).amountRatio }}</strong><span :class="{ 'contract-date-pending': paymentCell(item, nodeType).missingDate }">{{ paymentCell(item, nodeType).date || t('admin.contractPayment.datePending') }}</span></template><span v-else>—</span></td>
|
||||
<td v-for="nodeType in stageTypes" :key="nodeType" class="contract-payment-cell"><template v-if="paymentCell(item, nodeType).amountRatio !== '—'"><strong>{{ paymentCell(item, nodeType).amountRatio }}</strong><span :class="{ 'contract-date-pending': paymentCell(item, nodeType).missingDate }">{{ paymentCell(item, nodeType).dateText || t('admin.contractPayment.datePending') }}</span><span v-if="paymentCell(item, nodeType).payLabel" class="stage-pay-tag" :class="paymentCell(item, nodeType).payTone">{{ paymentCell(item, nodeType).payLabel }}</span></template><span v-else>—</span></td>
|
||||
<td class="contract-applicant">{{ item.applicant_name || '—' }}</td>
|
||||
<td><span class="contract-status" :class="displayStatus(item).tone">{{ displayStatus(item).label }}</span></td>
|
||||
</tr>
|
||||
@@ -344,11 +373,10 @@ onMounted(() => void load());
|
||||
.contract-scroll-panel::-webkit-scrollbar-thumb { background: #9eb1c9; border-radius: 8px; border: 2px solid #e8eef6; }
|
||||
.contract-scroll-panel::-webkit-scrollbar-thumb:hover { background: #7c93b0; }
|
||||
.contract-ledger-table { width: 100%; min-width: 1260px; border-collapse: separate; border-spacing: 0; color: #183c72; }
|
||||
.contract-ledger-table th { position: sticky; top: 0; z-index: 2; height: 59px; padding: 11px 12px; background: #f7faff; border-bottom: 1px solid #d7e1ef; color: #426493; font-size: 13px; font-weight: 700; line-height: 1.35; text-align: left; vertical-align: top; white-space: nowrap; }
|
||||
.contract-ledger-table th small { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; }
|
||||
.contract-ledger-table th { position: sticky; top: 0; z-index: 2; height: auto; padding: 10px 12px; background: #f7faff; border-bottom: 1px solid #d7e1ef; color: #426493; font-size: 13px; font-weight: 700; line-height: 1.35; text-align: left; vertical-align: middle; white-space: nowrap; }
|
||||
.contract-ledger-table td { padding: 12px; border-bottom: 1px solid #d7e1ef; vertical-align: top; line-height: 1.5; }
|
||||
.contract-ledger-table tbody tr:last-child td { border-bottom: 0; }
|
||||
.contract-ledger-table tbody tr:hover { background: #fbfdff; }.contract-ledger-row { cursor: pointer; }
|
||||
.contract-ledger-table th:nth-child(1) { width: 22%; }.contract-ledger-table th:nth-child(2) { width: 8.5%; }.contract-ledger-table th:nth-child(n+3):nth-child(-n+6) { width: 13.5%; }.contract-ledger-table th:nth-child(7) { width: 7.5%; }.contract-ledger-table th:nth-child(8) { width: 7%; }
|
||||
.contract-identify strong, .contract-payment-cell strong { display: block; color: #102d59; font-weight: 750; }.contract-identify span, .contract-payment-cell span { display: block; margin-top: 3px; color: #58749f; }.contract-identify strong { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }.contract-money { color: #102d59; white-space: nowrap; }.contract-payment-cell { color: #102d59; }.contract-date-pending { color: #5c76a0; }.contract-applicant { white-space: nowrap; color: #102d59; }.contract-status { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }.contract-status.normal { color: #2563eb; background: #edf5ff; }.contract-status.due { color: #ea580c; background: #fff4e8; }.contract-status.overdue { color: #dc2626; background: #fee2e2; }.contract-status.completed { color: #16a34a; background: #e8f7ee; }.contract-status.needs-completion { color: #c2410c; background: #fff4e8; }.contract-empty { padding: 34px !important; color: var(--text-muted); text-align: center; }
|
||||
.contract-identify strong, .contract-payment-cell strong { display: block; color: #102d59; font-weight: 750; }.contract-identify span, .contract-payment-cell span { display: block; margin-top: 3px; color: #58749f; }.contract-payment-cell .stage-pay-tag { display: inline-flex; align-items: center; margin-top: 6px; margin-bottom: 0; min-height: 20px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }.contract-payment-cell .stage-pay-tag.paid { color: #16a34a; background: #e8f7ee; }.contract-payment-cell .stage-pay-tag.due { color: #ea580c; background: #fff4e8; }.contract-payment-cell .stage-pay-tag.overdue { color: #dc2626; background: #fee2e2; }.contract-payment-cell .stage-pay-tag.normal { color: #2563eb; background: #edf5ff; }.contract-identify strong { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }.contract-money { color: #102d59; white-space: nowrap; }.contract-payment-cell { color: #102d59; }.contract-date-pending { color: #5c76a0; }.contract-applicant { white-space: nowrap; color: #102d59; }.contract-status { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }.contract-status.normal { color: #2563eb; background: #edf5ff; }.contract-status.due { color: #ea580c; background: #fff4e8; }.contract-status.overdue { color: #dc2626; background: #fee2e2; }.contract-status.completed { color: #16a34a; background: #e8f7ee; }.contract-status.needs-completion { color: #c2410c; background: #fff4e8; }.contract-empty { padding: 34px !important; color: var(--text-muted); text-align: center; }
|
||||
</style>
|
||||
@@ -2,7 +2,7 @@
|
||||
features/contract-payment/views/ContractPaymentReviewPage.vue
|
||||
用途:集中展示关键解析事实缺失或冲突的合同,供管理员下载原文并人工确认。
|
||||
依赖:contract-payment.api、PaginationBar、统一消息提示。
|
||||
逻辑:后端以 review_only 过滤 needs_review 合同;关键词可搜合同号、采购单号、供应商和申请人;Chat 父级通过 open-detail 下钻详情。
|
||||
逻辑:后端以 review_only 过滤 needs_review 合同;关键词可搜合同号、采购单号、供应商和申请人;点行打开原来的合同详情,人工复核在详情页按钮里弹出。
|
||||
嵌入布局为搜索栏与底部分页固定,仅表格区域滚动,表头 sticky。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
@@ -56,8 +56,8 @@ async function load(resetPage = false): Promise<void> {
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开待确认合同详情,以便查看解析问题并下载原文人工核验。
|
||||
* 核心逻辑:仍复用现有合同详情页,避免新页面复制附件权限与下载逻辑。
|
||||
* 打开待确认合同的原详情。
|
||||
* 核心逻辑:把合同主键交给 Chat 父级,仍进入合同详情;人工复核从表单按钮弹出,不替换详情。
|
||||
* @param contractId - 合同付款台账主键。
|
||||
* @returns 路由跳转完成。
|
||||
*/
|
||||
|
||||
@@ -4811,11 +4811,11 @@
|
||||
}
|
||||
},
|
||||
"contractPayment": {
|
||||
"title": "Contract Payment Alerts", "subtitle": "Sync OA contract, acceptance, and vendor prepayment requests; notify procurement roles through three escalation rounds.", "sessionHint": "Chat and history are hidden in this phase. Use the tabs above to open the ledger.", "sync": "Sync OA data", "moreActions": "More", "forceSync": "Force overwrite OA fields", "forceSyncConfirm": "This will overwrite existing OA data with non-empty fields returned this time and record an audit trail. Continue?", "reparseExisting": "Reparse existing contracts", "reparseExistingConfirm": "This will refresh all existing contract parsing results from archived attachments using the current rules. OA fields will not be synced or overwritten. Continue?", "scanAlerts": "Scan to generate alerts", "jobSubmitted": "Job submitted", "actionFailed": "Action failed", "loadFailed": "Failed to load contracts", "searchPlaceholder": "Search contract number, purchase order, supplier, or applicant", "allStatus": "All", "search": "Search", "ledger": "Contract ledger", "items": "items", "empty": "No contract data", "purchaseOrder": "Purchase order", "supplier": "Supplier", "amount": "Contract amount", "deliveryDate": "Delivery due date", "timeline": "Payment plan timeline", "notAvailable": "—", "stats": {"contracts": "Contracts", "pendingParse": "Pending contracts", "readyPlans": "Plans ready", "alerts": "Alert nodes"}, "ledgerFocus": {"due": "Due soon", "dueHint": "within 7 days", "overdue": "Overdue unpaid", "active": "Not yet due", "activeHint": "beyond 7 days", "dueThisMonth": "Due this month", "dueThisMonthHint": "this calendar month"}, "status": {"completed": "Completed", "needs_review": "Needs review", "pending": "Pending parse"}, "stateLabel": {"parsed": "Parsed", "needs_review": "Needs review", "pending": "Pending parse", "active": "Active"}, "nodeType": {"prepayment": "Prepayment", "shipment": "Shipment payment", "acceptance": "Acceptance payment", "warranty": "Warranty payment"}, "ruleConfirmed": "Confirmed", "prepaymentRule": "Alerts at 7/14/21 days after contract archival; request status comes from OA vendor prepayment requests.", "shipmentRule": "Alerts 7 days before delivery, on the due date, and 14 days after; request status comes from OA vendor prepayment requests.", "acceptanceRule": "Alerts at 30/40/60 days after acceptance archival; warranty alerts are 7 days before, on, and 14 days after maturity.", "pendingAlerts": "Pending alerts", "processing": "Payment initiated", "dataPending": "Data pending", "paid": "Paid", "amountRatioDate": "Amount / ratio · date", "applicant": "Applicant", "statusLabel": "Status", "contractPrefix": "Contract", "datePending": "Date pending", "statusNormal": "Normal", "statusNeedsCompletion": "Needs completion", "statusOverdue": "Overdue", "statusUpcoming": "Due soon", "statusActive": "Not yet due", "statusCompleted": "Completed", "totalPrefix": "Total", "contractSupplier": "Contract / supplier", "nextAlert": "Next alert", "triggerBasis": "Trigger basis", "alertDate": "Alert date", "alertFirstRound": "Round 1", "payDate": "Payment date", "processStatus": "Status", "owner": "Procurement owner", "oaData": "OA data", "contractRule": "Contract rule", "ownerDefault": "Procurement owner", "workflowNo": "Workflow number", "contractNoPending": "Contract number pending attachment parsing", "synced": "Synced", "detailSubtitle": "OA data, payment nodes, and WeCom alert records", "backToOverview": "Back to overview", "contractInfo": "OA contract details", "alertHistory": "Alert history", "alertRound": "Alert round {round}", "alertAudit": "Alert delivery record", "alertAuditEmpty": "No alert records", "alertNode": "Payment stage", "alertScheduledAt": "Scheduled date", "alertSentAt": "Sent at", "alertStatus": {"pending": "Pending", "sent": "Sent", "failed": "Failed"}, "roundValue": "Round {round}", "weeklyBatchesTitle": "Weekly Summary Batches", "weeklyBatchesSubtitle": "Review recipient-level payment-alert summaries, Excel attachments, and delivery records.", "weeklySend": "Send alerts", "weeklyBatchSubmitted": "Send alert job submitted", "weeklyJobSent": "Sent {sent} batch(es)", "weeklyJobFailed": "{failed} batch(es) failed. The list has been refreshed; open the failure icon for the reason.", "weeklyJobPartial": "Sent {sent} batch(es); {failed} failed", "weeklyJobEmpty": "There are no pending alerts, so the batch list will not change", "weeklyJobTimeout": "The send task is still running in the background. Reopen this page later to see the result.", "weeklyJobError": "The send task failed", "weeklyBatchesLoadFailed": "Failed to load weekly summary batches", "batchNo": "Batch no.", "weekKey": "Week", "batchStatusLabel": "Delivery status", "batchFailureReason": "Failure reason", "batchFailureReasonEmpty": "No specific failure reason was recorded", "batchFailureReasonAria": "View the send failure reason", "batchFailureReasonLine": "{reason}: {detail}", "batchFailureReasonCode": {"notify_disabled": "WeCom notificLine truncated
|
||||
"title": "Contract Payment Alerts", "subtitle": "Sync OA contract, acceptance, and vendor prepayment requests; notify procurement roles through three escalation rounds.", "sessionHint": "Chat and history are hidden in this phase. Use the tabs above to open the ledger.", "sync": "Sync OA data", "moreActions": "More", "forceSync": "Force overwrite OA fields", "forceSyncConfirm": "This will overwrite existing OA data with non-empty fields returned this time and record an audit trail. Continue?", "reparseExisting": "Reparse existing contracts", "reparseExistingConfirm": "This will refresh all existing contract parsing results from archived attachments using the current rules. OA fields will not be synced or overwritten. Continue?", "scanAlerts": "Scan to generate alerts", "jobSubmitted": "Job submitted", "actionFailed": "Action failed", "loadFailed": "Failed to load contracts", "searchPlaceholder": "Search contract number, purchase order, supplier, or applicant", "allStatus": "All", "search": "Search", "ledger": "Contract ledger", "items": "items", "empty": "No contract data", "purchaseOrder": "Purchase order", "supplier": "Supplier", "amount": "Contract amount", "deliveryDate": "Delivery due date", "timeline": "Payment plan timeline", "notAvailable": "—", "stats": {"contracts": "Contracts", "pendingParse": "Pending contracts", "readyPlans": "Plans ready", "alerts": "Alert nodes"}, "ledgerFocus": {"due": "Due soon", "dueHint": "within 7 days", "overdue": "Overdue unpaid", "active": "Not yet due", "activeHint": "beyond 7 days", "dueThisMonth": "Due this month", "dueThisMonthHint": "this calendar month"}, "status": {"completed": "Completed", "needs_review": "Needs review", "pending": "Pending parse"}, "stateLabel": {"parsed": "Parsed", "needs_review": "Needs review", "pending": "Pending parse", "active": "Active"}, "nodeType": {"prepayment": "Prepayment", "shipment": "Shipment payment", "acceptance": "Acceptance payment", "warranty": "Warranty payment"}, "ruleConfirmed": "Confirmed", "prepaymentRule": "Alerts at 7/14/21 days after contract archival; request status comes from OA vendor prepayment requests.", "shipmentRule": "Alerts 7 days before delivery, on the due date, and 14 days after; request status comes from OA vendor prepayment requests.", "acceptanceRule": "Alerts at 30/40/60 days after acceptance archival; warranty alerts are 7 days before, on, and 14 days after maturity.", "pendingAlerts": "Pending alerts", "processing": "Payment initiated", "dataPending": "Data pending", "paid": "Paid", "stagePaid": "Paid", "amountRatioDate": "Amount / ratio · date", "applicant": "Applicant", "statusLabel": "Status", "contractPrefix": "Contract", "datePending": "Date pending", "statusNormal": "Normal", "statusNeedsCompletion": "Needs completion", "statusOverdue": "Overdue", "statusUpcoming": "Due soon", "statusActive": "Not yet due", "statusCompleted": "Completed", "totalPrefix": "Total", "contractSupplier": "Contract / supplier", "nextAlert": "Next alert", "triggerBasis": "Trigger basis", "alertDate": "Alert date", "alertRuleHint": "Each stage has three reminders on calendar days. Due items go out in the next Friday 18:00 digest. If the date is missing, no reminder is sent.\nPrepayment: day 7, 14, and 21 after contract archive (the page shows the first round)\nShipment payment: 7 days before the delivery date, on that date, and 14 days after\nAcceptance payment: day 30, 40, and 60 after the acceptance is archived\nWarranty payment: 7 days before warranty expiry, on that date, and 14 days after", "alertFirstRound": "Round 1", "payDate": "Payment date", "processStatus": "Status", "owner": "Procurement owner", "oaData": "OA data", "contractRule": "Contract rule", "ownerDefault": "Procurement owner", "workflowNo": "Workflow number", "contractNoPending": "Contract number pending attachment parsing", "synced": "Synced", "detailSubtitle": "OA data, payment nodes, and WeCom alert records", "backToOverview": "Back to overview", "contractInfo": "OA contract details", "alertHistory": "Alert history", "alertRound": "Alert round {round}", "alertAudit": "Alert delivery record", "alertAuditEmpty": "No alert records", "alertNode": "Payment stage", "alertScheduledAt": "Scheduled date", "alertSentAt": "Sent at", "alertStatus": {"pending": "Pending", "sent": "Sent", "failed": "Failed"}, "roundValue": "Round {round}", "weeklyBatchesTitle": "Weekly Summary Batches", "weeklyBatchesSubtitle": "Review recipient-level payment-alert summaries, Excel attachments, and delivery records.", "weeklySend": "Send alerts", "weeklyBatchSubmitted": "Send alert job submitted", "weeklyJobSent": "Sent {sent} batch(es)", "weeklyJobFailed": "{failed} batch(es) failed. The list has been refreshed; open the failure icon for the reason.", "weeklyJobPartial": "Sent {sent} batch(es); {failed} failed", "weeklyJobEmpty": "There are no pending alerts, so the batch list will not change", "weeklyJobTimeout": "The send task is still running in the background. RLine truncated
|
||||
},
|
||||
"contractPaymentReview": {"title": "Contracts for Confirmation", "subtitle": "Contracts that do not match the equipment procurement synonym title groups, fail payment-ratio validation, or conflict with OA fields are excluded from payment alerts. Download the original contract to verify it.", "searchPlaceholder": "Contract number, purchase order, supplier, or applicant", "loadFailed": "Failed to load contracts for confirmation", "contractWorkflow": "Contract / workflow number", "reason": "Reason for confirmation", "fallbackIssue": "Parsing result requires manual confirmation", "empty": "No contracts need confirmation"},
|
||||
"contractPaymentReview": {"title": "Contracts for Confirmation", "subtitle": "Contracts that do not match the equipment procurement synonym title groups, fail payment-ratio validation, or conflict with OA fields are excluded from payment alerts. Download the original contract to verify it.", "searchPlaceholder": "Contract number, purchase order, supplier, or applicant", "loadFailed": "Failed to load contracts for confirmation", "contractWorkflow": "Contract / workflow number", "reason": "Reason for confirmation", "fallbackIssue": "Parsing result requires manual confirmation", "empty": "No contracts need confirmation", "manualTitle": "Review payment stages", "manualSubtitle": "{supplier} · PO {purchaseOrder}. Recognized stages are filled in and can be edited.", "backToReview": "Back to pending", "confirmLedger": "Add to ledger", "confirmSuccess": "Added to the contract ledger", "issueTitle": "Parse notes", "contractNoOptional": "Contract number (optional)", "contractNoPlaceholder": "Not found in the attachment", "percentage": "Percent %", "stageAmount": "Amount", "basisDate": "Date basis", "noStage": "No such stage", "ruleIdentity": "Purchase order and contract amount are valid", "rulePercent": "Enabled percentages total 100%. A blank percentage is not zero", "ruleAmount": "Each enabled amount equals the contract amount times its percentage", "ruleDate": "Prepayment and shipment payment need a date basis", "hintPrepayment": "Date basis is the contract archive date. Enter the deposit or prepayment percentage from the contract.", "hintShipment": "Date basis is the delivery date. If the contract only says “N days after the deposit”, enter a calendar date.", "hintAcceptance": "Date basis is the acceptance archive date. Leave it empty if acceptance is not archived yet.", "hintWarranty": "Check “No such stage” when there is no warranty payment share. A warranty period is not a percentage.", "formLoadFailed": "Failed to load the review form", "submitFailed": "Failed to submit the review", "manualAction": "Manual review", "fillHintTitle": "How to fill in"},
|
||||
"contractPaymentReparse": {"action": "Reparse contract original", "success": "Reparsed with attachment “{attachment}”", "failed": "Failed to reparse contract"},
|
||||
"contractPaymentReview": {"title": "Contracts for Confirmation", "subtitle": "Contracts that do not match the equipment procurement synonym title groups, fail payment-ratio validation, or conflict with OA fields are excluded from payment alerts. Download the original contract to verify it.", "searchPlaceholder": "Contract number, purchase order, supplier, or applicant", "loadFailed": "Failed to load contracts for confirmation", "contractWorkflow": "Contract / workflow number", "reason": "Reason for confirmation", "fallbackIssue": "Parsing result requires manual confirmation", "empty": "No contracts need confirmation"},
|
||||
"contractPaymentReview": {"title": "Contracts for Confirmation", "subtitle": "Contracts that do not match the equipment procurement synonym title groups, fail payment-ratio validation, or conflict with OA fields are excluded from payment alerts. Download the original contract to verify it.", "searchPlaceholder": "Contract number, purchase order, supplier, or applicant", "loadFailed": "Failed to load contracts for confirmation", "contractWorkflow": "Contract / workflow number", "reason": "Reason for confirmation", "fallbackIssue": "Parsing result requires manual confirmation", "empty": "No contracts need confirmation", "manualTitle": "Review payment stages", "manualSubtitle": "{supplier} · PO {purchaseOrder}. Recognized stages are filled in and can be edited.", "backToReview": "Back to pending", "confirmLedger": "Add to ledger", "confirmSuccess": "Added to the contract ledger", "issueTitle": "Parse notes", "contractNoOptional": "Contract number (optional)", "contractNoPlaceholder": "Not found in the attachment", "percentage": "Percent %", "stageAmount": "Amount", "basisDate": "Date basis", "noStage": "No such stage", "ruleIdentity": "Purchase order and contract amount are valid", "rulePercent": "Enabled percentages total 100%. A blank percentage is not zero", "ruleAmount": "Each enabled amount equals the contract amount times its percentage", "ruleDate": "Prepayment and shipment payment need a date basis", "hintPrepayment": "Date basis is the contract archive date. Enter the deposit or prepayment percentage from the contract.", "hintShipment": "Date basis is the delivery date. If the contract only says “N days after the deposit”, enter a calendar date.", "hintAcceptance": "Date basis is the acceptance archive date. Leave it empty if acceptance is not archived yet.", "hintWarranty": "Check “No such stage” when there is no warranty payment share. A warranty period is not a percentage.", "formLoadFailed": "Failed to load the review form", "submitFailed": "Failed to submit the review", "manualAction": "Manual review", "fillHintTitle": "How to fill in"},
|
||||
"procurementContract": {
|
||||
"title": "Procurement Contract Review",
|
||||
"subtitle": "Manage templates, risk red-line rules, and review history",
|
||||
|
||||
@@ -4680,11 +4680,11 @@
|
||||
}
|
||||
},
|
||||
"contractPayment": {
|
||||
"title": "แจ้งเตือนการชำระเงินตามสัญญา", "subtitle": "ซิงก์สัญญา OA การรับมอบ และคำขอเบิกเงินล่วงหน้าของผู้ขาย พร้อมแจ้งเตือน 3 ระดับ", "sessionHint": "ระยะนี้ยังไม่ใช้แชทและประวัติการสนทนา เปิดบัญชีจากแท็บด้านบน", "sync": "ซิงก์ข้อมูล OA", "moreActions": "เพิ่มเติม", "forceSync": "เขียนทับฟิลด์ OA แบบบังคับ", "forceSyncConfirm": "ระบบจะเขียนทับข้อมูล OA เดิมด้วยฟิลด์ที่ไม่ว่างจาก OA ครั้งนี้และบันทึกการตรวจสอบ ต้องการดำเนินการต่อหรือไม่?", "reparseExisting": "แยกวิเคราะห์สัญญาเดิมทั้งหมดใหม่", "reparseExistingConfirm": "ระบบจะรีเฟรชผลการแยกข้อมูลของสัญญาเดิมทั้งหมดจากไฟล์แนบที่จัดเก็บตามกฎปัจจุบัน โดยจะไม่ซิงก์หรือเขียนทับฟิลด์ OA ต้องการดำเนินการต่อหรือไม่?", "scanAlerts": "สแกนเพื่อสร้างแจ้งเตือน", "jobSubmitted": "ส่งงานแล้ว", "actionFailed": "ดำเนินการไม่สำเร็จ", "loadFailed": "โหลดสัญญาไม่สำเร็จ", "searchPlaceholder": "ค้นหาเลขที่สัญญา ใบสั่งซื้อ ผู้ขาย หรือผู้ขอ", "allStatus": "ทั้งหมด", "search": "ค้นหา", "ledger": "ทะเบียนสัญญา", "items": "รายการ", "empty": "ไม่มีข้อมูลสัญญา", "purchaseOrder": "ใบสั่งซื้อ", "supplier": "ผู้ขาย", "amount": "มูลค่าสัญญา", "deliveryDate": "กำหนดส่งมอบ", "timeline": "ไทม์ไลน์แผนการชำระเงิน", "notAvailable": "—", "stats": {"contracts": "สัญญา", "pendingParse": "สัญญาที่รอดำเนินการ", "readyPlans": "แผนพร้อมใช้", "alerts": "จุดแจ้งเตือน"}, "ledgerFocus": {"due": "ใกล้ครบกำหนด", "dueHint": "ใน 7 วัน", "overdue": "ค้างชำระเกินกำหนด", "active": "ยังไม่ถึงกำหนด", "activeHint": "เกิน 7 วัน", "dueThisMonth": "ถึงกำหนดเดือนนี้", "dueThisMonthHint": "เดือนปฏิทินนี้"}, "status": {"completed": "เสร็จสิ้น", "needs_review": "ต้องตรวจสอบ", "pending": "รอแยกข้อมูล"}, "stateLabel": {"parsed": "แยกข้อมูลแล้ว", "needs_review": "ต้องตรวจสอบ", "pending": "รอแยกข้อมูล", "active": "ใช้งานอยู่"}, "nodeType": {"prepayment": "เงินล่วงหน้า", "shipment": "เงินก่อนส่ง", "acceptance": "เงินรับมอบ", "warranty": "เงินประกัน"}, "ruleConfirmed": "ยืนยันแล้ว", "prepaymentRule": "แจ้งเตือนวันที่ 7/14/21 หลังจัดเก็บสัญญา; สถานะคำขออ้างอิง OA.", "shipmentRule": "แจ้งเตือนก่อนกำหนดส่ง 7 วัน วันครบกำหนด และหลังครบกำหนด 14 วัน; สถานะคำขออ้างอิง OA.", "acceptanceRule": "แจ้งเตือนวันที่ 30/40/60 หลังจัดเก็บใบรับมอบ; เงินประกันแจ้งก่อนครบกำหนด 7 วัน วันครบกำหนด และหลังครบกำหนด 14 วัน.", "pendingAlerts": "แจ้งเตือนที่รอดำเนินการ", "processing": "เริ่มชำระแล้ว", "dataPending": "รอข้อมูล", "paid": "ชำระแล้ว", "amountRatioDate": "จำนวนเงิน / สัดส่วน · วันที่", "applicant": "ผู้ขอ", "statusLabel": "สถานะ", "contractPrefix": "สัญญา", "datePending": "รอระบุวันทีLine truncated
|
||||
"title": "แจ้งเตือนการชำระเงินตามสัญญา", "subtitle": "ซิงก์สัญญา OA การรับมอบ และคำขอเบิกเงินล่วงหน้าของผู้ขาย พร้อมแจ้งเตือน 3 ระดับ", "sessionHint": "ระยะนี้ยังไม่ใช้แชทและประวัติการสนทนา เปิดบัญชีจากแท็บด้านบน", "sync": "ซิงก์ข้อมูล OA", "moreActions": "เพิ่มเติม", "forceSync": "เขียนทับฟิลด์ OA แบบบังคับ", "forceSyncConfirm": "ระบบจะเขียนทับข้อมูล OA เดิมด้วยฟิลด์ที่ไม่ว่างจาก OA ครั้งนี้และบันทึกการตรวจสอบ ต้องการดำเนินการต่อหรือไม่?", "reparseExisting": "แยกวิเคราะห์สัญญาเดิมทั้งหมดใหม่", "reparseExistingConfirm": "ระบบจะรีเฟรชผลการแยกข้อมูลของสัญญาเดิมทั้งหมดจากไฟล์แนบที่จัดเก็บตามกฎปัจจุบัน โดยจะไม่ซิงก์หรือเขียนทับฟิลด์ OA ต้องการดำเนินการต่อหรือไม่?", "scanAlerts": "สแกนเพื่อสร้างแจ้งเตือน", "jobSubmitted": "ส่งงานแล้ว", "actionFailed": "ดำเนินการไม่สำเร็จ", "loadFailed": "โหลดสัญญาไม่สำเร็จ", "searchPlaceholder": "ค้นหาเลขที่สัญญา ใบสั่งซื้อ ผู้ขาย หรือผู้ขอ", "allStatus": "ทั้งหมด", "search": "ค้นหา", "ledger": "ทะเบียนสัญญา", "items": "รายการ", "empty": "ไม่มีข้อมูลสัญญา", "purchaseOrder": "ใบสั่งซื้อ", "supplier": "ผู้ขาย", "amount": "มูลค่าสัญญา", "deliveryDate": "กำหนดส่งมอบ", "timeline": "ไทม์ไลน์แผนการชำระเงิน", "notAvailable": "—", "stats": {"contracts": "สัญญา", "pendingParse": "สัญญาที่รอดำเนินการ", "readyPlans": "แผนพร้อมใช้", "alerts": "จุดแจ้งเตือน"}, "ledgerFocus": {"due": "ใกล้ครบกำหนด", "dueHint": "ใน 7 วัน", "overdue": "ค้างชำระเกินกำหนด", "active": "ยังไม่ถึงกำหนด", "activeHint": "เกิน 7 วัน", "dueThisMonth": "ถึงกำหนดเดือนนี้", "dueThisMonthHint": "เดือนปฏิทินนี้"}, "status": {"completed": "เสร็จสิ้น", "needs_review": "ต้องตรวจสอบ", "pending": "รอแยกข้อมูล"}, "stateLabel": {"parsed": "แยกข้อมูลแล้ว", "needs_review": "ต้องตรวจสอบ", "pending": "รอแยกข้อมูล", "active": "ใช้งานอยู่"}, "nodeType": {"prepayment": "เงินล่วงหน้า", "shipment": "เงินก่อนส่ง", "acceptance": "เงินรับมอบ", "warranty": "เงินประกัน"}, "ruleConfirmed": "ยืนยันแล้ว", "prepaymentRule": "แจ้งเตือนวันที่ 7/14/21 หลังจัดเก็บสัญญา; สถานะคำขออ้างอิง OA.", "shipmentRule": "แจ้งเตือนก่อนกำหนดส่ง 7 วัน วันครบกำหนด และหลังครบกำหนด 14 วัน; สถานะคำขออ้างอิง OA.", "acceptanceRule": "แจ้งเตือนวันที่ 30/40/60 หลังจัดเก็บใบรับมอบ; เงินประกันแจ้งก่อนครบกำหนด 7 วัน วันครบกำหนด และหลังครบกำหนด 14 วัน.", "pendingAlerts": "แจ้งเตือนที่รอดำเนินการ", "processing": "เริ่มชำระแล้ว", "dataPending": "รอข้อมูล", "paid": "ชำระแล้ว", "stagePaid": "ชำระแล้ว", "amountRatioDate": "จำนวนเงิน / สัดส่วน · วันที่", "applicant": "ผู้ขอ", "statusLabel": "สถานะ", "contractPrefix": "สัญญา", "datePendLine truncated
|
||||
},
|
||||
"contractPaymentReview": {"title": "สัญญาที่รอยืนยัน", "subtitle": "สัญญาที่ไม่ตรงกับกลุ่มหัวข้อคำพ้องของสัญญาจัดซื้ออุปกรณ์ ตรวจสอบสัดส่วนการชำระเงินไม่ผ่าน หรือขัดแย้งกับฟิลด์ OA จะไม่เข้าสู่การแจ้งเตือนการชำระเงิน โปรดดาวน์โหลดต้นฉบับเพื่อตรวจสอบ", "searchPlaceholder": "เลขที่สัญญา ใบสั่งซื้อ ผู้ขาย หรือผู้ขอ", "loadFailed": "โหลดสัญญาที่รอยืนยันไม่สำเร็จ", "contractWorkflow": "เลขที่สัญญา / เวิร์กโฟลว์", "reason": "เหตุผลที่ต้องยืนยัน", "fallbackIssue": "ผลการแยกข้อมูลต้องยืนยันโดยผู้ใช้", "empty": "ไม่มีสัญญาที่รอยืนยัน"},
|
||||
"contractPaymentReview": {"title": "สัญญาที่รอยืนยัน", "subtitle": "สัญญาที่ไม่ตรงกับกลุ่มหัวข้อคำพ้องของสัญญาจัดซื้ออุปกรณ์ ตรวจสอบสัดส่วนการชำระเงินไม่ผ่าน หรือขัดแย้งกับฟิลด์ OA จะไม่เข้าสู่การแจ้งเตือนการชำระเงิน โปรดดาวน์โหลดต้นฉบับเพื่อตรวจสอบ", "searchPlaceholder": "เลขที่สัญญา ใบสั่งซื้อ ผู้ขาย หรือผู้ขอ", "loadFailed": "โหลดสัญญาที่รอยืนยันไม่สำเร็จ", "contractWorkflow": "เลขที่สัญญา / เวิร์กโฟลว์", "reason": "เหตุผลที่ต้องยืนยัน", "fallbackIssue": "ผลการแยกข้อมูลต้องยืนยันโดยผู้ใช้", "empty": "ไม่มีสัญญาที่รอยืนยัน", "manualTitle": "ตรวจสอบงวดชำระ", "manualSubtitle": "{supplier} · ใบสั่งซื้อ {purchaseOrder} งวดที่ระบบอ่านได้ถูกเติมไว้แล้วและแก้ไขได้", "backToReview": "กลับไปรายการรอยืนยัน", "confirmLedger": "บันทึกเข้าบัญชีสัญญา", "confirmSuccess": "เข้าบัญชีสัญญาแล้ว", "issueTitle": "หมายเหตุจากการอ่านสัญญา", "contractNoOptional": "เลขที่สัญญา (ไม่บังคับ)", "contractNoPlaceholder": "ไม่พบเลขที่สัญญาในไฟล์แนบ", "percentage": "สัดส่วน %", "stageAmount": "จำนวนเงิน", "basisDate": "วันที่อ้างอิง", "noStage": "ไม่มีงวดนี้", "ruleIdentity": "เลขที่ใบสั่งซื้อและยอดสัญญาถูกต้อง", "rulePercent": "สัดส่วนของงวดที่เปิดใช้รวมกันต้องเป็น 100% ช่องว่างไม่นับเป็น 0", "ruleAmount": "จำนวนเงินของแต่ละงวดเท่ากับยอดสัญญาคูณสัดส่วน", "ruleDate": "เงินมัดจำและเงินค่าสินค้าต้องระบุวันที่อ้างอิง", "hintPrepayment": "วันที่อ้างอิงคือวันจัดเก็บสัญญา หากสัญญาระบุสัดส่วนเงินมัดจำ ให้กรอกที่นี่", "hintShipment": "วันที่อ้างอิงคือกำหนดส่งมอบ หากสัญญาเขียนเพียง “หลังรับเงินมัดจำ N วัน” ให้กรอกวันที่จริง", "hintAcceptance": "วันที่อ้างอิงคือวันจัดเก็บใบตรวจรับ ถ้ายังไม่จัดเก็บให้เว้นว่าง", "hintWarranty": "หากไม่มีสัดส่วนเงินประกันผลงาน ให้เลือกไม่มีงวดนี้ ระยะประกันไม่ใช่สัดส่วนการชำระ", "formLoadFailed": "เปิดแบบฟอร์มตรวจสอบไม่สำเร็จ", "submitFailed": "ส่งผลการตรวจสอบไม่สำเร็จ", "manualAction": "ตรวจสอบด้วยตนเอง", "fillHintTitle": "วิธีกรอก"},
|
||||
"contractPaymentReparse": {"action": "แยกข้อมูลจากต้นฉบับอีกครั้ง", "success": "แยกข้อมูลใหม่ด้วยไฟล์แนบ “{attachment}” แล้ว", "failed": "แยกข้อมูลสัญญาใหม่ไม่สำเร็จ"},
|
||||
"contractPaymentReview": {"title": "สัญญาที่รอยืนยัน", "subtitle": "สัญญาที่ไม่ตรงกับกลุ่มหัวข้อคำพ้องของสัญญาจัดซื้ออุปกรณ์ ตรวจสอบสัดส่วนการชำระเงินไม่ผ่าน หรือขัดแย้งกับฟิลด์ OA จะไม่เข้าสู่การแจ้งเตือนการชำระเงิน โปรดดาวน์โหลดต้นฉบับเพื่อตรวจสอบ", "searchPlaceholder": "เลขที่สัญญา ใบสั่งซื้อ ผู้ขาย หรือผู้ขอ", "loadFailed": "โหลดสัญญาที่รอยืนยันไม่สำเร็จ", "contractWorkflow": "เลขที่สัญญา / เวิร์กโฟลว์", "reason": "เหตุผลที่ต้องยืนยัน", "fallbackIssue": "ผลการแยกข้อมูลต้องยืนยันโดยผู้ใช้", "empty": "ไม่มีสัญญาที่รอยืนยัน"},
|
||||
"contractPaymentReview": {"title": "สัญญาที่รอยืนยัน", "subtitle": "สัญญาที่ไม่ตรงกับกลุ่มหัวข้อคำพ้องของสัญญาจัดซื้ออุปกรณ์ ตรวจสอบสัดส่วนการชำระเงินไม่ผ่าน หรือขัดแย้งกับฟิลด์ OA จะไม่เข้าสู่การแจ้งเตือนการชำระเงิน โปรดดาวน์โหลดต้นฉบับเพื่อตรวจสอบ", "searchPlaceholder": "เลขที่สัญญา ใบสั่งซื้อ ผู้ขาย หรือผู้ขอ", "loadFailed": "โหลดสัญญาที่รอยืนยันไม่สำเร็จ", "contractWorkflow": "เลขที่สัญญา / เวิร์กโฟลว์", "reason": "เหตุผลที่ต้องยืนยัน", "fallbackIssue": "ผลการแยกข้อมูลต้องยืนยันโดยผู้ใช้", "empty": "ไม่มีสัญญาที่รอยืนยัน", "manualTitle": "ตรวจสอบงวดชำระ", "manualSubtitle": "{supplier} · ใบสั่งซื้อ {purchaseOrder} งวดที่ระบบอ่านได้ถูกเติมไว้แล้วและแก้ไขได้", "backToReview": "กลับไปรายการรอยืนยัน", "confirmLedger": "บันทึกเข้าบัญชีสัญญา", "confirmSuccess": "เข้าบัญชีสัญญาแล้ว", "issueTitle": "หมายเหตุจากการอ่านสัญญา", "contractNoOptional": "เลขที่สัญญา (ไม่บังคับ)", "contractNoPlaceholder": "ไม่พบเลขที่สัญญาในไฟล์แนบ", "percentage": "สัดส่วน %", "stageAmount": "จำนวนเงิน", "basisDate": "วันที่อ้างอิง", "noStage": "ไม่มีงวดนี้", "ruleIdentity": "เลขที่ใบสั่งซื้อและยอดสัญญาถูกต้อง", "rulePercent": "สัดส่วนของงวดที่เปิดใช้รวมกันต้องเป็น 100% ช่องว่างไม่นับเป็น 0", "ruleAmount": "จำนวนเงินของแต่ละงวดเท่ากับยอดสัญญาคูณสัดส่วน", "ruleDate": "เงินมัดจำและเงินค่าสินค้าต้องระบุวันที่อ้างอิง", "hintPrepayment": "วันที่อ้างอิงคือวันจัดเก็บสัญญา หากสัญญาระบุสัดส่วนเงินมัดจำ ให้กรอกที่นี่", "hintShipment": "วันที่อ้างอิงคือกำหนดส่งมอบ หากสัญญาเขียนเพียง “หลังรับเงินมัดจำ N วัน” ให้กรอกวันที่จริง", "hintAcceptance": "วันที่อ้างอิงคือวันจัดเก็บใบตรวจรับ ถ้ายังไม่จัดเก็บให้เว้นว่าง", "hintWarranty": "หากไม่มีสัดส่วนเงินประกันผลงาน ให้เลือกไม่มีงวดนี้ ระยะประกันไม่ใช่สัดส่วนการชำระ", "formLoadFailed": "เปิดแบบฟอร์มตรวจสอบไม่สำเร็จ", "submitFailed": "ส่งผลการตรวจสอบไม่สำเร็จ", "manualAction": "ตรวจสอบด้วยตนเอง", "fillHintTitle": "วิธีกรอก"},
|
||||
"procurementContract": {
|
||||
"title": "ตรวจสอบสัญญาจัดซื้อ",
|
||||
"subtitle": "จัดการเทมเพลต กฎเส้นแดงความเสี่ยง และประวัติการตรวจสอบ",
|
||||
|
||||
@@ -4829,10 +4829,10 @@
|
||||
"prepaymentRule": "合同归档后第 7/14/21 天预警;请款以 OA 厂商预付款请款作业为准。",
|
||||
"shipmentRule": "交货期限前 7 天、到期日、到期后 14 天预警;请款以 OA 厂商预付款请款作业为准。",
|
||||
"acceptanceRule": "验收归档后第 30/40/60 天预警;质保款在质保到期前 7 天、到期日、到期后 14 天预警。",
|
||||
"pendingAlerts": "待处理预警", "processing": "已发起付款", "dataPending": "数据待确认", "paid": "已付款", "amountRatioDate": "金额 / 比例 · 日期", "applicant": "申请人", "statusLabel": "状态", "contractPrefix": "合同", "datePending": "待补充日期", "statusNormal": "正常", "statusNeedsCompletion": "待补充", "statusOverdue": "已逾期", "statusUpcoming": "即将到期", "statusActive": "未到期", "statusCompleted": "已完成",
|
||||
"totalPrefix": "共", "contractSupplier": "合同号 / 供应商", "nextAlert": "下一预警", "triggerBasis": "触发依据", "alertDate": "预警日期", "alertFirstRound": "首轮", "payDate": "付款日期", "processStatus": "处理状态", "owner": "采购负责人", "oaData": "OA 数据", "contractRule": "合同规则", "ownerDefault": "采购负责人", "workflowNo": "流程编号", "contractNoPending": "合同号待从附件解析", "synced": "已同步", "detailSubtitle": "OA 数据、付款节点与企业微信提醒记录", "backToOverview": "返回总览", "contractInfo": "OA 合同信息", "alertHistory": "预警记录", "alertRound": "第 {round} 次预警", "alertAudit": "预警发送记录", "alertAuditEmpty": "暂无预警记录", "alertNode": "付款节点", "alertScheduledAt": "计划日期", "alertSentAt": "发送时间", "alertStatus": {"pending": "待发送", "sent": "已发送", "failed": "发送失败"}, "roundValue": "第 {round} 次", "weeklyBatchesTitle": "周汇总批次", "weeklyBatchesSubtitle": "查看按收件人生成的付款预警周汇总、Excel 附件及发送记录。", "weeklySend": "发送预警", "weeklyBatchSubmitted": "发送预警任务已提交", "weeklyJobSent": "已发送 {sent} 个批次", "weeklyJobFailed": "{failed} 个批次发送失败,列表已更新,可点击失败图标查看原因", "weeklyJobPartial": "已发送 {sent} 个批次,另有 {failed} 个失败", "weeklyJobEmpty": "没有待发送的预警,批次记录不会变化", "weeklyJobTimeout": "发送任务仍在后台执行,请稍后重新打开本页查看", "weeklyJobError": "发送任务执行失败", "weeklyBatchesLoadFailed": "加载周汇总批次失败", "batchNo": "批次号", "weekKey": "周次", "batchStatusLabel": "发送状态", "batchFailureReason": "失败原因", "batchFailureReasonEmpty": "未记录具体失败原因", "batchFailureReasonAria": "查看发送失败原因", "batchFailureReasonLine": "{reason}:{detail}", "batchFailureReasonCode": {"notify_disabled": "企业微信通知未启用", "event_disabled": "合同付款预警通知事件未启用", "user_unbound": "收件人未绑定企业微信账号", "textcard_failed": "企业微信卡片发送失败", "file_upload_failed": "企业微信附件上传失败", "file_failed": "企业微信附件发送失败", "unknown": "发送失败"}, "batchTotal": "汇总笔数", "batchExcel": "Excel 附件", "batchSentAt": "发送时间", "weeklyBatchesEmpty": "暂无周汇总批次", "weeklyPendingSummary": "本周待发送 {count} 笔 · 下次发送 {datetime}", "weeklyPendingCountOnly": "本周待发送 {count} 笔", "downloadExcel": "下载 Excel", "excelDownloadFailed": "下载预警附件失败", "batchStatus": {"pending": "待发送", "sent": "已发送", "failed": "发送失败", "processing": "处理中", "resolved": "已停止提醒"}, "backToLedger": "返回", "detailLoadFailed": "加载合同详情失败", "detailLoading": "正在加载合同详情…", "detailOverview": "合同概览", "detailAttachments": "原文附件", "detailPaymentPlan": "付款计划", "detailAlertHistory": "预警记录", "archiveDate": "合同归档日期", "archiveDateHint": "该日期为合同申请单的归档日期", "parseStatus": "解析状态", "parseIssueTitle": "解析提示", "planStatus": "计划状态", "attachmentsEmpty": "暂无已归档的合同原文附件", "downloadAttachment": "下载附件", "attachmentDownloadFailed": "下载合同附件失败", "paymentPlanEmpty": "暂无可展示的付款计划", "anchorDate": "日期依据", "nodeStatus": {"pending": "待处理", "active": "进行中", "paid": "已付", "processing": "处理中", "resolved": "已停止提醒", "upcoming": "即将到期", "notStarted": "待起算", "overdue": "已逾期", "review": "待复核"}, "reparse": "重新解析合同原文", "reparseSuccess": "已使用附件“{attachment}”重新解析", "reparseFailed": "重新解析合同失败", "reviewTitle": "待确认合同", "reviewSubtitle": "未匹配设备采购合同同义标题组、付款比例校验失败或关键字段冲突的合同不会进入付款预警,请下载原文核对。", "reviewSearchPlaceholder": "合同编号、采购编号或供应商", "reviewLoadFailed": "待确认合同加载失败", "reviewContractWorkflow": "合同号 / 流程编号", "reviewReason": "待确认原因", "reviewFallbackIssue": "解析结果待人工确认", "reviewEmpty": "暂无待确认合同"
|
||||
"pendingAlerts": "待处理预警", "processing": "已发起付款", "dataPending": "数据待确认", "paid": "已付款", "stagePaid": "已付", "amountRatioDate": "金额 / 比例 · 日期", "applicant": "申请人", "statusLabel": "状态", "contractPrefix": "合同", "datePending": "待补充日期", "statusNormal": "正常", "statusNeedsCompletion": "待补充", "statusOverdue": "已逾期", "statusUpcoming": "即将到期", "statusActive": "未到期", "statusCompleted": "已完成",
|
||||
"totalPrefix": "共", "contractSupplier": "合同号 / 供应商", "nextAlert": "下一预警", "triggerBasis": "触发依据", "alertDate": "预警日期", "alertRuleHint": "每阶段按自然日提醒三轮,到日后并入最近的周五 18:00 汇总发送。没有对应日期则不提醒。\n预付款:合同归档日后第 7、14、21 天(页面显示首轮)\n出货款:交货期限前 7 天、当天、后 14 天\n验收款:验收单归档后第 30、40、60 天\n质保款:质保到期前 7 天、当天、后 14 天", "alertFirstRound": "首轮", "payDate": "付款日期", "processStatus": "处理状态", "owner": "采购负责人", "oaData": "OA 数据", "contractRule": "合同规则", "ownerDefault": "采购负责人", "workflowNo": "流程编号", "contractNoPending": "合同号待从附件解析", "synced": "已同步", "detailSubtitle": "OA 数据、付款节点与企业微信提醒记录", "backToOverview": "返回总览", "contractInfo": "OA 合同信息", "alertHistory": "预警记录", "alertRound": "第 {round} 次预警", "alertAudit": "预警发送记录", "alertAuditEmpty": "暂无预警记录", "alertNode": "付款节点", "alertScheduledAt": "计划日期", "alertSentAt": "发送时间", "alertStatus": {"pending": "待发送", "sent": "已发送", "failed": "发送失败"}, "roundValue": "第 {round} 次", "weeklyBatchesTitle": "周汇总批次", "weeklyBatchesSubtitle": "查看按收件人生成的付款预警周汇总、Excel 附件及发送记录。", "weeklySend": "发送预警", "weeklyBatchSubmitted": "发送预警任务已提交", "weeklyJobSent": "已发送 {sent} 个批次", "weeklyJobFailed": "{failed} 个批次发送失败,列表已更新,可点击失败图标查看原因", "weeklyJobPartial": "已发送 {sent} 个批次,另有 {failed} 个失败", "weeklyJobEmpty": "没有待发送的预警,批次记录不会变化", "weeklyJobTimeout": "发送任务仍在后台执行,请稍后重新打开本页查看", "weeklyJobError": "发送任务执行失败", "weeklyBatchesLoadFailed": "加载周汇总批次失败", "batchNo": "批次号", "weekKey": "周次", "batchStatusLabel": "发送状态", "batchFailureReason": "失败原因", "batchFailureReasonEmpty": "未记录具体失败原因", "batchFailureReasonAria": "查看发送失败原因", "batchFailureReasonLine": "{reason}:{detail}", "batchFailureReasonCode": {"notify_disabled": "企业微信通知未启用", "event_disabled": "合同付款预警通知事件未启用", "user_unbound": "收件人未绑定企业微信账号", "textcard_failed": "企业微信卡片发送失败", "file_upload_failed": "企业微信附件上传失败", "file_failed": "企业微信附件发送失败", "unknown": "发送失败"}, "batchTotal": "汇总笔数", "batchExcel": "Excel 附件", "batchSentAt": "发送时间", "weeklyBatchesEmpty": "暂无周汇总批次", "weeklyPendingSummary": "本周待发送 {count} 笔 · 下次发送 {datetime}", "weeklyPendingCountOnly": "本周待发送 {count} 笔", "downloadExcel": "下载 Excel", "excelDownloadFailed": "下载预警附件失败", "batchStatus": {"pending": "待发送", "sent": "已发送", "failed": "发送失败", "processing": "处理中", "resolved": "已停止提醒"}, "backToLedger": "返回", "detailLoadFailed": "加载合同详情失败", "detailLoading": "正在加载合同详情…", "detailOverview": "合同概览", "detailAttachments": "原文附件", "detailPaymentPlan": "付款计划", "detailAlertHistory": "预警记录", "archiveDate": "合同归档日期", "archiveDateHint": "该日期为合同申请单的归档日期", "parseStatus": "解析状态", "parseIssueTitle": "解析提示", "planStatus": "计划状态", "attachmentsEmpty": "暂无已归档的合同原文附件", "downloadAttachment": "下载附件", "previewAttachment": "预览", "attachmentPreviewFailed": "附件预览失败", "attachmentPreviewUnsupported": "该格式暂不支持在线预览,请下载后查看", "attachmentDownloadFailed": "下载合同附件失败", "paymentPlanEmpty": "暂无可展示的付款计划", "anchorDate": "日期依据", "nodeStatus": {"pending": "待处理", "active": "进行中", "paid": "已付", "processing": "处理中", "resolved": "已停止提醒", "upcoming": "即将到期", "notStarted": "待起算", "overdue": "已逾期", "review": "待复核", "notApplicable": "无此阶段"}, "reparse": "重新解析合同原文", "reparseSuccess": "已使用附件“{attachment}”重新解析", "reparseFailed": "重新解析合同失败", "reviewTitle": "待确认合同", "reviewSubtitle": "未匹配设备采购合同同义标题组、付款比例校验失败或关键字段冲突的合同不会进入付款预警,请下载原文核对。", "reviewSearchPlaceholder": "合同编号、采购编号或供应商", "reviewLoadFailed": "待确认合同加载失败", "reviewContractWorkflow": "合同号 / 流程编号", "reviewReason": "待确认原因", "reviewFallbackIssuLine truncated
|
||||
},
|
||||
"contractPaymentReview": {"title": "待确认合同", "subtitle": "未匹配设备采购合同同义标题组、付款比例校验失败或关键字段冲突的合同不会进入付款预警,请下载原文核对。", "searchPlaceholder": "合同编号、采购编号、供应商或申请人", "loadFailed": "待确认合同加载失败", "contractWorkflow": "合同号 / 流程编号", "reason": "待确认原因", "fallbackIssue": "解析结果待人工确认", "empty": "暂无待确认合同"},
|
||||
"contractPaymentReview": {"title": "待确认合同", "subtitle": "未匹配设备采购合同同义标题组、付款比例校验失败或关键字段冲突的合同不会进入付款预警,请下载原文核对。", "searchPlaceholder": "合同编号、采购编号、供应商或申请人", "loadFailed": "待确认合同加载失败", "contractWorkflow": "合同号 / 流程编号", "reason": "待确认原因", "fallbackIssue": "解析结果待人工确认", "empty": "暂无待确认合同", "manualTitle": "复核付款阶段", "manualSubtitle": "{supplier} · 采购单号 {purchaseOrder}。已识别的阶段已填入,可改。", "backToReview": "返回待确认", "confirmLedger": "确认进入台账", "confirmSuccess": "已进入合同台账", "issueTitle": "解析提示", "contractNoOptional": "合同编号(可空)", "contractNoPlaceholder": "附件未识别出合同号", "percentage": "比例 %", "stageAmount": "金额", "basisDate": "日期依据", "noStage": "无此阶段", "ruleIdentity": "采购单号和合同金额有效", "rulePercent": "启用阶段的比例合计为 100%,空比例不算 0", "ruleAmount": "每个启用阶段的金额等于合同金额乘以比例", "ruleDate": "预付款、出货款须填写日期依据", "hintPrepayment": "日期依据是合同归档日。正文写了定金或预付款比例时填在这里。", "hintShipment": "日期依据是交货期限。正文只有“收到定金后 N 天”时,请填写具体日期。", "hintAcceptance": "日期依据是验收单归档日。还没归档可以留空。", "hintWarranty": "没有质保款比例时勾选无此阶段。质保期不是付款比例。", "formLoadFailed": "复核表单加载失败", "submitFailed": "复核提交失败", "manualAction": "人工复核", "fillHintTitle": "填写提示"},
|
||||
"contractPaymentReparse": {"action": "重新解析合同原文", "success": "已使用附件“{attachment}”重新解析", "failed": "重新解析合同失败"},
|
||||
"procurementContract": {
|
||||
"title": "采购合同审查",
|
||||
|
||||
@@ -4685,11 +4685,11 @@
|
||||
}
|
||||
},
|
||||
"contractPayment": {
|
||||
"title": "合約付款預警", "subtitle": "同步 OA 合約、驗收和廠商預付款請款作業,按三輪規則通知採購職位", "sessionHint": "本期不使用對話和歷史會話,請從上方 Tab 查看台帳。", "sync": "同步 OA 資料", "moreActions": "更多", "forceSync": "強制覆蓋 OA 欄位", "forceSyncConfirm": "將以本次 OA 回傳的非空欄位覆蓋既有 OA 資料,並記錄變更稽核。是否繼續?", "reparseExisting": "批量重新解析既有合約", "reparseExistingConfirm": "將使用已歸檔的合約附件依目前規則更新所有既有合約的解析結果,不會同步或覆蓋 OA 欄位。是否繼續?", "scanAlerts": "掃描產生預警", "jobSubmitted": "工作已提交", "actionFailed": "操作失敗", "loadFailed": "載入合約失敗", "searchPlaceholder": "搜尋合約編號、採購單號、供應商或申請人", "allStatus": "全部", "search": "查詢", "ledger": "合約台帳", "items": "筆", "empty": "暫無合約資料", "purchaseOrder": "採購單號", "supplier": "供應商", "amount": "合約金額", "deliveryDate": "交貨期限", "timeline": "付款計畫時間線", "notAvailable": "—", "stats": {"contracts": "合約總數", "pendingParse": "待處理合約", "readyPlans": "計畫已產生", "alerts": "待預警節點"}, "ledgerFocus": {"due": "即將到期", "dueHint": "7日內", "overdue": "逾期未付", "active": "未到期", "activeHint": "7日外", "dueThisMonth": "本月應付", "dueThisMonthHint": "本自然月"}, "status": {"completed": "已完成", "needs_review": "待覆核", "pending": "待解析"}, "stateLabel": {"parsed": "已解析", "needs_review": "待複核", "pending": "待解析", "active": "已生效"}, "nodeType": {"prepayment": "預付款", "shipment": "出貨款", "acceptance": "驗收款", "warranty": "質保款"}, "ruleConfirmed": "已確定", "prepaymentRule": "合約歸檔後第 7/14/21 天預警;請款以 OA 廠商預付款請款作業為準。", "shipmentRule": "交貨期限前 7 天、到期日、到期後 14 天預警;請款以 OA 廠商預付款請款作業為準。", "acceptanceRule": "驗收歸檔後第 30/40/60 天預警;質保款在質保到期前 7 天、到期日、到期後 14 天預警。", "pendingAlerts": "待處理預警", "processing": "已發起付款", "dataPending": "資料待確認", "paid": "已付款", "amountRatioDate": "金額 / 比例 · 日期", "applicant": "申請人", "statusLabel": "狀態", "contractPrefix": "合約", "datePending": "待補充日期", "statusNormal": "正常", "statusNeedsCompletion": "待補充", "statusOverdue": "已逾期", "statusUpcoming": "即將到期", "statusActive": "未到期", "statusCompleted": "已完成", "totalPrefix": "共", "contractSupplier": "合約號 / 供應商", "nextAlert": "下一預警", "triggerBasis": "觸發依據", "alertDate": "預警日期", "alertFirstRound": "首輪", "payDate": "付款日期", "processStatus": "處理狀態", "owner": "採購負責人", "oaData": "OA 資料", "contractRule": "合約規則", "ownerDefault": "採購負責人", "workflowNo": "流程編號", "contractNoPending": "合約號待從附件解析", "synced": "已同步", "detailSubtitle": "OA 資料、付款節點與企業微信提醒記錄", "backToOverview": "返回總覽", "contractInfo": "OA 合約資訊", "alertHistory": "預警記錄", "alertRound": "第 {round} 次預警", "alertAudit": "預警發送記錄", "alertAuditEmpty": "暫無預警記錄", "alertNode": "付款節點", "alertScheduledAt": "計畫日期", "alertSentAt": "發送時間", "alertStatus": {"pending": "待發送", "sent": "已發送", "failed": "發送失敗"}, "roundValue": "第 {round} 次", "weeklyBatchesTitle": "週彙總批次", "weeklyBatchesSubtitle": "查看依收件人產生的付款預警週彙總、Excel 附件與發送記錄。", "weeklySend": "傳送預警", "weeklyBatchSubmitted": "發送預警任務已提交", "weeklyJobSent": "已發送 {sent} 個批次", "weeklyJobFailed": "{failed} 個批次發送失敗,列表已更新,可點擊失敗圖示查看原因", "weeklyJobPartial": "已發送 {sent} 個批次,另有 {failed} 個失敗", "weeklyJobEmpty": "沒有待發送的預警,批次記錄不會變化", "weeklyJobTimeout": "發送任務仍在背景執行,請稍後重新開啟本頁查看", "weeklyJobError": "發送任務執行失敗", "weeklyBatchesLoadFailed": "載入週彙總批次失敗", "batchNo": "批次號", "weekKey": "週次", "batchStatusLabel": "發送狀態", "batchFailureReason": "失敗原因", "batchFailureReasonEmpty": "未記錄具體失敗原因", "batchFailureReasonAria": "查看發送失敗原因", "batchFailureReasonLine": "{reason}:{detail}", "batchFailureReasonCode": {"notify_disabled": "企業微信通知未啟用", "event_disabled": "合約付款預警通知事件未啟用", "user_unbound": "收件人未綁定企業微信帳號", "textcard_failed": "企業微信卡片發送失敗", "file_upload_failed": "企業微Line truncated
|
||||
"title": "合約付款預警", "subtitle": "同步 OA 合約、驗收和廠商預付款請款作業,按三輪規則通知採購職位", "sessionHint": "本期不使用對話和歷史會話,請從上方 Tab 查看台帳。", "sync": "同步 OA 資料", "moreActions": "更多", "forceSync": "強制覆蓋 OA 欄位", "forceSyncConfirm": "將以本次 OA 回傳的非空欄位覆蓋既有 OA 資料,並記錄變更稽核。是否繼續?", "reparseExisting": "批量重新解析既有合約", "reparseExistingConfirm": "將使用已歸檔的合約附件依目前規則更新所有既有合約的解析結果,不會同步或覆蓋 OA 欄位。是否繼續?", "scanAlerts": "掃描產生預警", "jobSubmitted": "工作已提交", "actionFailed": "操作失敗", "loadFailed": "載入合約失敗", "searchPlaceholder": "搜尋合約編號、採購單號、供應商或申請人", "allStatus": "全部", "search": "查詢", "ledger": "合約台帳", "items": "筆", "empty": "暫無合約資料", "purchaseOrder": "採購單號", "supplier": "供應商", "amount": "合約金額", "deliveryDate": "交貨期限", "timeline": "付款計畫時間線", "notAvailable": "—", "stats": {"contracts": "合約總數", "pendingParse": "待處理合約", "readyPlans": "計畫已產生", "alerts": "待預警節點"}, "ledgerFocus": {"due": "即將到期", "dueHint": "7日內", "overdue": "逾期未付", "active": "未到期", "activeHint": "7日外", "dueThisMonth": "本月應付", "dueThisMonthHint": "本自然月"}, "status": {"completed": "已完成", "needs_review": "待覆核", "pending": "待解析"}, "stateLabel": {"parsed": "已解析", "needs_review": "待複核", "pending": "待解析", "active": "已生效"}, "nodeType": {"prepayment": "預付款", "shipment": "出貨款", "acceptance": "驗收款", "warranty": "質保款"}, "ruleConfirmed": "已確定", "prepaymentRule": "合約歸檔後第 7/14/21 天預警;請款以 OA 廠商預付款請款作業為準。", "shipmentRule": "交貨期限前 7 天、到期日、到期後 14 天預警;請款以 OA 廠商預付款請款作業為準。", "acceptanceRule": "驗收歸檔後第 30/40/60 天預警;質保款在質保到期前 7 天、到期日、到期後 14 天預警。", "pendingAlerts": "待處理預警", "processing": "已發起付款", "dataPending": "資料待確認", "paid": "已付款", "stagePaid": "已付", "amountRatioDate": "金額 / 比例 · 日期", "applicant": "申請人", "statusLabel": "狀態", "contractPrefix": "合約", "datePending": "待補充日期", "statusNormal": "正常", "statusNeedsCompletion": "待補充", "statusOverdue": "已逾期", "statusUpcoming": "即將到期", "statusActive": "未到期", "statusCompleted": "已完成", "totalPrefix": "共", "contractSupplier": "合約號 / 供應商", "nextAlert": "下一預警", "triggerBasis": "觸發依據", "alertDate": "預警日期", "alertRuleHint": "每階段按自然日提醒三輪,到期後併入最近的週五 18:00 彙總發送。沒有對應日期則不提醒。\n預付款:合約歸檔日後第 7、14、21 天(頁面顯示首輪)\n出貨款:交貨期限前 7 天、當天、後 14 天\n驗收款:驗收單歸檔後第 30、40、60 天\n質保款:質保到期前 7 天、當天、後 14 天", "alertFirstRound": "首輪", "payDate": "付款日期", "processStatus": "處理狀態", "owner": "採購負責人", "oaData": "OA 資料", "contractRule": "合約規則", "ownerDefault": "採購負責人", "workflowNo": "流程編號", "contractNoPending": "合約號待從附件解析", "synced": "已同步", "detailSubtitle": "OA 資料、付款節點與企業微信提醒記錄", "backToOverview": "返回總覽", "contractInfo": "OA 合約資訊", "alertHistory": "預警記錄", "alertRound": "第 {round} 次預警", "alertAudit": "預警發送記錄", "alertAuditEmpty": "暫無預警記錄", "alertNode": "付款節點", "alertScheduledAt": "計畫日期", "alertSentAt": "發送時間", "alertStatus": {"pending": "待發送", "sent": "已發送", "failed": "發送失敗"}, "roundValue": "第 {round} 次", "weeklyBatchesTitle": "週彙總批次", "weeklyBatchesSubtitle": "查看依收件人產生的付款預警週彙總、Excel 附件與發送記錄。", "weeklySend": "傳送預警", "weeklyBatchSubmitted": "發送預警任務已提交", "weeklyJobSent": "已發送 {sent} 個批次", "weeklyJobFailed": "{failed} 個批次發送失敗,列表已更新,可點擊失敗圖示查看原因", "weeklyJobPartial": "已發送 {sent} 個批次,另有 {failed} 個失敗", "weeklyJobEmpty": "沒有待發送的預警,批次記錄不會變化", "weeklyJobTimeout": "發送任務仍在背景執行,請稍後重新開啟本頁查看", "weeklyJobError": "發送任務執行失敗", "weeklyBatchesLoadFailed": "載入週彙總批次失敗", "batchNo": "批次號", "weekKey": "週次", "batchStatusLabel": "發送狀態", "batchFailureReason": "失敗原因", "batchFailureReasonEmpty": "未記Line truncated
|
||||
},
|
||||
"contractPaymentReview": {"title": "待確認合約", "subtitle": "未符合設備採購合約同義標題組、付款比例驗證失敗或關鍵欄位衝突的合約,不會進入付款預警,請下載原文核對。", "searchPlaceholder": "合約編號、採購單號、供應商或申請人", "loadFailed": "待確認合約載入失敗", "contractWorkflow": "合約號 / 流程編號", "reason": "待確認原因", "fallbackIssue": "解析結果待人工確認", "empty": "暫無待確認合約"},
|
||||
"contractPaymentReview": {"title": "待確認合約", "subtitle": "未符合設備採購合約同義標題組、付款比例驗證失敗或關鍵欄位衝突的合約,不會進入付款預警,請下載原文核對。", "searchPlaceholder": "合約編號、採購單號、供應商或申請人", "loadFailed": "待確認合約載入失敗", "contractWorkflow": "合約號 / 流程編號", "reason": "待確認原因", "fallbackIssue": "解析結果待人工確認", "empty": "暫無待確認合約", "manualTitle": "複核付款階段", "manualSubtitle": "{supplier} · 採購單號 {purchaseOrder}。已識別的階段已填入,可改。", "backToReview": "返回待確認", "confirmLedger": "確認進入台帳", "confirmSuccess": "已進入合同台帳", "issueTitle": "解析提示", "contractNoOptional": "合同編號(可空)", "contractNoPlaceholder": "附件未識別出合同號", "percentage": "比例 %", "stageAmount": "金額", "basisDate": "日期依據", "noStage": "無此階段", "ruleIdentity": "採購單號和合同金額有效", "rulePercent": "啟用階段的比例合計為 100%,空白比例不算 0", "ruleAmount": "每個啟用階段的金額等於合同金額乘以比例", "ruleDate": "預付款、出貨款須填寫日期依據", "hintPrepayment": "日期依據是合同歸檔日。正文寫了定金或預付款比例時填在這裡。", "hintShipment": "日期依據是交貨期限。正文只有「收到定金後 N 天」時,請填寫具體日期。", "hintAcceptance": "日期依據是驗收單歸檔日。尚未歸檔可以留空。", "hintWarranty": "沒有質保款比例時勾選無此階段。質保期不是付款比例。", "formLoadFailed": "複核表單載入失敗", "submitFailed": "複核提交失敗", "manualAction": "人工複核", "fillHintTitle": "填寫提示"},
|
||||
"contractPaymentReparse": {"action": "重新解析合約原文", "success": "已使用附件“{attachment}”重新解析", "failed": "重新解析合約失敗"},
|
||||
"contractPaymentReview": {"title": "待確認合約", "subtitle": "未符合設備採購合約同義標題組、付款比例驗證失敗或關鍵欄位衝突的合約,不會進入付款預警,請下載原文核對。", "searchPlaceholder": "合約編號、採購單號、供應商或申請人", "loadFailed": "待確認合約載入失敗", "contractWorkflow": "合約號 / 流程編號", "reason": "待確認原因", "fallbackIssue": "解析結果待人工確認", "empty": "暫無待確認合約"},
|
||||
"contractPaymentReview": {"title": "待確認合約", "subtitle": "未符合設備採購合約同義標題組、付款比例驗證失敗或關鍵欄位衝突的合約,不會進入付款預警,請下載原文核對。", "searchPlaceholder": "合約編號、採購單號、供應商或申請人", "loadFailed": "待確認合約載入失敗", "contractWorkflow": "合約號 / 流程編號", "reason": "待確認原因", "fallbackIssue": "解析結果待人工確認", "empty": "暫無待確認合約", "manualTitle": "複核付款階段", "manualSubtitle": "{supplier} · 採購單號 {purchaseOrder}。已識別的階段已填入,可改。", "backToReview": "返回待確認", "confirmLedger": "確認進入台帳", "confirmSuccess": "已進入合同台帳", "issueTitle": "解析提示", "contractNoOptional": "合同編號(可空)", "contractNoPlaceholder": "附件未識別出合同號", "percentage": "比例 %", "stageAmount": "金額", "basisDate": "日期依據", "noStage": "無此階段", "ruleIdentity": "採購單號和合同金額有效", "rulePercent": "啟用階段的比例合計為 100%,空白比例不算 0", "ruleAmount": "每個啟用階段的金額等於合同金額乘以比例", "ruleDate": "預付款、出貨款須填寫日期依據", "hintPrepayment": "日期依據是合同歸檔日。正文寫了定金或預付款比例時填在這裡。", "hintShipment": "日期依據是交貨期限。正文只有「收到定金後 N 天」時,請填寫具體日期。", "hintAcceptance": "日期依據是驗收單歸檔日。尚未歸檔可以留空。", "hintWarranty": "沒有質保款比例時勾選無此階段。質保期不是付款比例。", "formLoadFailed": "複核表單載入失敗", "submitFailed": "複核提交失敗", "manualAction": "人工複核", "fillHintTitle": "填寫提示"},
|
||||
"procurementContract": {
|
||||
"title": "採購合同審查",
|
||||
"subtitle": "維護標準合同模板、風險紅線規則並查看審查歷史",
|
||||
|
||||
Reference in new issue
Block a user