fix:日志详情添加停机时间,修正新增编辑的bug

This commit is contained in:
shijing 2024-05-09 16:25:14 +08:00
parent 979ad5870d
commit ce9fdf52b4
1 changed files with 35 additions and 3 deletions

View File

@ -325,6 +325,10 @@
label="发生时间"
prop="start_time"
></el-table-column>
<el-table-column
label="结束时间"
prop="end_time"
></el-table-column>
<el-table-column
label="原因类别"
prop="cate"
@ -383,13 +387,27 @@
highlightCurrentRow
>
<el-table-column type="index" width="50" />
<el-table-column label="处理班组">
<el-table-column label="班组名称">
<template #default="scope">
<span v-if="scope.row.sflog_">{{
scope.row.sflog_.shift_name
}}</span>
</template>
</el-table-column>
<el-table-column label="开始时间">
<template #default="scope">
<span v-if="scope.row.sflog_">{{
scope.row.sflog_.start_time
}}</span>
</template>
</el-table-column>
<el-table-column label="结束时间">
<template #default="scope">
<span v-if="scope.row.sflog_">{{
scope.row.sflog_.end_time
}}</span>
</template>
</el-table-column>
<el-table-column label="所在工段">
<template #default="scope">
<span v-if="scope.row.sflog_">{{
@ -550,11 +568,19 @@
</el-form>
<el-footer>
<el-button
v-if="sflogExpVisiable"
type="primary"
:loading="isSaveing"
@click="submit42"
>保存</el-button
>
<el-button
v-else
type="primary"
:loading="isSaveing"
@click="submit4"
>保存</el-button
>
<el-button @click="visible = false"
>取消</el-button
>
@ -715,7 +741,7 @@ export default {
getStlog() {
let obj = {};
obj.page = 0;
obj.sflog = this.form.id;
obj.mgroup = this.mgroupId;
this.$API.wpm.stlog.list.req(obj).then((res) => {
this.stlogList = res;
});
@ -735,18 +761,22 @@ export default {
this.stlogForm.handler = this.$TOOL.data.get("USER_INFO").id;
this.stlogForm.mgroup = this.mgroupId;
this.stlogTitle = "新增异常";
this.sflogExpVisiable = false;
this.visible = true;
},
//
editStlog(row) {
this.stlogTitle = "编辑异常";
this.stlogForm = row;
this.stlogForm.current_sflog = row.sflog;
this.sflogExpVisiable = false;
this.visible = true;
},
handleStlog() {
this.stlogTitle = "异常处理";
this.stlogForm = row;
this.visible = true;
this.sflogExpVisiable = true;
},
//
submit4() {
@ -767,6 +797,8 @@ export default {
that.isSaveing = false;
});
} else if (that.stlogTitle == "编辑异常") {
console.log("that.stlogForm", that.stlogForm);
console.log("that.stlogForm.id", that.stlogForm.id);
that.$API.wpm.stlog.update
.req(that.stlogForm.id, that.stlogForm)
.then((res) => {
@ -794,6 +826,7 @@ export default {
that.getSflogexp(that.clickItem.id);
})
.catch((res) => {
this.sflogExpVisiable = false;
that.isSaveing = false;
});
},
@ -818,7 +851,6 @@ export default {
console.log(row);
this.clickItem = row;
this.getSflogexp(row.id);
this.sflogExpVisiable = true;
},
getSflogexp(id) {
let obj = {};