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.
100 lines
2.5 KiB
100 lines
2.5 KiB
$(document).ready(function() {
|
|
|
|
$('.delete_license').click(function(e){
|
|
e.preventDefault();
|
|
var accountID = $(this).data('id');
|
|
|
|
$('#dialogs').html('Удалить счет на оплату?');
|
|
$('#dialogs').dialog({
|
|
buttons: {
|
|
"Да": function(){
|
|
$.post('/my/delete_license/' + accountID + '/', function(data){
|
|
$('.account_' + data['id']).remove()
|
|
});
|
|
$(this).dialog("close");
|
|
},
|
|
"Нет": function(){
|
|
$(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;
|
|
});
|
|
|
|
});
|
|
|
|
|