You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
3.1 KiB
84 lines
3.1 KiB
import {getCookie} from '../utils'
|
|
|
|
|
|
function bindArchiveProjects() {
|
|
// Нажимаем на кнопку архивные сообщения
|
|
$("#trashed-button").on('click', function (e) {
|
|
e.preventDefault();
|
|
var state = $(this).attr('data-show');
|
|
var trashedOrderHtml = "";
|
|
|
|
if (state == 'true') {
|
|
$(this).attr('data-show', 'false');
|
|
$(this).text("Скрыть архивные заказы");
|
|
|
|
$("#archive-space").show();
|
|
$("#show-archive-label").show();
|
|
|
|
} else {
|
|
$(this).attr('data-show', 'true');
|
|
$(this).text("Показать архивные заказы");
|
|
$("#archive-space").hide();
|
|
$("#show-archive-label").hide();
|
|
}
|
|
|
|
|
|
});
|
|
|
|
// Нажимаем на заказ в архмвных заказах
|
|
$(".messageBlock").on('click', '.trashedOrderBlock', function () {
|
|
let $this = $(this);
|
|
$("#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 = '';
|
|
|
|
|
|
let orderId = $this.data('id');
|
|
// let projectId = $this.data('project-id');
|
|
// let recipentId = $this.data('recipent-id');
|
|
// let orderName = $this.data('order-name');
|
|
location.hash = '#order' + orderId;
|
|
// console.log(orderId);
|
|
window.chatController.create(orderId);
|
|
// $.ajax({
|
|
// url: '/api/message',
|
|
// type: 'GET',
|
|
// beforeSend: function (xhr) {
|
|
// xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
|
|
// },
|
|
// data: {'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();
|
|
// $("#reserveSpace").hide();
|
|
});
|
|
}
|
|
|
|
export {bindArchiveProjects} |