Rev 31070 | Rev 33247 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
$(function() {$(document).on('click', ".logistics", function() {loadlogistics("main-content");});$(document).on('click', ".provider", function() {loadprovider("main-content");});$(document).on('click', ".provider-tat", function() {loadproviderTat("main-content");});$(document).on('click', ".delay-billing", function() {loadDelayBilling("main-content")});$(document).on('click', ".public-provider-holiday", function() {loadpublicHoliday("main-content");});$(document).on('click', "#uploadshipping", function() {getAuthorisedWarehouses(function(warehouseId) {console.log(warehouseId)window.location.href = context + "/downloadUploadShippingTemplate?warehouseId=" + warehouseId;});});$(document).on('click', "#uploadTatTemplate", function() {window.location.href = context + "/downloadProviderTatTemplate";});$(document).on('click', "#delaydayTemplate", function() {window.location.href = context + "/downloadDelayDayTemplate";})$(document).on('click', ".providertat", function() {var providerId = $("#provider").val();console.log(providerId)doGetAjaxRequestHandler(context + "/getProviderTat?providerId=" + providerId,function(response) {console.log(response)$('.' + "providertatContainer").html(response);});});$(document).on('click', ".uploaddelaydayfile", function() {console.log("hello");if (confirm('Confirm upload ?')) {var fileSelector = $(this)[0];if (fileSelector != undefined) {var url = `${context}/delayDayFileUpload`;console.log(url);var file = $("#delaydayfile")[0].files[0];let fileInput = $(this);console.log("file" + file);console.log("fileInput" + fileInput);doAjaxUploadRequestHandler(url,'POST',file, function(response) {console.log(response)alert("successfully uploaded");loadproviderTat("main-content");if (response == 'true') {}});}}});$(document).on('click', "#markDeliveredTemplate", function() {window.location.href = context + "/downloadMarkDeliveredTemplate";});$(document).on('click', ".uploadmarkdeliveredfile", function() {console.log("hello");if (confirm('Confirm upload ?')) {var fileSelector = $(this)[0];if (fileSelector != undefined) {var url = `${context}/markDeliveredFileUpload`;console.log(url);var file = $("#markdeliveredfile")[0].files[0];let fileInput = $(this);console.log("file" + file);console.log("fileInput" + fileInput);doAjaxUploadRequestHandler(url,'POST',file, function(response) {console.log(response)alert("successfully uploaded");loadproviderTat("main-content");if (response == 'true') {}});}}});$(document).on('click', ".billedOrderUpload", function() {console.log("hello");if (confirm('Confirm upload ?')) {var fileSelector = $(this)[0];if (fileSelector != undefined) {var url = `${context}/billedOrderFileUploader`;console.log(url);var file = $("#billedOrderFile")[0].files[0];let fileInput = $(this);console.log("file" + file);console.log("fileInput" + fileInput);doAjaxUploadRequestHandler(url,'POST',file, function(response) {console.log(response)if (response == true) {alert("successfully uploaded");loadlogistics("main-content");}});}}});$(document).on('click', "#delayBillingTemplate", function() {window.location.href = context + "/delayBillingTemplate";});$(document).on('click', ".generate-awb", function() {console.log("ghghkg");doPostAjaxRequestHandler(context + "/sctrachOffer/create",function(response) {console.log(response)});});$(document).on('click', ".uploadDelayBillingFile", function() {console.log("hello");if (confirm('Confirm upload ?')) {var fileSelector = $(this)[0];if (fileSelector != undefined) {var url = `${context}/getDelayBillingFileUploader`;console.log(url);var file = $("#delayBillingFile")[0].files[0];let fileInput = $(this);console.log("file" + file);console.log("fileInput" + fileInput);doAjaxUploadRequestHandler(url,'POST',file, function(response) {if (response == true) {alert("successfully uploaded");console.log("response" + response);}});}}});$(document).on('click', ".providertatupload", function() {console.log("hello");if (confirm('Confirm upload ?')) {var fileSelector = $(this)[0];if (fileSelector != undefined) {var url = `${context}/providerTatFileUploader`;console.log(url);var file = $("#providertatfile")[0].files[0];let fileInput = $(this);console.log("file" + file);console.log("fileInput" + fileInput);doAjaxUploadRequestHandler(url,'POST',file, function(response) {if (response == true) {alert("successfully uploaded");console.log("response" + response);}});}}});$(document).on('click', ".create-provider",function() {var name = $('#providerName').val();var email = $('#promoterEmail').val();var mobile = $('#providerMobile').val();var accountNo = $('#accountNo').val();var provideractive = $('#provideractive').val();if (name === "" && mobile === "" && email === ""&& accountNo === "") {alert("Field can't be empty");return;}if (name === "") {alert("Name is required");return;}if (accountNo === "") {alert("AccountNo is required");return;}if (email === "") {alert("email is required");return;}if (mobile === "") {alert("mobile Number is required");return;}if (provideractive === "") {alert("Status is required");return;}var providerdetailData = {}providerdetailData['name'] = nameproviderdetailData['email'] = emailproviderdetailData['mobile'] = mobileproviderdetailData['accountNo'] = accountNoproviderdetailData['provideractive'] = provideractive;console.log(providerdetailData);if (confirm("Are you sure you want to add Promoter!") == true) {doPostAjaxRequestWithJsonHandler(context+ "/createProvider", JSON.stringify(providerdetailData), function(response) {if (response == 'true') {alert("successfully Add");loadprovider("main-content");}});return false;}});$(document).on('click', ".public-holiday", function() {var date = $('#date').val();var occassion = $('#occassion').val();if (date === "") {alert("date is required");return;}if (occassion === "") {alert("occassion is required");return;}console.log(date);if (confirm("Are you sure you want add holiday!") == true) {doPostAjaxRequestHandler(context + "/createPublicHoliday?date="+ date + "&occassion="+ occassion, function(response) {if (response == true) {alert("successfully submit");loadpublicHoliday("main-content");}});}});});function loadlogistics(domId) {doGetAjaxRequestHandler(context + "/logistics",function(response) {$('#' + domId).html(response);});}function loadDelayBilling(domId) {doGetAjaxRequestHandler(context + "/delayBilling",function(response) {$('#' + domId).html(response);});}function loadprovider(domId) {doGetAjaxRequestHandler(context + "/provider",function(response) {$('#' + domId).html(response);});}function loadproviderTat(domId) {doGetAjaxRequestHandler(context + "/providerTat",function(response) {$('#' + domId).html(response);});}function loadpublicHoliday(domId) {doGetAjaxRequestHandler(context + "/publicProviderHolidays",function(response) {$('#' + domId).html(response);});}