update 优化审批按钮判断
This commit is contained in:
parent
2c9c837c1b
commit
f95f6e8390
@ -53,7 +53,7 @@ export const getHistoryList = (businessKey: string): AxiosPromise<Record<string,
|
|||||||
* @param businessKey 业务id
|
* @param businessKey 业务id
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export const getHistoryRecord = (businessKey: string) => {
|
export const getHistoryRecord = (businessKey: string | number) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/workflow/processInstance/getHistoryRecord/${businessKey}`,
|
url: `/workflow/processInstance/getHistoryRecord/${businessKey}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
|
@ -67,7 +67,7 @@ const tabActiveName = ref('bpmn');
|
|||||||
const bpmnViewRef = ref<BpmnView>();
|
const bpmnViewRef = ref<BpmnView>();
|
||||||
|
|
||||||
//初始化查询审批记录
|
//初始化查询审批记录
|
||||||
const init = async (businessKey: string) => {
|
const init = async (businessKey: string | number) => {
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
tabActiveName.value = 'bpmn';
|
tabActiveName.value = 'bpmn';
|
||||||
|
@ -1,22 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="visible" draggable :title="title" :width="width" :height="height" append-to-body
|
<el-dialog v-model="visible" draggable :title="title" :width="width" :height="height" append-to-body :close-on-click-modal="false">
|
||||||
:close-on-click-modal="false">
|
<div v-if="multiInstance === 'add'" class="p-2">
|
||||||
<div class="p-2" v-if="multiInstance === 'add'">
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<!-- 部门树 -->
|
<!-- 部门树 -->
|
||||||
<el-col :lg="4" :xs="24" style="">
|
<el-col :lg="4" :xs="24" style="">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-input v-model="deptName" placeholder="请输入部门名称" prefix-icon="Search" clearable />
|
<el-input v-model="deptName" placeholder="请输入部门名称" prefix-icon="Search" clearable />
|
||||||
<el-tree class="mt-2" ref="deptTreeRef" node-key="id" :data="deptOptions"
|
<el-tree
|
||||||
:props="{ label: 'label', children: 'children' }" :expand-on-click-node="false"
|
ref="deptTreeRef"
|
||||||
:filter-node-method="filterNode" highlight-current default-expand-all
|
class="mt-2"
|
||||||
@node-click="handleNodeClick"></el-tree>
|
node-key="id"
|
||||||
|
:data="deptOptions"
|
||||||
|
:props="{ label: 'label', children: 'children' }"
|
||||||
|
:expand-on-click-node="false"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
highlight-current
|
||||||
|
default-expand-all
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
></el-tree>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="20" :xs="24">
|
<el-col :lg="20" :xs="24">
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter"
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
:leave-active-class="proxy?.animate.searchAnimate.leave">
|
<div v-show="showSearch" class="search">
|
||||||
<div class="search" v-show="showSearch">
|
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
<el-form-item label="用户名称" prop="userName">
|
<el-form-item label="用户名称" prop="userName">
|
||||||
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable @keyup.enter="handleQuery" />
|
||||||
@ -25,8 +31,8 @@
|
|||||||
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleQuery" icon="Search">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
<el-button @click="resetQuery" icon="Refresh">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -35,17 +41,16 @@
|
|||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="handleQuery" :search="true"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" :search="true" @query-table="handleQuery"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="userList" ref="multipleTableRef" row-key="userId"
|
<el-table ref="multipleTableRef" v-loading="loading" :data="userList" row-key="userId" @selection-change="handleSelectionChange">
|
||||||
@selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
<el-table-column label="用户编号" align="center" key="userId" prop="userId" />
|
<el-table-column key="userId" label="用户编号" align="center" prop="userId" />
|
||||||
<el-table-column label="用户名称" align="center" key="userName" prop="userName" :show-overflow-tooltip="true" />
|
<el-table-column key="userName" label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" :show-overflow-tooltip="true" />
|
<el-table-column key="nickName" label="用户昵称" align="center" prop="nickName" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" width="120" />
|
<el-table-column key="phonenumber" label="手机号码" align="center" prop="phonenumber" width="120" />
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ scope.row.createTime }}</span>
|
<span>{{ scope.row.createTime }}</span>
|
||||||
@ -53,18 +58,23 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
<pagination
|
||||||
v-model:limit="queryParams.pageSize" @pagination="handleQuery" />
|
v-show="total > 0"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
:total="total"
|
||||||
|
@pagination="handleQuery"
|
||||||
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-tag v-for="(user, index) in chooseUserList" :key="user.userId" style="margin:2px" closable
|
<el-tag v-for="(user, index) in chooseUserList" :key="user.userId" style="margin: 2px" closable @close="handleCloseTag(user, index)"
|
||||||
@close="handleCloseTag(user, index)">{{ user.userName }}
|
>{{ user.userName }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-2" v-if="multiInstance === 'delete'">
|
<div v-if="multiInstance === 'delete'" class="p-2">
|
||||||
<el-table v-loading="loading" :data="taskList" @selection-change="handleTaskSelection">
|
<el-table v-loading="loading" :data="taskList" @selection-change="handleTaskSelection">
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="name" label="任务名称" />
|
<el-table-column prop="name" label="任务名称" />
|
||||||
@ -285,7 +295,7 @@ const handleNodeClick = (data: DeptVO) => {
|
|||||||
//删除tag
|
//删除tag
|
||||||
const handleCloseTag = (user: UserVO, index: any) => {
|
const handleCloseTag = (user: UserVO, index: any) => {
|
||||||
if (multipleTableRef.value.selection && multipleTableRef.value.selection.length > 0) {
|
if (multipleTableRef.value.selection && multipleTableRef.value.selection.length > 0) {
|
||||||
multipleTableRef.value.selection.forEach((u: UserVO, i: Number) => {
|
multipleTableRef.value.selection.forEach((u: UserVO, i: number) => {
|
||||||
if (user.userId === u.userId) {
|
if (user.userId === u.userId) {
|
||||||
multipleTableRef.value.selection.splice(i, 1);
|
multipleTableRef.value.selection.splice(i, 1);
|
||||||
}
|
}
|
||||||
|
@ -3,34 +3,10 @@
|
|||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<div style="display: flex; justify-content: space-between">
|
<div style="display: flex; justify-content: space-between">
|
||||||
<div>
|
<div>
|
||||||
<el-button
|
<el-button v-if="submitButtonShow" :loading="buttonLoading" type="info" @click="submitForm('draft')">暂存</el-button>
|
||||||
v-if="
|
<el-button v-if="submitButtonShow" :loading="buttonLoading" type="primary" @click="submitForm('submit')">提 交</el-button>
|
||||||
routeParams.type === 'add' ||
|
<el-button v-if="approvalButtonShow" :loading="buttonLoading" type="primary" @click="approvalVerifyOpen">审批</el-button>
|
||||||
(routeParams.type === 'update' && form.status && (form.status === 'draft' || form.status === 'cancel' || form.status === 'back'))
|
<el-button v-if="form && form.id && form.status !== 'draft'" type="primary" @click="handleApprovalRecord">流程进度</el-button>
|
||||||
"
|
|
||||||
:loading="buttonLoading"
|
|
||||||
type="info"
|
|
||||||
@click="submitForm('draft')"
|
|
||||||
>暂存</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
v-if="
|
|
||||||
routeParams.type === 'add' ||
|
|
||||||
(routeParams.type === 'update' && form.status && (form.status === 'draft' || form.status === 'cancel' || form.status === 'back'))
|
|
||||||
"
|
|
||||||
:loading="buttonLoading"
|
|
||||||
type="primary"
|
|
||||||
@click="submitForm('submit')"
|
|
||||||
>提 交</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
v-if="routeParams.type === 'approval' && form.status && form.status === 'waiting'"
|
|
||||||
:loading="buttonLoading"
|
|
||||||
type="primary"
|
|
||||||
@click="approvalVerifyOpen"
|
|
||||||
>审批</el-button
|
|
||||||
>
|
|
||||||
<el-button v-if="form.status !== 'draft'" type="primary" @click="handleApprovalRecord">流程进度</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button style="float: right" @click="goBack()">返回</el-button>
|
<el-button style="float: right" @click="goBack()">返回</el-button>
|
||||||
@ -246,6 +222,21 @@ const goBack = () => {
|
|||||||
const approvalVerifyOpen = async () => {
|
const approvalVerifyOpen = async () => {
|
||||||
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||||
};
|
};
|
||||||
|
//校验提交按钮是否显示
|
||||||
|
const submitButtonShow = computed(() => {
|
||||||
|
return (
|
||||||
|
routeParams.value.type === 'add' ||
|
||||||
|
(routeParams.value.type === 'update' &&
|
||||||
|
form.value.status &&
|
||||||
|
(form.value.status === 'draft' || form.value.status === 'cancel' || form.value.status === 'back'))
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
//校验审批按钮是否显示
|
||||||
|
const approvalButtonShow = computed(() => {
|
||||||
|
return routeParams.value.type === 'approval' && form.value.status && form.value.status === 'waiting';
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(async () => {
|
nextTick(async () => {
|
||||||
routeParams.value = proxy.$route.query;
|
routeParams.value = proxy.$route.query;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user