功能:完善用户服务关系展示与组织联动
统一平台、气站和配送点后台的服务关系业务名称展示。 新增气站、配送点、服务人员三级联动及暂未分配语义。 后端补充组织归属、人员角色和启用状态的严格校验。 补充前后端测试、项目文档、操作日志及本机日志忽略规则。
This commit is contained in:
@@ -60,6 +60,42 @@ export function linkedRelationFilters(
|
||||
return parentIdentity ? { [filterKey]: parentIdentity } : undefined;
|
||||
}
|
||||
|
||||
/** 为服务人员关系生成精确组织范围;空组织使用显式未分配条件,避免返回其他组织人员。 */
|
||||
export function staffOrganizationFilters(
|
||||
gasIdentity: string,
|
||||
deliveryIdentity: string,
|
||||
) {
|
||||
return {
|
||||
...(gasIdentity
|
||||
? { gas_basic_identities: gasIdentity }
|
||||
: { gas_basic_unassigned: '1' }),
|
||||
...(deliveryIdentity
|
||||
? { delivery_basic_identities: deliveryIdentity }
|
||||
: { delivery_basic_unassigned: '1' }),
|
||||
};
|
||||
}
|
||||
|
||||
/** 校验服务人员记录与当前气站、配送点完全一致,空字符串代表可以提交。 */
|
||||
export function staffOrganizationValidationMessage(
|
||||
gasIdentity: string,
|
||||
deliveryIdentity: string,
|
||||
staffIdentity: string,
|
||||
option: ResourceRow | undefined,
|
||||
) {
|
||||
if (!staffIdentity) return '';
|
||||
if (!option) return '无法确认所选服务人员的组织归属,请重新选择';
|
||||
if (optionParentIdentity(option, 'gas_basic_identity') !== gasIdentity) {
|
||||
return '所选服务人员不属于当前气站,请重新选择';
|
||||
}
|
||||
if (
|
||||
optionParentIdentity(option, 'delivery_basic_identity') !==
|
||||
deliveryIdentity
|
||||
) {
|
||||
return '所选服务人员不属于当前配送点,请重新选择';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/** 为同一关联资源生成递增版本号,用于识别并丢弃过期响应。 */
|
||||
export function createRelationRequestVersionGuard() {
|
||||
const versions = new Map<string, number>();
|
||||
|
||||
Reference in New Issue
Block a user