rollback
xy 10 months ago
parent 47d0b067c6
commit 0a1371bb9f

@ -201,6 +201,28 @@ export async function rollback(data,isLoading=true) {
isLoading
})
}
// 退回不清除记录
export async function rollbackSimple(data,isLoading=true) {
await MessageBox.confirm("确认退回?", "提示")
return request({
method: 'post',
url: '/api/oa/flow/rollback-simple',
data,
isLoading
})
}
// 退回后重新流转方式
export function rollbackJump(data) {
return request({
url: '/api/oa/flow/rollback-jump',
method: 'post',
data
})
}
export function flowLogs(params,isLoading=false) {
return request({
method: 'get',

@ -4,10 +4,10 @@
<vxe-toolbar print custom export>
<template #buttons>
<el-date-picker
:value="select.month"
v-model="select.month"
type="month"
size="small"
value-format="yyyy-MM-dd"
value-format="yyyy-MM"
style="width: 160px;">
</el-date-picker>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 6px;" @click="getList"></el-button>

@ -41,7 +41,7 @@
</template>
<script>
import { flowLogs, rollback } from '@/api/flow'
import { flowLogs, rollback, rollbackSimple } from '@/api/flow'
import { PopupManager } from 'element-ui/lib/utils/popup'
import { defaultModalSize } from '@/settings'
export default {
@ -86,7 +86,8 @@ export default {
}
try {
this.form.id = this.flow.id;
const res = await rollback(this.form)
const res = await rollbackSimple(this.form)
// const res = await rollback(this.form)
this.$message({
message: res,
duration: 2000,

@ -18,8 +18,7 @@
<el-steps :space="120" finish-status="success" align-center>
<template v-if="!isFirstNode">
<el-step
v-for="step in config.logs"
v-if="(step.flow_node_id !== node.id && step.status !== -1)"
v-for="step in config.logs ? config.logs.slice(0, -1) : []"
:title="step.node.name"
:status="step.status !== -1 ? 'success' : 'error'"
icon="el-icon-circle-check"
@ -35,10 +34,14 @@
status="wait"
>
<template #title>
<el-tooltip class="item" effect="dark" :content="(node.nextNodes && node.nextNodes instanceof Array) ? node.nextNodes.map(i => i.name).toString() : ''" placement="bottom">
<div>
<div style="max-width: 180px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
<span v-for="(nextNode, index) in ((node.nextNodes && node.nextNodes instanceof Array) ? node.nextNodes : [])">{{ index === 0 ? '' : ',' }}{{ nextNode.name }}</span>
</div>
<div v-if="node.nextNodes">{{ node.nextNodes.length }}</div>
</div>
</el-tooltip>
</template>
</el-step>
</el-steps>
@ -248,11 +251,13 @@ import { generateRandomString } from '@/utils'
import {
create,
deal,
fieldConfig, flowList,
fieldConfig,
flowList,
preConfig,
preDeal,
updateNodeTime,
view,
rollbackJump
} from "@/api/flow";
import { deepCopy } from "@/utils";
import { validation, validationName } from "@/utils/validate";
@ -767,7 +772,35 @@ export default {
if (this.$route.query.flow_id) {
copyForm["temporary_save"] = 0;
}
callback = () => (this.isShowAssign = true);
callback = () => {
if (this.isRollbackNode) {
this.$confirm('是否直接流转至退回人节点', '提示', {
distinguishCancelAndClose: true,
confirmButtonText: '流转至退回人节点',
cancelButtonText: '重新流转'
}).then(async _ => {
try {
const res = await rollbackJump({
id: this.$route.query.flow_id,
way: 2
})
this.$router.push("/flow/list/todo")
} catch (err) {
console.error(err)
}
}).catch(async(action) => {
if (action === 'cancel') {
const res = await rollbackJump({
id: this.$route.query.flow_id,
way: 1
})
this.isShowAssign = true
}
})
} else {
this.isShowAssign = true
}
};
break;
}
@ -817,7 +850,7 @@ export default {
})
})
}
},
}
},
computed: {
device() {
@ -837,6 +870,21 @@ export default {
node() {
return this.config?.currentNode || {};
},
isRollbackNode() {
if (this.config.logs && this.config.logs instanceof Array && this.config.logs?.length > 0) {
if (this.config.logs.at(-1)?.flow_node_id === this.node.id) {
if (this.config.logs.at(-2)?.hasOwnProperty('status')) {
return this.config.logs.at(-2).status === -1
} else {
return false
}
} else {
return false
}
} else {
return false
}
},
scriptContent() {
if (this.config?.customModel?.view_js && this.$route.query.flow_id && /\/detail/.test(this.$route.path)) {
return this.config?.customModel?.view_js;

@ -124,10 +124,13 @@
:row-config="{ keyField: 'id' }"
:custom-config="{ mode: 'popup' }"
:data="list"
:menu-config="menuConfig"
@cell-click="cellClickEvent"
@cell-dblclick="cellDblclickEvent"
@checkbox-change="checkboxChange"
@checkbox-all="checkboxChange"
@menu-click="contextMenuClickEvent"
>
<vxe-column type="checkbox" width="50" align="center"></vxe-column>
<vxe-column :visible="$store.getters.device === 'mobile'" field="m-operate" type="expand" title="操作" width="60" align="center">
@ -486,6 +489,23 @@ export default {
};
},
methods: {
contextMenuClickEvent({ menu, row, column }) {
switch (menu.code) {
case 'edit':
//
if (row && column) {
const target = this.$router.resolve({
path: '/flow/edit',
query: {
flow_id: row.id
}
})
window.open(target.href, '_blank')
}
break
default:
}
},
cellClickEvent(e) {
if (e.column?.field !== 'title') return
this.listPopoverId = e.row.id
@ -603,6 +623,20 @@ export default {
}
},
computed: {
menuConfig() {
if (this.$store.state.user.adminId === 1) {
return {
className: 'my-menus',
body: {
options: [
[
{ code: 'edit', name: '编辑', prefixConfig: { icon: 'vxe-icon-feedback' } },
],
]
}
}
}
}
},
watch: {
'select.custom_model_id': {

Loading…
Cancel
Save