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

View File

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

View File

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