From 31f4219f3d7fc041ba6ec2d11084e7e0f61ffdb8 Mon Sep 17 00:00:00 2001 From: songgaoshuai <1742057357@qq.com> Date: 星期五, 22 三月 2024 11:32:58 +0800 Subject: [PATCH] fix修复已办参数传错 --- src/views/workflow/task/allTaskWaiting.vue | 95 ++++++++++++++++++++++++++++++++--------------- 1 files changed, 64 insertions(+), 31 deletions(-) diff --git a/src/views/workflow/task/allTaskWaiting.vue b/src/views/workflow/task/allTaskWaiting.vue index ef1c45e..8d5836f 100644 --- a/src/views/workflow/task/allTaskWaiting.vue +++ b/src/views/workflow/task/allTaskWaiting.vue @@ -33,15 +33,15 @@ <template #header> <el-row :gutter="10" class="mb8"> <el-col :span="1.5"> - <el-button type="primary" plain icon="Edit" @click="handleUpdate">淇敼鍔炵悊浜�</el-button> + <el-button type="primary" plain icon="Edit" :disabled="multiple" @click="handleUpdate">淇敼鍔炵悊浜�</el-button> </el-col> <right-toolbar v-model:showSearch="showSearch" @query-table="handleQuery"></right-toolbar> </el-row> </template> - <el-table v-loading="loading" :data="taskList" @selection-change="handleSelectionChange"> + <el-table v-loading="loading" border :data="taskList" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55" align="center" /> - <el-table-column fixed align="center" type="index" label="搴忓彿" width="50"></el-table-column> + <el-table-column fixed align="center" type="index" label="搴忓彿" width="60"></el-table-column> <el-table-column fixed align="center" prop="processDefinitionName" label="娴佺▼瀹氫箟鍚嶇О"></el-table-column> <el-table-column fixed align="center" prop="processDefinitionKey" label="娴佺▼瀹氫箟KEY"></el-table-column> <el-table-column fixed align="center" prop="name" label="浠诲姟鍚嶇О"></el-table-column> @@ -70,7 +70,8 @@ <el-tag v-else type="success">宸插畬鎴�</el-tag> </template> </el-table-column> - <el-table-column align="center" prop="createTime" label="鍒涘缓鏃堕棿" width="160"></el-table-column> + <el-table-column align="center" v-if="tab === 'waiting'" prop="createTime" label="鍒涘缓鏃堕棿" width="160"></el-table-column> + <el-table-column align="center" v-if="tab === 'finish'" prop="startTime" label="鍒涘缓鏃堕棿" width="160"></el-table-column> <el-table-column label="鎿嶄綔" align="center" width="160" class-name="small-padding fixed-width"> <template #default="scope"> <el-row :gutter="10" class="mb8"> @@ -82,6 +83,9 @@ </el-col> <el-col v-if="scope.row.multiInstance" :span="1.5"> <el-button link type="primary" size="small" icon="Remove" @click="deleteMultiInstanceUser(scope.row)">鍑忕</el-button> + </el-col> + <el-col v-if="tab === 'waiting'" :span="1.5"> + <el-button link type="primary" size="small" icon="Document" @click="handleInstanceVariable(scope.row)">娴佺▼鍙橀噺</el-button> </el-col> </el-row> </template> @@ -97,30 +101,41 @@ </el-card> <!-- 瀹℃壒璁板綍 --> <approvalRecord ref="approvalRecordRef" /> - <!-- 鎻愪氦缁勪欢 --> - <submitVerify ref="submitVerifyRef" :task-id="taskId" @submit-callback="handleQuery" /> <!-- 鍔犵缁勪欢 --> <multiInstanceUser ref="multiInstanceUserRef" :title="title" @submit-callback="handleQuery" /> - <!-- 鍔犵缁勪欢 --> - <SysUser ref="sysUserRef" :multiple="true" @submit-callback="submitCallback" /> + <!-- 閫変汉缁勪欢 --> + <UserSelect ref="userSelectRef" :multiple="false" @confirm-call-back="submitCallback"></UserSelect> + <!-- 娴佺▼鍙橀噺寮�濮� --> + <el-dialog v-model="variableVisible" draggable title="娴佺▼鍙橀噺" width="60%" :close-on-click-modal="false"> + <el-card class="box-card" v-loading="variableLoading"> + <div slot="header" class="clearfix"> + <span>娴佺▼瀹氫箟鍚嶇О锛�<el-tag>{{processDefinitionName}}</el-tag></span> + </div> + <div v-for="(v,index) in variableList" :key="index" > + <el-form :label-position="'right'" v-if="v.key!=='_FLOWABLE_SKIP_EXPRESSION_ENABLED'" label-width="150px"> + <el-form-item :label="v.key+'锛�'"> + {{v.value}} + </el-form-item> + </el-form> + </div> + </el-card> + </el-dialog> + <!-- 娴佺▼鍙橀噺缁撴潫 --> </div> </template> <script lang="ts" setup> -import { getAllTaskWaitByPage, getAllTaskFinishByPage, updateAssignee } from '@/api/workflow/task'; +import { getPageByAllTaskWait, getPageByAllTaskFinish, updateAssignee, getInstanceVariable } from '@/api/workflow/task'; import ApprovalRecord from '@/components/Process/approvalRecord.vue'; -import SubmitVerify from '@/components/Process/submitVerify.vue'; -import MultiInstanceUser from '@/components/Process/multiInstance-user.vue'; -import SysUser from '@/components/Process/sys-user.vue'; -import { TaskQuery, TaskVO } from '@/api/workflow/task/types'; -//鎻愪氦缁勪欢 -const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>(); +import MultiInstanceUser from '@/components/Process/multiInstanceUser.vue'; +import UserSelect from '@/components/UserSelect'; +import { TaskQuery, TaskVO, VariableVo } from '@/api/workflow/task/types'; //瀹℃壒璁板綍缁勪欢 const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>(); //鍔犵缁勪欢 const multiInstanceUserRef = ref<InstanceType<typeof MultiInstanceUser>>(); -//閫変汉缁勪欢 -const sysUserRef = ref<InstanceType<typeof SysUser>>(); +//閫変汉缁勪欢 +const userSelectRef = ref<InstanceType<typeof UserSelect>>(); const queryFormRef = ref<ElFormInstance>(); const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -138,9 +153,17 @@ const total = ref(0); // 妯″瀷瀹氫箟琛ㄦ牸鏁版嵁 const taskList = ref([]); -// 浠诲姟id -const taskId = ref(''); const title = ref(''); +// 娴佺▼鍙橀噺鏄惁鏄剧ず +const variableVisible = ref(false); +const variableLoading = ref(true); +// 娴佺▼鍙橀噺 +const variableList = ref<VariableVo>({ + key: '', + value: '', +}) +//娴佺▼瀹氫箟鍚嶇О +const processDefinitionName = ref(undefined); // 鏌ヨ鍙傛暟 const queryParams = ref<TaskQuery>({ pageNum: 1, @@ -205,7 +228,7 @@ //鍒嗛〉 const getWaitingList = () => { loading.value = true; - getAllTaskWaitByPage(queryParams.value).then((resp) => { + getPageByAllTaskWait(queryParams.value).then((resp) => { taskList.value = resp.rows; total.value = resp.total; loading.value = false; @@ -213,25 +236,35 @@ }; const getFinishList = () => { loading.value = true; - getAllTaskFinishByPage(queryParams.value).then((resp) => { + getPageByAllTaskFinish(queryParams.value).then((resp) => { taskList.value = resp.rows; total.value = resp.total; loading.value = false; }); }; +//鎵撳紑淇敼閫変汉 const handleUpdate = () => { - if (sysUserRef.value) { - sysUserRef.value.getUserList([]); - } + userSelectRef.value.open(); }; //淇敼鍔炵悊浜� -const submitCallback = (data) => { - if (data && data.value.length > 0) { - updateAssignee(ids.value, data.value[0].userId).then((resp) => { - sysUserRef.value.close(); - proxy?.$modal.msgSuccess('鎿嶄綔鎴愬姛'); - handleQuery(); - }); +const submitCallback = async (data) => { + if(data && data.length > 0){ + await proxy?.$modal.confirm('鏄惁纭鎻愪氦锛�'); + loading.value = true; + await updateAssignee(ids.value, data[0].userId) + handleQuery() + proxy?.$modal.msgSuccess('鎿嶄綔鎴愬姛'); + }else{ + proxy?.$modal.msgWarning('璇烽�夋嫨鐢ㄦ埛锛�'); } }; +//鏌ヨ娴佺▼鍙橀噺 +const handleInstanceVariable = async (row: TaskVO) => { + variableLoading.value = true + variableVisible.value = true + processDefinitionName.value = row.processDefinitionName + let data = await getInstanceVariable(row.id) + variableList.value = data.data + variableLoading.value = false +}; </script> -- Gitblit v1.9.3