Commit 18a34247 authored by 李苏's avatar 李苏 💬

KMES修改

parent c2bb6c52
......@@ -241,6 +241,55 @@
console.log(e||"请求失败")
})
}
/* 日排除合格率 */
function apisetRpcHglEchart1(chartHgl,isRcl){
function gethgl(){
return new Promise(function(y,n){
HTTP.post("queryGpfkHgl", {}, function(result) {
if (result['success']) {
let data=result.data.records
result.data.records.forEach(function(e,index){
data[index].fkrq=new Date(e.fkrq).toLocaleDateString().split('/').join('-')
if(e.fksl==0){
data[index].hgl=0
}else{
let hgl=(e.hgsl/e.fksl)*100
hgl=hgl.toFixed(2)
data[index].hgl=hgl
}
})
y(data)
} else {
n("请求失败")
}
});
})
}
gethgl().then(function(ye){
HTTP.post("queryWeekPcsl", {}, function(result) {
if (result['success']) {
let data=result.data.records
data.forEach(function(e,index){
data[index].jhrq=new Date(e.pcrq).toLocaleDateString().split('/').join('-')
})
if(isRcl=='rcl'){
setRclHglEchart1(chartHgl,ye,data)
}else{
setRpcHglEchart(chartHgl,ye,data)
}
} else {
console.log("请求失败")
}
});
}).catch(function(e){
console.log(e||"请求失败")
})
}
function apiqueryWorkingWO(){
HTTP.post("queryWorkingWO", {}, function(result) {
if (result['success']) {
......
......@@ -2596,6 +2596,7 @@ function setRpcHglEchart(chart, apidata1, apidata2) {
hgllist.push(e.hgl)
})
apidata2.forEach(function(e) {
console.log(e.jhrq)
datelist.push(e.jhrq.slice(5))
......@@ -2806,12 +2807,12 @@ function setRclHglEchart(chart, apidata1, apidata2) {
// }
// }
// },
legend: {
data: ['日产量', '合格率'],
textStyle: {
color: 'white'
}
},
// legend: {
// data: ['日产量'],
// textStyle: {
// color: 'white'
// }
// },
grid: {
left: '3%',
right: '4%',
......@@ -2871,6 +2872,135 @@ function setRclHglEchart(chart, apidata1, apidata2) {
formatter: '{value}'
}
},
// {
// type: 'value',
// name: '合格率',
// min: 0,
// max: 100,
// interval: 20,
// nameTextStyle: {
// color: "white"
// },
// splitLine: {
// show: false,
// },
// axisTick: {
// show: true,
// lineStyle: {
// color: 'white',
// }
// },
// axisLine: {
// show: true,
// lineStyle: {
// color: 'white',
// }
// },
// axisLabel: {
// show: true,
// color: 'white',
// formatter: '{value} %'
// }
// },
],
series: [{
name: '日产量',
type: 'bar',
data: wglist || [
2.6, 5.9, 9.0, 26.4, 28.7,
],
barWidth: 30,
itemStyle: {
normal: {
label: {
show: true,
position: "top",
textStyle: {
color: "white",
}
}
}
}
},
// {
// name: '合格率',
// type: 'line',
// yAxisIndex: 1,
// data: hgllist || [20, 30, 90, 30, 29],
// itemStyle: {
// normal: {
// label: {
// show: true,
// position: "top",
// textStyle: {
// color: "orange",
// }
// }
// }
// }
// }
]
};
chart.setOption(ops, true);
}
function setRclHglEchart1 (chart, apidata1, apidata2) {
let datelist = []
let hgllist = []
let jslist = []
let wglist = []
if (apidata1 && apidata2) {
apidata1.forEach(function(e) {
hgllist.push(e.hgl)
})
console.log(hgllist,'_____________________________')
apidata2.forEach(function(e) {
datelist.push(e.jhrq.slice(5))
jslist.push(e.jhsl)
wglist.push(e.wgsl)
})
}
var ops = {
color: ["#409eff", "#55ff7f", "#ffd03e"],
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [{
type: 'category',
data: datelist || ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
axisPointer: {
type: 'shadow'
},
axisTick: {
show: true,
lineStyle: {
color: "white"
}
},
axisLine: {
show: true,
lineStyle: {
color: "white"
}
},
axisLabel: {
show: true,
color: 'white'
}
}],
yAxis: [
{
type: 'value',
name: '合格率',
......@@ -2902,13 +3032,13 @@ function setRclHglEchart(chart, apidata1, apidata2) {
color: 'white',
formatter: '{value} %'
}
}],
},
],
series: [{
name: '日产量',
type: 'bar',
data: wglist || [
2.6, 5.9, 9.0, 26.4, 28.7,
],
name: '合格率',
type: 'line',
// yAxisIndex: 1,
data: hgllist || [20, 30, 90, 30, 29],
barWidth: 30,
itemStyle: {
normal: {
......@@ -2922,32 +3052,16 @@ function setRclHglEchart(chart, apidata1, apidata2) {
}
}
},
{
name: '合格率',
type: 'line',
yAxisIndex: 1,
data: hgllist || [20, 30, 90, 30, 29],
itemStyle: {
normal: {
label: {
show: true,
position: "top",
textStyle: {
color: "orange",
}
}
}
}
}
]
};
console.log(ops)
chart.setOption(ops, true);
}
// function setPieYChart(chart) {
// var ops= {
// tooltip: {
......
......@@ -69,7 +69,7 @@
<div class="header-img"></div>
</div>
<div class="header-right fl" style="line-height: 1.05rem;text-align:center;">
<span>温度:22°C</span>&nbsp;&nbsp;<span>湿度:12%rh</span>
<span>温度:22°C</span>&nbsp;&nbsp;<span>湿度:55%rh</span>
</div>
<div class="header-bottom fl"></div>
......@@ -339,14 +339,18 @@
</div>
</div>
<div class="right-cen border" style="height: 3.175rem;margin-bottom: .2rem;">
<div class="title">在制品状态</div>
<div class="title">合格率</div>
<div class="right-cen-cent">
<div id="chartzzp" class="allnav"></div>
</div>
<!-- <div class="title">合格率</div>
<div class="chat" style="height: 3.1rem;">
<div id="chartRpcdcsj1" class="allnav"></div>
</div> -->
</div>
<div class="right-bottom rightTop border" style="height: 3.8rem;">
<div class="title">日产量&合格率</div>
<div class="title">日产量</div>
<div class="chat" style="height: 3.1rem;">
<div id="chartRpcdcsj" class="allnav"></div>
</div>
......@@ -389,26 +393,29 @@
});
// var myChartSdcl = echarts.init(document.getElementById('chartSdcl'));
var chartRpcdcsj=echarts.init(document.getElementById("chartRpcdcsj"),null, {renderer: 'svg'});
var chartRpcdcsj1=echarts.init(document.getElementById("chartzzp"),null, {renderer: 'svg'});
var chartHgl=echarts.init(document.getElementById("chartHgl"),null, {renderer: 'svg'});
// var chartRjh=echarts.init(document.getElementById("chartRjh"),null, {renderer: 'svg'});
var chartYjh=echarts.init(document.getElementById("chartYjh"),null, {renderer: 'svg'});
var chartJdshCirle=echarts.init(document.getElementById("chartJdshCirle"),null, {renderer: 'svg'});
var chartTzzp=echarts.init(document.getElementById("chartzzp"),null, {renderer: 'svg'});
setproduceEchart(chartTzzp)/* 在制品状态 */
// var chartTzzp=echarts.init(document.getElementById("chartzzp"),null, {renderer: 'svg'});
// setproduceEchart(chartTzzp)
// oaechart(myChartSdcl); /*oa*/
setRclHglEchart(chartRpcdcsj); /*日排产达成数据*/
setRclHglEchart1(chartRpcdcsj1);
// setHglEchart(chartHgl);/*合格率*/
// setPieDailyChart(chartRjh,80);
setPieDailyChart(chartYjh,80);
setproduceEchart(chartTzzp)
// setproduceEchart(chartTzzp)
$('.myscroll').myScroll({
speed: 60, //数值越大,速度越慢
rowHeight: 46 //li的高度
});
function echartzsy(){
chartTzzp.resize()
// chartTzzp.resize()
// myChartSdcl.resize()
chartRpcdcsj.resize()
chartRpcdcsj1.resize()
chartHgl.resize()
// chartRjh.resize()
chartYjh.resize()
......@@ -419,11 +426,9 @@
apiqueryZscl()
apiqueryOA()
apigetscts($("#aqscts"))
apiCurProZtsl(chartTzzp)
// apiCurProZtsl(chartTzzp)
apisetRpcHglEchart(chartRpcdcsj,'rcl')
// apisetTimeProductionEchart(myChartSdcl)
// apisetDailyDataEchart(chartRpcdcsj)
// apisetPieDailyChart(chartRjh)
apisetRpcHglEchart1(chartRpcdcsj1,'rcl')
apisetPieDailyCharty(chartYjh)
apisetHglEchart(chartHgl)
apiqueryWo()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment