fix:光芯动态路由后各工序页面抽离(分为fmlog>index2和mlog>index)

This commit is contained in:
shijing 2025-03-11 16:49:58 +08:00
parent a6008e4cdc
commit c0d336d85c
2 changed files with 260 additions and 0 deletions

130
src/views/wpm_gx/index.vue Normal file
View File

@ -0,0 +1,130 @@
<!-- 最新版生产执行页面 -->
<template>
<el-container>
<el-header>
<el-segmented
v-model="values"
:options="options"
size="default"
></el-segmented>
</el-header>
<el-main id="elMain" class="nopadding">
<!-- 日志 -->
<mlogs
v-if="values == '日志'&&componentsShow"
:mgroupName="mgroupName"
:mgroupId="mgroupId"
:mgroupcode="mgroup_code"
:processId="mgroupProcess"
:deptId = "mgroupDept"
style="height: 60%"
></mlogs>
<mtask
v-if="values == '日志'&&componentsShow"
:mgroupId="mgroupId"
:deptId = "mgroupDept"
:mgroupName="mgroupName"
:processId="mgroupProcess"
:mgroupcode="mgroup_code"
style="height: 40%"
></mtask>
<!-- 交接记录 -->
<handover
v-else-if="values == '交接记录'&&componentsShow"
:mgroupId="mgroupId"
:deptId = "mgroupDept"
:mgroupName="mgroupName"
:processId="mgroupProcess"
:mgroupcode="mgroup_code"
></handover>
<!-- 库存 -->
<inm v-else-if="values == '来料未完成'&&componentsShow"
:mgroupId="mgroupId"
:deptId = "mgroupDept"
:mgroupName="mgroupName"
:processId="mgroupProcess"
:mgroupcode="mgroup_code"
></inm>
<inmOut v-else-if="values == '出料已完成'"
:mgroupId="mgroupId"
:deptId = "mgroupDept"
:mgroupName="mgroupName"
:processId="mgroupProcess"
:mgroupcode="mgroup_code"
></inmOut>
<record v-else
:mgroupId="mgroupId"
:deptId = "mgroupDept"
:mgroupName="mgroupName"
:processId="mgroupProcess"
:mgroupcode="mgroup_code"
></record>
</el-main>
</el-container>
</template>
<script>
import inm from "./inm.vue";
import inmOut from "./inmOut.vue";
import mlogs from "./mlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
import record from "./inmrecord.vue";
export default {
name: "bx",
components: { inm, inmOut,mlogs, mtask, handover,record },
data() {
return {
mgroups:[],
tableHieght: 200,
options: ["日志", "交接记录", "来料未完成","出料已完成","入库记录"],
values: "日志",
mgroupName: "",
mgroupId: "",
selectedIndex:0,
mgroup_code:'',
mgroupDept:'',
componentsShow:false,
};
},
watch: {
mgroup_code:{
handler(val,oldVal){
console.log('mgroup_code',val,oldVal);
this.mgroup_code = val;
this.getMgroups(val);
},
deep: true
}
},
mounted() {
let that = this;
that.componentsShow=false;
let height = document.getElementById("elMain").clintHeight / 2;
that.tableHieght = height;
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;
that.$API.mtm.mgroup.list.req({page:0,code}).then((res) => {
that.mgroups = res;
that.mgroupName = res[0].name;
that.mgroupId = res[0].id;
that.mgroupProcess = res[0].process;
that.mgroupDept = res[0].belong_dept;
that.componentsShow = true;
});
},
},
};
</script>
<style scoped>
</style>

130
src/views/wpm_gx/index2.vue Normal file
View File

@ -0,0 +1,130 @@
<!-- 最新版生产执行页面 -->
<template>
<el-container>
<el-header>
<el-segmented
v-model="values"
:options="options"
size="default"
></el-segmented>
</el-header>
<el-main id="elMain" class="nopadding">
<!-- 日志 -->
<mlogs
v-if="values == '日志'&&componentsShow"
:mgroupName="mgroupName"
:mgroupId="mgroupId"
:mgroupcode="mgroup_code"
:processId="mgroupProcess"
:deptId = "mgroupDept"
style="height: 60%"
></mlogs>
<mtask
v-if="values == '日志'&&componentsShow"
:mgroupId="mgroupId"
:deptId = "mgroupDept"
:mgroupName="mgroupName"
:processId="mgroupProcess"
:mgroupcode="mgroup_code"
style="height: 40%"
></mtask>
<!-- 交接记录 -->
<handover
v-else-if="values == '交接记录'&&componentsShow"
:mgroupId="mgroupId"
:deptId = "mgroupDept"
:mgroupName="mgroupName"
:processId="mgroupProcess"
:mgroupcode="mgroup_code"
></handover>
<!-- 库存 -->
<inm v-else-if="values == '来料未完成'&&componentsShow"
:mgroupId="mgroupId"
:deptId = "mgroupDept"
:mgroupName="mgroupName"
:processId="mgroupProcess"
:mgroupcode="mgroup_code"
></inm>
<inmOut v-else-if="values == '出料已完成'"
:mgroupId="mgroupId"
:deptId = "mgroupDept"
:mgroupName="mgroupName"
:processId="mgroupProcess"
:mgroupcode="mgroup_code"
></inmOut>
<record v-else
:mgroupId="mgroupId"
:deptId = "mgroupDept"
:mgroupName="mgroupName"
:processId="mgroupProcess"
:mgroupcode="mgroup_code"
></record>
</el-main>
</el-container>
</template>
<script>
import inm from "./inm.vue";
import inmOut from "./inmOut.vue";
import mlogs from "./fmlogs.vue";
import mtask from "./mtask.vue";
import handover from "./handover.vue";
import record from "./inmrecord.vue";
export default {
name: "bx",
components: { inm, inmOut,mlogs, mtask, handover,record },
data() {
return {
mgroups:[],
tableHieght: 200,
options: ["日志", "交接记录", "来料未完成","出料已完成","入库记录"],
values: "日志",
mgroupName: "",
mgroupId: "",
selectedIndex:0,
mgroup_code:'',
mgroupDept:'',
componentsShow:false,
};
},
watch: {
mgroup_code:{
handler(val,oldVal){
console.log('mgroup_code',val,oldVal);
this.mgroup_code = val;
this.getMgroups(val);
},
deep: true
}
},
mounted() {
let that = this;
that.componentsShow=false;
let height = document.getElementById("elMain").clintHeight / 2;
that.tableHieght = height;
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;
that.$API.mtm.mgroup.list.req({page:0,code}).then((res) => {
that.mgroups = res;
that.mgroupName = res[0].name;
that.mgroupId = res[0].id;
that.mgroupProcess = res[0].process;
that.mgroupDept = res[0].belong_dept;
that.componentsShow = true;
});
},
},
};
</script>
<style scoped>
</style>