|
|
|
|
@ -24,9 +24,9 @@ |
|
|
|
|
</li> |
|
|
|
|
|
|
|
|
|
{% if team_orders %} |
|
|
|
|
<li role="presentation"> |
|
|
|
|
<a href="#tab3" data-toggle="tab">Исполнители</a> |
|
|
|
|
</li> |
|
|
|
|
<li role="presentation"> |
|
|
|
|
<a href="#tab3" data-toggle="tab">Исполнители</a> |
|
|
|
|
</li> |
|
|
|
|
{% endif %} |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
|
@ -34,7 +34,7 @@ |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="tab-content"> |
|
|
|
|
<!-- Tab1 contacts block --> |
|
|
|
|
<!-- Tab1 contacts block --> |
|
|
|
|
<div class="chatBlock disTab tab-pane fade in active" id="tab1"> |
|
|
|
|
<div class="col-lg-3 wrMessages"> |
|
|
|
|
<div class="messageBlock box-sizing disTab"> |
|
|
|
|
@ -47,9 +47,24 @@ |
|
|
|
|
{% endthumbnail %} |
|
|
|
|
</div> |
|
|
|
|
<p class="nameMess"> |
|
|
|
|
<div><a href="#" style="color:black;">{{ contact.username }}</a></div> |
|
|
|
|
<div><a href="#" style="color:black;">{{ contact.username }}</a></div> |
|
|
|
|
</p> |
|
|
|
|
<a href="javascript:void(0)" class="conMess">Контакты</a> |
|
|
|
|
|
|
|
|
|
<div class="modal fade" id="userModal" tabindex="-1" role="dialog"> |
|
|
|
|
<div class="modal-dialog"> |
|
|
|
|
<div class="modal-content"> |
|
|
|
|
<div class="modal-header"> |
|
|
|
|
<button class="close" type="button" data-dismiss="modal">x</button> |
|
|
|
|
<h4 class="modal-title" id="myModalLabel">Название модального |
|
|
|
|
окна</h4> |
|
|
|
|
</div> |
|
|
|
|
<div class="modal-body"> |
|
|
|
|
<h3>Содержимое модального окна</h3> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<a href="#" data-target="#userModal" data-toggle="modal" class="conMess">Контакты</a> |
|
|
|
|
|
|
|
|
|
<span>0</span> |
|
|
|
|
<a href="javascript:void(0)" class="deleteMess"> |
|
|
|
|
@ -70,7 +85,7 @@ |
|
|
|
|
<div class="bunChat"> |
|
|
|
|
<div class="setChat box-sizing"> |
|
|
|
|
<p>Прикрепить файл</p> |
|
|
|
|
<span>Не более 10 файлов с общим объемом 500мб</span> |
|
|
|
|
<span>Не более 10 файлов с общим объемом 500мб</span> |
|
|
|
|
</div> |
|
|
|
|
<a id="contact-chat-add-message" href="javascript:void(0)">отправить</a> |
|
|
|
|
</div> |
|
|
|
|
@ -85,16 +100,17 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- End block Tab1 --> |
|
|
|
|
<!-- End block Tab1 --> |
|
|
|
|
|
|
|
|
|
<!-- Tab2 chat order block --> |
|
|
|
|
<!-- Tab2 chat order block --> |
|
|
|
|
<div class="chatBlock disTab tab-pane fade" id="tab2"> |
|
|
|
|
<div class="col-lg-3 wrMessages"> |
|
|
|
|
|
|
|
|
|
<div class="messageBlock box-sizing disTab"> |
|
|
|
|
<p>Заказы</p> |
|
|
|
|
{% for order in orders %} |
|
|
|
|
<div class="orderBlock box-sizing order-block" data-recipent-id="{{ order.project.customer.pk }}" data-id="{{ order.id }}"> |
|
|
|
|
<div class="orderBlock box-sizing order-block" |
|
|
|
|
data-recipent-id="{{ order.project.customer.pk }}" data-id="{{ order.id }}"> |
|
|
|
|
<span class="dimovChat"></span> |
|
|
|
|
<p class="titleOB">{{ order }}</p> |
|
|
|
|
<div class="hideOBB"> |
|
|
|
|
@ -121,7 +137,7 @@ |
|
|
|
|
<div class="bunChat"> |
|
|
|
|
<div class="setChat box-sizing"> |
|
|
|
|
<p>Прикрепить файл</p> |
|
|
|
|
<span>Не более 10 файлов с общим объемом 500мб</span> |
|
|
|
|
<span>Не более 10 файлов с общим объемом 500мб</span> |
|
|
|
|
</div> |
|
|
|
|
<a href="javascript:void(0)" id="order-chat-add-message">отправить</a> |
|
|
|
|
</div> |
|
|
|
|
@ -154,87 +170,89 @@ |
|
|
|
|
<p>Для заметок</p> |
|
|
|
|
<form id="add-form-order-note"> |
|
|
|
|
<textarea id="chat2" name="text"></textarea> |
|
|
|
|
<input type="hidden" name="order" id="orderNote" value="" /> |
|
|
|
|
<input type="hidden" name="sender" id="senderNote" value="{{ request.user.pk }}" /> |
|
|
|
|
<input type="hidden" name="recipent" id="recipentNote" value="" /> |
|
|
|
|
<input type="hidden" name="order" id="orderNote" value=""/> |
|
|
|
|
<input type="hidden" name="sender" id="senderNote" value="{{ request.user.pk }}"/> |
|
|
|
|
<input type="hidden" name="recipent" id="recipentNote" value=""/> |
|
|
|
|
<a href="#" id="add-note-button">сохранить</a> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- End block Tab2--> |
|
|
|
|
|
|
|
|
|
{% if team_orders %} |
|
|
|
|
<!-- Tab3 groups block --> |
|
|
|
|
<div class="chatBlock disTab tab-pane fade" id="tab3"> |
|
|
|
|
<div class="col-lg-3 wrMessages"> |
|
|
|
|
<div class="messageBlock box-sizing disTab"> |
|
|
|
|
<p>Заказы</p> |
|
|
|
|
{% for torder in team_orders %} |
|
|
|
|
<div class="team-order-block orderBlock box-sizing" data-team-id="{{ torder.team.pk }}" data-order-id="{{ torder.pk}}"> |
|
|
|
|
<span class="dimovChat"></span> |
|
|
|
|
<p class="titleOB"> |
|
|
|
|
{{ torder }} |
|
|
|
|
</p> |
|
|
|
|
<div class="hideOBB disTab"> |
|
|
|
|
<p class="pOB"> |
|
|
|
|
{# <span>Заказчик:</span> {{ torder.project.customer }}#} |
|
|
|
|
<span>Исполнитель:</span> {{ torder.team.name }} |
|
|
|
|
</p> |
|
|
|
|
<ul class="listChat1"> |
|
|
|
|
{% for tuser in torder.team.users.all %} |
|
|
|
|
<li>{{ tuser }}</li> |
|
|
|
|
{% endfor %} |
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
|
<p class="pOB"> |
|
|
|
|
<span>Чаты:</span> |
|
|
|
|
{% for tuser in torder.team.users.all %} |
|
|
|
|
{% if request.user.pk != tuser.pk %} |
|
|
|
|
<span class="team-chat-user" data-id="{{ tuser.pk }}">{{ tuser.username }},</span> |
|
|
|
|
{% endif %} |
|
|
|
|
{% endfor %} |
|
|
|
|
</p> |
|
|
|
|
<a href="#" class="linkChat11"> |
|
|
|
|
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> |
|
|
|
|
Полное описание заказа |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
<!-- End block Tab2--> |
|
|
|
|
|
|
|
|
|
{% if team_orders %} |
|
|
|
|
<!-- Tab3 groups block --> |
|
|
|
|
<div class="chatBlock disTab tab-pane fade" id="tab3"> |
|
|
|
|
<div class="col-lg-3 wrMessages"> |
|
|
|
|
<div class="messageBlock box-sizing disTab"> |
|
|
|
|
<p>Заказы</p> |
|
|
|
|
{% for torder in team_orders %} |
|
|
|
|
<div class="team-order-block orderBlock box-sizing" |
|
|
|
|
data-team-id="{{ torder.team.pk }}" data-order-id="{{ torder.pk }}"> |
|
|
|
|
<span class="dimovChat"></span> |
|
|
|
|
<p class="titleOB"> |
|
|
|
|
{{ torder }} |
|
|
|
|
</p> |
|
|
|
|
<div class="hideOBB disTab"> |
|
|
|
|
<p class="pOB"> |
|
|
|
|
{# <span>Заказчик:</span> {{ torder.project.customer }}#} |
|
|
|
|
<span>Исполнитель:</span> {{ torder.team.name }} |
|
|
|
|
</p> |
|
|
|
|
<ul class="listChat1"> |
|
|
|
|
{% for tuser in torder.team.users.all %} |
|
|
|
|
<li>{{ tuser }}</li> |
|
|
|
|
{% endfor %} |
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
|
<p class="pOB"> |
|
|
|
|
<span>Чаты:</span> |
|
|
|
|
{% for tuser in torder.team.users.all %} |
|
|
|
|
{% if request.user.pk != tuser.pk %} |
|
|
|
|
<span class="team-chat-user" |
|
|
|
|
data-id="{{ tuser.pk }}">{{ tuser.username }},</span> |
|
|
|
|
{% endif %} |
|
|
|
|
{% endfor %} |
|
|
|
|
</p> |
|
|
|
|
<a href="#" class="linkChat11"> |
|
|
|
|
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> |
|
|
|
|
Полное описание заказа |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{% endfor %} |
|
|
|
|
</div> |
|
|
|
|
{% endfor %} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="col-lg-6 commChat"> |
|
|
|
|
<div id="message-chat-team-space"></div> |
|
|
|
|
<form id="team-chat-form"> |
|
|
|
|
<input type="text" name="sender" id="senderId" value="{{ request.user.pk }}" /> |
|
|
|
|
<input type="text" name="recipent" id="recipentId" value="" /> |
|
|
|
|
<input type="text" name="order" id="orderId" value="" /> |
|
|
|
|
<input type="text" name="team" id="teamId" value="" /> |
|
|
|
|
<input type="text" name="document-send" id="documentSendIds" /> |
|
|
|
|
<textarea id="chatText" class="chat-textarea box-sizing"></textarea> |
|
|
|
|
<div class="bunChat"> |
|
|
|
|
<div class="setChat box-sizing upload"> |
|
|
|
|
<input type="file" name="file" id="upload-document-team"/> |
|
|
|
|
<p>Прикрепить файл</p> |
|
|
|
|
</div> |
|
|
|
|
<div id="progress" class="progress"> |
|
|
|
|
<div class="progress-bar progress-bar-success"></div> |
|
|
|
|
</div> |
|
|
|
|
<div class="col-lg-6 commChat"> |
|
|
|
|
<div id="message-chat-team-space"></div> |
|
|
|
|
<form id="team-chat-form"> |
|
|
|
|
<input type="text" name="sender" id="senderId" value="{{ request.user.pk }}"/> |
|
|
|
|
<input type="text" name="recipent" id="recipentId" value=""/> |
|
|
|
|
<input type="text" name="order" id="orderId" value=""/> |
|
|
|
|
<input type="text" name="team" id="teamId" value=""/> |
|
|
|
|
<input type="text" name="document-send" id="documentSendIds"/> |
|
|
|
|
<textarea id="chatText" class="chat-textarea box-sizing"></textarea> |
|
|
|
|
<div class="bunChat"> |
|
|
|
|
<div class="setChat box-sizing upload"> |
|
|
|
|
<input type="file" name="file" id="upload-document-team"/> |
|
|
|
|
<p>Прикрепить файл</p> |
|
|
|
|
</div> |
|
|
|
|
<div id="progress" class="progress"> |
|
|
|
|
<div class="progress-bar progress-bar-success"></div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div id="document-send"> |
|
|
|
|
<div id="document-send"> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
<a href="javascript:void(0)" id="add-team-chat-message">отправить</a> |
|
|
|
|
</div> |
|
|
|
|
<a href="javascript:void(0)" id="add-team-chat-message">отправить</a> |
|
|
|
|
</div> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
<div class="col-lg-3 wrstepschat"> |
|
|
|
|
<div class="col-lg-3 wrstepschat"> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- End block Tab3--> |
|
|
|
|
{% endif %} |
|
|
|
|
<!-- End block Tab3--> |
|
|
|
|
{% endif %} |
|
|
|
|
</div> |
|
|
|
|
{% include 'partials/footer.html' %} |
|
|
|
|
</div> |
|
|
|
|
@ -256,7 +274,7 @@ |
|
|
|
|
var domain = '{{ request.META.HTTP_HOST }}'; |
|
|
|
|
var port = '{{ request.META.SERVER_PORT }}'; |
|
|
|
|
domain = domain.replace(':' + port, ''); |
|
|
|
|
var url = 'ws://' + domain +':8888/chat/' + userId + '/'; |
|
|
|
|
var url = 'ws://' + domain + ':8888/chat/' + userId + '/'; |
|
|
|
|
var sock = new WebSocket(url); |
|
|
|
|
var intervalId; |
|
|
|
|
sock.onopen = function () { |
|
|
|
|
@ -274,7 +292,7 @@ |
|
|
|
|
inbox = document.getElementById('message-chat-space'); |
|
|
|
|
} else if (message.answer_type == 'order' || message.answer_type == 'add_message_order') { |
|
|
|
|
inbox = document.getElementById('message-chat-order-space'); |
|
|
|
|
} else if(message.answer_type == 'add_message_team'){ |
|
|
|
|
} else if (message.answer_type == 'add_message_team') { |
|
|
|
|
inbox = document.getElementById('message-chat-team-space'); |
|
|
|
|
} |
|
|
|
|
console.log(message.answer_type); |
|
|
|
|
@ -294,7 +312,7 @@ |
|
|
|
|
console.log(data); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
this.add_team_message = function(messageData){ |
|
|
|
|
this.add_team_message = function (messageData) { |
|
|
|
|
|
|
|
|
|
console.log(messageData); |
|
|
|
|
sock.send(JSON.stringify(messageData)); |
|
|
|
|
@ -327,16 +345,16 @@ |
|
|
|
|
var form = document.getElementById('message_form'); |
|
|
|
|
var csrftoken = getCookie('csrftoken'); |
|
|
|
|
|
|
|
|
|
setTimeout(function(){ |
|
|
|
|
$(".user-block").first().trigger('click'); |
|
|
|
|
setTimeout(function () { |
|
|
|
|
$(".user-block").first().trigger('click'); |
|
|
|
|
}, 10); |
|
|
|
|
|
|
|
|
|
setTimeout(function(){ |
|
|
|
|
$(".order-block").first().trigger('click'); |
|
|
|
|
setTimeout(function () { |
|
|
|
|
$(".order-block").first().trigger('click'); |
|
|
|
|
}, 100); |
|
|
|
|
|
|
|
|
|
setTimeout(function(){ |
|
|
|
|
$(".team-order-block").first().trigger('click'); |
|
|
|
|
setTimeout(function () { |
|
|
|
|
$(".team-order-block").first().trigger('click'); |
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -354,12 +372,13 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
dataType: 'json', |
|
|
|
|
done: function (e, data) {; |
|
|
|
|
done: function (e, data) { |
|
|
|
|
; |
|
|
|
|
$.each(data.result.files, function (index, file) { |
|
|
|
|
var currentValue = $("#documentSendIds").val(); |
|
|
|
|
currentValue += file.id + ';'; |
|
|
|
|
$("#documentSendIds").val(currentValue); |
|
|
|
|
var htmlImg = '<p>'+ file.name+'</p>'; |
|
|
|
|
var htmlImg = '<p>' + file.name + '</p>'; |
|
|
|
|
var document_send = $(htmlImg).appendTo("#document-send"); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
@ -374,23 +393,23 @@ |
|
|
|
|
.parent().addClass($.support.fileInput ? undefined : 'disabled'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#order-stages").on('click',"#approve-stages",function(e){ |
|
|
|
|
$("#order-stages").on('click', "#approve-stages", function (e) { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
$(".stage-block-approve").each(function(){ |
|
|
|
|
var stageId = $(this).attr('data-id'); |
|
|
|
|
$(".stage-block-approve").each(function () { |
|
|
|
|
var stageId = $(this).attr('data-id'); |
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
url: '/api/stages/' + stageId + '/', |
|
|
|
|
type: 'PATCH', |
|
|
|
|
beforeSend: function(xhr){ |
|
|
|
|
beforeSend: function (xhr) { |
|
|
|
|
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) |
|
|
|
|
}, |
|
|
|
|
data: "status=in_process", |
|
|
|
|
dataType:'json', |
|
|
|
|
success: function(json){ |
|
|
|
|
dataType: 'json', |
|
|
|
|
success: function (json) { |
|
|
|
|
console.log(json); |
|
|
|
|
}, |
|
|
|
|
error: function(e){ |
|
|
|
|
error: function (e) { |
|
|
|
|
console.log('error'); |
|
|
|
|
console.log(e); |
|
|
|
|
} |
|
|
|
|
@ -399,13 +418,13 @@ |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$(".team-chat-user").on('click',function(e){ |
|
|
|
|
$(".team-chat-user").on('click', function (e) { |
|
|
|
|
e.stopPropagation(); |
|
|
|
|
var recipentId = $(this).attr('data-id'); |
|
|
|
|
$("#team-chat-form #recipentId").val(recipentId); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$(".team-order-block").on('click', function(){ |
|
|
|
|
$(".team-order-block").on('click', function () { |
|
|
|
|
|
|
|
|
|
$('.team-order-block').each(function () { |
|
|
|
|
$(this).removeClass('orAct'); |
|
|
|
|
@ -423,7 +442,7 @@ |
|
|
|
|
$.ajax({ |
|
|
|
|
url: '/api/message', |
|
|
|
|
type: 'GET', |
|
|
|
|
data: {csrfmiddlewaretoken: csrftoken, 'team': teamId,'order': orderId}, |
|
|
|
|
data: {csrfmiddlewaretoken: csrftoken, 'team': teamId, 'order': orderId}, |
|
|
|
|
dataType: 'json', |
|
|
|
|
success: function (json) { |
|
|
|
|
$.each(json.results, function (i, v) { |
|
|
|
|
@ -489,7 +508,7 @@ |
|
|
|
|
console.log(json.results); |
|
|
|
|
var noteHtmlInbox = ''; |
|
|
|
|
$.each(json.results, function (i, v) { |
|
|
|
|
noteHtmlInbox += '<li>'+ v.text +'<li>'; |
|
|
|
|
noteHtmlInbox += '<li>' + v.text + '<li>'; |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
$(".notes-block").html(noteHtmlInbox); |
|
|
|
|
@ -508,15 +527,15 @@ |
|
|
|
|
if (json.results.length > 0) { |
|
|
|
|
|
|
|
|
|
$.each(json.results, function (i, v) { |
|
|
|
|
if(v.is_paid){ |
|
|
|
|
stagesReservedHtml += '<li class="reserved">Сумма за этап '+ i +'.Зарезервирована.</li>'; |
|
|
|
|
}else{ |
|
|
|
|
stagesReservedHtml += '<li class="unreserved">Сумма за этап '+ i +'.Не зарезервирована.</li>'; |
|
|
|
|
if (v.is_paid) { |
|
|
|
|
stagesReservedHtml += '<li class="reserved">Сумма за этап ' + i + '.Зарезервирована.</li>'; |
|
|
|
|
} else { |
|
|
|
|
stagesReservedHtml += '<li class="unreserved">Сумма за этап ' + i + '.Не зарезервирована.</li>'; |
|
|
|
|
} |
|
|
|
|
htmlInbox += '<div data-id="' + v.id + '" class="numberStepp box-sizing stage-block-approve"><div class="insetNumStepp">' + |
|
|
|
|
'<p class="titleNumStepp"><span>Этап ' + v.pos + '</span>' + v.name + '</p>' + |
|
|
|
|
'<p class="textNumStepp">Результаты этапа:' + v.result + '</p><div>' + |
|
|
|
|
'<p>'+ v.status+'</p><span>' + v.cost + '<i class="fa fa-rub"></i></span></div></div></div>'; |
|
|
|
|
'<p>' + v.status + '</p><span>' + v.cost + '<i class="fa fa-rub"></i></span></div></div></div>'; |
|
|
|
|
}); |
|
|
|
|
htmlInbox += '<div class="textAreaBlock2 FFD box-sizing disTab"><a id="approve-stages" href="#">согласовать</a></div>'; |
|
|
|
|
|
|
|
|
|
@ -529,21 +548,21 @@ |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('#add-note-button').on('click', function(){ |
|
|
|
|
$('#add-note-button').on('click', function () { |
|
|
|
|
$.ajax({ |
|
|
|
|
url: '/api/note/', |
|
|
|
|
type: 'POST', |
|
|
|
|
beforeSend: function (xhr) { |
|
|
|
|
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) |
|
|
|
|
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) |
|
|
|
|
}, |
|
|
|
|
data:$("#add-form-order-note").serialize(), |
|
|
|
|
data: $("#add-form-order-note").serialize(), |
|
|
|
|
dataType: 'json', |
|
|
|
|
success: function (json) { |
|
|
|
|
console.log(json); |
|
|
|
|
$("#add-form-order-note #chat2").val(""); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
error: function(e){ |
|
|
|
|
error: function (e) { |
|
|
|
|
console.log('error'); |
|
|
|
|
console.log(e); |
|
|
|
|
} |
|
|
|
|
@ -586,7 +605,7 @@ |
|
|
|
|
|
|
|
|
|
//Добавить сообщение для исполнителей в группе |
|
|
|
|
|
|
|
|
|
$("#add-team-chat-message").on('click', function(){ |
|
|
|
|
$("#add-team-chat-message").on('click', function () { |
|
|
|
|
var chatMessage = $("#team-chat-form #chatText").val(); |
|
|
|
|
var recipentId = $("#team-chat-form #recipentId").val(); |
|
|
|
|
var senderId = $("#team-chat-form #senderId").val(); |
|
|
|
|
|