Rev 31183 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
$(function() {$(document).on('click', ".hygiene", function() {loadHygiene("main-content");});$(document).on('click', "#hygiene-fofo-search", function() {var fofoId = $('#partnerId').val();doGetAjaxRequestHandler(context + "/getHygieneData?fofoId=" + fofoId, function(response) {$('#' + "main-content").html(response);});});$(document).on('click', "#hygiene-mobile-search", function() {var mobileNumber = $('#mobileNumber').val();doGetAjaxRequestHandler(context + "/getHygieneData?mobileNumber=" + mobileNumber, function(response) {$('#' + "main-content").html(response);});});$(document).on('click', "#hygiene-date-search", function() {var fofoId = $('#partnerId').val();var date = getDatesFromPicker('input[name="hdate"]').startDateconsole.log(fofoId)if (fofoId == "") {doGetAjaxRequestHandler(context + "/getHygieneData?date=" + date, function(response) {$('#' + "main-content").html(response);});} else {doGetAjaxRequestHandler(context + "/getHygieneData?fofoId=" + fofoId + "&date=" + date, function(response) {$('#' + "main-content").html(response);});}});$(document).on('click', ".fetchDetail",function() {doGetAjaxRequestHandler(context + "/getFetchHygieneData",function(response) {$('#fetchCustomerData .modal-content').html(response);$('#schedule').hide();$('#hygiene-detail').hide();});});$(document).on('click', ".fetch",function() {var id = $(this).data('requestid');console.log(id);doGetAjaxRequestHandler(context+ "/getFetchHygieneDataByOrderId?orderId=" + id, function(response) {$('#fetchCustomerData .modal-content').html(response);$('#schedule').hide();$('#hygiene-detail').hide();$("#textRemark").hide();});});$(document).on('click', ".add-customer-feedback",function() {var hygieneData = {}var status = $('#status').val();var val = $("#remark").val();console.log(val);if (val == "other") {remark = $('input[name="textRemark"]').val();} else {remark = val;}var orderId = $(this).data('orderid');if (status === "" && remark === "") {alert("Field can't be empty");return;}if (remark === "") {alert("Remark is required");return;}if (status === "") {alert("Status is required");return;}if (status == "Not connected") {hygieneData['orderId'] = orderId;hygieneData['status'] = $('#status').val();hygieneData['remark'] = remark;hygieneData['hygieneRating'] = $('#hygieneRating').val();hygieneData['scheduleTime'] = getDatesFromPicker('input[name="scheduleTime"]').startDate;} else if (status == "Not Connected Closed") {hygieneData['orderId'] = orderId;hygieneData['status'] = $('#status').val();hygieneData['hygieneRating'] = $('#hygieneRating').val();hygieneData['remark'] = remark}else if (status == "connected") {hygieneData['orderId'] = orderId;hygieneData['status'] = $('#status').val();hygieneData['remark'] = remark;hygieneData['hygieneRating'] = $('#hygieneRating').val();hygieneData['dop'] = getDatesFromPicker('input[name="dateTime"]').startDate;hygieneData['quesPhone'] = $('#quest1').val();hygieneData['quesInformation'] = $('#quest2').val();hygieneData['quesInvoice'] = $('#quest3').val();hygieneData['rating'] = $('#rating').val();hygieneData['feedback'] = $('#feedback').val();hygieneData['action'] = $('#action').val();} else {alert("status is required")return;}console.log(hygieneData);if (confirm("Are you sure you want to update detail!") == true) {doPostAjaxRequestWithJsonHandler(context + "/hygieneData",JSON.stringify(hygieneData), function(response) {if (response == 'true') {alert("successfully Update");$('#fetchCustomerData').modal('hide');$('.modal-backdrop').remove();loadHygiene("main-content");}});return false;}});});function statusChange() {var val = $('#status').val();console.log(val)if (val == "Not connected") {$('#hygiene-detail').hide();$('#schedule').show();} else if (val == "connected") {$('#schedule').hide();$('#hygiene-detail').show();} else {$('#schedule').hide();$('#hygiene-detail').hide();}}function loadHygiene(domId) {doGetAjaxRequestHandler(context + "/getHygieneData", function(response) {$('#' + domId).html(response);});}function changeRemark() {var val = $("#remark").val();console.log(val);if (val == "other") {$("#textRemark").show();} else {$("#textRemark").hide();}}