feat: 流程物理与逻辑删除

saber
ssc 4 years ago
parent eb9b8e464c
commit 806545c7ad
  1. 11
      src/api/plugin/workflow/ops.js
  2. 4
      src/views/plugin/workflow/mixins/ex-form.js
  3. 3
      src/views/plugin/workflow/ops/done.vue
  4. 63
      src/views/plugin/workflow/ops/list.vue
  5. 1
      src/views/plugin/workflow/process/components/flow.vue
  6. 3
      src/views/plugin/workflow/process/done.vue
  7. 3
      src/views/plugin/workflow/process/send.vue

@ -188,4 +188,15 @@ export const getList = (current, size, params) => {
method: 'post',
data
})
}
/**
* 删除流程
*/
export const deleteProcess = (data) => {
return request({
url: `${prefix}/deleteProcess`,
method: 'post',
data
})
}

@ -442,6 +442,10 @@ export default {
comment = '撤销:' + fullMessage
ff.class = 'nodeWarn'
}
if (type == 'deleteProcessComment') {
comment = '删除流程:' + fullMessage
ff.class = 'nodeError'
}
if (type == 'comment') {
comment = '审批:' + fullMessage
ff.class = 'nodeSuccess'

@ -174,6 +174,9 @@ export default {
}, {
label: '已撤销',
value: 'withdraw'
}, {
label: '已删除',
value: 'deleted'
}],
type: 'select',
search: true

@ -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 }

@ -71,6 +71,7 @@ export default {
deleteMultiInstanceComment: '减签',
withdrawComment: '撤销',
recallComment: '撤回',
deleteProcessComment: '删除流程',
comment: '审批意见'
}
}

@ -136,6 +136,9 @@ export default {
}, {
label: '已撤销',
value: 'withdraw'
}, {
label: '已删除',
value: 'deleted'
}],
type: 'select',
search: true

@ -140,6 +140,9 @@ export default {
}, {
label: '被驳回',
value: 'reject'
}, {
label: '已删除',
value: 'deleted'
}],
type: 'select',
search: true

Loading…
Cancel
Save