temporary fix
This commit is contained in:
parent
4eae476d2f
commit
0054d5c328
861
js/crm_vue.js
861
js/crm_vue.js
File diff suppressed because it is too large
Load Diff
@ -4163,6 +4163,91 @@ $user_id = $_SESSION['id'];
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Блок информации о сделке (показывается когда "По клиенту прошла сделка" включена) -->
|
||||
<?php if (in_array((int)$_SESSION['id'], $allowed_users_deal)) { ?>
|
||||
<div id="deal_close_block" style="display: none; margin: 15px 0; padding: 15px; border: 1px solid #e0e0e0; border-radius: 5px;">
|
||||
<div style="font-weight: 600; margin-bottom: 10px; width: 100%;">Информация о сделке</div>
|
||||
<div id="deal_close_content">
|
||||
<div style="color: #999;">Загрузка данных сделки...</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#luck').on('change', function() {
|
||||
if ($(this).is(':checked') && window.dealCloseData) {
|
||||
renderDealCloseContent();
|
||||
$('#deal_close_block').show();
|
||||
} else {
|
||||
$('#deal_close_block').hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
function renderDealCloseContent() {
|
||||
var d = window.dealCloseData;
|
||||
if (!d) return;
|
||||
var html = '';
|
||||
if (d.title) html += '<div style="margin-bottom: 8px;"><span style="font-weight: 500;">Название:</span> ' + d.title + '</div>';
|
||||
if (d.contract_price) html += '<div style="margin-bottom: 8px;"><span style="font-weight: 500;">Сумма в договоре:</span> ' + Number(d.contract_price).toLocaleString('ru-RU') + ' руб.</div>';
|
||||
if (d.agent_commission) html += '<div style="margin-bottom: 8px;"><span style="font-weight: 500;">Комиссия агента:</span> ' + Number(d.agent_commission).toLocaleString('ru-RU') + ' руб.</div>';
|
||||
|
||||
var reqIds = [];
|
||||
if (d.side_one_requisition_id) reqIds.push(d.side_one_requisition_id);
|
||||
if (d.side_two_requisition_id) reqIds.push(d.side_two_requisition_id);
|
||||
if (reqIds.length > 0) {
|
||||
$.ajax({
|
||||
url: '/ajax/ajax_vue_requisitions.php',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify({ request: 'get_deals_linked_reqs', req_ids: reqIds }),
|
||||
success: function(reqRes) {
|
||||
var reqs = reqRes.reqs || [];
|
||||
if (reqs.length > 0) {
|
||||
html += '<div style="margin-top: 10px;"><b>Связанные заявки:</b></div>';
|
||||
reqs.forEach(function(req) {
|
||||
html += '<div style="padding: 3px 0;">' + req.name;
|
||||
html += req.deleted == 1 ? ' <span style="color: #43A047;">✓ закрыта</span>' : ' <span style="color: #f57c00;">открыта</span>';
|
||||
html += '</div>';
|
||||
});
|
||||
}
|
||||
|
||||
var objIds = [];
|
||||
if (d.side_one_object_id) objIds.push(d.side_one_object_id);
|
||||
if (d.side_two_object_id) objIds.push(d.side_two_object_id);
|
||||
if (objIds.length > 0) {
|
||||
$.ajax({
|
||||
url: '/ajax/ajax_vue_requisitions.php',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify({ request: 'get_deals_linked_objects', object_ids: objIds }),
|
||||
success: function(objRes) {
|
||||
var objs = objRes.objects || [];
|
||||
if (objs.length > 0) {
|
||||
html += '<div style="margin-top: 10px;"><b>Связанные объекты:</b></div>';
|
||||
objs.forEach(function(obj) {
|
||||
html += '<div style="padding: 3px 0;">' + obj.nazv + ' <span style="color: #999;">' + obj.adres + '</span></div>';
|
||||
});
|
||||
}
|
||||
html += '<div style="margin-top: 12px; padding-top: 10px; border-top: 1px solid #e0e0e0;"><b>Фактические данные</b></div>';
|
||||
html += '<div><span style="color: #666;">Комиссия агента:</span> ' + (d.agent_commission || 0) + ' руб. | <span style="color: #666;">Сумма сделки:</span> ' + (d.contract_price || 0) + ' руб.</div>';
|
||||
$('#deal_close_content').html(html);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
html += '<div style="margin-top: 12px; padding-top: 10px; border-top: 1px solid #e0e0e0;"><b>Фактические данные</b></div>';
|
||||
html += '<div><span style="color: #666;">Комиссия агента:</span> ' + (d.agent_commission || 0) + ' руб. | <span style="color: #666;">Сумма сделки:</span> ' + (d.contract_price || 0) + ' руб.</div>';
|
||||
$('#deal_close_content').html(html);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
html += '<div style="margin-top: 12px; padding-top: 10px; border-top: 1px solid #e0e0e0;"><b>Фактические данные</b></div>';
|
||||
html += '<div><span style="color: #666;">Комиссия агента:</span> ' + (d.agent_commission || 0) + ' руб. | <span style="color: #666;">Сумма сделки:</span> ' + (d.contract_price || 0) + ' руб.</div>';
|
||||
$('#deal_close_content').html(html);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php } ?>
|
||||
<script src=""></script>
|
||||
<div class="modal-submit">
|
||||
<input type="hidden" name="id_funnel_client" value="0">
|
||||
@ -5400,55 +5485,6 @@ $user_id = $_SESSION['id'];
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Блок информации о сделке при закрытии этапа -->
|
||||
<?php if (in_array((int)$_SESSION['id'], $allowed_users_deal)) { ?>
|
||||
<div v-if="step.is_deal === 1 && currentPage.includes('/requisitions.php')" class="form-block" style="border: 1px solid #e0e0e0; border-radius: 5px; padding: 15px; margin-top: 10px;">
|
||||
<div class="label" style="font-weight: 600; margin-bottom: 10px; width: 100%;">Информация о сделке</div>
|
||||
<div v-if="dealCloseData">
|
||||
<div v-if="dealCloseData.title" style="margin-bottom: 8px;">
|
||||
<span style="font-weight: 500;">Название:</span> {{ dealCloseData.title }}
|
||||
</div>
|
||||
|
||||
<!-- Связанные заявки -->
|
||||
<div v-if="dealCloseReqs.length > 0" style="margin-top: 10px;">
|
||||
<span style="font-weight: 500;">Связанные заявки:</span>
|
||||
<div v-for="req in dealCloseReqs" style="padding: 5px 0; border-bottom: 1px solid #f0f0f0;">
|
||||
<span style="color: #666;">{{ req.name }}</span>
|
||||
<span v-if="req.deleted == 1" style="color: #43A047; margin-left: 5px;">✓ закрыта</span>
|
||||
<span v-else style="color: #f57c00; margin-left: 5px;">открыта</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Связанные объекты -->
|
||||
<div v-if="dealCloseObjects.length > 0" style="margin-top: 10px;">
|
||||
<span style="font-weight: 500;">Связанные объекты:</span>
|
||||
<div v-for="obj in dealCloseObjects" style="padding: 5px 0; border-bottom: 1px solid #f0f0f0;">
|
||||
<span style="color: #666;">{{ obj.nazv }}</span>
|
||||
<span style="color: #999; margin-left: 5px;">{{ obj.adres }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Фактические данные -->
|
||||
<div style="margin-top: 12px; padding-top: 10px; border-top: 1px solid #e0e0e0;">
|
||||
<div class="label" style="font-weight: 500; margin-bottom: 8px; width: 100%;">Фактические данные</div>
|
||||
<div class="form-block">
|
||||
<div style="width: 100%;" class="label">Комиссия агента (руб.)</div>
|
||||
<div class="inputs">
|
||||
<input v-model="dealCloseAgentCommission" type="number" class="text" style="width: 200px;" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-block">
|
||||
<div style="width: 100%;" class="label">Сумма сделки (руб.)</div>
|
||||
<div class="inputs">
|
||||
<input v-model="dealCloseSumma" type="number" class="text" style="width: 200px;" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else style="color: #999;">Загрузка данных сделки...</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user