|
|
|
|
@ -105,7 +105,7 @@ |
|
|
|
|
<div class="messageBlock box-sizing disTab"> |
|
|
|
|
<p>Заказы</p> |
|
|
|
|
{% for order in orders %} |
|
|
|
|
<div class="orderBlock box-sizing order-block" |
|
|
|
|
<div class="orderBlock box-sizing order-block" data-project-id="{{ order.id }}" |
|
|
|
|
id="orderBlock{{ order.order.id }}" data-secure-deal="{% if order.order.secure %}true{% else %}false{% endif %}" data-recipent-id="{{ order.order.contractor.pk }}" data-id="{{ order.order.id }}"> |
|
|
|
|
<span class="dimovChat"></span> |
|
|
|
|
<p class="titleOB">{{ order }}</p> |
|
|
|
|
@ -183,7 +183,11 @@ |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="closeChat closeChat1" id="leaveReview" style="display: none;"> |
|
|
|
|
<a href="#" data-toggle="modal" data-target="#review-add"> |
|
|
|
|
Закрыть проект<br>и оставить отзыв |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="textAreaBlock2 box-sizing disTab"> |
|
|
|
|
<p>Для заметок</p> |
|
|
|
|
@ -192,13 +196,6 @@ |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="closeChat closeChat1" id="leaveReview" style="display: none;"> |
|
|
|
|
<a href="#" data-toggle="modal" data-target="#review-add"> |
|
|
|
|
Закрыть проект<br>и оставить отзыв |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Review add --> |
|
|
|
|
|
|
|
|
|
{% include 'review_add_modal.html' %} |
|
|
|
|
@ -230,10 +227,9 @@ |
|
|
|
|
var csrftoken = getCookie('csrftoken'); |
|
|
|
|
|
|
|
|
|
$("#reserve-button").on("click",function(e) { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
e.preventDefault(); |
|
|
|
|
$("#reserve-stage-modal").modal('show'); |
|
|
|
|
var orderId = $(this).attr('data-order-id'); |
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
url: '/api/stages/', |
|
|
|
|
type: 'GET', |
|
|
|
|
@ -244,11 +240,13 @@ |
|
|
|
|
var totalSum = 0; |
|
|
|
|
var stagesIds = ''; |
|
|
|
|
$.each(json.results, function (i, v) { |
|
|
|
|
console.log(v.cost); |
|
|
|
|
totalSum += parseInt(v.cost); |
|
|
|
|
outputValues += '<option data-stage-sum="' + v.cost + '" value="'+ v.id +'">' + v.name + '</option>'; |
|
|
|
|
stagesIds += v.id + ';' |
|
|
|
|
if((v.status == 'in_process') && (!v.is_paid)) { |
|
|
|
|
totalSum += parseInt(v.cost); |
|
|
|
|
outputValues += '<option data-stage-sum="' + v.cost + '" value="' + v.id + '">' + v.name + '</option>'; |
|
|
|
|
stagesIds += v.id + ';' |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$("#stagesSelect").html(outputValues); |
|
|
|
|
$(".totalSum").text(totalSum); |
|
|
|
|
$("#choiceWayOrder").val(totalSum) |
|
|
|
|
@ -293,7 +291,6 @@ |
|
|
|
|
type: 'GET', |
|
|
|
|
data:{csrfmiddlewaretoken: csrftoken}, |
|
|
|
|
dataType: 'json', |
|
|
|
|
|
|
|
|
|
}).then(function(data){ |
|
|
|
|
var stagesResults = data.stages; |
|
|
|
|
var stageCount = stagesResults.length; |
|
|
|
|
@ -321,8 +318,12 @@ |
|
|
|
|
var statusNotAgreed = true; |
|
|
|
|
var stagesInWork = []; |
|
|
|
|
var stagesPaidProcess = []; |
|
|
|
|
var stagesCompleted = []; |
|
|
|
|
|
|
|
|
|
$.each(stagesResults, function (i, v) { |
|
|
|
|
if (v.status == "completed"){ |
|
|
|
|
stagesCompleted.push(v); |
|
|
|
|
} |
|
|
|
|
if(!data.secure){ |
|
|
|
|
if(v.status == "in_process") { |
|
|
|
|
stagesInWork.push(v); |
|
|
|
|
@ -347,7 +348,7 @@ |
|
|
|
|
htmlInbox += '<div class="numberStepp box-sizing"><div class="insetNumStepp">' + |
|
|
|
|
'<p class="titleNumStepp"><span>Этап ' + v.pos + '</span>' + v.name + '</p>' + |
|
|
|
|
'<p class="textNumStepp">Результаты этапа:' + v.result + '</p><div>' + |
|
|
|
|
'<p>до Дата</p><span>' + v.cost + '<i class="fa fa-rub"></i></span>' + |
|
|
|
|
'<p>до '+ v.term +'</p><span>' + v.cost + '<i class="fa fa-rub"></i></span>' + |
|
|
|
|
'</div></div></div>'; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
@ -377,7 +378,7 @@ |
|
|
|
|
var stage = stagesInWork[0]; |
|
|
|
|
var stageWork = '<p>В работе '+ stage.name +'</p> ' + |
|
|
|
|
'<p>Результат этапа : '+ stage.result +'</p>' + |
|
|
|
|
'<p>Срок сдачи 25.08.2016 <b>' + stage.cost + 'р.</b></p>'; |
|
|
|
|
'<p>Срок сдачи '+ stage.term +'<b>' + stage.cost + 'р.</b></p>'; |
|
|
|
|
|
|
|
|
|
if (stage.close_contractor){ |
|
|
|
|
stageWork += '<a href="#" class="closeStage" data-order-id="'+ orderId + '" data-sender-id="{{ request.user.pk }}"' + |
|
|
|
|
@ -385,6 +386,17 @@ |
|
|
|
|
} |
|
|
|
|
$("#stagesWork").html(stageWork); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!data.secure){ |
|
|
|
|
$("#reserveSpace").hide(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(stagesCompleted.length == stagesResults.length){ |
|
|
|
|
$("#leaveReview").show(); |
|
|
|
|
console.log("Все этапы завершены"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -536,11 +548,12 @@ |
|
|
|
|
|
|
|
|
|
$(this).addClass('orAct'); |
|
|
|
|
var orderId = $(this).attr('data-id'); |
|
|
|
|
var projectId = $(this).attr('data-project-id'); |
|
|
|
|
var recipentId = $(this).attr('data-recipent-id'); |
|
|
|
|
var secureOrder = $(this).attr('data-secure-deal'); |
|
|
|
|
secureOrder = Boolean(secureOrder); |
|
|
|
|
$("#chat-order-add #orderId").val(orderId); |
|
|
|
|
$("#projectReviewId").val(orderId); |
|
|
|
|
$("#projectReviewId").val(projectId); |
|
|
|
|
$("#reserve-button").attr('data-order-id', orderId); |
|
|
|
|
$("#targetContractorId").val(recipentId); |
|
|
|
|
$("#chat-order-add #recipentId").val(recipentId); |
|
|
|
|
|