@@ -391,7 +392,7 @@ export default {
headerBGC: 'rgba(47,102,107,.34)',
oddRowBGC: 'rgba(0,0,0,0)',
evenRowBGC: 'rgba(0,0,0,0)',
- header: ['任务编号', '产出产品', '任务量', '合格数'],
+ header:['批次号','物料名称', '当前工序', '状态', '数量'],
data: []
},
config_middle_bottom:{
@@ -402,51 +403,42 @@ 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:'',
+ deptName: "扭转班组",
};
},
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.$API.system.dept.list.req({name:that.deptName,page:0}).then((res) => {
+ if(res.length > 0){
+ that.deptId = res[0].id;
+ that.getMgroups();
+ //设备列表:各个工段的设备列表
+ that.getEquipment();
+ //每个人日生产量:个人绩效
+ that.getEveryoneCount();
+ //车间库存
+ that.getInms();
+ }
})
+ //车间整体产品统计
+ that.materialAll();
},
methods: {
getMondayOfCurrentWeek() {
@@ -484,93 +476,63 @@ export default {
}, 500);
return myChart;
},
+ //车间工段列表
getMgroups(){
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:that.deptName,page:0}).then((res) => {
if(res.length > 0){
- res.forEach((item,inde)=>{
+ res.forEach((item)=>{
that.mgroupsId += item.id + ',';
- that.getmgroupMaterial(item);
- //未完成的物料
- if(inde==res.length-1){
- that.getLastmgroupMaterial(item);
- }
-
+ let obj = {};
+ obj.name = item.name;
+ obj.value = 0;
+ that.config_left1.data.push(obj);
+ that.getmgroupMaterial();
+ that.getInms(item);
})
}
});
},
- //任务进度
- getMtask1() {
+ //车间物料展示车间库存
+ getInms(item){
let that = this;
- let params = {
- state: 20,mgroup__belong_dept: that.deptId,page:0,
- query: " { id, material_out_name, number, count, count_ok }"
- };
- that.config_middle_top.data = [];
- that.$API.pm.mtask.list.req(params).then((res) => {
+ let params = { tag: 'done',page:0,mgroup: item.id };
+ that.$API.wpm.wmaterial.list.req(params).then((res) => {
if(res.length>0){
- res.forEach((item) => {
+ res.forEach((item)=>{
let arr = [];
- arr[0] = item.number;
- arr[1] = item.material_out_name;
- arr[2] = item.count;
- arr[3] = item.count_ok;
- // arr[4] = item.count_ok/item.count*100+'%';
+ arr[0] = item.batch;
+ arr[1] = item.material_.name;
+ arr[2] = item.material_.process_name;
+ arr[3] = item.state==10?'合格品':'不合格品';
+ arr[4] = item.count;
that.config_middle_top.data.push(arr);
})
}
+ })
+ },
+ //车间各工段生产产品数
+ getmgroupMaterial() {
+ let that = this;
+ 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:that.deptName},
+ };
+ 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.合格数;
+ }
+ })
+ })
+ }
});
},
- //库存统计列表
- getmgroupMaterial(item) {
- 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 }"
- };
- 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 = {
@@ -594,23 +556,89 @@ export default {
}
})
},
- getCount(){
+ //每个人日产量
+ getEveryoneCount(){
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:'2025-05-04',end_date:'2025-05-04',dept_name:that.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.deptName;
+ });
+ 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);
+ })
+ }
+ });
+ },
+ //任务进度
+ getMtask1() {
+ let that = this;
+ let params = {
+ state: 20,mgroup__belong_dept: that.deptId,page:0,
+ query: " { id, material_out_name, number, count, count_ok }"
+ };
+ that.config_middle_top.data = [];
+ that.$API.pm.mtask.list.req(params).then((res) => {
+ if(res.length>0){
+ res.forEach((item) => {
+ let arr = [];
+ arr[0] = item.number;
+ 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);
})
}
- that.chartOption1.xAxis.data = namelist;
- that.chartOption1.series.data = valuelist;
});
},
},
@@ -684,7 +712,7 @@ export default {
}
.leftChartBlock2{
width:100%;
- height: 28vh;
+ height: 30vh;
}
.middleTableBlock1{
width:94%;
diff --git a/src/views/bigScreen/bxerp/reyadept.vue b/src/views/bigScreen/bxerp/reyadept.vue
index b1b9c4b1..9d0f022b 100644
--- a/src/views/bigScreen/bxerp/reyadept.vue
+++ b/src/views/bigScreen/bxerp/reyadept.vue
@@ -90,7 +90,7 @@
@@ -121,7 +121,8 @@
@@ -391,7 +392,7 @@ export default {
headerBGC: 'rgba(47,102,107,.34)',
oddRowBGC: 'rgba(0,0,0,0)',
evenRowBGC: 'rgba(0,0,0,0)',
- header: ['任务编号', '产出产品', '任务量', '合格数'],
+ header:['批次号','物料名称', '当前工序', '状态', '数量'],
data: []
},
config_middle_bottom:{
@@ -402,51 +403,42 @@ 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:'',
+ deptName: "热压班组",
};
},
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.$API.system.dept.list.req({name:that.deptName,page:0}).then((res) => {
+ if(res.length > 0){
+ that.deptId = res[0].id;
+ that.getMgroups();
+ //设备列表:各个工段的设备列表
+ that.getEquipment();
+ //每个人日生产量:个人绩效
+ that.getEveryoneCount();
+ //车间库存
+ that.getInms();
+ }
})
+ //车间整体产品统计
+ that.materialAll();
},
methods: {
getMondayOfCurrentWeek() {
@@ -484,93 +476,64 @@ export default {
}, 500);
return myChart;
},
+ //车间工段列表
getMgroups(){
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:that.deptName,page:0}).then((res) => {
if(res.length > 0){
- res.forEach((item,inde)=>{
+ res.forEach((item)=>{
that.mgroupsId += item.id + ',';
- that.getmgroupMaterial(item);
- //未完成的物料
- if(inde==res.length-1){
- that.getLastmgroupMaterial(item);
- }
-
+ let obj = {};
+ obj.name = item.name;
+ obj.value = 0;
+ that.config_left1.data.push(obj);
+ that.getmgroupMaterial();
+ that.getInms(item);
})
}
});
},
- //任务进度
- getMtask1() {
+ //车间物料展示车间库存
+ getInms(item){
let that = this;
- let params = {
- state: 20,mgroup__belong_dept: that.deptId,page:0,
- query: " { id, material_out_name, number, count, count_ok }"
- };
- that.config_middle_top.data = [];
- that.$API.pm.mtask.list.req(params).then((res) => {
+ let params = { tag: 'done',page:0,mgroup: item.id };
+ that.$API.wpm.wmaterial.list.req(params).then((res) => {
if(res.length>0){
- res.forEach((item) => {
+ res.forEach((item)=>{
let arr = [];
- arr[0] = item.number;
- arr[1] = item.material_out_name;
- arr[2] = item.count;
- arr[3] = item.count_ok;
- // arr[4] = item.count_ok/item.count*100+'%';
+ arr[0] = item.batch;
+ arr[1] = item.material_.name;
+ // arr[2] = item.material_.specification+item.material_.model;
+ arr[2] = item.material_.process_name;
+ arr[3] = item.state==10?'合格品':'不合格品';
+ arr[4] = item.count;
that.config_middle_top.data.push(arr);
})
}
+ })
+ },
+ //车间各工段生产产品数
+ getmgroupMaterial() {
+ let that = this;
+ 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:that.deptName},
+ };
+ 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.合格数;
+ }
+ })
+ })
+ }
});
},
- //库存统计列表
- getmgroupMaterial(item) {
- 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 }"
- };
- 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 = {
@@ -594,23 +557,89 @@ export default {
}
})
},
- getCount(){
+ //每个人日产量
+ getEveryoneCount(){
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:that.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.deptName;
+ });
+ 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);
+ })
+ }
+ });
+ },
+ //任务进度
+ getMtask1() {
+ let that = this;
+ let params = {
+ state: 20,mgroup__belong_dept: that.deptId,page:0,
+ query: " { id, material_out_name, number, count, count_ok }"
+ };
+ that.config_middle_top.data = [];
+ that.$API.pm.mtask.list.req(params).then((res) => {
+ if(res.length>0){
+ res.forEach((item) => {
+ let arr = [];
+ arr[0] = item.number;
+ 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);
})
}
- that.chartOption1.xAxis.data = namelist;
- that.chartOption1.series.data = valuelist;
});
},
},
@@ -684,7 +713,7 @@ export default {
}
.leftChartBlock2{
width:100%;
- height: 28vh;
+ height: 30vh;
}
.middleTableBlock1{
width:94%;