提交
This commit is contained in:
1 parent
ecde2ba07d
commit
06d021807b
61 files changed
+14874
-8772
No files matched your search
@@ -40,6 +40,7 @@ from app.models.models import (
|
||||
SysEthnic,
|
||||
SysUser,
|
||||
)
|
||||
from app.crud import collection_region as collection_region_crud
|
||||
from app.crud import customer as customer_crud
|
||||
from app.core.data_scope import apply_data_scope
|
||||
from app.models.research_donation import (
|
||||
@@ -267,25 +268,20 @@ def search_customers_for_protocol(
|
||||
kw = str(keyword or '').strip()
|
||||
page = max(1, int(page or 1))
|
||||
page_size = min(max(1, int(page_size or 20)), 100)
|
||||
if not kw:
|
||||
return {
|
||||
'list': [],
|
||||
'total': 0,
|
||||
'page': page,
|
||||
'pageSize': page_size,
|
||||
}
|
||||
|
||||
like = f'%{kw}%'
|
||||
query = db.query(BizCustomer).filter(
|
||||
BizCustomer.del_flag == 0,
|
||||
BizCustomer.tenant_no == ctx.tenant_no,
|
||||
or_(
|
||||
BizCustomer.customer_name.like(like),
|
||||
BizCustomer.phone_no.like(like),
|
||||
BizCustomer.id_card_no.like(like),
|
||||
BizCustomer.customer_tags.like(like),
|
||||
),
|
||||
)
|
||||
if kw:
|
||||
like = f'%{kw}%'
|
||||
query = query.filter(
|
||||
or_(
|
||||
BizCustomer.customer_name.like(like),
|
||||
BizCustomer.phone_no.like(like),
|
||||
BizCustomer.id_card_no.like(like),
|
||||
BizCustomer.customer_tags.like(like),
|
||||
),
|
||||
)
|
||||
query = apply_data_scope(query, BizCustomer, user_info, db, ctx.tenant_no)
|
||||
total = query.count()
|
||||
rows = (
|
||||
@@ -438,6 +434,17 @@ def get_form_options(
|
||||
.limit(50)
|
||||
.all()
|
||||
)
|
||||
current_user_regions = []
|
||||
if current_user:
|
||||
current_user_regions = [
|
||||
_option(item.get('id'), item.get('regionName'))
|
||||
for item in collection_region_crud.list_regions_by_staff_user(
|
||||
db,
|
||||
user_id=str(current_user.id),
|
||||
tenant_no=ctx.tenant_no,
|
||||
)
|
||||
if item.get('id')
|
||||
]
|
||||
result = {
|
||||
'regions': [_option(row.id, row.region_name) for row in regions],
|
||||
'hospitals': [_option(row.id, row.hospital_name) for row in hospitals],
|
||||
@@ -456,6 +463,8 @@ def get_form_options(
|
||||
if current_user
|
||||
else None
|
||||
),
|
||||
# 当前登录人在 biz_collection_region_staff 的关联地区(顺序即默认取第一个)
|
||||
'currentUserRegions': current_user_regions,
|
||||
}
|
||||
if normalized_module == 'protocol':
|
||||
ethnicities = (
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,11 +1,11 @@
|
||||
# Graph Report - app (2026-10-15)
|
||||
|
||||
## Corpus Check
|
||||
- Large corpus: 308 files · ~376,049 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
|
||||
- Large corpus: 308 files · ~376,074 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
|
||||
|
||||
## Summary
|
||||
- 6313 nodes · 34912 edges · 41 communities detected
|
||||
- Extraction: 32% EXTRACTED · 68% INFERRED · 0% AMBIGUOUS · INFERRED: 23864 edges (avg confidence: 0.6)
|
||||
- 6313 nodes · 34914 edges · 39 communities detected
|
||||
- Extraction: 32% EXTRACTED · 68% INFERRED · 0% AMBIGUOUS · INFERRED: 23866 edges (avg confidence: 0.6)
|
||||
- Token cost: 0 input · 0 output
|
||||
|
||||
## Community Hubs (Navigation)
|
||||
@@ -42,14 +42,12 @@
|
||||
- [[_COMMUNITY_Community 30|Community 30]]
|
||||
- [[_COMMUNITY_Community 31|Community 31]]
|
||||
- [[_COMMUNITY_Community 32|Community 32]]
|
||||
- [[_COMMUNITY_Community 33|Community 33]]
|
||||
- [[_COMMUNITY_Community 34|Community 34]]
|
||||
- [[_COMMUNITY_Community 35|Community 35]]
|
||||
- [[_COMMUNITY_Community 36|Community 36]]
|
||||
- [[_COMMUNITY_Community 37|Community 37]]
|
||||
- [[_COMMUNITY_Community 38|Community 38]]
|
||||
- [[_COMMUNITY_Community 39|Community 39]]
|
||||
- [[_COMMUNITY_Community 40|Community 40]]
|
||||
- [[_COMMUNITY_Community 41|Community 41]]
|
||||
- [[_COMMUNITY_Community 42|Community 42]]
|
||||
|
||||
## God Nodes (most connected - your core abstractions)
|
||||
1. `success_response()` - 826 edges
|
||||
@@ -66,219 +64,209 @@
|
||||
## Surprising Connections (you probably didn't know these)
|
||||
- `统一记录 API 请求/响应出入参的中间件` --uses--> `SysApiRequestLog` [INFERRED]
|
||||
core/api_request_log_middleware.py → models/models.py
|
||||
- `get_menu_list()` --calls--> `success_response()` [INFERRED]
|
||||
api/menu.py → core/response.py
|
||||
- `菜单 code 权限守卫(V0.3:通过 sys_user_role → sys_role_menu → sys_menu.perms)` --uses--> `SysUser` [INFERRED]
|
||||
core/menu_guard.py → models/models.py
|
||||
- `运营端角色守卫:admin / super_admin 可访问。` --uses--> `SysUser` [INFERRED]
|
||||
core/menu_guard.py → models/models.py
|
||||
- `读取用户授权的菜单权限标识集合(与前端 meta.menuCode / perms 对齐)。` --uses--> `SysUser` [INFERRED]
|
||||
core/menu_guard.py → models/models.py
|
||||
- `判断用户是否拥有指定权限码(不拦截请求,用于字段/按钮级能力控制)。` --uses--> `SysUser` [INFERRED]
|
||||
core/menu_guard.py → models/models.py
|
||||
|
||||
## Communities
|
||||
|
||||
### Community 0 - "Community 0"
|
||||
Cohesion: 0.01
|
||||
Nodes (1171): _assert_user_tenant_access(), attachment_download_url(), create_dept(), create_dict_data(), create_dict_type(), create_express_company(), create_item_unit(), create_menu() (+1163 more)
|
||||
Nodes (1159): _assert_user_tenant_access(), attachment_download_url(), create_dept(), create_dict_data(), create_dict_type(), create_express_company(), create_item_unit(), create_menu() (+1151 more)
|
||||
|
||||
### Community 1 - "Community 1"
|
||||
Cohesion: 0.01
|
||||
Nodes (794): get_designer_data(), BaseSettings, Config, secret_key_must_be_strong(), Settings, generate_uuid(), allocate_next_biz_no(), _allocate_sqlite_sequence() (+786 more)
|
||||
Nodes (749): BaseSettings, Config, secret_key_must_be_strong(), Settings, generate_uuid(), allocate_next_biz_no(), _allocate_sqlite_sequence(), _format_biz_no() (+741 more)
|
||||
|
||||
### Community 2 - "Community 2"
|
||||
Cohesion: 0.01
|
||||
Nodes (602): GarmentBatchDeleteBody, GarmentBatchDiscardBody, GarmentCreateBody, GarmentDiscardBody, GarmentUpdateBody, SterilizeLogBatchBody, SterilizeLogCreateBody, SterilizeLogUpdateBody (+594 more)
|
||||
Nodes (605): GarmentBatchDeleteBody, GarmentBatchDiscardBody, GarmentCreateBody, GarmentDiscardBody, GarmentUpdateBody, SterilizeLogBatchBody, SterilizeLogCreateBody, SterilizeLogUpdateBody (+597 more)
|
||||
|
||||
### Community 3 - "Community 3"
|
||||
Cohesion: 0.05
|
||||
Nodes (516): AttachmentDownloadUrlBody, DeptCreateBody, DeptUpdateBody, DictDataCreateBody, DictDataUpdateBody, DictTypeCreateBody, DictTypeUpdateBody, ExpressCompanyCreateBody (+508 more)
|
||||
Cohesion: 0.01
|
||||
Nodes (437): _normalize_date_bound(), assert_protocol_sensitive_fields(), create_collection_protocol(), delete_collection_protocol(), get_collection_protocol_detail(), get_invoice_eligible_payments(), get_protocol_invoice_requests(), _get_tenant_no() (+429 more)
|
||||
|
||||
### Community 4 - "Community 4"
|
||||
Cohesion: 0.01
|
||||
Nodes (466): _normalize_date_bound(), assert_protocol_sensitive_fields(), create_collection_protocol(), delete_collection_protocol(), get_collection_protocol_detail(), get_invoice_eligible_payments(), get_protocol_invoice_requests(), _get_tenant_no() (+458 more)
|
||||
Cohesion: 0.04
|
||||
Nodes (463): CellSampleTypeCreateBody, CellSampleTypeUpdateBody, CollectionRegionCreateBody, CollectionRegionUpdateBody, CustomerCreateBody, CustomerUpdateBody, HospitalCreateBody, HospitalUpdateBody (+455 more)
|
||||
|
||||
### Community 5 - "Community 5"
|
||||
Cohesion: 0.04
|
||||
Nodes (465): CellSampleTypeCreateBody, CellSampleTypeUpdateBody, CollectionRegionCreateBody, CollectionRegionUpdateBody, CustomerCreateBody, CustomerUpdateBody, HospitalCreateBody, HospitalUpdateBody (+457 more)
|
||||
Cohesion: 0.07
|
||||
Nodes (440): InsuranceCompanyCreateBody, InsuranceCompanyInvoiceCreateBody, InsuranceCompanyInvoiceUpdateBody, InsuranceCompanyUpdateBody, InsuranceProjectPriceCreateBody, InsuranceProjectPriceUpdateBody, 保险公司及险种价格管理 API(保险公司 + 开票信息 + 险种价格), 小程序菜单:当前用户在「移动端菜单」树下有权限的入口。 (+432 more)
|
||||
|
||||
### Community 6 - "Community 6"
|
||||
Cohesion: 0.01
|
||||
Nodes (314): eq_unicode(), like_unicode(), MySQL 字符串比较/模糊匹配时统一排序规则,避免 Illegal mix of collations。, 跨表字符串等值比较(JOIN / WHERE)时统一为 utf8mb4_unicode_ci。, 将列显式设为 utf8mb4_unicode_ci。, unicode_ci(), _load_lineage_qc_for_nodes(), lookup_attachments_by_urls() (+306 more)
|
||||
Nodes (280): eq_unicode(), like_unicode(), MySQL 字符串比较/模糊匹配时统一排序规则,避免 Illegal mix of collations。, 跨表字符串等值比较(JOIN / WHERE)时统一为 utf8mb4_unicode_ci。, 将列显式设为 utf8mb4_unicode_ci。, unicode_ci(), format_protocol_status_label(), resolve_void_type_label() (+272 more)
|
||||
|
||||
### Community 7 - "Community 7"
|
||||
Cohesion: 0.02
|
||||
Nodes (234): _copied_app_name(), copy_app(), create_app(), _create_version(), delete_app(), delete_group(), _dumps(), _find_draft() (+226 more)
|
||||
Nodes (241): AttachmentDownloadUrlBody, DeptCreateBody, DeptUpdateBody, DictDataCreateBody, DictDataUpdateBody, DictTypeCreateBody, DictTypeUpdateBody, ExpressCompanyCreateBody (+233 more)
|
||||
|
||||
### Community 8 - "Community 8"
|
||||
Cohesion: 0.03
|
||||
Nodes (161): _save_sample_payments(), deduct_for_step(), _display_remark(), list_stock_logs(), _parse_receiver_purpose_from_remark(), 耗材变动记录 CRUD(biz_consumable_stock_log), 撤销步骤此前 step_save 扣减,便于重新填报。, 扣减耗材库存并生成变动记录。调用方控制事务,本函数不 commit。 (+153 more)
|
||||
Cohesion: 0.02
|
||||
Nodes (234): _copied_app_name(), copy_app(), create_app(), _create_version(), delete_app(), delete_group(), _dumps(), _find_draft() (+226 more)
|
||||
|
||||
### Community 9 - "Community 9"
|
||||
Cohesion: 0.02
|
||||
Nodes (105): _error_json(), lifespan(), 未捕获异常:统一 JSON 500,确保跨域场景下仍有 Access-Control-Allow-Origin, 数据库异常:返回 JSON 并保留 CORS 头,避免浏览器只报跨域错误, sqlalchemy_exception_handler(), unhandled_exception_handler(), BaseHTTPMiddleware, ApiCryptoError (+97 more)
|
||||
Nodes (150): get_designer_data(), _error_json(), lifespan(), 未捕获异常:统一 JSON 500,确保跨域场景下仍有 Access-Control-Allow-Origin, 数据库异常:返回 JSON 并保留 CORS 头,避免浏览器只报跨域错误, sqlalchemy_exception_handler(), unhandled_exception_handler(), BaseHTTPMiddleware (+142 more)
|
||||
|
||||
### Community 10 - "Community 10"
|
||||
Cohesion: 0.03
|
||||
Nodes (150): format_protocol_status_label(), resolve_void_type_label(), _ancestor_link_from_cell_product_input(), _ancestor_sample_chain_link(), _apply_cell_product_status_change(), _build_ancestor_chain(), _build_descendant_chain(), _build_facility_path_label() (+142 more)
|
||||
Cohesion: 0.02
|
||||
Nodes (199): _save_sample_payments(), deduct_for_step(), _display_remark(), list_stock_logs(), _parse_receiver_purpose_from_remark(), 耗材变动记录 CRUD(biz_consumable_stock_log), 撤销步骤此前 step_save 扣减,便于重新填报。, 扣减耗材库存并生成变动记录。调用方控制事务,本函数不 commit。 (+191 more)
|
||||
|
||||
### Community 11 - "Community 11"
|
||||
Cohesion: 0.02
|
||||
Nodes (140): _register_attachment_routes(), _register_freight_routes(), _register_payment_routes(), _register_presign_routes(), _register_protocol_routes(), mp_bind_status(), 小程序鉴权:微信登录 / 绑定 openid。, 当前用户是否已绑定微信服务号 openid。 (+132 more)
|
||||
Nodes (169): api_save_application(), api_detail(), api_get_outbound_handover(), api_list(), api_save_outbound_handover(), _get_tenant_no(), ProductItemBody, UpdateQcStatusBody (+161 more)
|
||||
|
||||
### Community 12 - "Community 12"
|
||||
Cohesion: 0.02
|
||||
Nodes (141): api_detail(), api_get_outbound_handover(), api_list(), api_save_outbound_handover(), _get_tenant_no(), ProductItemBody, UpdateQcStatusBody, UpdateScheduleBody (+133 more)
|
||||
Cohesion: 0.03
|
||||
Nodes (147): _ancestor_link_from_cell_product_input(), _ancestor_sample_chain_link(), _apply_cell_product_status_change(), _build_ancestor_chain(), _build_descendant_chain(), _build_facility_path_label(), build_split_product_codes(), create_cell_product() (+139 more)
|
||||
|
||||
### Community 13 - "Community 13"
|
||||
Cohesion: 0.05
|
||||
Nodes (113): AccessLogCreateBody, AccessLogUpdateBody, CleanRoomCreateBody, CleanRoomUpdateBody, ExhibitionAppointmentCreateBody, ExhibitionAppointmentUpdateBody, list_storage_slot_stats(), OccupancyCreateBody (+105 more)
|
||||
Cohesion: 0.03
|
||||
Nodes (122): get_customer_service_dict(), _get_tenant_no(), _customer_service_incoming_from_body(), _get_current_user_id(), _get_tenant_no(), _optional_dt(), quick_register_sample_info(), QuickRegisterBody (+114 more)
|
||||
|
||||
### Community 14 - "Community 14"
|
||||
Cohesion: 0.04
|
||||
Nodes (104): _body_to_payload(), _get_current_user_id(), get_production_reception_by_sample_code(), get_production_reception_detail(), _get_tenant_no(), post_production_reception(), ProductionReceptionBody, put_production_reception() (+96 more)
|
||||
|
||||
### Community 15 - "Community 15"
|
||||
Cohesion: 0.04
|
||||
Nodes (97): get_customer_service_dict(), _get_tenant_no(), _get_current_user_id(), get_sample_insurance(), get_sample_storage_cert(), _get_tenant_no(), put_sample_insurance(), put_sample_storage_cert() (+89 more)
|
||||
Cohesion: 0.05
|
||||
Nodes (112): AccessLogCreateBody, AccessLogUpdateBody, CleanRoomCreateBody, CleanRoomUpdateBody, ExhibitionAppointmentCreateBody, ExhibitionAppointmentUpdateBody, OccupancyCreateBody, 运营支撑 API(洁净室、进出记录、仓储设施、储位、展厅预约) (+104 more)
|
||||
|
||||
### Community 16 - "Community 16"
|
||||
Cohesion: 0.06
|
||||
Nodes (62): complete_application(), create_basic_experiment_sale_schedules(), create_infusion_plan(), create_schedule(), _create_schedule_products(), _format_yyyy_mm_dd(), _generate_application_no(), get_application() (+54 more)
|
||||
Nodes (78): create_sample_freight(), delete_sample_freight(), _get_current_user_id(), get_sample_freight(), _get_tenant_no(), link_sample_freight(), list_sample_freight_options(), list_sample_freights() (+70 more)
|
||||
|
||||
### Community 17 - "Community 17"
|
||||
Cohesion: 0.09
|
||||
Nodes (52): create_sample_freight(), delete_sample_freight(), _get_current_user_id(), get_sample_freight(), _get_tenant_no(), link_sample_freight(), list_sample_freight_options(), list_sample_freights() (+44 more)
|
||||
|
||||
### Community 18 - "Community 18"
|
||||
Cohesion: 0.12
|
||||
Nodes (11): get_wechat_pay_client(), get_wechat_pay_v2(), 微信支付工具模块 支持微信支付 V3 API 文档参考: https://pay.weixin.qq.com/docs/v3/apis/index.ht, 统一下单接口 (V3) Args: out_trade_no: 商户订单号 total, 申请退款 Args: out_trade_no: 商户订单号 total_amount, 小程序调起支付的二次签名参数(与公众号 JSAPI 规则一致), 统一下单 (V2 API) Args: out_trade_no: 商户订单号 tot, 生成签名 V3 (SHA256 with RSA) (+3 more)
|
||||
|
||||
### Community 19 - "Community 19"
|
||||
### Community 18 - "Community 18"
|
||||
Cohesion: 0.14
|
||||
Nodes (11): apply_formulas_and_linkages(), eval_formula(), _extract_rules(), preprocess_formula(), OA 表单公式与数据联动(禁止任意 eval), 按 schema 中字段 props.formula / props.linkage 回填 form_data。 linkage 示例: { "when, 将 {field} 转为合法标识符引用 field。, _SafeEval (+3 more)
|
||||
|
||||
### Community 20 - "Community 20"
|
||||
### Community 19 - "Community 19"
|
||||
Cohesion: 0.21
|
||||
Nodes (19): _consumable_row_to_dict(), create_process(), _create_sub_consumable(), _create_sub_data_collection(), _create_sub_output(), _create_sub_reagent(), _data_collection_row_to_dict(), get_process() (+11 more)
|
||||
|
||||
### Community 21 - "Community 21"
|
||||
### Community 20 - "Community 20"
|
||||
Cohesion: 0.2
|
||||
Nodes (19): _code_exists(), create_material(), _dec(), _fmt_dt(), get_material(), get_material_entity(), get_my_usages(), _is_enabled_status() (+11 more)
|
||||
|
||||
### Community 22 - "Community 22"
|
||||
### Community 21 - "Community 21"
|
||||
Cohesion: 0.29
|
||||
Nodes (11): get_detail(), _load_sample_context(), _row_to_dict(), upsert(), dumps_payload(), empty_detail(), loads_payload(), normalize_payload() (+3 more)
|
||||
|
||||
### Community 23 - "Community 23"
|
||||
### Community 22 - "Community 22"
|
||||
Cohesion: 0.24
|
||||
Nodes (11): deduct_for_step(), _display_remark(), list_stock_logs(), _parse_receiver_purpose_from_remark(), 试剂变动记录 CRUD(biz_reagent_stock_log), 撤销步骤此前 step_save 扣减,便于重新填报。, 扣减试剂库存并生成变动记录。调用方控制事务,本函数不 commit。, _resolve_receiver_purpose() (+3 more)
|
||||
|
||||
### Community 24 - "Community 24"
|
||||
### Community 23 - "Community 23"
|
||||
Cohesion: 0.31
|
||||
Nodes (10): create_account(), _filtered_query(), get_account(), list_accounts(), list_options(), OA 收款账户 CRUD(oa_receive_account), row_to_dict(), soft_delete_account() (+2 more)
|
||||
|
||||
### Community 25 - "Community 25"
|
||||
### Community 24 - "Community 24"
|
||||
Cohesion: 0.33
|
||||
Nodes (8): _build_tree(), _cascade_soft_delete(), get_menu(), list_menus(), list_menus_tree(), _row_to_dict(), soft_delete_menu(), update_menu()
|
||||
|
||||
### Community 26 - "Community 26"
|
||||
### Community 25 - "Community 25"
|
||||
Cohesion: 0.29
|
||||
Nodes (2): BaseModel, SoftDeleteModel
|
||||
|
||||
### Community 27 - "Community 27"
|
||||
### Community 26 - "Community 26"
|
||||
Cohesion: 0.38
|
||||
Nodes (6): derive_legacy_status_from_three(), derive_three_status_from_legacy(), 阶段A兼容:从旧 status 推导三字段。 约束:旧 status 本身混合了支付/配送/订单生命周期,因此只能尽力推断; 若业务侧已有更精确, 阶段A兼容:从三字段反推旧 status(用于旧前端/旧筛选参数兼容)。, ThreeStatus, _to_decimal()
|
||||
|
||||
### Community 28 - "Community 28"
|
||||
### Community 27 - "Community 27"
|
||||
Cohesion: 0.4
|
||||
Nodes (5): batch_matches_stock_status(), normalize_batch_stock_status(), 质检物料入库批次:按剩余数量过滤的语义辅助。, 纯函数判定(供单测);list_batches 用 SQL 等价条件。, 返回 'available' | 'exhausted';全部 / 空 / 非法 → None(不加剩余数量条件)。
|
||||
|
||||
### Community 29 - "Community 29"
|
||||
### Community 28 - "Community 28"
|
||||
Cohesion: 0.5
|
||||
Nodes (2): _auto_fill_create_dept_id(), ORM before_insert 钩子:当 create_dept_id 为空时,自动从请求上下文填充当前用户部门 ID
|
||||
|
||||
### Community 30 - "Community 30"
|
||||
Cohesion: 0.67
|
||||
Nodes (2): get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,5 个一级菜单分组)
|
||||
|
||||
### Community 31 - "Community 31"
|
||||
### Community 29 - "Community 29"
|
||||
Cohesion: 0.67
|
||||
Nodes (1): 转正套件:入职日 + 试用期月数 → 建议转正日(YYYY-MM-DD)。
|
||||
|
||||
### Community 32 - "Community 32"
|
||||
### Community 30 - "Community 30"
|
||||
Cohesion: 1.0
|
||||
Nodes (1): 质检物料金额查看授权:专用角色与菜单权限常量。
|
||||
|
||||
### Community 33 - "Community 33"
|
||||
### Community 31 - "Community 31"
|
||||
Cohesion: 1.0
|
||||
Nodes (1): 请求级别的用户上下文变量 通过 contextvars 在请求处理链路中传递当前用户信息, 供 SQLAlchemy 事件监听器等底层机制使用,避免逐层手动传
|
||||
|
||||
### Community 34 - "Community 34"
|
||||
### Community 32 - "Community 32"
|
||||
Cohesion: 1.0
|
||||
Nodes (1): API 路由包(骨架:公共鉴权 + 静态菜单 + 运营端占位)
|
||||
|
||||
### Community 37 - "Community 37"
|
||||
### Community 35 - "Community 35"
|
||||
Cohesion: 1.0
|
||||
Nodes (1): 发送订单状态通知 Args: openid: 用户openid ord
|
||||
|
||||
### Community 38 - "Community 38"
|
||||
### Community 36 - "Community 36"
|
||||
Cohesion: 1.0
|
||||
Nodes (1): 发送支付成功通知 Args: openid: 用户openid ord
|
||||
|
||||
### Community 39 - "Community 39"
|
||||
### Community 37 - "Community 37"
|
||||
Cohesion: 1.0
|
||||
Nodes (1): 发送配送通知 Args: openid: 配送员openid task
|
||||
|
||||
### Community 40 - "Community 40"
|
||||
### Community 38 - "Community 38"
|
||||
Cohesion: 1.0
|
||||
Nodes (1): 发送配送时效预警 Args: openid: 配送员openid ta
|
||||
|
||||
### Community 41 - "Community 41"
|
||||
### Community 39 - "Community 39"
|
||||
Cohesion: 1.0
|
||||
Nodes (1): 发送退款结果通知 Args: openid: 用户openid ord
|
||||
|
||||
### Community 42 - "Community 42"
|
||||
### Community 40 - "Community 40"
|
||||
Cohesion: 1.0
|
||||
Nodes (1): 发送催单通知给配送员 Args: deliver_openid: 配送员openid
|
||||
|
||||
## Knowledge Gaps
|
||||
- **207 isolated node(s):** `刷新会话 TTL(refreshToken 续期;已登录用户每次 API 校验通过后滑动续期)`, `写入 refreshToken(用于 one-time 使用/吊销)`, `根据 token 获取当前用户(包含 Redis 会话校验;会话滑动续期)`, `严格判断当前租户用户是否拥有指定移动市场权限码。`, `为移动市场 API 提供租户化、精确匹配的菜单权限依赖。` (+202 more)
|
||||
These have ≤1 connection - possible missing edges or undocumented components.
|
||||
- **Thin community `Community 26`** (8 nodes): `BaseModel`, `.to_dict()`, `get_active()`, `base.py`, `SoftDeleteModel`, `.restore()`, `.soft_delete()`, `__tablename__()`
|
||||
- **Thin community `Community 25`** (8 nodes): `BaseModel`, `.to_dict()`, `get_active()`, `base.py`, `SoftDeleteModel`, `.restore()`, `.soft_delete()`, `__tablename__()`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 29`** (4 nodes): `_auto_fill_create_dept_id()`, `get_db()`, `database.py`, `ORM before_insert 钩子:当 create_dept_id 为空时,自动从请求上下文填充当前用户部门 ID`
|
||||
- **Thin community `Community 28`** (4 nodes): `_auto_fill_create_dept_id()`, `get_db()`, `database.py`, `ORM before_insert 钩子:当 create_dept_id 为空时,自动从请求上下文填充当前用户部门 ID`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 30`** (3 nodes): `get_menu_list()`, `menu.py`, `运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,5 个一级菜单分组)`
|
||||
- **Thin community `Community 29`** (3 nodes): `add_months_ymd()`, `oa_confirmation_date.py`, `转正套件:入职日 + 试用期月数 → 建议转正日(YYYY-MM-DD)。`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 31`** (3 nodes): `add_months_ymd()`, `oa_confirmation_date.py`, `转正套件:入职日 + 试用期月数 → 建议转正日(YYYY-MM-DD)。`
|
||||
- **Thin community `Community 30`** (2 nodes): `qc_material_amount_auth_constants.py`, `质检物料金额查看授权:专用角色与菜单权限常量。`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 32`** (2 nodes): `qc_material_amount_auth_constants.py`, `质检物料金额查看授权:专用角色与菜单权限常量。`
|
||||
- **Thin community `Community 31`** (2 nodes): `context.py`, `请求级别的用户上下文变量 通过 contextvars 在请求处理链路中传递当前用户信息, 供 SQLAlchemy 事件监听器等底层机制使用,避免逐层手动传`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 33`** (2 nodes): `context.py`, `请求级别的用户上下文变量 通过 contextvars 在请求处理链路中传递当前用户信息, 供 SQLAlchemy 事件监听器等底层机制使用,避免逐层手动传`
|
||||
- **Thin community `Community 32`** (2 nodes): `__init__.py`, `API 路由包(骨架:公共鉴权 + 静态菜单 + 运营端占位)`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 34`** (2 nodes): `__init__.py`, `API 路由包(骨架:公共鉴权 + 静态菜单 + 运营端占位)`
|
||||
- **Thin community `Community 35`** (1 nodes): `发送订单状态通知 Args: openid: 用户openid ord`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 37`** (1 nodes): `发送订单状态通知 Args: openid: 用户openid ord`
|
||||
- **Thin community `Community 36`** (1 nodes): `发送支付成功通知 Args: openid: 用户openid ord`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 38`** (1 nodes): `发送支付成功通知 Args: openid: 用户openid ord`
|
||||
- **Thin community `Community 37`** (1 nodes): `发送配送通知 Args: openid: 配送员openid task`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 39`** (1 nodes): `发送配送通知 Args: openid: 配送员openid task`
|
||||
- **Thin community `Community 38`** (1 nodes): `发送配送时效预警 Args: openid: 配送员openid ta`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 40`** (1 nodes): `发送配送时效预警 Args: openid: 配送员openid ta`
|
||||
- **Thin community `Community 39`** (1 nodes): `发送退款结果通知 Args: openid: 用户openid ord`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 41`** (1 nodes): `发送退款结果通知 Args: openid: 用户openid ord`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 42`** (1 nodes): `发送催单通知给配送员 Args: deliver_openid: 配送员openid`
|
||||
- **Thin community `Community 40`** (1 nodes): `发送催单通知给配送员 Args: deliver_openid: 配送员openid`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
|
||||
## Suggested Questions
|
||||
_Questions this graph is uniquely positioned to answer:_
|
||||
|
||||
- **Why does `SysUser` connect `Community 5` to `Community 0`, `Community 1`, `Community 2`, `Community 3`, `Community 4`, `Community 7`, `Community 8`, `Community 9`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 17`, `Community 23`?**
|
||||
- **Why does `SysUser` connect `Community 4` to `Community 0`, `Community 2`, `Community 3`, `Community 5`, `Community 7`, `Community 8`, `Community 9`, `Community 10`, `Community 11`, `Community 13`, `Community 14`, `Community 15`, `Community 16`, `Community 22`?**
|
||||
_High betweenness centrality (0.107) - this node is a cross-community bridge._
|
||||
- **Why does `success_response()` connect `Community 0` to `Community 1`, `Community 2`, `Community 3`, `Community 4`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 17`, `Community 30`?**
|
||||
- **Why does `success_response()` connect `Community 0` to `Community 2`, `Community 3`, `Community 7`, `Community 9`, `Community 11`, `Community 13`, `Community 14`, `Community 16`?**
|
||||
_High betweenness centrality (0.043) - this node is a cross-community bridge._
|
||||
- **Why does `generate_uuid()` connect `Community 1` to `Community 0`, `Community 3`, `Community 4`, `Community 5`, `Community 6`, `Community 7`, `Community 8`, `Community 9`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 17`, `Community 20`, `Community 21`, `Community 22`, `Community 23`, `Community 24`?**
|
||||
- **Why does `generate_uuid()` connect `Community 1` to `Community 0`, `Community 3`, `Community 4`, `Community 6`, `Community 7`, `Community 8`, `Community 9`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 16`, `Community 19`, `Community 20`, `Community 21`, `Community 22`, `Community 23`?**
|
||||
_High betweenness centrality (0.037) - this node is a cross-community bridge._
|
||||
- **Are the 1157 inferred relationships involving `str` (e.g. with `unhandled_exception_handler()` and `get_current_user_by_token()`) actually correct?**
|
||||
_`str` has 1157 INFERRED edges - model-reasoned connections that need verification._
|
||||
|
||||
+3693
-3669
File diff suppressed because it is too large.
Load diff
@@ -287,7 +287,7 @@
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/sample_payment_progress.py": 1791800781.2391684,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_resignation_kit_sync.py": 1785405020.285242,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/wechat_mp_auth.py": 1786615330.0733685,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/market_support.py": 1791955207.4837897,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/market_support.py": 1792071279.776183,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_assignee.py": 1790665524.6969597,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/wechat_login_service.py": 1786615952.6840453,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/market_protocol.py": 1791920092.0782788,
|
||||
@@ -299,7 +299,7 @@
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_money_field.py": 1785380625.3526123,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/sample_storage_cert_qc.py": 1791520419.7485287,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/protocol_pay_mode_switch.py": 1791922115.8003666,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/market_freight.py": 1791955205.3779838,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/market_freight.py": 1792071632.7135,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_post_select.py": 1785394392.5716882,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_wechat_notify.py": 1789108034.959046,
|
||||
"/Users/wuzilong/work/00code/zkxw/backend/app/services/oa_confirmation_kit_sync.py": 1785403667.4270058,
|
||||
|
||||
@@ -0,0 +1,662 @@
|
||||
#!/usr/bin/env python3
|
||||
"""采集协议单缴费模型 v1 → v2 迁移(生产专用,可重复执行)。
|
||||
|
||||
规则(与 docs/superpowers/specs/2026-10-15-protocol-save-auto-submit-and-v1-to-v2-migration-design.md 一致):
|
||||
|
||||
- 单样本 + 无退费:1:1 迁到 sample_payment / schedule / transfer,并置 payment_model_version=2
|
||||
- 多样本 + 无退费:默认只进人工清单;加 --multi-average 时按样本数平均分合同/应缴/转账
|
||||
- 有退费痕迹 / 无有效样本 / 无样本编码 / 无 v1 缴费主表:只进人工清单
|
||||
- 不物理删除 v1 payment / payment_detail
|
||||
|
||||
用法(在 backend 目录、已配置 .env):
|
||||
python -m scripts.migrate_protocol_payment_v1_to_v2 --list-only
|
||||
python -m scripts.migrate_protocol_payment_v1_to_v2 --dry-run
|
||||
python -m scripts.migrate_protocol_payment_v1_to_v2
|
||||
python -m scripts.migrate_protocol_payment_v1_to_v2 --multi-average
|
||||
python -m scripts.migrate_protocol_payment_v1_to_v2 --multi-average --include-open-payments
|
||||
python -m scripts.migrate_protocol_payment_v1_to_v2 --protocol-id <ID>
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import csv
|
||||
import os
|
||||
import sys
|
||||
from collections import defaultdict
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import datetime
|
||||
from decimal import Decimal, ROUND_DOWN, ROUND_HALF_UP
|
||||
from typing import Any, Dict, Iterable, List, Optional, Sequence, Tuple
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from app.core.database import SessionLocal
|
||||
from app.core.utils import generate_uuid
|
||||
from app.models.models import (
|
||||
BizCollectionProtocol,
|
||||
BizProtocolPayment,
|
||||
BizProtocolPaymentDetail,
|
||||
BizProtocolPaymentSchedule,
|
||||
BizProtocolPaymentTransfer,
|
||||
BizProtocolSample,
|
||||
BizProtocolSamplePayment,
|
||||
)
|
||||
|
||||
REFUND_STATUSES = frozenset({"tfqrz", "ytf"})
|
||||
OPEN_STATUSES = frozenset({"dfj", "jfqrz"})
|
||||
VOID_SAMPLE_STATUS = "yzf"
|
||||
CENTS = Decimal("0.01")
|
||||
|
||||
|
||||
def _dec(value: Any) -> Optional[Decimal]:
|
||||
if value is None or value == "":
|
||||
return None
|
||||
try:
|
||||
return Decimal(str(value))
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
|
||||
def _money(value: Any) -> Optional[Decimal]:
|
||||
d = _dec(value)
|
||||
if d is None:
|
||||
return None
|
||||
return d.quantize(CENTS, rounding=ROUND_HALF_UP)
|
||||
|
||||
|
||||
def split_amount_across(total: Optional[Decimal], n: int) -> List[Optional[Decimal]]:
|
||||
"""金额按分均分,余数落在最后一项;total 为空则返回全 None。"""
|
||||
if n <= 0:
|
||||
raise ValueError("n must be positive")
|
||||
if total is None:
|
||||
return [None] * n
|
||||
cents = int((total.quantize(CENTS, rounding=ROUND_HALF_UP) * 100).to_integral_value(rounding=ROUND_DOWN))
|
||||
base, rem = divmod(cents, n)
|
||||
out: List[Optional[Decimal]] = []
|
||||
for i in range(n):
|
||||
c = base + (rem if i == n - 1 else 0)
|
||||
out.append((Decimal(c) / Decimal(100)).quantize(CENTS))
|
||||
return out
|
||||
|
||||
|
||||
def detail_has_refund(d: BizProtocolPaymentDetail) -> bool:
|
||||
status = (d.pay_status or "").strip()
|
||||
if status in REFUND_STATUSES:
|
||||
return True
|
||||
amt = _dec(d.refund_amount)
|
||||
if amt is not None and amt > 0:
|
||||
return True
|
||||
for attr in (
|
||||
"refund_attachments",
|
||||
"refund_remark",
|
||||
"refund_finance_confirm_attachments",
|
||||
"refund_finance_remark",
|
||||
):
|
||||
if str(getattr(d, attr, None) or "").strip():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def _is_active_sample(s: BizProtocolSample) -> bool:
|
||||
if int(s.del_flag or 0) != 0:
|
||||
return False
|
||||
status = (s.sample_status or "").strip()
|
||||
if status == VOID_SAMPLE_STATUS:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def _schedule_no_of(d: BizProtocolPaymentDetail, *, pay_mode: str) -> int:
|
||||
if (pay_mode or "").strip() != "fq":
|
||||
return 1
|
||||
no = int(d.installment_no or 0)
|
||||
return no if no > 0 else 1
|
||||
|
||||
|
||||
def _append_remark(existing: Optional[str], extra: str) -> str:
|
||||
base = (existing or "").strip()
|
||||
if not base:
|
||||
return extra[:512]
|
||||
joined = f"{base} | {extra}"
|
||||
return joined[:512]
|
||||
|
||||
|
||||
@dataclass
|
||||
class ProtocolCandidate:
|
||||
protocol: BizCollectionProtocol
|
||||
samples: List[BizProtocolSample]
|
||||
payment: Optional[BizProtocolPayment]
|
||||
details: List[BizProtocolPaymentDetail]
|
||||
skip_reason: Optional[str] = None
|
||||
has_open_payment: bool = False
|
||||
|
||||
@property
|
||||
def sample_count(self) -> int:
|
||||
return len(self.samples)
|
||||
|
||||
@property
|
||||
def protocol_id(self) -> str:
|
||||
return str(self.protocol.id)
|
||||
|
||||
|
||||
@dataclass
|
||||
class MigrateStats:
|
||||
scanned: int = 0
|
||||
migrated: int = 0
|
||||
skipped_already_v2: int = 0
|
||||
listed: List[Dict[str, Any]] = field(default_factory=list)
|
||||
errors: List[str] = field(default_factory=list)
|
||||
|
||||
|
||||
def load_v1_protocols(
|
||||
db,
|
||||
*,
|
||||
protocol_id: Optional[str] = None,
|
||||
) -> List[BizCollectionProtocol]:
|
||||
q = db.query(BizCollectionProtocol).filter(
|
||||
BizCollectionProtocol.del_flag == 0,
|
||||
BizCollectionProtocol.payment_model_version == 1,
|
||||
)
|
||||
if protocol_id:
|
||||
q = q.filter(BizCollectionProtocol.id == protocol_id)
|
||||
return q.order_by(BizCollectionProtocol.create_time.asc()).all()
|
||||
|
||||
|
||||
def has_v2_sample_payment(db, protocol_id: str) -> bool:
|
||||
row = (
|
||||
db.query(BizProtocolSamplePayment.id)
|
||||
.filter(
|
||||
BizProtocolSamplePayment.collection_protocol_id == protocol_id,
|
||||
BizProtocolSamplePayment.del_flag == 0,
|
||||
)
|
||||
.first()
|
||||
)
|
||||
return row is not None
|
||||
|
||||
|
||||
def build_candidate(db, protocol: BizCollectionProtocol) -> ProtocolCandidate:
|
||||
samples = (
|
||||
db.query(BizProtocolSample)
|
||||
.filter(
|
||||
BizProtocolSample.collection_protocol_id == protocol.id,
|
||||
BizProtocolSample.del_flag == 0,
|
||||
)
|
||||
.order_by(BizProtocolSample.order_num.asc(), BizProtocolSample.create_time.asc())
|
||||
.all()
|
||||
)
|
||||
active = [s for s in samples if _is_active_sample(s)]
|
||||
payment = (
|
||||
db.query(BizProtocolPayment)
|
||||
.filter(
|
||||
BizProtocolPayment.collection_protocol_id == protocol.id,
|
||||
BizProtocolPayment.del_flag == 0,
|
||||
)
|
||||
.order_by(BizProtocolPayment.create_time.asc())
|
||||
.first()
|
||||
)
|
||||
details: List[BizProtocolPaymentDetail] = []
|
||||
if payment:
|
||||
details = (
|
||||
db.query(BizProtocolPaymentDetail)
|
||||
.filter(
|
||||
BizProtocolPaymentDetail.payment_id == payment.id,
|
||||
BizProtocolPaymentDetail.del_flag == 0,
|
||||
)
|
||||
.order_by(
|
||||
BizProtocolPaymentDetail.installment_no.asc(),
|
||||
BizProtocolPaymentDetail.create_time.asc(),
|
||||
)
|
||||
.all()
|
||||
)
|
||||
|
||||
cand = ProtocolCandidate(
|
||||
protocol=protocol,
|
||||
samples=active,
|
||||
payment=payment,
|
||||
details=details,
|
||||
has_open_payment=any((d.pay_status or "").strip() in OPEN_STATUSES for d in details),
|
||||
)
|
||||
|
||||
if has_v2_sample_payment(db, protocol.id):
|
||||
cand.skip_reason = "already_has_v2"
|
||||
return cand
|
||||
if not payment:
|
||||
cand.skip_reason = "no_v1_payment"
|
||||
return cand
|
||||
if not active:
|
||||
cand.skip_reason = "no_sample"
|
||||
return cand
|
||||
if any(not str(s.sample_code or "").strip() for s in active):
|
||||
cand.skip_reason = "no_sample_code"
|
||||
return cand
|
||||
if any(detail_has_refund(d) for d in details):
|
||||
cand.skip_reason = "has_refund"
|
||||
return cand
|
||||
if len(active) != 1:
|
||||
cand.skip_reason = "multi_sample"
|
||||
return cand
|
||||
return cand
|
||||
|
||||
|
||||
def _list_row(cand: ProtocolCandidate) -> Dict[str, Any]:
|
||||
p = cand.protocol
|
||||
pay = cand.payment
|
||||
return {
|
||||
"protocol_id": p.id,
|
||||
"protocol_no": p.protocol_no,
|
||||
"tenant_no": p.tenant_no,
|
||||
"sample_count": cand.sample_count,
|
||||
"sample_codes": ",".join(str(s.sample_code or "") for s in cand.samples),
|
||||
"contract_amount": str(pay.contract_amount) if pay and pay.contract_amount is not None else "",
|
||||
"detail_count": len(cand.details),
|
||||
"has_open_payment": "1" if cand.has_open_payment else "0",
|
||||
"skip_reason": cand.skip_reason or "",
|
||||
}
|
||||
|
||||
|
||||
def _new_common(
|
||||
*,
|
||||
tenant_no: str,
|
||||
user_id: Optional[str],
|
||||
create_dept_id: str,
|
||||
create_by: Optional[str],
|
||||
create_time: Optional[datetime],
|
||||
order_num: Optional[int],
|
||||
remark: Optional[str],
|
||||
) -> Dict[str, Any]:
|
||||
now = datetime.now()
|
||||
return {
|
||||
"tenant_no": tenant_no,
|
||||
"order_num": order_num,
|
||||
"remark": remark,
|
||||
"create_by": create_by or user_id,
|
||||
"create_dept_id": (create_dept_id or "").strip(),
|
||||
"create_time": create_time or now,
|
||||
"update_by": user_id,
|
||||
"update_time": now,
|
||||
"del_flag": 0,
|
||||
}
|
||||
|
||||
|
||||
def _group_details(
|
||||
details: Sequence[BizProtocolPaymentDetail], *, pay_mode: str
|
||||
) -> Dict[int, List[BizProtocolPaymentDetail]]:
|
||||
groups: Dict[int, List[BizProtocolPaymentDetail]] = defaultdict(list)
|
||||
for d in details:
|
||||
groups[_schedule_no_of(d, pay_mode=pay_mode)].append(d)
|
||||
return dict(sorted(groups.items(), key=lambda x: x[0]))
|
||||
|
||||
|
||||
def _due_from_group(
|
||||
rows: Sequence[BizProtocolPaymentDetail],
|
||||
*,
|
||||
payment: BizProtocolPayment,
|
||||
schedule_no: int,
|
||||
) -> Tuple[Optional[Decimal], Optional[str]]:
|
||||
due_amount = None
|
||||
due_date = None
|
||||
for d in rows:
|
||||
if due_amount is None and d.due_amount is not None:
|
||||
due_amount = _money(d.due_amount)
|
||||
if not due_date and str(d.installment_due_date or "").strip():
|
||||
due_date = str(d.installment_due_date).strip()
|
||||
if due_amount is None and schedule_no == 1 and (payment.pay_mode or "").strip() != "fq":
|
||||
due_amount = _money(payment.contract_amount)
|
||||
if not due_date and (payment.pay_mode or "").strip() != "fq":
|
||||
due_date = (payment.lump_sum_deadline or "").strip() or None
|
||||
return due_amount, due_date
|
||||
|
||||
|
||||
def migrate_single_sample(
|
||||
db,
|
||||
cand: ProtocolCandidate,
|
||||
*,
|
||||
user_id: Optional[str],
|
||||
dry_run: bool,
|
||||
) -> None:
|
||||
assert cand.payment is not None
|
||||
assert len(cand.samples) == 1
|
||||
sample = cand.samples[0]
|
||||
payment = cand.payment
|
||||
protocol = cand.protocol
|
||||
pay_mode = (payment.pay_mode or "dj").strip() or "dj"
|
||||
common = _new_common(
|
||||
tenant_no=protocol.tenant_no,
|
||||
user_id=user_id,
|
||||
create_dept_id=payment.create_dept_id or protocol.create_dept_id or "",
|
||||
create_by=payment.create_by,
|
||||
create_time=payment.create_time,
|
||||
order_num=payment.order_num,
|
||||
remark=payment.remark,
|
||||
)
|
||||
sp_id = generate_uuid()
|
||||
sp = BizProtocolSamplePayment(
|
||||
id=sp_id,
|
||||
collection_protocol_id=protocol.id,
|
||||
protocol_sample_id=sample.id,
|
||||
sample_code=str(sample.sample_code).strip(),
|
||||
pay_mode=pay_mode,
|
||||
contract_amount=payment.contract_amount,
|
||||
installment_count=payment.installment_count,
|
||||
installment_interval_months=payment.installment_interval_months,
|
||||
installment_start_date=payment.installment_start_date,
|
||||
installment_advance_days=payment.installment_advance_days,
|
||||
installment_ratios=payment.installment_ratios,
|
||||
lump_sum_deadline=payment.lump_sum_deadline,
|
||||
**common,
|
||||
)
|
||||
if not dry_run:
|
||||
db.add(sp)
|
||||
|
||||
groups = _group_details(cand.details, pay_mode=pay_mode)
|
||||
if not groups:
|
||||
# 无明细:仍建一期空 schedule,保证方案可编辑
|
||||
groups = {1: []}
|
||||
|
||||
for schedule_no, rows in groups.items():
|
||||
due_amount, due_date = _due_from_group(rows, payment=payment, schedule_no=schedule_no)
|
||||
sch_id = generate_uuid()
|
||||
sch = BizProtocolPaymentSchedule(
|
||||
id=sch_id,
|
||||
sample_payment_id=sp_id,
|
||||
collection_protocol_id=protocol.id,
|
||||
sample_code=str(sample.sample_code).strip(),
|
||||
schedule_no=schedule_no,
|
||||
due_amount=due_amount,
|
||||
due_date=due_date,
|
||||
schedule_status="open",
|
||||
**_new_common(
|
||||
tenant_no=protocol.tenant_no,
|
||||
user_id=user_id,
|
||||
create_dept_id=payment.create_dept_id or protocol.create_dept_id or "",
|
||||
create_by=payment.create_by,
|
||||
create_time=payment.create_time,
|
||||
order_num=schedule_no,
|
||||
remark=None,
|
||||
),
|
||||
)
|
||||
if not dry_run:
|
||||
db.add(sch)
|
||||
for d in rows:
|
||||
tr = BizProtocolPaymentTransfer(
|
||||
id=generate_uuid(),
|
||||
schedule_id=sch_id,
|
||||
sample_payment_id=sp_id,
|
||||
collection_protocol_id=protocol.id,
|
||||
sample_code=str(sample.sample_code).strip(),
|
||||
transfer_amount=d.transfer_amount,
|
||||
transfer_time=d.transfer_time,
|
||||
transfer_type=d.transfer_type,
|
||||
transfer_attachments=d.transfer_attachments,
|
||||
pay_status=(d.pay_status or "dfj").strip() or "dfj",
|
||||
finance_confirm_attachments=d.finance_confirm_attachments,
|
||||
finance_remark=d.finance_remark,
|
||||
**_new_common(
|
||||
tenant_no=protocol.tenant_no,
|
||||
user_id=user_id,
|
||||
create_dept_id=d.create_dept_id or payment.create_dept_id or "",
|
||||
create_by=d.create_by,
|
||||
create_time=d.create_time,
|
||||
order_num=d.order_num,
|
||||
remark=_append_remark(d.remark, f"migrated_from_v1_detail:{d.id}"),
|
||||
),
|
||||
)
|
||||
if not dry_run:
|
||||
db.add(tr)
|
||||
|
||||
if not dry_run:
|
||||
protocol.payment_model_version = 2
|
||||
protocol.update_by = user_id
|
||||
protocol.update_time = datetime.now()
|
||||
db.add(protocol)
|
||||
|
||||
|
||||
def migrate_multi_average(
|
||||
db,
|
||||
cand: ProtocolCandidate,
|
||||
*,
|
||||
user_id: Optional[str],
|
||||
dry_run: bool,
|
||||
) -> None:
|
||||
"""多样本:合同/应缴/转账金额均分;状态与凭证复制;备注标注来源明细。"""
|
||||
assert cand.payment is not None
|
||||
assert len(cand.samples) >= 2
|
||||
payment = cand.payment
|
||||
protocol = cand.protocol
|
||||
samples = cand.samples
|
||||
n = len(samples)
|
||||
pay_mode = (payment.pay_mode or "dj").strip() or "dj"
|
||||
contract_parts = split_amount_across(_money(payment.contract_amount), n)
|
||||
|
||||
groups = _group_details(cand.details, pay_mode=pay_mode)
|
||||
if not groups:
|
||||
groups = {1: []}
|
||||
|
||||
# 每期应缴:取组代表金额后均分
|
||||
due_parts_by_no: Dict[int, List[Optional[Decimal]]] = {}
|
||||
due_date_by_no: Dict[int, Optional[str]] = {}
|
||||
for schedule_no, rows in groups.items():
|
||||
due_amount, due_date = _due_from_group(rows, payment=payment, schedule_no=schedule_no)
|
||||
due_parts_by_no[schedule_no] = split_amount_across(due_amount, n)
|
||||
due_date_by_no[schedule_no] = due_date
|
||||
|
||||
for idx, sample in enumerate(samples):
|
||||
code = str(sample.sample_code).strip()
|
||||
sp_id = generate_uuid()
|
||||
sp = BizProtocolSamplePayment(
|
||||
id=sp_id,
|
||||
collection_protocol_id=protocol.id,
|
||||
protocol_sample_id=sample.id,
|
||||
sample_code=code,
|
||||
pay_mode=pay_mode,
|
||||
contract_amount=contract_parts[idx],
|
||||
installment_count=payment.installment_count,
|
||||
installment_interval_months=payment.installment_interval_months,
|
||||
installment_start_date=payment.installment_start_date,
|
||||
installment_advance_days=payment.installment_advance_days,
|
||||
installment_ratios=payment.installment_ratios,
|
||||
lump_sum_deadline=payment.lump_sum_deadline,
|
||||
**_new_common(
|
||||
tenant_no=protocol.tenant_no,
|
||||
user_id=user_id,
|
||||
create_dept_id=payment.create_dept_id or protocol.create_dept_id or "",
|
||||
create_by=payment.create_by,
|
||||
create_time=payment.create_time,
|
||||
order_num=idx + 1,
|
||||
remark=_append_remark(payment.remark, f"v1_multi_average:{n}"),
|
||||
),
|
||||
)
|
||||
if not dry_run:
|
||||
db.add(sp)
|
||||
|
||||
for schedule_no, rows in groups.items():
|
||||
sch_id = generate_uuid()
|
||||
sch = BizProtocolPaymentSchedule(
|
||||
id=sch_id,
|
||||
sample_payment_id=sp_id,
|
||||
collection_protocol_id=protocol.id,
|
||||
sample_code=code,
|
||||
schedule_no=schedule_no,
|
||||
due_amount=due_parts_by_no[schedule_no][idx],
|
||||
due_date=due_date_by_no[schedule_no],
|
||||
schedule_status="open",
|
||||
**_new_common(
|
||||
tenant_no=protocol.tenant_no,
|
||||
user_id=user_id,
|
||||
create_dept_id=payment.create_dept_id or protocol.create_dept_id or "",
|
||||
create_by=payment.create_by,
|
||||
create_time=payment.create_time,
|
||||
order_num=schedule_no,
|
||||
remark=None,
|
||||
),
|
||||
)
|
||||
if not dry_run:
|
||||
db.add(sch)
|
||||
for d in rows:
|
||||
amt_parts = split_amount_across(_money(d.transfer_amount), n)
|
||||
tr = BizProtocolPaymentTransfer(
|
||||
id=generate_uuid(),
|
||||
schedule_id=sch_id,
|
||||
sample_payment_id=sp_id,
|
||||
collection_protocol_id=protocol.id,
|
||||
sample_code=code,
|
||||
transfer_amount=amt_parts[idx],
|
||||
transfer_time=d.transfer_time,
|
||||
transfer_type=d.transfer_type,
|
||||
transfer_attachments=d.transfer_attachments,
|
||||
pay_status=(d.pay_status or "dfj").strip() or "dfj",
|
||||
finance_confirm_attachments=d.finance_confirm_attachments,
|
||||
finance_remark=d.finance_remark,
|
||||
**_new_common(
|
||||
tenant_no=protocol.tenant_no,
|
||||
user_id=user_id,
|
||||
create_dept_id=d.create_dept_id or payment.create_dept_id or "",
|
||||
create_by=d.create_by,
|
||||
create_time=d.create_time,
|
||||
order_num=d.order_num,
|
||||
remark=_append_remark(
|
||||
d.remark, f"拆自原明细:{d.id} ({idx + 1}/{n})"
|
||||
),
|
||||
),
|
||||
)
|
||||
if not dry_run:
|
||||
db.add(tr)
|
||||
|
||||
if not dry_run:
|
||||
protocol.payment_model_version = 2
|
||||
protocol.update_by = user_id
|
||||
protocol.update_time = datetime.now()
|
||||
db.add(protocol)
|
||||
|
||||
|
||||
def run_migration(
|
||||
db,
|
||||
*,
|
||||
dry_run: bool,
|
||||
list_only: bool,
|
||||
multi_average: bool,
|
||||
include_open_payments: bool,
|
||||
protocol_id: Optional[str],
|
||||
user_id: Optional[str],
|
||||
list_csv_path: Optional[str],
|
||||
) -> MigrateStats:
|
||||
stats = MigrateStats()
|
||||
protocols = load_v1_protocols(db, protocol_id=protocol_id)
|
||||
stats.scanned = len(protocols)
|
||||
|
||||
for protocol in protocols:
|
||||
if has_v2_sample_payment(db, protocol.id):
|
||||
stats.skipped_already_v2 += 1
|
||||
continue
|
||||
cand = build_candidate(db, protocol)
|
||||
|
||||
# 可自动迁:单样本无 skip;或多平均且 skip 仅为 multi_sample
|
||||
can_single = cand.skip_reason is None
|
||||
can_multi = (
|
||||
multi_average
|
||||
and cand.skip_reason == "multi_sample"
|
||||
and cand.payment is not None
|
||||
and cand.sample_count >= 2
|
||||
and all(str(s.sample_code or "").strip() for s in cand.samples)
|
||||
)
|
||||
if can_multi and cand.has_open_payment and not include_open_payments:
|
||||
cand.skip_reason = "multi_sample_open_payment"
|
||||
can_multi = False
|
||||
|
||||
if list_only or (not can_single and not can_multi):
|
||||
if cand.skip_reason and cand.skip_reason != "already_has_v2":
|
||||
stats.listed.append(_list_row(cand))
|
||||
continue
|
||||
|
||||
try:
|
||||
if can_single:
|
||||
migrate_single_sample(db, cand, user_id=user_id, dry_run=dry_run)
|
||||
else:
|
||||
# 临时清掉 skip,便于日志
|
||||
cand.skip_reason = None
|
||||
migrate_multi_average(db, cand, user_id=user_id, dry_run=dry_run)
|
||||
if not dry_run:
|
||||
db.commit()
|
||||
else:
|
||||
db.rollback()
|
||||
stats.migrated += 1
|
||||
print(
|
||||
f"[OK] {'DRY ' if dry_run else ''}migrated "
|
||||
f"{protocol.protocol_no} ({protocol.id}) samples={cand.sample_count}"
|
||||
)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
db.rollback()
|
||||
msg = f"[ERR] {protocol.protocol_no} ({protocol.id}): {exc}"
|
||||
stats.errors.append(msg)
|
||||
print(msg)
|
||||
|
||||
if stats.listed:
|
||||
print(f"\n=== 人工清单 {len(stats.listed)} 条 ===")
|
||||
writer = csv.DictWriter(
|
||||
sys.stdout,
|
||||
fieldnames=list(stats.listed[0].keys()),
|
||||
extrasaction="ignore",
|
||||
)
|
||||
writer.writeheader()
|
||||
writer.writerows(stats.listed)
|
||||
if list_csv_path:
|
||||
with open(list_csv_path, "w", encoding="utf-8", newline="") as f:
|
||||
w = csv.DictWriter(f, fieldnames=list(stats.listed[0].keys()))
|
||||
w.writeheader()
|
||||
w.writerows(stats.listed)
|
||||
print(f"\n清单已写入: {list_csv_path}")
|
||||
|
||||
return stats
|
||||
|
||||
|
||||
def main(argv: Optional[Sequence[str]] = None) -> int:
|
||||
parser = argparse.ArgumentParser(description="Migrate protocol payment v1 → v2")
|
||||
parser.add_argument("--dry-run", action="store_true", help="只演练,不写库")
|
||||
parser.add_argument("--list-only", action="store_true", help="只输出人工清单,不迁移")
|
||||
parser.add_argument(
|
||||
"--multi-average",
|
||||
action="store_true",
|
||||
help="多样本无退费时按平均分自动迁移(默认:多样本仅进清单)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--include-open-payments",
|
||||
action="store_true",
|
||||
help="与 --multi-average 联用:允许 dfj/jfqrz 明细一并均分(有财务重复确认风险)",
|
||||
)
|
||||
parser.add_argument("--protocol-id", default=None, help="只处理指定协议 ID")
|
||||
parser.add_argument("--user-id", default="migrate_v1_v2", help="写入 update_by")
|
||||
parser.add_argument(
|
||||
"--list-csv",
|
||||
default=None,
|
||||
help="人工清单另存 CSV 路径",
|
||||
)
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
db = SessionLocal()
|
||||
try:
|
||||
stats = run_migration(
|
||||
db,
|
||||
dry_run=bool(args.dry_run),
|
||||
list_only=bool(args.list_only),
|
||||
multi_average=bool(args.multi_average),
|
||||
include_open_payments=bool(args.include_open_payments),
|
||||
protocol_id=(args.protocol_id or "").strip() or None,
|
||||
user_id=(args.user_id or "").strip() or None,
|
||||
list_csv_path=(args.list_csv or "").strip() or None,
|
||||
)
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
print(
|
||||
"\n=== 汇总 ===\n"
|
||||
f"scanned_v1={stats.scanned}\n"
|
||||
f"migrated={stats.migrated}\n"
|
||||
f"skipped_already_v2_data={stats.skipped_already_v2}\n"
|
||||
f"manual_list={len(stats.listed)}\n"
|
||||
f"errors={len(stats.errors)}"
|
||||
)
|
||||
return 1 if stats.errors else 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -3718,7 +3718,8 @@ def test_cell_protocol_detail_includes_presign_deposit_hint_and_transfers():
|
||||
assert detail['depositTransfers'][0]['transferTypeLabel'] == '微信支付'
|
||||
|
||||
|
||||
def test_protocol_customer_search_empty_keyword_returns_empty_list():
|
||||
def test_protocol_customer_search_empty_keyword_returns_recent_list():
|
||||
"""空关键字仍返回近期客户列表,供移动端「选档案」弹窗默认展示。"""
|
||||
from app.services.market_support import search_customers_for_protocol
|
||||
|
||||
db = _session()
|
||||
@@ -3737,8 +3738,8 @@ def test_protocol_customer_search_empty_keyword_returns_empty_list():
|
||||
data = search_customers_for_protocol(
|
||||
db, ctx=_ctx('specialist'), user_info=_user(), keyword=' '
|
||||
)
|
||||
assert data['list'] == []
|
||||
assert data['total'] == 0
|
||||
assert [item['id'] for item in data['list']] == ['c-empty-kw']
|
||||
assert data['total'] == 1
|
||||
|
||||
|
||||
def test_protocol_customer_search_matches_name_phone_and_isolates_tenant():
|
||||
|
||||
@@ -178,6 +178,8 @@ def test_specialist_form_options_list_all_tenant_regions_like_web(monkeypatch):
|
||||
]
|
||||
assert out['transferTypes'] == [{'value': 'wx', 'label': '微信'}]
|
||||
assert out['currentUser'] == {'value': 'user-a', 'label': '本人'}
|
||||
# 当前登录人关联采集地区(新增协议单默认采集地区用)
|
||||
assert out['currentUserRegions'] == [{'value': 'ra', 'label': 'A区'}]
|
||||
assert '跨租户' not in str(out)
|
||||
|
||||
scoped = get_form_options(
|
||||
@@ -215,6 +217,44 @@ def test_specialist_form_options_list_all_tenant_regions_like_web(monkeypatch):
|
||||
]
|
||||
|
||||
|
||||
def test_form_options_current_user_regions_keep_staff_binding_order():
|
||||
"""多地区绑定时 currentUserRegions 按人员地区表顺序返回,供前端默认第一个。"""
|
||||
from app.services.market_support import get_form_options
|
||||
|
||||
db = _session()
|
||||
_seed_options(db)
|
||||
db.add(
|
||||
BizCollectionRegionStaff(
|
||||
id='rsa-b',
|
||||
region_id='rb',
|
||||
user_id='user-a',
|
||||
is_leader=0,
|
||||
order_num=20,
|
||||
tenant_no='tenant-a',
|
||||
create_dept_id='',
|
||||
del_flag=0,
|
||||
)
|
||||
)
|
||||
# 已有 rsa 绑定 ra;显式调高 order_num 保证 ra 在前
|
||||
rsa = db.query(BizCollectionRegionStaff).filter_by(id='rsa').one()
|
||||
rsa.order_num = 10
|
||||
db.commit()
|
||||
|
||||
out = get_form_options(db, module='protocol', ctx=_ctx(), user_info=_user())
|
||||
assert out['currentUserRegions'] == [
|
||||
{'value': 'ra', 'label': 'A区'},
|
||||
{'value': 'rb', 'label': 'B区'},
|
||||
]
|
||||
|
||||
unbound = get_form_options(
|
||||
db,
|
||||
module='protocol',
|
||||
ctx=_ctx('specialist', 'staff-unbound'),
|
||||
user_info=_user('staff-unbound'),
|
||||
)
|
||||
assert unbound['currentUserRegions'] == []
|
||||
|
||||
|
||||
def test_manager_form_options_list_all_tenant_regions_like_web():
|
||||
from app.services.market_support import get_form_options
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
"""纯函数单测:v1→v2 金额均分 / 退费判定(不连库)。"""
|
||||
from decimal import Decimal
|
||||
from types import SimpleNamespace
|
||||
|
||||
from scripts.migrate_protocol_payment_v1_to_v2 import (
|
||||
detail_has_refund,
|
||||
split_amount_across,
|
||||
)
|
||||
|
||||
|
||||
def test_split_amount_remainder_on_last():
|
||||
parts = split_amount_across(Decimal("100.00"), 3)
|
||||
assert parts == [Decimal("33.33"), Decimal("33.33"), Decimal("33.34")]
|
||||
assert sum(parts) == Decimal("100.00")
|
||||
|
||||
|
||||
def test_split_amount_none():
|
||||
assert split_amount_across(None, 2) == [None, None]
|
||||
|
||||
|
||||
def test_detail_has_refund_by_status():
|
||||
assert detail_has_refund(SimpleNamespace(
|
||||
pay_status="ytf",
|
||||
refund_amount=None,
|
||||
refund_attachments=None,
|
||||
refund_remark=None,
|
||||
refund_finance_confirm_attachments=None,
|
||||
refund_finance_remark=None,
|
||||
))
|
||||
|
||||
|
||||
def test_detail_has_refund_by_amount():
|
||||
assert detail_has_refund(SimpleNamespace(
|
||||
pay_status="yjf",
|
||||
refund_amount=Decimal("1.00"),
|
||||
refund_attachments=None,
|
||||
refund_remark=None,
|
||||
refund_finance_confirm_attachments=None,
|
||||
refund_finance_remark=None,
|
||||
))
|
||||
|
||||
|
||||
def test_detail_no_refund():
|
||||
assert not detail_has_refund(SimpleNamespace(
|
||||
pay_status="dfj",
|
||||
refund_amount=None,
|
||||
refund_attachments="",
|
||||
refund_remark="",
|
||||
refund_finance_confirm_attachments=None,
|
||||
refund_finance_remark=None,
|
||||
))
|
||||
@@ -0,0 +1,119 @@
|
||||
-- 采集协议单缴费 v1→v2 迁移 · 清单与校验(只读,不改数据)
|
||||
-- 实际迁移请用:backend/scripts/migrate_protocol_payment_v1_to_v2.py
|
||||
-- MySQL 5.7 / utf8mb4
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- 1) 仍为 v1 的协议概览
|
||||
-- ---------------------------------------------------------------------------
|
||||
SELECT
|
||||
p.id AS protocol_id,
|
||||
p.protocol_no,
|
||||
p.tenant_no,
|
||||
p.payment_model_version,
|
||||
(
|
||||
SELECT COUNT(*)
|
||||
FROM biz_protocol_sample s
|
||||
WHERE s.collection_protocol_id = p.id
|
||||
AND s.del_flag = 0
|
||||
AND IFNULL(s.sample_status, '') <> 'yzf'
|
||||
) AS active_sample_count,
|
||||
(
|
||||
SELECT COUNT(*)
|
||||
FROM biz_protocol_payment pay
|
||||
WHERE pay.collection_protocol_id = p.id AND pay.del_flag = 0
|
||||
) AS v1_payment_count,
|
||||
(
|
||||
SELECT COUNT(*)
|
||||
FROM biz_protocol_sample_payment sp
|
||||
WHERE sp.collection_protocol_id = p.id AND sp.del_flag = 0
|
||||
) AS v2_sample_payment_count
|
||||
FROM biz_collection_protocol p
|
||||
WHERE p.del_flag = 0
|
||||
AND p.payment_model_version = 1
|
||||
ORDER BY p.create_time;
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- 2) 人工清单候选:多样本
|
||||
-- ---------------------------------------------------------------------------
|
||||
SELECT
|
||||
p.id AS protocol_id,
|
||||
p.protocol_no,
|
||||
COUNT(s.id) AS active_sample_count,
|
||||
'multi_sample' AS skip_reason
|
||||
FROM biz_collection_protocol p
|
||||
INNER JOIN biz_protocol_sample s
|
||||
ON s.collection_protocol_id = p.id
|
||||
AND s.del_flag = 0
|
||||
AND IFNULL(s.sample_status, '') <> 'yzf'
|
||||
WHERE p.del_flag = 0
|
||||
AND p.payment_model_version = 1
|
||||
GROUP BY p.id, p.protocol_no
|
||||
HAVING COUNT(s.id) > 1;
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- 3) 人工清单候选:有退费痕迹的明细
|
||||
-- ---------------------------------------------------------------------------
|
||||
SELECT DISTINCT
|
||||
p.id AS protocol_id,
|
||||
p.protocol_no,
|
||||
d.id AS detail_id,
|
||||
d.pay_status,
|
||||
d.refund_amount,
|
||||
'has_refund' AS skip_reason
|
||||
FROM biz_collection_protocol p
|
||||
INNER JOIN biz_protocol_payment pay
|
||||
ON pay.collection_protocol_id = p.id AND pay.del_flag = 0
|
||||
INNER JOIN biz_protocol_payment_detail d
|
||||
ON d.payment_id = pay.id AND d.del_flag = 0
|
||||
WHERE p.del_flag = 0
|
||||
AND p.payment_model_version = 1
|
||||
AND (
|
||||
d.pay_status IN ('tfqrz', 'ytf')
|
||||
OR (d.refund_amount IS NOT NULL AND d.refund_amount > 0)
|
||||
OR IFNULL(d.refund_attachments, '') <> ''
|
||||
OR IFNULL(d.refund_remark, '') <> ''
|
||||
OR IFNULL(d.refund_finance_confirm_attachments, '') <> ''
|
||||
OR IFNULL(d.refund_finance_remark, '') <> ''
|
||||
);
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- 4) 可自动迁(单样本、有 v1 缴费、尚无 v2 方案)粗筛
|
||||
-- 注意:退费还需用第 3 节排除,本查询仅看样本数
|
||||
-- ---------------------------------------------------------------------------
|
||||
SELECT
|
||||
p.id AS protocol_id,
|
||||
p.protocol_no,
|
||||
s.sample_code,
|
||||
pay.contract_amount,
|
||||
pay.pay_mode
|
||||
FROM biz_collection_protocol p
|
||||
INNER JOIN biz_protocol_payment pay
|
||||
ON pay.collection_protocol_id = p.id AND pay.del_flag = 0
|
||||
INNER JOIN biz_protocol_sample s
|
||||
ON s.collection_protocol_id = p.id
|
||||
AND s.del_flag = 0
|
||||
AND IFNULL(s.sample_status, '') <> 'yzf'
|
||||
WHERE p.del_flag = 0
|
||||
AND p.payment_model_version = 1
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM biz_protocol_sample_payment sp
|
||||
WHERE sp.collection_protocol_id = p.id AND sp.del_flag = 0
|
||||
)
|
||||
GROUP BY p.id, p.protocol_no, s.sample_code, pay.contract_amount, pay.pay_mode
|
||||
HAVING COUNT(DISTINCT s.id) = 1;
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- 5) 迁移后抽样校验:某协议 v1 detail 金额合计 vs v2 transfer 金额合计
|
||||
-- 将 @pid 换成协议 ID
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- SET @pid := 'YOUR_PROTOCOL_ID';
|
||||
-- SELECT 'v1_detail' AS src, COUNT(*) AS cnt, IFNULL(SUM(transfer_amount), 0) AS amt
|
||||
-- FROM biz_protocol_payment_detail d
|
||||
-- INNER JOIN biz_protocol_payment pay ON pay.id = d.payment_id AND pay.del_flag = 0
|
||||
-- WHERE pay.collection_protocol_id = @pid AND d.del_flag = 0
|
||||
-- UNION ALL
|
||||
-- SELECT 'v2_transfer', COUNT(*), IFNULL(SUM(transfer_amount), 0)
|
||||
-- FROM biz_protocol_payment_transfer t
|
||||
-- WHERE t.collection_protocol_id = @pid AND t.del_flag = 0;
|
||||
@@ -0,0 +1,48 @@
|
||||
# 采集协议单保存自动提交财务 Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** 采集协议单新增/编辑保存成功后,自动将 `dfj` 转账/缴费明细提交财务确认(对齐预签约)。
|
||||
|
||||
**Architecture:** 保存 create/update 后用 `protocolId` 回查详情,展平 v2 transfers 或取 v1 paymentDetails,复用 `submitDfjTransfersOnSave` 逐笔调用独立提交接口;失败不回滚协议,仅警告。历史 v1→v2 迁移不在本期。
|
||||
|
||||
**Tech Stack:** Vue 3 + TypeScript(web-admin)、现有 `presign-save-auto-submit.ts`、collection-protocol / protocol-sample-payment API
|
||||
|
||||
**Spec:** `docs/superpowers/specs/2026-10-15-protocol-save-auto-submit-and-v1-to-v2-migration-design.md`
|
||||
|
||||
---
|
||||
|
||||
### Task 1: 泛化自动提交工具文案
|
||||
|
||||
**Files:**
|
||||
- Modify: `web-admin/src/utils/presign-save-auto-submit.ts`
|
||||
- Modify: `web-admin/src/utils/presign-save-auto-submit.test.ts`
|
||||
|
||||
- [x] **Step 1:** `formatAutoSubmitFinanceFailureMessage(failures, entityLabel = '订单')` → `「${entityLabel}已保存,但有 N 笔…」`
|
||||
- [x] **Step 2:** 新增 `flattenSamplePaymentTransfers(samplePayments)` 返回带 `id`/`payStatus` 的 transfer 列表
|
||||
- [x] **Step 3:** 单测覆盖新文案与 flatten;预签约旧断言仍用默认「订单」
|
||||
- [x] **Step 4:** 跑测试通过
|
||||
|
||||
### Task 2: API 支持关闭成功 toast
|
||||
|
||||
**Files:**
|
||||
- Modify: `web-admin/src/api/protocol-sample-payment.ts` — `fetchSubmitPaymentTransferFinance`
|
||||
- Modify: `web-admin/src/api/collection-protocol.ts` — `fetchSubmitReceiptFinance`
|
||||
|
||||
- [x] **Step 1:** 增加可选 `options?: { showSuccessMessage?: boolean }`,默认 true(与预签约一致)
|
||||
|
||||
### Task 3: ProtocolFormDialog 保存后自动提交
|
||||
|
||||
**Files:**
|
||||
- Modify: `web-admin/src/views/cell-storage/protocol/ProtocolFormDialog.vue`
|
||||
|
||||
- [x] **Step 1:** create/update 取返回 `id`(编辑用 `editingId`)
|
||||
- [x] **Step 2:** `fetchCollectionProtocolDetail(id)` 回查
|
||||
- [x] **Step 3:** v2 → flatten `samplePayments` transfers;v1 → `paymentDetails`
|
||||
- [x] **Step 4:** `submitDfjTransfersOnSave` + 对应 submit API(`showSuccessMessage: false`)
|
||||
- [x] **Step 5:** 有 failures 则 `ElMessage.warning(format…(failures, '协议'))`;关窗 `emit('saved')`
|
||||
|
||||
### Task 4: 验证
|
||||
|
||||
- [x] 跑 `presign-save-auto-submit` 单测
|
||||
- [x] 必要时 `./scripts/update-graph.sh frontend`
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
# 采集协议单 · 保存自动提交财务(+ 历史 v1→v2 迁移备忘)
|
||||
|
||||
**日期:** 2026-10-15
|
||||
**范围:**
|
||||
- **本期交付:** `web-admin` 采集协议单新增/编辑弹窗 — 保存时自动提交财务
|
||||
- **历史迁移:** 独立脚本,**不纳入本期开发/上线必跑**;后续专门处理生产数据(可含人工拆分)
|
||||
**状态:** 已确认设计(迁移策略见备忘,本期只做自动提交)
|
||||
|
||||
## 1. 背景与目标
|
||||
|
||||
1. **预签约订单**保存时会把 `dfj` 意向金转账自动提交财务确认;**采集协议单**目前不会,需对齐。
|
||||
2. 历史协议多为 v1(整单缴费),新单为 v2(按样本)。统一到 v2 有价值,但生产数据可能需手动拆分,故迁移与本期功能解耦。
|
||||
|
||||
## 2. 已确认决策
|
||||
|
||||
| 项 | 决策 |
|
||||
|----|------|
|
||||
| 保存自动提交 | **本期做**;对齐预签约 |
|
||||
| 自动提交范围 | **v2 transfer + v1 payment_detail** 中 `payStatus === 'dfj'` 且已有 id 的笔 |
|
||||
| 后端 save 顺带改状态 | **不做**;仍走独立「提交财务确认」接口(前端编排) |
|
||||
| v1→v2 迁移脚本 | **独立后续事项**;不阻塞本期;不作为本次发版必跑 SQL |
|
||||
| 多样本拆分原则(迁移备忘) | 合同金额 **平均分**;缴费记录金额 **平均分**(见 §4) |
|
||||
| 有退费 / 复杂单 | 迁移时优先人工处理 |
|
||||
| 本需求是否下线 v1 UI | **否** |
|
||||
|
||||
## 3. 本期交付 — 保存时自动提交财务
|
||||
|
||||
**改动点:** `web-admin/src/views/cell-storage/protocol/ProtocolFormDialog.vue` 的保存成功路径。
|
||||
|
||||
**流程:**
|
||||
|
||||
1. 校验并通过 create/update 保存协议(含缴费草稿落库)。
|
||||
2. 取得 `protocolId`(编辑用已有 id;新建用接口返回的 `id`)。
|
||||
3. 按 `paymentModelVersion` 回查可提交笔:
|
||||
- **v2:** 回查 sample-payments bundle,展平 `schedules[].transfers`,筛 `id` 且 `payStatus === 'dfj'`。
|
||||
- **v1:** 回查 `paymentDetails`,筛 `id` 且 `payStatus === 'dfj'`。
|
||||
4. 逐笔调用:
|
||||
- v2:`fetchSubmitPaymentTransferFinance`(关闭单笔成功 toast)。
|
||||
- v1:`fetchSubmitReceiptFinance`(关闭单笔成功 toast)。
|
||||
5. 复用/泛化 `presign-save-auto-submit.ts`:
|
||||
- `submitDfjTransfersOnSave` / `collectDfjTransferIds` 保持通用。
|
||||
- `formatAutoSubmitFinanceFailureMessage` 支持文案主体(「订单」/「协议」)。
|
||||
6. 部分失败:协议仍算保存成功;警告
|
||||
`协议已保存,但有 N 笔提交财务确认失败:…`;关弹窗并 `emit('saved')`。
|
||||
7. 行上「提交财务确认 / 撤回」保留。
|
||||
|
||||
**不做:**
|
||||
|
||||
- 不在协议 create/update 后端内自动改 `pay_status`。
|
||||
- 不提交非 `dfj` 笔;不提交无 id 的纯前端草稿(保存后回查即可)。
|
||||
- **本期不写、不跑** v1→v2 迁移 SQL。
|
||||
|
||||
### 测试要点(本期)
|
||||
|
||||
- 新建 v2 带完整 `dfj` 转账 → 保存后变 `jfqrz`,财务确认列表可见
|
||||
- 编辑已有 `dfj` → 自动提交;`jfqrz`/`yjf` 不重复提交
|
||||
- 缺转账方式/金额 → 协议保存成功 + 失败警告
|
||||
- 仍有的 v1 单编辑保存 → `dfj` detail 自动提交
|
||||
|
||||
## 4. 后续备忘 — 独立迁移脚本(生产专用)
|
||||
|
||||
> 本节仅作产品/技术备忘,**不纳入本期实现计划**。后续单独开任务:清单导出、脚本、人工拆分流程。
|
||||
|
||||
### 4.1 交付形态(已落地)
|
||||
|
||||
- Python:`backend/scripts/migrate_protocol_payment_v1_to_v2.py`
|
||||
支持 `--list-only` / `--dry-run` / 默认单样本迁移 / `--multi-average` 多样本均分。
|
||||
- 只读清单 SQL:`docs/sql/migrations/2026-10-15-protocol-payment-v1-to-v2-checklist.sql`
|
||||
- 迁后保留 v1 表数据(不物理删),改 `payment_model_version=2`。
|
||||
- **不上线自动跑**;生产由人工在窗口期执行。
|
||||
|
||||
### 4.2 多样本推荐拆分规则(平均分)
|
||||
|
||||
相对「全部挂第一样本」,**合同金额与缴费金额都按样本数平均分**更符合「按样本缴费」语义,后续建议采用。
|
||||
|
||||
设有效样本数 `N`,金额用「分」运算,**余数落在最后一个样本**,保证合计不变。
|
||||
|
||||
| 字段 | 规则 |
|
||||
|------|------|
|
||||
| 各样本 `contract_amount` | `floor(总合同×100/N)/100`,末样本吃余数 |
|
||||
| 各期 `due_amount` | 同上,按期对总应缴均分到 N 个 schedule |
|
||||
| 每笔转账 `transfer_amount` | 原金额均分为 N 笔(每样本一期各一笔),状态/方式/时间/凭证 URL **复制**;`remark` 注明 `拆自原明细:{old_detail_id}` |
|
||||
|
||||
**注意(财务凭证):**
|
||||
|
||||
- 银行侧往往是 **一笔到账**;均分后库内变成 N 笔同凭证、金额 1/N,适合「历史已确认数据的展示与合计」,不适合再拿去当新的财务确认依据。
|
||||
- 因此生产执行时建议:
|
||||
- **已确认(`yjf`)**:可按平均分批量生成(展示/统计对齐)。
|
||||
- **待缴/确认中(`dfj`/`jfqrz`)**:优先人工拆分或确认后再迁,避免财务按拆后多笔重复审核。
|
||||
- **有退费**:一律人工清单,不自动拆。
|
||||
|
||||
### 4.3 单样本 / 退费
|
||||
|
||||
- 单样本无退费:可脚本直迁(1:1 映射 schedule/transfer)。
|
||||
- 有退费痕迹(`tfqrz`/`ytf`、退费金额或附件非空等):只进人工清单。
|
||||
|
||||
## 5. 错误处理(本期自动提交)
|
||||
|
||||
| 场景 | 行为 |
|
||||
|------|------|
|
||||
| 保存成功、部分自动提交失败 | 警告;不回滚协议 |
|
||||
| 回查无 `dfj` 笔 | 静默成功关窗 |
|
||||
|
||||
## 6. 非目标
|
||||
|
||||
- 不在发版流水线中自动执行迁移;生产需人工确认后跑脚本
|
||||
- 不删除 v1 表、不下线 v1 表单分支
|
||||
- 不改小程序付款模型
|
||||
|
||||
## 7. 参考实现
|
||||
|
||||
- 预签约自动提交:`PresignOrderFormDialog.vue` + `presign-save-auto-submit.ts`
|
||||
- v1 按期归组:`ProtocolViewDialog.vue` → `v1PayPeriods`
|
||||
- 表结构:`docs/sql/biz_per_sample_payment_presign.sql`
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 微信公众平台须为对应环境配置 request / 业务域名(HTTPS)
|
||||
*/
|
||||
export const APP_ENV = 'test' // 'local' | 'test' | 'prod'
|
||||
export const APP_ENV = 'local' // 'local' | 'test' | 'prod'
|
||||
|
||||
const ENV_PRESETS = {
|
||||
local: {
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
v-for="action in normalizedActions"
|
||||
:key="action.actionKey || action.code"
|
||||
class="market-bottom-bar__button"
|
||||
:type="action.primary ? 'primary' : 'default'"
|
||||
:type="action.buttonType"
|
||||
:plain="action.plain"
|
||||
:disabled="action.disabled || loading"
|
||||
:loading="loading && (action.actionKey || action.code) === loadingAction"
|
||||
round
|
||||
@click="$emit('action', action)"
|
||||
>
|
||||
{{ action.label }}
|
||||
@@ -37,6 +37,15 @@ const ACTION_LABELS = {
|
||||
unlink: '取消样本关联'
|
||||
}
|
||||
|
||||
const DANGER_CODES = new Set([
|
||||
'delete',
|
||||
'unlink',
|
||||
'delete-transfer',
|
||||
'delete-payment-transfer'
|
||||
])
|
||||
|
||||
const SOFT_CODES = new Set(['withdraw', 'withdraw-transfer'])
|
||||
|
||||
const props = defineProps({
|
||||
allowedActions: { type: Array, default: () => [] },
|
||||
loading: { type: Boolean, default: false },
|
||||
@@ -45,28 +54,41 @@ const props = defineProps({
|
||||
|
||||
defineEmits(['action'])
|
||||
|
||||
function resolveButtonTone(code, primary) {
|
||||
if (primary) return { buttonType: 'primary', plain: false }
|
||||
if (DANGER_CODES.has(code)) return { buttonType: 'danger', plain: true }
|
||||
if (SOFT_CODES.has(code)) return { buttonType: 'warning', plain: false }
|
||||
return { buttonType: 'default', plain: true }
|
||||
}
|
||||
|
||||
const normalizedActions = computed(() =>
|
||||
props.allowedActions
|
||||
.map((action, index) => {
|
||||
if (typeof action === 'string') {
|
||||
const code = action
|
||||
const primary = index === 0
|
||||
const tone = resolveButtonTone(code, primary)
|
||||
return {
|
||||
code: action,
|
||||
label: ACTION_LABELS[action] || action,
|
||||
primary: index === 0,
|
||||
disabled: false
|
||||
code,
|
||||
label: ACTION_LABELS[code] || code,
|
||||
primary,
|
||||
disabled: false,
|
||||
...tone
|
||||
}
|
||||
}
|
||||
const code = String(action?.code || action?.action || '').trim()
|
||||
if (!code) return null
|
||||
const primary = action.primary ?? index === 0
|
||||
const tone = resolveButtonTone(code, primary)
|
||||
return {
|
||||
...action,
|
||||
code,
|
||||
label: action.label || ACTION_LABELS[code] || code,
|
||||
primary: action.primary ?? index === 0,
|
||||
disabled: Boolean(action.disabled)
|
||||
primary,
|
||||
disabled: Boolean(action.disabled),
|
||||
...tone
|
||||
}
|
||||
})
|
||||
.filter(Boolean)
|
||||
)
|
||||
</script>
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
</template>
|
||||
</div>
|
||||
<div class="market-filter-sheet__actions">
|
||||
<van-button block round @click="reset">重置</van-button>
|
||||
<van-button block round type="primary" color="#0a9f6d" @click="apply">确定</van-button>
|
||||
<van-button block plain @click="reset">重置</van-button>
|
||||
<van-button block type="primary" color="#0a9f6d" @click="apply">确定</van-button>
|
||||
</div>
|
||||
|
||||
<van-popup v-model:show="selectVisible" position="bottom" round>
|
||||
|
||||
@@ -22,7 +22,19 @@
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="field.type === 'select' || field.type === 'multi-select'" class="market-form-field__control">
|
||||
<PresignSelectField
|
||||
v-if="field.searchable"
|
||||
:model-value="modelValue"
|
||||
:options="options"
|
||||
:multiple="field.type === 'multi-select'"
|
||||
:disabled="disabled || field.readOnly"
|
||||
searchable
|
||||
:title="`选择${field.label}`"
|
||||
:placeholder="options.length ? '请选择' : '暂无可选数据'"
|
||||
@update:model-value="update"
|
||||
/>
|
||||
<OaSelectField
|
||||
v-else
|
||||
:model-value="modelValue"
|
||||
:options="options"
|
||||
:multiple="field.type === 'multi-select'"
|
||||
@@ -88,6 +100,7 @@ import {
|
||||
PROTOCOL_ATTACHMENT_MAX_BYTES
|
||||
} from '../attachment-upload-policy.js'
|
||||
import MarketAttachmentCards from './MarketAttachmentCards.vue'
|
||||
import PresignSelectField from './PresignSelectField.vue'
|
||||
import ProtocolCustomerSearchField from './ProtocolCustomerSearchField.vue'
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@@ -64,7 +64,10 @@ const emit = defineEmits(['update:modelValue', 'upload', 'field-change', 'custom
|
||||
const value = computed(() => props.modelValue || {})
|
||||
const rows = computed(() => Array.isArray(props.modelValue) ? props.modelValue : [])
|
||||
const visibleFields = computed(() => (props.section.fields || []).filter(
|
||||
(field) => (!field.source || field.source === props.source) && !(field.createOnly && props.mode !== 'create')
|
||||
(field) =>
|
||||
!field.hidden &&
|
||||
(!field.source || field.source === props.source) &&
|
||||
!(field.createOnly && props.mode !== 'create')
|
||||
))
|
||||
|
||||
function fieldOptions(field, rowIndex = -1) {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
<div class="market-list-card__fields">
|
||||
<div
|
||||
v-for="field in card.fields"
|
||||
v-for="field in previewFields"
|
||||
:key="`${field.label}:${field.value}`"
|
||||
class="market-list-card__field"
|
||||
:class="{ 'is-wide': field.wide }"
|
||||
@@ -33,6 +33,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 每一期缴费:始终展示在「展开更多」上方,不收进总折叠 -->
|
||||
<div v-if="card.periodBlocks?.length" class="market-list-card__periods">
|
||||
<div
|
||||
v-for="block in card.periodBlocks"
|
||||
@@ -74,7 +75,38 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="card.footerFields?.length" class="market-list-card__fields">
|
||||
<div
|
||||
v-if="useFieldFold"
|
||||
class="market-list-card__fields-fold"
|
||||
:class="{ 'is-open': fieldsOpen }"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="market-list-card__fields-toggle"
|
||||
:aria-expanded="fieldsOpen ? 'true' : 'false'"
|
||||
:aria-label="fieldsOpen ? '收起更多信息' : '展开更多信息'"
|
||||
@click="fieldsOpen = !fieldsOpen"
|
||||
>
|
||||
<span class="market-list-card__fields-toggle-title">
|
||||
{{ fieldsOpen ? '收起' : `展开更多(${foldHiddenCount})` }}
|
||||
</span>
|
||||
<van-icon class="market-list-card__fields-toggle-chevron" name="arrow-down" />
|
||||
</button>
|
||||
<div v-show="fieldsOpen && collapsedFields.length" class="market-list-card__fields market-list-card__fields--folded">
|
||||
<div
|
||||
v-for="field in collapsedFields"
|
||||
:key="`more:${field.label}:${field.value}`"
|
||||
class="market-list-card__field"
|
||||
:class="{ 'is-wide': field.wide }"
|
||||
>
|
||||
<span>{{ field.label }}</span>
|
||||
<van-tag v-if="field.tag" class="market-tag" :type="field.tagType || resolveStatusTone(field.value)" size="medium" round :title="field.value">{{ field.value }}</van-tag>
|
||||
<b v-else :class="{ 'is-money': field.money }">{{ field.value }}</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="card.footerFields?.length && showFoldedFooter" class="market-list-card__fields">
|
||||
<div
|
||||
v-for="field in card.footerFields"
|
||||
:key="`footer:${field.label}:${field.value}`"
|
||||
@@ -152,11 +184,11 @@
|
||||
|
||||
<footer v-if="!selectionMode" class="market-list-card__actions">
|
||||
<van-button
|
||||
v-for="action in card.actions"
|
||||
v-for="action in orderedActions"
|
||||
:key="action"
|
||||
size="small"
|
||||
:type="action === 'view' || action === 'view-payment-detail' ? 'primary' : action === 'delete' || action === 'unlink' ? 'danger' : 'default'"
|
||||
:plain="action !== 'view' && action !== 'view-payment-detail'"
|
||||
:type="actionButtonType(action)"
|
||||
:plain="!isPrimaryAction(action)"
|
||||
@click="$emit('action', action, item)"
|
||||
>{{ actionLabel(action) }}</van-button>
|
||||
</footer>
|
||||
@@ -180,11 +212,60 @@ const props = defineProps({
|
||||
|
||||
defineEmits(['action', 'toggle-select'])
|
||||
|
||||
/** 协议 / 催缴 / 缴费:默认展示前 4 项,中间折叠;缴费期次始终在折叠上方 */
|
||||
const FIELD_PREVIEW_COUNT = 4
|
||||
const FIELD_FOLD_MODULES = new Set(['protocol', 'payment-chase', 'payment'])
|
||||
|
||||
const card = computed(() => buildMarketCard(props.module, props.role, props.item))
|
||||
const statusTone = computed(() => card.value.statusTone || resolveStatusTone(card.value.status))
|
||||
const allFields = computed(() => (Array.isArray(card.value.fields) ? card.value.fields : []))
|
||||
const footerFieldCount = computed(() =>
|
||||
Array.isArray(card.value.footerFields) ? card.value.footerFields.length : 0
|
||||
)
|
||||
const useFieldFold = computed(() => {
|
||||
if (!FIELD_FOLD_MODULES.has(props.module)) return false
|
||||
return allFields.value.length > FIELD_PREVIEW_COUNT || footerFieldCount.value > 0
|
||||
})
|
||||
const previewFields = computed(() =>
|
||||
useFieldFold.value ? allFields.value.slice(0, FIELD_PREVIEW_COUNT) : allFields.value
|
||||
)
|
||||
const collapsedFields = computed(() =>
|
||||
useFieldFold.value ? allFields.value.slice(FIELD_PREVIEW_COUNT) : []
|
||||
)
|
||||
/** 缴费底部汇总随「展开更多」显示;期次块始终外置 */
|
||||
const showFoldedFooter = computed(() =>
|
||||
props.module !== 'payment' || !useFieldFold.value || fieldsOpen.value
|
||||
)
|
||||
const foldHiddenCount = computed(() => {
|
||||
let count = collapsedFields.value.length
|
||||
if (props.module === 'payment' && useFieldFold.value) {
|
||||
count += footerFieldCount.value
|
||||
}
|
||||
return count
|
||||
})
|
||||
const fieldsOpen = ref(false)
|
||||
const samplesOpen = ref(false)
|
||||
const periodOpenKeys = ref({})
|
||||
|
||||
const PRIMARY_ACTIONS = new Set(['view', 'view-payment-detail', 'view-payment', 'view-protocol'])
|
||||
const DANGER_ACTIONS = new Set(['delete', 'unlink'])
|
||||
|
||||
function isPrimaryAction(action) {
|
||||
return PRIMARY_ACTIONS.has(action)
|
||||
}
|
||||
|
||||
function actionButtonType(action) {
|
||||
if (isPrimaryAction(action)) return 'primary'
|
||||
if (DANGER_ACTIONS.has(action)) return 'danger'
|
||||
return 'default'
|
||||
}
|
||||
|
||||
/** 主操作靠右:次要/危险在前,primary 在后 */
|
||||
const orderedActions = computed(() => {
|
||||
const actions = Array.isArray(card.value.actions) ? [...card.value.actions] : []
|
||||
return actions.sort((a, b) => Number(isPrimaryAction(a)) - Number(isPrimaryAction(b)))
|
||||
})
|
||||
|
||||
function togglePeriod(key) {
|
||||
periodOpenKeys.value = {
|
||||
...periodOpenKeys.value,
|
||||
@@ -195,6 +276,7 @@ function togglePeriod(key) {
|
||||
watch(
|
||||
() => props.item?.id || props.index,
|
||||
() => {
|
||||
fieldsOpen.value = false
|
||||
samplesOpen.value = false
|
||||
periodOpenKeys.value = {}
|
||||
}
|
||||
|
||||
@@ -16,26 +16,43 @@
|
||||
</button>
|
||||
|
||||
<dl class="presign-order-card__fields">
|
||||
<div v-for="field in detailFields" :key="field.key" class="presign-order-card__field">
|
||||
<div v-for="field in previewFields" :key="field.key" class="presign-order-card__field">
|
||||
<dt>{{ field.label }}</dt>
|
||||
<dd :class="{ 'is-money': field.money }">{{ field.value }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<div
|
||||
v-if="collapsedFields.length"
|
||||
class="presign-order-card__fields-fold"
|
||||
:class="{ 'is-open': fieldsOpen }"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="presign-order-card__fields-toggle"
|
||||
:aria-expanded="fieldsOpen ? 'true' : 'false'"
|
||||
:aria-label="fieldsOpen ? '收起更多信息' : '展开更多信息'"
|
||||
@click.stop="fieldsOpen = !fieldsOpen"
|
||||
>
|
||||
<span>{{ fieldsOpen ? '收起' : `展开更多(${collapsedFields.length})` }}</span>
|
||||
<van-icon class="presign-order-card__fields-toggle-chevron" name="arrow-down" />
|
||||
</button>
|
||||
<dl v-show="fieldsOpen" class="presign-order-card__fields presign-order-card__fields--folded">
|
||||
<div v-for="field in collapsedFields" :key="`more:${field.key}`" class="presign-order-card__field">
|
||||
<dt>{{ field.label }}</dt>
|
||||
<dd :class="{ 'is-money': field.money }">{{ field.value }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<footer v-if="card.actions.length" class="presign-order-card__actions">
|
||||
<van-button
|
||||
v-if="can('edit')"
|
||||
plain
|
||||
:disabled="Boolean(pendingAction)"
|
||||
:loading="pendingAction === 'edit'"
|
||||
@click.stop="handleAction('edit')"
|
||||
>编辑</van-button>
|
||||
<van-button
|
||||
v-if="can('convert')"
|
||||
type="primary"
|
||||
:disabled="Boolean(pendingAction)"
|
||||
:loading="pendingAction === 'convert'"
|
||||
@click.stop="handleAction('convert')"
|
||||
>转正式</van-button>
|
||||
<van-button
|
||||
v-if="can('delete')"
|
||||
type="danger"
|
||||
@@ -44,17 +61,27 @@
|
||||
:loading="pendingAction === 'delete'"
|
||||
@click.stop="handleAction('delete')"
|
||||
>删除</van-button>
|
||||
<van-button
|
||||
v-if="can('convert')"
|
||||
type="primary"
|
||||
:disabled="Boolean(pendingAction)"
|
||||
:loading="pendingAction === 'convert'"
|
||||
@click.stop="handleAction('convert')"
|
||||
>转正式</van-button>
|
||||
</footer>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import {
|
||||
buildPresignCardModel,
|
||||
presignCardActionEvent
|
||||
} from '../presign/presign-list-model.js'
|
||||
|
||||
/** 默认展示两行(4 项),其余折叠 */
|
||||
const FIELD_PREVIEW_COUNT = 4
|
||||
|
||||
const props = defineProps({
|
||||
item: { type: Object, required: true },
|
||||
index: { type: Number, required: true },
|
||||
@@ -68,6 +95,20 @@ const statusField = computed(() => card.value.fields.find((field) => field.key =
|
||||
const detailFields = computed(() => card.value.fields.filter(
|
||||
(field) => !['motherName', 'orderStatus'].includes(field.key)
|
||||
))
|
||||
const previewFields = computed(() => detailFields.value.slice(0, FIELD_PREVIEW_COUNT))
|
||||
const collapsedFields = computed(() =>
|
||||
detailFields.value.length > FIELD_PREVIEW_COUNT
|
||||
? detailFields.value.slice(FIELD_PREVIEW_COUNT)
|
||||
: []
|
||||
)
|
||||
const fieldsOpen = ref(false)
|
||||
|
||||
watch(
|
||||
() => props.item?.id || props.index,
|
||||
() => {
|
||||
fieldsOpen.value = false
|
||||
}
|
||||
)
|
||||
|
||||
function can(action) {
|
||||
return card.value.actions.includes(action)
|
||||
|
||||
@@ -232,7 +232,8 @@ function removeAttachment(index) {
|
||||
height: 28px;
|
||||
padding: 0 8px;
|
||||
font-size: 12px;
|
||||
border-radius: 7px;
|
||||
border-radius: 8px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.presign-transfer-card__delete {
|
||||
|
||||
@@ -39,16 +39,12 @@
|
||||
@click="pick(item)"
|
||||
>
|
||||
<strong>{{ item.customerName || '—' }}</strong>
|
||||
<span>{{ item.phoneNo || '无电话' }}</span>
|
||||
<span>{{ item.phoneNo || '无电话' }} · {{ maskIdCard(item.idCardNo) }}</span>
|
||||
</button>
|
||||
<van-empty
|
||||
v-if="!loading && searched && !results.length"
|
||||
description="未找到客户档案"
|
||||
/>
|
||||
<van-empty
|
||||
v-else-if="!loading && !searched"
|
||||
description="输入关键字检索客户档案"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</van-popup>
|
||||
@@ -77,13 +73,20 @@ let searchSeq = 0
|
||||
|
||||
const controlId = `market-customer-${useId().replace(/[^a-zA-Z0-9_-]/g, '')}`
|
||||
|
||||
function maskIdCard(raw) {
|
||||
const text = String(raw || '').trim()
|
||||
if (!text) return '无证件号'
|
||||
if (text.length < 8) return text
|
||||
return `${text.slice(0, 4)}****${text.slice(-4)}`
|
||||
}
|
||||
|
||||
function open() {
|
||||
if (props.disabled) return
|
||||
keyword.value = String(props.modelValue || '').trim()
|
||||
results.value = []
|
||||
searched.value = false
|
||||
show.value = true
|
||||
if (keyword.value) runSearch(keyword.value)
|
||||
runSearch(keyword.value)
|
||||
}
|
||||
|
||||
function onKeyword(value) {
|
||||
@@ -93,12 +96,6 @@ function onKeyword(value) {
|
||||
|
||||
async function runSearch(kw) {
|
||||
const seq = ++searchSeq
|
||||
if (!kw) {
|
||||
results.value = []
|
||||
searched.value = false
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
loading.value = true
|
||||
try {
|
||||
const list = await props.search(kw)
|
||||
@@ -143,7 +140,7 @@ onBeforeUnmount(() => {
|
||||
min-width: 64px;
|
||||
min-height: 44px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid #a7f3d0;
|
||||
border: 0;
|
||||
border-radius: 8px;
|
||||
background: #e9f9f2;
|
||||
color: #0a9f6d;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,27 +1,61 @@
|
||||
<template>
|
||||
<section class="market-form-section protocol-sample-transport">
|
||||
<div class="protocol-sample-transport__toolbar">
|
||||
<h2>样本及运输</h2>
|
||||
<div class="protocol-sample-transport__actions">
|
||||
<van-button size="mini" type="primary" plain :disabled="disabled" @click="openAdd">
|
||||
添加样本
|
||||
</van-button>
|
||||
<van-button size="mini" type="primary" plain :disabled="disabled" @click="openFreightConfig">
|
||||
配置运费
|
||||
</van-button>
|
||||
<van-button size="mini" type="warning" plain :disabled="disabled" @click="unlinkFreight">
|
||||
取消运费
|
||||
</van-button>
|
||||
<div>
|
||||
<h2>样本及运输</h2>
|
||||
<p class="protocol-sample-transport__hint">勾选样本后可批量配置 / 取消运费</p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="protocol-sample-transport__hint">规则与管理端「样本及运输」一致</p>
|
||||
|
||||
<van-empty v-if="!samples.length" description="请添加样本" image-size="48" />
|
||||
<div v-if="samples.length" class="protocol-sample-transport__sum">
|
||||
<div class="protocol-sample-transport__sum-item">
|
||||
<span class="k">样本</span>
|
||||
<span class="v">{{ samples.length }}</span>
|
||||
</div>
|
||||
<div v-if="showPrice" class="protocol-sample-transport__sum-item">
|
||||
<span class="k">优惠价合计</span>
|
||||
<span class="v">{{ formatMoney(priceSum) }}</span>
|
||||
</div>
|
||||
<div class="protocol-sample-transport__sum-item" :class="{ 'is-warn': pendingFreightCount > 0 }">
|
||||
<span class="k">待配运费</span>
|
||||
<span class="v">{{ pendingFreightCount }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="protocol-sample-transport__actions">
|
||||
<van-button size="mini" type="primary" :disabled="disabled" @click="openAdd">
|
||||
添加样本
|
||||
</van-button>
|
||||
<van-button size="mini" type="primary" plain :disabled="disabled" @click="openFreightConfig">
|
||||
配置运费
|
||||
</van-button>
|
||||
<van-button size="mini" type="warning" :disabled="disabled" @click="unlinkFreight">
|
||||
取消运费
|
||||
</van-button>
|
||||
</div>
|
||||
|
||||
<div v-if="checkedCount > 0" class="protocol-sample-transport__sel">
|
||||
<span>已选 {{ checkedCount }} 个样本</span>
|
||||
<button type="button" class="protocol-sample-transport__sel-link" :disabled="disabled" @click="openFreightConfig">
|
||||
去配置运费 ›
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="!samples.length" class="protocol-sample-transport__empty">
|
||||
<p>还没有样本,添加后可配置运输与缴费</p>
|
||||
<van-button size="mini" type="primary" :disabled="disabled" @click="openAdd">
|
||||
添加第一个样本
|
||||
</van-button>
|
||||
</div>
|
||||
|
||||
<article
|
||||
v-for="(row, index) in samples"
|
||||
:key="row.id || row._key || index"
|
||||
class="protocol-sample-transport__card"
|
||||
:class="{
|
||||
'is-checked': Boolean(row._checked),
|
||||
'is-alert': !freightDisplay(row).modeLabel
|
||||
}"
|
||||
>
|
||||
<header class="protocol-sample-transport__card-head">
|
||||
<van-checkbox
|
||||
@@ -29,19 +63,37 @@
|
||||
:disabled="disabled"
|
||||
@update:model-value="(v) => patchRow(index, { _checked: v })"
|
||||
>
|
||||
{{ row.sampleCode || `样本 ${index + 1}` }}
|
||||
<span class="protocol-sample-transport__code">{{ row.sampleCode || `样本 ${index + 1}` }}</span>
|
||||
</van-checkbox>
|
||||
<van-tag class="market-tag" type="primary" round>{{ statusLabel(row.sampleStatus) }}</van-tag>
|
||||
</header>
|
||||
<div class="protocol-sample-transport__meta">
|
||||
<span>{{ typeLabel(row.sampleTypeId) }}</span>
|
||||
<span v-if="showPrice">优惠价 {{ formatMoney(row.price) }}</span>
|
||||
<span v-if="freightDisplay(row).modeLabel">
|
||||
<div class="protocol-sample-transport__type-row">
|
||||
<span class="protocol-sample-transport__type">{{ typeLabel(row.sampleTypeId) }}</span>
|
||||
<span v-if="Number(row.isSpecial) === 1" class="protocol-sample-transport__special">特殊样本</span>
|
||||
</div>
|
||||
<div class="protocol-sample-transport__metrics">
|
||||
<div v-if="showPrice" class="protocol-sample-transport__metric">
|
||||
<span class="k">优惠价</span>
|
||||
<span class="v is-money">{{ formatMoney(row.price) }}</span>
|
||||
</div>
|
||||
<div v-if="showPrice" class="protocol-sample-transport__metric">
|
||||
<span class="k">存储年限</span>
|
||||
<span class="v">{{ row.storageYears != null && row.storageYears !== '' ? `${row.storageYears} 年` : '—' }}</span>
|
||||
</div>
|
||||
<div class="protocol-sample-transport__metric is-span2">
|
||||
<span class="k">预计到达</span>
|
||||
<span class="v" :class="{ 'is-muted': !row.etaTime }">{{ row.etaTime || '未填写' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="protocol-sample-transport__freight"
|
||||
:class="{ 'is-none': !freightDisplay(row).modeLabel }"
|
||||
>
|
||||
<template v-if="freightDisplay(row).modeLabel">
|
||||
{{ freightDisplay(row).modeLabel }}
|
||||
· {{ formatMoney(freightDisplay(row).amount) }}{{ freightDisplay(row).shared ? '(共用)' : '' }}
|
||||
</span>
|
||||
<span v-else class="is-muted">未配置运费</span>
|
||||
<span v-if="row.etaTime">ETA {{ row.etaTime }}</span>
|
||||
</template>
|
||||
<template v-else>未配置运费 — 勾选后点「配置运费」</template>
|
||||
</div>
|
||||
<div class="protocol-sample-transport__row-actions">
|
||||
<van-button size="mini" plain :disabled="disabled" @click="openEdit(index)">编辑</van-button>
|
||||
@@ -54,79 +106,107 @@
|
||||
<van-popup v-model:show="editorVisible" position="bottom" round :style="{ maxHeight: '88%' }">
|
||||
<div class="protocol-sample-transport__editor">
|
||||
<h3>{{ editorIndex < 0 ? '添加样本' : '编辑样本' }}</h3>
|
||||
<van-field
|
||||
:model-value="typeLabel(draft.sampleTypeId)"
|
||||
is-link
|
||||
readonly
|
||||
label="样本类型"
|
||||
placeholder="请选择"
|
||||
required
|
||||
@click="openTypeSheet"
|
||||
/>
|
||||
<van-field
|
||||
v-if="autoGenerateCode"
|
||||
:model-value="draft.sampleCode || '保存后自动生成'"
|
||||
readonly
|
||||
label="样本编码"
|
||||
/>
|
||||
<van-field
|
||||
v-else
|
||||
:model-value="codeLabel(draft.sampleCodeId, draft.sampleCode)"
|
||||
is-link
|
||||
readonly
|
||||
label="样本编码"
|
||||
placeholder="请选择"
|
||||
required
|
||||
@click="openCodeSheet"
|
||||
/>
|
||||
<template v-if="showPrice">
|
||||
<van-field :model-value="formatMoney(draft.originalPrice)" readonly label="原价格(元)" />
|
||||
<div class="protocol-sample-transport__money-field">
|
||||
<label>优惠价格(元)</label>
|
||||
<OaMoneyField v-model="draft.price" :show-upper="false" />
|
||||
<div class="market-form-fields">
|
||||
<div class="market-form-field">
|
||||
<label>样本类型<b>*</b></label>
|
||||
<div class="market-form-field__control">
|
||||
<PresignSelectField
|
||||
:model-value="draft.sampleTypeId"
|
||||
:options="typeSelectOptions"
|
||||
searchable
|
||||
title="选择样本类型"
|
||||
@update:model-value="onTypeIdChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<van-field
|
||||
:model-value="draft.storageYears == null ? '' : String(draft.storageYears)"
|
||||
type="digit"
|
||||
label="存储年限(年)"
|
||||
@update:model-value="(v) => (draft.storageYears = parseInteger(v))"
|
||||
/>
|
||||
</template>
|
||||
<van-field
|
||||
:model-value="statusLabel(draft.sampleStatus)"
|
||||
is-link
|
||||
readonly
|
||||
label="样本状态"
|
||||
@click="statusSheetVisible = true"
|
||||
/>
|
||||
<div class="protocol-sample-transport__datetime">
|
||||
<label>预计到达时间</label>
|
||||
<OaDatePicker
|
||||
:model-value="draft.etaTime || ''"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
@update:model-value="(v) => (draft.etaTime = v || '')"
|
||||
/>
|
||||
</div>
|
||||
<van-field label="特殊样本">
|
||||
<template #input>
|
||||
<van-switch
|
||||
:model-value="Number(draft.isSpecial) === 1"
|
||||
size="20px"
|
||||
@update:model-value="onSpecialToggle"
|
||||
<div v-if="autoGenerateCode" class="market-form-field">
|
||||
<label>样本编码</label>
|
||||
<van-field
|
||||
:model-value="draft.sampleCode || '保存后自动生成'"
|
||||
readonly
|
||||
:border="false"
|
||||
/>
|
||||
</div>
|
||||
<div v-else class="market-form-field">
|
||||
<label>样本编码<b>*</b></label>
|
||||
<div class="market-form-field__control">
|
||||
<PresignSelectField
|
||||
:model-value="draft.sampleCodeId"
|
||||
:options="codeSelectOptions"
|
||||
searchable
|
||||
title="选择样本编码"
|
||||
placeholder="搜索样本编码"
|
||||
@update:model-value="onCodeIdChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="showPrice">
|
||||
<div class="market-form-field">
|
||||
<label>原价格(元)</label>
|
||||
<van-field :model-value="formatMoney(draft.originalPrice)" readonly :border="false" />
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>优惠价格(元)</label>
|
||||
<div class="market-form-field__control">
|
||||
<OaMoneyField v-model="draft.price" :show-upper="false" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>存储年限(年)</label>
|
||||
<van-field
|
||||
:model-value="draft.storageYears == null ? '' : String(draft.storageYears)"
|
||||
type="digit"
|
||||
:border="false"
|
||||
@update:model-value="(v) => (draft.storageYears = parseInteger(v))"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</van-field>
|
||||
<van-field
|
||||
v-model="draft.specialRemark"
|
||||
type="textarea"
|
||||
rows="2"
|
||||
maxlength="256"
|
||||
show-word-limit
|
||||
label="特殊说明"
|
||||
:disabled="Number(draft.isSpecial) !== 1"
|
||||
placeholder="如小三阳、HBV 携带等"
|
||||
/>
|
||||
<div class="market-form-field">
|
||||
<label>样本状态</label>
|
||||
<div class="market-form-field__control">
|
||||
<PresignSelectField
|
||||
:model-value="draft.sampleStatus"
|
||||
:options="statusSelectOptions"
|
||||
title="选择样本状态"
|
||||
@update:model-value="(v) => (draft.sampleStatus = v)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>预计到达时间</label>
|
||||
<div class="market-form-field__control">
|
||||
<OaDatePicker
|
||||
:model-value="draft.etaTime || ''"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
@update:model-value="(v) => (draft.etaTime = v || '')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>特殊样本</label>
|
||||
<div class="market-form-field__control protocol-sample-transport__switch">
|
||||
<van-switch
|
||||
:model-value="Number(draft.isSpecial) === 1"
|
||||
size="20px"
|
||||
@update:model-value="onSpecialToggle"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>特殊说明</label>
|
||||
<van-field
|
||||
v-model="draft.specialRemark"
|
||||
type="textarea"
|
||||
rows="2"
|
||||
maxlength="256"
|
||||
show-word-limit
|
||||
:disabled="Number(draft.isSpecial) !== 1"
|
||||
placeholder="如小三阳、HBV 携带等"
|
||||
:border="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="protocol-sample-transport__editor-footer">
|
||||
<van-button block plain @click="editorVisible = false">取消</van-button>
|
||||
<van-button block type="primary" @click="confirmEditor">确定</van-button>
|
||||
@@ -142,39 +222,76 @@
|
||||
<van-tab title="关联已有" name="link" />
|
||||
</van-tabs>
|
||||
<template v-if="freightMode === 'create'">
|
||||
<van-field
|
||||
:model-value="transportModeLabel(freightForm.transportMode)"
|
||||
is-link
|
||||
readonly
|
||||
label="运输方式"
|
||||
required
|
||||
@click="transportSheetVisible = true"
|
||||
/>
|
||||
<div class="protocol-sample-transport__money-field is-required">
|
||||
<label>运费金额</label>
|
||||
<OaMoneyField
|
||||
v-model="freightForm.freightAmount"
|
||||
:show-upper="false"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
<div class="market-form-fields">
|
||||
<div class="market-form-field">
|
||||
<label>运输方式<b>*</b></label>
|
||||
<div class="market-form-field__control">
|
||||
<PresignSelectField
|
||||
v-model="freightForm.transportMode"
|
||||
:options="transportSelectOptions"
|
||||
searchable
|
||||
title="选择运输方式"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>运费金额<b>*</b></label>
|
||||
<div class="market-form-field__control">
|
||||
<OaMoneyField
|
||||
v-model="freightForm.freightAmount"
|
||||
:show-upper="false"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<van-radio-group v-model="selectedFreightId">
|
||||
<div class="protocol-sample-transport__link-toolbar">
|
||||
<van-search
|
||||
v-model="existingFreightKeyword"
|
||||
shape="round"
|
||||
placeholder="批次号 / 运输方式"
|
||||
@search="loadExistingFreights"
|
||||
@clear="loadExistingFreights"
|
||||
/>
|
||||
</div>
|
||||
<van-loading
|
||||
v-if="existingFreightLoading"
|
||||
class="protocol-sample-transport__link-loading"
|
||||
color="#0a9f6d"
|
||||
>
|
||||
加载运费批次…
|
||||
</van-loading>
|
||||
<van-radio-group v-else v-model="selectedFreightId">
|
||||
<van-cell
|
||||
v-for="item in existingFreights"
|
||||
:key="item.id"
|
||||
clickable
|
||||
:title="item.freightNo || item.id"
|
||||
:label="`${transportModeLabel(item.transportMode)} · ${formatMoney(item.freightAmount)}`"
|
||||
@click="selectedFreightId = item.id"
|
||||
>
|
||||
<template #label>
|
||||
<div class="protocol-sample-transport__link-label">
|
||||
<div>
|
||||
{{ transportModeLabel(item.transportMode) }} ·
|
||||
{{ formatMoney(item.freightAmount) }}
|
||||
</div>
|
||||
<div>样本:{{ formatFreightLinkedSampleCodes(item) }}</div>
|
||||
<div>创建人:{{ formatFreightCreatorName(item) }}</div>
|
||||
<div>创建:{{ item.createTime || '—' }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #right-icon>
|
||||
<van-radio :name="item.id" />
|
||||
</template>
|
||||
</van-cell>
|
||||
</van-radio-group>
|
||||
<van-empty v-if="!existingFreights.length" description="暂无运费批次" image-size="48" />
|
||||
<van-empty
|
||||
v-if="!existingFreightLoading && !existingFreights.length"
|
||||
description="暂无运费批次"
|
||||
image-size="48"
|
||||
/>
|
||||
</template>
|
||||
<div class="protocol-sample-transport__editor-footer">
|
||||
<van-button block plain @click="freightVisible = false">取消</van-button>
|
||||
@@ -185,35 +302,6 @@
|
||||
</div>
|
||||
</van-popup>
|
||||
|
||||
<van-action-sheet
|
||||
v-model:show="typeSheetVisible"
|
||||
:actions="typeSheetActions"
|
||||
cancel-text="取消"
|
||||
close-on-click-action
|
||||
@select="onTypeSelect"
|
||||
/>
|
||||
<van-action-sheet
|
||||
v-model:show="codeSheetVisible"
|
||||
:actions="codeSheetActions"
|
||||
cancel-text="取消"
|
||||
close-on-click-action
|
||||
@select="onCodeSelect"
|
||||
/>
|
||||
<van-action-sheet
|
||||
v-model:show="statusSheetVisible"
|
||||
:actions="statusSheetActions"
|
||||
cancel-text="取消"
|
||||
close-on-click-action
|
||||
@select="(a) => (draft.sampleStatus = a.value)"
|
||||
/>
|
||||
<van-action-sheet
|
||||
v-model:show="transportSheetVisible"
|
||||
:actions="transportSheetActions"
|
||||
cancel-text="取消"
|
||||
close-on-click-action
|
||||
@select="(a) => (freightForm.transportMode = a.value)"
|
||||
/>
|
||||
|
||||
<van-popup v-model:show="unlinkVisible" position="bottom" round :style="{ maxHeight: '80%' }">
|
||||
<div class="protocol-sample-transport__editor">
|
||||
<h3>取消运费</h3>
|
||||
@@ -257,6 +345,7 @@ import {
|
||||
} from '../../api/market.js'
|
||||
import { marketErrorMessage } from '../market-error.js'
|
||||
import { formatMoney } from '../money.js'
|
||||
import PresignSelectField from './PresignSelectField.vue'
|
||||
import {
|
||||
SAMPLE_STATUS_OPTIONS,
|
||||
applyFreightAssignments,
|
||||
@@ -265,6 +354,8 @@ import {
|
||||
buildFreightDraft,
|
||||
buildFreightUnlinkCandidates,
|
||||
emptySampleRow,
|
||||
formatFreightCreatorName,
|
||||
formatFreightLinkedSampleCodes,
|
||||
freightDisplay,
|
||||
partitionFreightConfigSamples,
|
||||
sampleHasFreight,
|
||||
@@ -291,20 +382,28 @@ const freightContext = computed(() => ({
|
||||
module: 'freight',
|
||||
marketRole: props.marketRole || 'specialist'
|
||||
}))
|
||||
const checkedCount = computed(() => samples.value.filter((row) => Boolean(row._checked)).length)
|
||||
const pendingFreightCount = computed(
|
||||
() => samples.value.filter((row) => !freightDisplay(row).modeLabel).length
|
||||
)
|
||||
const priceSum = computed(() =>
|
||||
samples.value.reduce((sum, row) => {
|
||||
const n = Number(row.price)
|
||||
return sum + (Number.isFinite(n) ? n : 0)
|
||||
}, 0)
|
||||
)
|
||||
|
||||
const editorVisible = ref(false)
|
||||
const editorIndex = ref(-1)
|
||||
const draft = reactive(emptySampleRow())
|
||||
const typeSheetVisible = ref(false)
|
||||
const codeSheetVisible = ref(false)
|
||||
const statusSheetVisible = ref(false)
|
||||
const transportSheetVisible = ref(false)
|
||||
const freightVisible = ref(false)
|
||||
const freightMode = ref('create')
|
||||
const freightBusy = ref(false)
|
||||
const freightForm = reactive({ transportMode: '', freightAmount: '' })
|
||||
const selectedFreightId = ref('')
|
||||
const existingFreights = ref([])
|
||||
const existingFreightKeyword = ref('')
|
||||
const existingFreightLoading = ref(false)
|
||||
const freightTargets = ref([])
|
||||
const unlinkVisible = ref(false)
|
||||
const unlinkBusy = ref(false)
|
||||
@@ -312,23 +411,25 @@ const unlinkItems = ref([])
|
||||
const unlinkSelectedKeys = ref([])
|
||||
const unlinkSeedRows = ref([])
|
||||
|
||||
const typeSheetActions = computed(() =>
|
||||
const typeSelectOptions = computed(() =>
|
||||
(props.sampleTypes || []).map((opt) => ({
|
||||
name: opt.label || opt.typeName || opt.value,
|
||||
value: opt.value || opt.id
|
||||
label: opt.label || opt.typeName || opt.value,
|
||||
value: opt.value || opt.id,
|
||||
storagePrice: opt.storagePrice ?? opt.price,
|
||||
storageYears: opt.storageYears
|
||||
}))
|
||||
)
|
||||
const statusSheetActions = SAMPLE_STATUS_OPTIONS.map((opt) => ({
|
||||
name: opt.label,
|
||||
const statusSelectOptions = SAMPLE_STATUS_OPTIONS.map((opt) => ({
|
||||
label: opt.label,
|
||||
value: opt.value
|
||||
}))
|
||||
const transportSheetActions = computed(() =>
|
||||
const transportSelectOptions = computed(() =>
|
||||
(props.transportModes || []).map((opt) => ({
|
||||
name: opt.label || opt.value,
|
||||
label: opt.label || opt.value,
|
||||
value: opt.value
|
||||
}))
|
||||
)
|
||||
const codeSheetActions = computed(() => {
|
||||
const codeSelectOptions = computed(() => {
|
||||
const used = new Set(
|
||||
samples.value
|
||||
.map((row, idx) => (idx === editorIndex.value ? '' : String(row.sampleCodeId || '')))
|
||||
@@ -337,7 +438,7 @@ const codeSheetActions = computed(() => {
|
||||
return (props.sampleCodes || [])
|
||||
.filter((opt) => !used.has(String(opt.value || opt.id || '')))
|
||||
.map((opt) => ({
|
||||
name: opt.label || opt.sampleCode || opt.value,
|
||||
label: opt.label || opt.sampleCode || opt.value,
|
||||
value: opt.value || opt.id,
|
||||
sampleCode: opt.sampleCode || opt.label || ''
|
||||
}))
|
||||
@@ -403,32 +504,22 @@ function openEdit(index) {
|
||||
editorVisible.value = true
|
||||
}
|
||||
|
||||
function openTypeSheet() {
|
||||
if (!typeSheetActions.value.length) {
|
||||
function onTypeIdChange(value) {
|
||||
if (!value) {
|
||||
draft.sampleTypeId = ''
|
||||
return
|
||||
}
|
||||
if (!typeSelectOptions.value.length) {
|
||||
showToast('暂无样本类型')
|
||||
return
|
||||
}
|
||||
typeSheetVisible.value = true
|
||||
}
|
||||
|
||||
function openCodeSheet() {
|
||||
if (!codeSheetActions.value.length) {
|
||||
showToast('暂无可选样本编码')
|
||||
return
|
||||
}
|
||||
codeSheetVisible.value = true
|
||||
}
|
||||
|
||||
function onTypeSelect(action) {
|
||||
const type = (props.sampleTypes || []).find(
|
||||
(opt) => String(opt.value || opt.id) === String(action.value)
|
||||
)
|
||||
const type = typeSelectOptions.value.find((opt) => String(opt.value) === String(value))
|
||||
Object.assign(
|
||||
draft,
|
||||
applySampleTypeDefaults(
|
||||
{ ...draft, sampleTypeId: action.value },
|
||||
{ ...draft, sampleTypeId: value },
|
||||
{
|
||||
storagePrice: type?.storagePrice ?? type?.price,
|
||||
storagePrice: type?.storagePrice,
|
||||
storageYears: type?.storageYears
|
||||
},
|
||||
{ showPrice: showPrice.value }
|
||||
@@ -437,9 +528,19 @@ function onTypeSelect(action) {
|
||||
if (autoGenerateCode.value) draft.sampleCode = ''
|
||||
}
|
||||
|
||||
function onCodeSelect(action) {
|
||||
draft.sampleCodeId = action.value
|
||||
draft.sampleCode = action.sampleCode || codeLabel(action.value, '')
|
||||
function onCodeIdChange(value) {
|
||||
if (!value) {
|
||||
draft.sampleCodeId = ''
|
||||
draft.sampleCode = ''
|
||||
return
|
||||
}
|
||||
if (!codeSelectOptions.value.length) {
|
||||
showToast('暂无可选样本编码')
|
||||
return
|
||||
}
|
||||
const hit = codeSelectOptions.value.find((opt) => String(opt.value) === String(value))
|
||||
draft.sampleCodeId = value
|
||||
draft.sampleCode = hit?.sampleCode || hit?.label || codeLabel(value, '')
|
||||
}
|
||||
|
||||
function onSpecialToggle(checked) {
|
||||
@@ -499,13 +600,28 @@ async function openFreightConfig() {
|
||||
freightForm.transportMode = ''
|
||||
freightForm.freightAmount = ''
|
||||
selectedFreightId.value = ''
|
||||
try {
|
||||
const data = await fetchMarketList(freightContext.value, { page: 1, pageSize: 50 })
|
||||
existingFreights.value = data?.list || data?.records || []
|
||||
} catch {
|
||||
existingFreights.value = []
|
||||
}
|
||||
existingFreightKeyword.value = ''
|
||||
freightVisible.value = true
|
||||
await loadExistingFreights()
|
||||
}
|
||||
|
||||
async function loadExistingFreights() {
|
||||
existingFreightLoading.value = true
|
||||
try {
|
||||
const data = await fetchMarketList(freightContext.value, {
|
||||
page: 1,
|
||||
pageSize: 50,
|
||||
includeItems: true,
|
||||
sampleSource: props.source || undefined,
|
||||
keyword: existingFreightKeyword.value.trim() || undefined
|
||||
})
|
||||
existingFreights.value = data?.list || data?.records || data?.items || data?.rows || []
|
||||
} catch (error) {
|
||||
existingFreights.value = []
|
||||
showToast(marketErrorMessage(error, '加载运费批次失败'))
|
||||
} finally {
|
||||
existingFreightLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function toFreightItems(rows) {
|
||||
@@ -742,40 +858,135 @@ async function confirmUnlink() {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.protocol-sample-transport {
|
||||
padding-left: 14px;
|
||||
padding-right: 14px;
|
||||
}
|
||||
.protocol-sample-transport__toolbar {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
padding: 0 16px 4px;
|
||||
display: block;
|
||||
padding: 0;
|
||||
}
|
||||
.protocol-sample-transport__toolbar h2 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-size: 15px;
|
||||
font-weight: 720;
|
||||
}
|
||||
.protocol-sample-transport__hint {
|
||||
margin: 4px 0 0;
|
||||
color: #6b7b74;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.protocol-sample-transport__sum {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
|
||||
gap: 8px;
|
||||
margin: 12px 0 0;
|
||||
}
|
||||
.protocol-sample-transport__toolbar h2::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
margin-right: 8px;
|
||||
border-radius: 50%;
|
||||
background: #0a9f6d;
|
||||
box-shadow: 0 0 0 3px #e9f9f2;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.protocol-sample-transport__sum-item {
|
||||
padding: 10px 8px;
|
||||
border-radius: 12px;
|
||||
text-align: center;
|
||||
background: linear-gradient(180deg, #f8fffc, #f2faf6);
|
||||
border: 1px solid #e3f0ea;
|
||||
}
|
||||
.protocol-sample-transport__sum-item .k {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
color: #6b7b74;
|
||||
font-weight: 500;
|
||||
}
|
||||
.protocol-sample-transport__sum-item .v {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
font-size: 14px;
|
||||
font-weight: 780;
|
||||
color: #087f57;
|
||||
}
|
||||
.protocol-sample-transport__sum-item.is-warn .v {
|
||||
color: #92400e;
|
||||
}
|
||||
.protocol-sample-transport__actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
margin: 12px 0 0;
|
||||
}
|
||||
.protocol-sample-transport__actions :deep(.van-button),
|
||||
.protocol-sample-transport__row-actions :deep(.van-button) {
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
padding: 0 12px;
|
||||
min-width: auto;
|
||||
min-height: 28px;
|
||||
height: 28px;
|
||||
padding: 0 10px;
|
||||
border-radius: 8px !important;
|
||||
font-weight: 600;
|
||||
}
|
||||
.protocol-sample-transport__hint {
|
||||
margin: 0 16px 12px;
|
||||
color: #64748b;
|
||||
.protocol-sample-transport__sel {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 10px;
|
||||
padding: 8px 12px;
|
||||
border-radius: 12px;
|
||||
background: #ecfdf5;
|
||||
border: 1px solid #b8ebd4;
|
||||
font-size: 12px;
|
||||
font-weight: 650;
|
||||
color: #087f57;
|
||||
}
|
||||
.protocol-sample-transport__sel-link {
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: #0a9f6d;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
.protocol-sample-transport__sel-link:disabled {
|
||||
opacity: 0.45;
|
||||
}
|
||||
.protocol-sample-transport__empty {
|
||||
margin-top: 12px;
|
||||
padding: 24px 16px;
|
||||
text-align: center;
|
||||
border-radius: 14px;
|
||||
border: 1.5px dashed #b8ebd4;
|
||||
background: #f7fffb;
|
||||
}
|
||||
.protocol-sample-transport__empty p {
|
||||
margin: 0 0 12px;
|
||||
font-size: 13px;
|
||||
color: #6b7b74;
|
||||
font-weight: 500;
|
||||
}
|
||||
.protocol-sample-transport__card {
|
||||
margin: 0 12px 12px;
|
||||
margin: 10px 0 0;
|
||||
padding: 12px;
|
||||
border-radius: 12px;
|
||||
border-radius: 14px;
|
||||
background: #fff;
|
||||
border: 1px solid #e2e8f0;
|
||||
border: 1.5px solid #e3f0ea;
|
||||
transition: border-color 0.15s, box-shadow 0.15s;
|
||||
}
|
||||
.protocol-sample-transport__card.is-checked {
|
||||
border-color: #0a9f6d;
|
||||
background: linear-gradient(180deg, #f7fffb, #fff);
|
||||
box-shadow: 0 0 0 3px rgb(10 159 109 / 12%);
|
||||
}
|
||||
.protocol-sample-transport__card.is-alert:not(.is-checked) {
|
||||
border-color: #f0c989;
|
||||
background: linear-gradient(180deg, #fffbeb, #fff);
|
||||
}
|
||||
.protocol-sample-transport__card-head {
|
||||
display: flex;
|
||||
@@ -783,20 +994,91 @@ async function confirmUnlink() {
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
}
|
||||
.protocol-sample-transport__meta {
|
||||
.protocol-sample-transport__code {
|
||||
font-size: 14px;
|
||||
font-weight: 760;
|
||||
}
|
||||
.protocol-sample-transport__type-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px 12px;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-top: 8px;
|
||||
color: #475569;
|
||||
font-size: 12px;
|
||||
}
|
||||
.protocol-sample-transport__meta .is-muted {
|
||||
.protocol-sample-transport__type {
|
||||
display: inline-flex;
|
||||
padding: 3px 8px;
|
||||
border-radius: 8px;
|
||||
background: #f0f7f4;
|
||||
color: #3d524a;
|
||||
font-size: 12px;
|
||||
font-weight: 650;
|
||||
}
|
||||
.protocol-sample-transport__special {
|
||||
font-size: 11px;
|
||||
font-weight: 750;
|
||||
color: #b45309;
|
||||
padding: 2px 6px;
|
||||
border-radius: 6px;
|
||||
background: #fff7e8;
|
||||
}
|
||||
.protocol-sample-transport__metrics {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.protocol-sample-transport__metric {
|
||||
padding: 8px 10px;
|
||||
border-radius: 10px;
|
||||
background: #f6faf8;
|
||||
border: 1px solid #e8f2ed;
|
||||
}
|
||||
.protocol-sample-transport__metric.is-span2 {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
.protocol-sample-transport__metric .k {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
color: #6b7b74;
|
||||
font-weight: 500;
|
||||
}
|
||||
.protocol-sample-transport__metric .v {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
font-size: 13px;
|
||||
font-weight: 720;
|
||||
color: #1f2a26;
|
||||
}
|
||||
.protocol-sample-transport__metric .v.is-money {
|
||||
color: #087f57;
|
||||
}
|
||||
.protocol-sample-transport__metric .v.is-muted {
|
||||
color: #94a3b8;
|
||||
font-weight: 600;
|
||||
}
|
||||
.protocol-sample-transport__freight {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-top: 8px;
|
||||
padding: 8px 10px;
|
||||
border-radius: 10px;
|
||||
background: #f8fffc;
|
||||
border: 1px dashed #b8ebd4;
|
||||
font-size: 12px;
|
||||
color: #087f57;
|
||||
font-weight: 650;
|
||||
}
|
||||
.protocol-sample-transport__freight.is-none {
|
||||
background: #fffaf0;
|
||||
border-color: #f0e0bc;
|
||||
color: #92400e;
|
||||
}
|
||||
.protocol-sample-transport__row-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
gap: 6px;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.protocol-sample-transport__editor {
|
||||
@@ -806,26 +1088,38 @@ async function confirmUnlink() {
|
||||
margin: 0 4px 12px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.protocol-sample-transport__editor .market-form-fields {
|
||||
margin-top: 4px;
|
||||
}
|
||||
.protocol-sample-transport__editor-footer {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 10px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
.protocol-sample-transport__datetime,
|
||||
.protocol-sample-transport__money-field {
|
||||
padding: 8px 16px;
|
||||
.protocol-sample-transport__switch {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 46px;
|
||||
padding: 0 12px;
|
||||
}
|
||||
.protocol-sample-transport__datetime label,
|
||||
.protocol-sample-transport__money-field label {
|
||||
display: block;
|
||||
margin-bottom: 6px;
|
||||
color: #646566;
|
||||
font-size: 14px;
|
||||
.protocol-sample-transport__link-toolbar {
|
||||
margin: 8px 0;
|
||||
}
|
||||
.protocol-sample-transport__money-field.is-required label::before {
|
||||
margin-right: 2px;
|
||||
color: #ee0a24;
|
||||
content: '*';
|
||||
.protocol-sample-transport__link-label {
|
||||
display: grid;
|
||||
gap: 2px;
|
||||
margin-top: 2px;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
color: #6b7b74;
|
||||
word-break: break-all;
|
||||
}
|
||||
.protocol-sample-transport__link-loading,
|
||||
.protocol-sample-transport__freight-loading {
|
||||
display: flex;
|
||||
min-height: 80px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -8,74 +8,108 @@
|
||||
<van-tag class="market-tag" type="primary" round>v1</van-tag>
|
||||
</div>
|
||||
|
||||
<div class="market-form-fields protocol-v1-pay__total">
|
||||
<div class="market-form-field">
|
||||
<label>协议总金额</label>
|
||||
<van-field
|
||||
:model-value="protocolTotalAmount == null ? '' : String(protocolTotalAmount)"
|
||||
type="number"
|
||||
inputmode="decimal"
|
||||
placeholder="请输入"
|
||||
:disabled="disabled"
|
||||
:border="false"
|
||||
@update:model-value="emitProtocolTotal"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<article class="protocol-v1-pay__card">
|
||||
<h3>缴费主表</h3>
|
||||
<van-cell-group inset>
|
||||
<van-field
|
||||
:model-value="payModeLabel(payment.payMode)"
|
||||
label="缴费模式"
|
||||
is-link
|
||||
readonly
|
||||
:disabled="disabled"
|
||||
@click="!disabled && (modeSheetVisible = true)"
|
||||
/>
|
||||
<div class="protocol-v1-pay__money-field">
|
||||
<div class="market-form-fields">
|
||||
<div class="market-form-field">
|
||||
<label>缴费模式</label>
|
||||
<div class="market-form-field__control" @click="!disabled && (modeSheetVisible = true)">
|
||||
<van-field
|
||||
:model-value="payModeLabel(payment.payMode)"
|
||||
is-link
|
||||
readonly
|
||||
:disabled="disabled"
|
||||
:border="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>合同金额(元)</label>
|
||||
<OaMoneyField
|
||||
:model-value="payment.contractAmount"
|
||||
:disabled="disabled"
|
||||
@update:model-value="onContractAmountChange"
|
||||
/>
|
||||
<div class="market-form-field__control">
|
||||
<OaMoneyField
|
||||
:model-value="payment.contractAmount"
|
||||
:disabled="disabled"
|
||||
@update:model-value="onContractAmountChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="payment.payMode === 'dj'">
|
||||
<div class="protocol-v1-pay__picker-field">
|
||||
<div class="market-form-field">
|
||||
<label>趸交截止时间</label>
|
||||
<OaDatePicker
|
||||
:model-value="payment.lumpSumDeadline || ''"
|
||||
type="date"
|
||||
value-format="YYYYMMDD"
|
||||
:disabled="disabled"
|
||||
@update:model-value="onLumpSumDeadlineChange"
|
||||
/>
|
||||
<div class="market-form-field__control">
|
||||
<OaDatePicker
|
||||
:model-value="payment.lumpSumDeadline || ''"
|
||||
type="date"
|
||||
value-format="YYYYMMDD"
|
||||
:disabled="disabled"
|
||||
@update:model-value="onLumpSumDeadlineChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="isLegacyInstallmentMode(payment.payMode)">
|
||||
<van-field
|
||||
:model-value="payment.installmentCount == null ? '' : String(payment.installmentCount)"
|
||||
label="分期期数"
|
||||
type="digit"
|
||||
inputmode="numeric"
|
||||
:disabled="disabled"
|
||||
@update:model-value="onInstallmentCountChange"
|
||||
/>
|
||||
<van-field
|
||||
:model-value="payment.installmentIntervalMonths == null ? '' : String(payment.installmentIntervalMonths)"
|
||||
label="每期间隔(月)"
|
||||
type="text"
|
||||
inputmode="decimal"
|
||||
:disabled="disabled"
|
||||
@update:model-value="(value) => onPaymentPlanFieldChange({ installmentIntervalMonths: value })"
|
||||
/>
|
||||
<div class="protocol-v1-pay__picker-field">
|
||||
<label>分期开始时间</label>
|
||||
<OaDatePicker
|
||||
:model-value="payment.installmentStartDate || ''"
|
||||
type="date"
|
||||
value-format="YYYYMMDD"
|
||||
<div class="market-form-field">
|
||||
<label>分期期数</label>
|
||||
<van-field
|
||||
:model-value="payment.installmentCount == null ? '' : String(payment.installmentCount)"
|
||||
type="digit"
|
||||
inputmode="numeric"
|
||||
:disabled="disabled"
|
||||
@update:model-value="(value) => onPaymentPlanFieldChange({ installmentStartDate: value || '' })"
|
||||
:border="false"
|
||||
@update:model-value="onInstallmentCountChange"
|
||||
/>
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>每期间隔(月)</label>
|
||||
<van-field
|
||||
:model-value="payment.installmentIntervalMonths == null ? '' : String(payment.installmentIntervalMonths)"
|
||||
type="text"
|
||||
inputmode="decimal"
|
||||
:disabled="disabled"
|
||||
:border="false"
|
||||
@update:model-value="(value) => onPaymentPlanFieldChange({ installmentIntervalMonths: value })"
|
||||
/>
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>分期开始时间</label>
|
||||
<div class="market-form-field__control">
|
||||
<OaDatePicker
|
||||
:model-value="payment.installmentStartDate || ''"
|
||||
type="date"
|
||||
value-format="YYYYMMDD"
|
||||
:disabled="disabled"
|
||||
@update:model-value="(value) => onPaymentPlanFieldChange({ installmentStartDate: value || '' })"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>提前催缴预警(天)</label>
|
||||
<van-field
|
||||
:model-value="payment.installmentAdvanceDays == null ? '' : String(payment.installmentAdvanceDays)"
|
||||
type="digit"
|
||||
inputmode="numeric"
|
||||
:disabled="disabled"
|
||||
:border="false"
|
||||
@update:model-value="(value) => onPaymentPlanFieldChange({ installmentAdvanceDays: integerValue(value) })"
|
||||
/>
|
||||
</div>
|
||||
<van-field
|
||||
:model-value="payment.installmentAdvanceDays == null ? '' : String(payment.installmentAdvanceDays)"
|
||||
label="提前催缴预警(天)"
|
||||
type="digit"
|
||||
inputmode="numeric"
|
||||
:disabled="disabled"
|
||||
@update:model-value="(value) => onPaymentPlanFieldChange({ installmentAdvanceDays: integerValue(value) })"
|
||||
/>
|
||||
</template>
|
||||
</van-cell-group>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<div class="protocol-v1-pay__details-head">
|
||||
@@ -85,8 +119,6 @@
|
||||
</div>
|
||||
<van-button
|
||||
type="primary"
|
||||
plain
|
||||
round
|
||||
:disabled="disabled || !canAddDetail"
|
||||
@click="addDetail"
|
||||
>
|
||||
@@ -112,82 +144,99 @@
|
||||
当前状态由财务流程维护,本行仅可查看与下载附件
|
||||
</p>
|
||||
|
||||
<van-cell-group inset>
|
||||
<van-field
|
||||
:model-value="detail.installmentNo == null ? '' : String(detail.installmentNo)"
|
||||
label="期次"
|
||||
type="digit"
|
||||
inputmode="numeric"
|
||||
:disabled="disabled || !isEditable(detail)"
|
||||
@update:model-value="(value) => patchDetail(index, { installmentNo: integerValue(value) })"
|
||||
/>
|
||||
<div class="protocol-v1-pay__money-field">
|
||||
<div class="market-form-fields">
|
||||
<div class="market-form-field">
|
||||
<label>期次</label>
|
||||
<van-field
|
||||
:model-value="detail.installmentNo == null ? '' : String(detail.installmentNo)"
|
||||
type="digit"
|
||||
inputmode="numeric"
|
||||
:disabled="disabled || !isEditable(detail)"
|
||||
:border="false"
|
||||
@update:model-value="(value) => patchDetail(index, { installmentNo: integerValue(value) })"
|
||||
/>
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>应缴费金额(元)</label>
|
||||
<OaMoneyField
|
||||
:model-value="detail.dueAmount"
|
||||
:disabled="disabled || !isEditable(detail)"
|
||||
@update:model-value="(value) => onDueAmountChange(index, value)"
|
||||
/>
|
||||
<div class="market-form-field__control">
|
||||
<OaMoneyField
|
||||
:model-value="detail.dueAmount"
|
||||
:disabled="disabled || !isEditable(detail)"
|
||||
@update:model-value="(value) => onDueAmountChange(index, value)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<van-field
|
||||
:model-value="transferTypeLabel(detail.transferType)"
|
||||
label="转账方式"
|
||||
is-link
|
||||
readonly
|
||||
:disabled="disabled || !isEditable(detail)"
|
||||
@click="openTransferTypeSheet(index, detail)"
|
||||
/>
|
||||
<div class="protocol-v1-pay__money-field">
|
||||
<div class="market-form-field">
|
||||
<label>转账方式</label>
|
||||
<div class="market-form-field__control" @click="openTransferTypeSheet(index, detail)">
|
||||
<van-field
|
||||
:model-value="transferTypeLabel(detail.transferType)"
|
||||
is-link
|
||||
readonly
|
||||
:disabled="disabled || !isEditable(detail)"
|
||||
:border="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>转账金额(元)</label>
|
||||
<OaMoneyField
|
||||
:model-value="detail.transferAmount"
|
||||
:disabled="disabled || !isEditable(detail)"
|
||||
@update:model-value="(value) => patchDetail(index, { transferAmount: value })"
|
||||
/>
|
||||
<div class="market-form-field__control">
|
||||
<OaMoneyField
|
||||
:model-value="detail.transferAmount"
|
||||
:disabled="disabled || !isEditable(detail)"
|
||||
@update:model-value="(value) => patchDetail(index, { transferAmount: value })"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="protocol-v1-pay__picker-field">
|
||||
<div class="market-form-field">
|
||||
<label>转账时间</label>
|
||||
<OaDatePicker
|
||||
:model-value="detail.transferTime || ''"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
:disabled="disabled || !isEditable(detail)"
|
||||
@update:model-value="(value) => patchDetail(index, { transferTime: value || '' })"
|
||||
/>
|
||||
<div class="market-form-field__control">
|
||||
<OaDatePicker
|
||||
:model-value="detail.transferTime || ''"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
:disabled="disabled || !isEditable(detail)"
|
||||
@update:model-value="(value) => patchDetail(index, { transferTime: value || '' })"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="protocol-v1-pay__picker-field">
|
||||
<div class="market-form-field">
|
||||
<label>应缴费时间</label>
|
||||
<OaDatePicker
|
||||
:model-value="detail.installmentDueDate || ''"
|
||||
type="date"
|
||||
value-format="YYYYMMDD"
|
||||
<div class="market-form-field__control">
|
||||
<OaDatePicker
|
||||
:model-value="detail.installmentDueDate || ''"
|
||||
type="date"
|
||||
value-format="YYYYMMDD"
|
||||
:disabled="disabled || !isEditable(detail)"
|
||||
@update:model-value="(value) => patchDetail(index, { installmentDueDate: value || '' })"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>备注</label>
|
||||
<van-field
|
||||
:model-value="detail.remark || ''"
|
||||
type="textarea"
|
||||
rows="2"
|
||||
maxlength="512"
|
||||
show-word-limit
|
||||
:disabled="disabled || !isEditable(detail)"
|
||||
@update:model-value="(value) => patchDetail(index, { installmentDueDate: value || '' })"
|
||||
:border="false"
|
||||
@update:model-value="(value) => patchDetail(index, { remark: value })"
|
||||
/>
|
||||
</div>
|
||||
<div class="market-form-field">
|
||||
<label>转账凭证</label>
|
||||
<MarketAttachmentCards
|
||||
:model-value="detail.transferAttachments || ''"
|
||||
:editable="!disabled && isEditable(detail)"
|
||||
:uploading="uploading"
|
||||
:max-size="PROTOCOL_ATTACHMENT_MAX_BYTES"
|
||||
:accept="PROTOCOL_ATTACHMENT_ACCEPT"
|
||||
@upload="(file) => emit('upload', { index, file })"
|
||||
@remove="(attachmentIndex) => removeAttachment(index, attachmentIndex)"
|
||||
/>
|
||||
</div>
|
||||
<van-field
|
||||
:model-value="detail.remark || ''"
|
||||
label="备注"
|
||||
type="textarea"
|
||||
rows="2"
|
||||
maxlength="512"
|
||||
show-word-limit
|
||||
:disabled="disabled || !isEditable(detail)"
|
||||
@update:model-value="(value) => patchDetail(index, { remark: value })"
|
||||
/>
|
||||
</van-cell-group>
|
||||
|
||||
<div class="protocol-v1-pay__attachments">
|
||||
<label>转账凭证</label>
|
||||
<MarketAttachmentCards
|
||||
:model-value="detail.transferAttachments || ''"
|
||||
:editable="!disabled && isEditable(detail)"
|
||||
:uploading="uploading"
|
||||
:max-size="PROTOCOL_ATTACHMENT_MAX_BYTES"
|
||||
:accept="PROTOCOL_ATTACHMENT_ACCEPT"
|
||||
@upload="(file) => emit('upload', { index, file })"
|
||||
@remove="(attachmentIndex) => removeAttachment(index, attachmentIndex)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<van-button
|
||||
@@ -195,7 +244,6 @@
|
||||
class="protocol-v1-pay__delete"
|
||||
type="danger"
|
||||
plain
|
||||
round
|
||||
@click="removeDetail(index)"
|
||||
>
|
||||
删除明细
|
||||
@@ -245,15 +293,22 @@ const props = defineProps({
|
||||
paymentDetails: { type: Array, default: () => [] },
|
||||
transferTypes: { type: Array, default: () => [] },
|
||||
disabled: { type: Boolean, default: false },
|
||||
uploading: { type: Boolean, default: false }
|
||||
uploading: { type: Boolean, default: false },
|
||||
protocolTotalAmount: { type: [String, Number], default: null }
|
||||
})
|
||||
const emit = defineEmits([
|
||||
'update:payment',
|
||||
'update:paymentDetails',
|
||||
'update:protocolTotalAmount',
|
||||
'upload',
|
||||
'change'
|
||||
])
|
||||
|
||||
function emitProtocolTotal(value) {
|
||||
emit('update:protocolTotalAmount', value === '' || value == null ? null : value)
|
||||
emit('change')
|
||||
}
|
||||
|
||||
const payment = computed(() => props.payment || {})
|
||||
const details = computed(() => props.paymentDetails || [])
|
||||
const modeSheetVisible = ref(false)
|
||||
@@ -545,29 +600,12 @@ function removeAttachment(detailIndex, attachmentIndex) {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.protocol-v1-pay__money-field,
|
||||
.protocol-v1-pay__picker-field,
|
||||
.protocol-v1-pay__attachments {
|
||||
padding: 12px 16px;
|
||||
.protocol-v1-pay__total {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.protocol-v1-pay__money-field > label,
|
||||
.protocol-v1-pay__picker-field > label,
|
||||
.protocol-v1-pay__attachments > label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
color: #42584e;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.protocol-v1-pay__money-field :deep(.van-cell),
|
||||
.protocol-v1-pay__picker-field :deep(.van-cell) {
|
||||
min-height: 44px;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.protocol-v1-pay__attachments {
|
||||
border-top: 1px solid #edf3f0;
|
||||
.protocol-v1-pay__card .market-form-fields {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.protocol-v1-pay__delete {
|
||||
|
||||
@@ -3,9 +3,7 @@ const SOURCES = new Set(['cell_storage', 'research_donation'])
|
||||
const DEFAULTS = Object.freeze({
|
||||
presign: Object.freeze({ orderStatus: '' }),
|
||||
protocol: Object.freeze({
|
||||
protocolStatus: '',
|
||||
createTimeRange: Object.freeze([]),
|
||||
sampleCollectTimeRange: Object.freeze([])
|
||||
protocolStatus: ''
|
||||
}),
|
||||
'payment-chase': Object.freeze({ chaseType: '', payMode: '' }),
|
||||
payment: Object.freeze({
|
||||
@@ -36,24 +34,13 @@ function addText(result, key, value) {
|
||||
if (normalized) result[key] = normalized
|
||||
}
|
||||
|
||||
function addRange(result, range, startKey, endKey) {
|
||||
if (!Array.isArray(range) || range.length !== 2) return
|
||||
const start = text(range[0])
|
||||
const end = text(range[1])
|
||||
if (!start || !end) return
|
||||
result[startKey] = start
|
||||
result[endKey] = end
|
||||
}
|
||||
|
||||
export function createListFilters(module, source = '') {
|
||||
const result = cloneDefaults(module)
|
||||
if (module === 'protocol') {
|
||||
result.source = SOURCES.has(text(source)) ? text(source) : 'cell_storage'
|
||||
return {
|
||||
source: result.source,
|
||||
protocolStatus: result.protocolStatus,
|
||||
createTimeRange: result.createTimeRange,
|
||||
sampleCollectTimeRange: result.sampleCollectTimeRange
|
||||
protocolStatus: result.protocolStatus
|
||||
}
|
||||
}
|
||||
return result
|
||||
@@ -67,13 +54,6 @@ export function buildListParams(module, filters = {}) {
|
||||
const source = text(filters.source)
|
||||
if (SOURCES.has(source)) result.source = source
|
||||
addText(result, 'protocolStatus', filters.protocolStatus)
|
||||
addRange(result, filters.createTimeRange, 'createTimeStart', 'createTimeEnd')
|
||||
addRange(
|
||||
result,
|
||||
filters.sampleCollectTimeRange,
|
||||
'sampleCollectTimeStart',
|
||||
'sampleCollectTimeEnd'
|
||||
)
|
||||
} else if (module === 'payment-chase') {
|
||||
addText(result, 'chaseType', filters.chaseType)
|
||||
addText(result, 'payMode', filters.payMode)
|
||||
|
||||
@@ -11,19 +11,15 @@ test('creates isolated defaults for every market module', () => {
|
||||
const first = createListFilters('protocol', 'cell_storage')
|
||||
const second = createListFilters('protocol', 'research_donation')
|
||||
|
||||
first.createTimeRange.push('2026-10-01')
|
||||
first.protocolStatus = 'sxz'
|
||||
|
||||
assert.deepEqual(first, {
|
||||
source: 'cell_storage',
|
||||
protocolStatus: '',
|
||||
createTimeRange: ['2026-10-01'],
|
||||
sampleCollectTimeRange: []
|
||||
protocolStatus: 'sxz'
|
||||
})
|
||||
assert.deepEqual(second, {
|
||||
source: 'research_donation',
|
||||
protocolStatus: '',
|
||||
createTimeRange: [],
|
||||
sampleCollectTimeRange: []
|
||||
protocolStatus: ''
|
||||
})
|
||||
assert.deepEqual(createListFilters('presign'), { orderStatus: '' })
|
||||
assert.deepEqual(createListFilters('payment-chase'), { chaseType: '', payMode: '' })
|
||||
@@ -37,16 +33,10 @@ test('maps every web-equivalent filter to backend query names', () => {
|
||||
})
|
||||
assert.deepEqual(buildListParams('protocol', {
|
||||
source: 'cell_storage',
|
||||
protocolStatus: 'sxz',
|
||||
createTimeRange: ['2026-10-01', '2026-10-13'],
|
||||
sampleCollectTimeRange: ['2026-09-01', '2026-09-30']
|
||||
protocolStatus: 'sxz'
|
||||
}), {
|
||||
source: 'cell_storage',
|
||||
protocolStatus: 'sxz',
|
||||
createTimeStart: '2026-10-01',
|
||||
createTimeEnd: '2026-10-13',
|
||||
sampleCollectTimeStart: '2026-09-01',
|
||||
sampleCollectTimeEnd: '2026-09-30'
|
||||
protocolStatus: 'sxz'
|
||||
})
|
||||
assert.deepEqual(buildListParams('payment', {
|
||||
payMode: 'fq',
|
||||
@@ -76,10 +66,8 @@ test('drops incomplete ranges and counts only user-selectable filters', () => {
|
||||
}), { progressStatus: 'yjq' })
|
||||
assert.equal(activeFilterCount('protocol', {
|
||||
source: 'cell_storage',
|
||||
protocolStatus: 'sxz',
|
||||
createTimeRange: ['2026-10-01', '2026-10-13'],
|
||||
sampleCollectTimeRange: []
|
||||
}), 2)
|
||||
protocolStatus: 'sxz'
|
||||
}), 1)
|
||||
assert.equal(activeFilterCount('freight', {
|
||||
transportMode: '', sampleSource: 'research_donation'
|
||||
}), 1)
|
||||
|
||||
@@ -127,21 +127,20 @@ function protocolCard(item) {
|
||||
const collectDate = String(item.sampleCollectTime || '').slice(0, 10)
|
||||
return {
|
||||
title: text(item.motherName || item.customerName),
|
||||
subtitle: `${label(SOURCE_LABELS, item.source)} · ${text(item.labStorageCode || item.sampleCode)}`,
|
||||
subtitle: `${label(SOURCE_LABELS, item.source)} · ${text(item.sampleCode || item.labStorageCode)}`,
|
||||
status,
|
||||
statusTone: statusTag.tagType,
|
||||
fields: [
|
||||
field('样本编码', item.sampleCode || item.labStorageCode),
|
||||
field('采集日期', collectDate || item.donationDate),
|
||||
field('当月核量号', item.monthlyVerifyNo),
|
||||
field('实验室流转编号', item.labStorageCode || item.sampleCode, { wide: true }),
|
||||
field('协议状态', status, { tag: true, tagType: statusTag.tagType }),
|
||||
field('实验室流转编号', item.labStorageCode || item.sampleCode),
|
||||
field('废弃原因', item.voidDesc),
|
||||
field('母亲姓名', item.motherName || item.customerName),
|
||||
field('样本类型', item.sampleTypeName),
|
||||
field('采集地区', referenceName(item.regionName, item.regionId)),
|
||||
field('采集医院', referenceName(item.hospitalName, item.hospitalId), { wide: true }),
|
||||
field('分娩时间', item.newbornDeliveryTime, { wide: true }),
|
||||
field('采集时间', item.sampleCollectTime, { wide: true }),
|
||||
field('采集医院', referenceName(item.hospitalName, item.hospitalId)),
|
||||
field('分娩时间', item.newbornDeliveryTime),
|
||||
field('采集时间', item.sampleCollectTime),
|
||||
field('市场专员', personName(item.salesUserName, item.salesUserId)),
|
||||
field('地区经理', personName(item.regionManagerUserName || item.managerName, item.regionManagerUserId)),
|
||||
field('运输方式', item.transportModeLabel || item.transportMode),
|
||||
@@ -149,18 +148,17 @@ function protocolCard(item) {
|
||||
field('新生儿体重', item.newbornWeightGram),
|
||||
field('分娩方式', label(DELIVERY_MODE_LABELS, item.deliveryMode)),
|
||||
field('胎次', item.birthOrder),
|
||||
field('母血采集时间', item.maternalBloodCollectTime, { wide: true }),
|
||||
field('母血采集时间', item.maternalBloodCollectTime),
|
||||
field('知情同意书', attachmentPresence(item.consentFormUrls)),
|
||||
field('传染病检测报告', attachmentPresence(item.infectiousDiseaseReportUrls)),
|
||||
field('协议书', attachmentPresence(item.attachmentUrls)),
|
||||
field('备注', item.remark, { wide: true })
|
||||
field('备注', item.remark)
|
||||
],
|
||||
actions: ['view', ...actions]
|
||||
}
|
||||
}
|
||||
const subtitleParts = [
|
||||
label(SOURCE_LABELS, item.source),
|
||||
text(item.protocolNo, ''),
|
||||
text(item.sampleCode, '')
|
||||
].filter(Boolean)
|
||||
return {
|
||||
@@ -169,23 +167,20 @@ function protocolCard(item) {
|
||||
status,
|
||||
statusTone: statusTag.tagType,
|
||||
fields: [
|
||||
field('状态', status, { tag: true, tagType: statusTag.tagType }),
|
||||
field('协议编号', item.protocolNo, { wide: true }),
|
||||
field('样本编码', item.sampleCode),
|
||||
field('登记日期', item.registerDate || item.donationDate),
|
||||
field('母亲姓名', item.motherName || item.customerName),
|
||||
field('母亲电话', item.motherPhone),
|
||||
field('母亲身份证号', item.motherIdCard, { wide: true }),
|
||||
field('母亲身份证号', item.motherIdCard),
|
||||
field('父亲姓名', item.fatherName),
|
||||
field('新生儿性别', label(NEWBORN_SEX_LABELS, item.newbornSex)),
|
||||
field('分娩方式', label(DELIVERY_MODE_LABELS, item.deliveryMode)),
|
||||
field('新生儿体重(克)', item.newbornWeightGram),
|
||||
field('采集地区', referenceName(item.regionName, item.regionId)),
|
||||
field('采集医院', referenceName(item.hospitalName, item.hospitalId), { wide: true }),
|
||||
field('采集医院', referenceName(item.hospitalName, item.hospitalId)),
|
||||
field('采集专员', personName(item.collectorUserName, item.collectorUserId)),
|
||||
field('市场专员', personName(item.salesUserName, item.salesUserId)),
|
||||
field('样本采集时间', item.sampleCollectTime, { wide: true }),
|
||||
field('样本编码', item.sampleCode, { wide: true }),
|
||||
field('创建时间', item.createTime, { wide: true })
|
||||
field('样本采集时间', item.sampleCollectTime),
|
||||
field('创建时间', item.createTime)
|
||||
],
|
||||
actions: ['view', ...actions]
|
||||
}
|
||||
@@ -211,12 +206,15 @@ function chaseCard(item) {
|
||||
status: timing,
|
||||
...(chaseTag ? { statusTone: chaseTag.tagType } : {}),
|
||||
fields: [
|
||||
field('协议号', item.protocolNo, { wide: true }), field('客户', item.motherName),
|
||||
field('联系电话', item.motherPhone), field('样本编码', item.sampleCode, { wide: true }),
|
||||
field('客户', item.motherName),
|
||||
field('联系电话', item.motherPhone),
|
||||
field('样本编码', item.sampleCode),
|
||||
field('市场专员', personName(item.salesUserName, item.salesUserId)),
|
||||
field('缴费方式', mode.label, { tag: true, tagType: mode.tagType }),
|
||||
field('期次', `第 ${text(item.scheduleNo, '1')} 期`), field('应缴日', item.dueDate),
|
||||
field('应缴金额', money(item.dueAmount), { money: true }), field('已缴金额', money(item.paidAmount), { money: true }),
|
||||
field('期次', `第 ${text(item.scheduleNo, '1')} 期`),
|
||||
field('应缴日', item.dueDate),
|
||||
field('应缴金额', money(item.dueAmount), { money: true }),
|
||||
field('已缴金额', money(item.paidAmount), { money: true }),
|
||||
field('欠缴金额', money(item.arrearsAmount), { money: true }),
|
||||
chaseField,
|
||||
field('协议状态', protocol.label, { tag: true, tagType: protocol.tagType })
|
||||
|
||||
@@ -40,8 +40,12 @@ test('protocol card exposes web parity fields without truncating to three rows',
|
||||
allowedActions: ['audit', 'edit', 'delete']
|
||||
})
|
||||
assert.equal(card.title, '李安然')
|
||||
assert.equal(card.subtitle, '细胞存储 · XBC-001 · S-001')
|
||||
assert.ok(card.fields.some((item) => item.label === '协议编号' && item.value === 'XBC-001'))
|
||||
assert.equal(card.subtitle, '细胞存储 · S-001')
|
||||
assert.equal(card.fields[0].label, '样本编码')
|
||||
assert.equal(card.fields[0].value, 'S-001')
|
||||
assert.ok(!card.fields.some((item) => item.label === '协议编号'))
|
||||
assert.ok(!card.fields.some((item) => item.label === '状态'))
|
||||
assert.ok(card.fields.every((item) => !item.wide))
|
||||
assert.ok(card.fields.length >= 12)
|
||||
assert.deepEqual(card.actions, ['view', 'edit', 'delete'])
|
||||
assert.equal(buildMarketCard('protocol', 'specialist', {
|
||||
@@ -69,8 +73,8 @@ test('voided protocol cards append the backend void type label like Web', () =>
|
||||
})
|
||||
|
||||
assert.equal(card.status, '已作废(租户自定义作废)')
|
||||
assert.ok(card.fields.some(
|
||||
(field) => ['状态', '协议状态'].includes(field.label) && field.value === card.status
|
||||
assert.ok(!card.fields.some(
|
||||
(field) => ['状态', '协议状态'].includes(field.label)
|
||||
))
|
||||
}
|
||||
})
|
||||
@@ -106,14 +110,18 @@ test('research donation protocol card matches excel-parity field set', () => {
|
||||
allowedActions: ['edit']
|
||||
})
|
||||
const labels = card.fields.map((f) => f.label)
|
||||
assert.equal(labels[0], '样本编码')
|
||||
for (const label of [
|
||||
'当月核量号', '实验室流转编号', '协议状态', '废弃原因', '样本类型',
|
||||
'样本编码', '当月核量号', '实验室流转编号', '废弃原因', '样本类型',
|
||||
'采集地区', '采集医院', '分娩时间', '采集时间', '市场专员', '地区经理',
|
||||
'运输方式', '新生儿性别', '新生儿体重', '分娩方式', '胎次', '母血采集时间',
|
||||
'知情同意书', '传染病检测报告', '协议书', '备注'
|
||||
]) {
|
||||
assert.ok(labels.includes(label), `missing ${label}`)
|
||||
}
|
||||
assert.ok(!labels.includes('协议状态'))
|
||||
assert.ok(!labels.includes('协议编号'))
|
||||
assert.ok(card.fields.every((item) => !item.wide))
|
||||
assert.equal(card.fields.find((f) => f.label === '当月核量号').value, '202508001')
|
||||
assert.equal(card.fields.find((f) => f.label === '知情同意书').value, '有')
|
||||
assert.equal(card.fields.find((f) => f.label === '传染病检测报告').value, '—')
|
||||
@@ -201,6 +209,8 @@ test('payment chase keeps the Web action column while paid totals remain card da
|
||||
assert.deepEqual(card.actions, ['view-payment', 'view-protocol'])
|
||||
assert.equal(card.fields.find((field) => field.label === '市场专员').value, '未知人员')
|
||||
assert.ok(card.fields.some((field) => field.label === '催缴状态'))
|
||||
assert.ok(!card.fields.some((field) => field.label === '协议号'))
|
||||
assert.ok(card.fields.every((field) => !field.wide))
|
||||
})
|
||||
|
||||
test('freight card shows the scope-safe visible count and collapsible sample blocks for both roles', () => {
|
||||
|
||||
@@ -57,7 +57,7 @@ test('market list visual contract keeps search white, tags filled and actions ri
|
||||
assert.match(styles, /\.market-list__filters\s*\{[\s\S]*?background:\s*#fff;/)
|
||||
assert.match(styles, /\.presign-order-page__search\s*\{[\s\S]*?top:\s*0;/)
|
||||
assert.match(styles, /\.market-list-card__actions\s*\{[\s\S]*?justify-content:\s*flex-end;/)
|
||||
assert.match(styles, /\.market-list-card__actions \.van-button\s*\{[\s\S]*?padding:\s*0 8px;/)
|
||||
assert.match(styles, /\.market-list-card__actions \.van-button\s*\{[\s\S]*?padding:\s*0 12px;/)
|
||||
const listCard = source('./components/MarketListCard.vue')
|
||||
assert.doesNotMatch(listCard, /#icon/)
|
||||
assert.doesNotMatch(listCard, /actionIcon/)
|
||||
@@ -112,6 +112,8 @@ test('protocol lists wire dual source tabs into listParams and create navigation
|
||||
assert.match(genericList, /clearStalePointerLocks/)
|
||||
assert.match(styles, /\.market-source-tabs__btn\s*\{/)
|
||||
assert.match(styles, /cursor:\s*pointer/)
|
||||
assert.match(styles, /\.market-source-tabs__list\s*\{/)
|
||||
assert.match(genericList, /market-source-tabs__list/)
|
||||
assert.doesNotMatch(styles, /\.market-list__filters\s*\{[^}]*position:\s*sticky/)
|
||||
})
|
||||
|
||||
@@ -164,6 +166,22 @@ test('payment list uses inline dropdown filters like presign instead of filter s
|
||||
assert.match(genericList, /market-list__filter-row/)
|
||||
})
|
||||
|
||||
test('payment-chase list uses inline dropdown filters like presign instead of filter sheet', () => {
|
||||
const chase = source('./modules/payment-chase.js')
|
||||
const filters = source('./list-filters.js')
|
||||
const genericList = source('../views/market/MarketModuleList.vue')
|
||||
|
||||
assert.match(chase, /inlineDropdownFilters/)
|
||||
assert.match(chase, /全部催缴类型/)
|
||||
assert.match(chase, /全部缴费方式/)
|
||||
assert.match(chase, /filterFields:\s*\[\]/)
|
||||
assert.doesNotMatch(chase, /label:\s*'催缴类型'/)
|
||||
assert.match(filters, /'payment-chase': Object\.freeze\(\{[\s\S]*?chaseType: ''[\s\S]*?payMode: ''/)
|
||||
assert.match(genericList, /inlineDropdownFilters/)
|
||||
assert.match(genericList, /market-list__filter-row/)
|
||||
assert.match(genericList, /van-dropdown-menu/)
|
||||
})
|
||||
|
||||
test('freight list and detail wire cascade delete with confirm', () => {
|
||||
const freight = source('./modules/freight.js')
|
||||
const list = source('../views/market/MarketModuleList.vue')
|
||||
@@ -212,6 +230,22 @@ test('payment list cards collapse period blocks by default and allow independent
|
||||
assert.match(styles, /\.market-list-card__period-toggle\s*\{[\s\S]*?min-height:\s*44px;/)
|
||||
})
|
||||
|
||||
test('payment list cards fold main fields periods and footer by default', () => {
|
||||
const card = source('./components/MarketListCard.vue')
|
||||
|
||||
assert.match(card, /'payment'/)
|
||||
assert.match(card, /FIELD_FOLD_MODULES/)
|
||||
assert.match(card, /showFoldedFooter/)
|
||||
assert.match(card, /foldHiddenCount/)
|
||||
assert.match(card, /展开更多/)
|
||||
assert.doesNotMatch(card, /fields-fold--top/)
|
||||
// 期次块始终在「展开更多」上方,不收进总折叠
|
||||
assert.match(card, /每一期缴费/)
|
||||
assert.match(card, /card\.periodBlocks\?\.length/)
|
||||
assert.doesNotMatch(card, /periodBlocks\?\.length && showFolded/)
|
||||
assert.match(card, /footerFields\?\.length && showFoldedFooter/)
|
||||
})
|
||||
|
||||
test('dedicated presign list wires orderStatus dropdown without reset on mobile', () => {
|
||||
const presignList = source('../views/market/presign/PresignOrderList.vue')
|
||||
const styles = source('../styles/market.css')
|
||||
@@ -227,6 +261,19 @@ test('dedicated presign list wires orderStatus dropdown without reset on mobile'
|
||||
assert.doesNotMatch(styles, /\.presign-order-page__filter-row\s+\.van-button\s*\{/)
|
||||
})
|
||||
|
||||
test('presign list cards collapse extra fields by default and allow expand', () => {
|
||||
const card = source('./components/PresignOrderCard.vue')
|
||||
const styles = source('../styles/market.css')
|
||||
|
||||
assert.match(card, /FIELD_PREVIEW_COUNT\s*=\s*4/)
|
||||
assert.match(card, /fieldsOpen/)
|
||||
assert.match(card, /collapsedFields/)
|
||||
assert.match(card, /展开更多/)
|
||||
assert.match(card, /收起/)
|
||||
assert.match(styles, /\.presign-order-card__fields-fold\s*\{/)
|
||||
assert.match(styles, /\.presign-order-card__fields-toggle\s*\{[\s\S]*?min-height:\s*40px;/)
|
||||
})
|
||||
|
||||
test('freight sample selector supports source filters, server paging and confirmations', () => {
|
||||
const form = source('../views/market/MarketModuleForm.vue')
|
||||
const freight = source('./modules/freight.js')
|
||||
@@ -252,13 +299,37 @@ test('freight sample selector supports source filters, server paging and confirm
|
||||
assert.match(styles, /\.market-sample-option \.van-checkbox__label\s*\{[\s\S]*?overflow-wrap:\s*anywhere;/)
|
||||
})
|
||||
|
||||
test('protocol list uses inline protocol-status dropdown like presign instead of filter sheet', () => {
|
||||
const protocol = source('./modules/protocol.js')
|
||||
const filters = source('./list-filters.js')
|
||||
const genericList = source('../views/market/MarketModuleList.vue')
|
||||
|
||||
assert.match(protocol, /inlineDropdownFilters/)
|
||||
assert.match(protocol, /全部协议状态/)
|
||||
assert.match(protocol, /filterFields:\s*\[\]/)
|
||||
assert.doesNotMatch(protocol, /createTimeRange/)
|
||||
assert.doesNotMatch(protocol, /sampleCollectTimeRange/)
|
||||
assert.match(filters, /protocol: Object\.freeze\(\{[\s\S]*?protocolStatus: ''/)
|
||||
assert.doesNotMatch(filters, /createTimeRange/)
|
||||
assert.match(genericList, /inlineDropdownFilters/)
|
||||
assert.match(genericList, /market-list__filter-row/)
|
||||
})
|
||||
|
||||
test('protocol list exposes mobile batch selection and sequential authorized deletion', () => {
|
||||
const genericList = source('../views/market/MarketModuleList.vue')
|
||||
const styles = source('../styles/market.css')
|
||||
assert.match(genericList, /batchSelectionMode/)
|
||||
assert.match(genericList, /selectedRecordIds/)
|
||||
assert.match(genericList, /deleteMarketItemsSequentially/)
|
||||
assert.match(genericList, /批量删除/)
|
||||
assert.match(genericList, /未处理/)
|
||||
assert.match(genericList, /market-source-tabs__more/)
|
||||
assert.match(genericList, /toggleBatchSelectionMode/)
|
||||
assert.match(genericList, /market-list__batch-bar/)
|
||||
assert.match(genericList, /toggleSelectAll/)
|
||||
assert.doesNotMatch(genericList, /market-list__batch-toolbar/)
|
||||
assert.match(styles, /\.market-list__batch-bar\s*\{/)
|
||||
assert.match(styles, /\.market-source-tabs__more\s*\{/)
|
||||
})
|
||||
|
||||
test('market detail contains no protocol audit interaction', () => {
|
||||
@@ -493,13 +564,46 @@ test('protocol cards expose the same business fields as the web list', async ()
|
||||
})
|
||||
|
||||
assert.deepEqual(card.fields.map((field) => field.label), [
|
||||
'状态', '协议编号', '登记日期', '母亲姓名', '母亲电话', '母亲身份证号', '父亲姓名',
|
||||
'样本编码', '登记日期', '母亲电话', '母亲身份证号', '父亲姓名',
|
||||
'新生儿性别', '分娩方式', '新生儿体重(克)', '采集地区', '采集医院',
|
||||
'采集专员', '市场专员', '样本采集时间', '样本编码', '创建时间'
|
||||
'采集专员', '市场专员', '样本采集时间', '创建时间'
|
||||
])
|
||||
assert.ok(card.fields.every((field) => !field.wide))
|
||||
assert.deepEqual(card.actions, ['view', 'edit', 'delete'])
|
||||
})
|
||||
|
||||
test('protocol list cards collapse extra fields by default and allow expand', () => {
|
||||
const card = source('./components/MarketListCard.vue')
|
||||
const styles = source('../styles/market.css')
|
||||
|
||||
assert.match(card, /FIELD_PREVIEW_COUNT\s*=\s*4/)
|
||||
assert.match(card, /FIELD_FOLD_MODULES/)
|
||||
assert.match(card, /fieldsOpen/)
|
||||
assert.match(card, /collapsedFields/)
|
||||
assert.match(card, /展开更多/)
|
||||
assert.match(card, /收起/)
|
||||
assert.match(card, /'protocol'/)
|
||||
assert.match(styles, /\.market-list-card__fields-fold\s*\{/)
|
||||
assert.match(styles, /\.market-list-card__fields-toggle\s*\{[\s\S]*?min-height:\s*40px;/)
|
||||
})
|
||||
|
||||
test('payment-chase list cards collapse extra fields by default and allow expand', async () => {
|
||||
const card = source('./components/MarketListCard.vue')
|
||||
const { buildMarketCard } = await import('./list-presenter.js')
|
||||
|
||||
assert.match(card, /'payment-chase'/)
|
||||
assert.match(card, /FIELD_FOLD_MODULES/)
|
||||
assert.match(card, /fieldsOpen/)
|
||||
assert.match(card, /展开更多/)
|
||||
|
||||
const chase = buildMarketCard('payment-chase', 'specialist', {
|
||||
motherName: '周雨桐', sampleCode: 'S-1', protocolNo: 'P-1'
|
||||
})
|
||||
assert.ok(!chase.fields.some((field) => field.label === '协议号'))
|
||||
assert.ok(chase.fields.every((field) => !field.wide))
|
||||
assert.ok(chase.fields.length > 4)
|
||||
})
|
||||
|
||||
test('protocol, freight and presign details define explicit Chinese nested cards', () => {
|
||||
const protocol = getMarketModule('protocol').detailSections({
|
||||
source: 'cell_storage',
|
||||
@@ -553,17 +657,37 @@ test('protocol create and edit forms expose every writable web business field',
|
||||
'source', 'protocolNo', 'donationNo', 'registerDate', 'donationDate',
|
||||
'collectorUserId', 'protocolTotalAmount', 'remark'
|
||||
])
|
||||
assert.equal(
|
||||
module.formSections.find((section) => section.key === 'protocol')
|
||||
.fields.find((field) => field.key === 'protocolNo').hidden,
|
||||
true
|
||||
)
|
||||
assert.equal(
|
||||
module.formSections.find((section) => section.key === 'protocol')
|
||||
.fields.find((field) => field.key === 'donationNo').hidden,
|
||||
true
|
||||
)
|
||||
assert.equal(
|
||||
module.formSections.find((section) => section.key === 'protocol')
|
||||
.fields.find((field) => field.key === 'protocolTotalAmount').hidden,
|
||||
true
|
||||
)
|
||||
assert.deepEqual(bySection.collection, [
|
||||
'salesUserId', 'regionId', 'hospitalId', 'regionManagerUserId', 'medicalStaff',
|
||||
'sampleCollectTime', 'maternalBloodCollectTime', 'remark'
|
||||
'sampleCollectTime', 'maternalBloodCollectTime'
|
||||
])
|
||||
assert.deepEqual(bySection.customer, [
|
||||
'motherName', 'motherPhone', 'motherIdCard', 'motherEmail', 'motherBirthYm',
|
||||
'motherEthnic', 'motherAddress', 'fatherName', 'fatherPhone', 'fatherIdCard',
|
||||
'newbornName', 'newbornSex', 'expectedDeliveryDate', 'newbornDeliveryTime',
|
||||
'newbornIdCard', 'deliveryMode', 'birthOrder', 'newbornWeightGram',
|
||||
'apgar1min', 'apgar5min', 'remark'
|
||||
'apgar1min'
|
||||
])
|
||||
assert.equal(
|
||||
module.formSections.find((section) => section.key === 'customer')
|
||||
.fields.find((field) => field.key === 'motherEthnic').searchable,
|
||||
true
|
||||
)
|
||||
assert.equal(bySection.samples, undefined)
|
||||
assert.deepEqual(bySection.attachments, [
|
||||
'protocolAttachments', 'consentFormUrls', 'healthSurveyFormUrls',
|
||||
@@ -580,7 +704,7 @@ test('protocol create and edit forms expose every writable web business field',
|
||||
)
|
||||
assert.deepEqual(
|
||||
customer.fields.find((field) => field.key === 'motherEthnic'),
|
||||
{ key: 'motherEthnic', label: '母亲民族', type: 'select', optionKey: 'ethnicities' }
|
||||
{ key: 'motherEthnic', label: '母亲民族', type: 'select', optionKey: 'ethnicities', searchable: true }
|
||||
)
|
||||
const form = source('../views/market/MarketModuleForm.vue')
|
||||
assert.match(form, /ProtocolSampleTransportPanel/)
|
||||
@@ -601,6 +725,10 @@ test('protocol create and edit forms expose every writable web business field',
|
||||
assert.match(samplePanel, /特殊说明/)
|
||||
assert.match(samplePanel, /showPrice/)
|
||||
assert.match(samplePanel, /autoGenerateCode/)
|
||||
assert.match(samplePanel, /PresignSelectField/)
|
||||
assert.match(samplePanel, /codeSelectOptions/)
|
||||
assert.match(samplePanel, /searchable/)
|
||||
assert.match(samplePanel, /market-form-field/)
|
||||
const payPanel = source('../market/components/ProtocolSamplePaymentPanel.vue')
|
||||
assert.match(payPanel, /applyPreferentialPriceToPayment/)
|
||||
assert.match(payPanel, /lastPreferentialByCode/)
|
||||
@@ -613,6 +741,21 @@ test('protocol create and edit forms expose every writable web business field',
|
||||
assert.doesNotMatch(payPanel, /canManageTransfers/)
|
||||
assert.match(payPanel, /performMarketAction|register-transfer/)
|
||||
assert.match(payPanel, /module:\s*'payment'/)
|
||||
assert.match(payPanel, /协议总金额/)
|
||||
assert.match(payPanel, /protocolTotalAmount/)
|
||||
assert.match(payPanel, /market-form-field/)
|
||||
assert.match(payPanel, /添加转账/)
|
||||
assert.match(payPanel, /canAddTransfer/)
|
||||
assert.match(samplePanel, /loadExistingFreights/)
|
||||
assert.match(samplePanel, /includeItems/)
|
||||
const customerSearch = source('../market/components/ProtocolCustomerSearchField.vue')
|
||||
assert.match(customerSearch, /border:\s*0/)
|
||||
assert.match(customerSearch, /runSearch/)
|
||||
assert.match(form, /applyProtocolCreateDefaults/)
|
||||
assert.match(form, /protocol-form-defaults/)
|
||||
assert.match(form, /currentUserRegions|applyCollectionRegion/)
|
||||
assert.match(form, /onProtocolTotalAmountChange/)
|
||||
assert.doesNotMatch(form, /样本合同合计/)
|
||||
assert.doesNotMatch(payPanel, /module:\s*'protocol'[\s\S]*uploadTransferFile/)
|
||||
assert.match(form, /:protocol-id=/)
|
||||
assert.doesNotMatch(form, /:can-manage-transfers="true"/)
|
||||
|
||||
@@ -307,6 +307,9 @@ test('protocol source is selectable only while creating and exposes all attachme
|
||||
assert.equal(fields.find((field) => field.key === 'source').createOnly, true)
|
||||
assert.equal(fields.find((field) => field.key === 'source').type, 'tabs')
|
||||
assert.ok(fields.some((field) => field.key === 'protocolTotalAmount'))
|
||||
assert.equal(fields.find((field) => field.key === 'protocolNo').hidden, true)
|
||||
assert.equal(fields.find((field) => field.key === 'donationNo').hidden, true)
|
||||
assert.equal(fields.find((field) => field.key === 'protocolTotalAmount').hidden, true)
|
||||
assert.ok(fields.some((field) => field.key === 'healthSurveyFormUrls'))
|
||||
assert.ok(fields.some((field) => field.key === 'infectiousDiseaseReportUrls'))
|
||||
})
|
||||
|
||||
@@ -15,15 +15,21 @@ export default {
|
||||
{ text: '已逾期', value: 'overdue' },
|
||||
{ text: '未来 30 天', value: 'upcoming' }
|
||||
],
|
||||
filterFields: [
|
||||
// 催缴列表用搜索下方 van-dropdown-menu(对齐预签约),不走筛选弹层
|
||||
filterFields: [],
|
||||
inlineDropdownFilters: [
|
||||
{
|
||||
key: 'chaseType', label: '催缴类型', type: 'select', options: [
|
||||
key: 'chaseType',
|
||||
allText: '全部催缴类型',
|
||||
options: [
|
||||
{ text: '仅逾期', value: 'overdue' },
|
||||
{ text: '仅未来30天', value: 'upcoming' }
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'payMode', label: '缴费方式', type: 'select', options: [
|
||||
key: 'payMode',
|
||||
allText: '全部缴费方式',
|
||||
options: [
|
||||
{ text: '趸交', value: 'dj' },
|
||||
{ text: '分期', value: 'fq' },
|
||||
{ text: '分改趸', value: 'fgd' }
|
||||
|
||||
@@ -410,9 +410,14 @@ export default {
|
||||
{ text: '细胞存储', value: 'cell_storage' },
|
||||
{ text: '科研捐赠', value: 'research_donation' }
|
||||
],
|
||||
filterFields: [
|
||||
// 协议列表用搜索下方 van-dropdown-menu(对齐预签约),不走筛选弹层
|
||||
filterFields: [],
|
||||
inlineDropdownFilters: [
|
||||
{
|
||||
key: 'protocolStatus', label: '协议状态', type: 'select', source: 'cell_storage', options: [
|
||||
key: 'protocolStatus',
|
||||
allText: '全部协议状态',
|
||||
source: 'cell_storage',
|
||||
options: [
|
||||
{ text: '待生效', value: 'dsx' },
|
||||
{ text: '生效中', value: 'sxz' },
|
||||
{ text: '已过期', value: 'ygq' },
|
||||
@@ -420,9 +425,7 @@ export default {
|
||||
{ text: '属地废弃', value: 'sdfq' },
|
||||
{ text: '转科研', value: 'zky' }
|
||||
]
|
||||
},
|
||||
{ key: 'createTimeRange', label: '创建时间', type: 'date-range', source: 'cell_storage' },
|
||||
{ key: 'sampleCollectTimeRange', label: '样本采集时间', type: 'date-range', source: 'cell_storage' }
|
||||
}
|
||||
],
|
||||
statusLabel(detail) {
|
||||
const basic = detail?.protocol || detail?.basic || detail || {}
|
||||
@@ -729,12 +732,14 @@ export default {
|
||||
{ key: 'source', label: '业务来源', type: 'tabs', required: true, createOnly: true, options: [
|
||||
{ text: '细胞存储', value: 'cell_storage' }, { text: '科研捐赠', value: 'research_donation' }
|
||||
] },
|
||||
{ key: 'protocolNo', label: '协议编号', source: 'cell_storage' },
|
||||
{ key: 'donationNo', label: '捐赠编号', source: 'research_donation' },
|
||||
// 服务端发号:表单不展示,仍参与 payload
|
||||
{ key: 'protocolNo', label: '协议编号', source: 'cell_storage', hidden: true },
|
||||
{ key: 'donationNo', label: '捐赠编号', source: 'research_donation', hidden: true },
|
||||
{ key: 'registerDate', label: '登记日期', type: 'date', valueFormat: 'YYYYMMDD', source: 'cell_storage' },
|
||||
{ key: 'donationDate', label: '捐赠日期', type: 'date', valueFormat: 'YYYYMMDD', source: 'research_donation' },
|
||||
{ key: 'collectorUserId', label: '采集专员', type: 'select', optionKey: 'collectorStaff' },
|
||||
{ key: 'protocolTotalAmount', label: '协议总金额', type: 'number', source: 'cell_storage' },
|
||||
// 展示在缴费信息面板(ProtocolSamplePaymentPanel / ProtocolV1PaymentPanel)
|
||||
{ key: 'protocolTotalAmount', label: '协议总金额', type: 'number', source: 'cell_storage', hidden: true },
|
||||
{ key: 'remark', label: '备注', type: 'textarea' }
|
||||
] },
|
||||
{ key: 'collection', title: '采集信息', nested: true, fields: [
|
||||
@@ -744,8 +749,7 @@ export default {
|
||||
{ key: 'regionManagerUserId', label: '地区经理', type: 'select', optionKey: 'managerStaff' },
|
||||
{ key: 'medicalStaff', label: '采集医护' },
|
||||
{ key: 'sampleCollectTime', label: '样本采集时间', type: 'datetime' },
|
||||
{ key: 'maternalBloodCollectTime', label: '母血采集时间', type: 'datetime' },
|
||||
{ key: 'remark', label: '备注', type: 'textarea' }
|
||||
{ key: 'maternalBloodCollectTime', label: '母血采集时间', type: 'datetime' }
|
||||
] },
|
||||
{ key: 'customer', title: '客户信息', nested: true, fields: [
|
||||
{ key: 'motherName', label: '母亲姓名', type: 'customerSearch', role: 'mother', required: true },
|
||||
@@ -753,7 +757,7 @@ export default {
|
||||
{ key: 'motherIdCard', label: '母亲身份证号' },
|
||||
{ key: 'motherEmail', label: '母亲邮箱' },
|
||||
{ key: 'motherBirthYm', label: '母亲出生年月' },
|
||||
{ key: 'motherEthnic', label: '母亲民族', type: 'select', optionKey: 'ethnicities' },
|
||||
{ key: 'motherEthnic', label: '母亲民族', type: 'select', optionKey: 'ethnicities', searchable: true },
|
||||
{ key: 'motherAddress', label: '母亲家庭住址', type: 'textarea' },
|
||||
{ key: 'fatherName', label: '父亲姓名', type: 'customerSearch', role: 'father' },
|
||||
{ key: 'fatherPhone', label: '父亲电话', type: 'tel' },
|
||||
@@ -770,19 +774,18 @@ export default {
|
||||
] },
|
||||
{ key: 'birthOrder', label: '胎次', type: 'number' },
|
||||
{ key: 'newbornWeightGram', label: '新生儿体重(克)', type: 'number' },
|
||||
{ key: 'apgar1min', label: '新生儿评分(1分钟)', type: 'number' },
|
||||
{ key: 'apgar5min', label: '新生儿评分(5分钟)', type: 'number' },
|
||||
{ key: 'remark', label: '备注', type: 'textarea' }
|
||||
{ key: 'apgar1min', label: '新生儿评分(1分钟)', type: 'number' }
|
||||
] },
|
||||
// 样本及运输改由 ProtocolSampleTransportPanel 托管(对齐 Web)
|
||||
{ key: 'attachments', title: '附件与确认', nested: true, fields: [
|
||||
{ key: 'attachments', title: '附件', nested: true, fields: [
|
||||
{ key: 'protocolAttachments', label: '协议附件', type: 'upload', attachmentPolicy: 'protocol', source: 'cell_storage' },
|
||||
{ key: 'consentFormUrls', label: '知情同意书', type: 'upload', attachmentPolicy: 'protocol' },
|
||||
{ key: 'healthSurveyFormUrls', label: '健康调查表', type: 'upload', attachmentPolicy: 'protocol', source: 'cell_storage' },
|
||||
{ key: 'attachmentUrls', label: '其他附件', type: 'upload', attachmentPolicy: 'protocol', source: 'research_donation' },
|
||||
{ key: 'infectiousDiseaseReportUrls', label: '传染病报告', type: 'upload', attachmentPolicy: 'protocol', source: 'research_donation' }
|
||||
] },
|
||||
{ key: 'confirm', title: '提交确认', nested: true, uiOnly: true, fields: [
|
||||
// 渲染时须置于样本运输 / 缴费面板之后(见 MarketModuleForm)
|
||||
{ key: 'confirm', title: '提交确认', nested: true, uiOnly: true, renderLast: true, fields: [
|
||||
{ key: 'confirmed', label: '我已核对以上信息', type: 'checkbox', required: true }
|
||||
] }
|
||||
]
|
||||
|
||||
@@ -170,13 +170,30 @@ export function collectDfjTransferIds(transfers) {
|
||||
.map((row) => String(row.id).trim())
|
||||
}
|
||||
|
||||
export function formatAutoSubmitFinanceFailureMessage(failures) {
|
||||
export function formatAutoSubmitFinanceFailureMessage(failures, entityLabel = '订单') {
|
||||
const list = Array.isArray(failures) ? failures.filter(Boolean) : []
|
||||
if (!list.length) return ''
|
||||
const reasons = list
|
||||
.map((item) => String(item?.message || item || '提交失败').trim())
|
||||
.filter(Boolean)
|
||||
return `订单已保存,但有 ${list.length} 笔提交财务确认失败:${reasons.join(';')}`
|
||||
const label = String(entityLabel || '订单').trim() || '订单'
|
||||
return `${label}已保存,但有 ${list.length} 笔提交财务确认失败:${reasons.join(';')}`
|
||||
}
|
||||
|
||||
/** 从 v2 samplePayments 展平全部转账笔(供协议保存后自动提交财务) */
|
||||
export function flattenSamplePaymentTransfers(samplePayments) {
|
||||
const payments = Array.isArray(samplePayments) ? samplePayments : []
|
||||
const out = []
|
||||
for (const pay of payments) {
|
||||
const schedules = Array.isArray(pay?.schedules) ? pay.schedules : []
|
||||
for (const sch of schedules) {
|
||||
const transfers = Array.isArray(sch?.transfers) ? sch.transfers : []
|
||||
for (const tr of transfers) {
|
||||
if (tr && typeof tr === 'object') out.push(tr)
|
||||
}
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
export async function submitDfjTransfersOnSave(transfers, submitOne) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
isPresignLocked,
|
||||
isPresignTransferLocked,
|
||||
mergePersistedTransfer,
|
||||
flattenSamplePaymentTransfers,
|
||||
submitDfjTransfersOnSave
|
||||
} from './presign-form-state.js'
|
||||
|
||||
@@ -253,6 +254,28 @@ test('formatAutoSubmitFinanceFailureMessage summarizes count and reasons', () =>
|
||||
]),
|
||||
'订单已保存,但有 2 笔提交财务确认失败:请选择转账方式;请填写转账金额'
|
||||
)
|
||||
assert.equal(
|
||||
formatAutoSubmitFinanceFailureMessage([{ id: 't1', message: '请选择转账方式' }], '协议'),
|
||||
'协议已保存,但有 1 笔提交财务确认失败:请选择转账方式'
|
||||
)
|
||||
})
|
||||
|
||||
test('flattenSamplePaymentTransfers walks nested schedules', () => {
|
||||
assert.deepEqual(
|
||||
flattenSamplePaymentTransfers([
|
||||
{
|
||||
schedules: [
|
||||
{ transfers: [{ id: 'a', payStatus: 'dfj' }] },
|
||||
{ transfers: [{ id: 'b', payStatus: 'jfqrz' }, null] }
|
||||
]
|
||||
},
|
||||
{ schedules: [] }
|
||||
]),
|
||||
[
|
||||
{ id: 'a', payStatus: 'dfj' },
|
||||
{ id: 'b', payStatus: 'jfqrz' }
|
||||
]
|
||||
)
|
||||
})
|
||||
|
||||
test('submitDfjTransfersOnSave submits only dfj ids and continues after failures', async () => {
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/** 协议单新增表单默认值(登记日期 / 采集专员 / 市场专员 / 采集地区 / 民族 / 新生儿性别等) */
|
||||
|
||||
export const DEFAULT_MOTHER_ETHNIC = '汉族'
|
||||
|
||||
export function todayYmd() {
|
||||
const date = new Date()
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${year}${month}${day}`
|
||||
}
|
||||
|
||||
function stringValue(value, fallback = '') {
|
||||
return value == null || value === '' ? fallback : String(value)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Record<string, any>} form
|
||||
* @param {Record<string, any>} options form-options 响应(含 currentUser / currentUserRegions / regions)
|
||||
* @param {{ today?: string }} [opts]
|
||||
*/
|
||||
export function applyProtocolCreateDefaults(form, options = {}, opts = {}) {
|
||||
const next = { ...(form || {}) }
|
||||
const today = stringValue(opts.today, todayYmd())
|
||||
const currentUserId = stringValue(
|
||||
options?.currentUser?.value ?? options?.currentUser?.id
|
||||
)
|
||||
|
||||
if (next.source === 'research_donation') {
|
||||
if (!next.donationDate) next.donationDate = today
|
||||
} else if (!next.registerDate) {
|
||||
next.registerDate = today
|
||||
}
|
||||
|
||||
if (!next.collectorUserId && currentUserId) {
|
||||
next.collectorUserId = currentUserId
|
||||
}
|
||||
|
||||
const collection = { ...(next.collection || {}) }
|
||||
if (!collection.salesUserId && currentUserId) {
|
||||
collection.salesUserId = currentUserId
|
||||
}
|
||||
if (!collection.regionId) {
|
||||
const linked = Array.isArray(options?.currentUserRegions)
|
||||
? options.currentUserRegions
|
||||
: []
|
||||
const first = linked[0]
|
||||
if (first?.value != null && first.value !== '') {
|
||||
collection.regionId = String(first.value)
|
||||
collection.regionName = stringValue(first.label)
|
||||
}
|
||||
}
|
||||
next.collection = collection
|
||||
|
||||
const customer = { ...(next.customer || {}) }
|
||||
if (customer.newbornSex == null || customer.newbornSex === '') {
|
||||
customer.newbornSex = '1'
|
||||
}
|
||||
if (!stringValue(customer.motherEthnic)) {
|
||||
customer.motherEthnic = DEFAULT_MOTHER_ETHNIC
|
||||
}
|
||||
next.customer = customer
|
||||
return next
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
|
||||
import { applyProtocolCreateDefaults } from './protocol-form-defaults.js'
|
||||
|
||||
test('create defaults: newborn sex male, ethnic Han, dates today, collector and sales current user', () => {
|
||||
const next = applyProtocolCreateDefaults(
|
||||
{ source: 'cell_storage', customer: {}, collection: {} },
|
||||
{ currentUser: { value: 'u1', label: '张三' }, currentUserRegions: [] },
|
||||
{ today: '20261015' }
|
||||
)
|
||||
assert.equal(next.registerDate, '20261015')
|
||||
assert.equal(next.collectorUserId, 'u1')
|
||||
assert.equal(next.collection.salesUserId, 'u1')
|
||||
assert.equal(next.customer.newbornSex, '1')
|
||||
assert.equal(next.customer.motherEthnic, '汉族')
|
||||
})
|
||||
|
||||
test('create defaults: donation date for research source', () => {
|
||||
const next = applyProtocolCreateDefaults(
|
||||
{ source: 'research_donation', customer: {}, collection: {} },
|
||||
{ currentUser: { value: 'u1' }, currentUserRegions: [] },
|
||||
{ today: '20261015' }
|
||||
)
|
||||
assert.equal(next.donationDate, '20261015')
|
||||
assert.equal(next.registerDate, undefined)
|
||||
})
|
||||
|
||||
test('create defaults: region uses first of currentUserRegions', () => {
|
||||
const next = applyProtocolCreateDefaults(
|
||||
{ source: 'cell_storage', customer: {}, collection: {} },
|
||||
{
|
||||
currentUser: { value: 'u1' },
|
||||
currentUserRegions: [
|
||||
{ value: 'r-b', label: 'B区' },
|
||||
{ value: 'r-a', label: 'A区' }
|
||||
],
|
||||
regions: [
|
||||
{ value: 'r-a', label: 'A区' },
|
||||
{ value: 'r-b', label: 'B区' },
|
||||
{ value: 'r-c', label: 'C区' }
|
||||
]
|
||||
},
|
||||
{ today: '20261015' }
|
||||
)
|
||||
assert.equal(next.collection.regionId, 'r-b')
|
||||
assert.equal(next.collection.regionName, 'B区')
|
||||
})
|
||||
|
||||
test('create defaults: does not overwrite existing region or collector', () => {
|
||||
const next = applyProtocolCreateDefaults(
|
||||
{
|
||||
source: 'cell_storage',
|
||||
registerDate: '20260101',
|
||||
collectorUserId: 'other',
|
||||
customer: { newbornSex: '0' },
|
||||
collection: { regionId: 'keep', regionName: '保留区', salesUserId: 's1' }
|
||||
},
|
||||
{
|
||||
currentUser: { value: 'u1' },
|
||||
currentUserRegions: [{ value: 'r-b', label: 'B区' }]
|
||||
},
|
||||
{ today: '20261015' }
|
||||
)
|
||||
assert.equal(next.registerDate, '20260101')
|
||||
assert.equal(next.collectorUserId, 'other')
|
||||
assert.equal(next.customer.newbornSex, '0')
|
||||
assert.equal(next.collection.regionId, 'keep')
|
||||
assert.equal(next.collection.salesUserId, 's1')
|
||||
})
|
||||
|
||||
test('create defaults: empty currentUserRegions leaves region blank', () => {
|
||||
const next = applyProtocolCreateDefaults(
|
||||
{ source: 'cell_storage', customer: {}, collection: {} },
|
||||
{ currentUser: { value: 'u1' }, currentUserRegions: [] },
|
||||
{ today: '20261015' }
|
||||
)
|
||||
assert.equal(next.collection.regionId, undefined)
|
||||
})
|
||||
@@ -275,6 +275,14 @@ test('protocol transfer UI calls DELETE for persisted rows without reloading for
|
||||
assert.match(panel, /emit\('transfer-dirty-change'/)
|
||||
})
|
||||
|
||||
test('protocol create/edit save auto-submits dfj transfers to finance', () => {
|
||||
const form = source('../views/market/MarketModuleForm.vue')
|
||||
assert.match(form, /submitDfjTransfersOnSave/)
|
||||
assert.match(form, /flattenSamplePaymentTransfers/)
|
||||
assert.match(form, /formatAutoSubmitFinanceFailureMessage\(failures,\s*'协议'\)/)
|
||||
assert.match(form, /performMarketAction\(paymentCtx,\s*'submit'/)
|
||||
})
|
||||
|
||||
test('protocol uploads use the Web 20MB rich attachment policy', () => {
|
||||
const protocol = source('./modules/protocol.js')
|
||||
const formField = source('./components/MarketFormField.vue')
|
||||
@@ -283,12 +291,18 @@ test('protocol uploads use the Web 20MB rich attachment policy', () => {
|
||||
assert.match(formField, /PROTOCOL_ATTACHMENT_ACCEPT/)
|
||||
})
|
||||
|
||||
test('protocol list and nested payment actions keep 44px mobile touch targets', () => {
|
||||
test('protocol list and nested payment actions use OA-aligned soft semantic buttons', () => {
|
||||
const styles = source('../styles/market.css')
|
||||
const panel = source('./components/ProtocolSamplePaymentPanel.vue')
|
||||
assert.match(styles, /\.market-list-card__actions \.van-button\s*\{[^}]*min-height:\s*32px;/)
|
||||
assert.match(styles, /\.market-list-card__actions \.van-button\s*\{[\s\S]*?padding:\s*0 8px;/)
|
||||
assert.match(panel, /\.protocol-sample-pay__transfer-actions[\s\S]*?\.van-button\s*\{[^}]*min-height:\s*44px;/)
|
||||
assert.match(styles, /\.market-list-card__actions \.van-button\s*\{[\s\S]*?padding:\s*0 12px;/)
|
||||
assert.match(styles, /\.market-page \.van-button--mini\s*\{[\s\S]*?min-height:\s*28px;/)
|
||||
assert.match(styles, /\.market-page \.van-button--mini\s*\{[\s\S]*?border-radius:\s*8px;/)
|
||||
assert.match(styles, /\.market-page \.van-button--primary\s*\{[\s\S]*?background:\s*var\(--market-primary\);/)
|
||||
assert.doesNotMatch(styles, /linear-gradient\(135deg,\s*#12b981/)
|
||||
assert.match(panel, /\.protocol-sample-pay__transfer-actions[\s\S]*?\.van-button[\s\S]*?min-height:\s*28px;/)
|
||||
assert.match(panel, /protocol-sample-pay__timeline/)
|
||||
assert.match(panel, /protocol-sample-pay__sum/)
|
||||
})
|
||||
|
||||
test('protocol form edits v1 with a dedicated mobile panel and never upgrades it while rendering', () => {
|
||||
|
||||
@@ -151,6 +151,31 @@ export function freightDisplay(sample) {
|
||||
return { modeLabel, amount, shared, linkedSampleCount: linked }
|
||||
}
|
||||
|
||||
/** 「关联已有」列表:去重样本编码,超过 max 个时截断为「前 max 个等 N 个」 */
|
||||
export function formatFreightLinkedSampleCodes(freight, { max = 3 } = {}) {
|
||||
const codes = []
|
||||
const seen = new Set()
|
||||
for (const row of freight?.items || []) {
|
||||
const code = String(row?.sampleCode || '').trim()
|
||||
if (!code || seen.has(code)) continue
|
||||
seen.add(code)
|
||||
codes.push(code)
|
||||
}
|
||||
if (!codes.length) return '—'
|
||||
const limit = Number(max)
|
||||
const cap = Number.isFinite(limit) && limit > 0 ? Math.floor(limit) : 3
|
||||
if (codes.length <= cap) return codes.join('、')
|
||||
return `${codes.slice(0, cap).join('、')}等${codes.length}个`
|
||||
}
|
||||
|
||||
/** 「关联已有」列表:创建人展示名,回退到账号标识 */
|
||||
export function formatFreightCreatorName(freight) {
|
||||
const name = String(
|
||||
freight?.createByName || freight?.creatorName || freight?.createBy || ''
|
||||
).trim()
|
||||
return name || '—'
|
||||
}
|
||||
|
||||
export function freightUnlinkRowKey(item) {
|
||||
return `${String(item?.sampleSource || '')}:${String(item?.sampleId || '')}`
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import {
|
||||
buildFreightDraft,
|
||||
buildFreightUnlinkCandidates,
|
||||
emptySampleRow,
|
||||
formatFreightCreatorName,
|
||||
formatFreightLinkedSampleCodes,
|
||||
freightDisplay,
|
||||
partitionFreightConfigSamples,
|
||||
sampleHasFreight,
|
||||
@@ -18,6 +20,47 @@ import {
|
||||
validateSampleRow
|
||||
} from './protocol-sample-transport.js'
|
||||
|
||||
test('formatFreightLinkedSampleCodes joins unique codes and truncates after 3', () => {
|
||||
assert.equal(formatFreightLinkedSampleCodes({ items: [] }), '—')
|
||||
assert.equal(formatFreightLinkedSampleCodes({}), '—')
|
||||
assert.equal(
|
||||
formatFreightLinkedSampleCodes({
|
||||
items: [
|
||||
{ sampleCode: 'S-1' },
|
||||
{ sampleCode: ' S-1 ' },
|
||||
{ sampleCode: 'S-2' },
|
||||
{ sampleCode: '' },
|
||||
{ sampleCode: 'S-3' }
|
||||
]
|
||||
}),
|
||||
'S-1、S-2、S-3'
|
||||
)
|
||||
assert.equal(
|
||||
formatFreightLinkedSampleCodes({
|
||||
items: [
|
||||
{ sampleCode: 'A' },
|
||||
{ sampleCode: 'B' },
|
||||
{ sampleCode: 'C' },
|
||||
{ sampleCode: 'D' }
|
||||
]
|
||||
}),
|
||||
'A、B、C等4个'
|
||||
)
|
||||
})
|
||||
|
||||
test('formatFreightCreatorName prefers display name over raw createBy', () => {
|
||||
assert.equal(formatFreightCreatorName({}), '—')
|
||||
assert.equal(formatFreightCreatorName({ createBy: 'u1' }), 'u1')
|
||||
assert.equal(
|
||||
formatFreightCreatorName({ createByName: '张三', createBy: 'u1' }),
|
||||
'张三'
|
||||
)
|
||||
assert.equal(
|
||||
formatFreightCreatorName({ creatorName: '李四', createBy: 'u2' }),
|
||||
'李四'
|
||||
)
|
||||
})
|
||||
|
||||
test('empty cell sample defaults to collected status', () => {
|
||||
const row = emptySampleRow({ source: 'cell_storage' })
|
||||
assert.equal(row.sampleStatus, 'ycj')
|
||||
@@ -300,10 +343,18 @@ test('sample transport component uses shared money input and display contracts',
|
||||
assert.match(panel, /freightAmount:\s*freightDraft\.freightAmount/)
|
||||
assert.match(panel, /buildFreightCreatePayload/)
|
||||
assert.match(panel, /applyFreightAssignments/)
|
||||
assert.match(panel, /formatFreightLinkedSampleCodes/)
|
||||
assert.match(panel, /formatFreightCreatorName/)
|
||||
assert.match(panel, /样本:\{\{\s*formatFreightLinkedSampleCodes\(item\)\s*\}\}/)
|
||||
assert.match(panel, /创建人:\{\{\s*formatFreightCreatorName\(item\)\s*\}\}/)
|
||||
assert.match(panel, /创建:\{\{\s*item\.createTime\s*\|\|\s*'—'\s*\}\}/)
|
||||
assert.equal((panel.match(/applyFreightLocalAssignments\(assignments\)/g) || []).length, 3)
|
||||
assert.match(panel, /\.protocol-sample-transport__actions\s+:deep\(\.van-button\)/)
|
||||
assert.match(panel, /\.protocol-sample-transport__row-actions\s+:deep\(\.van-button\)/)
|
||||
assert.match(panel, /min-height:\s*44px/)
|
||||
assert.match(panel, /min-height:\s*28px/)
|
||||
assert.match(panel, /protocol-sample-transport__sum/)
|
||||
assert.match(panel, /protocol-sample-transport__freight/)
|
||||
assert.match(panel, /protocol-sample-transport__link-label/)
|
||||
})
|
||||
|
||||
test('protocol form delegates sample serialization to the shared payload builder', () => {
|
||||
|
||||
@@ -123,11 +123,17 @@ export function hydrateProtocolReferenceOptions(options, detail) {
|
||||
...source,
|
||||
collectorStaff: personOptions(
|
||||
source.staff,
|
||||
reference(basic.collectorUserId, basic.collectorUserName)
|
||||
[
|
||||
reference(basic.collectorUserId, basic.collectorUserName),
|
||||
source.currentUser
|
||||
]
|
||||
),
|
||||
salesStaff: personOptions(
|
||||
source.staff,
|
||||
reference(collection.salesUserId, collection.salesUserName)
|
||||
[
|
||||
reference(collection.salesUserId, collection.salesUserName),
|
||||
source.currentUser
|
||||
]
|
||||
),
|
||||
managerStaff: personOptions(
|
||||
source.staff,
|
||||
|
||||
@@ -31,7 +31,11 @@ test('reference options keep scoped choices and add readable current snapshots o
|
||||
|
||||
test('protocol options hydrate all selected reference values from detail labels', () => {
|
||||
const options = hydrateProtocolReferenceOptions(
|
||||
{ staff: [{ value: 'collector-1', label: '现有专员' }], sampleTypes: [] },
|
||||
{
|
||||
staff: [{ value: 'collector-1', label: '现有专员' }],
|
||||
sampleTypes: [],
|
||||
currentUser: { value: 'me-1', label: '当前登录人' }
|
||||
},
|
||||
{
|
||||
basic: { collectorUserId: 'collector-2', collectorUserName: '历史采集员' },
|
||||
collection: {
|
||||
@@ -51,8 +55,14 @@ test('protocol options hydrate all selected reference values from detail labels'
|
||||
)
|
||||
|
||||
assert.deepEqual(options.staff.map((item) => item.label), ['现有专员'])
|
||||
assert.deepEqual(options.collectorStaff.map((item) => item.label), ['现有专员', '历史采集员'])
|
||||
assert.deepEqual(options.salesStaff.map((item) => item.label), ['现有专员', '市场专员'])
|
||||
assert.deepEqual(
|
||||
options.collectorStaff.map((item) => item.label),
|
||||
['现有专员', '历史采集员', '当前登录人']
|
||||
)
|
||||
assert.deepEqual(
|
||||
options.salesStaff.map((item) => item.label),
|
||||
['现有专员', '市场专员', '当前登录人']
|
||||
)
|
||||
assert.deepEqual(options.managerStaff.map((item) => item.label), ['现有专员', '地区经理'])
|
||||
assert.deepEqual(options.regions, [{ value: 'region-1', label: '合肥区域' }])
|
||||
assert.deepEqual(options.hospitals, [{ value: 'hospital-1', label: '省妇幼' }])
|
||||
|
||||
@@ -144,7 +144,10 @@ export function resolveMarketSavedDetailId(module, currentId, result, action) {
|
||||
result?.disappeared === true
|
||||
) return ''
|
||||
if (module === 'payment' && current) return current
|
||||
return String(result?.id || current).trim()
|
||||
const fromResult = String(
|
||||
result?.id || result?.basic?.id || result?.protocol?.id || ''
|
||||
).trim()
|
||||
return fromResult || current
|
||||
}
|
||||
|
||||
const listComponent = () => import('../views/market/MarketModuleList.vue')
|
||||
|
||||
@@ -212,6 +212,10 @@ test('keeps only a validated return path in internal market navigation', () => {
|
||||
test('keeps the payment record route id after creating or editing a transfer', () => {
|
||||
assert.equal(resolveMarketSavedDetailId('payment', 'payment-1', { id: 'transfer-new' }), 'payment-1')
|
||||
assert.equal(resolveMarketSavedDetailId('protocol', 'protocol-1', { id: 'protocol-1' }), 'protocol-1')
|
||||
assert.equal(
|
||||
resolveMarketSavedDetailId('protocol', '', { basic: { id: 'protocol-from-basic' } }),
|
||||
'protocol-from-basic'
|
||||
)
|
||||
assert.equal(resolveMarketSavedDetailId('presign', '', { id: 'presign-new' }), 'presign-new')
|
||||
})
|
||||
|
||||
|
||||
+388
-143
@@ -117,33 +117,71 @@
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.market-list__filter-row .van-dropdown-menu__title {
|
||||
padding: 0 14px 0 0;
|
||||
/*
|
||||
* 市场部筛选下拉箭头(列表 / 样本工具栏 / 预签约共用):
|
||||
* 不用 Vant「边框拐角 + 旋转」(折叠偏低、展开偏高),改用对称正三角,与文字 flex 居中。
|
||||
*/
|
||||
.market-list__filter-row .van-dropdown-menu__title,
|
||||
.market-sample-toolbar__filter-row .van-dropdown-menu__title,
|
||||
.presign-order-page__filter-row .van-dropdown-menu__title {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 0;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.market-list__filter-row .van-dropdown-menu__title,
|
||||
.market-sample-toolbar__filter-row .van-dropdown-menu__title {
|
||||
color: var(--market-text, #1f2937);
|
||||
}
|
||||
|
||||
.market-list__filter-row .van-dropdown-menu__title::after {
|
||||
top: 50%;
|
||||
right: 0;
|
||||
margin-top: 0;
|
||||
border-color: transparent transparent currentColor currentColor;
|
||||
opacity: 0.7;
|
||||
transform: translateY(-50%) rotate(-45deg);
|
||||
.presign-order-page__filter-row .van-dropdown-menu__title {
|
||||
color: var(--presign-text, #18332a);
|
||||
}
|
||||
|
||||
.market-list__filter-row .van-dropdown-menu__title--down::after {
|
||||
margin-top: 0;
|
||||
transform: translateY(-50%) rotate(135deg);
|
||||
.market-list__filter-row .van-dropdown-menu__title::after,
|
||||
.market-sample-toolbar__filter-row .van-dropdown-menu__title::after,
|
||||
.presign-order-page__filter-row .van-dropdown-menu__title::after {
|
||||
position: static;
|
||||
top: auto;
|
||||
right: auto;
|
||||
box-sizing: border-box;
|
||||
flex: 0 0 auto;
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin: 0 0 0 5px;
|
||||
border-style: solid;
|
||||
border-width: 5px 4px 0;
|
||||
border-color: currentColor transparent transparent;
|
||||
opacity: 0.75;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.market-list__filter-row .van-dropdown-menu__title--down::after,
|
||||
.market-sample-toolbar__filter-row .van-dropdown-menu__title--down::after,
|
||||
.presign-order-page__filter-row .van-dropdown-menu__title--down::after {
|
||||
margin: 0 0 0 5px;
|
||||
border-width: 0 4px 5px;
|
||||
border-color: transparent transparent currentColor;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.market-list__filter-row .van-dropdown-menu__title--active,
|
||||
.market-list__filter-row .van-dropdown-menu__title--down {
|
||||
.market-list__filter-row .van-dropdown-menu__title--down,
|
||||
.market-sample-toolbar__filter-row .van-dropdown-menu__title--active,
|
||||
.market-sample-toolbar__filter-row .van-dropdown-menu__title--down {
|
||||
color: var(--market-primary, #0a9f6d);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.presign-order-page__filter-row .van-dropdown-menu__title--active,
|
||||
.presign-order-page__filter-row .van-dropdown-menu__title--down {
|
||||
color: var(--presign-primary, #0a9f6d);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.market-list__filter-button {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
@@ -232,17 +270,24 @@
|
||||
|
||||
/* 与 MarketFormField tabs 同结构:原生 button,微信 web-view 可点 */
|
||||
.market-source-tabs {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.market-source-tabs__list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.market-source-tabs__btn {
|
||||
flex: 0 0 auto;
|
||||
min-height: 44px;
|
||||
padding: 0 14px;
|
||||
min-height: 32px;
|
||||
padding: 4px 14px;
|
||||
border: 1px solid var(--market-border);
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
@@ -264,6 +309,30 @@
|
||||
color: var(--market-primary-dark, #087f57);
|
||||
}
|
||||
|
||||
/* 绝对定位到右侧,不占文档流,避免挤偏 Tab 居中 */
|
||||
.market-source-tabs__more {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
display: inline-grid;
|
||||
width: 36px;
|
||||
height: 32px;
|
||||
place-items: center;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 8px;
|
||||
background: transparent;
|
||||
color: var(--market-muted, #64748b);
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
transform: translateY(-50%);
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
-webkit-tap-highlight-color: rgba(10, 159, 109, 0.18);
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
/* Toast forbidClick 泄漏时 Vant 会给 body 加此类,导致整页点不着 */
|
||||
body.van-toast--unclickable .market-page,
|
||||
body.van-toast--unclickable .presign-order-page {
|
||||
@@ -295,6 +364,10 @@ body.van-toast--unclickable .presign-order-page * {
|
||||
padding-bottom: 76px;
|
||||
}
|
||||
|
||||
.market-list--batch-selecting {
|
||||
padding-bottom: calc(88px + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.market-list__error {
|
||||
display: flex;
|
||||
min-height: 44px;
|
||||
@@ -319,48 +392,61 @@ body.van-toast--unclickable .presign-order-page * {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.market-list__batch-toolbar {
|
||||
.market-list__batch-bar {
|
||||
position: fixed;
|
||||
z-index: 30;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
min-height: 48px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 12px;
|
||||
padding: 8px 10px;
|
||||
border: 1px solid var(--market-border);
|
||||
border-radius: 12px;
|
||||
padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
|
||||
border-top: 1px solid #eef2f6;
|
||||
background: #fff;
|
||||
color: var(--market-muted);
|
||||
font-size: 13px;
|
||||
box-shadow: 0 -4px 16px rgb(15 23 42 / 4%);
|
||||
}
|
||||
|
||||
.market-list__batch-toolbar span {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.market-list__batch-toolbar button {
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
.market-list__batch-bar-side {
|
||||
flex: 0 0 auto;
|
||||
min-width: 56px;
|
||||
min-height: 40px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid var(--market-border);
|
||||
border-radius: 9px;
|
||||
background: #fff;
|
||||
color: var(--market-primary-dark);
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: var(--market-primary-dark, #087f57);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
.market-list__batch-toolbar button.is-danger {
|
||||
border-color: #fecaca;
|
||||
color: #dc2626;
|
||||
}
|
||||
|
||||
.market-list__batch-toolbar button:disabled {
|
||||
opacity: 0.45;
|
||||
}
|
||||
|
||||
.market-list__batch-toolbar .market-list__batch-start {
|
||||
.market-list__batch-bar-main {
|
||||
display: inline-flex;
|
||||
flex: 1.2 1 auto;
|
||||
max-width: 240px;
|
||||
min-height: 40px;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
margin-left: auto;
|
||||
justify-content: center;
|
||||
padding: 0 16px;
|
||||
border: 1px solid #fecaca;
|
||||
border-radius: 12px;
|
||||
background: #fef2f2;
|
||||
color: #dc2626;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
.market-list__batch-bar-main:disabled {
|
||||
opacity: 0.45;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.market-list-card {
|
||||
@@ -483,6 +569,49 @@ body.van-toast--unclickable .presign-order-page * {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.market-list-card__fields-fold {
|
||||
margin: 0 0 4px;
|
||||
}
|
||||
|
||||
.market-list-card__fields-toggle {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
min-height: 40px;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 4px;
|
||||
margin: -4px 0 0;
|
||||
padding: 6px 12px 6px 0;
|
||||
border: 0;
|
||||
border-radius: 8px;
|
||||
background: transparent;
|
||||
color: var(--market-primary-dark, #087f57);
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
.market-list-card__fields-toggle:active {
|
||||
background: var(--market-primary-soft, #e9f9f2);
|
||||
}
|
||||
|
||||
.market-list-card__fields-toggle-chevron {
|
||||
font-size: 14px;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.market-list-card__fields-fold.is-open .market-list-card__fields-toggle-chevron {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.market-list-card__fields--folded {
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.market-list-card__field b {
|
||||
overflow: hidden;
|
||||
color: var(--market-text);
|
||||
@@ -691,17 +820,18 @@ body.van-toast--unclickable .presign-order-page * {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
gap: 6px;
|
||||
padding-top: 8px;
|
||||
gap: 8px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid #eef4f1;
|
||||
}
|
||||
|
||||
.market-list-card__actions .van-button {
|
||||
min-width: 0;
|
||||
min-height: 32px;
|
||||
padding: 0 8px;
|
||||
padding: 0 12px;
|
||||
border-radius: 8px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.market-list-card__actions .van-button .van-button__icon {
|
||||
@@ -989,17 +1119,34 @@ body.van-toast--unclickable .presign-order-page * {
|
||||
|
||||
.market-form-section {
|
||||
margin-bottom: 12px;
|
||||
padding: 16px;
|
||||
border: 1px solid var(--market-border);
|
||||
padding: 14px 14px 12px;
|
||||
border: 1px solid rgb(220 235 228 / 90%);
|
||||
border-radius: 16px;
|
||||
background: var(--market-surface);
|
||||
box-shadow: 0 8px 24px rgb(15 42 34 / 6%);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.market-form-section > h2 {
|
||||
margin: 0 0 14px;
|
||||
padding-left: 10px;
|
||||
border-left: 3px solid var(--market-primary);
|
||||
margin: 0 0 12px;
|
||||
padding-left: 0;
|
||||
border-left: 0;
|
||||
font-size: 15px;
|
||||
font-weight: 720;
|
||||
color: var(--market-text);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.market-form-section > h2::before {
|
||||
content: '';
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: var(--market-primary);
|
||||
box-shadow: 0 0 0 3px var(--market-primary-soft);
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.market-form-fields--grid-2 {
|
||||
@@ -1046,42 +1193,20 @@ body.van-toast--unclickable .presign-order-page * {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.market-sample-toolbar__filter-row .van-dropdown-menu__title {
|
||||
padding: 0 14px 0 0;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--market-text);
|
||||
}
|
||||
|
||||
.market-sample-toolbar__filter-row .van-dropdown-menu__title::after {
|
||||
top: 50%;
|
||||
right: 0;
|
||||
margin-top: 0;
|
||||
border-color: transparent transparent currentColor currentColor;
|
||||
opacity: 0.7;
|
||||
transform: translateY(-50%) rotate(-45deg);
|
||||
}
|
||||
|
||||
.market-sample-toolbar__filter-row .van-dropdown-menu__title--down::after {
|
||||
margin-top: 0;
|
||||
transform: translateY(-50%) rotate(135deg);
|
||||
}
|
||||
|
||||
.market-sample-toolbar__filter-row .van-dropdown-menu__title--active,
|
||||
.market-sample-toolbar__filter-row .van-dropdown-menu__title--down {
|
||||
color: var(--market-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.market-protocol-total-sync {
|
||||
margin: 0 0 8px;
|
||||
color: var(--market-muted);
|
||||
font-size: 13px;
|
||||
padding: 10px 12px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #f0e0bc;
|
||||
background: #fff7e8;
|
||||
color: #8a6419;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.market-protocol-total-sync.is-warn {
|
||||
color: #d97706;
|
||||
color: #92400e;
|
||||
border-color: #f0c989;
|
||||
}
|
||||
|
||||
.market-deposit-transfer {
|
||||
@@ -1091,9 +1216,9 @@ body.van-toast--unclickable .presign-order-page * {
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid var(--market-border);
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
border: 1px solid #e3f0ea;
|
||||
border-radius: 12px;
|
||||
background: #f7fffb;
|
||||
color: #18332a;
|
||||
font-size: 13px;
|
||||
}
|
||||
@@ -1104,31 +1229,47 @@ body.van-toast--unclickable .presign-order-page * {
|
||||
|
||||
.market-form-field {
|
||||
display: grid;
|
||||
gap: 7px;
|
||||
margin-bottom: 14px;
|
||||
color: var(--market-muted);
|
||||
font-size: 13px;
|
||||
gap: 6px;
|
||||
margin-bottom: 12px;
|
||||
color: #3d524a;
|
||||
font-size: 12px;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.market-form-field > label {
|
||||
color: #3d524a;
|
||||
font-size: 12px;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.market-form-field > label b {
|
||||
margin-left: 3px;
|
||||
color: #dc2626;
|
||||
color: #d14343;
|
||||
}
|
||||
|
||||
.market-form-field > .van-field,
|
||||
.market-form-field__control {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
min-height: 44px;
|
||||
border: 1px solid var(--market-border);
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
min-height: 46px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 12px;
|
||||
background: #f4faf7;
|
||||
overflow: hidden;
|
||||
transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
|
||||
}
|
||||
|
||||
.market-form-field > .van-field:focus-within,
|
||||
.market-form-field__control:focus-within {
|
||||
background: #fff;
|
||||
border-color: var(--market-primary);
|
||||
box-shadow: 0 0 0 3px rgb(10 159 109 / 15%);
|
||||
}
|
||||
|
||||
.market-form-field__control .van-field {
|
||||
min-height: 44px;
|
||||
min-height: 46px;
|
||||
align-items: center;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.market-form-field__checks {
|
||||
@@ -1139,22 +1280,27 @@ body.van-toast--unclickable .presign-order-page * {
|
||||
.market-form-field__tabs {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
gap: 6px;
|
||||
padding: 4px;
|
||||
border-radius: 14px;
|
||||
background: #eef6f2;
|
||||
}
|
||||
|
||||
.market-form-field__tabs button {
|
||||
min-height: 44px;
|
||||
border: 1px solid var(--market-border);
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
color: var(--market-text);
|
||||
min-height: 40px;
|
||||
border: 0;
|
||||
border-radius: 11px;
|
||||
background: transparent;
|
||||
color: var(--market-muted);
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.market-form-field__tabs button.active {
|
||||
border-color: var(--market-primary);
|
||||
background: var(--market-primary-soft);
|
||||
border-color: transparent;
|
||||
background: #fff;
|
||||
color: var(--market-primary-dark);
|
||||
font-weight: 600;
|
||||
font-weight: 700;
|
||||
box-shadow: 0 2px 8px rgb(15 42 34 / 8%);
|
||||
}
|
||||
|
||||
.market-form-field__checkbox {
|
||||
@@ -1244,37 +1390,119 @@ body.van-toast--unclickable .presign-order-page * {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
overflow-x: auto;
|
||||
padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
|
||||
border-top: 1px solid var(--market-border);
|
||||
background: rgb(255 255 255 / 96%);
|
||||
padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
|
||||
border-top: 1px solid #eef2f6;
|
||||
background: #fff;
|
||||
box-shadow: 0 -4px 16px rgb(15 23 42 / 4%);
|
||||
}
|
||||
|
||||
.market-bottom-bar__button {
|
||||
min-height: 44px;
|
||||
min-width: 112px;
|
||||
flex: 1 0 112px;
|
||||
min-height: 40px;
|
||||
min-width: 88px;
|
||||
flex: 1 1 auto;
|
||||
border-radius: 12px !important;
|
||||
font-size: 14px !important;
|
||||
font-weight: 600 !important;
|
||||
}
|
||||
|
||||
.market-bottom-bar__button.van-button--primary {
|
||||
flex: 1.2 1 88px;
|
||||
font-weight: 700 !important;
|
||||
box-shadow: 0 2px 8px rgb(10 159 109 / 16%);
|
||||
}
|
||||
|
||||
.market-form-bottom {
|
||||
justify-content: center;
|
||||
padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.market-form-bottom .market-bottom-bar__button {
|
||||
min-width: 120px;
|
||||
max-width: 168px;
|
||||
min-height: 44px;
|
||||
flex: 0 1 168px;
|
||||
font-size: 15px !important;
|
||||
}
|
||||
|
||||
.market-form-bottom .market-bottom-bar__button.van-button--primary {
|
||||
flex: 1.35 1 120px;
|
||||
}
|
||||
|
||||
/* 表单内小按钮:对齐 OA 软语义,取消胶囊渐变 */
|
||||
.market-page .van-button--mini {
|
||||
min-height: 28px;
|
||||
min-width: auto;
|
||||
height: 28px;
|
||||
padding: 0 10px;
|
||||
border-radius: 8px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
/* 主操作:实心品牌绿(无渐变) */
|
||||
.market-page .van-button--primary {
|
||||
border-color: var(--market-primary);
|
||||
background: var(--market-primary);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* 次操作 / plain primary:白底描边 */
|
||||
.market-page .van-button--plain.van-button--primary {
|
||||
border-color: #e2e8f0;
|
||||
background: #fff;
|
||||
color: var(--market-primary-dark);
|
||||
color: #334155;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 警告:琥珀软底(对齐 OA 打回) */
|
||||
.market-page .van-button--warning {
|
||||
border-color: #fde68a;
|
||||
background: #fff7e8;
|
||||
color: #d97706;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.market-page .van-button--plain.van-button--warning {
|
||||
border-color: #fde68a;
|
||||
background: #fff7e8;
|
||||
color: #d97706;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 危险实心 → 浅红软底;plain → 白底红描边 */
|
||||
.market-page .van-button--danger {
|
||||
border-color: #fecaca;
|
||||
background: #fef2f2;
|
||||
color: #dc2626;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.market-page .van-button--plain.van-button--danger {
|
||||
border-color: #fecaca;
|
||||
background: #fff;
|
||||
color: #dc2626;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 弱操作:浅灰软底 */
|
||||
.market-page .van-button--default {
|
||||
border-color: transparent;
|
||||
background: #f1f5f9;
|
||||
color: #334155;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 次操作描边 */
|
||||
.market-page .van-button--plain.van-button--default {
|
||||
border-color: #e2e8f0;
|
||||
background: #fff;
|
||||
color: #334155;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.market-page .van-tag--primary {
|
||||
@@ -1360,33 +1588,6 @@ body.van-toast--unclickable .presign-order-page * {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.presign-order-page__filter-row .van-dropdown-menu__title {
|
||||
padding: 0 14px 0 0;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--presign-text);
|
||||
}
|
||||
|
||||
.presign-order-page__filter-row .van-dropdown-menu__title::after {
|
||||
top: 50%;
|
||||
right: 0;
|
||||
margin-top: 0;
|
||||
border-color: transparent transparent currentColor currentColor;
|
||||
opacity: 0.7;
|
||||
transform: translateY(-50%) rotate(-45deg);
|
||||
}
|
||||
|
||||
.presign-order-page__filter-row .van-dropdown-menu__title--down::after {
|
||||
margin-top: 0;
|
||||
transform: translateY(-50%) rotate(135deg);
|
||||
}
|
||||
|
||||
.presign-order-page__filter-row .van-dropdown-menu__title--active,
|
||||
.presign-order-page__filter-row .van-dropdown-menu__title--down {
|
||||
color: var(--presign-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.presign-order-page__content {
|
||||
box-sizing: border-box;
|
||||
min-height: 100vh;
|
||||
@@ -1467,6 +1668,49 @@ body.van-toast--unclickable .presign-order-page * {
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
.presign-order-card__fields--folded {
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.presign-order-card__fields-fold {
|
||||
margin: 0 0 4px;
|
||||
}
|
||||
|
||||
.presign-order-card__fields-toggle {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
min-height: 40px;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 4px;
|
||||
margin: -4px 0 0;
|
||||
padding: 6px 12px 6px 0;
|
||||
border: 0;
|
||||
border-radius: 8px;
|
||||
background: transparent;
|
||||
color: var(--presign-primary-dark, #087f57);
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
.presign-order-card__fields-toggle:active {
|
||||
background: var(--presign-primary-soft, #e9f9f2);
|
||||
}
|
||||
|
||||
.presign-order-card__fields-toggle-chevron {
|
||||
font-size: 14px;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.presign-order-card__fields-fold.is-open .presign-order-card__fields-toggle-chevron {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.presign-order-card__field {
|
||||
min-width: 0;
|
||||
}
|
||||
@@ -1509,7 +1753,8 @@ body.van-toast--unclickable .presign-order-page * {
|
||||
.presign-order-card__actions .van-button {
|
||||
min-width: 82px;
|
||||
min-height: 44px;
|
||||
border-radius: 9px;
|
||||
border-radius: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.presign-order-card__actions .van-button--primary {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<template v-else>
|
||||
<MarketFormSection
|
||||
v-for="section in visibleSections"
|
||||
v-for="section in leadingSections"
|
||||
:key="section.key"
|
||||
:section="section"
|
||||
:model-value="sectionValue(section)"
|
||||
@@ -46,18 +46,6 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section
|
||||
v-if="context.module === 'protocol' && formData.source === 'cell_storage' && isProtocolV2"
|
||||
class="market-form-section"
|
||||
>
|
||||
<p class="market-protocol-total-sync">
|
||||
样本合同合计 ¥{{ sampleContractSumDisplay }}
|
||||
</p>
|
||||
<p v-if="protocolTotalHintText" class="market-protocol-total-sync is-warn">
|
||||
{{ protocolTotalHintText }}
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<ProtocolSampleTransportPanel
|
||||
v-if="context.module === 'protocol'"
|
||||
v-model="formData.samples"
|
||||
@@ -74,12 +62,16 @@
|
||||
<ProtocolSamplePaymentPanel
|
||||
v-if="context.module === 'protocol' && formData.source === 'cell_storage' && isProtocolV2"
|
||||
v-model="formData.samplePayments"
|
||||
:protocol-total-amount="formData.protocolTotalAmount"
|
||||
:samples="formData.samples || []"
|
||||
:disabled="fieldsLocked"
|
||||
:protocol-id="id"
|
||||
:market-role="context.marketRole"
|
||||
:transfer-types="formOptions.transferTypes || []"
|
||||
:sample-contract-sum="sampleContractSumDisplay"
|
||||
:protocol-total-hint="protocolTotalHintText"
|
||||
@update:model-value="onSamplePaymentsChange"
|
||||
@update:protocol-total-amount="onProtocolTotalAmountChange"
|
||||
@transfer-dirty-change="handleTransferDirtyChange"
|
||||
/>
|
||||
|
||||
@@ -87,13 +79,32 @@
|
||||
v-if="context.module === 'protocol' && formData.source === 'cell_storage' && isProtocolV1"
|
||||
v-model:payment="formData.payment"
|
||||
v-model:payment-details="formData.paymentDetails"
|
||||
:protocol-total-amount="formData.protocolTotalAmount"
|
||||
:disabled="fieldsLocked"
|
||||
:uploading="false"
|
||||
:transfer-types="formOptions.transferTypes || []"
|
||||
@upload="uploadV1PaymentAttachment"
|
||||
@update:protocol-total-amount="onProtocolTotalAmountChange"
|
||||
@change="dirty = true"
|
||||
/>
|
||||
|
||||
<MarketFormSection
|
||||
v-for="section in trailingSections"
|
||||
:key="section.key"
|
||||
:section="section"
|
||||
:model-value="sectionValue(section)"
|
||||
:options="formOptions"
|
||||
:source="formData.source"
|
||||
:mode="mode"
|
||||
:uploading="false"
|
||||
:disabled="fieldsLocked"
|
||||
:search-customers="searchProtocolCustomers"
|
||||
@update:model-value="setSectionValue(section, $event)"
|
||||
@upload="uploadField"
|
||||
@field-change="handleFieldChange"
|
||||
@customer-select="handleCustomerSelect"
|
||||
/>
|
||||
|
||||
<section v-if="context.module === 'freight' && action !== 'edit'" class="market-form-section">
|
||||
<h2>关联样本</h2>
|
||||
<div
|
||||
@@ -154,11 +165,10 @@
|
||||
|
||||
<template #bottom>
|
||||
<footer class="market-bottom-bar market-form-bottom">
|
||||
<van-button class="market-bottom-bar__button" round :disabled="formBusy" @click="back">取消</van-button>
|
||||
<van-button class="market-bottom-bar__button" :disabled="formBusy" @click="back">取消</van-button>
|
||||
<van-button
|
||||
class="market-bottom-bar__button"
|
||||
type="primary"
|
||||
round
|
||||
:loading="submitting"
|
||||
:disabled="loading || Boolean(errorMessage) || !action || submitting || uploadPending > 0"
|
||||
@click="submit"
|
||||
@@ -219,6 +229,7 @@ import {
|
||||
import ProtocolSamplePaymentPanel from '../../market/components/ProtocolSamplePaymentPanel.vue'
|
||||
import ProtocolV1PaymentPanel from '../../market/components/ProtocolV1PaymentPanel.vue'
|
||||
import ProtocolSampleTransportPanel from '../../market/components/ProtocolSampleTransportPanel.vue'
|
||||
import { applyProtocolCreateDefaults, todayYmd } from '../../market/protocol-form-defaults.js'
|
||||
import { buildProtocolSamplesPayload } from '../../market/protocol-sample-transport.js'
|
||||
import {
|
||||
createPendingMarketAttachment,
|
||||
@@ -228,6 +239,11 @@ import {
|
||||
} from '../../market/attachment-upload-state.js'
|
||||
import { marketErrorMessage } from '../../market/market-error.js'
|
||||
import { protocolTransferSaveBlockMessage } from '../../market/protocol-transfer-dirty.js'
|
||||
import {
|
||||
flattenSamplePaymentTransfers,
|
||||
formatAutoSubmitFinanceFailureMessage,
|
||||
submitDfjTransfersOnSave
|
||||
} from '../../market/presign/presign-form-state.js'
|
||||
import {
|
||||
createLegacyPaymentState,
|
||||
serializeLegacyPaymentState,
|
||||
@@ -335,6 +351,16 @@ const visibleSections = computed(() => {
|
||||
)
|
||||
})
|
||||
|
||||
/** 普通分区(不含须垫底的提交确认等) */
|
||||
const leadingSections = computed(() =>
|
||||
visibleSections.value.filter((section) => !section.renderLast)
|
||||
)
|
||||
|
||||
/** 提交确认等须排在样本运输 / 缴费面板之后 */
|
||||
const trailingSections = computed(() =>
|
||||
visibleSections.value.filter((section) => section.renderLast)
|
||||
)
|
||||
|
||||
function sectionValue(section) {
|
||||
if (section.nested || section.repeat || section.key === 'transfer') {
|
||||
return formData.value[section.key] || (section.repeat ? [] : {})
|
||||
@@ -391,6 +417,14 @@ function onSamplePaymentsChange(value) {
|
||||
syncProtocolTotalFromSamples()
|
||||
}
|
||||
|
||||
function onProtocolTotalAmountChange(value) {
|
||||
formData.value = { ...formData.value, protocolTotalAmount: value }
|
||||
dirty.value = true
|
||||
if (!isProtocolV2.value) return
|
||||
const total = normalizeMoney(value)
|
||||
protocolTotalFollowSamples.value = shouldFollowProtocolTotal(total, sampleContractSum.value)
|
||||
}
|
||||
|
||||
function handleTransferDirtyChange(value) {
|
||||
transferDirty.value = Boolean(value)
|
||||
}
|
||||
@@ -428,10 +462,13 @@ function handleCustomerSelect({ section, field, customer }) {
|
||||
|
||||
async function handleFieldChange({ section, field, value, index }) {
|
||||
if (context.value.module !== 'protocol') return
|
||||
if (section.key === 'protocol' && field.key === 'protocolTotalAmount') {
|
||||
if (!isProtocolV2.value) return
|
||||
const total = normalizeMoney(value)
|
||||
protocolTotalFollowSamples.value = shouldFollowProtocolTotal(total, sampleContractSum.value)
|
||||
if (section.key === 'protocol' && field.key === 'source' && mode.value === 'create') {
|
||||
const today = todayYmd()
|
||||
if (value === 'research_donation' && !formData.value.donationDate) {
|
||||
formData.value = { ...formData.value, donationDate: today }
|
||||
} else if (value === 'cell_storage' && !formData.value.registerDate) {
|
||||
formData.value = { ...formData.value, registerDate: today }
|
||||
}
|
||||
return
|
||||
}
|
||||
if (section.key === 'customer' && (field.key === 'motherName' || field.key === 'fatherName')) {
|
||||
@@ -473,19 +510,28 @@ async function handleFieldChange({ section, field, value, index }) {
|
||||
return
|
||||
}
|
||||
if (section.key !== 'collection' || field.key !== 'regionId') return
|
||||
await applyCollectionRegion(value, { resetHospital: true, defaultManager: true })
|
||||
}
|
||||
|
||||
/** 切换采集地区:刷新医院/人员选项,可选默认地区经理 */
|
||||
async function applyCollectionRegion(regionId, { resetHospital = true, defaultManager = false } = {}) {
|
||||
const value = String(regionId || '').trim()
|
||||
const selectedRegion = (formOptions.value.regions || []).find(
|
||||
(item) => String(item?.value) === String(value)
|
||||
(item) => String(item?.value) === value
|
||||
) || (formOptions.value.currentUserRegions || []).find(
|
||||
(item) => String(item?.value) === value
|
||||
)
|
||||
formData.value = {
|
||||
...formData.value,
|
||||
collection: {
|
||||
...(formData.value.collection || {}),
|
||||
regionId: value,
|
||||
regionName: selectedRegion?.label || '',
|
||||
hospitalId: '',
|
||||
hospitalName: ''
|
||||
}
|
||||
const collection = {
|
||||
...(formData.value.collection || {}),
|
||||
regionId: value,
|
||||
regionName: selectedRegion?.label || formData.value.collection?.regionName || ''
|
||||
}
|
||||
if (resetHospital) {
|
||||
collection.hospitalId = ''
|
||||
collection.hospitalName = ''
|
||||
}
|
||||
formData.value = { ...formData.value, collection }
|
||||
if (!value) return
|
||||
cascadeOptionsController?.abort()
|
||||
cascadeOptionsController = new AbortController()
|
||||
try {
|
||||
@@ -499,6 +545,20 @@ async function handleFieldChange({ section, field, value, index }) {
|
||||
{ ...formOptions.value, ...options },
|
||||
formData.value
|
||||
)
|
||||
if (defaultManager && !formData.value.collection?.regionManagerUserId) {
|
||||
const leader = (options?.staff || []).find((item) => item.isLeader) || options?.staff?.[0]
|
||||
if (leader?.value) {
|
||||
formData.value = {
|
||||
...formData.value,
|
||||
collection: {
|
||||
...(formData.value.collection || {}),
|
||||
regionManagerUserId: String(leader.value),
|
||||
regionManagerUserName: String(leader.label || '')
|
||||
}
|
||||
}
|
||||
formOptions.value = hydrateProtocolReferenceOptions(formOptions.value, formData.value)
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
if (error?.name !== 'AbortError' && mountGuard.isCurrent(mountToken)) {
|
||||
showToast(marketErrorMessage(error, '医院选项加载失败'))
|
||||
@@ -692,6 +752,18 @@ async function load() {
|
||||
}
|
||||
formData.value = initialForm(detail)
|
||||
transferDirty.value = false
|
||||
formOptions.value = hydrateCurrentOptions(options, detail)
|
||||
if (context.value.module === 'protocol' && mode.value === 'create') {
|
||||
formData.value = applyProtocolCreateDefaults(formData.value, formOptions.value)
|
||||
const defaultRegionId = String(formData.value.collection?.regionId || '').trim()
|
||||
if (defaultRegionId) {
|
||||
await applyCollectionRegion(defaultRegionId, {
|
||||
resetHospital: true,
|
||||
defaultManager: true
|
||||
})
|
||||
if (!mountGuard.isCurrent(mountToken) || !loadGuard.isCurrent(requestToken)) return
|
||||
}
|
||||
}
|
||||
if (
|
||||
context.value.module === 'protocol' &&
|
||||
formData.value.source === 'cell_storage' &&
|
||||
@@ -705,7 +777,6 @@ async function load() {
|
||||
} else {
|
||||
protocolTotalFollowSamples.value = true
|
||||
}
|
||||
formOptions.value = hydrateCurrentOptions(options, detail)
|
||||
if (context.value.module === 'freight') {
|
||||
if (action.value === 'unlink') loadUnlinkOptions(detail)
|
||||
else if (contract.value.usesPagedSampleOptions?.(action.value)) await loadSampleOptions()
|
||||
@@ -995,8 +1066,44 @@ async function submit() {
|
||||
if (!mountGuard.isCurrent(mountToken)) return
|
||||
dirty.value = false
|
||||
allowLeave = true
|
||||
showSuccessToast('保存成功')
|
||||
const detailId = resolveMarketSavedDetailId(context.value.module, id.value, result, action.value)
|
||||
let saveToast = '保存成功'
|
||||
if (
|
||||
context.value.module === 'protocol' &&
|
||||
String(formData.value.source || '') === 'cell_storage' &&
|
||||
detailId &&
|
||||
!['register-transfer', 'edit-transfer', 'link', 'unlink'].includes(action.value)
|
||||
) {
|
||||
try {
|
||||
const detail = await fetchMarketDetail(context.value, detailId, {
|
||||
signal: submitController.signal
|
||||
})
|
||||
if (!mountGuard.isCurrent(mountToken)) return
|
||||
const version = Number(
|
||||
detail?.paymentModelVersion ?? detail?.basic?.paymentModelVersion ?? formData.value.paymentModelVersion ?? 2
|
||||
)
|
||||
if (version >= 2) {
|
||||
const rows = flattenSamplePaymentTransfers(detail?.samplePayments || [])
|
||||
const paymentCtx = {
|
||||
module: 'payment',
|
||||
marketRole: context.value.marketRole
|
||||
}
|
||||
const failures = await submitDfjTransfersOnSave(rows, (transferId) =>
|
||||
performMarketAction(paymentCtx, 'submit', { id: transferId }, {
|
||||
signal: submitController.signal
|
||||
})
|
||||
)
|
||||
if (failures.length) {
|
||||
saveToast = formatAutoSubmitFinanceFailureMessage(failures, '协议')
|
||||
}
|
||||
}
|
||||
} catch (autoSubmitError) {
|
||||
if (autoSubmitError?.name === 'AbortError' || !mountGuard.isCurrent(mountToken)) return
|
||||
saveToast = '协议已保存,但自动提交财务确认失败,请在缴费信息中手动提交'
|
||||
}
|
||||
}
|
||||
if (saveToast === '保存成功') showSuccessToast(saveToast)
|
||||
else showToast(saveToast)
|
||||
await router.replace({
|
||||
name: detailId
|
||||
? `market-${context.value.marketRole}-${context.value.module}-detail`
|
||||
|
||||
@@ -12,17 +12,28 @@
|
||||
role="tablist"
|
||||
aria-label="业务来源"
|
||||
>
|
||||
<div class="market-source-tabs__list">
|
||||
<button
|
||||
v-for="tab in listFilterTabs"
|
||||
:key="tab.value"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="market-source-tabs__btn"
|
||||
:class="{ 'is-active': listStatus === tab.value }"
|
||||
:aria-selected="listStatus === tab.value"
|
||||
@click="switchListStatus(tab.value)"
|
||||
>
|
||||
{{ tab.text }}
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
v-for="tab in listFilterTabs"
|
||||
:key="tab.value"
|
||||
v-if="batchDeleteAvailable && !batchSelectionMode"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="market-source-tabs__btn"
|
||||
:class="{ 'is-active': listStatus === tab.value }"
|
||||
:aria-selected="listStatus === tab.value"
|
||||
@click="switchListStatus(tab.value)"
|
||||
class="market-source-tabs__more"
|
||||
aria-label="更多操作"
|
||||
@click="toggleBatchSelectionMode"
|
||||
>
|
||||
{{ tab.text }}
|
||||
<van-icon name="ellipsis" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="market-list__search-row">
|
||||
@@ -68,27 +79,10 @@
|
||||
</van-empty>
|
||||
</div>
|
||||
<van-empty v-else-if="!items.length" description="暂无相关数据" />
|
||||
<div v-if="batchDeleteAvailable" class="market-list__batch-toolbar">
|
||||
<template v-if="batchSelectionMode">
|
||||
<span>已选 {{ selectedRecordIds.length }} 项</span>
|
||||
<button type="button" @click="toggleSelectAll">
|
||||
{{ allDeletableSelected ? '取消全选' : '全选' }}
|
||||
</button>
|
||||
<button type="button" @click="cancelBatchSelection">取消</button>
|
||||
<button
|
||||
type="button"
|
||||
class="is-danger"
|
||||
:disabled="!selectedRecordIds.length || batchDeleting"
|
||||
@click="deleteSelectedProtocols"
|
||||
>批量删除</button>
|
||||
</template>
|
||||
<button v-else type="button" class="market-list__batch-start" @click="batchSelectionMode = true">
|
||||
批量删除
|
||||
</button>
|
||||
</div>
|
||||
<van-list
|
||||
v-if="items.length"
|
||||
class="market-list"
|
||||
:class="{ 'market-list--batch-selecting': batchSelectionMode }"
|
||||
:loading="loadingMore"
|
||||
:finished="!hasMore || Boolean(errorMessage)"
|
||||
finished-text="没有更多了"
|
||||
@@ -114,7 +108,35 @@
|
||||
/>
|
||||
</van-list>
|
||||
|
||||
<button v-if="canCreate" type="button" class="market-list__fab" :aria-label="`新增${moduleTitle}`" @click="openCreate">
|
||||
<div
|
||||
v-if="batchSelectionMode"
|
||||
class="market-list__batch-bar"
|
||||
role="toolbar"
|
||||
aria-label="批量操作"
|
||||
>
|
||||
<button type="button" class="market-list__batch-bar-side" @click="toggleSelectAll">
|
||||
{{ allDeletableSelected ? '取消全选' : '全选' }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="market-list__batch-bar-main is-danger"
|
||||
:disabled="!selectedRecordIds.length || batchDeleting"
|
||||
@click="deleteSelectedProtocols"
|
||||
>
|
||||
批量删除{{ selectedRecordIds.length ? `(${selectedRecordIds.length})` : '' }}
|
||||
</button>
|
||||
<button type="button" class="market-list__batch-bar-side" @click="cancelBatchSelection">
|
||||
取消
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button
|
||||
v-if="canCreate && !batchSelectionMode"
|
||||
type="button"
|
||||
class="market-list__fab"
|
||||
:aria-label="`新增${moduleTitle}`"
|
||||
@click="openCreate"
|
||||
>
|
||||
<van-icon name="plus" />
|
||||
</button>
|
||||
<MarketFilterSheet
|
||||
@@ -214,11 +236,13 @@ const sheetFilterFields = computed(() =>
|
||||
!field.source || field.source === listFilters.value.source
|
||||
)
|
||||
)
|
||||
const inlineDropdownFilters = computed(() =>
|
||||
Array.isArray(moduleContract.value.inlineDropdownFilters)
|
||||
const inlineDropdownFilters = computed(() => {
|
||||
const rows = Array.isArray(moduleContract.value.inlineDropdownFilters)
|
||||
? moduleContract.value.inlineDropdownFilters
|
||||
: []
|
||||
)
|
||||
const source = listFilters.value.source || listStatus.value
|
||||
return rows.filter((field) => !field.source || field.source === source)
|
||||
})
|
||||
const activeFilters = computed(() =>
|
||||
activeFilterCount(context.value.module, listFilters.value)
|
||||
)
|
||||
@@ -485,6 +509,11 @@ function cancelBatchSelection() {
|
||||
selectedRecordIds.value = []
|
||||
}
|
||||
|
||||
function toggleBatchSelectionMode() {
|
||||
batchSelectionMode.value = true
|
||||
selectedRecordIds.value = []
|
||||
}
|
||||
|
||||
async function deleteSelectedProtocols() {
|
||||
if (!selectedRecordIds.value.length || batchDeleting.value) return
|
||||
const selected = selectedRecordIds.value
|
||||
@@ -548,6 +577,7 @@ function switchListStatus(value) {
|
||||
listFilters.value = createListFilters('protocol', next)
|
||||
keyword.value = ''
|
||||
collectionActions.value = []
|
||||
cancelBatchSelection()
|
||||
const nextQuery = {
|
||||
...pickMarketNavigationQuery(route.query),
|
||||
source: next,
|
||||
|
||||
@@ -211,10 +211,9 @@
|
||||
</main>
|
||||
|
||||
<footer class="presign-form-bottom">
|
||||
<van-button round :disabled="formBusy" @click="back">取消</van-button>
|
||||
<van-button :disabled="formBusy" @click="back">取消</van-button>
|
||||
<van-button
|
||||
type="primary"
|
||||
round
|
||||
:loading="saving"
|
||||
:disabled="loading || Boolean(errorMessage) || formDisabled || formBusy"
|
||||
@click="save"
|
||||
|
||||
@@ -0,0 +1,924 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
|
||||
<title>市场部按钮 · 对齐 OA 工作流样式 Demo</title>
|
||||
<style>
|
||||
:root {
|
||||
/* OA 工作流(已上线) */
|
||||
--oa-brand: #22c55e;
|
||||
--oa-brand-dark: #16a34a;
|
||||
--oa-ink: #334155;
|
||||
--oa-line: #e2e8f0;
|
||||
--oa-soft: #f1f5f9;
|
||||
--oa-warn: #d97706;
|
||||
--oa-warn-soft: #fff7e8;
|
||||
--oa-warn-line: #fde68a;
|
||||
--oa-danger: #ef4444;
|
||||
--oa-danger-soft: #fef2f2;
|
||||
|
||||
/* 市场部 Token(三墙,不混用 OA #22c55e) */
|
||||
--m-brand: #0a9f6d;
|
||||
--m-brand-dark: #087f57;
|
||||
--m-brand-soft: #e9f9f2;
|
||||
--m-text: #18332a;
|
||||
--m-muted: #6b7f77;
|
||||
--m-border: #dce9e4;
|
||||
--m-page: #f4f8f6;
|
||||
--m-barley: #d6a343;
|
||||
--m-barley-soft: #fff7e8;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", -apple-system, system-ui, sans-serif;
|
||||
color: #0f172a;
|
||||
line-height: 1.45;
|
||||
background:
|
||||
radial-gradient(900px 420px at 8% -8%, rgba(10, 159, 109, 0.12), transparent 55%),
|
||||
radial-gradient(700px 380px at 92% 0%, rgba(34, 197, 94, 0.08), transparent 50%),
|
||||
linear-gradient(180deg, #f8fffc 0%, #f4f7fb 50%, #f7f8fa 100%);
|
||||
}
|
||||
|
||||
.stage { max-width: 1280px; margin: 0 auto; padding: 28px 16px 80px; }
|
||||
h1 { margin: 0 0 8px; font-size: 24px; font-weight: 720; letter-spacing: -0.02em; }
|
||||
.sub { margin: 0; max-width: 920px; color: #64748b; font-size: 14px; }
|
||||
|
||||
.rec {
|
||||
margin: 16px 0 0;
|
||||
padding: 14px 16px;
|
||||
border-radius: 14px;
|
||||
background: #e9f9f2;
|
||||
border: 1px solid #b7ebd4;
|
||||
font-size: 13px;
|
||||
color: #166534;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.rec b { color: #087f57; }
|
||||
|
||||
.grid-tokens {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||
gap: 12px;
|
||||
margin: 18px 0 0;
|
||||
}
|
||||
.token-card {
|
||||
background: #fff;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 14px;
|
||||
padding: 14px 16px;
|
||||
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
|
||||
}
|
||||
.token-card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 680; }
|
||||
.token-card ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: #475569; }
|
||||
.token-card li { margin: 5px 0; }
|
||||
.swatch {
|
||||
display: inline-block;
|
||||
width: 10px; height: 10px;
|
||||
border-radius: 3px;
|
||||
margin-right: 4px;
|
||||
vertical-align: -1px;
|
||||
border: 1px solid rgba(15, 23, 42, 0.08);
|
||||
}
|
||||
|
||||
.tabs {
|
||||
display: flex; flex-wrap: wrap; gap: 10px;
|
||||
margin: 22px 0 16px;
|
||||
}
|
||||
.tab {
|
||||
appearance: none; border: 1px solid #e2e8f0; background: #fff;
|
||||
border-radius: 999px; padding: 10px 16px; font-size: 13px;
|
||||
font-weight: 600; color: #475569; cursor: pointer;
|
||||
}
|
||||
.tab.is-active {
|
||||
color: #087f57; border-color: #0a9f6d;
|
||||
background: #e9f9f2;
|
||||
box-shadow: 0 0 0 3px rgba(10, 159, 109, 0.16);
|
||||
}
|
||||
|
||||
.panel { display: none; }
|
||||
.panel.is-on { display: block; }
|
||||
|
||||
.compare {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 18px;
|
||||
align-items: start;
|
||||
}
|
||||
@media (max-width: 900px) { .compare { grid-template-columns: 1fr; } }
|
||||
|
||||
.col-title {
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
margin: 0 0 10px; font-size: 14px; font-weight: 680;
|
||||
}
|
||||
.badge {
|
||||
display: inline-flex; align-items: center;
|
||||
padding: 2px 8px; border-radius: 999px;
|
||||
font-size: 11px; font-weight: 650;
|
||||
}
|
||||
.badge.bad { background: #fef2f2; color: #b91c1c; }
|
||||
.badge.good { background: #ecfdf5; color: #047857; }
|
||||
.badge.ref { background: #f1f5f9; color: #475569; }
|
||||
|
||||
.phones {
|
||||
display: flex; flex-wrap: wrap; gap: 16px; justify-content: center;
|
||||
}
|
||||
.phone {
|
||||
width: 360px;
|
||||
background: #fff;
|
||||
border-radius: 28px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 0 0 1px rgb(15 23 42 / 6%), 0 18px 40px rgb(15 23 42 / 12%);
|
||||
position: relative;
|
||||
}
|
||||
.cap {
|
||||
text-align: center; font-size: 11px; font-weight: 650; color: #64748b;
|
||||
padding: 8px; background: #f8fafc; border-bottom: 1px solid #eef2f0;
|
||||
}
|
||||
.nav {
|
||||
height: 44px; display: flex; align-items: center; justify-content: center;
|
||||
background: #ecfdf5; border-bottom: 1px solid #d8f3e5;
|
||||
font-size: 15px; font-weight: 650; color: #0f291e;
|
||||
position: relative;
|
||||
}
|
||||
.nav::before {
|
||||
content: ""; position: absolute; left: 14px;
|
||||
width: 10px; height: 10px;
|
||||
border-left: 2px solid #0f291e; border-bottom: 2px solid #0f291e;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
.page {
|
||||
min-height: 520px;
|
||||
background: var(--m-page);
|
||||
padding: 12px;
|
||||
padding-bottom: 88px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* —— 卡片 —— */
|
||||
.card {
|
||||
background: #fff;
|
||||
border: 1px solid var(--m-border);
|
||||
border-radius: 16px;
|
||||
padding: 14px;
|
||||
box-shadow: 0 6px 20px rgb(8 127 87 / 7%);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.card-hd {
|
||||
display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
|
||||
}
|
||||
.card-hd strong { font-size: 15px; }
|
||||
.pill {
|
||||
margin-left: auto;
|
||||
padding: 2px 8px; border-radius: 6px;
|
||||
font-size: 11px; font-weight: 650;
|
||||
background: #ecfdf5; color: #047857;
|
||||
}
|
||||
.field {
|
||||
display: flex; justify-content: space-between; gap: 10px;
|
||||
padding: 7px 0; border-top: 1px solid #f1f5f9;
|
||||
font-size: 13px;
|
||||
}
|
||||
.field:first-of-type { border-top: 0; }
|
||||
.field .k { color: var(--m-muted); }
|
||||
.field .v { font-weight: 560; text-align: right; }
|
||||
|
||||
/* ========== OA 工作流按钮(参考源) ========== */
|
||||
.oa-ft {
|
||||
position: absolute; left: 0; right: 0; bottom: 0;
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
|
||||
background: #fff;
|
||||
border-top: 1px solid #eef2f6;
|
||||
box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
|
||||
}
|
||||
.oa-btn {
|
||||
appearance: none; border: none; cursor: pointer;
|
||||
height: 40px; border-radius: 12px;
|
||||
font: inherit; font-size: 14px; padding: 0 10px;
|
||||
flex: 1 1 auto; min-width: 0;
|
||||
}
|
||||
.oa-btn--more {
|
||||
flex: 0 0 auto; width: 44px; min-width: 44px; padding: 0;
|
||||
border: 1px solid var(--oa-line); background: #fff; color: var(--oa-ink);
|
||||
font-size: 18px; font-weight: 700; letter-spacing: 1px;
|
||||
}
|
||||
.oa-btn--ghost {
|
||||
border: 1px solid var(--oa-line); background: #fff; color: var(--oa-ink); font-weight: 600;
|
||||
}
|
||||
.oa-btn--primary {
|
||||
flex: 1 1 88px; background: var(--oa-brand); color: #fff; font-weight: 700;
|
||||
}
|
||||
.oa-btn--draft {
|
||||
flex: 1; height: 44px; background: var(--oa-soft); color: var(--oa-ink); font-weight: 600;
|
||||
}
|
||||
.oa-btn--submit {
|
||||
flex: 1.35; height: 44px; background: var(--oa-brand); color: #fff; font-weight: 700;
|
||||
box-shadow: 0 2px 8px rgba(34, 197, 94, 0.14);
|
||||
}
|
||||
.oa-batch {
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 8px;
|
||||
margin-bottom: 10px; padding: 10px 12px;
|
||||
border-radius: 10px; background: #fff; border: 1px solid #e8eaed;
|
||||
box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
|
||||
}
|
||||
.oa-batch__hint { font-size: 13px; color: #646a73; }
|
||||
.oa-batch__actions { display: flex; gap: 8px; margin-left: auto; }
|
||||
.oa-batch__btn {
|
||||
min-height: 32px; padding: 0 14px; border-radius: 8px;
|
||||
font-size: 13px; font-weight: 600; border: none; cursor: pointer;
|
||||
}
|
||||
.oa-batch__btn.is-ok { color: #fff; background: #0a9f6d; }
|
||||
.oa-batch__btn.is-return {
|
||||
color: var(--oa-warn); background: var(--oa-warn-soft); border: 1px solid var(--oa-warn-line);
|
||||
}
|
||||
|
||||
/* ========== 市场部 · 现状 ========== */
|
||||
.old-actions {
|
||||
display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px;
|
||||
padding-top: 8px; border-top: 1px solid #eef4f1; margin-top: 4px;
|
||||
}
|
||||
.old-btn {
|
||||
appearance: none; border: 0; cursor: pointer;
|
||||
min-height: 32px; padding: 0 8px; border-radius: 8px;
|
||||
font-size: 12px; font-weight: 700; color: #fff;
|
||||
}
|
||||
.old-btn.primary { background: linear-gradient(135deg, #12b981, #087f57); }
|
||||
.old-btn.default { background: #5f8f7d; }
|
||||
.old-btn.danger { background: linear-gradient(135deg, #e35d5d, #d14343); }
|
||||
.old-btn.warn { background: linear-gradient(135deg, #e5a63a, #cf8a19); }
|
||||
|
||||
.old-ft {
|
||||
position: absolute; left: 0; right: 0; bottom: 0;
|
||||
display: flex; gap: 10px;
|
||||
padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
|
||||
background: linear-gradient(180deg, rgb(244 248 246 / 0%), #fff 28%);
|
||||
box-shadow: 0 -8px 24px rgb(15 42 34 / 6%);
|
||||
}
|
||||
.old-ft .btn {
|
||||
flex: 1; min-height: 40px; border: 0; border-radius: 12px;
|
||||
font-size: 14px; font-weight: 700; color: #fff; cursor: pointer;
|
||||
}
|
||||
.old-ft .btn.ghost { background: #5f8f7d; }
|
||||
.old-ft .btn.primary { background: linear-gradient(135deg, #12b981, #087f57); }
|
||||
|
||||
.old-mini {
|
||||
display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
|
||||
}
|
||||
.old-mini .btn {
|
||||
min-height: 26px; padding: 0 10px; border-radius: 999px; border: 0;
|
||||
font-size: 11px; font-weight: 700; color: #fff; cursor: pointer;
|
||||
}
|
||||
|
||||
.old-batch-ft {
|
||||
position: absolute; left: 0; right: 0; bottom: 0;
|
||||
display: flex; align-items: center; justify-content: center; gap: 10px;
|
||||
padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
|
||||
border-top: 1px solid var(--m-border); background: #fff;
|
||||
box-shadow: 0 -6px 20px rgb(15 23 42 / 6%);
|
||||
}
|
||||
.old-batch-ft .side {
|
||||
min-width: 64px; min-height: 44px; border: 0; background: transparent;
|
||||
color: #087f57; font-size: 14px; font-weight: 600; cursor: pointer;
|
||||
}
|
||||
.old-batch-ft .main {
|
||||
flex: 1; max-width: 220px; min-height: 44px;
|
||||
border: 1px solid #fecaca; border-radius: 22px; background: #fff;
|
||||
color: #dc2626; font-size: 15px; font-weight: 700; cursor: pointer;
|
||||
}
|
||||
|
||||
/* ========== 市场部 · 对齐 OA ========== */
|
||||
.new-actions {
|
||||
display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
|
||||
padding-top: 10px; border-top: 1px solid #eef4f1; margin-top: 4px;
|
||||
}
|
||||
.m-btn {
|
||||
appearance: none; cursor: pointer;
|
||||
display: inline-flex; align-items: center; justify-content: center;
|
||||
min-height: 32px; padding: 0 12px; border-radius: 8px;
|
||||
font: inherit; font-size: 12px; font-weight: 600;
|
||||
border: 1px solid transparent;
|
||||
transition: opacity .12s, transform .12s;
|
||||
}
|
||||
.m-btn:active { opacity: 0.86; transform: scale(0.98); }
|
||||
.m-btn--ghost {
|
||||
border-color: #e2e8f0; background: #fff; color: #334155;
|
||||
}
|
||||
.m-btn--primary {
|
||||
border-color: var(--m-brand); background: var(--m-brand); color: #fff; font-weight: 700;
|
||||
}
|
||||
.m-btn--soft {
|
||||
border-color: transparent; background: #f1f5f9; color: #334155;
|
||||
}
|
||||
.m-btn--warn {
|
||||
border-color: #fde68a; background: #fff7e8; color: #d97706;
|
||||
}
|
||||
.m-btn--danger {
|
||||
border-color: #fecaca; background: #fff; color: #dc2626;
|
||||
}
|
||||
.m-btn--danger-soft {
|
||||
border-color: #fecaca; background: #fef2f2; color: #dc2626;
|
||||
}
|
||||
|
||||
.new-ft {
|
||||
position: absolute; left: 0; right: 0; bottom: 0;
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
|
||||
background: #fff;
|
||||
border-top: 1px solid #eef2f6;
|
||||
box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
|
||||
}
|
||||
.new-ft .m-btn {
|
||||
height: 40px; min-height: 40px; border-radius: 12px; font-size: 14px; padding: 0 10px;
|
||||
}
|
||||
.new-ft .m-btn--more {
|
||||
flex: 0 0 auto; width: 44px; min-width: 44px; padding: 0;
|
||||
border: 1px solid #e2e8f0; background: #fff; color: #334155;
|
||||
font-size: 18px; font-weight: 700; letter-spacing: 1px;
|
||||
}
|
||||
.new-ft .m-btn--ghost { flex: 1 1 auto; }
|
||||
.new-ft .m-btn--soft { flex: 1; }
|
||||
.new-ft .m-btn--primary {
|
||||
flex: 1.2 1 0; min-width: 88px;
|
||||
box-shadow: 0 2px 8px rgba(10, 159, 109, 0.16);
|
||||
}
|
||||
.new-ft.is-form .m-btn { height: 44px; min-height: 44px; font-size: 15px; }
|
||||
.new-ft.is-form .m-btn--primary { flex: 1.35; }
|
||||
|
||||
.new-mini {
|
||||
display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
|
||||
}
|
||||
.new-mini .m-btn {
|
||||
min-height: 28px; padding: 0 10px; border-radius: 8px; font-size: 11px;
|
||||
}
|
||||
|
||||
.new-batch-ft {
|
||||
position: absolute; left: 0; right: 0; bottom: 0;
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
|
||||
background: #fff;
|
||||
border-top: 1px solid #eef2f6;
|
||||
box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
|
||||
}
|
||||
.new-batch-ft .hint {
|
||||
flex: 0 0 auto; font-size: 13px; color: #646a73; padding-right: 4px;
|
||||
}
|
||||
.new-batch-ft .m-btn {
|
||||
height: 40px; min-height: 40px; border-radius: 12px; font-size: 14px; flex: 1;
|
||||
}
|
||||
.new-batch-ft .m-btn--link {
|
||||
flex: 0 0 auto; min-width: 56px; border: 0; background: transparent;
|
||||
color: var(--m-brand-dark); font-weight: 600;
|
||||
}
|
||||
|
||||
/* 图例 */
|
||||
.legend {
|
||||
margin-top: 16px;
|
||||
background: #fff;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 14px;
|
||||
padding: 14px 16px;
|
||||
font-size: 13px;
|
||||
color: #475569;
|
||||
}
|
||||
.legend h3 { margin: 0 0 10px; font-size: 14px; color: #0f172a; }
|
||||
.legend-row {
|
||||
display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
|
||||
margin: 8px 0;
|
||||
}
|
||||
.legend-row span.label {
|
||||
width: 88px; flex: none; font-size: 12px; color: #64748b; font-weight: 600;
|
||||
}
|
||||
.note-list {
|
||||
margin: 12px 0 0; padding-left: 18px; font-size: 12.5px; color: #64748b;
|
||||
}
|
||||
.note-list li { margin: 6px 0; }
|
||||
code {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
||||
font-size: 12px;
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 5px;
|
||||
padding: 1px 5px;
|
||||
}
|
||||
|
||||
.matrix {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 12.5px;
|
||||
margin-top: 12px;
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #e2e8f0;
|
||||
}
|
||||
.matrix th, .matrix td {
|
||||
text-align: left; padding: 10px 12px;
|
||||
border-bottom: 1px solid #f1f5f9; vertical-align: top;
|
||||
}
|
||||
.matrix th { background: #f8fafc; color: #64748b; font-weight: 650; font-size: 11px; }
|
||||
.matrix tr:last-child td { border-bottom: 0; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="stage">
|
||||
<h1>市场部按钮 · 对齐【OA工作流】样式</h1>
|
||||
<p class="sub">
|
||||
从已上线的 OA 详情底栏、发起页底栏、待办批量条抽取按钮语言,映射到市场部列表卡操作、详情/表单底栏、行内小按钮与批量删除。
|
||||
主色保留市场三墙绿 <b style="color:#087f57">#0a9f6d</b>,不套用 OA 的 #22c55e。
|
||||
</p>
|
||||
|
||||
<div class="rec">
|
||||
<b>设计结论(推荐):</b>
|
||||
市场部放弃「全员实心灰绿 / 渐变」,改为 OA 同构的四级语义:
|
||||
<b>主操作实心品牌绿</b> · <b>次操作白底描边</b> · <b>弱操作浅灰软底</b> ·
|
||||
<b>警告/危险用软色底或描边</b>(非高饱和渐变实心)。圆角与高度分层:卡内 32px/8px,底栏 40–44px/12px。
|
||||
</div>
|
||||
|
||||
<div class="grid-tokens">
|
||||
<div class="token-card">
|
||||
<h3>OA 工作流(上线源)</h3>
|
||||
<ul>
|
||||
<li><span class="swatch" style="background:#22c55e"></span>主按钮:实心 <code>#22c55e</code>,高 40/44,圆角 12</li>
|
||||
<li><span class="swatch" style="background:#fff;border-color:#e2e8f0"></span>次按钮:白底 + <code>#e2e8f0</code> 描边,字 <code>#334155</code></li>
|
||||
<li><span class="swatch" style="background:#f1f5f9"></span>草稿/弱:软灰底 <code>#f1f5f9</code></li>
|
||||
<li><span class="swatch" style="background:#fff7e8"></span>打回:琥珀软底 + 描边(待办批量)</li>
|
||||
<li>更多:44×44 方钮,描边白底</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="token-card">
|
||||
<h3>市场部现状(问题)</h3>
|
||||
<ul>
|
||||
<li>primary / default / plain 几乎都是<strong>实心色</strong>(plain 也被刷成 <code>#5f8f7d</code>)</li>
|
||||
<li>主按钮用 <strong>135° 渐变</strong>,与 OA 扁平实心不一致</li>
|
||||
<li>危险/警告同样渐变实心,同屏饱和度过高</li>
|
||||
<li>卡内 32px、预签 44px、底栏 round 混用,层级不清</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="token-card">
|
||||
<h3>市场部对齐方案</h3>
|
||||
<ul>
|
||||
<li><span class="swatch" style="background:#0a9f6d"></span>主:实心 <code>#0a9f6d</code>(无渐变)</li>
|
||||
<li><span class="swatch" style="background:#fff"></span>次:白底描边(查看/编辑/取消)</li>
|
||||
<li><span class="swatch" style="background:#f1f5f9"></span>弱:浅灰软底(保存草稿类)</li>
|
||||
<li><span class="swatch" style="background:#fff"></span>危险:白底红字描边,或浅红软底</li>
|
||||
<li>警告:琥珀软底(对齐 OA 打回)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tabs" role="tablist">
|
||||
<button type="button" class="tab is-active" data-tab="oa">① OA 工作流参考</button>
|
||||
<button type="button" class="tab" data-tab="list">② 列表卡操作</button>
|
||||
<button type="button" class="tab" data-tab="footer">③ 详情 / 表单底栏</button>
|
||||
<button type="button" class="tab" data-tab="inline">④ 行内小按钮</button>
|
||||
<button type="button" class="tab" data-tab="batch">⑤ 批量底栏</button>
|
||||
<button type="button" class="tab" data-tab="spec">⑥ 规格表</button>
|
||||
</div>
|
||||
|
||||
<!-- ① OA 参考 -->
|
||||
<section class="panel is-on" data-panel="oa">
|
||||
<div class="phones">
|
||||
<div class="phone">
|
||||
<div class="cap">OA · 待办详情底栏(OaDetail)</div>
|
||||
<div class="nav">审批详情</div>
|
||||
<div class="page">
|
||||
<div class="card" style="border-color:#eef2f6;box-shadow:none">
|
||||
<div class="card-hd"><strong>请假申请</strong><span class="pill">审批中</span></div>
|
||||
<div class="field"><span class="k">申请人</span><span class="v">张三</span></div>
|
||||
<div class="field"><span class="k">天数</span><span class="v">2 天</span></div>
|
||||
</div>
|
||||
<div class="oa-ft">
|
||||
<button type="button" class="oa-btn oa-btn--more">⋯</button>
|
||||
<button type="button" class="oa-btn oa-btn--ghost">打回</button>
|
||||
<button type="button" class="oa-btn oa-btn--primary">同意</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="phone">
|
||||
<div class="cap">OA · 发起页底栏(OaStart)</div>
|
||||
<div class="nav">发起审批</div>
|
||||
<div class="page">
|
||||
<div class="card" style="border-color:#eef2f6;box-shadow:none">
|
||||
<div class="card-hd"><strong>用章申请</strong></div>
|
||||
<div class="field"><span class="k">事由</span><span class="v">合同盖章</span></div>
|
||||
</div>
|
||||
<div class="oa-ft" style="padding:12px 14px;gap:10px">
|
||||
<button type="button" class="oa-btn" style="flex:0;background:transparent;color:#94a3b8;font-weight:500;font-size:14px;height:44px">历史</button>
|
||||
<button type="button" class="oa-btn oa-btn--draft">存草稿</button>
|
||||
<button type="button" class="oa-btn oa-btn--submit">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="phone">
|
||||
<div class="cap">OA · 待办批量条(pending batch)</div>
|
||||
<div class="nav">待办中心</div>
|
||||
<div class="page">
|
||||
<div class="oa-batch">
|
||||
<span class="oa-batch__hint">已选 3 项</span>
|
||||
<div class="oa-batch__actions">
|
||||
<button type="button" class="oa-batch__btn is-return">打回</button>
|
||||
<button type="button" class="oa-batch__btn is-ok">通过</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card" style="border-color:#eef2f6;box-shadow:none">
|
||||
<div class="card-hd"><strong>报销单 · 王五</strong><span class="pill">待审批</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="legend">
|
||||
<h3>从 OA 抽取的一致性原则</h3>
|
||||
<ol class="note-list">
|
||||
<li><b>一屏一个实心主色</b>:主行动用品牌实心;其余不用同色实心抢戏。</li>
|
||||
<li><b>次要 = 白底描边</b>,不是「另一个实心灰绿」。</li>
|
||||
<li><b>弱操作 = 浅灰软底</b>(存草稿),无描边、无渐变。</li>
|
||||
<li><b>风险操作 = 软色语义</b>(琥珀打回 / 红字描边删除),避免大红大黄渐变块。</li>
|
||||
<li><b>底栏白底 + 顶部分割线 + 轻阴影</b>;圆角统一 12(底栏)/ 8(卡内)。</li>
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ② 列表卡 -->
|
||||
<section class="panel" data-panel="list">
|
||||
<div class="compare">
|
||||
<div>
|
||||
<div class="col-title">市场部现状 <span class="badge bad">Before</span></div>
|
||||
<div class="phones">
|
||||
<div class="phone">
|
||||
<div class="cap">协议列表卡 · 全员实心</div>
|
||||
<div class="nav">协议单</div>
|
||||
<div class="page">
|
||||
<div class="card">
|
||||
<div class="card-hd"><strong>XY-2026-0312</strong><span class="pill">进行中</span></div>
|
||||
<div class="field"><span class="k">客户</span><span class="v">李女士</span></div>
|
||||
<div class="field"><span class="k">金额</span><span class="v">¥28,000</span></div>
|
||||
<div class="old-actions">
|
||||
<button type="button" class="old-btn primary">查看</button>
|
||||
<button type="button" class="old-btn default">编辑</button>
|
||||
<button type="button" class="old-btn default">催缴</button>
|
||||
<button type="button" class="old-btn danger">删除</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-hd"><strong>预签 · PS-8891</strong><span class="pill">待转</span></div>
|
||||
<div class="field"><span class="k">意向金</span><span class="v">¥5,000</span></div>
|
||||
<div class="old-actions">
|
||||
<button type="button" class="old-btn default">编辑</button>
|
||||
<button type="button" class="old-btn primary">转正式</button>
|
||||
<button type="button" class="old-btn danger">删除</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="col-title">对齐 OA 后 <span class="badge good">After · 推荐</span></div>
|
||||
<div class="phones">
|
||||
<div class="phone">
|
||||
<div class="cap">协议列表卡 · 描边次要 + 实心主</div>
|
||||
<div class="nav">协议单</div>
|
||||
<div class="page">
|
||||
<div class="card">
|
||||
<div class="card-hd"><strong>XY-2026-0312</strong><span class="pill">进行中</span></div>
|
||||
<div class="field"><span class="k">客户</span><span class="v">李女士</span></div>
|
||||
<div class="field"><span class="k">金额</span><span class="v">¥28,000</span></div>
|
||||
<div class="new-actions">
|
||||
<button type="button" class="m-btn m-btn--ghost">编辑</button>
|
||||
<button type="button" class="m-btn m-btn--ghost">催缴</button>
|
||||
<button type="button" class="m-btn m-btn--danger">删除</button>
|
||||
<button type="button" class="m-btn m-btn--primary">查看</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-hd"><strong>预签 · PS-8891</strong><span class="pill">待转</span></div>
|
||||
<div class="field"><span class="k">意向金</span><span class="v">¥5,000</span></div>
|
||||
<div class="new-actions">
|
||||
<button type="button" class="m-btn m-btn--ghost">编辑</button>
|
||||
<button type="button" class="m-btn m-btn--danger">删除</button>
|
||||
<button type="button" class="m-btn m-btn--primary">转正式</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="legend">
|
||||
<h3>列表卡规则</h3>
|
||||
<ul class="note-list">
|
||||
<li>每卡<strong>仅 1 个</strong> <code>primary</code>(查看 / 转正式 / 查看缴费 等主路径)。</li>
|
||||
<li>编辑、催缴、关联等 → <code>ghost</code> 白底描边。</li>
|
||||
<li>删除 / 取消关联 → <code>danger</code> 白底红字描边(不对齐大红渐变块)。</li>
|
||||
<li>尺寸:min-height 32px,padding 0 12px,radius 8,字号 12,字重 600/700。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ③ 底栏 -->
|
||||
<section class="panel" data-panel="footer">
|
||||
<div class="compare">
|
||||
<div>
|
||||
<div class="col-title">市场部现状 <span class="badge bad">Before</span></div>
|
||||
<div class="phones">
|
||||
<div class="phone">
|
||||
<div class="cap">详情底栏 · 灰绿实心「次要」</div>
|
||||
<div class="nav">协议详情</div>
|
||||
<div class="page">
|
||||
<div class="card">
|
||||
<div class="card-hd"><strong>协议详情摘要</strong></div>
|
||||
<div class="field"><span class="k">状态</span><span class="v">草稿</span></div>
|
||||
</div>
|
||||
<div class="old-ft">
|
||||
<button type="button" class="btn ghost">删除</button>
|
||||
<button type="button" class="btn primary">编辑</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="phone">
|
||||
<div class="cap">表单底栏 · 渐变主按钮</div>
|
||||
<div class="nav">编辑协议</div>
|
||||
<div class="page">
|
||||
<div class="card">
|
||||
<div class="card-hd"><strong>基本信息</strong></div>
|
||||
<div class="field"><span class="k">客户</span><span class="v">李女士</span></div>
|
||||
</div>
|
||||
<div class="old-ft">
|
||||
<button type="button" class="btn ghost">取消</button>
|
||||
<button type="button" class="btn primary">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="col-title">对齐 OA 后 <span class="badge good">After · 推荐</span></div>
|
||||
<div class="phones">
|
||||
<div class="phone">
|
||||
<div class="cap">详情底栏 · 对齐 OaDetail</div>
|
||||
<div class="nav">协议详情</div>
|
||||
<div class="page">
|
||||
<div class="card">
|
||||
<div class="card-hd"><strong>协议详情摘要</strong></div>
|
||||
<div class="field"><span class="k">状态</span><span class="v">草稿</span></div>
|
||||
</div>
|
||||
<div class="new-ft">
|
||||
<button type="button" class="m-btn m-btn--more">⋯</button>
|
||||
<button type="button" class="m-btn m-btn--danger">删除</button>
|
||||
<button type="button" class="m-btn m-btn--primary">编辑</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="phone">
|
||||
<div class="cap">表单底栏 · 对齐 OaStart</div>
|
||||
<div class="nav">编辑协议</div>
|
||||
<div class="page">
|
||||
<div class="card">
|
||||
<div class="card-hd"><strong>基本信息</strong></div>
|
||||
<div class="field"><span class="k">客户</span><span class="v">李女士</span></div>
|
||||
</div>
|
||||
<div class="new-ft is-form">
|
||||
<button type="button" class="m-btn m-btn--soft">取消</button>
|
||||
<button type="button" class="m-btn m-btn--primary">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="legend">
|
||||
<h3>底栏规则</h3>
|
||||
<ul class="note-list">
|
||||
<li>容器:白底、顶边 <code>#eef2f6</code>、阴影 <code>0 -4px 16px rgba(15,23,42,.04)</code>(与 OA 一致)。</li>
|
||||
<li>详情:高 40 / 圆角 12;表单:高 44 / 圆角 12。</li>
|
||||
<li>取消/次要 → soft 灰底或 ghost 描边;主保存/提交 → 实心品牌绿,可略加大 flex。</li>
|
||||
<li>操作过多时:左侧 ⋯ 收纳,主路径保留在底栏(对齐 OA「更多」)。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ④ 行内 -->
|
||||
<section class="panel" data-panel="inline">
|
||||
<div class="compare">
|
||||
<div>
|
||||
<div class="col-title">市场部现状 <span class="badge bad">Before</span></div>
|
||||
<div class="phones">
|
||||
<div class="phone">
|
||||
<div class="cap">样本运输 / 缴费 · 胶囊实心</div>
|
||||
<div class="nav">编辑协议</div>
|
||||
<div class="page">
|
||||
<div class="card">
|
||||
<div class="card-hd"><strong>样本与运费</strong></div>
|
||||
<div class="old-mini">
|
||||
<button type="button" class="btn old-btn primary" style="border-radius:999px;min-height:26px;font-size:11px">+ 添加样本</button>
|
||||
<button type="button" class="btn old-btn default" style="border-radius:999px;min-height:26px;font-size:11px">配置运费</button>
|
||||
<button type="button" class="btn old-btn warn" style="border-radius:999px;min-height:26px;font-size:11px">取消运费</button>
|
||||
</div>
|
||||
<div style="margin-top:12px;padding-top:10px;border-top:1px solid #eef4f1">
|
||||
<div style="font-size:13px;font-weight:650;margin-bottom:8px">样本 S-001</div>
|
||||
<div class="old-mini">
|
||||
<button type="button" class="btn old-btn default" style="border-radius:999px;min-height:26px;font-size:11px">编辑</button>
|
||||
<button type="button" class="btn old-btn danger" style="border-radius:999px;min-height:26px;font-size:11px">删除</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="col-title">对齐 OA 后 <span class="badge good">After · 推荐</span></div>
|
||||
<div class="phones">
|
||||
<div class="phone">
|
||||
<div class="cap">行内 · 取消胶囊渐变,改软语义</div>
|
||||
<div class="nav">编辑协议</div>
|
||||
<div class="page">
|
||||
<div class="card">
|
||||
<div class="card-hd"><strong>样本与运费</strong></div>
|
||||
<div class="new-mini">
|
||||
<button type="button" class="m-btn m-btn--primary">+ 添加样本</button>
|
||||
<button type="button" class="m-btn m-btn--ghost">配置运费</button>
|
||||
<button type="button" class="m-btn m-btn--warn">取消运费</button>
|
||||
</div>
|
||||
<div style="margin-top:12px;padding-top:10px;border-top:1px solid #eef4f1">
|
||||
<div style="font-size:13px;font-weight:650;margin-bottom:8px">样本 S-001</div>
|
||||
<div class="new-mini">
|
||||
<button type="button" class="m-btn m-btn--ghost">编辑</button>
|
||||
<button type="button" class="m-btn m-btn--danger-soft">删除</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="legend">
|
||||
<h3>行内小按钮规则</h3>
|
||||
<ul class="note-list">
|
||||
<li>取消 <code>border-radius: 999px</code> 胶囊;统一 8px 圆角,与卡内操作一致。</li>
|
||||
<li>高度约 28px;主添加用实心,配置用 ghost,取消运费用 warn 软底(对齐 OA 打回语义)。</li>
|
||||
<li>行删除用 <code>danger-soft</code> 浅红底,避免迷你大红块。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ⑤ 批量 -->
|
||||
<section class="panel" data-panel="batch">
|
||||
<div class="compare">
|
||||
<div>
|
||||
<div class="col-title">市场部现状 <span class="badge bad">Before</span></div>
|
||||
<div class="phones">
|
||||
<div class="phone">
|
||||
<div class="cap">批量删除 · 大圆角描边红钮</div>
|
||||
<div class="nav">协议单 · 管理</div>
|
||||
<div class="page">
|
||||
<div class="card">
|
||||
<div class="card-hd"><strong>已勾选 2 条</strong></div>
|
||||
</div>
|
||||
<div class="old-batch-ft">
|
||||
<button type="button" class="side">全选</button>
|
||||
<button type="button" class="main">删除选中</button>
|
||||
<button type="button" class="side">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="col-title">对齐 OA 后 <span class="badge good">After · 推荐</span></div>
|
||||
<div class="phones">
|
||||
<div class="phone">
|
||||
<div class="cap">批量 · 对齐 OA 底栏语言</div>
|
||||
<div class="nav">协议单 · 管理</div>
|
||||
<div class="page">
|
||||
<div class="card">
|
||||
<div class="card-hd"><strong>已勾选 2 条</strong></div>
|
||||
</div>
|
||||
<div class="new-batch-ft">
|
||||
<button type="button" class="m-btn m-btn--link">全选</button>
|
||||
<button type="button" class="m-btn m-btn--danger-soft" style="flex:1.2">删除选中</button>
|
||||
<button type="button" class="m-btn m-btn--ghost">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="legend">
|
||||
<h3>批量底栏规则</h3>
|
||||
<ul class="note-list">
|
||||
<li>底栏容器与详情底栏同一套(白底 + 顶线 + 轻阴影),避免单独「大胶囊」。</li>
|
||||
<li>全选/取消:文字链或 ghost;删除:danger-soft 或白底红描边,高 40 / 圆角 12。</li>
|
||||
<li>若后续有「批量通过」类正向操作,用实心品牌绿(对齐 OA pending <code>is-ok</code>)。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ⑥ 规格表 -->
|
||||
<section class="panel" data-panel="spec">
|
||||
<table class="matrix">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>场景</th>
|
||||
<th>OA 参考</th>
|
||||
<th>市场部现状</th>
|
||||
<th>对齐后</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>主操作</td>
|
||||
<td>实心 <code>#22c55e</code>,无渐变</td>
|
||||
<td>渐变 <code>#12b981→#087f57</code></td>
|
||||
<td>实心 <code>#0a9f6d</code>,无渐变</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>次操作</td>
|
||||
<td>白底 + <code>#e2e8f0</code> 描边</td>
|
||||
<td>实心 <code>#5f8f7d</code>(含 plain)</td>
|
||||
<td>白底描边 ghost</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>弱操作</td>
|
||||
<td>软灰 <code>#f1f5f9</code></td>
|
||||
<td>缺失 / 被当成次实心</td>
|
||||
<td>soft 灰底(取消/草稿)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>警告</td>
|
||||
<td>琥珀软底 + 描边</td>
|
||||
<td>黄橙渐变实心</td>
|
||||
<td>warn 软底(取消运费等)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>危险</td>
|
||||
<td>Sheet 行红字 / 少用实心红块</td>
|
||||
<td>红渐变实心</td>
|
||||
<td>白底红描边或浅红软底</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>底栏容器</td>
|
||||
<td>白底 + 顶线 + 轻阴影</td>
|
||||
<td>渐变淡出底 + 更重阴影 / round</td>
|
||||
<td>对齐 OA 底栏容器</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>卡内高度</td>
|
||||
<td>—(OA 以底栏为主)</td>
|
||||
<td>32px / 预签 44px 混用</td>
|
||||
<td>统一 32px · radius 8</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>底栏高度</td>
|
||||
<td>详情 40 / 发起 44</td>
|
||||
<td>约 40 + round</td>
|
||||
<td>详情 40 / 表单 44 · radius 12</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>品牌色</td>
|
||||
<td><code>#22c55e</code>(OA token)</td>
|
||||
<td><code>#0a9f6d</code>(三墙)</td>
|
||||
<td>保持 <code>#0a9f6d</code>,只借结构</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="legend" style="margin-top:16px">
|
||||
<h3>落地时拟改文件(确认后再动代码)</h3>
|
||||
<ul class="note-list">
|
||||
<li><code>mobile-oa-h5/src/styles/market.css</code> — 全局 <code>.van-button--*</code>、列表卡、底栏、批量条</li>
|
||||
<li><code>MarketListCard.vue</code> / <code>PresignOrderCard.vue</code> — primary/plain 语义映射</li>
|
||||
<li><code>MarketBottomBar.vue</code> — 去掉 round 渐变心智,改 ghost/soft/primary</li>
|
||||
<li>协议样本运输 / 缴费面板 — mini 按钮从胶囊实心改为软语义</li>
|
||||
<li><code>mobile-h5</code> 若仅 WebView 嵌套市场 H5,样式以 <code>mobile-oa-h5</code> 为准;小程序壳无需重复按钮皮</li>
|
||||
</ul>
|
||||
<div class="legend-row" style="margin-top:14px">
|
||||
<span class="label">图例预览</span>
|
||||
<button type="button" class="m-btn m-btn--primary">主操作</button>
|
||||
<button type="button" class="m-btn m-btn--ghost">次操作</button>
|
||||
<button type="button" class="m-btn m-btn--soft">弱操作</button>
|
||||
<button type="button" class="m-btn m-btn--warn">警告</button>
|
||||
<button type="button" class="m-btn m-btn--danger">危险描边</button>
|
||||
<button type="button" class="m-btn m-btn--danger-soft">危险软底</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.querySelectorAll('.tab').forEach((tab) => {
|
||||
tab.addEventListener('click', () => {
|
||||
document.querySelectorAll('.tab').forEach((t) => t.classList.remove('is-active'))
|
||||
document.querySelectorAll('.panel').forEach((p) => p.classList.remove('is-on'))
|
||||
tab.classList.add('is-active')
|
||||
const panel = document.querySelector('[data-panel="' + tab.dataset.tab + '"]')
|
||||
if (panel) panel.classList.add('is-on')
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,11 +1,11 @@
|
||||
# Graph Report - src (2026-10-15)
|
||||
|
||||
## Corpus Check
|
||||
- Large corpus: 1035 files · ~685,005 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
|
||||
- Large corpus: 1035 files · ~685,298 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
|
||||
|
||||
## Summary
|
||||
- 3849 nodes · 5641 edges · 60 communities detected
|
||||
- Extraction: 76% EXTRACTED · 24% INFERRED · 0% AMBIGUOUS · INFERRED: 1347 edges (avg confidence: 0.8)
|
||||
- 3850 nodes · 5643 edges · 63 communities detected
|
||||
- Extraction: 76% EXTRACTED · 24% INFERRED · 0% AMBIGUOUS · INFERRED: 1348 edges (avg confidence: 0.8)
|
||||
- Token cost: 0 input · 0 output
|
||||
|
||||
## Community Hubs (Navigation)
|
||||
@@ -50,29 +50,32 @@
|
||||
- [[_COMMUNITY_Community 38|Community 38]]
|
||||
- [[_COMMUNITY_Community 39|Community 39]]
|
||||
- [[_COMMUNITY_Community 40|Community 40]]
|
||||
- [[_COMMUNITY_Community 41|Community 41]]
|
||||
- [[_COMMUNITY_Community 42|Community 42]]
|
||||
- [[_COMMUNITY_Community 43|Community 43]]
|
||||
- [[_COMMUNITY_Community 44|Community 44]]
|
||||
- [[_COMMUNITY_Community 46|Community 46]]
|
||||
- [[_COMMUNITY_Community 49|Community 49]]
|
||||
- [[_COMMUNITY_Community 45|Community 45]]
|
||||
- [[_COMMUNITY_Community 47|Community 47]]
|
||||
- [[_COMMUNITY_Community 50|Community 50]]
|
||||
- [[_COMMUNITY_Community 52|Community 52]]
|
||||
- [[_COMMUNITY_Community 51|Community 51]]
|
||||
- [[_COMMUNITY_Community 53|Community 53]]
|
||||
- [[_COMMUNITY_Community 54|Community 54]]
|
||||
- [[_COMMUNITY_Community 55|Community 55]]
|
||||
- [[_COMMUNITY_Community 56|Community 56]]
|
||||
- [[_COMMUNITY_Community 57|Community 57]]
|
||||
- [[_COMMUNITY_Community 59|Community 59]]
|
||||
- [[_COMMUNITY_Community 60|Community 60]]
|
||||
- [[_COMMUNITY_Community 61|Community 61]]
|
||||
- [[_COMMUNITY_Community 66|Community 66]]
|
||||
- [[_COMMUNITY_Community 70|Community 70]]
|
||||
- [[_COMMUNITY_Community 74|Community 74]]
|
||||
- [[_COMMUNITY_Community 87|Community 87]]
|
||||
- [[_COMMUNITY_Community 63|Community 63]]
|
||||
- [[_COMMUNITY_Community 64|Community 64]]
|
||||
- [[_COMMUNITY_Community 69|Community 69]]
|
||||
- [[_COMMUNITY_Community 72|Community 72]]
|
||||
- [[_COMMUNITY_Community 75|Community 75]]
|
||||
- [[_COMMUNITY_Community 90|Community 90]]
|
||||
- [[_COMMUNITY_Community 91|Community 91]]
|
||||
- [[_COMMUNITY_Community 93|Community 93]]
|
||||
- [[_COMMUNITY_Community 94|Community 94]]
|
||||
|
||||
## God Nodes (most connected - your core abstractions)
|
||||
1. `get()` - 342 edges
|
||||
2. `push()` - 129 edges
|
||||
2. `push()` - 130 edges
|
||||
3. `Number()` - 103 edges
|
||||
4. `emit()` - 34 edges
|
||||
5. `WebSocketClient` - 26 edges
|
||||
@@ -92,297 +95,313 @@
|
||||
- `handleBatchDelete()` --calls--> `withFullscreenLoading()` [INFERRED]
|
||||
views/operations/exhibition-appointment/index.vue → utils/fullscreen-loading.ts
|
||||
- `handleBatchDelete()` --calls--> `withFullscreenLoading()` [INFERRED]
|
||||
views/system/tenant/index.vue → utils/fullscreen-loading.ts
|
||||
views/basic-info/cell-sample-type/index.vue → utils/fullscreen-loading.ts
|
||||
|
||||
## Communities
|
||||
|
||||
### Community 0 - "Community 0"
|
||||
Cohesion: 0.0
|
||||
Nodes (216): fetchAccessLogList(), fetchActiveRegions(), fetchCategoryList(), fetchCategoryParameters(), fetchCellProductPriceList(), fetchCellProductSpecList(), fetchCellProductTypeList(), fetchChannelAccount() (+208 more)
|
||||
Nodes (231): fetchAccessLogList(), fetchActiveRegions(), fetchCategoryList(), fetchCategoryParameters(), fetchCellProductPriceList(), fetchCellProductSpecList(), fetchCellProductTypeList(), fetchChannelAccount() (+223 more)
|
||||
|
||||
### Community 1 - "Community 1"
|
||||
Cohesion: 0.01
|
||||
Nodes (164): fetchSamplePaymentDetail(), handleFocus(), handleInput(), if(), buildPreviewRow(), findEarliestConfirmableSchedule(), fullFileUrl(), handleAttachPreview() (+156 more)
|
||||
Cohesion: 0.02
|
||||
Nodes (127): if(), Number(), applyPreferentialContractForV1Mode(), createEmptyTransport(), datetimeToYmd(), defaultInstallmentStartDateYmd(), if(), initPaymentDetailExpandFlags() (+119 more)
|
||||
|
||||
### Community 2 - "Community 2"
|
||||
Cohesion: 0.02
|
||||
Nodes (103): fetchMyProductionTasks(), fetchMyQcTaskList(), fetchQcTaskDetail(), fetchQcTaskList(), buildTemporaryViewSections(), buildInsertedSiblingCard(), fetchMineTasksForWorkOrders(), resolveShowProtocolPaymentAtGroup() (+95 more)
|
||||
Nodes (131): fetchUploadAttachment(), fetchOaRelatedSummaries(), handleReportUpload(), handleReportUpload(), walk(), buildFilterParams(), currentPrinterName(), handleReset() (+123 more)
|
||||
|
||||
### Community 3 - "Community 3"
|
||||
Cohesion: 0.02
|
||||
Nodes (79): fetchBatchDeleteOaReceiveAccounts(), fetchBatchMarkOaCcTasksRead(), fetchCreateOaReceiveAccount(), fetchDeleteOaReceiveAccount(), fetchMarkOaCcTaskRead(), fetchOaAppDraft(), fetchOaCcUnreadCount(), fetchOaFormAttachments() (+71 more)
|
||||
Nodes (106): fetchMyProductionTasks(), fetchMyQcTaskList(), fetchQcTaskDetail(), fetchQcTaskList(), buildTemporaryViewSections(), buildInsertedSiblingCard(), fetchMineTasksForWorkOrders(), resolveShowProtocolPaymentAtGroup() (+98 more)
|
||||
|
||||
### Community 4 - "Community 4"
|
||||
Cohesion: 0.02
|
||||
Nodes (89): batchSavePilotCheckup(), deletePilotCheckupActualItem(), fetchCheckupInstitutionList(), fetchCheckupInstitutionPackageDetail(), fetchCheckupInstitutionPackages(), fetchPilotCheckupDetail(), fetchPilotCheckupList(), markPilotCheckupChecked() (+81 more)
|
||||
Nodes (89): fetchAddTaskStep(), fetchCopyTaskStep(), fetchDeleteTaskStep(), fetchDispatchProductionTaskSteps(), fetchForwardProductionTask(), fetchProductionTaskDetail(), fetchProductionTaskEditorInit(), fetchProductionTaskList() (+81 more)
|
||||
|
||||
### Community 5 - "Community 5"
|
||||
Cohesion: 0.03
|
||||
Nodes (76): fetchUploadAttachment(), FireworkSystem, handleReportUpload(), handleReportUpload(), walk(), async(), addDispatchItem(), createDispatchItem() (+68 more)
|
||||
Nodes (76): collectIds(), buildInboundBasicSection(), buildInboundCellStorageViewSections(), buildInboundResearchDonationViewSections(), buildReceptionSection(), buildTransportSection(), resolveInboundProtocolStatus(), buildBaseFields() (+68 more)
|
||||
|
||||
### Community 6 - "Community 6"
|
||||
Cohesion: 0.02
|
||||
Nodes (80): fetchCheckupInstitutionInvoices(), fetchCheckupInstitutionProjects(), fetchCreateCheckupInstitution(), fetchCreateCheckupInstitutionInvoice(), fetchCreateCheckupInstitutionProject(), fetchCreateItemUnit(), fetchDeleteItemUnit(), fetchItemUnitList() (+72 more)
|
||||
Nodes (89): batchSavePilotCheckup(), deletePilotCheckupActualItem(), fetchCheckupInstitutionList(), fetchCheckupInstitutionPackageDetail(), fetchCheckupInstitutionPackages(), fetchPilotCheckupDetail(), fetchPilotCheckupList(), markPilotCheckupChecked() (+81 more)
|
||||
|
||||
### Community 7 - "Community 7"
|
||||
Cohesion: 0.02
|
||||
Nodes (64): fetchProductionTaskList(), fetchProductionWasteOutputList(), fetchSampleFreightDetail(), fetchSampleFreightList(), fetchSampleFreightSampleOptions(), fetchUpdateSampleFreight(), fetchProductionReceptionBySampleCode(), fetchProductionReceptionSubmit() (+56 more)
|
||||
Nodes (72): fetchBatchDeleteOaReceiveAccounts(), fetchBatchMarkOaCcTasksRead(), fetchCreateOaReceiveAccount(), fetchDeleteOaReceiveAccount(), fetchMarkOaCcTaskRead(), fetchOaAppDraft(), fetchOaCcUnreadCount(), fetchOaFormAttachments() (+64 more)
|
||||
|
||||
### Community 8 - "Community 8"
|
||||
Cohesion: 0.03
|
||||
Nodes (74): handleBlur(), handleFocus(), handleInput(), fetchConfirmPresignTransfer(), fetchPresignOrderDetail(), fetchPresignOrderList(), fetchPresignTransferReceiptConfirmedList(), fetchPresignTransferReceiptConfirmList() (+66 more)
|
||||
Cohesion: 0.02
|
||||
Nodes (82): fetchCheckupInstitutionInvoices(), fetchCheckupInstitutionProjects(), fetchCreateCheckupInstitution(), fetchCreateCheckupInstitutionInvoice(), fetchCreateCheckupInstitutionProject(), fetchCreateItemUnit(), fetchCreateTenant(), fetchDeleteItemUnit() (+74 more)
|
||||
|
||||
### Community 9 - "Community 9"
|
||||
Cohesion: 0.03
|
||||
Nodes (34): fetchGetMenuList(), ComponentLoader, IframeRouteManager, MenuProcessor, RoutePermissionValidator, RouteRegistry, RouteTransformer, useAppMode() (+26 more)
|
||||
Nodes (70): fetchConfirmPresignTransfer(), fetchPresignOrderDetail(), fetchPresignOrderList(), fetchPresignTransferReceiptConfirmedList(), fetchPresignTransferReceiptConfirmList(), fetchRejectPresignTransfer(), fetchConfirmPaymentTransfer(), fetchCreatePaymentTransfer() (+62 more)
|
||||
|
||||
### Community 10 - "Community 10"
|
||||
Cohesion: 0.03
|
||||
Nodes (60): fetchDictDataOptions(), fetchAttachmentDownloadUrl(), fetchMineQcWorkOrderTabUnfinishedCounts(), fetchOutboundQcDetail(), fetchQcWorkOrderDetail(), fetchQcWorkOrderList(), fetchQcWorkOrdersBySample(), fetchQcWorkOrderTabUnfinishedCounts() (+52 more)
|
||||
Nodes (34): fetchGetMenuList(), ComponentLoader, IframeRouteManager, MenuProcessor, RoutePermissionValidator, RouteRegistry, RouteTransformer, useAppMode() (+26 more)
|
||||
|
||||
### Community 11 - "Community 11"
|
||||
Cohesion: 0.03
|
||||
Nodes (56): useSettingsHandlers(), useSettingsPanel(), useSettingsState(), useCeremony(), useTheme(), if(), chipTitle(), confirmPicker() (+48 more)
|
||||
Nodes (65): useSettingsHandlers(), useSettingsPanel(), useSettingsState(), useCeremony(), useTheme(), if(), branchConditionLines(), collectConditionReferencedFields() (+57 more)
|
||||
|
||||
### Community 12 - "Community 12"
|
||||
Cohesion: 0.03
|
||||
Nodes (54): fetchCreateMenu(), fetchDeleteMenu(), fetchMenuTree(), fetchUpdateMenu(), fetchUpdatePostBoundRoles(), collectIds(), buildInboundBasicSection(), buildInboundCellStorageViewSections() (+46 more)
|
||||
Nodes (59): fetchDictDataOptions(), fetchAttachmentDownloadUrl(), fetchMineQcWorkOrderTabUnfinishedCounts(), fetchOutboundQcDetail(), fetchQcWorkOrderDetail(), fetchQcWorkOrderList(), fetchQcWorkOrdersBySample(), fetchQcWorkOrderTabUnfinishedCounts() (+51 more)
|
||||
|
||||
### Community 13 - "Community 13"
|
||||
Cohesion: 0.04
|
||||
Nodes (69): fetchDeptTree(), fetchOaFlowPreview(), fetchOaTemplateDetail(), branchConditionLines(), collectConditionReferencedFields(), collectFormConditionReferencedFields(), flattenFormRules(), formatConditionPreview() (+61 more)
|
||||
|
||||
### Community 14 - "Community 14"
|
||||
Cohesion: 0.03
|
||||
Nodes (28): fetchCollectionProtocolList(), fetchSampleInsurance(), fetchSampleStorageCert(), fetchUpdateSampleStorageCert(), dash(), fmtMoney(), auditorDisplay(), dash() (+20 more)
|
||||
|
||||
### Community 15 - "Community 15"
|
||||
Cohesion: 0.04
|
||||
Nodes (44): buildBaseFields(), buildFeeSection(), buildInboundBasicSection(), buildInboundCellStorageProductionViewSections(), buildInboundResearchDonationProductionViewSections(), buildOutboundBasicExperimentProductionViewSections(), buildOutboundClinicalProductionViewSections(), buildOutboundDetail() (+36 more)
|
||||
|
||||
### Community 16 - "Community 16"
|
||||
### Community 14 - "Community 14"
|
||||
Cohesion: 0.04
|
||||
Nodes (57): fetchCollectionRegionList(), fetchCreateCollectionRegion(), fetchCreateHospital(), fetchCreateRegionStaff(), fetchDeleteCollectionRegion(), fetchDeleteHospital(), fetchDeleteRegionStaff(), fetchHospitalList() (+49 more)
|
||||
|
||||
### Community 17 - "Community 17"
|
||||
### Community 15 - "Community 15"
|
||||
Cohesion: 0.05
|
||||
Nodes (53): fetchGetMenuCodes(), fetchGetUserInfo(), fetchLogin(), fetchRefreshToken(), fetchUpdateProfile(), fetchUploadProfileAvatar(), fetchWxQrStatus(), fetchUserInfo() (+45 more)
|
||||
Nodes (61): fetchDeptTree(), fetchUserList(), fetchOaFlowPreview(), fetchOaTemplateDetail(), remoteSearchHandoverUsers(), applySchema(), flowNeedsInitiatorSelect(), loadFlowPreview() (+53 more)
|
||||
|
||||
### Community 16 - "Community 16"
|
||||
Cohesion: 0.04
|
||||
Nodes (43): handleBlur(), handleFocus(), handleInput(), fetchClinicalReceiptConfirmed(), fetchClinicalRefundConfirmed(), buildConfirmedParams(), buildPendingParams(), formatAmount() (+35 more)
|
||||
|
||||
### Community 17 - "Community 17"
|
||||
Cohesion: 0.04
|
||||
Nodes (40): fetchDeleteMaterialBatch(), fetchMaterialBatchList(), fetchMaterialBatchOptions(), fetchMaterialList(), fetchMaterialOptions(), fetchUpdateMaterialBatch(), fetchMaterialUsageList(), fetchMyMaterialUsageList() (+32 more)
|
||||
|
||||
### Community 18 - "Community 18"
|
||||
Cohesion: 0.04
|
||||
Nodes (35): fetchClinicalPaymentDetail(), fetchClinicalPayments(), fetchClinicalReceiptConfirmed(), fetchClinicalReceiptPending(), fetchClinicalRefundConfirmed(), fetchClinicalRefundPending(), fetchOrderAdjusts(), fetchOrderDetail() (+27 more)
|
||||
|
||||
### Community 19 - "Community 19"
|
||||
Cohesion: 0.06
|
||||
Nodes (48): fetchOaRelatedSummaries(), buildFormRows(), buildOaPrintFilename(), buildOaPrintModel(), canvasToPdf(), ensurePlainObject(), exportOaApprovalPdf(), extractUrls() (+40 more)
|
||||
|
||||
### Community 20 - "Community 20"
|
||||
Cohesion: 0.05
|
||||
Nodes (39): fetchCreateQcInspectionItemTemplate(), fetchDeleteQcInspectionItemTemplate(), fetchQcInspectionItemTemplateDetail(), fetchQcInspectionItemTemplateList(), fetchQcInspectionItemTemplatesActive(), fetchUpdateQcInspectionItemTemplate(), fetchQcLabTestItemList(), fetchQcLabTestItemsActive() (+31 more)
|
||||
|
||||
### Community 21 - "Community 21"
|
||||
### Community 19 - "Community 19"
|
||||
Cohesion: 0.06
|
||||
Nodes (43): completePilotApplication(), deletePilotApplication(), fetchCreateExhibitionAppointment(), fetchDeleteExhibitionAppointment(), fetchExhibitionAppointmentList(), fetchPilotApplicationList(), fetchUpdateExhibitionAppointment(), startPilotApplication() (+35 more)
|
||||
|
||||
### Community 22 - "Community 22"
|
||||
Cohesion: 0.06
|
||||
Nodes (37): fetchUserList(), fetchAddTaskStep(), fetchCopyTaskStep(), fetchDeleteTaskStep(), fetchDispatchProductionTaskSteps(), fetchForwardProductionTask(), fetchProductionTaskDetail(), fetchProductionTaskEditorInit() (+29 more)
|
||||
|
||||
### Community 23 - "Community 23"
|
||||
### Community 20 - "Community 20"
|
||||
Cohesion: 0.06
|
||||
Nodes (25): fetchQcMaterialBatchDetail(), fetchQcMaterialBatchList(), fetchQcMaterialBatchOptions(), fetchQcMaterialList(), fetchQcMaterialOptions(), fetchUpdateQcMaterialBatch(), fetchMarkQcMaterialUsageFullyUsed(), financeAttachmentsToUrlString() (+17 more)
|
||||
|
||||
### Community 24 - "Community 24"
|
||||
### Community 21 - "Community 21"
|
||||
Cohesion: 0.1
|
||||
Nodes (2): WebSocketClient, TableCache
|
||||
|
||||
### Community 22 - "Community 22"
|
||||
Cohesion: 0.09
|
||||
Nodes (31): base64ToBytes(), bytesToBase64(), decryptJson(), deriveKey(), encryptJson(), fromBase64Url(), hexToBytes(), sha256Hex() (+23 more)
|
||||
|
||||
### Community 23 - "Community 23"
|
||||
Cohesion: 0.06
|
||||
Nodes (20): fetchEthnicList(), fetchSampleFreightDetail(), fetchSampleFreightList(), fetchSampleFreightSampleOptions(), applyDonationBundleToForm(), createEmptyTransport(), ensureEthnicOptionInList(), handleOpenForAdd() (+12 more)
|
||||
|
||||
### Community 24 - "Community 24"
|
||||
Cohesion: 0.09
|
||||
Nodes (8): getDefaultLanguage(), checkStorageCompatibility(), StorageConfig, getSystemStorage(), getSysVersion(), StorageKeyManager, StorageCompatibilityManager, validateStorageData()
|
||||
|
||||
### Community 25 - "Community 25"
|
||||
Cohesion: 0.08
|
||||
Nodes (24): fetchMineProductionWorkOrderTabStepCounts(), fetchMineProductionWorkOrderTabStepCountsDeduped(), fetchProductionWorkOrderCellProductOptions(), fetchProductionWorkOrderDetail(), fetchProductionWorkOrderList(), fetchProductionWorkOrderQcDispatchOptions(), fetchProductionWorkOrderQcInfo(), fetchProductionWorkOrderTabStepCounts() (+16 more)
|
||||
|
||||
### Community 26 - "Community 26"
|
||||
Cohesion: 0.09
|
||||
Nodes (8): getDefaultLanguage(), checkStorageCompatibility(), StorageConfig, getSystemStorage(), getSysVersion(), StorageKeyManager, StorageCompatibilityManager, validateStorageData()
|
||||
|
||||
### Community 27 - "Community 27"
|
||||
Cohesion: 0.07
|
||||
Nodes (20): fetchDeleteMaterialBatch(), fetchMaterialBatchList(), fetchMaterialBatchOptions(), fetchMaterialList(), fetchMaterialOptions(), fetchUpdateMaterialBatch(), fetchMaterialUsageList(), fetchMyMaterialUsageList() (+12 more)
|
||||
|
||||
### Community 28 - "Community 28"
|
||||
Cohesion: 0.08
|
||||
Nodes (20): createEmptySnapshots(), normalizeConfiguredReagents(), normalizeConsumables(), normalizeDataCollections(), normalizeReagents(), normalizeStepOutputs(), serializeAttachments(), serializeEquipmentIds() (+12 more)
|
||||
|
||||
### Community 29 - "Community 29"
|
||||
### Community 27 - "Community 27"
|
||||
Cohesion: 0.09
|
||||
Nodes (22): fetchOaAppList(), fetchOaGroupList(), fetchPublishOaApp(), loadData(), loadGroups(), resetForm(), onSuccess(), goBack() (+14 more)
|
||||
|
||||
### Community 30 - "Community 30"
|
||||
Cohesion: 0.09
|
||||
Nodes (16): fetchEthnicList(), applyDonationBundleToForm(), createEmptyTransport(), ensureEthnicOptionInList(), handleOpenForAdd(), loadEthnicOptions(), normalizeSampleRow(), resetForm() (+8 more)
|
||||
### Community 28 - "Community 28"
|
||||
Cohesion: 0.1
|
||||
Nodes (22): fetchGetMenuCodes(), fetchGetUserInfo(), fetchLogin(), fetchRefreshToken(), fetchUpdateProfile(), fetchUploadProfileAvatar(), fetchWxQrStatus(), fetchUserInfo() (+14 more)
|
||||
|
||||
### Community 31 - "Community 31"
|
||||
### Community 29 - "Community 29"
|
||||
Cohesion: 0.13
|
||||
Nodes (19): fetchCreateMenu(), fetchDeleteMenu(), fetchMenuTree(), fetchUpdateMenu(), postorder(), preorder(), applyTreeExpand(), handleAdd() (+11 more)
|
||||
|
||||
### Community 30 - "Community 30"
|
||||
Cohesion: 0.1
|
||||
Nodes (12): fetchOutboundReleaseMaterial(), fetchOutboundReleaseReviewDetail(), fetchOutboundReleaseReviewList(), fetchReleaseReviewList(), handleReset(), handleSearch(), handleTabChange(), handleToggleSelect() (+4 more)
|
||||
|
||||
### Community 31 - "Community 31"
|
||||
Cohesion: 0.13
|
||||
Nodes (19): fetchCellSampleTypeList(), fetchCreateCellSampleType(), fetchDeleteCellSampleType(), fetchUpdateCellSampleType(), handleAdd(), handleBatchDelete(), handleDelete(), handleDropdownCommand() (+11 more)
|
||||
|
||||
### Community 32 - "Community 32"
|
||||
Cohesion: 0.12
|
||||
Nodes (15): addCopyButton(), highlightCode(), insertLineNumbers(), isBlockProcessed(), markBlockAsProcessed(), processBlock(), setupHighlightDirective(), setupRippleDirective() (+7 more)
|
||||
|
||||
### Community 33 - "Community 33"
|
||||
Cohesion: 0.13
|
||||
Nodes (18): fetchCellSampleTypeList(), fetchCreateCellSampleType(), fetchDeleteCellSampleType(), fetchUpdateCellSampleType(), handleAdd(), handleDelete(), handleDropdownCommand(), handleEdit() (+10 more)
|
||||
|
||||
### Community 34 - "Community 34"
|
||||
Cohesion: 0.15
|
||||
Nodes (17): fetchCreateTenant(), fetchDeleteTenant(), fetchTenantList(), fetchUpdateTenant(), handleAdd(), handleBatchDelete(), handleDelete(), handleDropdownCommand() (+9 more)
|
||||
|
||||
### Community 35 - "Community 35"
|
||||
Cohesion: 0.2
|
||||
Nodes (14): applyFlagToRule(), applySchema(), countRules(), getActiveRule(), getDesigner(), getSetupState(), onMessage(), readFlag() (+6 more)
|
||||
|
||||
### Community 36 - "Community 36"
|
||||
### Community 34 - "Community 34"
|
||||
Cohesion: 0.16
|
||||
Nodes (14): fetchCreateEnvDetectItem(), fetchDeleteEnvDetectItem(), fetchEnvDetectItemDetail(), fetchEnvDetectItemList(), fetchEnvDetectItemsActive(), fetchUpdateEnvDetectItem(), handleAdd(), handleBatchDelete() (+6 more)
|
||||
|
||||
### Community 35 - "Community 35"
|
||||
Cohesion: 0.12
|
||||
Nodes (6): setupOaConfirmationKit(), ensureOaKitMenu(), setupOaLeaveKit(), setupOaOvertimeKit(), setupOaResignationKit(), setupOaTripKit()
|
||||
|
||||
### Community 37 - "Community 37"
|
||||
### Community 36 - "Community 36"
|
||||
Cohesion: 0.16
|
||||
Nodes (10): useTable(), useTableImpl(), getColumnChecks(), useTableColumns(), createErrorHandler(), createSmartDebounce(), defaultResponseAdapter(), extractPagination() (+2 more)
|
||||
|
||||
### Community 38 - "Community 38"
|
||||
### Community 37 - "Community 37"
|
||||
Cohesion: 0.27
|
||||
Nodes (14): useChart(), useChartComponent(), useChartOps(), colourBlend(), getCssVar(), getDarkColor(), getLightColor(), handleElementThemeColor() (+6 more)
|
||||
|
||||
### Community 38 - "Community 38"
|
||||
Cohesion: 0.22
|
||||
Nodes (9): fullFileUrl(), handleDownloadAttachment(), handlePreviewAttachment(), isVideoFile(), normalizeDisplayValue(), resolveReviewCellType(), resolveReviewQuantity(), resolveReviewSpecText() (+1 more)
|
||||
|
||||
### Community 39 - "Community 39"
|
||||
Cohesion: 0.25
|
||||
Nodes (12): buildFlowItems(), isCcProgressItem(), peopleDisplayNames(), progressNodeStatusText(), progressPersonLinesFromItem(), statusText(), displayName(), formatProgressPersonLines() (+4 more)
|
||||
|
||||
### Community 40 - "Community 40"
|
||||
Cohesion: 0.33
|
||||
Nodes (13): buildProtocolPaymentFlowSteps(), dash(), financeReceiptTime(), formatAmount(), hasFinanceReceipt(), hasFinanceRefund(), hasReceiptSubmit(), hasRefundSubmit() (+5 more)
|
||||
|
||||
### Community 41 - "Community 41"
|
||||
Cohesion: 0.19
|
||||
Nodes (6): fetchServiceOrderTxnList(), handleReset(), handleSearch(), handleTabChange(), loadData(), switchTab()
|
||||
|
||||
### Community 42 - "Community 42"
|
||||
### Community 40 - "Community 40"
|
||||
Cohesion: 0.24
|
||||
Nodes (10): buildPrintDocumentHtml(), cleanupPrintIframe(), embedSopImagesAsDataUrls(), getSopA4ContentHeightPx(), getSopA4EditorHeightPx(), normalizeSopCheckboxes(), prepareSopHtmlForPrint(), printSopHtml() (+2 more)
|
||||
|
||||
### Community 42 - "Community 42"
|
||||
Cohesion: 0.26
|
||||
Nodes (8): fetchSampleStorageCertQc(), saveSampleStorageCertQc(), applyDetail(), handleSave(), loadDetail(), resetFormKeys(), resolveStorageCertQcTypeKey(), supportsStorageCertQc()
|
||||
|
||||
### Community 43 - "Community 43"
|
||||
Cohesion: 0.42
|
||||
Nodes (9): buildPaymentFlowSteps(), dash(), formatAmount(), hasFinanceReceipt(), hasFinanceRefund(), hasReceiptSubmit(), hasRefundSubmit(), receiptSubmitTime() (+1 more)
|
||||
|
||||
### Community 44 - "Community 44"
|
||||
Cohesion: 0.28
|
||||
Nodes (1): FireworkSystem
|
||||
|
||||
### Community 45 - "Community 45"
|
||||
Cohesion: 0.25
|
||||
Nodes (2): handleTouchEnd(), setTransition()
|
||||
|
||||
### Community 46 - "Community 46"
|
||||
### Community 47 - "Community 47"
|
||||
Cohesion: 0.28
|
||||
Nodes (4): isActiveHistoryInstance(), isUploadPreviewLabel(), previewColumnMinWidth(), syncWorktabTitle()
|
||||
|
||||
### Community 49 - "Community 49"
|
||||
### Community 50 - "Community 50"
|
||||
Cohesion: 0.39
|
||||
Nodes (6): isIgnorableScriptError(), normalizeErrorMessage(), registerPromiseErrorHandler(), registerResourceErrorHandler(), scriptErrorHandler(), setupErrorHandle()
|
||||
|
||||
### Community 50 - "Community 50"
|
||||
### Community 51 - "Community 51"
|
||||
Cohesion: 0.36
|
||||
Nodes (1): TableHeightCalculator
|
||||
|
||||
### Community 52 - "Community 52"
|
||||
### Community 53 - "Community 53"
|
||||
Cohesion: 0.33
|
||||
Nodes (2): logApiCryptoBootInfo(), maskSecret()
|
||||
|
||||
### Community 53 - "Community 53"
|
||||
### Community 54 - "Community 54"
|
||||
Cohesion: 0.38
|
||||
Nodes (4): handleFocus(), handleInput(), parseDecimalToNumber(), sanitizeDecimalInput()
|
||||
|
||||
### Community 55 - "Community 55"
|
||||
Cohesion: 0.29
|
||||
Nodes (1): fetchQcMonthTemplateList()
|
||||
|
||||
### Community 54 - "Community 54"
|
||||
### Community 56 - "Community 56"
|
||||
Cohesion: 0.4
|
||||
Nodes (2): isUnfinishedQcWorkOrder(), resolveQcWorkOrderUnfinishedBadgeCount()
|
||||
|
||||
### Community 55 - "Community 55"
|
||||
### Community 57 - "Community 57"
|
||||
Cohesion: 0.5
|
||||
Nodes (2): parseEquipmentIds(), syncEquipmentNamesFromOptions()
|
||||
|
||||
### Community 57 - "Community 57"
|
||||
### Community 59 - "Community 59"
|
||||
Cohesion: 0.5
|
||||
Nodes (2): focusInput(), handleKeydown()
|
||||
|
||||
### Community 60 - "Community 60"
|
||||
Cohesion: 0.4
|
||||
Nodes (1): fetchQcMaterialAmountAuthUsers()
|
||||
|
||||
### Community 63 - "Community 63"
|
||||
Cohesion: 0.67
|
||||
Nodes (2): isCurrentPending(), isNotReached()
|
||||
|
||||
### Community 61 - "Community 61"
|
||||
### Community 64 - "Community 64"
|
||||
Cohesion: 0.67
|
||||
Nodes (2): if(), logSidebarMenu()
|
||||
|
||||
### Community 66 - "Community 66"
|
||||
### Community 69 - "Community 69"
|
||||
Cohesion: 1.0
|
||||
Nodes (2): getSettingDefaults(), resetToDefaults()
|
||||
|
||||
### Community 70 - "Community 70"
|
||||
### Community 72 - "Community 72"
|
||||
Cohesion: 1.0
|
||||
Nodes (2): copyTextToClipboard(), copyTextWithFallback()
|
||||
|
||||
### Community 74 - "Community 74"
|
||||
### Community 75 - "Community 75"
|
||||
Cohesion: 1.0
|
||||
Nodes (2): getSourceProtocolAttachment(), normalizeAttachmentFiles()
|
||||
|
||||
### Community 87 - "Community 87"
|
||||
### Community 90 - "Community 90"
|
||||
Cohesion: 1.0
|
||||
Nodes (2): emptyTabCounts(), useProductionWorkOrderTabStepCounts()
|
||||
|
||||
### Community 90 - "Community 90"
|
||||
### Community 93 - "Community 93"
|
||||
Cohesion: 1.0
|
||||
Nodes (2): initialProgress(), useQcWorkOrderAttachmentExport()
|
||||
|
||||
### Community 91 - "Community 91"
|
||||
### Community 94 - "Community 94"
|
||||
Cohesion: 1.0
|
||||
Nodes (2): emptyTabCounts(), useQcWorkOrderTabUnfinishedCounts()
|
||||
|
||||
## Knowledge Gaps
|
||||
- **Thin community `Community 24`** (42 nodes): `WebSocketClient`, `.calculateReconnectDelay()`, `.clearAllTimers()`, `.clearConnectionTimers()`, `.clearTimer()`, `.close()`, `.closeCurrentSocketForReconnect()`, `.connect()`, `.connectionStatusText()`, `.constructor()`, `.destroyInstance()`, `.flushMessageQueue()`, `.getInstance()`, `.getReadyStateText()`, `.handleClose()`, `.handleConnectionTimeout()`, `.handleError()`, `.handleMessage()`, `.handleOpen()`, `.init()`, `.isWebSocketConnected()`, `.reconnect()`, `.resetHeartbeat()`, `.send()`, `.startHeartbeat()`, `.startPing()`, `TableCache`, `.cleanupExpired()`, `.clear()`, `.clearByTags()`, `.clearCurrentSearch()`, `.clearPagination()`, `.constructor()`, `.evictLRU()`, `.generateKey()`, `.generateTags()`, `.get()`, `.getStats()`, `.log()`, `.set()`, `index.ts`, `tableCache.ts`
|
||||
- **Thin community `Community 21`** (42 nodes): `WebSocketClient`, `.calculateReconnectDelay()`, `.clearAllTimers()`, `.clearConnectionTimers()`, `.clearTimer()`, `.close()`, `.closeCurrentSocketForReconnect()`, `.connect()`, `.connectionStatusText()`, `.constructor()`, `.destroyInstance()`, `.flushMessageQueue()`, `.getInstance()`, `.getReadyStateText()`, `.handleClose()`, `.handleConnectionTimeout()`, `.handleError()`, `.handleMessage()`, `.handleOpen()`, `.init()`, `.isWebSocketConnected()`, `.reconnect()`, `.resetHeartbeat()`, `.send()`, `.startHeartbeat()`, `.startPing()`, `TableCache`, `.cleanupExpired()`, `.clear()`, `.clearByTags()`, `.clearCurrentSearch()`, `.clearPagination()`, `.constructor()`, `.evictLRU()`, `.generateKey()`, `.generateTags()`, `.get()`, `.getStats()`, `.log()`, `.set()`, `index.ts`, `tableCache.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 44`** (9 nodes): `cleanupEventListeners()`, `handleTouchEnd()`, `handleTouchMove()`, `handleTouchStart()`, `handleWheelScroll()`, `if()`, `setTransition()`, `setupEventListeners()`, `index.vue`
|
||||
- **Thin community `Community 44`** (9 nodes): `FireworkSystem`, `.constructor()`, `.createFirework()`, `.createParticle()`, `.getAvailableParticle()`, `.initializePool()`, `.preloadAllImages()`, `.preloadImage()`, `index.vue`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 50`** (8 nodes): `TableHeightCalculator`, `.calculate()`, `.calculateOffset()`, `.calculatePaginationOffset()`, `.constructor()`, `.getHeaderHeight()`, `useTableHeight()`, `useTableHeight.ts`
|
||||
- **Thin community `Community 45`** (9 nodes): `cleanupEventListeners()`, `handleTouchEnd()`, `handleTouchMove()`, `handleTouchStart()`, `handleWheelScroll()`, `if()`, `setTransition()`, `setupEventListeners()`, `index.vue`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 52`** (7 nodes): `App.vue`, `main.ts`, `refreshButtonAutoIcons()`, `refreshPanelTitleIcons()`, `logApiCryptoBootInfo()`, `maskSecret()`, `console.ts`
|
||||
- **Thin community `Community 51`** (8 nodes): `TableHeightCalculator`, `.calculate()`, `.calculateOffset()`, `.calculatePaginationOffset()`, `.constructor()`, `.getHeaderHeight()`, `useTableHeight()`, `useTableHeight.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 53`** (7 nodes): `fetchConfirmQcMonthImport()`, `fetchCreateQcMonthTemplate()`, `fetchDeleteQcMonthTemplate()`, `fetchPreviewQcMonthImport()`, `fetchQcMonthTemplateList()`, `fetchUpdateQcMonthTemplate()`, `qc-material-month-template.ts`
|
||||
- **Thin community `Community 53`** (7 nodes): `App.vue`, `main.ts`, `refreshButtonAutoIcons()`, `refreshPanelTitleIcons()`, `logApiCryptoBootInfo()`, `maskSecret()`, `console.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 54`** (6 nodes): `formatQcWorkOrderUnfinishedBadgeCount()`, `isUnfinishedQcWorkOrder()`, `qcWorkOrderUnfinishedBadgeTitle()`, `resolveQcWorkOrderUnfinishedBadgeCount()`, `sumQcWorkOrderGroupUnfinishedBadgeCount()`, `qc-work-order-unfinished-badge.ts`
|
||||
- **Thin community `Community 55`** (7 nodes): `fetchConfirmQcMonthImport()`, `fetchCreateQcMonthTemplate()`, `fetchDeleteQcMonthTemplate()`, `fetchPreviewQcMonthImport()`, `fetchQcMonthTemplateList()`, `fetchUpdateQcMonthTemplate()`, `qc-material-month-template.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 55`** (5 nodes): `equipmentOptionLabel()`, `joinEquipmentIds()`, `parseEquipmentIds()`, `syncEquipmentNamesFromOptions()`, `equipment-select.ts`
|
||||
- **Thin community `Community 56`** (6 nodes): `formatQcWorkOrderUnfinishedBadgeCount()`, `isUnfinishedQcWorkOrder()`, `qcWorkOrderUnfinishedBadgeTitle()`, `resolveQcWorkOrderUnfinishedBadgeCount()`, `sumQcWorkOrderGroupUnfinishedBadgeCount()`, `qc-work-order-unfinished-badge.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 57`** (5 nodes): `focusInput()`, `handleKeydown()`, `if()`, `search()`, `index.vue`
|
||||
- **Thin community `Community 57`** (5 nodes): `equipmentOptionLabel()`, `joinEquipmentIds()`, `parseEquipmentIds()`, `syncEquipmentNamesFromOptions()`, `equipment-select.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 60`** (4 nodes): `isCurrentPending()`, `isNotReached()`, `mergeProgressWithComments()`, `oa-progress-merge-comments.ts`
|
||||
- **Thin community `Community 59`** (5 nodes): `focusInput()`, `handleKeydown()`, `if()`, `search()`, `index.vue`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 61`** (4 nodes): `if()`, `logSidebarMenu()`, `index.vue`, `SidebarSubmenu.vue`
|
||||
- **Thin community `Community 60`** (5 nodes): `fetchBatchRevokeQcMaterialAmountAuth()`, `fetchGrantQcMaterialAmountAuth()`, `fetchQcMaterialAmountAuthUsers()`, `fetchRevokeQcMaterialAmountAuth()`, `qc-material-amount-auth.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 66`** (3 nodes): `getSettingDefaults()`, `resetToDefaults()`, `setting.ts`
|
||||
- **Thin community `Community 63`** (4 nodes): `isCurrentPending()`, `isNotReached()`, `mergeProgressWithComments()`, `oa-progress-merge-comments.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 70`** (3 nodes): `copyTextToClipboard()`, `copyTextWithFallback()`, `copy-text.ts`
|
||||
- **Thin community `Community 64`** (4 nodes): `if()`, `logSidebarMenu()`, `index.vue`, `SidebarSubmenu.vue`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 74`** (3 nodes): `getSourceProtocolAttachment()`, `normalizeAttachmentFiles()`, `protocol-source-attachment.ts`
|
||||
- **Thin community `Community 69`** (3 nodes): `getSettingDefaults()`, `resetToDefaults()`, `setting.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 87`** (3 nodes): `emptyTabCounts()`, `useProductionWorkOrderTabStepCounts()`, `useProductionWorkOrderTabStepCounts.ts`
|
||||
- **Thin community `Community 72`** (3 nodes): `copyTextToClipboard()`, `copyTextWithFallback()`, `copy-text.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 90`** (3 nodes): `initialProgress()`, `useQcWorkOrderAttachmentExport()`, `useQcWorkOrderAttachmentExport.ts`
|
||||
- **Thin community `Community 75`** (3 nodes): `getSourceProtocolAttachment()`, `normalizeAttachmentFiles()`, `protocol-source-attachment.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 91`** (3 nodes): `emptyTabCounts()`, `useQcWorkOrderTabUnfinishedCounts()`, `useQcWorkOrderTabUnfinishedCounts.ts`
|
||||
- **Thin community `Community 90`** (3 nodes): `emptyTabCounts()`, `useProductionWorkOrderTabStepCounts()`, `useProductionWorkOrderTabStepCounts.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 93`** (3 nodes): `initialProgress()`, `useQcWorkOrderAttachmentExport()`, `useQcWorkOrderAttachmentExport.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
- **Thin community `Community 94`** (3 nodes): `emptyTabCounts()`, `useQcWorkOrderTabUnfinishedCounts()`, `useQcWorkOrderTabUnfinishedCounts.ts`
|
||||
Too small to be a meaningful cluster - may be noise or needs more connections extracted.
|
||||
|
||||
## Suggested Questions
|
||||
_Questions this graph is uniquely positioned to answer:_
|
||||
|
||||
- **Why does `push()` connect `Community 5` to `Community 0`, `Community 1`, `Community 2`, `Community 3`, `Community 4`, `Community 6`, `Community 7`, `Community 8`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 17`, `Community 19`, `Community 20`, `Community 21`, `Community 22`, `Community 24`, `Community 25`, `Community 28`, `Community 29`, `Community 39`?**
|
||||
_High betweenness centrality (0.294) - this node is a cross-community bridge._
|
||||
- **Why does `get()` connect `Community 0` to `Community 1`, `Community 2`, `Community 3`, `Community 4`, `Community 5`, `Community 6`, `Community 7`, `Community 8`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 16`, `Community 17`, `Community 18`, `Community 19`, `Community 20`, `Community 21`, `Community 22`, `Community 23`, `Community 25`, `Community 27`, `Community 29`, `Community 30`, `Community 31`, `Community 33`, `Community 34`, `Community 41`, `Community 53`?**
|
||||
_High betweenness centrality (0.255) - this node is a cross-community bridge._
|
||||
- **Why does `Number()` connect `Community 1` to `Community 0`, `Community 2`, `Community 3`, `Community 4`, `Community 5`, `Community 6`, `Community 7`, `Community 8`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 17`, `Community 19`, `Community 23`, `Community 27`, `Community 28`, `Community 30`, `Community 38`, `Community 40`?**
|
||||
_High betweenness centrality (0.167) - this node is a cross-community bridge._
|
||||
- **Why does `push()` connect `Community 2` to `Community 0`, `Community 1`, `Community 3`, `Community 4`, `Community 5`, `Community 6`, `Community 7`, `Community 8`, `Community 9`, `Community 11`, `Community 12`, `Community 13`, `Community 15`, `Community 17`, `Community 18`, `Community 19`, `Community 21`, `Community 22`, `Community 25`, `Community 26`, `Community 27`, `Community 44`?**
|
||||
_High betweenness centrality (0.281) - this node is a cross-community bridge._
|
||||
- **Why does `get()` connect `Community 0` to `Community 1`, `Community 2`, `Community 3`, `Community 4`, `Community 6`, `Community 7`, `Community 8`, `Community 9`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 16`, `Community 17`, `Community 18`, `Community 19`, `Community 20`, `Community 23`, `Community 25`, `Community 27`, `Community 28`, `Community 29`, `Community 30`, `Community 31`, `Community 34`, `Community 39`, `Community 42`, `Community 55`, `Community 60`?**
|
||||
_High betweenness centrality (0.264) - this node is a cross-community bridge._
|
||||
- **Why does `Number()` connect `Community 1` to `Community 0`, `Community 2`, `Community 3`, `Community 5`, `Community 6`, `Community 7`, `Community 8`, `Community 9`, `Community 11`, `Community 12`, `Community 13`, `Community 15`, `Community 16`, `Community 17`, `Community 20`, `Community 22`, `Community 23`, `Community 26`, `Community 37`, `Community 43`, `Community 54`?**
|
||||
_High betweenness centrality (0.153) - this node is a cross-community bridge._
|
||||
- **Are the 341 inferred relationships involving `get()` (e.g. with `resolveStorageSlotRangeFill()` and `buildNodeCodePathFromFlat()`) actually correct?**
|
||||
_`get()` has 341 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **Are the 128 inferred relationships involving `push()` (e.g. with `refreshQcMenuBadges()` and `collectLeafFacilityNodesInTreeOrder()`) actually correct?**
|
||||
_`push()` has 128 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **Are the 129 inferred relationships involving `push()` (e.g. with `refreshQcMenuBadges()` and `collectLeafFacilityNodesInTreeOrder()`) actually correct?**
|
||||
_`push()` has 129 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **Are the 98 inferred relationships involving `Number()` (e.g. with `slotOrderNum()` and `isSlotAvailable()`) actually correct?**
|
||||
_`Number()` has 98 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **Are the 33 inferred relationships involving `emit()` (e.g. with `updateSamples()` and `notifyChanged()`) actually correct?**
|
||||
|
||||
@@ -57,12 +57,12 @@
|
||||
</div>
|
||||
<div id="legend"></div>
|
||||
</div>
|
||||
<div id="stats">3849 nodes · 5641 edges · 395 communities</div>
|
||||
<div id="stats">3850 nodes · 5643 edges · 398 communities</div>
|
||||
</div>
|
||||
<script>
|
||||
const RAW_NODES = [{"id": "app_vue", "label": "App.vue", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "App.vue", "community": 52, "community_name": "Community 52", "source_file": "App.vue", "file_type": "code", "degree": 3}, {"id": "src_app_refreshbuttonautoicons", "label": "refreshButtonAutoIcons()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "refreshButtonAutoIcons()", "community": 52, "community_name": "Community 52", "source_file": "App.vue", "file_type": "code", "degree": 1}, {"id": "src_app_refreshpaneltitleicons", "label": "refreshPanelTitleIcons()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "refreshPanelTitleIcons()", "community": 52, "community_name": "Community 52", "source_file": "App.vue", "file_type": "code", "degree": 1}, {"id": "main_ts", "label": "main.ts", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.4, "font": {"size": 0, "color": "#ffffff"}, "title": "main.ts", "community": 52, "community_name": "Community 52", "source_file": "main.ts", "file_type": "code", "degree": 4}, {"id": "src_main_masksecret", "label": "maskSecret()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "maskSecret()", "community": 52, "community_name": "Community 52", "source_file": "main.ts", "file_type": "code", "degree": 2}, {"id": "src_main_logapicryptobootinfo", "label": "logApiCryptoBootInfo()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "logApiCryptoBootInfo()", "community": 52, "community_name": "Community 52", "source_file": "main.ts", "file_type": "code", "degree": 2}, {"id": "env_d_ts", "label": "env.d.ts", "color": {"background": "#FF9DA7", "border": "#FF9DA7", "highlight": {"background": "#ffffff", "border": "#FF9DA7"}}, "size": 10.0, "font": {"size": 0, "color": "#ffffff"}, "title": "env.d.ts", "community": 137, "community_name": "Community 137", "source_file": "env.d.ts", "file_type": "code", "degree": 0}, {"id": "shims_loose_d_ts", "label": "shims-loose.d.ts", "color": {"background": "#9C755F", "border": "#9C755F", "highlight": {"background": "#ffffff", "border": "#9C755F"}}, "size": 10.0, "font": {"size": 0, "color": "#ffffff"}, "title": "shims-loose.d.ts", "community": 138, "community_name": "Community 138", "source_file": "shims-loose.d.ts", "file_type": "code", "degree": 0}, {"id": "directives_index_ts", "label": "index.ts", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "index.ts", "community": 32, "community_name": "Community 32", "source_file": "directives/index.ts", "file_type": "code", "degree": 1}, {"id": "directives_index_setupglobdirectives", "label": "setupGlobDirectives()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.4, "font": {"size": 0, "color": "#ffffff"}, "title": "setupGlobDirectives()", "community": 32, "community_name": "Community 32", "source_file": "directives/index.ts", "file_type": "code", "degree": 5}, {"id": "directives_core_roles_ts", "label": "roles.ts", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "roles.ts", "community": 32, "community_name": "Community 32", "source_file": "directives/core/roles.ts", "file_type": "code", "degree": 3}, {"id": "core_roles_checkrolepermission", "label": "checkRolePermission()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "checkRolePermission()", "community": 32, "community_name": "Community 32", "source_file": "directives/core/roles.ts", "file_type": "code", "degree": 2}, {"id": "core_roles_removeelement", "label": "removeElement()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "removeElement()", "community": 32, "community_name": "Community 32", "source_file": "directives/core/roles.ts", "file_type": "code", "degree": 2}, {"id": "core_roles_setuprolesdirective",Line truncated
|
||||
const RAW_EDGES = [{"from": "app_vue", "to": "src_app_refreshbuttonautoicons", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_vue", "to": "src_app_refreshpaneltitleicons", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_vue", "to": "main_ts", "label": "imports_from", "title": "imports_from [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "main_ts", "to": "utils_sys_console_ts", "label": "imports_from", "title": "imports_from [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "main_ts", "to": "src_main_masksecret", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "main_ts", "to": "src_main_logapicryptobootinfo", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "src_main_masksecret", "to": "src_main_logapicryptobootinfo", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_index_ts", "to": "directives_index_setupglobdirectives", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_index_setupglobdirectives", "to": "core_auth_setupauthdirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_index_setupglobdirectives", "to": "core_roles_setuprolesdirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_index_setupglobdirectives", "to": "business_highlight_setuphighlightdirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_index_setupglobdirectives", "to": "business_ripple_setuprippledirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_core_roles_ts", "to": "core_roles_checkrolepermission", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_roles_ts", "to": "core_roles_removeelement", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_roles_ts", "to": "core_roles_setuprolesdirective", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "core_roles_checkrolepermission", "to": "core_roles_removeelement", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_auth_ts", "to": "core_auth_checkauthpermission", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_auth_ts", "to": "core_auth_removeelement", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_auth_ts", "to": "core_auth_setupauthdirective", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "core_auth_checkauthpermission", "to": "core_auth_removeelement", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_ripple_ts", "to": "business_ripple_setuprippledirective", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_highlight_ts", "to": "business_highlight_highlightcode", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_highlight_ts", "to": "business_highlight_insertlinenumbers", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_highlight_ts", "to": "business_highlight_addcopybutton", "label": "contains", "title": "contains [EXTRACTED]", "dLine truncated
|
||||
const LEGEND = [{"cid": 0, "color": "#4E79A7", "label": "Community 0", "count": 585}, {"cid": 1, "color": "#F28E2B", "label": "Community 1", "count": 232}, {"cid": 2, "color": "#E15759", "label": "Community 2", "count": 158}, {"cid": 3, "color": "#76B7B2", "label": "Community 3", "count": 139}, {"cid": 4, "color": "#59A14F", "label": "Community 4", "count": 131}, {"cid": 5, "color": "#EDC948", "label": "Community 5", "count": 122}, {"cid": 6, "color": "#B07AA1", "label": "Community 6", "count": 119}, {"cid": 7, "color": "#FF9DA7", "label": "Community 7", "count": 115}, {"cid": 8, "color": "#9C755F", "label": "Community 8", "count": 112}, {"cid": 9, "color": "#BAB0AC", "label": "Community 9", "count": 101}, {"cid": 10, "color": "#4E79A7", "label": "Community 10", "count": 99}, {"cid": 11, "color": "#F28E2B", "label": "Community 11", "count": 95}, {"cid": 12, "color": "#E15759", "label": "Community 12", "count": 90}, {"cid": 13, "color": "#76B7B2", "label": "Community 13", "count": 88}, {"cid": 14, "color": "#59A14F", "label": "Community 14", "count": 78}, {"cid": 15, "color": "#EDC948", "label": "Community 15", "count": 77}, {"cid": 16, "color": "#B07AA1", "label": "Community 16", "count": 73}, {"cid": 17, "color": "#FF9DA7", "label": "Community 17", "count": 70}, {"cid": 18, "color": "#9C755F", "label": "Community 18", "count": 62}, {"cid": 19, "color": "#BAB0AC", "label": "Community 19", "count": 59}, {"cid": 20, "color": "#4E79A7", "label": "Community 20", "count": 57}, {"cid": 21, "color": "#F28E2B", "label": "Community 21", "count": 53}, {"cid": 22, "color": "#E15759", "label": "Community 22", "count": 51}, {"cid": 23, "color": "#76B7B2", "label": "Community 23", "count": 46}, {"cid": 24, "color": "#59A14F", "label": "Community 24", "count": 42}, {"cid": 25, "color": "#EDC948", "label": "Community 25", "count": 37}, {"cid": 26, "color": "#B07AA1", "label": "Community 26", "count": 37}, {"cid": 27, "color": "#FF9DA7", "label": "Community 27", "count": 36}, {"cid": 28, "color": "#9C755F", "label": "Community 28", "count": 35}, {"cid": 29, "color": "#BAB0AC", "label": "Community 29", "count": 33}, {"cid": 30, "color": "#4E79A7", "label": "Community 30", "count": 29}, {"cid": 31, "color": "#F28E2B", "label": "Community 31", "count": 24}, {"cid": 32, "color": "#E15759", "label": "Community 32", "count": 22}, {"cid": 33, "color": "#76B7B2", "label": "Community 33", "count": 22}, {"cid": 34, "color": "#59A14F", "label": "Community 34", "count": 20}, {"cid": 35, "color": "#EDC948", "label": "Community 35", "count": 19}, {"cid": 36, "color": "#B07AA1", "label": "Community 36", "count": 17}, {"cid": 37, "color": "#FF9DA7", "label": "Community 37", "count": 17}, {"cid": 38, "color": "#9C755F", "label": "Community 38", "count": 16}, {"cid": 39, "color": "#BAB0AC", "label": "Community 39", "count": 14}, {"cid": 40, "color": "#4E79A7", "label": "Community 40", "count": 14}, {"cid": 41, "color": "#F28E2B", "label": "Community 41", "count": 14}, {"cid": 42, "color": "#E15759", "label": "Community 42", "count": 13}, {"cid": 43, "color": "#76B7B2", "label": "Community 43", "count": 13}, {"cid": 44, "color": "#59A14F", "label": "Community 44", "count": 9}, {"cid": 45, "color": "#EDC948", "label": "Community 45", "count": 9}, {"cid": 46, "color": "#B07AA1", "label": "Community 46", "count": 9}, {"cid": 47, "color": "#FF9DA7", "label": "Community 47", "count": 9}, {"cid": 48, "color": "#9C755F", "label": "Community 48", "count": 9}, {"cid": 49, "color": "#BAB0AC", "label": "Community 49", "count": 8}, {"cid": 50, "color": "#4E79A7", "label": "Community 50", "count": 8}, {"cid": 51, "color": "#F28E2B", "label": "Community 51", "count": 8}, {"cid": 52, "color": "#E15759", "label": "Community 52", "count": 7}, {"cid": 53, "color": "#76B7B2", "label": "Community 53", "count": 7}, {"cid": 54, "color": "#59A14F", "label": "Community 54", "count": 6}, {"cid": 55, "color": "#EDC948", "label": "Community 55", "count": 5}, {"cid": 56, "color": "#B07AA1", "label": "Community 56", "count": 5}, {"cid": 57, "color": "#FF9DA7", "label": "Community 57", "count": 5}, {"cid": 58, "color": "#9C755F", "label": "Community 58", "count": 4}, {"cid": 59, "color": "#BAB0AC", "label": "Community 59", "count": 4}, {"cid": 60, "color": "#4E79A7", "label": "Community 60", "count": 4}, {"cid": 61, "color": "#F28E2B", "label": "Community 61", "count": 4}, {"cid": 62, "color": "#E15759", "label": "Community 62", "count": 4}, {"cid": 63, "color": "#76B7B2", "label": "Community 63", "count": 4}, {"cid": 64, "color": "#59A14F", "label": "Community 64", "count": 4}, {"cid": 65, "color": "#EDC948", "label": "Community 65", "count": 3}, {"cid": 66, "color": "#B07AA1", "label": "Community 66", "count": 3}, {"cid": 67, "color": "#FF9DA7", "label": "Community 67", "count": 3}, {"cid": 68, "color": "#9C755F", "label": "Community 68", "count": 3}, {"cid": 69, "color": "#BAB0AC", "label": "Community 69", "count": 3}, {"cid": 70, "color": "#4E79A7", "label": "CommuniLine truncated
|
||||
const RAW_NODES = [{"id": "app_vue", "label": "App.vue", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "App.vue", "community": 53, "community_name": "Community 53", "source_file": "App.vue", "file_type": "code", "degree": 3}, {"id": "src_app_refreshbuttonautoicons", "label": "refreshButtonAutoIcons()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "refreshButtonAutoIcons()", "community": 53, "community_name": "Community 53", "source_file": "App.vue", "file_type": "code", "degree": 1}, {"id": "src_app_refreshpaneltitleicons", "label": "refreshPanelTitleIcons()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "refreshPanelTitleIcons()", "community": 53, "community_name": "Community 53", "source_file": "App.vue", "file_type": "code", "degree": 1}, {"id": "main_ts", "label": "main.ts", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.4, "font": {"size": 0, "color": "#ffffff"}, "title": "main.ts", "community": 53, "community_name": "Community 53", "source_file": "main.ts", "file_type": "code", "degree": 4}, {"id": "src_main_masksecret", "label": "maskSecret()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "maskSecret()", "community": 53, "community_name": "Community 53", "source_file": "main.ts", "file_type": "code", "degree": 2}, {"id": "src_main_logapicryptobootinfo", "label": "logApiCryptoBootInfo()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "logApiCryptoBootInfo()", "community": 53, "community_name": "Community 53", "source_file": "main.ts", "file_type": "code", "degree": 2}, {"id": "env_d_ts", "label": "env.d.ts", "color": {"background": "#4E79A7", "border": "#4E79A7", "highlight": {"background": "#ffffff", "border": "#4E79A7"}}, "size": 10.0, "font": {"size": 0, "color": "#ffffff"}, "title": "env.d.ts", "community": 140, "community_name": "Community 140", "source_file": "env.d.ts", "file_type": "code", "degree": 0}, {"id": "shims_loose_d_ts", "label": "shims-loose.d.ts", "color": {"background": "#F28E2B", "border": "#F28E2B", "highlight": {"background": "#ffffff", "border": "#F28E2B"}}, "size": 10.0, "font": {"size": 0, "color": "#ffffff"}, "title": "shims-loose.d.ts", "community": 141, "community_name": "Community 141", "source_file": "shims-loose.d.ts", "file_type": "code", "degree": 0}, {"id": "directives_index_ts", "label": "index.ts", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "index.ts", "community": 32, "community_name": "Community 32", "source_file": "directives/index.ts", "file_type": "code", "degree": 1}, {"id": "directives_index_setupglobdirectives", "label": "setupGlobDirectives()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.4, "font": {"size": 0, "color": "#ffffff"}, "title": "setupGlobDirectives()", "community": 32, "community_name": "Community 32", "source_file": "directives/index.ts", "file_type": "code", "degree": 5}, {"id": "directives_core_roles_ts", "label": "roles.ts", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "roles.ts", "community": 32, "community_name": "Community 32", "source_file": "directives/core/roles.ts", "file_type": "code", "degree": 3}, {"id": "core_roles_checkrolepermission", "label": "checkRolePermission()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "checkRolePermission()", "community": 32, "community_name": "Community 32", "source_file": "directives/core/roles.ts", "file_type": "code", "degree": 2}, {"id": "core_roles_removeelement", "label": "removeElement()", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "removeElement()", "community": 32, "community_name": "Community 32", "source_file": "directives/core/roles.ts", "file_type": "code", "degree": 2}, {"id": "core_roles_setuprolesdirective",Line truncated
|
||||
const RAW_EDGES = [{"from": "app_vue", "to": "src_app_refreshbuttonautoicons", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_vue", "to": "src_app_refreshpaneltitleicons", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_vue", "to": "main_ts", "label": "imports_from", "title": "imports_from [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "main_ts", "to": "utils_sys_console_ts", "label": "imports_from", "title": "imports_from [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "main_ts", "to": "src_main_masksecret", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "main_ts", "to": "src_main_logapicryptobootinfo", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "src_main_masksecret", "to": "src_main_logapicryptobootinfo", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_index_ts", "to": "directives_index_setupglobdirectives", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_index_setupglobdirectives", "to": "core_auth_setupauthdirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_index_setupglobdirectives", "to": "core_roles_setuprolesdirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_index_setupglobdirectives", "to": "business_highlight_setuphighlightdirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_index_setupglobdirectives", "to": "business_ripple_setuprippledirective", "label": "calls", "title": "calls [INFERRED]", "dashes": true, "width": 1, "color": {"opacity": 0.35}, "confidence": "INFERRED"}, {"from": "directives_core_roles_ts", "to": "core_roles_checkrolepermission", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_roles_ts", "to": "core_roles_removeelement", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_roles_ts", "to": "core_roles_setuprolesdirective", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "core_roles_checkrolepermission", "to": "core_roles_removeelement", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_auth_ts", "to": "core_auth_checkauthpermission", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_auth_ts", "to": "core_auth_removeelement", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_core_auth_ts", "to": "core_auth_setupauthdirective", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "core_auth_checkauthpermission", "to": "core_auth_removeelement", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_ripple_ts", "to": "business_ripple_setuprippledirective", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_highlight_ts", "to": "business_highlight_highlightcode", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_highlight_ts", "to": "business_highlight_insertlinenumbers", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "directives_business_highlight_ts", "to": "business_highlight_addcopybutton", "label": "contains", "title": "contains [EXTRACTED]", "dLine truncated
|
||||
const LEGEND = [{"cid": 0, "color": "#4E79A7", "label": "Community 0", "count": 612}, {"cid": 1, "color": "#F28E2B", "label": "Community 1", "count": 179}, {"cid": 2, "color": "#E15759", "label": "Community 2", "count": 173}, {"cid": 3, "color": "#76B7B2", "label": "Community 3", "count": 168}, {"cid": 4, "color": "#59A14F", "label": "Community 4", "count": 155}, {"cid": 5, "color": "#EDC948", "label": "Community 5", "count": 131}, {"cid": 6, "color": "#B07AA1", "label": "Community 6", "count": 131}, {"cid": 7, "color": "#FF9DA7", "label": "Community 7", "count": 128}, {"cid": 8, "color": "#9C755F", "label": "Community 8", "count": 119}, {"cid": 9, "color": "#BAB0AC", "label": "Community 9", "count": 102}, {"cid": 10, "color": "#4E79A7", "label": "Community 10", "count": 102}, {"cid": 11, "color": "#F28E2B", "label": "Community 11", "count": 100}, {"cid": 12, "color": "#E15759", "label": "Community 12", "count": 100}, {"cid": 13, "color": "#76B7B2", "label": "Community 13", "count": 78}, {"cid": 14, "color": "#59A14F", "label": "Community 14", "count": 73}, {"cid": 15, "color": "#EDC948", "label": "Community 15", "count": 72}, {"cid": 16, "color": "#B07AA1", "label": "Community 16", "count": 70}, {"cid": 17, "color": "#FF9DA7", "label": "Community 17", "count": 68}, {"cid": 18, "color": "#9C755F", "label": "Community 18", "count": 57}, {"cid": 19, "color": "#BAB0AC", "label": "Community 19", "count": 53}, {"cid": 20, "color": "#4E79A7", "label": "Community 20", "count": 46}, {"cid": 21, "color": "#F28E2B", "label": "Community 21", "count": 42}, {"cid": 22, "color": "#E15759", "label": "Community 22", "count": 39}, {"cid": 23, "color": "#76B7B2", "label": "Community 23", "count": 38}, {"cid": 24, "color": "#59A14F", "label": "Community 24", "count": 37}, {"cid": 25, "color": "#EDC948", "label": "Community 25", "count": 37}, {"cid": 26, "color": "#B07AA1", "label": "Community 26", "count": 35}, {"cid": 27, "color": "#FF9DA7", "label": "Community 27", "count": 33}, {"cid": 28, "color": "#9C755F", "label": "Community 28", "count": 31}, {"cid": 29, "color": "#BAB0AC", "label": "Community 29", "count": 24}, {"cid": 30, "color": "#4E79A7", "label": "Community 30", "count": 24}, {"cid": 31, "color": "#F28E2B", "label": "Community 31", "count": 23}, {"cid": 32, "color": "#E15759", "label": "Community 32", "count": 22}, {"cid": 33, "color": "#76B7B2", "label": "Community 33", "count": 19}, {"cid": 34, "color": "#59A14F", "label": "Community 34", "count": 19}, {"cid": 35, "color": "#EDC948", "label": "Community 35", "count": 17}, {"cid": 36, "color": "#B07AA1", "label": "Community 36", "count": 17}, {"cid": 37, "color": "#FF9DA7", "label": "Community 37", "count": 16}, {"cid": 38, "color": "#9C755F", "label": "Community 38", "count": 14}, {"cid": 39, "color": "#BAB0AC", "label": "Community 39", "count": 14}, {"cid": 40, "color": "#4E79A7", "label": "Community 40", "count": 13}, {"cid": 41, "color": "#F28E2B", "label": "Community 41", "count": 13}, {"cid": 42, "color": "#E15759", "label": "Community 42", "count": 12}, {"cid": 43, "color": "#76B7B2", "label": "Community 43", "count": 10}, {"cid": 44, "color": "#59A14F", "label": "Community 44", "count": 9}, {"cid": 45, "color": "#EDC948", "label": "Community 45", "count": 9}, {"cid": 46, "color": "#B07AA1", "label": "Community 46", "count": 9}, {"cid": 47, "color": "#FF9DA7", "label": "Community 47", "count": 9}, {"cid": 48, "color": "#9C755F", "label": "Community 48", "count": 9}, {"cid": 49, "color": "#BAB0AC", "label": "Community 49", "count": 9}, {"cid": 50, "color": "#4E79A7", "label": "Community 50", "count": 8}, {"cid": 51, "color": "#F28E2B", "label": "Community 51", "count": 8}, {"cid": 52, "color": "#E15759", "label": "Community 52", "count": 8}, {"cid": 53, "color": "#76B7B2", "label": "Community 53", "count": 7}, {"cid": 54, "color": "#59A14F", "label": "Community 54", "count": 7}, {"cid": 55, "color": "#EDC948", "label": "Community 55", "count": 7}, {"cid": 56, "color": "#B07AA1", "label": "Community 56", "count": 6}, {"cid": 57, "color": "#FF9DA7", "label": "Community 57", "count": 5}, {"cid": 58, "color": "#9C755F", "label": "Community 58", "count": 5}, {"cid": 59, "color": "#BAB0AC", "label": "Community 59", "count": 5}, {"cid": 60, "color": "#4E79A7", "label": "Community 60", "count": 5}, {"cid": 61, "color": "#F28E2B", "label": "Community 61", "count": 4}, {"cid": 62, "color": "#E15759", "label": "Community 62", "count": 4}, {"cid": 63, "color": "#76B7B2", "label": "Community 63", "count": 4}, {"cid": 64, "color": "#59A14F", "label": "Community 64", "count": 4}, {"cid": 65, "color": "#EDC948", "label": "Community 65", "count": 4}, {"cid": 66, "color": "#B07AA1", "label": "Community 66", "count": 4}, {"cid": 67, "color": "#FF9DA7", "label": "Community 67", "count": 4}, {"cid": 68, "color": "#9C755F", "label": "Community 68", "count": 3}, {"cid": 69, "color": "#BAB0AC", "label": "Community 69", "count": 3}, {"cid": 70, "color": "#4E79A7", "label": "CommLine truncated
|
||||
|
||||
// HTML-escape helper — prevents XSS when injecting graph data into innerHTML
|
||||
function esc(s) {
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/common/index.ts": 1781272556.3597305,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/directive/directive.d.ts": 1781272556.3601494,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/api/api.d.ts": 1781272556.3606477,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/import/components.d.ts": 1792026466.2337976,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/import/auto-imports.d.ts": 1792026453.592733,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/import/components.d.ts": 1792059675.1250718,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/import/auto-imports.d.ts": 1792059659.3977199,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/store/index.ts": 1787887312.735774,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/types/router/index.ts": 1787887320.8486114,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/composables/useAttachmentActions.ts": 1788162977.6691713,
|
||||
@@ -64,7 +64,7 @@
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/oa-trip-kit-runtime.ts": 1785412937.5821183,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/oa-form-create-overtime-kit.ts": 1785488982.6957128,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/oa-approval-print-related.ts": 1785145511.865531,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/presign-save-auto-submit.ts": 1791950536.869089,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/presign-save-auto-submit.ts": 1792075222.9989974,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/qc-material-ui.ts": 1781525352.6976836,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/sop-print.ts": 1787899876.3465168,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/qc-work-order-tabs.ts": 1787193681.0370538,
|
||||
@@ -125,7 +125,7 @@
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/oa-overtime-hours.ts": 1786373623.0874693,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/oa-form-create-leave-kit.ts": 1785488971.141004,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/production-work-order-step-badge.ts": 1783307221.345424,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/presign-save-auto-submit.test.ts": 1791950533.415062,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/presign-save-auto-submit.test.ts": 1792075235.2212684,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/sample-freight-config-guard.ts": 1791784010.7375543,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/oa-owner-field-defaults.ts": 1785401266.0298183,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/qc-work-order-inbound-sample-cards.ts": 1786958660.8933563,
|
||||
@@ -430,7 +430,7 @@
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/material-usage.ts": 1782894693.658203,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/pre-transit-sample.ts": 1782204427.8344586,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/qc-third-party-company.ts": 1781415389.1483624,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/collection-protocol.ts": 1781750452.7497737,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/collection-protocol.ts": 1792075243.0424178,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/chinaRegion.ts": 1781272556.6606348,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/storage-entry-sms-notification.ts": 1781272556.660898,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/business.ts": 1781750847.0646322,
|
||||
@@ -460,7 +460,7 @@
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/material.ts": 1782894693.658258,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/sample-reception.ts": 1782719389.581961,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/auth.ts": 1790217216.9281998,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/protocol-sample-payment.ts": 1791616440.5825613,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/protocol-sample-payment.ts": 1792075236.7229176,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/api/qc-work-order.ts": 1791862690.2468123,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/auth/login/index.vue": 1789715240.9777095,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/presign-order/index.vue": 1791603964.5550117,
|
||||
@@ -475,7 +475,7 @@
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/ProtocolRefundRecordDialog.vue": 1791471058.669799,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/ProtocolViewDialog.vue": 1792029038.7091923,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue": 1791162227.1000674,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/ProtocolFormDialog.vue": 1791914003.9575415,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/ProtocolFormDialog.vue": 1792075262.2818923,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/SamplePaymentPanel.vue": 1791874376.61873,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/protocol/ProtocolAuditDialog.vue": 1782893854.3675368,
|
||||
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/cell-storage/sample-info/index.vue": 1791187848.6336563,
|
||||
|
||||
@@ -35,6 +35,7 @@ export function fetchCollectionProtocolDetail(id: string) {
|
||||
samples: Array<Record<string, unknown>> | null
|
||||
payment: Record<string, unknown> | null
|
||||
paymentDetails: Array<Record<string, unknown>> | null
|
||||
samplePayments?: Array<Record<string, unknown>> | null
|
||||
attachments?: Array<Record<string, unknown>>
|
||||
storageCert?: Record<string, unknown> | null
|
||||
}>({
|
||||
@@ -175,11 +176,15 @@ export function fetchUpdatePaymentDetailDraft(
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchSubmitReceiptFinance(detailId: string, data?: PaymentDetailDraftPayload) {
|
||||
export function fetchSubmitReceiptFinance(
|
||||
detailId: string,
|
||||
data?: PaymentDetailDraftPayload,
|
||||
options?: { showSuccessMessage?: boolean }
|
||||
) {
|
||||
return request.post({
|
||||
url: `/web/admin/protocol-payment-details/${detailId}/submit-receipt-finance`,
|
||||
data: data || {},
|
||||
showSuccessMessage: true
|
||||
showSuccessMessage: options?.showSuccessMessage !== false
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -41,10 +41,13 @@ export function fetchUpdatePaymentTransfer(transferId: string, data: Record<stri
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchSubmitPaymentTransferFinance(transferId: string) {
|
||||
export function fetchSubmitPaymentTransferFinance(
|
||||
transferId: string,
|
||||
options?: { showSuccessMessage?: boolean }
|
||||
) {
|
||||
return request.post({
|
||||
url: `/web/admin/payment-transfers/${transferId}/submit-receipt-finance`,
|
||||
showSuccessMessage: true
|
||||
showSuccessMessage: options?.showSuccessMessage !== false
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { describe, it } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import {
|
||||
collectDfjTransferIds,
|
||||
flattenSamplePaymentTransfers,
|
||||
formatAutoSubmitFinanceFailureMessage,
|
||||
submitDfjTransfersOnSave
|
||||
} from './presign-save-auto-submit'
|
||||
@@ -30,6 +31,31 @@ describe('presign-save-auto-submit', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('formats protocol entity label', () => {
|
||||
assert.equal(
|
||||
formatAutoSubmitFinanceFailureMessage([{ id: 't1', message: '请选择转账方式' }], '协议'),
|
||||
'协议已保存,但有 1 笔提交财务确认失败:请选择转账方式'
|
||||
)
|
||||
})
|
||||
|
||||
it('flattens sample payment transfers', () => {
|
||||
assert.deepEqual(
|
||||
flattenSamplePaymentTransfers([
|
||||
{
|
||||
schedules: [
|
||||
{ transfers: [{ id: 'a', payStatus: 'dfj' }] },
|
||||
{ transfers: [{ id: 'b', payStatus: 'jfqrz' }, null] }
|
||||
]
|
||||
},
|
||||
{ schedules: [] }
|
||||
]),
|
||||
[
|
||||
{ id: 'a', payStatus: 'dfj' },
|
||||
{ id: 'b', payStatus: 'jfqrz' }
|
||||
]
|
||||
)
|
||||
})
|
||||
|
||||
it('continues submitting after one failure', async () => {
|
||||
const calls: string[] = []
|
||||
const failures = await submitDfjTransfersOnSave(
|
||||
|
||||
@@ -22,7 +22,8 @@ export function collectDfjTransferIds(
|
||||
}
|
||||
|
||||
export function formatAutoSubmitFinanceFailureMessage(
|
||||
failures: Array<AutoSubmitFailure | string> | null | undefined
|
||||
failures: Array<AutoSubmitFailure | string> | null | undefined,
|
||||
entityLabel = '订单'
|
||||
): string {
|
||||
const list = Array.isArray(failures) ? failures.filter(Boolean) : []
|
||||
if (!list.length) return ''
|
||||
@@ -33,7 +34,26 @@ export function formatAutoSubmitFinanceFailureMessage(
|
||||
: String(item?.message || '提交失败').trim()
|
||||
)
|
||||
.filter(Boolean)
|
||||
return `订单已保存,但有 ${list.length} 笔提交财务确认失败:${reasons.join(';')}`
|
||||
const label = String(entityLabel || '订单').trim() || '订单'
|
||||
return `${label}已保存,但有 ${list.length} 笔提交财务确认失败:${reasons.join(';')}`
|
||||
}
|
||||
|
||||
/** 从 v2 samplePayments 展平全部转账笔(供保存后自动提交财务) */
|
||||
export function flattenSamplePaymentTransfers(
|
||||
samplePayments: Array<Record<string, any>> | null | undefined
|
||||
): PresignTransferLike[] {
|
||||
const payments = Array.isArray(samplePayments) ? samplePayments : []
|
||||
const out: PresignTransferLike[] = []
|
||||
for (const pay of payments) {
|
||||
const schedules = Array.isArray(pay?.schedules) ? pay.schedules : []
|
||||
for (const sch of schedules) {
|
||||
const transfers = Array.isArray(sch?.transfers) ? sch.transfers : []
|
||||
for (const tr of transfers) {
|
||||
if (tr && typeof tr === 'object') out.push(tr)
|
||||
}
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
export async function submitDfjTransfersOnSave(
|
||||
|
||||
@@ -1184,8 +1184,15 @@
|
||||
fetchCollectionProtocolDetail,
|
||||
fetchCreateCollectionProtocol,
|
||||
fetchUpdateCollectionProtocol,
|
||||
fetchSubmitReceiptFinance,
|
||||
type CollectionProtocolRow
|
||||
} from '@/api/collection-protocol'
|
||||
import { fetchSubmitPaymentTransferFinance } from '@/api/protocol-sample-payment'
|
||||
import {
|
||||
flattenSamplePaymentTransfers,
|
||||
formatAutoSubmitFinanceFailureMessage,
|
||||
submitDfjTransfersOnSave
|
||||
} from '@/utils/presign-save-auto-submit'
|
||||
import { fetchUploadAttachment } from '@/api/business'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import {
|
||||
@@ -2597,11 +2604,36 @@
|
||||
payload.paymentDetails = formData.paymentDetails.map(buildProtocolPaymentDetailPayload)
|
||||
}
|
||||
|
||||
let protocolId = ''
|
||||
if (isEdit.value && editingId.value) {
|
||||
await fetchUpdateCollectionProtocol(editingId.value, payload)
|
||||
protocolId = String(editingId.value)
|
||||
} else {
|
||||
await fetchCreateCollectionProtocol(payload)
|
||||
const created: any = await fetchCreateCollectionProtocol(payload)
|
||||
protocolId = String(created?.id || created?.protocol?.id || '')
|
||||
}
|
||||
|
||||
if (protocolId) {
|
||||
try {
|
||||
const bundle: any = await fetchCollectionProtocolDetail(protocolId)
|
||||
const rowsForSubmit = isV2
|
||||
? flattenSamplePaymentTransfers(bundle?.samplePayments || [])
|
||||
: Array.isArray(bundle?.paymentDetails)
|
||||
? bundle.paymentDetails
|
||||
: []
|
||||
const failures = await submitDfjTransfersOnSave(rowsForSubmit, (transferId) =>
|
||||
isV2
|
||||
? fetchSubmitPaymentTransferFinance(transferId, { showSuccessMessage: false })
|
||||
: fetchSubmitReceiptFinance(transferId, undefined, { showSuccessMessage: false })
|
||||
)
|
||||
if (failures.length) {
|
||||
ElMessage.warning(formatAutoSubmitFinanceFailureMessage(failures, '协议'))
|
||||
}
|
||||
} catch {
|
||||
ElMessage.warning('协议已保存,但自动提交财务确认失败,请在缴费信息中手动提交')
|
||||
}
|
||||
}
|
||||
|
||||
emit('update:modelValue', false)
|
||||
emit('saved')
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user