Compare commits

...

2 Commits

Author SHA1 Message Date
xy 6a6c6a60ba Merge branch 'master' into rollback
9 months ago
xy 0a1371bb9f rollback
10 months ago

@ -210,6 +210,28 @@ export async function rollback(data,isLoading=true) {
isLoading 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) { export function flowLogs(params,isLoading=false) {
return request({ return request({
method: 'get', method: 'get',

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

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

@ -18,8 +18,7 @@
<el-steps :space="120" finish-status="success" align-center> <el-steps :space="120" finish-status="success" align-center>
<template v-if="!isFirstNode"> <template v-if="!isFirstNode">
<el-step <el-step
v-for="step in config.logs" v-for="step in config.logs ? config.logs.slice(0, -1) : []"
v-if="(step.flow_node_id !== node.id && step.status !== -1)"
:title="step.node.name" :title="step.node.name"
:status="step.status !== -1 ? 'success' : 'error'" :status="step.status !== -1 ? 'success' : 'error'"
icon="el-icon-circle-check" icon="el-icon-circle-check"
@ -35,10 +34,14 @@
status="wait" status="wait"
> >
<template #title> <template #title>
<div style="max-width: 180px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> <el-tooltip class="item" effect="dark" :content="(node.nextNodes && node.nextNodes instanceof Array) ? node.nextNodes.map(i => i.name).toString() : ''" placement="bottom">
<span v-for="(nextNode, index) in ((node.nextNodes && node.nextNodes instanceof Array) ? node.nextNodes : [])">{{ index === 0 ? '' : ',' }}{{ nextNode.name }}</span> <div>
</div> <div style="max-width: 180px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
<div v-if="node.nextNodes">{{ node.nextNodes.length }}</div> <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> </template>
</el-step> </el-step>
</el-steps> </el-steps>
@ -248,11 +251,13 @@ import { generateRandomString } from '@/utils'
import { import {
create, create,
deal, deal,
fieldConfig, flowList, fieldConfig,
flowList,
preConfig, preConfig,
preDeal, preDeal,
updateNodeTime, updateNodeTime,
view, view,
rollbackJump
} from "@/api/flow"; } from "@/api/flow";
import { deepCopy } from "@/utils"; import { deepCopy } from "@/utils";
import { validation, validationName } from "@/utils/validate"; import { validation, validationName } from "@/utils/validate";
@ -783,7 +788,35 @@ export default {
if (this.$route.query.flow_id) { if (this.$route.query.flow_id) {
copyForm["temporary_save"] = 0; 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; break;
} }
@ -833,7 +866,7 @@ export default {
}) })
}) })
} }
}, }
}, },
computed: { computed: {
device() { device() {
@ -854,6 +887,21 @@ export default {
node() { node() {
return this.config?.currentNode || {}; 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() { scriptContent() {
if (this.config?.customModel?.view_js && this.$route.query.flow_id && /\/detail/.test(this.$route.path)) { if (this.config?.customModel?.view_js && this.$route.query.flow_id && /\/detail/.test(this.$route.path)) {
return this.config?.customModel?.view_js; return this.config?.customModel?.view_js;

Loading…
Cancel
Save