优化界面:对齐课程教室住宿门禁成绩破坏性操作入口与对象名称提示
This commit is contained in:
1 parent
88d6c17ca6
commit
3f0cbe3b16
9 files changed
+145
-6
No files matched your search
@@ -69,3 +69,11 @@ export function transferAccommodation(accommodationId, newDormId, newBedNo) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除预分配住宿安排(仅限未实际入住的预分配记录)
|
||||
export function delAccommodation(accommodationId) {
|
||||
return request({
|
||||
url: '/train/accommodation/' + accommodationId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -42,3 +42,11 @@ export function delAuth(authId) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 注销门禁授权
|
||||
export function revokeAuth(authId) {
|
||||
return request({
|
||||
url: '/train/auth/' + authId + '/revoke',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
@@ -34,3 +34,11 @@ export function updateClassroom(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除教室信息
|
||||
export function delClassroom(classRoomId) {
|
||||
return request({
|
||||
url: '/train/classroom/' + classRoomId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -34,3 +34,11 @@ export function updateCourse(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除课程信息
|
||||
export function delCourse(cId) {
|
||||
return request({
|
||||
url: '/train/course/' + cId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -94,6 +94,15 @@
|
||||
icon="el-icon-check"
|
||||
@click="handleCheckIn(scope.row)"
|
||||
>入住</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.accommodationStatus === 0"
|
||||
v-hasPermi="['train:accommodation:remove']"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
style="color: #F56C6C;"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.accommodationStatus === 1"
|
||||
v-hasPermi="['train:accommodation:edit']"
|
||||
@@ -198,7 +207,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listAccommodation, checkInAccommodation, checkOutAccommodation, transferAccommodation, getAccommodationHistory } from '@/api/train/accommodation'
|
||||
import { listAccommodation, checkInAccommodation, checkOutAccommodation, transferAccommodation, getAccommodationHistory, delAccommodation } from '@/api/train/accommodation'
|
||||
import { listDormitory } from '@/api/train/dormitory'
|
||||
|
||||
export default {
|
||||
@@ -306,6 +315,16 @@ export default {
|
||||
}).catch(() => {
|
||||
this.historyLoading = false
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
const studentDesc = row.studentName ? `${row.studentName} (${row.studentId || ''})` : (row.studentId || `ID:${row.accommodationId}`)
|
||||
const dormDesc = `${row.dormBuilding || ''} ${row.dormRoom || ''}`
|
||||
this.$modal.confirm(`确定要删除学员【${studentDesc}】在宿舍【${dormDesc}】的预分配住宿记录吗?`).then(() => {
|
||||
return delAccommodation(row.accommodationId)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,6 +124,15 @@
|
||||
icon="el-icon-refresh"
|
||||
@click="handleManualReconcile(scope.row)"
|
||||
>手动对账</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.authStatus === 'ACTIVE' || scope.row.authStatus === 'GRANTING'"
|
||||
v-hasPermi="['system:auth:edit']"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-circle-close"
|
||||
style="color: #E6A23C;"
|
||||
@click="handleRevoke(scope.row)"
|
||||
>注销授权</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -222,6 +231,7 @@
|
||||
|
||||
<script>
|
||||
import { listAuth, getOperationHistory, manualReconcile } from '@/api/train/access'
|
||||
import { revokeAuth } from '@/api/train/auth'
|
||||
|
||||
export default {
|
||||
name: 'Auth',
|
||||
@@ -302,6 +312,16 @@ export default {
|
||||
this.oneTimeDialogOpen = true
|
||||
}
|
||||
}).catch(() => {})
|
||||
},
|
||||
handleRevoke(row) {
|
||||
const studentDesc = row.studentId || `报名ID:${row.enrollmentId}`
|
||||
const dormDesc = `${row.dormBuilding || ''} ${row.dormRoom || ''}`
|
||||
this.$modal.confirm(`确定要注销学员【${studentDesc}】在宿舍【${dormDesc}】的门禁授权(授权ID: ${row.authId})吗?注销后该学员将无法通行该门禁。`).then(() => {
|
||||
return revokeAuth(row.authId)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('注销成功')
|
||||
this.getList()
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-hasPermi="['train:classroom:edit']"
|
||||
@@ -81,6 +81,14 @@
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['train:classroom:remove']"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
style="color: #F56C6C;"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -125,7 +133,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listClassroom, getClassroom, addClassroom, updateClassroom } from '@/api/train/classroom'
|
||||
import { listClassroom, getClassroom, addClassroom, updateClassroom, delClassroom } from '@/api/train/classroom'
|
||||
|
||||
export default {
|
||||
name: 'Classroom',
|
||||
@@ -264,6 +272,15 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm(`确定删除教室【${row.roomName}】吗?`).then(() => {
|
||||
return delClassroom(row.classRoomId)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" min-width="120" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160" />
|
||||
<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="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-hasPermi="['train:course:edit']"
|
||||
@@ -88,6 +88,32 @@
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.status === 1"
|
||||
v-hasPermi="['train:course:edit']"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-video-pause"
|
||||
style="color: #E6A23C;"
|
||||
@click="handleStatusChange(scope.row, 0)"
|
||||
>停用</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
v-hasPermi="['train:course:edit']"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-video-play"
|
||||
style="color: #67C23A;"
|
||||
@click="handleStatusChange(scope.row, 1)"
|
||||
>启用</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['train:course:remove']"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
style="color: #F56C6C;"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -140,7 +166,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCourse, getCourse, addCourse, updateCourse } from '@/api/train/course'
|
||||
import { listCourse, getCourse, addCourse, updateCourse, delCourse } from '@/api/train/course'
|
||||
|
||||
export default {
|
||||
name: 'Course',
|
||||
@@ -287,6 +313,28 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 状态切换(停用/启用) */
|
||||
handleStatusChange(row, newStatus) {
|
||||
const actionText = newStatus === 1 ? '启用' : '停用'
|
||||
const promptText = newStatus === 0
|
||||
? `确定停用课程《${row.cName}》吗?停用后该课程将无法被新培训计划选用。`
|
||||
: `确定启用课程《${row.cName}》吗?`
|
||||
this.$modal.confirm(promptText).then(() => {
|
||||
return updateCourse({ cId: row.cId, status: newStatus })
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess(`${actionText}成功`)
|
||||
this.getList()
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm(`确定删除课程《${row.cName}》吗?`).then(() => {
|
||||
return delCourse(row.cId)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +265,10 @@ export default {
|
||||
},
|
||||
handleDelete(row) {
|
||||
const scoreIds = row.scoreId || this.ids
|
||||
this.$modal.confirm('是否确认删除成绩编号为"' + scoreIds + '"的数据项?').then(() => {
|
||||
const confirmText = row.scoreId && row.studentId
|
||||
? `确定要删除学员【${row.studentId}】的课程成绩记录(成绩编号: ${row.scoreId})吗?`
|
||||
: `是否确认删除成绩编号为"${scoreIds}"的数据项?`
|
||||
this.$modal.confirm(confirmText).then(() => {
|
||||
return delScore(scoreIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
|
||||
Reference in new issue
Block a user