提交
This commit is contained in:
1 parent
7c838cfb2d
commit
8e70047f4c
161 files changed
+16659
-10436
No files matched your search
+1
-1
@@ -1 +1 @@
|
||||
12399
|
||||
8708
|
||||
@@ -1407,3 +1407,22 @@ def attachment_download_url(
|
||||
return success_response({"downloadUrl": url})
|
||||
except Exception as e:
|
||||
return error_response(500, f"获取下载链接失败: {str(e)}")
|
||||
|
||||
|
||||
@router.post("/attachment/preview-url")
|
||||
def attachment_preview_url(
|
||||
body: AttachmentDownloadUrlBody,
|
||||
user: dict = Depends(require_admin_or_super_admin),
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
"""返回用于浏览器内联预览的 URL(PDF iframe 等)。"""
|
||||
file_url = (body.file_url or "").strip()
|
||||
if not file_url:
|
||||
return error_response(400, "文件地址不能为空")
|
||||
tenant_no = _get_tenant_no(db, user)
|
||||
oss_svc.get_oss_by_url(db, tenant_no, file_url)
|
||||
try:
|
||||
url = storage.presigned_preview_url(file_url)
|
||||
return success_response({"previewUrl": url})
|
||||
except Exception as e:
|
||||
return error_response(500, f"获取预览链接失败: {str(e)}")
|
||||
+3
-12
@@ -784,20 +784,17 @@ def product_import(
|
||||
for idx, row in enumerate(rows, start=2):
|
||||
row_errors: List[str] = []
|
||||
try:
|
||||
# 列: 产品编号、产品名称、分类名称、规格型号、单位、标准单价、成本价、状态、备注
|
||||
# 列: 产品编号、产品名称、分类名称、规格型号、状态、备注
|
||||
product_no = str(row[0]).strip() if row[0] else None
|
||||
product_name = str(row[1]).strip() if row[1] else ""
|
||||
category_name = str(row[2]).strip() if row[2] else None
|
||||
model = str(row[3]).strip() if row[3] else None
|
||||
unit = str(row[4]).strip() if row[4] else "件"
|
||||
price = row[5] if row[5] is not None else 0
|
||||
cost_price = row[6] if row[6] is not None else None
|
||||
status = str(row[7]).strip() if row[7] else "on"
|
||||
status = str(row[4]).strip() if row[4] else "on"
|
||||
if status == "1":
|
||||
status = "on"
|
||||
elif status == "0":
|
||||
status = "off"
|
||||
remark = str(row[8]).strip() if row[8] else None
|
||||
remark = str(row[5]).strip() if row[5] else None
|
||||
|
||||
# 必填校验
|
||||
if not product_name:
|
||||
@@ -828,9 +825,6 @@ def product_import(
|
||||
category_id=category_id,
|
||||
category_name=category_name,
|
||||
model=model,
|
||||
unit=unit,
|
||||
price=price,
|
||||
cost_price=cost_price,
|
||||
status=status,
|
||||
remark=remark,
|
||||
)
|
||||
@@ -901,9 +895,6 @@ def product_import_template(
|
||||
"产品名称",
|
||||
"分类名称",
|
||||
"规格型号",
|
||||
"单位",
|
||||
"标准单价",
|
||||
"成本价",
|
||||
"状态(on上架/off下架)",
|
||||
"备注",
|
||||
]
|
||||
|
||||
@@ -83,6 +83,10 @@ class BaseStorage:
|
||||
"""带下载文件名的访问 URL;默认实现为普通访问地址。"""
|
||||
return self.get_url(file_path)
|
||||
|
||||
def presigned_preview_url(self, file_path: str, expires_seconds: int = 3600) -> str:
|
||||
"""浏览器内联预览 URL;默认实现为普通访问地址。"""
|
||||
return self.get_url(file_path)
|
||||
|
||||
|
||||
class LocalStorage(BaseStorage):
|
||||
"""本地存储"""
|
||||
@@ -357,6 +361,21 @@ class MinIOStorage(BaseStorage):
|
||||
response_headers={"response-content-disposition": disposition},
|
||||
)
|
||||
|
||||
def presigned_preview_url(self, file_path: str, expires_seconds: int = 3600) -> str:
|
||||
"""MinIO 预签名内联预览 URL(PDF 等 iframe 场景)。"""
|
||||
key = self._extract_object_key(file_path)
|
||||
if not key:
|
||||
raise ValueError("无效的文件路径")
|
||||
response_headers: dict[str, str] = {"response-content-disposition": "inline"}
|
||||
if key.lower().endswith(".pdf"):
|
||||
response_headers["response-content-type"] = "application/pdf"
|
||||
return self.client.presigned_get_object(
|
||||
bucket_name=self.bucket_name,
|
||||
object_name=key,
|
||||
expires=timedelta(seconds=expires_seconds),
|
||||
response_headers=response_headers,
|
||||
)
|
||||
|
||||
|
||||
def get_storage() -> BaseStorage:
|
||||
"""获取存储实例"""
|
||||
|
||||
@@ -284,6 +284,7 @@ def category_code_exists(
|
||||
|
||||
def _product_row_to_dict(row: CrmProduct) -> Dict[str, Any]:
|
||||
"""产品 ORM 对象转 dict(camelCase 键名)"""
|
||||
unit = (row.unit or "").strip()
|
||||
return {
|
||||
"id": row.id,
|
||||
"productNo": row.product_no,
|
||||
@@ -291,11 +292,11 @@ def _product_row_to_dict(row: CrmProduct) -> Dict[str, Any]:
|
||||
"categoryId": row.category_id or "",
|
||||
"categoryName": row.category_name or "",
|
||||
"model": row.model or "",
|
||||
"unit": row.unit,
|
||||
"unit": unit or None,
|
||||
"barcode": row.barcode or "",
|
||||
"price": float(row.price) if row.price else 0.0,
|
||||
"costPrice": float(row.cost_price) if row.cost_price else 0.0,
|
||||
"cost": float(row.cost_price) if row.cost_price else 0.0,
|
||||
"price": float(row.price) if row.price is not None else None,
|
||||
"costPrice": float(row.cost_price) if row.cost_price is not None else None,
|
||||
"cost": float(row.cost_price) if row.cost_price is not None else None,
|
||||
"stock": row.stock if row.stock is not None else 0,
|
||||
"lowStock": row.low_stock if row.low_stock is not None else 10,
|
||||
"taxRate": float(row.tax_rate) if row.tax_rate is not None else 13.0,
|
||||
@@ -472,10 +473,10 @@ def create_product(
|
||||
category_id=category_id,
|
||||
category_name=category_name or "",
|
||||
model=kwargs.get("model"),
|
||||
unit=kwargs.get("unit", "件"),
|
||||
unit=_normalize_text(kwargs.get("unit")) or None,
|
||||
barcode=barcode,
|
||||
price=kwargs.get("price", 0),
|
||||
cost_price=kwargs.get("cost_price"),
|
||||
price=kwargs.get("price") if "price" in kwargs else None,
|
||||
cost_price=kwargs.get("cost_price") if "cost_price" in kwargs else None,
|
||||
stock=kwargs.get("stock", 0),
|
||||
low_stock=kwargs.get("low_stock", 10),
|
||||
tax_rate=kwargs.get("tax_rate", Decimal("13.00")),
|
||||
@@ -635,7 +636,7 @@ def list_product_options(
|
||||
"label": r.product_name,
|
||||
"value": r.id,
|
||||
"productNo": r.product_no,
|
||||
"price": float(r.price) if r.price else 0.0,
|
||||
"price": float(r.price) if r.price is not None else None,
|
||||
}
|
||||
for r in rows
|
||||
]
|
||||
@@ -777,7 +778,7 @@ def resolve_product_id_for_quote_item(
|
||||
if not product_name:
|
||||
raise ValueError("产品名称不能为空")
|
||||
model = _normalize_text(_get_quote_item_field(product_data, "model"))
|
||||
unit = _normalize_text(_get_quote_item_field(product_data, "unit")) or "件"
|
||||
unit = _normalize_text(_get_quote_item_field(product_data, "unit"))
|
||||
category_id = (_get_quote_item_field(product_data, "category_id", "categoryId") or "").strip() or None
|
||||
|
||||
name_key = product_name.lower()
|
||||
@@ -819,8 +820,8 @@ def resolve_product_id_for_quote_item(
|
||||
category_id=category_id,
|
||||
category_name=category_name_val or "",
|
||||
model=model,
|
||||
unit=unit,
|
||||
price=Decimal("0"),
|
||||
unit=unit or None,
|
||||
price=None,
|
||||
status="on",
|
||||
tenant_no=tenant_no,
|
||||
create_by=user_id,
|
||||
|
||||
@@ -51,10 +51,10 @@ class CrmProduct(Base):
|
||||
category_id = Column(String(64), nullable=True, comment="分类ID")
|
||||
category_name = Column(String(100), nullable=True, comment="分类名称(冗余)")
|
||||
model = Column(String(100), nullable=True, comment="规格型号")
|
||||
unit = Column(String(20), nullable=False, default="件", comment="单位")
|
||||
unit = Column(String(20), nullable=True, default=None, comment="单位")
|
||||
barcode = Column(String(100), nullable=True, comment="条码")
|
||||
price = Column(DECIMAL(15, 2), nullable=False, default=0.00, comment="标准单价")
|
||||
cost_price = Column(DECIMAL(15, 2), nullable=True, default=0.00, comment="成本价")
|
||||
price = Column(DECIMAL(15, 2), nullable=True, default=None, comment="标准单价")
|
||||
cost_price = Column(DECIMAL(15, 2), nullable=True, default=None, comment="成本价")
|
||||
stock = Column(Integer, nullable=False, default=0, comment="库存数量")
|
||||
low_stock = Column(Integer, nullable=False, default=10, comment="库存预警值")
|
||||
tax_rate = Column(DECIMAL(5, 2), nullable=False, default=13.00, comment="税率(百分比)")
|
||||
|
||||
@@ -76,9 +76,9 @@ class ProductCreateBody(BaseModel):
|
||||
category_id: Optional[str] = Field(default=None, alias="categoryId", description="分类ID")
|
||||
category_name: Optional[str] = Field(default=None, alias="categoryName", description="分类名称")
|
||||
model: Optional[str] = Field(default=None, description="规格型号")
|
||||
unit: str = Field(default="件", description="单位")
|
||||
unit: Optional[str] = Field(default=None, description="单位(产品模块不维护,留空)")
|
||||
barcode: Optional[str] = Field(default=None, description="条码(不传则自动生成)")
|
||||
price: Decimal = Field(default=Decimal("0.00"), description="标准单价")
|
||||
price: Optional[Decimal] = Field(default=None, description="标准单价(产品模块不维护,留空)")
|
||||
cost_price: Optional[Decimal] = Field(
|
||||
default=None,
|
||||
validation_alias=AliasChoices("costPrice", "cost"),
|
||||
|
||||
@@ -41,6 +41,9 @@ class FreightSettlementUpdate(BaseModel):
|
||||
invoice_date: Optional[date] = Field(default=None, alias="invoiceDate")
|
||||
invoice_attachment_urls: Optional[str] = Field(default=None, alias="invoiceAttachmentUrls")
|
||||
remark: Optional[str] = None
|
||||
transport_ids: Optional[list[str]] = Field(
|
||||
default=None, alias="transportIds", description="关联运输ID全量列表,仅草稿可更新"
|
||||
)
|
||||
model_config = {"populate_by_name": True}
|
||||
|
||||
|
||||
@@ -93,6 +96,12 @@ class UnsettledPlanItem(BaseModel):
|
||||
transport_company: Optional[str] = Field(default=None, alias="transportCompany")
|
||||
freight_amount: Decimal = Field(default=Decimal("0"), alias="freightAmount")
|
||||
archive_time: Optional[datetime] = Field(default=None, alias="archiveTime")
|
||||
transport_id: str = Field(alias="transportId")
|
||||
transport_no: Optional[str] = Field(default=None, alias="transportNo")
|
||||
driver_name: Optional[str] = Field(default=None, alias="driverName")
|
||||
transport_medium: Optional[str] = Field(default=None, alias="transportMedium")
|
||||
start_point: Optional[str] = Field(default=None, alias="startPoint")
|
||||
end_point: Optional[str] = Field(default=None, alias="endPoint")
|
||||
model_config = {"populate_by_name": True}
|
||||
|
||||
|
||||
|
||||
@@ -30,8 +30,10 @@ from app.schemas.pl.freight import (
|
||||
|
||||
_FMT = "%Y-%m-%d %H:%M:%S"
|
||||
|
||||
_DRAFT_SETTLEMENT_STATUSES = ("pending", "rejected")
|
||||
|
||||
TAB_STATUS_MAP = {
|
||||
"bills": ("pending", "approving", "approved", "confirmed", "cancelled"),
|
||||
"bills": ("pending", "rejected", "approving", "approved", "confirmed", "cancelled"),
|
||||
"approval_pending": ("approving",),
|
||||
"approval_done": ("approved", "confirmed"),
|
||||
"disburse": ("approved",),
|
||||
@@ -200,6 +202,12 @@ def list_unsettled_plans(
|
||||
"transportCompany": transport.carrier_name,
|
||||
"freightAmount": plan.freight_amount or transport.freight_amount,
|
||||
"archiveTime": plan.update_time,
|
||||
"transportId": transport.id,
|
||||
"transportNo": transport.transport_no,
|
||||
"driverName": transport.driver_name,
|
||||
"transportMedium": transport.transport_medium,
|
||||
"startPoint": transport.start_point,
|
||||
"endPoint": transport.end_point,
|
||||
}
|
||||
)
|
||||
return total, items
|
||||
@@ -299,12 +307,143 @@ def create_settlement(
|
||||
return settlement
|
||||
|
||||
|
||||
def _recalc_settlement_total_freight_from_links(
|
||||
db: Session,
|
||||
settlement_id: str,
|
||||
*,
|
||||
user_id: str,
|
||||
now: Optional[datetime] = None,
|
||||
) -> None:
|
||||
# SessionLocal 关闭了 autoflush,须先 flush 再聚合查询,否则 SUM 仍读到旧明细金额
|
||||
db.flush()
|
||||
total = (
|
||||
db.query(func.coalesce(func.sum(PlFreightSettlementTransport.freight_amount), 0))
|
||||
.filter(
|
||||
PlFreightSettlementTransport.settlement_id == settlement_id,
|
||||
PlFreightSettlementTransport.del_flag == 0,
|
||||
)
|
||||
.scalar()
|
||||
)
|
||||
settlement = (
|
||||
db.query(PlFreightSettlement)
|
||||
.filter(
|
||||
PlFreightSettlement.id == settlement_id,
|
||||
PlFreightSettlement.del_flag == 0,
|
||||
)
|
||||
.first()
|
||||
)
|
||||
if not settlement:
|
||||
return
|
||||
ts = now or datetime.now()
|
||||
settlement.total_freight = Decimal(str(total or 0))
|
||||
settlement.update_by = user_id
|
||||
settlement.update_time = ts
|
||||
|
||||
|
||||
def sync_draft_settlement_freight_for_transport(
|
||||
db: Session,
|
||||
*,
|
||||
tenant_no: str,
|
||||
transport_id: str,
|
||||
freight_amount: Decimal,
|
||||
user_id: str,
|
||||
) -> None:
|
||||
"""运输单运费变更后,同步关联草稿结算单的明细快照与合计。"""
|
||||
tid = (transport_id or "").strip()
|
||||
if not tid:
|
||||
return
|
||||
|
||||
links = (
|
||||
db.query(PlFreightSettlementTransport)
|
||||
.join(
|
||||
PlFreightSettlement,
|
||||
PlFreightSettlement.id == PlFreightSettlementTransport.settlement_id,
|
||||
)
|
||||
.filter(
|
||||
PlFreightSettlementTransport.transport_id == tid,
|
||||
PlFreightSettlementTransport.tenant_no == tenant_no,
|
||||
PlFreightSettlementTransport.del_flag == 0,
|
||||
PlFreightSettlement.tenant_no == tenant_no,
|
||||
PlFreightSettlement.del_flag == 0,
|
||||
PlFreightSettlement.settlement_status.in_(_DRAFT_SETTLEMENT_STATUSES),
|
||||
)
|
||||
.all()
|
||||
)
|
||||
if not links:
|
||||
return
|
||||
|
||||
now = datetime.now()
|
||||
amount = Decimal(str(freight_amount or 0))
|
||||
settlement_ids = set()
|
||||
for link in links:
|
||||
link.freight_amount = amount
|
||||
link.update_by = user_id
|
||||
link.update_time = now
|
||||
settlement_ids.add(link.settlement_id)
|
||||
|
||||
for settlement_id in settlement_ids:
|
||||
_recalc_settlement_total_freight_from_links(
|
||||
db, settlement_id, user_id=user_id, now=now
|
||||
)
|
||||
|
||||
|
||||
def refresh_draft_settlement_freight(
|
||||
db: Session,
|
||||
settlement: PlFreightSettlement,
|
||||
*,
|
||||
user_id: str = "",
|
||||
) -> bool:
|
||||
"""草稿/已驳回结算单按当前运输单运费刷新明细快照与合计。"""
|
||||
if settlement.settlement_status not in _DRAFT_SETTLEMENT_STATUSES:
|
||||
return False
|
||||
|
||||
links = (
|
||||
db.query(PlFreightSettlementTransport)
|
||||
.filter(
|
||||
PlFreightSettlementTransport.settlement_id == settlement.id,
|
||||
PlFreightSettlementTransport.del_flag == 0,
|
||||
)
|
||||
.all()
|
||||
)
|
||||
if not links:
|
||||
return False
|
||||
|
||||
transport_ids = [link.transport_id for link in links]
|
||||
transports = {
|
||||
t.id: t
|
||||
for t in db.query(PlTransport)
|
||||
.filter(PlTransport.id.in_(transport_ids), PlTransport.del_flag == 0)
|
||||
.all()
|
||||
}
|
||||
|
||||
old_total = Decimal(str(settlement.total_freight or 0))
|
||||
now = datetime.now()
|
||||
changed = False
|
||||
for link in links:
|
||||
transport = transports.get(link.transport_id)
|
||||
if not transport:
|
||||
continue
|
||||
new_amount = Decimal(str(transport.freight_amount or 0))
|
||||
if Decimal(str(link.freight_amount or 0)) != new_amount:
|
||||
link.freight_amount = new_amount
|
||||
link.update_time = now
|
||||
if user_id:
|
||||
link.update_by = user_id
|
||||
changed = True
|
||||
|
||||
_recalc_settlement_total_freight_from_links(
|
||||
db, settlement.id, user_id=user_id, now=now
|
||||
)
|
||||
new_total = Decimal(str(settlement.total_freight or 0))
|
||||
return changed or new_total != old_total
|
||||
|
||||
|
||||
def delete_draft_settlement(
|
||||
db: Session, *, tenant_no: str, settlement_id: str, user_id: str, user=None
|
||||
) -> None:
|
||||
settlement = get_settlement_row(db, tenant_no, settlement_id, user=user)
|
||||
if settlement.settlement_status != "pending":
|
||||
raise HTTPException(status_code=400, detail="仅草稿结算单可删除")
|
||||
if settlement.settlement_status not in _DRAFT_SETTLEMENT_STATUSES:
|
||||
raise HTTPException(status_code=400, detail="仅草稿或已驳回结算单可删除")
|
||||
|
||||
if user:
|
||||
assert_row_deletable_by_creator(settlement, user_info_from_context(user))
|
||||
@@ -335,8 +474,8 @@ def cancel_draft_settlement(
|
||||
db: Session, *, tenant_no: str, settlement_id: str, user_id: str, user=None
|
||||
) -> PlFreightSettlement:
|
||||
settlement = get_settlement_row(db, tenant_no, settlement_id, user=user)
|
||||
if settlement.settlement_status != "pending":
|
||||
raise HTTPException(status_code=400, detail="仅草稿结算单可作废")
|
||||
if settlement.settlement_status not in _DRAFT_SETTLEMENT_STATUSES:
|
||||
raise HTTPException(status_code=400, detail="仅草稿或已驳回结算单可作废")
|
||||
|
||||
if user:
|
||||
assert_row_deletable_by_creator(settlement, user_info_from_context(user))
|
||||
@@ -591,7 +730,7 @@ def _advance_after_approval(
|
||||
) -> None:
|
||||
now = datetime.now()
|
||||
if result == "rejected":
|
||||
settlement.settlement_status = "pending"
|
||||
settlement.settlement_status = "rejected"
|
||||
settlement.update_time = now
|
||||
others = (
|
||||
db.query(PlFreightSettlementApproval)
|
||||
@@ -674,8 +813,8 @@ def submit_settlement_approval(
|
||||
user=None,
|
||||
) -> PlFreightSettlement:
|
||||
settlement = get_settlement_row(db, tenant_no, settlement_id, user=user)
|
||||
if settlement.settlement_status != "pending":
|
||||
raise HTTPException(status_code=400, detail="仅草稿状态可提交审批")
|
||||
if settlement.settlement_status not in _DRAFT_SETTLEMENT_STATUSES:
|
||||
raise HTTPException(status_code=400, detail="仅草稿或已驳回状态可提交审批")
|
||||
|
||||
settlement.settlement_status = "approving"
|
||||
if body.remark:
|
||||
@@ -991,12 +1130,15 @@ def list_settlements_enriched(
|
||||
.all()
|
||||
)
|
||||
status_fixed = False
|
||||
freight_fixed = False
|
||||
for row in rows:
|
||||
if _sync_settlement_status_if_approval_complete(db, row):
|
||||
status_fixed = True
|
||||
if _sync_settlement_status_if_disbursed(db, row):
|
||||
status_fixed = True
|
||||
if status_fixed:
|
||||
if refresh_draft_settlement_freight(db, row, user_id=user_id):
|
||||
freight_fixed = True
|
||||
if status_fixed or freight_fixed:
|
||||
db.commit()
|
||||
for row in rows:
|
||||
db.refresh(row)
|
||||
@@ -1018,6 +1160,9 @@ def get_settlement_detail(
|
||||
if _sync_settlement_status_if_disbursed(db, settlement):
|
||||
db.commit()
|
||||
db.refresh(settlement)
|
||||
if refresh_draft_settlement_freight(db, settlement, user_id=user_id):
|
||||
db.commit()
|
||||
db.refresh(settlement)
|
||||
base = enrich_settlement_list_item(db, settlement, user_id)
|
||||
|
||||
transport_ids = _get_transport_ids(db, settlement_id)
|
||||
@@ -1089,6 +1234,122 @@ def get_settlement_detail(
|
||||
return base
|
||||
|
||||
|
||||
def _validate_transports_for_settlement_update(
|
||||
db: Session,
|
||||
*,
|
||||
tenant_no: str,
|
||||
settlement_id: str,
|
||||
transport_ids: List[str],
|
||||
) -> List[PlTransport]:
|
||||
cleaned = list(dict.fromkeys([tid.strip() for tid in transport_ids if (tid or "").strip()]))
|
||||
if not cleaned:
|
||||
raise HTTPException(status_code=400, detail="至少保留一条关联运输")
|
||||
|
||||
transports = (
|
||||
db.query(PlTransport)
|
||||
.filter(
|
||||
PlTransport.id.in_(cleaned),
|
||||
PlTransport.tenant_no == tenant_no,
|
||||
PlTransport.del_flag == 0,
|
||||
)
|
||||
.all()
|
||||
)
|
||||
if len(transports) != len(cleaned):
|
||||
raise HTTPException(status_code=400, detail="存在无效的运输单")
|
||||
|
||||
transport_map = {t.id: t for t in transports}
|
||||
current_ids = set(_get_transport_ids(db, settlement_id))
|
||||
added_ids = [tid for tid in cleaned if tid not in current_ids]
|
||||
|
||||
if added_ids:
|
||||
occupied = {r[0] for r in _occupied_transport_ids_subquery(db, tenant_no).all()}
|
||||
conflict = [tid for tid in added_ids if tid in occupied]
|
||||
if conflict:
|
||||
raise HTTPException(status_code=400, detail="所选运输单已纳入其他结算单")
|
||||
|
||||
plans = (
|
||||
db.query(PlPlan)
|
||||
.filter(
|
||||
PlPlan.tenant_no == tenant_no,
|
||||
PlPlan.del_flag == 0,
|
||||
PlPlan.transport_id.in_(added_ids),
|
||||
)
|
||||
.all()
|
||||
)
|
||||
plan_by_transport = {p.transport_id: p for p in plans if p.transport_id}
|
||||
for tid in added_ids:
|
||||
plan = plan_by_transport.get(tid)
|
||||
if not plan:
|
||||
raise HTTPException(status_code=400, detail="存在未关联计划的运输单")
|
||||
if plan.archive_status != "archived":
|
||||
raise HTTPException(status_code=400, detail=f"计划 {plan.plan_no} 未归档,不能结算")
|
||||
if int(plan.has_freight or 0) != 1:
|
||||
raise HTTPException(status_code=400, detail=f"计划 {plan.plan_no} 无运输费用")
|
||||
if plan.follow_status == "cancelled":
|
||||
raise HTTPException(status_code=400, detail=f"计划 {plan.plan_no} 已作废")
|
||||
amount = Decimal(str(transport_map[tid].freight_amount or 0))
|
||||
if amount <= 0:
|
||||
raise HTTPException(status_code=400, detail=f"运输单 {transport_map[tid].transport_no} 运费无效")
|
||||
|
||||
return [transport_map[tid] for tid in cleaned]
|
||||
|
||||
|
||||
def _sync_settlement_transport_links(
|
||||
db: Session,
|
||||
*,
|
||||
tenant_no: str,
|
||||
settlement_id: str,
|
||||
transport_ids: List[str],
|
||||
transports: List[PlTransport],
|
||||
user_id: str,
|
||||
dept_id: str,
|
||||
) -> None:
|
||||
cleaned = list(dict.fromkeys([tid.strip() for tid in transport_ids if (tid or "").strip()]))
|
||||
transport_map = {t.id: t for t in transports}
|
||||
now = datetime.now()
|
||||
|
||||
current_links = (
|
||||
db.query(PlFreightSettlementTransport)
|
||||
.filter(
|
||||
PlFreightSettlementTransport.settlement_id == settlement_id,
|
||||
PlFreightSettlementTransport.del_flag == 0,
|
||||
)
|
||||
.all()
|
||||
)
|
||||
current_map = {link.transport_id: link for link in current_links}
|
||||
new_set = set(cleaned)
|
||||
|
||||
for tid, link in current_map.items():
|
||||
if tid not in new_set:
|
||||
link.del_flag = 1
|
||||
link.update_by = user_id
|
||||
link.update_time = now
|
||||
|
||||
for tid in cleaned:
|
||||
transport = transport_map[tid]
|
||||
amount = transport.freight_amount
|
||||
if tid in current_map:
|
||||
link = current_map[tid]
|
||||
if Decimal(str(link.freight_amount or 0)) != Decimal(str(amount or 0)):
|
||||
link.freight_amount = amount
|
||||
link.update_by = user_id
|
||||
link.update_time = now
|
||||
continue
|
||||
db.add(
|
||||
PlFreightSettlementTransport(
|
||||
id=generate_uuid(),
|
||||
tenant_no=tenant_no,
|
||||
settlement_id=settlement_id,
|
||||
transport_id=tid,
|
||||
freight_amount=amount,
|
||||
create_by=user_id,
|
||||
create_dept_id=dept_id or "",
|
||||
)
|
||||
)
|
||||
|
||||
_recalc_settlement_total_freight_from_links(db, settlement_id, user_id=user_id, now=now)
|
||||
|
||||
|
||||
def update_settlement_draft(
|
||||
db: Session,
|
||||
*,
|
||||
@@ -1100,15 +1361,37 @@ def update_settlement_draft(
|
||||
) -> PlFreightSettlement:
|
||||
settlement = get_settlement_row(db, tenant_no, settlement_id, user=user)
|
||||
status = settlement.settlement_status
|
||||
if status not in ("pending", "approved"):
|
||||
if status not in (*_DRAFT_SETTLEMENT_STATUSES, "approved"):
|
||||
raise HTTPException(status_code=400, detail="当前状态不可编辑")
|
||||
|
||||
update_data = payload.model_dump(exclude_unset=True, by_alias=False)
|
||||
transport_ids = update_data.pop("transport_ids", None)
|
||||
|
||||
if status == "approved":
|
||||
if transport_ids is not None:
|
||||
raise HTTPException(status_code=400, detail="当前状态不可修改关联运输")
|
||||
allowed = {"invoice_amount", "invoice_no", "invoice_date", "invoice_attachment_urls", "remark"}
|
||||
update_data = {k: v for k, v in update_data.items() if k in allowed}
|
||||
if not update_data:
|
||||
raise HTTPException(status_code=400, detail="无有效更新字段")
|
||||
elif status in _DRAFT_SETTLEMENT_STATUSES and transport_ids is not None:
|
||||
dept_id = getattr(user, "dept_id", "") if user else ""
|
||||
transports = _validate_transports_for_settlement_update(
|
||||
db,
|
||||
tenant_no=tenant_no,
|
||||
settlement_id=settlement_id,
|
||||
transport_ids=transport_ids,
|
||||
)
|
||||
_sync_settlement_transport_links(
|
||||
db,
|
||||
tenant_no=tenant_no,
|
||||
settlement_id=settlement_id,
|
||||
transport_ids=transport_ids,
|
||||
transports=transports,
|
||||
user_id=user_id,
|
||||
dept_id=dept_id,
|
||||
)
|
||||
|
||||
for key, value in update_data.items():
|
||||
setattr(settlement, key, value)
|
||||
settlement.update_by = user_id
|
||||
|
||||
@@ -27,6 +27,7 @@ from app.schemas.pl.plan import (
|
||||
PlanProductCreate,
|
||||
PlanTransportCreateBlock,
|
||||
)
|
||||
from app.services.pl_freight_settlement_service import sync_draft_settlement_freight_for_transport
|
||||
from app.services.pl_transport_resource_snapshot_service import (
|
||||
apply_resource_snapshot_json,
|
||||
build_transport_resource_snapshot,
|
||||
@@ -59,8 +60,24 @@ def _product_quantity(prod: PlanProductCreate) -> Decimal:
|
||||
return Decimal("0")
|
||||
|
||||
|
||||
def sum_product_quantities(products: list[PlanProductCreate]) -> Decimal:
|
||||
return sum(_product_quantity(p) for p in products)
|
||||
def _product_create_actual_qty(prod: PlanProductCreate) -> Decimal:
|
||||
if prod.actual_qty is not None:
|
||||
return Decimal(str(prod.actual_qty))
|
||||
return Decimal("0")
|
||||
|
||||
|
||||
def _plan_product_actual_qty(prod: PlPlanProduct) -> Decimal:
|
||||
if prod.actual_qty is not None:
|
||||
return Decimal(str(prod.actual_qty))
|
||||
return Decimal("0")
|
||||
|
||||
|
||||
def sum_product_actual_quantities(products: list[PlanProductCreate]) -> Decimal:
|
||||
return sum(_product_create_actual_qty(p) for p in products)
|
||||
|
||||
|
||||
def sum_plan_product_actual_quantities(products: list[PlPlanProduct]) -> Decimal:
|
||||
return sum(_plan_product_actual_qty(p) for p in products)
|
||||
|
||||
|
||||
def _estimate_qty_fields(plan_type: str, qty: Optional[Decimal]) -> dict:
|
||||
@@ -100,7 +117,7 @@ def build_plan_product(
|
||||
package_spec=prod.package_spec,
|
||||
delivery_method=prod.delivery_method,
|
||||
quantity=qty if qty else None,
|
||||
actual_qty=Decimal(str(prod.actual_qty)) if prod.actual_qty is not None else (qty if qty else None),
|
||||
actual_qty=Decimal(str(prod.actual_qty)) if prod.actual_qty is not None else None,
|
||||
tax_price=tax_price,
|
||||
tax_amount=prod.tax_amount,
|
||||
tax_subtotal=prod.tax_subtotal,
|
||||
@@ -195,10 +212,7 @@ def _calc_freight_amount(
|
||||
|
||||
qty = transport_qty
|
||||
if qty is None:
|
||||
qty = sum(
|
||||
Decimal(str(p.quantity or p.inbound_estimate_qty or p.outbound_estimate_qty or 0))
|
||||
for p in products
|
||||
)
|
||||
qty = sum_plan_product_actual_quantities(products)
|
||||
if freight_price is not None:
|
||||
computed = qty * Decimal(str(freight_price))
|
||||
if freight_amount is not None:
|
||||
@@ -356,10 +370,7 @@ def _resolve_transport_context(
|
||||
)
|
||||
transport_qty = transport_payload.transport_qty
|
||||
if transport_qty is None and transport_payload.freight_type == "by_weight":
|
||||
transport_qty = sum(
|
||||
Decimal(str(p.quantity or p.inbound_estimate_qty or p.outbound_estimate_qty or 0))
|
||||
for p in products
|
||||
)
|
||||
transport_qty = sum_plan_product_actual_quantities(products)
|
||||
|
||||
return (
|
||||
vehicle,
|
||||
@@ -521,6 +532,14 @@ def upsert_draft_transport_for_plan(
|
||||
driver_id=driver_id,
|
||||
)
|
||||
plan.freight_amount = freight_amount or 0
|
||||
if plan.transport_id:
|
||||
sync_draft_settlement_freight_for_transport(
|
||||
db,
|
||||
tenant_no=tenant_no,
|
||||
transport_id=plan.transport_id,
|
||||
freight_amount=freight_amount or Decimal("0"),
|
||||
user_id=user_id,
|
||||
)
|
||||
if plan.transport_status != "arranged":
|
||||
plan.transport_status = "pending"
|
||||
|
||||
@@ -660,10 +679,7 @@ def create_transport_for_plan(
|
||||
|
||||
transport_qty = transport_payload.transport_qty
|
||||
if transport_qty is None and transport_payload.freight_type == "by_weight":
|
||||
transport_qty = sum(
|
||||
Decimal(str(p.quantity or p.inbound_estimate_qty or p.outbound_estimate_qty or 0))
|
||||
for p in products
|
||||
)
|
||||
transport_qty = sum_plan_product_actual_quantities(products)
|
||||
|
||||
transport_no = generate_transport_no(db)
|
||||
transport = PlTransport(
|
||||
@@ -739,9 +755,9 @@ def validate_create_full(payload: PlanCreateFull) -> None:
|
||||
if transport.freight_type == "by_weight":
|
||||
if not transport.freight_price or Decimal(str(transport.freight_price)) <= 0:
|
||||
raise HTTPException(status_code=422, detail="按重量计费时请填写运输单价")
|
||||
qty = transport.transport_qty or sum_product_quantities(payload.products)
|
||||
qty = transport.transport_qty or sum_product_actual_quantities(payload.products)
|
||||
if qty <= 0:
|
||||
raise HTTPException(status_code=422, detail="运输量必须大于0")
|
||||
raise HTTPException(status_code=422, detail="运输量必须大于0,请填写产品实际数量或运输量")
|
||||
elif transport.freight_type == "by_trip":
|
||||
if not transport.freight_amount or Decimal(str(transport.freight_amount)) <= 0:
|
||||
raise HTTPException(status_code=422, detail="按趟计费时请填写运费金额")
|
||||
@@ -850,6 +866,13 @@ def apply_archive_freight(
|
||||
transport.freight_price = None
|
||||
transport.transport_qty = None
|
||||
transport.update_by = user_id
|
||||
sync_draft_settlement_freight_for_transport(
|
||||
db,
|
||||
tenant_no=tenant_no,
|
||||
transport_id=plan.transport_id,
|
||||
freight_amount=Decimal("0"),
|
||||
user_id=user_id,
|
||||
)
|
||||
return
|
||||
|
||||
if not plan.transport_id:
|
||||
@@ -874,13 +897,34 @@ def apply_archive_freight(
|
||||
transport.freight_price = freight.freight_price
|
||||
amount = freight.freight_amount or Decimal("0")
|
||||
transport.freight_amount = amount
|
||||
freight_type = freight.freight_type or transport.freight_type or "by_weight"
|
||||
plan_products = (
|
||||
db.query(PlPlanProduct)
|
||||
.filter(
|
||||
PlPlanProduct.plan_id == plan.id,
|
||||
PlPlanProduct.tenant_no == tenant_no,
|
||||
PlPlanProduct.del_flag == 0,
|
||||
)
|
||||
.all()
|
||||
)
|
||||
if freight.transport_qty is not None:
|
||||
transport.transport_qty = freight.transport_qty
|
||||
elif freight_type == "by_weight":
|
||||
transport.transport_qty = sum_plan_product_actual_quantities(plan_products)
|
||||
if freight_type == "by_weight" and (transport.transport_qty or 0) <= 0:
|
||||
raise HTTPException(status_code=400, detail="运输量必须大于0,请先填写产品实际数量")
|
||||
if freight.has_invoice is not None:
|
||||
transport.has_invoice = freight.has_invoice
|
||||
transport.update_by = user_id
|
||||
|
||||
plan.freight_amount = amount
|
||||
sync_draft_settlement_freight_for_transport(
|
||||
db,
|
||||
tenant_no=tenant_no,
|
||||
transport_id=plan.transport_id,
|
||||
freight_amount=amount,
|
||||
user_id=user_id,
|
||||
)
|
||||
|
||||
|
||||
def record_plan_change(
|
||||
|
||||
@@ -148,7 +148,5 @@
|
||||
"146": "Community 146",
|
||||
"147": "Community 147",
|
||||
"148": "Community 148",
|
||||
"149": "Community 149",
|
||||
"150": "Community 150",
|
||||
"151": "Community 151"
|
||||
"150": "Community 150"
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
# Graph Report - backend (2026-06-30)
|
||||
# Graph Report - backend (2026-07-01)
|
||||
|
||||
## Corpus Check
|
||||
- 226 files · ~157,929 words
|
||||
- 226 files · ~158,852 words
|
||||
- Verdict: corpus is large enough that graph structure adds value.
|
||||
|
||||
## Summary
|
||||
- 4973 nodes · 34742 edges · 152 communities (150 shown, 2 thin omitted)
|
||||
- Extraction: 51% EXTRACTED · 49% INFERRED · 0% AMBIGUOUS · INFERRED: 17183 edges (avg confidence: 0.5)
|
||||
- 5033 nodes · 34891 edges · 150 communities (148 shown, 2 thin omitted)
|
||||
- Extraction: 51% EXTRACTED · 49% INFERRED · 0% AMBIGUOUS · INFERRED: 17194 edges (avg confidence: 0.5)
|
||||
- Token cost: 0 input · 0 output
|
||||
|
||||
## Graph Freshness
|
||||
- Built from commit: `d84f4b94`
|
||||
- Built from commit: `7c838cfb`
|
||||
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
|
||||
- Run `graphify update .` after code changes (no API cost).
|
||||
|
||||
@@ -154,9 +154,7 @@
|
||||
- [[_COMMUNITY_Community 146|Community 146]]
|
||||
- [[_COMMUNITY_Community 147|Community 147]]
|
||||
- [[_COMMUNITY_Community 148|Community 148]]
|
||||
- [[_COMMUNITY_Community 149|Community 149]]
|
||||
- [[_COMMUNITY_Community 150|Community 150]]
|
||||
- [[_COMMUNITY_Community 151|Community 151]]
|
||||
|
||||
## God Nodes (most connected - your core abstractions)
|
||||
1. `Session` - 1123 edges
|
||||
@@ -164,9 +162,9 @@
|
||||
3. `int` - 336 edges
|
||||
4. `Any` - 331 edges
|
||||
5. `get_tenant_no()` - 327 edges
|
||||
6. `SysUser` - 281 edges
|
||||
6. `SysUser` - 282 edges
|
||||
7. `DbUserContext` - 272 edges
|
||||
8. `success_response()` - 258 edges
|
||||
8. `success_response()` - 259 edges
|
||||
9. `Session` - 257 edges
|
||||
10. `bool` - 255 edges
|
||||
|
||||
@@ -182,175 +180,175 @@
|
||||
- `int` --uses--> `LocalStorage` [INFERRED]
|
||||
scripts/run_db_auto_generate_plans.py → app/core/storage.py
|
||||
|
||||
## Communities (152 total, 2 thin omitted)
|
||||
## Communities (150 total, 2 thin omitted)
|
||||
|
||||
### Community 0 - "Community 0"
|
||||
Cohesion: 0.11
|
||||
Nodes (126): date, DbUserContext, int, Session, str, DocumentReminderRead, DocumentReminderUpdate, FreightSettlementCreate (+118 more)
|
||||
Cohesion: 0.14
|
||||
Nodes (103): date, DbUserContext, int, Session, str, DocumentReminderRead, DocumentReminderUpdate, FreightSettlementUpdate (+95 more)
|
||||
|
||||
### Community 1 - "Community 1"
|
||||
Cohesion: 0.08
|
||||
Nodes (24): 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo (+16 more)
|
||||
Cohesion: 0.04
|
||||
Nodes (46): invoice_info_list(), 按客户ID查询开票信息(与 by-customer 等价), 按客户ID查询开票信息(与 by-customer 等价), 按客户ID查询开票信息(与 by-customer 等价), 按客户ID查询开票信息(与 by-customer 等价), 按客户ID查询开票信息(与 by-customer 等价), 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll (+38 more)
|
||||
|
||||
### Community 2 - "Community 2"
|
||||
Cohesion: 0.35
|
||||
Nodes (221): Any, bool, str, UploadFile, CRM 线索管理 Pydantic Schemas, CRM 客户管理 Pydantic Schemas, CRM 商机管理 Pydantic Schemas, CRM 客户公海池规则 Pydantic Schemas (+213 more)
|
||||
Nodes (219): Any, bool, str, UploadFile, CRM 线索管理 Pydantic Schemas, CRM 客户管理 Pydantic Schemas, CRM 商机管理 Pydantic Schemas, CRM 客户公海池规则 Pydantic Schemas (+211 more)
|
||||
|
||||
### Community 3 - "Community 3"
|
||||
Cohesion: 0.07
|
||||
Nodes (172): _apply_default_invoice_info_to_customers(), category_add(), category_delete(), category_tree(), category_update(), clue_assign(), clue_check_convert(), clue_check_duplicate() (+164 more)
|
||||
Nodes (171): _apply_default_invoice_info_to_customers(), category_add(), category_delete(), category_tree(), category_update(), clue_assign(), clue_check_convert(), clue_check_duplicate() (+163 more)
|
||||
|
||||
### Community 4 - "Community 4"
|
||||
Cohesion: 0.05
|
||||
Nodes (43): invoice_info_list(), 按客户ID查询开票信息(与 by-customer 等价), 按客户ID查询开票信息(与 by-customer 等价), 按客户ID查询开票信息(与 by-customer 等价), 按客户ID查询开票信息(与 by-customer 等价), 分页查询供方列表 — Java: CrmSupplierInfoController.list, 分页查询供方列表 — Java: CrmSupplierInfoController.list, 分页查询供方列表 — Java: CrmSupplierInfoController.list (+35 more)
|
||||
Cohesion: 0.13
|
||||
Nodes (29): Any, bool, CRM 供方信息 CRUD — 对照 CrmSupplierInfoServiceImpl.java, int, Session, str, _apply_list_filters(), create_supplier_info() (+21 more)
|
||||
|
||||
### Community 5 - "Community 5"
|
||||
Cohesion: 0.07
|
||||
Nodes (42): _db_pool_keepalive_loop(), _error_json(), lifespan(), _mask_secret(), Exception, int, Request, str (+34 more)
|
||||
Cohesion: 0.08
|
||||
Nodes (39): _db_pool_keepalive_loop(), _error_json(), lifespan(), _mask_secret(), Exception, int, Request, str (+31 more)
|
||||
|
||||
### Community 6 - "Community 6"
|
||||
Cohesion: 0.13
|
||||
Nodes (56): Any, int, Session, str, Any, bool, CRM 客户 CRUD(客户主表 + 转移/成交/公海池操作), CrmCustomer (+48 more)
|
||||
|
||||
### Community 7 - "Community 7"
|
||||
Cohesion: 0.14
|
||||
Nodes (39): Any, bool, int, Session, str, SysUser, create_user(), get_user() (+31 more)
|
||||
|
||||
### Community 7 - "Community 7"
|
||||
Cohesion: 0.06
|
||||
Nodes (33): BaseModel, AttachmentOut, ReimburseApplyCreate, ReimburseApplyUpdate, ReimburseApprovalCreate, _coerce_optional_id(), WorkflowDefCreate, WorkflowDefUpdate (+25 more)
|
||||
|
||||
### Community 8 - "Community 8"
|
||||
Cohesion: 0.16
|
||||
Nodes (33): Any, bool, int, Session, str, Any, Session, str (+25 more)
|
||||
Cohesion: 0.35
|
||||
Nodes (5): Any, str, WfProcessInstance, WorkflowEngine, WfProcessInstance
|
||||
|
||||
### Community 9 - "Community 9"
|
||||
Cohesion: 0.10
|
||||
Nodes (22): str, CustomerPoolDetailBody, CustomerPoolListBody, PurchasePlanBase, PurchasePlanCreate, PurchasePlanUpdate, BaseModel, SoftDeleteModel (+14 more)
|
||||
Cohesion: 0.19
|
||||
Nodes (38): ProcessDefCreateBody, ProcessDefUpdateBody, PublishVersionBody, StartInstanceBody, Any, bool, WfProcessInstance, bool (+30 more)
|
||||
|
||||
### Community 10 - "Community 10"
|
||||
Cohesion: 0.09
|
||||
Nodes (39): CRM 报价单 CRUD — 对照 CrmQuoteServiceImpl.java(P2 全量), date, Decimal, Query, _build_quote_filters(), calculate_quote_amount(), create_quote(), _decimal_value() (+31 more)
|
||||
Cohesion: 0.03
|
||||
Nodes (151): register_quote_routes(), Any, bool, CRM 报价单 CRUD — 对照 CrmQuoteServiceImpl.java(P2 全量), datetime, Decimal, int, Session (+143 more)
|
||||
|
||||
### Community 11 - "Community 11"
|
||||
Cohesion: 0.16
|
||||
Nodes (36): Any, bool, BxUserContext, BxWorkflowNode, float, int, ReimburseApplyOut, Session (+28 more)
|
||||
Cohesion: 0.15
|
||||
Nodes (38): Any, bool, BxUserContext, BxWorkflowNode, float, int, ReimburseApplyOut, Session (+30 more)
|
||||
|
||||
### Community 12 - "Community 12"
|
||||
Cohesion: 0.12
|
||||
Nodes (85): date, DbUserContext, int, Session, str, VehicleUreaApplyCreate, VehicleUreaApplyRead, VehicleUreaApplyUpdate (+77 more)
|
||||
Nodes (84): date, DbUserContext, int, Session, str, VehicleUreaApplyCreate, VehicleUreaApplyRead, VehicleUreaApplyUpdate (+76 more)
|
||||
|
||||
### Community 13 - "Community 13"
|
||||
Cohesion: 0.10
|
||||
Nodes (17): Exception, bool, bytes, int, str, BytesIO, BaseStorage, convert_heic_to_jpeg() (+9 more)
|
||||
Cohesion: 0.05
|
||||
Nodes (72): BxUserContext, Session, str, UploadFile, Any, bool, bytes, int (+64 more)
|
||||
|
||||
### Community 14 - "Community 14"
|
||||
Cohesion: 0.09
|
||||
Nodes (55): Any, bool, datetime, int, Session, str, _advance_contract_after_approval(), approve_contract() (+47 more)
|
||||
|
||||
### Community 15 - "Community 15"
|
||||
Cohesion: 0.18
|
||||
Nodes (24): bool, date, datetime, int, Session, str, ReimburseApplyOut, allocate_reimburse_title_seq() (+16 more)
|
||||
Cohesion: 0.14
|
||||
Nodes (28): str, T, bool, date, datetime, int, Session, str (+20 more)
|
||||
|
||||
### Community 16 - "Community 16"
|
||||
Cohesion: 0.17
|
||||
Nodes (28): API 路由包 — 山峡化工生产一体化门户, get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,14 个一级菜单), approve_task(), _assert_wf_instance_in_scope(), _business_type_label(), create_process_def(), delete_process_def() (+20 more)
|
||||
Cohesion: 0.07
|
||||
Nodes (103): Any, CRM 合同子模块路由 — 变更/模板/审批独立页, register_contract_sub_routes(), Any, CRM 合同 CRUD — 对照 CrmContractServiceImpl.java(列表/详情 P1), Decimal, int, Session (+95 more)
|
||||
|
||||
### Community 17 - "Community 17"
|
||||
Cohesion: 0.20
|
||||
Nodes (52): Any, Any, CRM 商机 CRUD(主表 + 阶段/赢输单/统计/看板/漏斗), CrmOpportunity, date, datetime, Decimal, int (+44 more)
|
||||
Cohesion: 0.18
|
||||
Nodes (50): Any, CRM 商机 CRUD(主表 + 阶段/赢输单/统计/看板/漏斗), CrmOpportunity, date, datetime, Decimal, int, Session (+42 more)
|
||||
|
||||
### Community 18 - "Community 18"
|
||||
Cohesion: 0.13
|
||||
Nodes (29): Any, bool, BxUserContext, BxWorkflowNode, float, int, Session, str (+21 more)
|
||||
Cohesion: 0.18
|
||||
Nodes (19): Any, bool, BxUserContext, BxWorkflowNode, float, int, Session, str (+11 more)
|
||||
|
||||
### Community 19 - "Community 19"
|
||||
Cohesion: 0.23
|
||||
Nodes (27): register_quote_routes(), bool, int, Session, str, accept_quote(), _ensure_quote_in_scope(), generate_pdf() (+19 more)
|
||||
Cohesion: 0.21
|
||||
Nodes (27): approve_task(), _assert_wf_instance_in_scope(), _business_type_label(), create_process_def(), delete_process_def(), _enrich_task_list(), get_business_all_tasks(), _get_business_form_fields() (+19 more)
|
||||
|
||||
### Community 20 - "Community 20"
|
||||
Cohesion: 0.35
|
||||
Nodes (30): BxUserContext, int, Session, str, approve_reimburse(), approved_by_me(), _build_details_data(), create_reimburse() (+22 more)
|
||||
Cohesion: 0.22
|
||||
Nodes (47): BxUserContext, int, Session, str, BxUserContext, int, Session, str (+39 more)
|
||||
|
||||
### Community 21 - "Community 21"
|
||||
Cohesion: 0.06
|
||||
Nodes (130): bool, DbUserContext, int, 运输计划管理 - 基础数据 API(承运商、车辆、人员), PlCarrier, PlVehicle, Session, str (+122 more)
|
||||
Cohesion: 0.05
|
||||
Nodes (162): bool, DbUserContext, int, 运输计划管理 - 基础数据 API(承运商、车辆、人员), PlCarrier, PlVehicle, Session, str (+154 more)
|
||||
|
||||
### Community 22 - "Community 22"
|
||||
Cohesion: 0.20
|
||||
Nodes (36): ProcessDefCreateBody, ProcessDefUpdateBody, PublishVersionBody, 审批意见:前端传 commentText,兼容 comment。, 审批意见:前端传 commentText,兼容 comment。, StartInstanceBody, TaskActionBody, Any (+28 more)
|
||||
|
||||
### Community 23 - "Community 23"
|
||||
Cohesion: 0.27
|
||||
Nodes (35): AdvanceIssueRequest, BxUserContext, int, ReimburseApplyOut, Session, str, str, BatchOffsetRequest (+27 more)
|
||||
|
||||
### Community 24 - "Community 24"
|
||||
Cohesion: 0.12
|
||||
Nodes (90): date, DbUserContext, int, Session, str, VehicleMaintenanceApplyCreate, VehicleMaintenanceApplyRead, VehicleMaintenanceApplyReminder (+82 more)
|
||||
|
||||
### Community 25 - "Community 25"
|
||||
Cohesion: 0.22
|
||||
Nodes (29): Any, int, Session, str, create_instance(), create_process_def(), create_task(), get_all_tasks_for_business() (+21 more)
|
||||
|
||||
### Community 23 - "Community 23"
|
||||
Cohesion: 0.23
|
||||
Nodes (37): AdvanceIssueRequest, BxUserContext, int, ReimburseApplyOut, Session, str, datetime, str (+29 more)
|
||||
|
||||
### Community 24 - "Community 24"
|
||||
Cohesion: 0.12
|
||||
Nodes (89): date, DbUserContext, int, Session, str, VehicleMaintenanceApplyCreate, VehicleMaintenanceApplyRead, VehicleMaintenanceApplyReminder (+81 more)
|
||||
|
||||
### Community 25 - "Community 25"
|
||||
Cohesion: 0.09
|
||||
Nodes (29): 运输计划管理 - 基础数据 Schema(承运商、车辆、人员、证书), CarrierAuditReject, CarrierBase, CarrierCreate, CarrierListResponse, CarrierQualificationBase, CarrierRead, CarrierUpdate (+21 more)
|
||||
|
||||
### Community 26 - "Community 26"
|
||||
Cohesion: 0.20
|
||||
Nodes (18): bool, int, Redis, Request, str, _claims_from_auth(), _coerce_post_method_override_to_get(), _get_redis_client() (+10 more)
|
||||
Cohesion: 0.15
|
||||
Nodes (23): logout(), 登出:吊销 Redis 会话(若已配置 REDIS_HOST)。, 登出:吊销 Redis 会话(若已配置 REDIS_HOST)。, 登出:吊销 Redis 会话(若已配置 REDIS_HOST)。, bool, int, Redis, Request (+15 more)
|
||||
|
||||
### Community 27 - "Community 27"
|
||||
Cohesion: 0.11
|
||||
Nodes (57): Any, bool, int, Session, str, Any, bool, CRM 线索 CRUD(线索主表 + 转化/分配/无效/等级操作) (+49 more)
|
||||
|
||||
### Community 28 - "Community 28"
|
||||
Cohesion: 0.07
|
||||
Nodes (61): Any, CertRead, date, int, Session, str, CertRead, Session (+53 more)
|
||||
Cohesion: 0.33
|
||||
Nodes (29): AdvanceApplyCreate, AdvanceApplyOut, AdvanceApplyUpdate, AdvanceApprovalCreate, BxUserContext, int, Session, str (+21 more)
|
||||
|
||||
### Community 29 - "Community 29"
|
||||
Cohesion: 0.04
|
||||
Nodes (66): 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll (+58 more)
|
||||
Cohesion: 0.08
|
||||
Nodes (26): 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo, 供方详情 — Java: CrmSupplierInfoController.getInfo (+18 more)
|
||||
|
||||
### Community 30 - "Community 30"
|
||||
Cohesion: 0.07
|
||||
Nodes (43): AttachmentUploadResponse, ChangePasswordRequest, Config, LoginRequest, LoginResponse, Pydantic schemas - 用户认证, ResetPasswordRequest, UserCreate (+35 more)
|
||||
|
||||
### Community 31 - "Community 31"
|
||||
Cohesion: 0.34
|
||||
Nodes (19): int, PlTransport, Session, str, UploadFile, _build_public_page(), _format_file_size(), _format_plan_date() (+11 more)
|
||||
Cohesion: 0.15
|
||||
Nodes (30): Any, bool, int, Session, str, approve_quote(), can_user_approve(), create_approval_records() (+22 more)
|
||||
|
||||
### Community 32 - "Community 32"
|
||||
Cohesion: 0.10
|
||||
Nodes (97): date, DbUserContext, int, Session, str, VehicleRechargeApplyCreate, VehicleRechargeApplyRead, VehicleRechargeApplyUpdate (+89 more)
|
||||
Nodes (99): date, DbUserContext, int, Session, str, VehicleRechargeApplyCreate, VehicleRechargeApplyRead, VehicleRechargeApplyUpdate (+91 more)
|
||||
|
||||
### Community 33 - "Community 33"
|
||||
Cohesion: 0.14
|
||||
Nodes (39): pool_rule_toggle(), Any, bool, CRM 公海池规则 CRUD + 规则执行逻辑, int, Session, str, create_pool_rule() (+31 more)
|
||||
Cohesion: 0.13
|
||||
Nodes (56): Any, int, Session, str, Any, bool, CRM 客户 CRUD(客户主表 + 转移/成交/公海池操作), CrmCustomer (+48 more)
|
||||
|
||||
### Community 34 - "Community 34"
|
||||
Cohesion: 0.23
|
||||
Nodes (28): Engine, build_id_maps(), clip_text(), count_rows(), export_mapping(), fetch_rows(), legacy_id_to_str(), main() (+20 more)
|
||||
Cohesion: 0.19
|
||||
Nodes (34): int, str, generate_random_password(), get_file_size_display(), Engine, int, Path, build_id_maps() (+26 more)
|
||||
|
||||
### Community 35 - "Community 35"
|
||||
Cohesion: 0.04
|
||||
Nodes (151): DbUserContext, FreightSettlementDisburseBody, FreightSettlementSubmitApprovalBody, FreightSettlementUpdate, int, Session, str, Any (+143 more)
|
||||
Nodes (182): DbUserContext, FreightSettlementDisburseBody, FreightSettlementSubmitApprovalBody, FreightSettlementUpdate, int, Session, str, Any (+174 more)
|
||||
|
||||
### Community 36 - "Community 36"
|
||||
Cohesion: 0.14
|
||||
Nodes (27): operlog_detail(), operlog_list(), 操作日志分页列表(基于 API 请求日志适配 RuoYi OperLog 结构), 操作日志分页列表(基于 API 请求日志适配 RuoYi OperLog 结构), _user_info(), Session, Any, bool (+19 more)
|
||||
Cohesion: 0.19
|
||||
Nodes (20): int, str, Any, bool, int, Session, str, business_type_from_path() (+12 more)
|
||||
|
||||
### Community 37 - "Community 37"
|
||||
Cohesion: 0.33
|
||||
Nodes (14): Any, int, Session, str, create_dict_data(), get_dict_data(), list_dict_data(), list_dict_data_options() (+6 more)
|
||||
|
||||
### Community 38 - "Community 38"
|
||||
Cohesion: 0.10
|
||||
Nodes (35): Any, bool, int, str, Any, bool, int, Session (+27 more)
|
||||
Cohesion: 0.13
|
||||
Nodes (15): Any, bool, int, str, get_wechat_pay_client(), get_wechat_pay_v2(), 微信支付工具模块 支持微信支付 V3 API 文档参考: https://pay.weixin.qq.com/docs/v3/apis/index.html, 统一下单接口 (V3) Args: out_trade_no: 商户订单号 total_amo (+7 more)
|
||||
|
||||
### Community 39 - "Community 39"
|
||||
Cohesion: 0.16
|
||||
Nodes (25): datetime, int, str, bool, date, datetime, str, 审批轮次过滤 — 驳回后重新提交时,进度接口仅展示当前轮次。 (+17 more)
|
||||
Cohesion: 0.18
|
||||
Nodes (22): datetime, date, datetime, str, 审批轮次过滤 — 驳回后重新提交时,进度接口仅展示当前轮次。, format_datetime(), get_current_time(), parse_datetime() (+14 more)
|
||||
|
||||
### Community 40 - "Community 40"
|
||||
Cohesion: 0.13
|
||||
Nodes (37): Any, bool, Decimal, int, Session, str, batch_insert_quote_products(), calculate_subtotal() (+29 more)
|
||||
|
||||
### Community 41 - "Community 41"
|
||||
Cohesion: 0.13
|
||||
Nodes (39): Any, bool, date, int, Session, str, Session, str (+31 more)
|
||||
Cohesion: 0.12
|
||||
Nodes (41): Any, bool, date, int, Session, str, Session, str (+33 more)
|
||||
|
||||
### Community 42 - "Community 42"
|
||||
Cohesion: 0.08
|
||||
@@ -362,39 +360,39 @@ Nodes (16): Any, int, str, BusinessException, InvalidStatusTransitionException,
|
||||
|
||||
### Community 44 - "Community 44"
|
||||
Cohesion: 0.21
|
||||
Nodes (38): DbInboundOutbound, DbUserContext, InboundOutboundRead, Session, str, CreateLinkForPlanPayload, _apply_inventory_product_update(), _apply_inventory_update() (+30 more)
|
||||
Nodes (36): DbInboundOutbound, DbUserContext, Session, str, CreateLinkForPlanPayload, _apply_inventory_product_update(), _apply_inventory_update(), _base_query() (+28 more)
|
||||
|
||||
### Community 45 - "Community 45"
|
||||
Cohesion: 0.36
|
||||
Nodes (15): create_leave(), delete_leave(), get_leave(), _leave_local_callback(), leave_workflow_callback(), list_leaves(), submit_leave(), update_leave() (+7 more)
|
||||
|
||||
### Community 46 - "Community 46"
|
||||
Cohesion: 0.19
|
||||
Nodes (18): str, Any, bool, Session, str, CRM 模块 Excel 导出列定义(字段与字典类型对齐 Java *Vo @ExcelDictFormat)。, _yes_no(), _build_workbook() (+10 more)
|
||||
Cohesion: 0.15
|
||||
Nodes (22): clue_import_template(), customer_import_template(), product_import_template(), str, Any, bool, Session, str (+14 more)
|
||||
|
||||
### Community 47 - "Community 47"
|
||||
Cohesion: 0.10
|
||||
Nodes (21): Java: createNewVersion — 返回新报价单 id, Java: CrmQuoteServiceImpl.withdrawApproval(校验创建人), Java: CrmQuoteServiceImpl.withdrawApproval(校验创建人), Java: CrmQuoteServiceImpl.withdrawApproval(校验创建人), Java: CrmQuoteServiceImpl.withdrawApproval(校验创建人), Java: CrmQuoteServiceImpl.withdrawApproval(校验创建人), Java: CrmQuoteServiceImpl.withdrawApproval(校验创建人), Java: statisticsOverview (+13 more)
|
||||
Cohesion: 0.05
|
||||
Nodes (82): CRM 合同 API 路由 — GET/PUT/DELETE/POST 对齐原 Java CRM, register_contract_routes(), bool, bool, 运营端角色守卫:admin / super_admin 可访问。, require_admin_or_super_admin(), batch_assign_owner(), batch_submit_approval() (+74 more)
|
||||
|
||||
### Community 48 - "Community 48"
|
||||
Cohesion: 0.35
|
||||
Nodes (9): bool, BxUserContext, BxWorkflowNode, Session, str, 按业务类型获取工作流;已知类型不存在时自动创建空定义(无节点)。, 按业务类型获取工作流;已知类型不存在时自动创建空定义(无节点)。, WorkflowService (+1 more)
|
||||
Cohesion: 0.39
|
||||
Nodes (8): bool, BxUserContext, Session, str, 按业务类型获取工作流;已知类型不存在时自动创建空定义(无节点)。, 按业务类型获取工作流;已知类型不存在时自动创建空定义(无节点)。, WorkflowService, BxWorkflowDef
|
||||
|
||||
### Community 49 - "Community 49"
|
||||
Cohesion: 0.31
|
||||
Nodes (20): Any, bool, CrmOpportunity, datetime, int, Session, str, create_opportunity_follow() (+12 more)
|
||||
Cohesion: 0.30
|
||||
Nodes (21): Any, bool, CrmOpportunity, datetime, int, Session, str, ensure_crm_create_by_row_in_scope() (+13 more)
|
||||
|
||||
### Community 50 - "Community 50"
|
||||
Cohesion: 0.11
|
||||
Nodes (32): CRM 报价单 API 路由 — 挂接到 crm.router, CRM 报价单 Pydantic Schemas, QuoteAcceptBody, QuoteApprovalApproveBody, QuoteApprovalListBody, QuoteApprovalRefreshNamesBody, QuoteApprovalWithdrawBody, QuoteCreateBody (+24 more)
|
||||
Cohesion: 0.12
|
||||
Nodes (31): CRM 报价单 API 路由 — 挂接到 crm.router, CRM 报价单 Pydantic Schemas, QuoteAcceptBody, QuoteApprovalApproveBody, QuoteApprovalListBody, QuoteApprovalRefreshNamesBody, QuoteApprovalWithdrawBody, QuoteCreateBody (+23 more)
|
||||
|
||||
### Community 51 - "Community 51"
|
||||
Cohesion: 0.07
|
||||
Nodes (46): CRM 合同 API 路由 — GET/PUT/DELETE/POST 对齐原 Java CRM, CRM 合同 Pydantic Schemas — 对照 CrmContractBo / CrmContractVo, ContractApprovalActionBody, ContractApprovalApproveBody, ContractApprovalByContractBody, ContractApprovalExportBody, ContractApprovalListBody, ContractApprovalListQuery (+38 more)
|
||||
Nodes (55): int, PlTransport, Session, str, UploadFile, Any, Session, str (+47 more)
|
||||
|
||||
### Community 52 - "Community 52"
|
||||
Cohesion: 0.10
|
||||
Nodes (61): CrmContract, Query, Any, bool, CrmContractProductPriceTier, date, Decimal, int (+53 more)
|
||||
Nodes (63): CrmContract, Query, Any, bool, CrmContractProductPriceTier, date, Decimal, int (+55 more)
|
||||
|
||||
### Community 53 - "Community 53"
|
||||
Cohesion: 0.24
|
||||
@@ -405,8 +403,8 @@ Cohesion: 0.22
|
||||
Nodes (17): Any, bool, Session, str, list_share_logs(), _parse_user_agent(), CRM 报价单分享访问日志 CRUD — 对照 CrmQuoteShareLogServiceImpl.java, Java: statisticsVisits (+9 more)
|
||||
|
||||
### Community 55 - "Community 55"
|
||||
Cohesion: 0.04
|
||||
Nodes (111): Any, bool, CRM 产品模块 CRUD(产品分类 + 产品 + 附件), int, Session, str, SysOss, int (+103 more)
|
||||
Cohesion: 0.20
|
||||
Nodes (30): Any, bool, CRM 产品模块 CRUD(产品分类 + 产品 + 附件), int, Session, str, barcode_exists(), category_code_exists() (+22 more)
|
||||
|
||||
### Community 56 - "Community 56"
|
||||
Cohesion: 0.26
|
||||
@@ -425,40 +423,40 @@ Cohesion: 0.25
|
||||
Nodes (23): Any, bool, int, Session, str, create_role(), get_role(), get_role_data_scope() (+15 more)
|
||||
|
||||
### Community 60 - "Community 60"
|
||||
Cohesion: 0.18
|
||||
Nodes (11): generate_contract_no(), Java: generateContractNo — {供方编码}/X-JT + yyyyMMdd + 3位流水, Java: generateContractNo — {供方编码}/X-JT + yyyyMMdd + 3位流水, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号}, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号}, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号}, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号}, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号} (+3 more)
|
||||
Cohesion: 0.28
|
||||
Nodes (18): Any, int, Session, str, _build_tree(), _cascade_soft_delete(), _collect_with_ancestors(), create_dept() (+10 more)
|
||||
|
||||
### Community 61 - "Community 61"
|
||||
Cohesion: 0.12
|
||||
Nodes (56): DbInboundOutbound, DbVehicle, InboundOutboundRead, VehicleRead, bool, datetime, DbWeighingSlip, Session (+48 more)
|
||||
Nodes (46): Session, str, bool, date, DbInboundOutbound, DbPurchasePlan, float, PlPlan (+38 more)
|
||||
|
||||
### Community 62 - "Community 62"
|
||||
Cohesion: 0.12
|
||||
Nodes (45): bool, DbInboundOutbound, int, PublicInventoryFeedback, PublicInventoryPageRead, Session, str, UploadFile (+37 more)
|
||||
|
||||
### Community 63 - "Community 63"
|
||||
Cohesion: 0.20
|
||||
Nodes (46): AdvanceApplyCreate, AdvanceApplyOut, AdvanceApplyUpdate, AdvanceApprovalCreate, BxUserContext, int, Session, str (+38 more)
|
||||
Cohesion: 0.09
|
||||
Nodes (22): generate_auto_product_no(), Java: generateAutoProductNo — SXWL + 8位随机大写字符, Java: generateAutoProductNo — SXWL + 8位随机大写字符, Java: resolveProductIdForQuoteItem(CrmProduct 无 tax_rate,跳过税率匹配), Java: resolveProductIdForQuoteItem(CrmProduct 无 tax_rate,跳过税率匹配), Java: generateAutoProductNo — SXWL + 8位随机大写字符, Java: generateAutoProductNo — SXWL + 8位随机大写字符, Java: generateAutoProductNo — SXWL + 8位随机大写字符 (+14 more)
|
||||
|
||||
### Community 64 - "Community 64"
|
||||
Cohesion: 0.11
|
||||
Nodes (18): export_contracts(), ORM → camelCase(单点真相), ORM → camelCase(单点真相), ORM → camelCase(单点真相), ORM → camelCase(单点真相), ORM → camelCase(单点真相), Java: queryList for export, Java: queryList for export (+10 more)
|
||||
Cohesion: 0.27
|
||||
Nodes (11): Any, bool, str, decrypt_login_payload(), ensure_initialized(), extract_login_credentials(), get_public_pem(), 登录凭据 RSA 解密(与前端 JSEncrypt PKCS#1 v1.5 兼容)。 (+3 more)
|
||||
|
||||
### Community 65 - "Community 65"
|
||||
Cohesion: 0.12
|
||||
Nodes (17): create_new_version(), Java: toContract — 返回 contractId, Java: createNewVersion — 返回新报价单 id, Java: toContract — 返回 contractId, Java: createNewVersion — 返回新报价单 id, Java: toContract — 返回 contractId, Java: createNewVersion — 返回新报价单 id, Java: createNewVersion — 返回新报价单 id (+9 more)
|
||||
Cohesion: 0.33
|
||||
Nodes (10): Any, int, Session, str, list_ethnics(), 民族码表 CRUD(全局 sys_ethnic), _row_to_dict(), 民族码表 sys_ethnic(国标 GB/T 3304,全局) (+2 more)
|
||||
|
||||
### Community 66 - "Community 66"
|
||||
Cohesion: 0.34
|
||||
Nodes (16): Any, bool, int, Session, str, create_dict_type(), dict_type_code_exists(), get_dict_type() (+8 more)
|
||||
Cohesion: 0.14
|
||||
Nodes (14): 删除供方 — Java: CrmSupplierInfoController.remove, 删除供方 — Java: CrmSupplierInfoController.remove, 删除供方 — Java: CrmSupplierInfoController.remove, 删除供方 — Java: CrmSupplierInfoController.remove, 删除供方 — Java: CrmSupplierInfoController.remove, 删除供方 — Java: CrmSupplierInfoController.remove, 删除供方 — Java: CrmSupplierInfoController.remove, 删除供方 — Java: CrmSupplierInfoController.remove (+6 more)
|
||||
|
||||
### Community 67 - "Community 67"
|
||||
Cohesion: 0.18
|
||||
Nodes (11): float, int, str, 发送订单状态通知 Args: openid: 用户openid order_n, 发送支付成功通知 Args: openid: 用户openid order_n, 发送配送通知 Args: openid: 配送员openid task_no:, 发送配送时效预警 Args: openid: 配送员openid task_n, 发送退款结果通知 Args: openid: 用户openid order_n (+3 more)
|
||||
Cohesion: 0.16
|
||||
Nodes (33): Any, bool, int, Session, str, Any, Session, str (+25 more)
|
||||
|
||||
### Community 68 - "Community 68"
|
||||
Cohesion: 0.11
|
||||
Nodes (35): BxUserContext, Session, str, Any, str, Any, bool, int (+27 more)
|
||||
Cohesion: 0.25
|
||||
Nodes (11): check_customer_protect_time(), _execute_single_rule(), _get_all_tenant_nos(), pool_recovery_job(), 公海池自动回收任务(由 APScheduler 调度) 遍历所有租户的启用规则,执行自动回收。, 每天凌晨1点:检查保护期到期客户,跟进次数不足则退回公海, 每天早上9点:保护期到期提醒(3天内到期且跟进不足), remind_customer_recycle() (+3 more)
|
||||
|
||||
### Community 69 - "Community 69"
|
||||
Cohesion: 0.28
|
||||
@@ -469,8 +467,8 @@ Cohesion: 0.29
|
||||
Nodes (14): is_valid_dict_type(), load_portal_baseline(), load_sx(), load_zkxw(), main(), map_tag_type(), normalize_row(), parse_insert() (+6 more)
|
||||
|
||||
### Community 71 - "Community 71"
|
||||
Cohesion: 0.41
|
||||
Nodes (13): BxUserContext, Session, str, UploadFile, bind_biz(), delete_attachment(), download_file(), list_by_biz() (+5 more)
|
||||
Cohesion: 0.08
|
||||
Nodes (51): BxUserContext, Session, str, Any, str, bool, BxUserContext, int (+43 more)
|
||||
|
||||
### Community 72 - "Community 72"
|
||||
Cohesion: 0.34
|
||||
@@ -478,39 +476,39 @@ Nodes (19): check_python(), create_venv(), ensure_dirs(), ensure_valid_venv(), e
|
||||
|
||||
### Community 73 - "Community 73"
|
||||
Cohesion: 0.07
|
||||
Nodes (98): attachment_download_url(), AttachmentDownloadUrlBody, create_dept(), create_dict_data(), create_dict_type(), create_menu(), create_post(), create_role_management() (+90 more)
|
||||
Nodes (100): attachment_download_url(), attachment_preview_url(), AttachmentDownloadUrlBody, create_dept(), create_dict_data(), create_dict_type(), create_menu(), create_post() (+92 more)
|
||||
|
||||
### Community 74 - "Community 74"
|
||||
Cohesion: 0.15
|
||||
Nodes (30): Any, bool, int, Session, str, approve_quote(), can_user_approve(), create_approval_records() (+22 more)
|
||||
Cohesion: 0.08
|
||||
Nodes (26): 分页查询供方列表 — Java: CrmSupplierInfoController.list, 分页查询供方列表 — Java: CrmSupplierInfoController.list, 分页查询供方列表 — Java: CrmSupplierInfoController.list, 分页查询供方列表 — Java: CrmSupplierInfoController.list, 分页查询供方列表 — Java: CrmSupplierInfoController.list, 分页查询供方列表 — Java: CrmSupplierInfoController.list, 分页查询供方列表 — Java: CrmSupplierInfoController.list, 分页查询供方列表 — Java: CrmSupplierInfoController.list (+18 more)
|
||||
|
||||
### Community 75 - "Community 75"
|
||||
Cohesion: 0.06
|
||||
Nodes (101): bool, Decimal, int, PlanCreateFull, PlPlan, PlPlanProduct, PlTransport, PlVehicle (+93 more)
|
||||
Cohesion: 0.05
|
||||
Nodes (124): bool, Decimal, int, PlanCreateFull, PlPlan, PlPlanProduct, PlTransport, PlVehicle (+116 more)
|
||||
|
||||
### Community 76 - "Community 76"
|
||||
Cohesion: 0.18
|
||||
Nodes (10): Any, Request, str, str, parse_admin_request_json(), 运营 Web(/web/admin)JSON 请求体解析。 与 ApiCryptoMiddleware 配合:中间件未改写 body 时,在路由内解密 `{, 读取 JSON body;dict 时走 resolve_request_payload(明文 / 密文 / data 包装)。 Returns:, 统一解析接口请求载荷(明文 / 密文信封)。 (+2 more)
|
||||
|
||||
### Community 77 - "Community 77"
|
||||
Cohesion: 0.33
|
||||
Nodes (5): _auto_fill_create_dept_id(), get_db(), ORM before_insert 钩子:当 create_dept_id 为空时,自动从请求上下文填充当前用户部门 ID, ORM before_insert 钩子:当 create_dept_id 为空时,自动从请求上下文填充当前用户部门 ID, ORM before_insert 钩子:当 create_dept_id 为空时,自动从请求上下文填充当前用户部门 ID
|
||||
Cohesion: 0.34
|
||||
Nodes (23): DbUserContext, DbWeighingSlip, Session, str, weighing_to_read(), apply_product_snapshot_to_weighing(), _apply_weighing_product_update(), _apply_weighing_update() (+15 more)
|
||||
|
||||
### Community 78 - "Community 78"
|
||||
Cohesion: 0.16
|
||||
Nodes (16): bool, date, Session, str, get_last_month_range(), month_range(), 地磅计划按月自动生成 — 迁移自 simple-dibang-xiaoshou/auto-create-plan/auto_create_monthly_pla, 按月自动生成采购计划。 - 默认仅在每月 1 日执行(force=True 时跳过该限制,供手动触发验收) - 遍历所有租户,按上月计划模板生 (+8 more)
|
||||
Cohesion: 0.13
|
||||
Nodes (20): bool, date, Session, str, get_last_month_range(), month_range(), 地磅计划按月自动生成 — 迁移自 simple-dibang-xiaoshou/auto-create-plan/auto_create_monthly_pla, 按月自动生成采购计划。 - 默认仅在每月 1 日执行(force=True 时跳过该限制,供手动触发验收) - 遍历所有租户,按上月计划模板生 (+12 more)
|
||||
|
||||
### Community 79 - "Community 79"
|
||||
Cohesion: 0.36
|
||||
Nodes (10): add_scope_before_order(), ensure_import(), patch_base_data(), patch_get_helper(), patch_inventory(), patch_plan(), patch_transport(), str (+2 more)
|
||||
|
||||
### Community 80 - "Community 80"
|
||||
Cohesion: 0.06
|
||||
Nodes (32): BaseModel, AdvanceApplyOut, AdvanceApprovalCreate, AttachmentOut, ReimburseApplyCreate, ReimburseApplyUpdate, ReimburseApprovalCreate, Config (+24 more)
|
||||
Cohesion: 0.05
|
||||
Nodes (62): str, CRM 合同 Pydantic Schemas — 对照 CrmContractBo / CrmContractVo, ContractApprovalActionBody, ContractApprovalApproveBody, ContractApprovalByContractBody, ContractApprovalExportBody, ContractApprovalListBody, ContractApprovalListQuery (+54 more)
|
||||
|
||||
### Community 81 - "Community 81"
|
||||
Cohesion: 0.38
|
||||
Nodes (15): Any, bool, int, Session, str, create_post(), get_post(), list_posts() (+7 more)
|
||||
Cohesion: 0.25
|
||||
Nodes (8): generate_template_no(), Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}, Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}, Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}, Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}, Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}, Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}, Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}
|
||||
|
||||
### Community 82 - "Community 82"
|
||||
Cohesion: 0.29
|
||||
@@ -521,68 +519,68 @@ Cohesion: 0.18
|
||||
Nodes (9): 报销(bx)API 路由聚合 — REST 风格,协议对齐 bx 原系统。, 报销(bx)Pydantic 模型 — 响应协议与 bx 原系统保持一致, bx_health(), 报销(bx)API 路由聚合 — REST 风格,协议对齐 bx 原系统。, P0 健康检查:验证 bx 路由已挂载且响应协议为 code=0。, P0 健康检查:验证 bx 路由已挂载且响应协议为 code=0。, P0 健康检查:验证 bx 路由已挂载且响应协议为 code=0。, P0 健康检查:验证 bx 路由已挂载且响应协议为 code=0。 (+1 more)
|
||||
|
||||
### Community 84 - "Community 84"
|
||||
Cohesion: 0.25
|
||||
Nodes (8): generate_template_no(), Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}, Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}, Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}, Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}, Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}, Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}, Java: generateTemplateNo — TMPL{yyyyMMdd}{4位序号}
|
||||
Cohesion: 0.41
|
||||
Nodes (11): Any, str, build_quote_html(), _default_value(), _format_date(), _format_discount(), _format_money(), generate_quote_pdf() (+3 more)
|
||||
|
||||
### Community 85 - "Community 85"
|
||||
Cohesion: 0.17
|
||||
Nodes (49): bool, DbPurchasePlan, DbUserContext, PurchasePlanRead, PurchasePlanWithFillLink, Session, str, DbPurchasePlan (+41 more)
|
||||
Cohesion: 0.26
|
||||
Nodes (49): InboundOutboundRead, bool, DbPurchasePlan, DbUserContext, PurchasePlanRead, PurchasePlanWithFillLink, Session, str (+41 more)
|
||||
|
||||
### Community 86 - "Community 86"
|
||||
Cohesion: 0.05
|
||||
Nodes (140): register_contract_routes(), CRM 合同子模块路由 — 变更/模板/审批独立页, register_contract_sub_routes(), Any, bool, CRM 合同 CRUD — 对照 CrmContractServiceImpl.java(列表/详情 P1), Decimal, int (+132 more)
|
||||
Cohesion: 0.18
|
||||
Nodes (11): float, int, str, 发送订单状态通知 Args: openid: 用户openid order_n, 发送支付成功通知 Args: openid: 用户openid order_n, 发送配送通知 Args: openid: 配送员openid task_no:, 发送配送时效预警 Args: openid: 配送员openid task_n, 发送退款结果通知 Args: openid: 用户openid order_n (+3 more)
|
||||
|
||||
### Community 87 - "Community 87"
|
||||
Cohesion: 0.31
|
||||
Nodes (26): DbUserContext, DbWeighingSlip, Session, str, WeighingSlipRead, DbWeighingSlip, WeighingSlipRead, weighing_to_read() (+18 more)
|
||||
Cohesion: 0.22
|
||||
Nodes (12): Any, bool, str, WfProcessInstance, _LocalCallbackFn, _dispatch_local(), 工作流回调服务 —— 流程状态变更时通知业务系统, 注册本地回调函数。当 callback_url 以 path 开头时直接调用 fn。 (+4 more)
|
||||
|
||||
### Community 88 - "Community 88"
|
||||
Cohesion: 0.29
|
||||
Nodes (16): Any, int, Session, str, BizLeaveRequest, create_leave(), get_leave(), list_leaves() (+8 more)
|
||||
Cohesion: 0.18
|
||||
Nodes (11): generate_contract_no(), Java: generateContractNo — {供方编码}/X-JT + yyyyMMdd + 3位流水, Java: generateContractNo — {供方编码}/X-JT + yyyyMMdd + 3位流水, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号}, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号}, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号}, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号}, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号} (+3 more)
|
||||
|
||||
### Community 89 - "Community 89"
|
||||
Cohesion: 0.18
|
||||
Nodes (19): bytes, int, str, download_file_bytes(), file_stream(), get_access_url(), get_download_url(), get_preview_url() (+11 more)
|
||||
Cohesion: 0.14
|
||||
Nodes (14): _build_category_tree(), _collect_category_with_ancestors(), list_category_tree(), 获取产品分类树(嵌套 children,供树形表格/树选择器使用), 获取产品分类树(嵌套 children,供树形表格/树选择器使用), 获取产品分类树(嵌套 children,供树形表格/树选择器使用), 按 parentId 将扁平分类列表组装为嵌套树, 获取产品分类树(嵌套 children,供树形表格/树选择器使用) (+6 more)
|
||||
|
||||
### Community 90 - "Community 90"
|
||||
Cohesion: 0.06
|
||||
Nodes (60): Any, bool, bytes, int, Request, str, Any, int (+52 more)
|
||||
Cohesion: 0.22
|
||||
Nodes (18): Any, bool, bytes, int, Request, str, _claims_from_auth(), _format_body_bytes() (+10 more)
|
||||
|
||||
### Community 91 - "Community 91"
|
||||
Cohesion: 0.32
|
||||
Nodes (7): str, eq_unicode(), like_unicode(), MySQL 字符串比较/模糊匹配时统一排序规则,避免 Illegal mix of collations。, 跨表字符串等值比较(JOIN / WHERE)时统一为 utf8mb4_unicode_ci。, 将列显式设为 utf8mb4_unicode_ci。, unicode_ci()
|
||||
|
||||
### Community 92 - "Community 92"
|
||||
Cohesion: 0.20
|
||||
Nodes (10): create_from_quote(), _quote_products_to_contract_products(), Java: createFromQuote — 返回合同 id, Java: createFromQuote — 返回合同 id, Java: createFromQuote — 返回合同 id, Java: createFromQuote — 返回合同 id, Java: createFromQuote — 返回合同 id, Java: createFromQuote — 返回合同 id (+2 more)
|
||||
Cohesion: 0.34
|
||||
Nodes (16): Any, bool, int, Session, str, create_dict_type(), dict_type_code_exists(), get_dict_type() (+8 more)
|
||||
|
||||
### Community 93 - "Community 93"
|
||||
Cohesion: 0.28
|
||||
Nodes (13): int, Session, str, _allocate_inbound_outbound_id(), _ensure_sequence_row(), max_numeric_inbound_outbound_id(), next_inbound_outbound_id(), 出入库单 id 生成 — 租户内纯数字自增,并发安全。 (+5 more)
|
||||
Cohesion: 0.15
|
||||
Nodes (22): int, Session, str, bool, datetime, DbWeighingSlip, Session, str (+14 more)
|
||||
|
||||
### Community 94 - "Community 94"
|
||||
Cohesion: 0.18
|
||||
Nodes (11): generate_contract_name(), Java: generateContractName, Java: generateContractName, Java: generateContractName, Java: generateContractName, Java: generateContractName, Java: generateContractName, Java: generateContractName (+3 more)
|
||||
|
||||
### Community 95 - "Community 95"
|
||||
Cohesion: 0.22
|
||||
Nodes (15): bool, BxUserContext, int, Session, str, Session, str, AttachmentService (+7 more)
|
||||
Cohesion: 0.29
|
||||
Nodes (16): Any, int, Session, str, BizLeaveRequest, create_leave(), get_leave(), list_leaves() (+8 more)
|
||||
|
||||
### Community 96 - "Community 96"
|
||||
Cohesion: 0.38
|
||||
Nodes (15): Any, bool, int, Session, str, create_site(), get_site(), list_sites() (+7 more)
|
||||
Cohesion: 0.34
|
||||
Nodes (16): Any, bool, int, Session, str, create_tenant(), get_tenant(), list_tenants() (+8 more)
|
||||
|
||||
### Community 97 - "Community 97"
|
||||
Cohesion: 0.33
|
||||
Nodes (10): Any, int, Session, str, list_ethnics(), 民族码表 CRUD(全局 sys_ethnic), _row_to_dict(), 民族码表 sys_ethnic(国标 GB/T 3304,全局) (+2 more)
|
||||
Cohesion: 0.24
|
||||
Nodes (27): Any, bool, CRM 公海池规则 CRUD + 规则执行逻辑, int, Session, str, create_pool_rule(), create_rule() (+19 more)
|
||||
|
||||
### Community 98 - "Community 98"
|
||||
Cohesion: 0.26
|
||||
Nodes (10): Any, bool, str, WfNode, WfProcessInstance, 流程连线/转移 wf_transition, 流程连线/转移 wf_transition, WfTransition (+2 more)
|
||||
Cohesion: 0.38
|
||||
Nodes (15): Any, bool, int, Session, str, create_post(), get_post(), list_posts() (+7 more)
|
||||
|
||||
### Community 99 - "Community 99"
|
||||
Cohesion: 0.33
|
||||
Nodes (3): 地磅 API 路由聚合 — REST 风格,协议对齐原 simple-dibang-xiaoshou。, 地磅(db)Pydantic schemas — 对齐原 simple-dibang-xiaoshou 契约。, 地磅 API 路由聚合 — REST 风格,协议对齐原 simple-dibang-xiaoshou。
|
||||
Cohesion: 0.21
|
||||
Nodes (9): API 路由包 — 山峡化工生产一体化门户, get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,14 个一级菜单), operlog_detail(), operlog_list(), 操作日志分页列表(基于 API 请求日志适配 RuoYi OperLog 结构), 操作日志分页列表(基于 API 请求日志适配 RuoYi OperLog 结构), _user_info() (+1 more)
|
||||
|
||||
### Community 100 - "Community 100"
|
||||
Cohesion: 0.45
|
||||
@@ -597,88 +595,88 @@ Cohesion: 0.60
|
||||
Nodes (10): Any, Session, str, _apply_create_range(), _base_query(), get_clue_level_statistics(), get_clue_overview_statistics(), get_clue_owner_statistics() (+2 more)
|
||||
|
||||
### Community 103 - "Community 103"
|
||||
Cohesion: 0.09
|
||||
Nodes (147): date, DbUserContext, int, PlanCreateFull, PlPlan, Session, str, bool (+139 more)
|
||||
Cohesion: 0.08
|
||||
Nodes (158): date, DbUserContext, int, PlanCreateFull, PlPlan, Session, str, bool (+150 more)
|
||||
|
||||
### Community 104 - "Community 104"
|
||||
Cohesion: 0.13
|
||||
Nodes (37): bool, Redis, Request, str, _T, bool, Redis, extend_session() (+29 more)
|
||||
Nodes (38): bool, Redis, Request, str, _T, bool, Redis, decode_token() (+30 more)
|
||||
|
||||
### Community 105 - "Community 105"
|
||||
Cohesion: 0.38
|
||||
Nodes (15): Any, bool, int, Session, str, create_site(), get_site(), list_sites() (+7 more)
|
||||
|
||||
### Community 106 - "Community 106"
|
||||
Cohesion: 0.13
|
||||
Nodes (15): patch_plan_product_certs(), 更新计划危化品产品购买证/运输证(不触发安排运输), 更新计划危化品产品购买证/运输证(不触发安排运输), 更新计划危化品产品购买证/运输证(不触发安排运输), 更新计划危化品产品购买证/运输证(不触发安排运输), 更新计划危化品产品购买证/运输证(不触发安排运输), 更新计划危化品产品购买证/运输证(不触发安排运输), 更新计划危化品产品购买证/运输证(不触发安排运输) (+7 more)
|
||||
|
||||
### Community 107 - "Community 107"
|
||||
Cohesion: 0.22
|
||||
Nodes (9): create_from_opportunity(), _opportunity_products_to_contract_products(), Java: createFromOpportunity — 返回合同 id, Java: createFromOpportunity — 返回合同 id, Java: createFromOpportunity — 返回合同 id, Java: createFromOpportunity — 返回合同 id, Java: createFromOpportunity — 返回合同 id, Java: createFromOpportunity — 返回合同 id (+1 more)
|
||||
|
||||
### Community 106 - "Community 106"
|
||||
Cohesion: 0.28
|
||||
Nodes (18): Any, int, Session, str, _build_tree(), _cascade_soft_delete(), _collect_with_ancestors(), create_dept() (+10 more)
|
||||
|
||||
### Community 107 - "Community 107"
|
||||
Cohesion: 0.34
|
||||
Nodes (16): Any, bool, int, Session, str, create_tenant(), get_tenant(), list_tenants() (+8 more)
|
||||
|
||||
### Community 108 - "Community 108"
|
||||
Cohesion: 0.18
|
||||
Nodes (11): Java: statisticsStatus, Java: statisticsStatus, Java: statisticsStatus, Java: statisticsStatus, Java: statisticsStatus, Java: statisticsStatus, Java: statisticsStatus, Java: statisticsStatus (+3 more)
|
||||
Cohesion: 0.44
|
||||
Nodes (8): bool, int, Session, str, ApiRequestLogCRUD, SysApiRequestLog, SysApiRequestLogHis, SysApiRequestLog
|
||||
|
||||
### Community 109 - "Community 109"
|
||||
Cohesion: 0.27
|
||||
Nodes (11): Any, bool, str, decrypt_login_payload(), ensure_initialized(), extract_login_credentials(), get_public_pem(), 登录凭据 RSA 解密(与前端 JSEncrypt PKCS#1 v1.5 兼容)。 (+3 more)
|
||||
Cohesion: 0.22
|
||||
Nodes (9): Java: renewContract — 基础续签, Java: renewContract — 基础续签, Java: renewContract — 基础续签, Java: renewContract — 基础续签, Java: renewContract — 基础续签, Java: renewContract — 基础续签, Java: renewContract — 基础续签, Java: renewContract — 基础续签 (+1 more)
|
||||
|
||||
### Community 111 - "Community 111"
|
||||
Cohesion: 0.14
|
||||
Nodes (14): Session, Any, Session, str, get_current_user(), get_current_user_by_token(), 根据 token 获取当前用户(包含 Redis 会话校验;会话滑动续期), 根据 token 获取当前用户(包含 Redis 会话校验;会话滑动续期) (+6 more)
|
||||
Cohesion: 0.07
|
||||
Nodes (27): Session, Any, Session, str, Session, str, get_current_user(), get_current_user_by_token() (+19 more)
|
||||
|
||||
### Community 112 - "Community 112"
|
||||
Cohesion: 0.14
|
||||
Nodes (19): Session, str, Session, str, get_user_menu_codes(), 菜单 code 权限守卫(V0.3:通过 sys_user_role → sys_role_menu → sys_menu.perms), 读取用户授权的菜单权限标识集合(与前端 meta.menuCode / perms 对齐)。, 接口菜单权限守卫。super_admin 直接放行。 (+11 more)
|
||||
Cohesion: 0.17
|
||||
Nodes (12): generate_product_no(), 生成产品编号(格式:CP + yyyyMMdd + 3位序号,如 CP20260530001), 生成产品编号(格式:CP + yyyyMMdd + 3位序号,如 CP20260530001), 生成产品编号(格式:CP + yyyyMMdd + 3位序号,如 CP20260530001), 生成产品编号(格式:CP + yyyyMMdd + 3位序号,如 CP20260530001), 生成产品编号(格式:CP + yyyyMMdd + 3位序号,如 CP20260530001), 生成产品编号(格式:CP + yyyyMMdd + 3位序号,如 CP20260530001), 生成产品编号(格式:CP + yyyyMMdd + 3位序号,如 CP20260530001) (+4 more)
|
||||
|
||||
### Community 122 - "Community 122"
|
||||
Cohesion: 0.30
|
||||
Nodes (14): Any, bool, bytes, int, str, bytes, ApiCryptoError, _b64url_decode() (+6 more)
|
||||
Cohesion: 0.40
|
||||
Nodes (10): SysOss, int, Session, str, SysOss, create_oss(), create_oss(), get_oss_by_url() (+2 more)
|
||||
|
||||
### Community 123 - "Community 123"
|
||||
Cohesion: 0.41
|
||||
Nodes (11): Any, str, build_quote_html(), _default_value(), _format_date(), _format_discount(), _format_money(), generate_quote_pdf() (+3 more)
|
||||
Cohesion: 0.33
|
||||
Nodes (8): Decimal, str, derive_legacy_status_from_three(), derive_three_status_from_legacy(), 阶段A兼容:从旧 status 推导三字段。 约束:旧 status 本身混合了支付/配送/订单生命周期,因此只能尽力推断; 若业务侧已有更精确, 阶段A兼容:从三字段反推旧 status(用于旧前端/旧筛选参数兼容)。, ThreeStatus, _to_decimal()
|
||||
|
||||
### Community 124 - "Community 124"
|
||||
Cohesion: 0.28
|
||||
Nodes (8): date, datetime, str, _date_to_str(), _dt_to_str(), PagedQuery, PagedResponse, bx 原系统 API 响应包装(code=0 / msg / data.rows),与门户 success_response 分离。
|
||||
|
||||
### Community 125 - "Community 125"
|
||||
Cohesion: 0.40
|
||||
Nodes (5): bool, str, get_password_hash(), 验证密码(哈希非 bcrypt 或损坏时返回 False,避免抛错), verify_password()
|
||||
Cohesion: 0.23
|
||||
Nodes (10): Any, bool, int, Session, str, camel_to_snake(), CRUDBase, get_model_attr() (+2 more)
|
||||
|
||||
### Community 126 - "Community 126"
|
||||
Cohesion: 0.10
|
||||
Nodes (24): Session, str, TransportInventoryLinkRead, PlTransportSiteLink, Session, str, TransportSiteLinkRead, _build_driver_url() (+16 more)
|
||||
Cohesion: 0.22
|
||||
Nodes (9): _category_row_to_dict(), list_categories(), 分类 ORM 对象转 dict(camelCase 键名), 分类 ORM 对象转 dict(camelCase 键名), 分类 ORM 对象转 dict(camelCase 键名), 分类 ORM 对象转 dict(camelCase 键名), 获取分类(扁平列表,支持名称模糊与状态筛选), 获取分类(扁平列表,支持名称模糊与状态筛选) (+1 more)
|
||||
|
||||
### Community 127 - "Community 127"
|
||||
Cohesion: 0.29
|
||||
Nodes (10): datetime, int, Session, str, BizNoKind, allocate_next_biz_no(), _format_biz_no(), _prefix_for() (+2 more)
|
||||
|
||||
### Community 128 - "Community 128"
|
||||
Cohesion: 0.11
|
||||
Nodes (22): Any, _fill_contract_linked_count(), list_quotes(), quote_row_to_dict(), ORM → camelCase(单点真相), ORM → camelCase(单点真相), ORM → camelCase(单点真相), ORM → camelCase(单点真相) (+14 more)
|
||||
Cohesion: 0.20
|
||||
Nodes (10): create_from_quote(), _quote_products_to_contract_products(), Java: createFromQuote — 返回合同 id, Java: createFromQuote — 返回合同 id, Java: createFromQuote — 返回合同 id, Java: createFromQuote — 返回合同 id, Java: createFromQuote — 返回合同 id, Java: createFromQuote — 返回合同 id (+2 more)
|
||||
|
||||
### Community 129 - "Community 129"
|
||||
Cohesion: 0.40
|
||||
Nodes (3): AdvanceApplyCreate, AdvanceApplyUpdate, _coerce_optional_id()
|
||||
Cohesion: 0.22
|
||||
Nodes (9): generate_barcode(), 生成唯一条码(纯数字:yyyyMMdd + 6位序号,如 20260606000001), 生成唯一条码(纯数字:yyyyMMdd + 6位序号,如 20260606000001), 生成唯一条码(纯数字:yyyyMMdd + 6位序号,如 20260606000001), 生成唯一条码(纯数字:yyyyMMdd + 6位序号,如 20260606000001), 生成唯一条码(纯数字:yyyyMMdd + 6位序号,如 20260606000001), 生成唯一条码(纯数字:yyyyMMdd + 6位序号,如 20260606000001), 生成唯一条码(纯数字:yyyyMMdd + 6位序号,如 20260606000001) (+1 more)
|
||||
|
||||
### Community 130 - "Community 130"
|
||||
Cohesion: 0.33
|
||||
Nodes (8): Decimal, str, derive_legacy_status_from_three(), derive_three_status_from_legacy(), 阶段A兼容:从旧 status 推导三字段。 约束:旧 status 本身混合了支付/配送/订单生命周期,因此只能尽力推断; 若业务侧已有更精确, 阶段A兼容:从三字段反推旧 status(用于旧前端/旧筛选参数兼容)。, ThreeStatus, _to_decimal()
|
||||
Cohesion: 0.10
|
||||
Nodes (32): _avatar_url_field(), _build_user_info_payload(), get_current_user_profile(), get_web_auth_menu_codes(), _jwt_user_payload(), 公共接口(Web 登录、刷新 Token、登出;用户模型对齐 docs/sql/shanxia2.0.sql 基线), 获取当前用户信息(与 sys_user 字段对应)。, 获取当前用户信息(与 sys_user 字段对应)。 (+24 more)
|
||||
|
||||
### Community 131 - "Community 131"
|
||||
Cohesion: 0.10
|
||||
Nodes (35): bool, Session, str, _append_user_scope_conditions(), apply_data_scope(), assert_row_in_data_scope(), _collect_scope_ids(), _get_child_dept_ids() (+27 more)
|
||||
Cohesion: 0.11
|
||||
Nodes (33): bool, Session, str, _append_user_scope_conditions(), apply_data_scope(), assert_row_in_data_scope(), _collect_scope_ids(), _get_child_dept_ids() (+25 more)
|
||||
|
||||
### Community 132 - "Community 132"
|
||||
Cohesion: 0.09
|
||||
Nodes (34): _avatar_url_field(), _build_user_info_payload(), get_current_user_profile(), get_web_auth_menu_codes(), _jwt_user_payload(), logout(), 公共接口(Web 登录、刷新 Token、登出;用户模型对齐 docs/sql/shanxia2.0.sql 基线), 登出:吊销 Redis 会话(若已配置 REDIS_HOST)。 (+26 more)
|
||||
Cohesion: 0.40
|
||||
Nodes (5): bool, str, get_password_hash(), 验证密码(哈希非 bcrypt 或损坏时返回 False,避免抛错), verify_password()
|
||||
|
||||
### Community 133 - "Community 133"
|
||||
Cohesion: 0.33
|
||||
Nodes (5): _coerce_optional_id(), WorkflowDefCreate, WorkflowDefUpdate, WorkflowNodeCreate, WorkflowNodeOut
|
||||
Cohesion: 0.32
|
||||
Nodes (5): AdvanceApplyCreate, AdvanceApplyOut, AdvanceApplyUpdate, AdvanceApprovalCreate, _coerce_optional_id()
|
||||
|
||||
### Community 134 - "Community 134"
|
||||
Cohesion: 0.38
|
||||
@@ -689,8 +687,8 @@ Cohesion: 0.25
|
||||
Nodes (7): 1. 上传到服务器, 2. 服务器首次启动, 3. 日常运维, 4. 配置文件, 5. 与 Nginx 配合, 6. 常见问题, shanxia2.0 Backend 生产部署说明
|
||||
|
||||
### Community 136 - "Community 136"
|
||||
Cohesion: 0.18
|
||||
Nodes (13): Any, bool, str, WfProcessInstance, _LocalCallbackFn, _dispatch_local(), 工作流回调服务 —— 流程状态变更时通知业务系统, 注册本地回调函数。当 callback_url 以 path 开头时直接调用 fn。 (+5 more)
|
||||
Cohesion: 0.29
|
||||
Nodes (7): _product_row_to_dict(), 产品 ORM 对象转 dict(camelCase 键名), 产品 ORM 对象转 dict(camelCase 键名), 产品 ORM 对象转 dict(camelCase 键名), 产品 ORM 对象转 dict(camelCase 键名), 产品 ORM 对象转 dict(camelCase 键名), 产品 ORM 对象转 dict(camelCase 键名)
|
||||
|
||||
### Community 137 - "Community 137"
|
||||
Cohesion: 0.13
|
||||
@@ -701,44 +699,36 @@ Cohesion: 0.39
|
||||
Nodes (6): _inject_user_info_after_tenant(), patch_contract_routes(), patch_quote_routes(), patch_route_file(), Path, str
|
||||
|
||||
### Community 139 - "Community 139"
|
||||
Cohesion: 0.13
|
||||
Nodes (15): patch_plan_product_certs(), 更新计划危化品产品购买证/运输证(不触发安排运输), 更新计划危化品产品购买证/运输证(不触发安排运输), 更新计划危化品产品购买证/运输证(不触发安排运输), 更新计划危化品产品购买证/运输证(不触发安排运输), 更新计划危化品产品购买证/运输证(不触发安排运输), 更新计划危化品产品购买证/运输证(不触发安排运输), 更新计划危化品产品购买证/运输证(不触发安排运输) (+7 more)
|
||||
Cohesion: 0.20
|
||||
Nodes (10): 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。 (+2 more)
|
||||
|
||||
### Community 140 - "Community 140"
|
||||
Cohesion: 0.83
|
||||
Nodes (3): _add_user_info_kwarg(), patch_file(), str
|
||||
|
||||
### Community 141 - "Community 141"
|
||||
Cohesion: 0.15
|
||||
Nodes (14): datetime, _parse_optional_datetime(), _period_key(), Java: statisticsTrend, Java: statisticsTrend, Java: statisticsTrend, Java: statisticsTrend, Java: statisticsTrend (+6 more)
|
||||
Cohesion: 0.29
|
||||
Nodes (7): get_third_party_plan_page(), 三方 H5 填写页初始化数据(无需门户登录,与原系统一致)。, 三方 H5 填写页初始化数据(无需门户登录,与原系统一致)。, 三方 H5 填写页初始化数据(无需门户登录,与原系统一致)。, 三方 H5 填写页初始化数据(无需门户登录,与原系统一致)。, 三方 H5 填写页初始化数据(无需门户登录,与原系统一致)。, 三方 H5 填写页初始化数据(无需门户登录,与原系统一致)。
|
||||
|
||||
### Community 143 - "Community 143"
|
||||
Cohesion: 0.32
|
||||
Nodes (22): Any, CrmOpportunity, Decimal, int, Session, str, batch_add_opportunity_products(), _calc_subtotal() (+14 more)
|
||||
|
||||
### Community 144 - "Community 144"
|
||||
Cohesion: 0.20
|
||||
Nodes (10): cancel_plan(), 作废运输计划:取消跟进状态、作废关联地磅出入库单、取消运输单。, 作废运输计划:取消跟进状态、作废关联地磅出入库单、取消运输单。, 作废运输计划:取消跟进状态、作废关联地磅出入库单、取消运输单。, 作废运输计划:取消跟进状态、作废关联地磅出入库单、取消运输单。, 作废运输计划:取消跟进状态、作废关联地磅出入库单、取消运输单。, 作废运输计划:取消跟进状态、作废关联地磅出入库单、取消运输单。, 作废运输计划:取消跟进状态、作废关联地磅出入库单、取消运输单。 (+2 more)
|
||||
Cohesion: 0.17
|
||||
Nodes (20): Any, int, str, get_oper_log_meta(), OperLogMeta, 请求级操作日志元数据(ContextVar), 供异步落库线程使用,避免 ContextVar 跨线程丢失。, set_oper_log_meta() (+12 more)
|
||||
|
||||
### Community 145 - "Community 145"
|
||||
Cohesion: 0.20
|
||||
Nodes (10): 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。, 解析司机信息:优先 pl_personnel,兼容旧 pl_driver。 (+2 more)
|
||||
Cohesion: 0.33
|
||||
Nodes (3): 地磅 API 路由聚合 — REST 风格,协议对齐原 simple-dibang-xiaoshou。, 地磅(db)Pydantic schemas — 对齐原 simple-dibang-xiaoshou 契约。, 地磅 API 路由聚合 — REST 风格,协议对齐原 simple-dibang-xiaoshou。
|
||||
|
||||
### Community 146 - "Community 146"
|
||||
Cohesion: 0.22
|
||||
Nodes (9): Java: renewContract — 基础续签, Java: renewContract — 基础续签, Java: renewContract — 基础续签, Java: renewContract — 基础续签, Java: renewContract — 基础续签, Java: renewContract — 基础续签, Java: renewContract — 基础续签, Java: renewContract — 基础续签 (+1 more)
|
||||
Cohesion: 0.47
|
||||
Nodes (5): OperLogDetailBody, OperLogListBody, 操作日志(兼容 RuoYi OperLog 视图), OperLogDetailBody, OperLogListBody
|
||||
|
||||
### Community 147 - "Community 147"
|
||||
Cohesion: 0.31
|
||||
Nodes (8): Session, str, apply_product_snapshot_to_inventory(), apply_product_snapshot_to_plan(), ProductSnapshot, 地磅模块 — CRM 产品解析与快照写入。, 校验 CRM 产品并返回名称/规格快照。新建单据 product_id 必填。, resolve_crm_product()
|
||||
|
||||
### Community 148 - "Community 148"
|
||||
Cohesion: 0.22
|
||||
Nodes (9): batch_submit_contract_approval(), Java: batchSubmitApproval, Java: batchSubmitApproval, Java: batchSubmitApproval, Java: batchSubmitApproval, Java: batchSubmitApproval, Java: batchSubmitApproval, Java: batchSubmitApproval (+1 more)
|
||||
|
||||
### Community 149 - "Community 149"
|
||||
Cohesion: 0.25
|
||||
Nodes (8): download_contract_pdf(), Java: downloadContractPdf — 返回合同文件 URL/路径, Java: batchAssignOwner, Java: downloadContractPdf — 返回合同文件 URL/路径, Java: downloadContractPdf — 返回合同文件 URL/路径, Java: downloadContractPdf — 返回合同文件 URL/路径, Java: downloadContractPdf — 返回合同文件 URL/路径, Java: downloadContractPdf — 返回合同文件 URL/路径
|
||||
Cohesion: 0.18
|
||||
Nodes (26): Any, bool, int, Session, str, Session, str, _build_tree() (+18 more)
|
||||
|
||||
### Community 150 - "Community 150"
|
||||
Cohesion: 0.33
|
||||
@@ -752,11 +742,11 @@ Nodes (3): _coerce_id(), OffsetItem, ReimburseDetailCreate
|
||||
## Suggested Questions
|
||||
_Questions this graph is uniquely positioned to answer:_
|
||||
|
||||
- **Why does `Session` connect `Community 3` to `Community 0`, `Community 1`, `Community 2`, `Community 4`, `Community 6`, `Community 7`, `Community 8`, `Community 10`, `Community 11`, `Community 14`, `Community 15`, `Community 16`, `Community 17`, `Community 18`, `Community 19`, `Community 20`, `Community 21`, `Community 22`, `Community 23`, `Community 25`, `Community 27`, `Community 29`, `Community 33`, `Community 35`, `Community 36`, `Community 37`, `Community 38`, `Community 40`, `Community 41`, `Community 44`, `Community 45`, `Community 46`, `Community 47`, `Community 48`, `Community 49`, `Community 52`, `Community 54`, `Community 55`, `Community 56`, `Community 57`, `Community 59`, `Community 60`, `Community 61`, `Community 63`, `Community 64`, `Community 65`, `Community 66`, `Community 68`, `Community 69`, `Community 71`, `Community 73`, `Community 74`, `Community 75`, `Community 78`, `Community 80`, `Community 81`, `Community 84`, `Community 85`, `Community 86`, `Community 87`, `Community 88`, `Community 90`, `Community 92`, `Community 93`, `Community 95`, `Community 96`, `Community 97`, `Community 98`, `Community 102`, `Community 103`, `Community 105`, `Community 106`, `Community 107`, `Community 108`, `Community 111`, `Community 112`, `Community 127`, `Community 128`, `Community 131`, `Community 132`, `Community 137`, `Community 141`, `Community 143`, `Community 144`, `Community 146`, `Community 147`, `Community 148`, `Community 149`?**
|
||||
_High betweenness centrality (0.231) - this node is a cross-community bridge._
|
||||
- **Why does `BaseModel` connect `Community 9` to `Community 0`, `Community 129`, `Community 2`, `Community 133`, `Community 134`, `Community 11`, `Community 12`, `Community 15`, `Community 20`, `Community 21`, `Community 22`, `Community 23`, `Community 150`, `Community 24`, `Community 28`, `Community 30`, `Community 31`, `Community 32`, `Community 36`, `Community 44`, `Community 45`, `Community 50`, `Community 51`, `Community 62`, `Community 63`, `Community 68`, `Community 69`, `Community 73`, `Community 75`, `Community 80`, `Community 85`, `Community 87`, `Community 103`, `Community 124`, `Community 126`?**
|
||||
_High betweenness centrality (0.073) - this node is a cross-community bridge._
|
||||
- **Why does `SysUser` connect `Community 22` to `Community 128`, `Community 2`, `Community 131`, `Community 132`, `Community 5`, `Community 6`, `Community 7`, `Community 136`, `Community 3`, `Community 10`, `Community 11`, `Community 12`, `Community 141`, `Community 14`, `Community 16`, `Community 17`, `Community 19`, `Community 23`, `Community 24`, `Community 25`, `Community 27`, `Community 32`, `Community 35`, `Community 36`, `Community 38`, `Community 39`, `Community 52`, `Community 56`, `Community 69`, `Community 73`, `Community 74`, `Community 86`, `Community 98`, `Community 103`?**
|
||||
- **Why does `Session` connect `Community 3` to `Community 0`, `Community 1`, `Community 2`, `Community 4`, `Community 6`, `Community 7`, `Community 8`, `Community 9`, `Community 10`, `Community 11`, `Community 13`, `Community 14`, `Community 15`, `Community 16`, `Community 17`, `Community 18`, `Community 19`, `Community 20`, `Community 21`, `Community 22`, `Community 23`, `Community 27`, `Community 28`, `Community 29`, `Community 31`, `Community 33`, `Community 35`, `Community 36`, `Community 37`, `Community 40`, `Community 41`, `Community 44`, `Community 45`, `Community 46`, `Community 47`, `Community 48`, `Community 49`, `Community 52`, `Community 54`, `Community 55`, `Community 56`, `Community 57`, `Community 59`, `Community 60`, `Community 61`, `Community 63`, `Community 65`, `Community 66`, `Community 67`, `Community 69`, `Community 71`, `Community 73`, `Community 74`, `Community 75`, `Community 77`, `Community 78`, `Community 81`, `Community 85`, `Community 88`, `Community 89`, `Community 92`, `Community 93`, `Community 95`, `Community 96`, `Community 97`, `Community 98`, `Community 99`, `Community 102`, `Community 103`, `Community 105`, `Community 107`, `Community 108`, `Community 109`, `Community 111`, `Community 112`, `Community 122`, `Community 125`, `Community 126`, `Community 127`, `Community 128`, `Community 129`, `Community 130`, `Community 131`, `Community 137`, `Community 141`, `Community 143`, `Community 146`, `Community 147`?**
|
||||
_High betweenness centrality (0.204) - this node is a cross-community bridge._
|
||||
- **Why does `BaseModel` connect `Community 80` to `Community 0`, `Community 2`, `Community 133`, `Community 134`, `Community 7`, `Community 9`, `Community 11`, `Community 12`, `Community 146`, `Community 19`, `Community 148`, `Community 21`, `Community 20`, `Community 23`, `Community 150`, `Community 25`, `Community 24`, `Community 28`, `Community 30`, `Community 32`, `Community 44`, `Community 45`, `Community 47`, `Community 50`, `Community 51`, `Community 62`, `Community 69`, `Community 71`, `Community 73`, `Community 75`, `Community 77`, `Community 85`, `Community 103`, `Community 124`?**
|
||||
_High betweenness centrality (0.067) - this node is a cross-community bridge._
|
||||
- **Why does `datetime` connect `Community 39` to `Community 0`, `Community 2`, `Community 3`, `Community 4`, `Community 5`, `Community 6`, `Community 9`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 143`, `Community 16`, `Community 17`, `Community 15`, `Community 147`, `Community 148`, `Community 21`, `Community 22`, `Community 23`, `Community 24`, `Community 25`, `Community 27`, `Community 30`, `Community 31`, `Community 32`, `Community 33`, `Community 34`, `Community 35`, `Community 36`, `Community 37`, `Community 38`, `Community 40`, `Community 41`, `Community 43`, `Community 44`, `Community 47`, `Community 49`, `Community 50`, `Community 51`, `Community 52`, `Community 54`, `Community 55`, `Community 56`, `Community 59`, `Community 60`, `Community 61`, `Community 62`, `Community 67`, `Community 68`, `Community 69`, `Community 75`, `Community 77`, `Community 78`, `Community 80`, `Community 84`, `Community 85`, `Community 92`, `Community 93`, `Community 95`, `Community 96`, `Community 97`, `Community 98`, `Community 100`, `Community 102`, `Community 103`, `Community 104`, `Community 105`, `Community 108`, `Community 124`, `Community 127`?**
|
||||
_High betweenness centrality (0.058) - this node is a cross-community bridge._
|
||||
- **Are the 251 inferred relationships involving `str` (e.g. with `AdvanceApplyCreate` and `AdvanceApplyOut`) actually correct?**
|
||||
_`str` has 251 INFERRED edges - model-reasoned connections that need verification._
|
||||
@@ -765,4 +755,4 @@ _Questions this graph is uniquely positioned to answer:_
|
||||
- **Are the 140 inferred relationships involving `int` (e.g. with `AdvanceApplyCreate` and `AdvanceApplyOut`) actually correct?**
|
||||
_`int` has 140 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **What connects `定期 ping MySQL,避免远程库/NAT 回收空闲 TCP 后首请求长时间卡住。`, `数据库异常:返回 JSON 并保留 CORS 头,避免浏览器只报跨域错误`, `未捕获异常:统一 JSON 500,确保跨域场景下仍有 Access-Control-Allow-Origin` to the rest of the system?**
|
||||
_1256 weakly-connected nodes found - possible documentation gaps or missing edges._
|
||||
_1298 weakly-connected nodes found - possible documentation gaps or missing edges._
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"/Users/zlwu/work/00code/shanxia2.0/backend/start-prod.sh":{"size":7357,"mtime_ns":1782639355476060453,"hash":"ca89869446be74a2bf2367b3b28f448580220859a39a84ad9613ac5fe35a8433"},"/Users/zlwu/work/00code/shanxia2.0/backend/start.sh":{"size":9548,"mtime_ns":1780114661446983244,"hash":"4d632863e8a0cd81194b491d83a0218a4157435ae812dec76a6f6197b4d48e57"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/__init__.py":{"size":21,"mtime_ns":1780113982281973984,"hash":"60a04ff08fd97084e83ea809fd13feda6d2848be20ebf309e31fc1dad7523230"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/main.py":{"size":6280,"mtime_ns":1782790852770448643,"hash":"8f9da799977bee7134d87a26ff8434ac5ef8eabb0b7368dd537eee49ad7fd00b"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/tasks/__init__.py":{"size":1953,"mtime_ns":1780805101147405418,"hash":"d2a416ff9daedad88780cbe3f14ea75e8299044f8787afb60e731f43963dc405"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/auth.py":{"size":7457,"mtime_ns":1782790841500516545,"hash":"34bac56e1c2cb6215f4b5fa2dc32d77d4b4abca51428819eebf4afd269cc51cf"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/api_crypto.py":{"size":1870,"mtime_ns":1780108930724444498,"hash":"c04b748aea86890a5971f749523c7b17dbad1ddd6f9f7f07a5679d159c984e33"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/login_crypto.py":{"size":3858,"mtime_ns":1780108930725155710,"hash":"b82d51afabf2293a9cb1fb2e5f994c383948e7f47ea95fe674686b4f3f3342b1"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/config.py":{"size":6698,"mtime_ns":1782790876685112837,"hash":"9d955a6baa70f78ddfcf29407d9711915a04e59a7f616254d06d25d25e8d0327"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/wechat_pay.py":{"size":23585,"mtime_ns":1780108930725768130,"hash":"3d52265ce65d21e7103f94afa1e8547aee0823b5ea6d65c50317436ac81fb4fc"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/api_request_log_middleware.py":{"size":11971,"mtime_ns":1782701669198208175,"hash":"0b84c32828939e6102bb3647691fa8f04b1f68e0e0e9f28127374cc44e19a11c"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/database.py":{"size":1510,"mtime_ns":1782790847265601586,"hash":"8bc9c8ae62e2be2c6920036582ba448dfcd1711c41cebb62274ff6bc6ee14b0b"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/security.py":{"size":728,"mtime_ns":1780108930725470004,"hash":"df0f01115064f7b8de1c81dbe9a6db39360c236610b68c33b3234a51d7f0025b"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/request_payload.py":{"size":2842,"mtime_ns":1780108930725350836,"hash":"e9937151530ab1417ef297aef59111977725cf90be2a8fa76c00a0618789aba0"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/__init__.py":{"size":61,"mtime_ns":1780108930724312414,"hash":"3dd1842ee59b0c804176b03b4b8a323bd4a252b7feb1bbc32db64f3a8928570e"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/response.py":{"size":1824,"mtime_ns":1780108930725412462,"hash":"f1739352d65ea8287d76e282a59553aa8d63c97e35764c64ac378aa5bd9c347e"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/menu_guard.py":{"size":1611,"mtime_ns":1780108930725223002,"hash":"3e26077288c3620a4780038b891a326206b45bffe00aca545bdae30172487235"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/db_collation.py":{"size":548,"mtime_ns":1780108930725025043,"hash":"0c680e25a18244ca839a7de6ed1f4313b33bc8da118d89c463aee1b6af00c6f9"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/context.py":{"size":421,"mtime_ns":1780108930724824458,"hash":"83a10aee67162374993c10a30bf8bb8bd9c4b35cf48f42c832415ccebd91660f"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/utils.py":{"size":1498,"mtime_ns":1780108930725607296,"hash":"09323693661c1d4560458b86a954128ccff82bbaf6522da0b44f24da99ddf9ea"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/storage.py":{"size":13209,"mtime_ns":1780108930725541087,"hash":"c3138253eb34f65b09f4436e037fb3179d947f84d3b5fef007ed9a8e3bb135ee"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/order_status_compat.py":{"size":2828,"mtime_ns":1780108930725284669,"hash":"5349e5a0745ee6734c4a995337779307adefc46f453906171988a77de2081540"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/exceptions.py":{"size":4946,"mtime_ns":1780108930725084335,"hash":"79c997d964bca1a4f12f2b92fb1f181fdb9e2b3cf72eae39f4cc164d23794fd7"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/data_scope.py":{"size":8043,"mtime_ns":1782648925694296304,"hash":"626dff86937e5cacec634ecbc61cd53d3763d760223a1d4ec7cd11f64e59a220"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/admin_request_json.py":{"size":2669,"mtime_ns":1780108930724378914,"hash":"4f68b3cf84291e7bddad6ecf4bb4d29ca5e1ec246a9f7f9c4cf5909d0ec1174a"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/api_crypto_middleware.py":{"size":10876,"mtime_ns":1782790001926627098,"hash":"b39f128b6612589ea6ac5babd30752e9585b3af07b82bb1ad53c9e3c0d90816f"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/wechat_message.py":{"size":11194,"mtime_ns":1780108930725684255,"hash":"5086070deb14d99d1a69e419b2299ec4Line truncated
|
||||
{"/Users/zlwu/work/00code/shanxia2.0/backend/start-prod.sh":{"size":7357,"mtime_ns":1782639355476060453,"hash":"ca89869446be74a2bf2367b3b28f448580220859a39a84ad9613ac5fe35a8433"},"/Users/zlwu/work/00code/shanxia2.0/backend/start.sh":{"size":9548,"mtime_ns":1780114661446983244,"hash":"4d632863e8a0cd81194b491d83a0218a4157435ae812dec76a6f6197b4d48e57"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/__init__.py":{"size":21,"mtime_ns":1780113982281973984,"hash":"60a04ff08fd97084e83ea809fd13feda6d2848be20ebf309e31fc1dad7523230"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/main.py":{"size":6280,"mtime_ns":1782790852770448643,"hash":"8f9da799977bee7134d87a26ff8434ac5ef8eabb0b7368dd537eee49ad7fd00b"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/tasks/__init__.py":{"size":1953,"mtime_ns":1780805101147405418,"hash":"d2a416ff9daedad88780cbe3f14ea75e8299044f8787afb60e731f43963dc405"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/auth.py":{"size":7457,"mtime_ns":1782790841500516545,"hash":"34bac56e1c2cb6215f4b5fa2dc32d77d4b4abca51428819eebf4afd269cc51cf"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/api_crypto.py":{"size":1870,"mtime_ns":1780108930724444498,"hash":"c04b748aea86890a5971f749523c7b17dbad1ddd6f9f7f07a5679d159c984e33"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/login_crypto.py":{"size":3858,"mtime_ns":1780108930725155710,"hash":"b82d51afabf2293a9cb1fb2e5f994c383948e7f47ea95fe674686b4f3f3342b1"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/config.py":{"size":6698,"mtime_ns":1782790876685112837,"hash":"9d955a6baa70f78ddfcf29407d9711915a04e59a7f616254d06d25d25e8d0327"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/wechat_pay.py":{"size":23585,"mtime_ns":1780108930725768130,"hash":"3d52265ce65d21e7103f94afa1e8547aee0823b5ea6d65c50317436ac81fb4fc"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/api_request_log_middleware.py":{"size":11971,"mtime_ns":1782701669198208175,"hash":"0b84c32828939e6102bb3647691fa8f04b1f68e0e0e9f28127374cc44e19a11c"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/database.py":{"size":1510,"mtime_ns":1782790847265601586,"hash":"8bc9c8ae62e2be2c6920036582ba448dfcd1711c41cebb62274ff6bc6ee14b0b"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/security.py":{"size":728,"mtime_ns":1780108930725470004,"hash":"df0f01115064f7b8de1c81dbe9a6db39360c236610b68c33b3234a51d7f0025b"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/request_payload.py":{"size":2842,"mtime_ns":1780108930725350836,"hash":"e9937151530ab1417ef297aef59111977725cf90be2a8fa76c00a0618789aba0"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/__init__.py":{"size":61,"mtime_ns":1780108930724312414,"hash":"3dd1842ee59b0c804176b03b4b8a323bd4a252b7feb1bbc32db64f3a8928570e"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/response.py":{"size":1824,"mtime_ns":1780108930725412462,"hash":"f1739352d65ea8287d76e282a59553aa8d63c97e35764c64ac378aa5bd9c347e"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/menu_guard.py":{"size":1611,"mtime_ns":1780108930725223002,"hash":"3e26077288c3620a4780038b891a326206b45bffe00aca545bdae30172487235"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/db_collation.py":{"size":548,"mtime_ns":1780108930725025043,"hash":"0c680e25a18244ca839a7de6ed1f4313b33bc8da118d89c463aee1b6af00c6f9"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/context.py":{"size":421,"mtime_ns":1780108930724824458,"hash":"83a10aee67162374993c10a30bf8bb8bd9c4b35cf48f42c832415ccebd91660f"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/utils.py":{"size":1498,"mtime_ns":1780108930725607296,"hash":"09323693661c1d4560458b86a954128ccff82bbaf6522da0b44f24da99ddf9ea"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/storage.py":{"size":14141,"mtime_ns":1782855136810943216,"hash":"3ae2c413c10898a8adb3d6773870bafbfbc18c739c10e0e8b4f765b4b5ca6c08"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/order_status_compat.py":{"size":2828,"mtime_ns":1780108930725284669,"hash":"5349e5a0745ee6734c4a995337779307adefc46f453906171988a77de2081540"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/exceptions.py":{"size":4946,"mtime_ns":1780108930725084335,"hash":"79c997d964bca1a4f12f2b92fb1f181fdb9e2b3cf72eae39f4cc164d23794fd7"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/data_scope.py":{"size":8043,"mtime_ns":1782648925694296304,"hash":"626dff86937e5cacec634ecbc61cd53d3763d760223a1d4ec7cd11f64e59a220"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/admin_request_json.py":{"size":2669,"mtime_ns":1780108930724378914,"hash":"4f68b3cf84291e7bddad6ecf4bb4d29ca5e1ec246a9f7f9c4cf5909d0ec1174a"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/api_crypto_middleware.py":{"size":10876,"mtime_ns":1782790001926627098,"hash":"b39f128b6612589ea6ac5babd30752e9585b3af07b82bb1ad53c9e3c0d90816f"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/wechat_message.py":{"size":11194,"mtime_ns":1780108930725684255,"hash":"5086070deb14d99d1a69e419b2299ec4Line truncated
|
||||
@@ -1,307 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>graphify - /Users/zlwu/work/00code/shanxia2.0/backend/graphify-out/graph.html</title>
|
||||
<script src="https://unpkg.com/vis-network@9.1.6/standalone/umd/vis-network.min.js"
|
||||
integrity="sha384-Ux6phic9PEHJ38YtrijhkzyJ8yQlH8i/+buBR8s3mAZOJrP1gwyvAcIYl3GWtpX1"
|
||||
crossorigin="anonymous"></script>
|
||||
<style>
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
body { background: #0f0f1a; color: #e0e0e0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; display: flex; height: 100vh; overflow: hidden; }
|
||||
#graph { flex: 1; }
|
||||
#sidebar { width: 280px; background: #1a1a2e; border-left: 1px solid #2a2a4e; display: flex; flex-direction: column; overflow: hidden; }
|
||||
#search-wrap { padding: 12px; border-bottom: 1px solid #2a2a4e; }
|
||||
#search { width: 100%; background: #0f0f1a; border: 1px solid #3a3a5e; color: #e0e0e0; padding: 7px 10px; border-radius: 6px; font-size: 13px; outline: none; }
|
||||
#search:focus { border-color: #4E79A7; }
|
||||
#search-results { max-height: 140px; overflow-y: auto; padding: 4px 12px; border-bottom: 1px solid #2a2a4e; display: none; }
|
||||
.search-item { padding: 4px 6px; cursor: pointer; border-radius: 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.search-item:hover { background: #2a2a4e; }
|
||||
#info-panel { padding: 14px; border-bottom: 1px solid #2a2a4e; min-height: 140px; }
|
||||
#info-panel h3 { font-size: 13px; color: #aaa; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
|
||||
#info-content { font-size: 13px; color: #ccc; line-height: 1.6; }
|
||||
#info-content .field { margin-bottom: 5px; }
|
||||
#info-content .field b { color: #e0e0e0; }
|
||||
#info-content .empty { color: #555; font-style: italic; }
|
||||
.neighbor-link { display: block; padding: 2px 6px; margin: 2px 0; border-radius: 3px; cursor: pointer; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid #333; }
|
||||
.neighbor-link:hover { background: #2a2a4e; }
|
||||
#neighbors-list { max-height: 160px; overflow-y: auto; margin-top: 4px; }
|
||||
#legend-wrap { flex: 1; overflow-y: auto; padding: 12px; }
|
||||
#legend-wrap h3 { font-size: 13px; color: #aaa; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
|
||||
.legend-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; border-radius: 4px; font-size: 12px; }
|
||||
.legend-item:hover { background: #2a2a4e; padding-left: 4px; }
|
||||
.legend-item.dimmed { opacity: 0.35; }
|
||||
.legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
|
||||
.legend-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.legend-count { color: #666; font-size: 11px; }
|
||||
#stats { padding: 10px 14px; border-top: 1px solid #2a2a4e; font-size: 11px; color: #555; }
|
||||
#legend-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 4px 0; }
|
||||
#legend-controls label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: #aaa; user-select: none; }
|
||||
#legend-controls label:hover { color: #e0e0e0; }
|
||||
.legend-cb, #select-all-cb { appearance: none; -webkit-appearance: none; width: 14px; height: 14px; border: 1.5px solid #3a3a5e; border-radius: 3px; background: #0f0f1a; cursor: pointer; position: relative; flex-shrink: 0; }
|
||||
.legend-cb:checked, #select-all-cb:checked { background: #4E79A7; border-color: #4E79A7; }
|
||||
.legend-cb:checked::after, #select-all-cb:checked::after { content: ''; position: absolute; left: 3.5px; top: 1px; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
|
||||
#select-all-cb:indeterminate { background: #4E79A7; border-color: #4E79A7; }
|
||||
#select-all-cb:indeterminate::after { content: ''; position: absolute; left: 2px; top: 5px; width: 8px; height: 2px; background: #fff; border: none; transform: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="graph"></div>
|
||||
<div id="sidebar">
|
||||
<div id="search-wrap">
|
||||
<input id="search" type="text" placeholder="Search nodes..." autocomplete="off">
|
||||
<div id="search-results"></div>
|
||||
</div>
|
||||
<div id="info-panel">
|
||||
<h3>Node Info</h3>
|
||||
<div id="info-content"><span class="empty">Click a node to inspect it</span></div>
|
||||
</div>
|
||||
<div id="legend-wrap">
|
||||
<h3>Communities</h3>
|
||||
<div id="legend-controls">
|
||||
<label><input type="checkbox" id="select-all-cb" checked onchange="toggleAllCommunities(!this.checked)">Select All</label>
|
||||
</div>
|
||||
<div id="legend"></div>
|
||||
</div>
|
||||
<div id="stats">4973 nodes · 34742 edges · 152 communities</div>
|
||||
</div>
|
||||
<script>
|
||||
const RAW_NODES = [{"id": "start_prod_sh", "label": "start-prod.sh", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.5, "font": {"size": 0, "color": "#ffffff"}, "title": "start-prod.sh", "community": 72, "community_name": "Community 72", "source_file": "start-prod.sh", "file_type": "code", "degree": 19}, {"id": "users_zlwu_work_00code_shanxia2_0_backend_start_prod_sh__entry", "label": "start-prod.sh script", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "start-prod.sh script", "community": 72, "community_name": "Community 72", "source_file": "start-prod.sh", "file_type": "code", "degree": 10}, {"id": "backend_start_prod_log_info", "label": "log_info()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "log_info()", "community": 72, "community_name": "Community 72", "source_file": "start-prod.sh", "file_type": "code", "degree": 8}, {"id": "backend_start_prod_log_warn", "label": "log_warn()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "log_warn()", "community": 72, "community_name": "Community 72", "source_file": "start-prod.sh", "file_type": "code", "degree": 10}, {"id": "backend_start_prod_log_error", "label": "log_error()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "log_error()", "community": 72, "community_name": "Community 72", "source_file": "start-prod.sh", "file_type": "code", "degree": 8}, {"id": "backend_start_prod_show_help", "label": "show_help()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "show_help()", "community": 72, "community_name": "Community 72", "source_file": "start-prod.sh", "file_type": "code", "degree": 2}, {"id": "backend_start_prod_ensure_dirs", "label": "ensure_dirs()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "ensure_dirs()", "community": 72, "community_name": "Community 72", "source_file": "start-prod.sh", "file_type": "code", "degree": 3}, {"id": "backend_start_prod_check_python", "label": "check_python()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "check_python()", "community": 72, "community_name": "Community 72", "source_file": "start-prod.sh", "file_type": "code", "degree": 6}, {"id": "backend_start_prod_venv_is_usable", "label": "venv_is_usable()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "venv_is_usable()", "community": 72, "community_name": "Community 72", "source_file": "start-prod.sh", "file_type": "code", "degree": 3}, {"id": "backend_start_prod_reset_venv", "label": "reset_venv()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "reset_venv()", "community": 72, "community_name": "Community 72", "source_file": "start-prod.sh", "file_type": "code", "degree": 4}, {"id": "backend_start_prod_create_venv", "label": "create_venv()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "create_venv()", "community": 72, "community_name": "Community 72", "source_file": "start-prod.sh", "file_type": "code", "degree": 5}, {"id": "backend_start_prod_ensure_valid_venv", "label": "ensure_valid_venv()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "ensure_valid_venv()", "community": 72, "community_name": "Community 72", "source_file": "start-prod.sh", "file_type": "code", "degree": 7}, {"id": "backend_start_prod_install_dependencies", "label": "install_dependencies()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "install_dependencies()", "community": 72, "community_name": "Community 72",Line truncated
|
||||
const RAW_EDGES = [{"from": "start_prod_sh", "to": "backend_start_prod_check_python", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_create_venv", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_ensure_dirs", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_ensure_valid_venv", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_ensure_venv_and_runtime", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_install_dependencies", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_is_running", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_log_error", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_log_info", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_log_warn", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_reset_venv", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_show_help", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_show_logs", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_start_server", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_status_server", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_stop_server", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_venv_is_usable", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "backend_start_prod_verify_health", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "start_prod_sh", "to": "users_zlwu_work_00code_shanxia2_0_backend_start_prod_sh__entry", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "users_zlwu_work_00code_shanxia2_0_backend_start_prod_sh__entry", "to": "backend_start_prod_install_dependencies", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "users_zlwu_work_00code_shanxia2_0_backend_start_prod_sh__entry", "to": "backend_start_prod_log_error", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "users_zlwu_work_00code_shanxia2_0_backend_start_prod_sh__entry", "to": "backend_start_prod_log_info", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "users_zlwu_work_00code_shanxia2_0_backend_start_prod_sh__entry", "to": "backend_start_prod_reset_venv", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "users_zlwu_work_00code_shanxia2_0_backend_start_prod_sh__entry", "to": "backend_startLine truncated
|
||||
const LEGEND = [{"cid": 0, "color": "#4E79A7", "label": "Community 0", "count": 131}, {"cid": 1, "color": "#F28E2B", "label": "Community 1", "count": 24}, {"cid": 2, "color": "#E15759", "label": "Community 2", "count": 234}, {"cid": 3, "color": "#76B7B2", "label": "Community 3", "count": 173}, {"cid": 4, "color": "#59A14F", "label": "Community 4", "count": 43}, {"cid": 5, "color": "#EDC948", "label": "Community 5", "count": 46}, {"cid": 6, "color": "#B07AA1", "label": "Community 6", "count": 58}, {"cid": 7, "color": "#FF9DA7", "label": "Community 7", "count": 42}, {"cid": 8, "color": "#9C755F", "label": "Community 8", "count": 35}, {"cid": 9, "color": "#BAB0AC", "label": "Community 9", "count": 31}, {"cid": 10, "color": "#4E79A7", "label": "Community 10", "count": 40}, {"cid": 11, "color": "#F28E2B", "label": "Community 11", "count": 67}, {"cid": 12, "color": "#E15759", "label": "Community 12", "count": 91}, {"cid": 13, "color": "#76B7B2", "label": "Community 13", "count": 45}, {"cid": 14, "color": "#59A14F", "label": "Community 14", "count": 56}, {"cid": 15, "color": "#EDC948", "label": "Community 15", "count": 26}, {"cid": 16, "color": "#B07AA1", "label": "Community 16", "count": 31}, {"cid": 17, "color": "#FF9DA7", "label": "Community 17", "count": 53}, {"cid": 18, "color": "#9C755F", "label": "Community 18", "count": 55}, {"cid": 19, "color": "#BAB0AC", "label": "Community 19", "count": 27}, {"cid": 20, "color": "#4E79A7", "label": "Community 20", "count": 31}, {"cid": 21, "color": "#F28E2B", "label": "Community 21", "count": 136}, {"cid": 22, "color": "#E15759", "label": "Community 22", "count": 38}, {"cid": 23, "color": "#76B7B2", "label": "Community 23", "count": 38}, {"cid": 24, "color": "#59A14F", "label": "Community 24", "count": 94}, {"cid": 25, "color": "#EDC948", "label": "Community 25", "count": 30}, {"cid": 26, "color": "#B07AA1", "label": "Community 26", "count": 20}, {"cid": 27, "color": "#FF9DA7", "label": "Community 27", "count": 59}, {"cid": 28, "color": "#9C755F", "label": "Community 28", "count": 65}, {"cid": 29, "color": "#BAB0AC", "label": "Community 29", "count": 67}, {"cid": 30, "color": "#4E79A7", "label": "Community 30", "count": 51}, {"cid": 31, "color": "#F28E2B", "label": "Community 31", "count": 20}, {"cid": 32, "color": "#E15759", "label": "Community 32", "count": 103}, {"cid": 33, "color": "#76B7B2", "label": "Community 33", "count": 42}, {"cid": 34, "color": "#59A14F", "label": "Community 34", "count": 29}, {"cid": 35, "color": "#EDC948", "label": "Community 35", "count": 153}, {"cid": 36, "color": "#B07AA1", "label": "Community 36", "count": 30}, {"cid": 37, "color": "#FF9DA7", "label": "Community 37", "count": 15}, {"cid": 38, "color": "#9C755F", "label": "Community 38", "count": 57}, {"cid": 39, "color": "#BAB0AC", "label": "Community 39", "count": 29}, {"cid": 40, "color": "#4E79A7", "label": "Community 40", "count": 38}, {"cid": 41, "color": "#F28E2B", "label": "Community 41", "count": 41}, {"cid": 42, "color": "#E15759", "label": "Community 42", "count": 26}, {"cid": 43, "color": "#76B7B2", "label": "Community 43", "count": 24}, {"cid": 44, "color": "#59A14F", "label": "Community 44", "count": 39}, {"cid": 45, "color": "#EDC948", "label": "Community 45", "count": 16}, {"cid": 46, "color": "#B07AA1", "label": "Community 46", "count": 23}, {"cid": 47, "color": "#FF9DA7", "label": "Community 47", "count": 21}, {"cid": 48, "color": "#9C755F", "label": "Community 48", "count": 18}, {"cid": 49, "color": "#BAB0AC", "label": "Community 49", "count": 21}, {"cid": 50, "color": "#4E79A7", "label": "Community 50", "count": 34}, {"cid": 51, "color": "#F28E2B", "label": "Community 51", "count": 48}, {"cid": 52, "color": "#E15759", "label": "Community 52", "count": 63}, {"cid": 53, "color": "#76B7B2", "label": "Community 53", "count": 22}, {"cid": 54, "color": "#59A14F", "label": "Community 54", "count": 18}, {"cid": 55, "color": "#EDC948", "label": "Community 55", "count": 113}, {"cid": 56, "color": "#B07AA1", "label": "Community 56", "count": 23}, {"cid": 57, "color": "#FF9DA7", "label": "Community 57", "count": 21}, {"cid": 58, "color": "#9C755F", "label": "Community 58", "count": 18}, {"cid": 59, "color": "#BAB0AC", "label": "Community 59", "count": 24}, {"cid": 60, "color": "#4E79A7", "label": "Community 60", "count": 11}, {"cid": 61, "color": "#F28E2B", "label": "Community 61", "count": 59}, {"cid": 62, "color": "#E15759", "label": "Community 62", "count": 49}, {"cid": 63, "color": "#76B7B2", "label": "Community 63", "count": 48}, {"cid": 64, "color": "#59A14F", "label": "Community 64", "count": 18}, {"cid": 65, "color": "#EDC948", "label": "Community 65", "count": 17}, {"cid": 66, "color": "#B07AA1", "label": "Community 66", "count": 17}, {"cid": 67, "color": "#FF9DA7", "label": "Community 67", "count": 20}, {"cid": 68, "color": "#9C755F", "label": "Community 68", "count": 53}, {"cid": 69, "color": "#BAB0AC", "label": "Community 69", "count": 27}, {"cid": 70, "color": "#4E7Line truncated
|
||||
|
||||
// HTML-escape helper — prevents XSS when injecting graph data into innerHTML
|
||||
function esc(s) {
|
||||
return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');
|
||||
}
|
||||
|
||||
// Build vis datasets
|
||||
const nodesDS = new vis.DataSet(RAW_NODES.map(n => ({
|
||||
id: n.id, label: n.label, color: n.color, size: n.size,
|
||||
font: n.font, title: n.title,
|
||||
_community: n.community, _community_name: n.community_name,
|
||||
_source_file: n.source_file, _file_type: n.file_type, _degree: n.degree,
|
||||
})));
|
||||
|
||||
const edgesDS = new vis.DataSet(RAW_EDGES.map((e, i) => ({
|
||||
id: i, from: e.from, to: e.to,
|
||||
label: '',
|
||||
title: e.title,
|
||||
dashes: e.dashes,
|
||||
width: e.width,
|
||||
color: e.color,
|
||||
arrows: { to: { enabled: true, scaleFactor: 0.5 } },
|
||||
})));
|
||||
|
||||
const container = document.getElementById('graph');
|
||||
const network = new vis.Network(container, { nodes: nodesDS, edges: edgesDS }, {
|
||||
physics: {
|
||||
enabled: true,
|
||||
solver: 'forceAtlas2Based',
|
||||
forceAtlas2Based: {
|
||||
gravitationalConstant: -60,
|
||||
centralGravity: 0.005,
|
||||
springLength: 120,
|
||||
springConstant: 0.08,
|
||||
damping: 0.4,
|
||||
avoidOverlap: 0.8,
|
||||
},
|
||||
stabilization: { iterations: 200, fit: true },
|
||||
},
|
||||
interaction: {
|
||||
hover: true,
|
||||
tooltipDelay: 100,
|
||||
hideEdgesOnDrag: true,
|
||||
navigationButtons: false,
|
||||
keyboard: false,
|
||||
},
|
||||
nodes: { shape: 'dot', borderWidth: 1.5 },
|
||||
edges: { smooth: { type: 'continuous', roundness: 0.2 }, selectionWidth: 3 },
|
||||
});
|
||||
|
||||
network.once('stabilizationIterationsDone', () => {
|
||||
network.setOptions({ physics: { enabled: false } });
|
||||
});
|
||||
|
||||
function showInfo(nodeId) {
|
||||
const n = nodesDS.get(nodeId);
|
||||
if (!n) return;
|
||||
const neighborIds = network.getConnectedNodes(nodeId);
|
||||
const neighborItems = neighborIds.map(nid => {
|
||||
const nb = nodesDS.get(nid);
|
||||
const color = nb ? nb.color.background : '#555';
|
||||
return `<span class="neighbor-link" style="border-left-color:${esc(color)}" onclick="focusNode(${JSON.stringify(nid)})">${esc(nb ? nb.label : nid)}</span>`;
|
||||
}).join('');
|
||||
document.getElementById('info-content').innerHTML = `
|
||||
<div class="field"><b>${esc(n.label)}</b></div>
|
||||
<div class="field">Type: ${esc(n._file_type || 'unknown')}</div>
|
||||
<div class="field">Community: ${esc(n._community_name)}</div>
|
||||
<div class="field">Source: ${esc(n._source_file || '-')}</div>
|
||||
<div class="field">Degree: ${n._degree}</div>
|
||||
${neighborIds.length ? `<div class="field" style="margin-top:8px;color:#aaa;font-size:11px">Neighbors (${neighborIds.length})</div><div id="neighbors-list">${neighborItems}</div>` : ''}
|
||||
`;
|
||||
}
|
||||
|
||||
function focusNode(nodeId) {
|
||||
network.focus(nodeId, { scale: 1.4, animation: true });
|
||||
network.selectNodes([nodeId]);
|
||||
showInfo(nodeId);
|
||||
}
|
||||
|
||||
// Track hovered node — hover detection is more reliable than click params
|
||||
let hoveredNodeId = null;
|
||||
network.on('hoverNode', params => {
|
||||
hoveredNodeId = params.node;
|
||||
container.style.cursor = 'pointer';
|
||||
});
|
||||
network.on('blurNode', () => {
|
||||
hoveredNodeId = null;
|
||||
container.style.cursor = 'default';
|
||||
});
|
||||
container.addEventListener('click', () => {
|
||||
if (hoveredNodeId !== null) {
|
||||
showInfo(hoveredNodeId);
|
||||
network.selectNodes([hoveredNodeId]);
|
||||
}
|
||||
});
|
||||
network.on('click', params => {
|
||||
if (params.nodes.length > 0) {
|
||||
showInfo(params.nodes[0]);
|
||||
} else if (hoveredNodeId === null) {
|
||||
document.getElementById('info-content').innerHTML = '<span class="empty">Click a node to inspect it</span>';
|
||||
}
|
||||
});
|
||||
|
||||
const searchInput = document.getElementById('search');
|
||||
const searchResults = document.getElementById('search-results');
|
||||
searchInput.addEventListener('input', () => {
|
||||
const q = searchInput.value.toLowerCase().trim();
|
||||
searchResults.innerHTML = '';
|
||||
if (!q) { searchResults.style.display = 'none'; return; }
|
||||
const matches = RAW_NODES.filter(n => n.label.toLowerCase().includes(q)).slice(0, 20);
|
||||
if (!matches.length) { searchResults.style.display = 'none'; return; }
|
||||
searchResults.style.display = 'block';
|
||||
matches.forEach(n => {
|
||||
const el = document.createElement('div');
|
||||
el.className = 'search-item';
|
||||
el.textContent = n.label;
|
||||
el.style.borderLeft = `3px solid ${n.color.background}`;
|
||||
el.style.paddingLeft = '8px';
|
||||
el.onclick = () => {
|
||||
network.focus(n.id, { scale: 1.5, animation: true });
|
||||
network.selectNodes([n.id]);
|
||||
showInfo(n.id);
|
||||
searchResults.style.display = 'none';
|
||||
searchInput.value = '';
|
||||
};
|
||||
searchResults.appendChild(el);
|
||||
});
|
||||
});
|
||||
document.addEventListener('click', e => {
|
||||
if (!searchResults.contains(e.target) && e.target !== searchInput)
|
||||
searchResults.style.display = 'none';
|
||||
});
|
||||
|
||||
const hiddenCommunities = new Set();
|
||||
|
||||
const selectAllCb = document.getElementById('select-all-cb');
|
||||
|
||||
function updateSelectAllState() {
|
||||
const total = LEGEND.length;
|
||||
const hidden = hiddenCommunities.size;
|
||||
selectAllCb.checked = hidden === 0;
|
||||
selectAllCb.indeterminate = hidden > 0 && hidden < total;
|
||||
}
|
||||
|
||||
function toggleAllCommunities(hide) {
|
||||
document.querySelectorAll('.legend-item').forEach(item => {
|
||||
hide ? item.classList.add('dimmed') : item.classList.remove('dimmed');
|
||||
});
|
||||
document.querySelectorAll('.legend-cb').forEach(cb => {
|
||||
cb.checked = !hide;
|
||||
});
|
||||
LEGEND.forEach(c => {
|
||||
if (hide) hiddenCommunities.add(c.cid); else hiddenCommunities.delete(c.cid);
|
||||
});
|
||||
const updates = RAW_NODES.map(n => ({ id: n.id, hidden: hide }));
|
||||
nodesDS.update(updates);
|
||||
updateSelectAllState();
|
||||
}
|
||||
|
||||
const legendEl = document.getElementById('legend');
|
||||
LEGEND.forEach(c => {
|
||||
const item = document.createElement('div');
|
||||
item.className = 'legend-item';
|
||||
const cb = document.createElement('input');
|
||||
cb.type = 'checkbox';
|
||||
cb.className = 'legend-cb';
|
||||
cb.checked = true;
|
||||
cb.addEventListener('change', (e) => {
|
||||
e.stopPropagation();
|
||||
if (cb.checked) {
|
||||
hiddenCommunities.delete(c.cid);
|
||||
item.classList.remove('dimmed');
|
||||
} else {
|
||||
hiddenCommunities.add(c.cid);
|
||||
item.classList.add('dimmed');
|
||||
}
|
||||
const updates = RAW_NODES
|
||||
.filter(n => n.community === c.cid)
|
||||
.map(n => ({ id: n.id, hidden: !cb.checked }));
|
||||
nodesDS.update(updates);
|
||||
updateSelectAllState();
|
||||
});
|
||||
item.innerHTML = `<div class="legend-dot" style="background:${c.color}"></div>
|
||||
<span class="legend-label">${c.label}</span>
|
||||
<span class="legend-count">${c.count}</span>`;
|
||||
item.prepend(cb);
|
||||
item.onclick = (e) => {
|
||||
if (e.target === cb) return;
|
||||
cb.checked = !cb.checked;
|
||||
cb.dispatchEvent(new Event('change'));
|
||||
};
|
||||
legendEl.appendChild(item);
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
// Render hyperedges as shaded regions
|
||||
const hyperedges = [];
|
||||
// afterDrawing passes ctx already transformed to network coordinate space.
|
||||
// Draw node positions raw — no manual pan/zoom/DPR math needed.
|
||||
network.on('afterDrawing', function(ctx) {
|
||||
hyperedges.forEach(h => {
|
||||
const positions = h.nodes
|
||||
.map(nid => network.getPositions([nid])[nid])
|
||||
.filter(p => p !== undefined);
|
||||
if (positions.length < 2) return;
|
||||
ctx.save();
|
||||
ctx.globalAlpha = 0.12;
|
||||
ctx.fillStyle = '#6366f1';
|
||||
ctx.strokeStyle = '#6366f1';
|
||||
ctx.lineWidth = 2;
|
||||
ctx.beginPath();
|
||||
// Centroid and expanded hull in network coordinates
|
||||
const cx = positions.reduce((s, p) => s + p.x, 0) / positions.length;
|
||||
const cy = positions.reduce((s, p) => s + p.y, 0) / positions.length;
|
||||
const expanded = positions.map(p => ({
|
||||
x: cx + (p.x - cx) * 1.15,
|
||||
y: cy + (p.y - cy) * 1.15
|
||||
}));
|
||||
ctx.moveTo(expanded[0].x, expanded[0].y);
|
||||
expanded.slice(1).forEach(p => ctx.lineTo(p.x, p.y));
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.globalAlpha = 0.4;
|
||||
ctx.stroke();
|
||||
// Label
|
||||
ctx.globalAlpha = 0.8;
|
||||
ctx.fillStyle = '#4f46e5';
|
||||
ctx.font = 'bold 11px sans-serif';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillText(h.label, cx, cy - 5);
|
||||
ctx.restore();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+4486
-2378
File diff suppressed because it is too large.
Load diff
@@ -1485,10 +1485,10 @@ CREATE TABLE `crm_product` (
|
||||
`category_id` varchar(64) DEFAULT NULL COMMENT '分类ID',
|
||||
`category_name` varchar(100) DEFAULT NULL COMMENT '分类名称(冗余)',
|
||||
`model` varchar(100) DEFAULT NULL COMMENT '规格型号',
|
||||
`unit` varchar(20) NOT NULL DEFAULT '件' COMMENT '单位',
|
||||
`unit` varchar(20) DEFAULT NULL COMMENT '单位',
|
||||
`barcode` varchar(100) DEFAULT NULL COMMENT '条码',
|
||||
`price` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT '标准单价',
|
||||
`cost_price` decimal(15,2) DEFAULT '0.00' COMMENT '成本价',
|
||||
`price` decimal(15,2) DEFAULT NULL COMMENT '标准单价',
|
||||
`cost_price` decimal(15,2) DEFAULT NULL COMMENT '成本价',
|
||||
`stock` int(11) NOT NULL DEFAULT '0' COMMENT '库存数量',
|
||||
`low_stock` int(11) NOT NULL DEFAULT '10' COMMENT '库存预警值',
|
||||
`tax_rate` decimal(5,2) NOT NULL DEFAULT '13.00' COMMENT '税率(百分比)',
|
||||
|
||||
+689
-654
File diff suppressed because it is too large.
Load diff
@@ -703,11 +703,8 @@
|
||||
"701": "Community 701",
|
||||
"702": "Community 702",
|
||||
"703": "Community 703",
|
||||
"704": "Community 704",
|
||||
"705": "Community 705",
|
||||
"706": "Community 706",
|
||||
"707": "Community 707",
|
||||
"708": "Community 708",
|
||||
"709": "Community 709",
|
||||
"710": "Community 710",
|
||||
"711": "Community 711",
|
||||
@@ -715,10 +712,24 @@
|
||||
"713": "Community 713",
|
||||
"714": "Community 714",
|
||||
"715": "Community 715",
|
||||
"716": "Community 716",
|
||||
"717": "Community 717",
|
||||
"718": "Community 718",
|
||||
"719": "Community 719",
|
||||
"720": "Community 720",
|
||||
"721": "Community 721"
|
||||
"722": "Community 722",
|
||||
"723": "Community 723",
|
||||
"724": "Community 724",
|
||||
"727": "Community 727",
|
||||
"728": "Community 728",
|
||||
"729": "Community 729",
|
||||
"730": "Community 730",
|
||||
"731": "Community 731",
|
||||
"733": "Community 733",
|
||||
"734": "Community 734",
|
||||
"735": "Community 735",
|
||||
"736": "Community 736",
|
||||
"737": "Community 737",
|
||||
"738": "Community 738",
|
||||
"739": "Community 739",
|
||||
"741": "Community 741"
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
||||
{"nodes": [{"id": "users_zlwu_work_00code_shanxia2_0_web_admin_scripts_add_list_index_columns_py", "label": "add-list-index-columns.py", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L1"}, {"id": "scripts_add_list_index_columns_find_table_spans", "label": "find_table_spans()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L16"}, {"id": "str", "label": "str", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L16"}, {"id": "int", "label": "int", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L16"}, {"id": "scripts_add_list_index_columns_extract_first_column", "label": "extract_first_column()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L27"}, {"id": "scripts_add_list_index_columns_leading_indent", "label": "leading_indent()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L51"}, {"id": "scripts_add_list_index_columns_build_index_column", "label": "build_index_column()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L56"}, {"id": "bool", "label": "bool", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L56"}, {"id": "scripts_add_list_index_columns_should_use_pagination", "label": "should_use_pagination()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L74"}, {"id": "scripts_add_list_index_columns_insert_index_into_block", "label": "insert_index_into_block()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L88"}, {"id": "scripts_add_list_index_columns_process_file", "label": "process_file()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L108"}, {"id": "path", "label": "Path", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L108"}, {"id": "scripts_add_list_index_columns_main", "label": "main()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L134"}], "edges": [{"source": "users_zlwu_work_00code_shanxia2_0_web_admin_scripts_add_list_index_columns_py", "target": "re", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L6", "weight": 1.0}, {"source": "users_zlwu_work_00code_shanxia2_0_web_admin_scripts_add_list_index_columns_py", "target": "sys", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L7", "weight": 1.0}, {"source": "users_zlwu_work_00code_shanxia2_0_web_admin_scripts_add_list_index_columns_py", "target": "pathlib", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L8", "weight": 1.0}, {"source": "users_zlwu_work_00code_shanxia2_0_web_admin_scripts_add_list_index_columns_py", "target": "scripts_add_list_index_columns_find_table_spans", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L16", "weight": 1.0}, {"source": "scripts_add_list_index_columns_find_table_spans", "target": "str", "relation": "references", "context": "parameter_type", "confidence": "EXTRACTED", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L16", "weight": 1.0}, {"source": "scripts_add_list_index_columns_find_table_spans", "target": "int", "relation": "references", "context": "generic_arg", "confidence": "EXTRACTED", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py", "source_location": "L16", "weight": 1.0}, {"source": "scripts_add_list_index_columns_find_table_spans", "target": "int", "relation": "references", "context": "generic_arg", "confidence": "EXTRACTED", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scriptsLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"nodes": [{"id": "users_zlwu_work_00code_shanxia2_0_web_admin_scripts_apply_list_toolbar_refresh_py", "label": "apply-list-toolbar-refresh.py", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L1"}, {"id": "scripts_apply_list_toolbar_refresh_detect_refresh_handler", "label": "detect_refresh_handler()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L81"}, {"id": "str", "label": "str", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L81"}, {"id": "scripts_apply_list_toolbar_refresh_has_loading_ref", "label": "has_loading_ref()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L90"}, {"id": "bool", "label": "bool", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L90"}, {"id": "scripts_apply_list_toolbar_refresh_find_toolbar_insert_point", "label": "find_toolbar_insert_point()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L98"}, {"id": "match", "label": "Match", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L98"}, {"id": "scripts_apply_list_toolbar_refresh_insert_component_import", "label": "insert_component_import()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L115"}, {"id": "scripts_apply_list_toolbar_refresh_apply_file", "label": "apply_file()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L135"}, {"id": "path", "label": "Path", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L135"}, {"id": "scripts_apply_list_toolbar_refresh_main", "label": "main()", "file_type": "code", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L169"}, {"id": "scripts_apply_list_toolbar_refresh_rationale_99", "label": "Find end of first list-toolbar-row block before list-body.", "file_type": "rationale", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L99"}, {"id": "scripts_apply_list_toolbar_refresh_rationale_116", "label": "Append ListToolbarEndActions import after existing import block.", "file_type": "rationale", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L116"}], "edges": [{"source": "users_zlwu_work_00code_shanxia2_0_web_admin_scripts_apply_list_toolbar_refresh_py", "target": "re", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L6", "weight": 1.0}, {"source": "users_zlwu_work_00code_shanxia2_0_web_admin_scripts_apply_list_toolbar_refresh_py", "target": "pathlib", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L7", "weight": 1.0}, {"source": "users_zlwu_work_00code_shanxia2_0_web_admin_scripts_apply_list_toolbar_refresh_py", "target": "scripts_apply_list_toolbar_refresh_detect_refresh_handler", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L81", "weight": 1.0}, {"source": "scripts_apply_list_toolbar_refresh_detect_refresh_handler", "target": "str", "relation": "references", "context": "parameter_type", "confidence": "EXTRACTED", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L81", "weight": 1.0}, {"source": "scripts_apply_list_toolbar_refresh_detect_refresh_handler", "target": "str", "relation": "references", "context": "return_type", "confidence": "EXTRACTED", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py", "source_location": "L81", "weight": 1.0}, {"source": "users_zlwu_work_00code_shanxia2_0_web_admin_scripts_apply_list_toolbar_refresh_py", "target": "scripts_apply_list_toolbar_refresh_has_loading_ref", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-lisLine truncated
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"/Users/zlwu/work/00code/shanxia2.0/web-admin/package.json":{"size":3957,"mtime_ns":1781960299953649209,"hash":"ca01a16c94014e791391dfd8896f93c1ba7c451db1afa2f49f8a2a68b87dcc56"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/tsconfig.json":{"size":921,"mtime_ns":1780108931391506392,"hash":"8cec43256bc87216f729ae2c9588979558b20f33831419aa58502b54f5127c98"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/.vscode/settings.json":{"size":425,"mtime_ns":1780108931156918274,"hash":"0f2b6369eaf54ccac995e091d7ef5e292fa1396eadd32b64cbddd5bba0018d14"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/.vscode/extensions.json":{"size":200,"mtime_ns":1780108931156854566,"hash":"520c42e097d801a599814f12fe6a97bf5d7100e5395fd33217a365baa2cfe3c8"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/src/locales/langs/zh.json":{"size":10130,"mtime_ns":1780108931365472245,"hash":"f9834cd440df5dbce6ee91cc778c58b604d72d9652c48e8a285ac41e2d1be44f"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/src/locales/langs/en.json":{"size":10269,"mtime_ns":1780108931365387869,"hash":"fd0abc176e117037235c47e12bd682d93a8dc50183e14b54e20e169fb5714758"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/src/mock/json/chinaMap.json":{"size":956443,"mtime_ns":1780108931366831877,"hash":"2ce3f532aed5b51fa9b64bf134bf1d77c7886e695fd55a3368333584cbef4113"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/src/assets/data/china-region-flat.json":{"size":341606,"mtime_ns":1780108931184708348,"hash":"120c09f381ee3ac8fc6282e0be885a72ff256093c5aebf7a0861e38185d5f8ae"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/src/assets/data/china-region-cascader.json":{"size":217969,"mtime_ns":1780108931184402180,"hash":"63789a66f6bd55e8adeda487f6e4f361f1a916c4fdb3e2d8961ee412de57d307"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/CHANGELOG.md":{"size":19526,"mtime_ns":1780108931156993275,"hash":"3e1cf79e220067ef1e99102d5cee89646591a03e292f7ca957e209ee264d416a"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/README.md":{"size":4196,"mtime_ns":1780108931157199359,"hash":"114c94f9bf11e2083f1c985b2a5f58c5fbc50334dfbd25438415f21f8f577150"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/CHANGELOG.zh-CN.md":{"size":17172,"mtime_ns":1780108931157071900,"hash":"f4ec5751d75c6d3ec0767fd9c1f5787cc96c0a1ab059ed199ae4de1f1959f9fc"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/README.zh-CN.md":{"size":3775,"mtime_ns":1780108931157266568,"hash":"75a5522b08799b17dfe4416d20153a9cd247f5cbf280fe04ed0858a8337dc2d7"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/src/views/crm/clue/README.md":{"size":7884,"mtime_ns":1780211534938564937,"hash":"43ee077b77166be37ebf44e0f13c8f01801f08a8274ebfa976ae21cbe8c27ca7"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-quote-vue.py":{"size":4450,"mtime_ns":1780242127112333277,"hash":"97378f52743089231fbc83430106cad7701aa59b045126af45a238d7d2878bac"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-index-shell.py":{"size":11102,"mtime_ns":1780228518737746875,"hash":"0557768a404e2a0d9f2d3b233599bd741bdeb61a8e2d3cadf8d8dc4f1d6be25d"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-vue.py":{"size":4673,"mtime_ns":1780228615418009691,"hash":"790b4297df996f03b45d2efda686e219d60cd8e0f796fd860c070ed2e13939d6"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-attachments.py":{"size":1708,"mtime_ns":1780229286334758010,"hash":"eb364a061d7f7a6659311604353cd64a53edc81c1f1413b626ddf0388d709c46"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-form-panel.py":{"size":5523,"mtime_ns":1780229250658746500,"hash":"c873cdb8f5e8d8339aec3f47dc840106e1a176e3c9ac210ddd6d0abe547d928a"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-form-attachments.py":{"size":14077,"mtime_ns":1780229316215427400,"hash":"470af77a8b9508291fab61aeee4c64bd495f78c77d09574e6b49962ce165eeaf"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-form-layout.py":{"size":5157,"mtime_ns":1780229581646441465,"hash":"d5d97158dd892bd942f61721bcae770de518de368f487c2a30129502b3125787"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-detail-fresh-mint.py":{"size":24615,"mtime_ns":1780229887010846627,"hash":"daf372506c69aa3a92a4ddf3d508252ae63b68718d00bb49fb03914cc8bcfee3"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py":{"size":5207,"mtime_ns":1782833189049773933,"hash":"b11f3424426b01a6445011dff30122103d5e7d40dd997167723ef66d7b742e7b"}}
|
||||
{"/Users/zlwu/work/00code/shanxia2.0/web-admin/package.json":{"size":3957,"mtime_ns":1781960299953649209,"hash":"ca01a16c94014e791391dfd8896f93c1ba7c451db1afa2f49f8a2a68b87dcc56"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/tsconfig.json":{"size":921,"mtime_ns":1780108931391506392,"hash":"8cec43256bc87216f729ae2c9588979558b20f33831419aa58502b54f5127c98"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/.vscode/settings.json":{"size":425,"mtime_ns":1780108931156918274,"hash":"0f2b6369eaf54ccac995e091d7ef5e292fa1396eadd32b64cbddd5bba0018d14"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/.vscode/extensions.json":{"size":200,"mtime_ns":1780108931156854566,"hash":"520c42e097d801a599814f12fe6a97bf5d7100e5395fd33217a365baa2cfe3c8"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/src/locales/langs/zh.json":{"size":10130,"mtime_ns":1780108931365472245,"hash":"f9834cd440df5dbce6ee91cc778c58b604d72d9652c48e8a285ac41e2d1be44f"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/src/locales/langs/en.json":{"size":10269,"mtime_ns":1780108931365387869,"hash":"fd0abc176e117037235c47e12bd682d93a8dc50183e14b54e20e169fb5714758"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/src/mock/json/chinaMap.json":{"size":956443,"mtime_ns":1780108931366831877,"hash":"2ce3f532aed5b51fa9b64bf134bf1d77c7886e695fd55a3368333584cbef4113"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/src/assets/data/china-region-flat.json":{"size":341606,"mtime_ns":1780108931184708348,"hash":"120c09f381ee3ac8fc6282e0be885a72ff256093c5aebf7a0861e38185d5f8ae"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/src/assets/data/china-region-cascader.json":{"size":217969,"mtime_ns":1780108931184402180,"hash":"63789a66f6bd55e8adeda487f6e4f361f1a916c4fdb3e2d8961ee412de57d307"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/CHANGELOG.md":{"size":19526,"mtime_ns":1780108931156993275,"hash":"3e1cf79e220067ef1e99102d5cee89646591a03e292f7ca957e209ee264d416a"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/README.md":{"size":4196,"mtime_ns":1780108931157199359,"hash":"114c94f9bf11e2083f1c985b2a5f58c5fbc50334dfbd25438415f21f8f577150"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/CHANGELOG.zh-CN.md":{"size":17172,"mtime_ns":1780108931157071900,"hash":"f4ec5751d75c6d3ec0767fd9c1f5787cc96c0a1ab059ed199ae4de1f1959f9fc"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/README.zh-CN.md":{"size":3775,"mtime_ns":1780108931157266568,"hash":"75a5522b08799b17dfe4416d20153a9cd247f5cbf280fe04ed0858a8337dc2d7"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/src/views/crm/clue/README.md":{"size":7884,"mtime_ns":1780211534938564937,"hash":"43ee077b77166be37ebf44e0f13c8f01801f08a8274ebfa976ae21cbe8c27ca7"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-quote-vue.py":{"size":4450,"mtime_ns":1780242127112333277,"hash":"97378f52743089231fbc83430106cad7701aa59b045126af45a238d7d2878bac"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-index-shell.py":{"size":11102,"mtime_ns":1780228518737746875,"hash":"0557768a404e2a0d9f2d3b233599bd741bdeb61a8e2d3cadf8d8dc4f1d6be25d"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-vue.py":{"size":4673,"mtime_ns":1780228615418009691,"hash":"790b4297df996f03b45d2efda686e219d60cd8e0f796fd860c070ed2e13939d6"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-attachments.py":{"size":1708,"mtime_ns":1780229286334758010,"hash":"eb364a061d7f7a6659311604353cd64a53edc81c1f1413b626ddf0388d709c46"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-form-panel.py":{"size":5523,"mtime_ns":1780229250658746500,"hash":"c873cdb8f5e8d8339aec3f47dc840106e1a176e3c9ac210ddd6d0abe547d928a"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-form-attachments.py":{"size":14077,"mtime_ns":1780229316215427400,"hash":"470af77a8b9508291fab61aeee4c64bd495f78c77d09574e6b49962ce165eeaf"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-form-layout.py":{"size":5157,"mtime_ns":1780229581646441465,"hash":"d5d97158dd892bd942f61721bcae770de518de368f487c2a30129502b3125787"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/migrate-contract-detail-fresh-mint.py":{"size":24615,"mtime_ns":1780229887010846627,"hash":"daf372506c69aa3a92a4ddf3d508252ae63b68718d00bb49fb03914cc8bcfee3"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/apply-list-toolbar-refresh.py":{"size":5777,"mtime_ns":1782834192989973152,"hash":"a2329df76d2aca29b6a7c751e43e61ec47b569718de910f3f10a2391d7b3bedb"},"/Users/zlwu/work/00code/shanxia2.0/web-admin/scripts/add-list-index-columns.py":{"size":4644,"mtime_ns":1782865925817727372,"hash":"7e769c9dcb928cb8c4a5ce3eecebd488b94c4a2467959c99d8ec4cbed76bdb44"}}
|
||||
+5727
-4071
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated by Pixelmator Pro 3.5.8 -->
|
||||
<svg width="2000" height="935" viewBox="0 0 2000 935" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<image id="image1" x="0" y="0" width="4619" height="935" xlink:href="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAEgsAAAOnCAYAAAAAAMEkAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAASC6ADAAQAAAABAAADpwAAAACZim2kAABAAElEQVR4AezdC3Cd55kf9uc7N1wIgDeQBEkIvJMAQ0LWhRJkmpLDrBxpJS8tS5z4EnsjO1LHli/y0CtLu2tlxkmdDTty0m7qSWfSaSaZJDvptlsn20yTzagZc7FRp5ttx3aXlGkblkTdCOhGUSIInEtxqGhWF1IkwQOc75zv98kyifN97/s+z+85RwOOjL+Tzz954A9/9mzutqdPRj5cBAikVmDjmlrs3BAnN6+v/aNiKf7x1yZ/4+nTRw6ktt5GF9Y58lB07fxW8jvlT9w+NRUP/fnTse/4iSR/ZqbRJ9mPAAECBAgQIECAAAECBAgQIECAAAECBAgQIEAgawJDq6OydX31//inO35wZ9Z61y8BAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECDQOgI5QUGtMyyVZlvgly8m8eKrsTqidvXsmbgqS0FB9clPHz0csyf/uJarxsYXXo3rfyooKNsfCN0TIECAAAECBAgQIECAAAECBAgQIECAAAECBBooUP8/16n/u/MGbmkrAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgEDDBXL1/9Fjw3e1IQECCyKQSyJySe6XD/xpbXxBDkj5pvWApG+8+s3vlytxdqac8mKVR4AAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg0FIC/t15S41LsQQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAIJMCuUx2rWkCLSiwdmXEv1r/zbjv3xz5enkyk1lB56ZWDwz6Z6u+uXL9yqi24BiVTIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQGBeAsKC5sVmEYHFFZjYfyge76hEPSjHFecc/n2xkqu7uAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAhkQUBYUBamrMeWFTg+OhZH170VElSeHG/ZPhai8LpHPTyp7lN3ShbiEHsSIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQSIlAISV1KINA5gUm9h+K8tRbgUDTRw+f85g++sPMu1wMoB4aVP/7R8W3nuwceejcbwr9e2PT449dbLn7BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBFpCQFhQS4xJke0qcHx07Fxr9XCg00cEAzVizm8HLdX3+vFcgFBh1d6oBwdt+9ETjdjeHgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgSaIiAsqCnsDs26QD0kqB5qM31UQNBCvxfKk+NR/7seHNQ58pDQoIUGtz8BAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgMCCCOQWZFebEiDwPoGJ/YeiHhL04+IPzwUFve8BLyy4QD2gqe5/dF0l6vNwESBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIEGgVAWFBrTIpdbasQD2Uph5Oc/rIASFBKZlieXL83DyEBqVkIMogQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBC4qICwoIsSeYDA/ATeGRJUD6dxpU9AaFD6ZqIiAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgACB8wsICzq/i1cJzFtASNC86Zq2UGhQ0+gdTIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgcIkCwoIuEcpjBC5F4Oi6Spw+ciDq4TOu1hMQGtR6M1MxAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQCArAsKCsjJpfS6owPHRsfhx8YdCghZUefE2f2do0OKd6iQCBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECFxYQFnRhG3cIXFTg7ZCg6aOHL/qsB1pPoB4aVA+Bqs/ZRYAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQKCZAsKCmqnv7JYVmNh/KI6uq4SQoJYd4WUVXp9zPTSoPncXAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAgWYICAtqhrozW1qgHhJ0+siBKE+Ot3Qfir98gfrc6/MXGnT5dlYQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAhcmUDhypZbTSA7AvWAmLdCgrLTs07fL1APiTo9eSCOjz4U2370xPsf8AoBAgQIECDQMgL5uejUrs6oLSnlap3FpFovfEV3Z3WmUk1qUTvXRxJJ5JKY++8kzpTLterc69VqJDOzldwbM9Xcm9ORzFYiam893jK9K5QAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQKD1BIQFtd7MVLzIAvWQoOljh88FBS3y0Y5LscD00cNxdN3e6Bx+KDY9/liKK1UaAQIECBDIrkCuHgZUiti+pnvmzFy4z2w5kjfP1pJTZ+pBP5Wo1OOByqWkp7M7WV7sznUXS1FI8pEUI6pRqccCnftrLgroXHRQX742t6Ya0+VKvDp7Nl6bORMz5dlzwN2lXCztzle7O5JaRyGpPfPK2fyZs5HMPeoiQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg0BABYUENYbRJuwocHx0TEtSuw21AX+XJ8Tg9eSCOjz4U2370RAN2tAUBAgQIECAwX4FcErF5TbFSDwA6OxvJa29Wc2+crURSLcbp17tLq7uWxfLuZdHXtzSWFftiZcfSGFyyKjb0DMRg9+pYWlpyWUe/NvNGnHjzZDx1+oU48cZkvDB9MiZnXspNnX05Tp55JWrlapQrs7GkIx/LluSrS0pRm3pjJnf6TCQz5cs6ysMECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIEzgkkg793V40FAQLvFzi6rhL1MBgXgUsRKKzaG53DD8Wmxx+7lMc9Q4AAAQIECFyBQD4XsaQramt6S9U3ztaS196YCwaaqURfR0ds6FsVm3vWxdaejbG1dyg29a6dVxjQFZQXbwcJTbz+fPzs9afi+OmnYuL0s/HLU5Px+tmZWNGTr3XWw4NOVXKzlYiaP5FdCbe1BAgQIECAAAECBAgQIECAAIGGCpz41B/MxVK7CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQLpFBAWlM65qKqJAhP7D8XpIweaWIGjW1mgc+Sh2PajJ1q5BbUTIECAAIHUCeTmwoG6ShH9PYXq6blwoJderyRdxUJsWbo6NvcOxraeTXPBQFfN/X5dbOwZiO5CZ+p6eKM8Hb+cCw968tRT8f+8+v/FT179eRx7+dmozv21oidX7elKqj9/caYwW05d6QoiQIAAAQIECBAgQIAAAQIECGRKQFhQpsatWQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg0HICwoJabmQKXkiBo+sqUZ4cX8gj7J0BgcKqvTHyXD4DnWqRAAECBAgsnEB+LiBoeU/UlnYVq1Onq7nX3qgkq5f0xvX92+PD/dfE1cu3xZa+9dFb7F64IhZw59lqOY69Nhcc9PJP40+m/iz+75NPxsk3T8faZcXqip6kevS5mUK1uoAF2JoAAQIECBAgQIAAAQIECBAgQOC8AsKCzsviRQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQCAlAsKCUjIIZTRXYGL/oZg+dlhLine truncated
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 274 KiB |
@@ -0,0 +1,146 @@
|
||||
#!/usr/bin/env python3
|
||||
"""为 web-admin 中缺少序号的 el-table 批量插入序号列。"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1] / "src"
|
||||
SKIP_FILES = {
|
||||
ROOT / "components/bx/base/BaseTable.vue",
|
||||
}
|
||||
|
||||
|
||||
def find_table_spans(text: str) -> list[tuple[int, int]]:
|
||||
spans: list[tuple[int, int]] = []
|
||||
for m in re.finditer(r"<el-table(?:\s|>)", text):
|
||||
start = m.start()
|
||||
end_m = re.search(r"</el-table>", text[start:])
|
||||
if not end_m:
|
||||
continue
|
||||
spans.append((start, start + end_m.end()))
|
||||
return spans
|
||||
|
||||
|
||||
def extract_first_column(block: str) -> tuple[int, int, str] | None:
|
||||
table_open = re.search(r"<el-table\b[^>]*>", block)
|
||||
if not table_open:
|
||||
return None
|
||||
pos = table_open.end()
|
||||
m = re.search(r"(\s*)<el-table-column\b", block[pos:])
|
||||
if not m:
|
||||
return None
|
||||
col_start = pos + m.start() + len(m.group(1))
|
||||
rest = block[col_start:]
|
||||
self_close = re.match(r"(<el-table-column\b[^>]*?/>)", rest, re.DOTALL)
|
||||
if self_close:
|
||||
col_end = col_start + len(self_close.group(1))
|
||||
return col_start, col_end, block[col_start:col_end]
|
||||
open_end = rest.find(">")
|
||||
if open_end == -1:
|
||||
return None
|
||||
close = rest.find("</el-table-column>", open_end)
|
||||
if close == -1:
|
||||
return None
|
||||
col_end = col_start + close + len("</el-table-column>")
|
||||
return col_start, col_end, block[col_start:col_end]
|
||||
|
||||
|
||||
def leading_indent(block: str, col_start: int) -> str:
|
||||
line_start = block.rfind("\n", 0, col_start) + 1
|
||||
return re.match(r"[ \t]*", block[line_start:col_start]).group(0)
|
||||
|
||||
|
||||
def build_index_column(indent: str, paginated: bool) -> str:
|
||||
if paginated:
|
||||
return (
|
||||
f"{indent}<el-table-column\n"
|
||||
f"{indent} type=\"index\"\n"
|
||||
f"{indent} label=\"序号\"\n"
|
||||
f"{indent} min-width=\"68\"\n"
|
||||
f"{indent} align=\"center\"\n"
|
||||
f"{indent} header-align=\"center\"\n"
|
||||
f"{indent} :index=\"(index) => (pagination.page - 1) * pagination.pageSize + index + 1\"\n"
|
||||
f"{indent}/>"
|
||||
)
|
||||
return (
|
||||
f'{indent}<el-table-column type="index" label="序号" min-width="68" '
|
||||
f'align="center" header-align="center" />'
|
||||
)
|
||||
|
||||
|
||||
def should_use_pagination(block: str, file_text: str) -> bool:
|
||||
if "pagination.page" not in file_text:
|
||||
return False
|
||||
table_open = re.search(r"<el-table\b[^>]*>", block)
|
||||
if not table_open:
|
||||
return False
|
||||
opening = table_open.group(0)
|
||||
if 'size="small"' in opening or "size='small'" in opening:
|
||||
return False
|
||||
if "sub-table" in opening:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def insert_index_into_block(block: str, file_text: str) -> str | None:
|
||||
if 'type="index"' in block or "type='index'" in block:
|
||||
return None
|
||||
first = extract_first_column(block)
|
||||
if not first:
|
||||
return None
|
||||
col_start, col_end, first_col = first
|
||||
indent = leading_indent(block, col_start)
|
||||
paginated = should_use_pagination(block, file_text)
|
||||
index_col = build_index_column(indent, paginated)
|
||||
is_select = re.search(r'type="(selection|radio)"', first_col) is not None
|
||||
if is_select:
|
||||
insert_at = col_end
|
||||
new_block = block[:insert_at] + "\n" + index_col + block[insert_at:]
|
||||
else:
|
||||
line_start = block.rfind("\n", 0, col_start) + 1
|
||||
new_block = block[:line_start] + index_col + "\n" + block[line_start:]
|
||||
return new_block
|
||||
|
||||
|
||||
def process_file(path: Path) -> bool:
|
||||
if path in SKIP_FILES:
|
||||
return False
|
||||
text = path.read_text(encoding="utf-8")
|
||||
if not re.search(r"<el-table(?:\s|>)", text):
|
||||
return False
|
||||
spans = find_table_spans(text)
|
||||
if not spans:
|
||||
return False
|
||||
changed = False
|
||||
offset = 0
|
||||
for start, end in spans:
|
||||
start += offset
|
||||
end += offset
|
||||
block = text[start:end]
|
||||
new_block = insert_index_into_block(block, text)
|
||||
if not new_block:
|
||||
continue
|
||||
text = text[:start] + new_block + text[end:]
|
||||
offset += len(new_block) - len(block)
|
||||
changed = True
|
||||
if changed:
|
||||
path.write_text(text, encoding="utf-8")
|
||||
return changed
|
||||
|
||||
|
||||
def main() -> int:
|
||||
changed_files: list[str] = []
|
||||
for path in sorted(ROOT.rglob("*.vue")):
|
||||
if process_file(path):
|
||||
changed_files.append(str(path.relative_to(ROOT.parents[0])))
|
||||
print(f"Updated {len(changed_files)} files")
|
||||
for f in changed_files:
|
||||
print(f" {f}")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -575,3 +575,10 @@ export function fetchAttachmentDownloadUrl(data: { fileUrl: string; fileName?: s
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchAttachmentPreviewUrl(data: { fileUrl: string; fileName?: string }) {
|
||||
return request.post<{ previewUrl: string }>({
|
||||
url: '/web/admin/attachment/preview-url',
|
||||
data
|
||||
})
|
||||
}
|
||||
@@ -622,6 +622,12 @@ export interface UnsettledPlanItem {
|
||||
transportCompany?: string
|
||||
freightAmount: number
|
||||
archiveTime?: string
|
||||
transportId: string
|
||||
transportNo?: string
|
||||
driverName?: string
|
||||
transportMedium?: string
|
||||
startPoint?: string
|
||||
endPoint?: string
|
||||
}
|
||||
|
||||
export interface UnsettledPlanQuery {
|
||||
@@ -740,6 +746,15 @@ export interface FreightSettlementDisburseBody {
|
||||
remark?: string
|
||||
}
|
||||
|
||||
export interface FreightSettlementUpdateBody {
|
||||
invoiceNo?: string
|
||||
invoiceDate?: string
|
||||
invoiceAmount?: number
|
||||
invoiceAttachmentUrls?: string
|
||||
remark?: string
|
||||
transportIds?: string[]
|
||||
}
|
||||
|
||||
export const freightApi = {
|
||||
listUnsettledPlans: (params?: UnsettledPlanQuery) =>
|
||||
request.get<UnsettledPlanListResponse>('/transport/freight/unsettled-plans', { params }),
|
||||
@@ -750,7 +765,7 @@ export const freightApi = {
|
||||
get: (id: string) => request.get<FreightSettlement>(`/transport/freight/${id}`),
|
||||
create: (data: { planIds?: string[]; transportIds?: string[] }) =>
|
||||
request.post<FreightSettlement>('/transport/freight/', data),
|
||||
update: (id: string, data: Partial<FreightSettlement>) =>
|
||||
update: (id: string, data: FreightSettlementUpdateBody) =>
|
||||
request.put<FreightSettlement>(`/transport/freight/${id}`, data),
|
||||
cancel: (id: string) => request.post<FreightSettlement>(`/transport/freight/${id}/cancel`),
|
||||
delete: (id: string) => request.delete(`/transport/freight/${id}`),
|
||||
|
||||
@@ -396,7 +396,7 @@ body {
|
||||
justify-content: center;
|
||||
background: var(--mint-primary-bg);
|
||||
color: var(--mint-primary-dark);
|
||||
border: 1px solid rgba(16, 185, 129, 0.16);
|
||||
border: 1px solid rgba(28, 168, 81, 0.16);
|
||||
margin-right: 4px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -425,7 +425,7 @@ body {
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
border-radius: 999px;
|
||||
background: var(--mint-primary, #10b981);
|
||||
background: var(--mint-primary, #1ca851);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
@@ -464,8 +464,8 @@ body {
|
||||
display: inline-flex;
|
||||
gap: 4px;
|
||||
padding: 4px;
|
||||
background: linear-gradient(180deg, var(--primary-bg, #ecfdf5) 0%, #fff 100%);
|
||||
border: 1px solid #d1fae5;
|
||||
background: linear-gradient(180deg, var(--primary-bg, #e6f8ed) 0%, #fff 100%);
|
||||
border: 1px solid #d4f0de;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
@@ -492,18 +492,18 @@ body {
|
||||
box-shadow 0.15s;
|
||||
|
||||
&:hover:not(.is-active) {
|
||||
color: #065f46;
|
||||
color: #125a30;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
background: var(--primary, #10b981);
|
||||
background: var(--primary, #1ca851);
|
||||
color: #fff;
|
||||
box-shadow: 0 1px 3px rgba(16, 185, 129, 0.28);
|
||||
box-shadow: 0 1px 3px rgba(28, 168, 81, 0.28);
|
||||
font-weight: 500;
|
||||
|
||||
&:hover {
|
||||
color: #fff;
|
||||
background: var(--primary, #10b981);
|
||||
background: var(--primary, #1ca851);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -524,13 +524,13 @@ body {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
border: 2px solid #d1fae5;
|
||||
border: 2px solid #d4f0de;
|
||||
pointer-events: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__btn.is-active &__badge {
|
||||
border-color: var(--primary, #10b981);
|
||||
border-color: var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
&__badge--zero {
|
||||
@@ -546,8 +546,8 @@ body {
|
||||
|
||||
&__btn.is-active &__badge--zero {
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
color: var(--primary-dark, #059669);
|
||||
border-color: var(--primary, #10b981);
|
||||
color: var(--primary-dark, #168f45);
|
||||
border-color: var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
// el-tabs 结构
|
||||
@@ -578,8 +578,8 @@ body {
|
||||
gap: 4px;
|
||||
float: none;
|
||||
padding: 4px;
|
||||
background: linear-gradient(180deg, var(--primary-bg, #ecfdf5) 0%, #fff 100%);
|
||||
border: 1px solid #d1fae5;
|
||||
background: linear-gradient(180deg, var(--primary-bg, #e6f8ed) 0%, #fff 100%);
|
||||
border: 1px solid #d4f0de;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
@@ -609,18 +609,18 @@ body {
|
||||
box-shadow 0.15s;
|
||||
|
||||
&:hover:not(.is-active) {
|
||||
color: #065f46;
|
||||
color: #125a30;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
background: var(--primary, #10b981);
|
||||
background: var(--primary, #1ca851);
|
||||
color: #fff;
|
||||
box-shadow: 0 1px 3px rgba(16, 185, 129, 0.28);
|
||||
box-shadow: 0 1px 3px rgba(28, 168, 81, 0.28);
|
||||
font-weight: 500;
|
||||
|
||||
&:hover {
|
||||
color: #fff;
|
||||
background: var(--primary, #10b981);
|
||||
background: var(--primary, #1ca851);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -799,7 +799,7 @@ body {
|
||||
justify-content: center;
|
||||
background: var(--mint-primary-bg);
|
||||
color: var(--mint-primary-dark);
|
||||
border: 1px solid rgba(16, 185, 129, 0.16);
|
||||
border: 1px solid rgba(28, 168, 81, 0.16);
|
||||
margin-right: 4px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -1373,7 +1373,7 @@ body {
|
||||
|
||||
/* Portal 一体化顶栏(对齐 zkxw TOP_LEFT 顶栏 56px + Fresh Mint) */
|
||||
#app-portal-header .portal-header {
|
||||
background: var(--mint-surface) !important;
|
||||
background: var(--mint-primary) !important;
|
||||
}
|
||||
|
||||
.app-layout-portal #app-worktab .worktab-strip {
|
||||
@@ -1381,11 +1381,6 @@ body {
|
||||
padding: 0 24px 4px !important;
|
||||
}
|
||||
|
||||
.app-layout-portal #app-sidebar .layout-sidebar {
|
||||
border-right: 1px solid var(--mint-border) !important;
|
||||
background: var(--mint-surface);
|
||||
}
|
||||
|
||||
/* 弹窗 / 抽屉内键值展示:上下布局、深色正文(对齐 zkxw Token 链) */
|
||||
:is(.el-dialog, .system-view-dialog, .el-drawer) {
|
||||
:is(.view-kv, [class*='-view-kv']:not([class*='-grid']), .pl-plan-kv) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
'white': #ffffff,
|
||||
'black': #000000,
|
||||
'success': (
|
||||
'base': #059669
|
||||
'base': #168f45
|
||||
),
|
||||
'warning': (
|
||||
'base': #ffae1f
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
// 系统主色
|
||||
--main-color: var(--mint-primary);
|
||||
--el-color-primary: var(--mint-primary) !important;
|
||||
--el-color-primary-light-3: #0d9d6e !important;
|
||||
--el-color-primary-light-5: #34a88a !important;
|
||||
--el-color-primary-light-7: #6bb99a !important;
|
||||
--el-color-primary-light-8: #a8d4c4 !important;
|
||||
--el-color-primary-light-3: #4db872 !important;
|
||||
--el-color-primary-light-5: #73c892 !important;
|
||||
--el-color-primary-light-7: #a8e0b8 !important;
|
||||
--el-color-primary-light-8: #c8ecd4 !important;
|
||||
--el-color-primary-light-9: var(--mint-primary-bg) !important;
|
||||
--el-color-primary-dark-2: var(--mint-primary-dark) !important;
|
||||
--el-border-color: var(--mint-border) !important;
|
||||
@@ -785,8 +785,8 @@ body .el-table thead {
|
||||
|
||||
.page-container .el-tag--success,
|
||||
.console-container .el-tag--success {
|
||||
background: #d1fae5 !important;
|
||||
color: #047857 !important;
|
||||
background: #d4f0de !important;
|
||||
color: #147a3c !important;
|
||||
}
|
||||
|
||||
.page-container .el-tag--warning,
|
||||
@@ -810,8 +810,8 @@ body .el-table thead {
|
||||
|
||||
.page-container .el-tag--primary,
|
||||
.console-container .el-tag--primary {
|
||||
background: #ecfdf5 !important;
|
||||
color: #059669 !important;
|
||||
background: #e6f8ed !important;
|
||||
color: #168f45 !important;
|
||||
}
|
||||
|
||||
.page-container .el-button--primary,
|
||||
@@ -946,7 +946,7 @@ textarea::placeholder {
|
||||
.console-container .el-select__wrapper.is-focused {
|
||||
box-shadow:
|
||||
0 0 0 1px var(--mint-primary) inset,
|
||||
0 0 0 2px rgba(16, 185, 129, 0.2) !important;
|
||||
0 0 0 2px rgba(28, 168, 81, 0.2) !important;
|
||||
}
|
||||
|
||||
.page-container .btn-main.el-button,
|
||||
@@ -1154,7 +1154,7 @@ textarea::placeholder {
|
||||
):focus-visible {
|
||||
background: var(--mint-primary-bg) !important;
|
||||
border-color: var(--mint-primary) !important;
|
||||
color: #047857 !important;
|
||||
color: #147a3c !important;
|
||||
}
|
||||
|
||||
.page-container
|
||||
@@ -1193,7 +1193,7 @@ textarea::placeholder {
|
||||
.op-warn
|
||||
):focus-visible
|
||||
.el-icon {
|
||||
color: #047857 !important;
|
||||
color: #147a3c !important;
|
||||
}
|
||||
|
||||
// 列表分割线统一:每个分区只保留一条线
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Fresh Mint 设计令牌(与 docs/web-admin-ui-spec-fresh-mint.md 一致;Step1 对齐 zkxw 语义色)
|
||||
:root {
|
||||
--mint-primary: #10b981;
|
||||
--mint-primary-dark: #059669;
|
||||
--mint-primary-bg: #ecfdf5;
|
||||
--mint-primary: #1ca851;
|
||||
--mint-primary-dark: #168f45;
|
||||
--mint-primary-bg: #e6f8ed;
|
||||
--mint-text: #1e293b;
|
||||
/* 略浅于主文字:label / 说明 / 表头等次要文字,可读且保留层次(对齐 zkxw 实践) */
|
||||
--mint-text-muted: #334155;
|
||||
@@ -18,10 +18,10 @@
|
||||
--mint-content-padding: 24px;
|
||||
|
||||
/* 成功 / 启用等语义色(深一档于主色,便于与 primary Tag 区分) */
|
||||
--mint-success: #059669;
|
||||
--mint-success-dark: #047857;
|
||||
--mint-success-bg: #d1fae5;
|
||||
--mint-success-text: #047857;
|
||||
--mint-success: #168f45;
|
||||
--mint-success-dark: #147a3c;
|
||||
--mint-success-bg: #d4f0de;
|
||||
--mint-success-text: #147a3c;
|
||||
|
||||
--primary: var(--mint-primary);
|
||||
--primary-dark: var(--mint-primary-dark);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
@change="handleAttachmentChange"
|
||||
>
|
||||
<div class="upload-card">
|
||||
<el-icon :size="28" color="#10b981"><Plus /></el-icon>
|
||||
<el-icon :size="28" color="#1ca851"><Plus /></el-icon>
|
||||
<span class="upload-card-text">上传附件</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
@@ -23,6 +23,7 @@
|
||||
>
|
||||
<div
|
||||
class="attachment-preview"
|
||||
:class="{ 'is-clickable': canPreview(file) }"
|
||||
@click="canPreview(file) ? handlePreviewAttachment(file) : undefined"
|
||||
>
|
||||
<template v-if="isImageFile(file) && file.fileUrl">
|
||||
@@ -37,8 +38,14 @@
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="attachment-preview__icon attachment-preview__icon--doc">
|
||||
<div
|
||||
class="attachment-preview__icon"
|
||||
:class="isPdfFile(file) ? 'attachment-preview__icon--pdf' : 'attachment-preview__icon--doc'"
|
||||
>
|
||||
<el-icon :size="28"><Document /></el-icon>
|
||||
<span v-if="getFileExtension(file.fileName)" class="attachment-preview__ext">
|
||||
{{ getFileExtension(file.fileName) }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
@@ -68,24 +75,41 @@
|
||||
|
||||
<el-dialog
|
||||
v-model="previewVisible"
|
||||
title="附件预览"
|
||||
width="800px"
|
||||
:title="previewFile?.fileName || '附件预览'"
|
||||
width="860px"
|
||||
align-center
|
||||
destroy-on-close
|
||||
append-to-body
|
||||
modal-class="order-module-dialog-mask"
|
||||
@closed="handlePreviewClosed"
|
||||
>
|
||||
<img
|
||||
v-if="previewFile && isImageFile(previewFile)"
|
||||
:src="resolveFileUrl(previewFile.fileUrl)"
|
||||
:alt="previewFile.fileName"
|
||||
class="preview-media"
|
||||
/>
|
||||
<video
|
||||
v-else-if="previewFile && isVideoFile(previewFile)"
|
||||
:src="resolveFileUrl(previewFile.fileUrl)"
|
||||
controls
|
||||
class="preview-media"
|
||||
/>
|
||||
<div v-loading="previewLoading" class="preview-body">
|
||||
<img
|
||||
v-if="previewFile && isImageFile(previewFile)"
|
||||
:src="resolveFileUrl(previewFile.fileUrl)"
|
||||
:alt="previewFile.fileName"
|
||||
class="preview-media"
|
||||
/>
|
||||
<video
|
||||
v-else-if="previewFile && isVideoFile(previewFile)"
|
||||
:src="resolveFileUrl(previewFile.fileUrl)"
|
||||
controls
|
||||
class="preview-media"
|
||||
/>
|
||||
<iframe
|
||||
v-else-if="previewFile && isPdfFile(previewFile) && previewPdfSrc"
|
||||
:src="previewPdfSrc"
|
||||
class="preview-media preview-media--iframe"
|
||||
title="PDF 预览"
|
||||
/>
|
||||
<div
|
||||
v-else-if="previewFile && isPdfFile(previewFile) && !previewLoading"
|
||||
class="preview-fallback"
|
||||
>
|
||||
<el-icon :size="40" color="#94a3b8"><Document /></el-icon>
|
||||
<p>PDF 暂无法在线预览,请使用下载查看。</p>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -103,7 +127,10 @@ import {
|
||||
import type { UploadFile, UploadInstance } from 'element-plus'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { fetchUploadAttachment } from '@/api/admin'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import {
|
||||
downloadAttachmentFile,
|
||||
resolveAttachmentPreviewUrl
|
||||
} from '@/utils/download-attachment'
|
||||
|
||||
type AttachmentItem = {
|
||||
id: string
|
||||
@@ -140,6 +167,8 @@ const uploadRef = ref<UploadInstance>()
|
||||
const attachments = ref<AttachmentItem[]>([])
|
||||
const previewVisible = ref(false)
|
||||
const previewFile = ref<AttachmentItem | null>(null)
|
||||
const previewPdfSrc = ref('')
|
||||
const previewLoading = ref(false)
|
||||
|
||||
function resolveFileUrl(url: string) {
|
||||
const trimmed = String(url || '').trim()
|
||||
@@ -199,8 +228,26 @@ function isVideoFile(file: AttachmentItem) {
|
||||
return type.startsWith('video/') || /\.(mp4|webm|ogg|mov|avi)$/i.test(name)
|
||||
}
|
||||
|
||||
function isPdfFile(file: AttachmentItem) {
|
||||
const name = file.fileName.toLowerCase()
|
||||
const type = String(file.fileType || '').toLowerCase()
|
||||
const url = String(file.fileUrl || '').toLowerCase()
|
||||
return (
|
||||
type === 'application/pdf' ||
|
||||
/\.pdf$/i.test(name) ||
|
||||
/\.pdf(\?|$)/i.test(url)
|
||||
)
|
||||
}
|
||||
|
||||
function getFileExtension(fileName: string) {
|
||||
if (!fileName) return ''
|
||||
const lastDotIndex = fileName.lastIndexOf('.')
|
||||
if (lastDotIndex === -1) return ''
|
||||
return fileName.substring(lastDotIndex + 1).toUpperCase()
|
||||
}
|
||||
|
||||
function canPreview(file: AttachmentItem) {
|
||||
return Boolean(file.fileUrl) && (isImageFile(file) || isVideoFile(file))
|
||||
return Boolean(file.fileUrl) && (isImageFile(file) || isVideoFile(file) || isPdfFile(file))
|
||||
}
|
||||
|
||||
async function handleAttachmentChange(uploadFile: UploadFile) {
|
||||
@@ -260,7 +307,28 @@ function handleDownloadAttachment(file: AttachmentItem) {
|
||||
function handlePreviewAttachment(file: AttachmentItem) {
|
||||
if (!canPreview(file)) return
|
||||
previewFile.value = file
|
||||
previewPdfSrc.value = ''
|
||||
previewVisible.value = true
|
||||
|
||||
if (!isPdfFile(file)) return
|
||||
|
||||
previewLoading.value = true
|
||||
resolveAttachmentPreviewUrl(file, { fullFileUrl: resolveFileUrl })
|
||||
.then((url) => {
|
||||
if (previewFile.value?.id !== file.id) return
|
||||
previewPdfSrc.value = url
|
||||
})
|
||||
.finally(() => {
|
||||
if (previewFile.value?.id === file.id) {
|
||||
previewLoading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function handlePreviewClosed() {
|
||||
previewFile.value = null
|
||||
previewPdfSrc.value = ''
|
||||
previewLoading.value = false
|
||||
}
|
||||
|
||||
function hasUploading() {
|
||||
@@ -284,7 +352,7 @@ defineExpose({ hasUploading })
|
||||
.upload-card {
|
||||
width: 140px;
|
||||
height: 96px;
|
||||
border: 1px dashed #a7f3d0;
|
||||
border: 1px dashed #a8e0b8;
|
||||
border-radius: 8px;
|
||||
background: #f0fdf4;
|
||||
display: flex;
|
||||
@@ -295,15 +363,15 @@ defineExpose({ hasUploading })
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
border-color: #10b981;
|
||||
border-color: #1ca851;
|
||||
border-style: solid;
|
||||
background: #ecfdf5;
|
||||
background: #e6f8ed;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-card-text {
|
||||
font-size: 12px;
|
||||
color: #10b981;
|
||||
color: #1ca851;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
}
|
||||
@@ -329,8 +397,8 @@ defineExpose({ hasUploading })
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border-color: #10b981;
|
||||
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
|
||||
border-color: #1ca851;
|
||||
box-shadow: 0 2px 8px rgba(28, 168, 81, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,7 +410,10 @@ defineExpose({ hasUploading })
|
||||
justify-content: center;
|
||||
background: #f8fafc;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
|
||||
&.is-clickable {
|
||||
cursor: zoom-in;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
@@ -354,9 +425,10 @@ defineExpose({ hasUploading })
|
||||
|
||||
.attachment-preview__icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
min-height: 48px;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@@ -369,6 +441,18 @@ defineExpose({ hasUploading })
|
||||
background: #e0f2fe;
|
||||
color: #0284c7;
|
||||
}
|
||||
|
||||
&--pdf {
|
||||
background: #fee2e2;
|
||||
color: #dc2626;
|
||||
}
|
||||
}
|
||||
|
||||
.attachment-preview__ext {
|
||||
margin-top: 4px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
}
|
||||
|
||||
.attachment-footer {
|
||||
@@ -404,7 +488,7 @@ defineExpose({ hasUploading })
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background: #10b981;
|
||||
background: #1ca851;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -416,9 +500,33 @@ defineExpose({ hasUploading })
|
||||
|
||||
.preview-media {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
max-height: 70vh;
|
||||
margin: 0 auto;
|
||||
object-fit: contain;
|
||||
border-radius: 8px;
|
||||
background: #f8fafc;
|
||||
|
||||
&--iframe {
|
||||
height: 70vh;
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.preview-body {
|
||||
min-height: 240px;
|
||||
}
|
||||
|
||||
.preview-fallback {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
min-height: 240px;
|
||||
color: #1e293b;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
:deep(.el-upload) {
|
||||
|
||||
@@ -187,7 +187,7 @@ defineExpose({ hasUploading, clearUploadRefs })
|
||||
.cert-card-index {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--primary, #10b981);
|
||||
color: var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
.cert-card-index::before {
|
||||
@@ -198,7 +198,7 @@ defineExpose({ hasUploading, clearUploadRefs })
|
||||
margin-right: 8px;
|
||||
vertical-align: -2px;
|
||||
border-radius: 2px;
|
||||
background: var(--primary, #10b981);
|
||||
background: var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
.cert-card-grid {
|
||||
|
||||
@@ -105,7 +105,7 @@ function buildCertViewFields(cert: CertRead): ViewField[] {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
border-left: 3px solid #10b981;
|
||||
border-left: 3px solid #1ca851;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -293,8 +293,8 @@ defineExpose({ open })
|
||||
gap: 12px 24px;
|
||||
padding: 16px;
|
||||
border-radius: 10px;
|
||||
background: var(--primary-bg, #ecfdf5);
|
||||
border: 1px solid #a7f3d0;
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
border: 1px solid #a8e0b8;
|
||||
}
|
||||
|
||||
.summary-item {
|
||||
@@ -317,7 +317,7 @@ defineExpose({ open })
|
||||
&--amount {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: var(--primary-dark, #059669);
|
||||
color: var(--primary-dark, #168f45);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<el-input :model-value="settlement?.settlementNo" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="运费合计(元)">
|
||||
<el-input :model-value="formatAmount(settlement?.totalFreight)" disabled />
|
||||
<el-input :model-value="formatAmount(displayTotalFreight)" disabled />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="form-grid-3">
|
||||
@@ -72,11 +72,21 @@
|
||||
</el-form>
|
||||
|
||||
<section class="dialog-section">
|
||||
<h3 class="dialog-section-title">关联运输信息</h3>
|
||||
<div class="dialog-section-head">
|
||||
<h3 class="dialog-section-title">关联运输信息</h3>
|
||||
<el-button
|
||||
v-if="canEditTransports"
|
||||
class="btn-ghost"
|
||||
:disabled="loading"
|
||||
@click="openAddDialog"
|
||||
>
|
||||
<el-icon><Plus /></el-icon>添加运输
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="panel dialog-list-panel">
|
||||
<div class="list-body list-wrap dialog-list-body-only">
|
||||
<el-table
|
||||
:data="settlement?.transports || []"
|
||||
:data="editableTransports"
|
||||
class="list-table"
|
||||
stripe
|
||||
empty-text="暂无数据"
|
||||
@@ -119,9 +129,29 @@
|
||||
<el-table-column prop="freightAmount" label="运费(元)" min-width="110" align="right">
|
||||
<template #default="{ row }">{{ formatAmount(row.freightAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="canEditTransports"
|
||||
label="操作"
|
||||
min-width="90"
|
||||
align="center"
|
||||
fixed="right"
|
||||
class-name="col-actions"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
:disabled="editableTransports.length <= 1"
|
||||
@click="handleRemoveTransport(row)"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="canEditTransports" class="dialog-section-tip">至少保留一条关联运输;删除后可在「添加运输」中重新加入</p>
|
||||
</section>
|
||||
|
||||
<template #footer>
|
||||
@@ -133,16 +163,305 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
v-model="addDialogVisible"
|
||||
title="添加运输"
|
||||
width="1200px"
|
||||
align-center
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
class="dialog-form-layout pl-freight-add-transport-dialog"
|
||||
modal-class="order-module-dialog-mask"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="add-transport-body">
|
||||
<div class="filter-block add-transport-filter">
|
||||
<el-form :model="addSearchForm" class="filter-form" @submit.prevent>
|
||||
<div class="add-transport-filter-row">
|
||||
<div class="add-transport-filter-fields">
|
||||
<el-form-item label="计划编号">
|
||||
<el-input
|
||||
v-model="addSearchForm.q"
|
||||
placeholder="搜索计划编号/客户"
|
||||
clearable
|
||||
@keyup.enter="handleAddSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="车牌号">
|
||||
<el-input
|
||||
v-model="addSearchForm.licensePlate"
|
||||
placeholder="搜索车牌号"
|
||||
clearable
|
||||
@keyup.enter="handleAddSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="filter-actions-end">
|
||||
<el-button class="btn-ghost" :loading="addLoading" @click="handleAddReset">
|
||||
<el-icon><RefreshLeft /></el-icon>重置
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" :loading="addLoading" @click="handleAddSearch">
|
||||
<el-icon><Search /></el-icon>搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div v-if="removedTransports.length" class="panel dialog-list-panel add-transport-removed-panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">本次已移除(可恢复)</h2>
|
||||
</div>
|
||||
<div class="list-toolbar">
|
||||
<div class="list-toolbar-row">
|
||||
<div class="list-toolbar-selected">
|
||||
已选 <span class="sel-num">{{ addSelectedRemoved.length }}</span> 项
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-body list-wrap dialog-list-body-only">
|
||||
<el-table
|
||||
:data="removedTransports"
|
||||
class="list-table"
|
||||
stripe
|
||||
row-key="id"
|
||||
empty-text="暂无已移除运输"
|
||||
@selection-change="handleRemovedSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" min-width="48" align="center" header-align="center" />
|
||||
<el-table-column type="index" label="序号" min-width="60" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
prop="transportNo"
|
||||
label="运输编号"
|
||||
min-width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="licensePlate"
|
||||
label="车牌号"
|
||||
min-width="110"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ row.licensePlate || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="driverName"
|
||||
label="司机"
|
||||
min-width="90"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ row.driverName || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="carrierName"
|
||||
label="承运商"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ row.carrierName || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="transportMedium"
|
||||
label="运输介质"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ row.transportMedium || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="startPoint"
|
||||
label="出发地"
|
||||
min-width="140"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ row.startPoint || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="endPoint"
|
||||
label="目的地"
|
||||
min-width="140"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ row.endPoint || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="freightAmount"
|
||||
label="运费(元)"
|
||||
min-width="120"
|
||||
align="right"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ formatAmount(row.freightAmount) }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel dialog-list-panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">未结算计划</h2>
|
||||
</div>
|
||||
<div class="list-toolbar">
|
||||
<div class="list-toolbar-row">
|
||||
<div class="list-toolbar-selected">
|
||||
已选 <span class="sel-num">{{ pendingAddCount }}</span> 项
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-body list-wrap dialog-list-body-only">
|
||||
<el-table
|
||||
v-loading="addLoading"
|
||||
:data="availablePlans"
|
||||
class="list-table"
|
||||
stripe
|
||||
row-key="id"
|
||||
empty-text="暂无可添加的未结算计划"
|
||||
@selection-change="handleAddSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" min-width="48" align="center" header-align="center" />
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
prop="planNo"
|
||||
label="计划编号"
|
||||
min-width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="planDate"
|
||||
label="计划日期"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="planType"
|
||||
label="单据类型"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getPlanTypeTagType(row.planType)" size="small">
|
||||
{{ getPlanTypeLabel(row.planType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="客户/供应商"
|
||||
min-width="140"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
{{ row.customerName || row.supplierName || '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="licensePlate"
|
||||
label="车牌号"
|
||||
min-width="110"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="transportCompany"
|
||||
label="运输公司"
|
||||
min-width="140"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="freightAmount"
|
||||
label="运费(元)"
|
||||
min-width="120"
|
||||
align="right"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ formatAmount(row.freightAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="archiveTime"
|
||||
label="归档时间"
|
||||
min-width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{
|
||||
row.archiveTime ? formatDateTime(row.archiveTime) : '—'
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
v-model:current-page="addPagination.page"
|
||||
v-model:page-size="addPagination.pageSize"
|
||||
:total="addPagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="handleAddSizeChange"
|
||||
@current-change="handleAddPageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="addDialogVisible = false">
|
||||
<el-icon><Close /></el-icon>取消
|
||||
</el-button>
|
||||
<el-button type="primary" :disabled="!pendingAddCount" @click="confirmAddTransports">
|
||||
<el-icon><Check /></el-icon>确定添加({{ pendingAddCount }})
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Check, Close } from '@element-plus/icons-vue'
|
||||
import { freightApi, type FreightSettlement } from '@/api/pl'
|
||||
import { Check, Close, Delete, Plus, RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import {
|
||||
freightApi,
|
||||
type FreightSettlement,
|
||||
type Transport,
|
||||
type UnsettledPlanItem
|
||||
} from '@/api/pl'
|
||||
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import { formatDateTime } from '@/utils/format'
|
||||
import { getPlanTypeLabel, getPlanTypeTagType, isEditableDraftSettlement } from '@/views/pl/freight/freight-status'
|
||||
|
||||
const emit = defineEmits<{ success: [] }>()
|
||||
|
||||
type EditableTransport = Pick<
|
||||
Transport,
|
||||
| 'id'
|
||||
| 'transportNo'
|
||||
| 'licensePlate'
|
||||
| 'driverName'
|
||||
| 'carrierName'
|
||||
| 'transportMedium'
|
||||
| 'startPoint'
|
||||
| 'endPoint'
|
||||
| 'freightAmount'
|
||||
>
|
||||
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
const submitLoading = ref(false)
|
||||
@@ -150,6 +469,23 @@ const settlement = ref<FreightSettlement | null>(null)
|
||||
const formRef = ref<ElFormInstance>()
|
||||
const attachmentRef = ref<InstanceType<typeof AttachmentUploadField>>()
|
||||
const invoiceAttachmentUrlsStr = ref('')
|
||||
const editableTransports = ref<EditableTransport[]>([])
|
||||
const removedTransports = ref<EditableTransport[]>([])
|
||||
|
||||
const addDialogVisible = ref(false)
|
||||
const addLoading = ref(false)
|
||||
const addPlanList = ref<UnsettledPlanItem[]>([])
|
||||
const addSelectedPlans = ref<UnsettledPlanItem[]>([])
|
||||
const addSelectedRemoved = ref<EditableTransport[]>([])
|
||||
const addSearchForm = reactive({
|
||||
q: '',
|
||||
licensePlate: ''
|
||||
})
|
||||
const addPagination = reactive({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
})
|
||||
|
||||
const form = reactive({
|
||||
invoiceNo: '',
|
||||
@@ -160,20 +496,65 @@ const form = reactive({
|
||||
|
||||
const rules = {}
|
||||
|
||||
const canEditTransports = computed(() => isEditableDraftSettlement(settlement.value?.settlementStatus))
|
||||
|
||||
const dialogTitle = computed(() => {
|
||||
if (settlement.value?.settlementStatus === 'approved') return '发票信息'
|
||||
return '编辑结算单'
|
||||
})
|
||||
|
||||
const displayTotalFreight = computed(() =>
|
||||
editableTransports.value.reduce((sum, row) => sum + Number(row.freightAmount || 0), 0)
|
||||
)
|
||||
|
||||
const selectedTransportIds = computed(() => new Set(editableTransports.value.map((row) => row.id)))
|
||||
|
||||
const availablePlans = computed(() =>
|
||||
addPlanList.value.filter((plan) => !selectedTransportIds.value.has(plan.transportId))
|
||||
)
|
||||
|
||||
const pendingAddCount = computed(
|
||||
() => addSelectedPlans.value.length + addSelectedRemoved.value.length
|
||||
)
|
||||
|
||||
function formatAmount(amount?: number) {
|
||||
if (!amount) return '¥0.00'
|
||||
return formatMoneyDisplay(amount)
|
||||
}
|
||||
|
||||
function cloneTransportRows(rows: Transport[] = []): EditableTransport[] {
|
||||
return rows.map((row) => ({
|
||||
id: row.id,
|
||||
transportNo: row.transportNo,
|
||||
licensePlate: row.licensePlate,
|
||||
driverName: row.driverName,
|
||||
carrierName: row.carrierName,
|
||||
transportMedium: row.transportMedium,
|
||||
startPoint: row.startPoint,
|
||||
endPoint: row.endPoint,
|
||||
freightAmount: row.freightAmount
|
||||
}))
|
||||
}
|
||||
|
||||
function planToTransportRow(plan: UnsettledPlanItem): EditableTransport {
|
||||
return {
|
||||
id: plan.transportId,
|
||||
transportNo: plan.transportNo || plan.planNo,
|
||||
licensePlate: plan.licensePlate,
|
||||
driverName: plan.driverName,
|
||||
carrierName: plan.transportCompany,
|
||||
transportMedium: plan.transportMedium,
|
||||
startPoint: plan.startPoint,
|
||||
endPoint: plan.endPoint,
|
||||
freightAmount: plan.freightAmount
|
||||
}
|
||||
}
|
||||
|
||||
async function open(id: string) {
|
||||
visible.value = true
|
||||
loading.value = true
|
||||
invoiceAttachmentUrlsStr.value = ''
|
||||
removedTransports.value = []
|
||||
try {
|
||||
const res = await freightApi.get(id)
|
||||
settlement.value = (res.data ?? res) as FreightSettlement
|
||||
@@ -182,26 +563,131 @@ async function open(id: string) {
|
||||
form.invoiceAmount = settlement.value.invoiceAmount
|
||||
form.remark = settlement.value.remark || ''
|
||||
invoiceAttachmentUrlsStr.value = settlement.value.invoiceAttachmentUrls || ''
|
||||
editableTransports.value = cloneTransportRows(settlement.value.transports || [])
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleRemoveTransport(row: EditableTransport) {
|
||||
if (editableTransports.value.length <= 1) {
|
||||
ElMessage.warning('至少保留一条关联运输')
|
||||
return
|
||||
}
|
||||
editableTransports.value = editableTransports.value.filter((item) => item.id !== row.id)
|
||||
if (!removedTransports.value.some((item) => item.id === row.id)) {
|
||||
removedTransports.value = [...removedTransports.value, row]
|
||||
}
|
||||
}
|
||||
|
||||
function openAddDialog() {
|
||||
addDialogVisible.value = true
|
||||
addSelectedPlans.value = []
|
||||
addSelectedRemoved.value = []
|
||||
addSearchForm.q = ''
|
||||
addSearchForm.licensePlate = ''
|
||||
addPagination.page = 1
|
||||
fetchAddPlans()
|
||||
}
|
||||
|
||||
async function fetchAddPlans() {
|
||||
addLoading.value = true
|
||||
try {
|
||||
const res = await freightApi.listUnsettledPlans({
|
||||
q: addSearchForm.q || undefined,
|
||||
licensePlate: addSearchForm.licensePlate || undefined,
|
||||
page: addPagination.page,
|
||||
pageSize: addPagination.pageSize
|
||||
})
|
||||
const data = res.data ?? res
|
||||
addPlanList.value = data.list || []
|
||||
addPagination.total = data.total || 0
|
||||
} finally {
|
||||
addLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleAddSearch() {
|
||||
addPagination.page = 1
|
||||
fetchAddPlans()
|
||||
}
|
||||
|
||||
function handleAddReset() {
|
||||
addSearchForm.q = ''
|
||||
addSearchForm.licensePlate = ''
|
||||
addPagination.page = 1
|
||||
fetchAddPlans()
|
||||
}
|
||||
|
||||
function handleAddPageChange() {
|
||||
fetchAddPlans()
|
||||
}
|
||||
|
||||
function handleAddSizeChange() {
|
||||
addPagination.page = 1
|
||||
fetchAddPlans()
|
||||
}
|
||||
|
||||
function handleAddSelectionChange(rows: UnsettledPlanItem[]) {
|
||||
addSelectedPlans.value = rows
|
||||
}
|
||||
|
||||
function handleRemovedSelectionChange(rows: EditableTransport[]) {
|
||||
addSelectedRemoved.value = rows
|
||||
}
|
||||
|
||||
function confirmAddTransports() {
|
||||
const nextIds = new Set(editableTransports.value.map((row) => row.id))
|
||||
const rowsToAdd: EditableTransport[] = []
|
||||
|
||||
for (const row of addSelectedRemoved.value) {
|
||||
if (!nextIds.has(row.id)) {
|
||||
rowsToAdd.push(row)
|
||||
nextIds.add(row.id)
|
||||
}
|
||||
}
|
||||
for (const plan of addSelectedPlans.value) {
|
||||
if (!nextIds.has(plan.transportId)) {
|
||||
rowsToAdd.push(planToTransportRow(plan))
|
||||
nextIds.add(plan.transportId)
|
||||
}
|
||||
}
|
||||
|
||||
if (!rowsToAdd.length) {
|
||||
ElMessage.warning('请选择要添加的运输')
|
||||
return
|
||||
}
|
||||
|
||||
editableTransports.value = [...editableTransports.value, ...rowsToAdd]
|
||||
removedTransports.value = removedTransports.value.filter(
|
||||
(row) => !rowsToAdd.some((item) => item.id === row.id)
|
||||
)
|
||||
addDialogVisible.value = false
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!settlement.value) return
|
||||
if (canEditTransports.value && editableTransports.value.length < 1) {
|
||||
ElMessage.warning('至少保留一条关联运输')
|
||||
return
|
||||
}
|
||||
if (attachmentRef.value?.hasUploading?.()) {
|
||||
ElMessage.warning('附件上传中,请稍候')
|
||||
return
|
||||
}
|
||||
submitLoading.value = true
|
||||
try {
|
||||
await freightApi.update(settlement.value.id, {
|
||||
const payload = {
|
||||
invoiceNo: form.invoiceNo || undefined,
|
||||
invoiceDate: form.invoiceDate || undefined,
|
||||
invoiceAmount: form.invoiceAmount,
|
||||
invoiceAttachmentUrls: invoiceAttachmentUrlsStr.value || undefined,
|
||||
remark: form.remark || undefined
|
||||
})
|
||||
remark: form.remark || undefined,
|
||||
...(canEditTransports.value
|
||||
? { transportIds: editableTransports.value.map((row) => row.id) }
|
||||
: {})
|
||||
}
|
||||
await freightApi.update(settlement.value.id, payload)
|
||||
ElMessage.success('保存成功')
|
||||
visible.value = false
|
||||
emit('success')
|
||||
@@ -218,9 +704,94 @@ defineExpose({ open })
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.dialog-section-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.dialog-section-title {
|
||||
margin: 0 0 12px;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.dialog-section-tip {
|
||||
margin: 8px 0 0;
|
||||
font-size: 12px;
|
||||
color: var(--text-muted, #64748b);
|
||||
}
|
||||
|
||||
.add-transport-body {
|
||||
min-height: 120px;
|
||||
}
|
||||
|
||||
.add-transport-filter {
|
||||
padding: 12px 16px 10px;
|
||||
margin-bottom: 12px;
|
||||
background: var(--mint-surface);
|
||||
border: 1px solid var(--mint-border);
|
||||
border-radius: var(--mint-radius);
|
||||
|
||||
.add-transport-filter-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
gap: 14px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.add-transport-filter-fields {
|
||||
display: grid;
|
||||
flex: 1;
|
||||
grid-template-columns: repeat(2, minmax(220px, 1fr));
|
||||
gap: 10px 14px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.add-transport-filter-fields .el-form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.filter-actions-end {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-shrink: 0;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.filter-actions-end .el-button + .el-button {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.add-transport-removed-panel {
|
||||
margin-bottom: 12px;
|
||||
|
||||
> .panel-top + .list-toolbar .list-toolbar-row {
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 760px) {
|
||||
.add-transport-filter {
|
||||
.add-transport-filter-row {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.add-transport-filter-fields {
|
||||
grid-template-columns: 1fr;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.filter-actions-end {
|
||||
justify-content: flex-end;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -195,6 +195,7 @@ import { formatDateTime } from '@/utils/format'
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
const settlement = ref<FreightSettlement | null>(null)
|
||||
const settlementId = ref<string | null>(null)
|
||||
|
||||
const approvalNodes = computed(() =>
|
||||
mapApprovalFlowToNodes(settlement.value?.approvalFlow || [])
|
||||
@@ -209,18 +210,29 @@ function normalizeVoucherUrls(raw?: string) {
|
||||
return normalizeAttachmentUrls(raw)
|
||||
}
|
||||
|
||||
async function open(id: string) {
|
||||
visible.value = true
|
||||
async function loadData() {
|
||||
if (!settlementId.value) return
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await freightApi.get(id)
|
||||
const res = await freightApi.get(settlementId.value)
|
||||
settlement.value = (res.data ?? res) as FreightSettlement
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
async function open(id: string) {
|
||||
settlementId.value = id
|
||||
visible.value = true
|
||||
await loadData()
|
||||
}
|
||||
|
||||
async function reload() {
|
||||
if (!visible.value || !settlementId.value) return
|
||||
await loadData()
|
||||
}
|
||||
|
||||
defineExpose({ open, reload })
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -235,8 +247,8 @@ defineExpose({ open })
|
||||
padding: 16px;
|
||||
margin-bottom: 16px;
|
||||
border-radius: 10px;
|
||||
background: var(--primary-bg, #ecfdf5);
|
||||
border: 1px solid #a7f3d0;
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
border: 1px solid #a8e0b8;
|
||||
}
|
||||
|
||||
.view-hero-top {
|
||||
@@ -281,7 +293,7 @@ defineExpose({ open })
|
||||
.view-hero-amount {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: var(--primary-dark, #059669);
|
||||
color: var(--primary-dark, #168f45);
|
||||
}
|
||||
|
||||
.view-section {
|
||||
|
||||
@@ -117,6 +117,7 @@ import PlPlanFormProductTable from '@/components/business/pl-plan-form-dialog/Pl
|
||||
import PlPlanViewTabs from '@/components/business/pl-plan-view-tabs/index.vue'
|
||||
import type { PlanFormProductRow } from '@/composables/usePlContractToPlan'
|
||||
import { usePlFreightCalc, resolveFreightUnitLabel } from '@/composables/usePlFreightCalc'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { pickBxData } from '@/utils/http/bx'
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -154,7 +155,12 @@ const freightCalc = usePlFreightCalc({
|
||||
freightType: freightTypeRef
|
||||
})
|
||||
|
||||
const freightUnitLabel = computed(() => resolveFreightUnitLabel(productRows.value))
|
||||
const dictStore = useDictStore()
|
||||
|
||||
const freightUnitLabel = computed(() => {
|
||||
const unitCode = resolveFreightUnitLabel(productRows.value)
|
||||
return dictStore.getLabel('crm_product_unit', unitCode) || unitCode || '吨'
|
||||
})
|
||||
|
||||
const isAdjustMode = computed(() => plan.value.archiveStatus === 'archived')
|
||||
|
||||
@@ -181,9 +187,7 @@ function mapPlanProducts(products: PlanProduct[]): PlanFormProductRow[] {
|
||||
categoryName: item.categoryName,
|
||||
unit: item.unit || '吨',
|
||||
quantity: Number(item.quantity ?? item.inboundEstimateQty ?? item.outboundEstimateQty ?? 0),
|
||||
actualQty: Number(
|
||||
item.actualQty ?? item.quantity ?? item.inboundEstimateQty ?? item.outboundEstimateQty ?? 0
|
||||
),
|
||||
actualQty: item.actualQty != null ? Number(item.actualQty) : undefined,
|
||||
packageSpec: item.packageSpec,
|
||||
deliveryMethod: item.deliveryMethod,
|
||||
taxPrice: item.taxPrice != null ? Number(item.taxPrice) : undefined,
|
||||
@@ -223,7 +227,8 @@ async function applyFreightPrefill(data: Plan) {
|
||||
formData.distanceKm = transport.distanceKm != null ? Number(transport.distanceKm) : null
|
||||
formData.freightType = transport.freightType || 'by_weight'
|
||||
|
||||
if (transport.transportQty != null) {
|
||||
// 首次归档时运输量仅按实际数量汇总,不回填安排运输阶段可能基于计划数量的运输量
|
||||
if (isAdjustMode.value && transport.transportQty != null) {
|
||||
freightCalc.transportQty.value = Number(transport.transportQty)
|
||||
freightCalc.transportQtyTouched.value = true
|
||||
}
|
||||
@@ -278,6 +283,14 @@ async function handleSubmit() {
|
||||
ElMessage.warning('请填写有效的实际数量')
|
||||
return
|
||||
}
|
||||
if (
|
||||
formData.hasFreight === 1 &&
|
||||
formData.freightType === 'by_weight' &&
|
||||
(!freightCalc.transportQty.value || Number(freightCalc.transportQty.value) <= 0)
|
||||
) {
|
||||
ElMessage.warning('运输量须大于0,请填写产品实际数量')
|
||||
return
|
||||
}
|
||||
if (formData.hasFreight === 1 && !plan.value.transportId) {
|
||||
ElMessage.warning('计划有运输费用但未安排运输,请先安排运输')
|
||||
return
|
||||
|
||||
@@ -137,9 +137,9 @@
|
||||
<el-form-item label="取货时间">
|
||||
<el-date-picker
|
||||
v-model="formData.pickupTime"
|
||||
type="datetime"
|
||||
type="date"
|
||||
placeholder="选择取货时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -179,9 +179,9 @@
|
||||
<el-form-item label="送达时间">
|
||||
<el-date-picker
|
||||
v-model="formData.deliveryTime"
|
||||
type="datetime"
|
||||
type="date"
|
||||
placeholder="选择送达时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -384,7 +384,7 @@ import { buildMissingHazardCertMessage } from '@/composables/usePlToxicProductCe
|
||||
import { usePlPlanArrangeActions } from '@/composables/usePlPlanArrangeActions'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { isTonProductUnit } from '@/utils/crm-product-display'
|
||||
import { formatDateTime } from '@/utils/format'
|
||||
import { formatDate } from '@/utils/format'
|
||||
import { pickBxData, pickBxList } from '@/utils/http/bx'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
@@ -505,9 +505,7 @@ const productRows = computed<PlanFormProductRow[]>(() =>
|
||||
categoryName: item.categoryName,
|
||||
unit: item.unit || '吨',
|
||||
quantity: Number(item.quantity ?? item.inboundEstimateQty ?? item.outboundEstimateQty ?? 0),
|
||||
actualQty: Number(
|
||||
item.actualQty ?? item.quantity ?? item.inboundEstimateQty ?? item.outboundEstimateQty ?? 0
|
||||
),
|
||||
actualQty: item.actualQty != null ? Number(item.actualQty) : undefined,
|
||||
packageSpec: item.packageSpec,
|
||||
deliveryMethod: item.deliveryMethod,
|
||||
remark: item.remark,
|
||||
@@ -583,10 +581,10 @@ function applyVehiclePersonnel(personnelList: VehiclePersonnelRow[], preferredDr
|
||||
|
||||
async function applyPrefillFromPlan(data: Plan) {
|
||||
formData.pickupAddress = data.pickupAddress || ''
|
||||
formData.pickupTime = formatDateTime(data.pickupTime) || ''
|
||||
formData.pickupTime = formatDate(data.pickupTime) || ''
|
||||
formData.pickupNotes = data.pickupNotes || ''
|
||||
formData.destinationAddress = data.destinationAddress || ''
|
||||
formData.deliveryTime = formatDateTime(data.deliveryTime) || ''
|
||||
formData.deliveryTime = formatDate(data.deliveryTime) || ''
|
||||
formData.destinationNotes = data.destinationNotes || ''
|
||||
formData.hasFreight = data.hasFreight ?? 0
|
||||
formData.remark = data.remark || ''
|
||||
@@ -628,10 +626,6 @@ async function applyPrefillFromPlan(data: Plan) {
|
||||
formData.freightType = transport.freightType || 'by_weight'
|
||||
prefilledDriverId.value = transport.driverId || prefilledDriverId.value
|
||||
|
||||
if (transport.transportQty != null) {
|
||||
freightCalc.transportQty.value = Number(transport.transportQty)
|
||||
freightCalc.transportQtyTouched.value = true
|
||||
}
|
||||
if (transport.freightPrice != null) {
|
||||
freightCalc.freightPrice.value = Number(transport.freightPrice)
|
||||
}
|
||||
@@ -938,12 +932,12 @@ async function handleSubmit() {
|
||||
.pl-plan-flow-bridge__label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--primary-dark, #059669);
|
||||
color: var(--primary-dark, #168f45);
|
||||
letter-spacing: 0.06em;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px;
|
||||
background: #ecfdf5;
|
||||
border: 1px solid #a7f3d0;
|
||||
background: #e6f8ed;
|
||||
border: 1px solid #a8e0b8;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
@@ -954,10 +948,10 @@ async function handleSubmit() {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 50%;
|
||||
color: var(--primary-dark, #059669);
|
||||
background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
|
||||
border: 1px solid #a7f3d0;
|
||||
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.14);
|
||||
color: var(--primary-dark, #168f45);
|
||||
background: linear-gradient(145deg, #e6f8ed 0%, #d4f0de 100%);
|
||||
border: 1px solid #a8e0b8;
|
||||
box-shadow: 0 2px 8px rgba(28, 168, 81, 0.14);
|
||||
|
||||
svg {
|
||||
width: 22px;
|
||||
@@ -1019,7 +1013,7 @@ async function handleSubmit() {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
border-left: 3px solid #10b981;
|
||||
border-left: 3px solid #1ca851;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@@ -1036,7 +1030,7 @@ async function handleSubmit() {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
border-left: 3px solid #10b981;
|
||||
border-left: 3px solid #1ca851;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,9 +129,9 @@
|
||||
<el-form-item label="取货时间">
|
||||
<el-date-picker
|
||||
v-model="formData.pickupTime"
|
||||
type="datetime"
|
||||
type="date"
|
||||
placeholder="选择取货时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -171,9 +171,9 @@
|
||||
<el-form-item label="送达时间">
|
||||
<el-date-picker
|
||||
v-model="formData.deliveryTime"
|
||||
type="datetime"
|
||||
type="date"
|
||||
placeholder="选择送达时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -284,7 +284,8 @@ import { usePlFreightCalc, resolveFreightUnitLabel } from '@/composables/usePlFr
|
||||
import { loadVehicleViewBundle, type VehicleViewBundle } from '@/composables/usePlVehicleViewDetail'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { formatDateTime } from '@/utils/format'
|
||||
import { formatDate } from '@/utils/format'
|
||||
import { pickBxList } from '@/utils/http/bx'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
|
||||
const ContractDetailDialog = defineAsyncComponent(
|
||||
@@ -612,11 +613,8 @@ async function restoreFreightFromTransport(plan: Plan) {
|
||||
}
|
||||
freightCalc.freightPrice.value =
|
||||
transport.freightPrice != null ? Number(transport.freightPrice) : null
|
||||
freightCalc.transportQty.value =
|
||||
transport.transportQty != null ? Number(transport.transportQty) : null
|
||||
freightCalc.freightAmount.value =
|
||||
transport.freightAmount != null ? Number(transport.freightAmount) : null
|
||||
freightCalc.transportQtyTouched.value = transport.transportQty != null
|
||||
freightCalc.freightAmountTouched.value = false
|
||||
} catch {
|
||||
if (plan.freightAmount) {
|
||||
@@ -707,10 +705,10 @@ async function loadPlanForEdit(planId: string) {
|
||||
settlementMethod: data.settlementMethod || '',
|
||||
hasFreight: data.hasFreight ?? 0,
|
||||
pickupAddress: data.pickupAddress || '',
|
||||
pickupTime: formatDateTime(data.pickupTime) || '',
|
||||
pickupTime: formatDate(data.pickupTime) || '',
|
||||
pickupNotes: data.pickupNotes || '',
|
||||
destinationAddress: data.destinationAddress || '',
|
||||
deliveryTime: formatDateTime(data.deliveryTime) || '',
|
||||
deliveryTime: formatDate(data.deliveryTime) || '',
|
||||
destinationNotes: data.destinationNotes || '',
|
||||
vehicleId: data.vehicleId || '',
|
||||
remark: data.remark || '',
|
||||
@@ -795,8 +793,8 @@ async function loadMasterData() {
|
||||
vehicleApi.list({ vehicleStatus: 'available', excludeIneligibleCarrier: true }),
|
||||
carrierApi.list({ status: '1', page: 1, pageSize: 100 })
|
||||
])
|
||||
vehicleList.value = (vehicleRes.data ?? vehicleRes) || []
|
||||
carrierList.value = (carrierRes.data ?? carrierRes) || []
|
||||
vehicleList.value = pickBxList<Vehicle>(vehicleRes)
|
||||
carrierList.value = pickBxList<Carrier>(carrierRes)
|
||||
} catch {
|
||||
vehicleList.value = []
|
||||
carrierList.value = []
|
||||
@@ -882,7 +880,7 @@ function validateBusinessRules() {
|
||||
return false
|
||||
}
|
||||
if (!freightCalc.transportQty.value || freightCalc.transportQty.value <= 0) {
|
||||
ElMessage.warning('运输量必须大于 0')
|
||||
ElMessage.warning('运输量须大于0,请填写产品实际数量或手动输入运输量')
|
||||
return false
|
||||
}
|
||||
} else if (!freightCalc.freightAmount.value || freightCalc.freightAmount.value <= 0) {
|
||||
@@ -954,7 +952,7 @@ async function handleSubmit() {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
border-left: 3px solid #10b981;
|
||||
border-left: 3px solid #1ca851;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@@ -1040,12 +1038,12 @@ async function handleSubmit() {
|
||||
.pl-plan-flow-bridge__label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--primary-dark, #059669);
|
||||
color: var(--primary-dark, #168f45);
|
||||
letter-spacing: 0.06em;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px;
|
||||
background: #ecfdf5;
|
||||
border: 1px solid #a7f3d0;
|
||||
background: #e6f8ed;
|
||||
border: 1px solid #a8e0b8;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
@@ -1056,10 +1054,10 @@ async function handleSubmit() {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 50%;
|
||||
color: var(--primary-dark, #059669);
|
||||
background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
|
||||
border: 1px solid #a7f3d0;
|
||||
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.14);
|
||||
color: var(--primary-dark, #168f45);
|
||||
background: linear-gradient(145deg, #e6f8ed 0%, #d4f0de 100%);
|
||||
border: 1px solid #a8e0b8;
|
||||
box-shadow: 0 2px 8px rgba(28, 168, 81, 0.14);
|
||||
|
||||
svg {
|
||||
width: 22px;
|
||||
|
||||
@@ -201,7 +201,7 @@ function handleClosed() {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
border-left: 3px solid #10b981;
|
||||
border-left: 3px solid #1ca851;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,8 @@
|
||||
<h5 class="pl-plan-dibang-weighing-title">地磅单</h5>
|
||||
<div class="view-subtable-wrap">
|
||||
<el-table :data="[row.weighing]" class="view-subtable list-table" stripe>
|
||||
<el-table-column
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
prop="batchNo"
|
||||
label="出入库单号"
|
||||
min-width="130"
|
||||
@@ -368,7 +369,7 @@
|
||||
import { mapPlanProductToFormRow, usePlPlanViewDetail, type PlPlanTransportDibangRow, type PlPlanTransportSiteRow } from '@/composables/usePlPlanViewDetail'
|
||||
import { isHazardProduct } from '@/composables/usePlToxicProductCertCheck'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { formatDateTime } from '@/utils/format'
|
||||
import { formatDate, formatDateTime } from '@/utils/format'
|
||||
import { pickBxData } from '@/utils/http/bx'
|
||||
import {
|
||||
buildSiteSummaryFromInventoryLinks
|
||||
@@ -531,7 +532,7 @@
|
||||
if (qty != null) return String(qty)
|
||||
if (!productRows.value.length) return '—'
|
||||
const sum = productRows.value.reduce(
|
||||
(total, item) => total + Number(item.actualQty ?? item.quantity ?? 0),
|
||||
(total, item) => total + Number(item.actualQty ?? 0),
|
||||
0
|
||||
)
|
||||
return sum ? String(sum) : '—'
|
||||
@@ -575,7 +576,7 @@
|
||||
|
||||
const pickupViewFields = computed<ViewField[]>(() => [
|
||||
{ label: '取货地址', value: plan.value?.pickupAddress, span: 'full' },
|
||||
{ label: '取货时间', value: formatDateTime(plan.value?.pickupTime) || '—' },
|
||||
{ label: '取货时间', value: formatDate(plan.value?.pickupTime) || '—' },
|
||||
{ label: '注意事项', value: plan.value?.pickupNotes, span: 'full' }
|
||||
])
|
||||
|
||||
@@ -585,7 +586,7 @@
|
||||
value: plan.value?.destinationAddress || plan.value?.destinationName,
|
||||
span: 'full'
|
||||
},
|
||||
{ label: '送达时间', value: formatDateTime(plan.value?.deliveryTime) || '—' },
|
||||
{ label: '送达时间', value: formatDate(plan.value?.deliveryTime) || '—' },
|
||||
{ label: '注意事项', value: plan.value?.destinationNotes, span: 'full' }
|
||||
])
|
||||
|
||||
@@ -763,7 +764,7 @@
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
border-left: 3px solid #10b981;
|
||||
border-left: 3px solid #1ca851;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@@ -850,7 +851,7 @@
|
||||
font-weight: 600;
|
||||
color: var(--text, #1e293b);
|
||||
line-height: 1.5;
|
||||
border-left: 3px solid var(--primary, #10b981);
|
||||
border-left: 3px solid var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
.party-flow-bridge {
|
||||
@@ -866,12 +867,12 @@
|
||||
.party-flow-bridge__label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--primary-dark, #059669);
|
||||
color: var(--primary-dark, #168f45);
|
||||
letter-spacing: 0.06em;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px;
|
||||
background: #ecfdf5;
|
||||
border: 1px solid #a7f3d0;
|
||||
background: #e6f8ed;
|
||||
border: 1px solid #a8e0b8;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
@@ -882,10 +883,10 @@
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 50%;
|
||||
color: var(--primary-dark, #059669);
|
||||
background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
|
||||
border: 1px solid #a7f3d0;
|
||||
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.14);
|
||||
color: var(--primary-dark, #168f45);
|
||||
background: linear-gradient(145deg, #e6f8ed 0%, #d4f0de 100%);
|
||||
border: 1px solid #a8e0b8;
|
||||
box-shadow: 0 2px 8px rgba(28, 168, 81, 0.14);
|
||||
|
||||
svg {
|
||||
width: 22px;
|
||||
@@ -926,7 +927,7 @@
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
border-left: 3px solid #10b981;
|
||||
border-left: 3px solid #1ca851;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@@ -970,7 +971,7 @@
|
||||
}
|
||||
|
||||
.money-display {
|
||||
color: #059669;
|
||||
color: #168f45;
|
||||
}
|
||||
|
||||
.pl-plan-dibang-block {
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ function getRoleTagType(role: string) {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
border-left: 3px solid #10b981;
|
||||
border-left: 3px solid #1ca851;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ watch(
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
border-left: 3px solid #10b981;
|
||||
border-left: 3px solid #1ca851;
|
||||
line-height: 1;
|
||||
}
|
||||
</style>
|
||||
@@ -369,7 +369,7 @@
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
padding: 20px 22px;
|
||||
background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 55%);
|
||||
background: linear-gradient(135deg, #e6f8ed 0%, #ffffff 55%);
|
||||
border-bottom: 1px solid #d9e8e2;
|
||||
align-items: center;
|
||||
}
|
||||
@@ -378,9 +378,9 @@
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(16, 185, 129, 0.2);
|
||||
background: rgba(16, 185, 129, 0.08);
|
||||
color: #059669;
|
||||
border: 1px solid rgba(28, 168, 81, 0.2);
|
||||
background: rgba(28, 168, 81, 0.08);
|
||||
color: #168f45;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -421,7 +421,7 @@
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
border-left: 3px solid #10b981;
|
||||
border-left: 3px solid #1ca851;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,10 +143,10 @@ function connectorClass(index: number) {
|
||||
}
|
||||
|
||||
.approval-flow-circle.is-approved {
|
||||
border-color: var(--success, #10b981);
|
||||
background: linear-gradient(135deg, #10b981, #059669);
|
||||
border-color: var(--success, #1ca851);
|
||||
background: linear-gradient(135deg, #1ca851, #168f45);
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
|
||||
box-shadow: 0 2px 8px rgba(28, 168, 81, 0.25);
|
||||
}
|
||||
|
||||
.approval-flow-circle.is-rejected {
|
||||
@@ -156,9 +156,9 @@ function connectorClass(index: number) {
|
||||
}
|
||||
|
||||
.approval-flow-circle.is-pending {
|
||||
border-color: var(--primary, #10b981);
|
||||
border-color: var(--primary, #1ca851);
|
||||
background: #fff;
|
||||
color: var(--primary, #10b981);
|
||||
color: var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
.approval-status-icon {
|
||||
@@ -206,7 +206,7 @@ function connectorClass(index: number) {
|
||||
}
|
||||
|
||||
.approval-flow-connector.is-done {
|
||||
background: linear-gradient(90deg, #10b981, #34d399);
|
||||
background: linear-gradient(90deg, #1ca851, #49be78);
|
||||
}
|
||||
|
||||
.approval-flow-connector.is-done::after {
|
||||
@@ -216,8 +216,8 @@ function connectorClass(index: number) {
|
||||
top: -3px;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-top: 2px solid #10b981;
|
||||
border-right: 2px solid #10b981;
|
||||
border-top: 2px solid #1ca851;
|
||||
border-right: 2px solid #1ca851;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
</style>
|
||||
@@ -139,10 +139,10 @@ const sortedItems = computed(() =>
|
||||
}
|
||||
|
||||
.approval-history-circle.is-approved {
|
||||
border-color: var(--success, #10b981);
|
||||
background: linear-gradient(135deg, #10b981, #059669);
|
||||
border-color: var(--success, #1ca851);
|
||||
background: linear-gradient(135deg, #1ca851, #168f45);
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
|
||||
box-shadow: 0 2px 8px rgba(28, 168, 81, 0.25);
|
||||
}
|
||||
|
||||
.approval-history-circle.is-rejected {
|
||||
@@ -152,9 +152,9 @@ const sortedItems = computed(() =>
|
||||
}
|
||||
|
||||
.approval-history-circle.is-pending {
|
||||
border-color: var(--primary, #10b981);
|
||||
border-color: var(--primary, #1ca851);
|
||||
background: #fff;
|
||||
color: var(--primary, #10b981);
|
||||
color: var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
.approval-status-icon {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
@change="handleAttachmentChange"
|
||||
>
|
||||
<div class="upload-card">
|
||||
<el-icon :size="28" color="#10b981"><Plus /></el-icon>
|
||||
<el-icon :size="28" color="#1ca851"><Plus /></el-icon>
|
||||
<span class="upload-card-text">上传附件</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- 系统logo -->
|
||||
<template>
|
||||
<div class="flex-cc">
|
||||
<img :style="logoStyle" src="/logo.gif" alt="山峡化工" class="block object-contain" />
|
||||
<img :style="logoStyle" :src="src" alt="山峡化工" class="block object-contain" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -11,10 +11,13 @@
|
||||
interface Props {
|
||||
/** logo 大小 */
|
||||
size?: number | string
|
||||
/** logo 图片路径 */
|
||||
src?: string
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
size: 36
|
||||
size: 36,
|
||||
src: '/logo.gif'
|
||||
})
|
||||
|
||||
const logoStyle = computed(() => {
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<!-- 列表序号列:有分页时连续编号,无分页时从 1 递增 -->
|
||||
<script setup lang="ts">
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
page?: number
|
||||
pageSize?: number
|
||||
}>(),
|
||||
{
|
||||
page: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
)
|
||||
|
||||
function resolveIndex(index: number) {
|
||||
return (props.page - 1) * props.pageSize + index + 1
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="resolveIndex"
|
||||
/>
|
||||
</template>
|
||||
@@ -111,14 +111,21 @@
|
||||
|
||||
<style scoped lang="scss">
|
||||
.user-avatar-wrapper {
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 5px;
|
||||
background-color: #fff;
|
||||
line-height: 0;
|
||||
cursor: pointer;
|
||||
border-radius: 50%;
|
||||
padding: 2px;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.8;
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
:deep(.el-avatar) {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
:item="item"
|
||||
:isMobile="false"
|
||||
:level="0"
|
||||
:show-icon="showIcon"
|
||||
/>
|
||||
</ElMenu>
|
||||
</div>
|
||||
@@ -37,12 +38,15 @@
|
||||
interface Props {
|
||||
/** 菜单列表数据 */
|
||||
list: AppRouteRecord[]
|
||||
/** 是否展示菜单图标 */
|
||||
showIcon?: boolean
|
||||
}
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
list: () => []
|
||||
list: () => [],
|
||||
showIcon: true
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
+12
-1
@@ -1,7 +1,12 @@
|
||||
<template>
|
||||
<ElSubMenu v-if="hasChildren" :index="item.path || item.meta.title" class="!p-0">
|
||||
<template #title>
|
||||
<ArtSvgIcon :icon="item.meta.icon" :color="theme?.iconColor" class="mr-1 text-lg" />
|
||||
<ArtSvgIcon
|
||||
v-if="showIcon"
|
||||
:icon="item.meta.icon"
|
||||
:color="theme?.iconColor"
|
||||
class="mr-1 text-lg"
|
||||
/>
|
||||
<span class="text-md">{{ formatMenuTitle(item.meta.title) }}</span>
|
||||
<div v-if="item.meta.showBadge" class="art-badge art-badge-horizontal" />
|
||||
<div v-if="item.meta.showTextBadge" class="art-text-badge">
|
||||
@@ -17,6 +22,7 @@
|
||||
:theme="theme"
|
||||
:is-mobile="isMobile"
|
||||
:level="level + 1"
|
||||
:show-icon="showIcon"
|
||||
@close="closeMenu"
|
||||
/>
|
||||
</ElSubMenu>
|
||||
@@ -27,6 +33,7 @@
|
||||
@click="goPage(item)"
|
||||
>
|
||||
<ArtSvgIcon
|
||||
v-if="showIcon"
|
||||
:icon="item.meta.icon"
|
||||
:color="theme?.iconColor"
|
||||
class="mr-1 text-lg"
|
||||
@@ -63,6 +70,10 @@
|
||||
level: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
showIcon: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
overflow: hidden;
|
||||
line-height: normal;
|
||||
cursor: pointer;
|
||||
background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
|
||||
background: linear-gradient(135deg, #1ca851 0%, #49be78 100%);
|
||||
border-bottom: none !important;
|
||||
|
||||
.header-brand {
|
||||
|
||||
@@ -215,7 +215,7 @@ $popup-menu-radius: 6px;
|
||||
.el-menu--collapse {
|
||||
.el-sub-menu.is-active {
|
||||
.el-sub-menu__title {
|
||||
background-color: var(--primary, #10b981);
|
||||
background-color: var(--primary, #1ca851);
|
||||
|
||||
.menu-icon {
|
||||
.art-svg-icon {
|
||||
@@ -226,7 +226,7 @@ $popup-menu-radius: 6px;
|
||||
}
|
||||
|
||||
.el-menu-item.is-active {
|
||||
background-color: var(--primary, #10b981);
|
||||
background-color: var(--primary, #1ca851);
|
||||
color: #fff !important;
|
||||
|
||||
span,
|
||||
@@ -240,7 +240,7 @@ $popup-menu-radius: 6px;
|
||||
// ---------------------- Design theme menu ----------------------
|
||||
.el-menu-design {
|
||||
@include theme-menu-base;
|
||||
@include menu-active(#fff, var(--primary, #10b981), #fff);
|
||||
@include menu-active(#fff, var(--primary, #1ca851), #fff);
|
||||
@include menu-hover($hover-bg-color);
|
||||
|
||||
.el-menu-item,
|
||||
@@ -274,7 +274,7 @@ $popup-menu-radius: 6px;
|
||||
}
|
||||
|
||||
.el-menu-item.is-active {
|
||||
background-color: var(--primary, #10b981);
|
||||
background-color: var(--primary, #1ca851);
|
||||
color: #fff !important;
|
||||
font-weight: 600;
|
||||
|
||||
@@ -322,7 +322,7 @@ $popup-menu-radius: 6px;
|
||||
.el-menu--popup {
|
||||
.el-menu-item.is-active {
|
||||
color: #fff !important;
|
||||
background-color: var(--primary, #10b981) !important;
|
||||
background-color: var(--primary, #1ca851) !important;
|
||||
|
||||
span,
|
||||
.menu-name,
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<RouterView v-if="isRefresh" v-slot="{ Component, route }" :style="contentStyle">
|
||||
<!-- 缓存路由动画 -->
|
||||
<Transition :name="showTransitionMask ? '' : actualTransition" mode="out-in" appear>
|
||||
<KeepAlive :max="10" :exclude="keepAliveExclude">
|
||||
<KeepAlive :max="keepAliveMax" :exclude="keepAliveExclude">
|
||||
<component
|
||||
class="art-page-view"
|
||||
:is="Component"
|
||||
@@ -59,9 +59,11 @@
|
||||
|
||||
const route = useRoute()
|
||||
const { containerMinHeight } = useAutoLayoutHeight()
|
||||
const { pageTransition, containerWidth, refresh } = storeToRefs(useSettingStore())
|
||||
const { pageTransition, containerWidth, refresh, showWorkTab } = storeToRefs(useSettingStore())
|
||||
const { keepAliveExclude } = storeToRefs(useWorktabStore())
|
||||
|
||||
const keepAliveMax = computed(() => (showWorkTab.value ? 10 : 1))
|
||||
|
||||
const isRefresh = shallowRef(true)
|
||||
const isOpenRouteInfo = import.meta.env.VITE_OPEN_ROUTE_INFO
|
||||
const showTransitionMask = ref(false)
|
||||
|
||||
@@ -2,17 +2,24 @@
|
||||
<template>
|
||||
<header class="portal-header">
|
||||
<div class="portal-header-brand" @click="toHome">
|
||||
<ArtLogo class="portal-header-logo" />
|
||||
<ArtLogo class="portal-header-logo" src="/logo-sx.svg" :size="38" />
|
||||
<p class="portal-header-title">{{ AppConfig.systemInfo.name }}</p>
|
||||
</div>
|
||||
|
||||
<ArtPortalTopNav class="portal-header-nav" />
|
||||
<div class="portal-header-nav">
|
||||
<ArtPortalModuleSelect />
|
||||
<ArtPortalSubNav class="portal-header-sub-nav" />
|
||||
</div>
|
||||
|
||||
<div class="portal-header-actions">
|
||||
<ArtPortalMobileMenu />
|
||||
<ArtIconButton
|
||||
v-if="shouldShowFullscreen"
|
||||
icon="fullscreen"
|
||||
:class="[!isFullscreen ? 'full-screen-btn' : 'exit-full-screen-btn']"
|
||||
:class="[
|
||||
'portal-header-icon-btn',
|
||||
!isFullscreen ? 'full-screen-btn' : 'exit-full-screen-btn'
|
||||
]"
|
||||
class="max-md:!hidden"
|
||||
@click="toggleFullScreen"
|
||||
/>
|
||||
@@ -55,8 +62,8 @@
|
||||
height: 56px;
|
||||
padding: 0 var(--mint-content-padding, 24px);
|
||||
user-select: none;
|
||||
background: var(--mint-surface, #fff);
|
||||
border-bottom: 1px solid var(--mint-border, #d9e8e2);
|
||||
background: var(--mint-primary, #1ca851);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.portal-header-brand {
|
||||
@@ -64,10 +71,10 @@
|
||||
flex-shrink: 0;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
margin-right: 12px;
|
||||
margin-right: 4px;
|
||||
padding-right: 16px;
|
||||
cursor: pointer;
|
||||
border-right: 1px solid var(--mint-border, #d9e8e2);
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.22);
|
||||
}
|
||||
|
||||
.portal-header-logo {
|
||||
@@ -75,19 +82,26 @@
|
||||
}
|
||||
|
||||
.portal-header-title {
|
||||
max-width: 180px;
|
||||
max-width: 240px;
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
line-height: 1.35;
|
||||
color: var(--mint-text, #1e293b);
|
||||
white-space: normal;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.portal-header-nav {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.portal-header-sub-nav {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.portal-header-actions {
|
||||
@@ -96,6 +110,90 @@
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
:deep(.portal-module-select-trigger) {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border-color: rgba(255, 255, 255, 0.28);
|
||||
|
||||
.portal-module-select-trigger__icon,
|
||||
.portal-module-select-trigger__label,
|
||||
.portal-module-select-trigger__arrow {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:hover:not(.is-disabled) {
|
||||
background: rgba(255, 255, 255, 0.18);
|
||||
border-color: rgba(255, 255, 255, 0.45);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-card__icon),
|
||||
:deep(.portal-sub-nav-card__label) {
|
||||
color: rgba(255, 255, 255, 0.88);
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu .el-sub-menu__icon-arrow) {
|
||||
color: rgba(255, 255, 255, 0.88);
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.el-sub-menu__hide-arrow .el-sub-menu__title) {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.el-sub-menu__hide-arrow .el-sub-menu__icon-more),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.el-sub-menu__hide-arrow .el-icon) {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.el-sub-menu__hide-arrow:hover .el-sub-menu__title) {
|
||||
background: rgba(255, 255, 255, 0.14) !important;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item:hover .portal-sub-nav-card),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu:hover .portal-sub-nav-card) {
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item.is-active .portal-sub-nav-card),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.is-active .portal-sub-nav-card) {
|
||||
background: #fff;
|
||||
|
||||
.portal-sub-nav-card__icon,
|
||||
.portal-sub-nav-card__label {
|
||||
color: var(--mint-primary, #1ca851);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.portal-mobile-menu-trigger) {
|
||||
color: #fff;
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border-color: rgba(255, 255, 255, 0.28);
|
||||
|
||||
&:hover {
|
||||
color: #fff;
|
||||
background: rgba(255, 255, 255, 0.18);
|
||||
border-color: rgba(255, 255, 255, 0.45);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.portal-header-icon-btn) {
|
||||
color: #fff !important;
|
||||
|
||||
&:hover {
|
||||
background: rgba(255, 255, 255, 0.14) !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (width <= 800px) {
|
||||
.portal-header-title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.portal-header-sub-nav {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
<!-- 门户窄屏菜单抽屉(≤800px) -->
|
||||
<template>
|
||||
<div class="portal-mobile-menu">
|
||||
<ElButton class="portal-mobile-menu-trigger" @click="drawerVisible = true">
|
||||
<ElIcon><Menu /></ElIcon>
|
||||
<span>菜单</span>
|
||||
</ElButton>
|
||||
|
||||
<ElDrawer
|
||||
v-model="drawerVisible"
|
||||
title="功能菜单"
|
||||
direction="ltr"
|
||||
size="280px"
|
||||
:modal-class="'portal-mobile-menu-mask'"
|
||||
class="portal-mobile-menu-drawer"
|
||||
append-to-body
|
||||
>
|
||||
<ElScrollbar v-if="subMenuList.length">
|
||||
<ElMenu
|
||||
:default-active="routerPath"
|
||||
class="portal-mobile-menu-tree"
|
||||
@select="handleMenuSelect"
|
||||
>
|
||||
<SidebarSubmenu
|
||||
:list="subMenuList"
|
||||
:is-mobile="true"
|
||||
:level="1"
|
||||
@close="drawerVisible = false"
|
||||
/>
|
||||
</ElMenu>
|
||||
</ElScrollbar>
|
||||
<p v-else class="portal-mobile-menu-empty">当前模块暂无可用菜单</p>
|
||||
</ElDrawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { Menu } from '@element-plus/icons-vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useMenuStore } from '@/store/modules/menu'
|
||||
import { filterSidebarRoutes } from '@/utils/router/sidebar-menu-filter'
|
||||
import { resolvePortalSubMenus } from '@/utils/router/portal-menu'
|
||||
import SidebarSubmenu from '../art-menus/art-sidebar-menu/widget/SidebarSubmenu.vue'
|
||||
import type { AppRouteRecord } from '@/types/router'
|
||||
|
||||
defineOptions({ name: 'ArtPortalMobileMenu' })
|
||||
|
||||
const route = useRoute()
|
||||
const menuStore = useMenuStore()
|
||||
const { menuList } = storeToRefs(menuStore)
|
||||
|
||||
const drawerVisible = ref(false)
|
||||
|
||||
const currentRoutePath = computed(() => String(route.meta.activePath || route.path))
|
||||
const routerPath = computed(() => currentRoutePath.value)
|
||||
|
||||
const subMenuList = computed<AppRouteRecord[]>(() => {
|
||||
const raw = resolvePortalSubMenus(menuList.value, currentRoutePath.value)
|
||||
return filterSidebarRoutes(raw)
|
||||
})
|
||||
|
||||
const handleMenuSelect = (): void => {
|
||||
drawerVisible.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.portal-mobile-menu {
|
||||
display: none;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.portal-mobile-menu-trigger {
|
||||
display: inline-flex;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
height: 36px;
|
||||
padding: 0 12px;
|
||||
font-size: 14px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.portal-mobile-menu-empty {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
:deep(.portal-mobile-menu-tree) {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
@media only screen and (width <= 800px) {
|
||||
.portal-mobile-menu {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.portal-mobile-menu-mask {
|
||||
backdrop-filter: none !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,185 @@
|
||||
<!-- 门户顶栏一级模块下拉 -->
|
||||
<template>
|
||||
<div class="portal-module-select">
|
||||
<ElDropdown
|
||||
v-if="moduleList.length"
|
||||
trigger="click"
|
||||
popper-class="portal-module-select-popper"
|
||||
@command="handleModuleSelect"
|
||||
>
|
||||
<button type="button" class="portal-module-select-trigger">
|
||||
<ArtSvgIcon
|
||||
v-if="activeModule?.meta?.icon"
|
||||
:icon="activeModule.meta.icon"
|
||||
class="portal-module-select-trigger__icon"
|
||||
/>
|
||||
<span class="portal-module-select-trigger__label">{{ triggerLabel }}</span>
|
||||
<ElIcon class="portal-module-select-trigger__arrow"><ArrowDown /></ElIcon>
|
||||
</button>
|
||||
<template #dropdown>
|
||||
<ElDropdownMenu>
|
||||
<ElDropdownItem
|
||||
v-for="item in moduleList"
|
||||
:key="item.path"
|
||||
:command="item.path"
|
||||
:class="{ 'is-active': item.isActive }"
|
||||
>
|
||||
<ArtSvgIcon
|
||||
v-if="item.meta.icon"
|
||||
:icon="item.meta.icon"
|
||||
class="portal-module-select-item__icon"
|
||||
/>
|
||||
<span>{{ item.formattedTitle }}</span>
|
||||
</ElDropdownItem>
|
||||
</ElDropdownMenu>
|
||||
</template>
|
||||
</ElDropdown>
|
||||
<button v-else type="button" class="portal-module-select-trigger is-disabled" disabled>
|
||||
<span class="portal-module-select-trigger__label">暂无可用模块</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { ArrowDown } from '@element-plus/icons-vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { formatMenuTitle } from '@/utils/router'
|
||||
import { useMenuStore } from '@/store/modules/menu'
|
||||
import {
|
||||
filterPortalTopModules,
|
||||
getFirstAccessiblePath,
|
||||
isPortalModuleActive,
|
||||
PORTAL_DEFAULT_MODULE_PATH,
|
||||
resolveActivePortalModule
|
||||
} from '@/utils/router/portal-menu'
|
||||
import type { AppRouteRecord } from '@/types/router'
|
||||
|
||||
defineOptions({ name: 'ArtPortalModuleSelect' })
|
||||
|
||||
interface PortalModuleItem extends AppRouteRecord {
|
||||
isActive: boolean
|
||||
formattedTitle: string
|
||||
}
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const menuStore = useMenuStore()
|
||||
const { menuList } = storeToRefs(menuStore)
|
||||
|
||||
const currentRoutePath = computed(() => String(route.meta.activePath || route.path))
|
||||
|
||||
const moduleList = computed<PortalModuleItem[]>(() => {
|
||||
return filterPortalTopModules(menuList.value).map((item) => ({
|
||||
...item,
|
||||
isActive: isPortalModuleActive(item, currentRoutePath.value),
|
||||
formattedTitle: formatMenuTitle(item.meta.title)
|
||||
}))
|
||||
})
|
||||
|
||||
const activeModule = computed(() => {
|
||||
const matched = resolveActivePortalModule(menuList.value, currentRoutePath.value)
|
||||
if (matched) {
|
||||
return matched
|
||||
}
|
||||
return moduleList.value.find((item) => item.path === PORTAL_DEFAULT_MODULE_PATH) || moduleList.value[0]
|
||||
})
|
||||
|
||||
const triggerLabel = computed(() => {
|
||||
if (activeModule.value) {
|
||||
return formatMenuTitle(activeModule.value.meta.title)
|
||||
}
|
||||
return moduleList.value[0]?.formattedTitle || '选择模块'
|
||||
})
|
||||
|
||||
const handleModuleSelect = (modulePath: string): void => {
|
||||
const module = moduleList.value.find((item) => item.path === modulePath)
|
||||
if (!module || module.isActive) {
|
||||
return
|
||||
}
|
||||
|
||||
const target = getFirstAccessiblePath(module)
|
||||
if (target && target !== route.path) {
|
||||
router.push(target)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.portal-module-select {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.portal-module-select-trigger {
|
||||
display: inline-flex;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
max-width: 180px;
|
||||
height: 36px;
|
||||
padding: 0 12px;
|
||||
cursor: pointer;
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
border: 1px solid var(--mint-border, #d9e8e2);
|
||||
border-radius: 8px;
|
||||
transition:
|
||||
background-color 0.2s ease,
|
||||
border-color 0.2s ease;
|
||||
|
||||
&__icon {
|
||||
flex-shrink: 0;
|
||||
font-size: 18px;
|
||||
color: var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
&__label {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
color: var(--mint-text, #1e293b);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__arrow {
|
||||
flex-shrink: 0;
|
||||
font-size: 14px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
&:hover:not(.is-disabled) {
|
||||
border-color: var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
&.is-disabled {
|
||||
cursor: not-allowed;
|
||||
background: var(--mint-bg-page, #f8fafc);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.portal-module-select-popper.el-popper {
|
||||
backdrop-filter: none;
|
||||
}
|
||||
|
||||
.portal-module-select-popper {
|
||||
.el-dropdown-menu__item {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
font-size: 15px;
|
||||
|
||||
&.is-active {
|
||||
color: var(--primary, #1ca851);
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
}
|
||||
}
|
||||
|
||||
.portal-module-select-item__icon {
|
||||
flex-shrink: 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,225 @@
|
||||
<!-- 门户顶栏二三级水平菜单(上图标、下标题) -->
|
||||
<template>
|
||||
<div v-show="subMenuList.length" class="portal-sub-nav">
|
||||
<ElMenu
|
||||
mode="horizontal"
|
||||
:ellipsis="true"
|
||||
:default-active="routerPath"
|
||||
background-color="transparent"
|
||||
:show-timeout="50"
|
||||
:hide-timeout="50"
|
||||
popper-class="portal-sub-nav-popper"
|
||||
class="portal-sub-nav-menu"
|
||||
>
|
||||
<PortalSubmenu
|
||||
v-for="(item, index) in subMenuList"
|
||||
:key="`${item.path || item.meta.title}-${index}`"
|
||||
:item="item"
|
||||
:level="2"
|
||||
/>
|
||||
</ElMenu>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useMenuStore } from '@/store/modules/menu'
|
||||
import { filterSidebarRoutes } from '@/utils/router/sidebar-menu-filter'
|
||||
import { resolvePortalSubMenus } from '@/utils/router/portal-menu'
|
||||
import PortalSubmenu from './widget/PortalSubmenu.vue'
|
||||
import type { AppRouteRecord } from '@/types/router'
|
||||
|
||||
defineOptions({ name: 'ArtPortalSubNav' })
|
||||
|
||||
const route = useRoute()
|
||||
const menuStore = useMenuStore()
|
||||
const { menuList } = storeToRefs(menuStore)
|
||||
|
||||
const currentRoutePath = computed(() => String(route.meta.activePath || route.path))
|
||||
const routerPath = computed(() => currentRoutePath.value)
|
||||
|
||||
const subMenuList = computed<AppRouteRecord[]>(() => {
|
||||
const raw = resolvePortalSubMenus(menuList.value, currentRoutePath.value)
|
||||
return filterSidebarRoutes(raw)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.portal-sub-nav {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.portal-sub-nav-menu {
|
||||
width: 100%;
|
||||
height: 56px;
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu.el-menu--horizontal) {
|
||||
height: 56px;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu .el-sub-menu__title) {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 56px !important;
|
||||
padding: 0 6px !important;
|
||||
margin: 0 2px;
|
||||
line-height: normal !important;
|
||||
background-color: transparent !important;
|
||||
border-bottom: none !important;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item:hover),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu:hover > .el-sub-menu__title),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu .el-sub-menu__title:hover) {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu .el-sub-menu__title) {
|
||||
padding-right: 22px !important;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu .el-sub-menu__icon-arrow) {
|
||||
right: 4px;
|
||||
margin-top: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-card) {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 56px;
|
||||
min-height: 48px;
|
||||
padding: 4px 10px;
|
||||
border-radius: 8px;
|
||||
transition:
|
||||
background-color 0.2s ease,
|
||||
color 0.2s ease;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-card__icon) {
|
||||
flex-shrink: 0;
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-card__label) {
|
||||
font-size: 14px;
|
||||
line-height: 1.3;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item:hover .portal-sub-nav-card),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu:hover .portal-sub-nav-card) {
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item.is-active .portal-sub-nav-card) {
|
||||
background: var(--primary, #1ca851);
|
||||
|
||||
.portal-sub-nav-card__icon,
|
||||
.portal-sub-nav-card__label {
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.is-active .portal-sub-nav-card) {
|
||||
background: var(--primary, #1ca851);
|
||||
|
||||
.portal-sub-nav-card__icon,
|
||||
.portal-sub-nav-card__label {
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.portal-sub-nav-menu > .el-menu-item.is-active),
|
||||
:deep(.portal-sub-nav-menu > .el-sub-menu.is-active .el-sub-menu__title) {
|
||||
background: transparent !important;
|
||||
border-bottom: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.portal-sub-nav-popper.el-popper {
|
||||
backdrop-filter: none;
|
||||
}
|
||||
|
||||
.portal-sub-nav-popper {
|
||||
.el-menu-item,
|
||||
.el-sub-menu__title {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.el-menu-item:hover,
|
||||
.el-sub-menu__title:hover {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.el-menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: auto !important;
|
||||
min-height: 56px;
|
||||
padding: 4px 8px !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
|
||||
.portal-sub-nav-card {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 56px;
|
||||
padding: 6px 12px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.portal-sub-nav-card__icon {
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.portal-sub-nav-card__label {
|
||||
font-size: 14px;
|
||||
line-height: 1.3;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.el-menu-item:hover .portal-sub-nav-card {
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
}
|
||||
|
||||
.el-menu-item.is-active .portal-sub-nav-card {
|
||||
background: var(--primary, #1ca851);
|
||||
|
||||
.portal-sub-nav-card__icon,
|
||||
.portal-sub-nav-card__label {
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<ElSubMenu
|
||||
v-if="hasChildren"
|
||||
:index="item.path || item.meta.title"
|
||||
popper-class="portal-sub-nav-popper"
|
||||
class="portal-sub-nav-submenu"
|
||||
>
|
||||
<template #title>
|
||||
<div class="portal-sub-nav-card">
|
||||
<ArtSvgIcon
|
||||
:icon="menuIcon"
|
||||
class="portal-sub-nav-card__icon"
|
||||
/>
|
||||
<span class="portal-sub-nav-card__label">{{ formatMenuTitle(item.meta.title) }}</span>
|
||||
<div v-if="item.meta.showBadge" class="art-badge" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<PortalSubmenu
|
||||
v-for="(child, index) in filteredChildren"
|
||||
:key="getUniqueKey(child, index)"
|
||||
:item="child"
|
||||
:level="level + 1"
|
||||
/>
|
||||
</ElSubMenu>
|
||||
|
||||
<ElMenuItem
|
||||
v-else-if="isNavigableRoute"
|
||||
:index="item.path || item.meta.title"
|
||||
class="portal-sub-nav-menuitem"
|
||||
@click="goPage(item)"
|
||||
>
|
||||
<div class="portal-sub-nav-card">
|
||||
<ArtSvgIcon
|
||||
:icon="menuIcon"
|
||||
class="portal-sub-nav-card__icon"
|
||||
/>
|
||||
<span class="portal-sub-nav-card__label">{{ formatMenuTitle(item.meta.title) }}</span>
|
||||
<div v-if="item.meta.showBadge" class="art-badge" />
|
||||
<div v-if="item.meta.showTextBadge" class="art-text-badge">
|
||||
{{ item.meta.showTextBadge }}
|
||||
</div>
|
||||
</div>
|
||||
</ElMenuItem>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import type { AppRouteRecord } from '@/types/router'
|
||||
import { formatMenuTitle } from '@/utils/router'
|
||||
import { filterSidebarRoutes, isSidebarNavigableRoute } from '@/utils/router/sidebar-menu-filter'
|
||||
import { resolveSidebarMenuIcon } from '@/utils/router/menu-icon'
|
||||
import { handleMenuJump } from '@/utils/navigation'
|
||||
|
||||
defineOptions({ name: 'PortalSubmenu' })
|
||||
|
||||
interface Props {
|
||||
item: AppRouteRecord
|
||||
level?: number
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
level: 2
|
||||
})
|
||||
|
||||
const filteredChildren = computed(() => filterSidebarRoutes(props.item.children || []))
|
||||
|
||||
const hasChildren = computed(() => filteredChildren.value.length > 0)
|
||||
|
||||
const isNavigableRoute = computed(() => isSidebarNavigableRoute(props.item))
|
||||
|
||||
const menuIcon = computed(() =>
|
||||
resolveSidebarMenuIcon(props.item, hasChildren.value)
|
||||
)
|
||||
|
||||
const goPage = (item: AppRouteRecord): void => {
|
||||
handleMenuJump(item)
|
||||
}
|
||||
|
||||
const getUniqueKey = (item: AppRouteRecord, index: number): string => {
|
||||
return `${item.path || item.meta.title || 'menu'}-${props.level}-${index}`
|
||||
}
|
||||
</script>
|
||||
@@ -139,11 +139,11 @@
|
||||
}
|
||||
|
||||
&:hover:not(.is-active) {
|
||||
background: var(--primary-bg, #ecfdf5);
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
background: var(--primary, #10b981);
|
||||
background: var(--primary, #1ca851);
|
||||
|
||||
.portal-top-nav-card__icon,
|
||||
.portal-top-nav-card__label {
|
||||
|
||||
+11
-1
@@ -1,14 +1,16 @@
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ContainerWidthEnum } from '@/enums/appEnum'
|
||||
import { ContainerWidthEnum, MenuTypeEnum } from '@/enums/appEnum'
|
||||
import AppConfig from '@/config'
|
||||
import { headerBarConfig } from '@/config/modules/headerBar'
|
||||
import { useSettingStore } from '@/store/modules/setting'
|
||||
|
||||
/**
|
||||
* 设置项配置选项管理
|
||||
*/
|
||||
export function useSettingsConfig() {
|
||||
const { t } = useI18n()
|
||||
const settingStore = useSettingStore()
|
||||
|
||||
// 标签页风格选项
|
||||
const tabStyleOptions = computed(() => [
|
||||
@@ -219,6 +221,14 @@ export function useSettingsConfig() {
|
||||
return (
|
||||
allSettings
|
||||
.filter((setting) => {
|
||||
// 门户严格单页:隐藏多标签与标签样式配置
|
||||
if (
|
||||
settingStore.menuType === MenuTypeEnum.PORTAL &&
|
||||
(setting.key === 'showWorkTab' || setting.key === 'tabStyle')
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
||||
// 如果设置项不依赖headerBar配置,则始终显示
|
||||
if (setting.headerBarKey === null) {
|
||||
return true
|
||||
|
||||
@@ -64,7 +64,8 @@
|
||||
import { useWorktabStore } from '@/store/modules/worktab'
|
||||
import { useMenuStore } from '@/store/modules/menu'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { getFirstSecondLevelMenuPath, isWorkbenchRoute } from '@/utils/navigation/route'
|
||||
import { isWorkbenchRoute } from '@/utils/navigation/route'
|
||||
import { getPortalDefaultHomePath, getPortalDefaultPathForRoute } from '@/utils/router/portal-menu'
|
||||
import { formatMenuTitle } from '@/utils/router'
|
||||
import { useSettingStore } from '@/store/modules/setting'
|
||||
import { MenuItemType } from '../../others/art-menu-right/index.vue'
|
||||
@@ -344,9 +345,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
/** 标签全部关闭后,导航到侧栏第一个二级菜单 */
|
||||
/** 标签全部关闭后,导航到当前模块第一个二级菜单 */
|
||||
const navigateToDefaultMenuWhenEmpty = () => {
|
||||
const fromMenu = getFirstSecondLevelMenuPath(menuStore.menuList as AppRouteRecord[])
|
||||
const currentPath = String(route.meta.activePath || route.path)
|
||||
const fromModule = getPortalDefaultPathForRoute(
|
||||
menuStore.menuList as AppRouteRecord[],
|
||||
currentPath
|
||||
)
|
||||
const fromMenu =
|
||||
fromModule || getPortalDefaultHomePath(menuStore.menuList as AppRouteRecord[])
|
||||
const home = useCommon().homePath.value
|
||||
const fallbackPath = fromMenu || (home && !isWorkbenchRoute(home) ? home : '')
|
||||
if (fallbackPath && route.path !== fallbackPath) {
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
right: -80px;
|
||||
width: 360px;
|
||||
height: 360px;
|
||||
background: rgba(16, 185, 129, 0.18);
|
||||
background: rgba(28, 168, 81, 0.18);
|
||||
}
|
||||
|
||||
.exception-page__blob--2 {
|
||||
|
||||
@@ -12,7 +12,7 @@ export function sumProductActualQuantities(products: FreightCalcProductRow[]) {
|
||||
if (actual != null && !Number.isNaN(Number(actual))) {
|
||||
return sum + Number(actual)
|
||||
}
|
||||
return sum + Number(row.quantity || 0)
|
||||
return sum
|
||||
}, 0)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import type {
|
||||
import { planApi } from '@/api/pl'
|
||||
import DbPoundSlipQrcodeDialog from '@/components/business/db/DbPoundSlipQrcodeDialog.vue'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { formatDateTime } from '@/utils/format'
|
||||
import { formatDate } from '@/utils/format'
|
||||
import { pickBxData } from '@/utils/http/bx'
|
||||
import { formatPlanProductListText } from '@/utils/pl-display'
|
||||
import { buildSiteSummaryFromInventoryLinks } from '@/utils/db-site-summary'
|
||||
@@ -118,7 +118,7 @@ export function usePlPlanArrangeActions() {
|
||||
const lines = ['【运输安排】', `计划号:${plan.value?.planNo || '—'}`]
|
||||
lines.push(`车牌:${options?.licensePlate || licensePlate.value || plan.value?.licensePlate || '—'}`)
|
||||
lines.push(
|
||||
`时间:${formatDateTime(plan.value?.pickupTime) || plan.value?.planDate || '—'}`
|
||||
`时间:${formatDate(plan.value?.pickupTime) || plan.value?.planDate || '—'}`
|
||||
)
|
||||
const productText = products.value
|
||||
.map(p => formatPlanProductListText(p, getUnitLabel, { usePlannedQuantity: true }))
|
||||
|
||||
@@ -38,7 +38,7 @@ import { headerBarConfig } from './modules/headerBar'
|
||||
const appConfig: SystemConfig = {
|
||||
// 系统信息
|
||||
systemInfo: {
|
||||
name: '一体化门户' // 系统名称
|
||||
name: '山峡化工一体化门户' // 系统名称
|
||||
},
|
||||
// 系统主题
|
||||
systemThemeStyles: {
|
||||
@@ -119,6 +119,7 @@ const appConfig: SystemConfig = {
|
||||
],
|
||||
// 系统主色
|
||||
systemMainColor: [
|
||||
'#1ca851', // 山峡品牌绿
|
||||
'#1989fa', // 运营端专业蓝
|
||||
'#07c160', // 成功绿
|
||||
'#ff976a', // 警告橙
|
||||
|
||||
@@ -51,8 +51,8 @@ export const SETTING_DEFAULT_CONFIG = {
|
||||
showRefreshButton: false,
|
||||
/** 是否显示面包屑 */
|
||||
showCrumbs: false,
|
||||
/** 是否显示工作台标签 */
|
||||
showWorkTab: true,
|
||||
/** 是否显示工作台标签(false = 严格单页:每次仅保留当前页面) */
|
||||
showWorkTab: false,
|
||||
/** 是否显示语言切换 */
|
||||
showLanguage: true,
|
||||
/** 是否显示进度条 */
|
||||
|
||||
@@ -31,8 +31,9 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
import { AppRouteRecord } from '@/types/router'
|
||||
import { getFirstMenuPath, getFirstSecondLevelMenuPath } from '@/utils'
|
||||
import { getFirstMenuPath } from '@/utils'
|
||||
import { HOME_PAGE_PATH } from '@/router'
|
||||
import { getPortalDefaultHomePath } from '@/utils/router/portal-menu'
|
||||
|
||||
/**
|
||||
* 菜单状态管理
|
||||
@@ -54,7 +55,7 @@ export const useMenuStore = defineStore('menuStore', () => {
|
||||
*/
|
||||
const setMenuList = (list: AppRouteRecord[]) => {
|
||||
menuList.value = list
|
||||
setHomePath(HOME_PAGE_PATH || getFirstSecondLevelMenuPath(list) || getFirstMenuPath(list))
|
||||
setHomePath(HOME_PAGE_PATH || getPortalDefaultHomePath(list) || getFirstMenuPath(list))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,6 +39,7 @@ import { setElementThemeColor } from '@/utils/ui'
|
||||
import { useCeremony } from '@/hooks/core/useCeremony'
|
||||
import { StorageConfig } from '@/utils'
|
||||
import { SETTING_DEFAULT_CONFIG } from '@/config/setting'
|
||||
import { useWorktabStore } from '@/store/modules/worktab'
|
||||
|
||||
/**
|
||||
* 系统设置状态管理
|
||||
@@ -266,6 +267,9 @@ export const useSettingStore = defineStore(
|
||||
*/
|
||||
const setWorkTab = (show: boolean) => {
|
||||
showWorkTab.value = show
|
||||
if (!show) {
|
||||
useWorktabStore().enforceSinglePageTabs()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -444,7 +448,9 @@ export const useSettingStore = defineStore(
|
||||
{
|
||||
persist: {
|
||||
key: 'setting',
|
||||
storage: localStorage
|
||||
storage: localStorage,
|
||||
/** 严格单页:不持久化多标签开关,避免旧配置覆盖默认 false */
|
||||
omit: ['showWorkTab']
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -45,7 +45,9 @@ import { LocationQueryRaw, Router } from 'vue-router'
|
||||
import { WorkTab } from '@/types'
|
||||
import { useCommon } from '@/hooks/core/useCommon'
|
||||
import { useMenuStore } from '@/store/modules/menu'
|
||||
import { getFirstSecondLevelMenuPath, isWorkbenchRoute } from '@/utils/navigation/route'
|
||||
import { isWorkbenchRoute } from '@/utils/navigation/route'
|
||||
import { getPortalDefaultHomePath, getPortalDefaultPathForRoute } from '@/utils/router/portal-menu'
|
||||
import { useSettingStore } from '@/store/modules/setting'
|
||||
|
||||
interface WorktabState {
|
||||
current: Partial<WorkTab>
|
||||
@@ -111,12 +113,19 @@ export const useWorktabStore = defineStore(
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签全部关闭后的默认落点:侧栏第一个二级菜单(无则回退首页路径)
|
||||
* 标签全部关闭后的默认落点:当前一级模块首个二级菜单(无则回退首页路径)
|
||||
*/
|
||||
const resolveEmptyTabsPath = (): string => {
|
||||
const menuStore = useMenuStore()
|
||||
const { homePath } = useCommon()
|
||||
const fromMenu = getFirstSecondLevelMenuPath(menuStore.menuList)
|
||||
const currentPath = String(
|
||||
router.currentRoute.value.meta.activePath || router.currentRoute.value.path
|
||||
)
|
||||
const fromModule = getPortalDefaultPathForRoute(menuStore.menuList, currentPath)
|
||||
if (fromModule) {
|
||||
return fromModule
|
||||
}
|
||||
const fromMenu = getPortalDefaultHomePath(menuStore.menuList)
|
||||
if (fromMenu) {
|
||||
return fromMenu
|
||||
}
|
||||
@@ -146,6 +155,30 @@ export const useWorktabStore = defineStore(
|
||||
}
|
||||
}
|
||||
|
||||
/** 严格单页:showWorkTab 为 false 时仅保留当前页面并清理缓存 */
|
||||
const isSinglePageMode = (): boolean => !useSettingStore().showWorkTab
|
||||
|
||||
/**
|
||||
* 将已打开标签压至单页(保留当前激活页,其余移出 KeepAlive)
|
||||
*/
|
||||
const enforceSinglePageTabs = (): void => {
|
||||
if (!isSinglePageMode() || opened.value.length <= 1) {
|
||||
return
|
||||
}
|
||||
|
||||
const activePath =
|
||||
current.value.path || router.currentRoute.value.meta.activePath || router.currentRoute.value.path
|
||||
const activeTab =
|
||||
opened.value.find((t) => t.path === activePath) ?? opened.value[opened.value.length - 1]
|
||||
|
||||
const toRemove = opened.value.filter((t) => t.path !== activeTab?.path)
|
||||
markTabsToRemove(toRemove)
|
||||
opened.value = activeTab ? [activeTab] : []
|
||||
if (activeTab) {
|
||||
current.value = activeTab
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开或激活一个选项卡
|
||||
*/
|
||||
@@ -156,6 +189,8 @@ export const useWorktabStore = defineStore(
|
||||
}
|
||||
if (shouldIgnoreTab(tab)) return
|
||||
|
||||
const singlePage = isSinglePageMode()
|
||||
|
||||
// 从 keepAlive 排除列表中移除
|
||||
if (tab.name) {
|
||||
removeKeepAliveExclude(tab.name)
|
||||
@@ -171,13 +206,21 @@ export const useWorktabStore = defineStore(
|
||||
}
|
||||
|
||||
if (existingIndex === -1) {
|
||||
const newTab = { ...tab, fixedTab: singlePage ? false : tab.fixedTab }
|
||||
|
||||
if (singlePage) {
|
||||
markTabsToRemove(opened.value.filter((t) => t.path !== newTab.path))
|
||||
opened.value = [newTab]
|
||||
current.value = newTab
|
||||
return
|
||||
}
|
||||
|
||||
// 新增标签页:超出上限时淘汰最早的可关闭标签
|
||||
if (!ensureCapacityForNewTab()) {
|
||||
return
|
||||
}
|
||||
|
||||
const insertIndex = tab.fixedTab ? findFixedTabInsertIndex() : opened.value.length
|
||||
const newTab = { ...tab }
|
||||
|
||||
if (tab.fixedTab) {
|
||||
opened.value.splice(insertIndex, 0, newTab)
|
||||
@@ -196,13 +239,17 @@ export const useWorktabStore = defineStore(
|
||||
params: tab.params,
|
||||
query: tab.query,
|
||||
title: tab.title || existingTab.title,
|
||||
fixedTab: tab.fixedTab ?? existingTab.fixedTab,
|
||||
fixedTab: singlePage ? false : (tab.fixedTab ?? existingTab.fixedTab),
|
||||
keepAlive: tab.keepAlive ?? existingTab.keepAlive,
|
||||
name: tab.name || existingTab.name,
|
||||
icon: tab.icon || existingTab.icon
|
||||
}
|
||||
|
||||
current.value = opened.value[existingIndex]
|
||||
|
||||
if (singlePage) {
|
||||
enforceSinglePageTabs()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -528,7 +575,11 @@ export const useWorktabStore = defineStore(
|
||||
opened.value = validTabs
|
||||
}
|
||||
|
||||
trimTabsToMaxOpen()
|
||||
if (isSinglePageMode()) {
|
||||
enforceSinglePageTabs()
|
||||
} else {
|
||||
trimTabsToMaxOpen()
|
||||
}
|
||||
|
||||
// 验证当前激活标签的有效性
|
||||
const isCurrentValid =
|
||||
@@ -621,6 +672,7 @@ export const useWorktabStore = defineStore(
|
||||
removeAll,
|
||||
toggleFixedTab,
|
||||
validateWorktabs,
|
||||
enforceSinglePageTabs,
|
||||
clearAll,
|
||||
getStateSnapshot,
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #374151;
|
||||
background: #ecfdf5;
|
||||
background: #e6f8ed;
|
||||
padding: 0 12px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
@@ -60,7 +60,7 @@
|
||||
display: inline-block;
|
||||
width: 3px;
|
||||
height: 14px;
|
||||
background: #10b981;
|
||||
background: #1ca851;
|
||||
border-radius: 2px;
|
||||
margin-right: 8px;
|
||||
vertical-align: middle;
|
||||
@@ -78,8 +78,8 @@
|
||||
transition: all 0.15s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: #10b981;
|
||||
box-shadow: 0 2px 4px rgba(16, 185, 129, 0.12);
|
||||
border-color: #1ca851;
|
||||
box-shadow: 0 2px 4px rgba(28, 168, 81, 0.12);
|
||||
}
|
||||
&:active {
|
||||
cursor: grabbing;
|
||||
@@ -171,11 +171,11 @@
|
||||
transition: all 0.15s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: #6ee7b7;
|
||||
border-color: #7dd094;
|
||||
}
|
||||
&.is-active {
|
||||
border-color: #10b981;
|
||||
background: #ecfdf5;
|
||||
border-color: #1ca851;
|
||||
background: #e6f8ed;
|
||||
}
|
||||
}
|
||||
.route-config-step-handle {
|
||||
@@ -192,7 +192,7 @@
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 50%;
|
||||
background: #10b981;
|
||||
background: #1ca851;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
.upload-card {
|
||||
width: 140px;
|
||||
height: 96px;
|
||||
border: 1px dashed var(--el-color-primary-light-7, #a7f3d0);
|
||||
border: 1px dashed var(--el-color-primary-light-7, #a8e0b8);
|
||||
border-radius: var(--radius-md, 8px);
|
||||
background: var(--primary-bg);
|
||||
display: flex;
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
&:hover {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
|
||||
box-shadow: 0 2px 8px rgba(28, 168, 81, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
.bx-select .el-select__wrapper.is-focus,
|
||||
.bx-date-picker .el-input__wrapper.is-focus {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
|
||||
box-shadow: 0 0 0 2px rgba(28, 168, 81, 0.2);
|
||||
}
|
||||
|
||||
.bx-input .el-input__inner {
|
||||
@@ -366,7 +366,7 @@
|
||||
|
||||
.bx-tag--pending { color: var(--text-muted); }
|
||||
.bx-tag--processing { color: var(--primary-dark); }
|
||||
.bx-tag--done { color: var(--mint-success-text, #047857); }
|
||||
.bx-tag--done { color: var(--mint-success-text, #147a3c); }
|
||||
.bx-tag--warning {
|
||||
color: #b45309;
|
||||
background: var(--surface)beb;
|
||||
@@ -377,7 +377,7 @@
|
||||
background: var(--surface)beb;
|
||||
}
|
||||
.bx-tag--error { color: var(--danger); }
|
||||
.bx-tag--info { color: var(--mint-success-text, #047857); }
|
||||
.bx-tag--info { color: var(--mint-success-text, #147a3c); }
|
||||
|
||||
.bx-btn.el-button {
|
||||
height: var(--control-h);
|
||||
|
||||
@@ -44,13 +44,13 @@
|
||||
.list-toolbar-date-shortcuts .date-shortcut-btn.is-active.el-button {
|
||||
color: var(--primary-dark) !important;
|
||||
background: var(--primary-bg) !important;
|
||||
border-color: rgba(16, 185, 129, 0.35) !important;
|
||||
border-color: rgba(28, 168, 81, 0.35) !important;
|
||||
--el-button-text-color: var(--primary-dark);
|
||||
--el-button-bg-color: var(--primary-bg);
|
||||
--el-button-border-color: rgba(16, 185, 129, 0.35);
|
||||
--el-button-border-color: rgba(28, 168, 81, 0.35);
|
||||
--el-button-hover-text-color: var(--primary-dark);
|
||||
--el-button-hover-bg-color: var(--primary-bg);
|
||||
--el-button-hover-border-color: rgba(16, 185, 129, 0.45);
|
||||
--el-button-hover-border-color: rgba(28, 168, 81, 0.45);
|
||||
}
|
||||
|
||||
.db-quick-search-icon {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
:root {
|
||||
--van-primary-color: #10b981;
|
||||
--van-success-color: #10b981;
|
||||
--van-button-primary-background: #10b981;
|
||||
--van-button-primary-border-color: #10b981;
|
||||
--van-nav-bar-background: #ecfdf5;
|
||||
--van-nav-bar-title-text-color: #059669;
|
||||
--van-primary-color: #1ca851;
|
||||
--van-success-color: #1ca851;
|
||||
--van-button-primary-background: #1ca851;
|
||||
--van-button-primary-border-color: #1ca851;
|
||||
--van-nav-bar-background: #e6f8ed;
|
||||
--van-nav-bar-title-text-color: #168f45;
|
||||
--van-cell-group-inset-padding: 0;
|
||||
--van-uploader-size: 96px;
|
||||
--van-uploader-upload-background: #ecfdf5;
|
||||
--van-uploader-upload-icon-color: #059669;
|
||||
--van-uploader-upload-active-color: #10b981;
|
||||
--van-uploader-upload-background: #e6f8ed;
|
||||
--van-uploader-upload-icon-color: #168f45;
|
||||
--van-uploader-upload-active-color: #1ca851;
|
||||
}
|
||||
|
||||
.public-pl-transport-page {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { InventoryRecord } from '@/api/db/inventory'
|
||||
import type { TransportInventoryLink } from '@/api/pl'
|
||||
import { formatDateTime } from '@/utils/format'
|
||||
import { formatDate } from '@/utils/format'
|
||||
|
||||
const SITE_INSTRUCTION = '说明:请打开链接上传现场附件并填写备注。'
|
||||
|
||||
@@ -27,7 +27,7 @@ export function buildSiteSummaryFromInventoryLinks(options: {
|
||||
const planNo = options.planNo || options.records[0]?.planNo
|
||||
if (planNo) lines.push(`计划号:${planNo}`)
|
||||
if (options.licensePlate) lines.push(`车牌:${options.licensePlate}`)
|
||||
const time = formatDateTime(options.pickupTime) || options.planDate
|
||||
const time = formatDate(options.pickupTime) || options.planDate
|
||||
if (time) lines.push(`时间:${time}`)
|
||||
|
||||
const validRecords = options.records.filter(item => item.siteUrl)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { fetchAttachmentDownloadUrl } from '@/api/admin'
|
||||
import { fetchAttachmentDownloadUrl, fetchAttachmentPreviewUrl } from '@/api/admin'
|
||||
|
||||
export type AttachmentDownloadItem = {
|
||||
fileUrl?: string
|
||||
@@ -34,6 +34,25 @@ function triggerAnchorDownload(href: string, fileName: string) {
|
||||
document.body.removeChild(a)
|
||||
}
|
||||
|
||||
/** 附件预览:优先走后端预签名 inline URL,供 PDF iframe 等内联展示。 */
|
||||
export async function resolveAttachmentPreviewUrl(
|
||||
file: AttachmentDownloadItem,
|
||||
options?: { fullFileUrl?: (url: string) => string }
|
||||
): Promise<string> {
|
||||
const fileUrl = String(file.fileUrl || '').trim()
|
||||
if (!fileUrl) return ''
|
||||
const resolveUrl = options?.fullFileUrl || ((url: string) => url)
|
||||
|
||||
try {
|
||||
const res = await fetchAttachmentPreviewUrl({ fileUrl, fileName: file.fileName })
|
||||
if (res?.previewUrl) return res.previewUrl
|
||||
} catch {
|
||||
// 预签名失败时回退直连
|
||||
}
|
||||
|
||||
return resolveUrl(fileUrl)
|
||||
}
|
||||
|
||||
/** 附件下载:优先走后端预签名 URL,保证跨域场景下保留原始文件名与后缀。 */
|
||||
export async function downloadAttachmentFile(
|
||||
file: AttachmentDownloadItem,
|
||||
|
||||
@@ -35,3 +35,7 @@ export function parseTime(time?: string | number | Date | null, pattern = '{y}-{
|
||||
export function formatDateTime(time?: string | null) {
|
||||
return parseTime(time)
|
||||
}
|
||||
|
||||
export function formatDate(time?: string | number | Date | null) {
|
||||
return parseTime(time, '{y}-{m}-{d}')
|
||||
}
|
||||
@@ -24,9 +24,7 @@
|
||||
import { useWorktabStore } from '@/store/modules/worktab'
|
||||
import { RouteLocationNormalized } from 'vue-router'
|
||||
import { isIframe, isWorkbenchRoute } from './route'
|
||||
import { useSettingStore } from '@/store/modules/setting'
|
||||
import { IframeRouteManager } from '@/router/core'
|
||||
import { useCommon } from '@/hooks/core/useCommon'
|
||||
|
||||
/**
|
||||
* 根据当前路由信息设置工作标签页(worktab)
|
||||
@@ -54,7 +52,7 @@ export const setWorktab = (to: RouteLocationNormalized): void => {
|
||||
query
|
||||
})
|
||||
}
|
||||
} else if (useSettingStore().showWorkTab || path === useCommon().homePath.value) {
|
||||
} else {
|
||||
worktabStore.openTab({
|
||||
title: meta.title as string,
|
||||
icon: meta.icon as string,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { AppRouteRecord } from '@/types/router'
|
||||
import { getFirstMenuPath } from '@/utils/navigation/route'
|
||||
import { getFirstMenuPath, getFirstSecondLevelMenuPath, isIframe } from '@/utils/navigation/route'
|
||||
import { filterSidebarRoutes } from '@/utils/router/sidebar-menu-filter'
|
||||
|
||||
/** 门户顶栏一级模块展示顺序(与路由注册顺序无关) */
|
||||
@@ -14,6 +14,9 @@ export const PORTAL_TOP_MODULE_ORDER = [
|
||||
|
||||
export type PortalTopModulePath = (typeof PORTAL_TOP_MODULE_ORDER)[number]
|
||||
|
||||
/** 门户默认一级模块(登录后 / 关闭全部标签等场景的默认落点) */
|
||||
export const PORTAL_DEFAULT_MODULE_PATH: PortalTopModulePath = '/crm'
|
||||
|
||||
export function isDashboardMenuItem(item: AppRouteRecord): boolean {
|
||||
const path = String(item.path ?? '')
|
||||
const title = String(item.meta?.title ?? '')
|
||||
@@ -101,3 +104,78 @@ export function getFirstAccessiblePath(module: AppRouteRecord): string {
|
||||
|
||||
return module.path || '/'
|
||||
}
|
||||
|
||||
function findIframeSubMenus(currentPath: string, menuList: AppRouteRecord[]): AppRouteRecord[] {
|
||||
const hasPath = (items: AppRouteRecord[]): boolean => {
|
||||
for (const item of items) {
|
||||
if (item.path === currentPath) {
|
||||
return true
|
||||
}
|
||||
if (item.children?.length && hasPath(item.children)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
for (const menu of menuList) {
|
||||
if (menu.children?.length && hasPath(menu.children)) {
|
||||
return menu.children
|
||||
}
|
||||
}
|
||||
|
||||
return []
|
||||
}
|
||||
|
||||
/** 当前路由所属一级模块下的侧栏/顶栏子菜单(二三级) */
|
||||
export function resolvePortalSubMenus(
|
||||
menuList: AppRouteRecord[],
|
||||
routePath: string
|
||||
): AppRouteRecord[] {
|
||||
const allMenus = menuList || []
|
||||
const activePath = String(routePath)
|
||||
|
||||
if (isIframe(activePath)) {
|
||||
return findIframeSubMenus(activePath, allMenus)
|
||||
}
|
||||
|
||||
const currentTopPath = resolveTopModulePath(activePath)
|
||||
if (!currentTopPath) {
|
||||
return []
|
||||
}
|
||||
|
||||
const currentMenu = allMenus.find((menu) => menu.path === currentTopPath)
|
||||
return currentMenu?.children ?? []
|
||||
}
|
||||
|
||||
/** 门户默认首页:优先 CRM 管理模块首个可访问页 */
|
||||
export function getPortalDefaultHomePath(menuList: AppRouteRecord[]): string {
|
||||
const tops = filterPortalTopModules(menuList)
|
||||
const defaultModule =
|
||||
tops.find((item) => item.path === PORTAL_DEFAULT_MODULE_PATH) || tops[0]
|
||||
if (defaultModule) {
|
||||
return getFirstAccessiblePath(defaultModule)
|
||||
}
|
||||
return getFirstSecondLevelMenuPath(menuList) || getFirstMenuPath(menuList)
|
||||
}
|
||||
|
||||
/** WorkTab 全部关闭后:当前模块首个二级路径,无则模块首个可访问页 */
|
||||
export function getPortalDefaultPathForRoute(
|
||||
menuList: AppRouteRecord[],
|
||||
routePath: string
|
||||
): string {
|
||||
const module = resolveActivePortalModule(menuList, routePath)
|
||||
if (!module) {
|
||||
return getPortalDefaultHomePath(menuList)
|
||||
}
|
||||
|
||||
const children = filterSidebarRoutes(resolvePortalSubMenus(menuList, routePath))
|
||||
if (children.length) {
|
||||
const childPath = getFirstMenuPath(children, module.path)
|
||||
if (childPath) {
|
||||
return childPath
|
||||
}
|
||||
}
|
||||
|
||||
return getFirstAccessiblePath(module)
|
||||
}
|
||||
@@ -334,7 +334,8 @@
|
||||
|
||||
<BaseDetailTableSection title="冲抵记录" :data="viewOffsetRecords" empty-text="暂无冲抵记录">
|
||||
<el-table class="list-table" :data="viewOffsetRecords" stripe size="small">
|
||||
<el-table-column
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
prop="reimburseApplyCode"
|
||||
label="报销单号"
|
||||
min-width="130"
|
||||
|
||||
@@ -420,7 +420,8 @@
|
||||
|
||||
<BaseDetailTableSection title="冲抵流水" :data="offsetRecords" empty-text="暂无冲抵记录">
|
||||
<el-table class="list-table" :data="offsetRecords" stripe size="small">
|
||||
<el-table-column prop="reimburseApplyCode" label="报销单号" min-width="130" align="center" header-align="center" />
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column prop="reimburseApplyCode" label="报销单号" min-width="130" align="center" header-align="center" />
|
||||
<el-table-column prop="reimburseApplicantName" label="报销申请人" min-width="100" align="center" header-align="center" />
|
||||
<el-table-column label="冲抵金额(元)" min-width="120" class-name="col-money" align="right" header-align="center">
|
||||
<template #default="{ row: offsetRow }">
|
||||
|
||||
@@ -453,6 +453,7 @@
|
||||
@selection-change="handleOffsetSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" min-width="48" align="center" header-align="center" />
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column prop="applyCode" label="申请单号" min-width="130" align="center" header-align="center" />
|
||||
<el-table-column prop="applicantName" label="申请人" min-width="80" align="center" header-align="center" />
|
||||
<el-table-column prop="reason" label="申请原因" min-width="120" align="left" header-align="center" show-overflow-tooltip />
|
||||
@@ -561,7 +562,8 @@
|
||||
<h4 class="dlg-view-section-title section-gap-tight">冲抵明细</h4>
|
||||
<BaseDetailTableSection embedded title="冲抵明细" :data="processedOffsetRecords" empty-text="暂无冲抵明细">
|
||||
<el-table class="list-table" :data="processedOffsetRecords" stripe size="small">
|
||||
<el-table-column prop="advanceApplyCode" label="备用金单号" min-width="130" align="center" header-align="center" />
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column prop="advanceApplyCode" label="备用金单号" min-width="130" align="center" header-align="center" />
|
||||
<el-table-column prop="advanceApplicantName" label="备用金申请人" min-width="110" align="center" header-align="center" />
|
||||
<el-table-column prop="advanceReason" label="申请原因" min-width="160" align="left" header-align="center" show-overflow-tooltip />
|
||||
<el-table-column label="冲抵金额(元)" min-width="120" class-name="col-money" align="right" header-align="center">
|
||||
|
||||
@@ -401,7 +401,7 @@
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
border-left: 3px solid #10b981;
|
||||
border-left: 3px solid #1ca851;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,6 +241,14 @@
|
||||
@row-dblclick="handleView"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="clueName"
|
||||
label="线索姓名"
|
||||
|
||||
@@ -77,7 +77,8 @@
|
||||
<section v-else class="invalid-dialog-section">
|
||||
<h3 class="invalid-section-title">待标记线索({{ batchClues.length }} 条)</h3>
|
||||
<el-table :data="batchClues" class="list-table invalid-batch-table" stripe max-height="240">
|
||||
<el-table-column prop="clueName" label="线索姓名" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column prop="clueName" label="线索姓名" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="company" label="公司名称" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="mobile" label="手机号" min-width="120" />
|
||||
<el-table-column prop="level" label="线索等级" min-width="100">
|
||||
@@ -275,7 +276,7 @@
|
||||
height: 14px;
|
||||
margin-right: 8px;
|
||||
vertical-align: -2px;
|
||||
background: var(--primary, #10b981);
|
||||
background: var(--primary, #1ca851);
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
@@ -291,7 +292,7 @@
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
padding: 16px 18px;
|
||||
background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 55%);
|
||||
background: linear-gradient(135deg, #e6f8ed 0%, #ffffff 55%);
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@@ -302,9 +303,9 @@
|
||||
justify-content: center;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
color: var(--primary, #10b981);
|
||||
color: var(--primary, #1ca851);
|
||||
background: #fff;
|
||||
border: 1px solid #a7f3d0;
|
||||
border: 1px solid #a8e0b8;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
|
||||
@@ -148,9 +148,9 @@
|
||||
getStatisticsByOwner
|
||||
} from '@/api/crm/clue'
|
||||
|
||||
const MINT = '#10b981'
|
||||
const MINT_DARK = '#059669'
|
||||
const MINT_LIGHT = 'rgba(16, 185, 129, 0.25)'
|
||||
const MINT = '#1ca851'
|
||||
const MINT_DARK = '#168f45'
|
||||
const MINT_LIGHT = 'rgba(28, 168, 81, 0.25)'
|
||||
const AMBER = '#d97706'
|
||||
|
||||
const loading = ref(false)
|
||||
@@ -410,7 +410,7 @@
|
||||
label: { show: true, position: 'inside', formatter: '{b}: {c}个\n{d}%' },
|
||||
data: [
|
||||
{ value: totalCount, name: '新增线索', itemStyle: { color: MINT } },
|
||||
{ value: followCount, name: '开始跟进', itemStyle: { color: '#34d399' } },
|
||||
{ value: followCount, name: '开始跟进', itemStyle: { color: '#49be78' } },
|
||||
{ value: deepFollowCount, name: '深度跟进', itemStyle: { color: AMBER } },
|
||||
{ value: intentCount, name: '意向明确', itemStyle: { color: '#f59e0b' } },
|
||||
{ value: convertedCount, name: '成功转化', itemStyle: { color: MINT_DARK } }
|
||||
@@ -526,13 +526,13 @@
|
||||
margin-right: 14px;
|
||||
|
||||
&.primary {
|
||||
background: var(--primary-bg, #ecfdf5);
|
||||
color: var(--primary, #10b981);
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
color: var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
&.success {
|
||||
background: rgba(16, 185, 129, 0.12);
|
||||
color: var(--primary-dark, #059669);
|
||||
background: rgba(28, 168, 81, 0.12);
|
||||
color: var(--primary-dark, #168f45);
|
||||
}
|
||||
|
||||
&.warning {
|
||||
@@ -541,8 +541,8 @@
|
||||
}
|
||||
|
||||
&.danger {
|
||||
background: rgba(16, 185, 129, 0.08);
|
||||
color: #047857;
|
||||
background: rgba(28, 168, 81, 0.08);
|
||||
color: #147a3c;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,14 @@
|
||||
row-key="id"
|
||||
@row-dblclick="handleView"
|
||||
>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (queryParams.pageNum - 1) * queryParams.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="contractNo"
|
||||
label="合同编号"
|
||||
@@ -99,7 +107,9 @@
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-link type="primary" @click="handleViewContract(row)">{{ row.contractNo }}</el-link>
|
||||
<el-link type="primary" @click="handleViewContract(row)">{{
|
||||
row.contractNo
|
||||
}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -122,8 +132,12 @@
|
||||
/>
|
||||
<el-table-column label="审批结果" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.approvalResult === 'approved'" type="success" size="small">通过</el-tag>
|
||||
<el-tag v-else-if="row.approvalResult === 'rejected'" type="danger" size="small">驳回</el-tag>
|
||||
<el-tag v-if="row.approvalResult === 'approved'" type="success" size="small"
|
||||
>通过</el-tag
|
||||
>
|
||||
<el-tag v-else-if="row.approvalResult === 'rejected'" type="danger" size="small"
|
||||
>驳回</el-tag
|
||||
>
|
||||
<el-tag v-else type="warning" size="small">待审批</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -166,7 +180,9 @@
|
||||
<template #hero-actions>
|
||||
<div class="approval-view-hero-actions">
|
||||
<el-button
|
||||
v-if="hasContractPerm('approvalApprove') && viewDialog.data.approvalResult === 'pending'"
|
||||
v-if="
|
||||
hasContractPerm('approvalApprove') && viewDialog.data.approvalResult === 'pending'
|
||||
"
|
||||
class="btn-main"
|
||||
type="primary"
|
||||
@click="handleApprove(viewDialog.data)"
|
||||
@@ -219,7 +235,12 @@
|
||||
<el-button class="btn-ghost" @click="approvalDialog.visible = false">
|
||||
<el-icon><Close /></el-icon>取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" :loading="submitLoading" @click="submitApproval">
|
||||
<el-button
|
||||
class="btn-main"
|
||||
type="primary"
|
||||
:loading="submitLoading"
|
||||
@click="submitApproval"
|
||||
>
|
||||
<el-icon><Check /></el-icon>确定
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -229,121 +250,207 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ContractApproval">
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { Document, Download, Search, RefreshLeft, Close, Check, EditPen } from '@element-plus/icons-vue'
|
||||
import SystemViewDialog, {
|
||||
type ViewField,
|
||||
type ViewSection
|
||||
} from '@/components/business/system-view-dialog/index.vue'
|
||||
import { crmField, crmLongField, crmTagField } from '@/utils/crm/view-fields'
|
||||
import {
|
||||
listApproval,
|
||||
getApproval,
|
||||
approvePass,
|
||||
approveReject,
|
||||
exportApproval,
|
||||
type ApprovalQuery,
|
||||
type ApprovalVO
|
||||
} from '@/api/crm/contract/approval'
|
||||
import { parseTime } from '@/utils/format'
|
||||
import { $modal } from '@/utils/modal'
|
||||
import { useContractPerm } from '@/hooks/business/useContractPerm'
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import {
|
||||
Document,
|
||||
Download,
|
||||
Search,
|
||||
RefreshLeft,
|
||||
Close,
|
||||
Check,
|
||||
EditPen
|
||||
} from '@element-plus/icons-vue'
|
||||
import SystemViewDialog, {
|
||||
type ViewField,
|
||||
type ViewSection
|
||||
} from '@/components/business/system-view-dialog/index.vue'
|
||||
import { crmField, crmLongField, crmTagField } from '@/utils/crm/view-fields'
|
||||
import {
|
||||
listApproval,
|
||||
getApproval,
|
||||
approvePass,
|
||||
approveReject,
|
||||
exportApproval,
|
||||
type ApprovalQuery,
|
||||
type ApprovalVO
|
||||
} from '@/api/crm/contract/approval'
|
||||
import { parseTime } from '@/utils/format'
|
||||
import { $modal } from '@/utils/modal'
|
||||
import { useContractPerm } from '@/hooks/business/useContractPerm'
|
||||
|
||||
const router = useRouter()
|
||||
const { loadPerms, hasContractPerm } = useContractPerm()
|
||||
const router = useRouter()
|
||||
const { loadPerms, hasContractPerm } = useContractPerm()
|
||||
|
||||
const queryParams = ref<ApprovalQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
contractNo: undefined,
|
||||
contractName: undefined,
|
||||
approverName: undefined,
|
||||
approvalResult: undefined,
|
||||
beginTime: undefined,
|
||||
endTime: undefined
|
||||
})
|
||||
const queryParams = ref<ApprovalQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
contractNo: undefined,
|
||||
contractName: undefined,
|
||||
approverName: undefined,
|
||||
approvalResult: undefined,
|
||||
beginTime: undefined,
|
||||
endTime: undefined
|
||||
})
|
||||
|
||||
const approvalForm = ref({
|
||||
id: undefined as number | undefined,
|
||||
approvalResult: 'approved',
|
||||
approvalOpinion: ''
|
||||
})
|
||||
const approvalForm = ref({
|
||||
id: undefined as number | undefined,
|
||||
approvalResult: 'approved',
|
||||
approvalOpinion: ''
|
||||
})
|
||||
|
||||
const approvalRules = ref({
|
||||
approvalResult: [{ required: true, message: '请选择审批结果', trigger: 'change' }],
|
||||
approvalOpinion: [
|
||||
{
|
||||
validator: (_rule: unknown, value: string, callback: (err?: Error) => void) => {
|
||||
if (approvalForm.value.approvalResult === 'rejected' && !value) {
|
||||
callback(new Error('驳回时必须填写驳回原因'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: 'blur'
|
||||
const approvalRules = ref({
|
||||
approvalResult: [{ required: true, message: '请选择审批结果', trigger: 'change' }],
|
||||
approvalOpinion: [
|
||||
{
|
||||
validator: (_rule: unknown, value: string, callback: (err?: Error) => void) => {
|
||||
if (approvalForm.value.approvalResult === 'rejected' && !value) {
|
||||
callback(new Error('驳回时必须填写驳回原因'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const approvalList = ref<ApprovalVO[]>([])
|
||||
const loading = ref(true)
|
||||
const submitLoading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const total = ref(0)
|
||||
const dateRange = ref<[string, string]>()
|
||||
|
||||
const viewDialog = reactive({
|
||||
visible: false,
|
||||
data: {} as ApprovalVO
|
||||
})
|
||||
|
||||
function approvalResultTag(result?: string) {
|
||||
if (result === 'approved') return { label: '通过', type: 'success' as const }
|
||||
if (result === 'rejected') return { label: '驳回', type: 'danger' as const }
|
||||
return { label: '待审批', type: 'warning' as const }
|
||||
}
|
||||
|
||||
const approvalViewSections = computed<ViewSection[]>(() => {
|
||||
const d = viewDialog.data
|
||||
if (!d?.id && !d?.contractNo) return []
|
||||
|
||||
const result = approvalResultTag(d.approvalResult)
|
||||
|
||||
const basicFields: ViewField[] = [
|
||||
crmField('合同名称', d.contractName),
|
||||
crmField('审批流程 ID', d.flowId),
|
||||
crmField('审批级别', d.step != null ? `第${d.step}级` : undefined),
|
||||
crmField('步骤名称', d.stepName),
|
||||
crmField('审批人部门', d.approverDept),
|
||||
crmField('审批人', d.approverName),
|
||||
crmTagField('审批结果', result.label, result.type)
|
||||
]
|
||||
|
||||
const detailFields: ViewField[] = [
|
||||
crmLongField('审批意见', d.approvalOpinion, { fullSpan: true }),
|
||||
crmField('审批时间', parseTime(d.approvalTime)),
|
||||
crmField('创建时间', parseTime(d.createTime)),
|
||||
crmLongField('备注', d.remark, { fullSpan: true })
|
||||
]
|
||||
|
||||
return [
|
||||
{ title: '基本信息', fields: basicFields },
|
||||
{ title: '审批详情', fields: detailFields }
|
||||
]
|
||||
})
|
||||
|
||||
const approvalDialog = reactive({
|
||||
visible: false
|
||||
})
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>()
|
||||
const approvalFormRef = ref<ElFormInstance>()
|
||||
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
if (dateRange.value && dateRange.value.length === 2) {
|
||||
queryParams.value.beginTime = dateRange.value[0]
|
||||
queryParams.value.endTime = dateRange.value[1]
|
||||
} else {
|
||||
queryParams.value.beginTime = undefined
|
||||
queryParams.value.endTime = undefined
|
||||
}
|
||||
|
||||
const res = await listApproval(queryParams.value)
|
||||
approvalList.value = res.rows
|
||||
total.value = res.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
const approvalList = ref<ApprovalVO[]>([])
|
||||
const loading = ref(true)
|
||||
const submitLoading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const total = ref(0)
|
||||
const dateRange = ref<[string, string]>()
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const viewDialog = reactive({
|
||||
visible: false,
|
||||
data: {} as ApprovalVO
|
||||
})
|
||||
const resetQuery = () => {
|
||||
dateRange.value = undefined
|
||||
queryFormRef.value?.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
function approvalResultTag(result?: string) {
|
||||
if (result === 'approved') return { label: '通过', type: 'success' as const }
|
||||
if (result === 'rejected') return { label: '驳回', type: 'danger' as const }
|
||||
return { label: '待审批', type: 'warning' as const }
|
||||
}
|
||||
const handleView = async (row: ApprovalVO) => {
|
||||
const res = await getApproval(row.id)
|
||||
viewDialog.data = res.data
|
||||
viewDialog.visible = true
|
||||
}
|
||||
|
||||
const approvalViewSections = computed<ViewSection[]>(() => {
|
||||
const d = viewDialog.data
|
||||
if (!d?.id && !d?.contractNo) return []
|
||||
const handleViewContract = (row: ApprovalVO) => {
|
||||
router.push({
|
||||
path: '/crm/contract/detail',
|
||||
query: { id: row.contractId }
|
||||
})
|
||||
}
|
||||
|
||||
const result = approvalResultTag(d.approvalResult)
|
||||
const handleApprove = (row: ApprovalVO) => {
|
||||
approvalForm.value = {
|
||||
id: row.id,
|
||||
approvalResult: 'approved',
|
||||
approvalOpinion: ''
|
||||
}
|
||||
approvalDialog.visible = true
|
||||
}
|
||||
|
||||
const basicFields: ViewField[] = [
|
||||
crmField('合同名称', d.contractName),
|
||||
crmField('审批流程 ID', d.flowId),
|
||||
crmField('审批级别', d.step != null ? `第${d.step}级` : undefined),
|
||||
crmField('步骤名称', d.stepName),
|
||||
crmField('审批人部门', d.approverDept),
|
||||
crmField('审批人', d.approverName),
|
||||
crmTagField('审批结果', result.label, result.type)
|
||||
]
|
||||
const submitApproval = () => {
|
||||
approvalFormRef.value?.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
submitLoading.value = true
|
||||
try {
|
||||
if (approvalForm.value.approvalResult === 'approved') {
|
||||
await approvePass({
|
||||
id: approvalForm.value.id!,
|
||||
approvalOpinion: approvalForm.value.approvalOpinion
|
||||
})
|
||||
$modal.msgSuccess('审批通过')
|
||||
} else {
|
||||
await approveReject({
|
||||
id: approvalForm.value.id!,
|
||||
approvalOpinion: approvalForm.value.approvalOpinion
|
||||
})
|
||||
$modal.msgSuccess('已驳回')
|
||||
}
|
||||
approvalDialog.visible = false
|
||||
await getList()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const detailFields: ViewField[] = [
|
||||
crmLongField('审批意见', d.approvalOpinion, { fullSpan: true }),
|
||||
crmField('审批时间', parseTime(d.approvalTime)),
|
||||
crmField('创建时间', parseTime(d.createTime)),
|
||||
crmLongField('备注', d.remark, { fullSpan: true })
|
||||
]
|
||||
|
||||
return [
|
||||
{ title: '基本信息', fields: basicFields },
|
||||
{ title: '审批详情', fields: detailFields }
|
||||
]
|
||||
})
|
||||
|
||||
const approvalDialog = reactive({
|
||||
visible: false
|
||||
})
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>()
|
||||
const approvalFormRef = ref<ElFormInstance>()
|
||||
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const handleExport = async () => {
|
||||
if (dateRange.value && dateRange.value.length === 2) {
|
||||
queryParams.value.beginTime = dateRange.value[0]
|
||||
queryParams.value.endTime = dateRange.value[1]
|
||||
@@ -351,109 +458,31 @@ const getList = async () => {
|
||||
queryParams.value.beginTime = undefined
|
||||
queryParams.value.endTime = undefined
|
||||
}
|
||||
|
||||
const res = await listApproval(queryParams.value)
|
||||
approvalList.value = res.rows
|
||||
total.value = res.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const resetQuery = () => {
|
||||
dateRange.value = undefined
|
||||
queryFormRef.value?.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const handleView = async (row: ApprovalVO) => {
|
||||
const res = await getApproval(row.id)
|
||||
viewDialog.data = res.data
|
||||
viewDialog.visible = true
|
||||
}
|
||||
|
||||
const handleViewContract = (row: ApprovalVO) => {
|
||||
router.push({
|
||||
path: '/crm/contract/detail',
|
||||
query: { id: row.contractId }
|
||||
})
|
||||
}
|
||||
|
||||
const handleApprove = (row: ApprovalVO) => {
|
||||
approvalForm.value = {
|
||||
id: row.id,
|
||||
approvalResult: 'approved',
|
||||
approvalOpinion: ''
|
||||
}
|
||||
approvalDialog.visible = true
|
||||
}
|
||||
|
||||
const submitApproval = () => {
|
||||
approvalFormRef.value?.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
submitLoading.value = true
|
||||
exportLoading.value = true
|
||||
try {
|
||||
if (approvalForm.value.approvalResult === 'approved') {
|
||||
await approvePass({
|
||||
id: approvalForm.value.id!,
|
||||
approvalOpinion: approvalForm.value.approvalOpinion
|
||||
})
|
||||
$modal.msgSuccess('审批通过')
|
||||
} else {
|
||||
await approveReject({
|
||||
id: approvalForm.value.id!,
|
||||
approvalOpinion: approvalForm.value.approvalOpinion
|
||||
})
|
||||
$modal.msgSuccess('已驳回')
|
||||
}
|
||||
approvalDialog.visible = false
|
||||
await getList()
|
||||
const res = await exportApproval(queryParams.value)
|
||||
const blob =
|
||||
res instanceof Blob
|
||||
? res
|
||||
: new Blob([res as BlobPart], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
const url = URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = `contract_approval_${new Date().getTime()}.xlsx`
|
||||
link.click()
|
||||
URL.revokeObjectURL(url)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
$modal.msgError('导出失败')
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await loadPerms()
|
||||
getList()
|
||||
})
|
||||
}
|
||||
|
||||
const handleExport = async () => {
|
||||
if (dateRange.value && dateRange.value.length === 2) {
|
||||
queryParams.value.beginTime = dateRange.value[0]
|
||||
queryParams.value.endTime = dateRange.value[1]
|
||||
} else {
|
||||
queryParams.value.beginTime = undefined
|
||||
queryParams.value.endTime = undefined
|
||||
}
|
||||
exportLoading.value = true
|
||||
try {
|
||||
const res = await exportApproval(queryParams.value)
|
||||
const blob =
|
||||
res instanceof Blob
|
||||
? res
|
||||
: new Blob([res as BlobPart], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
const url = URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = `contract_approval_${new Date().getTime()}.xlsx`
|
||||
link.click()
|
||||
URL.revokeObjectURL(url)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
$modal.msgError('导出失败')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await loadPerms()
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
@@ -139,6 +139,14 @@
|
||||
@row-dblclick="handleView"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (queryParams.pageNum - 1) * queryParams.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="contractNo"
|
||||
label="合同编号"
|
||||
@@ -148,7 +156,9 @@
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-link type="primary" @click="handleViewContract(row)">{{ row.contractNo }}</el-link>
|
||||
<el-link type="primary" @click="handleViewContract(row)">{{
|
||||
row.contractNo
|
||||
}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -185,9 +195,15 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="审批状态" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.approvalStatus === 'pending'" type="warning" size="small">待审批</el-tag>
|
||||
<el-tag v-else-if="row.approvalStatus === 'approved'" type="success" size="small">已通过</el-tag>
|
||||
<el-tag v-else-if="row.approvalStatus === 'rejected'" type="danger" size="small">已驳回</el-tag>
|
||||
<el-tag v-if="row.approvalStatus === 'pending'" type="warning" size="small"
|
||||
>待审批</el-tag
|
||||
>
|
||||
<el-tag v-else-if="row.approvalStatus === 'approved'" type="success" size="small"
|
||||
>已通过</el-tag
|
||||
>
|
||||
<el-tag v-else-if="row.approvalStatus === 'rejected'" type="danger" size="small"
|
||||
>已驳回</el-tag
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -236,7 +252,12 @@
|
||||
>
|
||||
<div class="form-grid-2">
|
||||
<el-form-item label="合同" prop="contractId" class="form-col-span-2">
|
||||
<el-select v-model="form.contractId" placeholder="请选择合同" filterable style="width: 100%">
|
||||
<el-select
|
||||
v-model="form.contractId"
|
||||
placeholder="请选择合同"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
>
|
||||
<!-- TODO: 动态加载合同列表 -->
|
||||
<el-option label="合同1" :value="1" />
|
||||
</el-select>
|
||||
@@ -261,16 +282,36 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="变更原因" prop="changeReason" class="form-col-span-2">
|
||||
<el-input v-model="form.changeReason" type="textarea" :rows="3" placeholder="请输入变更原因" />
|
||||
<el-input
|
||||
v-model="form.changeReason"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入变更原因"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="变更内容" prop="changeContent" class="form-col-span-2">
|
||||
<el-input v-model="form.changeContent" type="textarea" :rows="2" placeholder="请输入变更内容描述" />
|
||||
<el-input
|
||||
v-model="form.changeContent"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入变更内容描述"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="变更前值" prop="oldValue" class="form-col-span-2">
|
||||
<el-input v-model="form.oldValue" type="textarea" :rows="2" placeholder="请输入变更前的值" />
|
||||
<el-input
|
||||
v-model="form.oldValue"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入变更前的值"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="变更后值" prop="newValue" class="form-col-span-2">
|
||||
<el-input v-model="form.newValue" type="textarea" :rows="2" placeholder="请输入变更后的值" />
|
||||
<el-input
|
||||
v-model="form.newValue"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入变更后的值"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark" class="form-col-span-2">
|
||||
<el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入备注" />
|
||||
@@ -300,21 +341,27 @@
|
||||
<template #hero-actions>
|
||||
<div class="change-view-hero-actions">
|
||||
<el-button
|
||||
v-if="hasContractPerm('changeApprove') && viewDialog.data.approvalStatus === 'pending'"
|
||||
v-if="
|
||||
hasContractPerm('changeApprove') && viewDialog.data.approvalStatus === 'pending'
|
||||
"
|
||||
class="btn-ghost"
|
||||
@click="handleSubmitApproval(viewDialog.data)"
|
||||
>
|
||||
<el-icon><Promotion /></el-icon>提交审批
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="hasContractPerm('changeApprove') && viewDialog.data.approvalStatus === 'approved'"
|
||||
v-if="
|
||||
hasContractPerm('changeApprove') && viewDialog.data.approvalStatus === 'approved'
|
||||
"
|
||||
class="btn-ghost"
|
||||
@click="handleExecute(viewDialog.data)"
|
||||
>
|
||||
<el-icon><VideoPlay /></el-icon>执行变更
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="hasContractPerm('changeApprove') && viewDialog.data.approvalStatus === 'pending'"
|
||||
v-if="
|
||||
hasContractPerm('changeApprove') && viewDialog.data.approvalStatus === 'pending'
|
||||
"
|
||||
class="btn-ghost"
|
||||
@click="handleWithdraw(viewDialog.data)"
|
||||
>
|
||||
@@ -340,343 +387,67 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ContractChange">
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import {
|
||||
Document,
|
||||
Plus,
|
||||
Delete,
|
||||
Download,
|
||||
Search,
|
||||
RefreshLeft,
|
||||
Close,
|
||||
Check,
|
||||
Promotion,
|
||||
VideoPlay
|
||||
} from '@element-plus/icons-vue'
|
||||
import SystemViewDialog, {
|
||||
type ViewField,
|
||||
type ViewSection
|
||||
} from '@/components/business/system-view-dialog/index.vue'
|
||||
import { crmDictField, crmField, crmLongField, crmTagField } from '@/utils/crm/view-fields'
|
||||
import {
|
||||
listChange,
|
||||
getChange,
|
||||
addChange,
|
||||
updateChange,
|
||||
delChange,
|
||||
submitChangeApproval,
|
||||
withdrawChange,
|
||||
executeChange,
|
||||
exportChange,
|
||||
type ChangeQuery,
|
||||
type ChangeForm,
|
||||
type ChangeVO
|
||||
} from '@/api/crm/contract/change'
|
||||
import { parseTime } from '@/utils/format'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { $modal } from '@/utils/modal'
|
||||
import { useContractPerm } from '@/hooks/business/useContractPerm'
|
||||
import {
|
||||
canDeleteByCreator,
|
||||
filterDeletableByCreator,
|
||||
allRowsDeletableByCreator,
|
||||
CREATOR_DELETE_TIP
|
||||
} from '@/utils/creator-delete'
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import {
|
||||
Document,
|
||||
Plus,
|
||||
Delete,
|
||||
Download,
|
||||
Search,
|
||||
RefreshLeft,
|
||||
Close,
|
||||
Check,
|
||||
Promotion,
|
||||
VideoPlay
|
||||
} from '@element-plus/icons-vue'
|
||||
import SystemViewDialog, {
|
||||
type ViewField,
|
||||
type ViewSection
|
||||
} from '@/components/business/system-view-dialog/index.vue'
|
||||
import { crmDictField, crmField, crmLongField, crmTagField } from '@/utils/crm/view-fields'
|
||||
import {
|
||||
listChange,
|
||||
getChange,
|
||||
addChange,
|
||||
updateChange,
|
||||
delChange,
|
||||
submitChangeApproval,
|
||||
withdrawChange,
|
||||
executeChange,
|
||||
exportChange,
|
||||
type ChangeQuery,
|
||||
type ChangeForm,
|
||||
type ChangeVO
|
||||
} from '@/api/crm/contract/change'
|
||||
import { parseTime } from '@/utils/format'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { $modal } from '@/utils/modal'
|
||||
import { useContractPerm } from '@/hooks/business/useContractPerm'
|
||||
import {
|
||||
canDeleteByCreator,
|
||||
filterDeletableByCreator,
|
||||
allRowsDeletableByCreator,
|
||||
CREATOR_DELETE_TIP
|
||||
} from '@/utils/creator-delete'
|
||||
|
||||
const router = useRouter()
|
||||
const dictStore = useDictStore()
|
||||
const { loadPerms, hasContractPerm } = useContractPerm()
|
||||
const router = useRouter()
|
||||
const dictStore = useDictStore()
|
||||
const { loadPerms, hasContractPerm } = useContractPerm()
|
||||
|
||||
const queryParams = ref<ChangeQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
contractNo: undefined,
|
||||
contractName: undefined,
|
||||
changeType: undefined,
|
||||
approvalStatus: undefined,
|
||||
beginTime: undefined,
|
||||
endTime: undefined
|
||||
})
|
||||
|
||||
const form = ref<ChangeForm>({
|
||||
contractId: 0,
|
||||
changeType: '',
|
||||
changeReason: '',
|
||||
changeContent: '',
|
||||
oldValue: '',
|
||||
newValue: '',
|
||||
changeAmount: 0,
|
||||
remark: ''
|
||||
})
|
||||
|
||||
const rules = ref({
|
||||
contractId: [{ required: true, message: '请选择合同', trigger: 'change' }],
|
||||
changeType: [{ required: true, message: '请选择变更类型', trigger: 'change' }],
|
||||
changeReason: [{ required: true, message: '请输入变更原因', trigger: 'blur' }],
|
||||
newValue: [{ required: true, message: '请输入变更后的值', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
const changeList = ref<ChangeVO[]>([])
|
||||
const selectedRows = ref<ChangeVO[]>([])
|
||||
const loading = ref(true)
|
||||
const submitLoading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const total = ref(0)
|
||||
const ids = ref<number[]>([])
|
||||
const dateRange = ref<[string, string]>()
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
})
|
||||
|
||||
const viewDialog = reactive({
|
||||
visible: false,
|
||||
data: {} as ChangeVO
|
||||
})
|
||||
|
||||
function changeStatusTag(status?: string) {
|
||||
if (status === 'pending') return { label: '待审批', type: 'warning' as const }
|
||||
if (status === 'approved') return { label: '已通过', type: 'success' as const }
|
||||
if (status === 'rejected') return { label: '已驳回', type: 'danger' as const }
|
||||
if (status === 'executed') return { label: '已执行', type: 'info' as const }
|
||||
return { label: '—', type: undefined }
|
||||
}
|
||||
|
||||
function approvalStatusTag(status?: string) {
|
||||
if (status === 'pending') return { label: '待审批', type: 'warning' as const }
|
||||
if (status === 'approved') return { label: '已通过', type: 'success' as const }
|
||||
if (status === 'rejected') return { label: '已驳回', type: 'danger' as const }
|
||||
return { label: '—', type: undefined }
|
||||
}
|
||||
|
||||
const changeViewSections = computed<ViewSection[]>(() => {
|
||||
const d = viewDialog.data
|
||||
if (!d?.id && !d?.contractNo) return []
|
||||
|
||||
const changeStatus = changeStatusTag(d.changeStatus)
|
||||
const approvalStatus = approvalStatusTag(d.approvalStatus)
|
||||
|
||||
const basicFields: ViewField[] = [
|
||||
crmField('合同名称', d.contractName),
|
||||
crmDictField('变更类型', 'crm_contract_change_type', d.changeType, dictStore),
|
||||
crmTagField('变更状态', changeStatus.label, changeStatus.type)
|
||||
]
|
||||
|
||||
const contentFields: ViewField[] = [
|
||||
crmLongField('变更原因', d.changeReason),
|
||||
crmLongField('变更内容', d.changeContent),
|
||||
crmLongField('变更前值', d.oldValue, { fullSpan: true }),
|
||||
crmLongField('变更后值', d.newValue, { fullSpan: true }),
|
||||
{
|
||||
label: '变更金额',
|
||||
value: d.changeAmount != null ? `¥${Number(d.changeAmount).toLocaleString()}` : '—',
|
||||
money: true
|
||||
}
|
||||
]
|
||||
|
||||
const approvalFields: ViewField[] = [
|
||||
crmTagField('审批状态', approvalStatus.label, approvalStatus.type),
|
||||
crmField('审批人', d.approverName),
|
||||
crmField('审批时间', parseTime(d.approvalTime)),
|
||||
crmLongField('审批意见', d.approvalOpinion, { fullSpan: true })
|
||||
]
|
||||
|
||||
const otherFields: ViewField[] = [
|
||||
crmField('创建时间', parseTime(d.createTime)),
|
||||
crmLongField('备注', d.remark, { fullSpan: true })
|
||||
]
|
||||
|
||||
return [
|
||||
{ title: '基本信息', fields: basicFields },
|
||||
{ title: '变更内容', fields: contentFields },
|
||||
{ title: '审批信息', fields: approvalFields },
|
||||
{ title: '其他', fields: otherFields }
|
||||
]
|
||||
})
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>()
|
||||
const formRef = ref<ElFormInstance>()
|
||||
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
if (dateRange.value && dateRange.value.length === 2) {
|
||||
queryParams.value.beginTime = dateRange.value[0]
|
||||
queryParams.value.endTime = dateRange.value[1]
|
||||
} else {
|
||||
queryParams.value.beginTime = undefined
|
||||
queryParams.value.endTime = undefined
|
||||
}
|
||||
|
||||
const res = await listChange(queryParams.value)
|
||||
changeList.value = res.rows
|
||||
total.value = res.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const resetQuery = () => {
|
||||
dateRange.value = undefined
|
||||
queryFormRef.value?.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const handleSelectionChange = (selection: ChangeVO[]) => {
|
||||
selectedRows.value = selection
|
||||
ids.value = selection.map((item) => item.id)
|
||||
}
|
||||
|
||||
const handleAdd = () => {
|
||||
reset()
|
||||
dialog.visible = true
|
||||
dialog.title = '添加变更记录'
|
||||
}
|
||||
|
||||
const handleView = async (row: ChangeVO) => {
|
||||
const res = await getChange(row.id)
|
||||
viewDialog.data = res.data
|
||||
viewDialog.visible = true
|
||||
}
|
||||
|
||||
const handleViewContract = (row: ChangeVO) => {
|
||||
router.push({
|
||||
path: '/crm/contract/detail',
|
||||
query: { id: row.contractId }
|
||||
const queryParams = ref<ChangeQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
contractNo: undefined,
|
||||
contractName: undefined,
|
||||
changeType: undefined,
|
||||
approvalStatus: undefined,
|
||||
beginTime: undefined,
|
||||
endTime: undefined
|
||||
})
|
||||
}
|
||||
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
submitLoading.value = true
|
||||
try {
|
||||
if (form.value.id) {
|
||||
await updateChange(form.value)
|
||||
$modal.msgSuccess('修改成功')
|
||||
} else {
|
||||
await addChange(form.value)
|
||||
$modal.msgSuccess('新增成功')
|
||||
}
|
||||
dialog.visible = false
|
||||
await getList()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleDelete = async (row?: ChangeVO) => {
|
||||
const targets = row ? [row] : selectedRows.value
|
||||
const deletable = filterDeletableByCreator(targets)
|
||||
if (!deletable.length) {
|
||||
$modal.msgWarning(CREATOR_DELETE_TIP)
|
||||
return
|
||||
}
|
||||
if (deletable.length < targets.length) {
|
||||
$modal.msgWarning(CREATOR_DELETE_TIP)
|
||||
return
|
||||
}
|
||||
const idList = row?.id ? [row.id] : ids.value
|
||||
await $modal.confirm('是否确认删除选中的变更记录?')
|
||||
await delChange(idList)
|
||||
$modal.msgSuccess('删除成功')
|
||||
await getList()
|
||||
}
|
||||
|
||||
async function handleDetailDelete() {
|
||||
if (!viewDialog.data?.id) return
|
||||
await handleDelete(viewDialog.data as ChangeVO)
|
||||
viewDialog.visible = false
|
||||
}
|
||||
|
||||
const handleCommand = async (command: string, row: ChangeVO) => {
|
||||
switch (command) {
|
||||
case 'submit':
|
||||
await handleSubmitApproval(row)
|
||||
break
|
||||
case 'execute':
|
||||
await handleExecute(row)
|
||||
break
|
||||
case 'withdraw':
|
||||
await handleWithdraw(row)
|
||||
break
|
||||
case 'delete':
|
||||
await handleDelete(row)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const handleSubmitApproval = async (row: ChangeVO) => {
|
||||
await $modal.confirm('是否确认提交该变更记录进行审批?')
|
||||
await submitChangeApproval({ id: row.id, approverIds: [] })
|
||||
$modal.msgSuccess('提交成功')
|
||||
await getList()
|
||||
}
|
||||
|
||||
const handleExecute = async (row: ChangeVO) => {
|
||||
await $modal.confirm('是否确认执行该变更?执行后将无法撤销')
|
||||
await executeChange(row.id)
|
||||
$modal.msgSuccess('执行成功')
|
||||
await getList()
|
||||
}
|
||||
|
||||
const handleWithdraw = async (row: ChangeVO) => {
|
||||
await $modal.confirm('是否确认撤回该变更记录?')
|
||||
await withdrawChange(row.id)
|
||||
$modal.msgSuccess('撤回成功')
|
||||
await getList()
|
||||
}
|
||||
|
||||
const handleExport = async () => {
|
||||
if (dateRange.value && dateRange.value.length === 2) {
|
||||
queryParams.value.beginTime = dateRange.value[0]
|
||||
queryParams.value.endTime = dateRange.value[1]
|
||||
} else {
|
||||
queryParams.value.beginTime = undefined
|
||||
queryParams.value.endTime = undefined
|
||||
}
|
||||
exportLoading.value = true
|
||||
try {
|
||||
const res = await exportChange(queryParams.value)
|
||||
const blob =
|
||||
res instanceof Blob
|
||||
? res
|
||||
: new Blob([res as BlobPart], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
const url = URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = `contract_change_${new Date().getTime()}.xlsx`
|
||||
link.click()
|
||||
URL.revokeObjectURL(url)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
$modal.msgError('导出失败')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const cancel = () => {
|
||||
dialog.visible = false
|
||||
reset()
|
||||
}
|
||||
|
||||
const reset = () => {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
const form = ref<ChangeForm>({
|
||||
contractId: 0,
|
||||
changeType: '',
|
||||
changeReason: '',
|
||||
@@ -685,12 +456,288 @@ const reset = () => {
|
||||
newValue: '',
|
||||
changeAmount: 0,
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await loadPerms()
|
||||
getList()
|
||||
})
|
||||
const rules = ref({
|
||||
contractId: [{ required: true, message: '请选择合同', trigger: 'change' }],
|
||||
changeType: [{ required: true, message: '请选择变更类型', trigger: 'change' }],
|
||||
changeReason: [{ required: true, message: '请输入变更原因', trigger: 'blur' }],
|
||||
newValue: [{ required: true, message: '请输入变更后的值', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
const changeList = ref<ChangeVO[]>([])
|
||||
const selectedRows = ref<ChangeVO[]>([])
|
||||
const loading = ref(true)
|
||||
const submitLoading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const total = ref(0)
|
||||
const ids = ref<number[]>([])
|
||||
const dateRange = ref<[string, string]>()
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
})
|
||||
|
||||
const viewDialog = reactive({
|
||||
visible: false,
|
||||
data: {} as ChangeVO
|
||||
})
|
||||
|
||||
function changeStatusTag(status?: string) {
|
||||
if (status === 'pending') return { label: '待审批', type: 'warning' as const }
|
||||
if (status === 'approved') return { label: '已通过', type: 'success' as const }
|
||||
if (status === 'rejected') return { label: '已驳回', type: 'danger' as const }
|
||||
if (status === 'executed') return { label: '已执行', type: 'info' as const }
|
||||
return { label: '—', type: undefined }
|
||||
}
|
||||
|
||||
function approvalStatusTag(status?: string) {
|
||||
if (status === 'pending') return { label: '待审批', type: 'warning' as const }
|
||||
if (status === 'approved') return { label: '已通过', type: 'success' as const }
|
||||
if (status === 'rejected') return { label: '已驳回', type: 'danger' as const }
|
||||
return { label: '—', type: undefined }
|
||||
}
|
||||
|
||||
const changeViewSections = computed<ViewSection[]>(() => {
|
||||
const d = viewDialog.data
|
||||
if (!d?.id && !d?.contractNo) return []
|
||||
|
||||
const changeStatus = changeStatusTag(d.changeStatus)
|
||||
const approvalStatus = approvalStatusTag(d.approvalStatus)
|
||||
|
||||
const basicFields: ViewField[] = [
|
||||
crmField('合同名称', d.contractName),
|
||||
crmDictField('变更类型', 'crm_contract_change_type', d.changeType, dictStore),
|
||||
crmTagField('变更状态', changeStatus.label, changeStatus.type)
|
||||
]
|
||||
|
||||
const contentFields: ViewField[] = [
|
||||
crmLongField('变更原因', d.changeReason),
|
||||
crmLongField('变更内容', d.changeContent),
|
||||
crmLongField('变更前值', d.oldValue, { fullSpan: true }),
|
||||
crmLongField('变更后值', d.newValue, { fullSpan: true }),
|
||||
{
|
||||
label: '变更金额',
|
||||
value: d.changeAmount != null ? `¥${Number(d.changeAmount).toLocaleString()}` : '—',
|
||||
money: true
|
||||
}
|
||||
]
|
||||
|
||||
const approvalFields: ViewField[] = [
|
||||
crmTagField('审批状态', approvalStatus.label, approvalStatus.type),
|
||||
crmField('审批人', d.approverName),
|
||||
crmField('审批时间', parseTime(d.approvalTime)),
|
||||
crmLongField('审批意见', d.approvalOpinion, { fullSpan: true })
|
||||
]
|
||||
|
||||
const otherFields: ViewField[] = [
|
||||
crmField('创建时间', parseTime(d.createTime)),
|
||||
crmLongField('备注', d.remark, { fullSpan: true })
|
||||
]
|
||||
|
||||
return [
|
||||
{ title: '基本信息', fields: basicFields },
|
||||
{ title: '变更内容', fields: contentFields },
|
||||
{ title: '审批信息', fields: approvalFields },
|
||||
{ title: '其他', fields: otherFields }
|
||||
]
|
||||
})
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>()
|
||||
const formRef = ref<ElFormInstance>()
|
||||
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
if (dateRange.value && dateRange.value.length === 2) {
|
||||
queryParams.value.beginTime = dateRange.value[0]
|
||||
queryParams.value.endTime = dateRange.value[1]
|
||||
} else {
|
||||
queryParams.value.beginTime = undefined
|
||||
queryParams.value.endTime = undefined
|
||||
}
|
||||
|
||||
const res = await listChange(queryParams.value)
|
||||
changeList.value = res.rows
|
||||
total.value = res.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const resetQuery = () => {
|
||||
dateRange.value = undefined
|
||||
queryFormRef.value?.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const handleSelectionChange = (selection: ChangeVO[]) => {
|
||||
selectedRows.value = selection
|
||||
ids.value = selection.map((item) => item.id)
|
||||
}
|
||||
|
||||
const handleAdd = () => {
|
||||
reset()
|
||||
dialog.visible = true
|
||||
dialog.title = '添加变更记录'
|
||||
}
|
||||
|
||||
const handleView = async (row: ChangeVO) => {
|
||||
const res = await getChange(row.id)
|
||||
viewDialog.data = res.data
|
||||
viewDialog.visible = true
|
||||
}
|
||||
|
||||
const handleViewContract = (row: ChangeVO) => {
|
||||
router.push({
|
||||
path: '/crm/contract/detail',
|
||||
query: { id: row.contractId }
|
||||
})
|
||||
}
|
||||
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
submitLoading.value = true
|
||||
try {
|
||||
if (form.value.id) {
|
||||
await updateChange(form.value)
|
||||
$modal.msgSuccess('修改成功')
|
||||
} else {
|
||||
await addChange(form.value)
|
||||
$modal.msgSuccess('新增成功')
|
||||
}
|
||||
dialog.visible = false
|
||||
await getList()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleDelete = async (row?: ChangeVO) => {
|
||||
const targets = row ? [row] : selectedRows.value
|
||||
const deletable = filterDeletableByCreator(targets)
|
||||
if (!deletable.length) {
|
||||
$modal.msgWarning(CREATOR_DELETE_TIP)
|
||||
return
|
||||
}
|
||||
if (deletable.length < targets.length) {
|
||||
$modal.msgWarning(CREATOR_DELETE_TIP)
|
||||
return
|
||||
}
|
||||
const idList = row?.id ? [row.id] : ids.value
|
||||
await $modal.confirm('是否确认删除选中的变更记录?')
|
||||
await delChange(idList)
|
||||
$modal.msgSuccess('删除成功')
|
||||
await getList()
|
||||
}
|
||||
|
||||
async function handleDetailDelete() {
|
||||
if (!viewDialog.data?.id) return
|
||||
await handleDelete(viewDialog.data as ChangeVO)
|
||||
viewDialog.visible = false
|
||||
}
|
||||
|
||||
const handleCommand = async (command: string, row: ChangeVO) => {
|
||||
switch (command) {
|
||||
case 'submit':
|
||||
await handleSubmitApproval(row)
|
||||
break
|
||||
case 'execute':
|
||||
await handleExecute(row)
|
||||
break
|
||||
case 'withdraw':
|
||||
await handleWithdraw(row)
|
||||
break
|
||||
case 'delete':
|
||||
await handleDelete(row)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const handleSubmitApproval = async (row: ChangeVO) => {
|
||||
await $modal.confirm('是否确认提交该变更记录进行审批?')
|
||||
await submitChangeApproval({ id: row.id, approverIds: [] })
|
||||
$modal.msgSuccess('提交成功')
|
||||
await getList()
|
||||
}
|
||||
|
||||
const handleExecute = async (row: ChangeVO) => {
|
||||
await $modal.confirm('是否确认执行该变更?执行后将无法撤销')
|
||||
await executeChange(row.id)
|
||||
$modal.msgSuccess('执行成功')
|
||||
await getList()
|
||||
}
|
||||
|
||||
const handleWithdraw = async (row: ChangeVO) => {
|
||||
await $modal.confirm('是否确认撤回该变更记录?')
|
||||
await withdrawChange(row.id)
|
||||
$modal.msgSuccess('撤回成功')
|
||||
await getList()
|
||||
}
|
||||
|
||||
const handleExport = async () => {
|
||||
if (dateRange.value && dateRange.value.length === 2) {
|
||||
queryParams.value.beginTime = dateRange.value[0]
|
||||
queryParams.value.endTime = dateRange.value[1]
|
||||
} else {
|
||||
queryParams.value.beginTime = undefined
|
||||
queryParams.value.endTime = undefined
|
||||
}
|
||||
exportLoading.value = true
|
||||
try {
|
||||
const res = await exportChange(queryParams.value)
|
||||
const blob =
|
||||
res instanceof Blob
|
||||
? res
|
||||
: new Blob([res as BlobPart], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
const url = URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = `contract_change_${new Date().getTime()}.xlsx`
|
||||
link.click()
|
||||
URL.revokeObjectURL(url)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
$modal.msgError('导出失败')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const cancel = () => {
|
||||
dialog.visible = false
|
||||
reset()
|
||||
}
|
||||
|
||||
const reset = () => {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
contractId: 0,
|
||||
changeType: '',
|
||||
changeReason: '',
|
||||
changeContent: '',
|
||||
oldValue: '',
|
||||
newValue: '',
|
||||
changeAmount: 0,
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await loadPerms()
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
@@ -331,14 +331,14 @@ defineExpose({
|
||||
height: 14px;
|
||||
margin-right: 8px;
|
||||
vertical-align: -2px;
|
||||
background: var(--primary, #10b981);
|
||||
background: var(--primary, #1ca851);
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.approval-flow {
|
||||
padding: 16px;
|
||||
background: var(--primary-bg, #ecfdf5);
|
||||
background: var(--primary-bg, #e6f8ed);
|
||||
border: 1px solid var(--border, #d9e8e2);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
:accept="accept"
|
||||
>
|
||||
<div class="upload-card">
|
||||
<el-icon :size="28" color="#10b981"><Plus /></el-icon>
|
||||
<el-icon :size="28" color="#1ca851"><Plus /></el-icon>
|
||||
<span class="upload-card-text">上传附件</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
@@ -322,7 +322,7 @@ defineExpose({ hasUploading })
|
||||
.upload-card {
|
||||
width: 140px;
|
||||
height: 96px;
|
||||
border: 1px dashed #a7f3d0;
|
||||
border: 1px dashed #a8e0b8;
|
||||
border-radius: 8px;
|
||||
background: #f0fdf4;
|
||||
display: flex;
|
||||
@@ -333,15 +333,15 @@ defineExpose({ hasUploading })
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
border-color: #10b981;
|
||||
border-color: #1ca851;
|
||||
border-style: solid;
|
||||
background: #ecfdf5;
|
||||
background: #e6f8ed;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-card-text {
|
||||
font-size: 12px;
|
||||
color: #10b981;
|
||||
color: #1ca851;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
}
|
||||
@@ -369,8 +369,8 @@ defineExpose({ hasUploading })
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border-color: #10b981;
|
||||
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
|
||||
border-color: #1ca851;
|
||||
box-shadow: 0 2px 8px rgba(28, 168, 81, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ defineExpose({ hasUploading })
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background: #10b981;
|
||||
background: #1ca851;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
@@ -362,7 +362,8 @@
|
||||
</div>
|
||||
<div class="list-body list-wrap">
|
||||
<el-table :data="detailPaymentList" class="list-table" stripe v-loading="detailPaymentLoading" empty-text="暂无回款记录">
|
||||
<el-table-column label="回款单号" prop="paymentNo" min-width="150" align="center" header-align="center">
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column label="回款单号" prop="paymentNo" min-width="150" align="center" header-align="center">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="handleDetailViewPayment(scope.row)">
|
||||
{{ scope.row.paymentNo }}
|
||||
@@ -402,7 +403,8 @@
|
||||
</div>
|
||||
<div class="list-body list-wrap">
|
||||
<el-table :data="detailInvoiceList" class="list-table" stripe v-loading="detailInvoiceLoading" empty-text="暂无开票记录">
|
||||
<el-table-column label="发票号码" prop="invoiceNo" min-width="150" align="center" header-align="center">
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column label="发票号码" prop="invoiceNo" min-width="150" align="center" header-align="center">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="handleDetailViewInvoice(scope.row)">
|
||||
{{ scope.row.invoiceNo }}
|
||||
@@ -2883,7 +2885,7 @@ onMounted(async () => {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--text, #1e293b);
|
||||
border-left: 3px solid var(--primary, #10b981);
|
||||
border-left: 3px solid var(--primary, #1ca851);
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
@@ -2922,7 +2924,7 @@ onMounted(async () => {
|
||||
font-weight: 600;
|
||||
color: var(--text, #1e293b);
|
||||
line-height: 1.5;
|
||||
border-left: 3px solid var(--primary, #10b981);
|
||||
border-left: 3px solid var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
.party-flow-bridge {
|
||||
@@ -2938,12 +2940,12 @@ onMounted(async () => {
|
||||
.party-flow-bridge__label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--primary-dark, #059669);
|
||||
color: var(--primary-dark, #168f45);
|
||||
letter-spacing: 0.06em;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px;
|
||||
background: #ecfdf5;
|
||||
border: 1px solid #a7f3d0;
|
||||
background: #e6f8ed;
|
||||
border: 1px solid #a8e0b8;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
@@ -2954,10 +2956,10 @@ onMounted(async () => {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 50%;
|
||||
color: var(--primary-dark, #059669);
|
||||
background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
|
||||
border: 1px solid #a7f3d0;
|
||||
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.14);
|
||||
color: var(--primary-dark, #168f45);
|
||||
background: linear-gradient(145deg, #e6f8ed 0%, #d4f0de 100%);
|
||||
border: 1px solid #a8e0b8;
|
||||
box-shadow: 0 2px 8px rgba(28, 168, 81, 0.14);
|
||||
|
||||
svg {
|
||||
width: 22px;
|
||||
@@ -3340,11 +3342,11 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border-color: #10b981;
|
||||
background: #ecfdf5;
|
||||
border-color: #1ca851;
|
||||
background: #e6f8ed;
|
||||
|
||||
.el-icon {
|
||||
color: #10b981;
|
||||
color: #1ca851;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3363,9 +3365,9 @@ onMounted(async () => {
|
||||
z-index: 2;
|
||||
|
||||
&:hover {
|
||||
color: #10b981;
|
||||
border-color: #10b981;
|
||||
background: #ecfdf5;
|
||||
color: #1ca851;
|
||||
border-color: #1ca851;
|
||||
background: #e6f8ed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3442,9 +3444,9 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
.list-toolbar-date-shortcuts :deep(.date-shortcut-btn.is-active.el-button) {
|
||||
color: var(--mint-primary-dark, #059669) !important;
|
||||
background: var(--mint-primary-bg, #ecfdf5) !important;
|
||||
border-color: rgba(16, 185, 129, 0.35) !important;
|
||||
color: var(--mint-primary-dark, #168f45) !important;
|
||||
background: var(--mint-primary-bg, #e6f8ed) !important;
|
||||
border-color: rgba(28, 168, 81, 0.35) !important;
|
||||
}
|
||||
|
||||
.quick-search-input {
|
||||
@@ -3458,7 +3460,7 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
.quick-search-icon:hover {
|
||||
color: var(--mint-primary, #10b981);
|
||||
color: var(--mint-primary, #1ca851);
|
||||
}
|
||||
|
||||
.panel-stats {
|
||||
@@ -3506,8 +3508,8 @@ onMounted(async () => {
|
||||
flex-direction: column;
|
||||
|
||||
&:hover {
|
||||
border-color: #10b981;
|
||||
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
|
||||
border-color: #1ca851;
|
||||
box-shadow: 0 2px 8px rgba(28, 168, 81, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2124,7 +2124,7 @@ const loadSupplierList = async () => {
|
||||
font-weight: 600;
|
||||
color: var(--text, #1e293b);
|
||||
line-height: 1.5;
|
||||
border-left: 3px solid var(--primary, #10b981);
|
||||
border-left: 3px solid var(--primary, #1ca851);
|
||||
}
|
||||
|
||||
.party-flow-bridge {
|
||||
@@ -2140,12 +2140,12 @@ const loadSupplierList = async () => {
|
||||
.party-flow-bridge__label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--primary-dark, #059669);
|
||||
color: var(--primary-dark, #168f45);
|
||||
letter-spacing: 0.06em;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px;
|
||||
background: #ecfdf5;
|
||||
border: 1px solid #a7f3d0;
|
||||
background: #e6f8ed;
|
||||
border: 1px solid #a8e0b8;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
@@ -2156,10 +2156,10 @@ const loadSupplierList = async () => {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 50%;
|
||||
color: var(--primary-dark, #059669);
|
||||
background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
|
||||
border: 1px solid #a7f3d0;
|
||||
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.14);
|
||||
color: var(--primary-dark, #168f45);
|
||||
background: linear-gradient(145deg, #e6f8ed 0%, #d4f0de 100%);
|
||||
border: 1px solid #a8e0b8;
|
||||
box-shadow: 0 2px 8px rgba(28, 168, 81, 0.14);
|
||||
|
||||
svg {
|
||||
width: 22px;
|
||||
|
||||
@@ -257,8 +257,8 @@ const formatAmount = (amount: number): string => {
|
||||
}
|
||||
|
||||
const getProgressColor = (rate: number): string => {
|
||||
if (rate >= 100) return '#10b981'
|
||||
if (rate >= 80) return '#059669'
|
||||
if (rate >= 100) return '#1ca851'
|
||||
if (rate >= 80) return '#168f45'
|
||||
if (rate >= 50) return '#d97706'
|
||||
return '#ef4444'
|
||||
}
|
||||
@@ -290,7 +290,7 @@ defineExpose({
|
||||
height: 14px;
|
||||
margin-right: 8px;
|
||||
vertical-align: -2px;
|
||||
background: var(--primary, #10b981);
|
||||
background: var(--primary, #1ca851);
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
@@ -302,12 +302,12 @@ defineExpose({
|
||||
}
|
||||
|
||||
.amount-text {
|
||||
color: var(--primary-dark, #059669);
|
||||
color: var(--primary-dark, #168f45);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.received-text {
|
||||
color: var(--primary, #10b981);
|
||||
color: var(--primary, #1ca851);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ defineExpose({
|
||||
}
|
||||
|
||||
.invoiced-text {
|
||||
color: var(--primary-dark, #059669);
|
||||
color: var(--primary-dark, #168f45);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
|
||||
@@ -455,7 +455,8 @@
|
||||
<el-tab-pane label="回款记录" name="payment">
|
||||
<el-button type="primary" icon="Plus" @click="handleAddPayment" class="mb-3">新增回款</el-button>
|
||||
<el-table :data="paymentList" border v-loading="paymentLoading">
|
||||
<el-table-column label="回款单号" prop="paymentNo" width="150" align="center" />
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column label="回款单号" prop="paymentNo" width="150" align="center" />
|
||||
<el-table-column label="回款金额" prop="amount" width="130" align="right">
|
||||
<template #default="scope">
|
||||
<span class="text-success font-weight-bold"
|
||||
@@ -482,7 +483,8 @@
|
||||
<el-tab-pane label="开票记录" name="invoice">
|
||||
<el-button type="primary" icon="Plus" @click="handleAddInvoice" class="mb-3">新增开票</el-button>
|
||||
<el-table :data="invoiceList" border v-loading="invoiceLoading">
|
||||
<el-table-column label="发票号码" prop="invoiceNo" width="150" align="center" />
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column label="发票号码" prop="invoiceNo" width="150" align="center" />
|
||||
<el-table-column label="发票类型" prop="invoiceType" width="120" align="center" />
|
||||
<el-table-column label="开票金额" prop="amount" width="130" align="right">
|
||||
<template #default="scope">
|
||||
@@ -913,7 +915,8 @@
|
||||
<el-tab-pane label="操作日志" name="log">
|
||||
<!-- 操作日志列表 -->
|
||||
<el-table v-loading="logLoading" :data="operLogList" stripe>
|
||||
<el-table-column label="操作时间" align="center" prop="operTime" width="160" />
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column label="操作时间" align="center" prop="operTime" width="160" />
|
||||
<el-table-column label="操作模块" align="center" prop="title" width="120" />
|
||||
<el-table-column label="操作类型" align="center" width="100">
|
||||
<template #default="scope">
|
||||
@@ -2717,7 +2720,7 @@ const handleGeneratePdfFile = async () => {
|
||||
font-weight: bold;
|
||||
|
||||
&.primary {
|
||||
color: var(--primary, #10b981);
|
||||
color: var(--primary, #1ca851);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1332,9 +1332,9 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
.list-toolbar-date-shortcuts :deep(.date-shortcut-btn.is-active.el-button) {
|
||||
color: var(--mint-primary-dark, #059669) !important;
|
||||
background: var(--mint-primary-bg, #ecfdf5) !important;
|
||||
border-color: rgba(16, 185, 129, 0.35) !important;
|
||||
color: var(--mint-primary-dark, #168f45) !important;
|
||||
background: var(--mint-primary-bg, #e6f8ed) !important;
|
||||
border-color: rgba(28, 168, 81, 0.35) !important;
|
||||
}
|
||||
|
||||
.quick-search-icon {
|
||||
@@ -1343,7 +1343,7 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
.quick-search-icon:hover {
|
||||
color: var(--mint-primary, #10b981);
|
||||
color: var(--mint-primary, #1ca851);
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -73,10 +73,7 @@
|
||||
v-if="hasContractPerm('templateRemove')"
|
||||
class="btn-ghost"
|
||||
type="danger"
|
||||
:disabled="
|
||||
selectedRows.length === 0 ||
|
||||
!allRowsDeletableByCreator(selectedRows)
|
||||
"
|
||||
:disabled="selectedRows.length === 0 || !allRowsDeletableByCreator(selectedRows)"
|
||||
:title="allRowsDeletableByCreator(selectedRows) ? '' : CREATOR_DELETE_TIP"
|
||||
@click="handleDelete()"
|
||||
>
|
||||
@@ -106,6 +103,14 @@
|
||||
@row-dblclick="handleView"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (queryParams.pageNum - 1) * queryParams.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="templateName"
|
||||
label="模板名称"
|
||||
@@ -157,7 +162,13 @@
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column prop="sort" label="排序" min-width="80" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
prop="sort"
|
||||
label="排序"
|
||||
min-width="80"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column label="创建时间" min-width="160" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
{{ parseTime(row.createTime) }}
|
||||
@@ -202,7 +213,11 @@
|
||||
<el-input v-model="form.templateName" placeholder="请输入模板名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模板类型" prop="templateType">
|
||||
<el-select v-model="form.templateType" placeholder="请选择模板类型" style="width: 100%">
|
||||
<el-select
|
||||
v-model="form.templateType"
|
||||
placeholder="请选择模板类型"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dictStore.getOptions('crm_contract_type')"
|
||||
:key="dict.value"
|
||||
@@ -227,16 +242,36 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同条款" prop="contractTerms" class="form-col-span-2">
|
||||
<el-input v-model="form.contractTerms" type="textarea" :rows="4" placeholder="请输入合同条款" />
|
||||
<el-input
|
||||
v-model="form.contractTerms"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入合同条款"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="付款条款" prop="paymentTerms" class="form-col-span-2">
|
||||
<el-input v-model="form.paymentTerms" type="textarea" :rows="3" placeholder="请输入付款条款" />
|
||||
<el-input
|
||||
v-model="form.paymentTerms"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入付款条款"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="交付条款" prop="deliveryTerms" class="form-col-span-2">
|
||||
<el-input v-model="form.deliveryTerms" type="textarea" :rows="3" placeholder="请输入交付条款" />
|
||||
<el-input
|
||||
v-model="form.deliveryTerms"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入交付条款"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模板内容" prop="templateContent" class="form-col-span-2">
|
||||
<el-input v-model="form.templateContent" type="textarea" :rows="6" placeholder="请输入模板内容" />
|
||||
<el-input
|
||||
v-model="form.templateContent"
|
||||
type="textarea"
|
||||
:rows="6"
|
||||
placeholder="请输入模板内容"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark" class="form-col-span-2">
|
||||
<el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入备注" />
|
||||
@@ -290,280 +325,61 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ContractTemplate">
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import {
|
||||
Document,
|
||||
Plus,
|
||||
Edit,
|
||||
Delete,
|
||||
Download,
|
||||
Search,
|
||||
RefreshLeft,
|
||||
Close,
|
||||
Check
|
||||
} from '@element-plus/icons-vue'
|
||||
import SystemViewDialog, {
|
||||
type ViewField,
|
||||
type ViewSection
|
||||
} from '@/components/business/system-view-dialog/index.vue'
|
||||
import { crmDictField, crmField, crmLongField, crmTagField } from '@/utils/crm/view-fields'
|
||||
import {
|
||||
listTemplate,
|
||||
getTemplate,
|
||||
addTemplate,
|
||||
updateTemplate,
|
||||
delTemplate,
|
||||
enableTemplate,
|
||||
disableTemplate,
|
||||
exportTemplate,
|
||||
type TemplateQuery,
|
||||
type TemplateForm,
|
||||
type TemplateVO
|
||||
} from '@/api/crm/contract/template'
|
||||
import { parseTime } from '@/utils/format'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { $modal } from '@/utils/modal'
|
||||
import { useContractPerm } from '@/hooks/business/useContractPerm'
|
||||
import {
|
||||
canDeleteByCreator,
|
||||
filterDeletableByCreator,
|
||||
allRowsDeletableByCreator,
|
||||
CREATOR_DELETE_TIP
|
||||
} from '@/utils/creator-delete'
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import {
|
||||
Document,
|
||||
Plus,
|
||||
Edit,
|
||||
Delete,
|
||||
Download,
|
||||
Search,
|
||||
RefreshLeft,
|
||||
Close,
|
||||
Check
|
||||
} from '@element-plus/icons-vue'
|
||||
import SystemViewDialog, {
|
||||
type ViewField,
|
||||
type ViewSection
|
||||
} from '@/components/business/system-view-dialog/index.vue'
|
||||
import { crmDictField, crmField, crmLongField, crmTagField } from '@/utils/crm/view-fields'
|
||||
import {
|
||||
listTemplate,
|
||||
getTemplate,
|
||||
addTemplate,
|
||||
updateTemplate,
|
||||
delTemplate,
|
||||
enableTemplate,
|
||||
disableTemplate,
|
||||
exportTemplate,
|
||||
type TemplateQuery,
|
||||
type TemplateForm,
|
||||
type TemplateVO
|
||||
} from '@/api/crm/contract/template'
|
||||
import { parseTime } from '@/utils/format'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { $modal } from '@/utils/modal'
|
||||
import { useContractPerm } from '@/hooks/business/useContractPerm'
|
||||
import {
|
||||
canDeleteByCreator,
|
||||
filterDeletableByCreator,
|
||||
allRowsDeletableByCreator,
|
||||
CREATOR_DELETE_TIP
|
||||
} from '@/utils/creator-delete'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
const { loadPerms, hasContractPerm } = useContractPerm()
|
||||
const dictStore = useDictStore()
|
||||
const { loadPerms, hasContractPerm } = useContractPerm()
|
||||
|
||||
const queryParams = ref<TemplateQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
templateNo: undefined,
|
||||
templateName: undefined,
|
||||
templateType: undefined,
|
||||
isActive: undefined
|
||||
})
|
||||
|
||||
const form = ref<TemplateForm>({
|
||||
templateName: '',
|
||||
templateType: '',
|
||||
templateContent: '',
|
||||
contractTerms: '',
|
||||
paymentTerms: '',
|
||||
deliveryTerms: '',
|
||||
isActive: 1,
|
||||
sort: 0,
|
||||
remark: ''
|
||||
})
|
||||
|
||||
const rules = ref({
|
||||
templateName: [{ required: true, message: '模板名称不能为空', trigger: 'blur' }],
|
||||
templateType: [{ required: true, message: '模板类型不能为空', trigger: 'change' }],
|
||||
templateContent: [{ required: true, message: '模板内容不能为空', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
const templateList = ref<TemplateVO[]>([])
|
||||
const selectedRows = ref<TemplateVO[]>([])
|
||||
const loading = ref(true)
|
||||
const submitLoading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const total = ref(0)
|
||||
const ids = ref<number[]>([])
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
})
|
||||
|
||||
const viewDialog = reactive({
|
||||
visible: false,
|
||||
data: {} as TemplateVO
|
||||
})
|
||||
|
||||
const templateViewSections = computed<ViewSection[]>(() => {
|
||||
const d = viewDialog.data
|
||||
if (!d?.id && !d?.templateNo) return []
|
||||
|
||||
const basicFields: ViewField[] = [
|
||||
crmField('模板名称', d.templateName),
|
||||
crmDictField('模板类型', 'crm_contract_type', d.templateType, dictStore),
|
||||
crmTagField('状态', d.isActive === 1 ? '启用' : '停用', d.isActive === 1 ? 'success' : 'info'),
|
||||
crmField('使用次数', d.usageCount),
|
||||
crmField('排序', d.sort),
|
||||
crmField('创建时间', parseTime(d.createTime)),
|
||||
crmField('更新时间', parseTime(d.updateTime))
|
||||
]
|
||||
|
||||
const termFields: ViewField[] = [
|
||||
crmLongField('合同条款', d.contractTerms, { fullSpan: true }),
|
||||
crmLongField('付款条款', d.paymentTerms, { fullSpan: true }),
|
||||
crmLongField('交付条款', d.deliveryTerms, { fullSpan: true }),
|
||||
crmLongField('模板内容', d.templateContent, { fullSpan: true }),
|
||||
crmLongField('备注', d.remark, { fullSpan: true })
|
||||
].filter((f) => f.value !== '—')
|
||||
|
||||
const sections: ViewSection[] = [{ title: '基本信息', fields: basicFields }]
|
||||
if (termFields.length) sections.push({ title: '条款与内容', fields: termFields })
|
||||
return sections
|
||||
})
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>()
|
||||
const formRef = ref<ElFormInstance>()
|
||||
|
||||
function handleToolbarEdit() {
|
||||
if (selectedRows.value.length !== 1) {
|
||||
$modal.msgWarning('请选择一条数据进行编辑')
|
||||
return
|
||||
}
|
||||
handleUpdate(selectedRows.value[0])
|
||||
}
|
||||
|
||||
async function handleDetailEdit() {
|
||||
if (!viewDialog.data?.id) return
|
||||
viewDialog.visible = false
|
||||
await handleUpdate(viewDialog.data as TemplateVO)
|
||||
}
|
||||
|
||||
async function handleDetailDelete() {
|
||||
if (!viewDialog.data?.id) return
|
||||
await handleDelete(viewDialog.data as TemplateVO)
|
||||
viewDialog.visible = false
|
||||
}
|
||||
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await listTemplate(queryParams.value)
|
||||
templateList.value = res.rows
|
||||
total.value = res.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const handleSelectionChange = (selection: TemplateVO[]) => {
|
||||
selectedRows.value = selection
|
||||
ids.value = selection.map((item) => item.id)
|
||||
}
|
||||
|
||||
const handleAdd = () => {
|
||||
reset()
|
||||
dialog.visible = true
|
||||
dialog.title = '添加合同模板'
|
||||
}
|
||||
|
||||
const handleUpdate = async (row: TemplateVO) => {
|
||||
reset()
|
||||
const res = await getTemplate(row.id)
|
||||
Object.assign(form.value, res.data)
|
||||
dialog.visible = true
|
||||
dialog.title = '修改合同模板'
|
||||
}
|
||||
|
||||
const handleView = async (row: TemplateVO) => {
|
||||
const res = await getTemplate(row.id)
|
||||
viewDialog.data = res.data
|
||||
viewDialog.visible = true
|
||||
}
|
||||
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
submitLoading.value = true
|
||||
try {
|
||||
if (form.value.id) {
|
||||
await updateTemplate(form.value)
|
||||
$modal.msgSuccess('修改成功')
|
||||
} else {
|
||||
await addTemplate(form.value)
|
||||
$modal.msgSuccess('新增成功')
|
||||
}
|
||||
dialog.visible = false
|
||||
await getList()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
const queryParams = ref<TemplateQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
templateNo: undefined,
|
||||
templateName: undefined,
|
||||
templateType: undefined,
|
||||
isActive: undefined
|
||||
})
|
||||
}
|
||||
|
||||
const handleDelete = async (row?: TemplateVO) => {
|
||||
const targets = row ? [row] : selectedRows.value
|
||||
const deletable = filterDeletableByCreator(targets)
|
||||
if (!deletable.length) {
|
||||
$modal.msgWarning(CREATOR_DELETE_TIP)
|
||||
return
|
||||
}
|
||||
if (deletable.length < targets.length) {
|
||||
$modal.msgWarning(CREATOR_DELETE_TIP)
|
||||
return
|
||||
}
|
||||
const idList = row?.id ? [row.id] : ids.value
|
||||
await $modal.confirm('是否确认删除选中的合同模板?')
|
||||
await delTemplate(idList)
|
||||
$modal.msgSuccess('删除成功')
|
||||
await getList()
|
||||
}
|
||||
|
||||
const handleStatusChange = async (row: TemplateVO) => {
|
||||
try {
|
||||
const text = row.isActive === 1 ? '启用' : '停用'
|
||||
await $modal.confirm(`确认要${text}"${row.templateName}"吗?`)
|
||||
if (row.isActive === 1) {
|
||||
await enableTemplate(row.id)
|
||||
} else {
|
||||
await disableTemplate(row.id)
|
||||
}
|
||||
$modal.msgSuccess(`${text}成功`)
|
||||
await getList()
|
||||
} catch {
|
||||
row.isActive = row.isActive === 0 ? 1 : 0
|
||||
}
|
||||
}
|
||||
|
||||
const handleExport = async () => {
|
||||
exportLoading.value = true
|
||||
try {
|
||||
const res = await exportTemplate(queryParams.value)
|
||||
const blob =
|
||||
res instanceof Blob
|
||||
? res
|
||||
: new Blob([res as BlobPart], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
const url = URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = `contract_template_${new Date().getTime()}.xlsx`
|
||||
link.click()
|
||||
URL.revokeObjectURL(url)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
$modal.msgError('导出失败')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const cancel = () => {
|
||||
dialog.visible = false
|
||||
reset()
|
||||
}
|
||||
|
||||
const reset = () => {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
const form = ref<TemplateForm>({
|
||||
templateName: '',
|
||||
templateType: '',
|
||||
templateContent: '',
|
||||
@@ -573,12 +389,235 @@ const reset = () => {
|
||||
isActive: 1,
|
||||
sort: 0,
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await loadPerms()
|
||||
getList()
|
||||
})
|
||||
const rules = ref({
|
||||
templateName: [{ required: true, message: '模板名称不能为空', trigger: 'blur' }],
|
||||
templateType: [{ required: true, message: '模板类型不能为空', trigger: 'change' }],
|
||||
templateContent: [{ required: true, message: '模板内容不能为空', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
const templateList = ref<TemplateVO[]>([])
|
||||
const selectedRows = ref<TemplateVO[]>([])
|
||||
const loading = ref(true)
|
||||
const submitLoading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const total = ref(0)
|
||||
const ids = ref<number[]>([])
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
})
|
||||
|
||||
const viewDialog = reactive({
|
||||
visible: false,
|
||||
data: {} as TemplateVO
|
||||
})
|
||||
|
||||
const templateViewSections = computed<ViewSection[]>(() => {
|
||||
const d = viewDialog.data
|
||||
if (!d?.id && !d?.templateNo) return []
|
||||
|
||||
const basicFields: ViewField[] = [
|
||||
crmField('模板名称', d.templateName),
|
||||
crmDictField('模板类型', 'crm_contract_type', d.templateType, dictStore),
|
||||
crmTagField(
|
||||
'状态',
|
||||
d.isActive === 1 ? '启用' : '停用',
|
||||
d.isActive === 1 ? 'success' : 'info'
|
||||
),
|
||||
crmField('使用次数', d.usageCount),
|
||||
crmField('排序', d.sort),
|
||||
crmField('创建时间', parseTime(d.createTime)),
|
||||
crmField('更新时间', parseTime(d.updateTime))
|
||||
]
|
||||
|
||||
const termFields: ViewField[] = [
|
||||
crmLongField('合同条款', d.contractTerms, { fullSpan: true }),
|
||||
crmLongField('付款条款', d.paymentTerms, { fullSpan: true }),
|
||||
crmLongField('交付条款', d.deliveryTerms, { fullSpan: true }),
|
||||
crmLongField('模板内容', d.templateContent, { fullSpan: true }),
|
||||
crmLongField('备注', d.remark, { fullSpan: true })
|
||||
].filter((f) => f.value !== '—')
|
||||
|
||||
const sections: ViewSection[] = [{ title: '基本信息', fields: basicFields }]
|
||||
if (termFields.length) sections.push({ title: '条款与内容', fields: termFields })
|
||||
return sections
|
||||
})
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>()
|
||||
const formRef = ref<ElFormInstance>()
|
||||
|
||||
function handleToolbarEdit() {
|
||||
if (selectedRows.value.length !== 1) {
|
||||
$modal.msgWarning('请选择一条数据进行编辑')
|
||||
return
|
||||
}
|
||||
handleUpdate(selectedRows.value[0])
|
||||
}
|
||||
|
||||
async function handleDetailEdit() {
|
||||
if (!viewDialog.data?.id) return
|
||||
viewDialog.visible = false
|
||||
await handleUpdate(viewDialog.data as TemplateVO)
|
||||
}
|
||||
|
||||
async function handleDetailDelete() {
|
||||
if (!viewDialog.data?.id) return
|
||||
await handleDelete(viewDialog.data as TemplateVO)
|
||||
viewDialog.visible = false
|
||||
}
|
||||
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await listTemplate(queryParams.value)
|
||||
templateList.value = res.rows
|
||||
total.value = res.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const handleSelectionChange = (selection: TemplateVO[]) => {
|
||||
selectedRows.value = selection
|
||||
ids.value = selection.map((item) => item.id)
|
||||
}
|
||||
|
||||
const handleAdd = () => {
|
||||
reset()
|
||||
dialog.visible = true
|
||||
dialog.title = '添加合同模板'
|
||||
}
|
||||
|
||||
const handleUpdate = async (row: TemplateVO) => {
|
||||
reset()
|
||||
const res = await getTemplate(row.id)
|
||||
Object.assign(form.value, res.data)
|
||||
dialog.visible = true
|
||||
dialog.title = '修改合同模板'
|
||||
}
|
||||
|
||||
const handleView = async (row: TemplateVO) => {
|
||||
const res = await getTemplate(row.id)
|
||||
viewDialog.data = res.data
|
||||
viewDialog.visible = true
|
||||
}
|
||||
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
submitLoading.value = true
|
||||
try {
|
||||
if (form.value.id) {
|
||||
await updateTemplate(form.value)
|
||||
$modal.msgSuccess('修改成功')
|
||||
} else {
|
||||
await addTemplate(form.value)
|
||||
$modal.msgSuccess('新增成功')
|
||||
}
|
||||
dialog.visible = false
|
||||
await getList()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleDelete = async (row?: TemplateVO) => {
|
||||
const targets = row ? [row] : selectedRows.value
|
||||
const deletable = filterDeletableByCreator(targets)
|
||||
if (!deletable.length) {
|
||||
$modal.msgWarning(CREATOR_DELETE_TIP)
|
||||
return
|
||||
}
|
||||
if (deletable.length < targets.length) {
|
||||
$modal.msgWarning(CREATOR_DELETE_TIP)
|
||||
return
|
||||
}
|
||||
const idList = row?.id ? [row.id] : ids.value
|
||||
await $modal.confirm('是否确认删除选中的合同模板?')
|
||||
await delTemplate(idList)
|
||||
$modal.msgSuccess('删除成功')
|
||||
await getList()
|
||||
}
|
||||
|
||||
const handleStatusChange = async (row: TemplateVO) => {
|
||||
try {
|
||||
const text = row.isActive === 1 ? '启用' : '停用'
|
||||
await $modal.confirm(`确认要${text}"${row.templateName}"吗?`)
|
||||
if (row.isActive === 1) {
|
||||
await enableTemplate(row.id)
|
||||
} else {
|
||||
await disableTemplate(row.id)
|
||||
}
|
||||
$modal.msgSuccess(`${text}成功`)
|
||||
await getList()
|
||||
} catch {
|
||||
row.isActive = row.isActive === 0 ? 1 : 0
|
||||
}
|
||||
}
|
||||
|
||||
const handleExport = async () => {
|
||||
exportLoading.value = true
|
||||
try {
|
||||
const res = await exportTemplate(queryParams.value)
|
||||
const blob =
|
||||
res instanceof Blob
|
||||
? res
|
||||
: new Blob([res as BlobPart], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
const url = URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = `contract_template_${new Date().getTime()}.xlsx`
|
||||
link.click()
|
||||
URL.revokeObjectURL(url)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
$modal.msgError('导出失败')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const cancel = () => {
|
||||
dialog.visible = false
|
||||
reset()
|
||||
}
|
||||
|
||||
const reset = () => {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
templateName: '',
|
||||
templateType: '',
|
||||
templateContent: '',
|
||||
contractTerms: '',
|
||||
paymentTerms: '',
|
||||
deliveryTerms: '',
|
||||
isActive: 1,
|
||||
sort: 0,
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await loadPerms()
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
@@ -136,7 +136,8 @@
|
||||
stripe
|
||||
empty-text=""
|
||||
>
|
||||
<el-table-column
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
label="联系人"
|
||||
prop="contactName"
|
||||
min-width="120"
|
||||
@@ -228,7 +229,8 @@
|
||||
stripe
|
||||
empty-text=""
|
||||
>
|
||||
<el-table-column
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
label="商机名称"
|
||||
prop="opportunityName"
|
||||
min-width="180"
|
||||
@@ -288,7 +290,8 @@
|
||||
stripe
|
||||
empty-text=""
|
||||
>
|
||||
<el-table-column
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
label="合同编号"
|
||||
prop="contractNo"
|
||||
min-width="150"
|
||||
@@ -365,7 +368,8 @@
|
||||
stripe
|
||||
empty-text=""
|
||||
>
|
||||
<el-table-column
|
||||
<el-table-column type="index" label="序号" min-width="68" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
label="操作时间"
|
||||
prop="operTime"
|
||||
min-width="160"
|
||||
|
||||
Loaded 100 of 161 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user