fix:控制台NAN问题处理
This commit is contained in:
parent
d721d1a9d9
commit
a6ef32997a
|
|
@ -583,7 +583,7 @@ export default {
|
||||||
list.forEach((item) => {
|
list.forEach((item) => {
|
||||||
for (let i = 0; i < this.weekDateList.length; i++) {
|
for (let i = 0; i < this.weekDateList.length; i++) {
|
||||||
if (item.日 == that.weekDateList[i]) {
|
if (item.日 == that.weekDateList[i]) {
|
||||||
saleOutdept6[i] = item.交付数;
|
saleOutdept6[i] = item.数量;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -286,13 +286,13 @@ export default {
|
||||||
that.$API.bi.dataset.exec.req('saleOutDay', obj6).then((res6) => {
|
that.$API.bi.dataset.exec.req('saleOutDay', obj6).then((res6) => {
|
||||||
let list6 = res6.data2.ds0;
|
let list6 = res6.data2.ds0;
|
||||||
if (list6.length > 0) {
|
if (list6.length > 0) {
|
||||||
this.dayPayNum6 = list6[0].交付数;
|
this.dayPayNum6 = list6[0].数量;
|
||||||
}
|
}
|
||||||
//6车前日交付数
|
//6车前日交付数
|
||||||
that.$API.bi.dataset.exec.req('saleOutDay', obj06).then((res06) => {
|
that.$API.bi.dataset.exec.req('saleOutDay', obj06).then((res06) => {
|
||||||
let list06 = res06.data2.ds0;
|
let list06 = res06.data2.ds0;
|
||||||
if (list06.length > 0) {
|
if (list06.length > 0) {
|
||||||
this.tongbi06 = Math.round((this.dayPayNum6 - list06[0].交付数) / list06[0].交付数 * 100);
|
this.tongbi06 = Math.round((this.dayPayNum6 - list06[0].数量) / list06[0].数量 * 100);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -669,12 +669,12 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (beforData7 !== 0) {
|
if (beforData7 !== 0) {
|
||||||
this.tongbi7 = Math.round(
|
that.tongbi7 = Math.round(
|
||||||
((this.dayPassNum7 - beforData7) / beforData7) *
|
((that.dayPassNum7 - beforData7) / beforData7) *
|
||||||
100
|
100
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.tongbi7 = this.dayPassNum7;
|
that.tongbi7 = that.dayPassNum7;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -705,57 +705,48 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (beforData10 !== 0) {
|
if (beforData10 !== 0) {
|
||||||
this.tongbi10 = Math.round(
|
that.tongbi10 = Math.round(((that.dayPassNum10 - beforData10) /beforData10) *100);
|
||||||
((this.dayPassNum10 - beforData10) /
|
|
||||||
beforData10) *
|
|
||||||
100
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
this.tongbi7 = this.dayPassNum7;
|
that.tongbi7 = that.dayPassNum7;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
//6车昨日交付数
|
//6车昨日交付数
|
||||||
this.dayPayNum6 = 0;
|
that.dayPayNum6 = 0;
|
||||||
that.$API.bi.dataset.exec.req("saleOutDay", obj6).then((res6) => {
|
that.$API.bi.dataset.exec.req("saleOutDay", obj6).then((res6) => {
|
||||||
if (res6.data2.ds0) {
|
if (res6.data2.ds0) {
|
||||||
let list6 = res6.data2.ds0;
|
let list6 = res6.data2.ds0;
|
||||||
if (list6.length > 0) {
|
if (list6.length > 0) {
|
||||||
list6.forEach((item6) => {
|
list6.forEach((item6) => {
|
||||||
this.dayPayNum6 += item6.交付数;
|
that.dayPayNum6 += item6.数量;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let beforData6 = 0;
|
let beforData6 = 0;
|
||||||
//6车前日交付数
|
//6车前日交付数
|
||||||
that.$API.bi.dataset.exec
|
that.$API.bi.dataset.exec.req("saleOutDay", obj06).then((res06) => {
|
||||||
.req("saleOutDay", obj06)
|
if (res06.data2.ds0) {
|
||||||
.then((res06) => {
|
let list06 = res06.data2.ds0;
|
||||||
if (res06.data2.ds0) {
|
if (list06.length > 0) {
|
||||||
let list06 = res06.data2.ds0;
|
list06.forEach((item06) => {
|
||||||
if (list06.length > 0) {
|
beforData6 += item06.数量;
|
||||||
list06.forEach((item06) => {
|
});
|
||||||
beforData6 += item06.交付数;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (beforData6 !== 0) {
|
}
|
||||||
this.tongbi06 = Math.round(
|
if (beforData6 !== 0) {
|
||||||
((this.dayPassNum6 - beforData6) / beforData6) *
|
that.tongbi06 = Math.round(((that.dayPayNum6 - beforData6) / beforData6) *100);
|
||||||
100
|
} else {
|
||||||
);
|
that.tongbi06 = that.dayPayNum6;
|
||||||
} else {
|
}
|
||||||
this.tongbi06 = this.dayPassNum6;
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//本月合格数&本月交付统计---6、7、10车间
|
//本月合格数&本月交付统计---6、7、10车间
|
||||||
getMonthData() {
|
getMonthData() {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.monthPayNum6 = 0;
|
that.monthPayNum6 = 0;
|
||||||
this.monthPassRate7 = 0;
|
that.monthPassRate7 = 0;
|
||||||
this.monthPassRate10 = 0;
|
that.monthPassRate10 = 0;
|
||||||
let start_date = that.year_s + "-" + that.month_s + "-01";
|
let start_date = that.year_s + "-" + that.month_s + "-01";
|
||||||
let end_date = that.year_s + "-" + that.month_s + "-" + that.day_s;
|
let end_date = that.year_s + "-" + that.month_s + "-" + that.day_s;
|
||||||
let obj6 = {
|
let obj6 = {
|
||||||
|
|
@ -802,11 +793,11 @@ export default {
|
||||||
rate = (sum_ok / sum_real) * 100;
|
rate = (sum_ok / sum_real) * 100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.monthPassRate7 = Math.round(rate);
|
that.monthPassRate7 = Math.round(rate);
|
||||||
});
|
});
|
||||||
//10车间本月合格率
|
//10车间本月合格率
|
||||||
that.$API.bi.dataset.exec.req("lineMonth", obj10).then((res10) => {
|
that.$API.bi.dataset.exec.req("lineMonth", obj10).then((res10) => {
|
||||||
this.monthPassRate10 = 0;
|
that.monthPassRate10 = 0;
|
||||||
let sum_ok_10 = 0,
|
let sum_ok_10 = 0,
|
||||||
sum_real_10 = 0,
|
sum_real_10 = 0,
|
||||||
rate_10 = 0;
|
rate_10 = 0;
|
||||||
|
|
@ -820,7 +811,7 @@ export default {
|
||||||
rate_10 = (sum_ok_10 / sum_real_10) * 100;
|
rate_10 = (sum_ok_10 / sum_real_10) * 100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.monthPassRate10 = Math.round(rate_10);
|
that.monthPassRate10 = Math.round(rate_10);
|
||||||
});
|
});
|
||||||
//6车间本月交付数
|
//6车间本月交付数
|
||||||
that.$API.bi.dataset.exec.req("saleOutMonth", obj6).then((res6) => {
|
that.$API.bi.dataset.exec.req("saleOutMonth", obj6).then((res6) => {
|
||||||
|
|
@ -833,7 +824,7 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.monthPayNum6 = sum6;
|
that.monthPayNum6 = sum6;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getProductStatistic() {
|
getProductStatistic() {
|
||||||
|
|
@ -844,7 +835,7 @@ export default {
|
||||||
query: {
|
query: {
|
||||||
start_date: start_date,
|
start_date: start_date,
|
||||||
end_date: end_date,
|
end_date: end_date,
|
||||||
dept_name: this.deptName,
|
dept_name: that.deptName,
|
||||||
group_bys_material: "",
|
group_bys_material: "",
|
||||||
order_bys_material: "",
|
order_bys_material: "",
|
||||||
select_cols_material: "",
|
select_cols_material: "",
|
||||||
|
|
@ -871,14 +862,14 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.hgNumber = ((hgNumber / xAxisData.length) *100).toFixed(2);
|
that.hgNumber = ((hgNumber / xAxisData.length) *100).toFixed(2);
|
||||||
this.chartData = chartData;
|
that.chartData = chartData;
|
||||||
this.option.xAxis.data = xAxisData;
|
that.option.xAxis.data = xAxisData;
|
||||||
this.option.series.data = chartData;
|
that.option.series.data = chartData;
|
||||||
//柱状图
|
//柱状图
|
||||||
var dom = document.getElementById("barCharts");
|
var dom = document.getElementById("barCharts");
|
||||||
var myChart = echarts.init(dom);
|
var myChart = echarts.init(dom);
|
||||||
myChart.setOption(this.option, true);
|
myChart.setOption(that.option, true);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
deptNameChange() {
|
deptNameChange() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue