“数据更新”
This commit is contained in:
1 parent
1277f1c6aa
commit
26044cc790
23 files changed
+2835
-15
No files matched your search
@@ -70,7 +70,7 @@ export function delBmzrAssessmentIndicator(ids: string | number | Array<string |
|
||||
*/
|
||||
export function getIndicatorTypeOptions() {
|
||||
return request({
|
||||
url: '/bzrkh/assessmentIndicator/indicatorTypes/options',
|
||||
url: '/bzrkh/assessmentIndicatorType/listAllIncludeDeleted',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -81,7 +81,7 @@ export function getIndicatorTypeOptions() {
|
||||
*/
|
||||
export function getParentIndicatorOptions() {
|
||||
return request({
|
||||
url: '/bzrkh/assessmentIndicator/parentIndicators/options',
|
||||
url: '/bzrkh/assessmentIndicator/treeselect',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -1,6 +1,13 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { TeacherClassVO, TeacherAssessmentPlanVO, TeacherAssessmentPlanQuery, TeacherClassQuery } from './types';
|
||||
import {
|
||||
TeacherClassVO,
|
||||
TeacherAssessmentPlanVO,
|
||||
TeacherAssessmentPlanQuery,
|
||||
TeacherClassQuery,
|
||||
AssessmentDetailVO,
|
||||
AssessmentSubmitVO
|
||||
} from './types';
|
||||
|
||||
/**
|
||||
* 查询班主任管理的班级列表
|
||||
@@ -58,4 +65,32 @@ export const getAssessmentDetail = (planId: string | number, classId: string | n
|
||||
classId
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取考核提交详情数据(用于提交弹窗)
|
||||
* @param planId 计划ID
|
||||
* @param classId 班级ID
|
||||
*/
|
||||
export const getAssessmentSubmitDetail = (planId: string | number, classId: string | number): AxiosPromise<AssessmentDetailVO> => {
|
||||
return request({
|
||||
url: '/bzrkh/teacherAssessment/submitDetail',
|
||||
method: 'get',
|
||||
params: {
|
||||
planId,
|
||||
classId
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 提交考核评分数据
|
||||
* @param data 考核提交数据
|
||||
*/
|
||||
export const submitAssessmentScore = (data: AssessmentSubmitVO): AxiosPromise<void> => {
|
||||
return request({
|
||||
url: '/bzrkh/teacherAssessment/submitScore',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
@@ -204,4 +204,221 @@ export interface TeacherClassQuery {
|
||||
* 班级状态:1-正常,2-暂停,3-毕业,4-解散
|
||||
*/
|
||||
classStatus?: string;
|
||||
}
|
||||
|
||||
// ========== 新增:考核提交相关类型定义 ==========
|
||||
|
||||
/**
|
||||
* 班级详细信息
|
||||
*/
|
||||
export interface ClassDetailVO {
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 班级层次:1-中级工 2-高级工 3-预备技师 4-技师 5-中高职一体
|
||||
*/
|
||||
classType?: string;
|
||||
|
||||
/**
|
||||
* 班级总人数
|
||||
*/
|
||||
totalStudentCount?: number;
|
||||
|
||||
/**
|
||||
* 住校生人数
|
||||
*/
|
||||
boardingStudentCount?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 系数信息
|
||||
*/
|
||||
export interface CoefficientVO {
|
||||
/**
|
||||
* 人数系数(K2)
|
||||
*/
|
||||
studentCountCoefficient?: number;
|
||||
|
||||
/**
|
||||
* 住校生系数(K3)
|
||||
*/
|
||||
boardingCoefficient?: number;
|
||||
|
||||
/**
|
||||
* 层次系数(K1)
|
||||
*/
|
||||
levelCoefficient?: number;
|
||||
|
||||
/**
|
||||
* 总系数(K = K1 * (K2 + K3))
|
||||
*/
|
||||
totalCoefficient?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 考核指标信息
|
||||
*/
|
||||
export interface AssessmentIndicatorVO {
|
||||
/**
|
||||
* 指标ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 指标名称
|
||||
*/
|
||||
indicatorName?: string;
|
||||
|
||||
/**
|
||||
* 指标编码
|
||||
*/
|
||||
indicatorCode?: string;
|
||||
|
||||
/**
|
||||
* 指标描述
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* 指标分值
|
||||
*/
|
||||
score?: number;
|
||||
|
||||
/**
|
||||
* 自评分数
|
||||
*/
|
||||
selfScore?: number;
|
||||
|
||||
/**
|
||||
* 自评意见
|
||||
*/
|
||||
selfComment?: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sortOrder?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 特色工作指标
|
||||
*/
|
||||
export interface SpecialWorkIndicatorVO {
|
||||
/**
|
||||
* 指标编码
|
||||
*/
|
||||
indicatorCode?: string;
|
||||
|
||||
/**
|
||||
* 指标名称
|
||||
*/
|
||||
indicatorName?: string;
|
||||
|
||||
/**
|
||||
* 分值
|
||||
*/
|
||||
score?: number;
|
||||
|
||||
/**
|
||||
* 自评意见
|
||||
*/
|
||||
selfComment?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 考核提交数据
|
||||
*/
|
||||
export interface AssessmentSubmitVO {
|
||||
/**
|
||||
* 考核计划ID
|
||||
*/
|
||||
planId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班主任常规工作指标评分
|
||||
*/
|
||||
routineWorkScores?: AssessmentIndicatorVO[];
|
||||
|
||||
/**
|
||||
* 班级扣分
|
||||
*/
|
||||
classDeduction?: number;
|
||||
|
||||
/**
|
||||
* 班级扣分意见
|
||||
*/
|
||||
classDeductionComment?: string;
|
||||
|
||||
/**
|
||||
* 特色工作指标评分
|
||||
*/
|
||||
specialWorkScores?: SpecialWorkIndicatorVO[];
|
||||
|
||||
/**
|
||||
* 总体评价
|
||||
*/
|
||||
overallComment?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 考核详情数据
|
||||
*/
|
||||
export interface AssessmentDetailVO {
|
||||
/**
|
||||
* 班级详细信息
|
||||
*/
|
||||
classDetail?: ClassDetailVO;
|
||||
|
||||
/**
|
||||
* 系数信息
|
||||
*/
|
||||
coefficient?: CoefficientVO;
|
||||
|
||||
/**
|
||||
* 班主任常规工作指标列表
|
||||
*/
|
||||
routineWorkIndicators?: AssessmentIndicatorVO[];
|
||||
|
||||
/**
|
||||
* 班级扣分指标
|
||||
*/
|
||||
classDeductionIndicator?: AssessmentIndicatorVO;
|
||||
|
||||
/**
|
||||
* 特色工作指标列表
|
||||
*/
|
||||
specialWorkIndicators?: SpecialWorkIndicatorVO[];
|
||||
|
||||
/**
|
||||
* 月考核得分
|
||||
*/
|
||||
monthlyScore?: number;
|
||||
|
||||
/**
|
||||
* 总体评价
|
||||
*/
|
||||
overallComment?: string;
|
||||
}
|
||||
@@ -35,15 +35,15 @@
|
||||
<!-- 表格区域 -->
|
||||
<el-card shadow="never" class="button-card table-card">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Edit" @click="() => handleSubmitAssessment()" :disabled="!hasSelectedPlan">提交考核</el-button>
|
||||
<el-button type="primary" plain icon="Edit" @click="() => handleSubmitAssessment()" :disabled="!hasSelectedPlan"></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="View" @click="() => handleViewAssessment()" :disabled="!hasSelectedPlan">查看考核</el-button>
|
||||
<el-button type="success" plain icon="View" @click="() => handleViewAssessment()" :disabled="!hasSelectedPlan"></el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
</template>
|
||||
|
||||
<div class="table-container">
|
||||
@@ -78,10 +78,22 @@
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="提交考核" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleSubmitAssessment(scope.row)">提交考核</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
:disabled="loading || !isDataReady"
|
||||
@click="handleSubmitAssessment(scope.row)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="查看考核" placement="top">
|
||||
<el-button link type="success" icon="View" @click="handleViewAssessment(scope.row)">查看考核</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="View"
|
||||
:disabled="loading || !isDataReady"
|
||||
@click="handleViewAssessment(scope.row)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -100,10 +112,19 @@
|
||||
<el-card shadow="never" v-else-if="!loading && teacherClasses.length === 0">
|
||||
<el-empty description="您暂时没有担任班主任的班级" />
|
||||
</el-card>
|
||||
|
||||
<!-- 考核提交弹窗 -->
|
||||
<SubmitDialog
|
||||
ref="submitDialogRef"
|
||||
:plan-id="currentPlanId"
|
||||
:class-id="currentClassId"
|
||||
@success="handleSubmitSuccess"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="TeacherAssessment" lang="ts">
|
||||
import { computed, nextTick } from 'vue';
|
||||
import {
|
||||
listTeacherClasses,
|
||||
listTeacherAssessmentPlans,
|
||||
@@ -116,6 +137,7 @@ import {
|
||||
TeacherAssessmentPlanQuery
|
||||
} from '@/api/bzrkh/teacherAssessment/types';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import SubmitDialog from './submitDialog.vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const userStore = useUserStore();
|
||||
@@ -129,6 +151,11 @@ const selectedPlans = ref<TeacherAssessmentPlanVO[]>([]);
|
||||
const hasSelectedPlan = ref(false);
|
||||
const total = ref(0);
|
||||
|
||||
// 考核提交相关状态
|
||||
const currentPlanId = ref<string | number>();
|
||||
const currentClassId = ref<string | number>();
|
||||
const submitDialogRef = ref();
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
|
||||
const data = reactive<PageData<any, TeacherAssessmentPlanQuery>>({
|
||||
@@ -144,6 +171,11 @@ const data = reactive<PageData<any, TeacherAssessmentPlanQuery>>({
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
|
||||
// 计算数据是否已准备就绪
|
||||
const isDataReady = computed(() => {
|
||||
return teacherClasses.value.length > 0 && activeTab.value !== '';
|
||||
});
|
||||
|
||||
/** 获取班主任管理的班级列表 */
|
||||
const getTeacherClasses = async () => {
|
||||
loading.value = true;
|
||||
@@ -157,10 +189,13 @@ const getTeacherClasses = async () => {
|
||||
if (teacherClasses.value.length > 0) {
|
||||
// 默认选中第一个班级
|
||||
activeTab.value = teacherClasses.value[0].id?.toString() || '';
|
||||
// 等待activeTab设置完成后再获取列表
|
||||
await nextTick();
|
||||
await getList();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取班级列表失败:', error);
|
||||
proxy?.$modal.msgError('获取班级列表失败,请刷新页面重试');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
@@ -222,13 +257,41 @@ const handleSubmitAssessment = async (row?: TeacherAssessmentPlanVO) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const planNames = plans.map(p => p.planName).join('、');
|
||||
if (plans.length > 1) {
|
||||
proxy?.$modal.msgWarning('每次只能提交一个考核计划');
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证数据是否已准备就绪
|
||||
if (!isDataReady.value) {
|
||||
proxy?.$modal.msgWarning('数据加载中,请稍后再试');
|
||||
return;
|
||||
}
|
||||
|
||||
const plan = plans[0];
|
||||
|
||||
// 确保计划ID存在
|
||||
if (!plan.id) {
|
||||
proxy?.$modal.msgError('考核计划ID无效');
|
||||
return;
|
||||
}
|
||||
|
||||
const currentClass = teacherClasses.value.find(c => c.id?.toString() === activeTab.value);
|
||||
|
||||
await proxy?.$modal.confirm(`确认要提交班级"${currentClass?.className}"的考核计划"${planNames}"吗?`).then(async () => {
|
||||
// TODO: 实现提交考核逻辑
|
||||
proxy?.$modal.msg('提交考核功能待实现');
|
||||
});
|
||||
if (!currentClass || !currentClass.id) {
|
||||
proxy?.$modal.msgError('获取班级信息失败,请刷新页面后重试');
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置当前考核的计划ID和班级ID
|
||||
currentPlanId.value = plan.id;
|
||||
currentClassId.value = currentClass.id;
|
||||
|
||||
// 确保参数设置成功后再打开弹窗
|
||||
await nextTick();
|
||||
|
||||
// 打开提交弹窗
|
||||
submitDialogRef.value?.open();
|
||||
};
|
||||
|
||||
/** 查看考核 */
|
||||
@@ -239,10 +302,40 @@ const handleViewAssessment = async (row?: TeacherAssessmentPlanVO) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证数据是否已准备就绪
|
||||
if (!isDataReady.value) {
|
||||
proxy?.$modal.msgWarning('数据加载中,请稍后再试');
|
||||
return;
|
||||
}
|
||||
|
||||
const plan = plans[0];
|
||||
|
||||
// 确保计划ID存在
|
||||
if (!plan.id) {
|
||||
proxy?.$modal.msgError('考核计划ID无效');
|
||||
return;
|
||||
}
|
||||
|
||||
const currentClass = teacherClasses.value.find(c => c.id?.toString() === activeTab.value);
|
||||
|
||||
if (!currentClass || !currentClass.id) {
|
||||
proxy?.$modal.msgError('获取班级信息失败,请刷新页面后重试');
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: 实现查看考核逻辑
|
||||
proxy?.$modal.msg('查看考核功能待实现');
|
||||
};
|
||||
|
||||
/** 考核提交成功回调 */
|
||||
const handleSubmitSuccess = () => {
|
||||
// 刷新考核计划列表
|
||||
getList();
|
||||
// 清空选择
|
||||
selectedPlans.value = [];
|
||||
hasSelectedPlan.value = false;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getTeacherClasses();
|
||||
});
|
||||
|
||||
@@ -0,0 +1,699 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="dialogTitle"
|
||||
v-model="visible"
|
||||
width="1200px"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
@close="handleClose"
|
||||
>
|
||||
<div v-loading="loading" class="submit-dialog-content">
|
||||
<!-- 1. 班级信息卡片 -->
|
||||
<el-card shadow="never" class="info-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>班级信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="学院名称">{{ assessmentDetail?.classDetail?.collegeName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="专业名称">{{ assessmentDetail?.classDetail?.majorName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班级名称">{{ assessmentDetail?.classDetail?.className || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 2. 人数系数卡片 -->
|
||||
<el-card shadow="never" class="info-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>人数系数(K2)</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="班级总人数">{{ assessmentDetail?.classDetail?.totalStudentCount || 0 }}人</el-descriptions-item>
|
||||
<el-descriptions-item label="人数系数">{{ formatNumber(assessmentDetail?.coefficient?.studentCountCoefficient, 4) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 3. 住校生系数卡片 -->
|
||||
<el-card shadow="never" class="info-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>住校生系数(K3)</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="住校生人数">{{ assessmentDetail?.classDetail?.boardingStudentCount || 0 }}人</el-descriptions-item>
|
||||
<el-descriptions-item label="住校生系数">{{ formatNumber(assessmentDetail?.coefficient?.boardingCoefficient, 4) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 4. 层次系数卡片 -->
|
||||
<el-card shadow="never" class="info-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>层次系数(K1)</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="班级学历层级">{{ getClassTypeText(assessmentDetail?.classDetail?.classType) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="层次系数">{{ formatNumber(assessmentDetail?.coefficient?.levelCoefficient, 4) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 5. 总系数卡片 -->
|
||||
<el-card shadow="never" class="info-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>总系数(K)</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="总系数">{{ formatNumber(assessmentDetail?.coefficient?.totalCoefficient, 6) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 6. 班主任常规工作(50分)卡片 -->
|
||||
<el-card shadow="never" class="info-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>班主任常规工作(50分)</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-table border :data="routineWorkScores" style="width: 100%">
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="indicatorName" label="指标名称" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="description" label="指标描述" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="score" label="指标分值" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.score || 0 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="自评分数" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.selfScore"
|
||||
:min="0"
|
||||
:max="scope.row.score || 100"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
placeholder="请输入分数"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="自评意见" width="200" align="center">
|
||||
<template #default="scope">
|
||||
<el-input
|
||||
v-model="scope.row.selfComment"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入自评意见"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<!-- 7. 班级管理实效(50分)卡片 -->
|
||||
<el-card shadow="never" class="info-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>班级管理实效(50分)</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form :model="managementEffectivenessForm" label-width="150px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="班级扣分">
|
||||
<el-input-number
|
||||
v-model="managementEffectivenessForm.classDeduction"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
placeholder="请输入扣分"
|
||||
@change="calculateDeductionHalf"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="按班级扣分50%计">
|
||||
<el-input
|
||||
:value="managementEffectivenessForm.classDeductionHalf?.toFixed(2) || '0.00'"
|
||||
readonly
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item>
|
||||
<el-button type="info" plain @click="handleViewStudentViolations">学生违规处分信息查看</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="自评意见">
|
||||
<el-input
|
||||
v-model="managementEffectivenessForm.selfComment"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入自评意见"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 8. 特色工作(加20分)卡片 -->
|
||||
<el-card shadow="never" class="info-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>特色工作(加20分)</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form :model="specialWorkForm" label-width="200px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="及时并妥善处理好学生违纪事件">
|
||||
<el-input-number
|
||||
v-model="specialWorkForm.score1"
|
||||
:min="0"
|
||||
:max="20"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
placeholder="请输入分值"
|
||||
@change="calculateTotalSpecialScore"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="自评意见">
|
||||
<el-input
|
||||
v-model="specialWorkForm.comment1"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入自评意见"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级活动获奖情况">
|
||||
<el-input-number
|
||||
v-model="specialWorkForm.score2"
|
||||
:min="0"
|
||||
:max="20"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
placeholder="请输入分值"
|
||||
@change="calculateTotalSpecialScore"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="自评意见">
|
||||
<el-input
|
||||
v-model="specialWorkForm.comment2"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入自评意见"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级宣传工作有特色">
|
||||
<el-input-number
|
||||
v-model="specialWorkForm.score3"
|
||||
:min="0"
|
||||
:max="20"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
placeholder="请输入分值"
|
||||
@change="calculateTotalSpecialScore"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="自评意见">
|
||||
<el-input
|
||||
v-model="specialWorkForm.comment3"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入自评意见"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="其他">
|
||||
<el-input-number
|
||||
v-model="specialWorkForm.score4"
|
||||
:min="0"
|
||||
:max="20"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
placeholder="请输入分值"
|
||||
@change="calculateTotalSpecialScore"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="自评意见">
|
||||
<el-input
|
||||
v-model="specialWorkForm.comment4"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入自评意见"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="总分值">
|
||||
<el-input
|
||||
:value="specialWorkForm.totalScore?.toFixed(2) || '0.00'"
|
||||
readonly
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 9. 月考核得分卡片 -->
|
||||
<el-card shadow="never" class="info-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>月考核得分</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form :model="monthlyScoreForm" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="月考核得分">
|
||||
<el-input
|
||||
:value="calculateMonthlyScore().toFixed(2)"
|
||||
readonly
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="总体评价">
|
||||
<el-input
|
||||
v-model="monthlyScoreForm.overallComment"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入总体评价"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="submitLoading" type="primary" @click="handleSubmit">保存</el-button>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="SubmitDialog" lang="ts">
|
||||
import {
|
||||
getAssessmentSubmitDetail,
|
||||
submitAssessmentScore
|
||||
} from '@/api/bzrkh/teacherAssessment';
|
||||
import {
|
||||
AssessmentDetailVO,
|
||||
AssessmentIndicatorVO,
|
||||
SpecialWorkIndicatorVO,
|
||||
AssessmentSubmitVO
|
||||
} from '@/api/bzrkh/teacherAssessment/types';
|
||||
|
||||
interface Props {
|
||||
planId?: string | number;
|
||||
classId?: string | number;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
const emit = defineEmits(['success']);
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const visible = ref(false);
|
||||
const loading = ref(false);
|
||||
const submitLoading = ref(false);
|
||||
|
||||
const assessmentDetail = ref<AssessmentDetailVO>();
|
||||
const routineWorkScores = ref<AssessmentIndicatorVO[]>([]);
|
||||
|
||||
// 班级管理实效表单
|
||||
const managementEffectivenessForm = reactive({
|
||||
classDeduction: 0,
|
||||
classDeductionHalf: 0,
|
||||
selfComment: ''
|
||||
});
|
||||
|
||||
// 特色工作表单
|
||||
const specialWorkForm = reactive({
|
||||
score1: 0, // 及时并妥善处理好学生违纪事件
|
||||
comment1: '',
|
||||
score2: 0, // 班级活动获奖情况
|
||||
comment2: '',
|
||||
score3: 0, // 班级宣传工作有特色
|
||||
comment3: '',
|
||||
score4: 0, // 其他
|
||||
comment4: '',
|
||||
totalScore: 0
|
||||
});
|
||||
|
||||
// 月考核得分表单
|
||||
const monthlyScoreForm = reactive({
|
||||
overallComment: ''
|
||||
});
|
||||
|
||||
const dialogTitle = computed(() => {
|
||||
const className = assessmentDetail.value?.classDetail?.className || '';
|
||||
return `${className} - 班主任考核提交`;
|
||||
});
|
||||
|
||||
/** 获取班级层次文本 */
|
||||
const getClassTypeText = (classType?: string) => {
|
||||
const typeMap: Record<string, string> = {
|
||||
'1': '中级工班',
|
||||
'2': '高级工班',
|
||||
'3': '预备技师班',
|
||||
'4': '技师班',
|
||||
'5': '中高职一体'
|
||||
};
|
||||
return typeMap[classType || ''] || '未知';
|
||||
};
|
||||
|
||||
/** 格式化数字显示 */
|
||||
const formatNumber = (value?: number | string, precision = 4) => {
|
||||
if (value === undefined || value === null || value === '') {
|
||||
return '0.' + '0'.repeat(precision);
|
||||
}
|
||||
|
||||
const numValue = typeof value === 'string' ? parseFloat(value) : value;
|
||||
|
||||
if (isNaN(numValue)) {
|
||||
return '0.' + '0'.repeat(precision);
|
||||
}
|
||||
|
||||
return numValue.toFixed(precision);
|
||||
};
|
||||
|
||||
/** 计算班级扣分50%计 */
|
||||
const calculateDeductionHalf = () => {
|
||||
managementEffectivenessForm.classDeductionHalf = (managementEffectivenessForm.classDeduction || 0) * 0.5;
|
||||
};
|
||||
|
||||
/** 计算特色工作总分 */
|
||||
const calculateTotalSpecialScore = () => {
|
||||
specialWorkForm.totalScore = (specialWorkForm.score1 || 0) +
|
||||
(specialWorkForm.score2 || 0) +
|
||||
(specialWorkForm.score3 || 0) +
|
||||
(specialWorkForm.score4 || 0);
|
||||
};
|
||||
|
||||
/** 计算月考核得分 */
|
||||
const calculateMonthlyScore = () => {
|
||||
// 总系数(K)
|
||||
const totalCoefficient = assessmentDetail.value?.coefficient?.totalCoefficient || 0;
|
||||
|
||||
// 班主任常规工作自评分之和
|
||||
const routineWorkTotal = routineWorkScores.value.reduce((sum, item) => sum + (item.selfScore || 0), 0);
|
||||
|
||||
// 按班级扣分50%计的分值
|
||||
const deductionHalf = managementEffectivenessForm.classDeductionHalf || 0;
|
||||
|
||||
// 特色工作总分值
|
||||
const specialWorkTotal = specialWorkForm.totalScore || 0;
|
||||
|
||||
// 月考核得分 = 总系数(K)* (班主任常规工作自评分之和 - 按班级扣分50%计的分值 + 特色工作总分值)
|
||||
return totalCoefficient * (routineWorkTotal - deductionHalf + specialWorkTotal);
|
||||
};
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async () => {
|
||||
if (!props.planId || !props.classId) {
|
||||
proxy?.$modal.msgError('参数错误:缺少计划ID或班级ID');
|
||||
return;
|
||||
}
|
||||
|
||||
visible.value = true;
|
||||
await loadAssessmentDetail();
|
||||
};
|
||||
|
||||
/** 加载考核详情数据 */
|
||||
const loadAssessmentDetail = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getAssessmentSubmitDetail(props.planId!, props.classId!);
|
||||
assessmentDetail.value = res.data;
|
||||
|
||||
// 初始化班主任常规工作数据
|
||||
routineWorkScores.value = (assessmentDetail.value?.routineWorkIndicators || []).map(item => ({
|
||||
...item,
|
||||
selfScore: item.selfScore || 0,
|
||||
selfComment: item.selfComment || ''
|
||||
}));
|
||||
|
||||
// 初始化班级管理实效数据
|
||||
if (assessmentDetail.value?.classDeductionIndicator) {
|
||||
managementEffectivenessForm.classDeduction = assessmentDetail.value.classDeductionIndicator.selfScore || 0;
|
||||
managementEffectivenessForm.selfComment = assessmentDetail.value.classDeductionIndicator.selfComment || '';
|
||||
calculateDeductionHalf();
|
||||
}
|
||||
|
||||
// 初始化特色工作数据
|
||||
const specialWorkIndicators = assessmentDetail.value?.specialWorkIndicators || [];
|
||||
specialWorkIndicators.forEach(item => {
|
||||
switch (item.indicatorCode) {
|
||||
case 'bzrtsgz001':
|
||||
specialWorkForm.score1 = Number(item.score) || 0;
|
||||
specialWorkForm.comment1 = item.selfComment || '';
|
||||
break;
|
||||
case 'bzrtsgz002':
|
||||
specialWorkForm.score2 = Number(item.score) || 0;
|
||||
specialWorkForm.comment2 = item.selfComment || '';
|
||||
break;
|
||||
case 'bzrtsgz003':
|
||||
specialWorkForm.score3 = Number(item.score) || 0;
|
||||
specialWorkForm.comment3 = item.selfComment || '';
|
||||
break;
|
||||
case 'bzrtsgz004':
|
||||
specialWorkForm.score4 = Number(item.score) || 0;
|
||||
specialWorkForm.comment4 = item.selfComment || '';
|
||||
break;
|
||||
}
|
||||
});
|
||||
// 确保特色工作总分重新计算
|
||||
calculateTotalSpecialScore();
|
||||
|
||||
// 初始化月考核得分数据
|
||||
monthlyScoreForm.overallComment = assessmentDetail.value?.overallComment || '';
|
||||
|
||||
// 调试信息:验证数据是否正确加载
|
||||
console.log('数据回显完成:', {
|
||||
totalSpecialScore: specialWorkForm.totalScore,
|
||||
monthlyScore: calculateMonthlyScore(),
|
||||
overallComment: monthlyScoreForm.overallComment
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
console.error('加载考核详情失败:', error);
|
||||
proxy?.$modal.msgError('加载考核详情失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 查看学生违规处分信息 */
|
||||
const handleViewStudentViolations = () => {
|
||||
proxy?.$modal.msg('学生违规处分信息查看功能暂未实现');
|
||||
};
|
||||
|
||||
/** 提交考核 */
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
// 验证必填项
|
||||
if (routineWorkScores.value.some(item => item.selfScore === undefined || item.selfScore === null)) {
|
||||
proxy?.$modal.msgWarning('请完善班主任常规工作的自评分数');
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证必要参数
|
||||
if (!props.planId || !props.classId) {
|
||||
proxy?.$modal.msgError('缺少必要参数:计划ID或班级ID');
|
||||
return;
|
||||
}
|
||||
|
||||
submitLoading.value = true;
|
||||
|
||||
// 构造提交数据
|
||||
const submitData: AssessmentSubmitVO = {
|
||||
planId: props.planId, // 考核计划ID
|
||||
classId: props.classId, // 班级ID - 将存储到数据库 class_id 字段
|
||||
routineWorkScores: routineWorkScores.value,
|
||||
classDeduction: managementEffectivenessForm.classDeduction,
|
||||
classDeductionComment: managementEffectivenessForm.selfComment,
|
||||
specialWorkScores: [
|
||||
{
|
||||
indicatorCode: 'bzrtsgz001',
|
||||
indicatorName: '及时并妥善处理好学生违纪事件',
|
||||
score: specialWorkForm.score1,
|
||||
selfComment: specialWorkForm.comment1
|
||||
},
|
||||
{
|
||||
indicatorCode: 'bzrtsgz002',
|
||||
indicatorName: '班级活动获奖情况',
|
||||
score: specialWorkForm.score2,
|
||||
selfComment: specialWorkForm.comment2
|
||||
},
|
||||
{
|
||||
indicatorCode: 'bzrtsgz003',
|
||||
indicatorName: '班级宣传工作有特色',
|
||||
score: specialWorkForm.score3,
|
||||
selfComment: specialWorkForm.comment3
|
||||
},
|
||||
{
|
||||
indicatorCode: 'bzrtsgz004',
|
||||
indicatorName: '其他',
|
||||
score: specialWorkForm.score4,
|
||||
selfComment: specialWorkForm.comment4
|
||||
}
|
||||
],
|
||||
overallComment: monthlyScoreForm.overallComment // 自我总体评价 - 将存储到数据库 self_overall_comment 字段
|
||||
};
|
||||
|
||||
await submitAssessmentScore(submitData);
|
||||
proxy?.$modal.msgSuccess('考核提交成功');
|
||||
emit('success');
|
||||
handleClose();
|
||||
|
||||
} catch (error) {
|
||||
console.error('提交考核失败:', error);
|
||||
proxy?.$modal.msgError('提交考核失败');
|
||||
} finally {
|
||||
submitLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 关闭弹窗 */
|
||||
const handleClose = () => {
|
||||
visible.value = false;
|
||||
// 重置表单数据
|
||||
routineWorkScores.value = [];
|
||||
Object.assign(managementEffectivenessForm, {
|
||||
classDeduction: 0,
|
||||
classDeductionHalf: 0,
|
||||
selfComment: ''
|
||||
});
|
||||
Object.assign(specialWorkForm, {
|
||||
score1: 0,
|
||||
comment1: '',
|
||||
score2: 0,
|
||||
comment2: '',
|
||||
score3: 0,
|
||||
comment3: '',
|
||||
score4: 0,
|
||||
comment4: '',
|
||||
totalScore: 0
|
||||
});
|
||||
Object.assign(monthlyScoreForm, {
|
||||
overallComment: ''
|
||||
});
|
||||
};
|
||||
|
||||
// 暴露给父组件的方法
|
||||
defineExpose({
|
||||
open
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.submit-dialog-content {
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.info-card {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.info-card:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
/* 表格样式 */
|
||||
:deep(.el-table) {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
:deep(.el-table th) {
|
||||
background-color: #f5f7fa;
|
||||
color: #606266;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 表单样式 */
|
||||
:deep(.el-form-item__label) {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 只读输入框样式 */
|
||||
:deep(.el-input.is-disabled .el-input__wrapper) {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
/* 响应式布局 */
|
||||
@media (max-width: 768px) {
|
||||
.submit-dialog-content {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.info-card {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user