移动端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,409 @@
<template>
<view class="add" v-if="teststate">
<view class="form-item">
<label><text class="tip">*</text>学年</label>
<picker :value="stuYearListIndex" :range="stu_year_list" :range-key="'stuYearName'" @change="onPoliticsChange">
<view class="uni-input">
<text class="val">{{stuYearListIndex<0?'请选择学年':stu_year_list[stuYearListIndex].stuYearName}}</text>
<uni-icons type="down" size="16" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label><text class="tip">*</text>加分项</label>
<picker :range="child_list" :value="childListIndex" :range-key="'ruleName'" @change="onSecondClassAchievementChange">
<view class="uni-input">
<text class="val">{{childListIndex<0?'请选择加分项':child_list[childListIndex].ruleName}}</text>
<uni-icons type="down" size="16" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label><text class="tip">*</text>分值</label>
<input disabled="" type="text" v-model="iam_add_record" placeholder="0" />
</view>
<view class="form-item">
<view class="content">
<label><text class="tip">*</text>佐证资料</label>
<view class="upload-img" v-if="tempSceneImgs.length==0" @tap="uploadSceneImg">
<view class="">
+ 添加照片
</view>
<view class="tip">
图片要求大小不超过<text style="color: red;"> 0.5MB </text>格式为<text style="color: red;">png/jpg/jpeg</text> 的文件
</view>
</view>
<view class="img-list" v-else
>
<view class="imgs">
<view class="img" v-for="(img,index) in tempSceneImgs">
<image :src="img.path" @tap="previewImg(tempSceneImgs)" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveSceneImg(index,img.path)">X</text>
</view>
</view>
<view class="btn" @tap="uploadSceneImg">
+ 添加照片
</view>
</view>
</view>
</view>
<view class="form-item">
<label><text class="tip">*</text>备注</label>
<input type="text" v-model="valiFormData.description" placeholder="请输入内容" />
</view>
<view class="btns">
<button @click="onSubmit" :disabled="isSubmitting">提交</button>
</view>
</view>
</template>
<script>
import {
validateFormFields
} from "@/utils/validateForm.js"
import {
listEnableYear,listIamChild,stuAdd
} from '@/api/comprehensive/student.js';
import {
uploadImg,
previewImg,
removeImg
} from "@/utils/uploadImg.js"
import {
baseUrl
} from "@/config.js";
export default {
data() {
return {
isSubmitting: false, //表单提交标志位
// 校验表单数据
valiFormData: {
stuYearId: '',
material: '',
description: '',
ruleId: '',
},
stuYearListIndex: -1, // 当前选中的政治面貌索引
childListIndex: -1, // 当前选中的学年索引
stu_year_list:[],
teststate:false,
child_list:[],
iam_add_record:0,
rwPicture: "",
tempSceneImgs: [],
}
},
onLoad() {
this.getStuYear()
this.listIamChild()
},
methods: {
//选择学年
onSecondClassAchievementChange(e) {
this.childListIndex = e.detail.value;
this.valiFormData.ruleId = this.child_list[this.childListIndex].ruleId;
this.iam_add_record=this.child_list[this.childListIndex].maxScore;
},
//选择加分项
onPoliticsChange(e) {
this.stuYearListIndex = e.detail.value;
this.valiFormData.stuYearId = this.stu_year_list[this.stuYearListIndex].id;
},
onSubmit() {
const requiredFields = [
'stuYearId',
'material',
'description',
'ruleId',
];
this.valiFormData.material=this.rwPicture
console.log(this.valiFormData)
if (!validateFormFields(requiredFields, this.valiFormData)) {
return;
}
this.isSubmitting = true; // 设置为正在提交
uni.showLoading({
title: "正在提交",
success: () => {
stuAdd(this.valiFormData).then(res => {
if (res.code == 200) {
uni.showToast({
title: "申请成功"
})
this.isSubmitting = false;
uni.navigateBack();
}
})
}
})
},
async getStuYear() {
let res = await listEnableYear();
this.stu_year_list = [...res.rows];
console.log( this.stu_year_list)
this.teststate=true
// this.iamForm.stuYearId = res.rows[0].id;
},
async listIamChild() {
this.child_list = [];
let res = await listIamChild();
console.log(res)
let temp = [...res.data];
temp.map(x => {
if (x.maxScore >= 0) {
this.child_list.push(x);
}
})
console.log(this.child_list)
},
uploadSceneImg() {
uploadImg('/common/upload', this.rwPicture, this.tempSceneImgs, baseUrl, (error, result) => {
if (!error) {
this.rwPicture = result.photo
// console.log(result)
}
});
},
previewImg(imgs) {
console.log(imgs)
previewImg(imgs);
},
onRemoveSceneImg(index, path) {
for (var i = 0; i < this.tempSceneImgs.length; i++) {
console.log("tempSceneImgs:"+this.tempSceneImgs[i])
}
removeImg(index, path, this.rwPicture, this.tempSceneImgs, baseUrl, (error, result) => {
if (!error) {
this.rwPicture = result.photo
// this.submitlist.rtFuResourceList.splice(index, 1);
}
});
},
}
}
</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;
}
}
textarea {
border: 1px solid #E1E1E1;
border-radius: 10rpx;
width: 100%;
height: 200rpx;
padding: 30rpx;
.input-placeholder {
color: #b6b6b6;
}
}
picker {
border: 1px solid #E1E1E1;
height: 70rpx;
line-height: 70rpx;
padding: 0 30rpx;
text {
color: #b6b6b6;
}
.uni-input {
display: flex;
color: #797979;
.val {
flex: 1;
}
}
}
.content {
background-color: white;
border-radius: 16rpx;
width: 90vw;
&>view:nth-child(-n+3) {
margin: 40rpx 40rpx;
}
.title {
padding: 40rpx 0 20rpx;
display: flex;
justify-content: center;
font-size: 38rpx;
font-weight: 550;
}
.tip {
color: red;
}
.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;
}
}
}
.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;
&[disabled] {
opacity: 0.5;
}
}
}
}
</style>

View File

@@ -0,0 +1,438 @@
<template>
<view class="detail" >
<view class="form-item">
<label><text class="tip">*</text>学年</label>
<picker :value="stuYearListIndex" :range="stu_year_list" :range-key="'stuYearName'" @change="onPoliticsChange">
<view class="uni-input">
<text class="val">{{stuYearListIndex<0?DefaultYear:stu_year_list[stuYearListIndex].stuYearName}}</text>
<uni-icons type="down" size="16" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label><text class="tip">*</text>加分项</label>
<picker :range="child_list" :value="childListIndex" :range-key="'ruleName'" @change="onSecondClassAchievementChange">
<view class="uni-input">
<text class="val">{{childListIndex<0?Defaultchild:child_list[childListIndex].ruleName}}</text>
<uni-icons type="down" size="16" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label><text class="tip">*</text>分值</label>
<input disabled="" type="text" v-model="iam_add_record" placeholder="0" />
</view>
<view class="form-item">
<view class="content">
<label><text class="tip">*</text>佐证资料</label>
<!-- <view class="upload-img" v-if="tempSceneImgs.length==0" >
<view class="">
+ 添加照片
</view>
<view class="tip">
图片要求大小不超过<text style="color: red;"> 0.5MB </text>格式为<text style="color: red;">png/jpg/jpeg</text> 的文件
</view>
</view> -->
<view class="img-list"
>
<view class="imgs">
<view class="img" v-for="(img,index) in tempSceneImgs">
<image :src="img.path" @tap="previewImg(tempSceneImgs)" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveSceneImg(index,img)">X</text>
</view>
</view>
<view v-if="detail.auditStatus==10" @tap="uploadSceneImg" class="btn">
+ 添加照片
</view>
</view>
</view>
</view>
<view class="form-item">
<label><text class="tip">*</text>备注</label>
<input type="text" v-model="valiFormData.description" placeholder="请输入内容" />
</view>
<view class="form-item" v-if="detail.auditStatus==10||detail.auditStatus==11">
<label><text class="tip">*</text>未通过原因</label>
<input type="text" disabled v-model="detail.remarks" placeholder="请输入内容" />
</view>
<view class="btns" v-if="detail.auditStatus==10">
<button @click="resubmitIamForm" :disabled="isSubmitting">重新提交</button>
</view>
</view>
</template>
<script>
import {
validateFormFields
} from "@/utils/validateForm.js"
import {
listEnableYear,listIamChild,stuAdd,reSub
} from '@/api/comprehensive/student.js';
import {
uploadImg,
previewImg,
removeImg
} from "@/utils/uploadImg.js"
import {
baseUrl
} from "@/config.js";
export default {
data() {
return {
isSubmitting: false, //表单提交标志位
// 校验表单数据
valiFormData: {
iamId:'',
stuYearId: '',
material: '',
description: '',
ruleId: '',
},
stuYearListIndex: -1, // 当前选中的政治面貌索引
childListIndex: -1, // 当前选中的学年索引
stu_year_list:[],
teststate:false,
child_list:[],
iam_add_record:0,
rwPicture: "",
tempSceneImgs: [],
detail:[],
baseUrl:baseUrl,
DefaultYear:'',
Defaultchild:'',
}
},
onLoad(option) {
var arr = JSON.parse(option.item)
this.detail=JSON.parse(option.item)
this.valiFormData.iamId=arr.id
this.valiFormData.stuYearId=arr.stuYearId
this.valiFormData.material=arr.material
this.valiFormData.ruleId=arr.ruleId
this.valiFormData.description=arr.description
this.DefaultYear=arr.stuYearName
this.Defaultchild=arr.ruleName
this.iam_add_record=arr.operateScore
this.rwPicture=arr.material
console.log(this.detail)
var arr1 = arr.material.split(",")
for (var i = 0; i < arr1.length; i++) {
var obj={}
obj.path=baseUrl+arr1[i]
this.tempSceneImgs.push(obj)
}
console.log(this.tempSceneImgs)
this.getStuYear()
this.listIamChild()
},
methods: {
//选择学年
onSecondClassAchievementChange(e) {
this.childListIndex = e.detail.value;
this.valiFormData.ruleId = this.child_list[this.childListIndex].ruleId;
this.iam_add_record=this.child_list[this.childListIndex].maxScore;
},
//选择加分项
onPoliticsChange(e) {
this.stuYearListIndex = e.detail.value;
this.valiFormData.stuYearId = this.stu_year_list[this.stuYearListIndex].id;
},
resubmitIamForm() {
const requiredFields = [
'iamId',
'stuYearId',
'material',
'description',
'ruleId',
];
this.valiFormData.material=this.rwPicture
if(this.stuYearListIndex<0){
this.valiFormData.stuYearId=this.detail.stuYearId
}
if(this.childListIndex<0){
this.valiFormData.ruleId=this.detail.ruleId
}
console.log(this.valiFormData)
if (!validateFormFields(requiredFields, this.valiFormData)) {
return;
}
this.isSubmitting = true; // 设置为正在提交
uni.showLoading({
title: "正在提交",
success: () => {
reSub(this.valiFormData).then(res => {
if (res.code == 200) {
uni.showToast({
title: "重新提交成功"
})
this.isSubmitting = false;
uni.navigateBack();
}
})
}
})
},
async getStuYear() {
let res = await listEnableYear();
this.stu_year_list = [...res.rows];
console.log( this.stu_year_list)
this.teststate=true
// this.iamForm.stuYearId = res.rows[0].id;
},
async listIamChild() {
this.child_list = [];
let res = await listIamChild();
console.log(res)
let temp = [...res.data];
temp.map(x => {
if (x.maxScore >= 0) {
this.child_list.push(x);
}
})
},
uploadSceneImg() {
uploadImg('/common/upload', this.rwPicture, this.tempSceneImgs, baseUrl, (error, result) => {
if (!error) {
this.rwPicture = result.photo
}
});
},
previewImg(imgs) {
previewImg(imgs);
},
onRemoveSceneImg(index, path) {
removeImg(index, path, this.rwPicture, this.tempSceneImgs, baseUrl, (error, result) => {
if (!error) {
this.rwPicture = result.photo
}
});
},
}
}
</script>
<style scoped lang="scss">
.detail {
background-color: #F5F5F7;
padding: 10px;
padding-bottom: 80px;
min-height: 98vh;
.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;
}
}
textarea {
border: 1px solid #E1E1E1;
border-radius: 10rpx;
width: 100%;
height: 200rpx;
padding: 30rpx;
.input-placeholder {
color: #b6b6b6;
}
}
picker {
border: 1px solid #E1E1E1;
height: 70rpx;
line-height: 70rpx;
padding: 0 30rpx;
text {
color: #b6b6b6;
}
.uni-input {
display: flex;
color: #797979;
.val {
flex: 1;
}
}
}
.content {
background-color: white;
border-radius: 16rpx;
width: 90vw;
&>view:nth-child(-n+3) {
margin: 40rpx 40rpx;
}
.title {
padding: 40rpx 0 20rpx;
display: flex;
justify-content: center;
font-size: 38rpx;
font-weight: 550;
}
.tip {
color: red;
}
.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;
}
}
}
.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;
&[disabled] {
opacity: 0.5;
}
}
}
}
</style>

View File

@@ -0,0 +1,261 @@
<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,index) in stuPunishmentList" :key="index">
<view class="top">
<view>
姓名:{{item.stuName}}
</view>
<view style="background-color: aqua;">
<DictStatus :types="audius_detail_type" :type="item.auditStatus" />
</view>
<!-- <DictType :types="rt_penalty_status" :type="item.penaltyStatus" /> -->
<!-- <uni-icons type="right" size="18" color="#202020"></uni-icons> -->
</view>
<view class="content">
<view>项目大类{{item.projectName}}</view>
<view>项目子类{{item.ruleName}}</view>
<view>分数{{item.operateScore > 0 ? "+" + item.operateScore.toString() : item.operateScore}}</view>
<view>班级{{item.className}}</view>
<view>提交时间{{item.submitTime}}</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 {
listOwnApply,
} from '@/api/comprehensive/student.js';
import DictStatus from "@/components/comprehensive-dict-type/dict-type.vue"
import {
getDicts,
} from '@/api/system/dict/data.js';
export default {
components: {
DictStatus
},
data() {
return {
stuPunishmentList: [],
loading: false,
topLoading: true,
audius_detail_type: [],
rt_penalty_status: [],
queryParams: {
pageNum: 1,
pageSize: 10,
projectName: null,
submitterId: null,
submitterName: null,
reviewedById: null,
projectId: null,
projectTypeId: null,
statusCode: null,
remarks: null
},
}
},
onLoad(){
},
onShow() {
this.getList();
this.get_audius_detail_type();
},
methods: {
addDisciplinaryApplication(){
uni.navigateTo({
url:"./add"
})
},
scrolltolower() {
if (this.queryParams.pageNum < this.totalPages) {
this.queryParams.pageNum++;
this.loading = true;
setTimeout(() => {
this.getList()
}, 1000)
} else {
}
},
toDetail(item){
uni.navigateTo({
url:`./detail?item=`+JSON.stringify(item)
})
},
navChange(index){
this.stuPunishmentList=[];
this.topLoading=true;
this.queryParams={
pageNum: 1,
pageSize: 10,
penaltyStatus:index
};
this.getList();
},
async getList() {
let res = await listOwnApply(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;
}
console.log(res)
},
async get_audius_detail_type() {
let res = await getDicts('audius_detail_type');
this.audius_detail_type = 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;
&>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>