fix:玻纤车间看板
This commit is contained in:
parent
f28a87a3c4
commit
4ed5be41e6
|
@ -121,7 +121,8 @@
|
||||||
<div style="height: 34vh;">
|
<div style="height: 34vh;">
|
||||||
<dv-border-box-1>
|
<dv-border-box-1>
|
||||||
<div class="chartBlockTitle">每个人日产量</div>
|
<div class="chartBlockTitle">每个人日产量</div>
|
||||||
<scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
<dv-scroll-board :config="config_right_top" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||||
|
<!-- <scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/> -->
|
||||||
</dv-border-box-1>
|
</dv-border-box-1>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 34vh;">
|
<div style="height: 34vh;">
|
||||||
|
@ -141,6 +142,7 @@
|
||||||
import * as echarts from "echarts";
|
import * as echarts from "echarts";
|
||||||
import { runningStateEnum } from "@/utils/enum.js";
|
import { runningStateEnum } from "@/utils/enum.js";
|
||||||
import scScrollTavle from "@/components/scScrollTable.vue";
|
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||||
|
import { name } from "babylonjs-gui";
|
||||||
function deepCopy(obj) {
|
function deepCopy(obj) {
|
||||||
return JSON.parse(JSON.stringify(obj));
|
return JSON.parse(JSON.stringify(obj));
|
||||||
}
|
}
|
||||||
|
@ -381,7 +383,15 @@ export default {
|
||||||
data:[]
|
data:[]
|
||||||
},
|
},
|
||||||
config_left1:{
|
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:{
|
config_left2:{
|
||||||
data:[]
|
data:[]
|
||||||
|
@ -402,35 +412,36 @@ export default {
|
||||||
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
||||||
data: []
|
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: "",
|
currentTime: "",
|
||||||
currentDay: "",
|
currentDay: "",
|
||||||
today: "",
|
today: "",
|
||||||
end_time:'',
|
end_time:'',
|
||||||
start_time:'',
|
start_time:'',
|
||||||
|
mgroups:['洗棒','捆棒','拉单丝','捆一次棒','一次复丝','捆二次棒','二次复丝'],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
//洗棒、捆棒、拉丝 :洗棒、捆棒、拉单丝、捆一次棒、一次复丝、捆二次棒、二次复丝
|
||||||
this.showTime();
|
this.showTime();
|
||||||
this.dayInterval = setInterval(() => {
|
this.dayInterval = setInterval(() => {
|
||||||
this.showTime();
|
this.showTime();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
let userInfo = this.$TOOL.data.get("USER_INFO");
|
that.mgroupsforEach();
|
||||||
this.deptId = userInfo.belong_dept;
|
that.getMgroups();
|
||||||
this.deptName = userInfo.belong_dept_name;
|
|
||||||
this.getMgroups();
|
|
||||||
this.$nextTick(() => {
|
|
||||||
//车间各个工段生产产品的数量:每个工段的已完成
|
|
||||||
// this.getmgroupMaterial();
|
|
||||||
//车间工段任务展示:各个工段的任务列表
|
|
||||||
this.getMtask1();
|
|
||||||
//设备列表:各个工段的设备列表
|
|
||||||
this.getEquipment();
|
|
||||||
//每个人日生产量:个人绩效
|
//每个人日生产量:个人绩效
|
||||||
this.getCount();
|
// that.getEveryoneCount(that.deptName1);
|
||||||
//车间整体产品统计:最后一个工序的产品统计
|
// that.getEveryoneCount(that.deptName2);
|
||||||
//产品占比:最后一个工序的产品占比
|
// that.getEveryoneCount(that.deptName3);
|
||||||
// this.getMaterials();// this.getmgroupMaterial();
|
that.materialAll();
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getMondayOfCurrentWeek() {
|
getMondayOfCurrentWeek() {
|
||||||
|
@ -470,25 +481,28 @@ export default {
|
||||||
},
|
},
|
||||||
getMgroups(){
|
getMgroups(){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$API.mtm.mgroup.list.req({belong_dept:that.deptId,page:0}).then((res) => {
|
let params = {page: 0,query:" { id, name }"};
|
||||||
if(res.length > 0){
|
that.$API.mtm.mgroup.list.req(params).then((res) => {
|
||||||
res.forEach((item,inde)=>{
|
res.forEach((item)=>{
|
||||||
that.mgroupsId += item.id + ',';
|
let index = that.mgroups.indexOf(item.name);
|
||||||
that.getmgroupMaterial(item);
|
if(index>-1){
|
||||||
//未完成的物料
|
that.getmgroupMaterial(item.id,item.name,index);
|
||||||
if(inde==res.length-1){
|
|
||||||
that.getLastmgroupMaterial(item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
});
|
},
|
||||||
|
mgroupsforEach(){
|
||||||
|
let that = this;
|
||||||
|
that.mgroups.forEach((item)=>{
|
||||||
|
that.getEquipment(item);
|
||||||
|
that.getMtask1(item);
|
||||||
|
})
|
||||||
},
|
},
|
||||||
//任务进度
|
//任务进度
|
||||||
getMtask1() {
|
getMtask1(name) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let params = {
|
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 }"
|
query: " { id, material_out_name, number, count, count_ok }"
|
||||||
};
|
};
|
||||||
that.config_middle_top.data = [];
|
that.config_middle_top.data = [];
|
||||||
|
@ -507,58 +521,21 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//库存统计列表
|
//库存统计列表
|
||||||
getmgroupMaterial(item) {
|
getmgroupMaterial(id,name,index) {
|
||||||
let that = this;
|
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) => {
|
that.$API.wpm.wmaterial.list.req(params).then((res) => {
|
||||||
let obj = {};
|
let count = 0;
|
||||||
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) => {
|
res.forEach((item) => {
|
||||||
let index = namelist.indexOf(item.material_.name);
|
count += Number(item.count);
|
||||||
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;
|
that.config_left1.data[index].value = count;
|
||||||
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() {
|
//车间设备列表
|
||||||
|
getEquipment(name) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let params = {
|
let params = {page: 0, mgroup__name:name,
|
||||||
page: 0, belong_dept:that.deptId,
|
|
||||||
// query: " { id, name, number, model, state ,mgroup_name }"
|
// query: " { id, name, number, model, state ,mgroup_name }"
|
||||||
};
|
};
|
||||||
that.config_middle_bottom.data = [];
|
that.config_middle_bottom.data = [];
|
||||||
|
@ -578,23 +555,67 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCount(){
|
//每个人日产量
|
||||||
|
getEveryoneCount(deptName){
|
||||||
let that = this;
|
let that = this;
|
||||||
|
that.config_right_top.data = [];
|
||||||
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
|
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
|
||||||
let params = {
|
let params = {
|
||||||
query: {start_date:date,end_date:date,dept_name:that.deptName},
|
// 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:deptName},
|
||||||
};
|
};
|
||||||
let namelist = [],valuelist = [];
|
|
||||||
this.$API.bi.dataset.exec.req("performance", params).then((res) => {
|
this.$API.bi.dataset.exec.req("performance", params).then((res) => {
|
||||||
if(res.data2.ds0.length>0){
|
if(res.data2.ds0.length>0){
|
||||||
res.data2.ds0.forEach((item)=>{
|
res.data2.ds0.forEach((item)=>{
|
||||||
namelist.push(item.操作人);
|
let arr = [];
|
||||||
valuelist.push(item.合格数);
|
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;
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -121,7 +121,8 @@
|
||||||
<div style="height: 34vh;">
|
<div style="height: 34vh;">
|
||||||
<dv-border-box-1>
|
<dv-border-box-1>
|
||||||
<div class="chartBlockTitle">每个人日产量</div>
|
<div class="chartBlockTitle">每个人日产量</div>
|
||||||
<scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
<dv-scroll-board :config="config_right_top" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||||
|
<!-- <scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/> -->
|
||||||
</dv-border-box-1>
|
</dv-border-box-1>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 34vh;">
|
<div style="height: 34vh;">
|
||||||
|
@ -141,6 +142,7 @@
|
||||||
import * as echarts from "echarts";
|
import * as echarts from "echarts";
|
||||||
import { runningStateEnum } from "@/utils/enum.js";
|
import { runningStateEnum } from "@/utils/enum.js";
|
||||||
import scScrollTavle from "@/components/scScrollTable.vue";
|
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||||
|
import { name } from "babylonjs-gui";
|
||||||
function deepCopy(obj) {
|
function deepCopy(obj) {
|
||||||
return JSON.parse(JSON.stringify(obj));
|
return JSON.parse(JSON.stringify(obj));
|
||||||
}
|
}
|
||||||
|
@ -381,7 +383,12 @@ export default {
|
||||||
data:[]
|
data:[]
|
||||||
},
|
},
|
||||||
config_left1:{
|
config_left1:{
|
||||||
data:[]
|
data:[
|
||||||
|
{name:'排一次棒',value:0},
|
||||||
|
{name:'排二次棒',value:0},
|
||||||
|
{name:'切丝',value:0},
|
||||||
|
{name:'排板',value:0},
|
||||||
|
]
|
||||||
} ,
|
} ,
|
||||||
config_left2:{
|
config_left2:{
|
||||||
data:[]
|
data:[]
|
||||||
|
@ -402,51 +409,36 @@ export default {
|
||||||
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
||||||
data: []
|
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: "",
|
currentTime: "",
|
||||||
currentDay: "",
|
currentDay: "",
|
||||||
today: "",
|
today: "",
|
||||||
end_time:'',
|
end_time:'',
|
||||||
start_time:'',
|
start_time:'',
|
||||||
|
mgroups:['排一次棒','排二次棒','切丝','排板'],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
//排棒、切丝、排板 :排一次棒、排二次棒、切丝、排板
|
||||||
this.showTime();
|
this.showTime();
|
||||||
this.dayInterval = setInterval(() => {
|
this.dayInterval = setInterval(() => {
|
||||||
this.showTime();
|
this.showTime();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
//近七天的日期数组
|
that.mgroupsforEach();
|
||||||
// let daysArr = this.getMondayOfCurrentWeek();
|
that.getMgroups();
|
||||||
// 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();
|
// that.getEveryoneCount(that.deptName1);
|
||||||
//车间整体产品统计:最后一个工序的产品统计
|
// that.getEveryoneCount(that.deptName2);
|
||||||
//产品占比:最后一个工序的产品占比
|
// that.getEveryoneCount(that.deptName3);
|
||||||
// this.getMaterials();// this.getmgroupMaterial();
|
that.materialAll();
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getMondayOfCurrentWeek() {
|
getMondayOfCurrentWeek() {
|
||||||
|
@ -486,25 +478,28 @@ export default {
|
||||||
},
|
},
|
||||||
getMgroups(){
|
getMgroups(){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$API.mtm.mgroup.list.req({belong_dept:that.deptId,page:0}).then((res) => {
|
let params = {page: 0,query:" { id, name }"};
|
||||||
if(res.length > 0){
|
that.$API.mtm.mgroup.list.req(params).then((res) => {
|
||||||
res.forEach((item,inde)=>{
|
res.forEach((item)=>{
|
||||||
that.mgroupsId += item.id + ',';
|
let index = that.mgroups.indexOf(item.name);
|
||||||
that.getmgroupMaterial(item);
|
if(index>-1){
|
||||||
//未完成的物料
|
that.getmgroupMaterial(item.id,item.name,index);
|
||||||
if(inde==res.length-1){
|
|
||||||
that.getLastmgroupMaterial(item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
});
|
},
|
||||||
|
mgroupsforEach(){
|
||||||
|
let that = this;
|
||||||
|
that.mgroups.forEach((item)=>{
|
||||||
|
that.getEquipment(item);
|
||||||
|
that.getMtask1(item);
|
||||||
|
})
|
||||||
},
|
},
|
||||||
//任务进度
|
//任务进度
|
||||||
getMtask1() {
|
getMtask1(name) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let params = {
|
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 }"
|
query: " { id, material_out_name, number, count, count_ok }"
|
||||||
};
|
};
|
||||||
that.config_middle_top.data = [];
|
that.config_middle_top.data = [];
|
||||||
|
@ -523,58 +518,21 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//库存统计列表
|
//库存统计列表
|
||||||
getmgroupMaterial(item) {
|
getmgroupMaterial(id,name,index) {
|
||||||
let that = this;
|
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) => {
|
that.$API.wpm.wmaterial.list.req(params).then((res) => {
|
||||||
let obj = {};
|
let count = 0;
|
||||||
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) => {
|
res.forEach((item) => {
|
||||||
let index = namelist.indexOf(item.material_.name);
|
count += Number(item.count);
|
||||||
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;
|
that.config_left1.data[index].value = count;
|
||||||
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() {
|
//车间设备列表
|
||||||
|
getEquipment(name) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let params = {
|
let params = {page: 0, mgroup__name:name,
|
||||||
page: 0, belong_dept:that.deptId,
|
|
||||||
// query: " { id, name, number, model, state ,mgroup_name }"
|
// query: " { id, name, number, model, state ,mgroup_name }"
|
||||||
};
|
};
|
||||||
that.config_middle_bottom.data = [];
|
that.config_middle_bottom.data = [];
|
||||||
|
@ -594,23 +552,67 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCount(){
|
//每个人日产量
|
||||||
|
getEveryoneCount(deptName){
|
||||||
let that = this;
|
let that = this;
|
||||||
|
that.config_right_top.data = [];
|
||||||
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
|
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
|
||||||
let params = {
|
let params = {
|
||||||
query: {start_date:date,end_date:date,dept_name:that.deptName},
|
// 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:deptName},
|
||||||
};
|
};
|
||||||
let namelist = [],valuelist = [];
|
|
||||||
this.$API.bi.dataset.exec.req("performance", params).then((res) => {
|
this.$API.bi.dataset.exec.req("performance", params).then((res) => {
|
||||||
if(res.data2.ds0.length>0){
|
if(res.data2.ds0.length>0){
|
||||||
res.data2.ds0.forEach((item)=>{
|
res.data2.ds0.forEach((item)=>{
|
||||||
namelist.push(item.操作人);
|
let arr = [];
|
||||||
valuelist.push(item.合格数);
|
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;
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -121,7 +121,8 @@
|
||||||
<div style="height: 34vh;">
|
<div style="height: 34vh;">
|
||||||
<dv-border-box-1>
|
<dv-border-box-1>
|
||||||
<div class="chartBlockTitle">每个人日产量</div>
|
<div class="chartBlockTitle">每个人日产量</div>
|
||||||
<scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
<dv-scroll-board :config="config_right_top" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||||
|
<!-- <scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/> -->
|
||||||
</dv-border-box-1>
|
</dv-border-box-1>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 34vh;">
|
<div style="height: 34vh;">
|
||||||
|
@ -402,51 +403,51 @@ export default {
|
||||||
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
||||||
data: []
|
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: "",
|
currentTime: "",
|
||||||
currentDay: "",
|
currentDay: "",
|
||||||
today: "",
|
today: "",
|
||||||
end_time:'',
|
end_time:'',
|
||||||
start_time:'',
|
start_time:'',
|
||||||
|
deptName1: "毛坯加工班组",
|
||||||
|
deptName2: "辅助班组",
|
||||||
|
deptName3: "精雕机班组",
|
||||||
|
deptName4: "成品精加工班组",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
let that = this;
|
||||||
this.showTime();
|
this.showTime();
|
||||||
this.dayInterval = setInterval(() => {
|
this.dayInterval = setInterval(() => {
|
||||||
this.showTime();
|
this.showTime();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
//近七天的日期数组
|
that.materialAll();
|
||||||
// let daysArr = this.getMondayOfCurrentWeek();
|
that.getMgroups(that.deptName1);
|
||||||
// this.daysArr = daysArr;
|
that.getMgroups(that.deptName2);
|
||||||
// let xAxisData = [];
|
that.getMgroups(that.deptName3);
|
||||||
// daysArr.forEach((item)=>{
|
that.getMgroups(that.deptName4);
|
||||||
// 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();
|
that.getEquipment(that.deptName1);
|
||||||
|
that.getEquipment(that.deptName2);
|
||||||
|
that.getEquipment(that.deptName3);
|
||||||
|
that.getEquipment(that.deptName4);
|
||||||
//每个人日生产量:个人绩效
|
//每个人日生产量:个人绩效
|
||||||
this.getCount();
|
that.getEveryoneCount(that.deptName1);
|
||||||
//车间整体产品统计:最后一个工序的产品统计
|
that.getEveryoneCount(that.deptName2);
|
||||||
//产品占比:最后一个工序的产品占比
|
that.getEveryoneCount(that.deptName3);
|
||||||
// this.getMaterials();// this.getmgroupMaterial();
|
that.getEveryoneCount(that.deptName4);
|
||||||
})
|
//任务进度
|
||||||
|
that.getMtask1(that.deptName1);
|
||||||
|
that.getMtask1(that.deptName2);
|
||||||
|
that.getMtask1(that.deptName3);
|
||||||
|
that.getMtask1(that.deptName4);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getMondayOfCurrentWeek() {
|
getMondayOfCurrentWeek() {
|
||||||
|
@ -484,27 +485,25 @@ export default {
|
||||||
}, 500);
|
}, 500);
|
||||||
return myChart;
|
return myChart;
|
||||||
},
|
},
|
||||||
getMgroups(){
|
//获取工段列表
|
||||||
|
getMgroups(deptName){
|
||||||
let that = this;
|
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){
|
if(res.length > 0){
|
||||||
res.forEach((item,inde)=>{
|
res.forEach((item)=>{
|
||||||
that.mgroupsId += item.id + ',';
|
that.mgroupsId += item.id + ',';
|
||||||
that.getmgroupMaterial(item);
|
that.getmgroupMaterial(item.name);
|
||||||
//未完成的物料
|
//工段太多了,暂时不显示全部,只显示有数据的工段
|
||||||
if(inde==res.length-1){
|
// that.config_left1.data.push({name:item.name,value:0});
|
||||||
that.getLastmgroupMaterial(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//任务进度
|
//任务进度
|
||||||
getMtask1() {
|
getMtask1(deptName) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let params = {
|
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 }"
|
query: " { id, material_out_name, number, count, count_ok }"
|
||||||
};
|
};
|
||||||
that.config_middle_top.data = [];
|
that.config_middle_top.data = [];
|
||||||
|
@ -516,66 +515,38 @@ export default {
|
||||||
arr[1] = item.material_out_name;
|
arr[1] = item.material_out_name;
|
||||||
arr[2] = item.count;
|
arr[2] = item.count;
|
||||||
arr[3] = item.count_ok;
|
arr[3] = item.count_ok;
|
||||||
// arr[4] = item.count_ok/item.count*100+'%';
|
|
||||||
that.config_middle_top.data.push(arr);
|
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 that = this;
|
||||||
|
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
|
||||||
let params = {
|
let params = {
|
||||||
tag: 'done',page:0,mgroup: item.id ,
|
// query: {start_date:date,end_date:date,mgroup_name:item.name},
|
||||||
// query: " { id, material_name }"
|
query: {start_date:date,end_date:date,dept_name:deptName},
|
||||||
};
|
};
|
||||||
that.$API.wpm.wmaterial.list.req(params).then((res) => {
|
this.$API.bi.dataset.exec.req("mlog_okrate", params).then((res) => {
|
||||||
if(res.length>0){
|
if(res.data2.ds0.length>0){
|
||||||
let namelist = [],valuelist = [],values=[];
|
let data = res.data2.ds0;
|
||||||
res.forEach((item)=>{
|
data.forEach((item) => {
|
||||||
let index = namelist.indexOf(item.material_.name);
|
that.config_left1.data.forEach((obj,index2) => {
|
||||||
if(index==-1){
|
if (item.name == obj.工段){
|
||||||
namelist.push(item.material_.name);
|
that.config_left1.data[index2].value = item.合格数;
|
||||||
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() {
|
//车间设备列表
|
||||||
|
getEquipment(deptName) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let params = {
|
let params = {
|
||||||
page: 0, belong_dept:that.deptId,
|
page: 0, belong_dept__name:deptName,
|
||||||
// query: " { id, name, number, model, state ,mgroup_name }"
|
query: " { id, name, number, model, state ,mgroup_name,running_state }"
|
||||||
};
|
};
|
||||||
that.config_middle_bottom.data = [];
|
that.config_middle_bottom.data = [];
|
||||||
that.$API.em.equipment.list.req(params).then((res) => {
|
that.$API.em.equipment.list.req(params).then((res) => {
|
||||||
|
@ -594,23 +565,67 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCount(){
|
//每个人日产量
|
||||||
|
getEveryoneCount(deptName){
|
||||||
let that = this;
|
let that = this;
|
||||||
|
that.config_right_top.data = [];
|
||||||
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
|
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
|
||||||
let params = {
|
let params = {
|
||||||
query: {start_date:date,end_date:date,dept_name:that.deptName},
|
query: {start_date:date,end_date:date,dept_name: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:deptName},
|
||||||
};
|
};
|
||||||
let namelist = [],valuelist = [];
|
|
||||||
this.$API.bi.dataset.exec.req("performance", params).then((res) => {
|
this.$API.bi.dataset.exec.req("performance", params).then((res) => {
|
||||||
if(res.data2.ds0.length>0){
|
if(res.data2.ds0.length>0){
|
||||||
res.data2.ds0.forEach((item)=>{
|
res.data2.ds0.forEach((item)=>{
|
||||||
namelist.push(item.操作人);
|
let arr = [];
|
||||||
valuelist.push(item.合格数);
|
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;
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container class="dashboard">
|
<el-container class="dashboard">
|
||||||
<el-header class="header">
|
<el-header class="header">
|
||||||
<div class="title">车间看板</div>
|
<div class="title">扭转车间看板</div>
|
||||||
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
|
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main>
|
<el-main>
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
<div class="middleBlock">
|
<div class="middleBlock">
|
||||||
<div style="height: 38vh;">
|
<div style="height: 38vh;">
|
||||||
<dv-border-box-1>
|
<dv-border-box-1>
|
||||||
<div class="chartBlockTitle">车间工段任务展示</div>
|
<div class="chartBlockTitle">车间物料展示</div>
|
||||||
<dv-scroll-board :config="config_middle_top" class="middleTableBlock1"/>
|
<dv-scroll-board :config="config_middle_top" class="middleTableBlock1"/>
|
||||||
</dv-border-box-1>
|
</dv-border-box-1>
|
||||||
</div>
|
</div>
|
||||||
|
@ -121,7 +121,8 @@
|
||||||
<div style="height: 34vh;">
|
<div style="height: 34vh;">
|
||||||
<dv-border-box-1>
|
<dv-border-box-1>
|
||||||
<div class="chartBlockTitle">每个人日产量</div>
|
<div class="chartBlockTitle">每个人日产量</div>
|
||||||
<scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
<dv-scroll-board :config="config_right_top" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||||
|
<!-- <scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/> -->
|
||||||
</dv-border-box-1>
|
</dv-border-box-1>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 34vh;">
|
<div style="height: 34vh;">
|
||||||
|
@ -391,7 +392,7 @@ export default {
|
||||||
headerBGC: 'rgba(47,102,107,.34)',
|
headerBGC: 'rgba(47,102,107,.34)',
|
||||||
oddRowBGC: 'rgba(0,0,0,0)',
|
oddRowBGC: 'rgba(0,0,0,0)',
|
||||||
evenRowBGC: 'rgba(0,0,0,0)',
|
evenRowBGC: 'rgba(0,0,0,0)',
|
||||||
header: ['任务编号', '产出产品', '任务量', '合格数'],
|
header:['批次号','物料名称', '当前工序', '状态', '数量'],
|
||||||
data: []
|
data: []
|
||||||
},
|
},
|
||||||
config_middle_bottom:{
|
config_middle_bottom:{
|
||||||
|
@ -402,51 +403,42 @@ export default {
|
||||||
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
||||||
data: []
|
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: "",
|
currentTime: "",
|
||||||
currentDay: "",
|
currentDay: "",
|
||||||
today: "",
|
today: "",
|
||||||
end_time:'',
|
end_time:'',
|
||||||
start_time:'',
|
start_time:'',
|
||||||
|
deptName: "扭转班组",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
let that = this;
|
||||||
this.showTime();
|
this.showTime();
|
||||||
this.dayInterval = setInterval(() => {
|
this.dayInterval = setInterval(() => {
|
||||||
this.showTime();
|
this.showTime();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
//近七天的日期数组
|
that.$API.system.dept.list.req({name:that.deptName,page:0}).then((res) => {
|
||||||
// let daysArr = this.getMondayOfCurrentWeek();
|
if(res.length > 0){
|
||||||
// this.daysArr = daysArr;
|
that.deptId = res[0].id;
|
||||||
// let xAxisData = [];
|
that.getMgroups();
|
||||||
// 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();
|
that.getEquipment();
|
||||||
//每个人日生产量:个人绩效
|
//每个人日生产量:个人绩效
|
||||||
this.getCount();
|
that.getEveryoneCount();
|
||||||
//车间整体产品统计:最后一个工序的产品统计
|
//车间库存
|
||||||
//产品占比:最后一个工序的产品占比
|
that.getInms();
|
||||||
// this.getMaterials();// this.getmgroupMaterial();
|
}
|
||||||
})
|
})
|
||||||
|
//车间整体产品统计
|
||||||
|
that.materialAll();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getMondayOfCurrentWeek() {
|
getMondayOfCurrentWeek() {
|
||||||
|
@ -484,18 +476,145 @@ export default {
|
||||||
}, 500);
|
}, 500);
|
||||||
return myChart;
|
return myChart;
|
||||||
},
|
},
|
||||||
|
//车间工段列表
|
||||||
getMgroups(){
|
getMgroups(){
|
||||||
let that = this;
|
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){
|
if(res.length > 0){
|
||||||
res.forEach((item,inde)=>{
|
res.forEach((item)=>{
|
||||||
that.mgroupsId += item.id + ',';
|
that.mgroupsId += item.id + ',';
|
||||||
that.getmgroupMaterial(item);
|
let obj = {};
|
||||||
//未完成的物料
|
obj.name = item.name;
|
||||||
if(inde==res.length-1){
|
obj.value = 0;
|
||||||
that.getLastmgroupMaterial(item);
|
that.config_left1.data.push(obj);
|
||||||
|
that.getmgroupMaterial();
|
||||||
|
that.getInms(item);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//车间物料展示车间库存
|
||||||
|
getInms(item){
|
||||||
|
let that = this;
|
||||||
|
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)=>{
|
||||||
|
let arr = [];
|
||||||
|
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.合格数;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//车间设备列表
|
||||||
|
getEquipment() {
|
||||||
|
let that = this;
|
||||||
|
let params = {
|
||||||
|
page: 0, belong_dept:that.deptId,
|
||||||
|
// query: " { id, name, number, model, state ,mgroup_name }"
|
||||||
|
};
|
||||||
|
that.config_middle_bottom.data = [];
|
||||||
|
that.$API.em.equipment.list.req(params).then((res) => {
|
||||||
|
if(res.length>0){
|
||||||
|
res.forEach((item) => {
|
||||||
|
let arr = [];
|
||||||
|
let state_ = that.state_[item.state];
|
||||||
|
let running_state_ = runningStateEnum[item.running_state]?.text;
|
||||||
|
arr[0] = item.name;
|
||||||
|
arr[1] = item.number;
|
||||||
|
arr[2] = state_;
|
||||||
|
arr[3] = running_state_;
|
||||||
|
arr[4] = item.mgroup_name;
|
||||||
|
that.config_middle_bottom.data.push(arr);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//每个人日产量
|
||||||
|
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-05-04',end_date:'2025-05-04',dept_name:that.deptName},
|
||||||
|
};
|
||||||
|
this.$API.bi.dataset.exec.req("performance", params).then((res) => {
|
||||||
|
if(res.data2.ds0.length>0){
|
||||||
|
res.data2.ds0.forEach((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);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -522,97 +641,6 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//库存统计列表
|
|
||||||
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 = {
|
|
||||||
page: 0, belong_dept:that.deptId,
|
|
||||||
// query: " { id, name, number, model, state ,mgroup_name }"
|
|
||||||
};
|
|
||||||
that.config_middle_bottom.data = [];
|
|
||||||
that.$API.em.equipment.list.req(params).then((res) => {
|
|
||||||
if(res.length>0){
|
|
||||||
res.forEach((item) => {
|
|
||||||
let arr = [];
|
|
||||||
let state_ = that.state_[item.state];
|
|
||||||
let running_state_ = runningStateEnum[item.running_state]?.text;
|
|
||||||
arr[0] = item.name;
|
|
||||||
arr[1] = item.number;
|
|
||||||
arr[2] = state_;
|
|
||||||
arr[3] = running_state_;
|
|
||||||
arr[4] = item.mgroup_name;
|
|
||||||
that.config_middle_bottom.data.push(arr);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getCount(){
|
|
||||||
let that = this;
|
|
||||||
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},
|
|
||||||
};
|
|
||||||
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.合格数);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
that.chartOption1.xAxis.data = namelist;
|
|
||||||
that.chartOption1.series.data = valuelist;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -684,7 +712,7 @@ export default {
|
||||||
}
|
}
|
||||||
.leftChartBlock2{
|
.leftChartBlock2{
|
||||||
width:100%;
|
width:100%;
|
||||||
height: 28vh;
|
height: 30vh;
|
||||||
}
|
}
|
||||||
.middleTableBlock1{
|
.middleTableBlock1{
|
||||||
width:94%;
|
width:94%;
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
<div class="middleBlock">
|
<div class="middleBlock">
|
||||||
<div style="height: 38vh;">
|
<div style="height: 38vh;">
|
||||||
<dv-border-box-1>
|
<dv-border-box-1>
|
||||||
<div class="chartBlockTitle">车间工段任务展示</div>
|
<div class="chartBlockTitle">车间物料展示</div>
|
||||||
<dv-scroll-board :config="config_middle_top" class="middleTableBlock1"/>
|
<dv-scroll-board :config="config_middle_top" class="middleTableBlock1"/>
|
||||||
</dv-border-box-1>
|
</dv-border-box-1>
|
||||||
</div>
|
</div>
|
||||||
|
@ -121,7 +121,8 @@
|
||||||
<div style="height: 34vh;">
|
<div style="height: 34vh;">
|
||||||
<dv-border-box-1>
|
<dv-border-box-1>
|
||||||
<div class="chartBlockTitle">每个人日产量</div>
|
<div class="chartBlockTitle">每个人日产量</div>
|
||||||
<scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
<dv-scroll-board :config="config_right_top" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||||
|
<!-- <scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/> -->
|
||||||
</dv-border-box-1>
|
</dv-border-box-1>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 34vh;">
|
<div style="height: 34vh;">
|
||||||
|
@ -391,7 +392,7 @@ export default {
|
||||||
headerBGC: 'rgba(47,102,107,.34)',
|
headerBGC: 'rgba(47,102,107,.34)',
|
||||||
oddRowBGC: 'rgba(0,0,0,0)',
|
oddRowBGC: 'rgba(0,0,0,0)',
|
||||||
evenRowBGC: 'rgba(0,0,0,0)',
|
evenRowBGC: 'rgba(0,0,0,0)',
|
||||||
header: ['任务编号', '产出产品', '任务量', '合格数'],
|
header:['批次号','物料名称', '当前工序', '状态', '数量'],
|
||||||
data: []
|
data: []
|
||||||
},
|
},
|
||||||
config_middle_bottom:{
|
config_middle_bottom:{
|
||||||
|
@ -402,51 +403,42 @@ export default {
|
||||||
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
||||||
data: []
|
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: "",
|
currentTime: "",
|
||||||
currentDay: "",
|
currentDay: "",
|
||||||
today: "",
|
today: "",
|
||||||
end_time:'',
|
end_time:'',
|
||||||
start_time:'',
|
start_time:'',
|
||||||
|
deptName: "热压班组",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
let that = this;
|
||||||
this.showTime();
|
this.showTime();
|
||||||
this.dayInterval = setInterval(() => {
|
this.dayInterval = setInterval(() => {
|
||||||
this.showTime();
|
this.showTime();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
//近七天的日期数组
|
that.$API.system.dept.list.req({name:that.deptName,page:0}).then((res) => {
|
||||||
// let daysArr = this.getMondayOfCurrentWeek();
|
if(res.length > 0){
|
||||||
// this.daysArr = daysArr;
|
that.deptId = res[0].id;
|
||||||
// let xAxisData = [];
|
that.getMgroups();
|
||||||
// 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();
|
that.getEquipment();
|
||||||
//每个人日生产量:个人绩效
|
//每个人日生产量:个人绩效
|
||||||
this.getCount();
|
that.getEveryoneCount();
|
||||||
//车间整体产品统计:最后一个工序的产品统计
|
//车间库存
|
||||||
//产品占比:最后一个工序的产品占比
|
that.getInms();
|
||||||
// this.getMaterials();// this.getmgroupMaterial();
|
}
|
||||||
})
|
})
|
||||||
|
//车间整体产品统计
|
||||||
|
that.materialAll();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getMondayOfCurrentWeek() {
|
getMondayOfCurrentWeek() {
|
||||||
|
@ -484,18 +476,146 @@ export default {
|
||||||
}, 500);
|
}, 500);
|
||||||
return myChart;
|
return myChart;
|
||||||
},
|
},
|
||||||
|
//车间工段列表
|
||||||
getMgroups(){
|
getMgroups(){
|
||||||
let that = this;
|
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){
|
if(res.length > 0){
|
||||||
res.forEach((item,inde)=>{
|
res.forEach((item)=>{
|
||||||
that.mgroupsId += item.id + ',';
|
that.mgroupsId += item.id + ',';
|
||||||
that.getmgroupMaterial(item);
|
let obj = {};
|
||||||
//未完成的物料
|
obj.name = item.name;
|
||||||
if(inde==res.length-1){
|
obj.value = 0;
|
||||||
that.getLastmgroupMaterial(item);
|
that.config_left1.data.push(obj);
|
||||||
|
that.getmgroupMaterial();
|
||||||
|
that.getInms(item);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//车间物料展示车间库存
|
||||||
|
getInms(item){
|
||||||
|
let that = this;
|
||||||
|
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)=>{
|
||||||
|
let arr = [];
|
||||||
|
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.合格数;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//车间设备列表
|
||||||
|
getEquipment() {
|
||||||
|
let that = this;
|
||||||
|
let params = {
|
||||||
|
page: 0, belong_dept:that.deptId,
|
||||||
|
// query: " { id, name, number, model, state ,mgroup_name }"
|
||||||
|
};
|
||||||
|
that.config_middle_bottom.data = [];
|
||||||
|
that.$API.em.equipment.list.req(params).then((res) => {
|
||||||
|
if(res.length>0){
|
||||||
|
res.forEach((item) => {
|
||||||
|
let arr = [];
|
||||||
|
let state_ = that.state_[item.state];
|
||||||
|
let running_state_ = runningStateEnum[item.running_state]?.text;
|
||||||
|
arr[0] = item.name;
|
||||||
|
arr[1] = item.number;
|
||||||
|
arr[2] = state_;
|
||||||
|
arr[3] = running_state_;
|
||||||
|
arr[4] = item.mgroup_name;
|
||||||
|
that.config_middle_bottom.data.push(arr);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//每个人日产量
|
||||||
|
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-05-04',end_date:'2025-05-04',dept_name:that.deptName},
|
||||||
|
};
|
||||||
|
this.$API.bi.dataset.exec.req("performance", params).then((res) => {
|
||||||
|
if(res.data2.ds0.length>0){
|
||||||
|
res.data2.ds0.forEach((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);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -522,97 +642,6 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//库存统计列表
|
|
||||||
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 = {
|
|
||||||
page: 0, belong_dept:that.deptId,
|
|
||||||
// query: " { id, name, number, model, state ,mgroup_name }"
|
|
||||||
};
|
|
||||||
that.config_middle_bottom.data = [];
|
|
||||||
that.$API.em.equipment.list.req(params).then((res) => {
|
|
||||||
if(res.length>0){
|
|
||||||
res.forEach((item) => {
|
|
||||||
let arr = [];
|
|
||||||
let state_ = that.state_[item.state];
|
|
||||||
let running_state_ = runningStateEnum[item.running_state]?.text;
|
|
||||||
arr[0] = item.name;
|
|
||||||
arr[1] = item.number;
|
|
||||||
arr[2] = state_;
|
|
||||||
arr[3] = running_state_;
|
|
||||||
arr[4] = item.mgroup_name;
|
|
||||||
that.config_middle_bottom.data.push(arr);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getCount(){
|
|
||||||
let that = this;
|
|
||||||
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},
|
|
||||||
};
|
|
||||||
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.合格数);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
that.chartOption1.xAxis.data = namelist;
|
|
||||||
that.chartOption1.series.data = valuelist;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -684,7 +713,7 @@ export default {
|
||||||
}
|
}
|
||||||
.leftChartBlock2{
|
.leftChartBlock2{
|
||||||
width:100%;
|
width:100%;
|
||||||
height: 28vh;
|
height: 30vh;
|
||||||
}
|
}
|
||||||
.middleTableBlock1{
|
.middleTableBlock1{
|
||||||
width:94%;
|
width:94%;
|
||||||
|
|
Loading…
Reference in New Issue