From 4ed5be41e6bfe5de387b763e85cdb70463bcf784 Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 9 Jul 2025 16:00:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=8E=BB=E7=BA=A4=E8=BD=A6=E9=97=B4?= =?UTF-8?q?=E7=9C=8B=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bigScreen/bxerp/jiejingdept.vue | 199 ++++++++------ src/views/bigScreen/bxerp/jiejingdept2.vue | 212 +++++++------- src/views/bigScreen/bxerp/lengjiagongdept.vue | 219 ++++++++------- src/views/bigScreen/bxerp/niuzhuandept.vue | 258 +++++++++-------- src/views/bigScreen/bxerp/reyadept.vue | 259 ++++++++++-------- 5 files changed, 621 insertions(+), 526 deletions(-) diff --git a/src/views/bigScreen/bxerp/jiejingdept.vue b/src/views/bigScreen/bxerp/jiejingdept.vue index cc07aad6..5a7ecea7 100644 --- a/src/views/bigScreen/bxerp/jiejingdept.vue +++ b/src/views/bigScreen/bxerp/jiejingdept.vue @@ -121,7 +121,8 @@
每个人日产量
- + +
@@ -141,6 +142,7 @@ import * as echarts from "echarts"; import { runningStateEnum } from "@/utils/enum.js"; import scScrollTavle from "@/components/scScrollTable.vue"; +import { name } from "babylonjs-gui"; function deepCopy(obj) { return JSON.parse(JSON.stringify(obj)); } @@ -381,7 +383,15 @@ export default { data:[] }, config_left1:{ - data:[] + data:[ + {name:'洗棒',value:0}, + {name:'捆棒',value:0}, + {name:'拉单丝',value:0}, + {name:'捆一次棒',value:0}, + {name:'一次复丝',value:0}, + {name:'捆二次棒',value:0}, + {name:'二次复丝',value:0}, + ] } , config_left2:{ data:[] @@ -402,35 +412,36 @@ export default { header: ['设备名称','设备位号','设备状态','运行状态','所在工段'], data: [] }, + config_right_top:{ + rowNum:10, + headerBGC: 'rgba(47,102,107,.34)', + oddRowBGC: 'rgba(0,0,0,0)', + evenRowBGC: 'rgba(0,0,0,0)', + header: ['工段','姓名','生产数','合格数','不合格数'], + data: [] + }, currentTime: "", currentDay: "", today: "", end_time:'', start_time:'', + mgroups:['洗棒','捆棒','拉单丝','捆一次棒','一次复丝','捆二次棒','二次复丝'], }; }, mounted() { + let that = this; + //洗棒、捆棒、拉丝 :洗棒、捆棒、拉单丝、捆一次棒、一次复丝、捆二次棒、二次复丝 this.showTime(); this.dayInterval = setInterval(() => { this.showTime(); }, 1000); - let userInfo = this.$TOOL.data.get("USER_INFO"); - this.deptId = userInfo.belong_dept; - this.deptName = userInfo.belong_dept_name; - this.getMgroups(); - this.$nextTick(() => { - //车间各个工段生产产品的数量:每个工段的已完成 - // this.getmgroupMaterial(); - //车间工段任务展示:各个工段的任务列表 - this.getMtask1(); - //设备列表:各个工段的设备列表 - this.getEquipment(); - //每个人日生产量:个人绩效 - this.getCount(); - //车间整体产品统计:最后一个工序的产品统计 - //产品占比:最后一个工序的产品占比 - // this.getMaterials();// this.getmgroupMaterial(); - }) + that.mgroupsforEach(); + that.getMgroups(); + //每个人日生产量:个人绩效 + // that.getEveryoneCount(that.deptName1); + // that.getEveryoneCount(that.deptName2); + // that.getEveryoneCount(that.deptName3); + that.materialAll(); }, methods: { getMondayOfCurrentWeek() { @@ -470,25 +481,28 @@ export default { }, getMgroups(){ let that = this; - that.$API.mtm.mgroup.list.req({belong_dept:that.deptId,page:0}).then((res) => { - if(res.length > 0){ - res.forEach((item,inde)=>{ - that.mgroupsId += item.id + ','; - that.getmgroupMaterial(item); - //未完成的物料 - if(inde==res.length-1){ - that.getLastmgroupMaterial(item); - } - - }) - } - }); + let params = {page: 0,query:" { id, name }"}; + that.$API.mtm.mgroup.list.req(params).then((res) => { + res.forEach((item)=>{ + let index = that.mgroups.indexOf(item.name); + if(index>-1){ + that.getmgroupMaterial(item.id,item.name,index); + } + }) + }) + }, + mgroupsforEach(){ + let that = this; + that.mgroups.forEach((item)=>{ + that.getEquipment(item); + that.getMtask1(item); + }) }, //任务进度 - getMtask1() { + getMtask1(name) { let that = this; let params = { - state: 20,mgroup__belong_dept: that.deptId,page:0, + state: 20,mgroup__name: name,page:0, query: " { id, material_out_name, number, count, count_ok }" }; that.config_middle_top.data = []; @@ -507,58 +521,21 @@ export default { }); }, //库存统计列表 - getmgroupMaterial(item) { + getmgroupMaterial(id,name,index) { let that = this; - let params = { tag: 'done',page_size:1,mgroup: item.id }; + let params = { tag: 'done',page:0,mgroup: id }; that.$API.wpm.wmaterial.list.req(params).then((res) => { - let obj = {}; - obj.name = item.name; - obj.value = res.count; - that.config_left1.data.push(obj); + let count = 0; + res.forEach((item) => { + count += Number(item.count); + }) + that.config_left1.data[index].value = count; }) }, - getLastmgroupMaterial(item){ + //车间设备列表 + getEquipment(name) { let that = this; - let params = { - tag: 'done',page:0,mgroup: item.id , - // query: " { id, material_name }" - }; - that.$API.wpm.wmaterial.list.req(params).then((res) => { - if(res.length>0){ - let namelist = [],valuelist = [],values=[]; - res.forEach((item)=>{ - let index = namelist.indexOf(item.material_.name); - if(index==-1){ - namelist.push(item.material_.name); - valuelist.push(1); - values.push(1); - }else{ - valuelist[index] += 1; - values[index] += 1; - } - }) - let maxNum = valuelist.sort((a, b) => b - a)[0]+2; - let arr = []; - valuelist.forEach((item)=>{ - arr.push(maxNum) - }) - that.chartOption2.yAxis[0].data = namelist; - that.chartOption2.yAxis[1].data = valuelist; - that.chartOption2.series[0].data = valuelist; - that.chartOption2.series[1].data = arr; - namelist.forEach((item,index)=>{ - let obj = {}; - obj.name = item; - obj.value = valuelist[index]; - that.config_left2.data.push(obj); - }) - } - }) - }, - getEquipment() { - let that = this; - let params = { - page: 0, belong_dept:that.deptId, + let params = {page: 0, mgroup__name:name, // query: " { id, name, number, model, state ,mgroup_name }" }; that.config_middle_bottom.data = []; @@ -578,23 +555,67 @@ export default { } }) }, - getCount(){ + //每个人日产量 + getEveryoneCount(deptName){ let that = this; + that.config_right_top.data = []; let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd"); let params = { - query: {start_date:date,end_date:date,dept_name:that.deptName}, - // query: {start_date:'2025-06-11',end_date:'2025-06-11',dept_name:that.deptName}, + // query: {start_date:date,end_date:date,dept_name:that.deptName}, + query: {start_date:'2025-05-04',end_date:'2025-05-04',dept_name:deptName}, }; - let namelist = [],valuelist = []; this.$API.bi.dataset.exec.req("performance", params).then((res) => { if(res.data2.ds0.length>0){ res.data2.ds0.forEach((item)=>{ - namelist.push(item.操作人); - valuelist.push(item.合格数); + let arr = []; + arr[0] = item.工段; + arr[1] = item.操作人; + arr[2] = item.生产数; + arr[3] = item.合格数; + arr[4] = item.不合格数; + that.config_right_top.data.push(arr); + }) + } + }); + }, + //车间整体产品统计 + materialAll(){ + let that = this; + let obj = {}; + that.$API.bi.dataset.exec.req("materialCount", obj).then((res) => { + if (res.data2.ds0&&res.data2.ds0.length>0) { + let arrs = res.data2.ds0; + let list = arrs.filter((item) => { + return item.dept_name == that.deptName1||item.dept_name == that.deptName2||item.dept_name == that.deptName3; + }); + let namelist = [],valuelist = [],values=[]; + if(list.length>0){ + list.forEach((item) => { + let index = namelist.indexOf(item.material_name); + if(index==-1){ + namelist.push(item.material_name); + valuelist.push(item.count); + values.push(item.count); + } + }) + } + let maxNum = valuelist.sort((a, b) => b - a)[0]+2; + let arr = []; + valuelist.forEach((item)=>{ + arr.push(maxNum) + }) + that.chartOption2.yAxis[0].data = namelist; + that.chartOption2.yAxis[1].data = valuelist; + that.chartOption2.series[0].data = valuelist; + that.chartOption2.series[1].data = arr; + + namelist.forEach((item,index)=>{ + let obj = {}; + obj.name = item; + obj.value = valuelist[index]; + that.config_left2.data.push(obj); }) } - that.chartOption1.xAxis.data = namelist; - that.chartOption1.series.data = valuelist; }); }, }, diff --git a/src/views/bigScreen/bxerp/jiejingdept2.vue b/src/views/bigScreen/bxerp/jiejingdept2.vue index 4422f508..45cda5fb 100644 --- a/src/views/bigScreen/bxerp/jiejingdept2.vue +++ b/src/views/bigScreen/bxerp/jiejingdept2.vue @@ -121,7 +121,8 @@
每个人日产量
- + +
@@ -141,6 +142,7 @@ import * as echarts from "echarts"; import { runningStateEnum } from "@/utils/enum.js"; import scScrollTavle from "@/components/scScrollTable.vue"; +import { name } from "babylonjs-gui"; function deepCopy(obj) { return JSON.parse(JSON.stringify(obj)); } @@ -381,7 +383,12 @@ export default { data:[] }, config_left1:{ - data:[] + data:[ + {name:'排一次棒',value:0}, + {name:'排二次棒',value:0}, + {name:'切丝',value:0}, + {name:'排板',value:0}, + ] } , config_left2:{ data:[] @@ -402,51 +409,36 @@ export default { header: ['设备名称','设备位号','设备状态','运行状态','所在工段'], data: [] }, + config_right_top:{ + rowNum:10, + headerBGC: 'rgba(47,102,107,.34)', + oddRowBGC: 'rgba(0,0,0,0)', + evenRowBGC: 'rgba(0,0,0,0)', + header: ['工段','姓名','生产数','合格数','不合格数'], + data: [] + }, currentTime: "", currentDay: "", today: "", end_time:'', start_time:'', + mgroups:['排一次棒','排二次棒','切丝','排板'], }; }, mounted() { + let that = this; + //排棒、切丝、排板 :排一次棒、排二次棒、切丝、排板 this.showTime(); this.dayInterval = setInterval(() => { this.showTime(); }, 1000); - //近七天的日期数组 - // let daysArr = this.getMondayOfCurrentWeek(); - // this.daysArr = daysArr; - // let xAxisData = []; - // daysArr.forEach((item)=>{ - // let dates = item.split('-'); - // let obj = dates[1]+'-'+dates[2]; - // xAxisData.push(obj); - // }) - // this.xAxisData = xAxisData; - // let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24); - // let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24); - // let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd hh:mm:ss"); - // let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd hh:mm:ss"); - // this.start_time = start_time; - // this.end_time = end_time; - let userInfo = this.$TOOL.data.get("USER_INFO"); - this.deptId = userInfo.belong_dept; - this.deptName = userInfo.belong_dept_name; - this.getMgroups(); - this.$nextTick(() => { - //车间各个工段生产产品的数量:每个工段的已完成 - // this.getmgroupMaterial(); - //车间工段任务展示:各个工段的任务列表 - this.getMtask1(); - //设备列表:各个工段的设备列表 - this.getEquipment(); - //每个人日生产量:个人绩效 - this.getCount(); - //车间整体产品统计:最后一个工序的产品统计 - //产品占比:最后一个工序的产品占比 - // this.getMaterials();// this.getmgroupMaterial(); - }) + that.mgroupsforEach(); + that.getMgroups(); + //每个人日生产量:个人绩效 + // that.getEveryoneCount(that.deptName1); + // that.getEveryoneCount(that.deptName2); + // that.getEveryoneCount(that.deptName3); + that.materialAll(); }, methods: { getMondayOfCurrentWeek() { @@ -486,25 +478,28 @@ export default { }, getMgroups(){ let that = this; - that.$API.mtm.mgroup.list.req({belong_dept:that.deptId,page:0}).then((res) => { - if(res.length > 0){ - res.forEach((item,inde)=>{ - that.mgroupsId += item.id + ','; - that.getmgroupMaterial(item); - //未完成的物料 - if(inde==res.length-1){ - that.getLastmgroupMaterial(item); - } - - }) - } - }); + let params = {page: 0,query:" { id, name }"}; + that.$API.mtm.mgroup.list.req(params).then((res) => { + res.forEach((item)=>{ + let index = that.mgroups.indexOf(item.name); + if(index>-1){ + that.getmgroupMaterial(item.id,item.name,index); + } + }) + }) + }, + mgroupsforEach(){ + let that = this; + that.mgroups.forEach((item)=>{ + that.getEquipment(item); + that.getMtask1(item); + }) }, //任务进度 - getMtask1() { + getMtask1(name) { let that = this; let params = { - state: 20,mgroup__belong_dept: that.deptId,page:0, + state: 20,mgroup__name: name,page:0, query: " { id, material_out_name, number, count, count_ok }" }; that.config_middle_top.data = []; @@ -523,58 +518,21 @@ export default { }); }, //库存统计列表 - getmgroupMaterial(item) { + getmgroupMaterial(id,name,index) { let that = this; - let params = { tag: 'done',page_size:1,mgroup: item.id }; + let params = { tag: 'done',page:0,mgroup: id }; that.$API.wpm.wmaterial.list.req(params).then((res) => { - let obj = {}; - obj.name = item.name; - obj.value = res.count; - that.config_left1.data.push(obj); + let count = 0; + res.forEach((item) => { + count += Number(item.count); + }) + that.config_left1.data[index].value = count; }) }, - getLastmgroupMaterial(item){ + //车间设备列表 + getEquipment(name) { let that = this; - let params = { - tag: 'done',page:0,mgroup: item.id , - // query: " { id, material_name }" - }; - that.$API.wpm.wmaterial.list.req(params).then((res) => { - if(res.length>0){ - let namelist = [],valuelist = [],values=[]; - res.forEach((item)=>{ - let index = namelist.indexOf(item.material_.name); - if(index==-1){ - namelist.push(item.material_.name); - valuelist.push(1); - values.push(1); - }else{ - valuelist[index] += 1; - values[index] += 1; - } - }) - let maxNum = valuelist.sort((a, b) => b - a)[0]+2; - let arr = []; - valuelist.forEach((item)=>{ - arr.push(maxNum) - }) - that.chartOption2.yAxis[0].data = namelist; - that.chartOption2.yAxis[1].data = valuelist; - that.chartOption2.series[0].data = valuelist; - that.chartOption2.series[1].data = arr; - namelist.forEach((item,index)=>{ - let obj = {}; - obj.name = item; - obj.value = valuelist[index]; - that.config_left2.data.push(obj); - }) - } - }) - }, - getEquipment() { - let that = this; - let params = { - page: 0, belong_dept:that.deptId, + let params = {page: 0, mgroup__name:name, // query: " { id, name, number, model, state ,mgroup_name }" }; that.config_middle_bottom.data = []; @@ -594,23 +552,67 @@ export default { } }) }, - getCount(){ + //每个人日产量 + getEveryoneCount(deptName){ let that = this; + that.config_right_top.data = []; let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd"); let params = { - query: {start_date:date,end_date:date,dept_name:that.deptName}, - // query: {start_date:'2025-06-11',end_date:'2025-06-11',dept_name:that.deptName}, + // query: {start_date:date,end_date:date,dept_name:that.deptName}, + query: {start_date:'2025-05-04',end_date:'2025-05-04',dept_name:deptName}, }; - let namelist = [],valuelist = []; this.$API.bi.dataset.exec.req("performance", params).then((res) => { if(res.data2.ds0.length>0){ res.data2.ds0.forEach((item)=>{ - namelist.push(item.操作人); - valuelist.push(item.合格数); + let arr = []; + arr[0] = item.工段; + arr[1] = item.操作人; + arr[2] = item.生产数; + arr[3] = item.合格数; + arr[4] = item.不合格数; + that.config_right_top.data.push(arr); + }) + } + }); + }, + //车间整体产品统计 + materialAll(){ + let that = this; + let obj = {}; + that.$API.bi.dataset.exec.req("materialCount", obj).then((res) => { + if (res.data2.ds0&&res.data2.ds0.length>0) { + let arrs = res.data2.ds0; + let list = arrs.filter((item) => { + return item.dept_name == that.deptName1||item.dept_name == that.deptName2||item.dept_name == that.deptName3; + }); + let namelist = [],valuelist = [],values=[]; + if(list.length>0){ + list.forEach((item) => { + let index = namelist.indexOf(item.material_name); + if(index==-1){ + namelist.push(item.material_name); + valuelist.push(item.count); + values.push(item.count); + } + }) + } + let maxNum = valuelist.sort((a, b) => b - a)[0]+2; + let arr = []; + valuelist.forEach((item)=>{ + arr.push(maxNum) + }) + that.chartOption2.yAxis[0].data = namelist; + that.chartOption2.yAxis[1].data = valuelist; + that.chartOption2.series[0].data = valuelist; + that.chartOption2.series[1].data = arr; + + namelist.forEach((item,index)=>{ + let obj = {}; + obj.name = item; + obj.value = valuelist[index]; + that.config_left2.data.push(obj); }) } - that.chartOption1.xAxis.data = namelist; - that.chartOption1.series.data = valuelist; }); }, }, diff --git a/src/views/bigScreen/bxerp/lengjiagongdept.vue b/src/views/bigScreen/bxerp/lengjiagongdept.vue index 2e0857bf..bbdb6995 100644 --- a/src/views/bigScreen/bxerp/lengjiagongdept.vue +++ b/src/views/bigScreen/bxerp/lengjiagongdept.vue @@ -121,7 +121,8 @@
每个人日产量
- + +
@@ -402,51 +403,51 @@ export default { header: ['设备名称','设备位号','设备状态','运行状态','所在工段'], data: [] }, + config_right_top:{ + rowNum:10, + headerBGC: 'rgba(47,102,107,.34)', + oddRowBGC: 'rgba(0,0,0,0)', + evenRowBGC: 'rgba(0,0,0,0)', + header: ['工段','姓名','生产数','合格数','不合格数'], + data: [] + }, currentTime: "", currentDay: "", today: "", end_time:'', start_time:'', + deptName1: "毛坯加工班组", + deptName2: "辅助班组", + deptName3: "精雕机班组", + deptName4: "成品精加工班组", }; }, mounted() { + let that = this; this.showTime(); this.dayInterval = setInterval(() => { this.showTime(); }, 1000); - //近七天的日期数组 - // let daysArr = this.getMondayOfCurrentWeek(); - // this.daysArr = daysArr; - // let xAxisData = []; - // daysArr.forEach((item)=>{ - // let dates = item.split('-'); - // let obj = dates[1]+'-'+dates[2]; - // xAxisData.push(obj); - // }) - // this.xAxisData = xAxisData; - // let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24); - // let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24); - // let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd hh:mm:ss"); - // let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd hh:mm:ss"); - // this.start_time = start_time; - // this.end_time = end_time; - let userInfo = this.$TOOL.data.get("USER_INFO"); - this.deptId = userInfo.belong_dept; - this.deptName = userInfo.belong_dept_name; - this.getMgroups(); - this.$nextTick(() => { - //车间各个工段生产产品的数量:每个工段的已完成 - // this.getmgroupMaterial(); - //车间工段任务展示:各个工段的任务列表 - this.getMtask1(); - //设备列表:各个工段的设备列表 - this.getEquipment(); - //每个人日生产量:个人绩效 - this.getCount(); - //车间整体产品统计:最后一个工序的产品统计 - //产品占比:最后一个工序的产品占比 - // this.getMaterials();// this.getmgroupMaterial(); - }) + that.materialAll(); + that.getMgroups(that.deptName1); + that.getMgroups(that.deptName2); + that.getMgroups(that.deptName3); + that.getMgroups(that.deptName4); + //设备列表:各个工段的设备列表 + that.getEquipment(that.deptName1); + that.getEquipment(that.deptName2); + that.getEquipment(that.deptName3); + that.getEquipment(that.deptName4); + //每个人日生产量:个人绩效 + that.getEveryoneCount(that.deptName1); + that.getEveryoneCount(that.deptName2); + that.getEveryoneCount(that.deptName3); + that.getEveryoneCount(that.deptName4); + //任务进度 + that.getMtask1(that.deptName1); + that.getMtask1(that.deptName2); + that.getMtask1(that.deptName3); + that.getMtask1(that.deptName4); }, methods: { getMondayOfCurrentWeek() { @@ -484,27 +485,25 @@ export default { }, 500); return myChart; }, - getMgroups(){ + //获取工段列表 + getMgroups(deptName){ let that = this; - that.$API.mtm.mgroup.list.req({belong_dept:that.deptId,page:0}).then((res) => { + that.$API.mtm.mgroup.list.req({belong_dept__name:deptName,page:0}).then((res) => { if(res.length > 0){ - res.forEach((item,inde)=>{ - that.mgroupsId += item.id + ','; - that.getmgroupMaterial(item); - //未完成的物料 - if(inde==res.length-1){ - that.getLastmgroupMaterial(item); - } - + res.forEach((item)=>{ + that.mgroupsId += item.id + ','; + that.getmgroupMaterial(item.name); + //工段太多了,暂时不显示全部,只显示有数据的工段 + // that.config_left1.data.push({name:item.name,value:0}); }) } }); }, //任务进度 - getMtask1() { + getMtask1(deptName) { let that = this; let params = { - state: 20,mgroup__belong_dept: that.deptId,page:0, + state: 20,mgroup__belong_dept__name: deptName,page:0, query: " { id, material_out_name, number, count, count_ok }" }; that.config_middle_top.data = []; @@ -516,66 +515,38 @@ export default { arr[1] = item.material_out_name; arr[2] = item.count; arr[3] = item.count_ok; - // arr[4] = item.count_ok/item.count*100+'%'; that.config_middle_top.data.push(arr); }) } }); }, - //库存统计列表 - getmgroupMaterial(item) { + //车间各工段生产产品数 + getmgroupMaterial(deptName) { let that = this; - let params = { tag: 'done',page_size:1,mgroup: item.id }; - that.$API.wpm.wmaterial.list.req(params).then((res) => { - let obj = {}; - obj.name = item.name; - obj.value = res.count; - that.config_left1.data.push(obj); - }) - }, - getLastmgroupMaterial(item){ - let that = this; - let params = { - tag: 'done',page:0,mgroup: item.id , - // query: " { id, material_name }" + let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd"); + let params = { + // query: {start_date:date,end_date:date,mgroup_name:item.name}, + query: {start_date:date,end_date:date,dept_name:deptName}, }; - that.$API.wpm.wmaterial.list.req(params).then((res) => { - if(res.length>0){ - let namelist = [],valuelist = [],values=[]; - res.forEach((item)=>{ - let index = namelist.indexOf(item.material_.name); - if(index==-1){ - namelist.push(item.material_.name); - valuelist.push(1); - values.push(1); - }else{ - valuelist[index] += 1; - values[index] += 1; - } - }) - let maxNum = valuelist.sort((a, b) => b - a)[0]+2; - let arr = []; - valuelist.forEach((item)=>{ - arr.push(maxNum) - }) - that.chartOption2.yAxis[0].data = namelist; - that.chartOption2.yAxis[1].data = valuelist; - that.chartOption2.series[0].data = valuelist; - that.chartOption2.series[1].data = arr; - namelist.forEach((item,index)=>{ - let obj = {}; - obj.name = item; - obj.value = valuelist[index]; - that.config_left2.data.push(obj); + this.$API.bi.dataset.exec.req("mlog_okrate", params).then((res) => { + if(res.data2.ds0.length>0){ + let data = res.data2.ds0; + data.forEach((item) => { + that.config_left1.data.forEach((obj,index2) => { + if (item.name == obj.工段){ + that.config_left1.data[index2].value = item.合格数; + } + }) }) } - }) + }); }, - getEquipment() { + //车间设备列表 + getEquipment(deptName) { let that = this; let params = { - page: 0, belong_dept:that.deptId, - // query: " { id, name, number, model, state ,mgroup_name }" + page: 0, belong_dept__name:deptName, + query: " { id, name, number, model, state ,mgroup_name,running_state }" }; that.config_middle_bottom.data = []; that.$API.em.equipment.list.req(params).then((res) => { @@ -594,23 +565,67 @@ export default { } }) }, - getCount(){ + //每个人日产量 + getEveryoneCount(deptName){ let that = this; + that.config_right_top.data = []; let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd"); let params = { - query: {start_date:date,end_date:date,dept_name:that.deptName}, - // query: {start_date:'2025-06-11',end_date:'2025-06-11',dept_name:that.deptName}, + query: {start_date:date,end_date:date,dept_name:deptName}, + // query: {start_date:'2025-05-04',end_date:'2025-05-04',dept_name:deptName}, }; - let namelist = [],valuelist = []; this.$API.bi.dataset.exec.req("performance", params).then((res) => { if(res.data2.ds0.length>0){ res.data2.ds0.forEach((item)=>{ - namelist.push(item.操作人); - valuelist.push(item.合格数); + let arr = []; + arr[0] = item.工段; + arr[1] = item.操作人; + arr[2] = item.生产数; + arr[3] = item.合格数; + arr[4] = item.不合格数; + that.config_right_top.data.push(arr); + }) + } + }); + }, + //车间整体产品统计 + materialAll(){ + let that = this; + let obj = {}; + that.$API.bi.dataset.exec.req("materialCount", obj).then((res) => { + if (res.data2.ds0&&res.data2.ds0.length>0) { + let arrs = res.data2.ds0; + let list = arrs.filter((item) => { + return item.dept_name == that.deptName1||item.dept_name == that.deptName2||item.dept_name == that.deptName3||item.dept_name == that.deptName4; + }); + let namelist = [],valuelist = [],values=[]; + if(list.length>0){ + list.forEach((item) => { + let index = namelist.indexOf(item.material_name); + if(index==-1){ + namelist.push(item.material_name); + valuelist.push(item.count); + values.push(item.count); + } + }) + } + let maxNum = valuelist.sort((a, b) => b - a)[0]+2; + let arr = []; + valuelist.forEach((item)=>{ + arr.push(maxNum) + }) + that.chartOption2.yAxis[0].data = namelist; + that.chartOption2.yAxis[1].data = valuelist; + that.chartOption2.series[0].data = valuelist; + that.chartOption2.series[1].data = arr; + + namelist.forEach((item,index)=>{ + let obj = {}; + obj.name = item; + obj.value = valuelist[index]; + that.config_left2.data.push(obj); }) } - that.chartOption1.xAxis.data = namelist; - that.chartOption1.series.data = valuelist; }); }, }, diff --git a/src/views/bigScreen/bxerp/niuzhuandept.vue b/src/views/bigScreen/bxerp/niuzhuandept.vue index 39a1298f..dcff9fd4 100644 --- a/src/views/bigScreen/bxerp/niuzhuandept.vue +++ b/src/views/bigScreen/bxerp/niuzhuandept.vue @@ -1,7 +1,7 @@