From b346545cbfb9057a229300836e6140200d8f0857 Mon Sep 17 00:00:00 2001
From: lizhixian <18210040298@163.com>
Date: Tue, 25 Feb 2025 17:01:26 +0800
Subject: [PATCH 1/8] =?UTF-8?q?feat:=20=E6=B5=81=E7=A8=8B=E5=AE=A1?=
=?UTF-8?q?=E6=89=B9=EF=BC=8C=E9=A2=84=E6=B5=8B=E4=B8=8B=E4=B8=AA=E8=8A=82?=
=?UTF-8?q?=E7=82=B9=E6=98=AF=E5=90=A6=E9=9C=80=E8=A6=81=E9=80=89=E6=8B=A9?=
=?UTF-8?q?=E5=AE=A1=E6=89=B9=E4=BA=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../create/ProcessDefinitionDetail.vue | 37 ++++++-----
.../detail/ProcessInstanceOperationButton.vue | 63 +++++++++++++++++--
.../detail/ProcessInstanceSimpleViewer.vue | 2 +-
.../bpm/processInstance/detail/index.vue | 15 +++--
4 files changed, 85 insertions(+), 32 deletions(-)
diff --git a/src/views/bpm/processInstance/create/ProcessDefinitionDetail.vue b/src/views/bpm/processInstance/create/ProcessDefinitionDetail.vue
index 5944c253..169d7ff6 100644
--- a/src/views/bpm/processInstance/create/ProcessDefinitionDetail.vue
+++ b/src/views/bpm/processInstance/create/ProcessDefinitionDetail.vue
@@ -157,25 +157,24 @@ const initProcessInfo = async (row: any, formVariables?: any) => {
}
/** 预测流程节点会因为输入的参数值而产生新的预测结果值,所以需重新预测一次 */
-// TODO @芋艿:这里我执行填写表单的时候不知道为啥一直报错,先注释了 @lesan:可以和群里的小北说下
-// watch(
-// detailForm.value,
-// (newValue) => {
-// if (newValue && Object.keys(newValue.value).length > 0) {
-// // 记录之前的节点审批人
-// tempStartUserSelectAssignees.value = startUserSelectAssignees.value
-// startUserSelectAssignees.value = {}
-// // 加载最新的审批详情
-// getApprovalDetail({
-// id: props.selectProcessDefinition.id,
-// processVariablesStr: JSON.stringify(newValue.value) // 解决 GET 无法传递对象的问题,后端 String 再转 JSON
-// })
-// }
-// },
-// {
-// immediate: true
-// }
-// )
+watch(
+ detailForm.value,
+ (newValue) => {
+ if (newValue && Object.keys(newValue.value).length > 0) {
+ // 记录之前的节点审批人
+ tempStartUserSelectAssignees.value = startUserSelectAssignees.value
+ startUserSelectAssignees.value = {}
+ // 加载最新的审批详情
+ getApprovalDetail({
+ id: props.selectProcessDefinition.id,
+ processVariablesStr: newValue.value // 解决 GET 无法传递对象的问题,后端 String 再转 JSON
+ })
+ }
+ },
+ {
+ immediate: true
+ }
+)
/** 获取审批详情 */
const getApprovalDetail = async (row: any) => {
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
index 4ad4e591..bfb7e05e 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
@@ -36,6 +36,18 @@
:rule="approveForm.rule"
/>
+
+
+
() // 运行中的任务
const approveForm = ref({}) // 审批通过时,额外的补充信息
const approveFormFApi = ref({}) // approveForms 的 fAPi
const nodeTypeName = ref('审批') // 节点类型名称
+const activityNodes = ref([]) // 审批节点信息
+const dialogVisibleSelectApproveUser = ref(false) // 是否显示节点审批人选择框
// 审批通过意见表单
const reasonRequire = ref()
@@ -556,14 +572,16 @@ const signRef = ref()
const approveSignFormRef = ref()
const approveReasonForm = reactive({
reason: '',
- signPicUrl: ''
+ signPicUrl: '',
+ selectApproveUser: {}
})
const approveReasonRule = computed(() => {
return {
reason: [
{ required: reasonRequire.value, message: nodeTypeName + '意见不能为空', trigger: 'blur' }
],
- signPicUrl: [{ required: true, message: '签名不能为空', trigger: 'change' }]
+ signPicUrl: [{ required: true, message: '签名不能为空', trigger: 'change' }],
+ selectApproveUser: [{ required: true, message: '审批人不能为空', trigger: 'change' }]
}
})
// 拒绝表单
@@ -663,6 +681,11 @@ watch(
}
)
+/** 选择发起人 */
+const selectUserConfirm = (id: string, userList: any[]) => {
+ approveReasonForm.selectApproveUser[id] = userList?.map((item: any) => item.id)
+}
+
/** 弹出气泡卡 */
const openPopover = async (type: string) => {
if (type === 'approve') {
@@ -694,6 +717,7 @@ const closePropover = (type: string, formRef: FormInstance | undefined) => {
formRef.resetFields()
}
popOverVisible.value[type] = false
+ dialogVisibleSelectApproveUser.value = false
}
/** 处理审批通过和不通过的操作 */
@@ -711,13 +735,44 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
}
if (pass) {
+ // 如果需要自选审批人,则校验自选审批人
+ if (
+ dialogVisibleSelectApproveUser.value &&
+ Object.keys(approveReasonForm.selectApproveUser).length === 0
+ ) {
+ message.warning('审批人不能为空!')
+ return
+ }
// 获取修改的流程变量, 暂时只支持流程表单
const variables = getUpdatedProcessInstanceVariables()
+ const param = {
+ processInstanceId: props.processInstance.id,
+ processVariablesStr: JSON.stringify(variables)
+ }
+ // 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人
+ const res = await ProcessInstanceApi.getApprovalDetail(param)
+ //当前待审批节点id
+ const activityId = res.todoTask?.taskDefinitionKey
+ if (res.activityNodes && res.activityNodes.length > 0) {
+ // 找到当前节点的索引
+ const currentNodeIndex = res.activityNodes.findIndex((node) => node.id === activityId)
+ const nextNode = res.activityNodes[currentNodeIndex + 1]
+ if (
+ nextNode.candidateStrategy === CandidateStrategy.START_USER_SELECT &&
+ !nextNode.tasks &&
+ nextNode.candidateUsers?.length === 0
+ ) {
+ // 自选审批人,则弹出选择审批人弹窗
+ activityNodes.value = [nextNode]
+ dialogVisibleSelectApproveUser.value = true
+ }
+ }
// 审批通过数据
const data = {
id: runningTask.value.id,
reason: approveReasonForm.reason,
- variables // 审批通过, 把修改的字段值赋于流程实例变量
+ variables, // 审批通过, 把修改的字段值赋于流程实例变量
+ startUserSelectAssignees: approveReasonForm.selectApproveUser // 下个自选节点选择的审批人信息
}
// 签名
if (runningTask.value.signEnable) {
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
index e1d11091..c4a6a364 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
@@ -48,7 +48,7 @@ watch(
finishedActivityIds,
finishedSequenceFlowActivityIds
)
- simpleModel.value = newModelView.simpleModel
+ simpleModel.value = newModelView.simpleModel == null ? {} : newModelView.simpleModel
}
}
)
diff --git a/src/views/bpm/processInstance/detail/index.vue b/src/views/bpm/processInstance/detail/index.vue
index 9809f7a8..ab6c4380 100644
--- a/src/views/bpm/processInstance/detail/index.vue
+++ b/src/views/bpm/processInstance/detail/index.vue
@@ -178,22 +178,21 @@ const writableFields: Array = [] // 表单可以编辑的字段
/** 获得详情 */
const getDetail = () => {
- getApprovalDetail()
-
+ const param = {
+ processInstanceId: props.id,
+ activityId: props.activityId,
+ taskId: props.taskId
+ }
+ getApprovalDetail(param)
getProcessModelView()
}
/** 加载流程实例 */
const BusinessFormComponent = ref(null) // 异步组件
/** 获取审批详情 */
-const getApprovalDetail = async () => {
+const getApprovalDetail = async (param?: any) => {
processInstanceLoading.value = true
try {
- const param = {
- processInstanceId: props.id,
- activityId: props.activityId,
- taskId: props.taskId
- }
const data = await ProcessInstanceApi.getApprovalDetail(param)
if (!data) {
message.error('查询不到审批详情信息!')
From 59528284ca854fe0b0d3f03301aec85722d22487 Mon Sep 17 00:00:00 2001
From: lizhixian <18210040298@163.com>
Date: Tue, 25 Feb 2025 17:17:00 +0800
Subject: [PATCH 2/8] =?UTF-8?q?feat:=20=E6=B5=81=E7=A8=8B=E5=AE=A1?=
=?UTF-8?q?=E6=89=B9=EF=BC=8C=E9=A2=84=E6=B5=8B=E4=B8=8B=E4=B8=AA=E8=8A=82?=
=?UTF-8?q?=E7=82=B9=E6=98=AF=E5=90=A6=E9=9C=80=E8=A6=81=E9=80=89=E6=8B=A9?=
=?UTF-8?q?=E5=AE=A1=E6=89=B9=E4=BA=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../detail/ProcessInstanceOperationButton.vue | 25 +++++++++++++++++++
.../detail/ProcessInstanceSimpleViewer.vue | 5 ++--
2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
index bfb7e05e..5e1c5082 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
@@ -695,6 +695,30 @@ const openPopover = async (type: string) => {
message.warning('表单校验不通过,请先完善表单!!')
return
}
+ // 获取修改的流程变量, 暂时只支持流程表单
+ const variables = getUpdatedProcessInstanceVariables()
+ const param = {
+ processInstanceId: props.processInstance.id,
+ processVariablesStr: JSON.stringify(variables)
+ }
+ // 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人
+ const res = await ProcessInstanceApi.getApprovalDetail(param)
+ //当前待审批节点id
+ const activityId = res.todoTask?.taskDefinitionKey
+ if (res.activityNodes && res.activityNodes.length > 0) {
+ // 找到当前节点的索引
+ const currentNodeIndex = res.activityNodes.findIndex((node) => node.id === activityId)
+ const nextNode = res.activityNodes[currentNodeIndex + 1]
+ if (
+ nextNode.candidateStrategy === CandidateStrategy.START_USER_SELECT &&
+ !nextNode.tasks &&
+ nextNode.candidateUsers?.length === 0
+ ) {
+ // 自选审批人,则弹出选择审批人弹窗
+ activityNodes.value = [nextNode]
+ dialogVisibleSelectApproveUser.value = true
+ }
+ }
}
if (type === 'return') {
// 获取退回节点
@@ -788,6 +812,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
}
await TaskApi.approveTask(data)
popOverVisible.value.approve = false
+ dialogVisibleSelectApproveUser.value = false
message.success('审批通过成功')
} else {
// 审批不通过数据
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
index c4a6a364..60209619 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
@@ -42,7 +42,7 @@ watch(
const finishedSequenceFlowActivityIds: string[] = newModelView.finishedSequenceFlowActivityIds
setSimpleModelNodeTaskStatus(
newModelView.simpleModel,
- newModelView.processInstance.status,
+ newModelView.processInstance?.status,
rejectedTaskActivityIds,
unfinishedTaskActivityIds,
finishedActivityIds,
@@ -171,5 +171,4 @@ const setSimpleModelNodeTaskStatus = (
}
-
+
From 303bbbdd7f1dcab50cedc0721b0c100551539c9e Mon Sep 17 00:00:00 2001
From: smallNorthLee <18210040298@163.com>
Date: Tue, 25 Feb 2025 22:42:46 +0800
Subject: [PATCH 3/8] =?UTF-8?q?review=EF=BC=9A=E4=BB=A3=E7=A0=81=E5=AE=A1?=
=?UTF-8?q?=E6=9F=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../detail/ProcessInstanceOperationButton.vue | 95 ++++++++-----------
.../detail/ProcessInstanceSimpleViewer.vue | 2 +-
.../bpm/processInstance/detail/index.vue | 14 +--
3 files changed, 46 insertions(+), 65 deletions(-)
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
index 5e1c5082..fcb984ce 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
@@ -36,8 +36,16 @@
:rule="approveForm.rule"
/>
+
+
+
@@ -48,14 +56,6 @@
@select-user-confirm="selectUserConfirm"
/>
-
-
-
{
message.warning('表单校验不通过,请先完善表单!!')
return
}
- // 获取修改的流程变量, 暂时只支持流程表单
- const variables = getUpdatedProcessInstanceVariables()
- const param = {
- processInstanceId: props.processInstance.id,
- processVariablesStr: JSON.stringify(variables)
- }
- // 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人
- const res = await ProcessInstanceApi.getApprovalDetail(param)
- //当前待审批节点id
- const activityId = res.todoTask?.taskDefinitionKey
- if (res.activityNodes && res.activityNodes.length > 0) {
- // 找到当前节点的索引
- const currentNodeIndex = res.activityNodes.findIndex((node) => node.id === activityId)
- const nextNode = res.activityNodes[currentNodeIndex + 1]
- if (
- nextNode.candidateStrategy === CandidateStrategy.START_USER_SELECT &&
- !nextNode.tasks &&
- nextNode.candidateUsers?.length === 0
- ) {
- // 自选审批人,则弹出选择审批人弹窗
- activityNodes.value = [nextNode]
- dialogVisibleSelectApproveUser.value = true
- }
- }
+ initNextTaskSelectAssigneeFormField()
}
if (type === 'return') {
// 获取退回节点
@@ -744,6 +721,33 @@ const closePropover = (type: string, formRef: FormInstance | undefined) => {
dialogVisibleSelectApproveUser.value = false
}
+/** // 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人 */
+const initNextTaskSelectAssigneeFormField = async () => {
+ // 获取修改的流程变量, 暂时只支持流程表单
+ const variables = getUpdatedProcessInstanceVariables()
+ const param = {
+ processInstanceId: props.processInstance.id,
+ processVariablesStr: JSON.stringify(variables)
+ }
+ const res = await ProcessInstanceApi.getApprovalDetail(param)
+ //当前待审批节点id
+ const activityId = res.todoTask?.taskDefinitionKey
+ if (res.activityNodes && res.activityNodes.length > 0) {
+ // 找到当前节点的索引
+ const currentNodeIndex = res.activityNodes.findIndex((node) => node.id === activityId)
+ const nextNode = res.activityNodes[currentNodeIndex + 1]
+ if (
+ nextNode.candidateStrategy === CandidateStrategy.START_USER_SELECT &&
+ !nextNode.tasks &&
+ nextNode.candidateUsers?.length === 0
+ ) {
+ // 自选审批人,则弹出选择审批人弹窗
+ activityNodes.value = [nextNode]
+ dialogVisibleSelectApproveUser.value = true
+ }
+ }
+}
+
/** 处理审批通过和不通过的操作 */
const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) => {
formLoading.value = true
@@ -764,33 +768,10 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
dialogVisibleSelectApproveUser.value &&
Object.keys(approveReasonForm.selectApproveUser).length === 0
) {
- message.warning('审批人不能为空!')
+ message.warning('下一个节点的审批人不能为空!')
return
}
- // 获取修改的流程变量, 暂时只支持流程表单
const variables = getUpdatedProcessInstanceVariables()
- const param = {
- processInstanceId: props.processInstance.id,
- processVariablesStr: JSON.stringify(variables)
- }
- // 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人
- const res = await ProcessInstanceApi.getApprovalDetail(param)
- //当前待审批节点id
- const activityId = res.todoTask?.taskDefinitionKey
- if (res.activityNodes && res.activityNodes.length > 0) {
- // 找到当前节点的索引
- const currentNodeIndex = res.activityNodes.findIndex((node) => node.id === activityId)
- const nextNode = res.activityNodes[currentNodeIndex + 1]
- if (
- nextNode.candidateStrategy === CandidateStrategy.START_USER_SELECT &&
- !nextNode.tasks &&
- nextNode.candidateUsers?.length === 0
- ) {
- // 自选审批人,则弹出选择审批人弹窗
- activityNodes.value = [nextNode]
- dialogVisibleSelectApproveUser.value = true
- }
- }
// 审批通过数据
const data = {
id: runningTask.value.id,
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
index 60209619..87f8119d 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
@@ -48,7 +48,7 @@ watch(
finishedActivityIds,
finishedSequenceFlowActivityIds
)
- simpleModel.value = newModelView.simpleModel == null ? {} : newModelView.simpleModel
+ simpleModel.value = newModelView.simpleModel ? newModelView.simpleModel : {}
}
}
)
diff --git a/src/views/bpm/processInstance/detail/index.vue b/src/views/bpm/processInstance/detail/index.vue
index ab6c4380..46ecaaee 100644
--- a/src/views/bpm/processInstance/detail/index.vue
+++ b/src/views/bpm/processInstance/detail/index.vue
@@ -178,21 +178,21 @@ const writableFields: Array = [] // 表单可以编辑的字段
/** 获得详情 */
const getDetail = () => {
- const param = {
- processInstanceId: props.id,
- activityId: props.activityId,
- taskId: props.taskId
- }
- getApprovalDetail(param)
+ getApprovalDetail()
getProcessModelView()
}
/** 加载流程实例 */
const BusinessFormComponent = ref(null) // 异步组件
/** 获取审批详情 */
-const getApprovalDetail = async (param?: any) => {
+const getApprovalDetail = async () => {
processInstanceLoading.value = true
try {
+ const param = {
+ processInstanceId: props.id,
+ activityId: props.activityId,
+ taskId: props.taskId
+ }
const data = await ProcessInstanceApi.getApprovalDetail(param)
if (!data) {
message.error('查询不到审批详情信息!')
From d7664c92cd9ab38a8c7cdfba168da8531e1d6487 Mon Sep 17 00:00:00 2001
From: smallNorthLee <18210040298@163.com>
Date: Tue, 25 Feb 2025 22:44:33 +0800
Subject: [PATCH 4/8] =?UTF-8?q?fix:=20processVariablesStr=E5=8F=82?=
=?UTF-8?q?=E6=95=B0=E8=BD=ACstring=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../bpm/processInstance/create/ProcessDefinitionDetail.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/views/bpm/processInstance/create/ProcessDefinitionDetail.vue b/src/views/bpm/processInstance/create/ProcessDefinitionDetail.vue
index 169d7ff6..8856fac7 100644
--- a/src/views/bpm/processInstance/create/ProcessDefinitionDetail.vue
+++ b/src/views/bpm/processInstance/create/ProcessDefinitionDetail.vue
@@ -167,7 +167,7 @@ watch(
// 加载最新的审批详情
getApprovalDetail({
id: props.selectProcessDefinition.id,
- processVariablesStr: newValue.value // 解决 GET 无法传递对象的问题,后端 String 再转 JSON
+ processVariablesStr: JSON.stringify(newValue.value) // 解决 GET 无法传递对象的问题,后端 String 再转 JSON
})
}
},
@@ -183,7 +183,7 @@ const getApprovalDetail = async (row: any) => {
const data = await ProcessInstanceApi.getApprovalDetail({
processDefinitionId: row.id,
activityId: NodeId.START_USER_NODE_ID,
- processVariablesStr: JSON.stringify(row.processVariablesStr) // 解决 GET 无法传递对象的问题,后端 String 再转 JSON
+ processVariablesStr: row.processVariablesStr // 解决 GET 无法传递对象的问题,后端 String 再转 JSON
})
if (!data) {
From 74d560a19ea316bd6c040c686fabbaf3c72872cc Mon Sep 17 00:00:00 2001
From: lizhixian <18210040298@163.com>
Date: Wed, 26 Feb 2025 15:58:13 +0800
Subject: [PATCH 5/8] =?UTF-8?q?review:=20=E8=B0=83=E6=95=B4=E5=AD=97?=
=?UTF-8?q?=E6=AE=B5=E5=90=8D=E7=A7=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../detail/ProcessInstanceOperationButton.vue | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
index fcb984ce..990f2417 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
@@ -46,7 +46,7 @@
{
return {
@@ -581,7 +581,7 @@ const approveReasonRule = computed(() => {
{ required: reasonRequire.value, message: nodeTypeName + '意见不能为空', trigger: 'blur' }
],
signPicUrl: [{ required: true, message: '签名不能为空', trigger: 'change' }],
- selectApproveUser: [{ required: true, message: '审批人不能为空', trigger: 'change' }]
+ nextAssignees: [{ required: true, message: '审批人不能为空', trigger: 'blur' }]
}
})
// 拒绝表单
@@ -681,9 +681,9 @@ watch(
}
)
-/** 选择发起人 */
+/** 选择下一个节点的审批人 */
const selectUserConfirm = (id: string, userList: any[]) => {
- approveReasonForm.selectApproveUser[id] = userList?.map((item: any) => item.id)
+ approveReasonForm.nextAssignees[id] = userList?.map((item: any) => item.id)
}
/** 弹出气泡卡 */
@@ -766,7 +766,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
// 如果需要自选审批人,则校验自选审批人
if (
dialogVisibleSelectApproveUser.value &&
- Object.keys(approveReasonForm.selectApproveUser).length === 0
+ Object.keys(approveReasonForm.nextAssignees).length === 0
) {
message.warning('下一个节点的审批人不能为空!')
return
@@ -777,7 +777,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
id: runningTask.value.id,
reason: approveReasonForm.reason,
variables, // 审批通过, 把修改的字段值赋于流程实例变量
- startUserSelectAssignees: approveReasonForm.selectApproveUser // 下个自选节点选择的审批人信息
+ nextAssignees: approveReasonForm.nextAssignees // 下个自选节点选择的审批人信息
}
// 签名
if (runningTask.value.signEnable) {
From cf03e7226423f6d54316f3cc097c0cdd3ca4dcac Mon Sep 17 00:00:00 2001
From: lizhixian <18210040298@163.com>
Date: Fri, 28 Feb 2025 17:11:34 +0800
Subject: [PATCH 6/8] =?UTF-8?q?feat=EF=BC=9A=20=E6=B7=BB=E5=8A=A0todo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../detail/ProcessInstanceOperationButton.vue | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
index 990f2417..4d09d977 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
@@ -1069,7 +1069,11 @@ const validateNormalForm = async () => {
return true
}
}
-
+// TODO @小北 这里存在问题,如果当前节点没有可编辑的字段,在提交审批时 variables = {},会导致流程走向出错 @芋道
+/** 场景:
+ 流程发起后,A节点字段可编辑,因为变量值变更,流程预测节点发生变化,A审批通过后,
+ B节点无可编辑字段且为审批人自选节点,在提交审批时variables = {}
+ */
/** 从可以编辑的流程表单字段,获取需要修改的流程实例的变量 */
const getUpdatedProcessInstanceVariables = () => {
const variables = {}
From 10c65d3967c62830626c8248e474d2797b83cfff Mon Sep 17 00:00:00 2001
From: smallNorthLee <18210040298@163.com>
Date: Fri, 28 Feb 2025 22:55:24 +0800
Subject: [PATCH 7/8] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0todo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../detail/ProcessInstanceOperationButton.vue | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
index 990f2417..33ec94e4 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
@@ -1071,6 +1071,11 @@ const validateNormalForm = async () => {
}
/** 从可以编辑的流程表单字段,获取需要修改的流程实例的变量 */
+/**
+ * TODO @小北 TO @芋道
+ * 问题:这里存在一种场景会出现问题,流程发起后,A节点审批完成,B节点没有可编辑的流程字段且B节点为自选审批人节点,会导致流程审批人为空,
+ * 原因:因为没有可编辑的流程字段时props.writableFields为空,参数variables传递时也为空
+ */
const getUpdatedProcessInstanceVariables = () => {
const variables = {}
props.writableFields.forEach((field) => {
From 3ef04b55bc49060426b8cbe58578419756c97f60 Mon Sep 17 00:00:00 2001
From: smallNorthLee <18210040298@163.com>
Date: Fri, 28 Feb 2025 22:56:22 +0800
Subject: [PATCH 8/8] =?UTF-8?q?feat=EF=BC=9A=E6=B7=BB=E5=8A=A0todo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../detail/ProcessInstanceOperationButton.vue | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
index 11115a3c..137d91bd 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
@@ -1069,17 +1069,13 @@ const validateNormalForm = async () => {
return true
}
}
-// TODO @小北 这里存在问题,如果当前节点没有可编辑的字段,在提交审批时 variables = {},会导致流程走向出错 @芋道
-/** 场景:
- 流程发起后,A节点字段可编辑,因为变量值变更,流程预测节点发生变化,A审批通过后,
- B节点无可编辑字段且为审批人自选节点,在提交审批时variables = {}
- */
-/** 从可以编辑的流程表单字段,获取需要修改的流程实例的变量 */
+
/**
* TODO @小北 TO @芋道
* 问题:这里存在一种场景会出现问题,流程发起后,A节点审批完成,B节点没有可编辑的流程字段且B节点为自选审批人节点,会导致流程审批人为空,
* 原因:因为没有可编辑的流程字段时props.writableFields为空,参数variables传递时也为空
*/
+/** 从可以编辑的流程表单字段,获取需要修改的流程实例的变量 */
const getUpdatedProcessInstanceVariables = () => {
const variables = {}
props.writableFields.forEach((field) => {