修复交互:对齐参训状态与考勤操作可达性
This commit is contained in:
1 parent
8df14882cb
commit
62088a6209
2 files changed
+31
-4
No files matched your search
@@ -55,8 +55,16 @@
|
||||
<el-table-column label="备注/调整说明" prop="remark" min-width="150" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row.remark || "-" }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="scope.row.signInTime && !scope.row.signOutTime"
|
||||
v-hasPermi="['train:attendance:checkin']"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-circle-check"
|
||||
@click="handleSignOut(scope.row)"
|
||||
>签退</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['train:attendance:edit']"
|
||||
size="mini"
|
||||
@@ -116,7 +124,7 @@
|
||||
|
||||
<script>
|
||||
import { listCheckin } from '@/api/train/checkin'
|
||||
import { adjustAttendance } from '@/api/train/attendance'
|
||||
import { adjustAttendance, signOutAttendance } from '@/api/train/attendance'
|
||||
|
||||
export default {
|
||||
name: 'Checkin',
|
||||
@@ -206,6 +214,17 @@ export default {
|
||||
this.adjustSubmitting = false
|
||||
})
|
||||
})
|
||||
},
|
||||
handleSignOut(row) {
|
||||
this.$modal.confirm(`确认对学员【${row.studentName}】执行课次签退?`).then(() => {
|
||||
return signOutAttendance({
|
||||
enrollmentId: row.enrollmentId,
|
||||
lessonId: row.lessonId
|
||||
})
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('签退成功')
|
||||
this.getList()
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="2" :disabled="scope.row.enrollmentStatus === 2">标记请假</el-dropdown-item>
|
||||
<el-dropdown-item command="3" :disabled="scope.row.enrollmentStatus === 3">标记退训</el-dropdown-item>
|
||||
<el-dropdown-item v-if="scope.row.enrollmentStatus === 2 || scope.row.enrollmentStatus === 3" command="resume">恢复参训</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<!-- 开班前支持移除 -->
|
||||
@@ -469,8 +470,15 @@ export default {
|
||||
},
|
||||
// ---- 变更参训状态 ----
|
||||
handleStatusAction(command, row) {
|
||||
const status = Number(command)
|
||||
const label = status === 2 ? '请假' : '退训'
|
||||
let status
|
||||
let label
|
||||
if (command === 'resume') {
|
||||
status = row.joinTime ? 1 : 0
|
||||
label = row.joinTime ? '恢复已报到归队' : '恢复待报到'
|
||||
} else {
|
||||
status = Number(command)
|
||||
label = status === 2 ? '请假' : '退训'
|
||||
}
|
||||
this.$prompt(`请输入将学员【${row.studentName}】标记为【${label}】的备注原因:`, '变更参训状态', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
||||
Reference in new issue
Block a user