102 lines
3.5 KiB
JavaScript
102 lines
3.5 KiB
JavaScript
function showModalNewUpdateSupplier(data) {
|
|
var loader = $('#overlay, #loader');
|
|
|
|
var SupplierId = data.supplierId;
|
|
if (!SupplierId) {
|
|
clearTextModal();
|
|
showHideLabelButtons(1);
|
|
$('#viewPRDetails').modal('hide');
|
|
$('#addNewEditSupplier').modal('show');
|
|
$('#addNewEditSupplier').css('z-index', 1070);
|
|
} else {
|
|
$.ajax({
|
|
url: '/CanvassMgmt/GetSupplierById',
|
|
type: 'POST',
|
|
data: { SupplierId },
|
|
beforeSend: function () {
|
|
loader.show();
|
|
},
|
|
complete: function () {
|
|
loader.hide();
|
|
},
|
|
success: function (data) {
|
|
if (data && data.data && data.data.length > 0) {
|
|
var item = data.data[0];
|
|
$('#supplierName').val(item.supplierName);
|
|
$('#emailAddress').val(item.emailAddress);
|
|
$('#isActive').val(item.isActive);
|
|
$('#addNewEditSupplier').modal('show');
|
|
} else {
|
|
console.log('Data is null or undefined');
|
|
}
|
|
},
|
|
error: errorHandler
|
|
});
|
|
}
|
|
}
|
|
function showRemarksDenied() {
|
|
$('#addRemarksUpdate').modal('show');
|
|
$('#addRemarksUpdate').css('z-index', 1075);
|
|
}
|
|
$(document).ready(function () {
|
|
loader = $('#overlay, #loader');
|
|
canvassTable = $('#PRTable').DataTable({
|
|
ajax: $.extend({
|
|
url: endpoint.GetCanvassPerSupplier,
|
|
type: 'GET',
|
|
}, beforeComplete(loader)),
|
|
initComplete: function () {
|
|
cleanupColumnSearch('#PRTable');
|
|
|
|
initializeColumnSearch({
|
|
tableId: '#PRTable',
|
|
dataTable: canvassTable,
|
|
searchableColumns: [
|
|
{
|
|
columnIndex: 2,
|
|
columnName: 'PR No',
|
|
placeholder: 'Enter PR Number...',
|
|
searchType: 'text',
|
|
searchMode: 'contains',
|
|
width: '150px'
|
|
},
|
|
{
|
|
columnIndex: 3,
|
|
columnName: 'Item No',
|
|
placeholder: 'Enter Item Number...',
|
|
searchType: 'text',
|
|
searchMode: 'exact',
|
|
width: '150px'
|
|
},
|
|
{
|
|
columnIndex: 4,
|
|
columnName: 'Item Name',
|
|
placeholder: 'Enter Item Name...',
|
|
searchType: 'text',
|
|
searchMode: 'contains',
|
|
width: '200px'
|
|
},
|
|
{
|
|
columnIndex: 0,
|
|
columnName: 'Supplier Name',
|
|
placeholder: 'Select Supplier...',
|
|
searchType: 'select',
|
|
searchMode: 'exact',
|
|
width: '150px'
|
|
}
|
|
]
|
|
});
|
|
const uniqueSearchClass = 'column-search-input-PRTable';
|
|
|
|
populateSelectOptions(canvassTable, 0, '.' + uniqueSearchClass + '[data-column="0"]');
|
|
|
|
restoreSearchFromURL(uniqueSearchClass, '#PRTable');
|
|
},
|
|
columns: colCanvassPerSupplier,
|
|
responsive: false,
|
|
language: {
|
|
emptyTable: "No record available"
|
|
},
|
|
error: errorHandler
|
|
});
|
|
}); |