This commit is contained in:
TianyangZhang 2025-11-19 13:49:35 +08:00
commit a0189dbe95
48 changed files with 4065 additions and 213 deletions

View File

@ -167,18 +167,6 @@ export default {
.asyncColorSwitch .el-switch__label--left.is-active{
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.is-group th.el-table__cell.colorheader1{
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{
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 {
padding: 0.7vh 0.7vh 0.2vh;
//background: linear-gradient(to right, #10608e, #1dabfd);
background: linear-gradient(to right, #053949, #107b90);
}
.enpMenu > .el-dropdown-menu__item {
margin-bottom: 0.5vh;
//background: linear-gradient(to right, #29d, #1dabfd);
background: linear-gradient(to right, #1b8fa4, #107b90);
}
.enpMenu > .el-dropdown-menu__item:not(.is-disabled):focus {
//background: linear-gradient(to right, #10608e, #1dabfd);
background: linear-gradient(to right, #053949, #107b90);
color: #ffffff;
}
@ -259,7 +235,6 @@ export default {
height: 92%;
bottom: 0;
top: 8%;
// background-image: url('/public/img/enp_blue/bg_enp_half.png');
}
#enpTable .el-table {
@ -321,25 +296,6 @@ export default {
.bigScreenTable table td {
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 {
color: #ffffff;
}

View File

@ -10,6 +10,13 @@ export default {
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: {
name: "工作流详情",
req: async function(id){

View File

@ -12,7 +12,7 @@
<div class="scTable-table" :style="{ height: _table_height }">
<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"
: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">
<slot></slot>
<template v-for="(item, index) in userColumn" :key="index">
@ -97,6 +97,7 @@ export default {
columnSetting,
},
props: {
expendShow:{ type: Boolean, default: false },
tableName: { type: String, default: "" },
apiObj: { type: Object, default: () => { } },
params: { type: Object, default: () => ({}) },
@ -134,6 +135,9 @@ export default {
this.tableData = this.data;
this.total = this.tableData.length;
},
expendShow(){
this.toggleExpandAll();
},
apiObj() {
this.tableParams = this.params;
this.refresh();
@ -161,6 +165,7 @@ export default {
emptyText: "暂无数据",
toggleIndex: 0,
tableData: [],
expandRowKeys:[],
total: 0,
currentPage: 1,
prop: null,
@ -207,6 +212,10 @@ export default {
this.isActivat = false;
},
methods: {
//
scrollToTop() {
this.$refs.scTable.scrollTo(0, 0);
},
//
async getCustomColumn() {
const userColumn = await config.columnSettingGet(
@ -518,6 +527,19 @@ export default {
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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -60,11 +60,6 @@
<span v-if="scope.row.material_&&scope.row.material_.model">{{ scope.row.material_.model }}</span>
</template>
</el-table-column>
<!--
:filters="unitFilters"
:filter-method="filterUnitDate"
filter-placement="bottom-end"
-->
<el-table-column label="单位">
<template #default="scope">
<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 label="总金额" prop="expiration_date" sortable>
<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>
</el-table-column>
</scTable>

View File

@ -127,6 +127,8 @@
</el-table-column>
<el-table-column label="创建时间" prop="create_time">
</el-table-column>
<el-table-column label="备注" prop="note">
</el-table-column>
<el-table-column
label="操作"
fixed="right"

View File

@ -131,7 +131,6 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="部门执行人"
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-select>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.note" placeholder="编号" />
</el-form-item>
</el-form>
<template #footer>
<el-button type="primary" :loading="isSaveing" @click="submit">

View File

@ -85,7 +85,10 @@
v-model="selectBatch"
value-key="id"
clearable
filterable
remote = "true"
style="width: 100%"
:remote-method="inputChange"
@change="selectBatchChange"
@clear="selectBatchClear"
>
@ -357,6 +360,33 @@ export default {
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() {
var type = this.form.type;
var cate = this.cate;

View File

@ -43,20 +43,27 @@
</el-form-item>
</el-form>
<el-footer>
<el-button type="danger"
v-if="localMode=='edit'"
v-auth="'supplieraudit.delete'"
:loading="saveLoading"
style="margin-right: 4px;"
@click="handleDel"
>删除</el-button>
<ticketd_b
:workflow_key="'wf_supplieraudit'"
:title="ticketTitle"
v-if ="formData.ticket_"
:t_id="formData.id"
:ticket_="formData.ticket_"
@success="$emit('success', localMode)"
:submit_b_func="submit_b_func"
ref="ticketd_b"
></ticketd_b>
<el-button
v-else
type="primary"
style="margin-right: 4px;"
@click="handleSave"
>提交审批</el-button>
</el-footer>
</el-main>
<el-aside width="20%" v-if="formData.ticket_">
@ -90,7 +97,7 @@ export default {
survery_form_: null
},
localMode: this.mode,
ticketTitle: "供应商审核"
saveLoading: false,
}
},
watch: {
@ -124,16 +131,18 @@ export default {
})
})
},
async submit_b_func() {
handleSave() {
if (this.localMode == "add") {
let res = await this.$API.pum.supplieraudit.create.req(this.formData);
this.ticketTitle = this.formData.name + "的供应商审核";
this.formData.id = res.id;
return res.id;
this.saveLoading = true;
this.$API.pum.supplieraudit.create.req(this.formData).then(res=>{
this.saveLoading = true;
this.$message.success("提交成功");
}).catch(e=>{
this.saveLoading = false;
})
this.$emit('success', this.localMode);
} else if (this.localMode == "edit") {
console.log(this.formData);
this.$message.error("不支持编辑");
throw new Error("不支持编辑");
this.$message.error("不支持编辑!")
}
},
}

View File

@ -2,11 +2,6 @@
<el-container>
<el-header>
<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"
placeholder="批次号"
clearable
@ -32,6 +27,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column type="index" width="50" fixed="left"/>

View File

@ -2,11 +2,6 @@
<el-container>
<el-header>
<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"
placeholder="批次号"
clearable
@ -32,6 +27,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column type="index" width="50" fixed="left"/>

View File

@ -2,11 +2,6 @@
<el-container>
<el-header>
<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"
placeholder="批次号"
clearable
@ -32,6 +27,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column type="index" width="50" fixed="left"/>

View File

@ -2,11 +2,6 @@
<el-container>
<el-header>
<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"
placeholder="批次号"
clearable
@ -32,6 +27,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column type="index" width="50" fixed="left"/>

View File

@ -27,6 +27,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column type="index" width="50" fixed="left"/>

View File

@ -2,11 +2,6 @@
<el-container>
<el-header>
<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"
placeholder="批次号"
clearable
@ -32,6 +27,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column type="index" width="50" fixed="left"/>

View File

@ -2,11 +2,6 @@
<el-container>
<el-header>
<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"
placeholder="批次号"
clearable
@ -32,6 +27,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column type="index" width="50" fixed="left"/>

View File

@ -32,6 +32,9 @@
ref="table"
:data="tableData"
id="exportDiv"
row-key="id"
hidePagination
hideDo
stripe
>
<el-table-column type="index" width="50" fixed="left"/>
@ -91,7 +94,7 @@ export default {
return {
query:{
end_date:'',
mgroup_name:'',
mgroup_name:'排板',
start_date:'',
},
mgroups: [],

View File

@ -2,11 +2,6 @@
<el-container>
<el-header>
<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"
placeholder="批次号"
clearable
@ -32,6 +27,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column type="index" width="50" fixed="left"/>

View File

@ -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>

View File

@ -2,11 +2,6 @@
<el-container>
<el-header>
<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"
placeholder="批次号"
clearable
@ -32,6 +27,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column type="index" width="50" fixed="left"/>

View File

@ -5,12 +5,15 @@
ref="table"
:data="tableData"
id="exportDiv"
row-key="id"
hidePagination
hideDo
stripe
>
<el-table-column type="index" width="50" fixed="left"/>
<el-table-column label="产品" prop="物料名" fixed="left" width="120">
</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">
<span v-if="scope.row[item]">{{ scope.row[item] }}</span>
</template>
@ -21,9 +24,8 @@
</template>
<script>
import { genTree } from "@/utils/verificate";
export default {
name: "workerTimes",
name: "inmTotal",
data() {
return {
lists:[],

View File

@ -2,11 +2,6 @@
<el-container>
<el-header>
<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"
placeholder="批次号"
clearable
@ -31,6 +26,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
:summary-method="getSummaries"
show-summary
stripe

View File

@ -26,6 +26,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column label="单号" prop="batch" align="center" fixed="left">

View File

@ -32,6 +32,7 @@
:params="params"
:query="querys"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column type="index" width="50" fixed="left"/>

View File

@ -26,6 +26,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column label="批次编号" fixed="left" prop="batch">

View File

@ -40,6 +40,9 @@
ref="table"
:data="tableData"
id="exportDiv"
row-key="id"
hidePagination
hideDo
stripe
>
<el-table-column type="index" width="50" fixed="left"/>
@ -50,18 +53,12 @@
{{ scope.row[item] }}
</template>
</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>
</el-main>
</el-container>
</template>
<script>
import { genTree } from "@/utils/verificate";
export default {
name: "workerTimes",
data() {

View File

@ -39,6 +39,9 @@
ref="table"
:data="tableData"
id="exportDiv"
row-key="id"
hidePagination
hideDo
stripe
>
<el-table-column label="日期" prop="日期" width="100" fixed="left">

View File

@ -32,6 +32,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column type="index" width="50" fixed="left"/>

View File

@ -32,6 +32,7 @@
:params="params"
:query="params"
id="exportDiv"
row-key="id"
stripe
>
<el-table-column type="index" width="50" fixed="left"/>

View File

@ -97,6 +97,7 @@
:data="tableData"
id="exportDiv"
stripe
class="totalFooterTable"
style="height: 100%;"
:summary-method="getSummaries"
show-summary
@ -151,7 +152,7 @@
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_黑圈缺口 }}</span></template>
</el-table-column>
<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 label="前道崩" class-name="colorheader1">
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_前道崩 }}</span></template>

View File

@ -97,6 +97,7 @@
:data="tableData"
id="exportDiv"
stripe
class="totalFooterTable"
style="height: 100%;"
:summary-method="getSummaries"
show-summary
@ -544,11 +545,8 @@ export default {
}
if(index==54){
let sum = 0;
if(sums[25]){
sum += sums[25];
}
if(sums[53]){
sum += sums[53];
if(sums[54]){
sum += sums[54];
}
sums[index] = sum;
}

View File

@ -98,7 +98,7 @@
:filters="specsFilters11"
:filter-method="filterSpecs11"
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">
<template #default="scope">
<el-input
@ -241,7 +241,7 @@ export default {
mioTypeEnum,
apiObj: this.$API.mtm.material.list,
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: {
material: "",
mio_type: mioTypeEnum.values[0].key,
@ -369,6 +369,7 @@ export default {
if(that.material_name!==''&&that.material_name!==null){
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) => {
that.tableData11 = res;
if(res.length>0){

View File

@ -15,13 +15,19 @@
@change="handleQuery"
clearable
style="margin-left: 2px"
>
<el-option-group
v-for="group in wfOptions"
:key="group.category"
:label="group.category"
>
<el-option
v-for="item in wfOptions"
v-for="item in group.items"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-option-group>
</el-select>
<el-select
v-model="query.script_run_last_result"
@ -136,14 +142,19 @@
</el-drawer>
</el-container>
<el-dialog v-model="dialogVisible" title="选择流程">
<el-card
v-for="item in wfOptions"
:key="item.id"
:body-style="{ padding: '10px', cursor: 'pointer' }"
style="width: 200px; display: inline-block; margin: 4px; background-color: #f5f7fa;"
shadow="hover"
@click="startTicket(item)"
>{{ item.name }}</el-card>
<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
v-for="item in group.items"
:key="item.id"
:body-style="{ padding: '10px', cursor: 'pointer' }"
style="width: 180px; display: inline-block; margin: 4px; background-color: #f5f7fa;"
shadow="hover"
@click="startTicket(item)"
>
{{ item.name }}
</el-card>
</div>
</el-dialog>
</template>
@ -208,8 +219,24 @@ export default {
},
methods: {
getWfOptions() {
let permissions = this.$TOOL.data.get("PERMISSIONS");
const groups = {};
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) {
@ -256,8 +283,9 @@ export default {
this.tvalue = "我的";
this.params.category = "owner";
this.query = {};
this.$refs.table.scrollToTop();
}
this.$refs.table.refresh()
this.handleQuery();
}
},
};

View File

@ -12,6 +12,15 @@
@click="batch_del" v-auth="'workflow.delete'"></el-button> -->
</div>
<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
v-model="query.search"
placeholder="工作流名称"
@ -38,6 +47,11 @@
prop="name"
width="220"
></el-table-column>
<el-table-column
label="分类"
prop="cate"
width="80"
></el-table-column>
<el-table-column
label="标识"
prop="key"
@ -136,6 +150,9 @@
<el-form-item label="名称" prop="name">
<el-input v-model="addForm.name" clearable></el-input>
</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-input v-model="addForm.key" clearable></el-input>
</el-form-item>
@ -214,6 +231,7 @@ export default {
edit: "编辑",
show: "查看",
},
wfCateOptions: [],
//
addForm: {
name: "",
@ -240,6 +258,7 @@ export default {
},
mounted() {
// this.getGroup();
this.getWfCates();
},
methods: {
//
@ -248,6 +267,12 @@ export default {
this.limitedVisible = true;
},
getWfCates() {
this.$API.wf.workflow.cates.req().then(res=>{
this.wfCateOptions = res
})
},
submitHandle() {
let that = this;
this.$refs.addForm.validate((valid) => {

View File

@ -7,23 +7,20 @@
icon="el-icon-plus"
@click="table_add(10)"
v-auth="'handover.create'"
>新增</el-button
>
>新增</el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="table_add(20)"
v-auth="'handover.create'"
v-if="mgroup_name!=='切片'&&mgroup_name!=='拉单丝'&&mgroup_name!=='一次复丝'&&mgroup_name!=='二次复丝'&&mgroup_name!=='切丝排版'"
>返工</el-button
>
>返工</el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="table_add(50)"
v-auth="'handover.create'"
>改版</el-button
>
>改版</el-button>
</div>
<div class="right-panel">
<el-select
@ -52,6 +49,7 @@
icon="el-icon-search"
@click="handleQuery"
></el-button>
<el-button type="warning" @click="expendChange">{{changeText}}</el-button>
</div>
</el-header>
<el-main class="nopadding">
@ -61,7 +59,7 @@
row-key="id"
:params="params"
:query="query"
default-expand-all
:expendShow="expendCode"
>
<el-table-column
label="#"
@ -289,8 +287,10 @@ export default {
mlogId: "",
mgroupId: "",
processId: "",
changeText: "展开",
processCate: "",
printer_name: "",
expendCode:false,
printVisible:false,
backDialogVisible: false,
mgroup_name:'',
@ -313,6 +313,14 @@ export default {
this.getMgroupOptions();
},
methods: {
expendChange(){
this.expendCode = !this.expendCode;
if(this.expendCode){
this.changeText="收起"
}else{
this.changeText="展开"
}
},
//
getMgroupOptions() {
let that = this;

View File

@ -96,7 +96,7 @@
controls-position="right"
:min="0"
:step="1"
:max="listItem.count_canhandover"
:max="Number(listItem.count_canhandover)"
:disabled="mode==='show'||listItem.tracking==20"
:step-strictly="true"
style="width: 100%"
@ -110,15 +110,23 @@
<el-button type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
</el-col>
</el-row>
<el-card shadow="false" v-if="bwVisible" style="position: relative;">
<el-card shadow="never" v-if="bwVisible" style="position: relative;">
<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>
</template>
<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>
<el-button @click="deletebw(index2)" type="primary">删除</el-button>
</div>
<!-- 批次物料列表 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;">
<span>{{ item2.number }}</span>
<el-button @click="deletebw(index2)" type="primary">删除</el-button>
</div>
</template>
</el-card>
<el-row>
<el-col :md="12" :sm="24">
@ -216,7 +224,8 @@
</el-col>
<el-col :md="12" :sm="24" v-if="change_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-col>
</el-row>
@ -244,6 +253,10 @@ export default {
type: String,
default: "",
},
tag: {
type: String,
default: "done",
},
},
components: {
scanDialog
@ -255,15 +268,15 @@ export default {
loading: false,
mode: "add",
titleMap: {
add10: "新增交接记录",
add20: "新增返工记录",
add40: "新增废品入库",
add50: "新增改版记录",
edit10: "编辑交接记录",
edit20: "编辑返工记录",
edit40: "编辑废品入库",
edit50: "编辑改版记录",
show: "查看交接记录",
add10: "新增",
add20: "新增",
add40: "新增",
add50: "新增",
edit10: "编辑",
edit20: "编辑",
edit40: "编辑",
edit50: "编辑",
show: "查看",
},
lists:[],//
handle_user: [],
@ -338,6 +351,7 @@ export default {
is_hidde:true,
},
wm_in:"",
route_code: "",
materials:[],
totalCount: 0,
deptID:'',
@ -364,6 +378,8 @@ export default {
that.form.mtype=30;
that.change_batch = true;
}
let arr = that.$route.path.split("/");
that.route_code = arr[2];
let materialObj = that.$TOOL.data.get("MATERIAL_OBJECT");
that.materialObj = materialObj;
that.form.handle_date =that.form.send_date =this.$TOOL.dateFormat2(new Date());
@ -443,7 +459,7 @@ export default {
let that = this;
var req = {
page: 0,
tag:'done',
tag:that.tag,
mgroupx:that.mgroupId
};
if(that.type!==50){
@ -462,8 +478,7 @@ export default {
that.materialOptions = [];
var req = {
mgroupx: that.mgroupId,
page: 0,
state:20
page: 0
};
this.$API.wpm.wmaterial.list.req(req).then((res) => {
that.materialOptions = res.filter(item=>{
@ -637,12 +652,18 @@ export default {
res.forEach(wpritem=>{
let obj = {};
obj.wpr = wpritem.id;
obj.checked = true;
obj.number = wpritem.number;
handoverbw.push(obj);
})
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(){
let that = this;
let totalCount = 0;
@ -673,6 +694,17 @@ export default {
that.form.recive_mgroup = that.form.send_mgroup;
}
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){
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
@ -752,6 +784,7 @@ export default {
this.imputDisable = false;
this.$refs.codeInput.focus();
},
async getInputText(data){
if(data==''){
return;
@ -923,6 +956,14 @@ export default {
this.countChange();
}, 500);
},
new_batch(){
let that = this;
if(that.form.new_batch.indexOf('#')>-1){
that.form.new_batch = '';
that.$message.error("新批次号不能用以有批次需要手动录入新批次号!");
}
},
},
};
</script>

View File

@ -209,8 +209,8 @@ export default {
},
formWminChange(index,number){
let that = this;
// console.log('number',number.split(" "));
let arrs = number.split(" ");
let barchArrs = [];
that.form.handoverb[index].wm_in = "";
if(arrs.length>1){
that.form.handoverb[index].wpr = '';
@ -221,12 +221,17 @@ export default {
let obj = {};
obj.number = item.number;
obj.wpr = item.id;
barchArrs.push(arr);
that.form.handoverb[index].handoverbw.push(obj);
that.form.handoverb[index].count = that.form.handoverb[index].handoverbw.length;
}
})
})
//arrswpr,
let diff = arrs.filter(item => !barchArrs.includes(item));
if(diff.length>0){
that.$confirm("物料"+diff.join(",")+"不在该批次中", "提示", {type: "warning",}).then(() => {});
}
}else{
//handoverbdisabled
that.wprOptions.forEach(item=>{

View File

@ -81,6 +81,13 @@
:mgroup_code="mgroup_code"
:mgroupMtype = "mgroupMtype"
></inmOut>
<record v-else-if="values == '出入库记录'"
:mgroupId="mgroupId"
:deptId = "mgroupDept"
:mgroupName="mgroupName"
:processId="processId"
:mgroupcode="mgroup_code"
></record>
</el-main>
</el-container>
</template>
@ -89,10 +96,11 @@ import inmIn from "./inmIn.vue";
import inmOut from "./inmOut.vue";
import mlogs from "./mlogs.vue";
import mtask from "./mtask.vue";
import record from "./../wpm_gx/inmrecord.vue";
import handover from "./handover.vue";
export default {
name: "bx",
components: { inmIn, mlogs, mtask, handover,inmOut },
components: { inmIn, mlogs, mtask, handover,inmOut,record },
data() {
return {
mgroups:[],
@ -118,6 +126,12 @@ export default {
let paths = this.$route.path;
let arr = paths.split("/");
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);
that.getMgroups(this.mgroup_code);
},

View File

@ -243,6 +243,7 @@
v-if="dialog.scrap"
ref="scrapDialog"
:type="type"
:tag="tag"
:mgroupName="mgroup_name"
:mgroupId="mgroupId"
@success="handleScrapSuccess"
@ -380,6 +381,7 @@ export default {
page:0,
wm: ""
},
tag:"",
wmId:"",
route_code:"",
showBatch: "",
@ -501,6 +503,7 @@ export default {
})
}
this.type = 10;
this.tag = 'todo';
this.dialog.scrap = true;
this.$nextTick(() => {
this.$refs.scrapDialog.open("add",handoverb,30);

View File

@ -812,6 +812,7 @@ export default {
that.equipmentOptions.forEach(item => {
if(item.id == that.form.equipment){
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;
}
});

View File

@ -361,6 +361,7 @@ export default {
typeOptions: [
{ name: "交送", value: "send" },
{ name: "接收", value: "recive" },
{ name: "合批", value: "hepi" },
],
searchType: "",
options: ["交送", "接收"],
@ -502,6 +503,8 @@ export default {
that.query.recive_mgroup = that.mgroupId;
that.query.send_mgroup = "";
}
}else if (that.searchType == "hepi") {
that.query.mtype =30;
} else {
that.query.send_mgroup = "";
that.query.recive_mgroup = "";

View File

@ -46,11 +46,11 @@
:query="query"
@selection-change="selectionChange"
>
<el-table-column type="selection"></el-table-column>
<el-table-column label="状态" prop="state" width="100" >
<template #default="scope">
<el-tag :type="wmState[scope.row.state]?.type">
{{wmState[scope.row.state]?.text}}
<el-table-column type="selection"></el-table-column>
<el-table-column label="状态" prop="state" width="100" >
<template #default="scope">
<el-tag :type="wmState[scope.row.state]?.type">
{{wmState[scope.row.state]?.text}}
</el-tag>
</template>
</el-table-column>
@ -61,9 +61,7 @@
>
<template #default="scope">
{{ scope.row.material_name }}
<span v-if="scope.row.material_origin != null"
>{{ scope.row.material_origin_name }}</span
>
<span v-if="scope.row.material_origin != null">{{ scope.row.material_origin_name }}</span>
</template>
</el-table-column>
<el-table-column
@ -79,9 +77,9 @@
label="部门/工段"
prop="belong_dept_name"
>
<template #default="scope">
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
</template>
<template #default="scope">
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
</template>
</el-table-column>
<el-table-column
label="数量"
@ -114,16 +112,14 @@
@click="table_Check(scope.row)"
v-auth="'ftestwork.create'"
type="primary"
v-if="(scope.row.mgroup_name == '黑化'||scope.row.mgroup_name == '退火')&&(scope.row.state == 10||scope.row.state == 20||scope.row.state == 34)"
>检验
</el-button>
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
link size="small"
type="warning"
@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)"
>检验记录
</el-button>
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 @click="printMaterial(scope.row)" type="text">物料标签</el-button>
</template>
</el-table-column>

View File

@ -157,22 +157,28 @@
hideDo
stripe
>
<el-table-column type="index" width="50" />
<el-table-column
label="物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope"
>{{ scope.row.material_name }}
</template>
</el-table-column>
<el-table-column label="批次号" prop="batch">
</el-table-column>
<el-table-column label="仓库" prop="warehouse_name">
</el-table-column>
<el-table-column label="数量" prop="count">
</el-table-column>
<el-table-column type="index" width="50" />
<el-table-column
label="物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope">{{ scope.row.material_name }}</template>
</el-table-column>
<el-table-column label="批次号" prop="batch">
</el-table-column>
<el-table-column label="仓库" prop="warehouse_name">
</el-table-column>
<el-table-column label="数量" prop="count">
</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>
</el-main>
</el-container>
@ -514,6 +520,18 @@ export default {
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() {
let that = this;
that.$API.inm.mio.submit.req(that.mioId).then((res) => {

View File

@ -3,20 +3,17 @@
<el-header>
<div class="left-panel">
<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 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
type="primary"
@click="tomio('return_in')"
v-auth="'mio.do'"
v-if="project_code=='gxerp'"
>退还入库</el-button>
<el-select
v-if="project_code=='gxerp'"
v-model="query.type"
clearable
style="width: 120px; margin-left: 2px"
@ -236,6 +233,7 @@ export default {
let that = this;
that.params.mgroup = that.mgroupId;
that.apiObj = that.$API.inm.mio.list;
that.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
},
methods: {
tomio(type) {