兵马未动 粮草先行
This commit is contained in:
@@ -90,12 +90,61 @@
|
||||
</el-table>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 查看详情弹窗(接口:queryDataByStuNo 通过学年学号查看详情) -->
|
||||
<el-dialog
|
||||
v-model="viewDialogVisible"
|
||||
title="学年操行考核详情"
|
||||
width="800px"
|
||||
destroy-on-close
|
||||
@close="viewDetailList = []">
|
||||
<div v-if="viewRow" class="view-summary">
|
||||
<el-descriptions :column="2" border size="small">
|
||||
<el-descriptions-item label="学号">{{ viewRow.stuNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">{{ viewRow.realName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学年">{{ queryForm.schoolYear }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学年总评">
|
||||
{{ viewRow.score != null && viewRow.score !== undefined ? Number(viewRow.score).toFixed(2) : '-' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div class="view-detail-title">考核记录</div>
|
||||
<el-table
|
||||
:data="viewDetailList"
|
||||
v-loading="viewLoading"
|
||||
border
|
||||
size="small"
|
||||
max-height="400"
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle">
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="schoolTerm" label="学期" width="80" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="recordDate" label="考核日期" width="110" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="conductType" label="类型" width="80" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.conductType === '1' ? 'success' : 'danger'" size="small">
|
||||
{{ scope.row.conductType === '1' ? '加分' : scope.row.conductType === '0' ? '扣分' : scope.row.conductType || '-' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="score" label="分数" width="80" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.score != null && scope.row.score !== undefined ? Number(scope.row.score) : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="description" label="情况记录" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="remarks" label="备注" min-width="100" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<template v-if="viewDetailList.length === 0 && !viewLoading">
|
||||
<el-empty description="暂无考核记录" :image-size="80" />
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="StuConductYear">
|
||||
import { reactive, ref, onMounted, computed } from 'vue'
|
||||
import { getStuConductYear } from "/@/api/stuwork/stuconduct";
|
||||
import { getStuConductYear, queryDataByStuNo } from "/@/api/stuwork/stuconduct";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
@@ -113,6 +162,10 @@ const loading = ref(false)
|
||||
const schoolYearList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
const studentList = ref<any[]>([])
|
||||
const viewDialogVisible = ref(false)
|
||||
const viewLoading = ref(false)
|
||||
const viewRow = ref<any>(null)
|
||||
const viewDetailList = ref<any[]>([])
|
||||
|
||||
// 查询表单
|
||||
const queryForm = reactive({
|
||||
@@ -245,8 +298,7 @@ const getDataList = async () => {
|
||||
} else {
|
||||
studentList.value = []
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '获取数据列表失败')
|
||||
} catch (_err) {
|
||||
studentList.value = []
|
||||
} finally {
|
||||
loading.value = false
|
||||
@@ -261,10 +313,27 @@ const handleReset = () => {
|
||||
studentList.value = []
|
||||
}
|
||||
|
||||
// 查看详情
|
||||
const handleView = (row: any) => {
|
||||
// 可以跳转到详情页面或打开详情弹窗
|
||||
useMessage().info('查看详情功能待实现')
|
||||
// 查看详情(接口:GET /stuwork/stuconduct/queryDataByStuNo,通过学年学号查看详情)
|
||||
const handleView = async (row: any) => {
|
||||
if (!queryForm.schoolYear || !row.stuNo) {
|
||||
useMessage().warning('缺少学年或学号')
|
||||
return
|
||||
}
|
||||
viewRow.value = row
|
||||
viewDialogVisible.value = true
|
||||
viewDetailList.value = []
|
||||
viewLoading.value = true
|
||||
try {
|
||||
const res = await queryDataByStuNo({
|
||||
schoolYear: queryForm.schoolYear,
|
||||
stuNo: row.stuNo
|
||||
})
|
||||
viewDetailList.value = Array.isArray(res.data) ? res.data : []
|
||||
} catch (_err) {
|
||||
viewDetailList.value = []
|
||||
} finally {
|
||||
viewLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学年列表
|
||||
@@ -313,6 +382,15 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
.view-summary {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.view-detail-title {
|
||||
margin-bottom: 8px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
// 确保页面可以滚动
|
||||
.layout-padding {
|
||||
height: 100%;
|
||||
|
||||
Reference in New Issue
Block a user