Fix deal
This commit is contained in:
parent
a635d601df
commit
c9db3f3f17
@ -1,8 +1,19 @@
|
||||
NODE_ENV=development
|
||||
VITE_API_URL=https://joyworkdev.ru
|
||||
VITE_LARAVEL_URL=https://llar.joyworkdev.ru
|
||||
VITE_LARAVEL_API_URL=https://joyworkdev.ru
|
||||
VITE_DEV_SESSION_ID=87ae8a661f903a5958e2a36aeaffb970
|
||||
VITE_DEV_REQUISITION_ID=17539
|
||||
#VITE_API_URL=https://joyworkdev.ru
|
||||
#VITE_LARAVEL_URL=https://llar.joyworkdev.ru
|
||||
#VITE_LARAVEL_API_URL=https://joyworkdev.ru
|
||||
#VITE_DEV_SESSION_ID=0f71932af5f6b31f1b3a56fdb67d8c6f
|
||||
#VITE_DEV_REQUISITION_ID=17539
|
||||
|
||||
VITE_API_URL=https://joywork.ru
|
||||
VITE_LARAVEL_URL=https://api.joywork.ru
|
||||
VITE_LARAVEL_API_URL=https://joywork.ru
|
||||
VITE_DEV_SESSION_ID=javn7fjr5pjv9q075krd89k641
|
||||
VITE_DEV_REQUISITION_ID=1481170
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#VITE_BASIC_AUTH_USER=adminlogin
|
||||
#VITE_BASIC_AUTH_PASS=adminpassword
|
||||
@ -1,7 +1,7 @@
|
||||
NODE_ENV=production
|
||||
VITE_API_URL=https://joyworkdev.ru
|
||||
VITE_LARAVEL_URL=https://llar.joyworkdev.ru
|
||||
VITE_LARAVEL_API_URL=https://joyworkdev.ru
|
||||
VITE_API_URL=https://joywork.ru
|
||||
VITE_LARAVEL_URL=https://api.joywork.ru
|
||||
VITE_LARAVEL_API_URL=https://joywork.ru
|
||||
VITE_DEV_SESSION_ID=e33a6f076567ef9c7c6a9e244f0fd626
|
||||
VITE_DEV_REQUISITION_ID=17539
|
||||
#VITE_BASIC_AUTH_USER=adminlogin
|
||||
|
||||
@ -34,4 +34,18 @@
|
||||
margin-inline-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-x-reverse)));
|
||||
}
|
||||
}
|
||||
|
||||
.text-gray-700 {
|
||||
color: var(--color-gray-700);
|
||||
}
|
||||
.block {
|
||||
display: block;
|
||||
}
|
||||
.font-medium {
|
||||
--tw-font-weight: var(--font-weight-medium);
|
||||
font-weight: var(--font-weight-medium);
|
||||
}
|
||||
.text-sm {
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="dealAddDoc">
|
||||
<div class="modal-content">
|
||||
<div class="deal-modal-content">
|
||||
<!-- <span class="close" @click="closeModal">×</span>-->
|
||||
<!-- <h3 class="mb-4">Добавление документа</h3>-->
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
<span class="ml-4">История и задачи</span>
|
||||
</button>
|
||||
</div>
|
||||
<div>Добавил: {{ object.add_user && object.add_user.fio ? object.add_user.fio : '' }}</div>
|
||||
<div>Добавил: {{ object.add_user && object.add_user.full_name ? object.add_user.full_name : '' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
v-for="(step, index) in steps"
|
||||
:key="index"
|
||||
class="progress-step"
|
||||
:class="{ 'bg-green-500': index < requisition.stage, 'bg-white': index >= requisition.stage }"
|
||||
:class="{ 'bg-green-500': index < requisition.stage_index, 'bg-white': index >= requisition.stage_index ?? 0 }"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="stage-current ml-4"> {{ currentStageName }}</div>
|
||||
<div class="stage-current ml-4"> {{ requisition.current_stage_name || currentStageName }}</div>
|
||||
|
||||
<div class="ml-auto cursor-pointer" @click="closeDealRequisition">
|
||||
<img src="@/shared/assets/icons/close.svg" alt="Close">
|
||||
@ -100,33 +100,32 @@
|
||||
</template>
|
||||
|
||||
<!-- Dropdown для выбора клиентов -->
|
||||
<div class="w-1/2 p-2 flex justify-between items-center">
|
||||
<div class="client w-full">
|
||||
<MultiSelect
|
||||
v-if="Array.isArray(clientsList)"
|
||||
v-model="selectedClientIds"
|
||||
:options="clientsList"
|
||||
optionLabel="fio"
|
||||
optionValue="id"
|
||||
placeholder="Выбрать клиента"
|
||||
class="w-full choiceDealClient"
|
||||
:maxSelectedLabels="3"
|
||||
:filter="true"
|
||||
display="chip"
|
||||
:virtualScrollerOptions="{ itemSize: 40 }"
|
||||
>
|
||||
<template #dropdownicon>
|
||||
<DropdownIcon />
|
||||
</template>
|
||||
</MultiSelect>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="p-4">
|
||||
<a href="javascript:{}" class="add_client_new" style="border: none;">
|
||||
<img src="@/shared/assets/icons/plus-green.svg" alt="Добавить клиента" class="w-6 h-6">
|
||||
</a>
|
||||
<div class="w-1/2 p-2">
|
||||
<div class="client flex justify-between items-center">
|
||||
<div class="flex-grow">
|
||||
<MultiSelect
|
||||
v-if="Array.isArray(clientsList)"
|
||||
v-model="selectedClientIds"
|
||||
:options="clientsList"
|
||||
optionLabel="fio"
|
||||
optionValue="id"
|
||||
placeholder="Выбрать клиента"
|
||||
class="w-full choiceDealClient"
|
||||
:maxSelectedLabels="3"
|
||||
:filter="true"
|
||||
display="chip"
|
||||
:virtualScrollerOptions="{ itemSize: 40 }"
|
||||
>
|
||||
<template #dropdownicon>
|
||||
<DropdownIcon />
|
||||
</template>
|
||||
</MultiSelect>
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<a href="javascript:{}" class="add_client_new" style="border: none;">
|
||||
<img src="@/shared/assets/icons/plus-green.svg" alt="Добавить клиента" class="w-6 h-6">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -249,31 +248,40 @@ const currentStageName = ref("");
|
||||
watch(
|
||||
() => props.requisition,
|
||||
(newRequisition) => {
|
||||
if (newRequisition.funnel_id === 0) {
|
||||
steps.value = [
|
||||
"Новый",
|
||||
"В работе",
|
||||
"Презентация",
|
||||
"Показ",
|
||||
"Бронь",
|
||||
"Подаем на ипотеку",
|
||||
"Сделка",
|
||||
"Закрыт",
|
||||
];
|
||||
currentStageName.value =
|
||||
steps.value[newRequisition.stage - 1] || "Неизвестный шаг";
|
||||
// if (newRequisition.funnel_id === 0) {
|
||||
// steps.value = [
|
||||
// "Новый",
|
||||
// "В работе",
|
||||
// "Презентация",
|
||||
// "Показ",
|
||||
// "Бронь",
|
||||
// "Подаем на ипотеку",
|
||||
// "Сделка",
|
||||
// "Закрыт",
|
||||
// ];
|
||||
// currentStageName.value =
|
||||
// steps.value[newRequisition.stage - 1] || "Неизвестный шаг";
|
||||
// } else {
|
||||
//
|
||||
// // Берём шаги из funnel_steps
|
||||
// if (newRequisition.funnel_steps && Array.isArray(newRequisition.funnel_steps)) {
|
||||
// steps.value = newRequisition.funnel_steps.map(step => step.name);
|
||||
// } else {
|
||||
// steps.value = [];
|
||||
// }
|
||||
//
|
||||
// currentStageName.value =
|
||||
// newRequisition.funnel_steps?.[newRequisition.stage - 1]?.name ||
|
||||
// "Неизвестный шаг";
|
||||
// }
|
||||
|
||||
if (newRequisition.funnel_steps && Array.isArray(newRequisition.funnel_steps)) {
|
||||
steps.value = newRequisition.funnel_steps.map(step => step.name);
|
||||
} else if (newRequisition.funnel_id === 0) {
|
||||
// Дефолтная воронка
|
||||
steps.value = ["Новый", "В работе", "Презентация", "Показ", "Бронь", "Подаем на ипотеку", "Сделка", "Закрыт"];
|
||||
} else {
|
||||
|
||||
// Берём шаги из funnel_steps
|
||||
if (newRequisition.funnel_steps && Array.isArray(newRequisition.funnel_steps)) {
|
||||
steps.value = newRequisition.funnel_steps.map(step => step.name);
|
||||
} else {
|
||||
steps.value = [];
|
||||
}
|
||||
|
||||
currentStageName.value =
|
||||
newRequisition.funnel_steps?.[newRequisition.stage - 1]?.name ||
|
||||
"Неизвестный шаг";
|
||||
steps.value = [];
|
||||
}
|
||||
console.log('newRequisition:', newRequisition);
|
||||
console.log('steps:', steps.value);
|
||||
@ -282,15 +290,22 @@ watch(
|
||||
);
|
||||
|
||||
|
||||
const REQ_TYPES = {
|
||||
1: "Подбор объекта",
|
||||
2: "Реализация объекта",
|
||||
3: "Другие услуги",
|
||||
4: "Спрос по нашему объекту",
|
||||
};
|
||||
|
||||
const typeReq = computed(() => {
|
||||
return REQ_TYPES[props.requisition.type_id] || "Неизвестный тип услуги";
|
||||
if (props.requisition?.type?.name) {
|
||||
return props.requisition.type.name;
|
||||
}
|
||||
|
||||
if (props.requisition?.type_name) {
|
||||
return props.requisition.type_name;
|
||||
}
|
||||
|
||||
const REQ_TYPES = {
|
||||
1: "Подбор объекта",
|
||||
2: "Реализация объекта",
|
||||
3: "Другие услуги",
|
||||
4: "Спрос по нашему объекту",
|
||||
};
|
||||
return REQ_TYPES[props.requisition?.type_id] || "Неизвестный тип услуги";
|
||||
});
|
||||
|
||||
</script>
|
||||
@ -353,21 +368,24 @@ const typeReq = computed(() => {
|
||||
font-size: 14px;
|
||||
line-height: 17px;
|
||||
align-content: flex-start;
|
||||
padding: 10px 8px 8px 12px;
|
||||
padding: 5px 10px;
|
||||
background: #FFFFFF;
|
||||
opacity: 0.8;
|
||||
border: 1px solid #E0E0E0;
|
||||
border-radius: 3px;
|
||||
height: 60px;
|
||||
height: 48px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.client-name {
|
||||
padding: 0;
|
||||
border: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.client-info {
|
||||
height: auto;
|
||||
width: auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
span {
|
||||
|
||||
@ -6,7 +6,8 @@ import axios from 'axios'
|
||||
const isDev = import.meta.env.MODE === 'development'
|
||||
const DEV_SESSION_ID = import.meta.env.VITE_DEV_SESSION_ID
|
||||
|
||||
const BASE_URL = isDev ? '' : 'https://joyworkdev.ru/deal/index.php'
|
||||
//const BASE_URL = isDev ? '' : 'https://joyworkdev.ru/deal/index.php'
|
||||
const BASE_URL = isDev ? '' : 'https://joywork.ru/deal/index.php'
|
||||
|
||||
axios.defaults.baseURL = BASE_URL
|
||||
axios.defaults.withCredentials = true
|
||||
|
||||
@ -24,22 +24,6 @@ const fetchData = (endpoint, options = {}) => {
|
||||
: getCookie('PHPSESSID');
|
||||
|
||||
|
||||
//const usernameDev = process.env.VUE_APP_BASIC_AUTH_USER;
|
||||
//const passwordDev = process.env.VUE_APP_BASIC_AUTH_PASS;
|
||||
//const authDev = btoa(`${usernameDev}:${passwordDev}`);
|
||||
//let authHeaders = {};
|
||||
|
||||
//Добавляем Basic Auth только в dev
|
||||
// if (isDev) {
|
||||
// const usernameDev = process.env.VUE_APP_BASIC_AUTH_USER;
|
||||
// const passwordDev = process.env.VUE_APP_BASIC_AUTH_PASS;
|
||||
//
|
||||
// if (usernameDev && passwordDev) {
|
||||
// const authDev = btoa(`${usernameDev}:${passwordDev}`);
|
||||
// authHeaders['Authorization'] = `Basic ${authDev}`;
|
||||
// }
|
||||
// }
|
||||
|
||||
// Извлекаем путь из endpoint
|
||||
const path = endpoint.replace(/^\//, '');
|
||||
//
|
||||
@ -51,7 +35,7 @@ const fetchData = (endpoint, options = {}) => {
|
||||
if (isFormData) {
|
||||
//console.log('[laravelApiService] Используем directAxiosInstance для FormData');
|
||||
|
||||
const laravelApiUrl = 'http://llar.joyworkdev.ru/api';
|
||||
const laravelApiUrl = import.meta.env.VITE_LARAVEL_URL || 'https://api.joywork.ru/api';
|
||||
|
||||
// временный инстанс axios без Content-Type
|
||||
const directAxiosInstance = axios.create({
|
||||
|
||||
@ -48,7 +48,7 @@ export const dealsApi = {
|
||||
method: 'GET',
|
||||
params: {
|
||||
target_id: dealId,
|
||||
target_type: 10, // Пример типа (уточните актуальное значение)
|
||||
target_type: 10,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user