fix:棒管综合统计查询条件
This commit is contained in:
parent
e98fdfc91f
commit
bc5e84d2ea
|
|
@ -351,6 +351,26 @@ export default {
|
|||
},
|
||||
},
|
||||
},
|
||||
mloguser: {
|
||||
list: {
|
||||
name: "列表",
|
||||
req: async function (data) {
|
||||
return await http.get(`${config.API_URL}/wpm/mloguser/`, data);
|
||||
},
|
||||
},
|
||||
create: {
|
||||
name: "创建",
|
||||
req: async function (data) {
|
||||
return await http.post(`${config.API_URL}/wpm/mloguser/`, data);
|
||||
},
|
||||
},
|
||||
delete: {
|
||||
name: "删除",
|
||||
req: async function (id) {
|
||||
return await http.delete(`${config.API_URL}/wpm/mloguser/${id}/`);
|
||||
},
|
||||
},
|
||||
},
|
||||
handover: {
|
||||
list: {
|
||||
name: "值班记录列表",
|
||||
|
|
@ -422,6 +442,14 @@ export default {
|
|||
);
|
||||
},
|
||||
},
|
||||
createsubmit: {
|
||||
name: "创建并提交",
|
||||
req: async function (data) {
|
||||
return await http.post(
|
||||
`${config.API_URL}/wpm/handover/create_and_submit/`,data
|
||||
);
|
||||
},
|
||||
},
|
||||
mgroups:{
|
||||
name: "获取可交接的工段",
|
||||
req: async function (data) {
|
||||
|
|
@ -491,6 +519,38 @@ export default {
|
|||
return await http.post(`${config.API_URL}/wpm/ana/put_prod/`, data);
|
||||
},
|
||||
},
|
||||
batchwork:{
|
||||
name: "工段批次加工进度",
|
||||
req: async function (data) {
|
||||
return await http.post(`${config.API_URL}/wpm/ana/batchwork/`, data);
|
||||
},
|
||||
},
|
||||
},
|
||||
// batchlog: {
|
||||
// name: "批次列表",
|
||||
// req: async function (data) {
|
||||
// return await http.get(`${config.API_URL}/wpm/batchlog/`, data);
|
||||
// },
|
||||
// },
|
||||
batchlog: {
|
||||
list: {
|
||||
name: "批次列表",
|
||||
req: async function (data) {
|
||||
return await http.get(`${config.API_URL}/wpm/batchlog/`, data);
|
||||
},
|
||||
},
|
||||
dag: {
|
||||
name: "获取批次的DAG图数据",
|
||||
req: async function (data) {
|
||||
return await http.post(`${config.API_URL}/wpm/batchlog/dag/`, data);
|
||||
},
|
||||
},
|
||||
batchesTo:{
|
||||
name: "获取已指向的批次号",
|
||||
req: async function (data) {
|
||||
return await http.post(`${config.API_URL}/wpm/batchlog/batches_to/`, data);
|
||||
},
|
||||
}
|
||||
},
|
||||
batchst: {
|
||||
name: "批次统计数据",
|
||||
|
|
@ -498,6 +558,12 @@ export default {
|
|||
return await http.get(`${config.API_URL}/wpm/batchst/`, data);
|
||||
},
|
||||
},
|
||||
batchstquery: {
|
||||
name: "批次统计数据",
|
||||
req: async function (data) {
|
||||
return await http.post(`${config.API_URL}/wpm/batchst/cquery/`, data);
|
||||
},
|
||||
},
|
||||
wpr:{
|
||||
list: {
|
||||
name: "动态产品",
|
||||
|
|
@ -511,5 +577,11 @@ export default {
|
|||
return await http.get(`${config.API_URL}/wpmw/wpr/${id}/`);
|
||||
},
|
||||
},
|
||||
newNumber: {
|
||||
name: "最新编号",
|
||||
req: async function (data) {
|
||||
return await http.post(`${config.API_URL}/wpmw/wpr/new_number/`, data);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,276 @@
|
|||
<template>
|
||||
<div v-if="visible">
|
||||
<svg id="mySvg" v-if="visible"></svg>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dagreD3 from "dagre-d3";
|
||||
import * as d3 from "d3";
|
||||
|
||||
export default {
|
||||
name: "degraD3",
|
||||
props: {
|
||||
nodes: {
|
||||
type:Array,
|
||||
default:()=>[]
|
||||
},
|
||||
edges:{
|
||||
type:Array,
|
||||
default:()=>[]
|
||||
},
|
||||
rankdir:{
|
||||
type: String,
|
||||
default: "DL",
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
g:null,
|
||||
visible:false,
|
||||
isSaving: false,
|
||||
type:""
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
nodes: {
|
||||
handler(val) {
|
||||
console.log(val);
|
||||
this.updateGraph();
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
edges: {
|
||||
handler(val) {
|
||||
console.log(val);
|
||||
this.updateGraph();
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
open(){
|
||||
this.visible = true;
|
||||
this.handleWatch();
|
||||
},
|
||||
handleWatch() {
|
||||
let that = this;
|
||||
that.$nextTick(() => {
|
||||
if(that.g!==null){
|
||||
that.updateGraph();
|
||||
}else{
|
||||
that.g = new dagreD3.graphlib.Graph().setGraph({
|
||||
rankdir: that.rankdir,
|
||||
nodesep: 40,
|
||||
edgesep: 25, //两条线之间的距离
|
||||
ranksep: 20, //节点之间的距离
|
||||
marginx: 80,
|
||||
marginy: 10,
|
||||
});
|
||||
// 添加节点
|
||||
that.nodes.forEach((item) => {
|
||||
if(item.id&& item.label){
|
||||
that.g.setNode(item.id, {
|
||||
// 节点标签
|
||||
label: item.label,
|
||||
// 节点形状
|
||||
shape: item.shape,
|
||||
toolText: item.label,
|
||||
//节点样式
|
||||
style: "fill:#fff;stroke:#000",
|
||||
labelStyle: "fill:#000;",
|
||||
rx: 5, //矩形节点圆角度
|
||||
ry: 5,
|
||||
});
|
||||
}
|
||||
});
|
||||
//流转得到线 链接关系
|
||||
that.edges.forEach((transition0) => {
|
||||
that.g.setEdge(transition0.source,transition0.target,{
|
||||
label: transition0.label,// 边标签
|
||||
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px", // 根据后台数据来改变连线的颜色
|
||||
});
|
||||
});
|
||||
// 创建渲染器
|
||||
let render = new dagreD3.render();
|
||||
// 选择 svg 并添加一个g元素作为绘图容器.
|
||||
let svg = d3.select("#mySvg");
|
||||
let inner = svg.append("g");
|
||||
that.inner = inner;
|
||||
// 在绘图容器上运行渲染器生成流程图.
|
||||
render(inner, that.g);
|
||||
let mySvgHeight =document.getElementsByClassName("nodes")[0].getBoundingClientRect().height + 50;
|
||||
let mySvgWdith =document.getElementsByClassName("output")[0].getBoundingClientRect().width+150 ;
|
||||
document.getElementById('mySvg').setAttribute("height", mySvgHeight);
|
||||
document.getElementById('mySvg').setAttribute("width", mySvgWdith);
|
||||
svg.selectAll("g.node").on("click", function(event, d) {
|
||||
svg.selectAll("g.node").style("fill", "white");
|
||||
svg.selectAll("g.node")._groups[0].forEach(item=>{
|
||||
console.log('item',item);
|
||||
d3.select(item).select("rect").style("fill", "#fff"); // 修改为白色
|
||||
})
|
||||
// 改变节点的颜色
|
||||
const node = d3.select(this);
|
||||
const currentColor = node.select("rect").style("fill")
|
||||
// 判断当前颜色,如果是默认颜色,就修改为新的颜色
|
||||
if (currentColor === "rgb(255, 255, 255)") { // 如果当前是白色
|
||||
node.select("rect").style("fill", "#f00"); // 修改为红色
|
||||
} else {
|
||||
node.select("rect").style("fill", "#fff"); // 否则恢复白色
|
||||
}
|
||||
// 调用自定义方法
|
||||
onNodeClick(d);
|
||||
});
|
||||
// 自定义方法:在节点点击时触发
|
||||
function onNodeClick(nodeData) {
|
||||
let batch = "";
|
||||
that.nodes.forEach((item) => {
|
||||
if (item.id === nodeData){
|
||||
batch = item.label;
|
||||
}
|
||||
})
|
||||
that.$emit("nodeClick", batch);
|
||||
// 你可以在这里处理更多的逻辑,例如显示一个提示框,更新图形状态等
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 假设你有一个方法来更新节点和边的数据
|
||||
updateGraph() {
|
||||
let that = this;
|
||||
// 清空现有图形
|
||||
that.g.nodes().forEach(function (v) {
|
||||
that.g.removeNode(v);
|
||||
});
|
||||
that.g.edges().forEach(function (e) {
|
||||
that.g.removeEdge(e);
|
||||
});
|
||||
|
||||
// 重新添加节点
|
||||
that.nodes.forEach((item) => {
|
||||
if (item.id && item.label) {
|
||||
that.g.setNode(item.id, {
|
||||
label: item.label,
|
||||
shape: item.shape,
|
||||
toolText: item.label,
|
||||
style: "fill:#fff;stroke:#000",
|
||||
labelStyle: "fill:#000;",
|
||||
rx: 5,
|
||||
ry: 5,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 重新添加边
|
||||
that.edges.forEach((transition0) => {
|
||||
that.g.setEdge(transition0.source, transition0.target, {
|
||||
label: transition0.label,
|
||||
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px",
|
||||
});
|
||||
});
|
||||
let render = new dagreD3.render();
|
||||
// 渲染更新后的图形
|
||||
render(that.inner, that.g);
|
||||
// 获取新的 SVG 尺寸
|
||||
let mySvgHeight = document.getElementsByClassName("nodes")[0]?.getBoundingClientRect().height + 50;
|
||||
let mySvgWdith = document.getElementsByClassName("output")[0]?.getBoundingClientRect().width + 150;
|
||||
|
||||
// 检查节点和边的容器是否存在
|
||||
if (mySvgHeight && mySvgWdith) {
|
||||
// 设置 SVG 尺寸
|
||||
document.getElementById('mySvg').setAttribute("height", mySvgHeight);
|
||||
document.getElementById('mySvg').setAttribute("width", mySvgWdith);
|
||||
} else {
|
||||
console.log("元素尚未加载,无法更新 SVG 尺寸");
|
||||
}
|
||||
},
|
||||
scaleUp() {
|
||||
var svg = document.getElementById("mySvg");
|
||||
svg.style.transform = "scale(0.5)";
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.treeMain {
|
||||
height: 280px;
|
||||
overflow: auto;
|
||||
border: 1px solid #dcdfe6;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.2);
|
||||
background-color: #fefefe;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
border-radius: 5px;
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.svgMark {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: auto;
|
||||
margin: 0;
|
||||
z-index: 2000;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.svgWrapper {
|
||||
background: #fff;
|
||||
width: 800px;
|
||||
margin: 5vh auto;
|
||||
height: 90vh;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.svgItem {
|
||||
padding: 20px 40px 0;
|
||||
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
|
||||
Microsoft YaHei, Arial, sans-serif;
|
||||
font-size: 18px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
svg {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.node rect {
|
||||
stroke: #606266;
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
.edgePath path {
|
||||
stroke: #606266;
|
||||
fill: #333;
|
||||
stroke-width: 1.5px;
|
||||
}
|
||||
|
||||
g.conditions > rect {
|
||||
fill: #00ffd0;
|
||||
stroke: #000;
|
||||
}
|
||||
|
||||
.el-icon-close {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -3459,47 +3459,7 @@ const routes = [
|
|||
perms: ["statistic_qm"],
|
||||
},
|
||||
component: "statistics/product_check2.vue",
|
||||
},
|
||||
// {
|
||||
// "name": "inm_check",
|
||||
// "path": "/statistic/inm_check",
|
||||
// "meta": {
|
||||
// "title": "库存检验统计",
|
||||
// "icon": "el-icon-DataAnalysis",
|
||||
// "perms": ["statistic_qm"]
|
||||
// },
|
||||
// "component": "statistics/inm_check.vue"
|
||||
// },
|
||||
// {
|
||||
// name: "good_check",
|
||||
// path: "/statistic/good_check",
|
||||
// meta: {
|
||||
// title: "成品检验统计",
|
||||
// // icon: "el-icon-DataAnalysis",
|
||||
// perms: ["statistic_qm"],
|
||||
// },
|
||||
// component: "statistics/good_check.vue",
|
||||
// },
|
||||
// {
|
||||
// "name": "behavior_check",
|
||||
// "path": "/statistic/behavior_check",
|
||||
// "meta": {
|
||||
// "title": "性能检验",
|
||||
// "icon": "el-icon-cellphone",
|
||||
// "perms": ["statistic_qm"]
|
||||
// },
|
||||
// "component": "statistics/behavior_check.vue"
|
||||
// },
|
||||
// {
|
||||
// "name": "enter_check",
|
||||
// "path": "/statistic/enter_check",
|
||||
// "meta": {
|
||||
// "title": "入厂检验",
|
||||
// "icon": "el-icon-cellphone",
|
||||
// "perms": ["statistic_qm"]
|
||||
// },
|
||||
// "component": "statistics/enter_check.vue"
|
||||
// },
|
||||
}
|
||||
],
|
||||
},
|
||||
//物料统计
|
||||
|
|
@ -3546,94 +3506,6 @@ const routes = [
|
|||
},
|
||||
component: "statistics/stock_statistics.vue",
|
||||
},
|
||||
//合格数统计——光芯
|
||||
{
|
||||
name: "pass_num_gx",
|
||||
path: "/statistic/pass_num_gx",
|
||||
meta: {
|
||||
title: "合格数统计",
|
||||
icon: "el-icon-DataAnalysis",
|
||||
perms: ["pass_num_gx"],
|
||||
},
|
||||
component: "statistics/pass_num_gx.vue",
|
||||
},
|
||||
//任务进度统计——光芯
|
||||
{
|
||||
name: "task_rate_gx",
|
||||
path: "/statistic/task_rate_gx",
|
||||
meta: {
|
||||
title: "任务进度",
|
||||
icon: "el-icon-DataAnalysis",
|
||||
perms: ["task_rate_gx"],
|
||||
},
|
||||
component: "statistics/task_rate_gx.vue",
|
||||
},
|
||||
//人员绩效统计——光芯
|
||||
{
|
||||
path: "/work_statistics",
|
||||
name: "work_statistics",
|
||||
meta: {
|
||||
title: "人员生产统计",
|
||||
icon: "el-icon-trend-charts",
|
||||
perms: ["work_statistics"],
|
||||
},
|
||||
component: "statistics/work_statistics.vue",
|
||||
},
|
||||
//库存统计——光芯
|
||||
{
|
||||
path: "/statistic_inm",
|
||||
name: "statistic_inm",
|
||||
meta: {
|
||||
title: "库存统计",
|
||||
icon: "el-icon-trend-charts",
|
||||
perms: ["statistic_inm_gx"],
|
||||
},
|
||||
component: "statistics/statistics_inm.vue",
|
||||
},
|
||||
//返工统计——光芯
|
||||
{
|
||||
path: "/rework_gx",
|
||||
name: "rework_gx",
|
||||
meta: {
|
||||
title: "返工统计",
|
||||
icon: "el-icon-trend-charts",
|
||||
perms: ["rework_gx"],
|
||||
},
|
||||
component: "statistics/rework_gx.vue",
|
||||
},
|
||||
//过程检验统计——光芯
|
||||
{
|
||||
path: "/process_check_gx",
|
||||
name: "process_check_gx",
|
||||
meta: {
|
||||
title: "过程检验统计",
|
||||
icon: "el-icon-trend-charts",
|
||||
perms: ["process_check_gx"],
|
||||
},
|
||||
component: "statistics/process_check_gx.vue",
|
||||
},
|
||||
//成品检验统计——光芯
|
||||
{
|
||||
path: "/good_check_gx",
|
||||
name: "good_check_gx",
|
||||
meta: {
|
||||
title: "成品检验统计",
|
||||
icon: "el-icon-trend-charts",
|
||||
perms: ["good_check_gx"],
|
||||
},
|
||||
component: "statistics/good_check_gx.vue",
|
||||
},
|
||||
//成品检验记录——光芯
|
||||
{
|
||||
path: "/check_record_gx",
|
||||
name: "check_record_gx",
|
||||
meta: {
|
||||
title: "成品检验记录",
|
||||
icon: "el-icon-trend-charts",
|
||||
perms: ["check_record_gx"],
|
||||
},
|
||||
component: "statistics/check_record_gx.vue",
|
||||
},
|
||||
//综合查询
|
||||
{
|
||||
name: "total_statistics",
|
||||
|
|
@ -3667,6 +3539,17 @@ const routes = [
|
|||
},
|
||||
component: "statistics/statistics_guan.vue",
|
||||
},
|
||||
//批次统计
|
||||
{
|
||||
name: "statistics_batch",
|
||||
path: "/statistic/statistics_batch",
|
||||
meta: {
|
||||
title: "批次统计",
|
||||
icon: "el-icon-DataAnalysis",
|
||||
perms: ["statistics_batch"],
|
||||
},
|
||||
component: "statistics/batch_statistics.vue",
|
||||
},
|
||||
//综合统计导出
|
||||
{
|
||||
name: "total_export",
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import scWaterMark from './components/scWaterMark'
|
|||
import scQrCode from './components/scQrCode'
|
||||
import scIconSelect from './components/scIconSelect'
|
||||
import scEcharts from './components/scEcharts'
|
||||
import scDegra from './components/scDegra'
|
||||
|
||||
import scStatusIndicator from './components/scMini/scStatusIndicator'
|
||||
import scTrend from './components/scMini/scTrend'
|
||||
|
|
@ -73,6 +74,8 @@ export default {
|
|||
app.component('scFire', scFire);
|
||||
app.component('scIconSelect', scIconSelect);
|
||||
app.component('scEcharts', scEcharts);
|
||||
|
||||
app.component('scDegra', scDegra);
|
||||
|
||||
//注册全局指令
|
||||
app.directive('auth', auth)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,417 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-side>
|
||||
<el-container>
|
||||
<el-header style="height: 40px;">
|
||||
<el-select
|
||||
v-model="query.material_start__type"
|
||||
placeholder="请选择"
|
||||
style="width: 90px;"
|
||||
>
|
||||
<el-option label="原料" :value="30"></el-option>
|
||||
<el-option label="半成品" :value="20"></el-option>
|
||||
<el-option label="成品" :value="10"></el-option>
|
||||
</el-select>
|
||||
<el-input
|
||||
v-model="query.batch"
|
||||
placeholder="请输入批次号"
|
||||
clearable
|
||||
style="width: 150px;"
|
||||
>
|
||||
</el-input>
|
||||
<el-button type="primary" @click="search">查询</el-button>
|
||||
</el-header>
|
||||
<el-main style="padding: 0 1px;">
|
||||
<scTable
|
||||
ref="tablets"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
:params="query"
|
||||
:query="query"
|
||||
stripe
|
||||
@row-click="rowClick"
|
||||
hideDo
|
||||
:paginationLayout="'total, sizes, jumper'"
|
||||
>
|
||||
<el-table-column prop="batch" label="批次号"></el-table-column>
|
||||
<el-table-column prop="version" label="版本" width="60"></el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-side>
|
||||
<el-main id="elMain">
|
||||
<el-container>
|
||||
<el-header style="height: 50%;flex-direction: column;align-items: start;overflow: scroll;">
|
||||
<p style="position: fixed;">批次流转图</p>
|
||||
<scDegra
|
||||
style="margin-top: 50px;"
|
||||
v-if="limitedWatch"
|
||||
ref="degraDialogs"
|
||||
:nodes="nodes"
|
||||
:edges="edges"
|
||||
:rankdir="'LR'"
|
||||
@nodeClick ="nodeClick"
|
||||
@closeDialog="limitedWatch = false"
|
||||
>
|
||||
</scDegra>
|
||||
</el-header>
|
||||
<el-main style="height: 50%;background: #fff;">
|
||||
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick" style="height: 100%;" lazy>
|
||||
<el-tab-pane name="mlog" label="生产日志" style="height: 100%;">
|
||||
<el-container v-if="activeName=='mlog'">
|
||||
<el-main>
|
||||
<scTable
|
||||
ref="tableMlog"
|
||||
:apiObj="apiObj_mlog"
|
||||
row-key="id"
|
||||
:params="params"
|
||||
:query="params"
|
||||
>
|
||||
<el-table-column label="#" type="index" width="50" fixed></el-table-column>
|
||||
<el-table-column label="工艺路线" prop="material_out_name" min-width="130" 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="加工数" prop="count_real"></el-table-column>
|
||||
<el-table-column label="合格数" prop="count_ok"></el-table-column>
|
||||
<el-table-column label="类型">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.is_fix" type="warning">返修</el-tag>
|
||||
<el-tag v-else type="primary">正常</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="部门/工段">
|
||||
<template #default="scope">
|
||||
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="处理人"
|
||||
prop="handle_user_name"
|
||||
width="80"
|
||||
></el-table-column>
|
||||
<el-table-column label="保温剩余时间" v-if="mgroup_name=='黑化'||mgroup_name=='退火'">
|
||||
<template #default="scope">
|
||||
{{ getRemaTime(scope.row) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作日期"
|
||||
prop="handle_date"
|
||||
></el-table-column>
|
||||
<el-table-column label="是否提交" prop="submit_time">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.submit_time!==null" style="color: green;">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="handover" label="交接记录" style="height: 100%;">
|
||||
<el-container v-if="activeName=='handover'">
|
||||
<el-main>
|
||||
<scTable
|
||||
ref="tableHandover"
|
||||
:apiObj="apiObj_handover"
|
||||
row-key="id"
|
||||
:query="params"
|
||||
:params="params"
|
||||
>
|
||||
<el-table-column
|
||||
label="#"
|
||||
type="index"
|
||||
width="50"
|
||||
></el-table-column>
|
||||
<el-table-column type="expand">
|
||||
<template #default="props">
|
||||
<div style="padding-left: 50px">
|
||||
<template v-for="item in props.row.handoverb" :key="item.id">
|
||||
<el-descriptions :column="3">
|
||||
<el-descriptions-item label="批次">
|
||||
{{item.batch}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="数量">
|
||||
{{item.count}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="不合格标记" v-if="item.defect_name!==null">
|
||||
{{item.defect_name}}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="物料"
|
||||
prop="material_name"
|
||||
min-width="140"
|
||||
></el-table-column>
|
||||
<el-table-column label="批次" prop="batch" min-width="80">
|
||||
<template #default="scope">
|
||||
<el-text v-if="scope.row.handoverb.length>0" type="primary">{{scope.row.handoverb.length}}批</el-text>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count" min-width="80"></el-table-column>
|
||||
<el-table-column label="交接类别" prop="type" width="80">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.type == 10" type="primary">正常</el-tag>
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交接类型" prop="mtype" min-width="80">
|
||||
<template #default="scope">
|
||||
<el-text v-if="scope.row.mtype == 10" type="primary">正常</el-text>
|
||||
<el-text v-if="scope.row.mtype == 20" type="success">分批</el-text>
|
||||
<el-text v-if="scope.row.mtype == 30" type="success">合批</el-text>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交送工段" prop="send_mgroup_name" min-width="80">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="交送人"
|
||||
prop="send_user_name"
|
||||
width="80"
|
||||
></el-table-column>
|
||||
<el-table-column label="接收工段" prop="recive_mgroup_name" min-width="80">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="接收人"
|
||||
prop="recive_user_name"
|
||||
width="80"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="交接日期"
|
||||
prop="send_date"
|
||||
width="120"
|
||||
></el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="winm" label="车间库存" style="height: 100%;">
|
||||
<el-container v-if="activeName == 'winm'">
|
||||
<el-main>
|
||||
<scTable
|
||||
ref="tableWinm"
|
||||
:apiObj="apiObj_winm"
|
||||
row-key="id"
|
||||
:query="params2"
|
||||
:params="params2"
|
||||
>
|
||||
<el-table-column type="selection"></el-table-column>
|
||||
<el-table-column label="状态" prop="state">
|
||||
<template #default="scope">
|
||||
<el-tag :type="wmState[scope.row.state]?.type">
|
||||
{{wmState[scope.row.state]?.text}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料名称" min-width="150">
|
||||
<template #default="scope">
|
||||
{{ scope.row.material_name }}
|
||||
<span v-if="scope.row.material_origin != null">({{ scope.row.material_origin_name }})</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次号" prop="batch" min-width="120"></el-table-column>
|
||||
<el-table-column label="部门/工段">
|
||||
<template #default="scope">
|
||||
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count"></el-table-column>
|
||||
<el-table-column label="生产中" prop="count_working"></el-table-column>
|
||||
<el-table-column label="不合格标记" prop="defect_name"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time" width="150"></el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="binm" label="仓库库存" style="height: 100%;">
|
||||
<el-container v-if="activeName == 'binm'">
|
||||
<el-main>
|
||||
<scTable
|
||||
ref="tableBinm"
|
||||
:apiObj="apiObj_binm"
|
||||
row-key="id"
|
||||
stripe
|
||||
:query="params2"
|
||||
:params="params2"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="批次" prop="batch">
|
||||
</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_.specification }}
|
||||
{{ 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_.process_name }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="仓库" prop="warehouse_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="物料存量" prop="count">
|
||||
</el-table-column>
|
||||
<el-table-column label="有效期" prop="expiration_date">
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" prop="update_time">
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="mio" label="出入库记录" style="height: 100%;">
|
||||
<el-container v-if="activeName=='mio'">
|
||||
<el-main>
|
||||
<scTable
|
||||
ref="tableMio"
|
||||
:apiObj="apiObj_mio"
|
||||
row-key="id"
|
||||
:query="params_mio"
|
||||
:params="params_mio"
|
||||
>
|
||||
<el-table-column label="#" type="index" width="40"></el-table-column>
|
||||
<el-table-column label="记录编号" prop="number" min-width="80"></el-table-column>
|
||||
<el-table-column label="出入库类型" prop="type">
|
||||
<template #default="scope">{{ typeDict[scope.row.type] }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="执行部门" prop="belong_dept_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="工段" prop="mgroup_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="type" width="80">
|
||||
<template #default="scope">
|
||||
{{ stateDict[scope.row.state] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="部门执行人" prop="do_user_name" ></el-table-column>
|
||||
<el-table-column label="仓库执行人" prop="mio_user_name"></el-table-column>
|
||||
<el-table-column label="日期" prop="inout_date"></el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import { wmState } from "@/utils/enum.js";
|
||||
export default {
|
||||
name: "batch_statistics",
|
||||
data() {
|
||||
return {
|
||||
wmState,
|
||||
apiObj:this.$API.wpm.batchst,
|
||||
apiObj_mlog:null,
|
||||
apiObj_handover:null,
|
||||
apiObj_winm:null,
|
||||
apiObj_binm:null,
|
||||
apiObj_mio:null,
|
||||
nodes: [],
|
||||
edges: [],
|
||||
stateDict: {
|
||||
10: "创建中",
|
||||
20: "已提交",
|
||||
},
|
||||
typeDict: {
|
||||
do_out: "生产领料",
|
||||
sale_out: "销售发货",
|
||||
pur_in: "采购入库",
|
||||
do_in: "生产入库",
|
||||
other_in: "其他入库",
|
||||
other_out: "其他出库",
|
||||
},
|
||||
//mlog\handover
|
||||
params:{
|
||||
cbatch:'',
|
||||
// query:" { id, name, code, last_data, gather_state }",
|
||||
},
|
||||
params2:{
|
||||
batch:'',
|
||||
},
|
||||
params_mio:{
|
||||
item_mio__batch:'',
|
||||
},
|
||||
query:{
|
||||
batch:'',
|
||||
material_start__type:30,
|
||||
},
|
||||
batch:'',
|
||||
activeName:'',
|
||||
limitedWatch:false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
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) => {
|
||||
res.nodes.forEach(item => {
|
||||
let obj = {};
|
||||
obj.id = item.id;
|
||||
obj.label = item.label;
|
||||
obj.shape = item.shape;
|
||||
obj.version = row.version;
|
||||
that.nodes.push(obj);
|
||||
});
|
||||
that.edges = res.edges;
|
||||
that.limitedWatch = true;
|
||||
that.$nextTick(() => {
|
||||
that.$refs.degraDialogs.open();
|
||||
});
|
||||
})
|
||||
},
|
||||
nodeClick(data){
|
||||
let that = this;
|
||||
that.params.cbatch = data;
|
||||
that.params2.batch = data;
|
||||
that.params_mio.item_mio__batch=data;
|
||||
that.activeName = 'mlog';
|
||||
if( that.apiObj_mlog !==null){
|
||||
that.activeName='mlog';
|
||||
that.$nextTick(() => {
|
||||
that.$refs.tableMlog.queryData(that.params);
|
||||
})
|
||||
}else{
|
||||
that.apiObj_mlog = that.$API.wpm.mlog.list;
|
||||
that.apiObj_handover = that.$API.wpm.handover.list;
|
||||
that.apiObj_winm = that.$API.wpm.wmaterial.list;
|
||||
that.apiObj_binm = that.$API.inm.warehouse.batch;
|
||||
that.apiObj_mio = that.$API.inm.mio.list;
|
||||
}
|
||||
},
|
||||
search(){
|
||||
this.$refs.tablets.queryData(this.query)
|
||||
},
|
||||
handleClick(){ }
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
|
@ -530,7 +530,8 @@ export default {
|
|||
return {
|
||||
params: {
|
||||
ordering:'-last_time',
|
||||
batch__startswith__in:'ZJ2,G05,J2C,A55',
|
||||
material_start__cate:'棒',
|
||||
last_time_isnull:false,
|
||||
},
|
||||
query:{
|
||||
batch__contains:'',
|
||||
|
|
|
|||
|
|
@ -570,7 +570,8 @@ export default {
|
|||
return {
|
||||
params: {
|
||||
ordering:'-last_time',
|
||||
batch__startswith__in:'ZB2,B1',
|
||||
material_start__cate:'管',
|
||||
last_time_isnull:false,
|
||||
},
|
||||
query:{
|
||||
batch__contains:'',
|
||||
|
|
|
|||
Loading…
Reference in New Issue