function initCache(cachedData){ //缓存门店员工信息 $.ajax({ url: '/emp/getList?deptCode=' + deptCode + '&limit=99999', method: 'post', async: false }).done(function (msg) { cachedData.emps = msg.data; }); //缓存模版信息 $.ajax({ url: '/schTmpDept/getList?deptId=' + deptCode, method: 'post', async: false }).done(function (res) { cachedData.tpls = { "list": res.data }; }); //缓存日期信息 $.ajax({ url: '/schInfo/getList?month=' + month, method: 'post', async: false }).done(function (res) { cachedData.schInfos = res.data; }); //缓存排班信息 $.ajax({ url: '/schInfoEmp/getList?month=' + month + "&deptId=" + deptCode, method: 'post', async: false }).done(function (res) { cachedData.schEmps = res.data; }); //缓存调班信息 $.ajax({ url: '/schInfo/getList?month=' + month, method: 'post', async: false }).done(function (res) { cachedData.schExgs = res.data; });
}
//数据缓存 var cachedData = new Object(); initCache(cachedData);