数据大屏为昨日周所在数据
This commit is contained in:
parent
a85dca660f
commit
348bd899d5
|
@ -379,9 +379,18 @@ export default {
|
||||||
let cDate = new Date();
|
let cDate = new Date();
|
||||||
let yesterday = new Date(cDate.getTime()-ondDayTime);
|
let yesterday = new Date(cDate.getTime()-ondDayTime);
|
||||||
let week = yesterday.getDay();//当前时间的week数
|
let week = yesterday.getDay();//当前时间的week数
|
||||||
// let time = ' 星期' + '日一二三四五六'.charAt(week);//当前时间周几
|
console.log(week);
|
||||||
let weekFirst = week - 1;//第一天对应的天数
|
let weekFirst = week - 1;//第一天对应的天数
|
||||||
let weekLast = 7 - week;//最后一天对应的天数
|
let weekLast = 7 - week;//最后一天对应的天数
|
||||||
|
if(week==0){
|
||||||
|
weekFirst = 6;
|
||||||
|
weekLast = 0;//周日特殊处理
|
||||||
|
}else{
|
||||||
|
weekFirst = week - 1;
|
||||||
|
weekLast = 7 - week;
|
||||||
|
}
|
||||||
|
// let time = ' 星期' + '日一二三四五六'.charAt(week);//当前时间周几
|
||||||
|
|
||||||
let first = new Date(new Date(yesterday.getTime() - (weekFirst * ondDayTime)));//本周周一
|
let first = new Date(new Date(yesterday.getTime() - (weekFirst * ondDayTime)));//本周周一
|
||||||
let last = new Date(new Date(yesterday.getTime() + (weekLast * ondDayTime)));//本周周日
|
let last = new Date(new Date(yesterday.getTime() + (weekLast * ondDayTime)));//本周周日
|
||||||
let dateArr = [];
|
let dateArr = [];
|
||||||
|
@ -395,6 +404,9 @@ export default {
|
||||||
this.end_date = last.getFullYear() + '-' + (last.getMonth() + 1) + '-' + last.getDate();
|
this.end_date = last.getFullYear() + '-' + (last.getMonth() + 1) + '-' + last.getDate();
|
||||||
// let yesterday = new Date(cDate.getTime()-ondDayTime);
|
// let yesterday = new Date(cDate.getTime()-ondDayTime);
|
||||||
this.yesterday = yesterday.getFullYear()+"-" + (yesterday.getMonth()+1) + "-" + yesterday.getDate();
|
this.yesterday = yesterday.getFullYear()+"-" + (yesterday.getMonth()+1) + "-" + yesterday.getDate();
|
||||||
|
console.log(this.start_date);
|
||||||
|
console.log(this.end_date);
|
||||||
|
console.log(this.yesterday);
|
||||||
this.getsaleOut();
|
this.getsaleOut();
|
||||||
this.getPlanRate();
|
this.getPlanRate();
|
||||||
this.getMaterialList();
|
this.getMaterialList();
|
||||||
|
|
|
@ -39,11 +39,9 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="16">
|
<el-col :lg="16">
|
||||||
<el-table :data="tableData7">
|
<el-table :data="tableData7">
|
||||||
<el-table-column label="年" prop="年">
|
<el-table-column label="年" prop="年" v-if="queryType=='年'">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="月" prop="月" v-if="queryType=='年'">
|
<el-table-column label="月" prop="月" v-else>
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="周" prop="周" v-else>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="出料数" prop="出料数">
|
<el-table-column label="出料数" prop="出料数">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -79,11 +77,9 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="16">
|
<el-col :lg="16">
|
||||||
<el-table :data="tableData10">
|
<el-table :data="tableData10">
|
||||||
<el-table-column label="年" prop="年">
|
<el-table-column label="年" prop="年" v-if="queryType=='年'">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="月" prop="月" v-if="queryType=='年'">
|
<el-table-column label="月" prop="月" v-else>
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="周" prop="周" v-else>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="出料数" prop="生产数">
|
<el-table-column label="出料数" prop="生产数">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -123,11 +119,9 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="16">
|
<el-col :lg="16">
|
||||||
<el-table :data="tableData8">
|
<el-table :data="tableData8">
|
||||||
<el-table-column label="年" prop="年">
|
<el-table-column label="年" prop="年" v-if="queryType=='年'">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="月" prop="月" v-if="queryType=='年'">
|
<el-table-column label="月" prop="月" v-else>
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="周" prop="周" v-else>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="出料数" prop=" 生产数">
|
<el-table-column label="出料数" prop=" 生产数">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -283,23 +277,24 @@
|
||||||
getData(){
|
getData(){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.tableData8 = [];
|
that.tableData8 = [];
|
||||||
let exec = that.queryType=='月'?'lineWeek':'lineMonth';
|
let exec = that.queryType=='月'?'lineMonth':'lineYear';
|
||||||
let obj = {
|
let obj = {
|
||||||
query: { start_date: this.start_date, end_date: this.end_date, dept_name: "8车间" },
|
query: { start_date: this.start_date, end_date: this.end_date, dept_name: "8车间" },
|
||||||
};
|
};
|
||||||
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
|
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
|
||||||
console.log('退火车间统计:',res);
|
console.log('退火车间统计:',res);
|
||||||
if(res.length>0){
|
let data = res.data2.ds0;
|
||||||
that.tableData8 = res;
|
if(data.length>0){
|
||||||
that.option1.series.data[0].value = res[0].合格数;
|
that.tableData8 = data;
|
||||||
that.option1.series.data[1].value = res[0].弯曲;
|
that.option1.series.data[0].value = data[0].合格数;
|
||||||
that.option1.series.data[2].value = res[0].条纹;
|
that.option1.series.data[1].value = data[0].弯曲;
|
||||||
that.option1.series.data[3].value = res[0].断裂;
|
that.option1.series.data[2].value = data[0].条纹;
|
||||||
that.option1.series.data[4].value = res[0].偏壁;
|
that.option1.series.data[3].value = data[0].断裂;
|
||||||
that.option1.series.data[5].value = res[0].大小头;
|
that.option1.series.data[4].value = data[0].偏壁;
|
||||||
that.option1.series.data[6].value = res[0].结石;
|
that.option1.series.data[5].value = data[0].大小头;
|
||||||
that.option1.series.data[7].value = res[0].气线;
|
that.option1.series.data[6].value = data[0].结石;
|
||||||
that.option1.series.data[8].value = res[0].箱中破;
|
that.option1.series.data[7].value = data[0].气线;
|
||||||
|
that.option1.series.data[8].value = data[0].箱中破;
|
||||||
}
|
}
|
||||||
// debugger;
|
// debugger;
|
||||||
});
|
});
|
||||||
|
@ -310,17 +305,18 @@
|
||||||
let obj = {
|
let obj = {
|
||||||
query: { start_date: this.start_date, end_date: this.end_date, dept_name: "7车间" },
|
query: { start_date: this.start_date, end_date: this.end_date, dept_name: "7车间" },
|
||||||
};
|
};
|
||||||
let exec = that.queryType=='月'?'lineWeek':'lineMonth';
|
let exec = that.queryType=='月'?'lineMonth':'lineYear';
|
||||||
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
|
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
|
||||||
console.log('7生产车间统计:',res);
|
console.log('7生产车间统计:',res);
|
||||||
if(res.length>0){
|
let data = res.data2.ds0;
|
||||||
that.tableData7 = res;
|
if(data.length>0){
|
||||||
that.option1.series.data[0].value = res[0].合格数;
|
that.tableData7 = data;
|
||||||
that.option1.series.data[1].value = res[0].炸纹;
|
that.option1.series.data[0].value = data[0].合格数;
|
||||||
that.option1.series.data[2].value = res[0].条纹;
|
that.option1.series.data[1].value = data[0].炸纹;
|
||||||
that.option1.series.data[3].value = res[0].气泡;
|
that.option1.series.data[2].value = data[0].条纹;
|
||||||
that.option1.series.data[4].value = res[0].弯曲;
|
that.option1.series.data[3].value = data[0].气泡;
|
||||||
that.option1.series.data[5].value = res[0].其他;
|
that.option1.series.data[4].value = data[0].弯曲;
|
||||||
|
that.option1.series.data[5].value = data[0].其他;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -328,20 +324,21 @@
|
||||||
let that = this;
|
let that = this;
|
||||||
that.tableData10 = [];
|
that.tableData10 = [];
|
||||||
let obj = {
|
let obj = {
|
||||||
query: { start_date: this.start_date, end_date: this.end_date, dept_name: "10·车间" },
|
query: { start_date: this.start_date, end_date: this.end_date, dept_name: "10车间" },
|
||||||
};
|
};
|
||||||
let exec = that.queryType=='月'?'lineWeek':'lineMonth';
|
let exec = that.queryType=='月'?'lineMonth':'lineYear';
|
||||||
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
|
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
|
||||||
console.log('10生产车间统计:',res);
|
console.log('10生产车间统计:',res);
|
||||||
if(res.length>0){
|
let data = res.data2.ds0;
|
||||||
that.tableData10 = res;
|
if(data.length>0){
|
||||||
that.option2.series.data[0].value = res[0].合格数;
|
that.tableData10 = data;
|
||||||
that.option2.series.data[1].value = res[0].断裂;
|
that.option2.series.data[0].value = data[0].合格数;
|
||||||
that.option2.series.data[2].value = res[0].条纹;
|
that.option2.series.data[1].value = data[0].断裂;
|
||||||
that.option2.series.data[3].value = res[0].偏壁;
|
that.option2.series.data[2].value = data[0].条纹;
|
||||||
that.option2.series.data[4].value = res[0].大小头;
|
that.option2.series.data[3].value = data[0].偏壁;
|
||||||
that.option2.series.data[5].value = res[0].结石;
|
that.option2.series.data[4].value = data[0].大小头;
|
||||||
that.option2.series.data[6].value = res[0].气线;
|
that.option2.series.data[5].value = data[0].结石;
|
||||||
|
that.option2.series.data[6].value = data[0].气线;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue