修复拼单明细并支持参与者撤单

This commit is contained in:
yml2213
2026-08-19 14:35:23 +08:00
parent 4b1dcd47ea
commit ab6387759e
9 changed files with 409 additions and 43 deletions
@@ -310,11 +310,13 @@ async function publishWorkOrderSnapshots(input: {
const viewedAt =
views.find((item) => Number(item.work_order_id) === workOrderId)?.viewed_at || null
const share = shares.find((item) => Number(item.worker_id) === workerId)
const isAssignedWorker = Number(workOrder.assigned_worker_id || 0) === workerId
const workerOrderVisible = isAssignedWorker || Boolean(share && share.status !== 'cancelled')
publishRealtimeEvent({
type: 'work_order.changed',
entityId: workOrderId,
scopes: ['worker_my_orders'],
operation: 'upsert',
operation: workerOrderVisible ? 'upsert' : 'remove',
data: mapWorkOrderForWorker(
workOrder,
resolveWorkerPermissions(worker),