统一合同气阀候选与绑定入口

This commit is contained in:
czl231
2026-08-31 22:04:22 +08:00
parent 9a23ab2f5a
commit 0f2475098f
23 changed files with 352 additions and 47 deletions

View File

@@ -111,6 +111,12 @@ if (
) {
fail('签约用户转出后未限制合同编辑和业务动作');
}
if (
!resourceSource.includes("filterKey: 'contract_identity'") ||
!resourceSource.includes('该合同用户暂无可绑定的智能气阀,请先由平台总后台将设备归属变更为该用户')
) {
fail('合同气阀候选未按合同联动或缺少平台归属引导');
}
if (
!ruleSource.includes('row.contract_readonly === true') ||
!recordSource.includes('record.value.contract_readonly === true') ||

View File

@@ -557,7 +557,7 @@ const platformResources: ResourceUiDefinition[] = [
{ name: '续签合同', resource: '/gasorder_contract/:identity/renew', fields: [f('effective_at', { required: true }), f('expired_at'), ...reason], visibleFor: { field: 'contract_status', values: [11, 12, 13] } },
{ 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), relation('product_info_identity', '/product_info', true, { label: '智能气阀', placeholder: '请选择该合同用户可绑定的智能气阀', relationEmptyText: '该合同用户暂无可绑定的智能气阀,请先由平台总后台将设备归属变更为该用户', relationLinkage: { parentKey: 'gasorder_contract_identity', optionParentKey: '', filterKey: 'contract_identity', filterOnly: true, requiresParent: true, parentChangeMessage: '配送合同已变更,请重新选择该合同用户的智能气阀' } }), f('unit_price')], 'list', [
{ name: '解绑气瓶', resource: '/gasorder_contract_product/:identity/unbind', danger: true, fields: reason },
]),
define('gasorder_contract_revision', '合同修订记录', 'readonly', []),
@@ -650,7 +650,7 @@ const gasOverrides: ResourceUiDefinition[] = [
{ name: '续签合同', resource: '/gasorder_contract/:identity/renew', fields: [f('effective_at', { required: true }), f('expired_at'), ...reason], visibleFor: { field: 'contract_status', values: [11, 12, 13] } },
{ 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), relation('product_info_identity', '/product_info', true, { label: '智能气阀', placeholder: '请选择该合同用户可绑定的智能气阀', relationEmptyText: '该合同用户暂无可绑定的智能气阀,请先由平台总后台将设备归属变更为该用户', relationLinkage: { parentKey: 'gasorder_contract_identity', optionParentKey: '', filterKey: 'contract_identity', filterOnly: true, requiresParent: true, parentChangeMessage: '配送合同已变更,请重新选择该合同用户的智能气阀' } }), f('unit_price')], 'list', [
{ name: '解绑气瓶', resource: '/gasorder_contract_product/:identity/unbind', danger: true, fields: reason },
]),
define('gasorder_contract_revision', '合同修订记录', 'readonly', []),