提交代码
This commit is contained in:
1 parent
f9b5e278ea
commit
f2ec6077d0
2 files changed
+219
-75
No files matched your search
@@ -62,6 +62,9 @@
|
||||
<text class="indicator-name">{{ item.indicatorName }}</text>
|
||||
<view class="indicator-meta">
|
||||
<text class="indicator-code">{{ item.indicatorCode }}</text>
|
||||
<text class="max-score-text">
|
||||
最高分值: {{ item.planMaxScore || 0 }}
|
||||
</text>
|
||||
<view
|
||||
class="view-data-btn"
|
||||
@click="handleViewIndicatorData(item)"
|
||||
@@ -79,28 +82,29 @@
|
||||
</text>
|
||||
</view>
|
||||
<view class="score-info">
|
||||
<view class="score-item">
|
||||
<text class="score-label">最高分值:</text>
|
||||
<text class="score-value">{{ item.planMaxScore || 0 }}</text>
|
||||
</view>
|
||||
<view class="score-item">
|
||||
<text class="score-label">自评得分:</text>
|
||||
<view v-if="isViewMode" class="score-display">
|
||||
{{ item.selfScore || '-' }}
|
||||
<view class="score-row">
|
||||
<view class="score-item">
|
||||
<text class="score-label">自评得分:</text>
|
||||
<view v-if="isViewMode" class="score-display">
|
||||
{{ item.selfScore || '-' }}
|
||||
</view>
|
||||
<view v-else class="score-input-container">
|
||||
<u-input
|
||||
v-model="item.selfScore"
|
||||
type="number"
|
||||
placeholder="请输入分数"
|
||||
:maxlength="10"
|
||||
style="width: 200rpx; text-align: right"
|
||||
@change="handleSelfScoreChange"
|
||||
></u-input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="score-item">
|
||||
<text class="score-label">班主任评分:</text>
|
||||
<text class="score-value">
|
||||
{{ item.teacherScore || '-' }}
|
||||
</text>
|
||||
</view>
|
||||
<u-number-box
|
||||
v-else
|
||||
v-model="item.selfScore"
|
||||
:min="0"
|
||||
:max="item.planMaxScore"
|
||||
:step="0.1"
|
||||
size="small"
|
||||
@change="handleSelfScoreChange"
|
||||
></u-number-box>
|
||||
</view>
|
||||
<view class="score-item">
|
||||
<text class="score-label">班主任评分:</text>
|
||||
<text class="score-value">{{ item.teacherScore || '-' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="remark-section">
|
||||
@@ -115,7 +119,7 @@
|
||||
placeholder="请输入自评备注"
|
||||
:maxlength="500"
|
||||
count
|
||||
height="120"
|
||||
height="70"
|
||||
></u-textarea>
|
||||
</view>
|
||||
<view class="form-item-textarea" v-if="item.teacherRemark">
|
||||
@@ -134,7 +138,14 @@
|
||||
<view class="form-section">
|
||||
<view class="section-title">
|
||||
<text>附加分模块</text>
|
||||
<u-button v-if="!isViewMode" type="primary" size="mini" @click="addBonusItem">
|
||||
<u-button
|
||||
v-if="!isViewMode"
|
||||
type="primary"
|
||||
shape="round"
|
||||
size="small"
|
||||
style="width: 160rpx; flex-shrink: 0"
|
||||
@click="addBonusItem"
|
||||
>
|
||||
添加附加分
|
||||
</u-button>
|
||||
</view>
|
||||
@@ -149,7 +160,9 @@
|
||||
<u-button
|
||||
v-if="!isViewMode"
|
||||
type="error"
|
||||
shape="round"
|
||||
size="mini"
|
||||
style="width: 100rpx; flex-shrink: 0; margin-left: auto"
|
||||
@click="removeBonusItem(index)"
|
||||
>
|
||||
删除
|
||||
@@ -168,19 +181,31 @@
|
||||
@change="calculateTotalScore"
|
||||
></u-input>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="form-label">附加分值:</text>
|
||||
<view v-if="isViewMode" class="form-value">
|
||||
{{ item.bonusScore || '-' }}
|
||||
<view class="score-info">
|
||||
<view class="score-row">
|
||||
<view class="score-item">
|
||||
<text class="score-label">附加分值:</text>
|
||||
<view v-if="isViewMode" class="score-display">
|
||||
{{ item.bonusScore || '-' }}
|
||||
</view>
|
||||
<view v-else class="score-input-container">
|
||||
<u-input
|
||||
v-model="item.bonusScore"
|
||||
type="number"
|
||||
placeholder="请输入分数"
|
||||
:maxlength="10"
|
||||
style="width: 200rpx; text-align: right"
|
||||
@change="calculateTotalScore"
|
||||
></u-input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="score-item">
|
||||
<text class="score-label">审核得分:</text>
|
||||
<text class="score-value">
|
||||
{{ item.approvalScore || '-' }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<u-number-box
|
||||
v-else
|
||||
v-model="item.bonusScore"
|
||||
:min="0"
|
||||
:step="0.1"
|
||||
size="small"
|
||||
@change="calculateTotalScore"
|
||||
></u-number-box>
|
||||
</view>
|
||||
<view class="form-item-textarea">
|
||||
<text class="form-label">附加分内容:</text>
|
||||
@@ -191,7 +216,7 @@
|
||||
v-else
|
||||
v-model="item.bonusContent"
|
||||
placeholder="请输入附加分内容"
|
||||
height="120"
|
||||
height="70"
|
||||
></u-textarea>
|
||||
</view>
|
||||
|
||||
@@ -264,6 +289,7 @@
|
||||
v-if="image.status === 'success'"
|
||||
size="mini"
|
||||
type="primary"
|
||||
shape="round"
|
||||
plain
|
||||
@click="handleDownload(image)"
|
||||
>
|
||||
@@ -273,6 +299,7 @@
|
||||
v-if="image.status === 'error'"
|
||||
size="mini"
|
||||
type="warning"
|
||||
shape="round"
|
||||
plain
|
||||
@click="retryUpload(image, item)"
|
||||
>
|
||||
@@ -282,6 +309,7 @@
|
||||
v-if="!isViewMode"
|
||||
size="mini"
|
||||
type="error"
|
||||
shape="round"
|
||||
plain
|
||||
@click="handleDelete(image, item)"
|
||||
>
|
||||
@@ -328,6 +356,7 @@
|
||||
v-if="file.status === 'success'"
|
||||
size="mini"
|
||||
type="primary"
|
||||
shape="round"
|
||||
plain
|
||||
@click="handleDownload(file)"
|
||||
>
|
||||
@@ -337,6 +366,7 @@
|
||||
v-if="file.status === 'error'"
|
||||
size="mini"
|
||||
type="warning"
|
||||
shape="round"
|
||||
plain
|
||||
@click="retryUpload(file, item)"
|
||||
>
|
||||
@@ -346,6 +376,7 @@
|
||||
v-if="!isViewMode"
|
||||
size="mini"
|
||||
type="error"
|
||||
shape="round"
|
||||
plain
|
||||
@click="handleDelete(file, item)"
|
||||
>
|
||||
@@ -363,10 +394,18 @@
|
||||
|
||||
<!-- 上传按钮 -->
|
||||
<view v-if="!isViewMode" class="upload-buttons">
|
||||
<u-button type="primary" @click="handleChooseImage(item)">
|
||||
<u-button
|
||||
type="primary"
|
||||
shape="round"
|
||||
@click="handleChooseImage(item)"
|
||||
>
|
||||
选择图片
|
||||
</u-button>
|
||||
<u-button type="info" @click="handleChooseFile(item)">
|
||||
<u-button
|
||||
type="info"
|
||||
shape="round"
|
||||
@click="handleChooseFile(item)"
|
||||
>
|
||||
选择文件
|
||||
</u-button>
|
||||
</view>
|
||||
@@ -388,10 +427,7 @@
|
||||
size="mini"
|
||||
></u-tag>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="form-label">审核得分:</text>
|
||||
<text class="form-value">{{ item.approvalScore || '-' }}</text>
|
||||
</view>
|
||||
|
||||
<view class="form-item-textarea" v-if="item.approvalRemark">
|
||||
<text class="form-label">审核备注:</text>
|
||||
<view class="form-textarea-value">
|
||||
@@ -408,25 +444,29 @@
|
||||
<view class="section-title">得分统计</view>
|
||||
<view class="form-content">
|
||||
<view class="score-summary">
|
||||
<view class="summary-item">
|
||||
<text class="summary-label">自评总得分:</text>
|
||||
<text class="summary-value">{{ form.selfScore || '0' }}</text>
|
||||
<view class="summary-row">
|
||||
<view class="summary-item">
|
||||
<text class="summary-label">自评总得分:</text>
|
||||
<text class="summary-value">{{ form.selfScore || '0' }}</text>
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<text class="summary-label">班主任评分:</text>
|
||||
<text class="summary-value">{{ form.teacherScore || '-' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<text class="summary-label">班主任评分:</text>
|
||||
<text class="summary-value">{{ form.teacherScore || '-' }}</text>
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<text class="summary-label">总得分:</text>
|
||||
<text class="summary-value">{{ form.totalScore || '-' }}</text>
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<text class="summary-label">申请状态:</text>
|
||||
<u-tag
|
||||
:text="getStatusText(form.status)"
|
||||
:type="getStatusTagType(form.status)"
|
||||
size="mini"
|
||||
></u-tag>
|
||||
<view class="summary-row">
|
||||
<view class="summary-item">
|
||||
<text class="summary-label">总得分:</text>
|
||||
<text class="summary-value">{{ form.totalScore || '-' }}</text>
|
||||
</view>
|
||||
<view class="summary-item">
|
||||
<text class="summary-label">申请状态:</text>
|
||||
<u-tag
|
||||
:text="getStatusText(form.status)"
|
||||
:type="getStatusTagType(form.status)"
|
||||
size="mini"
|
||||
></u-tag>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item-textarea">
|
||||
@@ -440,7 +480,7 @@
|
||||
placeholder="请输入自评备注"
|
||||
:maxlength="500"
|
||||
count
|
||||
height="160"
|
||||
height="110"
|
||||
></u-textarea>
|
||||
</view>
|
||||
<!-- 当状态为6(已完成)时显示班主任审核备注 -->
|
||||
@@ -456,9 +496,11 @@
|
||||
|
||||
<!-- 底部操作按钮 -->
|
||||
<view class="bottom-actions" v-if="!isViewMode">
|
||||
<u-button type="primary" @click="handleSave">保存</u-button>
|
||||
<u-button type="success" @click="handleSubmit">提交</u-button>
|
||||
<u-button v-if="form.id" type="error" @click="handleDelete">删除</u-button>
|
||||
<u-button type="primary" shape="round" @click="handleSave">保存</u-button>
|
||||
<u-button type="success" shape="round" @click="handleSubmit">提交</u-button>
|
||||
<u-button v-if="form.id" type="error" shape="round" @click="handleDelete">
|
||||
删除
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -1277,8 +1319,17 @@ $radius-lg: 16rpx;
|
||||
padding-bottom: 10rpx;
|
||||
border-bottom: 2rpx solid $border-color;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: $spacing-md;
|
||||
|
||||
text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.u-button {
|
||||
flex-shrink: 0;
|
||||
min-width: 160rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.form-content {
|
||||
@@ -1368,6 +1419,12 @@ $radius-lg: 16rpx;
|
||||
color: $text-placeholder;
|
||||
}
|
||||
|
||||
.max-score-text {
|
||||
font-size: 24rpx;
|
||||
color: $text-secondary;
|
||||
margin-left: $spacing-md;
|
||||
}
|
||||
|
||||
.view-data-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -1406,11 +1463,17 @@ $radius-lg: 16rpx;
|
||||
gap: $spacing-sm;
|
||||
}
|
||||
|
||||
.score-row {
|
||||
display: flex;
|
||||
gap: $spacing-md;
|
||||
}
|
||||
|
||||
.score-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: $spacing-sm 0;
|
||||
flex: 1; // 平均分配宽度
|
||||
}
|
||||
|
||||
.score-label {
|
||||
@@ -1432,6 +1495,13 @@ $radius-lg: 16rpx;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.score-input-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
width: 200rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.remark-section {
|
||||
margin-top: $spacing-md;
|
||||
}
|
||||
@@ -1456,6 +1526,7 @@ $radius-lg: 16rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: $text-primary;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.bonus-content {
|
||||
@@ -1593,6 +1664,11 @@ $radius-lg: 16rpx;
|
||||
margin-bottom: $spacing-lg;
|
||||
}
|
||||
|
||||
.summary-row {
|
||||
display: flex;
|
||||
gap: $spacing-md;
|
||||
}
|
||||
|
||||
.summary-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -1601,6 +1677,7 @@ $radius-lg: 16rpx;
|
||||
background-color: #fff;
|
||||
border-radius: $radius-md;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
|
||||
flex: 1; // 平均分配宽度
|
||||
}
|
||||
|
||||
.summary-label {
|
||||
|
||||
@@ -7,13 +7,23 @@
|
||||
</view>
|
||||
</u-navbar>
|
||||
|
||||
<!-- 加载状态 -->
|
||||
<view v-if="loading" class="loading-container">
|
||||
<u-loading-icon mode="flower" size="60"></u-loading-icon>
|
||||
<text class="loading-text">加载中...</text>
|
||||
</view>
|
||||
|
||||
<!-- 页面内容 -->
|
||||
<view class="page-content" v-loading="loading">
|
||||
<view class="page-content" v-if="!loading">
|
||||
<!-- 违纪处分记录区域 -->
|
||||
<view class="record-section">
|
||||
<view class="section-header">
|
||||
<text class="section-title">违纪处分记录</text>
|
||||
<u-tag type="error" size="mini">{{ disciplineRecords.length }} 条记录</u-tag>
|
||||
<u-tag
|
||||
type="error"
|
||||
size="mini"
|
||||
:text="`${disciplineRecords.length} 条记录`"
|
||||
></u-tag>
|
||||
</view>
|
||||
|
||||
<view v-if="disciplineRecords.length > 0" class="record-list">
|
||||
@@ -25,9 +35,11 @@
|
||||
<view class="record-header">
|
||||
<text class="record-type">{{ item.disciplineTypeName }}</text>
|
||||
<view class="record-score">
|
||||
<u-tag type="error" size="mini">
|
||||
-{{ item.scoreDeduction || 0 }}
|
||||
</u-tag>
|
||||
<u-tag
|
||||
type="error"
|
||||
size="mini"
|
||||
:text="`-${item.scoreDeduction || 0}`"
|
||||
></u-tag>
|
||||
</view>
|
||||
</view>
|
||||
<view class="record-content">
|
||||
@@ -62,7 +74,11 @@
|
||||
<view class="record-section">
|
||||
<view class="section-header">
|
||||
<text class="section-title">奖励记录</text>
|
||||
<u-tag type="success" size="mini">{{ rewardRecords.length }} 条记录</u-tag>
|
||||
<u-tag
|
||||
type="success"
|
||||
size="mini"
|
||||
:text="`${rewardRecords.length} 条记录`"
|
||||
></u-tag>
|
||||
</view>
|
||||
|
||||
<view v-if="rewardRecords.length > 0" class="record-list">
|
||||
@@ -70,9 +86,11 @@
|
||||
<view class="record-header">
|
||||
<text class="record-type">{{ item.rewardTypeName }}</text>
|
||||
<view class="record-score">
|
||||
<u-tag type="success" size="mini">
|
||||
+{{ item.scoreAddition || 0 }}
|
||||
</u-tag>
|
||||
<u-tag
|
||||
type="success"
|
||||
size="mini"
|
||||
:text="`+${item.scoreAddition || 0}`"
|
||||
></u-tag>
|
||||
</view>
|
||||
</view>
|
||||
<view class="record-content">
|
||||
@@ -164,7 +182,11 @@ export default {
|
||||
method: 'get',
|
||||
});
|
||||
|
||||
console.log('✅ 指标类型接口响应:', indicatorTypesResponse);
|
||||
|
||||
if (indicatorTypesResponse.code === 200 && indicatorTypesResponse.data) {
|
||||
console.log('✅ 指标类型数据:', JSON.stringify(indicatorTypesResponse.data));
|
||||
|
||||
// 修复字段名映射:后端返回下划线格式,前端使用驼峰格式
|
||||
const disciplineTypeIds =
|
||||
indicatorTypesResponse.data.discipline_type_ids ||
|
||||
@@ -173,12 +195,27 @@ export default {
|
||||
indicatorTypesResponse.data.reward_type_ids ||
|
||||
indicatorTypesResponse.data.rewardTypeIds;
|
||||
|
||||
console.log(
|
||||
'✅ 解析后的类型IDs - disciplineTypeIds:',
|
||||
disciplineTypeIds,
|
||||
'rewardTypeIds:',
|
||||
rewardTypeIds,
|
||||
);
|
||||
|
||||
// 并行加载违纪处分记录和奖励记录
|
||||
await Promise.all([
|
||||
this.loadDisciplineRecords(disciplineTypeIds),
|
||||
this.loadRewardRecords(rewardTypeIds),
|
||||
]);
|
||||
|
||||
console.log(
|
||||
'✅ 数据加载完成 - disciplineRecords长度:',
|
||||
this.disciplineRecords.length,
|
||||
'rewardRecords长度:',
|
||||
this.rewardRecords.length,
|
||||
);
|
||||
} else {
|
||||
console.error('❌ 获取指标类型信息失败,response:', indicatorTypesResponse);
|
||||
uni.showToast({
|
||||
title: '获取指标类型信息失败',
|
||||
icon: 'none',
|
||||
@@ -198,6 +235,7 @@ export default {
|
||||
// 加载违纪处分记录
|
||||
async loadDisciplineRecords(disciplineTypeIds) {
|
||||
if (!disciplineTypeIds) {
|
||||
console.log('🚨 disciplineTypeIds为空,跳过违纪记录加载');
|
||||
this.disciplineRecords = [];
|
||||
return;
|
||||
}
|
||||
@@ -220,9 +258,17 @@ export default {
|
||||
},
|
||||
});
|
||||
|
||||
console.log('✅ 违纪记录接口响应:', response);
|
||||
|
||||
if (response.code === 200) {
|
||||
this.disciplineRecords = response.data || [];
|
||||
console.log(
|
||||
'✅ 违纪记录数据赋值完成,数组长度:',
|
||||
this.disciplineRecords.length,
|
||||
);
|
||||
console.log('✅ 违纪记录数据内容:', JSON.stringify(this.disciplineRecords));
|
||||
} else {
|
||||
console.error('❌ 获取违纪处分记录失败,response:', response);
|
||||
uni.showToast({
|
||||
title: '获取违纪处分记录失败',
|
||||
icon: 'none',
|
||||
@@ -238,10 +284,13 @@ export default {
|
||||
// 加载奖励记录
|
||||
async loadRewardRecords(rewardTypeIds) {
|
||||
if (!rewardTypeIds) {
|
||||
console.log('🚨 rewardTypeIds为空,跳过奖励记录加载');
|
||||
this.rewardRecords = [];
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('加载奖励记录,rewardTypeIds:', rewardTypeIds);
|
||||
|
||||
try {
|
||||
const response = await request({
|
||||
url: '/rewardRecord/rewardRecord/getStudentRewardRecords',
|
||||
@@ -255,9 +304,13 @@ export default {
|
||||
},
|
||||
});
|
||||
|
||||
console.log('✅ 奖励记录接口响应:', response);
|
||||
|
||||
if (response.code === 200) {
|
||||
this.rewardRecords = response.data || [];
|
||||
console.log('✅ 奖励记录数据赋值完成,数组长度:', this.rewardRecords.length);
|
||||
} else {
|
||||
console.error('❌ 获取奖励记录失败,response:', response);
|
||||
uni.showToast({
|
||||
title: '获取奖励记录失败',
|
||||
icon: 'none',
|
||||
@@ -359,7 +412,7 @@ $radius-lg: 16rpx;
|
||||
border-radius: $radius-lg;
|
||||
padding: $spacing-xl;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||
border-left: 4rpx solid $primary-color;
|
||||
// border-left: 4rpx solid $primary-color;
|
||||
}
|
||||
|
||||
.record-header {
|
||||
@@ -431,4 +484,18 @@ $radius-lg: 16rpx;
|
||||
border-radius: $radius-lg;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.loading-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 0;
|
||||
gap: $spacing-lg;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 28rpx;
|
||||
color: $text-secondary;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user