fix:统计

This commit is contained in:
shijing 2025-04-11 10:02:34 +08:00
parent 141d7db185
commit 3af6b66647
3 changed files with 18 additions and 19 deletions

View File

@ -207,7 +207,7 @@ export default {
dataList.forEach(ite => {
if (nameList.indexOf(ite.物料名) > -1) { } else {
nameList.push(ite.物料名);
seriesData.push([])
seriesData.push([0,0,0,0,0,0,0,0,0,0,0,0])
}
})
dataList.forEach(item => {

View File

@ -203,6 +203,7 @@ export default {
is_count_utask: -1,
select_cols_mgroup: ", mgroup.name AS 工段",
group_bys_mgroup: ", mgroup.name",
order_bys_mgroup:",工段"
},
raise_exception: true,
};

View File

@ -35,9 +35,9 @@
<el-card shadow="never" style="margin-bottom: 8px;">
<el-header>
<div class="right-panel">
<h2>各工检验</h2>
<el-select v-model="process" clearable @change="processChange">
<el-option v-for="item in processOption"
<h2>各工检验</h2>
<el-select v-model="mgroup" clearable @change="mgroupChange">
<el-option v-for="item in mgroupOption"
:key="item.id"
:label="item.name"
:value="item.id"
@ -125,9 +125,9 @@
}
]
},
process:'',
processName:'',
processOption:[],
mgroup:'',
mgroupName:'',
mgroupOption:[],
tableData:[],
}
},
@ -143,23 +143,23 @@
this.queryDate = year + '-' + month;
this.start_date =year+'-'+month+'-01';
this.end_date = year+'-'+month+'-'+new Date(year, month, 0).getDate();
this.getProcess();
this.getMgroup();
},
methods:{
queryTypeChange(value){
console.log(value)
this.queryDate = '';
},
getProcess(){
this.$API.mtm.process.list.req({cate:'粗加工',page:0}).then((res) => {
this.processOption = res;
this.process = res[0].id;
this.processName = res[0].name;
getMgroup(){
this.$API.mtm.mgroup.list.req({belong_dept__name:'6车间',page:0}).then((res) => {
this.mgroupOption = res;
this.mgroup = res[0].id;
this.mgroupName = res[0].name;
this.getData();
});
},
processChange() {
this.processName = this.processOption.find(item => item.id === this.process).name;
mgroupChange() {
this.mgroupName = this.mgroupOption.find(item => item.id === this.mgroup).name;
this.getData();
},
getData(){
@ -169,7 +169,7 @@
query: {
end_date: that.end_date,
start_date: that.start_date,
mgroup_name: that.processName,group_bys_mgroup: ", mgroup.name",
mgroup_name: that.mgroupName,group_bys_mgroup: ", mgroup.name",
group_bys_material: "",order_bys_material: "",
select_cols_mgroup: ", mgroup.name AS 工段",
select_cols_material: "",
@ -178,7 +178,6 @@
};
//echarts
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
console.log('获取echarts数据:', res);
if (res.data2.ds0) {
let data = res.data2.ds0;
let seriesData = [
@ -201,14 +200,13 @@
})
})
}
console.log('seriesData:', seriesData);
that.option1.series[0].data = seriesData;
}
});
let obj2 = {
query: {
start_date: that.start_date, end_date: that.end_date,
mgroup_name: that.processName,group_bys_mgroup: ", mgroup.name",
mgroup_name: that.mgroupName,group_bys_mgroup: ", mgroup.name",
select_cols_mgroup: ", mgroup.name AS 工段",
is_count_utask: -1
},