diff --git a/src/views/personal-center/overtime-application/index.vue b/src/views/personal-center/overtime-application/index.vue index ffee8f1..63aedb6 100644 --- a/src/views/personal-center/overtime-application/index.vue +++ b/src/views/personal-center/overtime-application/index.vue @@ -171,7 +171,7 @@ function getRowActions(row: Api.OvertimeApplication.OvertimeApplication): Busine } ]; - if (row.statusCode === 'rejected' && row.allowEdit) { + if ((row.statusCode === 'rejected' || row.statusCode === 'cancelled') && row.allowEdit) { actions.push({ key: 'edit', label: '修改', @@ -189,7 +189,7 @@ function getRowActions(row: Api.OvertimeApplication.OvertimeApplication): Busine onClick: () => openStatusLog(row) }); - if (row.statusCode === 'pending' || row.statusCode === 'rejected') { + if (row.statusCode === 'pending') { actions.push({ key: 'cancel', label: '撤销', diff --git a/src/views/personal-center/overtime-application/modules/overtime-application-action-dialog.vue b/src/views/personal-center/overtime-application/modules/overtime-application-action-dialog.vue index c19dce5..3b12aae 100644 --- a/src/views/personal-center/overtime-application/modules/overtime-application-action-dialog.vue +++ b/src/views/personal-center/overtime-application/modules/overtime-application-action-dialog.vue @@ -51,7 +51,15 @@ const reasonLabel = computed(() => { return map[props.actionType]; }); -const reasonRequired = computed(() => props.actionType !== 'approve'); +const reasonRequired = computed(() => props.actionType === 'reject'); + +const reasonPlaceholder = computed(() => { + if (reasonRequired.value) { + return `请输入${reasonLabel.value}`; + } + + return props.actionType === 'cancel' ? '可填写撤销原因' : '可填写审核意见'; +}); const rules = computed(() => ({ reason: reasonRequired.value @@ -105,7 +113,7 @@ watch( :rows="5" maxlength="1000" show-word-limit - :placeholder="reasonRequired ? `请输入${reasonLabel}` : '可填写审核意见'" + :placeholder="reasonPlaceholder" />