diff --git a/js/pages/newDataAnalysis/workerEfficiencyAnalysis.js b/js/pages/newDataAnalysis/workerEfficiencyAnalysis.js index 0fe5eba..fe76581 100644 --- a/js/pages/newDataAnalysis/workerEfficiencyAnalysis.js +++ b/js/pages/newDataAnalysis/workerEfficiencyAnalysis.js @@ -7,6 +7,16 @@ const tipsArr = [ '持续强化技能培训与考核,同时确保施工工具按时检查,保障作业安全。', '定期组织技能培训和考试,并做好施工工具的维护与定期检查工作。', ]; + +// let +const inefficiencyArr = [ + { + 'gxName':'', + nameList:['专业技能不足', '工具故障','人员异常','设备维保','环境变化'], + valueList:[{ name: '专业技能不足', value: 4 }, { name: '工具故障', value: 1 }] + + } +]; layui.use(['layer', 'table', 'form'], function () { layer = layui.layer; table = layui.table; @@ -49,45 +59,47 @@ function initTable() { }, cols: [[ { type: 'numbers', title: '序号', width: '10%' }, // 添加序号列 - { field: 'userName', title: '姓名', align: 'center', width: '10%' }, - { field: 'teamName', title: '班组', align: 'center', width: '10%' }, - { field: 'postName', title: '工种', align: 'center', width: '10%' }, - { field: 'attDay', title: '出勤天数', align: 'center', width: '10%' }, + { field: 'userName', title: '班组长', align: 'center', width: '10%' }, + { field: 'teamName', title: '班组', align: 'center', width: '15%' }, { - field: 'sgType', title: '施工类型', align: 'center', width: '10%', + field: 'gxName', title: '工序', align: 'center', width: '20%', }, { - field: 'completeWorkload', title: '完成工作量', align: 'center', width: '10%', - templet: function (d) { - return d.completeWorkload + d.unitTimeOutputUnit; - } + field: 'planDay', title: '计划完成天数', align: 'center', width: '10%', + }, { - field: 'unitTimeOutput', title: '单位时间产量', align: 'center', width: '10%', - templet: function (d) { - return d.unitTimeOutput + d.unit; - } + field: 'actualDay', title: '实际完成天数', align: 'center', width: '10%', + }, { - field: 'standardTimeOutput', title: '单位时间标准产量', align: 'center', width: '10%', + field: 'workStandard', title: '作业内容', align: 'center', width: '15%', templet: function (d) { - return d.standardTimeOutput + d.unit; + if (d.workStandard) { + if (d.workStandard.length > 60) { + return '' + d.workStandard.substring(0, 60) + '...' + } else { + return '' + d.workStandard + '' + } + } else { + return ''; + } } + }, { title: '效率评级', align: 'center', width: '10%', templet: function (d) { let color = '', title = ''; - let min = parseFloat(d.standardTimeOutput.split('~')[0]) || 0; - let max = parseFloat(d.standardTimeOutput.split('~')[1]) || 0; - let unitTimeOutput = parseFloat(d.unitTimeOutput) || 0; - if (unitTimeOutput > max) { + let planDay = d.planDay; + let actualDay = d.actualDay; + if (planDay > actualDay ) { color = 'green', title = '高效'; - } else if (unitTimeOutput >= min && unitTimeOutput <= max) { + } else if (planDay === actualDay) { color = 'yellow', title = '达标'; - } else if (unitTimeOutput < min) { + } else if (planDay < actualDay) { color = 'red', title = '低效'; } @@ -143,10 +155,9 @@ function initEcharts(data) { myChart2 = echarts.init(document.getElementById("twoEcharts")); $('#suggestion').empty(); initEchartsOne(data); - let min = parseFloat(data.standardTimeOutput.split('~')[0]) || 0; - let max = parseFloat(data.standardTimeOutput.split('~')[1]) || 0; - let unitTimeOutput = parseFloat(data.unitTimeOutput) || 0; - if (unitTimeOutput < min) { + let planDay = data.planDay; + let actualDay = data.actualDay; + if (planDay < actualDay) { initEchartsTwo(data); const randomIndex = Math.floor(Math.random() * tipsArr.length); // 生成 0~4 的随机整数 const randomItem = tipsArr[randomIndex]; @@ -160,10 +171,8 @@ function average(a, b) { } function initEchartsOne(obj) { - let min = parseFloat(obj.standardTimeOutput.split('~')[0]) || 0; - let max = parseFloat(obj.standardTimeOutput.split('~')[1]) || 0; - const data = [obj.unitTimeOutput]; - const data2 = [average(min,max)]; + const data = [obj.actualDay]; + const data2 = [obj.planDay]; const colorArr1 = ["rgba(11, 83, 128)", "rgba(2, 143, 224)", "#2a7fcc"]; const colorArr2 = ["rgb(12, 109, 122)", "rgba(1, 241, 228)", "#5ce1d6"]; var color1 = { @@ -231,13 +240,10 @@ function initEchartsOne(obj) { trigger: 'axis', formatter: function (params) { var str = params[0].name + ":"; + str += "
" + "工序:" + obj.gxName; params.filter(function (item) { if (item.componentSubType == "bar") { - if(item.seriesName === '单位时间产量'){ - str += "
" + item.seriesName + ":" + item.value + obj.unit; - }else if(item.seriesName === '单位时间标准产量'){ - str += "
" + item.seriesName + ":" + obj.standardTimeOutput + obj.unit; - } + str += "
" + item.seriesName + ":" + item.value; } }); @@ -324,7 +330,7 @@ function initEchartsOne(obj) { series: [ { z: 1, - name: '单位时间产量', + name: '实际天数', type: "bar", barWidth: barWidth, barGap: "0%", @@ -337,7 +343,7 @@ function initEchartsOne(obj) { }, { z: 3, - name: '单位时间产量', + name: '实际天数', type: "pictorialBar", symbolPosition: "end", data: data, @@ -353,7 +359,7 @@ function initEchartsOne(obj) { }, { z: 1, - name: '单位时间标准产量', + name: '计划天数', type: "bar", barWidth: barWidth, barGap: "50%", @@ -366,7 +372,7 @@ function initEchartsOne(obj) { }, { z: 3, - name: '单位时间标准产量', + name: '计划天数', type: "pictorialBar", symbolPosition: "end", data: data2, @@ -393,7 +399,7 @@ function initEchartsOne(obj) { /* 变化趋势 */ function initEchartsTwo(data) { - let nameList = ['专业技能不足', '工具故障']; + let nameList = ['专业技能不足', '工具故障','人员异常','设备维保','环境变化']; let valueList = [{ name: '专业技能不足', value: 4 }, { name: '工具故障', value: 1 }]; const option = { grid: { diff --git a/pages/newDataAnalysis/workerEfficiencyAnalysis.html b/pages/newDataAnalysis/workerEfficiencyAnalysis.html index ebdca8e..a83293f 100644 --- a/pages/newDataAnalysis/workerEfficiencyAnalysis.html +++ b/pages/newDataAnalysis/workerEfficiencyAnalysis.html @@ -28,7 +28,7 @@
- +