mirror of
https://gitee.com/myxzgzs/boyue-ui-admin-vue3
synced 2025-08-08 16:32:43 +08:00
review:代码审查
This commit is contained in:
parent
59528284ca
commit
303bbbdd7f
@ -36,8 +36,16 @@
|
||||
:rule="approveForm.rule"
|
||||
/>
|
||||
</el-card>
|
||||
<el-form-item :label="`${nodeTypeName}意见`" prop="reason">
|
||||
<el-input
|
||||
v-model="approveReasonForm.reason"
|
||||
:placeholder="`请输入${nodeTypeName}意见`"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="选择审批人"
|
||||
label="选择下一个节点的审批人"
|
||||
prop="selectApproveUser"
|
||||
v-if="dialogVisibleSelectApproveUser"
|
||||
>
|
||||
@ -48,14 +56,6 @@
|
||||
@select-user-confirm="selectUserConfirm"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${nodeTypeName}意见`" prop="reason">
|
||||
<el-input
|
||||
v-model="approveReasonForm.reason"
|
||||
:placeholder="`请输入${nodeTypeName}意见`"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="runningTask.signEnable"
|
||||
label="签名"
|
||||
@ -695,30 +695,7 @@ 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
|
||||
}
|
||||
}
|
||||
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,
|
||||
|
@ -48,7 +48,7 @@ watch(
|
||||
finishedActivityIds,
|
||||
finishedSequenceFlowActivityIds
|
||||
)
|
||||
simpleModel.value = newModelView.simpleModel == null ? {} : newModelView.simpleModel
|
||||
simpleModel.value = newModelView.simpleModel ? newModelView.simpleModel : {}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
@ -178,21 +178,21 @@ const writableFields: Array<string> = [] // 表单可以编辑的字段
|
||||
|
||||
/** 获得详情 */
|
||||
const getDetail = () => {
|
||||
const param = {
|
||||
processInstanceId: props.id,
|
||||
activityId: props.activityId,
|
||||
taskId: props.taskId
|
||||
}
|
||||
getApprovalDetail(param)
|
||||
getApprovalDetail()
|
||||
getProcessModelView()
|
||||
}
|
||||
|
||||
/** 加载流程实例 */
|
||||
const BusinessFormComponent = ref<any>(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('查询不到审批详情信息!')
|
||||
|
Loading…
x
Reference in New Issue
Block a user