feat:车间看板公共模板调整

This commit is contained in:
shijing 2026-06-16 08:57:41 +08:00
parent 390e05f999
commit 49e5c61692
1 changed files with 51 additions and 37 deletions

View File

@ -19,17 +19,9 @@
<el-main class="dash-main">
<!-- KPI Cards -->
<div class="kpi-row">
<div class="kpi-card kpi-c1">
<div class="kpi-meta">
<div class="kpi-label">日投产量</div>
<div class="kpi-sub">DAILY INPUT</div>
</div>
<div class="kpi-value">{{ sctj.rtcs }}</div>
<div class="kpi-bar"></div>
</div>
<div class="kpi-card kpi-c2">
<div class="kpi-meta">
<div class="kpi-label">日加工数</div>
<div class="kpi-label">昨日加工数</div>
<div class="kpi-sub">PROCESSED</div>
</div>
<div class="kpi-value">{{ sctj.rjgs }}</div>
@ -37,7 +29,7 @@
</div>
<div class="kpi-card kpi-c3">
<div class="kpi-meta">
<div class="kpi-label">加工前不良</div>
<div class="kpi-label">昨日加工前不良</div>
<div class="kpi-sub">PRE-DEFECT</div>
</div>
<div class="kpi-value">{{ sctj.rjgqbls }}</div>
@ -45,7 +37,7 @@
</div>
<div class="kpi-card kpi-c4">
<div class="kpi-meta">
<div class="kpi-label">日合格数</div>
<div class="kpi-label">日合格数</div>
<div class="kpi-sub">QUALIFIED</div>
</div>
<div class="kpi-value">{{ sctj.rhgs }}</div>
@ -53,12 +45,20 @@
</div>
<div class="kpi-card kpi-c5">
<div class="kpi-meta">
<div class="kpi-label">日不合格数</div>
<div class="kpi-label">日不合格数</div>
<div class="kpi-sub">REJECTED</div>
</div>
<div class="kpi-value">{{ sctj.rbhgs }}</div>
<div class="kpi-bar"></div>
</div>
<div class="kpi-card kpi-c1">
<div class="kpi-meta">
<div class="kpi-label">昨日合格率</div>
<div class="kpi-sub">DAILY QUALITY RATE</div>
</div>
<div class="kpi-value">{{ sctj.rhgl }}</div>
<div class="kpi-bar"></div>
</div>
</div>
<!-- Top row: 2 panels -->
@ -170,11 +170,11 @@ export default {
gz: 0,
},
sctj: {
rtcs: 0,
rjgs: 0,
rjgqbls: 0,
rhgs: 0,
rbhgs: 0,
rhgl: 0,
},
dayInterval: null,
chartInterval2: null,
@ -195,7 +195,7 @@ export default {
headerBGC: 'rgba(0, 229, 255, 0.16)',
oddRowBGC: 'rgba(0, 229, 255, 0.04)',
evenRowBGC: 'rgba(0, 229, 255, 0.10)',
header: ['设备名称', '设备编号', '设备状态', '物料数量'],
header: ['设备名称', '设备编号', '设备状态', '日加工量', '累计加工量'],
headerHeight: 38,
rowNum: 8,
align: 'center',
@ -206,7 +206,7 @@ export default {
headerBGC: 'rgba(0, 229, 255, 0.16)',
oddRowBGC: 'rgba(0, 229, 255, 0.04)',
evenRowBGC: 'rgba(0, 229, 255, 0.10)',
header: ['日期', '加工数', '合格数', '不合格数'],
header: ['日期', '物料名', '接收数', '合格数', '不合格数', '交送数'],
headerHeight: 38,
rowNum: 7,
align: 'center',
@ -248,7 +248,7 @@ export default {
that.daysList.push(dayitem);
})
that.today = new Date().toISOString().split('T')[0];
that.yesterday = new Date(new Date().getTime() - 24 * 60 * 60 * 1000).toISOString().split('T')[0];
that.yesterday =that.$TOOL.dateFormat2(new Date().getTime() - 24 * 60 * 60 * 1000);;
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);
@ -322,19 +322,22 @@ export default {
let list = res.data2.ds0;
if (list.length > 0) {
list.forEach((item) => {
let dateNow = new Date().getDate();
if (item. == dateNow) {
let dateYes = that.yesterday.split('-')[2];
if (item. == dateYes) {
that.sctj.rtcs = item.总重量;
that.sctj.rjgs = item.生产数;
that.sctj.rjgqbls = item.生产数 - item.不合格数 - item.合格数;
that.sctj.rhgs = item.合格数;
that.sctj.rbhgs = item.不合格数;
that.sctj.rhgl = Number((item.合格率).toFixed(2));
}
let arr = [];
arr[0] = item. + '-' + item. + '-' + item.;
arr[1] = item.生产数;
arr[2] = item.合格数;
arr[3] = item.不合格数;
arr[1] = item.物料名;
arr[2] = item.接收数;
arr[3] = item.生产数;
arr[4] = item.合格数;
arr[5] = item.交送数;
that.configDatas.data.push(arr);
});
}
@ -373,29 +376,40 @@ export default {
})
},
//
getEqState(id) {
getEqState() {
let that = this;
that.$API.wpm.ana.equipLastMlog.req({ mgroup: id }).then((res) => {
that.hh.yx += res.运行;
that.hh.wyx += res.未运行;
that.hh.gz += res.故障;
if (res.rows.length > 0) {
res.rows.forEach((item) => {
let obj = {
query: { query_date: that.today, mgroup_name: that.mgroupName },
};
that.$API.wpm.ana.equipLastMlog.req({ mgroup: that.mgroupId }).then((res) => {
that.hh.yx = res.运行;
that.hh.wyx = res.未运行;
that.hh.gz = res.故障;
});
that.$API.bi.dataset.exec.req("equit_static", obj).then((res) => {
let list = res.data2.ds0;
if (list.length > 0) {
list.forEach((item) => {
let arr = [];
arr[0] = item.name;
arr[1] = item.number;
if (item.mstate == '运行') {
arr[2] = '<span style="color:#00e5ff">● 运行中</span>';
} else if (item.mstate == '未运行') {
arr[2] = '<span style="color:#45b076">● 未运行</span>';
} else if (item.mstate == '故障') {
arr[0] = item.设备名称;
arr[1] = item.设备编号;
if (item.运行状态 == '运行') {
arr[2] = '<span style="color:#00e5ff">● 运行</span>';
} else if (item.运行状态 == '待机') {
arr[2] = '<span style="color:#45b076">● 待机</span>';
} else if (item.运行状态 == '停机') {
arr[2] = '<span style="color:#de3c36">● 停机</span>';
}else if (item.运行状态 == '故障') {
arr[2] = '<span style="color:#de3c36">● 故障</span>';
}else if (item.运行状态 == '离线') {
arr[2] = '<span style="color:#de3c36">● 离线</span>';
}
arr[3] = item.t_count_use ? item.t_count_use : 0;
arr[3] = item.当日加工量 ? item.当日加工量 : 0;
arr[4] = item.累计总加工量 ? item.累计总加工量 : 0;
that.configDataEq.data.push(arr);
});
}
});
})
},
//
getMaterials(page) {