|
|
|
@ -64,7 +64,7 @@ var SocketHandler = function () { |
|
|
|
} else if (message.answer_type == 'approve_stages') { |
|
|
|
} else if (message.answer_type == 'approve_stages') { |
|
|
|
var resOrderId = message.order_id; |
|
|
|
var resOrderId = message.order_id; |
|
|
|
$.jGrowl(message.msg, { |
|
|
|
$.jGrowl(message.msg, { |
|
|
|
life: 4000 |
|
|
|
life: 15000 |
|
|
|
}); |
|
|
|
}); |
|
|
|
setTimeout(function () { |
|
|
|
setTimeout(function () { |
|
|
|
$("#orderBlock" + resOrderId).trigger('click'); |
|
|
|
$("#orderBlock" + resOrderId).trigger('click'); |
|
|
|
@ -185,51 +185,6 @@ function dialog (message, yesCallback, notCallback) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(".messageBlock").on('click','.trashedOrderBlock',function(){ |
|
|
|
|
|
|
|
$("#chat-order-add").css("display", "none"); |
|
|
|
|
|
|
|
$('.order-block, .trashedOrderBlock').each(function () { |
|
|
|
|
|
|
|
$(this).removeClass('orAct'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
$(this).addClass('orAct'); |
|
|
|
|
|
|
|
var inbox = document.getElementById('message-chat-order-space'); |
|
|
|
|
|
|
|
var docList = document.getElementById('documentOrderSpace'); |
|
|
|
|
|
|
|
inbox.innerHTML = ''; |
|
|
|
|
|
|
|
docList.innerHTML = ''; |
|
|
|
|
|
|
|
var orderId = $(this).attr('data-id'); |
|
|
|
|
|
|
|
location.hash = '#order' + orderId; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
|
|
url: '/api/message', |
|
|
|
|
|
|
|
type: 'GET', |
|
|
|
|
|
|
|
data: {csrfmiddlewaretoken: csrftoken, 'order': orderId, 'team__isnull': 'true'}, |
|
|
|
|
|
|
|
dataType: 'json', |
|
|
|
|
|
|
|
success: function (json) { |
|
|
|
|
|
|
|
$.each(json.results, function (i, v) { |
|
|
|
|
|
|
|
var senderName = 'Вы'; |
|
|
|
|
|
|
|
var className = 'youChat'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (v.sender.id !== userId) { |
|
|
|
|
|
|
|
senderName = v.sender.username; |
|
|
|
|
|
|
|
className = ''; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inbox.innerHTML += '<div class="col-lg-12 insetCommChat ' + className + '"><div class="topCommChat">' + |
|
|
|
|
|
|
|
'<p class="nameCommChat">' + senderName + '</p><span>' + v.created + '</span></div>' + |
|
|
|
|
|
|
|
'<p class="textCommChat">' + v.text + '</p></div>'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
var height = inbox.scrollHeight; |
|
|
|
|
|
|
|
inbox.scrollTop = height; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#order-stages").html(""); |
|
|
|
|
|
|
|
$("#completeWork").hide(); |
|
|
|
|
|
|
|
$("#add-form-order-note").hide(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Информация о заказе
|
|
|
|
// Информация о заказе
|
|
|
|
$(".messageBlock").on('click','.full-order-info', function (e) { |
|
|
|
$(".messageBlock").on('click','.full-order-info', function (e) { |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
@ -608,15 +563,14 @@ function dialog (message, yesCallback, notCallback) { |
|
|
|
var recipentId = $("#chat-order-add #recipentId").val(); |
|
|
|
var recipentId = $("#chat-order-add #recipentId").val(); |
|
|
|
var senderId = $("#chat-order-add #senderId").val(); |
|
|
|
var senderId = $("#chat-order-add #senderId").val(); |
|
|
|
var orderId = $("#chat-order-add #orderId").val(); |
|
|
|
var orderId = $("#chat-order-add #orderId").val(); |
|
|
|
|
|
|
|
var sendLinks = $("#document-send-order a"); |
|
|
|
if (chatMessage) { |
|
|
|
if (chatMessage || sendLinks.length > 0) { |
|
|
|
var sendLinks = $("#document-send-order a"); |
|
|
|
|
|
|
|
var sendLinkIds = ""; |
|
|
|
var sendLinkIds = ""; |
|
|
|
var documentLinks = ""; |
|
|
|
var documentLinks = ""; |
|
|
|
var documentAttachFiles = ""; |
|
|
|
var documentAttachFiles = ""; |
|
|
|
$.each(sendLinks, function (i, v) { |
|
|
|
$.each(sendLinks, function (i, v) { |
|
|
|
sendLinkIds += $(this).attr('data-id') + ';'; |
|
|
|
sendLinkIds += $(this).attr('data-id') + ';'; |
|
|
|
documentLinks += 'Входящий файл: <br> <a href="'+ $(this).attr('href') + '">'+ $(this).text() +'</a><br>'; |
|
|
|
documentLinks += 'Приложенный файл. скачать: <br> <a href="'+ $(this).attr('href') + '">'+ $(this).text() +'</a><br>'; |
|
|
|
documentAttachFiles += '<li style="word-break: break-all;">' + |
|
|
|
documentAttachFiles += '<li style="word-break: break-all;">' + |
|
|
|
'<a class="file-link" href="' + $(this).attr('href') + '">' + $(this).text() + '</a>' + |
|
|
|
'<a class="file-link" href="' + $(this).attr('href') + '">' + $(this).text() + '</a>' + |
|
|
|
'<div class="remove-document" data-id="' + $(this).attr('data-id') + '" style="right:-10px;"></div></li>'; |
|
|
|
'<div class="remove-document" data-id="' + $(this).attr('data-id') + '" style="right:-10px;"></div></li>'; |
|
|
|
@ -650,16 +604,18 @@ function dialog (message, yesCallback, notCallback) { |
|
|
|
var chatMessage = $("#chat").val(); |
|
|
|
var chatMessage = $("#chat").val(); |
|
|
|
var recipentId = $("#recipentContactId").val(); |
|
|
|
var recipentId = $("#recipentContactId").val(); |
|
|
|
var senderId = $("#senderContactId").val(); |
|
|
|
var senderId = $("#senderContactId").val(); |
|
|
|
if (chatMessage) { |
|
|
|
var sendLinks = $("#document-send-contact a"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (chatMessage || sendLinks.length > 0) { |
|
|
|
$("#contact-chat-form .errorEmptyMessage").hide(); |
|
|
|
$("#contact-chat-form .errorEmptyMessage").hide(); |
|
|
|
var sendLinks = $("#document-send-contact a"); |
|
|
|
|
|
|
|
var sendLinkIds = ""; |
|
|
|
var sendLinkIds = ""; |
|
|
|
var documentLinks = ""; |
|
|
|
var documentLinks = ""; |
|
|
|
var documentAttachFiles = ""; |
|
|
|
var documentAttachFiles = ""; |
|
|
|
|
|
|
|
|
|
|
|
$.each(sendLinks, function (i, v) { |
|
|
|
$.each(sendLinks, function (i, v) { |
|
|
|
sendLinkIds += $(this).attr('data-id') + ';'; |
|
|
|
sendLinkIds += $(this).attr('data-id') + ';'; |
|
|
|
documentLinks += 'Входящий файл: <br> <a href="'+ $(this).attr('href') + '">'+ $(this).text() +'</a><br>'; |
|
|
|
documentLinks += 'Приложенный файл. скачать: <br> <a href="'+ $(this).attr('href') + '">'+ $(this).text() +'</a><br>'; |
|
|
|
documentAttachFiles += '<li style="word-break: break-all;">' + |
|
|
|
documentAttachFiles += '<li style="word-break: break-all;">' + |
|
|
|
'<a class="file-link" href="' + $(this).attr('href') + '">' + $(this).text() + '</a>' + |
|
|
|
'<a class="file-link" href="' + $(this).attr('href') + '">' + $(this).text() + '</a>' + |
|
|
|
'<div class="remove-document" data-id="' + $(this).attr('data-id') + '" style="right:-10px;"></div></li>'; |
|
|
|
'<div class="remove-document" data-id="' + $(this).attr('data-id') + '" style="right:-10px;"></div></li>'; |
|
|
|
|