// 首页数据定时刷新-5min 刷新一次 function timedRefresh() { if (scheduledTask) { mergeData(); loadDayPlanAjax('1'); loadDutyTaskAjax(); loadDutyProgressAjax(); } else { scheduledTask = true; } setTimeout(timedRefresh, 1000 * 60 * 5); } // 工程统计 function loadProNumAjax() { let url = dataUrl + 'proteam/pot/sup/getProMaps'; let params = { 'isSup': user.isSup, 'orgId': user.orgId }; ajaxRequest(url, "POST", params, true, function () { }, function (result) { if (parseInt(result.code) == 200) { setProNum(result); } else if (parseInt(result.code) === 500) { layer.alert('服务异常', { icon: 2 }) } else if (parseInt(result.code) === 401) { logout(1); } }, function (xhr) { }); // 工程统计数量赋值 function setProNum(obj) { // if(isBd){ // $('#proTotalNum').html(1440); // $('#workNum').html(228); // $('#noWorkNum').html(158); // $('#stopNum').html(15); // initEchartsOne(1440, 228, 158,15); // }else{ $('#proTotalNum').html(obj.allNum); $('#workNum').html(obj.sgNum); $('#noWorkNum').html(obj.wsgNum); $('#stopNum').html(obj.TgNum); initEchartsOne(obj.allNum, obj.sgNum, obj.wsgNum, obj.TgNum); // } } } // 1.周计划/2.计划趋势/3.全省周计划 function loadWeekPlanAjax(type) { let url = dataUrl + 'proteam/pot/sup/getWeekMaps'; let params = { 'isSup': user.isSup, 'orgId': user.orgId, 'type': type }; ajaxRequest(url, "POST", params, true, function () { }, function (result) { console.log(result); if (parseInt(result.code) == 200) { setWeekPlan(result); } else if (parseInt(result.code) === 500) { layer.alert('服务异常', { icon: 2 }) } else if (parseInt(result.code) === 401) { logout(1); } }, function (xhr) { }); // 工程统计数量赋值 function setWeekPlan(obj) { if (type === '1') { let data = obj.data; // if(isBd){ // initEchartsFive(90, 742, 8075, 302); // $('#weekPlanNum').html(9209); // }else{ initEchartsFive(data[0], data[1], data[2], data[3]); $('#weekPlanNum').html(parseInt(data[0]) + parseInt(data[1]) + parseInt(data[2]) + parseInt(data[3])); //} } else if (type === '2') { // if(isBd){ // let da1=['合肥', '马鞍山', '芜湖', '安庆', '淮南', '宣城', '阜阳', '铜陵', '蚌埠', // '滁州', '六安', '淮北', '宿州', '池州', '黄山', '亳州', '建设分公司']; // let da2=[81,5,11,70,26,49,3,4,3,16,14,12,12,37,157,48,195]; // let da3=[50,0,2,0,6,0,0,0,0,3,0,2,5,1,0,0,21]; // initEchartsThree(da1,da3, da2); // }else{ initEchartsThree(obj.times, obj.twoList, obj.threeList); // } } } } // 日计划 function loadDayPlanAjax(type) { let url = dataUrl + 'proteam/pot/sup/getDayPlanMaps'; let params = { 'isSup': user.isSup, 'orgId': user.orgId, 'type': type }; ajaxRequest(url, "POST", params, true, function () { }, function (result) { if (parseInt(result.code) == 200) { setDayPlanNum(result); } else if (parseInt(result.code) === 500) { layer.alert('服务异常', { icon: 2 }) } else if (parseInt(result.code) === 401) { logout(1); } }, function (xhr) { }); // 日计划数量赋值 function setDayPlanNum(obj) { if (type === '1') { $('#dayTotalNum').html(obj.allNum); $('#dayDoNum').html(obj.yzxNum); $('#dayNoDoNum').html(obj.wzxNum); $('#wzxNum').html(obj.wzxNum); $('#yhsNum').html(obj.HsNum); $('#whsNum').html(obj.WhsNum); // initEchartsEight((obj.HsNum / obj.wzxNum)); } } } /*站班会--请求*/ function mergeData() { let objParam = { type: classDataType, curryDay: '' } $.ajax({ url: dataUrl + 'proteam/pot/home/getClassMettingData', type: 'post', headers: { "encrypt": sm3(JSON.stringify(objParam)) }, data: objParam, async: true, success: function (result) { if (result.code === 200) { if (result.data) { initEchartsByUser(result.data.data, result.data.value); } } else if (result.code === 500) { return layer.alert(result.msg, { icon: 2 }) } else if (result.code === 401) { logout(1); } }, }); } // 值班任务 function loadDutyTaskAjax() { let url = dataUrl + 'proteam/pot/sup/getDutyTaskMaps'; let params = { 'isSup': user.isSup, 'orgId': user.orgId }; ajaxRequest(url, "POST", params, true, function () { }, function (result) { if (parseInt(result.code) == 200) { setDutyTaskNum(result); } else if (parseInt(result.code) === 500) { layer.alert('服务异常', { icon: 2 }) } else if (parseInt(result.code) === 401) { logout(1); } }, function (xhr) { }); // 值班任务数量赋值 function setDutyTaskNum(obj) { $('#todayTaskTotalNum').html(obj.allNum); $('#todayTaskXSNum').html(obj.xs); $('#todayTaskWXSNum').html(obj.noXs); $('#yzwzNum').html(obj.YZWZ); $('#ybwzNum').html(obj.YBWZ); $('#xfNum').html(obj.XFWZ); $('#zgNum').html(obj.YZG); } } // 值班进度 function loadDutyProgressAjax() { let url = dataUrl + 'proteam/pot/sup/getDutySchedule'; let params = { 'isSup': user.isSup, 'orgId': user.orgId }; ajaxRequest(url, "POST", params, true, function () { }, function (result) { if (parseInt(result.code) == 200) { setDutyTaskNum(result); } else if (parseInt(result.code) === 500) { layer.alert('服务异常', { icon: 2 }) } else if (parseInt(result.code) === 401) { logout(1); } }, function (xhr) { }); // 值班进度赋值 function setDutyTaskNum(obj) { let num = 0, totalNum = 0; if (obj.taskList && obj.taskList.length > 0) { $.each(obj.taskList, function (index, item) { totalNum += parseInt(item) }) } if (obj.xsList && obj.xsList.length > 0) { $.each(obj.xsList, function (index, item) { num += parseInt(item) }) } initEchartsFour(num, totalNum); initEchartsSix(obj.userList, obj.taskList, obj.xsList, obj.wzList); } } // 人员统计 function loadPersonNumAjax() { let url = dataUrl + 'proteam/pot/sup/getPeopleMaps'; let params = { 'isSup': user.isSup, 'orgId': user.orgId, 'dateTimes': getNowTime() }; ajaxRequest(url, "POST", params, true, function () { }, function (result) { setPersonNum(result.data); }, function (xhr) { }); // 人员统计赋值 function setPersonNum(obj) { console.error(obj); $('#totalPersonNum2').html(obj.totalNum) $('#totalPersonNum').html(obj.totalNum) $('#rkPersonNum').html(obj.bePutInStorageNum) $('#wrkPersonNum').html(obj.notPutInStorageNum) initEchartsSeven(obj.personList); } } // 告警信息 function loadEarlyInfoAjax() { let url = dataUrl + 'proteam/pot/early/getTodayWarnInfo'; let params = { 'isSup': user.isSup, 'orgId': user.orgId, 'userId': user.userId }; ajaxRequest(url, "POST", params, true, function () { }, function (result) { setEarlyWarnInfo(result.data.data); }, function (xhr) { }); // 预警信息 function setEarlyWarnInfo(result) { function getTypeValue(type) { if (type === '4') { return '人数变化大'; } else if (type === '5') { return '工序变化'; } else if (type === '6') { return '作业类型变化'; } else if (type === '7') { return '球机异常'; } else if (type === '8') { return '球机信号差'; } else if (type === '9') { return '今日未施工'; } } let html = '
' $('#right-center').children('#early-box').remove() $('#early-title').after(html); $("#early-box").myScroll({ speed: 40, //数值越大,速度越慢 rowHeight: 58 //li的高度 }); } } // 违章下发审核 function loadVoiCheckAjax() { let url = dataUrl + 'proteam/pot/sup/getViolationAudit'; let params = { 'isSup': user.isSup, 'orgId': user.orgId }; ajaxRequest(url, "POST", params, true, function () { }, function (result) { if (parseInt(result.code) == 200) { setVoiData(result.data); } else if (parseInt(result.code) === 500) { layer.alert('服务异常', { icon: 2 }) } else if (parseInt(result.code) === 401) { logout(1); } }, function (xhr) { }); // 违章下发审核赋值 function setVoiData(dataList) { let html = '
'; $('#right-bottom').children('#voi-box').remove() $('#voi-ul-title').after(html); $("#voi-box").myScroll({ speed: 40, //数值越大,速度越慢 rowHeight: 58 //li的高度 }); } }