完善配送合同关联信息展示与归属校验
三端合同页面改为优先显示用户、气站和配送点业务名称,并保留标识与合同编号复制能力。 平台端增加气站与直属配送点联动,后端禁止平台主管及跨气站配送点绑定合同,同时补充测试和中文文档。
This commit is contained in:
@@ -160,8 +160,8 @@ const resourcesSource = await readFile(
|
||||
);
|
||||
assert.equal(
|
||||
(resourcesSource.match(/relationLinkage:/g) ?? []).length,
|
||||
2,
|
||||
'联动配置必须显式启用于工作人员和用户服务关系的配送点字段',
|
||||
3,
|
||||
'联动配置必须显式启用于工作人员、用户服务关系和配送合同的配送点字段',
|
||||
);
|
||||
assert.match(resourcesSource, /filterKey: 'gas_basic_identities'/);
|
||||
assert.match(resourcesSource, /organizationScoped: true/);
|
||||
|
||||
@@ -46,6 +46,8 @@ export type ResourceField = {
|
||||
placeholder?: string;
|
||||
showIdentityCopy?: boolean;
|
||||
readonlyRelationText?: boolean;
|
||||
/** 列表中以可悬浮、可复制的紧凑文本展示普通字段。 */
|
||||
listCopyable?: boolean;
|
||||
options?: Array<{ label: string; value: string | number }>;
|
||||
defaultValue?: string | number | boolean;
|
||||
readonlyOnCreate?: boolean;
|
||||
@@ -429,7 +431,28 @@ export const resources: ResourceUiDefinition[] = [
|
||||
define('product_repair', '智能气阀检修记录', 'editable', [relation('product_info_identity', '/product_info', true), f('repair_no', { required: true }), f('repair_type', { required: true }), f('started_at', { required: true }), f('completed_at'), f('result', { type: 'select', options: resourceSearchEnumOptions('product_repair', 'result') }), f('target_product_status', { type: 'select', options: [{ label: '在库', value: 28 }, { label: '运输中', value: 29 }, { label: '使用中', value: 30 }, { label: '报废', value: 27 }] }), f('content'), f('operator'), f('remark')]),
|
||||
define('product_owner', '智能气阀归属记录', 'readonly', []),
|
||||
|
||||
define('gasorder_contract', '配送合同', 'managed', [f('contract_no', { required: true }), relation('user_account_identity', '/user_account', true), relation('gas_basic_identity', '/gas_basic', true), relation('delivery_basic_identity', '/delivery_basic'), f('title', { required: true }), f('terms'), f('file_uri'), f('default_delivery_fee'), f('signed_at', { required: true }), f('effective_at', { required: true }), f('expired_at')], 'list', [
|
||||
define('gasorder_contract', '配送合同', 'managed', [
|
||||
f('contract_no', { required: true, listCopyable: true }),
|
||||
relation('user_account_identity', '/user_account', true, {
|
||||
label: '用户账户', listLabel: '用户账户', listRelationNameOnly: true,
|
||||
displayRelationLabel: true, showIdentityCopy: true, readonlyRelationText: true,
|
||||
}),
|
||||
relation('gas_basic_identity', '/gas_basic', true, {
|
||||
label: '所属气站', listLabel: '所属气站', listRelationNameOnly: true,
|
||||
displayRelationLabel: true, showIdentityCopy: true, readonlyRelationText: true,
|
||||
}),
|
||||
relation('delivery_basic_identity', '/delivery_basic', false, {
|
||||
label: '所属配送点', listLabel: '所属配送点', listRelationNameOnly: true,
|
||||
displayRelationLabel: true, emptyText: '暂未指定', placeholder: '请选择默认配送点,可留空',
|
||||
showIdentityCopy: true,
|
||||
relationLinkage: {
|
||||
parentKey: 'gas_basic_identity', optionParentKey: 'gas_basic_identity',
|
||||
filterKey: 'gas_basic_identities', backfillParent: true,
|
||||
},
|
||||
}),
|
||||
f('title', { required: true }), f('terms'), f('file_uri'), f('default_delivery_fee'),
|
||||
f('signed_at', { required: true }), f('effective_at', { required: true }), f('expired_at'),
|
||||
], 'list', [
|
||||
{ name: '启用合同', resource: '/gasorder_contract/:identity/activate', fields: reason, visibleFor: { field: 'contract_status', values: [10] } },
|
||||
{ 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] } },
|
||||
|
||||
@@ -66,6 +66,10 @@
|
||||
v-else-if="field.type === 'identity' && !field.displayRelationLabel && identityFieldValue(field, record)"
|
||||
:value="identityFieldValue(field, record)"
|
||||
/>
|
||||
<IdentityText
|
||||
v-else-if="field.listCopyable && record[field.key]"
|
||||
:value="String(record[field.key])"
|
||||
/>
|
||||
<template v-else>{{ displayListField(field, record) }}</template>
|
||||
</template>
|
||||
</a-table-column>
|
||||
|
||||
Reference in New Issue
Block a user