Simplify order statuses and manager actions

This commit is contained in:
Ruslan Bakiev
2026-04-04 14:01:46 +07:00
parent 2f828cd164
commit 9017555722
6 changed files with 216 additions and 142 deletions

View File

@@ -4,15 +4,12 @@ const props = defineProps<{
}>();
const statusLabel = computed(() => {
if (props.status === 'NEW') return 'Уточнение цены';
if (props.status === 'MANAGER_PROCESSING') return 'В работе у менеджера';
if (props.status === 'WAITING_DOUBLE_CONFIRM') return 'Ожидает подтверждения';
if (props.status === 'CONFIRMED') return 'Подтвержден';
if (props.status === 'IN_PROGRESS') return 'Выполняется';
if (props.status === 'NEW' || props.status === 'MANAGER_PROCESSING') return 'Заявка';
if (props.status === 'WAITING_DOUBLE_CONFIRM' || props.status === 'CONFIRMED') return 'Предложение';
if (props.status === 'IN_PROGRESS') return 'В работе';
if (props.status === 'COMPLETED') return 'Завершен';
if (props.status === 'CLIENT_REJECTED') return 'Отклонен клиентом';
if (props.status === 'MANAGER_REJECTED') return 'Отклонен менеджером';
if (props.status === 'MANAGER_BLOCKED') return 'Заблокирован';
if (props.status === 'CLIENT_REJECTED' || props.status === 'MANAGER_REJECTED') return 'Отклонен';
if (props.status === 'MANAGER_BLOCKED') return 'Пауза';
return props.status;
});
@@ -20,7 +17,7 @@ const className = computed(() => {
if (props.status === 'COMPLETED') return 'badge badge-success';
if (props.status === 'CLIENT_REJECTED' || props.status === 'MANAGER_REJECTED') return 'badge badge-error';
if (props.status === 'MANAGER_BLOCKED') return 'badge badge-warning';
if (props.status === 'NEW') return 'badge badge-warning';
if (props.status === 'NEW' || props.status === 'MANAGER_PROCESSING') return 'badge badge-warning';
return 'badge badge-info';
});
</script>

View File

@@ -5,11 +5,12 @@ import { getOrderStatusPresentation } from '~/composables/useOrderStatusPresenta
const props = defineProps<{
status: string;
createdAt: string | Date;
audience?: 'client' | 'manager';
}>();
const isExpanded = ref(false);
const presentation = computed(() => getOrderStatusPresentation(props.status, props.createdAt));
const presentation = computed(() => getOrderStatusPresentation(props.status, props.createdAt, props.audience ?? 'client'));
function itemClass(state: 'done' | 'current' | 'upcoming') {
if (state === 'current') {