Compare commits

...

5 Commits

Author SHA1 Message Date
5cccc6aa45 辅导员管理-添加学生测评和通知任务佐证功能
- 新增职业测评佐证相关页面配置,包括列表、添加、详情页面
- 新增通知任务佐证相关页面配置,包括列表、添加、详情页面
- 实现学生管理组件中上传材料功能,支持职业测评和通知任务材料上传
- 优化专业工作组件,支持毕业生和非毕业生不同评分字段逻辑
- 调整个人报告页面标签配置,区分毕业生和非毕业生不同业务流程
- 完善表单验证逻辑,针对不同班级类型和标签页进行差异化处理
```
2026-03-16 16:56:01 +08:00
705efc5dde Merge branch 'main' of http://47.112.118.149:10082/xgxt_sd/zhxg_app 2026-03-13 16:33:38 +08:00
904a354cc9 修改贫困认定申请页面的完善信息提示 2026-03-13 16:33:35 +08:00
80f08a29e4 Merge branch 'main' of http://47.112.118.149:10082/xgxt_sd/zhxg_app 2026-03-13 15:14:33 +08:00
ecc0d00a4f 辅导员管理-添加业绩考核个人填报详情和加分项、就业指导工作API
- 新增kpiFillingDetail函数用于获取业绩考核个人填报详情
- 新增加分项相关API:kpiFillingBonusPointsAdd、kpiFillingBonusPointsUpdate、
  kpiFillingBonusPointsDetail
- 新增就业指导工作相关API:kpiFillingGraduationGuidanceAdd、
  kpiFillingGraduationGuidanceUpdate、kpiFillingGraduationGuidanceDetail
- 添加TODO注释标记待后端API完成的功能

fix(pages): 解决部门名称存储问题

- 启用被注释掉的部门名称存储功能
- 确保deptName正确存入本地缓存

feat(performance): 支持毕业班和非毕业班不同考核标准

- 为考勤管理组件添加classType参数支持
- 为负面清单组件添加classType参数支持
- 为专业工作组件重构标签显示逻辑,支持根据classType动态显示
- 为奖励绩效加班组件添加classType参数支持
- 为学生突发事件组件添加classType参数支持
- 为学生管理组件添加毕业班/非毕业班差异化显示逻辑

refactor(performance): 优化业绩评估页面结构

- 添加班级类型选择按钮(毕业班/非毕业班)
- 在填报时间弹窗中集成班级类型选择功能
- 更新数据加载逻辑以支持classType参数
- 修正各种评分计算中的数值类型转换问题
```
2026-03-13 15:14:29 +08:00
22 changed files with 2954 additions and 162 deletions

View File

@@ -0,0 +1,45 @@
import request from '@/utils/request';
// 查询通知任务材料
export function listStuNoticeMaterials(query) {
return request({
url: '/teacher/stuNoticeMaterials/getByFdyNameAndYearAndMonth',
method: 'get',
params: query,
headers: {
Authorization: "Bearer " + uni.getStorageSync("App-Token"),
}
})
}
// 查询通知任务材料详细
export function getStuNoticeMaterials(id) {
return request({
url: '/teacher/stuNoticeMaterials/' + id,
method: 'get'
})
}
// 新增通知任务材料
export function addStuNoticeMaterials(data) {
return request({
url: '/teacher/stuNoticeMaterials/add',
method: 'post',
data: data
})
}
// 修改通知任务材料
export function updateStuNoticeMaterials(data) {
return request({
url: '/teacher/stuNoticeMaterials/update',
method: 'post',
data: data
})
}
// 删除通知任务材料
export function delStuNoticeMaterials(id) {
return request({
url: '/teacher/stuNoticeMaterials/'+id,
method: 'post',
})
}

View File

@@ -0,0 +1,45 @@
import request from '@/utils/request';
// 查询职业测评材料
export function listStuTestMaterials(query) {
return request({
url: '/teacher/stuTestMaterials/getByFdyNameAndYearAndMonth',
method: 'get',
params: query,
headers: {
Authorization: "Bearer " + uni.getStorageSync("App-Token"),
}
})
}
// 查询职业测评材料详细
export function getStuTestMaterials(id) {
return request({
url: '/teacher/stuTestMaterials/' + id,
method: 'get'
})
}
// 新增职业测评材料
export function addStuTestMaterials(data) {
return request({
url: '/teacher/stuTestMaterials/add',
method: 'post',
data: data
})
}
// 修改职业测评材料
export function updateStuTestMaterials(data) {
return request({
url: '/teacher/stuTestMaterials/update',
method: 'post',
data: data
})
}
// 删除职业测评材料
export function delStuTestMaterials(id) {
return request({
url: '/teacher/stuTestMaterials/'+id,
method: 'post',
})
}

View File

@@ -34,6 +34,13 @@ export function kpiFillingList(query) {
data: query
})
}
// 获取业绩考核-个人填报详情
export function kpiFillingDetail(id) {
return request({
url: '/teacher/kpiFilling/' + id,
method: 'get'
})
}
//个人填报-学生管理 新增
@@ -137,3 +144,58 @@ export function kpiFillingNegativeListDetail(query) {
})
}
// TODO: 个人填报-加分项 待后端API完成后实现
// export function kpiFillingBonusPointsAdd(data) {}
// export function kpiFillingBonusPointsUpdate(data) {}
// export function kpiFillingBonusPointsDetail(query) {}
//个人填报-加分项 新增
export function kpiFillingBonusPointsAdd(data) {
return request({
url: '/teacher/kpiFillingBonusPoints/add',
method: 'post',
data: data
})
}
//个人填报-加分项 修改
export function kpiFillingBonusPointsUpdate(data) {
return request({
url: '/teacher/kpiFillingBonusPoints/update',
method: 'post',
data: data
})
}
//个人填报-加分项 详情
export function kpiFillingBonusPointsDetail(query) {
return request({
url: '/teacher/kpiFillingBonusPoints/getByFdyNameAndYearAndMonth',
method: 'get',
data: query
})
}
//个人填报-就业指导工作 新增
export function kpiFillingGraduationGuidanceAdd(data) {
return request({
url: '/teacher/kpiFillingGraduationGuidance/add',
method: 'post',
data: data
})
}
//个人填报-就业指导工作 修改
export function kpiFillingGraduationGuidanceUpdate(data) {
return request({
url: '/teacher/kpiFillingGraduationGuidance/update',
method: 'post',
data: data
})
}
//个人填报-就业指导工作 详情
export function kpiFillingGraduationGuidanceDetail(query) {
return request({
url: '/teacher/kpiFillingGraduationGuidance/getByFdyNameAndYearAndMonth',
method: 'get',
data: query
})
}

View File

@@ -554,6 +554,54 @@
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/instructor/performance-appraisal/performance-evaluation/student-test/list",
"style": {
"navigationBarTitleText": "职业测评佐证",
"navigationBarBackgroundColor": "#1890FF",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/instructor/performance-appraisal/performance-evaluation/student-test/add",
"style": {
"navigationBarTitleText": "添加佐证",
"navigationBarBackgroundColor": "#1890FF",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/instructor/performance-appraisal/performance-evaluation/student-test/detail",
"style": {
"navigationBarTitleText": "佐证详情",
"navigationBarBackgroundColor": "#1890FF",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/instructor/performance-appraisal/performance-evaluation/student-notice/list",
"style": {
"navigationBarTitleText": "通知任务佐证",
"navigationBarBackgroundColor": "#1890FF",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/instructor/performance-appraisal/performance-evaluation/student-notice/add",
"style": {
"navigationBarTitleText": "添加佐证",
"navigationBarBackgroundColor": "#1890FF",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/instructor/performance-appraisal/performance-evaluation/student-notice/detail",
"style": {
"navigationBarTitleText": "佐证详情",
"navigationBarBackgroundColor": "#1890FF",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/instructor/performance-appraisal/performance-evaluation/overwork-materials/add",
"style": {
@@ -1321,6 +1369,12 @@
"navigationBarTitleText": "自治区奖学金申请",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/instructor/performance-appraisal/components/bonuspoints",
"style": {
"navigationBarTitleText": ""
}
}
],
"globalStyle": {

View File

@@ -594,7 +594,7 @@ import config from '@/config'
if (res.data.code === 0) {
uni.showModal({
title: '提示',
content: '基础信息未完善!(备注:白底照片也需要上传)',
content: '基础信息未完善请前往pc端完善基础信息!(备注:白底照片也需要上传)',
confirmText: '前往完善',
cancelText: '取消',
success: (res) => {

View File

@@ -304,7 +304,7 @@
uni.setStorageSync('stuName', data.nickName);
uni.setStorageSync('stuId', data.userId);
uni.setStorageSync("stuNo", data.userName)
//uni.setStorageSync("deptName", data.dept.deptName)
uni.setStorageSync("deptName", data.dept.deptName)
uni.setStorageSync("roles", res.roleGroup)
this.nickName = data.nickName
this.username = data.userName

View File

@@ -8,9 +8,9 @@
</view>
</view>
<view class="form-item">
<label>02 按要求参加辅导员各项会议培训10</label>
<label>02 按要求参加辅导员各项会议培训5</label>
<view class="bottom">
<input type="number" @blur="onLimitInput($event,'conferenceScoring',10)"
<input type="number" @blur="onLimitInput($event,'conferenceScoring',5)"
v-model="formData.conferenceScoring" placeholder="请输入分值" placeholder-class="input-placeholder" />
<text @tap="uploadMaterials">
{{commitStatus==1?"查看材料":"上传材料"}}
@@ -28,7 +28,7 @@
kpiFillingAMgtDetail
} from "@/api/instructor/superintendent.js"
export default {
props: ["queryDetailParams", "commitStatus"],
props: ["queryDetailParams", "commitStatus", "classType"],
data() {
return {
formData: {
@@ -39,7 +39,11 @@
}
},
created() {
kpiFillingAMgtDetail(this.queryDetailParams).then(res => {
const params = {
...this.queryDetailParams,
classType: this.classType
};
kpiFillingAMgtDetail(params).then(res => {
console.log(res);
if (res.rows.length > 0) {
const {

View File

@@ -0,0 +1,118 @@
<template>
<view class="form-container">
<view class="form-item">
<label>加分项三选一不选则不加分</label>
<view class="options">
<radio-group @change="onOptionChange">
<label class="option-item" v-for="(item, index) in options" :key="index">
<radio :value="item.value" :checked="formData.bonusType === item.value" />
<text>{{ item.label }} (+{{ item.score }})</text>
</label>
</radio-group>
</view>
</view>
</view>
</template>
<script>
import {
kpiFillingBonusPointsDetail
} from "@/api/instructor/superintendent.js"
export default {
props: ["queryDetailParams", "commitStatus", "classType"],
data() {
return {
options: [
{ label: "1.获得上级部门或学校表扬,妥善处置学生事件并形成典型案例,积极建言献策且建议被采纳,发挥模范带头作用。", value: "option1", score: 10 },
{ label: "2.在学校、学院阶段性重要任务推进过程中,主动担当作为,切实发挥作用。", value: "option2", score: 10 },
{ label: "3.协助学校开展辅导员培训、会议和学生活动,在活动中担任工作人员。", value: "option3", score: 10 }
],
formData: {
bonusType: "",
bonusScoring: "",
id: ""
}
}
},
created() {
const params = {
...this.queryDetailParams,
classType: this.classType
};
kpiFillingBonusPointsDetail(params).then(res => {
console.log(res);
if (res && res.rows && res.rows.length > 0) {
const {
bonusType,
bonusScoring,
id
} = res.rows[0];
this.formData = {
...this.formData,
bonusType,
bonusScoring,
id
};
} else {
console.log("第一次");
}
}).catch(err => {
console.log("API调用失败", err);
})
},
methods: {
onOptionChange(e) {
const value = e.detail.value;
this.formData.bonusType = value;
const selected = this.options.find(item => item.value === value);
this.formData.bonusScoring = selected ? selected.score : 0;
},
getFormData() {
return this.formData;
}
}
}
</script>
<style scoped lang="scss">
.form-container {
.form-item {
padding: 22rpx 40rpx 40rpx 40rpx;
background-color: white;
margin-bottom: 40rpx;
border-radius: 16rpx;
label {
margin-bottom: 20rpx;
display: inline-block;
font-size: 26rpx;
}
.options {
radio-group {
display: flex;
flex-direction: column;
.option-item {
display: flex;
align-items: center;
padding: 20rpx 0;
border-bottom: 1px solid #f0f0f0;
&:last-child {
border-bottom: none;
}
radio {
margin-right: 20rpx;
}
text {
font-size: 28rpx;
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,116 @@
<template>
<view class="form-container">
<view class="form-item">
<label>01 指导审核毕业生登记表等就业核心材料10</label>
<view class="bottom">
<input @blur="onLimitInput($event,'gradFormAuditScoring',10)" type="number"
v-model="formData.gradFormAuditScoring" placeholder="请输入分值" placeholder-class="input-placeholder" />
</view>
</view>
<view class="form-item">
<label>02 开展学生就业咨询服务及团体辅导工作助力学生解决就业困惑提升就业竞争力5</label>
<view class="bottom">
<input type="number" @blur="onLimitInput($event,'stuCareerConsultScoring',5)"
v-model="formData.stuCareerConsultScoring" placeholder="请输入分值" placeholder-class="input-placeholder" />
</view>
</view>
<view class="form-item">
<label>03 审核毕业生源信息就业系统信息等数据及就业证明材料含真实性完整性规范性10</label>
<view class="bottom">
<input type="number" @blur="onLimitInput($event,'gradFormGuidanceScoring',10)"
v-model="formData.gradFormGuidanceScoring" placeholder="请输入分值" placeholder-class="input-placeholder" />
</view>
</view>
</view>
</template>
<script>
import {
limitInput
} from "@/utils/limitInput.js"
import {
kpiFillingGraduationGuidanceDetail
} from "@/api/instructor/superintendent.js"
export default {
props: ["queryDetailParams", "commitStatus", "classType"],
data() {
return {
formData: {
gradFormAuditScoring: "",
stuCareerConsultScoring: "",
gradFormGuidanceScoring: "",
id: ""
}
}
},
created() {
const params = {
...this.queryDetailParams,
classType: this.classType
};
kpiFillingGraduationGuidanceDetail(params).then(res => {
console.log(res);
if (res.rows && res.rows.length > 0) {
const {
gradFormAuditScoring,
stuCareerConsultScoring,
gradFormGuidanceScoring,
id
} = res.rows[0];
this.formData = {
...this.formData,
gradFormAuditScoring,
stuCareerConsultScoring,
gradFormGuidanceScoring,
id
};
} else {
console.log("第一次");
}
})
},
methods: {
onLimitInput(event, name, max) {
let result = limitInput(event.detail.value, max);
this.formData[name] = result;
},
getFormData() {
return this.formData;
}
}
}
</script>
<style scoped lang="scss">
.form-container {
.form-item {
padding: 22rpx 40rpx 40rpx 40rpx;
background-color: white;
margin-bottom: 40rpx;
border-radius: 16rpx;
label {
margin-bottom: 20rpx;
display: inline-block;
font-size: 26rpx;
}
.bottom {
display: flex;
align-items: center;
input {
flex: 1;
border: 1px solid #E1E1E1;
border-radius: 10rpx;
height: 60rpx;
padding-left: 30rpx;
.input-placeholder {
color: #b6b6b6;
}
}
}
}
}
</style>

View File

@@ -113,7 +113,7 @@
kpiFillingNegativeListDetail
} from "@/api/instructor/superintendent.js"
export default {
props: ["queryDetailParams"],
props: ["queryDetailParams", "classType"],
data() {
return {
formData: {
@@ -129,7 +129,11 @@
}
},
created() {
kpiFillingNegativeListDetail(this.queryDetailParams).then(res => {
const params = {
...this.queryDetailParams,
classType: this.classType
};
kpiFillingNegativeListDetail(params).then(res => {
console.log(res);
if (res.rows.length > 0) {
// this.formData = res.rows[0];
@@ -164,9 +168,10 @@
handleRadioChange(e) {
const groupName = e.target.dataset.groupName; // 获取data-group-name的值
this.formData[groupName] = e.detail.value; // 更新formData中对应的属性
// 可以在这里加入其他逻辑,比如数据校验、表单提交等
console.log('negative-list formData:', this.formData);
},
getFormData() {
console.log('getFormData called, returning:', this.formData);
return this.formData;
}
}

View File

@@ -1,38 +1,51 @@
<template>
<view class="form-container">
<view class="form-item">
<label>01 严格执行学生请销假登记制度5</label>
<label>{{label01}}</label>
<view class="bottom">
<input @blur="onLimitInput($event,'stuLeaveMaterialsScoring',5)" v-model="formData.stuLeaveMaterialsScoring" type="number" placeholder="请输入分值"
<input @blur="onLimitInput($event, isGraduate ? 'stuLeaveMaterialsScoring' : 'stuLeaveRequestScoring', 5)"
v-model="formData[isGraduate ? 'stuLeaveMaterialsScoring' : 'stuLeaveRequestScoring']" type="number" placeholder="请输入分值"
placeholder-class="input-placeholder" />
</view>
</view>
<view class="form-item">
<label>02 认真指导学生完成各项材料填报工作 10</label>
<label>{{label02}}</label>
<view class="bottom">
<input @blur="onLimitInput($event,'stuFillingMaterialsScoring',10)" v-model="formData.stuFillingMaterialsScoring" type="number" placeholder="请输入分值"
<input @blur="onLimitInput($event, isGraduate ? 'stuFillingMaterialsScoring' : 'stuLeaveMaterialsScoring', isGraduate ? maxStuFillingMaterials : maxStuLeaveMaterials)"
v-model="formData[isGraduate ? 'stuFillingMaterialsScoring' : 'stuLeaveMaterialsScoring']" type="number" placeholder="请输入分值"
placeholder-class="input-placeholder" />
</view>
</view>
<view class="form-item">
<label>03 按时按质完成学生基础数据上报工作10</label>
<label>{{label03}}</label>
<view class="bottom">
<input @blur="onLimitInput($event,'stuBasicDataScoring',10)" v-model="formData.stuBasicDataScoring" type="number" placeholder="请输入分值"
placeholder-class="input-placeholder" />
<input @blur="onLimitInput($event, isGraduate ? 'stuBasicDataScoring' : 'stuFillingMaterialsScoring', isGraduate ? maxStuDisciplinaryViolation : maxStuFillingMaterials)"
v-model="formData[isGraduate ? 'stuBasicDataScoring' : 'stuFillingMaterialsScoring']"
type="number" placeholder="请输入分值" placeholder-class="input-placeholder" />
</view>
</view>
<view class="form-item">
<label>04 按规定完成学生违纪处分材料5</label>
<label>{{label04}}</label>
<view class="bottom">
<input @blur="onLimitInput($event,'stuDisciplinaryViolationScoring',5)" v-model="formData.stuDisciplinaryViolationScoring" type="number" placeholder="请输入分值"
placeholder-class="input-placeholder" />
<input @blur="onLimitInput($event, isGraduate ? 'stuDisciplinaryViolationScoring' : 'stuBasicDataScoring', 5)"
v-model="formData[isGraduate ? 'stuDisciplinaryViolationScoring' : 'stuBasicDataScoring']"
type="number" placeholder="请输入分值" placeholder-class="input-placeholder" />
</view>
</view>
<view class="form-item">
<label>05 按程序要求处理突发事件10</label>
<label>{{label05}}</label>
<view class="bottom">
<input @blur="onLimitInput($event,'handleEventsScoring',10)" v-model="formData.handleEventsScoring" type="number" placeholder="请输入分值"
placeholder-class="input-placeholder" />
<input @blur="onLimitInput($event, isGraduate ? 'handleEventsScoring' : 'stuDisciplinaryViolationScoring', isGraduate ? maxHandleEvents : 5)"
v-model="formData[isGraduate ? 'handleEventsScoring' : 'stuDisciplinaryViolationScoring']"
type="number" placeholder="请输入分值" placeholder-class="input-placeholder" />
</view>
</view>
<view class="form-item">
<label>{{label06}}</label>
<view class="bottom">
<input @blur="onLimitInput($event, isGraduate ? 'otherTaskScoring' : 'handleEventsScoring', isGraduate ? 5 : 10)"
v-model="formData[isGraduate ? 'otherTaskScoring' : 'handleEventsScoring']"
type="number" placeholder="请输入分值" placeholder-class="input-placeholder" />
</view>
</view>
</view>
@@ -46,37 +59,100 @@
kpiFillingBusinessWorkDetail
} from "@/api/instructor/superintendent.js"
export default {
props: ["queryDetailParams"],
data() {
props: {
queryDetailParams: Object,
commitStatus: [String, Number],
classType: {
type: String,
default: 'ungraduate'
}
},
computed: {
isGraduate() {
return this.classType === 'graduate';
},
label01() {
return this.isGraduate
? "01 按规定完成学生学籍异动、违纪处分与解除等材料5分"
: "01 严格执行学生请销假登记制度5分";
},
label02() {
return this.isGraduate
? "02 认真完成评优评先、资助评定工作 10分"
: "02 按规定完成学生学籍异动、违纪处分与解除等材料5分";
},
label03() {
return this.isGraduate
? "03 按时、准确填报学生各项基础数据 5分"
: "03 认真完成评优评先、资助评定工作10分";
},
label04() {
return this.isGraduate
? "04 认真指导学生完成各项材料填报工作 5分"
: "04 按时、准确填报学生各项基础数据5分";
},
label05() {
return this.isGraduate
? "05 按程序要求处理突发事件 10分"
: "05 认真指导学生完成各项材料填报工作5分";
},
label06() {
return this.isGraduate
? "06 按时按质完成学工、学院发布的各项学生工作通知、任务 5分"
: "06 按程序要求处理突发事件10分";
},
maxStuLeaveMaterials() {
return this.isGraduate ? 5 : 5;
},
maxStuFillingMaterials() {
return this.isGraduate ? 10 : 10;
},
maxStuDisciplinaryViolation() {
return this.isGraduate ? 5 : 5;
},
maxHandleEvents() {
return this.isGraduate ? 10 : 10;
}
}, data() {
return {
formData: {
stuLeaveRequestScoring: "",
stuLeaveMaterialsScoring: "",
stuFillingMaterialsScoring: "",
stuBasicDataScoring: "",
stuDisciplinaryViolationScoring: "",
handleEventsScoring: "",
otherTaskScoring: "",
id: ""
}
}
},
created() {
kpiFillingBusinessWorkDetail(this.queryDetailParams).then(res => {
const params = {
...this.queryDetailParams,
classType: this.classType
};
kpiFillingBusinessWorkDetail(params).then(res => {
if (res.rows.length > 0) {
const {
stuLeaveRequestScoring,
stuLeaveMaterialsScoring,
stuFillingMaterialsScoring,
stuBasicDataScoring,
stuDisciplinaryViolationScoring,
handleEventsScoring,
otherTaskScoring,
id
} = res.rows[0];
this.formData = {
...this.formData, // 保留 this.formData 中已有的其他属性
...this.formData,
stuLeaveRequestScoring,
stuLeaveMaterialsScoring,
stuFillingMaterialsScoring,
stuBasicDataScoring,
stuDisciplinaryViolationScoring,
handleEventsScoring,
otherTaskScoring,
id
};
} else {

View File

@@ -44,7 +44,7 @@
delkpiFillingRewards
} from "@/api/instructor/overwork-materials.js"
export default {
props: ["queryDetailParams", "commitStatus"],
props: ["queryDetailParams", "commitStatus", "classType"],
data() {
return {
actionOptions: [{
@@ -67,6 +67,7 @@
created() {
this.query = {
...this.queryDetailParams,
classType: this.classType,
fdyName: uni.getStorageSync("stuName"),
pageNum: 1,
pageSize: 10,

View File

@@ -48,7 +48,7 @@
delkpiFillingStuEmergency
} from "@/api/instructor/studentEmergencies.js"
export default {
props: ["queryDetailParams", "commitStatus"],
props: ["queryDetailParams", "commitStatus", "classType"],
data() {
return {
actionOptions: [{
@@ -71,6 +71,7 @@
mounted() {
this.query = {
...this.queryDetailParams,
classType: this.classType,
fdyName: uni.getStorageSync("stuName"),
pageNum: 1,
pageSize: 10,

View File

@@ -1,7 +1,7 @@
<template>
<view class="student-management">
<view class="form-item">
<label>01 每周按时开展班会10</label>
<label>{{label01}}</label>
<view class="bottom">
<input @blur="onLimitInput($event,'classScoring',10)" v-model="classScoring" type="number"
placeholder="请输入分值" placeholder-class="input-placeholder" />
@@ -10,8 +10,8 @@
</text>
</view>
</view>
<view class="form-item">
<label>02 每周深入学生宿舍至少2次10</label>
<view class="form-item" v-if="!isGraduate">
<label>{{label02}}</label>
<view class="bottom">
<input @blur="onLimitInput($event,'visitDormitoryScoring',10)" v-model="visitDormitoryScoring" type="number" placeholder="请输入分值"
placeholder-class="input-placeholder" />
@@ -21,7 +21,7 @@
</view>
</view>
<view class="form-item">
<label>03 每月与带班学生谈心谈话覆盖率不低于8%10</label>
<label>{{label03}}</label>
<view class="bottom">
<input @blur="onLimitInput($event,'stuTalkScoring',10)" v-model="stuTalkScoring" type="number" placeholder="请输入分值"
placeholder-class="input-placeholder" />
@@ -30,8 +30,8 @@
</text>
</view>
</view>
<view class="form-item">
<label>04 每月开展班团干部会议至少2次5</label>
<view class="form-item" v-if="!isGraduate">
<label>{{label04}}</label>
<view class="bottom">
<input @blur="onLimitInput($event,'cadreScoring',5)" v-model="cadreScoring" type="number" placeholder="请输入分值" placeholder-class="input-placeholder" />
<text @tap="uploadLeagueMeetingMaterial">
@@ -39,8 +39,8 @@
</text>
</view>
</view>
<view class="form-item">
<label>05 每月深入学生社区面向学生开展活动1次 5</label>
<view class="form-item" v-if="!isGraduate">
<label>{{label05}}</label>
<view class="bottom">
<input @blur="onLimitInput($event,'stuActivityScoring',5)" v-model="stuActivityScoring" type="number" placeholder="请输入分值"
placeholder-class="input-placeholder" />
@@ -49,6 +49,26 @@
</text>
</view>
</view>
<view class="form-item" v-if="!isGraduate">
<label>{{label06}}</label>
<view class="bottom">
<input @blur="onLimitInput($event,'edgScoring',5)" v-model="edgScoring" type="number" placeholder="请输入分值"
placeholder-class="input-placeholder" />
<text @tap="uploadStuTest">
{{commitStatus==1?"查看材料":"上传材料"}}
</text>
</view>
</view>
<view class="form-item" v-if="!isGraduate">
<label>{{label07}}</label>
<view class="bottom">
<input @blur="onLimitInput($event,'noticeScoring',5)" v-model="noticeScoring" type="number" placeholder="请输入分值"
placeholder-class="input-placeholder" />
<text @tap="uploadStuNotie">
{{commitStatus==1?"查看材料":"上传材料"}}
</text>
</view>
</view>
</view>
</template>
@@ -60,7 +80,49 @@
limitInput
} from "@/utils/limitInput.js"
export default {
props: ["queryDetailParams","commitStatus"],
props: {
queryDetailParams: Object,
commitStatus: [String, Number],
classType: {
type: String,
default: 'ungraduate'
}
},
computed: {
isGraduate() {
return this.classType === 'graduate';
},
label01() {
return this.isGraduate
? "01 每月通过线上线下方式定期召开班会开展教育10分"
: "01 每周日及节假日收假当天组织开展班会10分";
},
label02() {
if (this.isGraduate) return "";
return "02 每周深入学生宿舍至少2次10分";
},
label03() {
return this.classType === 'graduate'
? "03 月度谈心谈话总量≥10人次覆盖重点关注学生困难救助、就业预警、心理危机、违纪待处理等10分"
: "03 月度谈心谈话总量≥10人次覆盖重点关注学生困难救助、学业指导、心理危机、违纪待处理等10分";
},
label04() {
if (this.isGraduate) return "";
return "04 每月开展班团干部培训、专题工作会议频次均不少于1次5分";
},
label05() {
if (this.isGraduate) return "";
return "05 每月组织或参与学生社区育人活动、思政教育活动及文化艺术体育活动频次不少于2次5分";
},
label06() {
if (this.isGraduate) return "";
return "06 根据学校就业育人工作部署第一学期需指导并组织所带班级学生参与职业测评整体完成率需≥90%第二学期每月需开展1次就业育人相关活动。5分";
},
label07() {
if (this.isGraduate) return "";
return "07 按时按质完成学校及相关职能部门发布的与学生相关的各项工作通知、任务5分";
}
},
data() {
return {
classScoring: "", //班会材料分数
@@ -68,29 +130,63 @@
stuTalkScoring: "", // 学生谈话分数
cadreScoring: "", //班团干部会议材料分数
stuActivityScoring: "", //学生开展活动材料分数
edgScoring: "", //职业测评分数
noticeScoring: "", //其他任务分数
id: "", //学生开展活动材料分数
queryParams:null
}
},
created() {
teacherKpiFillingMgtDetail(this.queryDetailParams).then(res => {
console.log('===== student-management created =====');
console.log('queryDetailParams:', this.queryDetailParams);
console.log('classType:', this.classType);
},
mounted() {
// 初始化查询参数
this.initQueryParams();
// 等待 classType 准备好后再查询
if (this.classType) {
this.loadData();
}
},
methods: {
loadData() {
// 查询时带上 classType
const queryParams = {
...this.queryDetailParams,
classType: this.classType
};
console.log('最终查询参数:', queryParams);
teacherKpiFillingMgtDetail(queryParams).then(res => {
console.log('===== API 返回数据 =====');
console.log(res);
if (res.data) {
// 毕业班只填充需要的字段
if (this.isGraduate) {
this.classScoring = res.data.classScoring;
this.stuTalkScoring = res.data.stuTalkScoring;
this.id = res.data.id;
} else {
this.classScoring = res.data.classScoring;
this.visitDormitoryScoring = res.data.visitDormitoryScoring;
this.stuTalkScoring = res.data.stuTalkScoring;
this.cadreScoring = res.data.cadreScoring;
this.stuActivityScoring = res.data.stuActivityScoring;
this.edgScoring = res.data.edgScoring;
this.noticeScoring = res.data.noticeScoring;
this.id = res.data.id;
}
}
})
},
initQueryParams() {
this.queryParams = new URLSearchParams({
year: this.queryDetailParams.fillingYear,
month: this.queryDetailParams.fillingMonth,
commitStatus:this.commitStatus
});
},
methods: {
onLimitInput(event,name,max) {
let result = limitInput(event.detail.value,max);
this[name] = result;
@@ -121,15 +217,31 @@
url: `/pages/instructor/performance-appraisal/performance-evaluation/student-activity/list?${this.queryParams.toString()}`
})
},
uploadStuTest() {
uni.navigateTo({
url: `/pages/instructor/performance-appraisal/performance-evaluation/student-test/list?${this.queryParams.toString()}`
})
},
uploadStuNotie() {
uni.navigateTo({
url: `/pages/instructor/performance-appraisal/performance-evaluation/student-notice/list?${this.queryParams.toString()}`
})
},
getFormData() {
return {
const data = {
classScoring: this.classScoring,
visitDormitoryScoring: this.visitDormitoryScoring,
stuTalkScoring: this.stuTalkScoring,
cadreScoring: this.cadreScoring,
stuActivityScoring: this.stuActivityScoring,
id: this.id
};
// 非毕业班才包含这些字段
if (!this.isGraduate) {
data.visitDormitoryScoring = this.visitDormitoryScoring;
data.cadreScoring = this.cadreScoring;
data.stuActivityScoring = this.stuActivityScoring;
data.edgScoring = this.edgScoring;
data.noticeScoring = this.noticeScoring;
}
return data;
}
}
}

View File

@@ -81,6 +81,11 @@
<view class="title">
填报时间
</view>
<view class="class-type-btns">
<button :class="['type-btn', classType === 'graduate' ? 'active' : '']" @tap="selectClassType('graduate')">毕业班</button>
<button :class="['type-btn', classType === 'ungraduate' ? 'active' : '']" @tap="selectClassType('ungraduate')">非毕业班</button>
</view>
<view class="type-tip">必选</view>
<form @submit="topersonalReporting">
<view class="form-item">
<label>填报年份</label>
@@ -146,6 +151,7 @@
export default {
data() {
return {
classType: "graduate", // graduate-毕业班, ungraduate-非毕业班
topLoading: true,
loading: false,
type: 'center',
@@ -250,7 +256,8 @@
month: item.fillingMonth,
reportingId: item.id,
commitStatus: item.commitStatus,
roleAudit: item.roleAudit
roleAudit: item.roleAudit,
classType: item.classType || 'ungraduate'
});
if (item.auditStatus == 2) {
let refuseTxt = "";
@@ -292,30 +299,51 @@
// 学生管理分数
row.kpiFillingStuMgtList.forEach(element => {
if (element.hasOwnProperty('id')) {
scoring += element.cadreScoring
scoring += element.classScoring
scoring += element.stuActivityScoring
scoring += element.stuTalkScoring
scoring += element.visitDormitoryScoring
scoring += Number(element.cadreScoring) || 0
scoring += Number(element.classScoring) || 0
scoring += Number(element.stuActivityScoring) || 0
scoring += Number(element.stuTalkScoring) || 0
scoring += Number(element.visitDormitoryScoring) || 0
scoring += Number(element.noticeScoring) || 0
scoring += Number(element.edgScoring) || 0
}
});
// 业务工作分数
row.kpiFillingBusinessWorksList.forEach(element => {
if (element.hasOwnProperty('id')) {
scoring += element.stuLeaveMaterialsScoring
scoring += element.stuFillingMaterialsScoring
scoring += element.stuBasicDataScoring
scoring += element.stuDisciplinaryViolationScoring
scoring += element.handleEventsScoring
scoring += Number(element.stuLeaveMaterialsScoring) || 0
scoring += Number(element.stuFillingMaterialsScoring) || 0
scoring += Number(element.stuBasicDataScoring) || 0
scoring += Number(element.stuDisciplinaryViolationScoring) || 0
scoring += Number(element.handleEventsScoring) || 0
scoring += Number(element.otherTaskScoring) || 0
}
});
// 考勤管理分数
row.kpiFillingAMgtList.forEach(element => {
if (element.hasOwnProperty('id')) {
scoring += element.dutyWorkScoring
scoring += element.conferenceScoring
scoring += Number(element.dutyWorkScoring) || 0
scoring += Number(element.conferenceScoring) || 0
}
});
// 加分项分数
if (row.kpiFillingBonusPointsList) {
row.kpiFillingBonusPointsList.forEach(element => {
if (element.hasOwnProperty('id')) {
scoring += Number(element.bonusScoring) || 0
}
});
}
// 就业指导工作分数
if (row.kpiFillingGraduationGuidanceList) {
row.kpiFillingGraduationGuidanceList.forEach(element => {
if (element.hasOwnProperty('id')) {
scoring += Number(element.gradFormAuditScoring) || 0
scoring += Number(element.stuCareerConsultScoring) || 0
scoring += Number(element.gradFormGuidanceScoring) || 0
}
});
}
return scoring
},
scrolltolower() {
@@ -391,7 +419,17 @@
addRecordsPopup() {
this.$refs.popupTime.open(this.type);
},
selectClassType(type) {
this.classType = type;
},
async topersonalReporting(e) {
if (!this.classType) {
uni.showToast({
title: '请选择班级类型',
icon: 'none'
});
return;
}
this.$refs.popupTime.close();
let year = this.years[e.detail.value.year + 1].dictValue;
let month = this.months[e.detail.value.month].dictValue;
@@ -399,6 +437,7 @@
let formData = {
fillingYear: year,
fillingMonth: month,
classType: this.classType,
}
let res = await kpiFillingAdd(formData);
if (res.code == 200) {
@@ -407,7 +446,8 @@
month,
commitStatus: 0,
reportingId: res.data.id,
completionStatus: 0
completionStatus: 0,
classType: this.classType,
});
uni.navigateTo({
url: `/pages/instructor/performance-appraisal/performance-evaluation/personal-reporting?${searchParams.toString()}`
@@ -416,12 +456,14 @@
},
toPersonalReportingPage(params) {
console.log('toPersonalReportingPage params:', params);
const searchParams = new URLSearchParams({
year: params.fillingYear,
month: params.fillingMonth,
reportingId: params.id,
commitStatus: params.commitStatus,
completionStatus: params.completionStatus
completionStatus: params.completionStatus,
classType: params.classType || 'ungraduate'
});
uni.navigateTo({
@@ -702,7 +744,7 @@
.popup-content {
width: 600rpx;
height: 600rpx;
height: 680rpx;
padding: 40rpx 50rpx 40rpx;
.title {
@@ -748,6 +790,35 @@
}
}
.class-type-btns {
display: flex;
justify-content: center;
margin: 30rpx 0;
.type-btn {
flex: 1;
margin: 0 20rpx;
height: 70rpx;
line-height: 70rpx;
background-color: #f0f0f0;
color: #666;
border-radius: 10rpx;
font-size: 28rpx;
&.active {
background-color: #1890FF;
color: #fff;
}
}
}
.type-tip {
text-align: center;
color: #ff4d4f;
font-size: 24rpx;
margin-bottom: 20rpx;
}
.btns {
display: flex;
margin-top: 50rpx;

View File

@@ -6,18 +6,20 @@
:key="index">{{item}}</text>
</view>
</scroll-view>
<view class="form">
<StudentManagement :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" ref="studentManagement" v-if="tabIndex==0" />
<ProfessionalWork :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" ref="ProfessionalWork" v-if="tabIndex==1" />
<AttendanceManagement :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" ref="AttendanceManagement"
v-if="tabIndex==2" />
<NegativeList :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" ref="NegativeList" v-if="tabIndex==3" />
<OverWork :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" ref="OverWork" v-if="tabIndex==4" />
<StudentEmergencies :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" ref="StudentEmergencies" v-if="tabIndex==5" />
<view class="form" v-if="!loading">
<StudentManagement :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" :classType="classType" ref="studentManagement" v-if="tabIndex==0" :key="classType" />
<GraduationGuidance :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" :classType="classType" ref="GraduationGuidance" v-if="classType === 'graduate' && tabIndex==1" :key="classType" />
<ProfessionalWork :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" :classType="classType" ref="ProfessionalWork" v-if="(classType === 'graduate' && tabIndex==2) || (classType !== 'graduate' && tabIndex==1)" :key="classType" />
<AttendanceManagement :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" :classType="classType" ref="AttendanceManagement"
v-if="(classType === 'graduate' && tabIndex==3) || (classType !== 'graduate' && tabIndex==2)" :key="classType" />
<BonusPoints :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" :classType="classType" ref="BonusPoints" v-if="(classType === 'graduate' && tabIndex==4) || (classType !== 'graduate' && tabIndex==3)" :key="classType" />
<NegativeList :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" :classType="classType" ref="NegativeList" v-if="(classType === 'graduate' && tabIndex==5) || (classType !== 'graduate' && tabIndex==4)" :key="classType" />
<OverWork :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" :classType="classType" ref="OverWork" v-if="(classType === 'graduate' && tabIndex==6) || (classType !== 'graduate' && tabIndex==5)" :key="classType" />
<StudentEmergencies :commitStatus="commitStatus" :queryDetailParams="queryDetailParams" :classType="classType" ref="StudentEmergencies" v-if="(classType === 'graduate' && tabIndex==7) || (classType !== 'graduate' && tabIndex==6)" :key="classType" />
<view class="btns" v-if="commitStatus==0">
<button type="primary" class="prev-page" v-if="tabIndex!=0" @click="onPrevPage">上一页</button>
<button type="primary" class="next-page" @click="onNextPage" v-if="tabIndex!=5">保存</button>
<button type="primary" class="next-page" @click="onSubmit" v-if="tabIndex==5">提交</button>
<button type="primary" class="next-page" @click="onNextPage" v-if="(classType === 'graduate' && tabIndex!=7) || (classType !== 'graduate' && tabIndex!=6)">保存</button>
<button type="primary" class="next-page" @click="onSubmit" v-if="(classType === 'graduate' && tabIndex==7) || (classType !== 'graduate' && tabIndex==6)">提交</button>
</view>
</view>
</view>
@@ -26,6 +28,7 @@
<script>
import {
kpiFillingUpdate,
kpiFillingDetail,
teacherKpiFillingMgtAdd,
teacherKpiFillingMgtUpdate,
teacherKpiFillingMgtDetail,
@@ -34,7 +37,11 @@
kpiFillingAMgtAdd,
kpiFillingAMgtUpdate,
kpiFillingNegativeListAdd,
kpiFillingNegativeListUpdate
kpiFillingNegativeListUpdate,
kpiFillingBonusPointsAdd,
kpiFillingBonusPointsUpdate,
kpiFillingGraduationGuidanceAdd,
kpiFillingGraduationGuidanceUpdate
} from "@/api/instructor/superintendent.js"
import StudentManagement from "../components/student-management.vue";
import ProfessionalWork from "../components/professional-work.vue";
@@ -42,6 +49,8 @@
import NegativeList from "../components/negative-list.vue";
import OverWork from "../components/reward-performance-overwork.vue";
import StudentEmergencies from "../components/student-emergencies.vue";
import BonusPoints from "../components/bonuspoints.vue"
import GraduationGuidance from "../components/graduation-guidance.vue"
export default {
components: {
StudentManagement,
@@ -50,14 +59,17 @@
NegativeList,
OverWork,
StudentEmergencies,
BonusPoints,
GraduationGuidance,
reportingId: ""
},
data() {
return {
tabs: ["学生管理", "业务管理", "考勤管理", "负面清单", "超工作量奖励绩效", "处理学生突发事件"],
tabIndex: 0,
fillingYear: "",
fillingMonth: "",
classType: "ungraduate",
loading: true,
queryDetailParams: {
fdyName: uni.getStorageSync("stuName"),
fillingMonth: "",
@@ -69,7 +81,51 @@
commitStatus: "",
completionStatus: "", //完成状态
roleAudit:"",//角色
tabConfigs: {
}
},
computed: {
tabConfigs() {
if (this.classType === 'graduate') {
return {
0: {
ref: 'studentManagement',
addFunc: teacherKpiFillingMgtAdd,
updateFunc: teacherKpiFillingMgtUpdate,
},
1: {
ref: 'GraduationGuidance',
addFunc: kpiFillingGraduationGuidanceAdd,
updateFunc: kpiFillingGraduationGuidanceUpdate,
},
2: {
ref: 'ProfessionalWork',
addFunc: kpiFillingBusinessWorkAdd,
updateFunc: kpiFillingBusinessWorkUpdate,
},
3: {
ref: 'AttendanceManagement',
addFunc: kpiFillingAMgtAdd,
updateFunc: kpiFillingAMgtUpdate,
},
4: {
ref: 'BonusPoints',
addFunc: kpiFillingBonusPointsAdd,
updateFunc: kpiFillingBonusPointsUpdate,
},
5: {
ref: 'NegativeList',
addFunc: kpiFillingNegativeListAdd,
updateFunc: kpiFillingNegativeListUpdate,
},
6: {
ref: 'OverWork',
},
7: {
ref: 'StudentEmergencies',
}
};
}
return {
0: {
ref: 'studentManagement',
addFunc: teacherKpiFillingMgtAdd,
@@ -86,20 +142,32 @@
updateFunc: kpiFillingAMgtUpdate,
},
3: {
ref: 'BonusPoints',
addFunc: kpiFillingBonusPointsAdd,
updateFunc: kpiFillingBonusPointsUpdate,
},
4: {
ref: 'NegativeList',
addFunc: kpiFillingNegativeListAdd,
updateFunc: kpiFillingNegativeListUpdate,
},
4: {
5: {
ref: 'OverWork',
},
5: {
6: {
ref: 'StudentEmergencies',
}
};
},
tabs() {
if (this.classType === 'graduate') {
return ["学生管理", "就业指导工作", "业务管理", "考勤管理", "加分项", "负面清单", "超工作量奖励绩效", "处理学生突发事件"];
}
return ["学生管理", "业务管理", "考勤管理", "加分项", "负面清单", "超工作量奖励绩效", "处理学生突发事件"];
}
},
onLoad(option) {
console.log('personal-reporting onLoad option:', option);
this.fillingYear = option.year;
this.fillingMonth = option.month;
this.reportingId = option.reportingId;
@@ -108,8 +176,30 @@
this.commitStatus = option.commitStatus;
this.completionStatus = option.completionStatus;
this.roleAudit = option.roleAudit;
// 始终从后端获取classType
if (this.reportingId) {
this.getClassType();
} else if (option.classType) {
this.classType = option.classType;
}
this.loading = false;
},
methods: {
async getClassType() {
try {
console.log('calling kpiFillingDetail with id:', this.reportingId);
const res = await kpiFillingDetail(this.reportingId);
console.log('kpiFillingDetail response:', res);
if (res.data) {
this.classType = res.data.classType || 'ungraduate';
console.log('classType from backend:', this.classType);
}
} catch(e) {
console.error('getClassType error:', e);
}
},
tabChange(index) {
this.tabIndex = index;
},
@@ -137,24 +227,58 @@
addFunc,
updateFunc
} = this.tabConfigs[this.tabIndex];
// 检查组件是否存在
if (!this.$refs[ref]) {
this.tabIndex++;
return;
}
// 获取表单数据
let formData = this.$refs[ref].getFormData();
formData = {
...formData,
departmentName: uni.getStorageSync("deptName"),
departmentName: uni.getStorageSync("deptName") || "测试学院",
fdyName: uni.getStorageSync("stuName"),
fillingYear: this.fillingYear,
fillingMonth: this.fillingMonth,
classType: this.classType,
};
// 根据班级类型排除不需要填写的字段
let excludeKeys = ['id', 'departmentName', 'fdyName', 'fillingYear', 'fillingMonth', 'classType'];
// 业务管理(毕业班tabIndex 2, 非毕业班tabIndex 1) - 需要排除业务管理不需要验证的字段
if ((this.tabIndex === 2 && this.classType === 'graduate') || (this.tabIndex === 1 && this.classType === 'ungraduate')) {
excludeKeys = [...excludeKeys,
'stuLeaveRequestScoring', 'stuLeaveMaterialsScoring', 'stuFillingMaterialsScoring',
'stuBasicDataScoring', 'stuDisciplinaryViolationScoring', 'handleEventsScoring', 'otherTaskScoring'];
}
// 就业指导(毕业班tabIndex 1)不需要验证空值
if (this.classType === 'graduate' && this.tabIndex === 1) {
excludeKeys = [...excludeKeys,
'gradFormAuditScoring', 'stuCareerConsultScoring', 'gradFormGuidanceScoring'];
}
// 考勤管理(tabIndex 2/3)、加分项(tabIndex 3/4)、负面清单(tabIndex 4/5)不需要验证空值
if (this.tabIndex === 2 || this.tabIndex === 3 || this.tabIndex === 4 || this.tabIndex === 5) {
excludeKeys = [...excludeKeys,
'moralityAndBehavior', 'speech', 'complaint', 'offense', 'emergency', 'punishment', 'practiceFraud',
'dutyWorkScoring', 'conferenceScoring', 'bonusType', 'bonusScoring'];
}
console.log('formData:', formData);
console.log('excludeKeys:', excludeKeys);
console.log('hasEmptyValues result:', this.hasEmptyValues(formData, excludeKeys));
// 检查formData中是否有空值
if (this.hasEmptyValues(formData, ['id'])) {
if (this.hasEmptyValues(formData, excludeKeys)) {
console.log('表单有空值,阻止保存');
uni.showToast({
title: "请填写完整内容!",
icon: 'none' // 根据需要设置图标
});
return; // 停止执行后续操作
}
if (this.tabIndex !== 4 && this.tabIndex !== 5) {
console.log('准备保存tabIndex:', this.tabIndex, 'formData:', formData);
// 判断是否需要保存:超工作量(毕业班6/非毕业班5)和处理学生突发事件(毕业班7/非毕业班6)不需要保存
const skipSave = (this.classType === 'graduate' && (this.tabIndex === 6 || this.tabIndex === 7)) ||
(this.classType === 'ungraduate' && (this.tabIndex === 5 || this.tabIndex === 6));
if (!skipSave) {
if (formData.id || formData.id === 0) {
let res = await updateFunc(formData);
if (res.code == 200) {
@@ -162,7 +286,7 @@
title: "修改成功",
});
}
} else {
} else if (addFunc) {
let res = await addFunc(formData);
if (res.code == 200) {
uni.showToast({

View File

@@ -0,0 +1,397 @@
<template>
<view class="evidence-add">
<form>
<view class="form-item">
<label>主要内容</label>
<input type="text" v-model="formData.mainContent" placeholder="请输入"
placeholder-class="input-placeholder" />
</view>
<view class="form-item form-item--class">
<label>班级</label>
<picker v-if="classArray.length>0" range-key="class_name" :value="classIndex" :range="classArray"
@change="multiClassChange">
<view class="uni-input">
<view class="val-container">
<text class="val" v-if="selectedIndices.length <= 1 && classIndex > 0">{{ classArray[classIndex].class_name }}</text>
<textarea
v-else
:value="selectedClassNames"
disabled
style="background-color: #f9f9f9; border: none; font-size: 30rpx;"
auto-height />
</view>
<uni-icons type="down" size="16" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>参与人数</label>
<input v-model="formData.numberOfStudents" type="number" placeholder="请输入" />
</view>
<view class="form-item">
<label>开展时间</label>
<picker @change="onChangeTime" mode="date" :value="formData.developmentTime">
<view class="uni-input">
<text class="val">{{formData.developmentTime}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>地点</label>
<input v-model="formData.place" type="text" placeholder="请输入" />
</view>
<view class="form-item">
<label>照片</label>
<view class="upload-img" v-if="tempImgs.length==0" @tap="uploadImg">
<view class="add">
+ 添加照片
</view>
<view class="tip">
图片要求最多3张上限5MB
</view>
<view class="img-list">
</view>
</view>
<view class="img-list" v-else>
<view class="imgs">
<view class="img" v-for="(img,index) in tempImgs">
<image :src="img.path" @tap="previewImg(tempImgs)" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveImg(index,img.path)">X</text>
</view>
</view>
<view v-if="tempImgs.length<3" class="btn" @tap="uploadImg">
+ 添加照片
</view>
</view>
</view>
<button :disabled="isSubmitting" type="primary" class="submit-btn" @tap="onSubmit">提交</button>
</form>
</view>
</template>
<script>
import {
previewImg
} from "@/utils/uploadImg.js"
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js";
import {
checkPic
} from "@/utils/checkPic.js";
import {
OwnClass
} from '@/api/instructor/superintendent.js';
import {
addStuNoticeMaterials
} from '@/api/instructor/studentNotice.js';
import uploadFile from "@/plugins/upload.js";
import {
baseUrl
} from "@/config.js";
export default {
data() {
return {
isSubmitting:false,
classArray: [],
selectedIndices: [],
classIndex: 0,
tempImgs: [],
formData: {
mainContent: "",
className: "",
numberOfStudents: "",
developmentTime: getCurrentDateTime(),
place: "",
photo: "",
fdyName: uni.getStorageSync("stuName"),
fillingMonth: "",
fillingYear: "",
}
}
},
onLoad(option) {
this.formData.fillingYear = option.year;
this.formData.fillingMonth = option.month;
this.getOwnClass();
},
computed: {
selectedClassNames() {
if (this.selectedIndices.length === 0) {
return '请选择班级';
}
return this.selectedIndices.map(index => this.classArray[index].class_name).join('\n');
}
},
methods: {
uploadImg() {
uni.chooseImage({
count: 3,
success: async (img) => {
let bool = await checkPic(img.tempFiles[0]);
if (bool) {
uploadFile('/common/upload', img.tempFilePaths[0]).then((res) => {
if (this.formData.photo !== "") {
this.formData.photo = this.formData.photo + "," + JSON.parse(res)
.fileName;
} else {
this.formData.photo = JSON.parse(res).fileName;
}
this.tempImgs.push({
path: baseUrl + JSON.parse(res).fileName
});
})
}
}
})
},
onRemoveImg(index, path) {
this.tempImgs.splice(index, 1);
let newImgs = this.tempImgs.filter(fileName => fileName.path !== path);
newImgs = newImgs.map(img => img.path.replace(baseUrl, ''))
newImgs = newImgs.join(",");
this.formData.photo = newImgs;
},
classChange(e) {
this.classIndex = e.detail.value;
this.formData.className = this.classArray[e.detail.value].class_name;
},
onChangeTime(e) {
this.formData.developmentTime = e.detail.value;
},
async onSubmit() {
const requiredFields = [
'mainContent',
'className',
'numberOfStudents',
'place'
];
const emptyField = requiredFields.find(field => this.formData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写完整内容`,
icon: "none"
})
return;
}
this.isSubmitting=true;
let res = await addStuNoticeMaterials(this.formData);
if (res.code == 200) {
uni.showToast({
title: "添加成功"
})
setTimeout(() => {
this.isSubmitting=false;
uni.navigateBack({
success: () => {
const pages = getCurrentPages();
if (pages.length > 0) {
const prevPage = pages[pages.length - 2]
if (prevPage && typeof prevPage.getStuNoticeMaterials ===
'function') {
prevPage.queryParams.pageNum = 1;
prevPage.getStuNoticeMaterials();
}
}
}
})
}, 1000)
} else {
uni.showToast({
title: res.msg
})
}
},
async getOwnClass() {
let res = await OwnClass(this.formData);
this.classArray = res.data;
console.log(this.classArray);
this.formData.className = this.classArray[0].class_name;
},
previewImg(imgs) {
previewImg(imgs)
},
multiClassChange(e) {
const index = e.detail.value;
this.classIndex = e.detail.value;
this.formData.className = this.classArray[e.detail.value].class_name;
if (!this.selectedIndices.includes(index)) {
this.selectedIndices.push(index);
} else {
this.selectedIndices = this.selectedIndices.filter(i => i !== index);
}
const selectedClasses = this.selectedIndices.map(i => this.classArray[i].class_name);
this.formData.className = selectedClasses.join(',');
},
}
}
</script>
<style scoped lang="scss">
.evidence-add {
min-height: 95vh;
background-color: #F5F5F7;
padding: 40rpx;
.form-item {
padding: 22rpx 40rpx;
background-color: white;
margin-bottom: 20rpx;
border-radius: 16rpx;
.uni-icons {
opacity: .5;
font-weight: bold
}
label {
margin-bottom: 20rpx;
display: inline-block;
}
input {
border: 1px solid #E1E1E1;
border-radius: 10rpx;
height: 70rpx;
padding-left: 30rpx;
.input-placeholder {
color: #b6b6b6;
}
}
picker {
border: 1px solid #E1E1E1;
height: 70rpx;
line-height: 70rpx;
padding: 0 30rpx;
.uni-input {
display: flex;
color: #797979;
.val {
flex: 1;
}
}
}
.upload-img {
border: 1px solid #E1E1E1;
padding: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
.tip {
margin-top: 15rpx;
color: #7a7a7a;
font-size: 24rpx;
}
}
.img-list {
border: 1px solid #D8D8D8;
border-radius: 20rpx;
.imgs {
padding: 22rpx;
display: flex;
flex-wrap: wrap;
.img {
position: relative;
width: 160rpx;
height: 170rpx;
margin-bottom: 15rpx;
margin-right: 15rpx;
image {
width: 100%;
height: 100%;
}
.remove {
position: absolute;
right: 0;
top: 0;
color: white;
background-color: rgba(0, 0, 0, 0.4);
width: 52rpx;
height: 52rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
}
}
}
.btn {
border-top: 1px solid #D8D8D8;
height: 100rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
}
}
}
.form-item--class {
display: flex;
flex-direction: column;
justify-content: space-between;
picker {
height: auto;
line-height: 50rpx;
.uni-input {
width: 100%;
min-height: 65rpx;
height: auto;
padding: 16rpx 15rpx;
box-sizing: border-box;
align-items: flex-start;
.val-container {
flex: 1;
overflow: hidden;
white-space: pre-wrap;
word-break: break-all;
textarea {
width: 100%;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 25rpx;
line-height: 40rpx;
height: auto;
white-space: pre-wrap;
word-break: break-all;
}
}
}
}
}
.submit-btn {
margin-top: 60rpx;
}
}
</style>

View File

@@ -0,0 +1,344 @@
<template>
<view class="evidence-add">
<form>
<view class="form-item">
<label>主要内容</label>
<input type="text" v-model="formData.mainContent" placeholder="请输入"
placeholder-class="input-placeholder" />
</view>
<view class="form-item">
<label>班级</label>
<picker v-if="classArray.length>0" range-key="class_name" :value="classIndex" :range="classArray"
@change="classChange">
<view class="uni-input">
<text class="val">{{classArray[classIndex].class_name}}</text>
<uni-icons type="down" size="16" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>参与人数</label>
<input v-model="formData.numberOfStudents" type="number" placeholder="请输入" />
</view>
<view class="form-item">
<label>开展时间</label>
<picker @change="onChangeTime" mode="date" :value="formData.developmentTime">
<view class="uni-input">
<text class="val">{{formData.developmentTime}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>地点</label>
<input v-model="formData.place" type="text" placeholder="请输入" />
</view>
<view class="form-item">
<label>照片</label>
<view class="upload-img" v-if="tempImgs.length==0" @tap="uploadImg">
<view class="add">
+ 添加照片
</view>
<view class="tip">
图片要求最多3张上限5MB
</view>
<view class="img-list">
</view>
</view>
<view class="img-list" v-else>
<view class="imgs">
<view class="img" v-for="(img,index) in tempImgs">
<image :src="img.path" @tap="previewImg(tempImgs)" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveImg(index,img.path)">X</text>
</view>
</view>
<view v-if="tempImgs.length<3" class="btn" @tap="uploadImg">
+ 添加照片
</view>
</view>
</view>
<button :disabled="isSubmitting" v-if="commitStatus!=1" type="primary" class="submit-btn"
@tap="onEdit">保存修改</button>
</form>
</view>
</template>
<script>
import {
previewImg
} from "@/utils/uploadImg.js"
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js"
import {
checkPic
} from "@/utils/checkPic.js"
import {
OwnClass
} from '@/api/instructor/superintendent.js';
import {
updateStuNoticeMaterials,
getStuNoticeMaterials
} from '@/api/instructor/studentNotice.js';
import uploadFile from "@/plugins/upload.js";
import {
baseUrl
} from "@/config.js";
export default {
data() {
return {
isSubmitting: false,
classArray: [],
classIndex: 0,
tempImgs: [],
commitStatus: "",
formData: {
mainContent: "",
className: "",
numberOfStudents: "",
developmentTime: getCurrentDateTime(),
place: "",
photo: "",
fdyName: uni.getStorageSync("stuName"),
fillingMonth: getCurrentDateTime('MM'),
fillingYear: getCurrentDateTime('yyyy'),
}
}
},
onLoad(option) {
this.formData.id = option.id;
this.commitStatus = option.commitStatus;
this.getOwnClass();
},
methods: {
uploadImg() {
uni.chooseImage({
count: 3,
success: async (img) => {
let bool = await checkPic(img.tempFiles[0]);
if (bool) {
uploadFile('/common/upload', img.tempFilePaths[0]).then((res) => {
if (this.formData.photo !== "") {
this.formData.photo = this.formData.photo + "," + JSON.parse(res)
.fileName;
} else {
this.formData.photo = JSON.parse(res).fileName;
}
this.tempImgs.push({
path: baseUrl + JSON.parse(res).fileName
});
})
}
}
})
},
onRemoveImg(index, path) {
this.tempImgs.splice(index, 1);
let newImgs = this.tempImgs.filter(fileName => fileName.path !== path);
newImgs = newImgs.map(img => img.path.replace(baseUrl, ''))
newImgs = newImgs.join(",");
this.formData.photo = newImgs;
},
classChange(e) {
this.classIndex = e.detail.value;
this.formData.className = this.classArray[e.detail.value].class_name;
},
onChangeTime(e) {
this.formData.developmentTime = e.detail.value;
},
async getDetail() {
let res = await getStuNoticeMaterials(this.formData.id);
if (res.data.photo != null) {
let imgs = res.data.photo.split(',');
this.tempImgs = imgs.map(img => {
return {
path: baseUrl + img
};
})
}
this.formData = res.data;
let index = this.classArray.findIndex(item => {
return item.class_name === this.formData.className;
});
this.classIndex = index;
},
async onEdit() {
const requiredFields = [
'mainContent',
'className',
'numberOfStudents',
'place'
];
const emptyField = requiredFields.find(field => this.formData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写完整内容`,
icon: "none"
})
return;
}
this.isSubmitting = true;
let res = await updateStuNoticeMaterials(this.formData);
if (res.code == 200) {
uni.showToast({
title: "修改成功"
})
setTimeout(() => {
this.isSubmitting = false;
uni.navigateBack({
success: () => {
const pages = getCurrentPages();
if (pages.length > 0) {
const prevPage = pages[pages.length - 2]
if (prevPage && typeof prevPage.getStuNoticeMaterials ===
'function') {
prevPage.queryParams.pageNum = 1;
prevPage.getStuNoticeMaterials();
}
}
}
})
}, 1000)
} else {
uni.showToast({
title: res.msg
})
}
},
async getOwnClass() {
let res = await OwnClass(this.formData);
this.classArray = res.data;
this.formData.className = this.classArray[0].class_name;
if (res.code == 200) {
this.getDetail();
}
},
previewImg(imgs) {
previewImg(imgs)
}
}
}
</script>
<style scoped lang="scss">
.evidence-add {
min-height: 95vh;
background-color: #F5F5F7;
padding: 40rpx;
.form-item {
padding: 22rpx 40rpx;
background-color: white;
margin-bottom: 20rpx;
border-radius: 16rpx;
.uni-icons {
opacity: .5;
font-weight: bold
}
label {
margin-bottom: 20rpx;
display: inline-block;
}
input {
border: 1px solid #E1E1E1;
border-radius: 10rpx;
height: 70rpx;
padding-left: 30rpx;
.input-placeholder {
color: #b6b6b6;
}
}
picker {
border: 1px solid #E1E1E1;
height: 70rpx;
line-height: 70rpx;
padding: 0 30rpx;
.uni-input {
display: flex;
color: #797979;
.val {
flex: 1;
}
}
}
.upload-img {
border: 1px solid #E1E1E1;
padding: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
.tip {
margin-top: 15rpx;
color: #7a7a7a;
font-size: 24rpx;
}
}
.img-list {
border: 1px solid #D8D8D8;
border-radius: 20rpx;
.imgs {
padding: 22rpx;
display: flex;
flex-wrap: wrap;
.img {
position: relative;
width: 160rpx;
height: 170rpx;
margin-bottom: 15rpx;
margin-right: 15rpx;
image {
width: 100%;
height: 100%;
}
.remove {
position: absolute;
right: 0;
top: 0;
color: white;
background-color: rgba(0, 0, 0, 0.4);
width: 52rpx;
height: 52rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
}
}
}
.btn {
border-top: 1px solid #D8D8D8;
height: 100rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
}
}
}
.submit-btn {
margin-top: 60rpx;
}
}
</style>

View File

@@ -0,0 +1,238 @@
<template>
<view class="evidence-list">
<scroll-view scroll-y="true" @scrolltolower="scrolltolower">
<uni-swipe-action>
<view class="list">
<view class="item" @tap="toDetail(item.id)" v-for="item in list" :key="item.id">
<uni-swipe-action-item :right-options="actionOptions" @tap="onDel(item.id)">
<view class="top">
<view class="title">
主要内容
<text v-html="item.mainContent"></text>
</view>
<uni-icons type="right" size="16" color="#202020"></uni-icons>
</view>
<view class="content">
<view>班级{{item.className}}</view>
<view class="time">开展时间:{{item.developmentTime}}</view>
</view>
</uni-swipe-action-item>
</view>
</view>
</uni-swipe-action>
<view class="empty" v-if="list.length==0">
<image src="@/static/empty.png" mode="widthFix"></image>
暂时没有数据
</view>
<view class="loading-more" v-if="loading">
<uni-load-more status="loading" />
</view>
<view class="no-more" v-if="!loading&&list.length!=0">
到底啦~~
</view>
</scroll-view>
<view class="add" @tap="addEvidence" v-if="commitStatus!=1">
+
</view>
</view>
</template>
<script>
import {
listStuNoticeMaterials,
delStuNoticeMaterials
} from '@/api/instructor/studentNotice.js';
export default {
data() {
return {
actionOptions: [{
text: '删除',
style: {
width: "200px",
backgroundColor: '#df0000'
}
}],
list: [],
totalPages: 0,
loading: false,
commitStatus: "",
queryParams: {
pageNum: 1,
pageSize: 10,
fdyName: uni.getStorageSync("stuName"),
fillingMonth: "",
fillingYear: "",
},
}
},
onLoad(option) {
this.queryParams.fillingYear = option.year;
this.queryParams.fillingMonth = option.month;
this.commitStatus = option.commitStatus;
this.getStuNoticeMaterials();
},
methods: {
scrolltolower() {
if (this.queryParams.pageNum < this.totalPages) {
this.queryParams.pageNum++;
this.loading = true;
setTimeout(() => {
this.getStuNoticeMaterialsList()
}, 1000)
} else {
}
},
addEvidence() {
uni.navigateTo({
url: `add?year=${this.queryParams.fillingYear}&month=${this.queryParams.fillingMonth}`
})
},
toDetail(id) {
uni.navigateTo({
url: `detail?id=${id}&commitStatus=${this.commitStatus}`
})
},
getStuNoticeMaterials() {
listStuNoticeMaterials(this.queryParams).then(res => {
this.loading = false;
if (!res.rows) {
this.list = [];
return;
}
if (this.queryParams.pageNum == 1) {
this.list = res.rows;
} else {
this.list = this.list.concat(res.rows);
}
this.totalPages = Math.ceil(res.total / this.queryParams.pageSize);
}).catch(err => {
this.loading = false;
this.list = [];
});
},
onDel(id) {
console.log(id);
uni.showModal({
title: "确定删除吗?",
success: (res) => {
if (res.confirm) {
delStuNoticeMaterials(id).then(res => {
if (res.code == 200) {
uni.showToast({
title: "删除成功"
})
this.getStuNoticeMaterials();
}
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
scroll-view {
height: 100vh;
.load-more {
text-align: center;
}
.no-more {
text-align: center;
color: gray;
padding-bottom: 10px;
}
.empty {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 200rpx;
color: #9E9E9E;
font-size: 36rpx;
image {
width: 250rpx;
margin-bottom: 50rpx;
}
}
}
.evidence-list {
background-color: #F5F5F7;
min-height: 100vh;
.list {
padding: 40rpx;
.item {
padding: 40rpx;
background-color: white;
border-radius: 16rpx;
margin-bottom: 20rpx;
.top {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F5F5F7;
padding-bottom: 22rpx;
.title {
display: flex;
align-items: center;
font-weight: bold;
text {
margin-left: 8rpx;
}
}
.uni-icons {
opacity: 0.5;
}
text {
color: #3D3D3D;
font-weight: 600;
}
}
.content {
padding-top: 22rpx;
&>view:first-child {
display: flex;
align-items: center;
}
.time {
color: #9C9C9C;
margin-top: 14rpx;
font-size: 26rpx;
}
}
}
}
.add {
background-color: #1890FF;
width: 90rpx;
height: 90rpx;
border-radius: 50%;
color: white;
display: flex;
justify-content: center;
align-items: center;
font-size: 60rpx;
position: fixed;
bottom: 50px;
right: 25px;
}
}
</style>

View File

@@ -0,0 +1,397 @@
<template>
<view class="evidence-add">
<form>
<view class="form-item">
<label>主要内容</label>
<input type="text" v-model="formData.mainContent" placeholder="请输入"
placeholder-class="input-placeholder" />
</view>
<view class="form-item form-item--class">
<label>班级</label>
<picker v-if="classArray.length>0" range-key="class_name" :value="classIndex" :range="classArray"
@change="multiClassChange">
<view class="uni-input">
<view class="val-container">
<text class="val" v-if="selectedIndices.length <= 1 && classIndex > 0">{{ classArray[classIndex].class_name }}</text>
<textarea
v-else
:value="selectedClassNames"
disabled
style="background-color: #f9f9f9; border: none; font-size: 30rpx;"
auto-height />
</view>
<uni-icons type="down" size="16" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>参与人数</label>
<input v-model="formData.numberOfStudents" type="number" placeholder="请输入" />
</view>
<view class="form-item">
<label>开展时间</label>
<picker @change="onChangeTime" mode="date" :value="formData.developmentTime">
<view class="uni-input">
<text class="val">{{formData.developmentTime}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>地点</label>
<input v-model="formData.place" type="text" placeholder="请输入" />
</view>
<view class="form-item">
<label>照片</label>
<view class="upload-img" v-if="tempImgs.length==0" @tap="uploadImg">
<view class="add">
+ 添加照片
</view>
<view class="tip">
图片要求最多3张上限5MB
</view>
<view class="img-list">
</view>
</view>
<view class="img-list" v-else>
<view class="imgs">
<view class="img" v-for="(img,index) in tempImgs">
<image :src="img.path" @tap="previewImg(tempImgs)" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveImg(index,img.path)">X</text>
</view>
</view>
<view v-if="tempImgs.length<3" class="btn" @tap="uploadImg">
+ 添加照片
</view>
</view>
</view>
<button :disabled="isSubmitting" type="primary" class="submit-btn" @tap="onSubmit">提交</button>
</form>
</view>
</template>
<script>
import {
previewImg
} from "@/utils/uploadImg.js"
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js";
import {
checkPic
} from "@/utils/checkPic.js";
import {
OwnClass
} from '@/api/instructor/superintendent.js';
import {
addStuTestMaterials
} from '@/api/instructor/studentTest.js';
import uploadFile from "@/plugins/upload.js";
import {
baseUrl
} from "@/config.js";
export default {
data() {
return {
isSubmitting:false,
classArray: [],
selectedIndices: [],
classIndex: 0,
tempImgs: [],
formData: {
mainContent: "",
className: "",
numberOfStudents: "",
developmentTime: getCurrentDateTime(),
place: "",
photo: "",
fdyName: uni.getStorageSync("stuName"),
fillingMonth: "",
fillingYear: "",
}
}
},
onLoad(option) {
this.formData.fillingYear = option.year;
this.formData.fillingMonth = option.month;
this.getOwnClass();
},
computed: {
selectedClassNames() {
if (this.selectedIndices.length === 0) {
return '请选择班级';
}
return this.selectedIndices.map(index => this.classArray[index].class_name).join('\n');
}
},
methods: {
uploadImg() {
uni.chooseImage({
count: 3,
success: async (img) => {
let bool = await checkPic(img.tempFiles[0]);
if (bool) {
uploadFile('/common/upload', img.tempFilePaths[0]).then((res) => {
if (this.formData.photo !== "") {
this.formData.photo = this.formData.photo + "," + JSON.parse(res)
.fileName;
} else {
this.formData.photo = JSON.parse(res).fileName;
}
this.tempImgs.push({
path: baseUrl + JSON.parse(res).fileName
});
})
}
}
})
},
onRemoveImg(index, path) {
this.tempImgs.splice(index, 1);
let newImgs = this.tempImgs.filter(fileName => fileName.path !== path);
newImgs = newImgs.map(img => img.path.replace(baseUrl, ''))
newImgs = newImgs.join(",");
this.formData.photo = newImgs;
},
classChange(e) {
this.classIndex = e.detail.value;
this.formData.className = this.classArray[e.detail.value].class_name;
},
onChangeTime(e) {
this.formData.developmentTime = e.detail.value;
},
async onSubmit() {
const requiredFields = [
'mainContent',
'className',
'numberOfStudents',
'place'
];
const emptyField = requiredFields.find(field => this.formData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写完整内容`,
icon: "none"
})
return;
}
this.isSubmitting=true;
let res = await addStuTestMaterials(this.formData);
if (res.code == 200) {
uni.showToast({
title: "添加成功"
})
setTimeout(() => {
this.isSubmitting=false;
uni.navigateBack({
success: () => {
const pages = getCurrentPages();
if (pages.length > 0) {
const prevPage = pages[pages.length - 2]
if (prevPage && typeof prevPage.getStuTestMaterials ===
'function') {
prevPage.queryParams.pageNum = 1;
prevPage.getStuTestMaterials();
}
}
}
})
}, 1000)
} else {
uni.showToast({
title: res.msg
})
}
},
async getOwnClass() {
let res = await OwnClass(this.formData);
this.classArray = res.data;
console.log(this.classArray);
this.formData.className = this.classArray[0].class_name;
},
previewImg(imgs) {
previewImg(imgs)
},
multiClassChange(e) {
const index = e.detail.value;
this.classIndex = e.detail.value;
this.formData.className = this.classArray[e.detail.value].class_name;
if (!this.selectedIndices.includes(index)) {
this.selectedIndices.push(index);
} else {
this.selectedIndices = this.selectedIndices.filter(i => i !== index);
}
const selectedClasses = this.selectedIndices.map(i => this.classArray[i].class_name);
this.formData.className = selectedClasses.join(',');
},
}
}
</script>
<style scoped lang="scss">
.evidence-add {
min-height: 95vh;
background-color: #F5F5F7;
padding: 40rpx;
.form-item {
padding: 22rpx 40rpx;
background-color: white;
margin-bottom: 20rpx;
border-radius: 16rpx;
.uni-icons {
opacity: .5;
font-weight: bold
}
label {
margin-bottom: 20rpx;
display: inline-block;
}
input {
border: 1px solid #E1E1E1;
border-radius: 10rpx;
height: 70rpx;
padding-left: 30rpx;
.input-placeholder {
color: #b6b6b6;
}
}
picker {
border: 1px solid #E1E1E1;
height: 70rpx;
line-height: 70rpx;
padding: 0 30rpx;
.uni-input {
display: flex;
color: #797979;
.val {
flex: 1;
}
}
}
.upload-img {
border: 1px solid #E1E1E1;
padding: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
.tip {
margin-top: 15rpx;
color: #7a7a7a;
font-size: 24rpx;
}
}
.img-list {
border: 1px solid #D8D8D8;
border-radius: 20rpx;
.imgs {
padding: 22rpx;
display: flex;
flex-wrap: wrap;
.img {
position: relative;
width: 160rpx;
height: 170rpx;
margin-bottom: 15rpx;
margin-right: 15rpx;
image {
width: 100%;
height: 100%;
}
.remove {
position: absolute;
right: 0;
top: 0;
color: white;
background-color: rgba(0, 0, 0, 0.4);
width: 52rpx;
height: 52rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
}
}
}
.btn {
border-top: 1px solid #D8D8D8;
height: 100rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
}
}
}
.form-item--class {
display: flex;
flex-direction: column;
justify-content: space-between;
picker {
height: auto;
line-height: 50rpx;
.uni-input {
width: 100%;
min-height: 65rpx;
height: auto;
padding: 16rpx 15rpx;
box-sizing: border-box;
align-items: flex-start;
.val-container {
flex: 1;
overflow: hidden;
white-space: pre-wrap;
word-break: break-all;
textarea {
width: 100%;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 25rpx;
line-height: 40rpx;
height: auto;
white-space: pre-wrap;
word-break: break-all;
}
}
}
}
}
.submit-btn {
margin-top: 60rpx;
}
}
</style>

View File

@@ -0,0 +1,344 @@
<template>
<view class="evidence-add">
<form>
<view class="form-item">
<label>主要内容</label>
<input type="text" v-model="formData.mainContent" placeholder="请输入"
placeholder-class="input-placeholder" />
</view>
<view class="form-item">
<label>班级</label>
<picker v-if="classArray.length>0" range-key="class_name" :value="classIndex" :range="classArray"
@change="classChange">
<view class="uni-input">
<text class="val">{{classArray[classIndex].class_name}}</text>
<uni-icons type="down" size="16" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>参与人数</label>
<input v-model="formData.numberOfStudents" type="number" placeholder="请输入" />
</view>
<view class="form-item">
<label>开展时间</label>
<picker @change="onChangeTime" mode="date" :value="formData.developmentTime">
<view class="uni-input">
<text class="val">{{formData.developmentTime}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>地点</label>
<input v-model="formData.place" type="text" placeholder="请输入" />
</view>
<view class="form-item">
<label>照片</label>
<view class="upload-img" v-if="tempImgs.length==0" @tap="uploadImg">
<view class="add">
+ 添加照片
</view>
<view class="tip">
图片要求最多3张上限5MB
</view>
<view class="img-list">
</view>
</view>
<view class="img-list" v-else>
<view class="imgs">
<view class="img" v-for="(img,index) in tempImgs">
<image :src="img.path" @tap="previewImg(tempImgs)" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveImg(index,img.path)">X</text>
</view>
</view>
<view v-if="tempImgs.length<3" class="btn" @tap="uploadImg">
+ 添加照片
</view>
</view>
</view>
<button :disabled="isSubmitting" v-if="commitStatus!=1" type="primary" class="submit-btn"
@tap="onEdit">保存修改</button>
</form>
</view>
</template>
<script>
import {
previewImg
} from "@/utils/uploadImg.js"
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js"
import {
checkPic
} from "@/utils/checkPic.js"
import {
OwnClass
} from '@/api/instructor/superintendent.js';
import {
updateStuTestMaterials,
getStuTestMaterials
} from '@/api/instructor/studentTest.js';
import uploadFile from "@/plugins/upload.js";
import {
baseUrl
} from "@/config.js";
export default {
data() {
return {
isSubmitting: false,
classArray: [],
classIndex: 0,
tempImgs: [],
commitStatus: "",
formData: {
mainContent: "",
className: "",
numberOfStudents: "",
developmentTime: getCurrentDateTime(),
place: "",
photo: "",
fdyName: uni.getStorageSync("stuName"),
fillingMonth: getCurrentDateTime('MM'),
fillingYear: getCurrentDateTime('yyyy'),
}
}
},
onLoad(option) {
this.formData.id = option.id;
this.commitStatus = option.commitStatus;
this.getOwnClass();
},
methods: {
uploadImg() {
uni.chooseImage({
count: 3,
success: async (img) => {
let bool = await checkPic(img.tempFiles[0]);
if (bool) {
uploadFile('/common/upload', img.tempFilePaths[0]).then((res) => {
if (this.formData.photo !== "") {
this.formData.photo = this.formData.photo + "," + JSON.parse(res)
.fileName;
} else {
this.formData.photo = JSON.parse(res).fileName;
}
this.tempImgs.push({
path: baseUrl + JSON.parse(res).fileName
});
})
}
}
})
},
onRemoveImg(index, path) {
this.tempImgs.splice(index, 1);
let newImgs = this.tempImgs.filter(fileName => fileName.path !== path);
newImgs = newImgs.map(img => img.path.replace(baseUrl, ''))
newImgs = newImgs.join(",");
this.formData.photo = newImgs;
},
classChange(e) {
this.classIndex = e.detail.value;
this.formData.className = this.classArray[e.detail.value].class_name;
},
onChangeTime(e) {
this.formData.developmentTime = e.detail.value;
},
async getDetail() {
let res = await getStuTestMaterials(this.formData.id);
if (res.data.photo != null) {
let imgs = res.data.photo.split(',');
this.tempImgs = imgs.map(img => {
return {
path: baseUrl + img
};
})
}
this.formData = res.data;
let index = this.classArray.findIndex(item => {
return item.class_name === this.formData.className;
});
this.classIndex = index;
},
async onEdit() {
const requiredFields = [
'mainContent',
'className',
'numberOfStudents',
'place'
];
const emptyField = requiredFields.find(field => this.formData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写完整内容`,
icon: "none"
})
return;
}
this.isSubmitting = true;
let res = await updateStuTestMaterials(this.formData);
if (res.code == 200) {
uni.showToast({
title: "修改成功"
})
setTimeout(() => {
this.isSubmitting = false;
uni.navigateBack({
success: () => {
const pages = getCurrentPages();
if (pages.length > 0) {
const prevPage = pages[pages.length - 2]
if (prevPage && typeof prevPage.getStuTestMaterials ===
'function') {
prevPage.queryParams.pageNum = 1;
prevPage.getStuTestMaterials();
}
}
}
})
}, 1000)
} else {
uni.showToast({
title: res.msg
})
}
},
async getOwnClass() {
let res = await OwnClass(this.formData);
this.classArray = res.data;
this.formData.className = this.classArray[0].class_name;
if (res.code == 200) {
this.getDetail();
}
},
previewImg(imgs) {
previewImg(imgs)
}
}
}
</script>
<style scoped lang="scss">
.evidence-add {
min-height: 95vh;
background-color: #F5F5F7;
padding: 40rpx;
.form-item {
padding: 22rpx 40rpx;
background-color: white;
margin-bottom: 20rpx;
border-radius: 16rpx;
.uni-icons {
opacity: .5;
font-weight: bold
}
label {
margin-bottom: 20rpx;
display: inline-block;
}
input {
border: 1px solid #E1E1E1;
border-radius: 10rpx;
height: 70rpx;
padding-left: 30rpx;
.input-placeholder {
color: #b6b6b6;
}
}
picker {
border: 1px solid #E1E1E1;
height: 70rpx;
line-height: 70rpx;
padding: 0 30rpx;
.uni-input {
display: flex;
color: #797979;
.val {
flex: 1;
}
}
}
.upload-img {
border: 1px solid #E1E1E1;
padding: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
.tip {
margin-top: 15rpx;
color: #7a7a7a;
font-size: 24rpx;
}
}
.img-list {
border: 1px solid #D8D8D8;
border-radius: 20rpx;
.imgs {
padding: 22rpx;
display: flex;
flex-wrap: wrap;
.img {
position: relative;
width: 160rpx;
height: 170rpx;
margin-bottom: 15rpx;
margin-right: 15rpx;
image {
width: 100%;
height: 100%;
}
.remove {
position: absolute;
right: 0;
top: 0;
color: white;
background-color: rgba(0, 0, 0, 0.4);
width: 52rpx;
height: 52rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
}
}
}
.btn {
border-top: 1px solid #D8D8D8;
height: 100rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
}
}
}
.submit-btn {
margin-top: 60rpx;
}
}
</style>

View File

@@ -0,0 +1,238 @@
<template>
<view class="evidence-list">
<scroll-view scroll-y="true" @scrolltolower="scrolltolower">
<uni-swipe-action>
<view class="list">
<view class="item" @tap="toDetail(item.id)" v-for="item in list" :key="item.id">
<uni-swipe-action-item :right-options="actionOptions" @tap="onDel(item.id)">
<view class="top">
<view class="title">
主要内容
<text v-html="item.mainContent"></text>
</view>
<uni-icons type="right" size="16" color="#202020"></uni-icons>
</view>
<view class="content">
<view>班级{{item.className}}</view>
<view class="time">开展时间:{{item.developmentTime}}</view>
</view>
</uni-swipe-action-item>
</view>
</view>
</uni-swipe-action>
<view class="empty" v-if="list.length==0">
<image src="@/static/empty.png" mode="widthFix"></image>
暂时没有数据
</view>
<view class="loading-more" v-if="loading">
<uni-load-more status="loading" />
</view>
<view class="no-more" v-if="!loading&&list.length!=0">
到底啦~~
</view>
</scroll-view>
<view class="add" @tap="addEvidence" v-if="commitStatus!=1">
+
</view>
</view>
</template>
<script>
import {
listStuTestMaterials,
delStuTestMaterials
} from '@/api/instructor/studentTest.js';
export default {
data() {
return {
actionOptions: [{
text: '删除',
style: {
width: "200px",
backgroundColor: '#df0000'
}
}],
list: [],
totalPages: 0,
loading: false,
commitStatus: "",
queryParams: {
pageNum: 1,
pageSize: 10,
fdyName: uni.getStorageSync("stuName"),
fillingMonth: "",
fillingYear: "",
},
}
},
onLoad(option) {
this.queryParams.fillingYear = option.year;
this.queryParams.fillingMonth = option.month;
this.commitStatus = option.commitStatus;
this.getStuTestMaterials();
},
methods: {
scrolltolower() {
if (this.queryParams.pageNum < this.totalPages) {
this.queryParams.pageNum++;
this.loading = true;
setTimeout(() => {
this.getStuTestMaterialsList()
}, 1000)
} else {
}
},
addEvidence() {
uni.navigateTo({
url: `add?year=${this.queryParams.fillingYear}&month=${this.queryParams.fillingMonth}`
})
},
toDetail(id) {
uni.navigateTo({
url: `detail?id=${id}&commitStatus=${this.commitStatus}`
})
},
getStuTestMaterials() {
listStuTestMaterials(this.queryParams).then(res => {
this.loading = false;
if (!res.rows) {
this.list = [];
return;
}
if (this.queryParams.pageNum == 1) {
this.list = res.rows;
} else {
this.list = this.list.concat(res.rows);
}
this.totalPages = Math.ceil(res.total / this.queryParams.pageSize);
}).catch(err => {
this.loading = false;
this.list = [];
});
},
onDel(id) {
console.log(id);
uni.showModal({
title: "确定删除吗?",
success: (res) => {
if (res.confirm) {
delStuTestMaterials(id).then(res => {
if (res.code == 200) {
uni.showToast({
title: "删除成功"
})
this.getStuTestMaterials();
}
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
scroll-view {
height: 100vh;
.load-more {
text-align: center;
}
.no-more {
text-align: center;
color: gray;
padding-bottom: 10px;
}
.empty {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 200rpx;
color: #9E9E9E;
font-size: 36rpx;
image {
width: 250rpx;
margin-bottom: 50rpx;
}
}
}
.evidence-list {
background-color: #F5F5F7;
min-height: 100vh;
.list {
padding: 40rpx;
.item {
padding: 40rpx;
background-color: white;
border-radius: 16rpx;
margin-bottom: 20rpx;
.top {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F5F5F7;
padding-bottom: 22rpx;
.title {
display: flex;
align-items: center;
font-weight: bold;
text {
margin-left: 8rpx;
}
}
.uni-icons {
opacity: 0.5;
}
text {
color: #3D3D3D;
font-weight: 600;
}
}
.content {
padding-top: 22rpx;
&>view:first-child {
display: flex;
align-items: center;
}
.time {
color: #9C9C9C;
margin-top: 14rpx;
font-size: 26rpx;
}
}
}
}
.add {
background-color: #1890FF;
width: 90rpx;
height: 90rpx;
border-radius: 50%;
color: white;
display: flex;
justify-content: center;
align-items: center;
font-size: 60rpx;
position: fixed;
bottom: 50px;
right: 25px;
}
}
</style>