Parcourir la source

feat: 1、评论操作完毕后,只刷新右侧的详情 2、图标挡住最底部下拉框 3、终止 不通过状态不展示操作按钮

luoyali il y a 1 an
Parent
commit
73b33fdad8

+ 1 - 1
src/store/modules/taskProcess.ts

@@ -16,7 +16,7 @@ export const useTaskProcessStore = defineStore({
 			this.storeInfoName = title || '审批流程'
 		},
 		setCurrentTaskRow(row: any) {
-			this.currentTaskRow = row
+			this.currentTaskRow = row // 当前左侧选中的值
 		}
 	},
 	persist: true

+ 20 - 14
src/views/approve/components/approvedContent.vue

@@ -80,14 +80,15 @@
 					</div>
 				</div>
 
-				<!-- 3、底部操作按钮 -->
+				<!-- 3、底部操作按钮  审批拒绝 强制终止不展示操作按钮-->
 				<!--
             1、已审批的任务不显示操作按钮
             2、我的申请显示撤回按钮
             3、认领任务显示认领按钮
             4、我收到的任务显示评论
             -->
-				<div class="flow-actions">
+				<div v-if="!([2, 5].indexOf(currentTaskRow.instanceState) !== -1)"
+						 class="flow-actions" >
 					<el-button :icon="ChatLineSquare" @click="openComment('reviewVisible', 'review')">评论</el-button>
 					<template v-if="currentTaskType !== 'myReceived' || currentTaskType !== 'approved'">
 						<el-button
@@ -192,7 +193,7 @@ import RollbackDialog from './rollbackDialog'
 import viewForm from '@/utils/form'
 import { storeToRefs } from 'pinia'
 
-const props = defineProps({
+defineProps({
 	/**
 	 * pendingApproval 待审批
 	 * myApplication 我的申请
@@ -237,16 +238,6 @@ const validateForm = ref({
 	loading: false
 })
 
-/**
- * 拿到当前关闭详情弹窗
- */
-const closeDetailEv = () => {
-	// 存储表单 todo.....
-	// 如果这里有表单,是否要把所有表单的内容进行存储,存储完毕后,才能关闭这个详情,刷新左侧的列表 todo
-	taskProcessInfo.refresh = true
-	taskProcessInfo.setCurrentTaskRow({})
-}
-
 /**
  * 详情按钮各个操作弹窗
  * @param visibleType 评论 拒绝 同意等
@@ -367,6 +358,21 @@ const claimTaskEv = async () => {
 	console.log(res, 'res====')
 }
 
+/**
+ * 详情页面操作按钮回调
+ */
+const closeDetailEv = () => {
+	// 存储表单 todo.....
+	// 如果这里有表单,是否要把所有表单的内容进行存储,存储完毕后,才能关闭这个详情,刷新左侧的列表 todo
+	if (currentType.value === 'review') {
+		// 评论按钮,不要刷新左侧的列表,只更新右侧的详情即可
+		getTaskDetail()
+		return
+	}
+	taskProcessInfo.refresh = true
+	taskProcessInfo.setCurrentTaskRow({})
+}
+
 /**
  * 监听同级子组件的instanceId的值变化 这里可能也有实例Id
  * 1、监听instanceId的值变化,如果值有变化,则重新获取审批详情
@@ -403,7 +409,7 @@ watch(
 		position: absolute;
 		right: 10px;
 		top: 10px;
-		z-index: 999;
+		z-index: 99;
 	}
 
 	// 头部