fix(加班申请): 修复加班申请中,和状态机相关的代码的不合理的地方。
This commit is contained in:
@@ -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: '撤销',
|
||||
|
||||
@@ -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"
|
||||
/>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
|
||||
Reference in New Issue
Block a user