Fix modal close last step
This commit is contained in:
parent
0881e803d2
commit
40c8c104b4
@ -503,14 +503,8 @@ var ac = new Vue({
|
|||||||
.catch(function() { callback(); });
|
.catch(function() { callback(); });
|
||||||
};
|
};
|
||||||
|
|
||||||
loadDealData(function() {
|
|
||||||
// Обновляем ac.reqId из скрытого поля (мог быть изменён через .delClientAgent)
|
|
||||||
var currentReqId = parseInt($('#del_client #id_del_req').val()) || 0;
|
|
||||||
if (currentReqId > 0) {
|
|
||||||
ac.reqId = currentReqId;
|
|
||||||
}
|
|
||||||
|
|
||||||
resetDealCloseModal();
|
resetDealCloseModal();
|
||||||
|
loadDealData(function() {
|
||||||
|
|
||||||
$("#del_client_bg").fadeIn(500);
|
$("#del_client_bg").fadeIn(500);
|
||||||
$("#del_client").toggle(10);
|
$("#del_client").toggle(10);
|
||||||
|
|||||||
32
js/main.js
32
js/main.js
@ -4162,18 +4162,44 @@ $(document).ready(function() {
|
|||||||
var req_id = 0;
|
var req_id = 0;
|
||||||
if ($(this).attr("data-req")) req_id = $(this).attr("data-req");
|
if ($(this).attr("data-req")) req_id = $(this).attr("data-req");
|
||||||
|
|
||||||
// Получаем client_id из заявки если data-id не задан
|
|
||||||
var id = $(this).attr('data-id') || 0;
|
var id = $(this).attr('data-id') || 0;
|
||||||
if (id == 'undefined' || !id) id = 0;
|
if (id == 'undefined' || !id) id = 0;
|
||||||
|
|
||||||
console.log('[delClientAgent] id:', id, 'req_id:', req_id);
|
console.log('[delClientAgent] id:', id, 'req_id:', req_id);
|
||||||
|
|
||||||
// Обновляем ac.reqId в Vue-компоненте если он доступен
|
|
||||||
if (typeof ac !== 'undefined') ac.reqId = parseInt(req_id) || 0;
|
if (typeof ac !== 'undefined') ac.reqId = parseInt(req_id) || 0;
|
||||||
|
|
||||||
resetDealCloseModal();
|
resetDealCloseModal();
|
||||||
$("#del_client_bg").fadeIn(500);
|
|
||||||
|
|
||||||
|
// Загружаем данные сделки для отображения информации
|
||||||
|
$.ajax({
|
||||||
|
url: '/ajax/ajax_vue_requisitions.php',
|
||||||
|
type: 'POST',
|
||||||
|
contentType: 'application/json',
|
||||||
|
data: JSON.stringify({ request: 'get_deal_by_req', req_id: req_id }),
|
||||||
|
success: function(response) {
|
||||||
|
var res = typeof response === 'string' ? JSON.parse(response) : response;
|
||||||
|
if (res && res.deal_id) {
|
||||||
|
$.ajax({
|
||||||
|
url: '/ajax/ajax_vue_requisitions.php',
|
||||||
|
type: 'POST',
|
||||||
|
contentType: 'application/json',
|
||||||
|
data: JSON.stringify({ request: 'get_deal_data', deal_id: res.deal_id }),
|
||||||
|
success: function(dealRes) {
|
||||||
|
var dealData = dealRes && dealRes.deal;
|
||||||
|
var currentReqId = $('#del_client #id_del_req').val();
|
||||||
|
if (dealData && currentReqId == req_id) {
|
||||||
|
window.dealCloseData = dealData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
window.dealCloseData = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#del_client_bg").fadeIn(500);
|
||||||
$("#del_client").toggle(10);
|
$("#del_client").toggle(10);
|
||||||
|
|
||||||
$("#del_client").find('input[name="id_del_client"]').val(id);
|
$("#del_client").find('input[name="id_del_client"]').val(id);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user