fix:合格数统计每个模块添加工段名称

This commit is contained in:
shijing 2024-09-11 16:56:19 +08:00
parent 8a1cf4a25b
commit 1cb2c30d3e
1 changed files with 1 additions and 5 deletions

View File

@ -923,6 +923,7 @@ export default {
let option = deepCopy(that.basicOption); let option = deepCopy(that.basicOption);
let query = deepCopy(that.query); let query = deepCopy(that.query);
query.mgroup_name = mgroup_name; query.mgroup_name = mgroup_name;
option.title.text = mgroup_name+"合格数统计";
let obj = {}; let obj = {};
obj.query = query; obj.query = query;
that.$API.bi.dataset.exec.req('lineDay_m', obj).then((res) => { that.$API.bi.dataset.exec.req('lineDay_m', obj).then((res) => {
@ -934,7 +935,6 @@ export default {
tableData.forEach((ite) => { tableData.forEach((ite) => {
if (nameList.indexOf(ite.物料名) > -1) {} else { if (nameList.indexOf(ite.物料名) > -1) {} else {
nameList.push(ite.物料名); nameList.push(ite.物料名);
dataList.push([]) dataList.push([])
datas.push([0,0,0,0,0,0,0]); datas.push([0,0,0,0,0,0,0]);
let obj = { let obj = {
@ -947,24 +947,20 @@ export default {
option.series.push(obj) option.series.push(obj)
} }
}); });
console.log('nameList',nameList);
that.nameList = nameList; that.nameList = nameList;
tableData.forEach((item) => { tableData.forEach((item) => {
let indexX = nameList.indexOf(item.物料名); let indexX = nameList.indexOf(item.物料名);
dataList[indexX].push(item); dataList[indexX].push(item);
}); });
console.log('dataList',dataList)
for(let i = 0;i<dataList.length;i++){ for(let i = 0;i<dataList.length;i++){
for(let j = 0;j<dataList[i].length;j++){ for(let j = 0;j<dataList[i].length;j++){
let index = that.weekDateList.indexOf(dataList[i][j].); let index = that.weekDateList.indexOf(dataList[i][j].);
datas[i][index] = dataList[i][j].合格数; //datas datas[i][index] = dataList[i][j].合格数; //datas
} }
} }
console.log('datas',datas);
for(let n=0;n<nameList.length;n++){ for(let n=0;n<nameList.length;n++){
option.series[n].data = datas[n]; option.series[n].data = datas[n];
} }
console.log('option',option);
let chartId = 'bachart'+mgroup_index; let chartId = 'bachart'+mgroup_index;
that.setChart(chartId, option); that.setChart(chartId, option);
} else { } else {