update 调整业务单据流程提交

This commit is contained in:
gssong 2023-09-30 18:09:11 +08:00
parent f4684fb0dc
commit c245ec7323
2 changed files with 56 additions and 23 deletions

View File

@ -25,10 +25,6 @@
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
v-hasPermi="['workflow:businessForm:edit']">修改</el-button> v-hasPermi="['workflow:businessForm:edit']">修改</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
v-hasPermi="['workflow:businessForm:remove']">删除</el-button>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" <el-button type="warning" plain icon="Download" @click="handleExport"
v-hasPermi="['workflow:businessForm:export']">导出</el-button> v-hasPermi="['workflow:businessForm:export']">导出</el-button>
@ -39,20 +35,36 @@
<el-table v-loading="loading" :data="businessFormList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="businessFormList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" v-if="true" /> <el-table-column label="主键" align="center" prop="id" v-if="false" />
<el-table-column label="申请编码" align="center" prop="applyCode" /> <el-table-column label="申请编码" align="center" prop="applyCode" />
<el-table-column label="表单id" align="center" prop="formId" />
<el-table-column label="表单名称" align="center" prop="formName" /> <el-table-column label="表单名称" align="center" prop="formName" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column align="center" prop="businessStatusName" label="流程状态" min-width="70">
<template #default="scope"> <template #default="scope">
<el-tooltip content="修改" placement="top"> <el-tag type="success">{{ scope.row.processInstanceVo.businessStatusName }}</el-tag>
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" </template>
v-hasPermi="['workflow:businessForm:edit']"></el-button> </el-table-column>
</el-tooltip> <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
<el-tooltip content="删除" placement="top"> <template #default="scope">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" <el-row :gutter="10" class="mb8">
v-hasPermi="['workflow:businessForm:remove']"></el-button> <el-col :span="1.5" v-if="scope.row.processInstanceVo.businessStatus !== 'draft'">
</el-tooltip> <el-button type="text" size="small" icon="Document"
@click="handleApprovalRecord(scope.row.processInstanceVo.id)">审批记录</el-button>
</el-col>
<el-col :span="1.5"
v-if="scope.row.processInstanceVo.businessStatus === 'draft' || scope.row.processInstanceVo.businessStatus === 'cancel' || scope.row.processInstanceVo.businessStatus === 'back'">
<el-button v-hasPermi="['workflow:businessForm:remove']" type="text" size="small" icon="Delete"
@click="handleDelete(scope.row)">删除</el-button>
</el-col>
<el-col :span="1.5" v-if="scope.row.processInstanceVo.businessStatus === 'waiting'">
<el-button type="text" size="small" icon="Notification"
@click="handleCancelProcessApply(scope.row.processInstanceVo.id)">撤销</el-button>
</el-col>
<el-col :span="1.5"
v-if="scope.row.processInstanceVo.businessStatus === 'draft' || scope.row.processInstanceVo.businessStatus === 'cancel' || scope.row.processInstanceVo.businessStatus === 'back'">
<el-button v-hasPermi="['workflow:businessForm:edit']" type="text" size="small" icon="Edit"
@click="handleUpdate(scope.row)">修改</el-button>
</el-col>
</el-row>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -75,16 +87,23 @@
</el-dialog> </el-dialog>
<!-- 提交组件 --> <!-- 提交组件 -->
<submitVerify ref="submitVerifyRef" @submitCallback="submitCallback" @cancelCallback="cancelCallback" /> <submitVerify ref="submitVerifyRef" @submitCallback="submitCallback" @cancelCallback="cancelCallback" />
<!-- 审批记录 -->
<approvalRecord ref="approvalRecordRef" />
</div> </div>
</template> </template>
<script setup name="BusinessForm" lang="ts"> <script setup name="BusinessForm" lang="ts">
import { listBusinessForm, getBusinessForm, delBusinessForm, updateBusinessForm } from '@/api/workflow/businessForm'; import { listBusinessForm, getBusinessForm, delBusinessForm, updateBusinessForm } from '@/api/workflow/businessForm';
import { cancelProcessApply } from '@/api/workflow/processInstance';
import { BusinessFormVO, BusinessFormQuery, BusinessFormForm } from '@/api/workflow/businessForm/types'; import { BusinessFormVO, BusinessFormQuery, BusinessFormForm } from '@/api/workflow/businessForm/types';
import SubmitVerify from '@/components/Process/submitVerify.vue'; import SubmitVerify from '@/components/Process/submitVerify.vue';
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
import { startWorkFlow } from '@/api/workflow/task'; import { startWorkFlow } from '@/api/workflow/task';
// //
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>(); const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
//
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const businessFormList = ref<BusinessFormVO[]>([]); const businessFormList = ref<BusinessFormVO[]>([]);
@ -243,8 +262,10 @@ const handleDelete = async (row?: BusinessFormVO) => {
const _ids = row?.id || ids.value; const _ids = row?.id || ids.value;
const _applyCode = row?.applyCode || applyCodes.value; const _applyCode = row?.applyCode || applyCodes.value;
await proxy?.$modal.confirm('是否确认删除流程编号为【' + _applyCode + '】的数据项?').finally(() => loading.value = false); await proxy?.$modal.confirm('是否确认删除流程编号为【' + _applyCode + '】的数据项?').finally(() => loading.value = false);
loading.value = true;
await delBusinessForm(_ids); await delBusinessForm(_ids);
proxy?.$modal.msgSuccess("删除成功"); proxy?.$modal.msgSuccess("删除成功");
loading.value = false;
await getList(); await getList();
} }
@ -254,7 +275,20 @@ const handleExport = () => {
...queryParams.value ...queryParams.value
}, `businessForm_${new Date().getTime()}.xlsx`) }, `businessForm_${new Date().getTime()}.xlsx`)
} }
//
const handleApprovalRecord = (processInstanceId: string) => {
if (approvalRecordRef.value) {
approvalRecordRef.value.init(processInstanceId);
}
};
/** 撤销按钮操作 */
const handleCancelProcessApply = async (processInstanceId: string) => {
await proxy?.$modal.confirm('是否确认撤销当前单据?');
loading.value = true;
await cancelProcessApply(processInstanceId).finally(() => (loading.value = false));
getList();
proxy?.$modal.msgSuccess('撤销成功');
};
onMounted(() => { onMounted(() => {
getList(); getList();
}); });

View File

@ -62,7 +62,7 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="text" size="small" icon="Document" <el-button type="text" size="small" icon="Document"
@click="handleApprovalRecord(scope.row)">审批记录</el-button> @click="handleApprovalRecord(scope.row.id)">审批记录</el-button>
</el-col> </el-col>
<el-col :span="1.5" <el-col :span="1.5"
v-if="scope.row.businessStatus === 'draft' || scope.row.businessStatus === 'cancel' || scope.row.businessStatus === 'back'"> v-if="scope.row.businessStatus === 'draft' || scope.row.businessStatus === 'cancel' || scope.row.businessStatus === 'back'">
@ -70,7 +70,7 @@
</el-col> </el-col>
<el-col :span="1.5" v-if="scope.row.businessStatus === 'waiting'"> <el-col :span="1.5" v-if="scope.row.businessStatus === 'waiting'">
<el-button type="text" size="small" icon="Notification" <el-button type="text" size="small" icon="Notification"
@click="handleCancelProcessApply(scope.row)">撤销</el-button> @click="handleCancelProcessApply(scope.row.id)">撤销</el-button>
</el-col> </el-col>
<el-col :span="1.5" <el-col :span="1.5"
v-if="scope.row.businessStatus === 'draft' || scope.row.businessStatus === 'cancel' || scope.row.businessStatus === 'back'"> v-if="scope.row.businessStatus === 'draft' || scope.row.businessStatus === 'cancel' || scope.row.businessStatus === 'back'">
@ -180,9 +180,9 @@ const getTreeselect = async () => {
}; };
// //
const handleApprovalRecord = (row: any) => { const handleApprovalRecord = (processInstanceId: string) => {
if (approvalRecordRef.value) { if (approvalRecordRef.value) {
approvalRecordRef.value.init(row.id); approvalRecordRef.value.init(processInstanceId);
} }
}; };
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -226,12 +226,11 @@ const handleDelete = async (row: any) => {
}; };
/** 撤销按钮操作 */ /** 撤销按钮操作 */
const handleCancelProcessApply = async (row: any) => { const handleCancelProcessApply = async (processInstanceId: string) => {
const id = row.id || ids.value;
await proxy?.$modal.confirm('是否确认撤销当前单据?'); await proxy?.$modal.confirm('是否确认撤销当前单据?');
loading.value = true; loading.value = true;
if ('running' === tab.value) { if ('running' === tab.value) {
await cancelProcessApply(id).finally(() => (loading.value = false)); await cancelProcessApply(processInstanceId).finally(() => (loading.value = false));
getList(); getList();
} }
proxy?.$modal.msgSuccess('撤销成功'); proxy?.$modal.msgSuccess('撤销成功');