feat(P21PWA1-1,P21PWA1-2,P21PWA1-3): 资产搜索扩展/扫码适配器/IndexedDB离线队列与去重重放
这个提交包含在:
@@ -28,6 +28,7 @@ const ASSET_LIST_QUERY_SCHEMA = z.object({
|
||||
assigneeId: UUID_SCHEMA.optional(),
|
||||
legalEntityId: UUID_SCHEMA.optional(),
|
||||
costCenterId: UUID_SCHEMA.optional(),
|
||||
q: z.string().trim().max(120).optional(),
|
||||
mine: BOOLEAN_QUERY_SCHEMA,
|
||||
});
|
||||
|
||||
@@ -200,6 +201,7 @@ function parseAssetListQuery(query) {
|
||||
assigneeId: parsed.data.assigneeId,
|
||||
legalEntityId: parsed.data.legalEntityId,
|
||||
costCenterId: parsed.data.costCenterId,
|
||||
q: parsed.data.q?.trim() ?? "",
|
||||
mine: parseBooleanQueryValue(parsed.data.mine),
|
||||
};
|
||||
}
|
||||
@@ -848,6 +850,18 @@ async function assetsRoutes(fastify) {
|
||||
if (query.costCenterId) {
|
||||
where.cost_center_id = query.costCenterId;
|
||||
}
|
||||
if (query.q) {
|
||||
where.OR = [
|
||||
{ asset_no: query.q },
|
||||
{ serial_no: query.q },
|
||||
{
|
||||
name: {
|
||||
contains: query.q,
|
||||
mode: "insensitive",
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
if (mine) {
|
||||
where.assignee_employee_id = request.employee.id;
|
||||
} else if (query.assigneeId) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户