mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-27 23:20:28 +01:00
53 lines
1.5 KiB
JavaScript
53 lines
1.5 KiB
JavaScript
var AmaInvoice = function ($) {
|
|
'use strict';
|
|
|
|
var me = {
|
|
storage: {
|
|
tableList: []
|
|
},
|
|
expertChange: function () {
|
|
if ($('#expert').prop('checked')) {
|
|
$('.trexpert').show();
|
|
} else {
|
|
$('.trexpert').hide();
|
|
}
|
|
},
|
|
init: function () {
|
|
$('#import').on('click', function () {
|
|
me.storage.tableList = [];
|
|
$('#amainvoice_list').find(':checked').each(function () {
|
|
me.storage.tableList.push($(this).data('id'));
|
|
});
|
|
if (me.storage.tableList.length > 0) {
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: 'index.php?module=amainvoice&action=list&cmd=importlist',
|
|
data: {
|
|
list: me.storage.tableList
|
|
},
|
|
success: function () {
|
|
me.storage.tableList = [];
|
|
}
|
|
});
|
|
}
|
|
});
|
|
if ($('#createorder').prop('checked')) {
|
|
$('#expert').prop('checked', true);
|
|
}
|
|
$('#expert').on('change', function () {
|
|
me.expertChange();
|
|
});
|
|
me.expertChange();
|
|
}
|
|
};
|
|
|
|
return {
|
|
init: me.init
|
|
};
|
|
|
|
}(jQuery);
|
|
|
|
$(document).ready(function () {
|
|
AmaInvoice.init();
|
|
});
|