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 => { dataList.forEach(ite => {
if (nameList.indexOf(ite.物料名) > -1) { } else { if (nameList.indexOf(ite.物料名) > -1) { } else {
nameList.push(ite.物料名); nameList.push(ite.物料名);
seriesData.push([]) seriesData.push([0,0,0,0,0,0,0,0,0,0,0,0])
} }
}) })
dataList.forEach(item => { dataList.forEach(item => {

View File

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

View File

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