|
|
|
|
@ -26,6 +26,18 @@ |
|
|
|
|
size="small" |
|
|
|
|
icon="el-icon-search" |
|
|
|
|
@click="handleFlow(row)">流程图</el-button> |
|
|
|
|
<el-button v-if="permission.wf_ops_delete_process" |
|
|
|
|
type="text" |
|
|
|
|
size="small" |
|
|
|
|
icon="el-icon-delete" |
|
|
|
|
@click="handleDeleteProcess(row)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #menuLeft> |
|
|
|
|
<el-button v-if="permission.wf_ops_delete_process" |
|
|
|
|
type="danger" |
|
|
|
|
size="mini" |
|
|
|
|
icon="el-icon-delete" |
|
|
|
|
@click="handleDeleteProcess()">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
|
|
|
|
|
@ -52,7 +64,7 @@ |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { detail } from '@/api/plugin/workflow/process' |
|
|
|
|
import { processList as getList } from "@/api/plugin/workflow/ops"; |
|
|
|
|
import { processList as getList, deleteProcess } from "@/api/plugin/workflow/ops"; |
|
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
|
|
|
|
|
|
import TaskDetail from './detail.vue' |
|
|
|
|
@ -183,6 +195,9 @@ export default { |
|
|
|
|
}, { |
|
|
|
|
label: '被驳回', |
|
|
|
|
value: 'reject' |
|
|
|
|
}, { |
|
|
|
|
label: '已删除', |
|
|
|
|
value: 'deleted' |
|
|
|
|
}], |
|
|
|
|
type: 'select', |
|
|
|
|
search: true |
|
|
|
|
@ -205,12 +220,56 @@ export default { |
|
|
|
|
ids() { |
|
|
|
|
let ids = []; |
|
|
|
|
this.selectionList.forEach(ele => { |
|
|
|
|
ids.push(ele.taskId); |
|
|
|
|
ids.push(ele.processInstanceId); |
|
|
|
|
}); |
|
|
|
|
return ids.join(","); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
handleDeleteProcess(row) { |
|
|
|
|
let processInstanceId |
|
|
|
|
if (row && row.processInstanceId) { |
|
|
|
|
processInstanceId = row.processInstanceId |
|
|
|
|
} else { |
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
this.$message.warning("请选择至少一条数据") |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
processInstanceId = this.ids |
|
|
|
|
} |
|
|
|
|
this.$confirm('<p><span style="color: red;">逻辑删除</span>:进行中的流程直接结束,但会保留历史数据,标记为已删除。删除后无法恢复成进行中。</p><p><span style="color: red;">物理删除</span>:完全删除所有数据,无法恢复。</p>', '警告', { |
|
|
|
|
confirmButtonText: '逻辑删除', |
|
|
|
|
cancelButtonText: '物理删除', |
|
|
|
|
type: 'warning', |
|
|
|
|
distinguishCancelAndClose: true, |
|
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$prompt('请输入删除原因', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
inputPattern: /^[\s\S]*.*[^\s][\s\S]*$/, |
|
|
|
|
inputErrorMessage: '请输入删除原因' |
|
|
|
|
}).then(({ value }) => { |
|
|
|
|
deleteProcess({ processInstanceId, comment: value }).then(() => { |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.onLoad(this.page, this.query) |
|
|
|
|
}) |
|
|
|
|
}).catch(() => { |
|
|
|
|
}) |
|
|
|
|
}).catch((action) => { |
|
|
|
|
if (action == 'cancel') { |
|
|
|
|
this.$confirm('二次确认!此操作将永久删除流程数据且无法恢复!', '警告', { |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
deleteProcess({ processInstanceId, status: 'force' }).then(() => { |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.onLoad(this.page, this.query) |
|
|
|
|
}) |
|
|
|
|
}).catch(() => { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleDetail(row) { |
|
|
|
|
this.dynamicRoute(row, 'detail', true).then(() => { |
|
|
|
|
this.form = { ...row } |
|
|
|
|
|