parent
7547ce372b
commit
b8c8423333
8 changed files with 218 additions and 93 deletions
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 58 KiB |
@ -1,23 +1,100 @@ |
|||||||
$(document).ready(function() { |
$(document).ready(function() { |
||||||
|
|
||||||
$('.delete_license').click(function(e){ |
$('.delete_license').click(function(e){ |
||||||
e.preventDefault(); |
e.preventDefault(); |
||||||
var accountID = $(this).data('id'); |
var accountID = $(this).data('id'); |
||||||
|
|
||||||
$('#dialogs').html('Удалить счет на оплату?'); |
$('#dialogs').html('Удалить счет на оплату?'); |
||||||
$('#dialogs').dialog({ |
$('#dialogs').dialog({ |
||||||
buttons: { |
buttons: { |
||||||
"Да": function(){ |
"Да": function(){ |
||||||
$.post('/my/delete_license/' + accountID + '/', function(data){ |
$.post('/my/delete_license/' + accountID + '/', function(data){ |
||||||
$('.account_' + data['id']).remove() |
$('.account_' + data['id']).remove() |
||||||
}); |
}); |
||||||
$(this).dialog("close"); |
$(this).dialog("close"); |
||||||
}, |
}, |
||||||
"Нет": function(){ |
"Нет": function(){ |
||||||
$(this).dialog("close"); |
$(this).dialog("close"); |
||||||
} |
} |
||||||
} |
} |
||||||
}) |
}) |
||||||
}) |
}); |
||||||
|
|
||||||
|
var options = { |
||||||
|
valueNames: [ |
||||||
|
{ data: ['id'] }, |
||||||
|
'order-date', |
||||||
|
{ data: ['type']}, |
||||||
|
{ data: ['status']} |
||||||
|
] |
||||||
|
}; |
||||||
|
|
||||||
|
var orderList = new List('listData', options); |
||||||
|
|
||||||
|
console.log(orderList); |
||||||
|
|
||||||
|
$('#filterNone').click(function() { |
||||||
|
event.preventDefault(); |
||||||
|
orderList.filter(); |
||||||
|
return false; |
||||||
|
}); |
||||||
|
|
||||||
|
$('#filterAccountsNone').click(function() { |
||||||
|
event.preventDefault(); |
||||||
|
orderList.filter(function(item) { |
||||||
|
return item.values().type === "account"; |
||||||
|
}); |
||||||
|
return false; |
||||||
|
}); |
||||||
|
|
||||||
|
$('#filterAccountsPay').click(function() { |
||||||
|
event.preventDefault(); |
||||||
|
orderList.filter(function(item) { |
||||||
|
// console.log(item.values());
|
||||||
|
return item.values().type === "account" && item.values().status === "2"; |
||||||
|
}); |
||||||
|
return false; |
||||||
|
}); |
||||||
|
|
||||||
|
$('#filterAccountsWaitPay').click(function() { |
||||||
|
event.preventDefault(); |
||||||
|
orderList.filter(function(item) { |
||||||
|
return item.values().type === "account" && item.values().status === "0"; |
||||||
|
}); |
||||||
|
return false; |
||||||
|
}); |
||||||
|
|
||||||
|
$('#filterAccountsFreezePay').click(function() { |
||||||
|
event.preventDefault(); |
||||||
|
orderList.filter(function(item) { |
||||||
|
return item.values().type === "account" && item.values().status === "4"; |
||||||
|
}); |
||||||
|
return false; |
||||||
|
}); |
||||||
|
|
||||||
|
$('#filterLicenseNone').click(function() { |
||||||
|
event.preventDefault(); |
||||||
|
orderList.filter(function(item) { |
||||||
|
return item.values().type === "license"; |
||||||
|
}); |
||||||
|
return false; |
||||||
|
}); |
||||||
|
|
||||||
|
$('#filterLicenseNow').click(function() { |
||||||
|
event.preventDefault(); |
||||||
|
orderList.filter(function(item) { |
||||||
|
return item.values().type === "license" && item.values().status === "2"; |
||||||
|
}); |
||||||
|
return false; |
||||||
|
}); |
||||||
|
|
||||||
|
$('#filterLicenseOld').click(function() { |
||||||
|
event.preventDefault(); |
||||||
|
orderList.filter(function(item) { |
||||||
|
return item.values().type === "license" && item.values().status === "3"; |
||||||
|
}); |
||||||
|
return false; |
||||||
|
}); |
||||||
|
|
||||||
}); |
}); |
||||||
|
|
||||||
|
|||||||
Loading…
Reference in new issue