// 首页数据定时刷新-5min 刷新一次 function timedRefresh() { if (scheduledTask) { 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) { $('#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; 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') { 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 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); }, function (xhr) { }); // 人员统计赋值 function setPersonNum(obj) { $('#totalPersonNum').html(obj.allNUM) // $('#rkPersonNum').html() // $('#wrkPersonNum').html() initEchartsSeven(obj.ptzy, obj.ttzy, obj.bzgg); } } // 告警信息 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); }, 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的高度 }); } }