增加待补图订单筛选
This commit is contained in:
@@ -95,10 +95,12 @@ const FILTERABLE_WORK_ORDER_STATUSES = [
|
||||
'in_progress',
|
||||
'pending_acceptance',
|
||||
'problem',
|
||||
'vip_evidence_pending',
|
||||
'accepted',
|
||||
'cancelled',
|
||||
] as const
|
||||
|
||||
const VIP_EVIDENCE_PENDING_STATUS = 'vip_evidence_pending'
|
||||
const SKIP_PUBLISH_CONFIRM_KEY = 'admin-work-order-skip-publish-confirm'
|
||||
|
||||
type MaterialFormValues = {
|
||||
@@ -158,6 +160,10 @@ export default function WorkOrdersPanel() {
|
||||
}>()
|
||||
// 仅单独筛选「待验收」时提供批量验收入口(多选状态下不启用勾选,避免误操作)
|
||||
const isPendingAcceptanceOnly = statuses.length === 1 && statuses[0] === 'pending_acceptance'
|
||||
const selectedWorkOrderStatuses = statuses.filter(
|
||||
(status) => status !== VIP_EVIDENCE_PENDING_STATUS,
|
||||
)
|
||||
const vipEvidencePending = statuses.includes(VIP_EVIDENCE_PENDING_STATUS)
|
||||
|
||||
const ordersQuery = useQuery({
|
||||
queryKey: [
|
||||
@@ -170,7 +176,9 @@ export default function WorkOrdersPanel() {
|
||||
],
|
||||
queryFn: () =>
|
||||
fetchAdminWorkOrders({
|
||||
status: statuses.length > 0 ? statuses.join(',') : undefined,
|
||||
status:
|
||||
selectedWorkOrderStatuses.length > 0 ? selectedWorkOrderStatuses.join(',') : undefined,
|
||||
vipEvidencePending: vipEvidencePending || undefined,
|
||||
keyword,
|
||||
workerId,
|
||||
page,
|
||||
@@ -875,6 +883,7 @@ export default function WorkOrdersPanel() {
|
||||
placeholder="全部状态(可多选)"
|
||||
style={{ minWidth: 220, maxWidth: 420 }}
|
||||
maxTagCount="responsive"
|
||||
listHeight={320}
|
||||
options={FILTERABLE_WORK_ORDER_STATUSES.map((item) => ({
|
||||
value: item,
|
||||
label: <Tag color={resolveStatusColor(item)}>{formatStatus(item)}</Tag>,
|
||||
|
||||
@@ -202,6 +202,7 @@ export function formatStatus(status: string) {
|
||||
in_progress: '代练中',
|
||||
pending_acceptance: '待验收',
|
||||
problem: '问题单',
|
||||
vip_evidence_pending: '待补图',
|
||||
accepted: '已验收',
|
||||
cancelled: '已取消',
|
||||
}
|
||||
@@ -216,6 +217,7 @@ export function resolveStatusColor(status: string) {
|
||||
in_progress: 'geekblue',
|
||||
pending_acceptance: 'purple',
|
||||
problem: 'red',
|
||||
vip_evidence_pending: 'gold',
|
||||
accepted: 'green',
|
||||
cancelled: 'default',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user