|
|
|
|
@ -1,156 +1,219 @@ |
|
|
|
|
<template> |
|
|
|
|
<div> |
|
|
|
|
<div style="height: 120px;"></div> |
|
|
|
|
<el-row class="foot-item avue-affix" |
|
|
|
|
:style="{width: isCollapse? 'calc(100% - 80px)': 'calc(100% - 260px)' }" |
|
|
|
|
id="avue-view"> |
|
|
|
|
<div style="height: 120px"></div> |
|
|
|
|
<el-row |
|
|
|
|
class="foot-item avue-affix" |
|
|
|
|
:style="{ |
|
|
|
|
width: isCollapse ? 'calc(100% - 80px)' : 'calc(100% - 260px)', |
|
|
|
|
}" |
|
|
|
|
id="avue-view" |
|
|
|
|
> |
|
|
|
|
<template v-if="process.status == 'todo'"> |
|
|
|
|
<el-button v-if="getButton('wf_pass')" |
|
|
|
|
type="success" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('examine', true)"> |
|
|
|
|
<span v-if="['recall', 'reject'].includes(process.processIsFinished)">重新提交</span> |
|
|
|
|
<span v-else>{{getButton('wf_pass').name}}</span> |
|
|
|
|
<el-button |
|
|
|
|
v-if="getButton('wf_pass')" |
|
|
|
|
type="success" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('examine', true)" |
|
|
|
|
> |
|
|
|
|
<span v-if="['recall', 'reject'].includes(process.processIsFinished)" |
|
|
|
|
>重新提交</span |
|
|
|
|
> |
|
|
|
|
<span v-else>{{ getButton("wf_pass").name }}</span> |
|
|
|
|
</el-button> |
|
|
|
|
<el-button v-if="getButton('wf_effect') && !['recall', 'reject'].includes(process.processIsFinished)" |
|
|
|
|
type="success" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('examine', true)"> |
|
|
|
|
<span >{{getButton('wf_effect').name}}</span> |
|
|
|
|
<el-button |
|
|
|
|
v-if=" |
|
|
|
|
getButton('wf_effect') && |
|
|
|
|
!['recall', 'reject'].includes(process.processIsFinished) |
|
|
|
|
" |
|
|
|
|
type="success" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('examine', true)" |
|
|
|
|
> |
|
|
|
|
<span>{{ getButton("wf_effect").name }}</span> |
|
|
|
|
</el-button> |
|
|
|
|
<el-button v-if="getButton('wf_reject')" |
|
|
|
|
type="danger" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('examine', false)"> |
|
|
|
|
<span v-if="backNodes.length > 1">{{getButton('wf_reject').name}}</span> |
|
|
|
|
<span v-else>取消申请</span> |
|
|
|
|
<el-button |
|
|
|
|
v-if="getButton('wf_reject') && backNodes.length > 1" |
|
|
|
|
type="danger" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('examine', false)" |
|
|
|
|
> |
|
|
|
|
<span v-if="backNodes.length > 1">{{ |
|
|
|
|
getButton("wf_reject").name |
|
|
|
|
}}</span> |
|
|
|
|
</el-button> |
|
|
|
|
<el-button v-if="getButton('wf_transfer')" |
|
|
|
|
type="primary" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('user-select', {type: 'transfer', checkType: 'radio'})">{{getButton('wf_transfer').name}}</el-button> |
|
|
|
|
<el-button v-if="getButton('wf_delegate')" |
|
|
|
|
type="warning" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('user-select', {type: 'delegate', checkType: 'radio'})">{{getButton('wf_delegate').name}}</el-button> |
|
|
|
|
<el-button v-if="getButton('wf_rollback')" |
|
|
|
|
type="success" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="handleRollback">{{getButton('wf_rollback').name}}</el-button> |
|
|
|
|
<el-button v-if="getButton('wf_terminate')" |
|
|
|
|
type="danger" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('terminate')">{{getButton('wf_terminate').name}}</el-button> |
|
|
|
|
<el-button v-if="process.isMultiInstance && getButton('wf_add_instance')" |
|
|
|
|
type="primary" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('user-select', {type: 'addInstance', checkType: 'checkbox'})">{{getButton('wf_add_instance').name}}</el-button> |
|
|
|
|
<el-button |
|
|
|
|
v-if="getButton('wf_reject') && backNodes.length == 1" |
|
|
|
|
type="danger" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('withdraw', 1)" |
|
|
|
|
> |
|
|
|
|
<span>取消申请</span> |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
v-if="getButton('wf_transfer')" |
|
|
|
|
type="primary" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click=" |
|
|
|
|
$emit('user-select', { type: 'transfer', checkType: 'radio' }) |
|
|
|
|
" |
|
|
|
|
>{{ getButton("wf_transfer").name }}</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
v-if="getButton('wf_delegate')" |
|
|
|
|
type="warning" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click=" |
|
|
|
|
$emit('user-select', { type: 'delegate', checkType: 'radio' }) |
|
|
|
|
" |
|
|
|
|
>{{ getButton("wf_delegate").name }}</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
v-if="getButton('wf_rollback')" |
|
|
|
|
type="success" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="handleRollback" |
|
|
|
|
>{{ getButton("wf_rollback").name }}</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
v-if="getButton('wf_terminate')" |
|
|
|
|
type="danger" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('terminate')" |
|
|
|
|
>{{ getButton("wf_terminate").name }}</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
v-if="process.isMultiInstance && getButton('wf_add_instance')" |
|
|
|
|
type="primary" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click=" |
|
|
|
|
$emit('user-select', { type: 'addInstance', checkType: 'checkbox' }) |
|
|
|
|
" |
|
|
|
|
>{{ getButton("wf_add_instance").name }}</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
<el-button v-if="permission.wf_process_withdraw && process.isOwner && process.isReturnable && !['recall', 'reject'].includes(process.processIsFinished)" |
|
|
|
|
type="warning" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('withdraw')">撤销</el-button> |
|
|
|
|
<el-button v-if="getButton('wf_print')" |
|
|
|
|
type="info" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('print')">{{getButton('wf_print').name}}</el-button> |
|
|
|
|
<el-button |
|
|
|
|
v-if=" |
|
|
|
|
permission.wf_process_withdraw && |
|
|
|
|
process.isOwner && |
|
|
|
|
process.isReturnable && |
|
|
|
|
!['recall', 'reject'].includes(process.processIsFinished) |
|
|
|
|
" |
|
|
|
|
type="warning" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('withdraw')" |
|
|
|
|
>撤销</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
v-if="getButton('wf_print')" |
|
|
|
|
type="info" |
|
|
|
|
size="medium" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@click="$emit('print')" |
|
|
|
|
>{{ getButton("wf_print").name }}</el-button |
|
|
|
|
> |
|
|
|
|
</el-row> |
|
|
|
|
<el-dialog :visible.sync="nodeVisible" |
|
|
|
|
append-to-body |
|
|
|
|
title="选择回退节点"> |
|
|
|
|
<avue-form v-if="nodeVisible" |
|
|
|
|
v-model="nodeForm" |
|
|
|
|
:option="nodeOption" |
|
|
|
|
@submit="handleNodeSubmit"></avue-form> |
|
|
|
|
<el-dialog :visible.sync="nodeVisible" append-to-body title="选择回退节点"> |
|
|
|
|
<avue-form |
|
|
|
|
v-if="nodeVisible" |
|
|
|
|
v-model="nodeForm" |
|
|
|
|
:option="nodeOption" |
|
|
|
|
@submit="handleNodeSubmit" |
|
|
|
|
></avue-form> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { backNodes } from '@/api/plugin/workflow/process' |
|
|
|
|
import { backNodes } from "@/api/plugin/workflow/process"; |
|
|
|
|
|
|
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: 'wf-button', |
|
|
|
|
name: "wf-button", |
|
|
|
|
computed: { |
|
|
|
|
...mapGetters(['isCollapse', 'permission']), |
|
|
|
|
...mapGetters(["isCollapse", "permission"]), |
|
|
|
|
}, |
|
|
|
|
props: { |
|
|
|
|
loading: { |
|
|
|
|
type: Boolean, |
|
|
|
|
default: false |
|
|
|
|
default: false, |
|
|
|
|
}, |
|
|
|
|
buttonList: { |
|
|
|
|
type: Array, |
|
|
|
|
default: () => { |
|
|
|
|
return [] |
|
|
|
|
} |
|
|
|
|
return []; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
process: Object, |
|
|
|
|
comment: String |
|
|
|
|
comment: String, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
nodeVisible: false, |
|
|
|
|
nodeForm: {}, |
|
|
|
|
nodeOption: { |
|
|
|
|
column: [{ |
|
|
|
|
label: '节点', |
|
|
|
|
prop: 'nodeId', |
|
|
|
|
type: 'select', |
|
|
|
|
props: { |
|
|
|
|
label: 'nodeName', |
|
|
|
|
value: 'nodeId' |
|
|
|
|
column: [ |
|
|
|
|
{ |
|
|
|
|
label: "节点", |
|
|
|
|
prop: "nodeId", |
|
|
|
|
type: "select", |
|
|
|
|
props: { |
|
|
|
|
label: "nodeName", |
|
|
|
|
value: "nodeId", |
|
|
|
|
}, |
|
|
|
|
span: 24, |
|
|
|
|
rules: [ |
|
|
|
|
{ required: true, message: "请选择回退节点", trigger: "change" }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
span: 24, |
|
|
|
|
rules: [{ required: true, message: '请选择回退节点', trigger: 'change' }] |
|
|
|
|
}] |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
backNodes: [] |
|
|
|
|
} |
|
|
|
|
backNodes: [], |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
'process.taskId': { |
|
|
|
|
"process.taskId": { |
|
|
|
|
handler(val) { |
|
|
|
|
if (val) { |
|
|
|
|
backNodes({ taskId: val }).then(res => { |
|
|
|
|
const list = res.data.data |
|
|
|
|
this.backNodes = list |
|
|
|
|
this.findObject(this.nodeOption.column, 'nodeId').dicData = list |
|
|
|
|
}) |
|
|
|
|
backNodes({ taskId: val }).then((res) => { |
|
|
|
|
const list = res.data.data; |
|
|
|
|
this.backNodes = list; |
|
|
|
|
this.findObject(this.nodeOption.column, "nodeId").dicData = list; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
immediate: true |
|
|
|
|
} |
|
|
|
|
immediate: true, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
handleRollback() { // 指定回退 |
|
|
|
|
handleRollback() { |
|
|
|
|
// 指定回退 |
|
|
|
|
if (!this.comment) { |
|
|
|
|
this.$message.error("请填写批复意见") |
|
|
|
|
return |
|
|
|
|
this.$message.error("请填写批复意见"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.nodeVisible = true |
|
|
|
|
this.nodeVisible = true; |
|
|
|
|
}, |
|
|
|
|
handleNodeSubmit() { // 指定回退确定 |
|
|
|
|
const { nodeId } = this.nodeForm |
|
|
|
|
this.$emit('rollback', nodeId) |
|
|
|
|
handleNodeSubmit() { |
|
|
|
|
// 指定回退确定 |
|
|
|
|
const { nodeId } = this.nodeForm; |
|
|
|
|
this.$emit("rollback", nodeId); |
|
|
|
|
}, |
|
|
|
|
getButton(key) { |
|
|
|
|
return this.buttonList.find(b => b.buttonKey == key) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return this.buttonList.find((b) => b.buttonKey == key); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
@ -170,4 +233,4 @@ export default { |
|
|
|
|
-webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
|
|
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
</style> |
|
|
|
|
|