Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
bb17d31373
30
src/App.vue
30
src/App.vue
|
|
@ -162,17 +162,39 @@ export default {
|
|||
padding: 0 20px 20px;
|
||||
}
|
||||
|
||||
|
||||
// .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.is-group th.el-table__cell.colorheader1{
|
||||
background-color: rgb(255, 243, 202)!important;
|
||||
background-color: rgba(246, 98, 98, 0.323)!important;
|
||||
}
|
||||
.el-table thead.is-group th.el-table__cell.colorheader2{
|
||||
background-color: rgb(227, 242, 217)!important;
|
||||
background-color: rgba(250, 130, 11, 0.325)!important;
|
||||
}
|
||||
.el-table thead.is-group th.el-table__cell.colorheader3{
|
||||
background-color: rgb(250, 218, 222)!important;
|
||||
background-color: rgba(247, 235, 9, 0.311)!important;
|
||||
}
|
||||
.el-table thead.is-group th.el-table__cell.colorheader4{
|
||||
background-color: rgb(168, 218, 228)!important;
|
||||
background-color: rgba(30, 252, 10, 0.202)!important;
|
||||
}
|
||||
.el-table thead.is-group th.el-table__cell.colorheader5{
|
||||
background-color: rgba(11, 251, 231, 0.326)!important;
|
||||
}
|
||||
.el-table thead.is-group th.el-table__cell.colorheader6{
|
||||
background-color: rgba(12, 85, 255, 0.326)!important;
|
||||
}
|
||||
.el-table thead.is-group th.el-table__cell.colorheader7{
|
||||
background-color: rgba(51, 15, 253, 0.317)!important;
|
||||
}
|
||||
// 排放系统
|
||||
|
||||
|
|
|
|||
|
|
@ -185,6 +185,13 @@ export default {
|
|||
data);
|
||||
}
|
||||
},
|
||||
revertDel:{
|
||||
name: "撤回并删除",
|
||||
req: async function(id){
|
||||
return await http.post(
|
||||
`${config.API_URL}/inm/mioitem/${id}/revert_and_del/`);
|
||||
}
|
||||
}
|
||||
},
|
||||
// mioitemw
|
||||
mioitemw: {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@
|
|||
dragSort: { type: Boolean, default: false },
|
||||
hideAdd: { type: Boolean, default: false },
|
||||
hideDelete: { type: Boolean, default: false },
|
||||
hideIndex: { type: Boolean, default: false }
|
||||
hideIndex: { type: Boolean, default: false },
|
||||
pushType: { type: String, default: 'push' }
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
|
|
@ -98,8 +99,12 @@
|
|||
})
|
||||
},
|
||||
rowAdd(){
|
||||
const temp = JSON.parse(JSON.stringify(this.addTemplate))
|
||||
this.data.push(temp);
|
||||
const temp = JSON.parse(JSON.stringify(this.addTemplate));
|
||||
if(this.pushType == 'unshift'){
|
||||
this.data.unshift(temp);
|
||||
}else{
|
||||
this.data.push(temp);
|
||||
}
|
||||
this.$emit('add', temp)
|
||||
},
|
||||
rowDel(row, index){
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const DEFAULT_CONFIG = {
|
|||
DASHBOARD_URL: "/dashboard",
|
||||
|
||||
//版本号
|
||||
APP_VER: "2.6.2025061213",
|
||||
APP_VER: "2.7.2025070310",
|
||||
|
||||
//内核版本号
|
||||
CORE_VER: "1.6.9",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,697 @@
|
|||
<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="margin-bottom: 1vh;">
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日工序报工量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在产产品数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月完工工单</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月计划产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<div class="leftBlock">
|
||||
<el-row style="margin-bottom: 1vh;">
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在制工序数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日完成工序</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 34vh;position: relative;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间各工段生产产品数</div>
|
||||
<dv-capsule-chart :config="config_left1" class="leftChartBlock1"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">产品占比</div>
|
||||
<dv-active-ring-chart :config="config_left2" class="leftChartBlock2"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="middleBlock">
|
||||
<div style="height: 38vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间工段任务展示</div>
|
||||
<dv-scroll-board :config="config_middle_top" class="middleTableBlock1"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 41vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">设备列表</div>
|
||||
<dv-scroll-board :config="config_middle_bottom" class="middleTableBlock2"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="rightBlock">
|
||||
<el-row style="margin-bottom: 1vh;">
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在制工单数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月交付数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">每个人日产量</div>
|
||||
<scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间整体产品统计</div>
|
||||
<scEcharts :option="chartOption2" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import { runningStateEnum } from "@/utils/enum.js";
|
||||
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||
function deepCopy(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
const myColor = ["#1089E7", "#F57474", "#56D0E3", "#F8B448", "#8B78F6"];
|
||||
export default {
|
||||
components: { scScrollTavle },
|
||||
data() {
|
||||
return {
|
||||
runningStateEnum,
|
||||
basicOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
},
|
||||
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",
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "",
|
||||
type: "bar",
|
||||
barWidth: 30,
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
itemStyle: {
|
||||
borderRadius: [5, 5, 0, 0],
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{offset: 0,color: "#00aaff"},
|
||||
{offset: 1,color: "#0033ff"},
|
||||
]),
|
||||
},
|
||||
data: [1,2,3,4,5,6,7],
|
||||
},
|
||||
],
|
||||
},
|
||||
chartOption1:{
|
||||
color: ['#2f89cf'],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: "0%",
|
||||
top: "10px",
|
||||
right: "0%",
|
||||
bottom: "4%",
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: [], // 类目数据
|
||||
axisTick: {
|
||||
alignWithLabel: true // 刻度线与标签对齐
|
||||
},
|
||||
axisLabel: {
|
||||
color: "rgb(255,255,255)",
|
||||
fontSize: "8",
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
color: "rgba(255,255,255,.6)",
|
||||
fontSize: "12"
|
||||
},
|
||||
},
|
||||
// 系列配置
|
||||
series: {
|
||||
name: 'Direct',
|
||||
type: 'bar',
|
||||
barWidth: '15',
|
||||
data: [],
|
||||
itemStyle: {
|
||||
barBorderRadius: 5
|
||||
}
|
||||
}
|
||||
},
|
||||
chartOption2: {
|
||||
grid: {
|
||||
top: "10%",
|
||||
left: "10%",
|
||||
bottom: "5%",
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
// show: false
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
},
|
||||
// Y 轴配置,包含两个 Y 轴,一个用于显示类目,一个用于显示数值
|
||||
yAxis: [
|
||||
{
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#fff"
|
||||
},
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
type: 'category',
|
||||
inverse: true, // 反转坐标轴
|
||||
data: []
|
||||
},
|
||||
{
|
||||
show: false,
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
color: "#fff"
|
||||
}
|
||||
},
|
||||
inverse: true, // 反转坐标轴
|
||||
data: [],
|
||||
}
|
||||
],
|
||||
// 一个柱状图,一个边框
|
||||
series: [
|
||||
{
|
||||
name: '柱状图',
|
||||
type: 'bar',
|
||||
data: [],
|
||||
yAxisIndex: 0,
|
||||
barCategoryGap: 50,
|
||||
barWidth: 10,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
barBorderRadius: 5,
|
||||
color: function (params) {
|
||||
return myColor[params.dataIndex];
|
||||
}
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
// show: true,
|
||||
position: "outside",
|
||||
color: "#fff",
|
||||
// formatter: "{a}"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "框",
|
||||
type: "bar",
|
||||
barCategoryGap: 50,
|
||||
barWidth: 12,
|
||||
itemStyle: {
|
||||
color: "none",
|
||||
shadowColor: '#999', // 阴影颜色
|
||||
shadowBlur: 3, // 阴影模糊
|
||||
shadowOffsetX: 0, // 阴影水平偏移
|
||||
shadowOffsetY: 0, // 阴影垂直偏移
|
||||
borderColor: "rgba(153,153,153,0.6)", // 边框颜色
|
||||
borderWidth: 0.5,
|
||||
barBorderRadius: 5,
|
||||
|
||||
},
|
||||
yAxisIndex: 1,
|
||||
data: []
|
||||
}
|
||||
]
|
||||
},
|
||||
tableHeight: 100,
|
||||
speed: 2000,
|
||||
time: null,
|
||||
deptId: "",
|
||||
dayInterval: null,
|
||||
chartInterval2: null,
|
||||
state_: {
|
||||
10: '完好',
|
||||
20: '限用',
|
||||
30: '在修',
|
||||
40: '禁用',
|
||||
},
|
||||
configData:{
|
||||
header:['物料名称','批次号','数量'],
|
||||
headerBGC:'#0a3f44',
|
||||
headerHeight:40,
|
||||
align:'center',
|
||||
data:[],
|
||||
waitTime:1000,
|
||||
},
|
||||
configData1:{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['产出名称','规格','型号','开始时间','结束时间','完成进度','产量','状态'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
config_left1:{
|
||||
data:[]
|
||||
} ,
|
||||
config_left2:{
|
||||
data:[]
|
||||
},
|
||||
config_middle_top:{
|
||||
rowNum:10,
|
||||
headerBGC: 'rgba(47,102,107,.34)',
|
||||
oddRowBGC: 'rgba(0,0,0,0)',
|
||||
evenRowBGC: 'rgba(0,0,0,0)',
|
||||
header: ['任务编号', '产出产品', '任务量', '合格数'],
|
||||
data: []
|
||||
},
|
||||
config_middle_bottom:{
|
||||
rowNum:10,
|
||||
headerBGC: 'rgba(0,0,0,0)',
|
||||
oddRowBGC: 'rgba(0,0,0,0)',
|
||||
evenRowBGC: 'rgba(0,0,0,0)',
|
||||
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
||||
data: []
|
||||
},
|
||||
currentTime: "",
|
||||
currentDay: "",
|
||||
today: "",
|
||||
end_time:'',
|
||||
start_time:'',
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.showTime();
|
||||
this.dayInterval = setInterval(() => {
|
||||
this.showTime();
|
||||
}, 1000);
|
||||
let userInfo = this.$TOOL.data.get("USER_INFO");
|
||||
this.deptId = userInfo.belong_dept;
|
||||
this.deptName = userInfo.belong_dept_name;
|
||||
this.getMgroups();
|
||||
this.$nextTick(() => {
|
||||
//车间各个工段生产产品的数量:每个工段的已完成
|
||||
// this.getmgroupMaterial();
|
||||
//车间工段任务展示:各个工段的任务列表
|
||||
this.getMtask1();
|
||||
//设备列表:各个工段的设备列表
|
||||
this.getEquipment();
|
||||
//每个人日生产量:个人绩效
|
||||
this.getCount();
|
||||
//车间整体产品统计:最后一个工序的产品统计
|
||||
//产品占比:最后一个工序的产品占比
|
||||
// this.getMaterials();// this.getmgroupMaterial();
|
||||
})
|
||||
},
|
||||
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.basicOption);
|
||||
}
|
||||
setTimeout(() => {
|
||||
try {
|
||||
myChart.setOption(option);
|
||||
} catch (error) {}
|
||||
}, 500);
|
||||
return myChart;
|
||||
},
|
||||
getMgroups(){
|
||||
let that = this;
|
||||
that.$API.mtm.mgroup.list.req({belong_dept:that.deptId,page:0}).then((res) => {
|
||||
if(res.length > 0){
|
||||
res.forEach((item,inde)=>{
|
||||
that.mgroupsId += item.id + ',';
|
||||
that.getmgroupMaterial(item);
|
||||
//未完成的物料
|
||||
if(inde==res.length-1){
|
||||
that.getLastmgroupMaterial(item);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//任务进度
|
||||
getMtask1() {
|
||||
let that = this;
|
||||
let params = {
|
||||
state: 20,mgroup__belong_dept: that.deptId,page:0,
|
||||
query: " { id, material_out_name, number, count, count_ok }"
|
||||
};
|
||||
that.config_middle_top.data = [];
|
||||
that.$API.pm.mtask.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
res.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.number;
|
||||
arr[1] = item.material_out_name;
|
||||
arr[2] = item.count;
|
||||
arr[3] = item.count_ok;
|
||||
// arr[4] = item.count_ok/item.count*100+'%';
|
||||
that.config_middle_top.data.push(arr);
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//库存统计列表
|
||||
getmgroupMaterial(item) {
|
||||
let that = this;
|
||||
let params = { tag: 'done',page_size:1,mgroup: item.id };
|
||||
that.$API.wpm.wmaterial.list.req(params).then((res) => {
|
||||
let obj = {};
|
||||
obj.name = item.name;
|
||||
obj.value = res.count;
|
||||
that.config_left1.data.push(obj);
|
||||
})
|
||||
},
|
||||
getLastmgroupMaterial(item){
|
||||
let that = this;
|
||||
let params = {
|
||||
tag: 'done',page:0,mgroup: item.id ,
|
||||
// query: " { id, material_name }"
|
||||
};
|
||||
that.$API.wpm.wmaterial.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
let namelist = [],valuelist = [],values=[];
|
||||
res.forEach((item)=>{
|
||||
let index = namelist.indexOf(item.material_.name);
|
||||
if(index==-1){
|
||||
namelist.push(item.material_.name);
|
||||
valuelist.push(1);
|
||||
values.push(1);
|
||||
}else{
|
||||
valuelist[index] += 1;
|
||||
values[index] += 1;
|
||||
}
|
||||
})
|
||||
let maxNum = valuelist.sort((a, b) => b - a)[0]+2;
|
||||
let arr = [];
|
||||
valuelist.forEach((item)=>{
|
||||
arr.push(maxNum)
|
||||
})
|
||||
that.chartOption2.yAxis[0].data = namelist;
|
||||
that.chartOption2.yAxis[1].data = valuelist;
|
||||
that.chartOption2.series[0].data = valuelist;
|
||||
that.chartOption2.series[1].data = arr;
|
||||
namelist.forEach((item,index)=>{
|
||||
let obj = {};
|
||||
obj.name = item;
|
||||
obj.value = valuelist[index];
|
||||
that.config_left2.data.push(obj);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getEquipment() {
|
||||
let that = this;
|
||||
let params = {
|
||||
page: 0, belong_dept:that.deptId,
|
||||
// query: " { id, name, number, model, state ,mgroup_name }"
|
||||
};
|
||||
that.config_middle_bottom.data = [];
|
||||
that.$API.em.equipment.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
res.forEach((item) => {
|
||||
let arr = [];
|
||||
let state_ = that.state_[item.state];
|
||||
let running_state_ = runningStateEnum[item.running_state]?.text;
|
||||
arr[0] = item.name;
|
||||
arr[1] = item.number;
|
||||
arr[2] = state_;
|
||||
arr[3] = running_state_;
|
||||
arr[4] = item.mgroup_name;
|
||||
that.config_middle_bottom.data.push(arr);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getCount(){
|
||||
let that = this;
|
||||
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
|
||||
let params = {
|
||||
query: {start_date:date,end_date:date,dept_name:that.deptName},
|
||||
// query: {start_date:'2025-06-11',end_date:'2025-06-11',dept_name:that.deptName},
|
||||
};
|
||||
let namelist = [],valuelist = [];
|
||||
this.$API.bi.dataset.exec.req("performance", params).then((res) => {
|
||||
if(res.data2.ds0.length>0){
|
||||
res.data2.ds0.forEach((item)=>{
|
||||
namelist.push(item.操作人);
|
||||
valuelist.push(item.合格数);
|
||||
})
|
||||
}
|
||||
that.chartOption1.xAxis.data = namelist;
|
||||
that.chartOption1.series.data = valuelist;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<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/head_bg.png"); */
|
||||
background: url("/public/img/header_bgv.png");
|
||||
border-bottom: none;
|
||||
background-size: 100% 100%;
|
||||
display: block;
|
||||
height: 8vh;
|
||||
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;
|
||||
font-size:4vh;
|
||||
letter-spacing: 10px;
|
||||
}
|
||||
.header > .timer {
|
||||
font-size: 14px;
|
||||
margin-top: 18px;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 20px;
|
||||
}
|
||||
.numBlock{
|
||||
height: 10vh;
|
||||
}
|
||||
.numBlock_title{
|
||||
height: 4vh;
|
||||
width: 100%;
|
||||
font-size: 1.5vh;
|
||||
line-height: 4vh;
|
||||
text-align: center;
|
||||
}
|
||||
.numBlock_value{
|
||||
height:6vh;
|
||||
width: 100%;
|
||||
line-height: 5vh;
|
||||
text-align: center;
|
||||
font-size: 3vh;
|
||||
font-family: "myfont";
|
||||
}
|
||||
.leftChartBlock1{
|
||||
width: 90%;
|
||||
height: 28vh;
|
||||
z-index: 999;
|
||||
left: 5%;
|
||||
border-radius: 3vh;
|
||||
}
|
||||
.leftChartBlock2{
|
||||
width:100%;
|
||||
height: 28vh;
|
||||
}
|
||||
.middleTableBlock1{
|
||||
width:94%;
|
||||
height:31vh;
|
||||
position: absolute;
|
||||
left: 4%
|
||||
}
|
||||
.middleTableBlock2{
|
||||
width:94%;
|
||||
height:34vh;
|
||||
position: absolute;
|
||||
left: 4%
|
||||
}
|
||||
.chartBlockTitle{
|
||||
width: 90%;
|
||||
height: 5vh;
|
||||
margin: auto;
|
||||
line-height: 6vh;
|
||||
border-radius: 10px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
font-size: 1.6vh;
|
||||
font-weight: 600;
|
||||
border-bottom: 1px solid rgb(83 198 243);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,713 @@
|
|||
<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="margin-bottom: 1vh;">
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日工序报工量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在产产品数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月完工工单</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月计划产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<div class="leftBlock">
|
||||
<el-row style="margin-bottom: 1vh;">
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在制工序数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日完成工序</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 34vh;position: relative;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间各工段生产产品数</div>
|
||||
<dv-capsule-chart :config="config_left1" class="leftChartBlock1"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">产品占比</div>
|
||||
<dv-active-ring-chart :config="config_left2" class="leftChartBlock2"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="middleBlock">
|
||||
<div style="height: 38vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间工段任务展示</div>
|
||||
<dv-scroll-board :config="config_middle_top" class="middleTableBlock1"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 41vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">设备列表</div>
|
||||
<dv-scroll-board :config="config_middle_bottom" class="middleTableBlock2"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="rightBlock">
|
||||
<el-row style="margin-bottom: 1vh;">
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在制工单数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月交付数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">每个人日产量</div>
|
||||
<scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间整体产品统计</div>
|
||||
<scEcharts :option="chartOption2" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import { runningStateEnum } from "@/utils/enum.js";
|
||||
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||
function deepCopy(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
const myColor = ["#1089E7", "#F57474", "#56D0E3", "#F8B448", "#8B78F6"];
|
||||
export default {
|
||||
components: { scScrollTavle },
|
||||
data() {
|
||||
return {
|
||||
runningStateEnum,
|
||||
basicOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
},
|
||||
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",
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "",
|
||||
type: "bar",
|
||||
barWidth: 30,
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
itemStyle: {
|
||||
borderRadius: [5, 5, 0, 0],
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{offset: 0,color: "#00aaff"},
|
||||
{offset: 1,color: "#0033ff"},
|
||||
]),
|
||||
},
|
||||
data: [1,2,3,4,5,6,7],
|
||||
},
|
||||
],
|
||||
},
|
||||
chartOption1:{
|
||||
color: ['#2f89cf'],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: "0%",
|
||||
top: "10px",
|
||||
right: "0%",
|
||||
bottom: "4%",
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: [], // 类目数据
|
||||
axisTick: {
|
||||
alignWithLabel: true // 刻度线与标签对齐
|
||||
},
|
||||
axisLabel: {
|
||||
color: "rgb(255,255,255)",
|
||||
fontSize: "8",
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
color: "rgba(255,255,255,.6)",
|
||||
fontSize: "12"
|
||||
},
|
||||
},
|
||||
// 系列配置
|
||||
series: {
|
||||
name: 'Direct',
|
||||
type: 'bar',
|
||||
barWidth: '15',
|
||||
data: [],
|
||||
itemStyle: {
|
||||
barBorderRadius: 5
|
||||
}
|
||||
}
|
||||
},
|
||||
chartOption2: {
|
||||
grid: {
|
||||
top: "10%",
|
||||
left: "10%",
|
||||
bottom: "5%",
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
// show: false
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
},
|
||||
// Y 轴配置,包含两个 Y 轴,一个用于显示类目,一个用于显示数值
|
||||
yAxis: [
|
||||
{
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#fff"
|
||||
},
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
type: 'category',
|
||||
inverse: true, // 反转坐标轴
|
||||
data: []
|
||||
},
|
||||
{
|
||||
show: false,
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
color: "#fff"
|
||||
}
|
||||
},
|
||||
inverse: true, // 反转坐标轴
|
||||
data: [],
|
||||
}
|
||||
],
|
||||
// 一个柱状图,一个边框
|
||||
series: [
|
||||
{
|
||||
name: '柱状图',
|
||||
type: 'bar',
|
||||
data: [],
|
||||
yAxisIndex: 0,
|
||||
barCategoryGap: 50,
|
||||
barWidth: 10,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
barBorderRadius: 5,
|
||||
color: function (params) {
|
||||
return myColor[params.dataIndex];
|
||||
}
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
// show: true,
|
||||
position: "outside",
|
||||
color: "#fff",
|
||||
// formatter: "{a}"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "框",
|
||||
type: "bar",
|
||||
barCategoryGap: 50,
|
||||
barWidth: 12,
|
||||
itemStyle: {
|
||||
color: "none",
|
||||
shadowColor: '#999', // 阴影颜色
|
||||
shadowBlur: 3, // 阴影模糊
|
||||
shadowOffsetX: 0, // 阴影水平偏移
|
||||
shadowOffsetY: 0, // 阴影垂直偏移
|
||||
borderColor: "rgba(153,153,153,0.6)", // 边框颜色
|
||||
borderWidth: 0.5,
|
||||
barBorderRadius: 5,
|
||||
|
||||
},
|
||||
yAxisIndex: 1,
|
||||
data: []
|
||||
}
|
||||
]
|
||||
},
|
||||
tableHeight: 100,
|
||||
speed: 2000,
|
||||
time: null,
|
||||
deptId: "",
|
||||
dayInterval: null,
|
||||
chartInterval2: null,
|
||||
state_: {
|
||||
10: '完好',
|
||||
20: '限用',
|
||||
30: '在修',
|
||||
40: '禁用',
|
||||
},
|
||||
configData:{
|
||||
header:['物料名称','批次号','数量'],
|
||||
headerBGC:'#0a3f44',
|
||||
headerHeight:40,
|
||||
align:'center',
|
||||
data:[],
|
||||
waitTime:1000,
|
||||
},
|
||||
configData1:{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['产出名称','规格','型号','开始时间','结束时间','完成进度','产量','状态'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
config_left1:{
|
||||
data:[]
|
||||
} ,
|
||||
config_left2:{
|
||||
data:[]
|
||||
},
|
||||
config_middle_top:{
|
||||
rowNum:10,
|
||||
headerBGC: 'rgba(47,102,107,.34)',
|
||||
oddRowBGC: 'rgba(0,0,0,0)',
|
||||
evenRowBGC: 'rgba(0,0,0,0)',
|
||||
header: ['任务编号', '产出产品', '任务量', '合格数'],
|
||||
data: []
|
||||
},
|
||||
config_middle_bottom:{
|
||||
rowNum:10,
|
||||
headerBGC: 'rgba(0,0,0,0)',
|
||||
oddRowBGC: 'rgba(0,0,0,0)',
|
||||
evenRowBGC: 'rgba(0,0,0,0)',
|
||||
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
||||
data: []
|
||||
},
|
||||
currentTime: "",
|
||||
currentDay: "",
|
||||
today: "",
|
||||
end_time:'',
|
||||
start_time:'',
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
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);
|
||||
// })
|
||||
// this.xAxisData = xAxisData;
|
||||
// let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24);
|
||||
// let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24);
|
||||
// let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd hh:mm:ss");
|
||||
// let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd hh:mm:ss");
|
||||
// this.start_time = start_time;
|
||||
// this.end_time = end_time;
|
||||
let userInfo = this.$TOOL.data.get("USER_INFO");
|
||||
this.deptId = userInfo.belong_dept;
|
||||
this.deptName = userInfo.belong_dept_name;
|
||||
this.getMgroups();
|
||||
this.$nextTick(() => {
|
||||
//车间各个工段生产产品的数量:每个工段的已完成
|
||||
// this.getmgroupMaterial();
|
||||
//车间工段任务展示:各个工段的任务列表
|
||||
this.getMtask1();
|
||||
//设备列表:各个工段的设备列表
|
||||
this.getEquipment();
|
||||
//每个人日生产量:个人绩效
|
||||
this.getCount();
|
||||
//车间整体产品统计:最后一个工序的产品统计
|
||||
//产品占比:最后一个工序的产品占比
|
||||
// this.getMaterials();// this.getmgroupMaterial();
|
||||
})
|
||||
},
|
||||
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.basicOption);
|
||||
}
|
||||
setTimeout(() => {
|
||||
try {
|
||||
myChart.setOption(option);
|
||||
} catch (error) {}
|
||||
}, 500);
|
||||
return myChart;
|
||||
},
|
||||
getMgroups(){
|
||||
let that = this;
|
||||
that.$API.mtm.mgroup.list.req({belong_dept:that.deptId,page:0}).then((res) => {
|
||||
if(res.length > 0){
|
||||
res.forEach((item,inde)=>{
|
||||
that.mgroupsId += item.id + ',';
|
||||
that.getmgroupMaterial(item);
|
||||
//未完成的物料
|
||||
if(inde==res.length-1){
|
||||
that.getLastmgroupMaterial(item);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//任务进度
|
||||
getMtask1() {
|
||||
let that = this;
|
||||
let params = {
|
||||
state: 20,mgroup__belong_dept: that.deptId,page:0,
|
||||
query: " { id, material_out_name, number, count, count_ok }"
|
||||
};
|
||||
that.config_middle_top.data = [];
|
||||
that.$API.pm.mtask.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
res.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.number;
|
||||
arr[1] = item.material_out_name;
|
||||
arr[2] = item.count;
|
||||
arr[3] = item.count_ok;
|
||||
// arr[4] = item.count_ok/item.count*100+'%';
|
||||
that.config_middle_top.data.push(arr);
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//库存统计列表
|
||||
getmgroupMaterial(item) {
|
||||
let that = this;
|
||||
let params = { tag: 'done',page_size:1,mgroup: item.id };
|
||||
that.$API.wpm.wmaterial.list.req(params).then((res) => {
|
||||
let obj = {};
|
||||
obj.name = item.name;
|
||||
obj.value = res.count;
|
||||
that.config_left1.data.push(obj);
|
||||
})
|
||||
},
|
||||
getLastmgroupMaterial(item){
|
||||
let that = this;
|
||||
let params = {
|
||||
tag: 'done',page:0,mgroup: item.id ,
|
||||
// query: " { id, material_name }"
|
||||
};
|
||||
that.$API.wpm.wmaterial.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
let namelist = [],valuelist = [],values=[];
|
||||
res.forEach((item)=>{
|
||||
let index = namelist.indexOf(item.material_.name);
|
||||
if(index==-1){
|
||||
namelist.push(item.material_.name);
|
||||
valuelist.push(1);
|
||||
values.push(1);
|
||||
}else{
|
||||
valuelist[index] += 1;
|
||||
values[index] += 1;
|
||||
}
|
||||
})
|
||||
let maxNum = valuelist.sort((a, b) => b - a)[0]+2;
|
||||
let arr = [];
|
||||
valuelist.forEach((item)=>{
|
||||
arr.push(maxNum)
|
||||
})
|
||||
that.chartOption2.yAxis[0].data = namelist;
|
||||
that.chartOption2.yAxis[1].data = valuelist;
|
||||
that.chartOption2.series[0].data = valuelist;
|
||||
that.chartOption2.series[1].data = arr;
|
||||
namelist.forEach((item,index)=>{
|
||||
let obj = {};
|
||||
obj.name = item;
|
||||
obj.value = valuelist[index];
|
||||
that.config_left2.data.push(obj);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getEquipment() {
|
||||
let that = this;
|
||||
let params = {
|
||||
page: 0, belong_dept:that.deptId,
|
||||
// query: " { id, name, number, model, state ,mgroup_name }"
|
||||
};
|
||||
that.config_middle_bottom.data = [];
|
||||
that.$API.em.equipment.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
res.forEach((item) => {
|
||||
let arr = [];
|
||||
let state_ = that.state_[item.state];
|
||||
let running_state_ = runningStateEnum[item.running_state]?.text;
|
||||
arr[0] = item.name;
|
||||
arr[1] = item.number;
|
||||
arr[2] = state_;
|
||||
arr[3] = running_state_;
|
||||
arr[4] = item.mgroup_name;
|
||||
that.config_middle_bottom.data.push(arr);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getCount(){
|
||||
let that = this;
|
||||
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
|
||||
let params = {
|
||||
query: {start_date:date,end_date:date,dept_name:that.deptName},
|
||||
// query: {start_date:'2025-06-11',end_date:'2025-06-11',dept_name:that.deptName},
|
||||
};
|
||||
let namelist = [],valuelist = [];
|
||||
this.$API.bi.dataset.exec.req("performance", params).then((res) => {
|
||||
if(res.data2.ds0.length>0){
|
||||
res.data2.ds0.forEach((item)=>{
|
||||
namelist.push(item.操作人);
|
||||
valuelist.push(item.合格数);
|
||||
})
|
||||
}
|
||||
that.chartOption1.xAxis.data = namelist;
|
||||
that.chartOption1.series.data = valuelist;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<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/head_bg.png"); */
|
||||
background: url("/public/img/header_bgv.png");
|
||||
border-bottom: none;
|
||||
background-size: 100% 100%;
|
||||
display: block;
|
||||
height: 8vh;
|
||||
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;
|
||||
font-size:4vh;
|
||||
letter-spacing: 10px;
|
||||
}
|
||||
.header > .timer {
|
||||
font-size: 14px;
|
||||
margin-top: 18px;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 20px;
|
||||
}
|
||||
.numBlock{
|
||||
height: 10vh;
|
||||
}
|
||||
.numBlock_title{
|
||||
height: 4vh;
|
||||
width: 100%;
|
||||
font-size: 1.5vh;
|
||||
line-height: 4vh;
|
||||
text-align: center;
|
||||
}
|
||||
.numBlock_value{
|
||||
height:6vh;
|
||||
width: 100%;
|
||||
line-height: 5vh;
|
||||
text-align: center;
|
||||
font-size: 3vh;
|
||||
font-family: "myfont";
|
||||
}
|
||||
.leftChartBlock1{
|
||||
width: 90%;
|
||||
height: 28vh;
|
||||
z-index: 999;
|
||||
left: 5%;
|
||||
border-radius: 3vh;
|
||||
}
|
||||
.leftChartBlock2{
|
||||
width:100%;
|
||||
height: 28vh;
|
||||
}
|
||||
.middleTableBlock1{
|
||||
width:94%;
|
||||
height:31vh;
|
||||
position: absolute;
|
||||
left: 4%
|
||||
}
|
||||
.middleTableBlock2{
|
||||
width:94%;
|
||||
height:34vh;
|
||||
position: absolute;
|
||||
left: 4%
|
||||
}
|
||||
.chartBlockTitle{
|
||||
width: 90%;
|
||||
height: 5vh;
|
||||
margin: auto;
|
||||
line-height: 6vh;
|
||||
border-radius: 10px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
font-size: 1.6vh;
|
||||
font-weight: 600;
|
||||
border-bottom: 1px solid rgb(83 198 243);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,713 @@
|
|||
<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="margin-bottom: 1vh;">
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日工序报工量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在产产品数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月完工工单</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月计划产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<div class="leftBlock">
|
||||
<el-row style="margin-bottom: 1vh;">
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在制工序数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日完成工序</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 34vh;position: relative;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间各工段生产产品数</div>
|
||||
<dv-capsule-chart :config="config_left1" class="leftChartBlock1"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">产品占比</div>
|
||||
<dv-active-ring-chart :config="config_left2" class="leftChartBlock2"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="middleBlock">
|
||||
<div style="height: 38vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间工段任务展示</div>
|
||||
<dv-scroll-board :config="config_middle_top" class="middleTableBlock1"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 41vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">设备列表</div>
|
||||
<dv-scroll-board :config="config_middle_bottom" class="middleTableBlock2"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="rightBlock">
|
||||
<el-row style="margin-bottom: 1vh;">
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在制工单数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月交付数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">每个人日产量</div>
|
||||
<scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间整体产品统计</div>
|
||||
<scEcharts :option="chartOption2" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import { runningStateEnum } from "@/utils/enum.js";
|
||||
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||
function deepCopy(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
const myColor = ["#1089E7", "#F57474", "#56D0E3", "#F8B448", "#8B78F6"];
|
||||
export default {
|
||||
components: { scScrollTavle },
|
||||
data() {
|
||||
return {
|
||||
runningStateEnum,
|
||||
basicOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
},
|
||||
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",
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "",
|
||||
type: "bar",
|
||||
barWidth: 30,
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
itemStyle: {
|
||||
borderRadius: [5, 5, 0, 0],
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{offset: 0,color: "#00aaff"},
|
||||
{offset: 1,color: "#0033ff"},
|
||||
]),
|
||||
},
|
||||
data: [1,2,3,4,5,6,7],
|
||||
},
|
||||
],
|
||||
},
|
||||
chartOption1:{
|
||||
color: ['#2f89cf'],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: "0%",
|
||||
top: "10px",
|
||||
right: "0%",
|
||||
bottom: "4%",
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: [], // 类目数据
|
||||
axisTick: {
|
||||
alignWithLabel: true // 刻度线与标签对齐
|
||||
},
|
||||
axisLabel: {
|
||||
color: "rgb(255,255,255)",
|
||||
fontSize: "8",
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
color: "rgba(255,255,255,.6)",
|
||||
fontSize: "12"
|
||||
},
|
||||
},
|
||||
// 系列配置
|
||||
series: {
|
||||
name: 'Direct',
|
||||
type: 'bar',
|
||||
barWidth: '15',
|
||||
data: [],
|
||||
itemStyle: {
|
||||
barBorderRadius: 5
|
||||
}
|
||||
}
|
||||
},
|
||||
chartOption2: {
|
||||
grid: {
|
||||
top: "10%",
|
||||
left: "10%",
|
||||
bottom: "5%",
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
// show: false
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
},
|
||||
// Y 轴配置,包含两个 Y 轴,一个用于显示类目,一个用于显示数值
|
||||
yAxis: [
|
||||
{
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#fff"
|
||||
},
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
type: 'category',
|
||||
inverse: true, // 反转坐标轴
|
||||
data: []
|
||||
},
|
||||
{
|
||||
show: false,
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
color: "#fff"
|
||||
}
|
||||
},
|
||||
inverse: true, // 反转坐标轴
|
||||
data: [],
|
||||
}
|
||||
],
|
||||
// 一个柱状图,一个边框
|
||||
series: [
|
||||
{
|
||||
name: '柱状图',
|
||||
type: 'bar',
|
||||
data: [],
|
||||
yAxisIndex: 0,
|
||||
barCategoryGap: 50,
|
||||
barWidth: 10,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
barBorderRadius: 5,
|
||||
color: function (params) {
|
||||
return myColor[params.dataIndex];
|
||||
}
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
// show: true,
|
||||
position: "outside",
|
||||
color: "#fff",
|
||||
// formatter: "{a}"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "框",
|
||||
type: "bar",
|
||||
barCategoryGap: 50,
|
||||
barWidth: 12,
|
||||
itemStyle: {
|
||||
color: "none",
|
||||
shadowColor: '#999', // 阴影颜色
|
||||
shadowBlur: 3, // 阴影模糊
|
||||
shadowOffsetX: 0, // 阴影水平偏移
|
||||
shadowOffsetY: 0, // 阴影垂直偏移
|
||||
borderColor: "rgba(153,153,153,0.6)", // 边框颜色
|
||||
borderWidth: 0.5,
|
||||
barBorderRadius: 5,
|
||||
|
||||
},
|
||||
yAxisIndex: 1,
|
||||
data: []
|
||||
}
|
||||
]
|
||||
},
|
||||
tableHeight: 100,
|
||||
speed: 2000,
|
||||
time: null,
|
||||
deptId: "",
|
||||
dayInterval: null,
|
||||
chartInterval2: null,
|
||||
state_: {
|
||||
10: '完好',
|
||||
20: '限用',
|
||||
30: '在修',
|
||||
40: '禁用',
|
||||
},
|
||||
configData:{
|
||||
header:['物料名称','批次号','数量'],
|
||||
headerBGC:'#0a3f44',
|
||||
headerHeight:40,
|
||||
align:'center',
|
||||
data:[],
|
||||
waitTime:1000,
|
||||
},
|
||||
configData1:{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['产出名称','规格','型号','开始时间','结束时间','完成进度','产量','状态'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
config_left1:{
|
||||
data:[]
|
||||
} ,
|
||||
config_left2:{
|
||||
data:[]
|
||||
},
|
||||
config_middle_top:{
|
||||
rowNum:10,
|
||||
headerBGC: 'rgba(47,102,107,.34)',
|
||||
oddRowBGC: 'rgba(0,0,0,0)',
|
||||
evenRowBGC: 'rgba(0,0,0,0)',
|
||||
header: ['任务编号', '产出产品', '任务量', '合格数'],
|
||||
data: []
|
||||
},
|
||||
config_middle_bottom:{
|
||||
rowNum:10,
|
||||
headerBGC: 'rgba(0,0,0,0)',
|
||||
oddRowBGC: 'rgba(0,0,0,0)',
|
||||
evenRowBGC: 'rgba(0,0,0,0)',
|
||||
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
||||
data: []
|
||||
},
|
||||
currentTime: "",
|
||||
currentDay: "",
|
||||
today: "",
|
||||
end_time:'',
|
||||
start_time:'',
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
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);
|
||||
// })
|
||||
// this.xAxisData = xAxisData;
|
||||
// let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24);
|
||||
// let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24);
|
||||
// let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd hh:mm:ss");
|
||||
// let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd hh:mm:ss");
|
||||
// this.start_time = start_time;
|
||||
// this.end_time = end_time;
|
||||
let userInfo = this.$TOOL.data.get("USER_INFO");
|
||||
this.deptId = userInfo.belong_dept;
|
||||
this.deptName = userInfo.belong_dept_name;
|
||||
this.getMgroups();
|
||||
this.$nextTick(() => {
|
||||
//车间各个工段生产产品的数量:每个工段的已完成
|
||||
// this.getmgroupMaterial();
|
||||
//车间工段任务展示:各个工段的任务列表
|
||||
this.getMtask1();
|
||||
//设备列表:各个工段的设备列表
|
||||
this.getEquipment();
|
||||
//每个人日生产量:个人绩效
|
||||
this.getCount();
|
||||
//车间整体产品统计:最后一个工序的产品统计
|
||||
//产品占比:最后一个工序的产品占比
|
||||
// this.getMaterials();// this.getmgroupMaterial();
|
||||
})
|
||||
},
|
||||
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.basicOption);
|
||||
}
|
||||
setTimeout(() => {
|
||||
try {
|
||||
myChart.setOption(option);
|
||||
} catch (error) {}
|
||||
}, 500);
|
||||
return myChart;
|
||||
},
|
||||
getMgroups(){
|
||||
let that = this;
|
||||
that.$API.mtm.mgroup.list.req({belong_dept:that.deptId,page:0}).then((res) => {
|
||||
if(res.length > 0){
|
||||
res.forEach((item,inde)=>{
|
||||
that.mgroupsId += item.id + ',';
|
||||
that.getmgroupMaterial(item);
|
||||
//未完成的物料
|
||||
if(inde==res.length-1){
|
||||
that.getLastmgroupMaterial(item);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//任务进度
|
||||
getMtask1() {
|
||||
let that = this;
|
||||
let params = {
|
||||
state: 20,mgroup__belong_dept: that.deptId,page:0,
|
||||
query: " { id, material_out_name, number, count, count_ok }"
|
||||
};
|
||||
that.config_middle_top.data = [];
|
||||
that.$API.pm.mtask.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
res.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.number;
|
||||
arr[1] = item.material_out_name;
|
||||
arr[2] = item.count;
|
||||
arr[3] = item.count_ok;
|
||||
// arr[4] = item.count_ok/item.count*100+'%';
|
||||
that.config_middle_top.data.push(arr);
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//库存统计列表
|
||||
getmgroupMaterial(item) {
|
||||
let that = this;
|
||||
let params = { tag: 'done',page_size:1,mgroup: item.id };
|
||||
that.$API.wpm.wmaterial.list.req(params).then((res) => {
|
||||
let obj = {};
|
||||
obj.name = item.name;
|
||||
obj.value = res.count;
|
||||
that.config_left1.data.push(obj);
|
||||
})
|
||||
},
|
||||
getLastmgroupMaterial(item){
|
||||
let that = this;
|
||||
let params = {
|
||||
tag: 'done',page:0,mgroup: item.id ,
|
||||
// query: " { id, material_name }"
|
||||
};
|
||||
that.$API.wpm.wmaterial.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
let namelist = [],valuelist = [],values=[];
|
||||
res.forEach((item)=>{
|
||||
let index = namelist.indexOf(item.material_.name);
|
||||
if(index==-1){
|
||||
namelist.push(item.material_.name);
|
||||
valuelist.push(1);
|
||||
values.push(1);
|
||||
}else{
|
||||
valuelist[index] += 1;
|
||||
values[index] += 1;
|
||||
}
|
||||
})
|
||||
let maxNum = valuelist.sort((a, b) => b - a)[0]+2;
|
||||
let arr = [];
|
||||
valuelist.forEach((item)=>{
|
||||
arr.push(maxNum)
|
||||
})
|
||||
that.chartOption2.yAxis[0].data = namelist;
|
||||
that.chartOption2.yAxis[1].data = valuelist;
|
||||
that.chartOption2.series[0].data = valuelist;
|
||||
that.chartOption2.series[1].data = arr;
|
||||
namelist.forEach((item,index)=>{
|
||||
let obj = {};
|
||||
obj.name = item;
|
||||
obj.value = valuelist[index];
|
||||
that.config_left2.data.push(obj);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getEquipment() {
|
||||
let that = this;
|
||||
let params = {
|
||||
page: 0, belong_dept:that.deptId,
|
||||
// query: " { id, name, number, model, state ,mgroup_name }"
|
||||
};
|
||||
that.config_middle_bottom.data = [];
|
||||
that.$API.em.equipment.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
res.forEach((item) => {
|
||||
let arr = [];
|
||||
let state_ = that.state_[item.state];
|
||||
let running_state_ = runningStateEnum[item.running_state]?.text;
|
||||
arr[0] = item.name;
|
||||
arr[1] = item.number;
|
||||
arr[2] = state_;
|
||||
arr[3] = running_state_;
|
||||
arr[4] = item.mgroup_name;
|
||||
that.config_middle_bottom.data.push(arr);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getCount(){
|
||||
let that = this;
|
||||
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
|
||||
let params = {
|
||||
query: {start_date:date,end_date:date,dept_name:that.deptName},
|
||||
// query: {start_date:'2025-06-11',end_date:'2025-06-11',dept_name:that.deptName},
|
||||
};
|
||||
let namelist = [],valuelist = [];
|
||||
this.$API.bi.dataset.exec.req("performance", params).then((res) => {
|
||||
if(res.data2.ds0.length>0){
|
||||
res.data2.ds0.forEach((item)=>{
|
||||
namelist.push(item.操作人);
|
||||
valuelist.push(item.合格数);
|
||||
})
|
||||
}
|
||||
that.chartOption1.xAxis.data = namelist;
|
||||
that.chartOption1.series.data = valuelist;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<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/head_bg.png"); */
|
||||
background: url("/public/img/header_bgv.png");
|
||||
border-bottom: none;
|
||||
background-size: 100% 100%;
|
||||
display: block;
|
||||
height: 8vh;
|
||||
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;
|
||||
font-size:4vh;
|
||||
letter-spacing: 10px;
|
||||
}
|
||||
.header > .timer {
|
||||
font-size: 14px;
|
||||
margin-top: 18px;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 20px;
|
||||
}
|
||||
.numBlock{
|
||||
height: 10vh;
|
||||
}
|
||||
.numBlock_title{
|
||||
height: 4vh;
|
||||
width: 100%;
|
||||
font-size: 1.5vh;
|
||||
line-height: 4vh;
|
||||
text-align: center;
|
||||
}
|
||||
.numBlock_value{
|
||||
height:6vh;
|
||||
width: 100%;
|
||||
line-height: 5vh;
|
||||
text-align: center;
|
||||
font-size: 3vh;
|
||||
font-family: "myfont";
|
||||
}
|
||||
.leftChartBlock1{
|
||||
width: 90%;
|
||||
height: 28vh;
|
||||
z-index: 999;
|
||||
left: 5%;
|
||||
border-radius: 3vh;
|
||||
}
|
||||
.leftChartBlock2{
|
||||
width:100%;
|
||||
height: 28vh;
|
||||
}
|
||||
.middleTableBlock1{
|
||||
width:94%;
|
||||
height:31vh;
|
||||
position: absolute;
|
||||
left: 4%
|
||||
}
|
||||
.middleTableBlock2{
|
||||
width:94%;
|
||||
height:34vh;
|
||||
position: absolute;
|
||||
left: 4%
|
||||
}
|
||||
.chartBlockTitle{
|
||||
width: 90%;
|
||||
height: 5vh;
|
||||
margin: auto;
|
||||
line-height: 6vh;
|
||||
border-radius: 10px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
font-size: 1.6vh;
|
||||
font-weight: 600;
|
||||
border-bottom: 1px solid rgb(83 198 243);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,713 @@
|
|||
<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="margin-bottom: 1vh;">
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日工序报工量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在产产品数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月完工工单</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月计划产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<div class="leftBlock">
|
||||
<el-row style="margin-bottom: 1vh;">
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在制工序数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日完成工序</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 34vh;position: relative;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间各工段生产产品数</div>
|
||||
<dv-capsule-chart :config="config_left1" class="leftChartBlock1"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">产品占比</div>
|
||||
<dv-active-ring-chart :config="config_left2" class="leftChartBlock2"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="middleBlock">
|
||||
<div style="height: 38vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间工段任务展示</div>
|
||||
<dv-scroll-board :config="config_middle_top" class="middleTableBlock1"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 41vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">设备列表</div>
|
||||
<dv-scroll-board :config="config_middle_bottom" class="middleTableBlock2"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="rightBlock">
|
||||
<el-row style="margin-bottom: 1vh;">
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在制工单数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月交付数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">每个人日产量</div>
|
||||
<scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间整体产品统计</div>
|
||||
<scEcharts :option="chartOption2" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import { runningStateEnum } from "@/utils/enum.js";
|
||||
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||
function deepCopy(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
const myColor = ["#1089E7", "#F57474", "#56D0E3", "#F8B448", "#8B78F6"];
|
||||
export default {
|
||||
components: { scScrollTavle },
|
||||
data() {
|
||||
return {
|
||||
runningStateEnum,
|
||||
basicOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
},
|
||||
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",
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "",
|
||||
type: "bar",
|
||||
barWidth: 30,
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
itemStyle: {
|
||||
borderRadius: [5, 5, 0, 0],
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{offset: 0,color: "#00aaff"},
|
||||
{offset: 1,color: "#0033ff"},
|
||||
]),
|
||||
},
|
||||
data: [1,2,3,4,5,6,7],
|
||||
},
|
||||
],
|
||||
},
|
||||
chartOption1:{
|
||||
color: ['#2f89cf'],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: "0%",
|
||||
top: "10px",
|
||||
right: "0%",
|
||||
bottom: "4%",
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: [], // 类目数据
|
||||
axisTick: {
|
||||
alignWithLabel: true // 刻度线与标签对齐
|
||||
},
|
||||
axisLabel: {
|
||||
color: "rgb(255,255,255)",
|
||||
fontSize: "8",
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
color: "rgba(255,255,255,.6)",
|
||||
fontSize: "12"
|
||||
},
|
||||
},
|
||||
// 系列配置
|
||||
series: {
|
||||
name: 'Direct',
|
||||
type: 'bar',
|
||||
barWidth: '15',
|
||||
data: [],
|
||||
itemStyle: {
|
||||
barBorderRadius: 5
|
||||
}
|
||||
}
|
||||
},
|
||||
chartOption2: {
|
||||
grid: {
|
||||
top: "10%",
|
||||
left: "10%",
|
||||
bottom: "5%",
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
// show: false
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
},
|
||||
// Y 轴配置,包含两个 Y 轴,一个用于显示类目,一个用于显示数值
|
||||
yAxis: [
|
||||
{
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#fff"
|
||||
},
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
type: 'category',
|
||||
inverse: true, // 反转坐标轴
|
||||
data: []
|
||||
},
|
||||
{
|
||||
show: false,
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
color: "#fff"
|
||||
}
|
||||
},
|
||||
inverse: true, // 反转坐标轴
|
||||
data: [],
|
||||
}
|
||||
],
|
||||
// 一个柱状图,一个边框
|
||||
series: [
|
||||
{
|
||||
name: '柱状图',
|
||||
type: 'bar',
|
||||
data: [],
|
||||
yAxisIndex: 0,
|
||||
barCategoryGap: 50,
|
||||
barWidth: 10,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
barBorderRadius: 5,
|
||||
color: function (params) {
|
||||
return myColor[params.dataIndex];
|
||||
}
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
// show: true,
|
||||
position: "outside",
|
||||
color: "#fff",
|
||||
// formatter: "{a}"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "框",
|
||||
type: "bar",
|
||||
barCategoryGap: 50,
|
||||
barWidth: 12,
|
||||
itemStyle: {
|
||||
color: "none",
|
||||
shadowColor: '#999', // 阴影颜色
|
||||
shadowBlur: 3, // 阴影模糊
|
||||
shadowOffsetX: 0, // 阴影水平偏移
|
||||
shadowOffsetY: 0, // 阴影垂直偏移
|
||||
borderColor: "rgba(153,153,153,0.6)", // 边框颜色
|
||||
borderWidth: 0.5,
|
||||
barBorderRadius: 5,
|
||||
|
||||
},
|
||||
yAxisIndex: 1,
|
||||
data: []
|
||||
}
|
||||
]
|
||||
},
|
||||
tableHeight: 100,
|
||||
speed: 2000,
|
||||
time: null,
|
||||
deptId: "",
|
||||
dayInterval: null,
|
||||
chartInterval2: null,
|
||||
state_: {
|
||||
10: '完好',
|
||||
20: '限用',
|
||||
30: '在修',
|
||||
40: '禁用',
|
||||
},
|
||||
configData:{
|
||||
header:['物料名称','批次号','数量'],
|
||||
headerBGC:'#0a3f44',
|
||||
headerHeight:40,
|
||||
align:'center',
|
||||
data:[],
|
||||
waitTime:1000,
|
||||
},
|
||||
configData1:{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['产出名称','规格','型号','开始时间','结束时间','完成进度','产量','状态'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
config_left1:{
|
||||
data:[]
|
||||
} ,
|
||||
config_left2:{
|
||||
data:[]
|
||||
},
|
||||
config_middle_top:{
|
||||
rowNum:10,
|
||||
headerBGC: 'rgba(47,102,107,.34)',
|
||||
oddRowBGC: 'rgba(0,0,0,0)',
|
||||
evenRowBGC: 'rgba(0,0,0,0)',
|
||||
header: ['任务编号', '产出产品', '任务量', '合格数'],
|
||||
data: []
|
||||
},
|
||||
config_middle_bottom:{
|
||||
rowNum:10,
|
||||
headerBGC: 'rgba(0,0,0,0)',
|
||||
oddRowBGC: 'rgba(0,0,0,0)',
|
||||
evenRowBGC: 'rgba(0,0,0,0)',
|
||||
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
||||
data: []
|
||||
},
|
||||
currentTime: "",
|
||||
currentDay: "",
|
||||
today: "",
|
||||
end_time:'',
|
||||
start_time:'',
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
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);
|
||||
// })
|
||||
// this.xAxisData = xAxisData;
|
||||
// let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24);
|
||||
// let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24);
|
||||
// let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd hh:mm:ss");
|
||||
// let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd hh:mm:ss");
|
||||
// this.start_time = start_time;
|
||||
// this.end_time = end_time;
|
||||
let userInfo = this.$TOOL.data.get("USER_INFO");
|
||||
this.deptId = userInfo.belong_dept;
|
||||
this.deptName = userInfo.belong_dept_name;
|
||||
this.getMgroups();
|
||||
this.$nextTick(() => {
|
||||
//车间各个工段生产产品的数量:每个工段的已完成
|
||||
// this.getmgroupMaterial();
|
||||
//车间工段任务展示:各个工段的任务列表
|
||||
this.getMtask1();
|
||||
//设备列表:各个工段的设备列表
|
||||
this.getEquipment();
|
||||
//每个人日生产量:个人绩效
|
||||
this.getCount();
|
||||
//车间整体产品统计:最后一个工序的产品统计
|
||||
//产品占比:最后一个工序的产品占比
|
||||
// this.getMaterials();// this.getmgroupMaterial();
|
||||
})
|
||||
},
|
||||
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.basicOption);
|
||||
}
|
||||
setTimeout(() => {
|
||||
try {
|
||||
myChart.setOption(option);
|
||||
} catch (error) {}
|
||||
}, 500);
|
||||
return myChart;
|
||||
},
|
||||
getMgroups(){
|
||||
let that = this;
|
||||
that.$API.mtm.mgroup.list.req({belong_dept:that.deptId,page:0}).then((res) => {
|
||||
if(res.length > 0){
|
||||
res.forEach((item,inde)=>{
|
||||
that.mgroupsId += item.id + ',';
|
||||
that.getmgroupMaterial(item);
|
||||
//未完成的物料
|
||||
if(inde==res.length-1){
|
||||
that.getLastmgroupMaterial(item);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//任务进度
|
||||
getMtask1() {
|
||||
let that = this;
|
||||
let params = {
|
||||
state: 20,mgroup__belong_dept: that.deptId,page:0,
|
||||
query: " { id, material_out_name, number, count, count_ok }"
|
||||
};
|
||||
that.config_middle_top.data = [];
|
||||
that.$API.pm.mtask.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
res.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.number;
|
||||
arr[1] = item.material_out_name;
|
||||
arr[2] = item.count;
|
||||
arr[3] = item.count_ok;
|
||||
// arr[4] = item.count_ok/item.count*100+'%';
|
||||
that.config_middle_top.data.push(arr);
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//库存统计列表
|
||||
getmgroupMaterial(item) {
|
||||
let that = this;
|
||||
let params = { tag: 'done',page_size:1,mgroup: item.id };
|
||||
that.$API.wpm.wmaterial.list.req(params).then((res) => {
|
||||
let obj = {};
|
||||
obj.name = item.name;
|
||||
obj.value = res.count;
|
||||
that.config_left1.data.push(obj);
|
||||
})
|
||||
},
|
||||
getLastmgroupMaterial(item){
|
||||
let that = this;
|
||||
let params = {
|
||||
tag: 'done',page:0,mgroup: item.id ,
|
||||
// query: " { id, material_name }"
|
||||
};
|
||||
that.$API.wpm.wmaterial.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
let namelist = [],valuelist = [],values=[];
|
||||
res.forEach((item)=>{
|
||||
let index = namelist.indexOf(item.material_.name);
|
||||
if(index==-1){
|
||||
namelist.push(item.material_.name);
|
||||
valuelist.push(1);
|
||||
values.push(1);
|
||||
}else{
|
||||
valuelist[index] += 1;
|
||||
values[index] += 1;
|
||||
}
|
||||
})
|
||||
let maxNum = valuelist.sort((a, b) => b - a)[0]+2;
|
||||
let arr = [];
|
||||
valuelist.forEach((item)=>{
|
||||
arr.push(maxNum)
|
||||
})
|
||||
that.chartOption2.yAxis[0].data = namelist;
|
||||
that.chartOption2.yAxis[1].data = valuelist;
|
||||
that.chartOption2.series[0].data = valuelist;
|
||||
that.chartOption2.series[1].data = arr;
|
||||
namelist.forEach((item,index)=>{
|
||||
let obj = {};
|
||||
obj.name = item;
|
||||
obj.value = valuelist[index];
|
||||
that.config_left2.data.push(obj);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getEquipment() {
|
||||
let that = this;
|
||||
let params = {
|
||||
page: 0, belong_dept:that.deptId,
|
||||
// query: " { id, name, number, model, state ,mgroup_name }"
|
||||
};
|
||||
that.config_middle_bottom.data = [];
|
||||
that.$API.em.equipment.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
res.forEach((item) => {
|
||||
let arr = [];
|
||||
let state_ = that.state_[item.state];
|
||||
let running_state_ = runningStateEnum[item.running_state]?.text;
|
||||
arr[0] = item.name;
|
||||
arr[1] = item.number;
|
||||
arr[2] = state_;
|
||||
arr[3] = running_state_;
|
||||
arr[4] = item.mgroup_name;
|
||||
that.config_middle_bottom.data.push(arr);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getCount(){
|
||||
let that = this;
|
||||
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
|
||||
let params = {
|
||||
query: {start_date:date,end_date:date,dept_name:that.deptName},
|
||||
// query: {start_date:'2025-06-11',end_date:'2025-06-11',dept_name:that.deptName},
|
||||
};
|
||||
let namelist = [],valuelist = [];
|
||||
this.$API.bi.dataset.exec.req("performance", params).then((res) => {
|
||||
if(res.data2.ds0.length>0){
|
||||
res.data2.ds0.forEach((item)=>{
|
||||
namelist.push(item.操作人);
|
||||
valuelist.push(item.合格数);
|
||||
})
|
||||
}
|
||||
that.chartOption1.xAxis.data = namelist;
|
||||
that.chartOption1.series.data = valuelist;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<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/head_bg.png"); */
|
||||
background: url("/public/img/header_bgv.png");
|
||||
border-bottom: none;
|
||||
background-size: 100% 100%;
|
||||
display: block;
|
||||
height: 8vh;
|
||||
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;
|
||||
font-size:4vh;
|
||||
letter-spacing: 10px;
|
||||
}
|
||||
.header > .timer {
|
||||
font-size: 14px;
|
||||
margin-top: 18px;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 20px;
|
||||
}
|
||||
.numBlock{
|
||||
height: 10vh;
|
||||
}
|
||||
.numBlock_title{
|
||||
height: 4vh;
|
||||
width: 100%;
|
||||
font-size: 1.5vh;
|
||||
line-height: 4vh;
|
||||
text-align: center;
|
||||
}
|
||||
.numBlock_value{
|
||||
height:6vh;
|
||||
width: 100%;
|
||||
line-height: 5vh;
|
||||
text-align: center;
|
||||
font-size: 3vh;
|
||||
font-family: "myfont";
|
||||
}
|
||||
.leftChartBlock1{
|
||||
width: 90%;
|
||||
height: 28vh;
|
||||
z-index: 999;
|
||||
left: 5%;
|
||||
border-radius: 3vh;
|
||||
}
|
||||
.leftChartBlock2{
|
||||
width:100%;
|
||||
height: 28vh;
|
||||
}
|
||||
.middleTableBlock1{
|
||||
width:94%;
|
||||
height:31vh;
|
||||
position: absolute;
|
||||
left: 4%
|
||||
}
|
||||
.middleTableBlock2{
|
||||
width:94%;
|
||||
height:34vh;
|
||||
position: absolute;
|
||||
left: 4%
|
||||
}
|
||||
.chartBlockTitle{
|
||||
width: 90%;
|
||||
height: 5vh;
|
||||
margin: auto;
|
||||
line-height: 6vh;
|
||||
border-radius: 10px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
font-size: 1.6vh;
|
||||
font-weight: 600;
|
||||
border-bottom: 1px solid rgb(83 198 243);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,713 @@
|
|||
<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="margin-bottom: 1vh;">
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日工序报工量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在产产品数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月完工工单</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月计划产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="3" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月产量</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<div class="leftBlock">
|
||||
<el-row style="margin-bottom: 1vh;">
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在制工序数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">今日完成工序</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 34vh;position: relative;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间各工段生产产品数</div>
|
||||
<dv-capsule-chart :config="config_left1" class="leftChartBlock1"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">产品占比</div>
|
||||
<dv-active-ring-chart :config="config_left2" class="leftChartBlock2"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="middleBlock">
|
||||
<div style="height: 38vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间工段任务展示</div>
|
||||
<dv-scroll-board :config="config_middle_top" class="middleTableBlock1"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 41vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">设备列表</div>
|
||||
<dv-scroll-board :config="config_middle_bottom" class="middleTableBlock2"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="rightBlock">
|
||||
<el-row style="margin-bottom: 1vh;">
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">在制工单数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
<el-col :span="12" class="numBlock">
|
||||
<dv-border-box-12>
|
||||
<div class="numBlock_title">本月交付数</div>
|
||||
<div class="numBlock_value">123</div>
|
||||
</dv-border-box-12>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">每个人日产量</div>
|
||||
<scEcharts :option="chartOption1" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
<div style="height: 34vh;">
|
||||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">车间整体产品统计</div>
|
||||
<scEcharts :option="chartOption2" style="height: 27.5vh;width: 90%;left: 5%;"/>
|
||||
</dv-border-box-1>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import { runningStateEnum } from "@/utils/enum.js";
|
||||
import scScrollTavle from "@/components/scScrollTable.vue";
|
||||
function deepCopy(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
const myColor = ["#1089E7", "#F57474", "#56D0E3", "#F8B448", "#8B78F6"];
|
||||
export default {
|
||||
components: { scScrollTavle },
|
||||
data() {
|
||||
return {
|
||||
runningStateEnum,
|
||||
basicOption: {
|
||||
backgroundColor: "",
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
},
|
||||
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",
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "",
|
||||
type: "bar",
|
||||
barWidth: 30,
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
color: "#fff",
|
||||
},
|
||||
itemStyle: {
|
||||
borderRadius: [5, 5, 0, 0],
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{offset: 0,color: "#00aaff"},
|
||||
{offset: 1,color: "#0033ff"},
|
||||
]),
|
||||
},
|
||||
data: [1,2,3,4,5,6,7],
|
||||
},
|
||||
],
|
||||
},
|
||||
chartOption1:{
|
||||
color: ['#2f89cf'],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: "0%",
|
||||
top: "10px",
|
||||
right: "0%",
|
||||
bottom: "4%",
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: [], // 类目数据
|
||||
axisTick: {
|
||||
alignWithLabel: true // 刻度线与标签对齐
|
||||
},
|
||||
axisLabel: {
|
||||
color: "rgb(255,255,255)",
|
||||
fontSize: "8",
|
||||
},
|
||||
axisLine: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
color: "rgba(255,255,255,.6)",
|
||||
fontSize: "12"
|
||||
},
|
||||
},
|
||||
// 系列配置
|
||||
series: {
|
||||
name: 'Direct',
|
||||
type: 'bar',
|
||||
barWidth: '15',
|
||||
data: [],
|
||||
itemStyle: {
|
||||
barBorderRadius: 5
|
||||
}
|
||||
}
|
||||
},
|
||||
chartOption2: {
|
||||
grid: {
|
||||
top: "10%",
|
||||
left: "10%",
|
||||
bottom: "5%",
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
// show: false
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
},
|
||||
// Y 轴配置,包含两个 Y 轴,一个用于显示类目,一个用于显示数值
|
||||
yAxis: [
|
||||
{
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#fff"
|
||||
},
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
type: 'category',
|
||||
inverse: true, // 反转坐标轴
|
||||
data: []
|
||||
},
|
||||
{
|
||||
show: false,
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show:false
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
color: "#fff"
|
||||
}
|
||||
},
|
||||
inverse: true, // 反转坐标轴
|
||||
data: [],
|
||||
}
|
||||
],
|
||||
// 一个柱状图,一个边框
|
||||
series: [
|
||||
{
|
||||
name: '柱状图',
|
||||
type: 'bar',
|
||||
data: [],
|
||||
yAxisIndex: 0,
|
||||
barCategoryGap: 50,
|
||||
barWidth: 10,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
barBorderRadius: 5,
|
||||
color: function (params) {
|
||||
return myColor[params.dataIndex];
|
||||
}
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
// show: true,
|
||||
position: "outside",
|
||||
color: "#fff",
|
||||
// formatter: "{a}"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "框",
|
||||
type: "bar",
|
||||
barCategoryGap: 50,
|
||||
barWidth: 12,
|
||||
itemStyle: {
|
||||
color: "none",
|
||||
shadowColor: '#999', // 阴影颜色
|
||||
shadowBlur: 3, // 阴影模糊
|
||||
shadowOffsetX: 0, // 阴影水平偏移
|
||||
shadowOffsetY: 0, // 阴影垂直偏移
|
||||
borderColor: "rgba(153,153,153,0.6)", // 边框颜色
|
||||
borderWidth: 0.5,
|
||||
barBorderRadius: 5,
|
||||
|
||||
},
|
||||
yAxisIndex: 1,
|
||||
data: []
|
||||
}
|
||||
]
|
||||
},
|
||||
tableHeight: 100,
|
||||
speed: 2000,
|
||||
time: null,
|
||||
deptId: "",
|
||||
dayInterval: null,
|
||||
chartInterval2: null,
|
||||
state_: {
|
||||
10: '完好',
|
||||
20: '限用',
|
||||
30: '在修',
|
||||
40: '禁用',
|
||||
},
|
||||
configData:{
|
||||
header:['物料名称','批次号','数量'],
|
||||
headerBGC:'#0a3f44',
|
||||
headerHeight:40,
|
||||
align:'center',
|
||||
data:[],
|
||||
waitTime:1000,
|
||||
},
|
||||
configData1:{
|
||||
headerBGC:'#0a3f44',
|
||||
header:['产出名称','规格','型号','开始时间','结束时间','完成进度','产量','状态'],
|
||||
headerHeight:40,
|
||||
data:[]
|
||||
},
|
||||
config_left1:{
|
||||
data:[]
|
||||
} ,
|
||||
config_left2:{
|
||||
data:[]
|
||||
},
|
||||
config_middle_top:{
|
||||
rowNum:10,
|
||||
headerBGC: 'rgba(47,102,107,.34)',
|
||||
oddRowBGC: 'rgba(0,0,0,0)',
|
||||
evenRowBGC: 'rgba(0,0,0,0)',
|
||||
header: ['任务编号', '产出产品', '任务量', '合格数'],
|
||||
data: []
|
||||
},
|
||||
config_middle_bottom:{
|
||||
rowNum:10,
|
||||
headerBGC: 'rgba(0,0,0,0)',
|
||||
oddRowBGC: 'rgba(0,0,0,0)',
|
||||
evenRowBGC: 'rgba(0,0,0,0)',
|
||||
header: ['设备名称','设备位号','设备状态','运行状态','所在工段'],
|
||||
data: []
|
||||
},
|
||||
currentTime: "",
|
||||
currentDay: "",
|
||||
today: "",
|
||||
end_time:'',
|
||||
start_time:'',
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
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);
|
||||
// })
|
||||
// this.xAxisData = xAxisData;
|
||||
// let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24);
|
||||
// let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24);
|
||||
// let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd hh:mm:ss");
|
||||
// let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd hh:mm:ss");
|
||||
// this.start_time = start_time;
|
||||
// this.end_time = end_time;
|
||||
let userInfo = this.$TOOL.data.get("USER_INFO");
|
||||
this.deptId = userInfo.belong_dept;
|
||||
this.deptName = userInfo.belong_dept_name;
|
||||
this.getMgroups();
|
||||
this.$nextTick(() => {
|
||||
//车间各个工段生产产品的数量:每个工段的已完成
|
||||
// this.getmgroupMaterial();
|
||||
//车间工段任务展示:各个工段的任务列表
|
||||
this.getMtask1();
|
||||
//设备列表:各个工段的设备列表
|
||||
this.getEquipment();
|
||||
//每个人日生产量:个人绩效
|
||||
this.getCount();
|
||||
//车间整体产品统计:最后一个工序的产品统计
|
||||
//产品占比:最后一个工序的产品占比
|
||||
// this.getMaterials();// this.getmgroupMaterial();
|
||||
})
|
||||
},
|
||||
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.basicOption);
|
||||
}
|
||||
setTimeout(() => {
|
||||
try {
|
||||
myChart.setOption(option);
|
||||
} catch (error) {}
|
||||
}, 500);
|
||||
return myChart;
|
||||
},
|
||||
getMgroups(){
|
||||
let that = this;
|
||||
that.$API.mtm.mgroup.list.req({belong_dept:that.deptId,page:0}).then((res) => {
|
||||
if(res.length > 0){
|
||||
res.forEach((item,inde)=>{
|
||||
that.mgroupsId += item.id + ',';
|
||||
that.getmgroupMaterial(item);
|
||||
//未完成的物料
|
||||
if(inde==res.length-1){
|
||||
that.getLastmgroupMaterial(item);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//任务进度
|
||||
getMtask1() {
|
||||
let that = this;
|
||||
let params = {
|
||||
state: 20,mgroup__belong_dept: that.deptId,page:0,
|
||||
query: " { id, material_out_name, number, count, count_ok }"
|
||||
};
|
||||
that.config_middle_top.data = [];
|
||||
that.$API.pm.mtask.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
res.forEach((item) => {
|
||||
let arr = [];
|
||||
arr[0] = item.number;
|
||||
arr[1] = item.material_out_name;
|
||||
arr[2] = item.count;
|
||||
arr[3] = item.count_ok;
|
||||
// arr[4] = item.count_ok/item.count*100+'%';
|
||||
that.config_middle_top.data.push(arr);
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//库存统计列表
|
||||
getmgroupMaterial(item) {
|
||||
let that = this;
|
||||
let params = { tag: 'done',page_size:1,mgroup: item.id };
|
||||
that.$API.wpm.wmaterial.list.req(params).then((res) => {
|
||||
let obj = {};
|
||||
obj.name = item.name;
|
||||
obj.value = res.count;
|
||||
that.config_left1.data.push(obj);
|
||||
})
|
||||
},
|
||||
getLastmgroupMaterial(item){
|
||||
let that = this;
|
||||
let params = {
|
||||
tag: 'done',page:0,mgroup: item.id ,
|
||||
// query: " { id, material_name }"
|
||||
};
|
||||
that.$API.wpm.wmaterial.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
let namelist = [],valuelist = [],values=[];
|
||||
res.forEach((item)=>{
|
||||
let index = namelist.indexOf(item.material_.name);
|
||||
if(index==-1){
|
||||
namelist.push(item.material_.name);
|
||||
valuelist.push(1);
|
||||
values.push(1);
|
||||
}else{
|
||||
valuelist[index] += 1;
|
||||
values[index] += 1;
|
||||
}
|
||||
})
|
||||
let maxNum = valuelist.sort((a, b) => b - a)[0]+2;
|
||||
let arr = [];
|
||||
valuelist.forEach((item)=>{
|
||||
arr.push(maxNum)
|
||||
})
|
||||
that.chartOption2.yAxis[0].data = namelist;
|
||||
that.chartOption2.yAxis[1].data = valuelist;
|
||||
that.chartOption2.series[0].data = valuelist;
|
||||
that.chartOption2.series[1].data = arr;
|
||||
namelist.forEach((item,index)=>{
|
||||
let obj = {};
|
||||
obj.name = item;
|
||||
obj.value = valuelist[index];
|
||||
that.config_left2.data.push(obj);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getEquipment() {
|
||||
let that = this;
|
||||
let params = {
|
||||
page: 0, belong_dept:that.deptId,
|
||||
// query: " { id, name, number, model, state ,mgroup_name }"
|
||||
};
|
||||
that.config_middle_bottom.data = [];
|
||||
that.$API.em.equipment.list.req(params).then((res) => {
|
||||
if(res.length>0){
|
||||
res.forEach((item) => {
|
||||
let arr = [];
|
||||
let state_ = that.state_[item.state];
|
||||
let running_state_ = runningStateEnum[item.running_state]?.text;
|
||||
arr[0] = item.name;
|
||||
arr[1] = item.number;
|
||||
arr[2] = state_;
|
||||
arr[3] = running_state_;
|
||||
arr[4] = item.mgroup_name;
|
||||
that.config_middle_bottom.data.push(arr);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getCount(){
|
||||
let that = this;
|
||||
let date = that.$TOOL.dateFormat(new Date(), "yyyy-MM-dd");
|
||||
let params = {
|
||||
query: {start_date:date,end_date:date,dept_name:that.deptName},
|
||||
// query: {start_date:'2025-06-11',end_date:'2025-06-11',dept_name:that.deptName},
|
||||
};
|
||||
let namelist = [],valuelist = [];
|
||||
this.$API.bi.dataset.exec.req("performance", params).then((res) => {
|
||||
if(res.data2.ds0.length>0){
|
||||
res.data2.ds0.forEach((item)=>{
|
||||
namelist.push(item.操作人);
|
||||
valuelist.push(item.合格数);
|
||||
})
|
||||
}
|
||||
that.chartOption1.xAxis.data = namelist;
|
||||
that.chartOption1.series.data = valuelist;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<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/head_bg.png"); */
|
||||
background: url("/public/img/header_bgv.png");
|
||||
border-bottom: none;
|
||||
background-size: 100% 100%;
|
||||
display: block;
|
||||
height: 8vh;
|
||||
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;
|
||||
font-size:4vh;
|
||||
letter-spacing: 10px;
|
||||
}
|
||||
.header > .timer {
|
||||
font-size: 14px;
|
||||
margin-top: 18px;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 20px;
|
||||
}
|
||||
.numBlock{
|
||||
height: 10vh;
|
||||
}
|
||||
.numBlock_title{
|
||||
height: 4vh;
|
||||
width: 100%;
|
||||
font-size: 1.5vh;
|
||||
line-height: 4vh;
|
||||
text-align: center;
|
||||
}
|
||||
.numBlock_value{
|
||||
height:6vh;
|
||||
width: 100%;
|
||||
line-height: 5vh;
|
||||
text-align: center;
|
||||
font-size: 3vh;
|
||||
font-family: "myfont";
|
||||
}
|
||||
.leftChartBlock1{
|
||||
width: 90%;
|
||||
height: 28vh;
|
||||
z-index: 999;
|
||||
left: 5%;
|
||||
border-radius: 3vh;
|
||||
}
|
||||
.leftChartBlock2{
|
||||
width:100%;
|
||||
height: 28vh;
|
||||
}
|
||||
.middleTableBlock1{
|
||||
width:94%;
|
||||
height:31vh;
|
||||
position: absolute;
|
||||
left: 4%
|
||||
}
|
||||
.middleTableBlock2{
|
||||
width:94%;
|
||||
height:34vh;
|
||||
position: absolute;
|
||||
left: 4%
|
||||
}
|
||||
.chartBlockTitle{
|
||||
width: 90%;
|
||||
height: 5vh;
|
||||
margin: auto;
|
||||
line-height: 6vh;
|
||||
border-radius: 10px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
font-size: 1.6vh;
|
||||
font-weight: 600;
|
||||
border-bottom: 1px solid rgb(83 198 243);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -524,6 +524,7 @@ export default {
|
|||
lineWidth:0,
|
||||
pieHeight:0,
|
||||
lineHeight:0,
|
||||
setIntervals:null,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -604,12 +605,19 @@ export default {
|
|||
that.getMaterials();
|
||||
that.getMgroup();
|
||||
that.getTaskNumber();
|
||||
that.addListener();
|
||||
that.getArticles();
|
||||
that.getpurinrate();
|
||||
that.initFactory();
|
||||
that.addListener();
|
||||
})
|
||||
that.setIntervals = setInterval(function () {
|
||||
that.getCountnotok();
|
||||
that.getMaterials();
|
||||
that.getMgroup();
|
||||
that.getTaskNumber();
|
||||
that.getArticles();
|
||||
that.getpurinrate();
|
||||
}, 300000);
|
||||
},
|
||||
//获取公告和视频
|
||||
getArticles(){
|
||||
|
|
@ -998,16 +1006,20 @@ export default {
|
|||
this.scene = null;
|
||||
clearInterval(that.timerTime);
|
||||
clearInterval(that.scrollInterval);
|
||||
clearInterval(that.setIntervals);
|
||||
that.timerTime = null;
|
||||
that.scrollInterval = null;
|
||||
that.setIntervals = null;
|
||||
},
|
||||
beforeDestoryed() {
|
||||
let that = this;
|
||||
this.scene = null;
|
||||
clearInterval(that.timerTime);
|
||||
clearInterval(that.scrollInterval);
|
||||
clearInterval(that.setIntervals);
|
||||
that.timerTime = null;
|
||||
that.scrollInterval = null;
|
||||
that.setIntervals = null;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<!-- <div class="left-panel">
|
||||
<el-select
|
||||
v-model="query.warehouse"
|
||||
clearable
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="right-panel">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
|
|
@ -38,6 +38,63 @@
|
|||
row-key="id"
|
||||
stripe
|
||||
:params="params"
|
||||
v-if="project_code=='gx'"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="日期" prop="update_time">
|
||||
</el-table-column>
|
||||
<el-table-column label="物料编号">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_&&scope.row.material_.number">{{ scope.row.material_.number }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料名称" prop="material_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="货位号">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_&&scope.row.material_.bin_number_main">{{ scope.row.material_.bin_number_main }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_&&scope.row.material_.specification">{{ scope.row.material_.specification }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="品牌型号">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_&&scope.row.material_.model">{{ scope.row.material_.model }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_&&scope.row.material_.unit">{{ scope.row.material_.unit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="安全库存">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_&&scope.row.material_.count_safe">{{ scope.row.material_.count_safe }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count">
|
||||
</el-table-column>
|
||||
<el-table-column label="单价">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_&&scope.row.material_.unit_price">{{ scope.row.material_.unit_price }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" prop="expiration_date">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
stripe
|
||||
:params="params"
|
||||
v-else
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料批次" prop="batch">
|
||||
|
|
@ -57,11 +114,6 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="更新时间" prop="update_time">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column width="90">
|
||||
<template #default="scope">
|
||||
<el-button @click="printMaterial(scope.row)" type="text">物料标签</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</scTable>
|
||||
</el-main>
|
||||
<print-dialog
|
||||
|
|
@ -83,7 +135,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
apiObj: this.$API.inm.warehouse.batch,
|
||||
params: { count__gte: 1, material__type__in: "40, 50, 60, 70" },
|
||||
params: { count__gte: 1, material__type__in: "40" },
|
||||
selection: [],
|
||||
query: {},
|
||||
warehouseOptions: [],
|
||||
|
|
@ -92,6 +144,7 @@ export default {
|
|||
materialsVisible:false,
|
||||
apiObjPrint:this.$API.cm.labelmat.fromMb,
|
||||
wmId:'',
|
||||
project_code:this.$TOOL.data.get("BASE_INFO").base.base_code
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
|||
|
|
@ -124,6 +124,15 @@
|
|||
>
|
||||
删除
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="table_revert(scope.row)"
|
||||
v-auth="'mio.submit'"
|
||||
v-if="scope.row.state == 20"
|
||||
>
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
|
@ -216,20 +225,28 @@ export default {
|
|||
table_del(row) {
|
||||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$API.inm.mio.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.table.refresh();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
}).then(() => {
|
||||
this.$API.inm.mio.delete.req(row.id).then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.table.refresh();
|
||||
return res;
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
table_revert(row){
|
||||
this.$confirm(`确定撤回吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
this.$API.inm.mio.revert.req(row.id).then((res) => {
|
||||
this.$message.success("撤回成功");
|
||||
this.$refs.table.refresh();
|
||||
return res;
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
table_submit(row) {
|
||||
this.$API.inm.mio.submit.req(row.id).then((res) => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,398 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-main class="nopadding">
|
||||
<el-card style="width: 100%" header="基本信息" shadow="never">
|
||||
<el-form
|
||||
ref="mioForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="编号">
|
||||
<el-input v-model="form.number" placeholder="编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="出入库日期">
|
||||
<el-date-picker
|
||||
v-model="form.inout_date"
|
||||
type="date"
|
||||
placeholder="出入库日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" v-if="urlCode == 'helpso_in'">
|
||||
<el-form-item label="采购订单">
|
||||
<el-select
|
||||
v-model="form.pu_order"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in puOrderOptions"
|
||||
:key="item.id"
|
||||
:label="item.number"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" v-if="urlCode == 'helpso_in'">
|
||||
<el-form-item label="供应商">
|
||||
<el-select
|
||||
v-model="form.supplier"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in supplierOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" v-if="urlCode == 'helpso_out'">
|
||||
<el-form-item label="执行部门">
|
||||
<el-select
|
||||
v-model="form.belong_dept"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="deptChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deptOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" v-if="urlCode == 'helpso_out'">
|
||||
<el-form-item label="工段">
|
||||
<el-select
|
||||
v-model="form.mgroup"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="为空时代表领料/入库到车间"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in mgroupOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" v-if="urlCode == 'helpso_out'">
|
||||
<el-form-item label="部门执行人">
|
||||
<el-select v-model="form.do_user" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="仓库执行人">
|
||||
<el-select
|
||||
v-model="form.mio_user"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="primary" :loading="mioSaveing" @click="mioSubmit">
|
||||
保存
|
||||
</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card style="width: 100%;position: relative;" header="物料明细" shadow="never">
|
||||
<el-button type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="table_add"
|
||||
v-if="params.mio!==null"
|
||||
style="position: absolute;right: 20px;top: 10px"
|
||||
>新增</el-button>
|
||||
<div style="height: 8px"></div>
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
stripe
|
||||
:params="params"
|
||||
hidePagination
|
||||
hideDo
|
||||
>
|
||||
<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="数量">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_&&scope.row.material_.tracking==10">{{scope.row.count}}</span>
|
||||
<el-link v-else :underline="false" type="primary" @click="showWpr(scope.row)">{{scope.row.count}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="create_time"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="150px"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-link type="danger" @click="table_del(scope.row)">删除</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-card>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="mioitemSaveing" @click="table_submit">提交</el-button>
|
||||
</el-footer>
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
:mioId="mioId"
|
||||
:mgroup="mioObj.mgroup"
|
||||
:belongDeptId="mioObj.belong_dept"
|
||||
:belongDeptName="mioObj.belong_dept_name"
|
||||
:mioObj="mioObj"
|
||||
:cate="cate"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
>
|
||||
</save-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./mioitem_form.vue";
|
||||
export default {
|
||||
name: "mio",
|
||||
components: {
|
||||
saveDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
stateDict: {
|
||||
10: "创建中",
|
||||
20: "已提交",
|
||||
},
|
||||
stateOptions: [
|
||||
{ id: 10, name: "创建中" },
|
||||
{ id: 20, name: "已提交" },
|
||||
],
|
||||
typeDict: {
|
||||
pur_in: "采购入库",
|
||||
do_out: "领料出库",
|
||||
},
|
||||
dialog: {
|
||||
save: false,
|
||||
record: false,
|
||||
},
|
||||
params: {
|
||||
mio: null,
|
||||
},
|
||||
form: {},
|
||||
query: {},
|
||||
mioObj:{},
|
||||
mioId:null,
|
||||
apiObj: null,
|
||||
userOption: [],
|
||||
userOptions: [],
|
||||
deptOptions: [],
|
||||
mgroupOptions: [],
|
||||
puOrderOptions: [],
|
||||
supplierOptions: [],
|
||||
mioSaveing: false,
|
||||
visibleDrawer: false,
|
||||
mioitemSaveing: false,
|
||||
urlCode: "helpso_in",
|
||||
cate: "helpso",
|
||||
type: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
that.getUsers();
|
||||
that.getDeptOptions();
|
||||
that.getPuOrderOptions();
|
||||
that.getSupplierOptions();
|
||||
that.urlCode = window.location.hash.split('/')[2];
|
||||
if (that.urlCode == "helpso_out") {
|
||||
that.form.type = "do_out";
|
||||
}else{
|
||||
that.form.type = "pur_in";
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getDeptOptions() {
|
||||
let that = this;
|
||||
that.$API.system.dept.list.req({ page: 0, type__in: "dept" }).then((res) => {
|
||||
that.deptOptions = res;
|
||||
});
|
||||
},
|
||||
getmgroupOptions() {
|
||||
let that = this;
|
||||
that.$API.mtm.mgroup.list.req({ depts: that.form.belong_dept,page: 0}).then(res=>{
|
||||
that.mgroupOptions = res;
|
||||
})
|
||||
},
|
||||
getDeptUsers(){
|
||||
let that = this;
|
||||
that.$API.system.user.list.req({ depts: that.form.belong_dept, page: 0 }).then((res) => {
|
||||
that.userOptions = res;
|
||||
});
|
||||
},
|
||||
getUsers(){
|
||||
let that = this;
|
||||
that.$API.system.user.list.req({ posts__name: "库管", page: 0 }).then((res) => {
|
||||
that.userOption = res;
|
||||
});
|
||||
},
|
||||
deptChange(){
|
||||
this.getDeptUsers();
|
||||
this.getmgroupOptions();
|
||||
},
|
||||
getSupplierOptions() {
|
||||
let that = this;
|
||||
that.$API.pum.supplier.list.req({ page: 0 }).then((res) => {
|
||||
that.supplierOptions = res;
|
||||
});
|
||||
},
|
||||
getPuOrderOptions() {
|
||||
let that = this;
|
||||
that.$API.pum.order.list.req({ page: 0, type__in: "20,30" }).then((res) => {
|
||||
that.puOrderOptions = res;
|
||||
});
|
||||
},
|
||||
mioSubmit(){
|
||||
let that = this;
|
||||
that.$refs.mioForm.validate((valid) => {
|
||||
if (valid) {
|
||||
that.mioSaveing = true;
|
||||
that.$API.inm.mio.create.req(that.form).then((res) => {
|
||||
that.$message.success("保存成功");
|
||||
that.mioSaveing = false;
|
||||
that.mioId = res.id;
|
||||
that.params.mio = res.id;
|
||||
that.apiObj = that.$API.inm.mioitem.list;
|
||||
that.$API.inm.mio.item.req(res.id).then((res1) => {
|
||||
that.mioObj = res1;
|
||||
})
|
||||
}).catch((err) => {
|
||||
that.mioSaveing = false;
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
//添加
|
||||
table_add() {
|
||||
let that = this;
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add", that.form.type);
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
table_edit(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("edit", that.form.type).setData(row);
|
||||
});
|
||||
},
|
||||
//查看
|
||||
table_detail(row) {
|
||||
this.type = row.type;
|
||||
this.mioId = row.id;
|
||||
this.visibleDrawer = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.showDrawer.open();
|
||||
});
|
||||
},
|
||||
//删除
|
||||
table_del(row) {
|
||||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
this.$API.inm.mioitem.delete.req(row.id).then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.table.refresh();
|
||||
return res;
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
table_submit() {
|
||||
let that = this;
|
||||
that.mioitemSaveing = true;
|
||||
that.$API.inm.mio.submit.req(that.mioObj.id).then((res) => {
|
||||
that.mioitemSaveing = false;
|
||||
that.$message.success("提交成功");
|
||||
that.form.number = "";
|
||||
that.form.inout_date = "";
|
||||
that.form.pu_order = "";
|
||||
that.form.supplier = "";
|
||||
that.form.belong_dept = "";
|
||||
that.form.mgroup = "";
|
||||
that.form.do_user = "";
|
||||
that.form.mio_user = "";
|
||||
that.form.mio =null;
|
||||
that.apiObj = null;
|
||||
that.params.mio = null;
|
||||
that.$refs.table.refresh();
|
||||
}).catch((err) => {
|
||||
that.mioitemSaveing = false;
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
handleSaveSuccess() {
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,247 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="add"
|
||||
v-auth="'material.create'"
|
||||
>新增</el-button
|
||||
>
|
||||
<scFileImport
|
||||
:templateUrl="materialTemplate"
|
||||
accept=".xlsx"
|
||||
:apiObj="$API.common.upload"
|
||||
@success="upSuccess"
|
||||
>
|
||||
</scFileImport>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="名称"
|
||||
clearable
|
||||
></el-input>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
stripe
|
||||
:params="params"
|
||||
@row-click="rowClick"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料编号" prop="number">
|
||||
</el-table-column>
|
||||
<el-table-column label="物料名称" prop="name">
|
||||
</el-table-column>
|
||||
<el-table-column label="规格" prop="specification">
|
||||
</el-table-column>
|
||||
<el-table-column label="型号" prop="model">
|
||||
</el-table-column>
|
||||
<el-table-column label="物料特征">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
type="warning"
|
||||
v-if="scope.row.is_hidden"
|
||||
effect="plain"
|
||||
>隐</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计量单位" prop="unit">
|
||||
</el-table-column>
|
||||
<el-table-column label="仓库位号" prop="bin_number_main">
|
||||
</el-table-column>
|
||||
<el-table-column label="总库存" prop="count">
|
||||
</el-table-column>
|
||||
<el-table-column label="安全库存" prop="count_safe">
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" prop="unit_price">
|
||||
</el-table-column>
|
||||
<el-table-column label="总价" prop="count_safe">
|
||||
<template #default="scope">
|
||||
{{ scope.row.unit_price * scope.row.count }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="materialType == ''"
|
||||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="140"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="table_edit(scope.row)"
|
||||
v-auth="'material.update'"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
@click="table_copy(scope.row)"
|
||||
v-auth="'material.create'"
|
||||
>
|
||||
复制
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="table_del(scope.row)"
|
||||
v-auth="'material.delete'"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scFileImport from "@/components/scFileImport";
|
||||
import saveDialog from "./../mtm/materials_form_gx.vue";
|
||||
import { ElLoading } from "element-plus";
|
||||
|
||||
export default {
|
||||
name: "rparty",
|
||||
props: {
|
||||
materialType: {
|
||||
//当作选择页面时传参
|
||||
type: String,
|
||||
default() {
|
||||
return "";
|
||||
},
|
||||
},
|
||||
},
|
||||
components: {
|
||||
saveDialog,
|
||||
scFileImport,
|
||||
ElLoading,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
project_code : this.$TOOL.data.get("BASE_INFO").base.base_code,
|
||||
materialTemplate: " /media/default/template/material.xlsx",
|
||||
dialog: {
|
||||
save: false,
|
||||
},
|
||||
apiObj: this.$API.mtm.material.list,
|
||||
params: { type: 40,is_hidden: false},
|
||||
query: { is_hidden: false },
|
||||
state_: {
|
||||
10: "完好",
|
||||
20: "限用",
|
||||
30: "在修",
|
||||
40: "禁用",
|
||||
},
|
||||
materialId: "",
|
||||
materialName: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.materialTemplate = this.materialTemplate+"?t=" + new Date().getTime();
|
||||
},
|
||||
methods: {
|
||||
rowClick(row) {
|
||||
this.materialId = row.id;
|
||||
this.materialName = row.full_name;
|
||||
this.$emit("choseChange", row.id);
|
||||
},
|
||||
handleClick(pane, ev) {
|
||||
this.query.type = pane.props.name;
|
||||
this.query.page = 1;
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
//添加
|
||||
add() {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add");
|
||||
});
|
||||
},
|
||||
table_copy(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add").setData(row);
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
table_edit(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("show").setData(row);
|
||||
});
|
||||
},
|
||||
//删除
|
||||
async table_del(row) {
|
||||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
this.$API.mtm.material.delete.req(row.id).then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.table.refresh();
|
||||
return res;
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
if (mode == "add") {
|
||||
this.$refs.table.refresh();
|
||||
} else if (mode == "edit") {
|
||||
this.$refs.table.refresh();
|
||||
}
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
upSuccess(res, close) {
|
||||
close();
|
||||
const loading = ElLoading.service({
|
||||
fullscreen: true,
|
||||
text: "解析中...请稍等",
|
||||
});
|
||||
this.$API.mtm.material.daoru.req({ path: res.path }).then((res) => {
|
||||
loading.close();
|
||||
this.$message.success("导入成功");
|
||||
this.$refs.table.queryData(this.query);
|
||||
}).catch((err) => {
|
||||
loading.close();
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -170,13 +170,7 @@
|
|||
link
|
||||
type="primary"
|
||||
@click="table_check(scope.row)"
|
||||
v-if="
|
||||
scope.row.test_date == null &&
|
||||
mioObj.state == 20 &&
|
||||
(type == 'pur_in' ||
|
||||
type == 'do_in' ||
|
||||
type == 'other_in')
|
||||
"
|
||||
v-if="scope.row.test_date == null &&mioObj.state == 20 &&(type == 'pur_in' ||type == 'do_in' ||type == 'other_in')"
|
||||
v-auth="'mioitem.test'"
|
||||
>
|
||||
检验
|
||||
|
|
@ -195,7 +189,7 @@
|
|||
@click="check_reSet(scope.row)"
|
||||
v-if="scope.row.test_date !== null"
|
||||
>
|
||||
撤回
|
||||
检验作废
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
|
|
@ -212,7 +206,15 @@
|
|||
>
|
||||
物料标签
|
||||
</el-link>
|
||||
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="check_revert(scope.row)"
|
||||
v-if="mioObj.state == 20&&(mioObj.type=='do_out'||mioObj.type=='other_in'||mioObj.type=='pur_in')"
|
||||
v-auth="'mio.update'"
|
||||
>
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
|
@ -405,6 +407,21 @@ export default {
|
|||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
//撤回并删除
|
||||
check_revert(row){
|
||||
let that = this;
|
||||
that.$confirm(`该记录已提交,确定撤回吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
console.log('确定删除');
|
||||
that.$API.inm.mioitem.revertDel.req(row.id).then((res) => {
|
||||
that.$message.success("撤回成功");
|
||||
that.$refs.table.refresh();
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
//检验
|
||||
table_check(row) {
|
||||
this.mioitemId = row.id;
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@
|
|||
v-model="form.warehouse"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
:disabled="warehouseDisable"
|
||||
:disabled="form.type == 'do_out'||form.type=='sale_out'"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
|
|
@ -261,7 +261,7 @@ export default {
|
|||
batchOptions: [],
|
||||
setFiltersVisible: false,
|
||||
warehouseOptions: [],
|
||||
warehouseDisable: false,
|
||||
// warehouseDisable: false,
|
||||
selectBatchDisable: false,
|
||||
assembShow: false,
|
||||
selectMaterial: null,
|
||||
|
|
@ -421,6 +421,7 @@ export default {
|
|||
var that = this;
|
||||
var type = this.form.type;
|
||||
that.form.material = that.selectObj.id;
|
||||
that.form.unit_price = that.selectObj.unit_price;
|
||||
that.form.batch = that.cate=='helpso'?that.selectObj.bin_number_main:that.selectObj.batch;
|
||||
that.mTracking = that.selectObj.tracking;
|
||||
if (type == "do_in") {
|
||||
|
|
@ -448,7 +449,7 @@ export default {
|
|||
this.form.mb = item.id;
|
||||
this.form.count = Number(item.count);
|
||||
this.form.warehouse = item.warehouse;
|
||||
this.warehouseDisable = true;
|
||||
// this.warehouseDisable = true;
|
||||
this.inputBatchDisable = true;
|
||||
},
|
||||
selectBatchClear() {
|
||||
|
|
@ -457,7 +458,7 @@ export default {
|
|||
this.form.batch = "";
|
||||
this.form.count = "";
|
||||
this.form.warehouse = "";
|
||||
this.warehouseDisable = false;
|
||||
// this.warehouseDisable = false;
|
||||
this.inputBatchDisable = false;
|
||||
},
|
||||
//显示
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
apiObj: null,
|
||||
params: {with_mio:'yes',material__type:30,mio__state:20},
|
||||
params: {with_mio:'yes',material__type:40,mio__state:20},
|
||||
selection: [],
|
||||
tableData:[],
|
||||
query: {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
hideDelete
|
||||
hideIndex
|
||||
:tableHeight="200"
|
||||
:pushType="pushType"
|
||||
v-model="qctmatlist"
|
||||
:addTemplate="mataddTemplate"
|
||||
placeholder="暂无数据"
|
||||
|
|
@ -38,9 +39,11 @@
|
|||
v-else
|
||||
:apiObj="apiObj"
|
||||
:labelField="'full_name'"
|
||||
v-model:obj="materialrow"
|
||||
v-model="scope.row.material"
|
||||
v-model:label="scope.row.full_name"
|
||||
style="width:100%"
|
||||
@change="materialrowChange"
|
||||
>
|
||||
<el-table-column label="物料名称" prop="full_name"></el-table-column>
|
||||
<!-- <el-table-column label="工序" prop="process_name"></el-table-column>
|
||||
|
|
@ -102,6 +105,7 @@
|
|||
<sc-form-table
|
||||
hideIndex
|
||||
:tableHeight="300"
|
||||
:pushType="pushType"
|
||||
v-model="qcttestitemlist"
|
||||
:addTemplate="defectaddTemplate"
|
||||
placeholder="暂无数据"
|
||||
|
|
@ -119,9 +123,10 @@
|
|||
v-else
|
||||
:apiObj="apiObj2"
|
||||
v-model="scope.row.testitem"
|
||||
v-model:label="scope.row.testitem_name"
|
||||
v-model:label="scope.row.testitem_name"
|
||||
v-model:obj="testitemrow"
|
||||
style="width:100%"
|
||||
@change="testitemrowChange"
|
||||
>
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="描述" prop="description"></el-table-column>
|
||||
|
|
@ -177,6 +182,7 @@
|
|||
<el-card style="width: 100%" header="检测缺陷项" shadow="hover">
|
||||
<sc-form-table
|
||||
hideIndex
|
||||
:pushType="pushType"
|
||||
:tableHeight="300"
|
||||
v-model="qctdefectlist"
|
||||
:addTemplate="testitemaddTemplate"
|
||||
|
|
@ -196,8 +202,9 @@
|
|||
:apiObj="apiObj3"
|
||||
v-model="scope.row.defect"
|
||||
v-model:obj="defectrow"
|
||||
v-model:label="scope.row.defect_name"
|
||||
v-model:label="scope.row.defect_name"
|
||||
style="width:100%"
|
||||
@change="defectrowChange"
|
||||
>
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="分类" prop="cate"></el-table-column>
|
||||
|
|
@ -325,8 +332,9 @@ export default {
|
|||
isEdit: true,
|
||||
},
|
||||
defectrow:{},
|
||||
materialrow:{},
|
||||
testitemrow:{},
|
||||
|
||||
pushType:'unshift',
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -337,7 +345,30 @@ export default {
|
|||
this.getLists();
|
||||
},
|
||||
watch:{
|
||||
defectrow:{}
|
||||
// testitemrow:{
|
||||
// handler(newVal,oldVal){
|
||||
// console.log('newVal',newVal);
|
||||
// console.log('oldVal',oldVal);
|
||||
// this.testitemrowChange()
|
||||
// },
|
||||
// deep: true,
|
||||
// },
|
||||
// defectrow:{
|
||||
// handler(newVal,oldVal){
|
||||
// console.log('newVal',newVal);
|
||||
// console.log('oldVal',oldVal);
|
||||
// this.defectrowChange()
|
||||
// },
|
||||
// deep: true,
|
||||
// },
|
||||
// materialrow:{
|
||||
// handler(newVal,oldVal){
|
||||
// console.log('newVal',newVal);
|
||||
// console.log('oldVal',oldVal);
|
||||
// this.materialrowChange()
|
||||
// },
|
||||
// deep: true,
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
|
|
@ -491,7 +522,32 @@ export default {
|
|||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
||||
materialrowChange(){
|
||||
let that = this;
|
||||
that.qctmatlist.forEach((item) => {
|
||||
if (item.material&&(item.material == that.materialrow.id)) {
|
||||
that.$message.warning("该物料已存在");
|
||||
}
|
||||
});
|
||||
},
|
||||
defectrowChange(){
|
||||
let that = this;
|
||||
console.log('that.qctdefectlist',that.qctdefectlist);
|
||||
that.qctdefectlist.forEach((item) => {
|
||||
if (item.defect&&(item.defect == that.defectrow.id)) {
|
||||
that.$message.warning("该缺陷项已存在");
|
||||
}
|
||||
});
|
||||
},
|
||||
testitemrowChange(){
|
||||
let that = this;
|
||||
console.log('that.qcttestitemlist',that.qcttestitemlist);
|
||||
that.qcttestitemlist.forEach((item) => {
|
||||
if (item.testitem&&item.testitem == that.testitemrow.id) {
|
||||
that.$message.warning("该检测项已存在");
|
||||
}
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
check_edit(row) {
|
||||
this.mioitemId = row.id;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<el-side>
|
||||
<el-container>
|
||||
<el-header style="height: 40px;">
|
||||
<el-select
|
||||
<!-- <el-select
|
||||
v-model="query.material_start__type"
|
||||
placeholder="请选择"
|
||||
style="width: 90px;"
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
<el-option label="原料" :value="30"></el-option>
|
||||
<el-option label="半成品" :value="20"></el-option>
|
||||
<el-option label="成品" :value="10"></el-option>
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
<el-input
|
||||
v-model="query.batch"
|
||||
placeholder="请输入批次号"
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
:paginationLayout="'total, sizes, jumper'"
|
||||
>
|
||||
<el-table-column prop="batch" label="批次号"></el-table-column>
|
||||
<el-table-column prop="version" label="版本" width="60"></el-table-column>
|
||||
<!-- <el-table-column prop="version" label="版本" width="60"></el-table-column> -->
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
|
@ -64,17 +64,25 @@
|
|||
ref="tableMlog"
|
||||
:apiObj="apiObj_mlog"
|
||||
row-key="id"
|
||||
:params="params"
|
||||
:query="params"
|
||||
:params="params_mlog"
|
||||
:query="params_mlog"
|
||||
>
|
||||
<el-table-column label="#" type="index" width="50" fixed></el-table-column>
|
||||
<el-table-column label="工艺路线" prop="material_out_name" min-width="130" fixed>
|
||||
<el-table-column label="工艺路线" prop="material_out_name" min-width="150" fixed>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_out_name!==null">{{scope.row.material_out_name}}</span>
|
||||
<span v-else>返工</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生产设备" prop="equipment_name" min-width="150"></el-table-column>
|
||||
<el-table-column label="生产物料" min-width="250">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.mlogb_full!==null">
|
||||
<span v-for="item in scope.row.mlogb_full" :key="item.id">
|
||||
<span v-if="item.material_in!==null">{{ item.batch }}({{Number(item.count_use)}})、</span>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加工数" prop="count_real"></el-table-column>
|
||||
<el-table-column label="合格数" prop="count_ok"></el-table-column>
|
||||
<el-table-column label="类型">
|
||||
|
|
@ -102,7 +110,7 @@
|
|||
label="操作日期"
|
||||
prop="handle_date"
|
||||
></el-table-column>
|
||||
<el-table-column label="是否提交" prop="submit_time">
|
||||
<el-table-column label="是否提交" prop="submit_time" width="80">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.submit_time!==null" style="color: green;">是</span>
|
||||
<span v-else>否</span>
|
||||
|
|
@ -163,6 +171,7 @@
|
|||
<el-tag v-if="scope.row.type == 20" type="warning">返工</el-tag>
|
||||
<el-tag v-if="scope.row.type == 40" type="danger" >报废</el-tag>
|
||||
<el-tag v-if="scope.row.type == 50" type="success" >改版</el-tag>
|
||||
<el-tag v-if="scope.row.type == 60" type="success" >退料</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交接类型" prop="mtype" min-width="80">
|
||||
|
|
@ -341,9 +350,13 @@ export default {
|
|||
other_out: "其他出库",
|
||||
},
|
||||
//mlog\handover
|
||||
params_mlog:{
|
||||
cbatch:'',
|
||||
with_mlogb:'yes',
|
||||
query: " { id,material_out_name,mlogb_full,count_real,count_ok,is_fix,belong_dept_name,mgroup_name,handle_user_name,handle_date,reminder_interval_list,mstate_json,work_start_time,work_end_time,oinfo_json,submit_time,submit_user_name}"
|
||||
},
|
||||
params:{
|
||||
cbatch:'',
|
||||
// query:" { id, name, code, last_data, gather_state }",
|
||||
},
|
||||
params2:{
|
||||
batch:'',
|
||||
|
|
@ -353,7 +366,7 @@ export default {
|
|||
},
|
||||
query:{
|
||||
batch:'',
|
||||
material_start__type:30,
|
||||
// material_start__type:30,
|
||||
},
|
||||
batch:'',
|
||||
activeName:'',
|
||||
|
|
@ -364,12 +377,11 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
rowClick(row){
|
||||
console.log('row',row)
|
||||
let that = this;
|
||||
that.nodes =[];
|
||||
that.edges = [];
|
||||
that.limitedWatch = false;
|
||||
that.$API.wpm.batchlog.dag.req({batch:row.batch,version:row.version}).then((res) => {
|
||||
that.$API.wpm.batchlog.dag.req({batch:row.batch,method:'direct'}).then((res) => {
|
||||
res.nodes.forEach(item => {
|
||||
let obj = {};
|
||||
obj.id = item.id;
|
||||
|
|
@ -388,6 +400,7 @@ export default {
|
|||
nodeClick(data){
|
||||
let that = this;
|
||||
that.params.cbatch = data;
|
||||
that.params_mlog.cbatch = data;
|
||||
that.params2.batch = data;
|
||||
that.params_mio.item_mio__batch=data;
|
||||
that.activeName = 'mlog';
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@
|
|||
show-summary
|
||||
|
||||
>
|
||||
<el-table-column label="批次号" class-name="colorheader1" prop="batch" min-width="240" fixed="left">
|
||||
<el-table-column label="批次号" prop="batch" min-width="240" fixed="left">
|
||||
<template #default="scope"><span>{{ scope.row.data.批次号 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="尺寸检验" align="center" class-name="colorheader1">
|
||||
|
|
@ -299,18 +299,18 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="外观总合格数" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data.外观检验_完全总合格数">{{ scope.row.data.外观检验_完全总合格数 }}</span>
|
||||
<span v-else>0</span>
|
||||
<span v-if="scope.row.data.外观检验_完全总合格数==0&&scope.row.data.外观检验_count_ok_full">{{ scope.row.data.外观检验_count_ok_full }}</span>
|
||||
<span v-else>{{ scope.row.data.外观检验_完全总合格数 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="外观总合格率(%)" class-name="colorheader4">
|
||||
<el-table-column label="外观总合格率(%)" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data.外观检验_完全总合格率">{{ scope.row.data.外观检验_完全总合格率 }}</span>
|
||||
<span v-else-if="scope.row.data.外观检验_完全合格率">{{ scope.row.data.外观检验_完全合格率 }}</span>
|
||||
<span v-else>0</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="直通良率(%)" class-name="colorheader4">
|
||||
<el-table-column label="直通良率(%)" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data.外观检验_完全直通合格率">{{ scope.row.data.外观检验_完全直通合格率 }}</span>
|
||||
<span v-else-if="scope.row.data.尺寸检验_合格率">{{ scope.row.data.尺寸检验_合格率 }}</span>
|
||||
|
|
@ -606,14 +606,24 @@ export default {
|
|||
sums[index] = ((sums[index-1]/sums[25])*100).toFixed(4);
|
||||
}
|
||||
}
|
||||
if(index==71){
|
||||
let sum = 0;
|
||||
if(sums[26]){
|
||||
sum += sums[26];
|
||||
}
|
||||
if(sums[55]){
|
||||
sum += sums[55];
|
||||
}
|
||||
sums[index] = sum;
|
||||
}
|
||||
if(index==72){
|
||||
if(sums[71]&&sums[25]){
|
||||
sums[index] = ((sums[71]/sums[25])*100).toFixed(4);
|
||||
sums[index] = ((sums[71]/sums[25])*100).toFixed(2);
|
||||
}
|
||||
}
|
||||
if(index==73){
|
||||
if(sums[72]&&sums[22]){
|
||||
sums[index] = ((sums[72]/sums[22])*100).toFixed(4);
|
||||
sums[index] = ((sums[72]*sums[22])/100).toFixed(2);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,551 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="right-panel">
|
||||
<el-input v-model="query.batch"
|
||||
placeholder="批次号"
|
||||
clearable
|
||||
style="width: 200px;"
|
||||
></el-input>
|
||||
<el-date-picker
|
||||
v-model="query.cc_data_start"
|
||||
type="date"
|
||||
placeholder="尺寸检验开始日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
clearable
|
||||
style="width: 160px; margin: 5px"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="query.cc_data_end"
|
||||
type="date"
|
||||
placeholder="尺寸检验结束日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
clearable
|
||||
style="width: 160px; margin:0"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="query.wg_data_start"
|
||||
type="date"
|
||||
placeholder="外观检验开始日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
clearable
|
||||
style="width: 160px; margin: 5px"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="query.wg_data_end"
|
||||
type="date"
|
||||
placeholder="外观检验结束日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
clearable
|
||||
style="width: 160px; margin:0"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="query.fx_data_start"
|
||||
type="date"
|
||||
placeholder="返修开始日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
clearable
|
||||
style="width: 160px; margin: 5px"
|
||||
></el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="query.fx_data_end"
|
||||
type="date"
|
||||
placeholder="返修结束日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
clearable
|
||||
style="width: 160px; margin:0"
|
||||
></el-date-picker>
|
||||
<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">
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
id="exportDiv"
|
||||
stripe
|
||||
style="height: 100%;"
|
||||
:summary-method="getSummaries"
|
||||
show-summary
|
||||
|
||||
>
|
||||
<el-table-column label="批次号" prop="batch" min-width="240" fixed="left">
|
||||
<template #default="scope"><span>{{ scope.row.data.批次号 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="尺寸检验" align="center" class-name="colorheader1">
|
||||
<el-table-column label="日期" class-name="colorheader1" width="90">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_日期 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检验数" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_count_real }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="黑圈内径" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_黑圈内径 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="比例(%)" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_黑圈内径_比例 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="黑圈外径" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_黑圈外径 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="比例(%)" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_黑圈外径_比例 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品同心度" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_产品同心度 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="比例(%)" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_产品同心度_比例 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="圆度" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_圆度 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="比例(%)" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_圆度_比例 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品外径小" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_产品外径小 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品外径大(返修)" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data['尺寸检验_缺陷_产品外径大(返修)'] }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="黑圈缺口" class-name="colorheader1">
|
||||
<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>
|
||||
</el-table-column>
|
||||
<el-table-column label="前道崩" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_缺陷_前道崩 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_count_ok_full }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率(%)" class-name="colorheader1">
|
||||
<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['尺寸检验_缺陷_准合格(B)'] }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="圆度准合格" class-name="colorheader1">
|
||||
<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.尺寸检验_count_ok }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总合格率(%)" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.尺寸检验_合格率 }}</span></template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="外观检验" align="center" class-name="colorheader2">
|
||||
<el-table-column label="日期" class-name="colorheader2" width="90">
|
||||
<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.外观检验_count_real }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data.外观检验_count_ok_full }}</span></template>
|
||||
</el-table-column>
|
||||
<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['外观检验_缺陷_划麻(返修)'] }}</span></template>
|
||||
</el-table-column>
|
||||
<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['外观检验_缺陷_脏(返修) ']}}</span></template>
|
||||
</el-table-column>
|
||||
<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.外观检验_缺陷_气泡 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="比例(%)" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data.外观检验_缺陷_气泡_比例 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="浅气泡(B)" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data['外观检验_缺陷_浅气泡(B)'] }}</span></template>
|
||||
</el-table-column>
|
||||
<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.外观检验_缺陷_黑圈缺口 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="重水纹" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data.外观检验_缺陷_重水纹 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="浅水纹(B)" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data['外观检验_缺陷_浅水纹(B)'] }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="大崩" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data.外观检验_缺陷_大崩 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小崩边(B)" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data['外观检验_缺陷_小崩边(B)'] }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="比例(%)" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data['外观检验_缺陷_小崩边(B)_比例'] }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="棕点" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data.外观检验_缺陷_棕点 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="浅划麻(B)" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data['外观检验_缺陷_浅划麻(B)'] }}</span></template>
|
||||
</el-table-column>
|
||||
<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.外观检验_缺陷_倒角 }}</span></template>
|
||||
</el-table-column>
|
||||
<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.外观检验_缺陷_蓝圈 }}</span></template>
|
||||
</el-table-column>
|
||||
<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.外观检验_缺陷_破损 }}</span></template>
|
||||
</el-table-column>
|
||||
<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.外观检验_缺陷_漏光 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="返修数" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data.外观检验_返修_count_real }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data.外观检验_返修_count_ok_full }}</span></template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="外观总合格数" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data.外观检验_完全总合格数==0&&scope.row.data.外观检验_count_ok_full">{{ scope.row.data.外观检验_count_ok_full }}</span>
|
||||
<span v-else>{{ scope.row.data.外观检验_完全总合格数 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="外观总合格率(%)" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data.外观检验_完全总合格率">{{ scope.row.data.外观检验_完全总合格率 }}</span>
|
||||
<span v-else-if="scope.row.data.外观检验_完全合格率">{{ scope.row.data.外观检验_完全合格率 }}</span>
|
||||
<span v-else>0</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="直通良率(%)" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data.外观检验_完全直通合格率">{{ scope.row.data.外观检验_完全直通合格率 }}</span>
|
||||
<span v-else-if="scope.row.data.尺寸检验_合格率">{{ scope.row.data.尺寸检验_合格率 }}</span>
|
||||
<span v-else-if="scope.row.data.外观检验_完全总合格率">{{ scope.row.data.外观检验_完全总合格率 }}</span>
|
||||
<span v-else>0</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-pagination
|
||||
background
|
||||
:small="true"
|
||||
:total="dataTotal"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:page-size="params.page_size"
|
||||
:page-sizes="[20, 50, 100, 200]"
|
||||
:current-page="params.page"
|
||||
@current-change="getList"
|
||||
@update:page-size="getList2"
|
||||
></el-pagination>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "chart",
|
||||
data() {
|
||||
return {
|
||||
query:{
|
||||
batch:'',
|
||||
cc_data_start:'',
|
||||
cc_data_end:'',
|
||||
wg_data_start:'',
|
||||
wg_data_end:'',
|
||||
fx_data_start:'',
|
||||
fx_data_end:'',
|
||||
},
|
||||
params: {
|
||||
page:1,
|
||||
page_size:20,
|
||||
ordering:"-last_time",
|
||||
querys:[
|
||||
[{field:"data__has_key",compare:"",value:"尺寸检验_日期"}],
|
||||
[{field:"data__has_key",compare:"",value:"外观检验_日期"}],
|
||||
[{field:"data__has_key",compare:"",value:"外观检验_返修_日期"}]
|
||||
],
|
||||
},
|
||||
apiObj: this.$API.wpm.batchst,
|
||||
dataTotal:0,
|
||||
options:[],
|
||||
tableData:[],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
that.getList();
|
||||
},
|
||||
methods: {
|
||||
getList(val){
|
||||
let that = this;
|
||||
that.params.page = val?val:1;
|
||||
that.$API.wpm.batchstquery.req(that.params).then((res) => {
|
||||
if (res.count > 0) {
|
||||
that.tableData = res.results;
|
||||
that.dataTotal = res.count;
|
||||
}else{
|
||||
that.tableData = [];
|
||||
that.dataTotal = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
getList2(val){
|
||||
let that = this;
|
||||
that.params.page = 1;
|
||||
that.params.page_size = val;
|
||||
that.params.querys=[
|
||||
[{field:"data__has_key",compare:"",value:"尺寸检验_日期"}],
|
||||
[{field:"data__has_key",compare:"",value:"外观检验_日期"}],
|
||||
[{field:"data__has_key",compare:"",value:"外观检验_返修_日期"}]
|
||||
];
|
||||
that.getList(1);
|
||||
},
|
||||
handleQuery(){
|
||||
let that = this;
|
||||
that.params.page = 1;
|
||||
that.params.querys=[];
|
||||
let arr1 = [{field:"data__has_key",compare:"",value:"尺寸检验_日期"}],
|
||||
arr2 = [{field:"data__has_key",compare:"",value:"外观检验_日期"}],
|
||||
arr3 = [{field:"data__has_key",compare:"",value:"外观检验_返修_日期"}];
|
||||
for(let key in that.query){
|
||||
if(that.query[key] != ""&&that.query[key] != null&&that.query[key] != undefined){
|
||||
let obj = {};
|
||||
obj.value = that.query[key];
|
||||
if(key=='batch'){
|
||||
obj.field = "batch";
|
||||
obj.compare = "contains";
|
||||
arr1.push(obj);
|
||||
arr2.push(obj);
|
||||
arr3.push(obj);
|
||||
}else if(key=='cc_data_start'){
|
||||
obj.compare = "gte";
|
||||
obj.field = "data__尺寸检验_日期";
|
||||
arr1.push(obj);
|
||||
}else if(key=='cc_data_end'){
|
||||
obj.compare = "lte";
|
||||
obj.field = "data__尺寸检验_日期";
|
||||
arr1.push(obj);
|
||||
}else if(key=='wg_data_start'){
|
||||
obj.compare = "gte";
|
||||
obj.field = "data__外观检验_日期";
|
||||
arr2.push(obj);
|
||||
}else if(key=='wg_data_end'){
|
||||
obj.compare = "lte";
|
||||
obj.field = "data__外观检验_日期";
|
||||
arr2.push(obj);
|
||||
}else if(key=='fx_data_start'){
|
||||
obj.compare = "gte";
|
||||
obj.field = "data__返修_日期";
|
||||
arr3.push(obj);
|
||||
}else if(key=='fx_data_end'){
|
||||
obj.compare = "lte";
|
||||
obj.field = "data__返修_日期";
|
||||
arr3.push(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
if((that.query.cc_data_start != ""&&that.query.cc_data_start != null)||(that.query.cc_data_end != ""&&that.query.cc_data_end != null)){
|
||||
that.params.querys.push(arr1);
|
||||
}
|
||||
if((that.query.wg_data_start != ""&&that.query.wg_data_start != null)||(that.query.wg_data_end != ""&&that.query.wg_data_end != null)){
|
||||
that.params.querys.push(arr2);
|
||||
}
|
||||
if((that.query.fx_data_start != ""&&that.query.fx_data_start != null)||(that.query.fx_data_end != ""&&that.query.fx_data_end != null)){
|
||||
that.params.querys.push(arr3);
|
||||
}
|
||||
if((that.query.cc_data_start == ""||that.query.cc_data_start == null)&&(that.query.cc_data_end == ""||that.query.cc_data_end== null)&&
|
||||
(that.query.wg_data_start == ""||that.query.wg_data_start == null)&&(that.query.wg_data_end == ""||that.query.wg_data_end == null)&&
|
||||
(that.query.fx_data_start == ""||that.query.fx_data_start == null)&&(that.query.fx_data_end == ""||that.query.fx_data_end == null)){
|
||||
that.params.querys.push(arr1,arr2,arr3);
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
getSummaries({ columns, data }) {
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = "合计";
|
||||
return;
|
||||
}
|
||||
let propert = '';
|
||||
//尺寸检验
|
||||
if(index == 2&&column.label=='检验数'){
|
||||
propert = '尺寸检验_count_real';
|
||||
}else if(column.label=='黑圈内径'){
|
||||
propert = '尺寸检验_缺陷_黑圈内径';
|
||||
}else if(column.label=='黑圈外径'){
|
||||
propert = '尺寸检验_缺陷_黑圈外径';
|
||||
}else if(column.label=='产品同心度'){
|
||||
propert = '尺寸检验_缺陷_产品同心度';
|
||||
}else if(column.label=='圆度'){
|
||||
propert = '尺寸检验_缺陷_圆度';
|
||||
}else if(column.label=='产品外径小'){
|
||||
propert = '尺寸检验_缺陷_产品外径小';
|
||||
}else if(column.label=='产品外径大(返修)'){
|
||||
propert = '尺寸检验_缺陷_产品外径大(返修)';
|
||||
}else if(index == 14&&column.label=='黑圈缺口'){
|
||||
propert = '尺寸检验_缺陷_黑圈缺口';
|
||||
}else if(column.label=='外径发货片(B)'){
|
||||
propert = '尺寸检验_缺陷_外径发货片(B)';
|
||||
}else if(column.label=='前道崩'){
|
||||
propert = '尺寸检验_缺陷_前道崩';
|
||||
}else if(index==16&&column.label=='合格数'){
|
||||
propert = '尺寸检验_count_ok_full';
|
||||
}else if(column.label=='准合格(B)'){
|
||||
propert = '尺寸检验_缺陷_准合格(B)';
|
||||
}else if(column.label=='圆度准合格'){
|
||||
propert = '尺寸检验_缺陷_圆准(B)';
|
||||
}else if(column.label=='总合格数'){
|
||||
propert = '尺寸检验_count_ok';
|
||||
}else if(index == 23&&column.label=='检验数'){
|
||||
propert = '外观检验_count_real';
|
||||
}else if(index==24&&column.label=='合格数'){
|
||||
propert = '外观检验_count_ok_full';
|
||||
}else if(index==26&&column.label=='划麻(返修)'){
|
||||
propert = '外观检验_缺陷_划麻(返修)';
|
||||
}else if(index==28&&column.label=='脏(返修)'){
|
||||
propert = '外观检验_缺陷_脏(返修)';
|
||||
}else if(index==30&&column.label=='气泡'){
|
||||
propert = '外观检验_缺陷_气泡';
|
||||
}else if(index==32&&column.label=='浅气泡(B)'){
|
||||
propert = '外观检验_缺陷_浅气泡(B)';
|
||||
}else if(index==33&&column.label=='黑圈变形'){
|
||||
propert = '外观检验_缺陷_黑圈变形';
|
||||
}else if(index==34&&column.label=='黑圈缺口'){
|
||||
propert = '外观检验_缺陷_黑圈缺口';
|
||||
}else if(index==35&&column.label=='重水纹'){
|
||||
propert = '外观检验_缺陷_重水纹';
|
||||
}else if(index==36&&column.label=='浅水纹(B)'){
|
||||
propert = '外观检验_缺陷_浅水纹(B)';
|
||||
}else if(index==37&&column.label=='大崩'){
|
||||
propert = '外观检验_缺陷_大崩';
|
||||
}else if(index==38&&column.label=='小崩边(B)'){
|
||||
propert = '外观检验_缺陷_小崩边(B)';
|
||||
}else if(index==40&&column.label=='棕点'){
|
||||
propert = '外观检验_缺陷_棕点';
|
||||
}else if(index==41&&column.label=='浅划麻(B)'){
|
||||
propert = '外观检验_缺陷_浅划麻(B)';
|
||||
}else if(index==42&&column.label=='双面划麻'){
|
||||
propert = '外观检验_缺陷_双面划麻';
|
||||
}else if(index==43&&column.label=='倒角'){
|
||||
propert = '外观检验_缺陷_倒角';
|
||||
}else if(index==44&&column.label=='棕圈'){
|
||||
propert = '外观检验_缺陷_棕圈';
|
||||
}else if(index==45&&column.label=='蓝圈'){
|
||||
propert = '外观检验_缺陷_蓝圈';
|
||||
}else if(index==46&&column.label=='尺寸小'){
|
||||
propert = '外观检验_缺陷_尺寸小';
|
||||
}else if(index==47&&column.label=='破损'){
|
||||
propert = '外观检验_缺陷_破损';
|
||||
}else if(index==48&&column.label=='发白'){
|
||||
propert = '外观检验_缺陷_发白';
|
||||
}else if(index==49&&column.label=='漏光'){
|
||||
propert = '外观检验_缺陷_漏光';
|
||||
}else if(index == 50&&column.label=='返修数'){
|
||||
propert = '外观检验_返修_count_real';
|
||||
}else if(index==51&&column.label=='合格数'){
|
||||
propert = '外观检验_返修_count_ok_full';
|
||||
}else if(column.label=='外观总合格数'){
|
||||
propert = '外观检验_完全总合格数';
|
||||
}
|
||||
if (propert!=='') {
|
||||
const values = data.map((item) =>
|
||||
Number(item.data[propert])
|
||||
);
|
||||
if (!values.every((value) => Number.isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
let sum = Number(Number(prev) + Number(curr));
|
||||
if (!isNaN(value)) {
|
||||
return sum;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
|
||||
}
|
||||
if(index==4||index==6||index==8||index==10||index==17||index==21){
|
||||
if(sums[index-1]){
|
||||
sums[index] = ((sums[index-1]/sums[2])*100).toFixed(4);
|
||||
}else{
|
||||
sums[index] = null;
|
||||
}
|
||||
}
|
||||
if(index==25||index==27||index==29||index==31||index==39){
|
||||
if(sums[index-1]){
|
||||
sums[index] = ((sums[index-1]/sums[23])*100).toFixed(4);
|
||||
}else{
|
||||
sums[index] = null;
|
||||
}
|
||||
}
|
||||
if(index==52){
|
||||
let sum = 0;
|
||||
if(sums[24]){
|
||||
sum += sums[24];
|
||||
}
|
||||
if(sums[51]){
|
||||
sum += sums[51];
|
||||
}
|
||||
sums[index] = sum;
|
||||
}
|
||||
if(index==53){
|
||||
if(sums[52]&&sums[23]){
|
||||
sums[index] = ((sums[52]/sums[23])*100).toFixed(2);
|
||||
}
|
||||
}
|
||||
if(index==54){
|
||||
if(sums[53]&&sums[21]){
|
||||
sums[index] = ((sums[53]*sums[21])/100).toFixed(2);
|
||||
}
|
||||
}
|
||||
});
|
||||
return sums;
|
||||
},
|
||||
handleExport() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX("#exportDiv", "过程检验统计");
|
||||
this.exportLoading = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
|
@ -54,8 +54,6 @@
|
|||
:data="tableData"
|
||||
:height="tableHeight"
|
||||
id="exportDiv"
|
||||
:summary-method="getSummaries"
|
||||
show-summary
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="工段" prop="工段">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,886 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="right-panel">
|
||||
<el-input v-model="query.batch"
|
||||
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">
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
id="exportDiv"
|
||||
stripe
|
||||
style="height: 100%;"
|
||||
>
|
||||
<el-table-column label="产品编号" prop="batch" min-width="160" fixed="left">
|
||||
</el-table-column>
|
||||
<el-table-column label="扫边A" align="center" class-name="colorheader1">
|
||||
<el-table-column label="1-内置-材料不良" align="center" class-name="colorheader1">
|
||||
<el-table-column label="气泡" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边A_缺陷_气泡 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="线痕" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边A_缺陷_线痕 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="断裂" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边A_缺陷_断裂 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="划伤" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边A_缺陷_划伤 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="2-破损" align="center" class-name="colorheader1">
|
||||
<el-table-column label="人为磕碰" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边A_缺陷_人为磕碰 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备故障" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边A_缺陷_设备故障 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="断点" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边A_缺陷_断点 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="调机破损" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边A_缺陷_调机破损 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="3-加工后崩边" align="center" class-name="colorheader1">
|
||||
<el-table-column label="大崩" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.扫边A_缺陷_崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小崩边" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.扫边A_缺陷_小崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'扫边A') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="扫边B" align="center" class-name="colorheader2">
|
||||
<el-table-column label="1-加工前不良" align="center" class-name="colorheader2">
|
||||
<el-table-column label="裂纹" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边B_加工前_缺陷_裂纹 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="断裂" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边B_加工前_缺陷_断裂 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="划伤" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边B_加工前_缺陷_划伤 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="抛光未磨透(线痕)" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边B_加工前_缺陷_线痕 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="麻点" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边B_加工前_缺陷_麻点 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'扫边B前') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="2-内置" align="center" class-name="colorheader2">
|
||||
<el-table-column label="黑圈不良" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边B_缺陷_黑圈不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料不良" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边B_缺陷_材料不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="3-破损" align="center" class-name="colorheader2">
|
||||
<el-table-column label="人为磕碰" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边B_缺陷_人为磕碰 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备故障" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边B_缺陷_设备故障 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="脏污" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边B_缺陷_脏污 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="抛光未磨透" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边B_缺陷_线痕 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="调机破损" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边B_缺陷_调机破损 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="断裂" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.扫边B_缺陷_断裂 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="4-加工后崩边" align="center" class-name="colorheader2">
|
||||
<el-table-column label="大崩" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data.扫边B_缺陷_崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小崩边" class-name="colorheader2">
|
||||
<template #default="scope"><span>{{ scope.row.data.扫边B_缺陷_小崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'扫边B') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="精雕" align="center" class-name="colorheader3">
|
||||
<el-table-column label="1-加工前不良" align="center" class-name="colorheader3">
|
||||
<el-table-column label="大崩" class-name="colorheader3">
|
||||
<template #default="scope"><span>{{ scope.row.data.精雕_加工前_缺陷_崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小崩边" class-name="colorheader3">
|
||||
<template #default="scope"><span>{{ scope.row.data.精雕_加工前_缺陷_小崩边}}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'精雕前') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="2-内置" align="center" class-name="colorheader3">
|
||||
<el-table-column label="黑圈不良" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.精雕_缺陷_黑圈不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料不良" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.精雕_缺陷_材料不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="3-破损" align="center" class-name="colorheader3">
|
||||
<el-table-column label="调机破损" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.精雕_缺陷_调机破损 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="人为磕碰" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.精雕_缺陷_人为磕碰 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="4-其他" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'精雕') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="倒角" align="center" class-name="colorheader4">
|
||||
<el-table-column label="1-加工前不良" align="center" class-name="colorheader4">
|
||||
<el-table-column label="大崩" class-name="colorheader4">
|
||||
<template #default="scope"><span>{{ scope.row.data.倒角_加工前_缺陷_崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小崩边" class-name="colorheader4">
|
||||
<template #default="scope"><span>{{ scope.row.data.倒角_加工前_缺陷_崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'倒角前') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="2-内置" align="center" class-name="colorheader4">
|
||||
<el-table-column label="黑圈不良" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.倒角_缺陷_黑圈不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料不良" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.倒角_缺陷_材料不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="3-破损" align="center" class-name="colorheader4">
|
||||
<el-table-column label="调机破损" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.倒角_缺陷_调机破损 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="人为磕碰" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.倒角_缺陷_人为磕碰 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="3-加工后崩边" align="center" class-name="colorheader4">
|
||||
<el-table-column label="大崩" class-name="colorheader4">
|
||||
<template #default="scope"><span>{{ scope.row.data.倒角_缺陷_崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小崩边" class-name="colorheader4">
|
||||
<template #default="scope"><span>{{ scope.row.data.倒角_缺陷_小崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="4-其他" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'倒角') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="减薄A" align="center" class-name="colorheader5">
|
||||
<el-table-column label="1-内置" align="center" class-name="colorheader5">
|
||||
<el-table-column label="黑圈不良" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.减薄A_缺陷_黑圈不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料不良" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.减薄A_缺陷_材料不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="黑雾" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.减薄A_缺陷_黑雾 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="2-破损" align="center" class-name="colorheader5">
|
||||
<el-table-column label="调机破损" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.减薄A_缺陷_调机破损 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="人为磕碰" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.减薄A_缺陷_人为磕碰 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="2-加工后崩边" align="center" class-name="colorheader5">
|
||||
<el-table-column label="大崩" class-name="colorheader5">
|
||||
<template #default="scope"><span>{{ scope.row.data.减薄A_缺陷_崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小崩边" class-name="colorheader5">
|
||||
<template #default="scope"><span>{{ scope.row.data.减薄A_缺陷_小崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="3-其他" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'减薄A') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="减薄B" align="center" class-name="colorheader6">
|
||||
<el-table-column label="1-内置" align="center" class-name="colorheader6">
|
||||
<el-table-column label="黑圈不良" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.减薄B_缺陷_黑圈不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料不良" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.减薄B_缺陷_材料不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="黑雾" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.减薄B_缺陷_黑雾 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="2-破损" align="center" class-name="colorheader6">
|
||||
<el-table-column label="调机破损" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.减薄B_缺陷_调机破损 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="人为" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.减薄B_缺陷_人为磕碰磕碰 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="2-加工后崩边" align="center" class-name="colorheader6">
|
||||
<el-table-column label="大崩" class-name="colorheader6">
|
||||
<template #default="scope"><span>{{ scope.row.data.减薄B_缺陷_崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小崩边" class-name="colorheader6">
|
||||
<template #default="scope"><span>{{ scope.row.data.减薄B_缺陷_小崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="3-其他" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'减薄B') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="磨抛" align="center" class-name="colorheader7">
|
||||
<el-table-column label="1-加工前不良" align="center" class-name="colorheader7">
|
||||
<el-table-column label="大崩" class-name="colorheader7">
|
||||
<template #default="scope"><span>{{ scope.row.data.磨抛_缺陷_崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小崩边" class-name="colorheader7">
|
||||
<template #default="scope"><span>{{ scope.row.data.磨抛_缺陷_小崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader7">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'磨抛前') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="2-内置" align="center" class-name="colorheader7">
|
||||
<el-table-column label="黑圈不良" class-name="colorheader7">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.磨抛_缺陷_黑圈不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料不良" class-name="colorheader7">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.磨抛_缺陷_材料不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="3-破损" align="center" class-name="colorheader7">
|
||||
<el-table-column label="调机破损" class-name="colorheader7">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.磨抛_缺陷_调机破损 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="人为磕碰" class-name="colorheader7">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.磨抛_缺陷_人为磕碰 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="4-其他" class-name="colorheader7">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'磨抛') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="一次超洗" align="center" class-name="colorheader1">
|
||||
<el-table-column label="1-加工前不良" align="center" class-name="colorheader1">
|
||||
<el-table-column label="大崩" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.一次超洗_加工前_缺陷_崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小崩边" class-name="colorheader1">
|
||||
<template #default="scope"><span>{{ scope.row.data.一次超洗_加工前_缺陷_小崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'一次超洗前') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="2-内置" align="center" class-name="colorheader1">
|
||||
<el-table-column label="黑圈不良" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.一次超洗_缺陷_黑圈不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料不良" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.一次超洗_缺陷_材料不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="3-破损" align="center" class-name="colorheader1">
|
||||
<el-table-column label="调机破损" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.一次超洗_缺陷_调机破损 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="人为磕碰" class-name="colorheader1">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.一次超洗_缺陷_人为磕碰 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="二次超洗" align="center" class-name="colorheader2">
|
||||
<el-table-column label="1-加工前不良" 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.二次超洗_加工前_缺陷_小崩边 }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'二次超洗前') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="2-内置" align="center" class-name="colorheader2">
|
||||
<el-table-column label="黑圈不良" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.二次超洗_缺陷_黑圈不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料不良" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.二次超洗_缺陷_材料不良 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="3-破损" align="center" class-name="colorheader2">
|
||||
<el-table-column label="调机破损" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.二次超洗_缺陷_调机破损 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="人为磕碰" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.二次超洗_缺陷_人为磕碰 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-pagination
|
||||
background
|
||||
:small="true"
|
||||
:total="dataTotal"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:page-size="params.page_size"
|
||||
:page-sizes="[20, 50, 100, 200]"
|
||||
:current-page="params.page"
|
||||
@current-change="getList"
|
||||
@update:page-size="getList2"
|
||||
></el-pagination>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
function deepCopy(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
export default {
|
||||
name: "chart",
|
||||
data() {
|
||||
return {
|
||||
dataTotal: 0,
|
||||
params: {
|
||||
page:1,
|
||||
page_size:20,
|
||||
ordering:"-last_time",
|
||||
querys:[],
|
||||
},
|
||||
querys:[
|
||||
[{field:"data__has_key",compare:"",value:"扫边A_日期"}],
|
||||
[{field:"data__has_key",compare:"",value:"扫边B_日期"}],
|
||||
[{field:"data__has_key",compare:"",value:"精雕_日期"}],
|
||||
[{field:"data__has_key",compare:"",value:"倒角_日期"}],
|
||||
[{field:"data__has_key",compare:"",value:"减薄A_日期"}],
|
||||
[{field:"data__has_key",compare:"",value:"减薄B_日期"}],
|
||||
[{field:"data__has_key",compare:"",value:"磨抛_日期"}],
|
||||
[{field:"data__has_key",compare:"",value:"一次超洗_日期"}],
|
||||
[{field:"data__has_key",compare:"",value:"二次超洗_日期"}],
|
||||
],
|
||||
query:{
|
||||
batch:'',
|
||||
},
|
||||
tableData:[],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
that.getList();
|
||||
},
|
||||
methods: {
|
||||
getList(val){
|
||||
let that = this;
|
||||
that.params.page = val?val:1;
|
||||
that.params.querys = that.querys;
|
||||
that.$API.wpm.batchstquery.req(that.params).then((res) => {
|
||||
if (res.count > 0) {
|
||||
that.tableData = res.results;
|
||||
that.dataTotal = res.count;
|
||||
}else{
|
||||
that.tableData = [];
|
||||
that.dataTotal = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
getList2(val){
|
||||
let that = this;
|
||||
that.params.page = 1;
|
||||
that.params.page_size = val;
|
||||
that.getList(1);
|
||||
},
|
||||
handleQuery(){
|
||||
let that = this;
|
||||
that.params.page = 1;
|
||||
that.params.querys = [];
|
||||
if(that.query.batch!==''&&that.query.batch!==null){
|
||||
console.log('that.query.batch',that.query.batch);
|
||||
let obj = {};
|
||||
obj.field = "batch__contains";
|
||||
obj.compare = "";//contains
|
||||
obj.value = that.query.batch;
|
||||
that.querys.forEach((item)=>{
|
||||
let arr = item;
|
||||
arr.push(obj);
|
||||
that.params.querys.push(arr);
|
||||
});
|
||||
}else{
|
||||
that.params.querys = that.querys;
|
||||
}
|
||||
this.getList();
|
||||
|
||||
},
|
||||
getCountQt(data,type){
|
||||
let count_qt = 0,count = 0;
|
||||
if(type=='扫边A'){
|
||||
if(data.扫边A_count_notok){
|
||||
if (data.扫边A_缺陷_气泡 !== undefined) {
|
||||
count += data.扫边A_缺陷_气泡 ;
|
||||
}
|
||||
if (data.扫边A_缺陷_线痕 !== undefined) {
|
||||
count += data.扫边A_缺陷_线痕 ;
|
||||
}
|
||||
if (data.扫边A_缺陷_断裂 !== undefined) {
|
||||
count += data.扫边A_缺陷_断裂 ;
|
||||
}
|
||||
if (data.扫边A_缺陷_划伤 !== undefined) {
|
||||
count += data.扫边A_缺陷_划伤 ;
|
||||
}
|
||||
if (data.扫边A_缺陷_人为磕碰 !== undefined) {
|
||||
count += data.扫边A_缺陷_人为磕碰 ;
|
||||
}
|
||||
if (data.扫边A_缺陷_设备故障 !== undefined) {
|
||||
count += data.扫边A_缺陷_设备故障 ;
|
||||
}
|
||||
if (data.扫边A_缺陷_断点 !== undefined) {
|
||||
count += data.扫边A_缺陷_断点 ;
|
||||
}
|
||||
if (data.扫边A_缺陷_调机破损 !== undefined) {
|
||||
count += data.扫边A_缺陷_调机破损 ;
|
||||
}
|
||||
if (data.扫边A_缺陷_崩边 !== undefined) {
|
||||
count += data.扫边A_缺陷_崩边 ;
|
||||
}
|
||||
if (data.扫边A_缺陷_小崩边 !== undefined) {
|
||||
count += data.扫边A_缺陷_小崩边 ;
|
||||
}
|
||||
count_qt = data.扫边A_count_notok - count;
|
||||
return count_qt;
|
||||
}
|
||||
}else if(type=='扫边B前'){
|
||||
if(data.扫边B_count_pn_jgqbl){
|
||||
if (data.扫边B_加工前_缺陷_裂纹 !== undefined) {
|
||||
count += data.扫边B_加工前_缺陷_裂纹 ;
|
||||
}
|
||||
if (data.扫边B_加工前_缺陷_断裂 !== undefined) {
|
||||
count += data.扫边B_加工前_缺陷_断裂 ;
|
||||
}
|
||||
if (data.扫边B_加工前_缺陷_划伤 !== undefined) {
|
||||
count += data.扫边B_加工前_缺陷_划伤 ;
|
||||
}
|
||||
if (data.扫边B_加工前_缺陷_线痕 !== undefined) {
|
||||
count += data.扫边B_加工前_缺陷_线痕 ;
|
||||
}
|
||||
if (data.扫边B_加工前_缺陷_麻点 !== undefined) {
|
||||
count += data.扫边B_加工前_缺陷_麻点 ;
|
||||
}
|
||||
count_qt = data.扫边B_count_pn_jgqbl - count;
|
||||
return count_qt;
|
||||
}
|
||||
}else if(type=='扫边B'){
|
||||
if(data.扫边B_count_notok){
|
||||
if (data.扫边B_缺陷_黑圈不良 !== undefined) {
|
||||
count += data.扫边B_缺陷_黑圈不良 ;
|
||||
}
|
||||
if (data.扫边B_缺陷_材料不良 !== undefined) {
|
||||
count += data.扫边B_缺陷_材料不良 ;
|
||||
}
|
||||
if (data.扫边B_缺陷_人为磕碰 !== undefined) {
|
||||
count += data.扫边B_缺陷_人为磕碰 ;
|
||||
}
|
||||
if (data.扫边B_缺陷_设备故障 !== undefined) {
|
||||
count += data.扫边B_缺陷_设备故障 ;
|
||||
}
|
||||
if (data.扫边B_缺陷_脏污 !== undefined) {
|
||||
count += data.扫边B_缺陷_脏污 ;
|
||||
}
|
||||
if (data.扫边B_缺陷_线痕 !== undefined) {
|
||||
count += data.扫边B_缺陷_线痕 ;
|
||||
}
|
||||
if (data.扫边B_缺陷_调机破损 !== undefined) {
|
||||
count += data.扫边B_缺陷_调机破损 ;
|
||||
}
|
||||
if (data.扫边B_缺陷_断裂 !== undefined) {
|
||||
count += data.扫边B_缺陷_断裂 ;
|
||||
}
|
||||
if (data.扫边B_缺陷_崩边 !== undefined) {
|
||||
count += data.扫边B_缺陷_崩边 ;
|
||||
}
|
||||
if (data.扫边B_缺陷_小崩边 !== undefined) {
|
||||
count += data.扫边B_缺陷_小崩边 ;
|
||||
}
|
||||
count_qt = data.扫边B_count_notok - count;
|
||||
return count_qt;
|
||||
}
|
||||
}else if(type=='精雕前'){
|
||||
if(data.精雕_count_pn_jgqbl){
|
||||
if (data.精雕_加工前_缺陷_崩边 !== undefined) {
|
||||
count += data.精雕_加工前_缺陷_崩边 ;
|
||||
}
|
||||
if (data.精雕_加工前_缺陷_小崩边 !== undefined) {
|
||||
count += data.精雕_加工前_缺陷_小崩边 ;
|
||||
}
|
||||
count_qt = data.扫边B_count_pn_jgqbl - count;
|
||||
return count_qt;
|
||||
}
|
||||
}else if(type=='精雕'){
|
||||
if(data.精雕_count_notok){
|
||||
if (data.精雕_缺陷_黑圈不良 !== undefined) {
|
||||
count += data.精雕_缺陷_黑圈不良 ;
|
||||
}
|
||||
if (data.精雕_缺陷_材料不良 !== undefined) {
|
||||
count += data.精雕_缺陷_材料不良 ;
|
||||
}
|
||||
if (data.精雕_缺陷_调机破损 !== undefined) {
|
||||
count += data.精雕_缺陷_调机破损 ;
|
||||
}
|
||||
if (data.精雕_缺陷_人为磕碰 !== undefined) {
|
||||
count += data.精雕_缺陷_人为磕碰 ;
|
||||
}
|
||||
count_qt = data.精雕_count_notok - count;
|
||||
return count_qt;
|
||||
}
|
||||
}else if(type=='倒角前'){
|
||||
if(data.倒角_count_pn_jgqbl){
|
||||
if (data.倒角_加工前_缺陷_崩边 !== undefined) {
|
||||
count += data.倒角_加工前_缺陷_崩边 ;
|
||||
}
|
||||
if (data.倒角_加工前_缺陷_小崩边 !== undefined) {
|
||||
count += data.倒角_加工前_缺陷_小崩边 ;
|
||||
}
|
||||
count_qt = data.倒角_count_pn_jgqbl - count;
|
||||
return count_qt;
|
||||
}
|
||||
}else if(type=='倒角'){
|
||||
if(data.倒角_count_notok){
|
||||
if (data.倒角_缺陷_黑圈不良 !== undefined) {
|
||||
count += data.倒角_缺陷_黑圈不良 ;
|
||||
}
|
||||
if (data.倒角_缺陷_材料不良 !== undefined) {
|
||||
count += data.倒角_缺陷_材料不良 ;
|
||||
}
|
||||
if (data.倒角_缺陷_调机破损 !== undefined) {
|
||||
count += data.倒角_缺陷_调机破损 ;
|
||||
}
|
||||
if (data.倒角_缺陷_人为磕碰 !== undefined) {
|
||||
count += data.倒角_缺陷_人为磕碰 ;
|
||||
}
|
||||
if (data.倒角_缺陷_崩边 !== undefined) {
|
||||
count += data.倒角_缺陷_崩边 ;
|
||||
}
|
||||
if (data.倒角_缺陷_小崩边 !== undefined) {
|
||||
count += data.倒角_缺陷_小崩边 ;
|
||||
}
|
||||
count_qt = data.倒角_count_notok - count;
|
||||
return count_qt;
|
||||
}
|
||||
}else if(type=='减薄A'){
|
||||
if(data.减薄A_count_notok){
|
||||
if (data.减薄A_缺陷_黑圈不良 !== undefined) {
|
||||
count += data.减薄A_缺陷_黑圈不良 ;
|
||||
}
|
||||
if (data.减薄A_缺陷_材料不良 !== undefined) {
|
||||
count += data.减薄A_缺陷_材料不良 ;
|
||||
}
|
||||
if (data.减薄A_缺陷_黑雾 !== undefined) {
|
||||
count += data.减薄A_缺陷_黑雾 ;
|
||||
}
|
||||
if (data.减薄A_缺陷_调机破损 !== undefined) {
|
||||
count += data.减薄A_缺陷_调机破损 ;
|
||||
}
|
||||
if (data.减薄A_缺陷_人为磕碰 !== undefined) {
|
||||
count += data.减薄A_缺陷_人为磕碰 ;
|
||||
}
|
||||
if (data.减薄A_缺陷_崩边 !== undefined) {
|
||||
count += data.减薄A_缺陷_崩边 ;
|
||||
}
|
||||
if (data.减薄A_缺陷_小崩边 !== undefined) {
|
||||
count += data.减薄A_缺陷_小崩边 ;
|
||||
}
|
||||
count_qt = data.减薄A_count_notok - count;
|
||||
return count_qt;
|
||||
}
|
||||
}else if(type=='减薄B'){
|
||||
if(data.减薄B_count_notok){
|
||||
if (data.减薄B_缺陷_黑圈不良 !== undefined) {
|
||||
count += data.减薄B_缺陷_黑圈不良 ;
|
||||
}
|
||||
if (data.减薄B_缺陷_材料不良 !== undefined) {
|
||||
count += data.减薄B_缺陷_材料不良 ;
|
||||
}
|
||||
if (data.减薄B_缺陷_黑雾 !== undefined) {
|
||||
count += data.减薄B_缺陷_黑雾 ;
|
||||
}
|
||||
if (data.减薄B_缺陷_调机破损 !== undefined) {
|
||||
count += data.减薄B_缺陷_调机破损 ;
|
||||
}
|
||||
if (data.减薄B_缺陷_人为磕碰 !== undefined) {
|
||||
count += data.减薄B_缺陷_人为磕碰 ;
|
||||
}
|
||||
if (data.减薄B_缺陷_崩边 !== undefined) {
|
||||
count += data.减薄B_缺陷_崩边 ;
|
||||
}
|
||||
if (data.减薄B_缺陷_小崩边 !== undefined) {
|
||||
count += data.减薄B_缺陷_小崩边 ;
|
||||
}
|
||||
count_qt = data.减薄B_count_notok - count;
|
||||
return count_qt;
|
||||
}
|
||||
}else if(type=='磨抛前'){
|
||||
if(data.磨抛_count_pn_jgqbl){
|
||||
if (data.磨抛_加工前_缺陷_崩边 !== undefined) {
|
||||
count += data.磨抛_加工前_缺陷_崩边 ;
|
||||
}
|
||||
if (data.磨抛_加工前_缺陷_小崩边 !== undefined) {
|
||||
count += data.磨抛_加工前_缺陷_小崩边 ;
|
||||
}
|
||||
count_qt = data.磨抛_count_pn_jgqbl - count;
|
||||
return count_qt;
|
||||
}
|
||||
}else if(type=='磨抛'){
|
||||
if(data.磨抛_count_notok){
|
||||
if (data.磨抛_缺陷_黑圈不良 !== undefined) {
|
||||
count += data.磨抛_缺陷_黑圈不良 ;
|
||||
}
|
||||
if (data.磨抛_缺陷_材料不良 !== undefined) {
|
||||
count += data.磨抛_缺陷_材料不良 ;
|
||||
}
|
||||
if (data.磨抛_缺陷_调机破损 !== undefined) {
|
||||
count += data.磨抛_缺陷_调机破损 ;
|
||||
}
|
||||
if (data.磨抛_缺陷_人为磕碰 !== undefined) {
|
||||
count += data.磨抛_缺陷_人为磕碰 ;
|
||||
}
|
||||
count_qt = data.磨抛_count_notok - count;
|
||||
return count_qt;
|
||||
}
|
||||
}
|
||||
else if(type=='一次超洗前'){
|
||||
if(data.一次超洗_count_pn_jgqbl){
|
||||
if (data.一次超洗_加工前_缺陷_崩边 !== undefined) {
|
||||
count += data.一次超洗_加工前_缺陷_崩边 ;
|
||||
}
|
||||
if (data.一次超洗_加工前_缺陷_小崩边 !== undefined) {
|
||||
count += data.一次超洗_加工前_缺陷_小崩边 ;
|
||||
}
|
||||
count_qt = data.一次超洗_count_pn_jgqbl - count;
|
||||
return count_qt;
|
||||
}
|
||||
}else if(type=='一次超洗'){
|
||||
if(data.一次超洗_count_notok){
|
||||
if (data.一次超洗_缺陷_黑圈不良 !== undefined) {
|
||||
count += data.一次超洗_缺陷_黑圈不良 ;
|
||||
}
|
||||
if (data.一次超洗_缺陷_材料不良 !== undefined) {
|
||||
count += data.一次超洗_缺陷_材料不良 ;
|
||||
}
|
||||
if (data.一次超洗_缺陷_调机破损 !== undefined) {
|
||||
count += data.一次超洗_缺陷_调机破损 ;
|
||||
}
|
||||
if (data.一次超洗_缺陷_人为磕碰 !== undefined) {
|
||||
count += data.一次超洗_缺陷_人为磕碰 ;
|
||||
}
|
||||
count_qt = data.一次超洗_count_notok - count;
|
||||
return count_qt;
|
||||
}
|
||||
}else if(type=='二次超洗前'){
|
||||
if(data.二次超洗_count_pn_jgqbl){
|
||||
if (data.二次超洗_加工前_缺陷_崩边 !== undefined) {
|
||||
count += data.二次超洗_加工前_缺陷_崩边 ;
|
||||
}
|
||||
if (data.二次超洗_加工前_缺陷_小崩边 !== undefined) {
|
||||
count += data.二次超洗_加工前_缺陷_小崩边 ;
|
||||
}
|
||||
count_qt = data.二次超洗_count_pn_jgqbl - count;
|
||||
return count_qt;
|
||||
}
|
||||
}else if(type=='二次超洗'){
|
||||
if(data.二次超洗_count_notok){
|
||||
if (data.二次超洗_缺陷_黑圈不良 !== undefined) {
|
||||
count += data.二次超洗_缺陷_黑圈不良 ;
|
||||
}
|
||||
if (data.二次超洗_缺陷_材料不良 !== undefined) {
|
||||
count += data.二次超洗_缺陷_材料不良 ;
|
||||
}
|
||||
if (data.二次超洗_缺陷_调机破损 !== undefined) {
|
||||
count += data.二次超洗_缺陷_调机破损 ;
|
||||
}
|
||||
if (data.二次超洗_缺陷_人为磕碰 !== undefined) {
|
||||
count += data.二次超洗_缺陷_人为磕碰 ;
|
||||
}
|
||||
count_qt = data.二次超洗_count_notok - count;
|
||||
return count_qt;
|
||||
}
|
||||
}
|
||||
},
|
||||
handleExport() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX("#exportDiv", "过程检验统计");
|
||||
this.exportLoading = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
@ -138,7 +138,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="合格数" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data.七车间入库_count&&scope.row.data.七车间入库_count_notok">{{ scope.row.data.七车间入库_count-scope.row.data.七车间入库_count_notok }}</span>
|
||||
<span v-if="scope.row.data.七车间入库_count">{{ scope.row.data.七车间入库_count-scope.row.data.七车间入库_count_notok }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" class-name="colorheader3">
|
||||
|
|
@ -320,6 +320,11 @@
|
|||
<span v-if="scope.row.data">{{ scope.row.data.六车间_抛光_count_use }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_抛光_count_notok }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_抛光_合格率 }}</span>
|
||||
|
|
@ -345,11 +350,6 @@
|
|||
<span v-if="scope.row.data">{{ getCountQt(scope.row.data,'抛光') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_抛光_count_notok }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加工日期" class-name="colorheader4" min-width="160">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_抛光_日期 }}</span>
|
||||
|
|
@ -529,8 +529,9 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
params: {
|
||||
ordering:'-last_time',
|
||||
batch__startswith__in:'ZJ2,G05,J2C,A55',
|
||||
ordering:'-last_time,-first_time',
|
||||
material_start__cate:'棒',
|
||||
last_time_isnull:false,
|
||||
},
|
||||
query:{
|
||||
batch__contains:'',
|
||||
|
|
@ -544,7 +545,38 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
handleQuery(){
|
||||
this.$refs.table.queryData(this.query);
|
||||
let that = this;
|
||||
let querys = [],arr1=[],arr2=[];
|
||||
let obj = {},obj1 = {},obj2 = {};
|
||||
obj.field = 'batch__contains';
|
||||
obj.value = that.query.batch__contains;
|
||||
obj.compare = '';
|
||||
obj1.field = 'last_time__gte';
|
||||
obj1.value = that.query.last_time__gte;
|
||||
obj1.compare = 'gte';
|
||||
obj2.field = 'last_time__gte';
|
||||
obj2.value = that.query.last_time__gte;
|
||||
obj2.compare = 'gte';
|
||||
if((that.query.last_time__gte==''||that.query.last_time__gte==null)&&(that.query.last_time__lte==''||that.query.last_time__lte==null)&&that.query.batch__contains!==''&&that.query.batch__contains!==null){
|
||||
querys.push(obj);
|
||||
}
|
||||
if(that.query.last_time__gte!==''&&that.query.last_time__gte!==null){
|
||||
arr1.push(obj1);
|
||||
if(that.query.batch__contains!==''&&that.query.batch__contains!==null){
|
||||
arr1.push(obj);
|
||||
}
|
||||
querys.push(arr1)
|
||||
}
|
||||
if(that.query.last_time__lte!==''&&that.query.last_time__lte!==null){
|
||||
arr2.push(obj2);
|
||||
if(that.query.batch__contains!==''&&that.query.batch__contains!==null){
|
||||
arr2.push(obj);
|
||||
}
|
||||
querys.push(arr2)
|
||||
}
|
||||
let params = {};
|
||||
params.querys = querys;
|
||||
this.$refs.table.queryData(params);
|
||||
},
|
||||
getCountQt(data,type){
|
||||
let count_qt = 0,count = 0;
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="10号抽检" class-name="colorheader2">
|
||||
<el-table-column label="8车间中检" align="center" class-name="colorheader2">
|
||||
<el-table-column label="抽检数量" class-name="colorheader2">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.十车间入库_count }}</span>
|
||||
|
|
@ -188,68 +188,6 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="退火" align="center" class-name="colorheader4">
|
||||
<el-table-column label="时间" width="160px" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_日期 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退火数" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_use }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_ok }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_合格率 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_notok }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="箱中破" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_xzp }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退火后碎" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_thhs }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="划伤" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_hs }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结石" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_js }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="气线" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_qx }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{getCountQt(scope.row.data,'管料退火')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退火人" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_操作人 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="8号入库" align="center" class-name="colorheader3">
|
||||
<el-table-column label="时间" width="100px" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
|
|
@ -325,113 +263,197 @@
|
|||
<template #default="scope">{{ scope.row.data.十车间入库_备注 }}</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="6号车间" align="center" class-name="colorheader5">
|
||||
<el-table-column label="领料" align="center" class-name="colorheader5">
|
||||
<el-table-column label="领取时间" width="160px" class-name="colorheader5">
|
||||
<el-table-column label="退火" align="center" class-name="colorheader3">
|
||||
<el-table-column label="时间" width="160px" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_日期 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退火数" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_use }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_ok }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_合格率 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_notok }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="箱中破" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_xzp }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退火后碎" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_thhs }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="划伤" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_hs }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结石" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_js }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="气线" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_count_n_qx }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{getCountQt(scope.row.data,'管料退火')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退火人" class-name="colorheader3">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.管料退火_操作人 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="6号车间" align="center" class-name="colorheader4">
|
||||
<el-table-column label="库存领料" align="center" class-name="colorheader4">
|
||||
<el-table-column label="领取时间" width="160px" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间领料_日期 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="领取数" class-name="colorheader5">
|
||||
<el-table-column label="领取数" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间领料_count }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交送人" class-name="colorheader5">
|
||||
<el-table-column label="交送人" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间领料_仓库执行人 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="领取人" class-name="colorheader5">
|
||||
<el-table-column label="领取人" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间领料_车间执行人 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" class-name="colorheader5">
|
||||
<el-table-column label="备注" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间领料_备注 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="开槽" align="center" class-name="colorheader5">
|
||||
<el-table-column label="加工数" class-name="colorheader5">
|
||||
<el-table-column label="交接领料" align="center" class-name="colorheader4">
|
||||
<el-table-column label="领取时间" width="160px" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间交接领料_日期 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="领取数" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间交接领料_count }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交送人" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间交接领料_送料人 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="领取人" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间交接领料_接料人 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="开槽" align="center" class-name="colorheader4">
|
||||
<el-table-column label="加工数" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_count_real }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" class-name="colorheader5">
|
||||
<el-table-column label="合格率" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_合格率 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" class-name="colorheader5">
|
||||
<el-table-column label="不合格数" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_count_notok }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="断裂" class-name="colorheader5">
|
||||
<el-table-column label="断裂" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_count_n_dl }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader5">
|
||||
<el-table-column label="其他" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{getCountQt(scope.row.data,'开槽')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加工日期" min-width="160" class-name="colorheader5">
|
||||
<el-table-column label="加工日期" min-width="160" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_日期 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人" class-name="colorheader5">
|
||||
<el-table-column label="操作人" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_操作人 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" class-name="colorheader5">
|
||||
<el-table-column label="备注" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_开槽_备注 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="倒角" align="center" class-name="colorheader5">
|
||||
<el-table-column label="加工数" class-name="colorheader5">
|
||||
<el-table-column label="倒角" align="center" class-name="colorheader4">
|
||||
<el-table-column label="加工数" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_count_real }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" class-name="colorheader5">
|
||||
<el-table-column label="合格率" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_合格率 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" class-name="colorheader5">
|
||||
<el-table-column label="不合格数" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_count_notok }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="断裂" class-name="colorheader5">
|
||||
<el-table-column label="断裂" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_count_n_dl }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader5">
|
||||
<el-table-column label="其他" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{getCountQt(scope.row.data,'倒角')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加工日期" min-width="160" class-name="colorheader5">
|
||||
<el-table-column label="加工日期" min-width="160" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_日期 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人" class-name="colorheader5">
|
||||
<el-table-column label="操作人" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_操作人 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" class-name="colorheader5">
|
||||
<el-table-column label="备注" class-name="colorheader4">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间_倒角_备注 }}</span>
|
||||
</template>
|
||||
|
|
@ -439,117 +461,117 @@
|
|||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- 六车间中检 -->
|
||||
<el-table-column label="检验" align="center" class-name="colorheader6">
|
||||
<el-table-column label="检验" class-name="colorheader6">
|
||||
<el-table-column label="六车间中检" align="center" class-name="colorheader5">
|
||||
<el-table-column label="检验" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" class-name="colorheader6">
|
||||
<el-table-column label="合格率" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间中检_合格率 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" class-name="colorheader6">
|
||||
<el-table-column label="不合格数" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_notok }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="划伤" class-name="colorheader6">
|
||||
<el-table-column label="划伤" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_hs }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="杂质" class-name="colorheader6">
|
||||
<el-table-column label="杂质" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_zz }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="锥度大" class-name="colorheader6">
|
||||
<el-table-column label="锥度大" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_zdd }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="炸纹" class-name="colorheader6">
|
||||
<el-table-column label="炸纹" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_zw }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="气泡" class-name="colorheader6">
|
||||
<el-table-column label="气泡" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_qp }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不亮" class-name="colorheader6">
|
||||
<el-table-column label="不亮" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_bl }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="横纹" class-name="colorheader6">
|
||||
<el-table-column label="横纹" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_hw }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="有皮" class-name="colorheader6">
|
||||
<el-table-column label="有皮" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间中检_count_n_yp }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader6">
|
||||
<el-table-column label="其他" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{getCountQt(scope.row.data,'六车间中检')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="日期" class-name="colorheader6" min-width="160">
|
||||
<el-table-column label="日期" class-name="colorheader5" min-width="160">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间中检_日期 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人" class-name="colorheader6">
|
||||
<el-table-column label="操作人" class-name="colorheader5">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间中检_检验人 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="终检" align="center" class-name="colorheader7">
|
||||
<el-table-column label="终检数" class-name="colorheader7">
|
||||
<el-table-column label="终检" align="center" class-name="colorheader6">
|
||||
<el-table-column label="终检数" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data&&scope.row.data.销售发货_count&&scope.row.data.六车间生产入库_count_notok">{{ scope.row.data.销售发货_count + scope.row.data.六车间生产入库_count_notok }}</span>
|
||||
<span v-if="scope.row.data&&scope.row.data.销售发货_count">{{ scope.row.data.销售发货_count + scope.row.data.六车间生产入库_count_notok }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格率" class-name="colorheader7">
|
||||
<el-table-column label="合格率" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间生产入库_合格率 }}</span>
|
||||
<span v-if="scope.row.data&&scope.row.data.六车间生产入库_检验日期!==''">{{ scope.row.data.六车间生产入库_合格率 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" class-name="colorheader7">
|
||||
<el-table-column label="不合格数" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间生产入库_count_notok }}</span>
|
||||
<span v-if="scope.row.data&&scope.row.data.六车间生产入库_检验日期!==''">{{ scope.row.data.六车间生产入库_count_notok }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="划伤" class-name="colorheader7">
|
||||
<el-table-column label="划伤" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间生产入库_count_n_hs }}</span>
|
||||
<span v-if="scope.row.data&&scope.row.data.六车间生产入库_检验日期!==''">{{ scope.row.data.六车间生产入库_count_n_hs }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="炸纹" class-name="colorheader7">
|
||||
<el-table-column label="炸纹" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间生产入库_count_n_zw }}</span>
|
||||
<span v-if="scope.row.data&&scope.row.data.六车间生产入库_检验日期!==''">{{ scope.row.data.六车间生产入库_count_n_zw }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他" class-name="colorheader7">
|
||||
<el-table-column label="其他" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{getCountQt(scope.row.data,'六车间生产入库')}}</span>
|
||||
<span v-if="scope.row.data&&scope.row.data.六车间生产入库_检验日期!==''">{{getCountQt(scope.row.data,'六车间生产入库')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="日期" class-name="colorheader7" min-width="160">
|
||||
<el-table-column label="日期" class-name="colorheader6" min-width="160">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间生产入库_检验日期 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人" class-name="colorheader7">
|
||||
<el-table-column label="操作人" class-name="colorheader6">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data">{{ scope.row.data.六车间生产入库_检验人 }}</span>
|
||||
<span v-if="scope.row.data&&scope.row.data.六车间生产入库_检验日期!==''">{{ scope.row.data.六车间生产入库_检验人 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
|
@ -570,7 +592,8 @@ export default {
|
|||
return {
|
||||
params: {
|
||||
ordering:'-last_time',
|
||||
batch__startswith__in:'ZB2,B1',
|
||||
material_start__cate:'管',
|
||||
last_time_isnull:false,
|
||||
},
|
||||
query:{
|
||||
batch__contains:'',
|
||||
|
|
@ -585,7 +608,38 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
handleQuery(){
|
||||
this.$refs.table.queryData(this.query);
|
||||
let that = this;
|
||||
let querys = [],arr1=[],arr2=[];
|
||||
let obj = {},obj1 = {},obj2 = {};
|
||||
obj.field = 'batch__contains';
|
||||
obj.value = that.query.batch__contains;
|
||||
obj.compare = '';
|
||||
obj1.field = 'last_time__gte';
|
||||
obj1.value = that.query.last_time__gte;
|
||||
obj1.compare = 'gte';
|
||||
obj2.field = 'last_time__gte';
|
||||
obj2.value = that.query.last_time__gte;
|
||||
obj2.compare = 'gte';
|
||||
if((that.query.last_time__gte==''||that.query.last_time__gte==null)&&(that.query.last_time__lte==''||that.query.last_time__lte==null)&&that.query.batch__contains!==''&&that.query.batch__contains!==null){
|
||||
querys.push(obj);
|
||||
}
|
||||
if(that.query.last_time__gte!==''&&that.query.last_time__gte!==null){
|
||||
arr1.push(obj1);
|
||||
if(that.query.batch__contains!==''&&that.query.batch__contains!==null){
|
||||
arr1.push(obj);
|
||||
}
|
||||
querys.push(arr1)
|
||||
}
|
||||
if(that.query.last_time__lte!==''&&that.query.last_time__lte!==null){
|
||||
arr2.push(obj2);
|
||||
if(that.query.batch__contains!==''&&that.query.batch__contains!==null){
|
||||
arr2.push(obj);
|
||||
}
|
||||
querys.push(arr2)
|
||||
}
|
||||
let params = {};
|
||||
params.querys = querys;
|
||||
this.$refs.table.queryData(params);
|
||||
},
|
||||
getCountQt(data,type){
|
||||
let count_qt = 0,count = 0;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@
|
|||
:filters="nameFilters1"
|
||||
:filter-method="filterName1"
|
||||
filter-placement="bottom-end"/>
|
||||
<!-- 光芯不要这两列 -->
|
||||
<el-table-column label="型号" prop="material_model"
|
||||
:filters="modelFilters1"
|
||||
:filter-method="filterModel1"
|
||||
|
|
@ -55,7 +54,6 @@
|
|||
:filters="specsFilters1"
|
||||
:filter-method="filterSpecs1"
|
||||
filter-placement="bottom-end"/>
|
||||
<!-- 光芯不要这两列 -->
|
||||
<el-table-column prop="dept_name" label="完成车间"
|
||||
:filters="deptFilters1"
|
||||
:filter-method="filterDept1"
|
||||
|
|
@ -77,18 +75,14 @@
|
|||
:filters="nameFilters11"
|
||||
:filter-method="filterName11"
|
||||
filter-placement="bottom-end"/>
|
||||
<!-- 光芯不要这两列 -->
|
||||
<el-table-column label="型号" prop="model"
|
||||
v-if="project_code!=='gx'"
|
||||
:filters="modelFilters11"
|
||||
:filter-method="filterModel11"
|
||||
filter-placement="bottom-end"/>
|
||||
<el-table-column label="规格" prop="specification"
|
||||
v-if="project_code!=='gx'"
|
||||
:filters="specsFilters11"
|
||||
:filter-method="filterSpecs11"
|
||||
filter-placement="bottom-end"/>
|
||||
<!-- 光芯不要这两列 -->
|
||||
<el-table-column label="库存总数" prop="count_mb"/>
|
||||
<el-table-column label="周预估值" v-if="params.type == 30">
|
||||
<template #default="scope">
|
||||
|
|
@ -266,7 +260,6 @@ export default {
|
|||
{ id: 40, name: "辅助材料" },
|
||||
{ id: 70, name: "办公用品" },
|
||||
],
|
||||
project_code : this.$TOOL.data.get("BASE_INFO").base.base_code,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -286,7 +279,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
queryTypeChnge() {
|
||||
this.query.queryDate = "";
|
||||
this.queryDate =null;
|
||||
},
|
||||
getTableData1() {
|
||||
let that = this;
|
||||
|
|
@ -460,19 +453,10 @@ export default {
|
|||
if (that.queryDate !== "" && that.queryDate !== null) {
|
||||
that.start_date = that.queryDate + "-01";
|
||||
let arr = that.queryDate.split("-");
|
||||
that.end_date =
|
||||
that.queryDate +
|
||||
"-" +
|
||||
new Date(arr[0], arr[1], 0).getDate();
|
||||
that.end_date = that.queryDate + "-" + new Date(arr[0], arr[1], 0).getDate();
|
||||
} else {
|
||||
that.start_date =
|
||||
that.currentYear + "-" + this.currentMonth + "-01";
|
||||
that.end_date =
|
||||
that.currentYear +
|
||||
"-" +
|
||||
this.currentMonth +
|
||||
"-" +
|
||||
that.currentLastDay;
|
||||
that.start_date = that.currentYear + "-" + this.currentMonth + "-01";
|
||||
that.end_date = that.currentYear + "-" + this.currentMonth + "-" + that.currentLastDay;
|
||||
}
|
||||
} else {
|
||||
if (this.queryDate !== "" && this.queryDate !== null) {
|
||||
|
|
|
|||
|
|
@ -67,13 +67,11 @@
|
|||
:data="tableData1"
|
||||
id="exportDiv7"
|
||||
:height="tableHeight"
|
||||
:summary-method="getSummaries"
|
||||
show-summary
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column
|
||||
label="任务编号"
|
||||
prop="number"
|
||||
min-width="100px"
|
||||
>
|
||||
<el-table-column label="任务编号" prop="number" min-width="100px" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划数" prop="count">
|
||||
</el-table-column>
|
||||
|
|
@ -96,13 +94,11 @@
|
|||
:data="tableData2"
|
||||
id="exportDiv10"
|
||||
:height="tableHeight"
|
||||
:summary-method="getSummaries"
|
||||
show-summary
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column
|
||||
label="任务编号"
|
||||
prop="number"
|
||||
min-width="100px"
|
||||
>
|
||||
<el-table-column label="任务编号" prop="number" min-width="100px" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划数" prop="count">
|
||||
</el-table-column>
|
||||
|
|
@ -125,13 +121,11 @@
|
|||
:data="tableData3"
|
||||
id="exportDiv6"
|
||||
:height="tableHeight"
|
||||
:summary-method="getSummaries"
|
||||
show-summary
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column
|
||||
label="任务编号"
|
||||
prop="number"
|
||||
min-width="100px"
|
||||
>
|
||||
<el-table-column label="任务编号" prop="number" min-width="100px" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划数" prop="count">
|
||||
</el-table-column>
|
||||
|
|
@ -178,8 +172,8 @@ export default {
|
|||
series: {
|
||||
name: "7车间完成率",
|
||||
type: "pie",
|
||||
radius: ["40%", "70%"],
|
||||
center: ["50%", "60%"],
|
||||
radius: ["35%", "65%"],
|
||||
center: ["50%", "58%"],
|
||||
label: {
|
||||
show: true,
|
||||
position: "outside",
|
||||
|
|
@ -194,7 +188,6 @@ export default {
|
|||
option2: {
|
||||
title: {
|
||||
text: "10车间完成率",
|
||||
// subtext: '',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "item",
|
||||
|
|
@ -207,8 +200,8 @@ export default {
|
|||
series: {
|
||||
name: "10车间完成率",
|
||||
type: "pie",
|
||||
radius: ["40%", "70%"],
|
||||
center: ["50%", "60%"],
|
||||
radius: ["35%", "65%"],
|
||||
center: ["50%", "58%"],
|
||||
label: {
|
||||
show: true,
|
||||
position: "outside",
|
||||
|
|
@ -235,8 +228,8 @@ export default {
|
|||
series: {
|
||||
name: "6车间完成率",
|
||||
type: "pie",
|
||||
radius: ["40%", "70%"],
|
||||
center: ["50%", "60%"],
|
||||
radius: ["35%", "65%"],
|
||||
center: ["50%", "58%"],
|
||||
label: {
|
||||
show: true,
|
||||
position: "outside",
|
||||
|
|
@ -276,8 +269,7 @@ export default {
|
|||
this.currentYear = year;
|
||||
this.currentMonth = month > 9 ? month : "0" + month;
|
||||
this.start_date = year + "-" + month + "-01";
|
||||
this.end_date =
|
||||
year + "-" + month + "-" + new Date(year, month, 0).getDate();
|
||||
this.end_date = year + "-" + month + "-" + days;
|
||||
let month1 = month > 9 ? month : "0" + month;
|
||||
this.queryDate = year + "-" + month1;
|
||||
let height = document.getElementById("elMain").clientHeight - 40;
|
||||
|
|
@ -430,6 +422,34 @@ export default {
|
|||
this.getData7();
|
||||
this.getData10();
|
||||
},
|
||||
getSummaries({ columns, data }) {
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = "合计";
|
||||
return;
|
||||
}
|
||||
if (index == 2||index == 3) {
|
||||
const values = data.map((item) =>
|
||||
Number(item[column.property])
|
||||
);
|
||||
if (!values.every((value) => Number.isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr); //Number转换为数值
|
||||
let sum = Number(
|
||||
Number(prev) + Number(curr)
|
||||
).toFixed(2); //toFixed(2)数据项保留两位小数
|
||||
if (!isNaN(value)) {
|
||||
return sum;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
return sums;
|
||||
},
|
||||
handleExport(val) {
|
||||
this.exportLoading = true;
|
||||
let id = "#exportDiv" + val;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<el-container>
|
||||
<el-header style="height: 40px;">
|
||||
<el-input
|
||||
v-model="query.wpr"
|
||||
v-model="query.search"
|
||||
placeholder="请输入物料编号"
|
||||
clearable
|
||||
style="width: 150px;"
|
||||
|
|
@ -17,7 +17,6 @@
|
|||
ref="tablets"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
:params="query"
|
||||
:query="query"
|
||||
stripe
|
||||
@row-click="rowClick"
|
||||
|
|
@ -240,18 +239,14 @@ export default {
|
|||
wmState,
|
||||
apiObj:this.$API.wpm.wpr.list,
|
||||
wprItem:{},
|
||||
params:{
|
||||
batch:'',
|
||||
},
|
||||
query:{
|
||||
batch:'',
|
||||
material_start__type:30,
|
||||
search:'',
|
||||
},
|
||||
params_mio:{
|
||||
item_mio__w_mioitem__number:'',
|
||||
},
|
||||
params_mlog:{
|
||||
b_mlog__w_mlogb__number:'',
|
||||
cnumber:'',
|
||||
},
|
||||
params_handover:{
|
||||
b_handover__w_handoverb__number:'',
|
||||
|
|
@ -294,7 +289,7 @@ export default {
|
|||
that.wprItem.number = row.number;
|
||||
}
|
||||
that.params_mio.item_mio__w_mioitem__number = row.number;
|
||||
that.params_mlog.b_mlog__w_mlogb__number = row.number;
|
||||
that.params_mlog.cnumber = row.number;
|
||||
that.params_handover.b_handover__w_handoverb__number = row.number;
|
||||
that.apiObj_mlog = that.$API.wpm.mlog.list;
|
||||
that.apiObj_handover = that.$API.wpm.handover.list;
|
||||
|
|
|
|||
|
|
@ -87,19 +87,13 @@
|
|||
关闭
|
||||
</el-button> -->
|
||||
<!--如果state_.retreat/state_.type==1处于草稿状态 -->
|
||||
<!-- <el-button
|
||||
v-if="
|
||||
scope.row.state_.enable_retreat &&
|
||||
userId === scope.row.create_by &&
|
||||
scope.row.state_.type !== 1
|
||||
"
|
||||
<el-button
|
||||
v-if="scope.row.state_.enable_retreat &&userId === scope.row.create_by"
|
||||
type="danger"
|
||||
@click="handleClose(scope, '1')"
|
||||
size="small"
|
||||
link
|
||||
>
|
||||
撤回
|
||||
</el-button> -->
|
||||
>撤回</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
|
@ -210,12 +204,12 @@ export default {
|
|||
})
|
||||
.then(async () => {
|
||||
if (that.handleTitle === "撤回工单") {
|
||||
res = that.$API.wf.ticket.ticketRetreat.req(
|
||||
res = await that.$API.wf.ticket.ticketRetreat.req(
|
||||
that.ticketId,
|
||||
that.handleForm
|
||||
);
|
||||
} else {
|
||||
res = that.$API.wf.ticket.ticketClose.req(
|
||||
res = await that.$API.wf.ticket.ticketClose.req(
|
||||
that.ticketId,
|
||||
that.handleForm
|
||||
);
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
<el-table-column type="expand">
|
||||
<template #default="props">
|
||||
<div style="padding-left: 50px">
|
||||
<div v-if="props.row.new_batch&&props.row.new_batch!= null" style="font-size: 14px;">新批次号:{{ props.row.new_batch }}</div>
|
||||
<template v-for="item in props.row.handoverb" :key="item.id">
|
||||
<el-descriptions :column="3">
|
||||
<el-descriptions-item label="批次">
|
||||
|
|
@ -82,6 +83,11 @@
|
|||
{{item.defect_name}}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<!-- {{ item }} -->
|
||||
<!-- {{ item.handoverbw }} -->
|
||||
<div v-if="item.handoverbw&&item.handoverbw.length>0">
|
||||
板段号:<span v-for="bwItem in item.handoverbw" :key="bwItem.id">{{ bwItem.number }}、</span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -97,12 +103,24 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count" min-width="80"></el-table-column>
|
||||
<el-table-column label="交接类型" prop="type" min-width="80">
|
||||
<template #default="scope" v-if="mgroup_name=='size'||mgroup_name=='facade'">
|
||||
<el-text v-if="scope.row.send_dept == deptId" type="primary">交送</el-text>
|
||||
<el-text v-if="scope.row.recive_dept == deptId" type="success">接收</el-text>
|
||||
<!-- <el-table-column label="交接类别" prop="type" width="80">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.type == 10" type="success">正常</el-tag>
|
||||
<el-tag v-if="scope.row.type == 20" type="warning">返工</el-tag>
|
||||
<el-tag v-if="scope.row.type == 30" type="primary">检验</el-tag>
|
||||
<el-tag v-if="scope.row.type == 40" type="danger">报废</el-tag>
|
||||
<el-tag v-if="scope.row.type == 60" type="warning">退料</el-tag>
|
||||
</template>
|
||||
<template #default="scope" v-else>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="交接类型" prop="type" min-width="80">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.type == 10&&scope.row.mtype == 10" type="success">正常</el-tag>
|
||||
<el-tag v-if="scope.row.type == 10&&scope.row.mtype == 20" type="warning">分批</el-tag>
|
||||
<el-tag v-if="scope.row.type == 10&&scope.row.mtype == 30" type="warning">合批</el-tag>
|
||||
<el-tag v-if="scope.row.type == 20" type="warning">返工</el-tag>
|
||||
<el-tag v-if="scope.row.type == 30" type="primary">检验</el-tag>
|
||||
<el-tag v-if="scope.row.type == 40" type="danger">报废</el-tag>
|
||||
<el-tag v-if="scope.row.type == 60" type="warning">退料</el-tag>
|
||||
<el-text v-if="scope.row.send_mgroup == mgroupId" type="primary">交送</el-text>
|
||||
<el-text v-if="scope.row.recive_mgroup == mgroupId" type="success">接收</el-text>
|
||||
</template>
|
||||
|
|
@ -113,15 +131,6 @@
|
|||
<el-text v-if="scope.row.recive_mgroup == mgroupId">{{scope.row.recive_mgroup_name}}</el-text>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交接类别" prop="type" width="80">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.type == 10" type="success">正常</el-tag>
|
||||
<el-tag v-if="scope.row.type == 20" type="warning">返工</el-tag>
|
||||
<el-tag v-if="scope.row.type == 30" type="primary">检验</el-tag>
|
||||
<el-tag v-if="scope.row.type == 40" type="danger">报废</el-tag>
|
||||
<el-tag v-if="scope.row.type == 60" type="warning">退料</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="交送人"
|
||||
prop="send_user_name"
|
||||
|
|
@ -177,7 +186,7 @@
|
|||
@click="table_edit(scope.row)"
|
||||
v-auth="'handover.update'"
|
||||
type="primary"
|
||||
v-if="(scope.row.send_mgroup == mgroupId||deptId==scope.row.send_dept)&&scope.row.submit_time == null"
|
||||
v-if="(scope.row.send_mgroup == mgroupId||deptId==scope.row.send_dept)&&scope.row.submit_time == null&&scope.row.mtype == 10"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-popconfirm
|
||||
|
|
@ -213,7 +222,7 @@
|
|||
<el-col style="display: flex;border-bottom: 1px dashed #eee;">
|
||||
<el-checkbox v-model="item.checked" :label="item.batch"/>
|
||||
<el-form-item label="退料数量" label-width="150px" style="margin-bottom: 10px;">
|
||||
<el-input-number v-model="item.count" :min="0" controls-position="right"/>
|
||||
<el-input-number disabled v-model="item.count" :min="0" controls-position="right"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@
|
|||
<el-form-item label="总计:">
|
||||
{{ totalCount }}
|
||||
</el-form-item>
|
||||
<el-form-item label="原始物料" v-if="mode!='add'&&form.mtype==20" style="margin-left: 20px;">
|
||||
<el-col >{{ form.batch }}</el-col>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row v-show="addShow">
|
||||
<el-col>
|
||||
|
|
@ -416,7 +419,6 @@ export default {
|
|||
let that = this;
|
||||
that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
|
||||
that.mgroupOptions = res;
|
||||
|
||||
if(that.type==40){
|
||||
res.forEach(item=>{
|
||||
if(item.name=="废品库"){
|
||||
|
|
@ -595,6 +597,7 @@ export default {
|
|||
that.mgroupOptions = res;
|
||||
if(res.length==1){
|
||||
that.form.recive_mgroup = res[0].id;
|
||||
that.getUserList2();
|
||||
}
|
||||
})
|
||||
data.forEach((item,index)=>{
|
||||
|
|
@ -696,27 +699,26 @@ export default {
|
|||
//表单注入数据
|
||||
setData(data) {
|
||||
let that = this;
|
||||
console.log('交接记录查看',data)
|
||||
this.totalCount = data.count?data.count:data.handoverb.count;
|
||||
Object.assign(this.form, data);
|
||||
if(data.type==30){
|
||||
this.getUserList3();
|
||||
}else{
|
||||
this.$API.system.user.list.req({ depts: data.recive_dept, page: 0 }).then((res) => {
|
||||
that.userList2 = res;
|
||||
});
|
||||
setTimeout(() => {
|
||||
let arr =that.userList2.filter((item) => {
|
||||
return item.id == data.recive_user
|
||||
})
|
||||
if(arr.length>0){}else{
|
||||
let obj = {};
|
||||
obj.id = data.recive_user;
|
||||
obj.name = data.recive_user_name;
|
||||
that.userList2.push(obj);
|
||||
}
|
||||
},500)
|
||||
|
||||
}
|
||||
this.$API.system.user.list.req({ depts: data.send_dept, page: 0 }).then((res) => {
|
||||
that.userList = res;
|
||||
});
|
||||
this.$API.system.user.list.req({ depts: data.recive_dept, page: 0 }).then((res) => {
|
||||
that.userList2 = res;
|
||||
});
|
||||
setTimeout(() => {
|
||||
let arr =that.userList2.filter((item) => {
|
||||
return item.id == data.recive_user
|
||||
})
|
||||
if(arr.length>0){}else{
|
||||
let obj = {};
|
||||
obj.id = data.recive_user;
|
||||
obj.name = data.recive_user_name;
|
||||
that.userList2.push(obj);
|
||||
}
|
||||
},500)
|
||||
if(data.new_batch!==''&&data.new_batch!==undefined&&data.new_batch!==null){
|
||||
this.change_batch = true;
|
||||
}
|
||||
|
|
@ -760,6 +762,7 @@ export default {
|
|||
that.mgroupOptions = res0;
|
||||
if(res0.length==1){
|
||||
that.form.recive_mgroup = res0[0].id;
|
||||
that.getUserList2();
|
||||
}
|
||||
})
|
||||
let obj = {};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="titleMap[mtype]"
|
||||
title="分批"
|
||||
v-model="visible"
|
||||
width="1000px"
|
||||
:size="1000"
|
||||
|
|
@ -15,39 +15,50 @@
|
|||
>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<span>交接物料:{{codeText}}</span>
|
||||
<span style="margin: 0 20px;">物料总数:{{totalCount}} </span>
|
||||
<el-button type="primary" @click="batchAdd">分批</el-button>
|
||||
<el-form-item label="物料批次:" label-width="100px">
|
||||
<b>{{batchOrign.batch}}</b>
|
||||
<span style="width: 80px;margin-left:60px;">物料总数:</span>
|
||||
<b>{{batchOrign.count}} </b>
|
||||
<el-button type="primary" @click="batchAdd" style="margin-left: 40px;">分批</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item label="剩余可分配数量:" label-width="130">
|
||||
{{saveCount}}
|
||||
</el-form-item>
|
||||
|
||||
</el-row>
|
||||
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="批次号">
|
||||
<el-input v-model="listItem.batch"></el-input>
|
||||
<el-input v-model="listItem.batch" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="数量">
|
||||
<el-input-number
|
||||
v-model="listItem.count"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:max="batchOrign.count"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="交接数量"
|
||||
@change="countChange($index)"
|
||||
>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
<el-col :span="14">
|
||||
<span style="margin: 0 0 0 20px;">选择物料:</span>
|
||||
<el-input ref="codeInput"
|
||||
placeholder="扫描交接物料"
|
||||
v-model="wm_in" clearable
|
||||
style="width: 120px;margin: 0 10px;"
|
||||
@change="formWminChange($index,wm_in)"
|
||||
></el-input>
|
||||
<el-select
|
||||
v-model="listItem.wpr"
|
||||
placeholder="选择交接物料"
|
||||
@change="wm_inChange($index)"
|
||||
style="width: 140px;">
|
||||
<el-option
|
||||
v-for="item in wprOptions"
|
||||
:disabled="item.disabled"
|
||||
:key="item.id"
|
||||
:label="item.number"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<span style="margin: 0 20px;">数量:{{ listItem.count }}</span>
|
||||
<el-button v-if="mode!=='show'" type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" v-if="mode!=='show'">
|
||||
<el-button type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
|
||||
<el-col :span="24" style="padding-left: 80px;margin-bottom: 20px;margin-top: -5px;">
|
||||
<div v-for="(item2,index2) in form.handoverb[$index].handoverbw" :key="item2.wpr" class="wprItem">
|
||||
<span>{{ item2.number }}</span>
|
||||
<el-icon class="circleCloseFilled" @click="deleteWpr($index,index2,item2.wpr)"><el-icon-circleClose-filled /></el-icon>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
|
|
@ -100,15 +111,11 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
selectItems:[],
|
||||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
20: "分批",
|
||||
30: "合批",
|
||||
},
|
||||
wm_in:"",
|
||||
mtype:20,
|
||||
saveCount:0,
|
||||
lastBatchNum:1,
|
||||
addBactchNum:1,
|
||||
form: {
|
||||
send_date: null,
|
||||
send_user: null,
|
||||
|
|
@ -132,8 +139,9 @@ export default {
|
|||
},
|
||||
},
|
||||
batchOrign:{},
|
||||
totalCount: 0,
|
||||
wprOptions: [],
|
||||
materialOptions: [],
|
||||
loading: false,
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
setFiltersVisible: false,
|
||||
|
|
@ -148,67 +156,109 @@ export default {
|
|||
that.form.send_user = that.form.recive_user= userInfo.id;
|
||||
},
|
||||
methods: {
|
||||
getWpr(id){
|
||||
let that = this;
|
||||
that.$API.wpm.wpr.list.req({page:0,wm:id}).then((res) => {
|
||||
that.wprOptions = res;
|
||||
});
|
||||
},
|
||||
getNum(batch){
|
||||
let that = this;
|
||||
that.$API.wpm.batchlog.batchesTo.req({batch:batch}).then((res) => {
|
||||
if(res.last_batch_num!==null){
|
||||
that.lastBatchNum = res.last_batch_num;
|
||||
that.addBactchNum = res.last_batch_num+1;
|
||||
}else{
|
||||
that.lastBatchNum = 0;
|
||||
that.addBactchNum = 1;
|
||||
}
|
||||
let obj = { };
|
||||
obj.wm = that.batchOrign.id;
|
||||
obj.batch = that.batchOrign.batch+"-"+that.addBactchNum;
|
||||
that.addBactchNum++;
|
||||
obj.count = 0;
|
||||
obj.handoverbw=[];
|
||||
that.form.handoverb.push(obj);
|
||||
})
|
||||
},
|
||||
//显示
|
||||
open(mode = "add",data,mtype) {
|
||||
this.mode = mode;
|
||||
this.form.mtype = mtype;
|
||||
this.codeText = data.batch;
|
||||
this.batchOrign = data;
|
||||
this.totalCount = data.count;
|
||||
let obj = { };
|
||||
obj.wm = data.id;
|
||||
obj.batch = data.batch+"-1";
|
||||
obj.count = data.count;
|
||||
this.saveCount = 0;
|
||||
this.form.handoverb.push(obj)
|
||||
this.getWpr(data.id);
|
||||
this.getNum(data.batch);
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
wm_inChange(index){
|
||||
let that = this;
|
||||
//放入对应的行中的handoverb中,并且在列表中disabled
|
||||
that.wprOptions.forEach(item=>{
|
||||
if(item.id == that.form.handoverb[index].wpr){
|
||||
let obj = {};
|
||||
obj.number = item.number;
|
||||
obj.wpr = item.id;
|
||||
item.disabled = true;
|
||||
that.form.handoverb[index].handoverbw.push(obj);
|
||||
that.form.handoverb[index].wpr = '';
|
||||
}
|
||||
})
|
||||
that.form.handoverb[index].count = that.form.handoverb[index].handoverbw.length;
|
||||
},
|
||||
formWminChange(index,number){
|
||||
let that = this;
|
||||
//放入对应的行中的handoverb中,并且在列表中disabled
|
||||
that.wprOptions.forEach(item=>{
|
||||
if(item.number== number){
|
||||
if(item.disabled){
|
||||
that.$message.error("该物料已被分配");
|
||||
that.form.handoverb[index].wpr = '';
|
||||
}else{
|
||||
item.disabled = true;
|
||||
let obj = {};
|
||||
obj.number = item.number;
|
||||
obj.wpr = item.id;
|
||||
that.form.handoverb[index].handoverbw.push(obj);
|
||||
that.form.handoverb[index].count = that.form.handoverb[index].handoverbw.length;
|
||||
that.form.handoverb[index].wpr = '';
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteWpr(index1,index2,wpr){
|
||||
let that = this;
|
||||
that.wprOptions.forEach(item=>{
|
||||
if(item.id == wpr){
|
||||
item.disabled = false;
|
||||
}
|
||||
})
|
||||
that.form.handoverb[index1].handoverbw.splice(index2,1);
|
||||
that.form.handoverb[index1].count = that.form.handoverb[index1].handoverbw.length;
|
||||
},
|
||||
batchAdd(){
|
||||
let that = this;
|
||||
if(that.saveCount>0){
|
||||
let indexs = that.form.handoverb.length+1;
|
||||
let count = 0;
|
||||
that.form.handoverb.forEach(item=>{
|
||||
count+=item.count;
|
||||
})
|
||||
let obj = { };
|
||||
obj.wm = that.batchOrign.id;
|
||||
obj.batch = that.codeText+"-"+indexs;
|
||||
obj.count = that.batchOrign.count - count;
|
||||
that.saveCount = 0;
|
||||
that.form.handoverb.push(obj)
|
||||
}else{
|
||||
that.$message.warning("已无可分配数量");
|
||||
}
|
||||
let obj = { };
|
||||
obj.wm = that.batchOrign.id;
|
||||
obj.batch = that.batchOrign.batch+"-"+that.addBactchNum;
|
||||
that.addBactchNum++;
|
||||
obj.count =0;
|
||||
obj.handoverbw=[];
|
||||
that.form.handoverb.push(obj)
|
||||
},
|
||||
delMaterial(index){
|
||||
this.form.handoverb.splice(index,1);
|
||||
this.countChange();
|
||||
},
|
||||
|
||||
countChange(index){
|
||||
let that = this;
|
||||
let totalCount = 0;
|
||||
if(this.form.handoverb.length>0){
|
||||
this.form.handoverb.forEach(item=>{
|
||||
totalCount += item.count;
|
||||
})
|
||||
let saveCount = that.batchOrign.count-totalCount;
|
||||
if(saveCount<0){//数量不能大于总数量
|
||||
this.form.handoverb[index].count = 0;
|
||||
let total = 0;
|
||||
this.form.handoverb.forEach(item=>{
|
||||
total += item.count;
|
||||
//解除该记录的wpr的disabled
|
||||
if(that.form.handoverb[index].handoverbw.length>0){
|
||||
that.form.handoverb[index].handoverbw.forEach(item=>{
|
||||
that.wprOptions.forEach(item2=>{
|
||||
if(item2.id == item.wpr){
|
||||
item2.disabled = false;
|
||||
}
|
||||
})
|
||||
this.form.handoverb[index].count = that.batchOrign.count-total;
|
||||
that.saveCount = 0;
|
||||
}else{
|
||||
that.saveCount = that.batchOrign.count-totalCount;
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
that.form.handoverb.splice(index,1);
|
||||
},
|
||||
//提交
|
||||
submit() {
|
||||
|
|
@ -267,4 +317,21 @@ export default {
|
|||
height: 50px;
|
||||
line-height: 50px;
|
||||
}
|
||||
.wprItem{
|
||||
background: #eeeeee;
|
||||
padding: 0 10px;
|
||||
border-radius: 5px;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.circleCloseFilled{
|
||||
position: absolute;
|
||||
top: -7px;
|
||||
right: -10px;
|
||||
color: red;
|
||||
font-size: 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -81,7 +81,11 @@
|
|||
label="批次号"
|
||||
prop="batch"
|
||||
min-width="120"
|
||||
></el-table-column>
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-link @click="rowClick(scope.row)" type="primary">{{scope.row.batch}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="部门/工段"
|
||||
prop="belong_dept_name"
|
||||
|
|
@ -180,11 +184,21 @@
|
|||
ref="inmRecordDialog"
|
||||
:cate = "cate_type"
|
||||
:process = "process"
|
||||
:mgroupId = "params.mgroupx"
|
||||
:mgroupId = "mgroupId"
|
||||
:deptId = " params.belong_dept"
|
||||
@success="handleinmSuccess"
|
||||
>
|
||||
</save-dialog>
|
||||
<handover-dialog
|
||||
v-if="dialog.handover"
|
||||
ref="handoverDialog"
|
||||
:type="type"
|
||||
:mgroupName="mgroupName"
|
||||
:mgroupId="mgroupId"
|
||||
@success="handleScrapSuccess"
|
||||
@closed="dialog.handover = false"
|
||||
>
|
||||
</handover-dialog>
|
||||
<el-drawer v-model="wprVisibleDrawer" :size="'70%'">
|
||||
<template #header>
|
||||
<h4>关联产品</h4>
|
||||
|
|
@ -246,6 +260,7 @@ import checkDialog from "./check_form.vue";
|
|||
import showDrawer from "./check_drawer.vue";
|
||||
import scrapDialog from "./handover_form.vue";
|
||||
import saveDialog from "./inm_record.vue";
|
||||
import handoverDialog from "./handover_form2.vue";
|
||||
export default {
|
||||
props: {
|
||||
deptId: {
|
||||
|
|
@ -274,7 +289,8 @@ export default {
|
|||
materials,
|
||||
checkDialog,
|
||||
showDrawer,
|
||||
scrapDialog
|
||||
scrapDialog,
|
||||
handoverDialog
|
||||
},
|
||||
name: "wmaterial",
|
||||
data() {
|
||||
|
|
@ -420,8 +436,9 @@ export default {
|
|||
obj.wm = item.id;
|
||||
obj.batch = item.batch;
|
||||
obj.process = item.material_.process_name;
|
||||
obj.count_cando = item.count_cando;
|
||||
obj.count = item.count_cando;
|
||||
obj.count_canhandover = item.count_canhandover;
|
||||
obj.count = item.count_canhandover;
|
||||
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';
|
||||
handoverb.push(obj)
|
||||
})
|
||||
}
|
||||
|
|
@ -458,6 +475,14 @@ export default {
|
|||
this.dialog.save = false;
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
//分批mtype:20
|
||||
rowClick(row){
|
||||
this.dialog.handover = true;
|
||||
this.type = 10;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.handoverDialog.open("add",row,20);
|
||||
});
|
||||
},
|
||||
//打印物料标签
|
||||
printMaterial(row,type){
|
||||
let that = this;
|
||||
|
|
@ -493,7 +518,7 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
params.extra_data={materialname:materialname,specification:specification,count:row.count,slicecount:slice_count,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]};
|
||||
params.extra_data={orimaterial:row.material_ofrom_name,materialname:materialname,specification:specification,count:row.count,slicecount:slice_count,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]};
|
||||
that.apiObjPrint.req(params).then((res) => {
|
||||
let obj = {};
|
||||
obj.printer_commands = res.commands;
|
||||
|
|
@ -505,9 +530,10 @@ export default {
|
|||
})
|
||||
}else{
|
||||
if(that.route_code=='paiyicibang'){
|
||||
params.extra_data={orimaterial:row.material_ofrom_name};
|
||||
params.label_template_name = '排一次棒打印模板';
|
||||
}else{
|
||||
params.extra_data={count:row.count};
|
||||
params.extra_data={orimaterial:row.material_ofrom_name,count:row.count};
|
||||
params.label_template_name = '其他工序打印模板';
|
||||
}
|
||||
that.apiObjPrint.req(params).then((res) => {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,11 @@
|
|||
label="批次号"
|
||||
prop="batch"
|
||||
min-width="120"
|
||||
></el-table-column>
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-link @click="rowClick(scope.row)" type="primary">{{scope.row.batch}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="部门/工段"
|
||||
prop="belong_dept_name"
|
||||
|
|
@ -186,6 +190,16 @@
|
|||
@success="handleinmSuccess"
|
||||
>
|
||||
</save-dialog>
|
||||
<handover-dialog
|
||||
v-if="dialog.handover"
|
||||
ref="handoverDialog"
|
||||
:type="type"
|
||||
:mgroupName="mgroupName"
|
||||
:mgroupId="mgroupId"
|
||||
@success="handleScrapSuccess"
|
||||
@closed="dialog.handover = false"
|
||||
>
|
||||
</handover-dialog>
|
||||
<el-drawer v-model="wprVisibleDrawer" :size="'70%'">
|
||||
<template #header>
|
||||
<h4>关联产品</h4>
|
||||
|
|
@ -247,6 +261,7 @@ import checkDialog from "./check_form.vue";
|
|||
import showDrawer from "./check_drawer.vue";
|
||||
import scrapDialog from "./handover_form.vue";
|
||||
import saveDialog from "./inm_record.vue";
|
||||
import handoverDialog from "./handover_form2.vue";
|
||||
export default {
|
||||
props: {
|
||||
deptId: {
|
||||
|
|
@ -275,7 +290,8 @@ export default {
|
|||
materials,
|
||||
checkDialog,
|
||||
showDrawer,
|
||||
scrapDialog
|
||||
scrapDialog,
|
||||
handoverDialog
|
||||
},
|
||||
name: "wmaterial",
|
||||
data() {
|
||||
|
|
@ -421,8 +437,9 @@ export default {
|
|||
obj.wm = item.id;
|
||||
obj.batch = item.batch;
|
||||
obj.process = item.material_.process_name;
|
||||
obj.count_cando = item.count_cando;
|
||||
obj.count = item.count_cando;
|
||||
obj.count_canhandover = item.count_canhandover;
|
||||
obj.count = item.count_canhandover;
|
||||
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';
|
||||
handoverb.push(obj)
|
||||
})
|
||||
}
|
||||
|
|
@ -454,6 +471,14 @@ export default {
|
|||
that.wprList = res;
|
||||
})
|
||||
},
|
||||
//分批mtype:20
|
||||
rowClick(row){
|
||||
this.dialog.handover = true;
|
||||
this.type = 10;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.handoverDialog.open("add",row,20);
|
||||
});
|
||||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
this.dialog.save = false;
|
||||
|
|
@ -495,7 +520,7 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
params.extra_data={materialname:materialname,specification:specification,count:row.count,slicecount:slice_count,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]};
|
||||
params.extra_data={orimaterial:row.material_ofrom_name,materialname:materialname,specification:specification,count:row.count,slicecount:slice_count,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]};
|
||||
that.apiObjPrint.req(params).then((res) => {
|
||||
let obj = {};
|
||||
obj.printer_commands = res.commands;
|
||||
|
|
@ -507,9 +532,10 @@ export default {
|
|||
})
|
||||
}else{
|
||||
if(that.route_code=='paiyicibang'){
|
||||
params.extra_data={orimaterial:row.material_ofrom_name};
|
||||
params.label_template_name = '排一次棒打印模板';
|
||||
}else{
|
||||
params.extra_data={count:row.count};
|
||||
params.extra_data={orimaterial:row.material_ofrom_name,count:row.count};
|
||||
params.label_template_name = '其他工序打印模板';
|
||||
}
|
||||
that.apiObjPrint.req(params).then((res) => {
|
||||
|
|
|
|||
|
|
@ -210,8 +210,9 @@
|
|||
@click="table_add"
|
||||
style="position: absolute; left: 100px; top: 5px"
|
||||
>新增</el-button>
|
||||
<span class="warningText" v-if="route_code=='ladansi'||route_code=='yicifusi'||route_code=='ercifusi'||route_code=='zlybcl'">注:请扫码录入单个棒!一个棒对应一个日志,方便于采集数据对应</span>
|
||||
<span class="warningText" v-if="route_code=='ladansi'||route_code=='yicifusi'||route_code=='ercifusi'">注:请扫码录入单个棒!一个棒对应一个日志,方便于采集数据对应</span>
|
||||
<span class="warningText" v-if="route_code=='paiyicibang'||route_code=='paiban'">注:请输入单个棒的料!一个棒的料对应一个日志,方便于自动排号</span>
|
||||
<span class="warningText" v-if="route_code=='zlybcl'">请扫码录入单个板段,一个板段对应一个日志,方便于采集数据对应</span>
|
||||
<scTable
|
||||
ref="tableIn"
|
||||
:apiObj="apiObj"
|
||||
|
|
@ -370,7 +371,7 @@
|
|||
</scTable>
|
||||
</el-card>
|
||||
<!-- 工段物料库存 -->
|
||||
<el-card style="width: 100%" header="工段物料列表" shadow="never">
|
||||
<!-- <el-card style="width: 100%" header="工段物料列表" shadow="never">
|
||||
<scTable
|
||||
ref="tableWm"
|
||||
:apiObj="apiObjWm"
|
||||
|
|
@ -392,7 +393,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-card>
|
||||
</el-card> -->
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
|
|
@ -497,13 +498,13 @@ export default {
|
|||
check_single: false,
|
||||
},
|
||||
apiObj: null,
|
||||
apiObjWm:null,
|
||||
// apiObjWm:null,
|
||||
apiObjMuser:null,
|
||||
paramsWm: {
|
||||
page: 0,
|
||||
search:'',
|
||||
mgroup:''
|
||||
},
|
||||
// paramsWm: {
|
||||
// page: 0,
|
||||
// search:'',
|
||||
// mgroup:''
|
||||
// },
|
||||
paramsIn: {
|
||||
page: 0,
|
||||
mlog: "",
|
||||
|
|
@ -609,8 +610,8 @@ export default {
|
|||
that.form.test_file = res.test_file;
|
||||
}
|
||||
that.mgroup = res.mgroup;
|
||||
that.paramsWm.mgroup = res.mgroup;
|
||||
that.paramsWm.search = that.batchContains;
|
||||
// that.paramsWm.mgroup = res.mgroup;
|
||||
// that.paramsWm.search = that.batchContains;
|
||||
that.materialIn = res.material_in;
|
||||
that.deptId = res.belong_dept;
|
||||
that.apiObjWm = that.$API.wpm.wmaterial.list;
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="结束时间" prop="work_end_time">
|
||||
<el-form-item label="结束时间">
|
||||
<el-date-picker
|
||||
v-model="form.work_end_time"
|
||||
type="datetime"
|
||||
|
|
@ -323,7 +323,8 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
disabledDateFn(time) {
|
||||
return time.getTime() > new Date().getTime();
|
||||
let that = this;
|
||||
return time.getTime() < new Date(that.form.work_start_time).getTime()- 1000 * 60 * 60*24;
|
||||
},
|
||||
gettestitem(){
|
||||
let that = this;
|
||||
|
|
|
|||
|
|
@ -298,8 +298,14 @@ export default {
|
|||
},
|
||||
//获取任务列表
|
||||
getMtask() {
|
||||
console.log(this.materialIn);
|
||||
let that = this;
|
||||
this.$API.pm.mtask.list.req({ page: 0, mgroup: that.mgroup, state: 20 }).then((res) => {
|
||||
let obj = {};
|
||||
obj.page = 0;
|
||||
obj.state = 20;
|
||||
obj.mgroup = that.mgroup;
|
||||
obj.route__material_in = that.materialIn;
|
||||
this.$API.pm.mtask.list.req(obj).then((res) => {
|
||||
that.options = res;
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -314,6 +314,16 @@
|
|||
style="width: 100%"
|
||||
@change="defectidsChange"
|
||||
>
|
||||
<template #header v-if="route_code=='zhongjian1'||route_code=='fenjian'||route_code=='zhongjian2'||route_code=='chengpingneiwaichujian'||route_code=='chengpneizhifujian'||route_code=='chengpingxinengjiance'||
|
||||
route_code=='chenpjianchicunjiance'||route_code=='chengpwaiguanfujianyi'||route_code=='chengpwaiguanfujianer'">
|
||||
<el-checkbox
|
||||
v-model="checkAll"
|
||||
:indeterminate="indeterminate"
|
||||
@change="handleCheckAll"
|
||||
>
|
||||
All
|
||||
</el-checkbox>
|
||||
</template>
|
||||
<el-option
|
||||
v-for="item in qct_defects"
|
||||
:key="item.defect"
|
||||
|
|
@ -351,7 +361,6 @@
|
|||
<el-col v-for="item2 in defectlists" :key="item2.id" :span="12">
|
||||
<el-form-item :label="item2.defect_name">
|
||||
<el-switch v-model="item2.value"></el-switch>
|
||||
<!-- <el-input v-model="item2.value"></el-input> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
|
|
@ -458,6 +467,7 @@ export default {
|
|||
route_code:"",
|
||||
wprInputText:"",
|
||||
params: {mlogb:'',page:0},
|
||||
checkAll: false,
|
||||
hideAdd: true,
|
||||
visible: false,
|
||||
setVisible:false,
|
||||
|
|
@ -911,6 +921,24 @@ export default {
|
|||
that.defectlists.push(item);
|
||||
}
|
||||
})
|
||||
if(that.defectlists.length == that.qct_defects.length){
|
||||
that.checkAll = true;
|
||||
}else{
|
||||
that.checkAll = false;
|
||||
}
|
||||
},
|
||||
handleCheckAll(){
|
||||
let that = this;
|
||||
that.defectlists = [];
|
||||
that.form.defectids = [];
|
||||
if(that.checkAll){
|
||||
that.qct_defects.forEach(item => {
|
||||
item.canEdit = true;
|
||||
item.value=null;
|
||||
that.defectlists.push(item);
|
||||
that.form.defectids.push(item.defect);
|
||||
})
|
||||
}
|
||||
},
|
||||
check_start(){
|
||||
this.checkVisible=true;
|
||||
|
|
@ -994,6 +1022,8 @@ export default {
|
|||
this.checkVisible = false;
|
||||
},
|
||||
check_set(){
|
||||
this.wprNumber = "";
|
||||
this.selectWpr = [];
|
||||
this.setVisible=true;
|
||||
},
|
||||
//扫描物料将这一行放到第一行并编辑这一行
|
||||
|
|
|
|||
|
|
@ -68,10 +68,19 @@
|
|||
prop="hour_work"
|
||||
width="80"
|
||||
></el-table-column>
|
||||
<el-table-column label="批次号" min-width="100">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.mlogb_full!==null">
|
||||
<span v-for="item in scope.row.mlogb_full" :key="item.id">
|
||||
<span v-if="item.material_in!==null">{{ item.batch }}、</span>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="生产设备"
|
||||
prop="equipment_name"
|
||||
min-width="150"
|
||||
min-width="130"
|
||||
></el-table-column>
|
||||
<el-table-column label="进度" prop="belong_dept_name" v-if="mgroup_name=='黑化'||mgroup_name=='退火'">
|
||||
<template #default="scope">
|
||||
|
|
@ -86,6 +95,31 @@
|
|||
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否保温" v-if="route_code=='zlybcl'">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.oinfo_json_">{{scope.row.oinfo_json_.是否保温}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="温度" v-if="route_code=='zlybcl'">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.oinfo_json_">{{scope.row.oinfo_json_.温度}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="压力" v-if="route_code=='zlybcl'">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.oinfo_json_">{{scope.row.oinfo_json_.压力}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="刻度" v-if="route_code=='zlybcl'">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.oinfo_json_">{{scope.row.oinfo_json_.刻度}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="压板用时" v-if="route_code=='zlybcl'">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.oinfo_json_">{{scope.row.oinfo_json_.压板用时}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="处理人"
|
||||
prop="handle_user_name"
|
||||
|
|
@ -104,12 +138,11 @@
|
|||
label="结束时间"
|
||||
prop="work_end_time"
|
||||
></el-table-column>
|
||||
<!-- <el-table-column label="是否提交">
|
||||
<el-table-column label="提交人">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.submit_time == null" type="warning">未提交</el-tag>
|
||||
<el-tag v-else type="success">已提交</el-tag>
|
||||
<span v-if="scope.row.submit_user_name">{{ scope.row.submit_user_name }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="提交时间"
|
||||
prop="submit_time"
|
||||
|
|
@ -205,8 +238,8 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
apiObj: null,
|
||||
params: { mgroup: "" ,submit_time__isnull:true,
|
||||
query: " { id,equipment, material_out_name, equipment_name, reminder_interval_list ,mstate_json,belong_dept_name, mgroup_name,handle_user_name,work_start_time,work_end_time,submit_time}"
|
||||
params: { mgroup: "" ,submit_time__isnull:true,with_mlogb:'yes',
|
||||
query: " { id,equipment, material_out_name, equipment_name, reminder_interval_list ,mstate_json,belong_dept_name, mgroup_name,handle_user_name,work_start_time,work_end_time,submit_time,oinfo_json,mlogb_full,submit_user_name}"
|
||||
},
|
||||
query: {submit_time__isnull:true},
|
||||
dialog: {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,27 @@
|
|||
style="padding: 0"
|
||||
>
|
||||
<el-row>
|
||||
<el-col v-if="route==null&&!is_fix">
|
||||
<el-form-item label="工艺步骤">
|
||||
<el-select
|
||||
v-model="form.route"
|
||||
placeholder="工艺步骤"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
@change="changeRoute"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in routeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
<span>[{{ item.routepack_name }}]{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item label="批次号" prop="wm_in">
|
||||
<el-select
|
||||
|
|
@ -429,6 +450,21 @@ export default {
|
|||
that.form.handle_date = that.$TOOL.dateFormat2(new Date());;
|
||||
},
|
||||
methods: {
|
||||
// getRoute() {
|
||||
// let that = this;
|
||||
// that.$API.mtm.route.list.req({ process: that.process, page: 0, routepack__state: 30 }).then((res) => {
|
||||
// that.routeOptions = res;
|
||||
// });
|
||||
// },
|
||||
changeRoute(){
|
||||
let that = this;
|
||||
that.routeOptions.forEach(item=>{
|
||||
if(item.id==that.form.route){
|
||||
console.log('item',item)
|
||||
that.getdefects(item.id,item.material_in,item.material_out);
|
||||
}
|
||||
})
|
||||
},
|
||||
getTeam() {
|
||||
let that = this;
|
||||
let form = {};
|
||||
|
|
@ -475,9 +511,11 @@ export default {
|
|||
that.getUserList();
|
||||
});
|
||||
},
|
||||
getdefects(){
|
||||
getdefects(route,material_in,material_out){
|
||||
let that = this;
|
||||
if(that.is_fix){
|
||||
console.log('getdefects')
|
||||
if(that.is_fix&&that.materialFix!==null&&that.materialFix!==''){
|
||||
console.log('that.materialFix',that.materialFix)
|
||||
that.$API.qm.qct.getQct.req({material: that.materialFix,tag:'process'}).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectform[item.defect_name] = 0;
|
||||
|
|
@ -494,37 +532,42 @@ export default {
|
|||
}
|
||||
})
|
||||
}else{
|
||||
that.$API.qm.qct.getQct.req({material: that.material_in,tag:'process'}).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectinform[item.defect_name] = 0;
|
||||
})
|
||||
that.qct_indefects=res.qct_defects;
|
||||
if(that.mlogindefect.length>0){
|
||||
that.qct_indefects.forEach(item => {
|
||||
that.mlogindefect.forEach(item2=>{
|
||||
if(item.defect==item2.defect){
|
||||
that.defectinform[item.defect_name] = item2.count;
|
||||
}
|
||||
})
|
||||
console.log('route',route)
|
||||
if(route!==null){
|
||||
console.log('material_in',material_in)
|
||||
console.log('material_out',material_out)
|
||||
that.$API.qm.qct.getQct.req({material:material_in,tag:'process'}).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectinform[item.defect_name] = 0;
|
||||
})
|
||||
}
|
||||
})
|
||||
//material_out
|
||||
that.$API.qm.qct.getQct.req({material: that.material_out,tag:'process'}).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectform[item.defect_name] = 0;
|
||||
})
|
||||
that.qct_defects=res.qct_defects;
|
||||
if(that.mlogdefect.length>0){
|
||||
that.qct_defects.forEach(item => {
|
||||
that.mlogdefect.forEach(item2=>{
|
||||
if(item.defect==item2.defect){
|
||||
that.defectform[item.defect_name] = item2.count;
|
||||
}
|
||||
that.qct_indefects=res.qct_defects;
|
||||
if(that.mlogindefect.length>0){
|
||||
that.qct_indefects.forEach(item => {
|
||||
that.mlogindefect.forEach(item2=>{
|
||||
if(item.defect==item2.defect){
|
||||
that.defectinform[item.defect_name] = item2.count;
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
//material_out
|
||||
that.$API.qm.qct.getQct.req({material:material_out,tag:'process'}).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectform[item.defect_name] = 0;
|
||||
})
|
||||
}
|
||||
})
|
||||
that.qct_defects=res.qct_defects;
|
||||
if(that.mlogdefect.length>0){
|
||||
that.qct_defects.forEach(item => {
|
||||
that.mlogdefect.forEach(item2=>{
|
||||
if(item.defect==item2.defect){
|
||||
that.defectform[item.defect_name] = item2.count;
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
getEquipment() {
|
||||
|
|
@ -542,18 +585,23 @@ export default {
|
|||
getRoute() {
|
||||
let that = this;
|
||||
if(!that.is_fix){//正常生产
|
||||
that.$API.mtm.route.item.req(that.route).then(res=>{
|
||||
that.material_in = res.material_in;
|
||||
that.material_out = that.form.material_out = res.material_out;
|
||||
if(that.mlogId){
|
||||
that.getMlogObj();
|
||||
}else{
|
||||
that.getdefects();
|
||||
}
|
||||
|
||||
});
|
||||
if(that.route==null){
|
||||
that.$API.mtm.route.list.req({ process: that.process, page: 0, routepack__state: 30 }).then((res) => {
|
||||
that.routeOptions = res;
|
||||
});
|
||||
}else{
|
||||
that.$API.mtm.route.item.req(that.route).then(res=>{
|
||||
that.material_in = res.material_in;
|
||||
that.material_out = that.form.material_out = res.material_out;
|
||||
if(that.mlogId){
|
||||
that.getMlogObj();
|
||||
}
|
||||
});
|
||||
}
|
||||
}else{
|
||||
// that.getdefects();
|
||||
that.$API.mtm.route.list.req({ process: that.process, page: 0, routepack__state: 30 }).then((res) => {
|
||||
that.routeOptions = res;
|
||||
});
|
||||
}
|
||||
},
|
||||
//获取工段人员
|
||||
|
|
@ -619,7 +667,7 @@ export default {
|
|||
that.materialCount = that.form.count_use =
|
||||
that.form.count_real = that.form.count_ok = item.count;
|
||||
that.form.count_real = item.count-that.form.count_pn_jgqbl;
|
||||
that.getdefects();
|
||||
that.getdefects(that.route,that.material_in,that.material_out);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -648,7 +696,7 @@ export default {
|
|||
console.log("this.$API.wpm.mlog.item", res);
|
||||
that.mlogindefect = res.mlogindefect;
|
||||
that.mlogdefect = res.mlogdefect;
|
||||
that.getdefects();
|
||||
that.getdefects(that.route,that.material_in,that.material_out);
|
||||
})
|
||||
},
|
||||
//表单注入数据
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<el-card style="width: 100%" header="基本信息" shadow="never">
|
||||
<el-button type="primary" @click="handlePrint" style="position: absolute;right: 20px;">打印</el-button>
|
||||
<el-descriptions>
|
||||
<el-descriptions-item label="工艺路线">{{
|
||||
<el-descriptions-item label="工艺步骤">{{
|
||||
fmlogItem.route_name
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="任务编号">{{
|
||||
|
|
@ -29,8 +29,7 @@
|
|||
v-if="fmlogItem.submit_time == null"
|
||||
icon="el-icon-plus"
|
||||
@click="table_add"
|
||||
>新增</el-button
|
||||
>
|
||||
>新增</el-button>
|
||||
<scScanner @scanResult="codeTextChange" style="margin:0 10px;"></scScanner>
|
||||
<el-input
|
||||
ref="codeInput"
|
||||
|
|
@ -263,10 +262,11 @@ export default {
|
|||
that.fmlogItem = res;
|
||||
that.route = res.route;
|
||||
that.is_fix = res.is_fix;
|
||||
that.material_in = that.material_in;
|
||||
that.material_out = that.material_out;
|
||||
that.paramsWm.mgroup = res.mgroup;
|
||||
that.apiObjWm = that.$API.wpm.wmaterial.list;
|
||||
that.getMlogs();
|
||||
|
||||
});
|
||||
},
|
||||
getMlogs(){
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@
|
|||
type="primary"
|
||||
v-if="
|
||||
(scope.row.send_mgroup == mgroupId||deptId==scope.row.send_dept)&&
|
||||
scope.row.submit_time == null
|
||||
scope.row.submit_time == null&&scope.row.mtype == 10
|
||||
"
|
||||
>编辑</el-button
|
||||
>
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@
|
|||
<el-form-item label="总计:">
|
||||
{{ totalCount }}
|
||||
</el-form-item>
|
||||
<el-form-item label="原始物料" v-if="mode!='add'&&form.mtype==20" style="margin-left: 20px;">
|
||||
<el-col >{{ form.batch }}</el-col>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row v-show="addShow">
|
||||
<el-col>
|
||||
|
|
@ -59,7 +62,7 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
|
||||
<el-col :span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="交接物料">
|
||||
<el-input v-model="listItem.label" disabled></el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -371,6 +374,7 @@ export default {
|
|||
that.mgroupOptions = res;
|
||||
if(res.length==1){
|
||||
that.form.recive_mgroup = res[0].id;
|
||||
that.getUserList2();
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -546,7 +550,7 @@ export default {
|
|||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
console.log(data)
|
||||
console.log('交接记录查看',data)
|
||||
let that = this;
|
||||
Object.assign(this.form, data);
|
||||
that.totalCount = 0;
|
||||
|
|
|
|||
|
|
@ -109,13 +109,10 @@ export default {
|
|||
let paths = this.$route.path;
|
||||
let arr = paths.split("/");
|
||||
this.mgroup_code = arr[2];
|
||||
console.log('this.mgroup_code',this.mgroup_code);
|
||||
that.getMgroups(this.mgroup_code);
|
||||
},
|
||||
methods: {
|
||||
handleChange(value) {
|
||||
this.value = value;
|
||||
console.log("Selected value:", value);
|
||||
},
|
||||
getMgroups(code){
|
||||
let that = this;
|
||||
|
|
|
|||
|
|
@ -119,13 +119,10 @@ export default {
|
|||
let paths = this.$route.path;
|
||||
let arr = paths.split("/");
|
||||
this.mgroup_code = arr[2];
|
||||
console.log('this.mgroup_code',this.mgroup_code);
|
||||
that.getMgroups(this.mgroup_code);
|
||||
},
|
||||
methods: {
|
||||
handleChange(value) {
|
||||
this.value = value;
|
||||
console.log("Selected value:", value);
|
||||
},
|
||||
getMgroups(code){
|
||||
let that = this;
|
||||
|
|
|
|||
|
|
@ -322,8 +322,9 @@ export default {
|
|||
let obj = {};
|
||||
obj.wm = item.id;
|
||||
obj.batch = item.batch;
|
||||
obj.count_cando = item.count_cando;
|
||||
obj.count = item.count_cando;
|
||||
obj.count_canhandover = item.count_canhandover;
|
||||
obj.count = item.count_canhandover;
|
||||
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';
|
||||
handoverb.push(obj)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -356,8 +356,9 @@ export default {
|
|||
let obj = {};
|
||||
obj.wm = item.id;
|
||||
obj.batch = item.batch;
|
||||
obj.count_cando = item.count_cando;
|
||||
obj.count = item.count_cando;
|
||||
obj.count_canhandover = item.count_canhandover;
|
||||
obj.count = item.count_canhandover;
|
||||
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';
|
||||
handoverb.push(obj)
|
||||
})
|
||||
}
|
||||
|
|
@ -391,8 +392,9 @@ export default {
|
|||
let obj = {};
|
||||
obj.wm = item.id;
|
||||
obj.batch = item.batch;
|
||||
obj.count_cando = item.count_cando;
|
||||
obj.count = item.count_cando;
|
||||
obj.count_canhandover = item.count_canhandover;
|
||||
obj.count = item.count_canhandover;
|
||||
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';
|
||||
handoverb.push(obj)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,9 +10,11 @@
|
|||
<el-card style="width: 100%" header="基本信息" shadow="never">
|
||||
<el-button type="primary" @click="handlePrint" style="position: absolute;right: 20px;">打印</el-button>
|
||||
<el-descriptions>
|
||||
<el-descriptions-item label="工艺路线">{{
|
||||
mlogItem.routepack_name
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="工艺步骤">
|
||||
<el-tag v-if="mlogItem.is_fix" type="warning">返工</el-tag>
|
||||
<span v-if="mlogItem.material_in_name!==null">{{mlogItem.material_in_name}}-></span>
|
||||
<span v-if="mlogItem.material_out_name!==null">{{mlogItem.material_out_name}}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="输入物料">{{
|
||||
mlogItem.material_in_name
|
||||
}}</el-descriptions-item>
|
||||
|
|
@ -344,6 +346,8 @@
|
|||
:mgroupName = "mgroupName"
|
||||
:codeText = "codeText"
|
||||
:materialIn="materialIn"
|
||||
:process = "process"
|
||||
:hasRoute = "hasRoute"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
>
|
||||
|
|
@ -603,6 +607,9 @@ export default {
|
|||
let that = this;
|
||||
that.$API.wpm.mlog.item.req(that.mlogId).then((res) => {
|
||||
that.mlogItem = res;
|
||||
if(res.route!==null){
|
||||
this.hasRoute = true;
|
||||
}
|
||||
that.mgroupName = res.mgroup_name;
|
||||
if(res.test_file!==null){
|
||||
that.fileList = [{name:res.test_file,url:res.test_file}];
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" v-if="mlogtype!=='rework'">
|
||||
<el-form-item label="工艺步骤" prop="route">
|
||||
<el-form-item label="工艺步骤">
|
||||
<el-select
|
||||
v-model="form.route"
|
||||
placeholder="工艺步骤"
|
||||
|
|
@ -72,6 +72,7 @@
|
|||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
<span>[{{ item.routepack_name }}]{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,28 @@
|
|||
label-width="100px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col v-if="!hasRoute&&!is_fix">
|
||||
<el-form-item label="工艺步骤" prop="route">
|
||||
<el-select
|
||||
v-model="form.route"
|
||||
placeholder="工艺步骤"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
:disabled="mode == 'edit'"
|
||||
@change="routeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in routeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
<span>[{{ item.routepack_name }}]{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item label="批次号" prop="wm_in">
|
||||
<xtSelect
|
||||
|
|
@ -36,36 +58,10 @@
|
|||
<span v-if="scope.row.defect_name !== null" style="color: orangered">{{ scope.row.defect_name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count" width="110px"></el-table-column>
|
||||
<el-table-column label="车间库存" prop="count" width="110px"></el-table-column>
|
||||
<el-table-column label="可用数量" prop="count_cando" width="110px"></el-table-column>
|
||||
</xtSelect>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="批次号" prop="wm_in">
|
||||
<el-select
|
||||
v-model="form.wm_in"
|
||||
placeholder="物料"
|
||||
clearable
|
||||
filterable
|
||||
class="width-100"
|
||||
@change="materialBatchChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.id"
|
||||
:label="item.batch"
|
||||
:value="item.id"
|
||||
>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<div>
|
||||
<span v-if="item.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span>
|
||||
<span v-if="item.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;">返工</span>
|
||||
<span>{{ item.batch }}({{ item.material_name }})</span>
|
||||
<span v-if="item.defect_name !== null" style="color: orangered">{{ item.defect_name }}</span>
|
||||
</div>
|
||||
<span>{{ item.count }}</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="关联任务">
|
||||
|
|
@ -100,7 +96,8 @@
|
|||
<el-col :md="12" :sm="24">
|
||||
<el-form-item :label="mgroupMtype==10?'领用数量':'批次总数'">
|
||||
<el-input-number
|
||||
v-model="selectObj.count_cando"
|
||||
v-model="form.count_use"
|
||||
:max="selectObj.count_cando"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
|
|
@ -191,6 +188,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { max } from 'd3';
|
||||
|
||||
const defaultForm = {
|
||||
mlog: "",
|
||||
mtask: "",
|
||||
|
|
@ -225,6 +224,10 @@ export default {
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hasRoute:{
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
mgroupMtype:{
|
||||
type: String,
|
||||
default: "",
|
||||
|
|
@ -233,6 +236,11 @@ export default {
|
|||
type:Array,
|
||||
default:()=>[]
|
||||
},
|
||||
process:{
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
|
||||
},
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
|
|
@ -269,6 +277,7 @@ export default {
|
|||
options: [],
|
||||
cellsList:[],
|
||||
qct_defects:[],
|
||||
routeOptions: [],
|
||||
materialOptions: [],
|
||||
defectform:{},
|
||||
visible: false,
|
||||
|
|
@ -307,7 +316,13 @@ export default {
|
|||
// that.getMaterial();
|
||||
}
|
||||
if(that.is_fix){}else{
|
||||
this.getdefects();
|
||||
console.log('that.materialIn' ,that.materialIn);
|
||||
if(that.materialIn!==''&&that.materialIn!==null){
|
||||
this.getdefects(that.materialIn);
|
||||
}
|
||||
}
|
||||
if(!this.hasRoute){
|
||||
this.getRoute();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -322,12 +337,29 @@ export default {
|
|||
this.cellsList = data.count_json_from;
|
||||
}
|
||||
},
|
||||
getRoute() {
|
||||
let that = this;
|
||||
that.$API.mtm.route.list
|
||||
.req({ process: that.process, page: 0, routepack__state: 30 })
|
||||
.then((res) => {
|
||||
that.routeOptions = res;
|
||||
if(res.length==1){
|
||||
that.form.route = res[0].id;
|
||||
}
|
||||
});
|
||||
},
|
||||
getMtask() {
|
||||
let that = this;
|
||||
this.$API.pm.mtask.list.req({ page: 0, mgroup: that.mgroup, state: 20 }).then((res) => {
|
||||
that.options = res;
|
||||
});
|
||||
},
|
||||
routeChange(){
|
||||
let that = this;
|
||||
that.$API.mtm.route.item.req(that.form.route).then((res) => {
|
||||
that.form.parent = res.parent;
|
||||
});
|
||||
},
|
||||
//获取车间物料
|
||||
getMaterial() {
|
||||
let that = this;
|
||||
|
|
@ -352,29 +384,29 @@ export default {
|
|||
res.forEach(item => {
|
||||
if(item.batch==that.codeBatch){
|
||||
that.form.wm_in = item.id;
|
||||
that.form.count_use = item.count;
|
||||
that.batch_count = item.count;
|
||||
that.form.count_use = item.count_cando;
|
||||
that.batch_count = item.count_cando;
|
||||
}
|
||||
if(that.form.wm_in == item.id){
|
||||
that.codeBatch=item.batch;
|
||||
that.batch_count = item.count;
|
||||
that.batch_count = item.count_cando;
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
},
|
||||
getdefects(){
|
||||
getdefects(material){
|
||||
let that = this;
|
||||
let material = that.is_fix?that.materialFix:that.materialIn;
|
||||
// let material = that.is_fix?that.materialFix:that.materialIn;
|
||||
that.$API.qm.qct.getQct.req({material: material,tag:'process'}).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectform[item.defect_name] = 0;
|
||||
})
|
||||
that.qct_defects=res.qct_defects;
|
||||
let count_pn_jgqbl = 0;
|
||||
if(data.mlogbdefect.length>0){
|
||||
if(res.mlogbdefect.length>0){
|
||||
that.qct_defects.forEach(item => {
|
||||
data.mlogbdefect.forEach(item2=>{
|
||||
res.mlogbdefect.forEach(item2=>{
|
||||
if(item.defect==item2.defect){
|
||||
count_pn_jgqbl+=item2.count;
|
||||
that.defectform[item.defect_name] = item2.count;
|
||||
|
|
@ -387,19 +419,12 @@ export default {
|
|||
materialBatchChange(){
|
||||
let that = this;
|
||||
that.form.batch = that.selectObj.batch;
|
||||
that.form.count_use = that.selectObj.count;
|
||||
that.form.count_use = that.selectObj.count_cando;
|
||||
that.batch_count = that.selectObj.count;
|
||||
that.materialFix = that.selectObj.material;
|
||||
that.getdefects();
|
||||
// that.materialOptions.forEach(item => {
|
||||
// if(item.id==that.form.wm_in){
|
||||
// that.form.batch = item.batch;
|
||||
// that.form.count_use = item.count;
|
||||
// that.batch_count = item.count;
|
||||
// that.materialFix = item.material;
|
||||
// that.getdefects();
|
||||
// }
|
||||
// });
|
||||
if(that.is_fix){
|
||||
that.materialFix = that.selectObj.material;
|
||||
}
|
||||
that.getdefects(that.selectObj.material);
|
||||
},
|
||||
//添加层组
|
||||
cellsAdd(){
|
||||
|
|
@ -463,7 +488,7 @@ export default {
|
|||
that.isSaveing = true;
|
||||
that.form.mlog = that.mlog;
|
||||
that.form.batch = that.selectObj.batch;
|
||||
that.form.count_use = that.selectObj.count_cando;
|
||||
// that.form.count_use = that.selectObj.count_cando;
|
||||
if(that.mgroupMtype==10&&that.cellsList.length>0){
|
||||
that.form.count_json_from = that.cellsList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,17 +78,13 @@
|
|||
<el-table-column
|
||||
label="生产设备"
|
||||
prop="equipment_name"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="进度" prop="belong_dept_name" v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||
<template #default="scope">
|
||||
<el-progress id="progressbwlq" :percentage="customMethod(scope.row,1)" :stroke-width="20" :color="customMethod(scope.row,2)" :text-inside="true"><span>{{customMethod(scope.row,3)}}</span></el-progress>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="部门/工段"
|
||||
prop="belong_dept_name"
|
||||
>
|
||||
<el-table-column label="部门/工段" prop="belong_dept_name">
|
||||
<template #default="scope">
|
||||
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
|
||||
</template>
|
||||
|
|
@ -115,13 +111,13 @@
|
|||
label="结束时间"
|
||||
prop="work_end_time"
|
||||
></el-table-column>
|
||||
<!-- <el-table-column label="是否提交">
|
||||
<el-table-column label="审批单号">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.submit_time != null" color="green">
|
||||
<CircleCheckFilled />
|
||||
<el-icon v-if="scope.row.ticket !== null" color="green">
|
||||
{{ scope.row.ticket_.sn }}
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="提交时间"
|
||||
prop="submit_time"
|
||||
|
|
@ -138,22 +134,12 @@
|
|||
width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
<!-- <el-button
|
||||
link
|
||||
size="small"
|
||||
v-auth="'mlog.update'"
|
||||
v-if="scope.row.submit_time == null"
|
||||
type="primary"
|
||||
@click.stop="table_edit(scope.row)"
|
||||
>编辑</el-button
|
||||
> -->
|
||||
<el-button
|
||||
link
|
||||
size="small"
|
||||
@click="table_detail(scope.row)"
|
||||
type="primary"
|
||||
>详情</el-button
|
||||
>
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
link
|
||||
size="small"
|
||||
|
|
@ -161,16 +147,21 @@
|
|||
type="danger"
|
||||
v-if="scope.row.submit_time == null"
|
||||
@click.stop="table_del(scope.row, scope.$index)"
|
||||
>删除</el-button
|
||||
>
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
link
|
||||
v-else
|
||||
size="small"
|
||||
type="danger"
|
||||
@click.stop="mlogRevert(scope.row)"
|
||||
>撤回</el-button
|
||||
>
|
||||
>撤回</el-button>
|
||||
<el-button
|
||||
link
|
||||
v-if="scope.row.ticket_!== null&&userId==scope.row.ticket_.create_by&&scope.row.ticket_.state_!==null&&scope.row.ticket_.state_.enable_retreat"
|
||||
size="small"
|
||||
type="danger"
|
||||
@click.stop="mlogWf(scope.row)"
|
||||
>撤回审批</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
|
@ -251,6 +242,7 @@ export default {
|
|||
codeText: "",
|
||||
route_code: "",
|
||||
showHidden:false,
|
||||
userId: this.$TOOL.data.get("USER_INFO").id,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -343,7 +335,15 @@ export default {
|
|||
});
|
||||
});
|
||||
},
|
||||
|
||||
mlogWf(row){
|
||||
this.$confirm(`确定撤回该日志审批吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
this.$API.wf.ticket.ticketRetreat.req(row.ticket).then(res=>{
|
||||
that.$refs.table.refresh();
|
||||
})
|
||||
})
|
||||
},
|
||||
customMethod(row,index){
|
||||
let color = '',context = '';
|
||||
let percent = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue