Завел попап подтверждения отклонения заказа с комментарием

parent 27d27cda
...@@ -607,3 +607,33 @@ input[type="checkbox"] ...@@ -607,3 +607,33 @@ input[type="checkbox"]
border: 0; border: 0;
} }
.b-popup-content
{
padding: 10px;
}
.b-popup-content h2
{
margin-top: 10px;
margin-bottom: 10px;
text-align: center;
font-size: 16px;
color: #337ab7;
}
.b-popup-content textarea.b-popup-comment
{
padding: 10px;
width: 100%;
background-color: #FFFFFF;
border: 1px solid #CCCCCC;
border-radius: 4px;
resize: none;
}
.b-popup-content button
{
display: block;
margin: 0 auto;
}
\ No newline at end of file
...@@ -330,7 +330,7 @@ $(document).ready(function(){ ...@@ -330,7 +330,7 @@ $(document).ready(function(){
OrdersStatusReCalc(); OrdersStatusReCalc();
// Переключение статусов заказов: // Переключение статусов заказов в таблице:
$ordersSwitcher.on('click', function() { $ordersSwitcher.on('click', function() {
var $this = $(this); var $this = $(this);
...@@ -342,6 +342,49 @@ $(document).ready(function(){ ...@@ -342,6 +342,49 @@ $(document).ready(function(){
} }
}); });
var
$popupBg = $('.l-popup'),
$popup = $('.b-popup__window.order-regected-comment', $popupBg),
$popupClose = $('.button-close', $popup),
$popupContent = $('.b-popup-content', $popup),
$popupComment = $('.b-popup-comment', $popup);
// Закрыввем попап по клику на Х:
$popupClose.on('click', function(){
ClosePopup();
});
// Закрыввем попап по клику извне:
$popup.on('click', function(event){
event.stopPropagation();
});
$popupBg.on('click', function(){
ClosePopup();
});
function ShowPopup(dataPopup)
{
$popupBg.addClass('open-popup');
$popup.show();
$popupContent.attr("data-feed-id", dataPopup.feedId);
$popupContent.attr("data-order-id", dataPopup.orderId);
}
function ClosePopup()
{
$popupBg.removeClass('open-popup');
$popup.hide();
var
feedIdValue = $popupContent.attr("data-feed-id"),
orderIdValue = $popupContent.attr("data-order-id");
console.log('AAA feedIdValue = ', feedIdValue);
console.log('AAA orderIdValue = ', orderIdValue);
$popupContent.attr("data-feed-id", null);
$popupContent.attr("data-order-id", null);
$popupComment.val('');
}
// Клик на галочку подтверждения заказа: // Клик на галочку подтверждения заказа:
$tableStat.on('change', 'td.status input', function(e) { $tableStat.on('change', 'td.status input', function(e) {
...@@ -359,6 +402,16 @@ $(document).ready(function(){ ...@@ -359,6 +402,16 @@ $(document).ready(function(){
$tableToExcel = $("#table2excel"), $tableToExcel = $("#table2excel"),
$orderTrExcel = $('tbody tr.order-item[data-feed-id="' + $spanWrap.data('feed-id') + '"][data-order-id="' + $spanWrap.data('order-id') + '"]', $tableToExcel); $orderTrExcel = $('tbody tr.order-item[data-feed-id="' + $spanWrap.data('feed-id') + '"][data-order-id="' + $spanWrap.data('order-id') + '"]', $tableToExcel);
// Popup с комментарием к отклонению заказа:
if (!data.confirmed) {
var dataPopup = {
'feedId': $spanWrap.data('feed-id'),
'orderId': $spanWrap.data('order-id'),
}
ShowPopup(dataPopup);
}
return false;
$this.prop("disabled", true); $this.prop("disabled", true);
$.ajax(action, { $.ajax(action, {
......
<div class="order-regected-comment b-popup__window">
<p class="button-close"></p>
<div class="b-popup-content" data-feed-id="" data-order-id="">
<h2><?= _t("Комментарий к отклонению заказа") ?></h2>
<textarea class="b-popup-comment"></textarea>
<button class="btn btn-danger" type="button111" >Отклонить заказ</button>
</div>
</div>
...@@ -130,6 +130,7 @@ $urlHome = $this->url('home',['lang' => $lang]); ...@@ -130,6 +130,7 @@ $urlHome = $this->url('home',['lang' => $lang]);
<?= $this->partial('app::popup/connection', ['lang' => $lang]) ?> <?= $this->partial('app::popup/connection', ['lang' => $lang]) ?>
<?= $this->partial('app::popup/password-reset', ['lang' => $lang]) ?> <?= $this->partial('app::popup/password-reset', ['lang' => $lang]) ?>
<?= $this->partial('app::popup/confirm', ['lang' => $lang]) ?> <?= $this->partial('app::popup/confirm', ['lang' => $lang]) ?>
<?= $this->partial('app::popup/order-regected-comment', ['lang' => $lang]) ?>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment