编辑代码

/*
Name: fnGetListOfCategories
Function: 
Param: 
Return: 
future: 
 */

function fnGetListOfCategories()
{
        let xmlhttp= new XMLHttpRequest();
        xmlhttp.onreadystatechange = function () {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {

            if(window.objGlobalParam!== undefined)
            {
                window.objGlobalParam.objAryListOfCategories= new Array();
                JSON.parse(xmlhttp.responseText).forEach((element)=>{
                    if(element.UseHousekeeping==true)
                    window.objGlobalParam.objAryListOfCategories.push(element);
                },)
            }
            else
            {
                window.objGlobalParam= new Array();
                window.objGlobalParam.objAryListOfCategories= new Array();
                JSON.parse(xmlhttp.responseText).forEach((element)=>{
                    if(element.UseHousekeeping==true)
                    window.objGlobalParam.objAryListOfCategories.push(element);
                },)

            }

            let objParam = {
                "strName": "fnCallBackGetListOfCategories",
                "bIfContinue": true,
                "objValue": 0
            }
            window.postMessage(objParam);
            }
        }

        let objParam= {   
            "SearchKey":"",
            "lstOfPropertyIds":[JSON.parse(window.sessionStorage.getItem("InitData")).data.AccDates[0].PropertyId],
            "PropGrpId":0,
            "DiscountId":0,
            "Arrive":"2025-06-28T07:00:00.000Z",
            "Depart":"2025-06-29T04:00:00.000Z",
            "AllotmentAssociationType":0,
            "UsingLongStay":false
        }

        xmlhttp.open("POST","https://app9.rmscloud.cn/api/Manager/Category/ListOfCategoriesOnRes");
        xmlhttp.setRequestHeader('content-Type','application/json; charset=utf-8');
        xmlhttp.send(JSON.stringify(objParam));
}