fix:光子生产执行页面操作后的刷新问题处理

This commit is contained in:
shijing 2025-02-19 09:08:57 +08:00
parent f0eb0708e7
commit 7564db1c48
3 changed files with 116 additions and 229 deletions

View File

@ -180,13 +180,9 @@
type="primary"
icon="el-icon-plus"
@click="addMlog"
v-if="
currentMtask &&
currentMtask.state == 20
"
v-if="currentMtask &&currentMtask.state == 20"
v-auth="'mlog.create'"
>新增</el-button
>
>新增</el-button>
</div>
</el-header>
<el-main class="nopadding">
@ -218,40 +214,19 @@
width="300"
>
<template #default="scope">
<div
v-if="
scope.row.mlogb.length >
0
"
>
<div v-if="scope.row.mlogb.length >0">
<div
v-for="item in scope.row
.mlogb"
v-for="item in scope.row.mlogb"
:key="item"
class="cateItem"
style=""
>
<span
>{{
item.material_out_name
}}|</span
>
<span
style="
color: darkblue;
font-weight: bold;
"
>{{
item.count_ok
}}</span
>
<span>{{item.material_out_name}}|</span>
<span style="color: darkblue;font-weight: bold;">{{item.count_ok}}</span>
</div>
</div>
<div v-else>
{{
scope.row
.material_out_name
}}
{{scope.row.material_out_name}}
</div>
</template>
</el-table-column>
@ -265,17 +240,7 @@
prop="count"
>
<template #default="scope">
<span
>{{
Math.floor(
(scope.row
.count_ok /
scope.row
.count_real) *
100
)
}}%</span
>
<span>{{Math.floor((scope.row.count_ok /scope.row.count_real) *100)}}%</span>
</template>
</el-table-column>
<el-table-column
@ -348,66 +313,37 @@
<el-button
link
type="primary"
@click="
table_edit(scope.row)
"
@click="table_edit(scope.row)"
v-auth="'mlog.update'"
v-if="
scope.row.submit_time ==
null
"
v-if="scope.row.submit_time ==null"
>编辑
</el-button>
<el-button
link
type="danger"
@click="
table_del(scope.row)
"
@click="table_del(scope.row)"
v-auth="'mlog.delete'"
v-if="
scope.row.submit_time ==
null
"
v-if="scope.row.submit_time ==null"
>删除
</el-button>
<el-button
link
type="primary"
@click="
mlog_submit(scope.row)
"
@click="mlog_submit(scope.row)"
v-auth="'mlog.submit'"
v-if="
scope.row.submit_time ==
null
"
v-if="scope.row.submit_time ==null"
:loading="mlogHandleLoading"
>提交
</el-button>
<el-button
link
type="danger"
@click="
mlog_revert(scope.row)
"
@click="mlog_revert(scope.row)"
v-auth="'mlog.submit'"
v-if="
scope.row.submit_time !=
null
"
v-if="scope.row.submit_time !=null"
:loading="mlogHandleLoading"
>撤回
</el-button>
<!-- <el-button
link
type="success"
@click="
table_show(scope.row)
"
>
日志记录
</el-button> -->
</template>
</el-table-column>
</scTable>
@ -843,13 +779,12 @@ export default {
this.$refs.table_mtask.queryData(this.queryMtask);
},
handover_submit(row) {
this.$API.wpm.handover.submit
.req(row.id)
.then((res) => {
this.$refs.table_handover.refresh();
this.$message.success("操作成功");
})
.catch((e) => {});
let that = this;
that.$API.wpm.handover.submit.req(row.id).then((res) => {
that.$refs.table_wm.refresh();
that.$refs.table_handover.refresh();
that.$message.success("操作成功");
}).catch((e) => {});
},
getMlogs() {
this.$API.wpm.mlog.list
@ -895,6 +830,7 @@ export default {
}
},
table_submit(row) {
let that = this;
let lengths = row.mlogs.length,
infoText = "";
if (lengths > 0) {
@ -902,18 +838,16 @@ export default {
} else {
infoText = "该任务没有日志,确定提交吗?";
}
this.$confirm(infoText, "提示", {
that.$confirm(infoText, "提示", {
type: "warning",
}).then(() => {
this.$API.pm.mtask.submit
.req(row.id)
.then((res) => {
this.$message.success("操作成功");
this.$refs.table_wm.refresh();
this.$refs.table_mtask.refresh();
this.mtaskClick(this.currentMtask);
})
.catch((err) => {});
that.$API.pm.mtask.submit.req(row.id).then((res) => {
that.$message.success("操作成功");
that.$refs.table_wm.refresh();
that.$refs.table_mtask.refresh();
that.mtaskClick(that.currentMtask);
that.currentMtask.state = 20
}).catch((err) => {});
});
},
// table_submit(row) {
@ -965,18 +899,19 @@ export default {
this.getMlogs();
},
mlog_submit(row) {
this.mlogHandleLoading = true;
this.$API.wpm.mlog.submit
let that = this;
that.mlogHandleLoading = true;
that.$API.wpm.mlog.submit
.req(row.id)
.then((res) => {
this.$message.success("操作成功");
this.mtaskClick(this.currentMtask);
this.$refs.table_wm.refresh();
this.$refs.table_mtask.refresh();
this.mlogHandleLoading = false;
that.$message.success("操作成功");
that.mtaskClick(that.currentMtask);
that.$refs.table_wm.refresh();
that.$refs.table_mtask.refresh();
that.mlogHandleLoading = false;
})
.catch((err) => {
this.mlogHandleLoading = false;
that.mlogHandleLoading = false;
});
},
//

View File

@ -90,8 +90,8 @@
ref="tableprocess"
row-key="id"
stripe
:hideDo="hideDo"
:data="processList"
:params="paramsProcess"
:apiObj="apiObjProcess"
@row-click="itemClick"
>
<el-table-column
@ -131,9 +131,7 @@
<template #default="scope">
<el-link
type="primary"
@click.stop="
table_submit(scope.row)
"
@click.stop="table_submit(scope.row)"
v-auth="'mtask.submit'"
v-if="
scope.row.state != 40 &&
@ -342,7 +340,7 @@
ref="showDrawer"
v-if="visibleDrawer"
:mtaskId="mtaskId"
@closed="visibleDrawer = false"
@closed="showDrawerClose"
>
</showDrawer>
<check-drawer
@ -400,6 +398,7 @@ export default {
34: "已终止",
40: "已提交",
},
clickRow:{},
wmaterials: [],
hideDo: true,
materialsVisible: false,
@ -412,6 +411,13 @@ export default {
paramsHandover: {
recive_dept__name: "6车间",
},
apiObjProcess:null,
paramsProcess:{
start_date: "",
end_date: "",
mgroup__belong_dept__name: "6车间",
utask: "",
},
queryHandover: {
search: "",
material: "",
@ -483,16 +489,12 @@ export default {
//
rowClick(row) {
let that = this;
this.$API.pm.mtask.list
.req({
start_date: row.start_date,
end_date: row.end_date,
mgroup__belong_dept__name: "6车间",
utask: row.utask,
})
.then((res) => {
that.processList = res.results;
});
that.clickRow = row;
that.paramsProcess.start_date = row.start_date;
that.paramsProcess.end_date = row.end_date;
that.paramsProcess.utask = row.utask;
that.apiObjProcess = that.$API.pm.mtask.list;
that.$refs.tableprocess.refresh();
},
//
itemClick(row) {
@ -522,26 +524,23 @@ export default {
that.$confirm(infoText, "提示", {
type: "warning",
}).then(() => {
that.$API.pm.mtask.submit
.req(row.id)
.then((res) => {
that.$message.success("操作成功");
that.$refs.table_mtask.refresh();
that.mtaskClick(that.currentMtask);
})
.catch((err) => {});
that.$API.pm.mtask.submit.req(row.id).then((res) => {
that.$message.success("操作成功");
that.$refs.table.refresh();
that.$refs.table_wm.refresh();
that.$refs.tableprocess.refresh();
that.$refs.table_handover.refresh();
that.mtaskClick(that.currentMtask);
}).catch((err) => {});
});
},
handover_submit(row) {
let that = this;
that.$API.wpm.handover.submit
.req(row.id)
.then((res) => {
that.$message.success("操作成功");
that.$refs.table_handover.refresh();
that.$refs.table_wm.refresh();
})
.catch((err) => {});
that.$API.wpm.handover.submit.req(row.id).then((res) => {
that.$message.success("操作成功");
that.$refs.table_handover.refresh();
that.$refs.table_wm.refresh();
}).catch((err) => {});
},
//
addHandover() {
@ -564,6 +563,14 @@ export default {
this.$refs.checkDrawers.open();
});
},
showDrawerClose(){
let that = this;
that.visibleDrawer = false;
that.$refs.table.refresh();
that.$refs.table_wm.refresh();
that.$refs.tableprocess.refresh();
that.$refs.table_handover.refresh();
},
},
};
</script>

View File

@ -164,10 +164,7 @@
type="primary"
icon="el-icon-plus"
@click="addMlog"
v-if="
currentMtask &&
currentMtask.state == 20
"
v-if="currentMtask &&currentMtask.state == 20"
v-auth="'mlog.create'"
>新增</el-button
>
@ -193,15 +190,7 @@
min-width="120"
>
<template #default="scope">
<span
v-if="
scope.row.material_out_
"
>{{
scope.row.material_out_
.name
}}</span
>
<span v-if="scope.row.material_out_">{{scope.row.material_out_.name}}</span>
</template>
</el-table-column>
<el-table-column
@ -215,14 +204,8 @@
>
<template #default="scope">
<span
v-if="
scope.row.material_out_
"
>{{
scope.row.material_out_
.specification
}}</span
>
v-if="scope.row.material_out_"
>{{scope.row.material_out_.specification}}</span>
</template>
</el-table-column>
<el-table-column
@ -240,17 +223,7 @@
prop="count"
>
<template #default="scope">
<span
>{{
Math.floor(
(scope.row
.count_ok /
scope.row
.count_real) *
100
)
}}%</span
>
<span>{{Math.floor((scope.row.count_ok /scope.row.count_real) *100)}}%</span>
</template>
</el-table-column>
<el-table-column
@ -318,66 +291,37 @@
<el-button
link
type="primary"
@click="
table_edit(scope.row)
"
@click="table_edit(scope.row)"
v-auth="'mlog.update'"
v-if="
scope.row.submit_time ==
null
"
v-if="scope.row.submit_time ==null"
>编辑
</el-button>
<el-button
link
type="danger"
@click="
table_del(scope.row)
"
@click="table_del(scope.row)"
v-auth="'mlog.delete'"
v-if="
scope.row.submit_time ==
null
"
v-if="scope.row.submit_time ==null"
>删除
</el-button>
<el-button
link
type="primary"
@click="
mlog_submit(scope.row)
"
@click="mlog_submit(scope.row)"
v-auth="'mlog.submit'"
v-if="
scope.row.submit_time ==
null
"
v-if="scope.row.submit_time ==null"
:loading="mlogHandleLoading"
>提交
</el-button>
<el-button
link
type="danger"
@click="
mlog_revert(scope.row)
"
@click="mlog_revert(scope.row)"
v-auth="'mlog.submit'"
v-if="
scope.row.submit_time !=
null
"
v-if="scope.row.submit_time !=null"
:loading="mlogHandleLoading"
>撤回
</el-button>
<!-- <el-button
link
type="success"
@click="
table_show(scope.row)
"
>
日志记录
</el-button> -->
</template>
</el-table-column>
</scTable>
@ -813,13 +757,12 @@ export default {
this.$refs.table_mtask.queryData(this.queryMtask);
},
handover_submit(row) {
this.$API.wpm.handover.submit
.req(row.id)
.then((res) => {
this.$refs.table_handover.refresh();
this.$message.success("操作成功");
})
.catch((e) => {});
let that = this;
that.$API.wpm.handover.submit.req(row.id).then((res) => {
that.$refs.table_handover.refresh();
that.$refs.table_wm.refresh();
that.$message.success("操作成功");
}).catch((e) => {});
},
getMlogs() {
this.$API.wpm.mlog.list
@ -839,6 +782,7 @@ export default {
this.getMlogs();
},
mtask_submit(row) {
let that = this;
let lengths = row.mlogs.length,
infoText = "";
if (lengths > 0) {
@ -846,17 +790,16 @@ export default {
} else {
infoText = "该任务没有日志,确定提交吗?";
}
this.$confirm(infoText, "提示", {
that.$confirm(infoText, "提示", {
type: "warning",
}).then(() => {
this.$API.pm.mtask.submit
.req(row.id)
.then((res) => {
this.$message.success("操作成功");
this.$refs.table_mtask.refresh();
this.mtaskClick(this.currentMtask);
})
.catch((err) => {});
that.$API.pm.mtask.submit.req(row.id).then((res) => {
that.$message.success("操作成功");
that.$refs.table_mtask.refresh();
that.$refs.table_wm.refresh();
that.mtaskClick(that.currentMtask);
that.currentMtask.state = 20
}).catch((err) => {});
});
},
handleSaveSuccess() {
@ -871,17 +814,19 @@ export default {
});
},
mlog_submit(row) {
this.mlogHandleLoading = true;
this.$API.wpm.mlog.submit
let that = this;
that.mlogHandleLoading = true;
that.$API.wpm.mlog.submit
.req(row.id)
.then((res) => {
this.$message.success("操作成功");
this.mtaskClick(this.currentMtask);
this.$refs.table_wm.refresh();
this.mlogHandleLoading = false;
that.$message.success("操作成功");
that.mtaskClick(that.currentMtask);
that.$refs.table_wm.refresh();
that.getMlogs();
that.mlogHandleLoading = false;
})
.catch((err) => {
this.mlogHandleLoading = false;
that.mlogHandleLoading = false;
});
},
//