fix(加班申请): 修复加班申请中,和状态机相关的代码的不合理的地方。

This commit is contained in:
dk
2026-06-03 21:04:51 +08:00
parent d3d0830820
commit 9d84b1aae0
2 changed files with 12 additions and 4 deletions

View File

@@ -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({ actions.push({
key: 'edit', key: 'edit',
label: '修改', label: '修改',
@@ -189,7 +189,7 @@ function getRowActions(row: Api.OvertimeApplication.OvertimeApplication): Busine
onClick: () => openStatusLog(row) onClick: () => openStatusLog(row)
}); });
if (row.statusCode === 'pending' || row.statusCode === 'rejected') { if (row.statusCode === 'pending') {
actions.push({ actions.push({
key: 'cancel', key: 'cancel',
label: '撤销', label: '撤销',

View File

@@ -51,7 +51,15 @@ const reasonLabel = computed(() => {
return map[props.actionType]; 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(() => ({ const rules = computed(() => ({
reason: reasonRequired.value reason: reasonRequired.value
@@ -105,7 +113,7 @@ watch(
:rows="5" :rows="5"
maxlength="1000" maxlength="1000"
show-word-limit show-word-limit
:placeholder="reasonRequired ? `请输入${reasonLabel}` : '可填写审核意见'" :placeholder="reasonPlaceholder"
/> />
</ElFormItem> </ElFormItem>
</ElForm> </ElForm>