fix(worker): 整单指派拼单订单无法验收
- 前端:拼单订单整单指派给本人时放行验收 - 后端:整单指派清掉 sharing_enabled;已有有效份额则拒绝
This commit is contained in:
@@ -24,7 +24,9 @@ import type { UploadedFile, WorkOrder, WorkerAcceptanceVideo } from '@/types/wor
|
||||
import { isExplicitOrderNoSearch, normalizeSearchText } from '@/utils/admin-realtime-work-orders'
|
||||
import { formatDateTime } from '@/utils/date-time'
|
||||
import { useIsMobile } from '@/utils/use-is-mobile'
|
||||
import { shouldBlockAcceptanceForMissingShares } from '@/utils/worker-order-acceptance'
|
||||
import { buildWorkerOrderQuery } from '@/utils/worker-order-query'
|
||||
import { getWorkerId } from '@/utils/worker-auth'
|
||||
import { WorkerOrderDesktopList } from './WorkerOrderDesktopList'
|
||||
import { WorkerOrderDetailDrawer } from './WorkerOrderDetailDrawer'
|
||||
import { WorkerOrderMobileList } from './WorkerOrderMobileList'
|
||||
@@ -324,8 +326,16 @@ export default function WorkerOrdersPage() {
|
||||
|
||||
function openAcceptanceModal(order: WorkOrder) {
|
||||
const shares = getOrderShares(order)
|
||||
// 整单(非拼单)本来就没有份额,不能拦;只有拼单订单缺份额时才提示刷新。
|
||||
if (shares.length === 0 && order.sharing?.enabled === true) {
|
||||
// 整单(非拼单)本来就没有份额,不能拦;拼单订单被管理端整单指派给本人时,
|
||||
// 后端也会按整单验收,同样不能拦。只有“拼单缺份额且不是指派给本人”才提示刷新。
|
||||
if (
|
||||
shouldBlockAcceptanceForMissingShares({
|
||||
shareCount: shares.length,
|
||||
sharingEnabled: order.sharing?.enabled === true,
|
||||
assignedWorkerId: order.worker?.workerId,
|
||||
currentWorkerId: getWorkerId(),
|
||||
})
|
||||
) {
|
||||
message.warning('未找到可验收的拼单份额,请刷新后重试')
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user