diff --git a/inventory-web/src/api/transaction.ts b/inventory-web/src/api/transaction.ts index 5abf4a3..424f352 100644 --- a/inventory-web/src/api/transaction.ts +++ b/inventory-web/src/api/transaction.ts @@ -309,9 +309,14 @@ export function rejectBorrowTransfer(transferId: number, reason?: string) { } /** - * 待我接收的转交数量 —— 全局待办强提醒用(初始化 + 轮询)。 - * 极轻量,只做一次 count。 - * @returns { count } + * 全局待办强提醒的轮询数据源(初始化 + 轮询)。 + * + * ★ 一次请求返回两类信息,避免前端多打一个请求: + * count —— 待**我接收**的转交数量 + * rejects —— **我发起、被对方拒绝、尚未告知我**的转交 + * (被拒时物品责任仍在我手上,不告知就会误以为已交接出去) + * + * @returns { count, rejects: [{ id, borrow_no, sku, material_name, to_user_name, remark, ... }] } */ export function getPendingTransferCount() { return request({ @@ -320,6 +325,18 @@ export function getPendingTransferCount() { }) } +/** + * 确认已知悉「转交被拒绝」—— 写 reject_seen_at,之后不再提醒。 + * @param ids 留空表示该用户全部待告知的拒绝 + */ +export function ackTransferRejects(ids?: number[]) { + return request({ + url: '/v1/transactions/borrow/transfer/reject-ack', + method: 'post', + data: { ids } + }) +} + /** * 整单流转时间线(**borrow_no** 维度):借出 → 转交(可多次) → 归还 → 报废 * diff --git a/inventory-web/src/components/PendingTransferNotifier/index.vue b/inventory-web/src/components/PendingTransferNotifier/index.vue index 373fbaa..2d75a4d 100644 --- a/inventory-web/src/components/PendingTransferNotifier/index.vue +++ b/inventory-web/src/components/PendingTransferNotifier/index.vue @@ -4,10 +4,14 @@