移动端V1.0

This commit is contained in:
2025-07-16 15:34:34 +08:00
commit 194b0750fd
1083 changed files with 178295 additions and 0 deletions

View File

@@ -0,0 +1,376 @@
<template>
<view class="add">
<view class="top">
<view class="title">
添加学生处分申请
</view>
<uni-forms ref="valiForm" :rules="rules" :modelValue="valiFormData">
<uni-forms-item label="学号" required name="stuNo">
<uni-easyinput :clearable="false" @blur="stduIDOnBlur" v-model="valiFormData.stuNo"
placeholder="请输入学号" />
</uni-forms-item>
<uni-forms-item label="姓名" required name="studentName">
<uni-easyinput :clearable="false" v-model="valiFormData.studentName" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="性别" required name="gender">
<radio-group name="">
<label class="nan">
<radio value="男" :checked="valiFormData.gender === '男'" color="#2A8F08"
style="transform:scale(0.7)" />
<text></text>
</label>
<label>
<radio value="女" :checked="valiFormData.gender === '女'" color="#2A8F08"
style="transform:scale(0.7)" />
<text></text>
</label>
</radio-group>
</uni-forms-item>
<uni-forms-item label="班级" required name="className">
<uni-easyinput :clearable="false" v-model="valiFormData.className" placeholder="请输入班级" />
</uni-forms-item>
<uni-forms-item label="学院" required name="departmentName">
<uni-easyinput :clearable="false" v-model="valiFormData.departmentName" placeholder="请输入学院" />
</uni-forms-item>
<uni-forms-item label="年级" required name="gradeName">
<uni-easyinput :clearable="false" v-model="valiFormData.gradeName" placeholder="请输入年级" />
</uni-forms-item>
<uni-forms-item label="民族" required name="mz">
<uni-easyinput :clearable="false" v-model="valiFormData.mz" placeholder="请输入民族" />
</uni-forms-item>
<uni-forms-item label="出生日期" required name="birthday">
<uni-easyinput :clearable="false" v-model="valiFormData.birthday" placeholder="请输入出生日期" />
</uni-forms-item>
<uni-forms-item label="籍贯" required name="jg">
<uni-easyinput :clearable="false" v-model="valiFormData.jg" placeholder="请输入籍贯" />
</uni-forms-item>
<uni-forms-item label="处分等级" required name="penaltyType">
<picker :range="options" v-model="valiFormData.penaltyType" @change="onPickerChange">
<view class="select">{{ options[valiFormData.penaltyType] || '请选择处分等级' }} </view>
</picker>
</uni-forms-item>
<uni-forms-item label="处分建议" required name="penaltyRecommendation">
<uni-easyinput :clearable="false" v-model="valiFormData.penaltyRecommendation"
placeholder="请输入处分建议" />
</uni-forms-item>
<uni-forms-item label="违纪条例" required name="violationRegulations">
<uni-easyinput :clearable="false" v-model="valiFormData.violationRegulations"
placeholder="请输入违纪条例" />
</uni-forms-item>
<uni-forms-item class="materials" label="违纪材料" required name="materials">
<view class="tip">
请上传违纪询问记录违纪申辩记录学生检讨书等扫描件
</view>
<view class="upImage">
<uni-file-picker :auto-upload="false" @select="uploadImg" @delete="deleteImg"></uni-file-picker>
</view>
</uni-forms-item>
</uni-forms>
</view>
<view class="btns">
<button @click="onSave('valiForm')">保存</button>
<button @click="onSubmit('valiForm')">提交</button>
</view>
</view>
</template>
<script>
import {
getStuInfoByStuNo,
submitPunishment,
savePunishment,
deleteImg
} from "@/api/applyrelieve/applyrelieve.js";
import uploadFile from "@/plugins/upload.js";
export default {
data() {
return {
// 校验表单数据
valiFormData: {
stuNo: '',
studentName: '',
gender: '',
className: '',
departmentName: '',
gradeName: '',
mz: '',
birthday: '',
penaltyType: '',
jg: '',
penaltyRecommendation: '',
violationRegulations: ''
},
// 校验规则
rules: {
stuNo: {
rules: [{
required: true,
errorMessage: '学号不能为空'
}]
},
studentName: {
rules: [{
required: true,
errorMessage: '姓名不能为空'
}]
},
gender: {
rules: [{
required: true,
errorMessage: '请选择性别'
}]
},
className: {
rules: [{
required: true,
errorMessage: '请输入班级'
}]
},
departmentName: {
rules: [{
required: true,
errorMessage: '请输入院系'
}]
},
gradeName: {
rules: [{
required: true,
errorMessage: '请输入年级'
}]
},
mz: {
rules: [{
required: true,
errorMessage: '请输入民族'
}]
},
birthday: {
rules: [{
required: true,
errorMessage: '请输入出生日期'
}]
},
jg: {
rules: [{
required: true,
errorMessage: '请选择籍贯'
}]
},
penaltyType: {
rules: [{
required: true,
errorMessage: '请选择处分等级'
}]
},
penaltyRecommendation: {
rules: [{
required: true,
errorMessage: '请输入违纪建议'
}]
},
violationRegulations: {
rules: [{
required: true,
errorMessage: '请输入违纪条例'
}]
},
},
options: ['警告', '严重警告', '记过', '留校察看', '开除学籍'], // 处分等级
selectedOptionIndex: -1, // 当前选中的处分等级索引
stuname: "", //
stduID: "",
system: "",
grade: "",
studclass: "",
gender: "",
nation: "",
birth: "",
suggest: "",
imageIds: [],
affixId:""
}
},
onLoad() {
},
methods: {
stduIDOnBlur() {
getStuInfoByStuNo(this.valiFormData.stuNo).then(res => {
console.log(res.data);
if (this.valiFormData.stuNo !== '') {
if (res.data) {
this.valiFormData.studentName = res.data.studentName;
this.valiFormData.gender = res.data.gender;
this.valiFormData.className = res.data.className;
this.valiFormData.departmentName = res.data.departmentName;
this.valiFormData.gradeName = res.data.gradeName;
} else {
uni.showToast({
title: "学号不存在",
icon: "error"
})
}
}
})
},
onPickerChange(event) {
this.valiFormData.penaltyType = event.detail.value;
},
base64ToBlob(base64String) {
const byteCharacters = atob(base64String.split(',')[1]);
const byteNumbers = new Array(byteCharacters.length);
for (let i = 0; i < byteCharacters.length; i++) {
byteNumbers[i] = byteCharacters.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
return new Blob([byteArray], {
type: 'application/octet-stream'
});
},
// 上传图片
uploadImg(e) {
if(this.affixId==""){
this.affixId=e.tempFiles[0].uuid;
}
let formDataObj = { // 使用一个普通的对象来存储表单数据
affixId:this.affixId
};
console.log(this.affixId);
uploadFile('/affix/upload', e.tempFilePaths[0],formDataObj).then((res) => {
let result=JSON.parse(res);
const imageId = result.id;
this.imageIds.push(imageId)
if(res.code==200){
uni.showToast({
title:"上传成功",
icon:"none"
})
}
})
},
deleteImg(e){
let imgId=this.imageIds[e.index];
this.imageIds.splice(e.index,1);
deleteImg({id:imgId}).then(res=>{
console.log(res);
})
},
onSave(ref) {
this.valiFormData.evidenceUpload =this.valiFormData.affixId;
this.$refs[ref].validate().then(res => {
uni.showLoading({
title: "正在保存",
success: () => {
savePunishment(this.valiFormData).then(res => {
if (res.code == 200) {
uni.showToast({
title: "保存成功"
})
uni.navigateBack();
}
})
}
})
}).catch(err => {
console.log('err', err);
})
},
onSubmit(ref) {
this.valiFormData.evidenceUpload =this.valiFormData.affixId;
this.$refs[ref].validate().then(res => {
uni.showLoading({
title: "正在提交",
success: () => {
submitPunishment(this.valiFormData).then(res => {
if (res.code == 200) {
uni.showToast({
title: "提交成功"
})
uni.navigateBack();
}
})
}
})
}).catch(err => {
console.log('err', err);
})
}
}
}
</script>
<style lang="scss" scoped>
.add {
background-color: #F5F5F7;
padding: 10px;
padding-bottom:80px;
.top {
background-color: white;
padding: 10px;
.title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 20px;
}
.uni-forms {
.uni-forms-item {
display: flex;
justify-content: space-between;
align-items: center;
&.materials {
display: flex;
flex-direction: column;
align-items: flex-start;
.tip {
color: red;
font-size: 24rpx;
}
.upImage {
margin-top: 8px;
}
}
/deep/ .uni-easyinput__content {
border: none;
}
}
/deep/ .uni-forms-item__label {
width: 100px !important;
}
}
}
.btns {
padding: 10px;
display: flex;
background: white;
position: fixed;
bottom: 0;
left: 0;
right:0;
button {
flex: 1;
background-color: #1890FF;
color: white;
&:first-child{
margin-right: 10px;
background-color: white;
border: 1px solid #1890FF;
color: #1890FF;
}
}
}
}
</style>

View File

@@ -0,0 +1,448 @@
<template>
<view class="container" style="padding-bottom: 60px;">
<uni-forms :modelValue="form" :rules="rules" ref="form">
<!-- 姓名 -->
<uni-forms-item label="姓名" name="stuName">
<uni-easyinput type="text" v-model="form.stuName" placeholder="请输入姓名" />
</uni-forms-item>
<!-- 学号 -->
<uni-forms-item label="学号" name="stuNo">
<uni-easyinput type="text" v-model="form.stuNo" placeholder="请输入学号" />
</uni-forms-item>
<!-- 性别选择 -->
<uni-forms-item label="性别" required name="gender">
<uni-data-checkbox v-model="form.gender" :localdata="sexs" />
</uni-forms-item>
<!-- <uni-forms-item label="性别" name="gender">
<picker :range="politicalOptions" v-model="form.gender" @change="onPoliticalChange">
<view class="select">{{ politicalOptions[selectedPoliticalIndex] || '请选择性别' }}</view>
</picker>
</uni-forms-item> -->
<!-- 系部 -->
<uni-forms-item label="系部" name="departmentName">
<uni-easyinput type="text" v-model="form.departmentName" placeholder="请输入系部" />
</uni-forms-item>
<!-- 年级 -->
<uni-forms-item label="年级" name="gradeName">
<uni-easyinput type="text" v-model="form.gradeName" placeholder="请输入年级" />
</uni-forms-item>
<!-- 班级 -->
<uni-forms-item label="班级" name="className">
<uni-easyinput type="text" v-model="form.className" placeholder="请输入班级" />
</uni-forms-item>
<!-- 民族 -->
<uni-forms-item label="民族" name="mz">
<uni-easyinput type="text" v-model="form.mz" placeholder="请输入民族" />
</uni-forms-item>
<!-- 出生日期 -->
<uni-forms-item label="出生日期" name="birthday">
<uni-easyinput type="text" v-model="form.birthday" placeholder="请输入出生日期" />
</uni-forms-item>
<!-- 籍贯 -->
<uni-forms-item label="籍贯" name="jg">
<uni-easyinput type="text" v-model="form.jg" placeholder="省/自治区/直辖市" />
</uni-forms-item>
<!-- 处分文号 -->
<uni-forms-item label="处分文号" name="penaltyNumber">
<uni-easyinput type="text" v-model="form.penaltyNumber" placeholder="请输入处分文号" @blur="handleBlurPenalty" />
</uni-forms-item>
<!-- 违纪时间 -->
<uni-forms-item label="违纪时间" name="violationDate">
<uni-easyinput type="text" v-model="form.violationDate" placeholder="请输入违纪时间" />
</uni-forms-item>
<!-- 处分等级 -->
<uni-forms-item label="处分等级" name="penaltyType">
<uni-data-select v-model="form.penaltyType" :localdata="penaltyTypeOptions" :disabled="true"></uni-data-select>
</uni-forms-item>
<!-- 处分建议 -->
<uni-forms-item label="处分建议" name="penaltyRecommendation">
<uni-easyinput type="textarea" v-model="form.penaltyRecommendation" maxlength="500" placeholder="请输入处分建议" />
</uni-forms-item>
<!-- 违纪条例 -->
<uni-forms-item label="违纪条例" name="stuName">
<uni-easyinput type="textarea" v-model="form.violationRegulations" maxlength="500" placeholder="请输入违纪条例" />
</uni-forms-item>
<!-- 按钮 -->
<view class="btn">
<button style="background-color: red;" @click="clean">清除</button>
<button style="background-color: whitesmoke; color: black;" @click="save">保存</button>
<button @click="submitForm">提交申请</button>
</view>
</uni-forms>
</view>
</template>
<script>
import {
getMyStuInfo,
getPenaltyNumber,
save,
addRelieve
} from "@/api/applyleave/applyleave.js";
// import {
// getDicts
// } from "@/api/system/dict/data";
export default {
data() {
return {
options: ['一等', '二等', '三等'], // 处分等级
selectedOptionIndex: -1, // 当前选中的奖项索引
politicalOptions: ['男', '女'], // 政治面貌选项
selectedPoliticalIndex: -1, // 当前选中的政治面貌索引
stuname: "", //
stduID: "",
system: "",
introduction: "",
deeds: "",
grade: "",
studclass: "",
nation: "",
birth: "",
Hometown: "",
city: "",
number: "",
thought: "",
time: "",
form: {
stuNo: '',
stuName: '',
gender: '',
departmentName: '',
gradeName: '',
className: '',
mz: '',
birthday: '',
jg: "",
penaltyNumber: '',
violationDate: '',
penaltyType: '',
penaltyRecommendation: '',
violationRegulations: ''
},
penaltyTypeOptions: null,
// 表单校验
rules: {
stuNo: {
rules: [{
required: true,
message: '学号不能为空',
trigger: 'blur'
}]
},
stuName: {
rules: [{
required: true,
errorMessage: '请输入姓名',
}]
},
gender: {
rules: [{
required: true,
errorMessage: '请选择性别',
}]
},
departmentName: {
rules: [{
required: true,
errorMessage: '请输入院部',
}]
},
gradeName: {
rules: [{
required: true,
errorMessage: '请输入年级',
}]
},
className: {
rules: [{
required: true,
errorMessage: '请输入班级',
}]
},
mz: {
rules: [{
required: true,
errorMessage: '请输入民族',
}]
},
birthday: {
rules: [{
required: true,
errorMessage: '请输入出生日期',
}]
},
jg: {
rules: [{
required: true,
errorMessage: '请选择籍贯',
}]
},
penaltyNumber: {
rules: [{
required: true,
errorMessage: '请输入处分文号',
}]
},
violationDate: {
rules: [{
required: true,
errorMessage: '违纪时间不能为空',
}]
},
penaltyType: {
rules: [{
required: true,
errorMessage: '处分等级不能为空',
}]
},
penaltyRecommendation: {
rules: [{
required: true,
errorMessage: '请输入处分建议',
}]
},
violationRegulations: {
rules: [{
required: true,
errorMessage: '请输入违纪条例',
}]
},
},
sexs: [{
text: '男',
value: '男'
}, {
text: '女',
value: '女'
}],
};
},
onLoad() {
this.loadMyStuInfo()
getDicts("rt_penalty_type").then(response => {
this.penaltyTypeOptions = response.data.map((item) => ({
value: item.dictValue, // 根据实际情况映射 value
text: item.dictLabel, // 如果 dictValue 和 value 相同,否则映射 dictValue
}));
});
},
mounted() {
// 在组件挂载时尝试从本地存储中加载已保存的数据
this.loadFormData();
},
methods: {
loadMyStuInfo() {
getMyStuInfo().then(res => {
this.form.stuNo = res.data.stuNo
this.form.stuName = res.data.studentName
this.form.gender = res.data.gender
this.form.departmentName = res.data.departmentName
this.form.gradeName = res.data.gradeName
this.form.className = res.data.className
this.form.mz = res.data.mz
this.form.birthday = res.data.birthday
this.form.jg = res.data.jg
})
},
handleBlurPenalty() {
if (this.form.penaltyNumber) {
getPenaltyNumber(this.form.penaltyNumber).then((res) => {
if (res.code == 500) {
return
}
if (res.data) {
this.form.penaltyNumber = res.data.penaltyNumber
this.form.violationDate = res.data.violationDate
this.form.penaltyType = res.data.penaltyType.toString()
this.form.penaltyRecommendation = res.data.penaltyRecommendation
this.form.violationRegulations = res.data.violationRegulations
} else {
this.$message.error('未找到相关处分文号')
}
})
}
},
onPickerChange(event) {
this.selectedOptionIndex = event.detail.value;
},
//
onPoliticalChange(event) {
this.selectedPoliticalIndex = event.detail.value;
},
// 清空表单
clean() {
this.form = null
},
save() {
this.$refs.form.validate().then(res => {
uni.showModal({
confirmText: "确定",
cancelText: "放弃",
confirmColor: "#aa0000",
title: "确定提交保存吗?",
success: res => {
if (res.confirm) {
save(this.form).then(res => {
if (res.code == 200) {
uni.showToast({
title: '保存成功',
duration: 2000,
success: res => {
// 跳转会主页
}
});
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
})
}
}
})
}).catch(err => {
console.log('表单错误信息:', err);
})
},
submitForm() {
this.$refs.form.validate().then(res => {
uni.showModal({
confirmText: "确定",
cancelText: "放弃",
confirmColor: "#aa0000",
title: "确定提交申请吗?",
success: res => {
if (res.confirm) {
addRelieve(this.form).then(res => {
if (res.code == 200) {
uni.showToast({
title: '提交成功',
duration: 2000,
success: res => {
// 跳转会主页
}
});
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
})
}
}
})
}).catch(err => {
console.log('表单错误信息:', err);
})
},
loadFormData() {
// 尝试从本地存储中加载已保存的表单数据
const savedData = localStorage.getItem('formData');
if (savedData) {
const formData = JSON.parse(savedData);
this.stduID = formData.stduID;
this.stuname = formData.stuname;
this.system = formData.system;
this.studclass = formData.studclass;
this.deeds = formData.deeds;
this.introduction = formData.introduction;
this.grade = formData.grade;
this.birth = formData.birth;
this.nation = formData.nation;
this.deeds = formData.deeds;
this.Hometown = formData.Hometown;
this.city = formData.city;
this.number = formData.number;
this.thought = formData.thought;
this.time = formData.time;
// 如果性别存在于选项中,则设置其索引
this.selectedOptionIndex = this.options.indexOf(formData.gender);
this.selectedPoliticalIndex = this.politicalOptions.indexOf(formData.because);
}
}
}
};
</script>
<style>
.container {
display: flex;
flex-direction: column;
align-items: center;
padding: 10rpx;
}
.form-item {
width: 95%;
height: 80rpx;
display: flex;
align-items: center;
margin-bottom: 20rpx;
justify-content: space-between;
border-bottom: 1px solid #ededee;
}
.form-text {
width: 95%;
margin-bottom: 20rpx;
border-bottom: 1px solid #ededee;
}
.txt {
margin-top: 20rpx;
}
.label {
text-align: right;
margin-right: 20rpx;
}
.select {
color: #888889;
}
.uni-input {
/* width: 23%; */
color: #888889;
text-align: right;
}
.btn {
width: 100%;
height: 90rpx;
display: flex;
justify-content: space-between;
position: fixed;
bottom: 20px;
left: 0;
margin: 0 auto;
}
button {
width: 30%;
background-color: #87CEFA;
color: white;
}
</style>

View File

@@ -0,0 +1,423 @@
<template>
<view class="add">
<view class="form-item">
<label>学号</label>
<input type="number" placeholder="请输入" @blur="stduIDOnBlur" v-model="valiFormData.stuNo" />
</view>
<view class="form-item">
<label>姓名</label>
<input type="text" v-model="valiFormData.studentName" placeholder="请输入" />
</view>
<view class="form-item">
<label>性别</label>
<radio-group data-group-name="punishment">
<label>
<radio value="男" :checked="valiFormData.gender === '男'" active-background-color="#2a8f08"
style="transform:scale(0.7)" />
</label>
<label>
<radio value="女" :checked="valiFormData.gender === '女'" active-background-color="#2a8f08"
style="transform:scale(0.7)" />
</label>
</radio-group>
</view>
<view class="form-item" v-for="(item,index) in inputArray" :key="index">
<label>{{item.text}}</label>
<input type="text" v-model="valiFormData[item.val]" placeholder="请输入" />
</view>
<view class="form-item">
<label>处分等级</label>
<picker range-key="class_name" v-model="valiFormData.penaltyType" :range="options" @change="onPickerChange">
<view class="uni-input">
<text class="val">{{ options[valiFormData.penaltyType] || '请选择处分等级' }}</text>
<uni-icons type="down" size="16" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>处分建议</label>
<input type="text" v-model="valiFormData.penaltyRecommendation" placeholder="请输入" />
</view>
<view class="form-item">
<label>违纪条例</label>
<input type="text" v-model="valiFormData.violationRegulations" placeholder="请输入" />
</view>
<view class="form-item">
<label>违纪材料</label>
<view class="tip">
请上传违纪询问记录违纪申辩记录学生检讨书等扫描件
</view>
<uni-file-picker :auto-upload="false" @select="uploadImg" @delete="deleteImg"></uni-file-picker>
</view>
<view class="btns">
<button @click="onSave" :disabled="isSubmitting">保存</button>
<button @click="onSubmit" :disabled="isSubmitting">提交</button>
</view>
</view>
</template>
<script>
import {
getStuInfoByStuNo,
submitPunishment,
savePunishment,
deleteImg
} from "@/api/applyrelieve/applyrelieve.js";
import uploadFile from "@/plugins/upload.js";
export default {
data() {
return {
isSubmitting: false, //表单提交标志位
inputArray: [{
text: "班级",
val: "className",
},
{
text: "学院",
val: "departmentName",
},
{
text: "年级",
val: "gradeName",
},
{
text: "民族",
val: "mz",
},
{
text: "出生日期",
val: "birthday",
},
{
text: "籍贯",
val: "jg",
},
],
// 校验表单数据
valiFormData: {
stuNo: '',
studentName: '',
gender: '',
className: '',
departmentName: '',
gradeName: '',
mz: '',
birthday: '',
penaltyType: '',
jg: '',
penaltyRecommendation: '',
violationRegulations: ''
},
options: ['警告', '严重警告', '记过', '留校察看', '开除学籍'], // 处分等级
selectedOptionIndex: -1, // 当前选中的处分等级索引
stuname: "", //
stduID: "",
system: "",
grade: "",
studclass: "",
gender: "",
nation: "",
birth: "",
suggest: "",
imageIds: [],
affixId: ""
}
},
onLoad() {},
methods: {
stduIDOnBlur() {
getStuInfoByStuNo(this.valiFormData.stuNo).then(res => {
console.log(res.data);
if (this.valiFormData.stuNo !== '') {
if (res.data) {
this.valiFormData.studentName = res.data.studentName;
this.valiFormData.gender = res.data.gender;
this.valiFormData.className = res.data.className;
this.valiFormData.departmentName = res.data.departmentName;
this.valiFormData.gradeName = res.data.gradeName;
console.log(this.valiFormData)
} else {
uni.showToast({
title: "学号不存在",
icon: "error"
})
}
}
})
},
onPickerChange(event) {
this.valiFormData.penaltyType = event.detail.value;
},
base64ToBlob(base64String) {
const byteCharacters = atob(base64String.split(',')[1]);
const byteNumbers = new Array(byteCharacters.length);
for (let i = 0; i < byteCharacters.length; i++) {
byteNumbers[i] = byteCharacters.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
return new Blob([byteArray], {
type: 'application/octet-stream'
});
},
// 上传图片
uploadImg(e) {
if (this.affixId == "") {
this.affixId = e.tempFiles[0].uuid;
}
let formDataObj = { // 使用一个普通的对象来存储表单数据
affixId: this.affixId
};
console.log(this.affixId);
uploadFile('/affix/upload', e.tempFilePaths[0], formDataObj).then((res) => {
let result = JSON.parse(res);
const imageId = result.id;
this.imageIds.push(imageId)
if (res.code == 200) {
uni.showToast({
title: "上传成功",
icon: "none"
})
}
})
},
deleteImg(e) {
let imgId = this.imageIds[e.index];
this.imageIds.splice(e.index, 1);
deleteImg({
id: imgId
}).then(res => {
console.log(res);
})
},
onSave(ref) {
this.valiFormData.evidenceUpload = this.affixId;
const requiredFields = [
'stuNo',
'studentName',
'gender',
'className',
'departmentName',
'gradeName',
'mz',
'birthday',
'penaltyType',
'jg',
'penaltyRecommendation',
'violationRegulations',
'evidenceUpload'
];
const emptyField = requiredFields.find(field => this.valiFormData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写完整内容`,
icon: "none"
})
return;
}
this.isSubmitting = true; // 设置为正在提交
uni.showLoading({
title: "正在保存",
success: () => {
savePunishment(this.valiFormData).then(res => {
if (res.code == 200) {
uni.showToast({
title: "保存成功"
})
this.isSubmitting = false;
uni.navigateBack();
}
})
}
})
},
onSubmit() {
this.valiFormData.evidenceUpload = this.affixId;
const requiredFields = [
'stuNo',
'studentName',
'gender',
'className',
'departmentName',
'gradeName',
'mz',
'birthday',
'penaltyType',
'jg',
'penaltyRecommendation',
'violationRegulations',
'evidenceUpload'
];
const emptyField = requiredFields.find(field => this.valiFormData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写完整内容`,
icon: "none"
})
return;
}
this.isSubmitting = true; // 设置为正在提交
uni.showLoading({
title: "正在提交",
success: () => {
submitPunishment(this.valiFormData).then(res => {
if (res.code == 200) {
uni.showToast({
title: "提交成功"
})
this.isSubmitting = false;
uni.navigateBack();
}
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.add {
background-color: #F5F5F7;
padding: 10px;
padding-bottom: 80px;
.form-item {
display: flex;
flex-direction: column;
padding: 22rpx 40rpx;
background-color: white;
margin-bottom: 20rpx;
border-radius: 16rpx;
.tip {
color: red;
font-size: 24rpx;
}
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;
}
}
}
.btns {
padding: 10px;
display: flex;
background: white;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 999;
button {
flex: 1;
background-color: #1890FF;
color: white;
&:first-child {
margin-right: 10px;
background-color: white;
border: 1px solid #1890FF;
color: #1890FF;
}
}
}
}
</style>

View File

@@ -0,0 +1,288 @@
<template>
<view class="detail" v-if="detail!=null">
<Nav :navs="navs" @change="navChange" />
<view class="card" v-if="navIndex==0">
<view class="title">基础信息</view>
<view class="row">
<label>学号</label>
<label>{{detail.stuNo}}</label>
</view>
<view class="row">
<label>姓名</label>
<label>{{detail.stuName}}</label>
</view>
<view class="row">
<label>性别</label>
<label>{{detail.gender}}</label>
</view>
<view class="row">
<label>学院</label>
<label>{{detail.departmentName}}</label>
</view>
<view class="row">
<label>年级</label>
<label>{{detail.gradeName}}</label>
</view>
<view class="row">
<label>班级</label>
<label>{{detail.className}}</label>
</view>
<view class="row">
<label>民族</label>
<label>{{detail.mz}}</label>
</view>
<view class="row">
<label>出生日期</label>
<label>{{detail.birthday}}</label>
</view>
<view class="row">
<label>籍贯</label>
<label>{{detail.jg}}</label>
</view>
</view>
<view class="card" v-if="navIndex==1">
<view class="title">处分信息</view>
<view class="row">
<label>处分文号</label>
<label>{{detail.penaltyNumber}}</label>
</view>
<view class="row">
<label>违纪时间</label>
<label>{{detail.violationDate}}</label>
</view>
<view class="row" style="display: flex;">
<label>处分等级</label>
<DictStatus :status="rt_penalty_type" :value="detail.penaltyType" />
</view>
<view class="row disciplinary-materials">
<label>违纪材料</label>
<view v-for="file in fileList" :key="file.id" @tap="onLook(file)">
<image src="../../../static/file.png" mode="widthFix"></image>
<text>{{file.trueName}}</text>
</view>
</view>
<view class="row">
<label>处分建议</label>
<label>{{detail.penaltyRecommendation}}</label>
</view>
<view class="row">
<label>违纪条例</label>
<label>{{detail.violationRegulations}}</label>
</view>
<!-- <view class="row">
<label>解除违纪申请</label>
<label>{{detail.gender}}</label>
</view> -->
</view>
<view class="card" v-if="navIndex==2">
<view class="title">处分进度</view>
<view class="steps">
<view class="step" v-for="step in stepList" :key="step.taskId">
<image v-if="step.finishTime" class="icon" src="../../../static/success.png" mode="widthFix">
</image>
<image style="width:34rpx;" v-else class="icon" src="../../../static/wating.png" mode="widthFix">
</image>
<image class="line" src="../../../static/step-line.png" mode="widthFix"></image>
<view class="right">
<text>{{step.taskName}}:</text>
<text>{{step.assigneeName}}</text>
</view>
</view>
</view>
<view class="loading-more-top" v-if="stepList.length==0">
<uni-load-more status="loading" />
</view>
</view>
</view>
</template>
<script>
import {
baseUrl
} from "@/config.js";
import {
isImageUrl
} from "@/utils/checkPic.js";
import Nav from "@/components/navs/navs.vue"
import DictStatus from "@/components/dict-status/dict-status.vue"
import {
getDicts,
} from '@/api/system/dict/data.js';
import {
getAffixItems
} from "@/api/affix.js";
import {
getDisciplinaryApplicationByProcInsId,
} from '@/api/applyrelieve/applyrelieve.js';
import {
flowRecord
} from '@/api/flowRecord/flowRecord.js';
export default {
components: {
Nav,
DictStatus
},
data() {
return {
navs: [{
text: "基础信息",
val: 0
},
{
text: "处分信息",
val: 1
},
{
text: "处分进度",
val: 2
}
],
detail: null,
navIndex: 0,
rt_penalty_type: [],
stepList: [],
//违纪材料
fileList: [],
}
},
onLoad(option) {
this.stuNo = option.stuNo;
this.procInsId = option.procInsId;
this.deployId = option.deployId;
this.getDisciplinaryApplicationByProcInsId();
this.get_penalty_type();
this.getFlowRecord();
},
methods: {
async get_penalty_type() {
let res = await getDicts('rt_penalty_type');
console.log(res);
this.rt_penalty_type = res.data;
},
navChange(index) {
this.navIndex = index;
},
async getDisciplinaryApplicationByProcInsId() {
let res = await getDisciplinaryApplicationByProcInsId(this.procInsId);
this.detail = res.data;
if (res.code == 200) {
getAffixItems({
affixId: this.detail.evidenceUpload
}).then(file => {
this.fileList = file.data;
})
}
console.log(res);
},
async getFlowRecord() {
let res = await flowRecord({
procInsId: this.procInsId,
deployId: this.deployId
});
this.stepList = res.data.flowList.reverse();
},
onLook(file) {
let url = baseUrl + file.savePath;
if (isImageUrl(file.savePath)) {
console.log("是图片");
uni.previewImage({
urls: [url], // 需要预览的图片HTTP链接列表
current: 0 // 当前显示图片的链接索引
});
} else {
const a = document.createElement('a');
a.style.display = 'none';
a.href = url;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
window.URL.revokeObjectURL(url);
}
},
}
}
</script>
<style scoped lang="scss">
.detail {
height: calc(100vh - 44px);
background-color: #F5F5F7;
padding: 80rpx 30rpx 0;
.card {
margin: 30rpx 0rpx 0;
padding: 30rpx;
background-color: white;
border-radius: 20rpx;
.title {
font-weight: bold;
color: #202020;
display: inline-block;
font-size: 30rpx;
margin-bottom: 30rpx;
}
.row {
margin-bottom: 30rpx;
&>label:first-child {
color: #9C9C9C;
margin-right: 40rpx;
}
&.disciplinary-materials {
view {
margin-top: 15px;
background-color: #F5F5F5;
padding: 18rpx;
display: flex;
align-items: center;
image {
width: 70rpx;
margin-right: 15rpx;
}
text {
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
.steps {
margin-top: 20px;
.step {
display: flex;
align-items: center;
margin-bottom: 50rpx;
.icon {
width: 35rpx;
}
.line {
flex: 0.7;
margin: 0 10px;
}
.right {
flex: 1.4;
text:first-child {
color: #9E9E9E;
margin-right: 10rpx;
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,280 @@
<template>
<view class="stu-punishment">
<Nav :navs="navs" @change="navChange"/>
<scroll-view scroll-y="true" @scrolltolower="scrolltolower">
<view class="list">
<view class="item" @tap="toDetail(item)" v-for="item in stuPunishmentList" :key="item.id">
<view class="top">
姓名:{{item.stuName}}
<DictType :types="rt_penalty_status" :type="item.penaltyStatus" />
<!-- <uni-icons type="right" size="18" color="#202020"></uni-icons> -->
</view>
<view class="content">
<view>学号{{item.stuNo}}</view>
<view>班级{{item.className}}</view>
<view class="level">处分等级
<DictStatus :status="rt_penalty_type" :value="item.penaltyType" />
</view>
</view>
</view>
</view>
<view class="empty" v-if="stuPunishmentList.length==0&&topLoading==false">
<image src="@/static/empty.png" mode="widthFix"></image>
暂时没有数据
</view>
<view class="loading-more-top" v-if="topLoading">
<uni-load-more style="padding-top: 90px;" status="loading" />
</view>
<view class="loading-more" v-if="loading">
<uni-load-more status="loading" />
</view>
<view class="no-more" v-if="!loading&&stuPunishmentList.length!=0">
到底啦~~
</view>
</scroll-view>
<view class="add" @tap="addDisciplinaryApplication">
+
</view>
</view>
</template>
<script>
import Nav from "@/components/navs/navs.vue"
import DictType from "@/components/dict-type/dict-type.vue"
import DictStatus from "@/components/dict-status/dict-status.vue"
import {
list,
} from '@/api/applyrelieve/applyrelieve.js';
import {
getDicts,
} from '@/api/system/dict/data.js';
export default {
components: {
Nav,
DictType,
DictStatus
},
data() {
return {
navs:[
{
text:"全部",
val:""
},
{
text:"处分中",
val:"0"
},
{
text:"已解除",
val:"1"
},
{
text:"解除中",
val:"2"
},
{
text:"处分申请中",
val:"3"
}
],
stuPunishmentList: [],
loading: false,
topLoading: true,
rt_penalty_type: [],
rt_penalty_status: [],
queryParams: {
pageNum: 1,
pageSize: 10,
penaltyStatus:""
},
}
},
onShow() {
this.getList();
this.get_penalty_type();
this.get_penalty_status();
},
methods: {
addDisciplinaryApplication(){
uni.navigateTo({
url:"./add-punishment"
})
},
scrolltolower() {
if (this.queryParams.pageNum < this.totalPages) {
this.queryParams.pageNum++;
this.loading = true;
setTimeout(() => {
this.getList()
}, 1000)
} else {
}
},
toDetail(item){
uni.navigateTo({
url:`./detail?procInsId=${item.processInstanceId}&deployId=${item.deployId}&category=disposal&stuNo=${item.stuNo}`
})
},
navChange(index){
this.stuPunishmentList=[];
this.topLoading=true;
this.queryParams={
pageNum: 1,
pageSize: 10,
penaltyStatus:index
};
this.getList();
},
async getList() {
let res = await list(this.queryParams);
if (res.code == 200) {
this.loading = false;
if (this.queryParams.pageNum == 1) {
this.stuPunishmentList = res.rows; // 如果是第一页,直接显示新数据
} else {
this.stuPunishmentList = this.stuPunishmentList.concat(res.rows); // 否则追加新数据到列表中
}
this.totalPages = Math.ceil(res.total / this.queryParams.pageSize);
this.topLoading = false;
}
},
async get_penalty_type() {
let res = await getDicts('rt_penalty_type');
this.rt_penalty_type = res.data;
},
async get_penalty_status() {
let res = await getDicts('rt_penalty_status');
this.rt_penalty_status = res.data;
},
}
}
</script>
<style scoped lang="scss">
.stu-punishment {
background-color: #F5F5F7;
scroll-view {
height: calc(100vh - 10px);
padding-top:100rpx;
.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;
}
}
}
.list {
padding: 20rpx 40rpx 15rpx 40rpx;
.item {
background-color: white;
margin-bottom: 20rpx;
padding: 40rpx;
border-radius:16px;
border-bottom-right-radius: 0;
position: relative;
.top {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F5F5F7;
padding-bottom: 20rpx;
.uni-icons {
opacity: 0.5;
}
}
.content {
padding-top: 20rpx;
.level {
display: flex;
}
&>view:not(:last-child) {
margin-bottom: 15rpx;
.progress {
color: #1890FF;
}
}
.status {
position: absolute;
bottom: 0;
right: 0;
color: white;
.status-text {
position: absolute;
bottom: 15px;
right: 8%;
font-size: 35rpx;
}
.triangle-right {
width: 0;
height: 0;
/* 上边框设置为透明 */
border-left: 120px solid transparent;
}
&.submit {
color: #202020;
.triangle-right {
/* 左边框设置为与文本相同的颜色 */
border-bottom: 100px solid #D7D7D7;
}
}
&.agree {
.triangle-right {
/* 左边框设置为与文本相同的颜色 */
border-bottom: 100px solid #2FB15B;
}
}
&.refuse {
.triangle-right {
/* 左边框设置为与文本相同的颜色 */
border-bottom: 100px solid #FF759F;
}
}
}
}
}
}
.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,87 @@
<template>
<view class="instructor-index">
<view class="panel">
<view class="title">
处分管理
</view>
<view class="grid">
<view class="grid-item" @tap="toDisciplinaryApplication">
<image src="../../static/images/applyrelieve/punishment.png" mode="widthFix"></image>
<text>处分记录</text>
</view>
<view class="grid-item" @tap="toRelieve">
<image src="../../static/images/applyrelieve/relieve_punishment.png" mode="widthFix"></image>
<text>解除处分记录</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
toDisciplinaryApplication(){
uni.navigateTo({
url:"./disciplinaryApplication/list"
})
},
toRelieve(){
uni.navigateTo({
url:"./relieve/list"
})
},
}
}
</script>
<style scoped lang="scss">
.instructor-index {
min-height: 100vh;
background-color: #F5F5F7;
padding: 40rpx 40rpx;
.panel {
background-color: white;
padding: 30rpx 0;
border-radius: 15rpx;
.title {
display: flex;
align-items: center;
margin: 0 0 40rpx 40rpx;
font-weight: bold;
color: #333;
&::before {
content: "";
display: inline-block;
height:25rpx;
border-radius: 20rpx;
width:8rpx;
background-color: #1890FF;
margin-right:8rpx;
}
}
.grid {
display: flex;
&-item {
display: flex;
flex-direction: column;
align-items: center;
width: 25%;
font-size: 26rpx;
image {
width: 80rpx;
margin-bottom: 10rpx;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,245 @@
<template>
<view class="detail" v-if="detail!=null">
<Nav :navs="navs" @change="navChange" />
<view class="card" v-if="navIndex==0">
<view class="title">基础信息</view>
<view class="row">
<label>学号</label>
<label>{{detail.stuNo}}</label>
</view>
<view class="row">
<label>姓名</label>
<label>{{detail.stuName}}</label>
</view>
<view class="row">
<label>性别</label>
<label>{{detail.gender}}</label>
</view>
<view class="row">
<label>学院</label>
<label>{{detail.departmentName}}</label>
</view>
<view class="row">
<label>年级</label>
<label>{{detail.gradeName}}</label>
</view>
<view class="row">
<label>班级</label>
<label>{{detail.className}}</label>
</view>
<view class="row">
<label>民族</label>
<label>{{detail.mz}}</label>
</view>
<view class="row">
<label>出生日期</label>
<label>{{detail.birthday}}</label>
</view>
<view class="row">
<label>籍贯</label>
<label>{{detail.jg}}</label>
</view>
</view>
<view class="card" v-if="navIndex==1">
<view class="title">处分信息</view>
<view class="row">
<label>处分文号</label>
<label>{{detail.penaltyNumber}}</label>
</view>
<view class="row">
<label>违纪时间</label>
<label>{{detail.violationDate}}</label>
</view>
<view class="row" style="display: flex;">
<label>处分等级</label>
<DictStatus :status="rt_penalty_type" :value="detail.penaltyType" />
</view>
<view class="row disciplinary-materials">
<label>违纪材料</label>
<view>
<image src="../../../static/word_file.png" mode="widthFix"></image>
<text>QQ截图2024fsf.pdf</text>
</view>
</view>
<view class="row">
<label>处分建议</label>
<label>{{detail.penaltyRecommendation}}</label>
</view>
<view class="row">
<label>违纪条例</label>
<label>{{detail.violationRegulations}}</label>
</view>
<!-- <view class="row">
<label>解除违纪申请</label>
<label>{{detail.gender}}</label>
</view> -->
</view>
<view class="card" v-if="navIndex==2">
<view class="title">处分进度</view>
<view class="steps">
<view class="step" v-for="step in stepList" :key="step.taskId">
<image v-if="step.finishTime" class="icon" src="../../../static/success.png" mode="widthFix"></image>
<image style="width:34rpx;" v-else class="icon" src="../../../static/wating.png" mode="widthFix">
</image>
<image class="line" src="../../../static/step-line.png" mode="widthFix"></image>
<view class="right">
<text>{{step.taskName}}:</text>
<text>{{step.assigneeName}}</text>
</view>
</view>
<view class="loading-more-top" v-if="stepList.length==0">
<uni-load-more status="loading" />
</view>
</view>
</view>
</view>
</template>
<script>
import Nav from "@/components/navs/navs.vue"
import DictStatus from "@/components/dict-status/dict-status.vue"
import {
getDicts,
} from '@/api/system/dict/data.js';
import {
relieveDetail
} from '@/api/applyrelieve/applyrelieve.js';
import {
flowRecord
} from '@/api/flowRecord/flowRecord.js';
export default {
components: {
Nav,
DictStatus
},
data() {
return {
navs: [{
text: "基础信息",
val: 0
},
{
text: "处分信息",
val: 1
},
{
text: "处分进度",
val: 2
}
],
basicInfo: null,
detail: null,
navIndex: 0,
rt_penalty_type: [],
stepList: []
}
},
onLoad(option) {
this.stuNo = option.stuNo;
this.procInsId = option.procInsId;
this.deployId = option.deployId;
this.getRelieveDetail();
this.get_penalty_type();
this.getFlowRecord();
},
methods: {
async get_penalty_type() {
let res = await getDicts('rt_penalty_type');
console.log(res);
this.rt_penalty_type = res.data;
},
navChange(index) {
this.navIndex = index;
},
async getRelieveDetail() {
let res = await relieveDetail(this.procInsId);
this.detail = res.data;
console.log(res);
},
async getFlowRecord() {
let res = await flowRecord({
procInsId: this.procInsId,
deployId: this.deployId
});
this.stepList = res.data.flowList.reverse();
}
}
}
</script>
<style scoped lang="scss">
.detail {
height: calc(100vh - 44px);
background-color: #F5F5F7;
padding: 80rpx 30rpx 0;
.card {
margin: 30rpx 0rpx 0;
padding: 30rpx;
background-color: white;
border-radius: 20rpx;
.title {
font-weight: bold;
color: #202020;
display: inline-block;
font-size: 30rpx;
margin-bottom: 30rpx;
}
.row {
margin-bottom: 30rpx;
&>label:first-child {
color: #9C9C9C;
margin-right: 40rpx;
}
&.disciplinary-materials {
// display: flex;
// flex-direction: column;
view {
margin-top: 15px;
background-color: #F5F5F5;
padding: 18rpx;
display: flex;
align-items: center;
image {
width: 70rpx;
margin-right: 15rpx;
}
}
}
}
.steps {
margin-top: 20px;
.step {
display: flex;
align-items: center;
margin-bottom: 50rpx;
.icon {
width: 35rpx;
}
.line {
flex: 0.7;
margin: 0 10px;
}
.right {
flex: 1.4;
text:first-child {
color: #9E9E9E;
margin-right: 10rpx;
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,234 @@
<template>
<view class="stu-punishment">
<scroll-view scroll-y="true" @scrolltolower="scrolltolower">
<view class="list">
<view class="item" @tap="toDetail(item)" v-for="item in stuPunishmentList" :key="item.id">
<view class="top">
姓名:{{item.stuName}}
<DictType :types="rt_penalty_status" :type="item.penaltyStatus" />
</view>
<view class="content">
<view>学号{{item.stuNo}}</view>
<view>班级{{item.className}}</view>
<view class="level">处分等级
<DictStatus :status="rt_penalty_type" :value="item.penaltyType" />
</view>
</view>
</view>
</view>
<view class="empty" v-if="stuPunishmentList.length==0&&topLoading==false">
<image src="@/static/empty.png" mode="widthFix"></image>
暂时没有数据
</view>
<view class="loading-more-top" v-if="topLoading">
<uni-load-more style="padding-top: 90px;" status="loading" />
</view>
<view class="loading-more" v-if="loading">
<uni-load-more status="loading" />
</view>
<view class="no-more" v-if="!loading&&stuPunishmentList.length!=0">
到底啦~~
</view>
</scroll-view>
</view>
</template>
<script>
import DictType from "@/components/dict-type/dict-type.vue"
import DictStatus from "@/components/dict-status/dict-status.vue"
import {
relieveList,
} from '@/api/applyrelieve/applyrelieve.js';
import {
getDicts,
} from '@/api/system/dict/data.js';
export default {
components: {
DictType,
DictStatus
},
data() {
return {
stuPunishmentList: [],
loading: false,
topLoading: true,
rt_penalty_type: [],
rt_penalty_status: [],
queryParams: {
pageNum: 1,
pageSize: 10,
},
}
},
onShow() {
this.getList();
this.get_penalty_type();
this.get_penalty_status();
},
methods: {
scrolltolower() {
if (this.queryParams.pageNum < this.totalPages) {
this.queryParams.pageNum++;
this.loading = true;
setTimeout(() => {
this.getList()
}, 1000)
} else {
}
},
toDetail(item){
console.log(item);
uni.navigateTo({
url:`./detail?procInsId=${item.processInstanceId}&deployId=${item.deployId}`
})
},
navChange(index){
console.log(index);
this.queryParams={
pageNum: 1,
pageSize: 10,
penaltyStatus:index
};
this.getList();
},
async getList() {
let res = await relieveList(this.queryParams);
console.log(res);
if (res.code == 200) {
this.loading = false;
if (this.queryParams.pageNum == 1) {
this.stuPunishmentList = res.rows; // 如果是第一页,直接显示新数据
} else {
this.stuPunishmentList = this.stuPunishmentList.concat(res.rows); // 否则追加新数据到列表中
}
this.totalPages = Math.ceil(res.total / this.queryParams.pageSize);
this.topLoading = false;
}
},
async get_penalty_type() {
let res = await getDicts('rt_penalty_type');
console.log(res);
this.rt_penalty_type = res.data;
},
async get_penalty_status() {
let res = await getDicts('rt_penalty_status');
console.log(res);
this.rt_penalty_status = res.data;
},
}
}
</script>
<style scoped lang="scss">
.stu-punishment {
background-color: #F5F5F7;
scroll-view {
height: calc(100vh - 10px);
padding-top:30rpx;
.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;
}
}
}
.list {
padding: 0rpx 40rpx 15rpx 40rpx;
.item {
background-color: white;
margin-bottom: 20rpx;
padding: 40rpx;
border-radius: 20rpx;
border-bottom-right-radius: 0;
position: relative;
.top {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F5F5F7;
padding-bottom: 20rpx;
.uni-icons {
opacity: 0.5;
}
}
.content {
padding-top: 20rpx;
.level {
display: flex;
}
&>view:not(:last-child) {
margin-bottom: 15rpx;
.progress {
color: #1890FF;
}
}
.status {
position: absolute;
bottom: 0;
right: 0;
color: white;
.status-text {
position: absolute;
bottom: 15px;
right: 8%;
font-size: 35rpx;
}
.triangle-right {
width: 0;
height: 0;
/* 上边框设置为透明 */
border-left: 120px solid transparent;
}
&.submit {
color: #202020;
.triangle-right {
/* 左边框设置为与文本相同的颜色 */
border-bottom: 100px solid #D7D7D7;
}
}
&.agree {
.triangle-right {
/* 左边框设置为与文本相同的颜色 */
border-bottom: 100px solid #2FB15B;
}
}
&.refuse {
.triangle-right {
/* 左边框设置为与文本相同的颜色 */
border-bottom: 100px solid #FF759F;
}
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,245 @@
<template>
<view class="stu-punishment">
<view class="search">
<view class="input">
<image src="../../static/search.png" mode="widthFix"></image>
<input type="text" placeholder="输入学生姓名/学号进行搜索"/>
</view>
<view class="icon" @tap="addPunishment">
<image src="/static/add_punishment.png" mode="aspectFit"></image>
</view>
</view>
<view class="body">
<view class="list">
<view class="item" v-for="(item,index) in punishmentList" :key="index">
<view class="title">
<text class="name">{{item.stuName}}</text>
<view class="lifting">
<text v-if="item.penaltyType==0">处分已解除</text>
<text v-if="item.penaltyType==1">处分申请中</text>
<text v-if="item.penaltyType==2||item.penaltyType==4">处分申请中</text>
<text v-if="item.penaltyType==3">处分已解除</text>
</view>
</view>
<view class="number">
<text>学号:</text>
<text>{{item.stuNo}}</text>
</view>
<view class="number-1">
<text>班级:</text>
<text>{{item.className}}</text>
</view>
<view class="grade">
<view class="left">
<text>处分等级:</text>
<text v-if="item.penaltyType==0">警告</text>
<text v-if="item.penaltyType==1">严重警告</text>
<text v-if="item.penaltyType==2">记过</text>
<text v-if="item.penaltyType==3">留校察看</text>
</view>
<view class="right">
<image src="/static/detail-icon.png" mode=""></image>
<text>详情</text>
</view>
</view>
<view class="time">
<text>提交时间:</text>
<text>{{item.createTime}}</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
list
} from "@/api/applyrelieve/applyrelieve.js";
export default {
data() {
return {
punishmentList: [],
pageNum: 1,
pageSize: 10
}
},
onShow() {
this.getPunishmentList();
},
methods: {
getPunishmentList() {
list({pageNum:this.pageNum,pageSize:this.pageSize}).then(res => {
console.log(res);
this.punishmentList = res.rows;
})
},
addPunishment(){
uni.navigateTo({
url:"/pages/applyrelieve/add-punishment"
})
}
}
}
</script>
<style scoped lang="scss">
.stu-punishment {
.search {
background-color: #258FE4;
height: 170rpx;
display: flex;
align-items: center;
justify-content: space-around;
padding: 0 10px;
.input {
display: flex;
align-items: center;
background-color: #ffffff;
height: 76rpx;
flex: 1;
margin: 0 30px 0 15px;
border-radius: 50px;
image {
width: 30rpx;
height: 36rpx;
margin: 0 20px;
}
input {
font-size: 28rpx;
line-height: 40px;
color: #dedede;
width: 100%;
}
}
.icon {
background-color: #ffffff;
width: 75rpx;
height: 75rpx;
border-radius: 8px;
display: flex;
justify-content: center;
align-items: center;
image {
width: 34rpx;
height: 38rpx;
}
}
}
.body {
background-color: #F5F5F7;
padding: 10px;
.list {
.item {
background-color: #ffffff;
border-radius: 10px;
margin: 20px;
padding: 15px;
.title {
display: flex;
justify-content: space-between;
padding-bottom: 10px;
.name {
font-size: 36rpx;
font-weight: bold;
}
.lifting {
display: flex;
justify-content: center;
align-items: center;
background-color: #e3f9ed;
// width: 100rpx;
padding: 0 5px;
height: 48rpx;
border-radius: 5px;
border: 1px solid #71E2A3;
text {
color: #71E2A3;
font-size: 24rpx;
}
}
}
.number {
font-size: 28rpx;
padding-bottom: 10px;
text:nth-child(1) {
color: #9C9C9C;
}
text:nth-child(2) {
margin-left: 10px;
color: #202020;
}
}
.number-1 {
font-size: 28rpx;
padding-bottom: 10px;
text:nth-child(1) {
color: #9C9C9C;
}
text:nth-child(2) {
margin-left: 10px;
color: #202020;
}
}
.grade {
display: flex;
font-size: 28rpx;
justify-content: space-between;
.left {
text:nth-child(1) {
color: #9C9C9C;
}
text:nth-child(2) {
color: #E80000;
margin-left: 10px;
}
}
.right {
display: flex;
align-items: center;
image {
width: 28rpx;
height: 28rpx;
margin-right: 3px;
}
text {
color: #258FE4;
}
}
}
.time{
margin-top:10px;
color: gray;
}
}
}
}
}
</style>