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"
|
:rule="approveForm.rule"
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</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
|
<el-form-item
|
||||||
label="选择审批人"
|
label="选择下一个节点的审批人"
|
||||||
prop="selectApproveUser"
|
prop="selectApproveUser"
|
||||||
v-if="dialogVisibleSelectApproveUser"
|
v-if="dialogVisibleSelectApproveUser"
|
||||||
>
|
>
|
||||||
@ -48,14 +56,6 @@
|
|||||||
@select-user-confirm="selectUserConfirm"
|
@select-user-confirm="selectUserConfirm"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</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
|
<el-form-item
|
||||||
v-if="runningTask.signEnable"
|
v-if="runningTask.signEnable"
|
||||||
label="签名"
|
label="签名"
|
||||||
@ -695,30 +695,7 @@ const openPopover = async (type: string) => {
|
|||||||
message.warning('表单校验不通过,请先完善表单!!')
|
message.warning('表单校验不通过,请先完善表单!!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 获取修改的流程变量, 暂时只支持流程表单
|
initNextTaskSelectAssigneeFormField()
|
||||||
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') {
|
if (type === 'return') {
|
||||||
// 获取退回节点
|
// 获取退回节点
|
||||||
@ -744,6 +721,33 @@ const closePropover = (type: string, formRef: FormInstance | undefined) => {
|
|||||||
dialogVisibleSelectApproveUser.value = false
|
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) => {
|
const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) => {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
@ -764,33 +768,10 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
|
|||||||
dialogVisibleSelectApproveUser.value &&
|
dialogVisibleSelectApproveUser.value &&
|
||||||
Object.keys(approveReasonForm.selectApproveUser).length === 0
|
Object.keys(approveReasonForm.selectApproveUser).length === 0
|
||||||
) {
|
) {
|
||||||
message.warning('审批人不能为空!')
|
message.warning('下一个节点的审批人不能为空!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 获取修改的流程变量, 暂时只支持流程表单
|
|
||||||
const variables = getUpdatedProcessInstanceVariables()
|
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 = {
|
const data = {
|
||||||
id: runningTask.value.id,
|
id: runningTask.value.id,
|
||||||
|
@ -48,7 +48,7 @@ watch(
|
|||||||
finishedActivityIds,
|
finishedActivityIds,
|
||||||
finishedSequenceFlowActivityIds
|
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 getDetail = () => {
|
||||||
const param = {
|
getApprovalDetail()
|
||||||
processInstanceId: props.id,
|
|
||||||
activityId: props.activityId,
|
|
||||||
taskId: props.taskId
|
|
||||||
}
|
|
||||||
getApprovalDetail(param)
|
|
||||||
getProcessModelView()
|
getProcessModelView()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 加载流程实例 */
|
/** 加载流程实例 */
|
||||||
const BusinessFormComponent = ref<any>(null) // 异步组件
|
const BusinessFormComponent = ref<any>(null) // 异步组件
|
||||||
/** 获取审批详情 */
|
/** 获取审批详情 */
|
||||||
const getApprovalDetail = async (param?: any) => {
|
const getApprovalDetail = async () => {
|
||||||
processInstanceLoading.value = true
|
processInstanceLoading.value = true
|
||||||
try {
|
try {
|
||||||
|
const param = {
|
||||||
|
processInstanceId: props.id,
|
||||||
|
activityId: props.activityId,
|
||||||
|
taskId: props.taskId
|
||||||
|
}
|
||||||
const data = await ProcessInstanceApi.getApprovalDetail(param)
|
const data = await ProcessInstanceApi.getApprovalDetail(param)
|
||||||
if (!data) {
|
if (!data) {
|
||||||
message.error('查询不到审批详情信息!')
|
message.error('查询不到审批详情信息!')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user