feat: 补充流程的完结功能,流程页面的按钮读取权限控制
This commit is contained in:
@ -9,13 +9,13 @@
|
|||||||
</slot>
|
</slot>
|
||||||
关闭
|
关闭
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button v-if="!readonly" type="primary" @click="onApproveClick">
|
<a-button v-if="!readonly && hasBtnApprove" type="primary" @click="onApproveClick">
|
||||||
<slot name="icon">
|
<slot name="icon">
|
||||||
<check-circle-outlined />
|
<check-circle-outlined />
|
||||||
</slot>
|
</slot>
|
||||||
同意
|
同意
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button v-if="!readonly" @click="onDenyClick">
|
<a-button v-if="!readonly && hasBtnReject" @click="onDenyClick">
|
||||||
<slot name="icon">
|
<slot name="icon">
|
||||||
<stop-outlined />
|
<stop-outlined />
|
||||||
</slot>
|
</slot>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
<a-dropdown>
|
<a-dropdown>
|
||||||
<template #overlay>
|
<template #overlay>
|
||||||
<a-menu @click="onMoreClick">
|
<a-menu @click="onMoreClick">
|
||||||
<a-menu-item v-if="!readonly" key="terminate">终止</a-menu-item>
|
<a-menu-item v-if="!readonly && hasBtnFinish" key="finish">终止</a-menu-item>
|
||||||
<a-menu-item v-if="!readonly" key="transfer">转办</a-menu-item>
|
<a-menu-item v-if="!readonly" key="transfer">转办</a-menu-item>
|
||||||
<a-menu-item key="flowchart">查看流程图</a-menu-item>
|
<a-menu-item key="flowchart">查看流程图</a-menu-item>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
@ -36,13 +36,20 @@
|
|||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
</a-space>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
<FormInformation :key="renderKey" ref="formInformation" :disabled="readonly"
|
<FormInformation
|
||||||
:formAssignmentData="data.formAssignmentData" :formInfos="data.formInfos" :opinions="data.opinions"
|
:key="renderKey"
|
||||||
:opinionsComponents="data.opinionsComponents" @get-form-configs="(config) => (formConfigs = config)" />
|
ref="formInformation"
|
||||||
|
:disabled="readonly"
|
||||||
|
:formAssignmentData="data.formAssignmentData"
|
||||||
|
:formInfos="data.formInfos"
|
||||||
|
:opinions="data.opinions"
|
||||||
|
:opinionsComponents="data.opinionsComponents"
|
||||||
|
@get-form-configs="(config) => (formConfigs = config)"
|
||||||
|
/>
|
||||||
<Title :font-size="18" default-value="流转信息"></Title>
|
<Title :font-size="18" default-value="流转信息"></Title>
|
||||||
<flow-history :items="getTaskRecords()"></flow-history>
|
<flow-history :items="getTaskRecords()"></flow-history>
|
||||||
<opinion-dialog ref="opinionDlg" />
|
<opinion-dialog ref="opinionDlg" />
|
||||||
<a-modal :visible="showFlowChart" centered class="geg" title="流程图" width="1200px" :closable="false">
|
<a-modal :closable="false" :visible="showFlowChart" centered class="geg" title="流程图" width="1200px">
|
||||||
<process-information :process-id="processId" :xml="data.xml" />
|
<process-information :process-id="processId" :xml="data.xml" />
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<a-button type="primary" @click="closeFlowChart">关闭</a-button>
|
<a-button type="primary" @click="closeFlowChart">关闭</a-button>
|
||||||
@ -90,6 +97,9 @@ const opinionDlg = ref();
|
|||||||
const validateSuccess = ref(false);
|
const validateSuccess = ref(false);
|
||||||
const formInformation = ref();
|
const formInformation = ref();
|
||||||
const showFlowChart = ref(false);
|
const showFlowChart = ref(false);
|
||||||
|
const hasBtnApprove = ref(true);
|
||||||
|
const hasBtnReject = ref(false);
|
||||||
|
const hasBtnFinish = ref(false);
|
||||||
|
|
||||||
let approvalData = reactive({
|
let approvalData = reactive({
|
||||||
isCountersign: false,
|
isCountersign: false,
|
||||||
@ -110,8 +120,11 @@ let approvalData = reactive({
|
|||||||
let approvedType = ref(ApproveType.AGREE);
|
let approvedType = ref(ApproveType.AGREE);
|
||||||
|
|
||||||
function onMoreClick(e) {
|
function onMoreClick(e) {
|
||||||
if (e.key === "flowchart") {
|
const key = e.key;
|
||||||
openFlowChart()
|
if (key === 'flowchart') {
|
||||||
|
openFlowChart();
|
||||||
|
} else if(key === 'finish'){
|
||||||
|
onFinishClick();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,6 +173,12 @@ async function onDenyClick() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function onFinishClick(){
|
||||||
|
approvalData.approvedType = ApproveType.FINISH;
|
||||||
|
approvalData.approvedResult = ApproveCode.FINISH;
|
||||||
|
onFinish('finish');
|
||||||
|
}
|
||||||
|
|
||||||
function flowSuccess() {
|
function flowSuccess() {
|
||||||
opinionDlg.value.toggleDialog({
|
opinionDlg.value.toggleDialog({
|
||||||
isClose: true
|
isClose: true
|
||||||
@ -189,6 +208,18 @@ function reset() {
|
|||||||
approvalData.circulateConfigs = [];
|
approvalData.circulateConfigs = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setBtnStatus() {
|
||||||
|
const btnConfigs = approvalData.buttonConfigs;
|
||||||
|
btnConfigs.forEach((btn) => {
|
||||||
|
const code = btn.buttonCode;
|
||||||
|
if (code === 'reject') {
|
||||||
|
hasBtnReject.value = true;
|
||||||
|
} else if (code === 'finish') {
|
||||||
|
hasBtnFinish.value = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function getTaskRecords() {
|
function getTaskRecords() {
|
||||||
if (data?.taskApproveOpinions?.length) {
|
if (data?.taskApproveOpinions?.length) {
|
||||||
return data.taskApproveOpinions || [];
|
return data.taskApproveOpinions || [];
|
||||||
@ -207,6 +238,7 @@ onMounted(async () => {
|
|||||||
if (!readonly.value) {
|
if (!readonly.value) {
|
||||||
if (res.buttonConfigs) {
|
if (res.buttonConfigs) {
|
||||||
approvalData.buttonConfigs = res.buttonConfigs;
|
approvalData.buttonConfigs = res.buttonConfigs;
|
||||||
|
setBtnStatus();
|
||||||
}
|
}
|
||||||
if (res.relationTasks) {
|
if (res.relationTasks) {
|
||||||
data.predecessorTasks = res.relationTasks;
|
data.predecessorTasks = res.relationTasks;
|
||||||
@ -289,7 +321,7 @@ async function getApproveParams() {
|
|||||||
|
|
||||||
async function onFinish(values) {
|
async function onFinish(values) {
|
||||||
try {
|
try {
|
||||||
if (validateSuccess.value || values === 'reject') {
|
if (validateSuccess.value || values === 'reject' || values === 'finish') {
|
||||||
let params = await getApproveParams();
|
let params = await getApproveParams();
|
||||||
await postApproval(params);
|
await postApproval(params);
|
||||||
flowSuccess();
|
flowSuccess();
|
||||||
|
|||||||
Reference in New Issue
Block a user