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