From 03b8bd5e2236b969f70d1348272e5c363ca6cb51 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 17 Mar 2024 22:14:28 +0800 Subject: [PATCH] =?UTF-8?q?BPM=EF=BC=9A=E8=B0=83=E6=95=B4=E6=8A=84?= =?UTF-8?q?=E9=80=81=E9=80=BB=E8=BE=91=E7=9A=84=E5=AE=9E=E7=8E=B0=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E6=88=90=E5=AE=A1=E6=89=B9=E9=80=9A=E8=BF=87=E3=80=81?= =?UTF-8?q?=E4=B8=8D=E9=80=9A=E8=BF=87=E6=97=B6=EF=BC=8C=E5=8F=AF=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=8A=84=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bpm/processInstance/index.ts | 34 +-- src/utils/formatTime.ts | 10 +- .../detail/TaskCCDialogForm.vue | 242 ------------------ .../bpm/processInstance/detail/index.vue | 29 ++- src/views/bpm/task/{cc => copy}/index.vue | 37 ++- src/views/bpm/task/done/TaskDetail.vue | 51 ---- src/views/bpm/task/done/index.vue | 69 +++-- 7 files changed, 95 insertions(+), 377 deletions(-) delete mode 100644 src/views/bpm/processInstance/detail/TaskCCDialogForm.vue rename src/views/bpm/task/{cc => copy}/index.vue (74%) delete mode 100644 src/views/bpm/task/done/TaskDetail.vue diff --git a/src/api/bpm/processInstance/index.ts b/src/api/bpm/processInstance/index.ts index a937eae2..1a5b5ecb 100644 --- a/src/api/bpm/processInstance/index.ts +++ b/src/api/bpm/processInstance/index.ts @@ -20,14 +20,14 @@ export type ProcessInstanceVO = { endTime: string } -export type ProcessInstanceCCVO = { - type: number, - taskName: string, - taskKey: string, - processInstanceName: string, - processInstanceKey: string, - startUserId: string, - options:string [], +export type ProcessInstanceCopyVO = { + type: number + taskName: string + taskKey: string + processInstanceName: string + processInstanceKey: string + startUserId: string + options: string[] reason: string } @@ -51,20 +51,6 @@ export const getProcessInstance = async (id: number) => { return await request.get({ url: '/bpm/process-instance/get?id=' + id }) } -/** - * 抄送 - * @param data 抄送数据 - * @returns 是否抄送成功 - */ -export const createProcessInstanceCC = async (data) => { - return await request.post({ url: '/bpm/process-instance/cc/create', data: data }) +export const getProcessInstanceCopyPage = async (params: any) => { + return await request.get({ url: '/bpm/process-instance/copy/page', params }) } - -/** - * 抄送列表 - * @param params - * @returns - */ -export const getProcessInstanceCCPage = async (params) => { - return await request.get({ url: '/bpm/process-instance/cc/my-page', params }) -} \ No newline at end of file diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index ed434cb0..134a986e 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -175,18 +175,18 @@ export function formatPast2(ms: number): string { const minute = Math.floor(ms / (60 * 1000) - day * 24 * 60 - hour * 60) const second = Math.floor(ms / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60) if (day > 0) { - return day + '天' + hour + '小时' + minute + '分钟' + return day + ' 天' + hour + ' 小时 ' + minute + ' 分钟' } if (hour > 0) { - return hour + '小时' + minute + '分钟' + return hour + ' 小时 ' + minute + ' 分钟' } if (minute > 0) { - return minute + '分钟' + return minute + ' 分钟' } if (second > 0) { - return second + '秒' + return second + ' 秒' } else { - return 0 + '秒' + return 0 + ' 秒' } } diff --git a/src/views/bpm/processInstance/detail/TaskCCDialogForm.vue b/src/views/bpm/processInstance/detail/TaskCCDialogForm.vue deleted file mode 100644 index be3bb4f5..00000000 --- a/src/views/bpm/processInstance/detail/TaskCCDialogForm.vue +++ /dev/null @@ -1,242 +0,0 @@ - - - diff --git a/src/views/bpm/processInstance/detail/index.vue b/src/views/bpm/processInstance/detail/index.vue index 3ce665f6..800ff2f3 100644 --- a/src/views/bpm/processInstance/detail/index.vue +++ b/src/views/bpm/processInstance/detail/index.vue @@ -31,6 +31,16 @@ type="textarea" /> + + + + +
@@ -118,6 +128,7 @@ import TaskDelegateForm from './TaskDelegateForm.vue' import TaskAddSignDialogForm from './TaskAddSignDialogForm.vue' import { registerComponent } from '@/utils/routerHelper' import { isEmpty } from '@/utils/is' +import * as UserApi from '@/api/system/user' defineOptions({ name: 'BpmProcessInstanceDetail' }) @@ -161,7 +172,8 @@ const handleAudit = async (task, pass) => { // 2.1 提交审批 const data = { id: task.id, - reason: auditForms.value[index].reason + reason: auditForms.value[index].reason, + copyUserIds: auditForms.value[index].copyUserIds } if (pass) { await TaskApi.approveTask(data) @@ -180,21 +192,20 @@ const openTaskUpdateAssigneeForm = (id: string) => { taskUpdateAssigneeFormRef.value.open(id) } -const taskDelegateForm = ref() /** 处理审批退回的操作 */ +const taskDelegateForm = ref() const handleDelegate = async (task) => { taskDelegateForm.value.open(task.id) } -//回退弹框组件 -const taskReturnDialogRef = ref() /** 处理审批退回的操作 */ +const taskReturnDialogRef = ref() const handleBack = async (task) => { taskReturnDialogRef.value.open(task.id) } -const taskAddSignDialogForm = ref() /** 处理审批加签的操作 */ +const taskAddSignDialogForm = ref() const handleSign = async (task) => { taskAddSignDialogForm.value.open(task.id) } @@ -304,13 +315,17 @@ const loadRunningTask = (tasks) => { // 2.3 添加到处理任务 runningTasks.value.push({ ...task }) auditForms.value.push({ - reason: '' + reason: '', + copyUserIds: [] }) }) } /** 初始化 */ -onMounted(() => { +const userOptions = ref([]) // 用户列表 +onMounted(async () => { getDetail() + // 获得用户列表 + userOptions.value = await UserApi.getSimpleUserList() }) diff --git a/src/views/bpm/task/cc/index.vue b/src/views/bpm/task/copy/index.vue similarity index 74% rename from src/views/bpm/task/cc/index.vue rename to src/views/bpm/task/copy/index.vue index 50ddf889..dd41b2e1 100644 --- a/src/views/bpm/task/cc/index.vue +++ b/src/views/bpm/task/copy/index.vue @@ -11,14 +11,6 @@ placeholder="请输入流程名称" /> - - - - - - - - - + + + + + - + @@ -78,14 +75,14 @@ import { dateFormatter } from '@/utils/formatTime' import * as ProcessInstanceApi from '@/api/bpm/processInstance' -defineOptions({ name: 'BpmCCProcessInstance' }) +defineOptions({ name: 'BpmProcessInstanceCopy' }) const { push } = useRouter() // 路由 const loading = ref(false) // 列表的加载中 const total = ref(0) // 列表的总页数 const list = ref([]) // 列表的数据 -const queryParams = ref({ +const queryParams = reactive({ pageNo: 1, pageSize: 10, processInstanceId: '', @@ -98,7 +95,7 @@ const queryFormRef = ref() // 搜索的表单 const getList = async () => { loading.value = true try { - const data = await ProcessInstanceApi.getProcessInstanceCCPage(queryParams) + const data = await ProcessInstanceApi.getProcessInstanceCopyPage(queryParams) list.value = data.list total.value = data.total } finally { @@ -118,7 +115,7 @@ const handleAudit = (row: any) => { /** 搜索按钮操作 */ const handleQuery = () => { - queryParams.value.pageNo = 1 + queryParams.pageNo = 1 getList() } diff --git a/src/views/bpm/task/done/TaskDetail.vue b/src/views/bpm/task/done/TaskDetail.vue deleted file mode 100644 index ff8f313d..00000000 --- a/src/views/bpm/task/done/TaskDetail.vue +++ /dev/null @@ -1,51 +0,0 @@ - - diff --git a/src/views/bpm/task/done/index.vue b/src/views/bpm/task/done/index.vue index b190bd4f..d9b32803 100644 --- a/src/views/bpm/task/done/index.vue +++ b/src/views/bpm/task/done/index.vue @@ -46,27 +46,50 @@ - - - - - + + + + + + + + + + - - - + + + @@ -78,15 +101,11 @@ @pagination="getList" /> - - -