完善合同气瓶绑定约束与候选过滤

- 明确合同状态、气瓶归属、停用、报废和重复绑定失败原因
- 根据当前合同过滤可绑定气瓶,排除无效及重复候选项
- 从合同列表进入绑定页时锁定预填合同,防止切换上下文
- 切换通用新建页合同后清空旧气瓶并重新加载候选项
- 增加前后端回归检查并同步中文操作日志
This commit is contained in:
czl231
2026-08-13 00:10:42 +08:00
parent 96d37d63cf
commit 9937e3a508
11 changed files with 120 additions and 10 deletions

View File

@@ -31,6 +31,8 @@ export type ResourceRelationLinkage = {
optionParentKey: string;
filterKey: string;
backfillParent?: boolean;
/** 仅使用父字段筛选候选项,不校验候选项中的父标识。 */
filterOnly?: boolean;
};
export type ResourceField = {
@@ -468,7 +470,15 @@ export const resources: ResourceUiDefinition[] = [
{ name: '续签合同', resource: '/gasorder_contract/:identity/renew', fields: [f('effective_at', { required: true }), f('expired_at'), ...reason], visibleFor: { field: 'contract_status', values: [11, 12] } },
{ name: '终止合同', resource: '/gasorder_contract/:identity/terminate', danger: true, fields: reason, visibleFor: { field: 'contract_status', values: [11] } },
], { canCreate: true, canEdit: true }),
define('gasorder_contract_product', '合同气瓶', 'append_only', [relation('gasorder_contract_identity', '/gasorder_contract', true), relation('product_info_identity', '/product_info', true), f('unit_price')], 'list', [
define('gasorder_contract_product', '合同气瓶', 'append_only', [relation('gasorder_contract_identity', '/gasorder_contract', true, {
readonlyRelationText: true, displayRelationLabel: true,
}), relation('product_info_identity', '/product_info', true, {
placeholder: '请先选择合同,再选择该合同用户可绑定的气瓶',
relationLinkage: {
parentKey: 'gasorder_contract_identity', optionParentKey: '',
filterKey: 'contract_identity', filterOnly: true,
},
}), f('unit_price')], 'list', [
{ name: '解绑气瓶', resource: '/gasorder_contract_product/:identity/unbind', danger: true, fields: reason },
]),
define('gasorder_contract_revision', '合同修订记录', 'readonly', []),