Merge branch 'master' of http://gitea.xxhhcty.xyz:8080/zcdsj/factory_web
This commit is contained in:
commit
a0189dbe95
56
src/App.vue
56
src/App.vue
|
|
@ -167,18 +167,6 @@ export default {
|
||||||
.asyncColorSwitch .el-switch__label--left.is-active{
|
.asyncColorSwitch .el-switch__label--left.is-active{
|
||||||
color: #0052d9!important; /* 关闭状态的文本颜色 */
|
color: #0052d9!important; /* 关闭状态的文本颜色 */
|
||||||
}
|
}
|
||||||
// .el-table thead.is-group th.el-table__cell.colorheader1{
|
|
||||||
// background-color: rgb(255, 243, 202)!important;
|
|
||||||
// }
|
|
||||||
// .el-table thead.is-group th.el-table__cell.colorheader2{
|
|
||||||
// background-color: rgb(227, 242, 217)!important;
|
|
||||||
// }
|
|
||||||
// .el-table thead.is-group th.el-table__cell.colorheader3{
|
|
||||||
// background-color: rgb(250, 218, 222)!important;
|
|
||||||
// }
|
|
||||||
// .el-table thead.is-group th.el-table__cell.colorheader4{
|
|
||||||
// background-color: rgb(168, 218, 228)!important;
|
|
||||||
// }
|
|
||||||
.el-table thead th.el-table__cell.colorheader1,
|
.el-table thead th.el-table__cell.colorheader1,
|
||||||
.el-table thead.is-group th.el-table__cell.colorheader1{
|
.el-table thead.is-group th.el-table__cell.colorheader1{
|
||||||
background-color: rgba(246, 98, 98, 0.323)!important;
|
background-color: rgba(246, 98, 98, 0.323)!important;
|
||||||
|
|
@ -207,36 +195,24 @@ export default {
|
||||||
.el-table thead.is-group th.el-table__cell.colorheader7{
|
.el-table thead.is-group th.el-table__cell.colorheader7{
|
||||||
background-color: rgba(51, 15, 253, 0.317)!important;
|
background-color: rgba(51, 15, 253, 0.317)!important;
|
||||||
}
|
}
|
||||||
|
.totalFooterTable>.el-table__inner-wrapper>.el-table__footer-wrapper tfoot td.el-table__cell {
|
||||||
|
background-color: #a4e398;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #000000;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
// 排放系统
|
// 排放系统
|
||||||
|
|
||||||
// .el-popper {
|
|
||||||
// border-radius: 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .el-popper[data-popper-placement^=bottom]>.el-popper__arrow {
|
|
||||||
// top: -5px;
|
|
||||||
// display: none !important;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .el-popper.is-light {
|
|
||||||
// background: linear-gradient(to right, #116a7c, #92f2ff);
|
|
||||||
// border-image-source: linear-gradient(to right, #92f2ff, #116a7c);
|
|
||||||
// }
|
|
||||||
|
|
||||||
.enpMenu.el-dropdown-menu {
|
.enpMenu.el-dropdown-menu {
|
||||||
padding: 0.7vh 0.7vh 0.2vh;
|
padding: 0.7vh 0.7vh 0.2vh;
|
||||||
//background: linear-gradient(to right, #10608e, #1dabfd);
|
|
||||||
background: linear-gradient(to right, #053949, #107b90);
|
background: linear-gradient(to right, #053949, #107b90);
|
||||||
}
|
}
|
||||||
|
|
||||||
.enpMenu > .el-dropdown-menu__item {
|
.enpMenu > .el-dropdown-menu__item {
|
||||||
margin-bottom: 0.5vh;
|
margin-bottom: 0.5vh;
|
||||||
//background: linear-gradient(to right, #29d, #1dabfd);
|
|
||||||
background: linear-gradient(to right, #1b8fa4, #107b90);
|
background: linear-gradient(to right, #1b8fa4, #107b90);
|
||||||
}
|
}
|
||||||
|
|
||||||
.enpMenu > .el-dropdown-menu__item:not(.is-disabled):focus {
|
.enpMenu > .el-dropdown-menu__item:not(.is-disabled):focus {
|
||||||
//background: linear-gradient(to right, #10608e, #1dabfd);
|
|
||||||
background: linear-gradient(to right, #053949, #107b90);
|
background: linear-gradient(to right, #053949, #107b90);
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
@ -259,7 +235,6 @@ export default {
|
||||||
height: 92%;
|
height: 92%;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
top: 8%;
|
top: 8%;
|
||||||
// background-image: url('/public/img/enp_blue/bg_enp_half.png');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#enpTable .el-table {
|
#enpTable .el-table {
|
||||||
|
|
@ -321,25 +296,6 @@ export default {
|
||||||
.bigScreenTable table td {
|
.bigScreenTable table td {
|
||||||
font-size: 0.7vw !important;
|
font-size: 0.7vw !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// .searchSelect>.select-trigger>.el-input>.el-input__wrapper {
|
|
||||||
// width: 7vw;
|
|
||||||
// height: 3vh;
|
|
||||||
// border: none !important;
|
|
||||||
// box-shadow: none !important;
|
|
||||||
// background-size: 100% 100%;
|
|
||||||
// background-image: url('/public/img/enp_blue/selectBg.png');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .searchInput>.el-input__wrapper {
|
|
||||||
// width: 7vw;
|
|
||||||
// height: 3vh;
|
|
||||||
// border: none !important;
|
|
||||||
// box-shadow: none !important;
|
|
||||||
// background-size: 100% 100%;
|
|
||||||
// background-image: url('/public/img/enp_blue/selectBg.png');
|
|
||||||
// }
|
|
||||||
|
|
||||||
.enpCheckbox > .el-checkbox > .el-checkbox__label {
|
.enpCheckbox > .el-checkbox > .el-checkbox__label {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,13 @@ export default {
|
||||||
return await http.get(this.url, data);
|
return await http.get(this.url, data);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
cates: {
|
||||||
|
url: `${config.API_URL}/wf/workflow/cates/`,
|
||||||
|
name: "工作流分类",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.get(this.url, data);
|
||||||
|
}
|
||||||
|
},
|
||||||
item: {
|
item: {
|
||||||
name: "工作流详情",
|
name: "工作流详情",
|
||||||
req: async function(id){
|
req: async function(id){
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<div class="scTable-table" :style="{ height: _table_height }">
|
<div class="scTable-table" :style="{ height: _table_height }">
|
||||||
<el-table v-bind="$attrs" :data="tableData" :row-key="rowKey" :key="toggleIndex" ref="scTable"
|
<el-table v-bind="$attrs" :data="tableData" :row-key="rowKey" :key="toggleIndex" ref="scTable"
|
||||||
:height="height == 'auto' ? null : '100%'" :size="config.size" :border="config.border" :stripe="config.stripe"
|
:height="height == 'auto' ? null : '100%'" :size="config.size" :border="config.border" :stripe="config.stripe"
|
||||||
:summary-method="remoteSummary ? remoteSummaryMethod : summaryMethod" @sort-change="sortChange"
|
:summary-method="remoteSummary ? remoteSummaryMethod : summaryMethod" :expand-row-keys="expandRowKeys" @sort-change="sortChange"
|
||||||
@filter-change="filterChange" @selection-change="selectionChange">
|
@filter-change="filterChange" @selection-change="selectionChange">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<template v-for="(item, index) in userColumn" :key="index">
|
<template v-for="(item, index) in userColumn" :key="index">
|
||||||
|
|
@ -97,6 +97,7 @@ export default {
|
||||||
columnSetting,
|
columnSetting,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
expendShow:{ type: Boolean, default: false },
|
||||||
tableName: { type: String, default: "" },
|
tableName: { type: String, default: "" },
|
||||||
apiObj: { type: Object, default: () => { } },
|
apiObj: { type: Object, default: () => { } },
|
||||||
params: { type: Object, default: () => ({}) },
|
params: { type: Object, default: () => ({}) },
|
||||||
|
|
@ -134,6 +135,9 @@ export default {
|
||||||
this.tableData = this.data;
|
this.tableData = this.data;
|
||||||
this.total = this.tableData.length;
|
this.total = this.tableData.length;
|
||||||
},
|
},
|
||||||
|
expendShow(){
|
||||||
|
this.toggleExpandAll();
|
||||||
|
},
|
||||||
apiObj() {
|
apiObj() {
|
||||||
this.tableParams = this.params;
|
this.tableParams = this.params;
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
|
@ -161,6 +165,7 @@ export default {
|
||||||
emptyText: "暂无数据",
|
emptyText: "暂无数据",
|
||||||
toggleIndex: 0,
|
toggleIndex: 0,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
expandRowKeys:[],
|
||||||
total: 0,
|
total: 0,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
prop: null,
|
prop: null,
|
||||||
|
|
@ -207,6 +212,10 @@ export default {
|
||||||
this.isActivat = false;
|
this.isActivat = false;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//滚动到顶部
|
||||||
|
scrollToTop() {
|
||||||
|
this.$refs.scTable.scrollTo(0, 0);
|
||||||
|
},
|
||||||
//获取列
|
//获取列
|
||||||
async getCustomColumn() {
|
async getCustomColumn() {
|
||||||
const userColumn = await config.columnSettingGet(
|
const userColumn = await config.columnSettingGet(
|
||||||
|
|
@ -518,6 +527,19 @@ export default {
|
||||||
sort(prop, order) {
|
sort(prop, order) {
|
||||||
this.$refs.scTable.sort(prop, order);
|
this.$refs.scTable.sort(prop, order);
|
||||||
},
|
},
|
||||||
|
// 控制展开/收起所有行
|
||||||
|
toggleExpandAll() {
|
||||||
|
const isExpandAll = this.expandRowKeys.length === this.$refs.scTable.data.length;
|
||||||
|
if (isExpandAll) {
|
||||||
|
this.expandRowKeys = []; // 收起所有
|
||||||
|
} else {
|
||||||
|
this.expandRowKeys = this.$refs.scTable.data.map(item => item.id); // 展开所有
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 每次展开状态变化时更新 expandRowKeys
|
||||||
|
handleExpandChange(row, expandedRows) {
|
||||||
|
this.expandRowKeys = expandedRows.map(row => row.is); // 根据实际的唯一标识
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,714 @@
|
||||||
|
<template>
|
||||||
|
<el-container class="dashboard">
|
||||||
|
<el-header class="header">
|
||||||
|
<div class="title">倒角车间生产数据看板</div>
|
||||||
|
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main>
|
||||||
|
<!-- 倒角 -->
|
||||||
|
<el-row style="height: 60%" :gutter="10">
|
||||||
|
<el-col :span="12" style="height: 100%">
|
||||||
|
<!-- 设备状态 -->
|
||||||
|
<el-col style="height: 50%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">
|
||||||
|
设备状态
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon yxicon"></span>
|
||||||
|
<span>运行中</span>
|
||||||
|
<span class="eqNum">{{hh.yx}}台</span>
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon wyxIcon"></span>
|
||||||
|
<span>未运行</span>
|
||||||
|
<span class="eqNum">{{hh.wyx}}台</span>
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon gzIcon"></span>
|
||||||
|
<span>故障</span>
|
||||||
|
<span class="eqNum">{{hh.gz}}台</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 2px"></div>
|
||||||
|
<div class="boxmain" id="scrollContainer">
|
||||||
|
<dv-scroll-board :config="configDataEq" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- 库存 -->
|
||||||
|
<el-col style="height: 50%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">
|
||||||
|
倒角车间库存
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 2px"></div>
|
||||||
|
<div class="boxmain" id="scrollContainer">
|
||||||
|
<dv-scroll-board :config="configDataInm" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" style="height: 100%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">生产数统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="totalStatic">
|
||||||
|
<span class="totalStaticItem">日投产量</span>
|
||||||
|
<span class="totalStaticItem">日加工数</span>
|
||||||
|
<span class="totalStaticItem">日加工前不良</span>
|
||||||
|
<span class="totalStaticItem">日合格数</span>
|
||||||
|
<span class="totalStaticItem">日不合格数</span>
|
||||||
|
</div>
|
||||||
|
<div class="totalStatic">
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rtcs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgqbls }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rhgs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rbhgs }}</span>
|
||||||
|
</div>
|
||||||
|
<dv-scroll-board :config="configDatas" class="boxmain boxmainTopRight" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div style="height: 0.3%"></div>
|
||||||
|
<!-- 生产统计 分析 -->
|
||||||
|
<div style="height: 0.3%"></div>
|
||||||
|
<el-row style="height: 39%" :gutter="10">
|
||||||
|
<!-- 折线图 日加工数、日合格数、日合格率,近七天数据 -->
|
||||||
|
<el-col :span="12" style="height: 100%;">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">合格数统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain boxmainbottom" id="chart1"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- 饼状图 各不合格品 原因占比 -->
|
||||||
|
<el-col :span="12" style="height: 100%;">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">不合格占比统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain boxmainbottom" id="chart2"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as echarts from "echarts";
|
||||||
|
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||||
|
function deepCopy(obj) {
|
||||||
|
return JSON.parse(JSON.stringify(obj));
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
components: { scScrollTavle },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
barOption: {
|
||||||
|
backgroundColor: "",
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
type: "cross",
|
||||||
|
label: {
|
||||||
|
backgroundColor: "#6a7985",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "stack",
|
||||||
|
right: 0,
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: "3%",
|
||||||
|
right: "2%",
|
||||||
|
bottom: "3%",
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: "category",
|
||||||
|
boundaryGap: true,
|
||||||
|
data: [],
|
||||||
|
nameTextStyle: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
name: "",
|
||||||
|
type: "value",
|
||||||
|
nameTextStyle: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
show: false,
|
||||||
|
lineStyle: {
|
||||||
|
type: "dashed", //y轴分割线类型
|
||||||
|
color: "rgba(102,102,102,0.9)",
|
||||||
|
width: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "加工数",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "合格数",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "合格率",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
pieOption: {
|
||||||
|
backgroundColor: "",
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item'
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "stack",
|
||||||
|
right: 0,
|
||||||
|
orient: 'vertical',
|
||||||
|
itemWidth: 12,
|
||||||
|
itemHeight: 12,
|
||||||
|
textStyle: {
|
||||||
|
color: '#fff',
|
||||||
|
fontSize: 11,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
name: '不合格占比',
|
||||||
|
type: 'pie',
|
||||||
|
radius: ['1%', '60%'],
|
||||||
|
center: ['35%', '50%'],
|
||||||
|
label: false,
|
||||||
|
data: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tableHeight: 100,
|
||||||
|
speed: 2000,
|
||||||
|
time: null,
|
||||||
|
hh:{
|
||||||
|
yx:0,
|
||||||
|
wyx:0,
|
||||||
|
gz:0,
|
||||||
|
},
|
||||||
|
sctj:{
|
||||||
|
rtcs:0,
|
||||||
|
rjgs:0,
|
||||||
|
rjgqbls:0,
|
||||||
|
rhgs:0,
|
||||||
|
rbhgs:0,
|
||||||
|
},
|
||||||
|
dayInterval: null,
|
||||||
|
chartInterval1: null,
|
||||||
|
chartInterval2: null,
|
||||||
|
//库存
|
||||||
|
configDataInm:{
|
||||||
|
header:['物料名称','批次号','数量','生产中'],
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
headerHeight:40,
|
||||||
|
align:'center',
|
||||||
|
data:[],
|
||||||
|
waitTime:1000,
|
||||||
|
},
|
||||||
|
//设备
|
||||||
|
configDataEq:{
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
|
||||||
|
headerHeight:40,
|
||||||
|
data:[]
|
||||||
|
},
|
||||||
|
//生产统计
|
||||||
|
configDatas :{
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
header:['日期','加工数','合格数','不合格数'],
|
||||||
|
headerHeight:40,
|
||||||
|
data:[]
|
||||||
|
},
|
||||||
|
page:1,
|
||||||
|
currentTime: "",
|
||||||
|
currentDay: "",
|
||||||
|
today: "",
|
||||||
|
end_time:'',
|
||||||
|
start_time:'',
|
||||||
|
mgroups:[],
|
||||||
|
daysList:[],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
that.page = 1;
|
||||||
|
that.configDataInm.data = [];
|
||||||
|
//表格table的高度
|
||||||
|
this.tableHeight = document.getElementById("scrollContainer").clientHeight;
|
||||||
|
this.showTime();
|
||||||
|
this.dayInterval = setInterval(() => {
|
||||||
|
this.showTime();
|
||||||
|
}, 1000);
|
||||||
|
//近七天的日期数组
|
||||||
|
let daysArr = this.getMondayOfCurrentWeek();
|
||||||
|
this.daysArr = daysArr;
|
||||||
|
let xAxisData = [];
|
||||||
|
daysArr.forEach((item)=>{
|
||||||
|
let dates = item.split('-');
|
||||||
|
let obj = dates[1]+'-'+dates[2];
|
||||||
|
xAxisData.push(obj);
|
||||||
|
let dayitem = Number(dates[2]);
|
||||||
|
that.daysList.push(dayitem);
|
||||||
|
})
|
||||||
|
that.today = new Date().toISOString().split('T')[0]
|
||||||
|
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");
|
||||||
|
let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd");
|
||||||
|
this.start_time = start_time;
|
||||||
|
this.end_time = end_time;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$API.mtm.mgroup.list.req({page:0,belong_dept__name:'倒角车间'}).then((res) => {
|
||||||
|
that.mgroups = res;
|
||||||
|
that.configDataEq.data = [];
|
||||||
|
res.forEach((item)=>{
|
||||||
|
//设备数据
|
||||||
|
that.getEqState(item.id);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.getMaterials(that.page);
|
||||||
|
//投产/生产分析
|
||||||
|
this.getProductLine();
|
||||||
|
this.getCountnotok();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getMondayOfCurrentWeek() {
|
||||||
|
let today = new Date();
|
||||||
|
let days = [];
|
||||||
|
for (let i = 6; i >= 0; i--) {
|
||||||
|
let date = new Date(today);
|
||||||
|
date.setDate(today.getDate() - i);
|
||||||
|
days.push(date.toISOString().split('T')[0]); // 格式化为 YYYY-MM-DD
|
||||||
|
}
|
||||||
|
return days;
|
||||||
|
},
|
||||||
|
//时间
|
||||||
|
showTime() {
|
||||||
|
this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss");
|
||||||
|
this.currentDay = this.$TOOL.dateFormat(
|
||||||
|
new Date(),
|
||||||
|
"yyyy年MM月dd日"
|
||||||
|
);
|
||||||
|
},
|
||||||
|
setChart(name, option = null) {
|
||||||
|
var myChart = echarts.getInstanceByDom(document.getElementById(name));
|
||||||
|
if (myChart == undefined) {
|
||||||
|
myChart = echarts.init(document.getElementById(name), "dark", {
|
||||||
|
renderer: "svg",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (option == null) {
|
||||||
|
option = Object.assign({}, this.barOption);
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
try {
|
||||||
|
myChart.setOption(option);
|
||||||
|
} catch (error) {}
|
||||||
|
}, 500);
|
||||||
|
return myChart;
|
||||||
|
},
|
||||||
|
//生产统计
|
||||||
|
getProductLine() {
|
||||||
|
let that = this;
|
||||||
|
let obj = {
|
||||||
|
query: {start_date: that.start_time,end_date: that.end_time,dept_name:'倒角车间'},
|
||||||
|
};
|
||||||
|
that.$API.bi.dataset.exec.req("lineDay", obj).then((res) => {
|
||||||
|
let list = res.data2.ds0;
|
||||||
|
let seriesData0 = [],seriesData1 = [],seriesData2 = [];
|
||||||
|
for (let i = 0; i < that.xAxisData.length; i++) {
|
||||||
|
seriesData0[i] = 0;seriesData1[i] = 0;seriesData2[i] = 0;
|
||||||
|
}
|
||||||
|
if (list.length > 0) {
|
||||||
|
list.forEach((item) => {
|
||||||
|
let dateNow = new Date().getDate();
|
||||||
|
if(item.日 == dateNow){
|
||||||
|
that.sctj.rtcs = item.总重量;
|
||||||
|
that.sctj.rjgs = item.生产数;
|
||||||
|
that.sctj.rjgqbls = item.生产数-item.不合格数-item.合格数;
|
||||||
|
that.sctj.rhgs = item.合格数;
|
||||||
|
that.sctj.rbhgs = item.不合格数;
|
||||||
|
}
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.年+'-'+item.月+'-'+item.日;
|
||||||
|
arr[1] = item.生产数;
|
||||||
|
arr[2] = item.合格数;
|
||||||
|
arr[3] = item.不合格数;
|
||||||
|
that.configDatas.data.push(arr);
|
||||||
|
|
||||||
|
let indexs = that.daysList.indexOf(item.日);
|
||||||
|
seriesData0[indexs] = item.生产数;
|
||||||
|
seriesData1[indexs] = item.合格数;
|
||||||
|
seriesData2[indexs] = item.合格率;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
that.barOption.xAxis.data = that.xAxisData;
|
||||||
|
that.barOption.series[0].data = seriesData0;
|
||||||
|
that.barOption.series[1].data = seriesData1;
|
||||||
|
that.barOption.series[2].data = seriesData2;
|
||||||
|
let chart1 = this.setChart("chart1", that.barOption);
|
||||||
|
let index1 = 0;
|
||||||
|
this.chartInterval1 = setInterval(function () {
|
||||||
|
if (index1 < that.barOption.series[0].data.length) {
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "downplay",
|
||||||
|
seriesIndex: 0,
|
||||||
|
});
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index1,
|
||||||
|
});
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "showTip",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index1,
|
||||||
|
});
|
||||||
|
index1++;
|
||||||
|
} else {
|
||||||
|
index1 = 0;
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//不合格分布
|
||||||
|
getCountnotok(){
|
||||||
|
let that = this;
|
||||||
|
let obj = {query:{start_date:that.start_time,end_date:that.end_time}};
|
||||||
|
that.$API.bi.dataset.exec.req('notok_dis', obj).then((res) => {
|
||||||
|
let seriesData = [];
|
||||||
|
if(res.data2.ds0){
|
||||||
|
res.data2.ds0.forEach((item) => {
|
||||||
|
let obj = {};
|
||||||
|
obj.name = item.不合格项;
|
||||||
|
obj.value = item.数量;
|
||||||
|
seriesData.push(obj);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.pieOption.series.data = seriesData;
|
||||||
|
let index2 = 0;
|
||||||
|
let chart2 = this.setChart("chart2", that.pieOption);
|
||||||
|
this.chartInterval2 = setInterval(function () {
|
||||||
|
if (index2 < that.barOption.series[0].data.length) {
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "downplay",
|
||||||
|
seriesIndex: 0,
|
||||||
|
});
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "showTip",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
index2++;
|
||||||
|
} else {
|
||||||
|
index2 = 0;
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//设备状态
|
||||||
|
getEqState(id) {
|
||||||
|
let that = this;
|
||||||
|
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
|
||||||
|
that.hh.bw = res.保温;
|
||||||
|
that.hh.lq = res.冷却;
|
||||||
|
that.hh.yx = res.运行;
|
||||||
|
that.hh.wyx = res.未运行;
|
||||||
|
that.hh.gz = res.故障;
|
||||||
|
let nowTime = new Date(res.now).getTime();
|
||||||
|
if(res.rows.length>0){
|
||||||
|
res.rows.forEach((item) => {
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.name;
|
||||||
|
arr[1] = item.number;
|
||||||
|
if(item.mstate=='冷却'){
|
||||||
|
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
|
||||||
|
}else if(item.mstate=='未运行'){
|
||||||
|
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
|
||||||
|
}else if(item.mstate=='故障'){
|
||||||
|
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
|
||||||
|
}
|
||||||
|
let process = null, workTime =0,saveTime=null,sumTime=0;
|
||||||
|
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
|
||||||
|
item.reminder_interval_list.forEach(item=>{
|
||||||
|
sumTime += item;
|
||||||
|
})
|
||||||
|
let startTime = new Date(item.work_start_time).getTime();
|
||||||
|
workTime = (nowTime-startTime)/60000;//已工作时间
|
||||||
|
process = Math.round((workTime/sumTime)*100);
|
||||||
|
process = process>100?'100%':process+'%';
|
||||||
|
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
|
||||||
|
if(bwSaveTime>0){
|
||||||
|
saveTime = bwSaveTime;
|
||||||
|
}else{
|
||||||
|
saveTime = 0;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
process = '';
|
||||||
|
saveTime = '';
|
||||||
|
}
|
||||||
|
arr[3] = process;
|
||||||
|
arr[4] = item.t_count_use?item.t_count_use:0;
|
||||||
|
that.configDataEq.data.push(arr);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//库存统计列表
|
||||||
|
getMaterials(page) {
|
||||||
|
let that = this;
|
||||||
|
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'倒角' }).then((res) => {
|
||||||
|
if(res.results.length>0){
|
||||||
|
res.results.forEach((item) => {
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.material_name;
|
||||||
|
arr[1] = item.batch;
|
||||||
|
arr[2] = item.count;
|
||||||
|
arr[3] = item.count_working;
|
||||||
|
that.configDataInm.data.push(arr);
|
||||||
|
})
|
||||||
|
if(res.count>that.configDataInm.data.length){
|
||||||
|
that.page++;
|
||||||
|
that.getMaterials(that.page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
@font-face {
|
||||||
|
font-family: "myfont";
|
||||||
|
src: url("../../../utils/youShe.ttf");
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard {
|
||||||
|
background-image: url("/public/img/photon_bg.png");
|
||||||
|
color: #fff;
|
||||||
|
font-family: "Microsoft Yahei" !important;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
background: url("/public/img/photon_header.png");
|
||||||
|
border-bottom: none;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
font-size: 26px;
|
||||||
|
display: block;
|
||||||
|
height: 80px;
|
||||||
|
color: rgb(149, 255, 255);
|
||||||
|
font-family: "Microsoft Yahei";
|
||||||
|
text-align: center;
|
||||||
|
padding: 12px 0px;
|
||||||
|
}
|
||||||
|
.header > .title {
|
||||||
|
font-weight: bold;
|
||||||
|
font-family: "myfont";
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
.header > .timer {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 18px;
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
background: rgba(10, 63, 68, 0.5);
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxtitle {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 16px;
|
||||||
|
display: flex;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
background: linear-gradient(
|
||||||
|
40deg,
|
||||||
|
rgba(11, 101, 140, 0.451),
|
||||||
|
rgba(0, 34, 48, 0.335),
|
||||||
|
rgba(11, 101, 140, 0.451)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bgimg {
|
||||||
|
background-image: url("https://cdn-upload.datav.aliyun.com/upload/download/1678762309227-E6RP8z2R.png");
|
||||||
|
background-size: 140% 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxlabel {
|
||||||
|
margin-left: 6px;
|
||||||
|
font-size: 18px;
|
||||||
|
/* margin-top: 6px; */
|
||||||
|
}
|
||||||
|
.stateIcon{
|
||||||
|
width:16px;
|
||||||
|
height: 16px;
|
||||||
|
margin: 0 5px;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.bwIcon{
|
||||||
|
background-color: rgb(245, 196, 0);
|
||||||
|
}
|
||||||
|
.lqIcon,.yxicon{
|
||||||
|
background-color: rgb(0,163,245);
|
||||||
|
}
|
||||||
|
.wyxIcon{
|
||||||
|
background-color: rgb(69,176,118);
|
||||||
|
}
|
||||||
|
.gzIcon{
|
||||||
|
background-color: rgb(222,60,54);
|
||||||
|
}
|
||||||
|
.eqNum{
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
.boxmain {
|
||||||
|
height: calc(100% - 50px);
|
||||||
|
}
|
||||||
|
.boxmain.boxmainbottom{
|
||||||
|
height: calc(100% - 38px);
|
||||||
|
}
|
||||||
|
.boxmain.boxmainTopRight{
|
||||||
|
height: calc(100% - 120px);
|
||||||
|
}
|
||||||
|
.lineDiv {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
padding-left: 0.5em;
|
||||||
|
}
|
||||||
|
.boxmainItemNumber {
|
||||||
|
color: rgb(42,234,200);
|
||||||
|
margin-left: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-face:24px;
|
||||||
|
font-family: electronicFont;
|
||||||
|
}
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.boxmain {
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex_center {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border {
|
||||||
|
border: 1px dashed #49bcf7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bigdata {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.marquee_top {
|
||||||
|
transition: all 0.5s ease-in-out;
|
||||||
|
margin-top: -26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totall {
|
||||||
|
color: #fff;
|
||||||
|
background-color: rgb(10, 63, 68);
|
||||||
|
}
|
||||||
|
|
||||||
|
.rollData {
|
||||||
|
background-color: rgb(10, 39, 50);
|
||||||
|
}
|
||||||
|
|
||||||
|
.rollData:nth-of-type(2n + 1) {
|
||||||
|
background-color: rgb(0, 59, 81);
|
||||||
|
}
|
||||||
|
.halfBox {
|
||||||
|
height: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totalStatic{
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.totalStaticItem{
|
||||||
|
flex: 1;
|
||||||
|
height: 25px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 25px;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
.totalStaticItemNum{
|
||||||
|
font-size: 24px;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
font-family: "myfont";
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 0;
|
||||||
|
color: rgb(149, 255, 255);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,715 @@
|
||||||
|
<template>
|
||||||
|
<el-container class="dashboard">
|
||||||
|
<el-header class="header">
|
||||||
|
<div class="title">多线切车间生产数据看板</div>
|
||||||
|
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main>
|
||||||
|
<!-- 多线切 -->
|
||||||
|
<el-row style="height: 60%" :gutter="10">
|
||||||
|
<el-col :span="12" style="height: 100%">
|
||||||
|
<!-- 设备状态 -->
|
||||||
|
<el-col style="height: 50%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">
|
||||||
|
设备状态
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon yxicon"></span>
|
||||||
|
<span>运行中</span>
|
||||||
|
<span class="eqNum">{{hh.yx}}台</span>
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon wyxIcon"></span>
|
||||||
|
<span>未运行</span>
|
||||||
|
<span class="eqNum">{{hh.wyx}}台</span>
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon gzIcon"></span>
|
||||||
|
<span>故障</span>
|
||||||
|
<span class="eqNum">{{hh.gz}}台</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 2px"></div>
|
||||||
|
<div class="boxmain" id="scrollContainer">
|
||||||
|
<dv-scroll-board :config="configDataEq" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- 库存 -->
|
||||||
|
<el-col style="height: 50%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">
|
||||||
|
多线切车间库存
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 2px"></div>
|
||||||
|
<div class="boxmain" id="scrollContainer">
|
||||||
|
<dv-scroll-board :config="configDataInm" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" style="height: 100%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">生产数统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="totalStatic">
|
||||||
|
<span class="totalStaticItem">日投产量</span>
|
||||||
|
<span class="totalStaticItem">日加工数</span>
|
||||||
|
<span class="totalStaticItem">日加工前不良</span>
|
||||||
|
<span class="totalStaticItem">日合格数</span>
|
||||||
|
<span class="totalStaticItem">日不合格数</span>
|
||||||
|
</div>
|
||||||
|
<div class="totalStatic">
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rtcs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgqbls }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rhgs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rbhgs }}</span>
|
||||||
|
</div>
|
||||||
|
<dv-scroll-board :config="configDatas" class="boxmain boxmainTopRight" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div style="height: 0.3%"></div>
|
||||||
|
<!-- 生产统计 分析 -->
|
||||||
|
<div style="height: 0.3%"></div>
|
||||||
|
<el-row style="height: 39%" :gutter="10">
|
||||||
|
<!-- 折线图 日加工数、日合格数、日合格率,近七天数据 -->
|
||||||
|
<el-col :span="12" style="height: 100%;">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">合格数统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain boxmainbottom" id="chart1"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- 饼状图 各不合格品 原因占比 -->
|
||||||
|
<el-col :span="12" style="height: 100%;">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">不合格占比统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain boxmainbottom" id="chart2"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as echarts from "echarts";
|
||||||
|
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||||
|
function deepCopy(obj) {
|
||||||
|
return JSON.parse(JSON.stringify(obj));
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
components: { scScrollTavle },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
barOption: {
|
||||||
|
backgroundColor: "",
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
type: "cross",
|
||||||
|
label: {
|
||||||
|
backgroundColor: "#6a7985",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "stack",
|
||||||
|
right: 0,
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: "3%",
|
||||||
|
right: "2%",
|
||||||
|
bottom: "3%",
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: "category",
|
||||||
|
boundaryGap: true,
|
||||||
|
data: [],
|
||||||
|
nameTextStyle: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
name: "",
|
||||||
|
type: "value",
|
||||||
|
nameTextStyle: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
show: false,
|
||||||
|
lineStyle: {
|
||||||
|
type: "dashed", //y轴分割线类型
|
||||||
|
color: "rgba(102,102,102,0.9)",
|
||||||
|
width: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "加工数",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "合格数",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "合格率",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
pieOption: {
|
||||||
|
backgroundColor: "",
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item'
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "stack",
|
||||||
|
right: 0,
|
||||||
|
orient: 'vertical',
|
||||||
|
itemWidth: 12,
|
||||||
|
itemHeight: 12,
|
||||||
|
textStyle: {
|
||||||
|
color: '#fff',
|
||||||
|
fontSize: 11,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
name: '不合格占比',
|
||||||
|
type: 'pie',
|
||||||
|
radius: ['1%', '60%'],
|
||||||
|
center: ['35%', '50%'],
|
||||||
|
label: false,
|
||||||
|
data: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tableHeight: 100,
|
||||||
|
speed: 2000,
|
||||||
|
time: null,
|
||||||
|
hh:{
|
||||||
|
yx:0,
|
||||||
|
wyx:0,
|
||||||
|
gz:0,
|
||||||
|
},
|
||||||
|
sctj:{
|
||||||
|
rtcs:0,
|
||||||
|
rjgs:0,
|
||||||
|
rjgqbls:0,
|
||||||
|
rhgs:0,
|
||||||
|
rbhgs:0,
|
||||||
|
},
|
||||||
|
dayInterval: null,
|
||||||
|
chartInterval1: null,
|
||||||
|
chartInterval2: null,
|
||||||
|
//库存
|
||||||
|
configDataInm:{
|
||||||
|
header:['物料名称','批次号','数量','生产中'],
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
headerHeight:40,
|
||||||
|
align:'center',
|
||||||
|
data:[],
|
||||||
|
waitTime:1000,
|
||||||
|
},
|
||||||
|
//设备
|
||||||
|
configDataEq:{
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
|
||||||
|
headerHeight:40,
|
||||||
|
data:[]
|
||||||
|
},
|
||||||
|
//生产统计
|
||||||
|
configDatas :{
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
header:['日期','加工数','合格数','不合格数'],
|
||||||
|
headerHeight:40,
|
||||||
|
data:[]
|
||||||
|
},
|
||||||
|
page:1,
|
||||||
|
currentTime: "",
|
||||||
|
currentDay: "",
|
||||||
|
today: "",
|
||||||
|
end_time:'',
|
||||||
|
start_time:'',
|
||||||
|
mgroups:[],
|
||||||
|
daysList:[],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
that.page = 1;
|
||||||
|
that.configDataInm.data = [];
|
||||||
|
//表格table的高度
|
||||||
|
this.tableHeight = document.getElementById("scrollContainer").clientHeight;
|
||||||
|
this.showTime();
|
||||||
|
this.dayInterval = setInterval(() => {
|
||||||
|
this.showTime();
|
||||||
|
}, 1000);
|
||||||
|
//近七天的日期数组
|
||||||
|
let daysArr = this.getMondayOfCurrentWeek();
|
||||||
|
this.daysArr = daysArr;
|
||||||
|
let xAxisData = [];
|
||||||
|
daysArr.forEach((item)=>{
|
||||||
|
let dates = item.split('-');
|
||||||
|
let obj = dates[1]+'-'+dates[2];
|
||||||
|
xAxisData.push(obj);
|
||||||
|
let dayitem = Number(dates[2]);
|
||||||
|
that.daysList.push(dayitem);
|
||||||
|
})
|
||||||
|
that.today = new Date().toISOString().split('T')[0]
|
||||||
|
// console.log('new Date', new Date().toISOString().split('T'))
|
||||||
|
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");
|
||||||
|
let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd");
|
||||||
|
this.start_time = start_time;
|
||||||
|
this.end_time = end_time;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$API.mtm.mgroup.list.req({page:0,belong_dept__name:'多线切车间'}).then((res) => {
|
||||||
|
that.mgroups = res;
|
||||||
|
that.configDataEq.data = [];
|
||||||
|
res.forEach((item)=>{
|
||||||
|
//设备数据
|
||||||
|
that.getEqState(item.id);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.getMaterials(that.page);
|
||||||
|
//投产/生产分析
|
||||||
|
this.getProductLine();
|
||||||
|
this.getCountnotok();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getMondayOfCurrentWeek() {
|
||||||
|
let today = new Date();
|
||||||
|
let days = [];
|
||||||
|
for (let i = 6; i >= 0; i--) {
|
||||||
|
let date = new Date(today);
|
||||||
|
date.setDate(today.getDate() - i);
|
||||||
|
days.push(date.toISOString().split('T')[0]); // 格式化为 YYYY-MM-DD
|
||||||
|
}
|
||||||
|
return days;
|
||||||
|
},
|
||||||
|
//时间
|
||||||
|
showTime() {
|
||||||
|
this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss");
|
||||||
|
this.currentDay = this.$TOOL.dateFormat(
|
||||||
|
new Date(),
|
||||||
|
"yyyy年MM月dd日"
|
||||||
|
);
|
||||||
|
},
|
||||||
|
setChart(name, option = null) {
|
||||||
|
var myChart = echarts.getInstanceByDom(document.getElementById(name));
|
||||||
|
if (myChart == undefined) {
|
||||||
|
myChart = echarts.init(document.getElementById(name), "dark", {
|
||||||
|
renderer: "svg",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (option == null) {
|
||||||
|
option = Object.assign({}, this.barOption);
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
try {
|
||||||
|
myChart.setOption(option);
|
||||||
|
} catch (error) {}
|
||||||
|
}, 500);
|
||||||
|
return myChart;
|
||||||
|
},
|
||||||
|
//生产统计
|
||||||
|
getProductLine() {
|
||||||
|
let that = this;
|
||||||
|
let obj = {
|
||||||
|
query: {start_date: that.start_time,end_date: that.end_time,dept_name:'多线切车间'},
|
||||||
|
};
|
||||||
|
that.$API.bi.dataset.exec.req("lineDay", obj).then((res) => {
|
||||||
|
let list = res.data2.ds0;
|
||||||
|
let seriesData0 = [],seriesData1 = [],seriesData2 = [];
|
||||||
|
for (let i = 0; i < that.xAxisData.length; i++) {
|
||||||
|
seriesData0[i] = 0;seriesData1[i] = 0;seriesData2[i] = 0;
|
||||||
|
}
|
||||||
|
if (list.length > 0) {
|
||||||
|
list.forEach((item) => {
|
||||||
|
let dateNow = new Date().getDate();
|
||||||
|
if(item.日 == dateNow){
|
||||||
|
that.sctj.rtcs = item.总重量;
|
||||||
|
that.sctj.rjgs = item.生产数;
|
||||||
|
that.sctj.rjgqbls = item.生产数-item.不合格数-item.合格数;
|
||||||
|
that.sctj.rhgs = item.合格数;
|
||||||
|
that.sctj.rbhgs = item.不合格数;
|
||||||
|
}
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.年+'-'+item.月+'-'+item.日;
|
||||||
|
arr[1] = item.生产数;
|
||||||
|
arr[2] = item.合格数;
|
||||||
|
arr[3] = item.不合格数;
|
||||||
|
that.configDatas.data.push(arr);
|
||||||
|
|
||||||
|
let indexs = that.daysList.indexOf(item.日);
|
||||||
|
seriesData0[indexs] = item.生产数;
|
||||||
|
seriesData1[indexs] = item.合格数;
|
||||||
|
seriesData2[indexs] = item.合格率;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
that.barOption.xAxis.data = that.xAxisData;
|
||||||
|
that.barOption.series[0].data = seriesData0;
|
||||||
|
that.barOption.series[1].data = seriesData1;
|
||||||
|
that.barOption.series[2].data = seriesData2;
|
||||||
|
let chart1 = this.setChart("chart1", that.barOption);
|
||||||
|
let index1 = 0;
|
||||||
|
this.chartInterval1 = setInterval(function () {
|
||||||
|
if (index1 < that.barOption.series[0].data.length) {
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "downplay",
|
||||||
|
seriesIndex: 0,
|
||||||
|
});
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index1,
|
||||||
|
});
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "showTip",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index1,
|
||||||
|
});
|
||||||
|
index1++;
|
||||||
|
} else {
|
||||||
|
index1 = 0;
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//不合格分布
|
||||||
|
getCountnotok(){
|
||||||
|
let that = this;
|
||||||
|
let obj = {query:{start_date:that.start_time,end_date:that.end_time}};
|
||||||
|
that.$API.bi.dataset.exec.req('notok_dis', obj).then((res) => {
|
||||||
|
let seriesData = [];
|
||||||
|
if(res.data2.ds0){
|
||||||
|
res.data2.ds0.forEach((item) => {
|
||||||
|
let obj = {};
|
||||||
|
obj.name = item.不合格项;
|
||||||
|
obj.value = item.数量;
|
||||||
|
seriesData.push(obj);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.pieOption.series.data = seriesData;
|
||||||
|
let index2 = 0;
|
||||||
|
let chart2 = this.setChart("chart2", that.pieOption);
|
||||||
|
this.chartInterval2 = setInterval(function () {
|
||||||
|
if (index2 < that.barOption.series[0].data.length) {
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "downplay",
|
||||||
|
seriesIndex: 0,
|
||||||
|
});
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "showTip",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
index2++;
|
||||||
|
} else {
|
||||||
|
index2 = 0;
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//设备状态
|
||||||
|
getEqState(id) {
|
||||||
|
let that = this;
|
||||||
|
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
|
||||||
|
that.hh.bw = res.保温;
|
||||||
|
that.hh.lq = res.冷却;
|
||||||
|
that.hh.yx = res.运行;
|
||||||
|
that.hh.wyx = res.未运行;
|
||||||
|
that.hh.gz = res.故障;
|
||||||
|
let nowTime = new Date(res.now).getTime();
|
||||||
|
if(res.rows.length>0){
|
||||||
|
res.rows.forEach((item) => {
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.name;
|
||||||
|
arr[1] = item.number;
|
||||||
|
if(item.mstate=='冷却'){
|
||||||
|
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
|
||||||
|
}else if(item.mstate=='未运行'){
|
||||||
|
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
|
||||||
|
}else if(item.mstate=='故障'){
|
||||||
|
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
|
||||||
|
}
|
||||||
|
let process = null, workTime =0,saveTime=null,sumTime=0;
|
||||||
|
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
|
||||||
|
item.reminder_interval_list.forEach(item=>{
|
||||||
|
sumTime += item;
|
||||||
|
})
|
||||||
|
let startTime = new Date(item.work_start_time).getTime();
|
||||||
|
workTime = (nowTime-startTime)/60000;//已工作时间
|
||||||
|
process = Math.round((workTime/sumTime)*100);
|
||||||
|
process = process>100?'100%':process+'%';
|
||||||
|
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
|
||||||
|
if(bwSaveTime>0){
|
||||||
|
saveTime = bwSaveTime;
|
||||||
|
}else{
|
||||||
|
saveTime = 0;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
process = '';
|
||||||
|
saveTime = '';
|
||||||
|
}
|
||||||
|
arr[3] = process;
|
||||||
|
arr[4] = item.t_count_use?item.t_count_use:0;
|
||||||
|
that.configDataEq.data.push(arr);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//库存统计列表
|
||||||
|
getMaterials(page) {
|
||||||
|
let that = this;
|
||||||
|
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'多线切' }).then((res) => {
|
||||||
|
if(res.results.length>0){
|
||||||
|
res.results.forEach((item) => {
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.material_name;
|
||||||
|
arr[1] = item.batch;
|
||||||
|
arr[2] = item.count;
|
||||||
|
arr[3] = item.count_working;
|
||||||
|
that.configDataInm.data.push(arr);
|
||||||
|
})
|
||||||
|
if(res.count>that.configDataInm.data.length){
|
||||||
|
that.page++;
|
||||||
|
that.getMaterials(that.page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
@font-face {
|
||||||
|
font-family: "myfont";
|
||||||
|
src: url("../../../utils/youShe.ttf");
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard {
|
||||||
|
background-image: url("/public/img/photon_bg.png");
|
||||||
|
color: #fff;
|
||||||
|
font-family: "Microsoft Yahei" !important;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
background: url("/public/img/photon_header.png");
|
||||||
|
border-bottom: none;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
font-size: 26px;
|
||||||
|
display: block;
|
||||||
|
height: 80px;
|
||||||
|
color: rgb(149, 255, 255);
|
||||||
|
font-family: "Microsoft Yahei";
|
||||||
|
text-align: center;
|
||||||
|
padding: 12px 0px;
|
||||||
|
}
|
||||||
|
.header > .title {
|
||||||
|
font-weight: bold;
|
||||||
|
font-family: "myfont";
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
.header > .timer {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 18px;
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
background: rgba(10, 63, 68, 0.5);
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxtitle {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 16px;
|
||||||
|
display: flex;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
background: linear-gradient(
|
||||||
|
40deg,
|
||||||
|
rgba(11, 101, 140, 0.451),
|
||||||
|
rgba(0, 34, 48, 0.335),
|
||||||
|
rgba(11, 101, 140, 0.451)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bgimg {
|
||||||
|
background-image: url("https://cdn-upload.datav.aliyun.com/upload/download/1678762309227-E6RP8z2R.png");
|
||||||
|
background-size: 140% 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxlabel {
|
||||||
|
margin-left: 6px;
|
||||||
|
font-size: 18px;
|
||||||
|
/* margin-top: 6px; */
|
||||||
|
}
|
||||||
|
.stateIcon{
|
||||||
|
width:16px;
|
||||||
|
height: 16px;
|
||||||
|
margin: 0 5px;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.bwIcon{
|
||||||
|
background-color: rgb(245, 196, 0);
|
||||||
|
}
|
||||||
|
.lqIcon,.yxicon{
|
||||||
|
background-color: rgb(0,163,245);
|
||||||
|
}
|
||||||
|
.wyxIcon{
|
||||||
|
background-color: rgb(69,176,118);
|
||||||
|
}
|
||||||
|
.gzIcon{
|
||||||
|
background-color: rgb(222,60,54);
|
||||||
|
}
|
||||||
|
.eqNum{
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
.boxmain {
|
||||||
|
height: calc(100% - 50px);
|
||||||
|
}
|
||||||
|
.boxmain.boxmainbottom{
|
||||||
|
height: calc(100% - 38px);
|
||||||
|
}
|
||||||
|
.boxmain.boxmainTopRight{
|
||||||
|
height: calc(100% - 120px);
|
||||||
|
}
|
||||||
|
.lineDiv {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
padding-left: 0.5em;
|
||||||
|
}
|
||||||
|
.boxmainItemNumber {
|
||||||
|
color: rgb(42,234,200);
|
||||||
|
margin-left: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-face:24px;
|
||||||
|
font-family: electronicFont;
|
||||||
|
}
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.boxmain {
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex_center {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border {
|
||||||
|
border: 1px dashed #49bcf7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bigdata {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.marquee_top {
|
||||||
|
transition: all 0.5s ease-in-out;
|
||||||
|
margin-top: -26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totall {
|
||||||
|
color: #fff;
|
||||||
|
background-color: rgb(10, 63, 68);
|
||||||
|
}
|
||||||
|
|
||||||
|
.rollData {
|
||||||
|
background-color: rgb(10, 39, 50);
|
||||||
|
}
|
||||||
|
|
||||||
|
.rollData:nth-of-type(2n + 1) {
|
||||||
|
background-color: rgb(0, 59, 81);
|
||||||
|
}
|
||||||
|
.halfBox {
|
||||||
|
height: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totalStatic{
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.totalStaticItem{
|
||||||
|
flex: 1;
|
||||||
|
height: 25px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 25px;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
.totalStaticItemNum{
|
||||||
|
font-size: 24px;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
font-family: "myfont";
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 0;
|
||||||
|
color: rgb(149, 255, 255);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,714 @@
|
||||||
|
<template>
|
||||||
|
<el-container class="dashboard">
|
||||||
|
<el-header class="header">
|
||||||
|
<div class="title">精雕车间生产数据看板</div>
|
||||||
|
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main>
|
||||||
|
<!-- 精雕 -->
|
||||||
|
<el-row style="height: 60%" :gutter="10">
|
||||||
|
<el-col :span="12" style="height: 100%">
|
||||||
|
<!-- 设备状态 -->
|
||||||
|
<el-col style="height: 50%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">
|
||||||
|
设备状态
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon yxicon"></span>
|
||||||
|
<span>运行中</span>
|
||||||
|
<span class="eqNum">{{hh.yx}}台</span>
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon wyxIcon"></span>
|
||||||
|
<span>未运行</span>
|
||||||
|
<span class="eqNum">{{hh.wyx}}台</span>
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon gzIcon"></span>
|
||||||
|
<span>故障</span>
|
||||||
|
<span class="eqNum">{{hh.gz}}台</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 2px"></div>
|
||||||
|
<div class="boxmain" id="scrollContainer">
|
||||||
|
<dv-scroll-board :config="configDataEq" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- 库存 -->
|
||||||
|
<el-col style="height: 50%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">
|
||||||
|
精雕车间库存
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 2px"></div>
|
||||||
|
<div class="boxmain" id="scrollContainer">
|
||||||
|
<dv-scroll-board :config="configDataInm" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" style="height: 100%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">生产数统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="totalStatic">
|
||||||
|
<span class="totalStaticItem">日投产量</span>
|
||||||
|
<span class="totalStaticItem">日加工数</span>
|
||||||
|
<span class="totalStaticItem">日加工前不良</span>
|
||||||
|
<span class="totalStaticItem">日合格数</span>
|
||||||
|
<span class="totalStaticItem">日不合格数</span>
|
||||||
|
</div>
|
||||||
|
<div class="totalStatic">
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rtcs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgqbls }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rhgs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rbhgs }}</span>
|
||||||
|
</div>
|
||||||
|
<dv-scroll-board :config="configDatas" class="boxmain boxmainTopRight" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div style="height: 0.3%"></div>
|
||||||
|
<!-- 生产统计 分析 -->
|
||||||
|
<div style="height: 0.3%"></div>
|
||||||
|
<el-row style="height: 39%" :gutter="10">
|
||||||
|
<!-- 折线图 日加工数、日合格数、日合格率,近七天数据 -->
|
||||||
|
<el-col :span="12" style="height: 100%;">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">合格数统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain boxmainbottom" id="chart1"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- 饼状图 各不合格品 原因占比 -->
|
||||||
|
<el-col :span="12" style="height: 100%;">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">不合格占比统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain boxmainbottom" id="chart2"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as echarts from "echarts";
|
||||||
|
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||||
|
function deepCopy(obj) {
|
||||||
|
return JSON.parse(JSON.stringify(obj));
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
components: { scScrollTavle },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
barOption: {
|
||||||
|
backgroundColor: "",
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
type: "cross",
|
||||||
|
label: {
|
||||||
|
backgroundColor: "#6a7985",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "stack",
|
||||||
|
right: 0,
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: "3%",
|
||||||
|
right: "2%",
|
||||||
|
bottom: "3%",
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: "category",
|
||||||
|
boundaryGap: true,
|
||||||
|
data: [],
|
||||||
|
nameTextStyle: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
name: "",
|
||||||
|
type: "value",
|
||||||
|
nameTextStyle: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
show: false,
|
||||||
|
lineStyle: {
|
||||||
|
type: "dashed", //y轴分割线类型
|
||||||
|
color: "rgba(102,102,102,0.9)",
|
||||||
|
width: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "加工数",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "合格数",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "合格率",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
pieOption: {
|
||||||
|
backgroundColor: "",
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item'
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "stack",
|
||||||
|
right: 0,
|
||||||
|
orient: 'vertical',
|
||||||
|
itemWidth: 12,
|
||||||
|
itemHeight: 12,
|
||||||
|
textStyle: {
|
||||||
|
color: '#fff',
|
||||||
|
fontSize: 11,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
name: '不合格占比',
|
||||||
|
type: 'pie',
|
||||||
|
radius: ['1%', '60%'],
|
||||||
|
center: ['35%', '50%'],
|
||||||
|
label: false,
|
||||||
|
data: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tableHeight: 100,
|
||||||
|
speed: 2000,
|
||||||
|
time: null,
|
||||||
|
hh:{
|
||||||
|
yx:0,
|
||||||
|
wyx:0,
|
||||||
|
gz:0,
|
||||||
|
},
|
||||||
|
sctj:{
|
||||||
|
rtcs:0,
|
||||||
|
rjgs:0,
|
||||||
|
rjgqbls:0,
|
||||||
|
rhgs:0,
|
||||||
|
rbhgs:0,
|
||||||
|
},
|
||||||
|
dayInterval: null,
|
||||||
|
chartInterval1: null,
|
||||||
|
chartInterval2: null,
|
||||||
|
//库存
|
||||||
|
configDataInm:{
|
||||||
|
header:['物料名称','批次号','数量','生产中'],
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
headerHeight:40,
|
||||||
|
align:'center',
|
||||||
|
data:[],
|
||||||
|
waitTime:1000,
|
||||||
|
},
|
||||||
|
//设备
|
||||||
|
configDataEq:{
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
|
||||||
|
headerHeight:40,
|
||||||
|
data:[]
|
||||||
|
},
|
||||||
|
//生产统计
|
||||||
|
configDatas :{
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
header:['日期','加工数','合格数','不合格数'],
|
||||||
|
headerHeight:40,
|
||||||
|
data:[]
|
||||||
|
},
|
||||||
|
page:1,
|
||||||
|
currentTime: "",
|
||||||
|
currentDay: "",
|
||||||
|
today: "",
|
||||||
|
end_time:'',
|
||||||
|
start_time:'',
|
||||||
|
mgroups:[],
|
||||||
|
daysList:[],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
that.page = 1;
|
||||||
|
that.configDataInm.data = [];
|
||||||
|
//表格table的高度
|
||||||
|
this.tableHeight = document.getElementById("scrollContainer").clientHeight;
|
||||||
|
this.showTime();
|
||||||
|
this.dayInterval = setInterval(() => {
|
||||||
|
this.showTime();
|
||||||
|
}, 1000);
|
||||||
|
//近七天的日期数组
|
||||||
|
let daysArr = this.getMondayOfCurrentWeek();
|
||||||
|
this.daysArr = daysArr;
|
||||||
|
let xAxisData = [];
|
||||||
|
daysArr.forEach((item)=>{
|
||||||
|
let dates = item.split('-');
|
||||||
|
let obj = dates[1]+'-'+dates[2];
|
||||||
|
xAxisData.push(obj);
|
||||||
|
let dayitem = Number(dates[2]);
|
||||||
|
that.daysList.push(dayitem);
|
||||||
|
})
|
||||||
|
that.today = new Date().toISOString().split('T')[0]
|
||||||
|
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");
|
||||||
|
let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd");
|
||||||
|
this.start_time = start_time;
|
||||||
|
this.end_time = end_time;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$API.mtm.mgroup.list.req({page:0,belong_dept__name:'精雕车间'}).then((res) => {
|
||||||
|
that.mgroups = res;
|
||||||
|
that.configDataEq.data = [];
|
||||||
|
res.forEach((item)=>{
|
||||||
|
//设备数据
|
||||||
|
that.getEqState(item.id);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.getMaterials(that.page);
|
||||||
|
//投产/生产分析
|
||||||
|
this.getProductLine();
|
||||||
|
this.getCountnotok();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getMondayOfCurrentWeek() {
|
||||||
|
let today = new Date();
|
||||||
|
let days = [];
|
||||||
|
for (let i = 6; i >= 0; i--) {
|
||||||
|
let date = new Date(today);
|
||||||
|
date.setDate(today.getDate() - i);
|
||||||
|
days.push(date.toISOString().split('T')[0]); // 格式化为 YYYY-MM-DD
|
||||||
|
}
|
||||||
|
return days;
|
||||||
|
},
|
||||||
|
//时间
|
||||||
|
showTime() {
|
||||||
|
this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss");
|
||||||
|
this.currentDay = this.$TOOL.dateFormat(
|
||||||
|
new Date(),
|
||||||
|
"yyyy年MM月dd日"
|
||||||
|
);
|
||||||
|
},
|
||||||
|
setChart(name, option = null) {
|
||||||
|
var myChart = echarts.getInstanceByDom(document.getElementById(name));
|
||||||
|
if (myChart == undefined) {
|
||||||
|
myChart = echarts.init(document.getElementById(name), "dark", {
|
||||||
|
renderer: "svg",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (option == null) {
|
||||||
|
option = Object.assign({}, this.barOption);
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
try {
|
||||||
|
myChart.setOption(option);
|
||||||
|
} catch (error) {}
|
||||||
|
}, 500);
|
||||||
|
return myChart;
|
||||||
|
},
|
||||||
|
//生产统计
|
||||||
|
getProductLine() {
|
||||||
|
let that = this;
|
||||||
|
let obj = {
|
||||||
|
query: {start_date: that.start_time,end_date: that.end_time,dept_name:'精雕车间'},
|
||||||
|
};
|
||||||
|
that.$API.bi.dataset.exec.req("lineDay", obj).then((res) => {
|
||||||
|
let list = res.data2.ds0;
|
||||||
|
let seriesData0 = [],seriesData1 = [],seriesData2 = [];
|
||||||
|
for (let i = 0; i < that.xAxisData.length; i++) {
|
||||||
|
seriesData0[i] = 0;seriesData1[i] = 0;seriesData2[i] = 0;
|
||||||
|
}
|
||||||
|
if (list.length > 0) {
|
||||||
|
list.forEach((item) => {
|
||||||
|
let dateNow = new Date().getDate();
|
||||||
|
if(item.日 == dateNow){
|
||||||
|
that.sctj.rtcs = item.总重量;
|
||||||
|
that.sctj.rjgs = item.生产数;
|
||||||
|
that.sctj.rjgqbls = item.生产数-item.不合格数-item.合格数;
|
||||||
|
that.sctj.rhgs = item.合格数;
|
||||||
|
that.sctj.rbhgs = item.不合格数;
|
||||||
|
}
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.年+'-'+item.月+'-'+item.日;
|
||||||
|
arr[1] = item.生产数;
|
||||||
|
arr[2] = item.合格数;
|
||||||
|
arr[3] = item.不合格数;
|
||||||
|
that.configDatas.data.push(arr);
|
||||||
|
|
||||||
|
let indexs = that.daysList.indexOf(item.日);
|
||||||
|
seriesData0[indexs] = item.生产数;
|
||||||
|
seriesData1[indexs] = item.合格数;
|
||||||
|
seriesData2[indexs] = item.合格率;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
that.barOption.xAxis.data = that.xAxisData;
|
||||||
|
that.barOption.series[0].data = seriesData0;
|
||||||
|
that.barOption.series[1].data = seriesData1;
|
||||||
|
that.barOption.series[2].data = seriesData2;
|
||||||
|
let chart1 = this.setChart("chart1", that.barOption);
|
||||||
|
let index1 = 0;
|
||||||
|
this.chartInterval1 = setInterval(function () {
|
||||||
|
if (index1 < that.barOption.series[0].data.length) {
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "downplay",
|
||||||
|
seriesIndex: 0,
|
||||||
|
});
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index1,
|
||||||
|
});
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "showTip",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index1,
|
||||||
|
});
|
||||||
|
index1++;
|
||||||
|
} else {
|
||||||
|
index1 = 0;
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//不合格分布
|
||||||
|
getCountnotok(){
|
||||||
|
let that = this;
|
||||||
|
let obj = {query:{start_date:that.start_time,end_date:that.end_time}};
|
||||||
|
that.$API.bi.dataset.exec.req('notok_dis', obj).then((res) => {
|
||||||
|
let seriesData = [];
|
||||||
|
if(res.data2.ds0){
|
||||||
|
res.data2.ds0.forEach((item) => {
|
||||||
|
let obj = {};
|
||||||
|
obj.name = item.不合格项;
|
||||||
|
obj.value = item.数量;
|
||||||
|
seriesData.push(obj);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.pieOption.series.data = seriesData;
|
||||||
|
let index2 = 0;
|
||||||
|
let chart2 = this.setChart("chart2", that.pieOption);
|
||||||
|
this.chartInterval2 = setInterval(function () {
|
||||||
|
if (index2 < that.barOption.series[0].data.length) {
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "downplay",
|
||||||
|
seriesIndex: 0,
|
||||||
|
});
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "showTip",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
index2++;
|
||||||
|
} else {
|
||||||
|
index2 = 0;
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//设备状态
|
||||||
|
getEqState(id) {
|
||||||
|
let that = this;
|
||||||
|
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
|
||||||
|
that.hh.bw = res.保温;
|
||||||
|
that.hh.lq = res.冷却;
|
||||||
|
that.hh.yx = res.运行;
|
||||||
|
that.hh.wyx = res.未运行;
|
||||||
|
that.hh.gz = res.故障;
|
||||||
|
let nowTime = new Date(res.now).getTime();
|
||||||
|
if(res.rows.length>0){
|
||||||
|
res.rows.forEach((item) => {
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.name;
|
||||||
|
arr[1] = item.number;
|
||||||
|
if(item.mstate=='冷却'){
|
||||||
|
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
|
||||||
|
}else if(item.mstate=='未运行'){
|
||||||
|
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
|
||||||
|
}else if(item.mstate=='故障'){
|
||||||
|
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
|
||||||
|
}
|
||||||
|
let process = null, workTime =0,saveTime=null,sumTime=0;
|
||||||
|
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
|
||||||
|
item.reminder_interval_list.forEach(item=>{
|
||||||
|
sumTime += item;
|
||||||
|
})
|
||||||
|
let startTime = new Date(item.work_start_time).getTime();
|
||||||
|
workTime = (nowTime-startTime)/60000;//已工作时间
|
||||||
|
process = Math.round((workTime/sumTime)*100);
|
||||||
|
process = process>100?'100%':process+'%';
|
||||||
|
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
|
||||||
|
if(bwSaveTime>0){
|
||||||
|
saveTime = bwSaveTime;
|
||||||
|
}else{
|
||||||
|
saveTime = 0;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
process = '';
|
||||||
|
saveTime = '';
|
||||||
|
}
|
||||||
|
arr[3] = process;
|
||||||
|
arr[4] = item.t_count_use?item.t_count_use:0;
|
||||||
|
that.configDataEq.data.push(arr);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//库存统计列表
|
||||||
|
getMaterials(page) {
|
||||||
|
let that = this;
|
||||||
|
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'精雕' }).then((res) => {
|
||||||
|
if(res.results.length>0){
|
||||||
|
res.results.forEach((item) => {
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.material_name;
|
||||||
|
arr[1] = item.batch;
|
||||||
|
arr[2] = item.count;
|
||||||
|
arr[3] = item.count_working;
|
||||||
|
that.configDataInm.data.push(arr);
|
||||||
|
})
|
||||||
|
if(res.count>that.configDataInm.data.length){
|
||||||
|
that.page++;
|
||||||
|
that.getMaterials(that.page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
@font-face {
|
||||||
|
font-family: "myfont";
|
||||||
|
src: url("../../../utils/youShe.ttf");
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard {
|
||||||
|
background-image: url("/public/img/photon_bg.png");
|
||||||
|
color: #fff;
|
||||||
|
font-family: "Microsoft Yahei" !important;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
background: url("/public/img/photon_header.png");
|
||||||
|
border-bottom: none;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
font-size: 26px;
|
||||||
|
display: block;
|
||||||
|
height: 80px;
|
||||||
|
color: rgb(149, 255, 255);
|
||||||
|
font-family: "Microsoft Yahei";
|
||||||
|
text-align: center;
|
||||||
|
padding: 12px 0px;
|
||||||
|
}
|
||||||
|
.header > .title {
|
||||||
|
font-weight: bold;
|
||||||
|
font-family: "myfont";
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
.header > .timer {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 18px;
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
background: rgba(10, 63, 68, 0.5);
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxtitle {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 16px;
|
||||||
|
display: flex;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
background: linear-gradient(
|
||||||
|
40deg,
|
||||||
|
rgba(11, 101, 140, 0.451),
|
||||||
|
rgba(0, 34, 48, 0.335),
|
||||||
|
rgba(11, 101, 140, 0.451)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bgimg {
|
||||||
|
background-image: url("https://cdn-upload.datav.aliyun.com/upload/download/1678762309227-E6RP8z2R.png");
|
||||||
|
background-size: 140% 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxlabel {
|
||||||
|
margin-left: 6px;
|
||||||
|
font-size: 18px;
|
||||||
|
/* margin-top: 6px; */
|
||||||
|
}
|
||||||
|
.stateIcon{
|
||||||
|
width:16px;
|
||||||
|
height: 16px;
|
||||||
|
margin: 0 5px;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.bwIcon{
|
||||||
|
background-color: rgb(245, 196, 0);
|
||||||
|
}
|
||||||
|
.lqIcon,.yxicon{
|
||||||
|
background-color: rgb(0,163,245);
|
||||||
|
}
|
||||||
|
.wyxIcon{
|
||||||
|
background-color: rgb(69,176,118);
|
||||||
|
}
|
||||||
|
.gzIcon{
|
||||||
|
background-color: rgb(222,60,54);
|
||||||
|
}
|
||||||
|
.eqNum{
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
.boxmain {
|
||||||
|
height: calc(100% - 50px);
|
||||||
|
}
|
||||||
|
.boxmain.boxmainbottom{
|
||||||
|
height: calc(100% - 38px);
|
||||||
|
}
|
||||||
|
.boxmain.boxmainTopRight{
|
||||||
|
height: calc(100% - 120px);
|
||||||
|
}
|
||||||
|
.lineDiv {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
padding-left: 0.5em;
|
||||||
|
}
|
||||||
|
.boxmainItemNumber {
|
||||||
|
color: rgb(42,234,200);
|
||||||
|
margin-left: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-face:24px;
|
||||||
|
font-family: electronicFont;
|
||||||
|
}
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.boxmain {
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex_center {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border {
|
||||||
|
border: 1px dashed #49bcf7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bigdata {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.marquee_top {
|
||||||
|
transition: all 0.5s ease-in-out;
|
||||||
|
margin-top: -26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totall {
|
||||||
|
color: #fff;
|
||||||
|
background-color: rgb(10, 63, 68);
|
||||||
|
}
|
||||||
|
|
||||||
|
.rollData {
|
||||||
|
background-color: rgb(10, 39, 50);
|
||||||
|
}
|
||||||
|
|
||||||
|
.rollData:nth-of-type(2n + 1) {
|
||||||
|
background-color: rgb(0, 59, 81);
|
||||||
|
}
|
||||||
|
.halfBox {
|
||||||
|
height: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totalStatic{
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.totalStaticItem{
|
||||||
|
flex: 1;
|
||||||
|
height: 25px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 25px;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
.totalStaticItemNum{
|
||||||
|
font-size: 24px;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
font-family: "myfont";
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 0;
|
||||||
|
color: rgb(149, 255, 255);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,714 @@
|
||||||
|
<template>
|
||||||
|
<el-container class="dashboard">
|
||||||
|
<el-header class="header">
|
||||||
|
<div class="title">磨抛车间生产数据看板</div>
|
||||||
|
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main>
|
||||||
|
<!-- 磨抛 -->
|
||||||
|
<el-row style="height: 60%" :gutter="10">
|
||||||
|
<el-col :span="12" style="height: 100%">
|
||||||
|
<!-- 设备状态 -->
|
||||||
|
<el-col style="height: 50%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">
|
||||||
|
设备状态
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon yxicon"></span>
|
||||||
|
<span>运行中</span>
|
||||||
|
<span class="eqNum">{{hh.yx}}台</span>
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon wyxIcon"></span>
|
||||||
|
<span>未运行</span>
|
||||||
|
<span class="eqNum">{{hh.wyx}}台</span>
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon gzIcon"></span>
|
||||||
|
<span>故障</span>
|
||||||
|
<span class="eqNum">{{hh.gz}}台</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 2px"></div>
|
||||||
|
<div class="boxmain" id="scrollContainer">
|
||||||
|
<dv-scroll-board :config="configDataEq" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- 库存 -->
|
||||||
|
<el-col style="height: 50%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">
|
||||||
|
磨抛车间库存
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 2px"></div>
|
||||||
|
<div class="boxmain" id="scrollContainer">
|
||||||
|
<dv-scroll-board :config="configDataInm" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" style="height: 100%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">生产数统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="totalStatic">
|
||||||
|
<span class="totalStaticItem">日投产量</span>
|
||||||
|
<span class="totalStaticItem">日加工数</span>
|
||||||
|
<span class="totalStaticItem">日加工前不良</span>
|
||||||
|
<span class="totalStaticItem">日合格数</span>
|
||||||
|
<span class="totalStaticItem">日不合格数</span>
|
||||||
|
</div>
|
||||||
|
<div class="totalStatic">
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rtcs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgqbls }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rhgs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rbhgs }}</span>
|
||||||
|
</div>
|
||||||
|
<dv-scroll-board :config="configDatas" class="boxmain boxmainTopRight" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div style="height: 0.3%"></div>
|
||||||
|
<!-- 生产统计 分析 -->
|
||||||
|
<div style="height: 0.3%"></div>
|
||||||
|
<el-row style="height: 39%" :gutter="10">
|
||||||
|
<!-- 折线图 日加工数、日合格数、日合格率,近七天数据 -->
|
||||||
|
<el-col :span="12" style="height: 100%;">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">合格数统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain boxmainbottom" id="chart1"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- 饼状图 各不合格品 原因占比 -->
|
||||||
|
<el-col :span="12" style="height: 100%;">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">不合格占比统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain boxmainbottom" id="chart2"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as echarts from "echarts";
|
||||||
|
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||||
|
function deepCopy(obj) {
|
||||||
|
return JSON.parse(JSON.stringify(obj));
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
components: { scScrollTavle },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
barOption: {
|
||||||
|
backgroundColor: "",
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
type: "cross",
|
||||||
|
label: {
|
||||||
|
backgroundColor: "#6a7985",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "stack",
|
||||||
|
right: 0,
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: "3%",
|
||||||
|
right: "2%",
|
||||||
|
bottom: "3%",
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: "category",
|
||||||
|
boundaryGap: true,
|
||||||
|
data: [],
|
||||||
|
nameTextStyle: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
name: "",
|
||||||
|
type: "value",
|
||||||
|
nameTextStyle: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
show: false,
|
||||||
|
lineStyle: {
|
||||||
|
type: "dashed", //y轴分割线类型
|
||||||
|
color: "rgba(102,102,102,0.9)",
|
||||||
|
width: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "加工数",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "合格数",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "合格率",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
pieOption: {
|
||||||
|
backgroundColor: "",
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item'
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "stack",
|
||||||
|
right: 0,
|
||||||
|
orient: 'vertical',
|
||||||
|
itemWidth: 12,
|
||||||
|
itemHeight: 12,
|
||||||
|
textStyle: {
|
||||||
|
color: '#fff',
|
||||||
|
fontSize: 11,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
name: '不合格占比',
|
||||||
|
type: 'pie',
|
||||||
|
radius: ['1%', '60%'],
|
||||||
|
center: ['35%', '50%'],
|
||||||
|
label: false,
|
||||||
|
data: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tableHeight: 100,
|
||||||
|
speed: 2000,
|
||||||
|
time: null,
|
||||||
|
hh:{
|
||||||
|
yx:0,
|
||||||
|
wyx:0,
|
||||||
|
gz:0,
|
||||||
|
},
|
||||||
|
sctj:{
|
||||||
|
rtcs:0,
|
||||||
|
rjgs:0,
|
||||||
|
rjgqbls:0,
|
||||||
|
rhgs:0,
|
||||||
|
rbhgs:0,
|
||||||
|
},
|
||||||
|
dayInterval: null,
|
||||||
|
chartInterval1: null,
|
||||||
|
chartInterval2: null,
|
||||||
|
//库存
|
||||||
|
configDataInm:{
|
||||||
|
header:['物料名称','批次号','数量','生产中'],
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
headerHeight:40,
|
||||||
|
align:'center',
|
||||||
|
data:[],
|
||||||
|
waitTime:1000,
|
||||||
|
},
|
||||||
|
//设备
|
||||||
|
configDataEq:{
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
|
||||||
|
headerHeight:40,
|
||||||
|
data:[]
|
||||||
|
},
|
||||||
|
//生产统计
|
||||||
|
configDatas :{
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
header:['日期','加工数','合格数','不合格数'],
|
||||||
|
headerHeight:40,
|
||||||
|
data:[]
|
||||||
|
},
|
||||||
|
page:1,
|
||||||
|
currentTime: "",
|
||||||
|
currentDay: "",
|
||||||
|
today: "",
|
||||||
|
end_time:'',
|
||||||
|
start_time:'',
|
||||||
|
mgroups:[],
|
||||||
|
daysList:[],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
that.page = 1;
|
||||||
|
that.configDataInm.data = [];
|
||||||
|
//表格table的高度
|
||||||
|
this.tableHeight = document.getElementById("scrollContainer").clientHeight;
|
||||||
|
this.showTime();
|
||||||
|
this.dayInterval = setInterval(() => {
|
||||||
|
this.showTime();
|
||||||
|
}, 1000);
|
||||||
|
//近七天的日期数组
|
||||||
|
let daysArr = this.getMondayOfCurrentWeek();
|
||||||
|
this.daysArr = daysArr;
|
||||||
|
let xAxisData = [];
|
||||||
|
daysArr.forEach((item)=>{
|
||||||
|
let dates = item.split('-');
|
||||||
|
let obj = dates[1]+'-'+dates[2];
|
||||||
|
xAxisData.push(obj);
|
||||||
|
let dayitem = Number(dates[2]);
|
||||||
|
that.daysList.push(dayitem);
|
||||||
|
})
|
||||||
|
that.today = new Date().toISOString().split('T')[0]
|
||||||
|
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");
|
||||||
|
let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd");
|
||||||
|
this.start_time = start_time;
|
||||||
|
this.end_time = end_time;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$API.mtm.mgroup.list.req({page:0,belong_dept__name:'磨抛车间'}).then((res) => {
|
||||||
|
that.mgroups = res;
|
||||||
|
that.configDataEq.data = [];
|
||||||
|
res.forEach((item)=>{
|
||||||
|
//设备数据
|
||||||
|
that.getEqState(item.id);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.getMaterials(that.page);
|
||||||
|
//投产/生产分析
|
||||||
|
this.getProductLine();
|
||||||
|
this.getCountnotok();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getMondayOfCurrentWeek() {
|
||||||
|
let today = new Date();
|
||||||
|
let days = [];
|
||||||
|
for (let i = 6; i >= 0; i--) {
|
||||||
|
let date = new Date(today);
|
||||||
|
date.setDate(today.getDate() - i);
|
||||||
|
days.push(date.toISOString().split('T')[0]); // 格式化为 YYYY-MM-DD
|
||||||
|
}
|
||||||
|
return days;
|
||||||
|
},
|
||||||
|
//时间
|
||||||
|
showTime() {
|
||||||
|
this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss");
|
||||||
|
this.currentDay = this.$TOOL.dateFormat(
|
||||||
|
new Date(),
|
||||||
|
"yyyy年MM月dd日"
|
||||||
|
);
|
||||||
|
},
|
||||||
|
setChart(name, option = null) {
|
||||||
|
var myChart = echarts.getInstanceByDom(document.getElementById(name));
|
||||||
|
if (myChart == undefined) {
|
||||||
|
myChart = echarts.init(document.getElementById(name), "dark", {
|
||||||
|
renderer: "svg",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (option == null) {
|
||||||
|
option = Object.assign({}, this.barOption);
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
try {
|
||||||
|
myChart.setOption(option);
|
||||||
|
} catch (error) {}
|
||||||
|
}, 500);
|
||||||
|
return myChart;
|
||||||
|
},
|
||||||
|
//生产统计
|
||||||
|
getProductLine() {
|
||||||
|
let that = this;
|
||||||
|
let obj = {
|
||||||
|
query: {start_date: that.start_time,end_date: that.end_time,dept_name:'磨抛车间'},
|
||||||
|
};
|
||||||
|
that.$API.bi.dataset.exec.req("lineDay", obj).then((res) => {
|
||||||
|
let list = res.data2.ds0;
|
||||||
|
let seriesData0 = [],seriesData1 = [],seriesData2 = [];
|
||||||
|
for (let i = 0; i < that.xAxisData.length; i++) {
|
||||||
|
seriesData0[i] = 0;seriesData1[i] = 0;seriesData2[i] = 0;
|
||||||
|
}
|
||||||
|
if (list.length > 0) {
|
||||||
|
list.forEach((item) => {
|
||||||
|
let dateNow = new Date().getDate();
|
||||||
|
if(item.日 == dateNow){
|
||||||
|
that.sctj.rtcs = item.总重量;
|
||||||
|
that.sctj.rjgs = item.生产数;
|
||||||
|
that.sctj.rjgqbls = item.生产数-item.不合格数-item.合格数;
|
||||||
|
that.sctj.rhgs = item.合格数;
|
||||||
|
that.sctj.rbhgs = item.不合格数;
|
||||||
|
}
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.年+'-'+item.月+'-'+item.日;
|
||||||
|
arr[1] = item.生产数;
|
||||||
|
arr[2] = item.合格数;
|
||||||
|
arr[3] = item.不合格数;
|
||||||
|
that.configDatas.data.push(arr);
|
||||||
|
|
||||||
|
let indexs = that.daysList.indexOf(item.日);
|
||||||
|
seriesData0[indexs] = item.生产数;
|
||||||
|
seriesData1[indexs] = item.合格数;
|
||||||
|
seriesData2[indexs] = item.合格率;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
that.barOption.xAxis.data = that.xAxisData;
|
||||||
|
that.barOption.series[0].data = seriesData0;
|
||||||
|
that.barOption.series[1].data = seriesData1;
|
||||||
|
that.barOption.series[2].data = seriesData2;
|
||||||
|
let chart1 = this.setChart("chart1", that.barOption);
|
||||||
|
let index1 = 0;
|
||||||
|
this.chartInterval1 = setInterval(function () {
|
||||||
|
if (index1 < that.barOption.series[0].data.length) {
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "downplay",
|
||||||
|
seriesIndex: 0,
|
||||||
|
});
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index1,
|
||||||
|
});
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "showTip",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index1,
|
||||||
|
});
|
||||||
|
index1++;
|
||||||
|
} else {
|
||||||
|
index1 = 0;
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//不合格分布
|
||||||
|
getCountnotok(){
|
||||||
|
let that = this;
|
||||||
|
let obj = {query:{start_date:that.start_time,end_date:that.end_time}};
|
||||||
|
that.$API.bi.dataset.exec.req('notok_dis', obj).then((res) => {
|
||||||
|
let seriesData = [];
|
||||||
|
if(res.data2.ds0){
|
||||||
|
res.data2.ds0.forEach((item) => {
|
||||||
|
let obj = {};
|
||||||
|
obj.name = item.不合格项;
|
||||||
|
obj.value = item.数量;
|
||||||
|
seriesData.push(obj);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.pieOption.series.data = seriesData;
|
||||||
|
let index2 = 0;
|
||||||
|
let chart2 = this.setChart("chart2", that.pieOption);
|
||||||
|
this.chartInterval2 = setInterval(function () {
|
||||||
|
if (index2 < that.barOption.series[0].data.length) {
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "downplay",
|
||||||
|
seriesIndex: 0,
|
||||||
|
});
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "showTip",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
index2++;
|
||||||
|
} else {
|
||||||
|
index2 = 0;
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//设备状态
|
||||||
|
getEqState(id) {
|
||||||
|
let that = this;
|
||||||
|
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
|
||||||
|
that.hh.bw = res.保温;
|
||||||
|
that.hh.lq = res.冷却;
|
||||||
|
that.hh.yx = res.运行;
|
||||||
|
that.hh.wyx = res.未运行;
|
||||||
|
that.hh.gz = res.故障;
|
||||||
|
let nowTime = new Date(res.now).getTime();
|
||||||
|
if(res.rows.length>0){
|
||||||
|
res.rows.forEach((item) => {
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.name;
|
||||||
|
arr[1] = item.number;
|
||||||
|
if(item.mstate=='冷却'){
|
||||||
|
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
|
||||||
|
}else if(item.mstate=='未运行'){
|
||||||
|
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
|
||||||
|
}else if(item.mstate=='故障'){
|
||||||
|
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
|
||||||
|
}
|
||||||
|
let process = null, workTime =0,saveTime=null,sumTime=0;
|
||||||
|
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
|
||||||
|
item.reminder_interval_list.forEach(item=>{
|
||||||
|
sumTime += item;
|
||||||
|
})
|
||||||
|
let startTime = new Date(item.work_start_time).getTime();
|
||||||
|
workTime = (nowTime-startTime)/60000;//已工作时间
|
||||||
|
process = Math.round((workTime/sumTime)*100);
|
||||||
|
process = process>100?'100%':process+'%';
|
||||||
|
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
|
||||||
|
if(bwSaveTime>0){
|
||||||
|
saveTime = bwSaveTime;
|
||||||
|
}else{
|
||||||
|
saveTime = 0;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
process = '';
|
||||||
|
saveTime = '';
|
||||||
|
}
|
||||||
|
arr[3] = process;
|
||||||
|
arr[4] = item.t_count_use?item.t_count_use:0;
|
||||||
|
that.configDataEq.data.push(arr);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//库存统计列表
|
||||||
|
getMaterials(page) {
|
||||||
|
let that = this;
|
||||||
|
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'白片抛后超洗,平磨,磨抛一次抛,一次抛后超洗,成品抛,一次超洗,二次超洗,三次超洗' }).then((res) => {
|
||||||
|
if(res.results.length>0){
|
||||||
|
res.results.forEach((item) => {
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.material_name;
|
||||||
|
arr[1] = item.batch;
|
||||||
|
arr[2] = item.count;
|
||||||
|
arr[3] = item.count_working;
|
||||||
|
that.configDataInm.data.push(arr);
|
||||||
|
})
|
||||||
|
if(res.count>that.configDataInm.data.length){
|
||||||
|
that.page++;
|
||||||
|
that.getMaterials(that.page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
@font-face {
|
||||||
|
font-family: "myfont";
|
||||||
|
src: url("../../../utils/youShe.ttf");
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard {
|
||||||
|
background-image: url("/public/img/photon_bg.png");
|
||||||
|
color: #fff;
|
||||||
|
font-family: "Microsoft Yahei" !important;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
background: url("/public/img/photon_header.png");
|
||||||
|
border-bottom: none;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
font-size: 26px;
|
||||||
|
display: block;
|
||||||
|
height: 80px;
|
||||||
|
color: rgb(149, 255, 255);
|
||||||
|
font-family: "Microsoft Yahei";
|
||||||
|
text-align: center;
|
||||||
|
padding: 12px 0px;
|
||||||
|
}
|
||||||
|
.header > .title {
|
||||||
|
font-weight: bold;
|
||||||
|
font-family: "myfont";
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
.header > .timer {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 18px;
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
background: rgba(10, 63, 68, 0.5);
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxtitle {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 16px;
|
||||||
|
display: flex;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
background: linear-gradient(
|
||||||
|
40deg,
|
||||||
|
rgba(11, 101, 140, 0.451),
|
||||||
|
rgba(0, 34, 48, 0.335),
|
||||||
|
rgba(11, 101, 140, 0.451)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bgimg {
|
||||||
|
background-image: url("https://cdn-upload.datav.aliyun.com/upload/download/1678762309227-E6RP8z2R.png");
|
||||||
|
background-size: 140% 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxlabel {
|
||||||
|
margin-left: 6px;
|
||||||
|
font-size: 18px;
|
||||||
|
/* margin-top: 6px; */
|
||||||
|
}
|
||||||
|
.stateIcon{
|
||||||
|
width:16px;
|
||||||
|
height: 16px;
|
||||||
|
margin: 0 5px;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.bwIcon{
|
||||||
|
background-color: rgb(245, 196, 0);
|
||||||
|
}
|
||||||
|
.lqIcon,.yxicon{
|
||||||
|
background-color: rgb(0,163,245);
|
||||||
|
}
|
||||||
|
.wyxIcon{
|
||||||
|
background-color: rgb(69,176,118);
|
||||||
|
}
|
||||||
|
.gzIcon{
|
||||||
|
background-color: rgb(222,60,54);
|
||||||
|
}
|
||||||
|
.eqNum{
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
.boxmain {
|
||||||
|
height: calc(100% - 50px);
|
||||||
|
}
|
||||||
|
.boxmain.boxmainbottom{
|
||||||
|
height: calc(100% - 38px);
|
||||||
|
}
|
||||||
|
.boxmain.boxmainTopRight{
|
||||||
|
height: calc(100% - 120px);
|
||||||
|
}
|
||||||
|
.lineDiv {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
padding-left: 0.5em;
|
||||||
|
}
|
||||||
|
.boxmainItemNumber {
|
||||||
|
color: rgb(42,234,200);
|
||||||
|
margin-left: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-face:24px;
|
||||||
|
font-family: electronicFont;
|
||||||
|
}
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.boxmain {
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex_center {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border {
|
||||||
|
border: 1px dashed #49bcf7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bigdata {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.marquee_top {
|
||||||
|
transition: all 0.5s ease-in-out;
|
||||||
|
margin-top: -26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totall {
|
||||||
|
color: #fff;
|
||||||
|
background-color: rgb(10, 63, 68);
|
||||||
|
}
|
||||||
|
|
||||||
|
.rollData {
|
||||||
|
background-color: rgb(10, 39, 50);
|
||||||
|
}
|
||||||
|
|
||||||
|
.rollData:nth-of-type(2n + 1) {
|
||||||
|
background-color: rgb(0, 59, 81);
|
||||||
|
}
|
||||||
|
.halfBox {
|
||||||
|
height: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totalStatic{
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.totalStaticItem{
|
||||||
|
flex: 1;
|
||||||
|
height: 25px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 25px;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
.totalStaticItemNum{
|
||||||
|
font-size: 24px;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
font-family: "myfont";
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 0;
|
||||||
|
color: rgb(149, 255, 255);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,714 @@
|
||||||
|
<!-- 扫边车间 -->
|
||||||
|
<template>
|
||||||
|
<el-container class="dashboard">
|
||||||
|
<el-header class="header">
|
||||||
|
<div class="title">扫边车间生产数据看板</div>
|
||||||
|
<div class="timer">{{ currentDay }} {{ currentTime }}</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main>
|
||||||
|
<el-row style="height: 60%" :gutter="10">
|
||||||
|
<el-col :span="12" style="height: 100%">
|
||||||
|
<!-- 设备状态 -->
|
||||||
|
<el-col style="height: 50%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">
|
||||||
|
设备状态
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon yxicon"></span>
|
||||||
|
<span>运行中</span>
|
||||||
|
<span class="eqNum">{{hh.yx}}台</span>
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon wyxIcon"></span>
|
||||||
|
<span>未运行</span>
|
||||||
|
<span class="eqNum">{{hh.wyx}}台</span>
|
||||||
|
</div>
|
||||||
|
<div class="boxlabel">
|
||||||
|
<span class="stateIcon gzIcon"></span>
|
||||||
|
<span>故障</span>
|
||||||
|
<span class="eqNum">{{hh.gz}}台</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 2px"></div>
|
||||||
|
<div class="boxmain" id="scrollContainer">
|
||||||
|
<dv-scroll-board :config="configDataEq" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- 库存 -->
|
||||||
|
<el-col style="height: 50%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">
|
||||||
|
扫边车间库存
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 2px"></div>
|
||||||
|
<div class="boxmain" id="scrollContainer">
|
||||||
|
<dv-scroll-board :config="configDataInm" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" style="height: 100%">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">生产数统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="totalStatic">
|
||||||
|
<span class="totalStaticItem">日投产量</span>
|
||||||
|
<span class="totalStaticItem">日加工数</span>
|
||||||
|
<span class="totalStaticItem">日加工前不良</span>
|
||||||
|
<span class="totalStaticItem">日合格数</span>
|
||||||
|
<span class="totalStaticItem">日不合格数</span>
|
||||||
|
</div>
|
||||||
|
<div class="totalStatic">
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rtcs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgqbls }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rhgs }}</span>
|
||||||
|
<span class="totalStaticItem totalStaticItemNum">{{ sctj.rbhgs }}</span>
|
||||||
|
</div>
|
||||||
|
<dv-scroll-board :config="configDatas" class="boxmain boxmainTopRight" style="width:98%;margin:auto" />
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div style="height: 0.3%"></div>
|
||||||
|
<!-- 生产统计 分析 -->
|
||||||
|
<div style="height: 0.3%"></div>
|
||||||
|
<el-row style="height: 39%" :gutter="10">
|
||||||
|
<!-- 折线图 日加工数、日合格数、日合格率,近七天数据 -->
|
||||||
|
<el-col :span="12" style="height: 100%;">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">合格数统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain boxmainbottom" id="chart1"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- 饼状图 各不合格品 原因占比 -->
|
||||||
|
<el-col :span="12" style="height: 100%;">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxtitle">
|
||||||
|
<div class="boxlabel">不合格占比统计</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxmain boxmainbottom" id="chart2"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as echarts from "echarts";
|
||||||
|
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||||
|
function deepCopy(obj) {
|
||||||
|
return JSON.parse(JSON.stringify(obj));
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
components: { scScrollTavle },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
barOption: {
|
||||||
|
backgroundColor: "",
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
type: "cross",
|
||||||
|
label: {
|
||||||
|
backgroundColor: "#6a7985",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "stack",
|
||||||
|
right: 0,
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: "3%",
|
||||||
|
right: "2%",
|
||||||
|
bottom: "3%",
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: "category",
|
||||||
|
boundaryGap: true,
|
||||||
|
data: [],
|
||||||
|
nameTextStyle: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
name: "",
|
||||||
|
type: "value",
|
||||||
|
nameTextStyle: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: "#ffffff",
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
show: false,
|
||||||
|
lineStyle: {
|
||||||
|
type: "dashed", //y轴分割线类型
|
||||||
|
color: "rgba(102,102,102,0.9)",
|
||||||
|
width: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "加工数",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "合格数",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "合格率",
|
||||||
|
type: "bar",
|
||||||
|
barWidth: 10,
|
||||||
|
emphasis: {
|
||||||
|
focus: "series",
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
pieOption: {
|
||||||
|
backgroundColor: "",
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item'
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "stack",
|
||||||
|
right: 0,
|
||||||
|
orient: 'vertical',
|
||||||
|
itemWidth: 12,
|
||||||
|
itemHeight: 12,
|
||||||
|
textStyle: {
|
||||||
|
color: '#fff',
|
||||||
|
fontSize: 11,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
name: '不合格占比',
|
||||||
|
type: 'pie',
|
||||||
|
radius: ['1%', '60%'],
|
||||||
|
center: ['35%', '50%'],
|
||||||
|
label: false,
|
||||||
|
data: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tableHeight: 100,
|
||||||
|
speed: 2000,
|
||||||
|
time: null,
|
||||||
|
hh:{
|
||||||
|
yx:0,
|
||||||
|
wyx:0,
|
||||||
|
gz:0,
|
||||||
|
},
|
||||||
|
sctj:{
|
||||||
|
rtcs:0,
|
||||||
|
rjgs:0,
|
||||||
|
rjgqbls:0,
|
||||||
|
rhgs:0,
|
||||||
|
rbhgs:0,
|
||||||
|
},
|
||||||
|
dayInterval: null,
|
||||||
|
chartInterval1: null,
|
||||||
|
chartInterval2: null,
|
||||||
|
//库存
|
||||||
|
configDataInm:{
|
||||||
|
header:['物料名称','批次号','数量','生产中'],
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
headerHeight:40,
|
||||||
|
align:'center',
|
||||||
|
data:[],
|
||||||
|
waitTime:1000,
|
||||||
|
},
|
||||||
|
//设备
|
||||||
|
configDataEq:{
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
|
||||||
|
headerHeight:40,
|
||||||
|
data:[]
|
||||||
|
},
|
||||||
|
//生产统计
|
||||||
|
configDatas :{
|
||||||
|
headerBGC:'#0a3f44',
|
||||||
|
header:['日期','加工数','合格数','不合格数'],
|
||||||
|
headerHeight:40,
|
||||||
|
data:[]
|
||||||
|
},
|
||||||
|
page:1,
|
||||||
|
currentTime: "",
|
||||||
|
currentDay: "",
|
||||||
|
today: "",
|
||||||
|
end_time:'',
|
||||||
|
start_time:'',
|
||||||
|
mgroups:[],
|
||||||
|
daysList:[],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
that.page = 1;
|
||||||
|
that.configDataInm.data = [];
|
||||||
|
//表格table的高度
|
||||||
|
this.tableHeight = document.getElementById("scrollContainer").clientHeight;
|
||||||
|
this.showTime();
|
||||||
|
this.dayInterval = setInterval(() => {
|
||||||
|
this.showTime();
|
||||||
|
}, 1000);
|
||||||
|
//近七天的日期数组
|
||||||
|
let daysArr = this.getMondayOfCurrentWeek();
|
||||||
|
this.daysArr = daysArr;
|
||||||
|
let xAxisData = [];
|
||||||
|
daysArr.forEach((item)=>{
|
||||||
|
let dates = item.split('-');
|
||||||
|
let obj = dates[1]+'-'+dates[2];
|
||||||
|
xAxisData.push(obj);
|
||||||
|
let dayitem = Number(dates[2]);
|
||||||
|
that.daysList.push(dayitem);
|
||||||
|
})
|
||||||
|
that.today = new Date().toISOString().split('T')[0]
|
||||||
|
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");
|
||||||
|
let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd");
|
||||||
|
this.start_time = start_time;
|
||||||
|
this.end_time = end_time;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$API.mtm.mgroup.list.req({page:0,belong_dept__name:'扫边车间'}).then((res) => {
|
||||||
|
that.mgroups = res;
|
||||||
|
that.configDataEq.data = [];
|
||||||
|
res.forEach((item)=>{
|
||||||
|
//设备数据
|
||||||
|
that.getEqState(item.id);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.getMaterials(that.page);
|
||||||
|
//投产/生产分析
|
||||||
|
this.getProductLine();
|
||||||
|
this.getCountnotok();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getMondayOfCurrentWeek() {
|
||||||
|
let today = new Date();
|
||||||
|
let days = [];
|
||||||
|
for (let i = 6; i >= 0; i--) {
|
||||||
|
let date = new Date(today);
|
||||||
|
date.setDate(today.getDate() - i);
|
||||||
|
days.push(date.toISOString().split('T')[0]); // 格式化为 YYYY-MM-DD
|
||||||
|
}
|
||||||
|
return days;
|
||||||
|
},
|
||||||
|
//时间
|
||||||
|
showTime() {
|
||||||
|
this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss");
|
||||||
|
this.currentDay = this.$TOOL.dateFormat(
|
||||||
|
new Date(),
|
||||||
|
"yyyy年MM月dd日"
|
||||||
|
);
|
||||||
|
},
|
||||||
|
setChart(name, option = null) {
|
||||||
|
var myChart = echarts.getInstanceByDom(document.getElementById(name));
|
||||||
|
if (myChart == undefined) {
|
||||||
|
myChart = echarts.init(document.getElementById(name), "dark", {
|
||||||
|
renderer: "svg",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (option == null) {
|
||||||
|
option = Object.assign({}, this.barOption);
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
try {
|
||||||
|
myChart.setOption(option);
|
||||||
|
} catch (error) {}
|
||||||
|
}, 500);
|
||||||
|
return myChart;
|
||||||
|
},
|
||||||
|
//生产统计
|
||||||
|
getProductLine() {
|
||||||
|
let that = this;
|
||||||
|
let obj = {
|
||||||
|
query: {start_date: that.start_time,end_date: that.end_time,dept_name:'扫边车间'},
|
||||||
|
};
|
||||||
|
that.$API.bi.dataset.exec.req("lineDay", obj).then((res) => {
|
||||||
|
let list = res.data2.ds0;
|
||||||
|
let seriesData0 = [],seriesData1 = [],seriesData2 = [];
|
||||||
|
for (let i = 0; i < that.xAxisData.length; i++) {
|
||||||
|
seriesData0[i] = 0;seriesData1[i] = 0;seriesData2[i] = 0;
|
||||||
|
}
|
||||||
|
if (list.length > 0) {
|
||||||
|
list.forEach((item) => {
|
||||||
|
let dateNow = new Date().getDate();
|
||||||
|
if(item.日 == dateNow){
|
||||||
|
that.sctj.rtcs = item.总重量;
|
||||||
|
that.sctj.rjgs = item.生产数;
|
||||||
|
that.sctj.rjgqbls = item.生产数-item.不合格数-item.合格数;
|
||||||
|
that.sctj.rhgs = item.合格数;
|
||||||
|
that.sctj.rbhgs = item.不合格数;
|
||||||
|
}
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.年+'-'+item.月+'-'+item.日;
|
||||||
|
arr[1] = item.生产数;
|
||||||
|
arr[2] = item.合格数;
|
||||||
|
arr[3] = item.不合格数;
|
||||||
|
that.configDatas.data.push(arr);
|
||||||
|
|
||||||
|
let indexs = that.daysList.indexOf(item.日);
|
||||||
|
seriesData0[indexs] = item.生产数;
|
||||||
|
seriesData1[indexs] = item.合格数;
|
||||||
|
seriesData2[indexs] = item.合格率;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
that.barOption.xAxis.data = that.xAxisData;
|
||||||
|
that.barOption.series[0].data = seriesData0;
|
||||||
|
that.barOption.series[1].data = seriesData1;
|
||||||
|
that.barOption.series[2].data = seriesData2;
|
||||||
|
let chart1 = this.setChart("chart1", that.barOption);
|
||||||
|
let index1 = 0;
|
||||||
|
this.chartInterval1 = setInterval(function () {
|
||||||
|
if (index1 < that.barOption.series[0].data.length) {
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "downplay",
|
||||||
|
seriesIndex: 0,
|
||||||
|
});
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index1,
|
||||||
|
});
|
||||||
|
chart1.dispatchAction({
|
||||||
|
type: "showTip",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index1,
|
||||||
|
});
|
||||||
|
index1++;
|
||||||
|
} else {
|
||||||
|
index1 = 0;
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//不合格分布
|
||||||
|
getCountnotok(){
|
||||||
|
let that = this;
|
||||||
|
let obj = {query:{start_date:that.start_time,end_date:that.end_time}};
|
||||||
|
that.$API.bi.dataset.exec.req('notok_dis', obj).then((res) => {
|
||||||
|
let seriesData = [];
|
||||||
|
if(res.data2.ds0){
|
||||||
|
res.data2.ds0.forEach((item) => {
|
||||||
|
let obj = {};
|
||||||
|
obj.name = item.不合格项;
|
||||||
|
obj.value = item.数量;
|
||||||
|
seriesData.push(obj);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.pieOption.series.data = seriesData;
|
||||||
|
let index2 = 0;
|
||||||
|
let chart2 = this.setChart("chart2", that.pieOption);
|
||||||
|
this.chartInterval2 = setInterval(function () {
|
||||||
|
if (index2 < that.barOption.series[0].data.length) {
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "downplay",
|
||||||
|
seriesIndex: 0,
|
||||||
|
});
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
chart2.dispatchAction({
|
||||||
|
type: "showTip",
|
||||||
|
seriesIndex: 0,
|
||||||
|
dataIndex: index2,
|
||||||
|
});
|
||||||
|
index2++;
|
||||||
|
} else {
|
||||||
|
index2 = 0;
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//设备状态
|
||||||
|
getEqState(id) {
|
||||||
|
let that = this;
|
||||||
|
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
|
||||||
|
that.hh.bw = res.保温;
|
||||||
|
that.hh.lq = res.冷却;
|
||||||
|
that.hh.yx = res.运行;
|
||||||
|
that.hh.wyx = res.未运行;
|
||||||
|
that.hh.gz = res.故障;
|
||||||
|
let nowTime = new Date(res.now).getTime();
|
||||||
|
if(res.rows.length>0){
|
||||||
|
res.rows.forEach((item) => {
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.name;
|
||||||
|
arr[1] = item.number;
|
||||||
|
if(item.mstate=='冷却'){
|
||||||
|
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
|
||||||
|
}else if(item.mstate=='未运行'){
|
||||||
|
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
|
||||||
|
}else if(item.mstate=='故障'){
|
||||||
|
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
|
||||||
|
}
|
||||||
|
let process = null, workTime =0,saveTime=null,sumTime=0;
|
||||||
|
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
|
||||||
|
item.reminder_interval_list.forEach(item=>{
|
||||||
|
sumTime += item;
|
||||||
|
})
|
||||||
|
let startTime = new Date(item.work_start_time).getTime();
|
||||||
|
workTime = (nowTime-startTime)/60000;//已工作时间
|
||||||
|
process = Math.round((workTime/sumTime)*100);
|
||||||
|
process = process>100?'100%':process+'%';
|
||||||
|
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
|
||||||
|
if(bwSaveTime>0){
|
||||||
|
saveTime = bwSaveTime;
|
||||||
|
}else{
|
||||||
|
saveTime = 0;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
process = '';
|
||||||
|
saveTime = '';
|
||||||
|
}
|
||||||
|
arr[3] = process;
|
||||||
|
arr[4] = item.t_count_use?item.t_count_use:0;
|
||||||
|
that.configDataEq.data.push(arr);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//库存统计列表
|
||||||
|
getMaterials(page) {
|
||||||
|
let that = this;
|
||||||
|
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'扫边A,扫边B' }).then((res) => {
|
||||||
|
if(res.results.length>0){
|
||||||
|
res.results.forEach((item) => {
|
||||||
|
let arr = [];
|
||||||
|
arr[0] = item.material_name;
|
||||||
|
arr[1] = item.batch;
|
||||||
|
arr[2] = item.count;
|
||||||
|
arr[3] = item.count_working;
|
||||||
|
that.configDataInm.data.push(arr);
|
||||||
|
})
|
||||||
|
if(res.count>that.configDataInm.data.length){
|
||||||
|
that.page++;
|
||||||
|
that.getMaterials(that.page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
@font-face {
|
||||||
|
font-family: "myfont";
|
||||||
|
src: url("../../../utils/youShe.ttf");
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard {
|
||||||
|
background-image: url("/public/img/photon_bg.png");
|
||||||
|
color: #fff;
|
||||||
|
font-family: "Microsoft Yahei" !important;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
background: url("/public/img/photon_header.png");
|
||||||
|
border-bottom: none;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
font-size: 26px;
|
||||||
|
display: block;
|
||||||
|
height: 80px;
|
||||||
|
color: rgb(149, 255, 255);
|
||||||
|
font-family: "Microsoft Yahei";
|
||||||
|
text-align: center;
|
||||||
|
padding: 12px 0px;
|
||||||
|
}
|
||||||
|
.header > .title {
|
||||||
|
font-weight: bold;
|
||||||
|
font-family: "myfont";
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
.header > .timer {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 18px;
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
background: rgba(10, 63, 68, 0.5);
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxtitle {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 16px;
|
||||||
|
display: flex;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
background: linear-gradient(
|
||||||
|
40deg,
|
||||||
|
rgba(11, 101, 140, 0.451),
|
||||||
|
rgba(0, 34, 48, 0.335),
|
||||||
|
rgba(11, 101, 140, 0.451)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bgimg {
|
||||||
|
background-image: url("https://cdn-upload.datav.aliyun.com/upload/download/1678762309227-E6RP8z2R.png");
|
||||||
|
background-size: 140% 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxlabel {
|
||||||
|
margin-left: 6px;
|
||||||
|
font-size: 18px;
|
||||||
|
/* margin-top: 6px; */
|
||||||
|
}
|
||||||
|
.stateIcon{
|
||||||
|
width:16px;
|
||||||
|
height: 16px;
|
||||||
|
margin: 0 5px;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.bwIcon{
|
||||||
|
background-color: rgb(245, 196, 0);
|
||||||
|
}
|
||||||
|
.lqIcon,.yxicon{
|
||||||
|
background-color: rgb(0,163,245);
|
||||||
|
}
|
||||||
|
.wyxIcon{
|
||||||
|
background-color: rgb(69,176,118);
|
||||||
|
}
|
||||||
|
.gzIcon{
|
||||||
|
background-color: rgb(222,60,54);
|
||||||
|
}
|
||||||
|
.eqNum{
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
.boxmain {
|
||||||
|
height: calc(100% - 50px);
|
||||||
|
}
|
||||||
|
.boxmain.boxmainbottom{
|
||||||
|
height: calc(100% - 38px);
|
||||||
|
}
|
||||||
|
.boxmain.boxmainTopRight{
|
||||||
|
height: calc(100% - 120px);
|
||||||
|
}
|
||||||
|
.lineDiv {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
padding-left: 0.5em;
|
||||||
|
}
|
||||||
|
.boxmainItemNumber {
|
||||||
|
color: rgb(42,234,200);
|
||||||
|
margin-left: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-face:24px;
|
||||||
|
font-family: electronicFont;
|
||||||
|
}
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
.boxmain {
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex_center {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border {
|
||||||
|
border: 1px dashed #49bcf7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bigdata {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.marquee_top {
|
||||||
|
transition: all 0.5s ease-in-out;
|
||||||
|
margin-top: -26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totall {
|
||||||
|
color: #fff;
|
||||||
|
background-color: rgb(10, 63, 68);
|
||||||
|
}
|
||||||
|
|
||||||
|
.rollData {
|
||||||
|
background-color: rgb(10, 39, 50);
|
||||||
|
}
|
||||||
|
|
||||||
|
.rollData:nth-of-type(2n + 1) {
|
||||||
|
background-color: rgb(0, 59, 81);
|
||||||
|
}
|
||||||
|
.halfBox {
|
||||||
|
height: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totalStatic{
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.totalStaticItem{
|
||||||
|
flex: 1;
|
||||||
|
height: 25px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 25px;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
.totalStaticItemNum{
|
||||||
|
font-size: 24px;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
font-family: "myfont";
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 0;
|
||||||
|
color: rgb(149, 255, 255);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -60,11 +60,6 @@
|
||||||
<span v-if="scope.row.material_&&scope.row.material_.model">{{ scope.row.material_.model }}</span>
|
<span v-if="scope.row.material_&&scope.row.material_.model">{{ scope.row.material_.model }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!--
|
|
||||||
:filters="unitFilters"
|
|
||||||
:filter-method="filterUnitDate"
|
|
||||||
filter-placement="bottom-end"
|
|
||||||
-->
|
|
||||||
<el-table-column label="单位">
|
<el-table-column label="单位">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.material_&&scope.row.material_.unit">{{ scope.row.material_.unit }}</span>
|
<span v-if="scope.row.material_&&scope.row.material_.unit">{{ scope.row.material_.unit }}</span>
|
||||||
|
|
@ -84,7 +79,15 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="总金额" prop="expiration_date" sortable>
|
<el-table-column label="总金额" prop="expiration_date" sortable>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.material_&&scope.row.material_.unit_price">{{ Number(scope.row.material_.unit_price)*Number(scope.row.count) }}</span>
|
<!-- <span v-if="scope.row.material_&&scope.row.material_.unit_price">{{ Math.round(Number(scope.row.material_.unit_price)*Number(scope.row.count)) }}</span> -->
|
||||||
|
<span v-if="scope.row.material_&&scope.row.material_.unit_price">{{ ((Number(scope.row.material_.unit_price)*Number(scope.row.count))).toFixed(2) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="库存状态" prop="count">
|
||||||
|
<template #default="scope">
|
||||||
|
<span v-if="Number(scope.row.count)>Number(scope.row.material_.count_safe)">正常</span>
|
||||||
|
<span v-else-if="Number(scope.row.count)==Number(scope.row.material_.count_safe)">临界</span>
|
||||||
|
<span v-else>待采购</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</scTable>
|
</scTable>
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,8 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" prop="create_time">
|
<el-table-column label="创建时间" prop="create_time">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" prop="note">
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="操作"
|
label="操作"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,6 @@
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="部门执行人"
|
label="部门执行人"
|
||||||
v-if="form.type == 'do_in' || form.type == 'do_out'|| form.type == 'borrow_out' || form.type == 'return_in'"
|
v-if="form.type == 'do_in' || form.type == 'do_out'|| form.type == 'borrow_out' || form.type == 'return_in'"
|
||||||
|
|
@ -161,6 +160,9 @@
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.note" placeholder="编号" />
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button type="primary" :loading="isSaveing" @click="submit">
|
<el-button type="primary" :loading="isSaveing" @click="submit">
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,10 @@
|
||||||
v-model="selectBatch"
|
v-model="selectBatch"
|
||||||
value-key="id"
|
value-key="id"
|
||||||
clearable
|
clearable
|
||||||
|
filterable
|
||||||
|
remote = "true"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
:remote-method="inputChange"
|
||||||
@change="selectBatchChange"
|
@change="selectBatchChange"
|
||||||
@clear="selectBatchClear"
|
@clear="selectBatchClear"
|
||||||
>
|
>
|
||||||
|
|
@ -357,6 +360,33 @@ export default {
|
||||||
this.wbatchOptions = res;
|
this.wbatchOptions = res;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
inputChange(e){
|
||||||
|
console.log('e',e);
|
||||||
|
if(e!==''&&e!==null&&e!==undefined){
|
||||||
|
let codeId = e.split('#')[1];
|
||||||
|
this.$API.cm.labelmat.item.req(codeId).then((res) => {
|
||||||
|
if(res){
|
||||||
|
arr = that.batchOptions.filter((item) => {
|
||||||
|
return item.batch == res.batch&&item.state==res.state;
|
||||||
|
})
|
||||||
|
if (arr.length > 0) {
|
||||||
|
that.selectBatch = arr[0].batch;
|
||||||
|
that.form.batch = arr[0].batch;
|
||||||
|
that.form.mb = arr[0].id;
|
||||||
|
that.batchcount = Number(arr[0].count_canmio);
|
||||||
|
that.form.count = Number(arr[0].count_canmio);
|
||||||
|
that.form.warehouse = arr[0].warehouse;
|
||||||
|
that.inputBatchDisable = true;
|
||||||
|
}else{
|
||||||
|
that.selectBatch = '';
|
||||||
|
that.$message.error("批次号不存在");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
that.selectBatch = '';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
getMaterialOptions() {
|
getMaterialOptions() {
|
||||||
var type = this.form.type;
|
var type = this.form.type;
|
||||||
var cate = this.cate;
|
var cate = this.cate;
|
||||||
|
|
|
||||||
|
|
@ -43,20 +43,27 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-footer>
|
<el-footer>
|
||||||
|
|
||||||
<el-button type="danger"
|
<el-button type="danger"
|
||||||
v-if="localMode=='edit'"
|
v-if="localMode=='edit'"
|
||||||
|
v-auth="'supplieraudit.delete'"
|
||||||
|
:loading="saveLoading"
|
||||||
style="margin-right: 4px;"
|
style="margin-right: 4px;"
|
||||||
@click="handleDel"
|
@click="handleDel"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
<ticketd_b
|
<ticketd_b
|
||||||
:workflow_key="'wf_supplieraudit'"
|
v-if ="formData.ticket_"
|
||||||
:title="ticketTitle"
|
|
||||||
:t_id="formData.id"
|
:t_id="formData.id"
|
||||||
:ticket_="formData.ticket_"
|
:ticket_="formData.ticket_"
|
||||||
@success="$emit('success', localMode)"
|
@success="$emit('success', localMode)"
|
||||||
:submit_b_func="submit_b_func"
|
|
||||||
ref="ticketd_b"
|
ref="ticketd_b"
|
||||||
></ticketd_b>
|
></ticketd_b>
|
||||||
|
<el-button
|
||||||
|
v-else
|
||||||
|
type="primary"
|
||||||
|
style="margin-right: 4px;"
|
||||||
|
@click="handleSave"
|
||||||
|
>提交审批</el-button>
|
||||||
</el-footer>
|
</el-footer>
|
||||||
</el-main>
|
</el-main>
|
||||||
<el-aside width="20%" v-if="formData.ticket_">
|
<el-aside width="20%" v-if="formData.ticket_">
|
||||||
|
|
@ -90,7 +97,7 @@ export default {
|
||||||
survery_form_: null
|
survery_form_: null
|
||||||
},
|
},
|
||||||
localMode: this.mode,
|
localMode: this.mode,
|
||||||
ticketTitle: "供应商审核"
|
saveLoading: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -124,16 +131,18 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async submit_b_func() {
|
handleSave() {
|
||||||
if (this.localMode == "add") {
|
if (this.localMode == "add") {
|
||||||
let res = await this.$API.pum.supplieraudit.create.req(this.formData);
|
this.saveLoading = true;
|
||||||
this.ticketTitle = this.formData.name + "的供应商审核";
|
this.$API.pum.supplieraudit.create.req(this.formData).then(res=>{
|
||||||
this.formData.id = res.id;
|
this.saveLoading = true;
|
||||||
return res.id;
|
this.$message.success("提交成功");
|
||||||
|
}).catch(e=>{
|
||||||
|
this.saveLoading = false;
|
||||||
|
})
|
||||||
|
this.$emit('success', this.localMode);
|
||||||
} else if (this.localMode == "edit") {
|
} else if (this.localMode == "edit") {
|
||||||
console.log(this.formData);
|
this.$message.error("不支持编辑!")
|
||||||
this.$message.error("不支持编辑");
|
|
||||||
throw new Error("不支持编辑");
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<!-- <el-input v-model="query.name__contains"
|
|
||||||
placeholder="产品名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px;"
|
|
||||||
></el-input> -->
|
|
||||||
<el-input v-model="query.batch__contains"
|
<el-input v-model="query.batch__contains"
|
||||||
placeholder="批次号"
|
placeholder="批次号"
|
||||||
clearable
|
clearable
|
||||||
|
|
@ -32,6 +27,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<!-- <el-input v-model="query.name__contains"
|
|
||||||
placeholder="产品名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px;"
|
|
||||||
></el-input> -->
|
|
||||||
<el-input v-model="query.batch__contains"
|
<el-input v-model="query.batch__contains"
|
||||||
placeholder="批次号"
|
placeholder="批次号"
|
||||||
clearable
|
clearable
|
||||||
|
|
@ -32,6 +27,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<!-- <el-input v-model="query.name__contains"
|
|
||||||
placeholder="产品名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px;"
|
|
||||||
></el-input> -->
|
|
||||||
<el-input v-model="query.batch__contains"
|
<el-input v-model="query.batch__contains"
|
||||||
placeholder="批次号"
|
placeholder="批次号"
|
||||||
clearable
|
clearable
|
||||||
|
|
@ -32,6 +27,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<!-- <el-input v-model="query.name__contains"
|
|
||||||
placeholder="产品名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px;"
|
|
||||||
></el-input> -->
|
|
||||||
<el-input v-model="query.batch__contains"
|
<el-input v-model="query.batch__contains"
|
||||||
placeholder="批次号"
|
placeholder="批次号"
|
||||||
clearable
|
clearable
|
||||||
|
|
@ -32,6 +27,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<!-- <el-input v-model="query.name__contains"
|
|
||||||
placeholder="产品名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px;"
|
|
||||||
></el-input> -->
|
|
||||||
<el-input v-model="query.batch__contains"
|
<el-input v-model="query.batch__contains"
|
||||||
placeholder="批次号"
|
placeholder="批次号"
|
||||||
clearable
|
clearable
|
||||||
|
|
@ -32,6 +27,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<!-- <el-input v-model="query.name__contains"
|
|
||||||
placeholder="产品名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px;"
|
|
||||||
></el-input> -->
|
|
||||||
<el-input v-model="query.batch__contains"
|
<el-input v-model="query.batch__contains"
|
||||||
placeholder="批次号"
|
placeholder="批次号"
|
||||||
clearable
|
clearable
|
||||||
|
|
@ -32,6 +27,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,9 @@
|
||||||
ref="table"
|
ref="table"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
|
hidePagination
|
||||||
|
hideDo
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
@ -91,7 +94,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
query:{
|
query:{
|
||||||
end_date:'',
|
end_date:'',
|
||||||
mgroup_name:'',
|
mgroup_name:'排板',
|
||||||
start_date:'',
|
start_date:'',
|
||||||
},
|
},
|
||||||
mgroups: [],
|
mgroups: [],
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<!-- <el-input v-model="query.name__contains"
|
|
||||||
placeholder="产品名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px;"
|
|
||||||
></el-input> -->
|
|
||||||
<el-input v-model="query.batch__contains"
|
<el-input v-model="query.batch__contains"
|
||||||
placeholder="批次号"
|
placeholder="批次号"
|
||||||
clearable
|
clearable
|
||||||
|
|
@ -32,6 +27,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,135 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<div class="right-panel">
|
||||||
|
<el-input v-model="query.batch__contains"
|
||||||
|
placeholder="批次号"
|
||||||
|
clearable
|
||||||
|
style="width: 200px;"
|
||||||
|
></el-input>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleQuery"
|
||||||
|
></el-button>
|
||||||
|
<el-button
|
||||||
|
@click="handleExport"
|
||||||
|
class="tables"
|
||||||
|
type="primary"
|
||||||
|
>导出</el-button>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main class="nopadding">
|
||||||
|
<scTable
|
||||||
|
ref="table"
|
||||||
|
:apiObj="apiObj"
|
||||||
|
:params="params"
|
||||||
|
:query="params"
|
||||||
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
|
stripe
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
<el-table-column label="批次号" fixed="left">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.data.分检_批次号 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="版型" prop="number" fixed="left">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="分检数" prop="number" fixed="left">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="S畸变" align="center" class-name="colorheader1">
|
||||||
|
<el-table-column label="差值" class-name="colorheader1">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.data.分检_检测项_S畸变 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="合格数" class-name="colorheader1">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{scope.row.data.分检_缺陷项_S畸变不合格?1-scope.row.data.分检_缺陷项_S畸变不合格:1 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="像位移" align="center" class-name="colorheader2">
|
||||||
|
<el-table-column label="差值" class-name="colorheader2">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.data.分检_检测项_像位移 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="合格数" class-name="colorheader2">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.data.分检_缺陷项_像位移不合格?1-scope.row.data.分检_缺陷项_像位移不合格:1 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="炸废" align="center" class-name="colorheader3">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.data.分检_缺陷项_炸废?scope.row.data.分检_缺陷项_炸废:0 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="放大率" align="center" class-name="colorheader4">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.data.分检_缺陷项_放大率?scope.row.data.分检_缺陷项_放大率:0 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="角偏" align="center" class-name="colorheader5">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.data.分检_缺陷项_角偏?scope.row.data.分检_缺陷项_角偏:0 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="扭转角不合格" align="center" class-name="colorheader6">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{scope.row.data.分检_缺陷项_扭转角不合格?scope.row.data.分检_缺陷项_扭转角不合格:0}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" class-name="colorheader7">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.data.分检_缺陷项_备注 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "statistics_guan",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
params: {
|
||||||
|
ordering:'data__分检_批次号',
|
||||||
|
querys:[[{field:"wm",value:0,compare:"isnull"},{field:"data__has_key",compare:"",value:"分检_批次号"}]],
|
||||||
|
},
|
||||||
|
query:{
|
||||||
|
name__contains:'',
|
||||||
|
batch__contains:'',
|
||||||
|
last_time__gte:'',
|
||||||
|
last_time__lte:'',
|
||||||
|
},
|
||||||
|
apiObj: this.$API.wpm.wpr.query,
|
||||||
|
options:[],
|
||||||
|
tableData:[],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleQuery(){
|
||||||
|
let that = this;
|
||||||
|
let querys = [[{field:"data__has_key",compare:"",value:"分检_批次号"}]];
|
||||||
|
let obj = {};
|
||||||
|
obj.field = 'batch';
|
||||||
|
obj.value = that.query.batch__contains;
|
||||||
|
obj.compare = '';
|
||||||
|
if(that.query.batch__contains!==''&&that.query.batch__contains!==null){
|
||||||
|
querys[0].push(obj);
|
||||||
|
}
|
||||||
|
that.params.querys = querys;
|
||||||
|
this.$refs.table.queryData(that.params);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
</style>
|
||||||
|
|
@ -2,11 +2,6 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<!-- <el-input v-model="query.name__contains"
|
|
||||||
placeholder="产品名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px;"
|
|
||||||
></el-input> -->
|
|
||||||
<el-input v-model="query.batch__contains"
|
<el-input v-model="query.batch__contains"
|
||||||
placeholder="批次号"
|
placeholder="批次号"
|
||||||
clearable
|
clearable
|
||||||
|
|
@ -32,6 +27,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,15 @@
|
||||||
ref="table"
|
ref="table"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
|
hidePagination
|
||||||
|
hideDo
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
<el-table-column label="产品" prop="物料名" fixed="left" width="120">
|
<el-table-column label="产品" prop="物料名" fixed="left" width="120">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-for="item in lists" :key="item" :label="item" :prop="item">
|
<el-table-column v-for="item in lists" :key="item" :label="item">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row[item]">{{ scope.row[item] }}</span>
|
<span v-if="scope.row[item]">{{ scope.row[item] }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -21,9 +24,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { genTree } from "@/utils/verificate";
|
|
||||||
export default {
|
export default {
|
||||||
name: "workerTimes",
|
name: "inmTotal",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lists:[],
|
lists:[],
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<!-- <el-input v-model="query.name__contains"
|
|
||||||
placeholder="产品名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px;"
|
|
||||||
></el-input> -->
|
|
||||||
<el-input v-model="query.batch__contains"
|
<el-input v-model="query.batch__contains"
|
||||||
placeholder="批次号"
|
placeholder="批次号"
|
||||||
clearable
|
clearable
|
||||||
|
|
@ -31,6 +26,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
:summary-method="getSummaries"
|
:summary-method="getSummaries"
|
||||||
show-summary
|
show-summary
|
||||||
stripe
|
stripe
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column label="单号" prop="batch" align="center" fixed="left">
|
<el-table-column label="单号" prop="batch" align="center" fixed="left">
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="querys"
|
:query="querys"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column label="批次编号" fixed="left" prop="batch">
|
<el-table-column label="批次编号" fixed="left" prop="batch">
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,9 @@
|
||||||
ref="table"
|
ref="table"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
|
hidePagination
|
||||||
|
hideDo
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
@ -50,18 +53,12 @@
|
||||||
{{ scope.row[item] }}
|
{{ scope.row[item] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="生产数" prop="生产数">
|
|
||||||
<template #default="scope">
|
|
||||||
<span v-for="item in scope.row.list" :key="item">{{ item.text }}:{{ item.value }}、</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column> -->
|
|
||||||
</scTable>
|
</scTable>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { genTree } from "@/utils/verificate";
|
|
||||||
export default {
|
export default {
|
||||||
name: "workerTimes",
|
name: "workerTimes",
|
||||||
data() {
|
data() {
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@
|
||||||
ref="table"
|
ref="table"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
|
hidePagination
|
||||||
|
hideDo
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column label="日期" prop="日期" width="100" fixed="left">
|
<el-table-column label="日期" prop="日期" width="100" fixed="left">
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="params"
|
:query="params"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
|
row-key="id"
|
||||||
stripe
|
stripe
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" fixed="left"/>
|
<el-table-column type="index" width="50" fixed="left"/>
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
stripe
|
stripe
|
||||||
|
class="totalFooterTable"
|
||||||
style="height: 100%;"
|
style="height: 100%;"
|
||||||
:summary-method="getSummaries"
|
:summary-method="getSummaries"
|
||||||
show-summary
|
show-summary
|
||||||
|
|
@ -151,7 +152,7 @@
|
||||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_黑圈缺口 }}</span></template>
|
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_黑圈缺口 }}</span></template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="外径发货片(B)" class-name="colorheader1">
|
<el-table-column label="外径发货片(B)" class-name="colorheader1">
|
||||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_外径发货片 }}</span></template>
|
<template #default="scope"><span>{{ scope.row.data['尺寸检验_缺陷_外径发货片(B)'] }}</span></template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="前道崩" class-name="colorheader1">
|
<el-table-column label="前道崩" class-name="colorheader1">
|
||||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_前道崩 }}</span></template>
|
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_前道崩 }}</span></template>
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
id="exportDiv"
|
id="exportDiv"
|
||||||
stripe
|
stripe
|
||||||
|
class="totalFooterTable"
|
||||||
style="height: 100%;"
|
style="height: 100%;"
|
||||||
:summary-method="getSummaries"
|
:summary-method="getSummaries"
|
||||||
show-summary
|
show-summary
|
||||||
|
|
@ -544,11 +545,8 @@ export default {
|
||||||
}
|
}
|
||||||
if(index==54){
|
if(index==54){
|
||||||
let sum = 0;
|
let sum = 0;
|
||||||
if(sums[25]){
|
if(sums[54]){
|
||||||
sum += sums[25];
|
sum += sums[54];
|
||||||
}
|
|
||||||
if(sums[53]){
|
|
||||||
sum += sums[53];
|
|
||||||
}
|
}
|
||||||
sums[index] = sum;
|
sums[index] = sum;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
:filters="specsFilters11"
|
:filters="specsFilters11"
|
||||||
:filter-method="filterSpecs11"
|
:filter-method="filterSpecs11"
|
||||||
filter-placement="bottom-end"/>
|
filter-placement="bottom-end"/>
|
||||||
<el-table-column label="库存总数" prop="count_mb"/>
|
<el-table-column label="仓库合格品数" prop="count_mb"/>
|
||||||
<el-table-column label="周预估值" v-if="params.type == 30">
|
<el-table-column label="周预估值" v-if="params.type == 30">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input
|
<el-input
|
||||||
|
|
@ -241,7 +241,7 @@ export default {
|
||||||
mioTypeEnum,
|
mioTypeEnum,
|
||||||
apiObj: this.$API.mtm.material.list,
|
apiObj: this.$API.mtm.material.list,
|
||||||
materialType: "",
|
materialType: "",
|
||||||
params: { is_hidden: false, type: 10, count__gte: 1,page:0 },
|
params: { is_hidden: false, type: 10, count_mb__gt: 0,page:0 },
|
||||||
query: {
|
query: {
|
||||||
material: "",
|
material: "",
|
||||||
mio_type: mioTypeEnum.values[0].key,
|
mio_type: mioTypeEnum.values[0].key,
|
||||||
|
|
@ -369,6 +369,7 @@ export default {
|
||||||
if(that.material_name!==''&&that.material_name!==null){
|
if(that.material_name!==''&&that.material_name!==null){
|
||||||
that.params.name = that.material_name;
|
that.params.name = that.material_name;
|
||||||
}
|
}
|
||||||
|
that.params.query = '{id,name,model,specification,count_mb,week_esitimate_consume}';
|
||||||
this.$API.mtm.material.list.req(that.params).then((res) => {
|
this.$API.mtm.material.list.req(that.params).then((res) => {
|
||||||
that.tableData11 = res;
|
that.tableData11 = res;
|
||||||
if(res.length>0){
|
if(res.length>0){
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,19 @@
|
||||||
@change="handleQuery"
|
@change="handleQuery"
|
||||||
clearable
|
clearable
|
||||||
style="margin-left: 2px"
|
style="margin-left: 2px"
|
||||||
|
>
|
||||||
|
<el-option-group
|
||||||
|
v-for="group in wfOptions"
|
||||||
|
:key="group.category"
|
||||||
|
:label="group.category"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in wfOptions"
|
v-for="item in group.items"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
|
</el-option-group>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="query.script_run_last_result"
|
v-model="query.script_run_last_result"
|
||||||
|
|
@ -136,14 +142,19 @@
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</el-container>
|
</el-container>
|
||||||
<el-dialog v-model="dialogVisible" title="选择流程">
|
<el-dialog v-model="dialogVisible" title="选择流程">
|
||||||
|
<div v-for="group in wfOptions" :key="group.category" class="category-group">
|
||||||
|
<h3 style="margin: 16px 0 8px 0; color: #606266;">{{ group.category }}</h3>
|
||||||
<el-card
|
<el-card
|
||||||
v-for="item in wfOptions"
|
v-for="item in group.items"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:body-style="{ padding: '10px', cursor: 'pointer' }"
|
:body-style="{ padding: '10px', cursor: 'pointer' }"
|
||||||
style="width: 200px; display: inline-block; margin: 4px; background-color: #f5f7fa;"
|
style="width: 180px; display: inline-block; margin: 4px; background-color: #f5f7fa;"
|
||||||
shadow="hover"
|
shadow="hover"
|
||||||
@click="startTicket(item)"
|
@click="startTicket(item)"
|
||||||
>{{ item.name }}</el-card>
|
>
|
||||||
|
{{ item.name }}
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -208,8 +219,24 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getWfOptions() {
|
getWfOptions() {
|
||||||
|
let permissions = this.$TOOL.data.get("PERMISSIONS");
|
||||||
|
const groups = {};
|
||||||
this.$API.wf.workflow.list.req({ page: 0 }).then((res) => {
|
this.$API.wf.workflow.list.req({ page: 0 }).then((res) => {
|
||||||
this.wfOptions = res;
|
res.forEach((item) => {
|
||||||
|
if(item.key && permissions.includes(item.key)) {
|
||||||
|
let cate = item.cate;
|
||||||
|
if (!cate){cate="未分组"}
|
||||||
|
if (!groups[cate]) {
|
||||||
|
groups[cate] = [];
|
||||||
|
}
|
||||||
|
groups[cate].push(item);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// 转换为数组形式,便于模板遍历
|
||||||
|
this.wfOptions = Object.keys(groups).map(category => ({
|
||||||
|
category,
|
||||||
|
items: groups[category]
|
||||||
|
}));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
reStart(row) {
|
reStart(row) {
|
||||||
|
|
@ -256,8 +283,9 @@ export default {
|
||||||
this.tvalue = "我的";
|
this.tvalue = "我的";
|
||||||
this.params.category = "owner";
|
this.params.category = "owner";
|
||||||
this.query = {};
|
this.query = {};
|
||||||
|
this.$refs.table.scrollToTop();
|
||||||
}
|
}
|
||||||
this.$refs.table.refresh()
|
this.handleQuery();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,15 @@
|
||||||
@click="batch_del" v-auth="'workflow.delete'"></el-button> -->
|
@click="batch_del" v-auth="'workflow.delete'"></el-button> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
|
<el-select v-model="query.cate" placeholder="工作流分组" clearable style="width: 220px;"
|
||||||
|
@change="handleQuery">
|
||||||
|
<el-option
|
||||||
|
v-for="item in wfCateOptions"
|
||||||
|
:key="item"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="query.search"
|
v-model="query.search"
|
||||||
placeholder="工作流名称"
|
placeholder="工作流名称"
|
||||||
|
|
@ -38,6 +47,11 @@
|
||||||
prop="name"
|
prop="name"
|
||||||
width="220"
|
width="220"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="分类"
|
||||||
|
prop="cate"
|
||||||
|
width="80"
|
||||||
|
></el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="标识"
|
label="标识"
|
||||||
prop="key"
|
prop="key"
|
||||||
|
|
@ -136,6 +150,9 @@
|
||||||
<el-form-item label="名称" prop="name">
|
<el-form-item label="名称" prop="name">
|
||||||
<el-input v-model="addForm.name" clearable></el-input>
|
<el-input v-model="addForm.name" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="分类" prop="cate">
|
||||||
|
<el-input v-model="addForm.cate" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="标识" prop="key">
|
<el-form-item label="标识" prop="key">
|
||||||
<el-input v-model="addForm.key" clearable></el-input>
|
<el-input v-model="addForm.key" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -214,6 +231,7 @@ export default {
|
||||||
edit: "编辑",
|
edit: "编辑",
|
||||||
show: "查看",
|
show: "查看",
|
||||||
},
|
},
|
||||||
|
wfCateOptions: [],
|
||||||
//表单数据
|
//表单数据
|
||||||
addForm: {
|
addForm: {
|
||||||
name: "",
|
name: "",
|
||||||
|
|
@ -240,6 +258,7 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.getGroup();
|
// this.getGroup();
|
||||||
|
this.getWfCates();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//添加工作流
|
//添加工作流
|
||||||
|
|
@ -248,6 +267,12 @@ export default {
|
||||||
this.limitedVisible = true;
|
this.limitedVisible = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getWfCates() {
|
||||||
|
this.$API.wf.workflow.cates.req().then(res=>{
|
||||||
|
this.wfCateOptions = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
submitHandle() {
|
submitHandle() {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.$refs.addForm.validate((valid) => {
|
this.$refs.addForm.validate((valid) => {
|
||||||
|
|
|
||||||
|
|
@ -7,23 +7,20 @@
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="table_add(10)"
|
@click="table_add(10)"
|
||||||
v-auth="'handover.create'"
|
v-auth="'handover.create'"
|
||||||
>新增</el-button
|
>新增</el-button>
|
||||||
>
|
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="table_add(20)"
|
@click="table_add(20)"
|
||||||
v-auth="'handover.create'"
|
v-auth="'handover.create'"
|
||||||
v-if="mgroup_name!=='切片'&&mgroup_name!=='拉单丝'&&mgroup_name!=='一次复丝'&&mgroup_name!=='二次复丝'&&mgroup_name!=='切丝排版'"
|
v-if="mgroup_name!=='切片'&&mgroup_name!=='拉单丝'&&mgroup_name!=='一次复丝'&&mgroup_name!=='二次复丝'&&mgroup_name!=='切丝排版'"
|
||||||
>返工</el-button
|
>返工</el-button>
|
||||||
>
|
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="table_add(50)"
|
@click="table_add(50)"
|
||||||
v-auth="'handover.create'"
|
v-auth="'handover.create'"
|
||||||
>改版</el-button
|
>改版</el-button>
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<el-select
|
<el-select
|
||||||
|
|
@ -52,6 +49,7 @@
|
||||||
icon="el-icon-search"
|
icon="el-icon-search"
|
||||||
@click="handleQuery"
|
@click="handleQuery"
|
||||||
></el-button>
|
></el-button>
|
||||||
|
<el-button type="warning" @click="expendChange">{{changeText}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
|
|
@ -61,7 +59,7 @@
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="query"
|
:query="query"
|
||||||
default-expand-all
|
:expendShow="expendCode"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="#"
|
label="#"
|
||||||
|
|
@ -289,8 +287,10 @@ export default {
|
||||||
mlogId: "",
|
mlogId: "",
|
||||||
mgroupId: "",
|
mgroupId: "",
|
||||||
processId: "",
|
processId: "",
|
||||||
|
changeText: "展开",
|
||||||
processCate: "",
|
processCate: "",
|
||||||
printer_name: "",
|
printer_name: "",
|
||||||
|
expendCode:false,
|
||||||
printVisible:false,
|
printVisible:false,
|
||||||
backDialogVisible: false,
|
backDialogVisible: false,
|
||||||
mgroup_name:'',
|
mgroup_name:'',
|
||||||
|
|
@ -313,6 +313,14 @@ export default {
|
||||||
this.getMgroupOptions();
|
this.getMgroupOptions();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
expendChange(){
|
||||||
|
this.expendCode = !this.expendCode;
|
||||||
|
if(this.expendCode){
|
||||||
|
this.changeText="收起"
|
||||||
|
}else{
|
||||||
|
this.changeText="展开"
|
||||||
|
}
|
||||||
|
},
|
||||||
//获取工段列表
|
//获取工段列表
|
||||||
getMgroupOptions() {
|
getMgroupOptions() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
:min="0"
|
:min="0"
|
||||||
:step="1"
|
:step="1"
|
||||||
:max="listItem.count_canhandover"
|
:max="Number(listItem.count_canhandover)"
|
||||||
:disabled="mode==='show'||listItem.tracking==20"
|
:disabled="mode==='show'||listItem.tracking==20"
|
||||||
:step-strictly="true"
|
:step-strictly="true"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
|
@ -110,15 +110,23 @@
|
||||||
<el-button type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
|
<el-button type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-card shadow="false" v-if="bwVisible" style="position: relative;">
|
<el-card shadow="never" v-if="bwVisible" style="position: relative;">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div style="width: 10px;height: 35px;"></div>
|
<div style="width: 10px;height: 25px;"></div>
|
||||||
<el-icon style="position: absolute;right: 10px;top: 10px;font-size: 25px;" @click="bwVisibleClose"><el-icon-circle-close /></el-icon>
|
<el-icon style="position: absolute;right: 10px;top: 10px;font-size: 25px;" @click="bwVisibleClose"><el-icon-circle-close /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- 批次物料列表 wprList -->
|
||||||
|
<template v-if="route_code=='shangpaipingmo'">
|
||||||
|
<span v-for="item2 in form.handoverb[bwIndex].handoverbw" :key="item2" style="margin-right: 10px;">
|
||||||
|
<el-checkbox v-model="item2.checked" :label="item2.number" @change="handleChange(bwIndex)"/>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
<div v-for="(item2,index2) in form.handoverb[bwIndex].handoverbw" :key="item2" style="display: flex;justify-content: space-between;padding-bottom: 10px;padding-left: 10px;">
|
<div v-for="(item2,index2) in form.handoverb[bwIndex].handoverbw" :key="item2" style="display: flex;justify-content: space-between;padding-bottom: 10px;padding-left: 10px;">
|
||||||
<span>{{ item2.number }}</span>
|
<span>{{ item2.number }}</span>
|
||||||
<el-button @click="deletebw(index2)" type="primary">删除</el-button>
|
<el-button @click="deletebw(index2)" type="primary">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
|
|
@ -216,7 +224,8 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24" v-if="change_batch">
|
<el-col :md="12" :sm="24" v-if="change_batch">
|
||||||
<el-form-item label="新批次号" prop="new_batch">
|
<el-form-item label="新批次号" prop="new_batch">
|
||||||
<el-input v-model="form.new_batch" placeholder="新批次号" :disabled="type==50"></el-input>
|
<el-input v-model="form.new_batch" placeholder="新批次号" @change="new_batch(form.new_batch)" :disabled="type==50"></el-input>
|
||||||
|
<span style="color: red;">请手动录入新批次号,不要用已有批次!</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -244,6 +253,10 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
|
tag: {
|
||||||
|
type: String,
|
||||||
|
default: "done",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
scanDialog
|
scanDialog
|
||||||
|
|
@ -255,15 +268,15 @@ export default {
|
||||||
loading: false,
|
loading: false,
|
||||||
mode: "add",
|
mode: "add",
|
||||||
titleMap: {
|
titleMap: {
|
||||||
add10: "新增交接记录",
|
add10: "新增",
|
||||||
add20: "新增返工记录",
|
add20: "新增",
|
||||||
add40: "新增废品入库",
|
add40: "新增",
|
||||||
add50: "新增改版记录",
|
add50: "新增",
|
||||||
edit10: "编辑交接记录",
|
edit10: "编辑",
|
||||||
edit20: "编辑返工记录",
|
edit20: "编辑",
|
||||||
edit40: "编辑废品入库",
|
edit40: "编辑",
|
||||||
edit50: "编辑改版记录",
|
edit50: "编辑",
|
||||||
show: "查看交接记录",
|
show: "查看",
|
||||||
},
|
},
|
||||||
lists:[],//交接数组
|
lists:[],//交接数组
|
||||||
handle_user: [],
|
handle_user: [],
|
||||||
|
|
@ -338,6 +351,7 @@ export default {
|
||||||
is_hidde:true,
|
is_hidde:true,
|
||||||
},
|
},
|
||||||
wm_in:"",
|
wm_in:"",
|
||||||
|
route_code: "",
|
||||||
materials:[],
|
materials:[],
|
||||||
totalCount: 0,
|
totalCount: 0,
|
||||||
deptID:'',
|
deptID:'',
|
||||||
|
|
@ -364,6 +378,8 @@ export default {
|
||||||
that.form.mtype=30;
|
that.form.mtype=30;
|
||||||
that.change_batch = true;
|
that.change_batch = true;
|
||||||
}
|
}
|
||||||
|
let arr = that.$route.path.split("/");
|
||||||
|
that.route_code = arr[2];
|
||||||
let materialObj = that.$TOOL.data.get("MATERIAL_OBJECT");
|
let materialObj = that.$TOOL.data.get("MATERIAL_OBJECT");
|
||||||
that.materialObj = materialObj;
|
that.materialObj = materialObj;
|
||||||
that.form.handle_date =that.form.send_date =this.$TOOL.dateFormat2(new Date());
|
that.form.handle_date =that.form.send_date =this.$TOOL.dateFormat2(new Date());
|
||||||
|
|
@ -443,7 +459,7 @@ export default {
|
||||||
let that = this;
|
let that = this;
|
||||||
var req = {
|
var req = {
|
||||||
page: 0,
|
page: 0,
|
||||||
tag:'done',
|
tag:that.tag,
|
||||||
mgroupx:that.mgroupId
|
mgroupx:that.mgroupId
|
||||||
};
|
};
|
||||||
if(that.type!==50){
|
if(that.type!==50){
|
||||||
|
|
@ -462,8 +478,7 @@ export default {
|
||||||
that.materialOptions = [];
|
that.materialOptions = [];
|
||||||
var req = {
|
var req = {
|
||||||
mgroupx: that.mgroupId,
|
mgroupx: that.mgroupId,
|
||||||
page: 0,
|
page: 0
|
||||||
state:20
|
|
||||||
};
|
};
|
||||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||||
that.materialOptions = res.filter(item=>{
|
that.materialOptions = res.filter(item=>{
|
||||||
|
|
@ -637,12 +652,18 @@ export default {
|
||||||
res.forEach(wpritem=>{
|
res.forEach(wpritem=>{
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj.wpr = wpritem.id;
|
obj.wpr = wpritem.id;
|
||||||
|
obj.checked = true;
|
||||||
obj.number = wpritem.number;
|
obj.number = wpritem.number;
|
||||||
handoverbw.push(obj);
|
handoverbw.push(obj);
|
||||||
})
|
})
|
||||||
that.form.handoverb[index].handoverbw = handoverbw;
|
that.form.handoverb[index].handoverbw = handoverbw;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleChange(index){
|
||||||
|
let trueCount = this.form.handoverb[index].handoverbw.filter(item => item.checked === true).length;
|
||||||
|
this.form.handoverb[index].count = trueCount;
|
||||||
|
this.countChange();
|
||||||
|
},
|
||||||
countChange(){
|
countChange(){
|
||||||
let that = this;
|
let that = this;
|
||||||
let totalCount = 0;
|
let totalCount = 0;
|
||||||
|
|
@ -673,6 +694,17 @@ export default {
|
||||||
that.form.recive_mgroup = that.form.send_mgroup;
|
that.form.recive_mgroup = that.form.send_mgroup;
|
||||||
}
|
}
|
||||||
that.form.mtype=that.mtype;
|
that.form.mtype=that.mtype;
|
||||||
|
if(that.route_code=='shangpaipingmo'){
|
||||||
|
that.form.handoverb.forEach(item=>{
|
||||||
|
let handoverbw = [];
|
||||||
|
item.handoverbw.forEach(item1=>{
|
||||||
|
if(item1.checked){
|
||||||
|
handoverbw.push(item1);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
item.handoverbw = handoverbw;
|
||||||
|
})
|
||||||
|
}
|
||||||
//合批、分批、报废,这三个交接操作直接创建并提交
|
//合批、分批、报废,这三个交接操作直接创建并提交
|
||||||
if(that.mtype==20||that.mtype==30||that.type==40){
|
if(that.mtype==20||that.mtype==30||that.type==40){
|
||||||
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
|
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
|
||||||
|
|
@ -752,6 +784,7 @@ export default {
|
||||||
this.imputDisable = false;
|
this.imputDisable = false;
|
||||||
this.$refs.codeInput.focus();
|
this.$refs.codeInput.focus();
|
||||||
},
|
},
|
||||||
|
|
||||||
async getInputText(data){
|
async getInputText(data){
|
||||||
if(data==''){
|
if(data==''){
|
||||||
return;
|
return;
|
||||||
|
|
@ -923,6 +956,14 @@ export default {
|
||||||
this.countChange();
|
this.countChange();
|
||||||
}, 500);
|
}, 500);
|
||||||
},
|
},
|
||||||
|
new_batch(){
|
||||||
|
let that = this;
|
||||||
|
if(that.form.new_batch.indexOf('#')>-1){
|
||||||
|
that.form.new_batch = '';
|
||||||
|
that.$message.error("新批次号不能用以有批次需要手动录入新批次号!");
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -209,8 +209,8 @@ export default {
|
||||||
},
|
},
|
||||||
formWminChange(index,number){
|
formWminChange(index,number){
|
||||||
let that = this;
|
let that = this;
|
||||||
// console.log('number',number.split(" "));
|
|
||||||
let arrs = number.split(" ");
|
let arrs = number.split(" ");
|
||||||
|
let barchArrs = [];
|
||||||
that.form.handoverb[index].wm_in = "";
|
that.form.handoverb[index].wm_in = "";
|
||||||
if(arrs.length>1){
|
if(arrs.length>1){
|
||||||
that.form.handoverb[index].wpr = '';
|
that.form.handoverb[index].wpr = '';
|
||||||
|
|
@ -221,12 +221,17 @@ export default {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj.number = item.number;
|
obj.number = item.number;
|
||||||
obj.wpr = item.id;
|
obj.wpr = item.id;
|
||||||
|
barchArrs.push(arr);
|
||||||
that.form.handoverb[index].handoverbw.push(obj);
|
that.form.handoverb[index].handoverbw.push(obj);
|
||||||
that.form.handoverb[index].count = that.form.handoverb[index].handoverbw.length;
|
that.form.handoverb[index].count = that.form.handoverb[index].handoverbw.length;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
//如果arrs里有不是这个批次的wpr,提示错误
|
||||||
|
let diff = arrs.filter(item => !barchArrs.includes(item));
|
||||||
|
if(diff.length>0){
|
||||||
|
that.$confirm("物料"+diff.join(",")+"不在该批次中", "提示", {type: "warning",}).then(() => {});
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
//放入对应的行中的handoverb中,并且在列表中disabled
|
//放入对应的行中的handoverb中,并且在列表中disabled
|
||||||
that.wprOptions.forEach(item=>{
|
that.wprOptions.forEach(item=>{
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,13 @@
|
||||||
:mgroup_code="mgroup_code"
|
:mgroup_code="mgroup_code"
|
||||||
:mgroupMtype = "mgroupMtype"
|
:mgroupMtype = "mgroupMtype"
|
||||||
></inmOut>
|
></inmOut>
|
||||||
|
<record v-else-if="values == '出入库记录'"
|
||||||
|
:mgroupId="mgroupId"
|
||||||
|
:deptId = "mgroupDept"
|
||||||
|
:mgroupName="mgroupName"
|
||||||
|
:processId="processId"
|
||||||
|
:mgroupcode="mgroup_code"
|
||||||
|
></record>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -89,10 +96,11 @@ import inmIn from "./inmIn.vue";
|
||||||
import inmOut from "./inmOut.vue";
|
import inmOut from "./inmOut.vue";
|
||||||
import mlogs from "./mlogs.vue";
|
import mlogs from "./mlogs.vue";
|
||||||
import mtask from "./mtask.vue";
|
import mtask from "./mtask.vue";
|
||||||
|
import record from "./../wpm_gx/inmrecord.vue";
|
||||||
import handover from "./handover.vue";
|
import handover from "./handover.vue";
|
||||||
export default {
|
export default {
|
||||||
name: "bx",
|
name: "bx",
|
||||||
components: { inmIn, mlogs, mtask, handover,inmOut },
|
components: { inmIn, mlogs, mtask, handover,inmOut,record },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
mgroups:[],
|
mgroups:[],
|
||||||
|
|
@ -118,6 +126,12 @@ export default {
|
||||||
let paths = this.$route.path;
|
let paths = this.$route.path;
|
||||||
let arr = paths.split("/");
|
let arr = paths.split("/");
|
||||||
this.mgroup_code = arr[2];
|
this.mgroup_code = arr[2];
|
||||||
|
if(this.mgroup_code=='chengpingneiwaichujian'||this.mgroup_code=='guangzhuichengpjianc'||
|
||||||
|
this.mgroup_code=='chengpneizhifujian'||this.mgroup_code=='chengpingxinengjiance'||
|
||||||
|
this.mgroup_code=='chenpjianchicunjiance'||this.mgroup_code=='chengpwaiguanfujianyi'||
|
||||||
|
this.mgroup_code=='chengpwaiguanfujianer'){
|
||||||
|
this.options.push('出入库记录');
|
||||||
|
}
|
||||||
console.log('this.mgroup_code',this.mgroup_code);
|
console.log('this.mgroup_code',this.mgroup_code);
|
||||||
that.getMgroups(this.mgroup_code);
|
that.getMgroups(this.mgroup_code);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -243,6 +243,7 @@
|
||||||
v-if="dialog.scrap"
|
v-if="dialog.scrap"
|
||||||
ref="scrapDialog"
|
ref="scrapDialog"
|
||||||
:type="type"
|
:type="type"
|
||||||
|
:tag="tag"
|
||||||
:mgroupName="mgroup_name"
|
:mgroupName="mgroup_name"
|
||||||
:mgroupId="mgroupId"
|
:mgroupId="mgroupId"
|
||||||
@success="handleScrapSuccess"
|
@success="handleScrapSuccess"
|
||||||
|
|
@ -380,6 +381,7 @@ export default {
|
||||||
page:0,
|
page:0,
|
||||||
wm: ""
|
wm: ""
|
||||||
},
|
},
|
||||||
|
tag:"",
|
||||||
wmId:"",
|
wmId:"",
|
||||||
route_code:"",
|
route_code:"",
|
||||||
showBatch: "",
|
showBatch: "",
|
||||||
|
|
@ -501,6 +503,7 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.type = 10;
|
this.type = 10;
|
||||||
|
this.tag = 'todo';
|
||||||
this.dialog.scrap = true;
|
this.dialog.scrap = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.scrapDialog.open("add",handoverb,30);
|
this.$refs.scrapDialog.open("add",handoverb,30);
|
||||||
|
|
|
||||||
|
|
@ -812,6 +812,7 @@ export default {
|
||||||
that.equipmentOptions.forEach(item => {
|
that.equipmentOptions.forEach(item => {
|
||||||
if(item.id == that.form.equipment){
|
if(item.id == that.form.equipment){
|
||||||
that.form.equipment_name = item.name;
|
that.form.equipment_name = item.name;
|
||||||
|
that.setForm.equipment_name = item.name;
|
||||||
that.form.cd_req_addr = that.setForm.cd_req_addr = item.cd_req_addr;
|
that.form.cd_req_addr = that.setForm.cd_req_addr = item.cd_req_addr;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -361,6 +361,7 @@ export default {
|
||||||
typeOptions: [
|
typeOptions: [
|
||||||
{ name: "交送", value: "send" },
|
{ name: "交送", value: "send" },
|
||||||
{ name: "接收", value: "recive" },
|
{ name: "接收", value: "recive" },
|
||||||
|
{ name: "合批", value: "hepi" },
|
||||||
],
|
],
|
||||||
searchType: "",
|
searchType: "",
|
||||||
options: ["交送", "接收"],
|
options: ["交送", "接收"],
|
||||||
|
|
@ -502,6 +503,8 @@ export default {
|
||||||
that.query.recive_mgroup = that.mgroupId;
|
that.query.recive_mgroup = that.mgroupId;
|
||||||
that.query.send_mgroup = "";
|
that.query.send_mgroup = "";
|
||||||
}
|
}
|
||||||
|
}else if (that.searchType == "hepi") {
|
||||||
|
that.query.mtype =30;
|
||||||
} else {
|
} else {
|
||||||
that.query.send_mgroup = "";
|
that.query.send_mgroup = "";
|
||||||
that.query.recive_mgroup = "";
|
that.query.recive_mgroup = "";
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,7 @@
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.material_name }}
|
{{ scope.row.material_name }}
|
||||||
<span v-if="scope.row.material_origin != null"
|
<span v-if="scope.row.material_origin != null">({{ scope.row.material_origin_name }})</span>
|
||||||
>({{ scope.row.material_origin_name }})</span
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -114,16 +112,14 @@
|
||||||
@click="table_Check(scope.row)"
|
@click="table_Check(scope.row)"
|
||||||
v-auth="'ftestwork.create'"
|
v-auth="'ftestwork.create'"
|
||||||
type="primary"
|
type="primary"
|
||||||
v-if="(scope.row.mgroup_name == '黑化'||scope.row.mgroup_name == '退火')&&(scope.row.state == 10||scope.row.state == 20||scope.row.state == 34)"
|
v-if="(scope.row.mgroup_name == '黑化'||scope.row.mgroup_name == '退火'||scope.row.mgroup_name == '外观检验')&&(scope.row.state == 10||scope.row.state == 20||scope.row.state == 34)"
|
||||||
>检验
|
>检验</el-button>
|
||||||
</el-button>
|
|
||||||
<el-button
|
<el-button
|
||||||
link size="small"
|
link size="small"
|
||||||
type="warning"
|
type="warning"
|
||||||
@click="tableCheckList(scope.row)"
|
@click="tableCheckList(scope.row)"
|
||||||
v-if="(scope.row.mgroup_name == '黑化'||scope.row.mgroup_name == '退火')&&(scope.row.state == 10||scope.row.state == 20||scope.row.state == 34)"
|
v-if="(scope.row.mgroup_name == '黑化'||scope.row.mgroup_name == '退火'||scope.row.mgroup_name == '外观检验')&&(scope.row.state == 10||scope.row.state == 20||scope.row.state == 34)"
|
||||||
>检验记录
|
>检验记录</el-button>
|
||||||
</el-button>
|
|
||||||
<el-button @click="printMaterial(scope.row)" type="text">物料标签</el-button>
|
<el-button @click="printMaterial(scope.row)" type="text">物料标签</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
|
||||||
|
|
@ -163,9 +163,7 @@
|
||||||
prop="material"
|
prop="material"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
>
|
>
|
||||||
<template #default="scope"
|
<template #default="scope">{{ scope.row.material_name }}</template>
|
||||||
>{{ scope.row.material_name }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="批次号" prop="batch">
|
<el-table-column label="批次号" prop="batch">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -173,6 +171,14 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="数量" prop="count">
|
<el-table-column label="数量" prop="count">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="90">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
@click="table_del(scope.row)"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</scTable>
|
</scTable>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
|
@ -514,6 +520,18 @@ export default {
|
||||||
this.$refs.saveDialog.open("edit").setData(row);
|
this.$refs.saveDialog.open("edit").setData(row);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
table_del(row){
|
||||||
|
let that = this;
|
||||||
|
this.$confirm(`确定删除吗?`, "提示", {
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
that.$API.inm.mioitem.delete.req(row.id).then((res) => {
|
||||||
|
that.$message.success("删除成功");
|
||||||
|
that.$refs.tables.refresh();
|
||||||
|
return res;
|
||||||
|
});
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
table_submit() {
|
table_submit() {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$API.inm.mio.submit.req(that.mioId).then((res) => {
|
that.$API.inm.mio.submit.req(that.mioId).then((res) => {
|
||||||
|
|
|
||||||
|
|
@ -3,20 +3,17 @@
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" @click="tomio('do_out')" v-auth="'mio.do'"
|
<el-button type="primary" @click="tomio('do_out')" v-auth="'mio.do'"
|
||||||
v-if="mgroupName!=='size'&&mgroupName!=='facade'"
|
v-if="mgroupName!=='size'&&mgroupName!=='facade'&&project_code=='gxerp'"
|
||||||
>领料</el-button>
|
>领料</el-button>
|
||||||
<el-button type="primary" @click="tomio('do_in')" v-auth="'mio.do'">入库</el-button>
|
<el-button type="primary" @click="tomio('do_in')" v-auth="'mio.do'">入库</el-button>
|
||||||
<!-- <el-button
|
|
||||||
type="primary"
|
|
||||||
@click="tomio('borrow_out')"
|
|
||||||
v-auth="'mio.do'"
|
|
||||||
>领用出库</el-button> -->
|
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="tomio('return_in')"
|
@click="tomio('return_in')"
|
||||||
v-auth="'mio.do'"
|
v-auth="'mio.do'"
|
||||||
|
v-if="project_code=='gxerp'"
|
||||||
>退还入库</el-button>
|
>退还入库</el-button>
|
||||||
<el-select
|
<el-select
|
||||||
|
v-if="project_code=='gxerp'"
|
||||||
v-model="query.type"
|
v-model="query.type"
|
||||||
clearable
|
clearable
|
||||||
style="width: 120px; margin-left: 2px"
|
style="width: 120px; margin-left: 2px"
|
||||||
|
|
@ -236,6 +233,7 @@ export default {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.params.mgroup = that.mgroupId;
|
that.params.mgroup = that.mgroupId;
|
||||||
that.apiObj = that.$API.inm.mio.list;
|
that.apiObj = that.$API.inm.mio.list;
|
||||||
|
that.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
tomio(type) {
|
tomio(type) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue