utask终止

This commit is contained in:
shijing 2024-01-04 13:27:19 +08:00
parent 4b3e3bf1a4
commit 8e5fca3daf
3 changed files with 66 additions and 6 deletions

View File

@ -45,10 +45,13 @@
</el-table-column>
<el-table-column label="任务状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state !== 40">
<el-tag v-if="scope.row.state == 40" type="success">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
<el-tag v-else-if="scope.row.state == 34" type="danger">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else>
{{ state_[scope.row.state] }}
</el-tag>
</template>
@ -89,6 +92,12 @@
<el-button link type="danger">删除</el-button>
</template>
</el-popconfirm>
<el-popconfirm title="确定终止该任务吗?" @confirm.stop="table_stop(scope.row)"
v-if="scope.row.state==30" v-auth="'utask.stop'">
<template #reference>
<el-button link type="danger" v-if="scope.row.state==30">终止</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
@ -177,6 +186,7 @@ export default {
14: "已分解",
20: "已下达",
30: "生产中",
34:'终止',
40: "已提交",
},
start_date:''
@ -298,6 +308,16 @@ export default {
return err;
});
},
table_stop(row) {
this.$API.pm.utask.stop.req(row.id).then((res) => {
this.$message.success("操作成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
},
bindClass(item) {
let classInfo = {
countBlock: true,

View File

@ -47,10 +47,13 @@
</el-table-column>
<el-table-column label="任务状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state !== 40">
<el-tag v-if="scope.row.state == 40" type="success">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
<el-tag v-else-if="scope.row.state == 34" type="danger">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else>
{{ state_[scope.row.state] }}
</el-tag>
</template>
@ -90,6 +93,12 @@
<el-button link type="danger">删除</el-button>
</template>
</el-popconfirm>
<el-popconfirm title="确定终止该任务吗?" @confirm.stop="table_stop(scope.row)"
v-if="scope.row.state==30" v-auth="'utask.stop'">
<template #reference>
<el-button link type="danger">终止</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
@ -149,6 +158,7 @@ export default {
14: "已分解",
20: "已下达",
30: "生产中",
34:'终止',
40: "已提交",
},
tasks: {
@ -286,6 +296,16 @@ export default {
return err;
});
},
table_stop(row) {
this.$API.pm.utask.stop.req(row.id).then((res) => {
this.$message.success("操作成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
},
bindClass(item) {
let classInfo = {
countBlock: true,

View File

@ -45,10 +45,13 @@
</el-table-column>
<el-table-column label="任务状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state !== 40">
<el-tag v-if="scope.row.state == 40" type="success">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
<el-tag v-else-if="scope.row.state == 34" type="danger">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else>
{{ state_[scope.row.state] }}
</el-tag>
</template>
@ -89,6 +92,12 @@
<el-button link type="danger">删除</el-button>
</template>
</el-popconfirm>
<el-popconfirm title="确定终止该任务吗?" @confirm.stop="table_stop(scope.row)"
v-if="scope.row.state==30" v-auth="'utask.stop'">
<template #reference>
<el-button link type="danger">终止</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
@ -176,6 +185,7 @@ export default {
14: "已分解",
20: "已下达",
30: "生产中",
34:'终止',
40: "已提交",
},
start_date:''
@ -297,6 +307,16 @@ export default {
return err;
});
},
table_stop(row) {
this.$API.pm.utask.stop.req(row.id).then((res) => {
this.$message.success("操作成功");
this.$refs.table.refresh();
return res;
})
.catch((err) => {
return err;
});
},
bindClass(item) {
let classInfo = {
countBlock: true,