Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3086a40b4c |
@@ -462,7 +462,7 @@ class HandlerEscortRecord {
|
|||||||
try {
|
try {
|
||||||
const {
|
const {
|
||||||
status, userId, appointmentDate, healthProfileId, cancelStatus, includeCancelled,
|
status, userId, appointmentDate, healthProfileId, cancelStatus, includeCancelled,
|
||||||
paymentStatus, payChannel, startDate, endDate, keyword,
|
paymentStatus, payChannel, startDate, endDate, keyword, scope,
|
||||||
} = ctx.request.query;
|
} = ctx.request.query;
|
||||||
const { page, pageSize } = HandlerEscortRecord.parsePaging(ctx.request.query);
|
const { page, pageSize } = HandlerEscortRecord.parsePaging(ctx.request.query);
|
||||||
const loginUserId = ctx.state.user?._id;
|
const loginUserId = ctx.state.user?._id;
|
||||||
@@ -486,11 +486,30 @@ class HandlerEscortRecord {
|
|||||||
isInternAttendant = isIntern;
|
isInternAttendant = isIntern;
|
||||||
// 可见范围由身份决定,前端传什么都会被忽略:
|
// 可见范围由身份决定,前端传什么都会被忽略:
|
||||||
// 实习 = 未分配 + 被共享;正式 = 未分配 + 本人已接 + 被共享
|
// 实习 = 未分配 + 被共享;正式 = 未分配 + 本人已接 + 被共享
|
||||||
attendantVisibility = {
|
// scope 只用于在已授权的可见范围内收窄(pool=未分配 / mine=我的),不扩大范围
|
||||||
includeUnassigned: true,
|
const mineVisibility = {
|
||||||
userId: isIntern ? undefined : loginUserId,
|
userId: isIntern ? undefined : loginUserId,
|
||||||
employeeId: attendantEmployee._id,
|
employeeId: attendantEmployee._id,
|
||||||
};
|
};
|
||||||
|
const scopeValue = String(scope || "");
|
||||||
|
if (scopeValue === "pool") {
|
||||||
|
attendantVisibility = { includeUnassigned: true };
|
||||||
|
} else if (scopeValue === "mine") {
|
||||||
|
attendantVisibility = mineVisibility;
|
||||||
|
} else {
|
||||||
|
attendantVisibility = { includeUnassigned: true, ...mineVisibility };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 管理端订单页同样按「未分配 / 我的」分栏:
|
||||||
|
// pool=只看未分配,mine=只看指派给当前账号的订单,不传保持全量
|
||||||
|
if (mode === "all") {
|
||||||
|
const scopeValue = String(scope || "");
|
||||||
|
if (scopeValue === "pool") {
|
||||||
|
attendantVisibility = { includeUnassigned: true };
|
||||||
|
} else if (scopeValue === "mine") {
|
||||||
|
attendantId = loginUserId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// status解析成数组
|
// status解析成数组
|
||||||
|
|||||||
Reference in New Issue
Block a user