This commit is contained in:
TianyangZhang 2026-04-16 10:57:21 +08:00
commit 5e77c90e04
10 changed files with 826 additions and 218 deletions

View File

@ -5,80 +5,16 @@
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
</el-header>
<el-main>
<el-row style="margin-bottom: 1vh;">
<el-col :span="3" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">本月产量</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
<el-col :span="3" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">今日产量</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
<el-col :span="3" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">今日工序报工量</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
<el-col :span="3" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">在产产品数</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
<el-col :span="3" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">本月完工工单</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
<el-col :span="3" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">本月计划产量</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
<el-col :span="3" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">本月产量</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
<el-col :span="3" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">本月产量</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<div class="leftBlock">
<el-row style="margin-bottom: 1vh;">
<el-col :span="12" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">在制工序数</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
<el-col :span="12" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">今日完成工序</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
</el-row>
<div style="height: 34vh;position: relative;">
<div style="height: 50vh;position: relative;">
<dv-border-box-1>
<div class="chartBlockTitle">车间各工段生产产品数</div>
<dv-capsule-chart :config="config_left1" class="leftChartBlock1"/>
</dv-border-box-1>
</div>
<div style="height: 34vh;">
<div style="height: 40vh;">
<dv-border-box-1>
<div class="chartBlockTitle">产品占比</div>
<dv-active-ring-chart :config="config_left2" class="leftChartBlock2"/>
@ -87,6 +23,32 @@
</div>
</el-col>
<el-col :span="12">
<el-row>
<el-col :span="6" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">今日工序报工量</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
<el-col :span="6" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">在产产品数</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
<el-col :span="6" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">本月完工工单</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
<el-col :span="6" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">本月计划产量</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
</el-row>
<div class="middleBlock">
<div style="height: 38vh;">
<dv-border-box-1>
@ -94,38 +56,80 @@
<dv-scroll-board :config="config_middle_top" class="middleTableBlock1"/>
</dv-border-box-1>
</div>
<div style="height: 41vh;">
<div style="height: 41vh;" class="eq-panel">
<dv-border-box-1>
<div class="chartBlockTitle">设备列表</div>
<dv-scroll-board :config="config_middle_bottom" class="middleTableBlock2"/>
<div class="eq-inner">
<div class="eq-header">
<div class="eq-title">
<span class="eq-title-bar"></span>
<span class="eq-title-icon"></span>
拉丝设备集群 · 实时状态
</div>
<div class="eq-online-badge">在线 {{ onlineCount }}/{{ equipmentList.length }}</div>
</div>
<div class="eq-grid" ref="eqGrid">
<div
v-for="(item, idx) in scrollItems"
:key="idx"
class="eq-card"
:class="item.isRunning ? 'eq-card--run' : 'eq-card--stop'"
>
<div class="eq-card-name">{{ item.name }}</div>
<div class="eq-card-center">
<span class="eq-dot" :class="item.isRunning ? 'eq-dot--green' : 'eq-dot--red'"></span>
<span class="eq-card-state" :class="item.isRunning ? 'state-run' : 'state-stop'">
{{ item.running_state_text }}
</span>
</div>
<div class="eq-card-sub">{{ item.isRunning ? item.number : '待机中' }}</div>
</div>
</div>
<div class="eq-footer">
<span class="eq-foot-item">
<span class="eq-dot eq-dot--green eq-dot--sm"></span>运行中 · {{ onlineCount }}
</span>
<span class="eq-foot-item">
<span class="eq-dot eq-dot--red eq-dot--sm"></span>停机/维护 · {{ equipmentList.length - onlineCount }}
</span>
<span class="eq-foot-update"> last update: {{ lastUpdateText }}</span>
</div>
</div>
</dv-border-box-1>
</div>
</div>
</el-col>
<el-col :span="6">
<div class="rightBlock">
<el-row style="margin-bottom: 1vh;">
<el-col :span="12" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">在制工单数</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
<el-col :span="12" class="numBlock">
<dv-border-box-12>
<div class="numBlock_title">本月交付数</div>
<div class="numBlock_value">123</div>
</dv-border-box-12>
</el-col>
</el-row>
<div style="height: 34vh;">
<div style="height: 55vh;" class="perf-panel">
<dv-border-box-1>
<div class="chartBlockTitle">每个人日产量</div>
<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%;"/> -->
<div class="perf-inner">
<div class="perf-header">
<div class="perf-title">
<span class="perf-title-bar"></span>
<span class="perf-title-icon">👥</span>
人员日产量 TOP5
</div>
<div class="perf-unit">单位: </div>
</div>
<div class="perf-list" ref="perfList">
<div class="perf-row" v-for="(item, idx) in scrollPerfItems" :key="idx">
<div class="perf-avatar">{{ item.操作人 ? item.操作人.charAt(0) : '?' }}</div>
<div class="perf-name">{{ item.操作人 }}</div>
<div class="perf-count">
<span class="perf-num">{{ item.生产数 }}</span>
<span class="perf-unit-sm"></span>
</div>
</div>
</div>
<div class="perf-footer">
平均效率 {{ avgEfficiency }}%
<span class="perf-lightning"></span>
标兵: {{ topPerson }}
</div>
</div>
</dv-border-box-1>
</div>
<div style="height: 34vh;">
<div style="height: 35vh;">
<dv-border-box-1>
<div class="chartBlockTitle">车间整体产品统计</div>
<scEcharts :option="chartOption2" style="height: 27.5vh;width: 90%;left: 5%;"/>
@ -414,22 +418,12 @@ export default {
header: ['任务编号', '产出产品', '任务量', '合格数'],
data: []
},
config_middle_bottom:{
rowNum:10,
headerBGC: 'rgba(0,0,0,0)',
oddRowBGC: 'rgba(0,0,0,0)',
evenRowBGC: 'rgba(0,0,0,0)',
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: []
},
equipmentList: [],
lastUpdateSeconds: 0,
lastUpdateInterval: null,
scrollTimer: null,
performanceList: [],
perfScrollTimer: null,
currentTime: "",
currentDay: "",
today: "",
@ -439,6 +433,43 @@ export default {
mgroups:['洗棒','捆棒','拉单丝','捆一次棒','一次复丝','捆二次棒','二次复丝'],
};
},
computed: {
onlineCount() {
return this.equipmentList.filter(e => e.isRunning).length;
},
lastUpdateText() {
return this.lastUpdateSeconds > 0 ? `${this.lastUpdateSeconds}s前` : '刚刚';
},
//
scrollItems() {
if (this.equipmentList.length === 0) return [];
return [...this.equipmentList, ...this.equipmentList];
},
//
sortedPerfList() {
return [...this.performanceList]
.sort((a, b) => Number(b.生产数) - Number(a.生产数));
},
//
scrollPerfItems() {
if (!this.sortedPerfList.length) return [];
return [...this.sortedPerfList, ...this.sortedPerfList];
},
// = /
avgEfficiency() {
if (!this.performanceList.length) return 0;
const totalProd = this.performanceList.reduce((s, i) => s + Number(i.生产数 || 0), 0);
const totalOk = this.performanceList.reduce((s, i) => s + Number(i.合格数 || 0), 0);
if (!totalProd) return 0;
return Math.round(totalOk / totalProd * 100);
},
// =
topPerson() {
if (!this.performanceList.length) return '-';
return [...this.performanceList]
.sort((a, b) => Number(b.生产数) - Number(a.生产数))[0]?.操作人 || '-';
},
},
mounted() {
let that = this;
//
@ -447,6 +478,7 @@ export default {
this.showTime();
}, 1000);
that.mgroupsforEach();
that.getEquipment();
that.getMgroups();
//
that.getEveryoneCount();
@ -505,7 +537,6 @@ export default {
mgroupsforEach(){
let that = this;
that.mgroups.forEach((item)=>{
that.getEquipment(item);
that.getMtask1(item);
})
},
@ -546,46 +577,78 @@ export default {
//
getEquipment() {
let that = this;
let params = {page: 0, belong_dept__name:'拉丝排板班组',
// query: " { id, name, number, model, state ,mgroup_name }"
};
that.config_middle_bottom.data = [];
let params = { page: 0, belong_dept__name: '拉丝排板班组' };
that.equipmentList = [];
clearInterval(that.lastUpdateInterval);
that.lastUpdateSeconds = 0;
that.$API.em.equipment.list.req(params).then((res) => {
if(res.length>0){
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);
})
that.equipmentList.push({
id: item.id,
name: item.name,
number: item.number,
running_state_text: runningStateEnum[item.running_state]?.text || '未知',
mgroup_name: item.mgroup_name,
isRunning: item.running_state == 10,
});
});
}
})
that.lastUpdateSeconds = 0;
that.lastUpdateInterval = setInterval(() => {
that.lastUpdateSeconds++;
}, 1000);
that.$nextTick(() => { that.startAutoScroll(); });
});
},
startPerfScroll() {
const that = this;
clearInterval(this.perfScrollTimer);
this.$nextTick(() => {
const el = that.$refs.perfList;
if (!el) return;
const halfHeight = el.scrollHeight / 2;
if (halfHeight <= el.clientHeight + 1) return;
that.perfScrollTimer = setInterval(() => {
el.scrollTop += 1;
if (el.scrollTop >= halfHeight) {
el.scrollTop = 0;
}
}, 40);
});
},
startAutoScroll() {
const that = this;
clearInterval(this.scrollTimer);
this.$nextTick(() => {
const el = that.$refs.eqGrid;
if (!el) return;
// scrollItems halfHeight
const halfHeight = el.scrollHeight / 2;
//
if (halfHeight <= el.clientHeight + 1) return;
that.scrollTimer = setInterval(() => {
el.scrollTop += 1;
//
if (el.scrollTop >= halfHeight) {
el.scrollTop = 0;
}
}, 40);
});
},
//
getEveryoneCount(){
let that = this;
that.config_right_top.data = [];
that.performanceList = [];
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
let params = {
query: {start_date:date,end_date:date,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);
})
if(res.data2.ds0.length > 0){
that.performanceList = res.data2.ds0;
}
that.$nextTick(() => { that.startPerfScroll(); });
});
},
//
@ -692,14 +755,14 @@ export default {
}
.leftChartBlock1{
width: 90%;
height: 28vh;
height: 43vh;
z-index: 999;
left: 5%;
border-radius: 3vh;
}
.leftChartBlock2{
width:100%;
height: 28vh;
height: 35vh;
}
.middleTableBlock1{
width:94%;
@ -725,4 +788,264 @@ export default {
font-weight: 600;
border-bottom: 1px solid rgb(83 198 243);
}
/* ===== 设备卡片面板 ===== */
.eq-panel { position: relative; }
/* dv-border-box-1 内层弹性布局,严格撑满边框内部 */
.eq-inner {
position: absolute;
inset: 2.5%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.eq-header {
flex-shrink: 0;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 1.2vh;
height: 4vh;
border-bottom: 1px solid rgba(83, 198, 243, 0.25);
}
.eq-title {
display: flex;
align-items: center;
gap: 0.4vh;
font-size: 1.5vh;
font-weight: 600;
color: #e0f4ff;
}
.eq-title-bar {
display: inline-block;
width: 3px;
height: 1.6vh;
background: #00b4ff;
border-radius: 2px;
margin-right: 2px;
}
.eq-title-icon { font-style: normal; color: #ff9d3e; font-size: 1.4vh; }
.eq-online-badge { font-size: 1.2vh; color: rgba(180, 230, 255, 0.7); }
/* 卡片网格 — flex:1 填充剩余空间overflow hidden 由 JS 控制滚动 */
.eq-grid {
flex: 1;
display: grid;
grid-template-columns: repeat(3, 1fr);
align-content: start;
gap: 0.5vh;
padding: 0.5vh 0.8vh;
overflow: hidden; /* JS 滚动,隐藏滚动条 */
overflow-y: hidden;
}
.eq-card {
background: rgba(8, 25, 45, 0.85);
border-radius: 0.8vh;
border: 1px solid rgba(40, 80, 120, 0.5);
padding: 0.4vh 0.3vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 0.3vh;
}
.eq-card--run {
border-color: rgba(0, 200, 100, 0.35);
box-shadow: inset 0 0 8px rgba(0, 200, 100, 0.06);
}
.eq-card--stop {
border-color: rgba(80, 90, 110, 0.45);
}
.eq-card-name {
font-size: 1.05vh;
color: rgba(180, 220, 255, 0.9);
background: rgba(0, 55, 100, 0.55);
padding: 0.1vh 0.6vh;
border-radius: 0.4vh;
border: 1px solid rgba(80, 160, 220, 0.3);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 95%;
}
.eq-card-center {
display: flex;
align-items: center;
gap: 0.5vh;
}
.eq-card-state {
font-size: 1.5vh;
font-weight: bold;
}
.state-run { color: #00e676; }
.state-stop { color: #ff5252; }
.eq-card-sub {
font-size: 0.9vh;
color: rgba(140, 195, 225, 0.55);
}
/* 指示点 */
.eq-dot {
display: inline-block;
border-radius: 50%;
flex-shrink: 0;
width: 1.1vh;
height: 1.1vh;
}
.eq-dot--green {
background: #00e676;
box-shadow: 0 0 5px #00e676, 0 0 12px rgba(0, 230, 118, 0.5);
animation: pulse-green 2s ease-in-out infinite;
}
.eq-dot--red {
background: #ff5252;
box-shadow: 0 0 5px #ff5252, 0 0 10px rgba(255, 82, 82, 0.45);
}
.eq-dot--sm { width: 0.8vh; height: 0.8vh; }
@keyframes pulse-green {
0%, 100% { box-shadow: 0 0 4px #00e676, 0 0 10px rgba(0,230,118,0.4); }
50% { box-shadow: 0 0 8px #00e676, 0 0 18px rgba(0,230,118,0.75); }
}
/* 底栏 */
.eq-footer {
flex-shrink: 0;
display: flex;
align-items: center;
padding: 0 1.2vh;
height: 3.5vh;
border-top: 1px solid rgba(83, 198, 243, 0.2);
gap: 2vh;
}
.eq-foot-item {
display: flex;
align-items: center;
gap: 0.5vh;
font-size: 1.1vh;
color: rgba(180, 220, 255, 0.8);
}
.eq-foot-update {
margin-left: auto;
font-size: 1.05vh;
color: rgba(120, 175, 215, 0.55);
}
/* ===== 人员日产量 TOP5 ===== */
.perf-panel { position: relative; }
.perf-inner {
position: absolute;
inset: 2.5%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.perf-header {
flex-shrink: 0;
display: flex;
justify-content: space-between;
align-items: center;
height: 4vh;
padding: 0 1vh;
border-bottom: 1px solid rgba(83, 198, 243, 0.2);
}
.perf-title {
display: flex;
align-items: center;
gap: 0.5vh;
font-size: 1.5vh;
font-weight: 600;
color: #e0f4ff;
}
.perf-title-bar {
display: inline-block;
width: 3px;
height: 1.8vh;
background: #00b4ff;
border-radius: 2px;
}
.perf-title-icon { font-style: normal; font-size: 1.4vh; }
.perf-unit { font-size: 1.2vh; color: rgba(180, 220, 255, 0.55); }
/* 列表区 */
.perf-list {
flex: 1;
overflow: hidden; /* JS 控制滚动,隐藏滚动条 */
padding: 0 1vh;
}
.perf-row {
display: flex;
align-items: center;
gap: 1.2vh;
height: 5.2vh; /* 固定行高,保证无缝滚动节奏一致 */
border-bottom: 1px solid rgba(83, 198, 243, 0.12);
flex-shrink: 0;
}
/* 头像圆圈 */
.perf-avatar {
flex-shrink: 0;
width: 3.6vh;
height: 3.6vh;
border-radius: 50%;
background: linear-gradient(135deg, #1a6fa8 0%, #0d4a7a 100%);
border: 1.5px solid rgba(100, 180, 255, 0.5);
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5vh;
font-weight: 600;
color: #b8e0ff;
}
.perf-name {
flex: 1;
font-size: 1.6vh;
color: rgba(210, 235, 255, 0.9);
}
.perf-count {
display: flex;
align-items: baseline;
gap: 0.3vh;
}
.perf-num {
font-size: 2.4vh;
font-weight: 700;
color: #c8ff50;
font-family: "myfont", "Microsoft Yahei";
letter-spacing: 1px;
}
.perf-unit-sm {
font-size: 1.1vh;
color: rgba(180, 220, 160, 0.7);
}
/* 底部标兵栏 */
.perf-footer {
flex-shrink: 0;
height: 4vh;
display: flex;
align-items: center;
justify-content: center;
gap: 0.6vh;
background: rgba(15, 40, 65, 0.8);
border-radius: 2vh;
font-size: 1.35vh;
color: rgba(200, 230, 255, 0.85);
border: 1px solid rgba(60, 120, 180, 0.3);
margin-top: 0.5vh;
}
.perf-lightning {
font-style: normal;
color: #ff9d3e;
font-size: 1.4vh;
}
</style>

View File

@ -19,6 +19,7 @@
:value="item.id"
></el-option>
</el-select>
<el-text style="margin-left: 1vw;cursor: pointer;" @click="handleWatch">仓库总数{{ totalCount }}</el-text>
</div>
<div class="right-panel">
<el-input
@ -75,9 +76,6 @@
<el-table-column width="80">
<template #default="scope">
<el-button @click="printMaterial(scope.row)" type="text">打签</el-button>
<!-- <el-link :underline="false" type="primary"
@click="handleWatch(scope.row)"
>流程图</el-link> -->
</template>
</el-table-column>
</scTable>
@ -89,11 +87,6 @@
<el-header>
<div class="left-panel">
<span style="font-size: 14px">车间库存</span>
<!-- <el-select v-model="queryWm.material__process" clearable placeholder="已到工序" @change="handleQueryWm"
style="margin-left: 4px">
<el-option v-for="item in processOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select> -->
</div>
</el-header>
<el-main>
@ -146,15 +139,18 @@
:mtype="wmtype"
:apiObj="apiObjPrint"
></print-dialog>
<el-drawer v-model="limitedWatch" title="工艺路线流程图" size="80%" @closeDialog="limitedWatch = false">
<scDegra
v-if="limitedWatch"
ref="degraDialogs"
:nodes="nodes"
:edges="edges"
:rankdir="'LR'"
>
</scDegra>
<el-drawer v-model="limitedWatch" title="物料仓库合格库存统计" size="80%" @closeDialog="limitedWatch = false">
<el-container>
<el-header style="height: 40%;">
<scTable :data="tableData" hideDo hidePagination row-key="id" style="width: 100%;">
<el-table-column label="物料名" prop="material_name"></el-table-column>
<el-table-column label="数量" prop="count"></el-table-column>
</scTable>
</el-header>
<el-main>
<scEcharts :option="echartsOptions" height="100%"></scEcharts>
</el-main>
</el-container>
</el-drawer>
</el-container>
</template>
@ -176,8 +172,10 @@ export default {
paramsWm: { count__gte: 1, material__type: 10 },
nodes:[],
edges:[],
tableData:[],
queryWm: {},
wmtype:0,
totalCount:0,
print_m:false,
limitedWatch:false,
materialsVisible:false,
@ -240,9 +238,28 @@ export default {
},
mounted() {
this.getWarehouse();
// this.getProcessOptions()
this.getProductCount();
},
methods: {
getProductCount(){
let that = this;
let query ={
material_types: "10",
select_material: "material.name as material_name",
groupby_material: "material.name"
};
that.$API.bi.dataset.exec.req("materialCount2", {query:query }).then((res) => {
let data = that.tableData = res.data2.ds0;
let totalCount = 0;
data.forEach(item => {
totalCount += item.count;
});
that.totalCount = totalCount;
if (res.echart_options) {
that.echartsOptions = JSON.parse(res.echart_options);
}
})
},
getWarehouse() {
this.$API.inm.warehouse.list.req({ page: 0 }).then((res) => {
this.warehouseOptions = res;
@ -262,16 +279,8 @@ export default {
resetQuery() {
this.query = {};
},
handleWatch(row) {
let that = this;
that.$API.wpm.batchlog.dag.req({batch:row.batch}).then((res) => {
that.nodes = res.nodes;
that.edges = res.edges;
that.limitedWatch = true;
that.$nextTick(() => {
that.$refs.degraDialogs.open();
});
})
handleWatch() {
this.limitedWatch = true;
},
//
printMaterial(row,type){

View File

@ -357,7 +357,7 @@ export default {
},
apiObjM: this.$API.mtm.material.list,
paramsMIn: { type__in: '10,20,30',ordering: '-create_time',query:'{full_name,id,is_hidden}'},
paramsMOut: { type__in: '10,20',ordering: '-create_time',query:'{full_name,id,is_hidden}'},
paramsMOut: { type__in: '10,20,30',ordering: '-create_time',query:'{full_name,id,is_hidden}'},
};
},
mounted() {

View File

@ -110,7 +110,13 @@
<span>{{scope.row.data.分检_缺陷项_扭转角不合格?scope.row.data.分检_缺陷项_扭转角不合格:0}}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" class-name="colorheader7">
<el-table-column label="开台人" align="center" class-name="colorheader7">
<template #default="scope">
<span v-if="scope.row.data.喷码_一体刀_操作人">{{scope.row.data.喷码_一体刀_操作人}}</span>
<span v-if="scope.row.data.喷码_磨床开台_操作人">{{scope.row.data.喷码_磨床开台_操作人}}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" class-name="colorheader1">
<template #default="scope">
<span>{{ scope.row.data.分检_缺陷项_备注 }}</span>
</template>

View File

@ -0,0 +1,222 @@
<template>
<el-container>
<el-header>
<div class="left-panel"></div>
<div class="right-panel">
<el-date-picker
v-model="query.start_date"
type="date"
value-format="YYYY-MM-DD"
placeholder="开始时间"
style="width: 150px"
/>
<el-date-picker
v-model="query.end_date"
type="date"
value-format="YYYY-MM-DD"
placeholder="结束时间"
style="margin-left: 2px; width: 150px"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery2"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<el-tabs type="border-card" v-model="query.mgroup_name" @tab-click="handleClick" style="height: 100%;" lazy>
<el-tab-pane
v-for="tab in tabs"
:key="tab"
:name="tab"
:label="tab"
style="height: 100%;"
>
<el-container v-if="query.mgroup_name === tab">
<el-main>
<scTable
v-if="showTable"
ref="table1"
:data="tableData"
row-key="id"
hidePagination
hideDo
stripe
>
<el-table-column type="index" width="50" fixed="left"/>
<el-table-column label="员工" prop="员工"/>
<el-table-column label="物料名" prop="物料名" :filters="nameFilters" :filter-method="filterName" filter-placement="bottom-end"/>
<el-table-column label="总数">
<template #default="scope">
<span v-if="scope.row.总切片数">{{ scope.row.总切片数 }}</span>
</template>
</el-table-column>
<el-table-column label="剪切">
<template #default="scope">
<span v-if="scope.row.剪切合格">{{ ((scope.row.剪切合格 / scope.row.总切片数) * 100).toFixed(2) }}%</span>
</template>
</el-table-column>
<el-table-column label="剪切加工率">
<template #default="scope">
<span v-if="scope.row['剪切¢18.3mm不合格']">{{ (((scope.row.总切片数 - scope.row['剪切18.3mm不合格'].含) / scope.row.总切片数) * 100).toFixed(2) }}%</span>
<span v-else>100%</span>
</template>
</el-table-column>
<el-table-column label="暗点">
<template #default="scope">
<span v-if="scope.row.暗点合格">{{ ((scope.row.暗点合格.含 / scope.row.总切片数) * 100).toFixed(2) }}%</span>
<span v-else>0%</span>
</template>
</el-table-column>
<el-table-column label="长点率">
<template #default="scope">
<span>{{ ((scope.row.长点数 / scope.row.总切片数) * 100).toFixed(2) }}%</span>
</template>
</el-table-column>
<el-table-column label="加工率">
<template #default="scope">
<span>{{ ((scope.row.加工率数 / scope.row.总切片数) * 100).toFixed(2) }}%</span>
</template>
</el-table-column>
<el-table-column label="合格率" prop="合格率">
<template #default="scope">
<span>{{ ((scope.row.合格率数 / scope.row.总切片数) * 100).toFixed(2) }}%</span>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-tab-pane>
</el-tabs>
</el-main>
<el-drawer v-model="visible" :title="userName+'板段列表'" size="50%" direction="rtl" append-to-body destroy-on-close>
<el-card shadow="never">
<div v-for="(item,index) in detailRow" :key="item" style="height:22px;border-bottom: 1px solid #efefef;">
<span style="margin-right:10px;width: 18px;display: inline-block;">{{ index+1 }} </span>
{{ item }}
</div>
</el-card>
</el-drawer>
</el-container>
</template>
<script>
export default {
name: "workHoursRY",
data() {
return {
visible: false,
showTable: false,
userName: '',
tabs: ['拉单丝' , '一次复丝', '排一次棒', '二次复丝', '排二次棒'],
query: {
end_date: '',
start_date: '',
mgroup_name: "拉单丝",
},
end_date: '',
start_date: '',
mgruops: [],
tableData: [],
detailRow: [],
nameFilters: []
};
},
mounted() {
let that = this;
let date = new Date();
that.end_date = that.query.end_date = that.$TOOL.dateFormat2(date);
that.start_date = that.query.start_date = that.query.end_date.split('-')[0] + '-' + that.query.end_date.split('-')[1] + '-01';
that.getData();
},
methods: {
getData() {
let that = this;
let params = {}, biStr = '', nameList = [], names = [];
let query = that.query;
if (that.query.start_date == '' || that.query.start_date == null) {
that.query.start_date = query.start_date = that.start_date;
} else {
query.start_date = that.query.start_date;
}
if (that.query.end_date == '' || that.query.end_date == null) {
that.query.end_date = query.end_date = that.end_date;
} else {
query.end_date = that.query.end_date;
}
params.query = query;
console.log('params', params);
if (that.query.mgroup_name == '拉单丝') {
biStr = 'product_defect_lds';
} else if (that.query.mgroup_name == '一次复丝' || that.query.mgroup_name == '排一次棒' || that.query.mgroup_name == '二次复丝' || that.query.mgroup_name == '排二次棒') {
biStr = 'product_defect_jjcj';
}
that.$API.bi.dataset.exec.req(biStr, params).then((res) => {
let data = res.data2.ds0;
data.forEach(item => {
if (names.indexOf(item.物料名) > -1) {} else {
names.push(item.物料名);
nameList.push({ text: item.物料名, value: item.物料名 });
}
if (item.缺陷分布 !== null) {
let defect = JSON.parse(item.缺陷分布);
for (let key in defect) {
item[key] = defect[key];
}
}
item.长点数 = item.暗点不合格 ? item.暗点重 ? item.暗点不合格. + item.暗点重. : item.暗点不合格. : item.暗点重 ? item.暗点重. : 0;
item.剪切合格 = item['剪切¢18.3mm不合格'] ? item['剪切¢18.3mm可加工'] ? item.总切片数 - item['剪切¢18.3mm可加工']. - item['剪切¢18.3mm不合格']. : item.总切片数 - item['剪切¢18.3mm不合格']. : item['剪切¢18.3mm可加工'] ? item.总切片数 - item['剪切¢18.3mm可加工']. : item.总切片数;
let count_hgls = item.暗点合格 ? item.暗点合格. : 0;
let count1 = item['剪切¢18.3mm不合格'] ? item.总切片数 - item.长点数 - item['剪切¢18.3mm不合格']. : item.总切片数 - item.长点数;
if (item['剪切¢18.3mm不合格'] && item['剪切¢18.3mm不合格']. !== null) {
if (item['剪切¢18.3mm不合格'].['剪切¢18.3mm不合格+暗点不合格']) {
count1 = count1 + item['剪切¢18.3mm不合格+暗点不合格'];
}
if (item['剪切¢18.3mm不合格'].['剪切¢18.3mm不合格+暗点重']) {
count1 = count1 + item['剪切¢18.3mm不合格+暗点重'];
}
if (item['剪切¢18.3mm可加工'].['剪切¢18.3mm可加工+暗点合格']) {
count_hgls = count_hgls - item['剪切¢18.3mm可加工'].['剪切¢18.3mm可加工+暗点合格'];
}
if (item['剪切¢18.3mm可加工'].['剪切¢18.3mm不合格+暗点合格']) {
count_hgls = count_hgls - item['剪切¢18.3mm不合格+暗点合格'];
}
}
item.加工率数 = count1;
item.合格率数 = count_hgls;
});
that.$nextTick(() => {
console.log('data', data);
that.nameFilters = nameList;
that.tableData = data;
that.showTable = true;
});
});
},
handleQuery2() {
this.getData();
},
filterName(value, row) {
return row.物料名 == value;
},
handleClick(e) {
let that = this;
that.query.end_date = that.end_date;
that.query.start_date = that.start_date;
that.query.mgroup_name = e.props.name;
that.showTable = false;
that.getData();
},
numberClick(row) {
let that = this;
that.detailRow = [];
that.userName = row.员工;
that.banduanNum = row.切片后缀;
that.detailRow = row.切片编号列表;
that.visible = true;
},
},
};
</script>
<style scoped>
</style>

View File

@ -3,20 +3,6 @@
<el-header>
<div class="left-panel"></div>
<div class="right-panel">
<el-select
v-if="activeName=='gongxu'"
v-model="query2.process_name"
placeholder="选择工序"
clearable
filterable
>
<el-option
v-for="item in processList"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<el-date-picker
v-model="query.start_date"
type="date"
@ -61,7 +47,7 @@
</el-table-column>
<el-table-column label="暗点" align="center">
<template #default="scope">
<span v-if="scope.row.暗点">{{ scope.row.暗点.含?scope.row.暗点.含:'' }}</span>
<span v-if="scope.row.暗点不合格">{{ scope.row.暗点不合格.含?scope.row.暗点不合格.含:'' }}</span>
</template>
</el-table-column>
<el-table-column label="暗点重" align="center">
@ -146,7 +132,7 @@
</el-table-column>
<el-table-column label="暗点" align="center">
<template #default="scope">
<span v-if="scope.row.暗点">{{ scope.row.暗点.含?scope.row.暗点.含:'' }}</span>
<span v-if="scope.row.暗点不合格">{{ scope.row.暗点不合格.含?scope.row.暗点不合格.含:'' }}</span>
</template>
</el-table-column>
<el-table-column label="暗点重" align="center">
@ -229,27 +215,18 @@ export default {
showTable:false,
userName:'',
activeName: 'product',
query1:{
number_contains:'',
time_gte:'',
time_lte:'',
},
query2:{
process_name:'压板出炉',
},
query:{
end_date:'',
start_date:'',
select_cols: "",
mgroup_name: "扭转",
testmgroup_name: "扭后检测",
testmgroup_name: "毛坯检测",
},
end_date:'',
start_date:'',
mgruops:[],
tableData:[],
detailRow:[],
processList:['装模','装炉','压板出炉','脱膜测量'],
params:{cate:'热压'},
};
},
@ -293,6 +270,7 @@ export default {
}
})
that.$nextTick(() => {
console.log('data',data);
that.tableData = data;
that.showTable=true;
})

View File

@ -88,13 +88,13 @@
</el-table-column>
<el-table-column label="炸纹">
<template #default="scope">
<span v-if="scope.row.炸纹">{{scope.row.炸纹.含}}</span>
<span v-if="scope.row.扭后炸纹">{{scope.row.扭后炸纹.含}}</span>
<span v-else>0</span>
</template>
</el-table-column>
<el-table-column label="炸废">
<template #default="scope">
<span v-if="scope.row.炸废">{{scope.row.炸废.含}}</span>
<span v-if="scope.row.扭后炸废">{{scope.row.扭后炸废.含}}</span>
<span v-else>0</span>
</template>
</el-table-column>
@ -161,13 +161,13 @@
</el-table-column>
<el-table-column label="炸纹">
<template #default="scope">
<span v-if="scope.row.炸纹">{{scope.row.炸纹.含}}</span>
<span v-if="scope.row.扭后炸纹">{{scope.row.扭后炸纹.含}}</span>
<span v-else>0</span>
</template>
</el-table-column>
<el-table-column label="炸废">
<template #default="scope">
<span v-if="scope.row.炸废">{{scope.row.炸废.含}}</span>
<span v-if="scope.row.扭后炸废">{{scope.row.扭后炸废.含}}</span>
<span v-else>0</span>
</template>
</el-table-column>
@ -230,13 +230,13 @@
</el-table-column>
<el-table-column label="炸纹">
<template #default="scope">
<span v-if="scope.row.炸纹">{{scope.row.炸纹.含}}</span>
<span v-if="scope.row.扭后炸纹">{{scope.row.扭后炸纹.含}}</span>
<span v-else>0</span>
</template>
</el-table-column>
<el-table-column label="炸废">
<template #default="scope">
<span v-if="scope.row.炸废">{{scope.row.炸废.含}}</span>
<span v-if="scope.row.扭后炸废">{{scope.row.扭后炸废.含}}</span>
<span v-else>0</span>
</template>
</el-table-column>
@ -269,6 +269,8 @@
stripe
>
<el-table-column type="index" width="50" fixed="left"/>
<el-table-column label="丝高" prop="丝高">
</el-table-column>
<el-table-column label="总数" prop="总切片数">
</el-table-column>
<el-table-column label="黑网重">
@ -297,13 +299,13 @@
</el-table-column>
<el-table-column label="炸纹">
<template #default="scope">
<span v-if="scope.row.炸纹">{{scope.row.炸纹.含}}</span>
<span v-if="scope.row.扭后炸纹">{{scope.row.扭后炸纹.含}}</span>
<span v-else>0</span>
</template>
</el-table-column>
<el-table-column label="炸废">
<template #default="scope">
<span v-if="scope.row.炸废">{{scope.row.炸废.含}}</span>
<span v-if="scope.row.扭后炸废">{{scope.row.扭后炸废.含}}</span>
<span v-else>0</span>
</template>
</el-table-column>
@ -344,11 +346,6 @@ export default {
showTable:false,
userName:'',
activeName: 'luhao',
query1:{
number_contains:'',
time_gte:'',
time_lte:'',
},
query2:{
process_name:'压板出炉',
},
@ -375,7 +372,8 @@ export default {
methods: {
getData(){
let that = this;
let params = {},query ={testmgroup_name:'扭转'},biStr = '';
// let params = {},query ={testmgroup_name:''},biStr = '';
let params = {},query ={},biStr = '';
if(that.query.start_date==''||that.query.start_date==null){
that.query.start_date = query.start_date = that.start_date;
}else{
@ -388,6 +386,8 @@ export default {
}
if(that.activeName=='luhao'){
query.select_cols = that.query.select_cols;
query.mgroup_name = '装炉压板出炉';
query.testmgroup_name = '扭后检测';
params.query = query;
biStr = 'product_defect_equip_mpjc';
}else if(that.activeName=='muju'){

View File

@ -41,6 +41,8 @@
:query="params"
id="exportDiv"
row-key="id"
:summary-method="getSummaries"
show-summary
stripe
>
<el-table-column type="index" width="50" fixed="left"/>
@ -60,6 +62,11 @@
<span>{{ scope.row.data.中检一_count_use }}</span>
</template>
</el-table-column>
<el-table-column label="合格数" fixed="left">
<template #default="scope">
<span>{{ scope.row.data.中检一_count_ok }}</span>
</template>
</el-table-column>
<el-table-column label="炸" align="center" class-name="colorheader1">
<el-table-column label="数量" class-name="colorheader1">
<template #default="scope">
@ -356,8 +363,67 @@ export default {
},
getCountQt(data,type){
let count_qt = 0,count = 0;
}
},
getSummaries({ columns, data }) {
const sums = [];
//
const totalCount = data.reduce((s, item) =>
s + Number(item.data['中检一_count_use'] || 0), 0);
// data
const countFieldMap = {
5: '中检一_count_use',
6: '中检一_count_ok',
7: '中检一_含缺陷_炸',
9: '中检一_含缺陷_偏',
11: '中检一_含缺陷_掉头',
13: '中检一_含缺陷_台阶划伤',
15: '中检一_含缺陷_柱面划伤',
17: '中检一_含缺陷_台棱',
19: '中检一_含缺陷_台糙',
21: '中检一_含缺陷_尺寸大/小',
23: '中检一_含缺陷_崩',
25: '中检一_含缺陷_修崩/炸',
27: '中检一_含缺陷_拆头',
29: '中检一_含缺陷_外黑',
31: '中检一_含缺陷_外磕',
33: '中检一_含缺陷_打毛/打台',
35: '中检一_含缺陷_喷码',
37: '中检一_含缺陷_掉皮',
39: '中检一_含缺陷_量崩',
41: '中检一_含缺陷_坑',
43: '中检一_count_ok',
};
//
const sumCache = {};
Object.entries(countFieldMap).forEach(([idx, field]) => {
sumCache[idx] = data.reduce((s, item) =>
s + Number(item.data[field] || 0), 0);
});
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = <p class="count_row">合计<br /><br />比率<br /></p>;
return;
}
if (countFieldMap[index] !== undefined) {
const sum = sumCache[index];
if (index === 5 || index === 6) {
// /
sums[index] = <p class="count_row"><div ref="borrowAmount1">{sum}</div><br /><div ref="borrowAmount2">-</div></p>;
} else {
const ratio = totalCount > 0
? Number(sum / totalCount * 100).toFixed(2)
: '0.00';
sums[index] = <p class="count_row"><div ref="borrowAmount1">{sum}</div><br /><div ref="borrowAmount2">{ratio}%</div></p>;
}
}
//
});
return sums;
},
},
};
</script>

View File

@ -381,13 +381,14 @@ export default {
let that = this;
let obj = {};
if(that.cate== 'do_in'){
obj.state = 10;
obj.material__process= that.process;
// obj.state = 10;
// obj.material__process= that.process;
obj.tag = 'done';
}else if(that.cate== 'return_in'){
obj.material__type = 40;
}
obj.page= 0;
obj.mgroupx= that.mgroupId;
obj.mgroup= that.mgroupId;
if (that.mgroupId != null &&that.mgroupId != undefined &&that.mgroupId != "") {
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
that.wbatchOptions = res;

View File

@ -337,16 +337,18 @@ export default {
this.cellsList = data.count_json_from;
}
},
getRoute() {
getRoute(material) {
let that = this;
that.$API.mtm.route.list
.req({ process: that.process, page: 0, routepack__state: 30 })
.then((res) => {
that.routeOptions = res;
if(res.length==1){
that.form.route = res[0].id;
}
});
let obj = { process:that.process,page: 0, routepack__state: 30};
if(material){
obj.material_in__in = material;
}
that.$API.mtm.route.list.req(obj).then((res) => {
that.routeOptions = res;
if(res.length==1){
that.form.route = res[0].id;
}
});
},
getMtask() {
let that = this;
@ -418,6 +420,7 @@ export default {
},
materialBatchChange(){
let that = this;
that.getRoute(that.selectObj.material);
that.form.batch = that.selectObj.batch;
that.form.count_use = that.selectObj.count_cando;
that.batch_count = that.selectObj.count;