function fnMainGetInhouseReservationList()
{
window.fnOldOnmessage= window.onmessage;
window.onmessage= function(objMsg){
console.log(objMsg);
if( objMsg.data.strName.match("fnCallbackGetInhouseReservationList"))
{
fnResetOnmessage();
objMsg.data.strName= "fnCallBackMainGetInhouseReservationList";
objMsg.data.bIfContinue= true;
window.postMessage(objMsg.data);
}
else
window.fnOldOnmessage(objMsg);
}
fnGetInhouseReservationList();
}
function fnResetOnmessage( )
{
window.onmessage = window.fnOldOnmessage;
window.fnOldOnmessage= null;
}
function fnGetInhouseReservationList()
{
let date = new Date();
let strSymble1;
let strSymble2;
if (parseInt(date.getMonth()) < 9) {
strSymble1 = '-0';
}
else
strSymble1 = '-';
if (parseInt(date.getDate()) < 10) {
strSymble2 = '-0';
}
else
strSymble2 = '-';
let nProperty;
nProperty= JSON.parse(window.localStorage.getItem("RM_Property")).data.split('_')[0];
let objParam = {
"FromDate": date.getFullYear() + strSymble1
+ parseInt(date.getMonth() + 1) + strSymble2
+ date.getDate(),
"ToDate": date.getFullYear() + strSymble1
+ parseInt(date.getMonth() + 1) + strSymble2
+ date.getDate(),
"OnlyShowPrimaryClient": true,
"ShowGroupMasterOnly": false,
"Properties": [nProperty],
"BookingTypeId": 0,
"ReportView": 3,
"ResView": 0,
"CatGrpIds": [],
"CatIds": []
}
let xmlhttp= new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
console.log("fnGetInhouseReservationList: ");
console.log(xmlhttp.responseText);
window.objParam= null;
window.objParam= (xmlhttp.responseText);
let objParam = {
"strName": "fnCallbackGetInhouseReservationList",
"objValue": JSON.parse(xmlhttp.responseText).InOutData
}
window.postMessage(objParam);
}
}
xmlhttp.open("POST","https://app9.rmscloud.cn/api/Reservation/InOutScreen/RetrieveScreenData");
xmlhttp.setRequestHeader('content-Type','application/json; charset=utf-8');
xmlhttp.send(JSON.stringify(objParam));
}
console.log("get reservation list");