初始化

This commit is contained in:
2025-08-01 10:44:32 +08:00
commit cbb8dc2ba6
1083 changed files with 178320 additions and 0 deletions

View File

@@ -0,0 +1,334 @@
<template>
<view class="evidence-add">
<form>
<view class="form-item">
<label>担任职务</label>
<input type="text" v-model="formData.servingPost" placeholder="请输入" />
</view>
<view class="form-item">
<label>担任时间</label>
<picker @change="onChangeTime" mode="date" :value="formData.servingTime">
<view class="uni-input">
<text class="val">{{formData.servingTime}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>任命文件</label>
<view class="upload-file" v-if="tempfiles.length==0" @tap="onUploadFile">
<view class="add">
+ 添加文件
</view>
<view class="tip">
<view>文件大小:不超过 5MB</view>
<view>文件格式:doc/xls/ppt/txt/pdf/xlsx </view>
</view>
<view class="file-list">
<view class="item" v-for="(file,index) in tempfiles" :key="index">
<image src="../../../../../static/word_file.png" mode="widthFix"></image>
<view class="right">
<text>{{file.name}}</text>
<text>{{file.name}}</text>
</view>
</view>
</view>
</view>
<view class="file-list" v-else>
<view class="files">
<view class="item" v-for="(file,index) in tempfiles" :key="index">
<image src="../../../../../static/word_file.png" mode="widthFix"></image>
<view class="right">
<text>{{file.name}}</text>
<text>{{file.size}}k</text>
</view>
<view class="del" @tap="onDel(index)">
删除
</view>
</view>
</view>
<view v-if="tempfiles.length<3" class="btn" @tap="onUploadFile">
+ 添加文件
</view>
</view>
</view>
<button type="primary" :disabled="isSubmitting" class="submit-btn" @tap="onSubmit">提交</button>
</form>
</view>
</template>
<script>
import uploadFile from "@/plugins/upload.js";
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js"
import {
servingAdd,
} from '@/api/compositive-performance/holdAPost.js';
import {
baseUrl
} from "@/config.js";
export default {
data() {
return {
isSubmitting: false, //表单提交标志位
activityIndex: 0,
tempfiles: [],
formData: {
servingPost: "",
servingTime: getCurrentDateTime(),
fdName: uni.getStorageSync("stuName"),
years: "",
servingFile: "",
}
}
},
onLoad(option) {
this.formData.years = option.year;
},
methods: {
onChangeTime(e) {
this.formData.servingTime = e.detail.value;
},
onUploadFile() {
uni.chooseFile({
count: 3,
extension: ['.doc', '.xls', '.ppt', '.docx'],
success: (file) => {
console.log(file);
if (file.tempFiles.length > 0) {
const fileExtension = file.tempFiles[0].name.split('.').pop(); // 提取后缀名
const fileSizeKB = (file.tempFiles[0].size / 1024).toFixed(2);
this.tempfiles.push({
name: file.tempFiles[0].name,
extension: fileExtension,
size: fileSizeKB
})
}
uploadFile("/common/upload", file.tempFilePaths[0]).then((res) => {
let result = JSON.parse(res);
if (result.code == 200) {
uni.showToast({
title: "文件上传成功"
})
if (this.formData.servingFile !== "") {
this.formData.servingFile = this.formData.servingFile +
"," + result.fileName;
} else {
this.formData.servingFile = result.fileName;
}
}
})
}
})
},
onDel(index) {
uni.showModal({
title: "确定删除文件吗?",
success: (res) => {
if (res.confirm) {
this.tempfiles.splice(index, 1);
let newFiles = this.formData.servingFile.split(",");
newFiles.splice(index, 1)
this.formData.servingFile = newFiles.join(",")
}
}
})
},
async onSubmit() {
const requiredFields = [
"servingPost",
];
const emptyField = requiredFields.find(field => this.formData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写职务`,
icon: "none"
})
return;
}
this.isSubmitting=true;
let res = await servingAdd(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
.getMaterialsList ===
'function') {
prevPage.queryParams.pageNum = 1;
prevPage.getMaterialsList();
}
}
}
})
}, 1000)
} else {
uni.showToast({
title: res.msg
})
}
}
}
}
</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-file {
border: 1px solid #E1E1E1;
padding: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
.tip {
margin-top: 15rpx;
color: #202020;
opacity: 0.25;
font-size: 24rpx;
view {
margin-bottom: 8rpx;
}
}
}
.file-list {
border: 1px solid #D8D8D8;
border-radius: 20rpx;
.files {
.item {
display: flex;
padding: 40rpx 20rpx;
align-items: center;
&:not(:last-child) {
border-bottom: 1px solid #E1E1E1;
}
image {
width: 60rpx;
margin-right: 20rpx;
}
.right {
flex: 1;
display: flex;
flex-direction: column;
text:last-child {
color: #969696;
margin-top: 10rpx;
}
}
.del {
color: red;
}
}
.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,361 @@
<template>
<view class="evidence-add">
<form>
<view class="form-item">
<label>担任职务</label>
<input type="text" v-model="formData.servingPost" placeholder="请输入" />
</view>
<view class="form-item">
<label>担任时间</label>
<picker @change="onChangeTime" mode="date" :value="formData.servingTime">
<view class="uni-input">
<text class="val">{{formData.servingTime}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>任命文件</label>
<view class="upload-file" v-if="tempfiles.length==0" @tap="onUploadFile">
<view class="add">
+ 添加文件
</view>
<view class="tip">
<view>文件大小:不超过 5MB</view>
<view>文件格式:doc/xls/ppt/txt/pdf/xlsx </view>
</view>
<view class="file-list">
<view class="item" v-for="(file,index) in tempfiles" :key="index">
<image src="../../../../../static/word_file.png" mode="widthFix"></image>
<view class="right">
<text>{{file.name}}</text>
<text>{{file.name}}</text>
</view>
</view>
</view>
</view>
<view class="file-list" v-else>
<view class="files">
<view class="item" v-for="(file,index) in tempfiles" :key="index">
<image src="../../../../../static/word_file.png" mode="widthFix"></image>
<view class="right">
<text>{{file.name}}</text>
<text v-if="file.size">{{file.size}}k</text>
</view>
<view class="del" @tap="onDel(index)">
删除
</view>
</view>
</view>
<view v-if="tempfiles.length<3" class="btn" @tap="onUploadFile">
+ 添加文件
</view>
</view>
</view>
<button v-if="substatus!=1" :disabled="isSubmitting" type="primary" class="submit-btn" @tap="onEdit">保存修改</button>
</form>
</view>
</template>
<script>
import uploadFile from "@/plugins/upload.js";
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js"
import {
servingDetail,
servingUpdate
} from '@/api/compositive-performance/holdAPost.js';
import {
baseUrl
} from "@/config.js";
export default {
data() {
return {
isSubmitting: false, //表单提交标志位
activityIndex: 0,
substatus:"",
tempfiles: [],
formData: {
servingPost: "",
servingTime: getCurrentDateTime(),
fdName: uni.getStorageSync("stuName"),
years: "",
servingFile: "",
}
}
},
onLoad(option) {
this.formData.years = option.year;
this.id = option.id;
this.substatus=option.substatus;
this.getDetails();
},
methods: {
async getDetails() {
let result = await servingDetail(this.id);
console.log(result);
this.formData = result.data;
if (result.data.servingFile != "") {
let files = result.data.servingFile.split(",")
console.log(files);
files.forEach(file => {
const fileExtension = file.split('.').pop(); // 提取后缀名
this.tempfiles.push({
name: file,
extension: fileExtension,
})
})
console.log(this.tempfiles);
}
},
onChangeTime(e) {
this.formData.servingTime = e.detail.value;
},
onUploadFile() {
uni.chooseFile({
count: 3,
extension: ['.doc', '.xls', '.xlsx', '.ppt', '.docx', '.txt', '.pdf'],
success: (file) => {
console.log(file);
if (file.tempFiles.length > 0) {
const fileExtension = file.tempFiles[0].name.split('.').pop(); // 提取后缀名
const fileSizeKB = (file.tempFiles[0].size / 1024).toFixed(2);
this.tempfiles.push({
name: file.tempFiles[0].name,
extension: fileExtension,
size: fileSizeKB
})
}
uploadFile("/common/upload", file.tempFilePaths[0]).then((res) => {
let result = JSON.parse(res);
if (result.code == 200) {
uni.showToast({
title: "文件上传成功"
})
if (this.formData.servingFile !== "") {
this.formData.servingFile = this.formData.servingFile +
"," + result.fileName;
} else {
this.formData.servingFile = result.fileName;
}
}
})
}
})
},
onDel(index) {
uni.showModal({
title: "确定删除文件吗?",
success: (res) => {
if (res.confirm) {
this.tempfiles.splice(index, 1);
let newFiles = this.formData.servingFile.split(",");
newFiles.splice(index, 1)
this.formData.servingFile = newFiles.join(",")
}
}
})
},
async onEdit() {
const requiredFields = [
"servingPost",
];
const emptyField = requiredFields.find(field => this.formData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写职务`,
icon: "none"
})
return;
}
this.isSubmitting=true;
let res = await servingUpdate(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
.getMaterialsList ===
'function') {
prevPage.queryParams.pageNum = 1;
prevPage.getMaterialsList();
}
}
}
})
}, 1000)
} else {
uni.showToast({
title: res.msg
})
}
},
}
}
</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-file {
border: 1px solid #E1E1E1;
padding: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
.tip {
margin-top: 15rpx;
color: #202020;
opacity: 0.25;
font-size: 24rpx;
view {
margin-bottom: 8rpx;
}
}
}
.file-list {
border: 1px solid #D8D8D8;
border-radius: 20rpx;
.files {
.item {
display: flex;
padding: 40rpx 20rpx;
align-items: center;
&:not(:last-child) {
border-bottom: 1px solid #E1E1E1;
}
image {
width: 60rpx;
margin-right: 20rpx;
}
.right {
flex: 1;
margin-right: 30rpx;
display: flex;
flex-direction: column;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text:last-child {
color: #969696;
margin-top: 10rpx;
}
}
.del {
color: red;
}
}
.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,229 @@
<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.servingPost"></text>
</view>
<uni-icons type="right" size="16" color="#202020"></uni-icons>
</view>
<view class="content">
<view>任职人{{item.fdName}}</view>
<view class="time">担任时间 : {{item.servingTime}}</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="substatus!=1">
+
</view>
</view>
</template>
<script>
import {
servingList,
servingDel
} from '@/api/compositive-performance/holdAPost.js';
export default {
data() {
return {
actionOptions: [{
text: '删除',
style: {
width: "200px",
backgroundColor: '#df0000'
}
}],
list: [],
totalPages: 0,
loading: false,
substatus: "",
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
fdName: uni.getStorageSync("stuName"),
years: "",
},
}
},
onLoad(option) {
this.queryParams.years = option.year;
this.sucesss = option.sucesss;
this.substatus = option.substatus;
this.getMaterialsList();
},
methods: {
scrolltolower() {
if (this.queryParams.pageNum < this.totalPages) {
this.queryParams.pageNum++;
this.loading = true;
setTimeout(() => {
this.getClassMeetingMaterialsList()
}, 1000)
} else {
}
},
addEvidence() {
uni.navigateTo({
url: `add?year=${this.queryParams.years}&sucesss=${this.sucesss}`
})
},
toDetail(id) {
uni.navigateTo({
url: `detail?id=${id}&substatus=${this.substatus}`
})
},
getMaterialsList() {
servingList(this.queryParams).then(res => {
this.loading = false;
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);
});
},
onDel(id) {
console.log(id);
uni.showModal({
title: "确定删除吗?",
success: (res) => {
if (res.confirm) {
servingDel(id).then(res => {
if (res.code == 200) {
uni.showToast({
title: "删除成功"
})
this.getMaterialsList();
}
})
}
}
})
}
}
}
</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 {
margin-bottom: 20rpx;
}
.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,567 @@
<template>
<view class="filling-record">
<view class="tabs">
<view class="left">
<picker range-key="dictValue" :value="yearIndex" :range="years" @change="onChangeTime" name="year">
<view class="uni-input">
<text class="val">{{timeText}}</text>
<uni-icons type="down" size="16" color="#1890FF"></uni-icons>
</view>
</picker>
</view>
<view class="right">
<picker :range="statusList" @change="onChangeStatus">
<view class="uni-input">
<text class="val">{{statusText}}</text>
<uni-icons type="down" size="16" color="#1890FF"></uni-icons>
</view>
</picker>
</view>
</view>
<scroll-view scroll-y="true" @scrolltolower="scrolltolower">
<view class="list">
<view class="item" @tap="toPersonalReportingPage(item)" v-for="item in FillingList" :key="item.id">
<view class="top">
填报人:{{item.fdName}}
<uni-icons type="right" size="18" color="#202020"></uni-icons>
</view>
<view class="content">
<view>填报年份{{item.years}}</view>
<view>填报时间{{item.fdTime}}</view>
<view>提交状态{{item.substatus|formateCommitStatus}}</view>
<view class="status submit" v-if="(item.substatus==0||item.substatus==null)&&item.shstatus!=2">
<text class="status-text">填报中</text>
<view class="triangle-right"></view>
</view>
<view class="status agree" v-else-if="item.xwstatus == 1 && item.yjstatus == 1
&& item.ksstatus == 1 && item.xgstatus == 1 ">
<text class="status-text">通过</text>
<view class="triangle-right"></view>
</view>
<view @tap.stop="showRefuseModal(item)" class="status refuse" v-else-if="item.shstatus==2&&item.substatus==0">
<text class="status-text">不通过</text>
<view class="triangle-right"></view>
</view>
<view class="status submit" v-else>
<text class="status-text">待审核</text>
<view class="triangle-right"></view>
</view>
<!-- <view class="status submit"
v-else-if="item.xwstatus==0||item.xwstatus==null||item.xwstatus == 1 && (item.yjstatus == 0 || item.yjstatus == null)||item.yjstatus == 1 && (item.ksstatus == 0 || item.ksstatus == null)||item.ksstatus == 1 && (item.xgstatus == 0 || item.xgstatus == null)">
<text class="status-text">待审核</text>
<view class="triangle-right"></view>
</view> -->
</view>
</view>
</view>
<view class="empty" v-if="FillingList.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&&FillingList.length!=0">
到底啦~~
</view>
</scroll-view>
<view class="add" @click="addRecordsPopup">
+
</view>
<uni-popup @change="popupChange" ref="popupTime" class="popup-time" background-color="#ffffff">
<view class="popup-content">
<view class="title">
填报时间
</view>
<form @submit="topersonalReporting">
<view class="form-item">
<label>填报年份</label>
<picker v-if="years.length>0" range-key="dictValue" :value="yearIndex" :range="years"
@change="yearChange" name="year">
<view class="uni-input">
<text class="val">{{years[yearIndex].dictValue}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="btns">
<button type="default" @tap="onCancel">取消</button>
<button form-type="submit" type="primary">确定</button>
</view>
</form>
</view>
</uni-popup>
</view>
</template>
<script>
import {
getDicts
} from "@/api/system/dict/data.js"
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js"
import {
performanceList,
performanceAdd
} from '@/api/compositive-performance/index.js';
export default {
data() {
return {
topLoading: true,
loading: false,
type: 'center',
years: [],
yearIndex: 0,
monthIndex: 0,
statusText: "审核状态",
statusList: ["全部", "待审核", "审核通过", "不通过"],
timeText: "全部",
timeList: ["2024年", "2025年"],
FillingList: [], //填报列表
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
years: "",
fdName: uni.getStorageSync("stuName")
},
}
},
filters: {
formateCommitStatus(val) {
if (val == 0 || val == null) {
return "填报中";
} else if (val == 1) {
return "已提交";
}
}
},
onShow() {
this.getPerformanceList();
},
onLoad() {
this.getYears();
},
methods: {
popupChange(e) {
if (e.show) {
this.years.shift();
} else {
this.years.unshift({
dictValue: "全部"
})
}
},
scrolltolower() {
if (this.queryParams.pageNum < this.totalPages) {
this.queryParams.pageNum++;
this.loading = true;
setTimeout(() => {
this.getPerformanceList()
}, 1000)
} else {
}
},
async getPerformanceList() {
let res = await performanceList(this.queryParams);
if (res.code == 200) {
this.loading = false;
if (this.queryParams.pageNum == 1) {
this.FillingList = res.rows; // 如果是第一页,直接显示新数据
} else {
this.FillingList = this.FillingList.concat(res.rows); // 否则追加新数据到列表中
}
this.totalPages = Math.ceil(res.total / this.queryParams.pageSize);
this.topLoading = false;
// //计算填报进度值
// this.FillingList.forEach((progress, index) => {
// this.FillingList[index].fillProgress = 0;
// if (progress.activeList.length > 0) {
// this.FillingList[index].fillProgress = Number(this.FillingList[index]
// .fillProgress) + 20;
// }
// if (progress.passList.length > 0) {
// this.FillingList[index].fillProgress = Number(this.FillingList[index]
// .fillProgress) + 20;
// }
// if (progress.rwList.length > 0) {
// this.FillingList[index].fillProgress = Number(this.FillingList[index]
// .fillProgress) + 20;
// }
// if (progress.servingList.length > 0) {
// this.FillingList[index].fillProgress = Number(this.FillingList[index]
// .fillProgress) + 20;
// }
// if (progress.taskList.length > 0) {
// this.FillingList[index].fillProgress = Number(this.FillingList[index]
// .fillProgress) + 20;
// }
// })
}
},
yearChange(e) {
this.yearIndex = e.detail.value;
},
onChangeTime(e) {
this.topLoading = true;
this.FillingList = [];
this.timeText = this.years[e.detail.value].dictValue;
if (this.timeText == "全部") {
this.queryParams.years = "";
} else {
this.queryParams.years = this.timeText;
}
this.queryParams.pageNum = 1;
setTimeout(() => {
this.getPerformanceList();
}, 500)
},
onChangeStatus(e) {
this.topLoading = true;
this.FillingList = [];
let index = e.detail.value;
let auditStatus;
if (index == 0) {
this.queryParams.xwstatus = "";
this.queryParams.yjstatus = "";
this.queryParams.ksstatus = "";
this.queryParams.xgstatus = "";
this.queryParams.shstatus = "";
} else if (index == 1) {
this.queryParams.shstatus = 0;
} else if (index == 2) {
this.queryParams.shstatus = 1;
} else {
// 获取审核不通过的数据
this.queryParams.shstatus = 2;
}
this.statusText = this.statusList[index];
this.queryParams.pageNum = 1;
setTimeout(() => {
this.getPerformanceList();
}, 500)
},
addRecordsPopup() {
this.$refs.popupTime.open(this.type);
},
async topersonalReporting(e) {
this.$refs.popupTime.close();
let year = this.years[(e.detail.value.year) + 1].dictValue;
let formData = {
fdTime: getCurrentDateTime(),
shstatus: 0,
years: year,
}
let res = await performanceAdd(formData);
if (res.code == 200) {
const searchParams = new URLSearchParams({
year: year,
id: res.data.id
});
uni.navigateTo({
url: `./personal-reporting?${searchParams.toString()}`
})
}
},
toPersonalReportingPage(params) {
const searchParams = new URLSearchParams({
id: params.id,
year: params.years,
substatus: params.substatus
});
uni.navigateTo({
url: `./personal-reporting?${searchParams.toString()}`
})
},
onCancel() {
this.$refs.popupTime.close();
},
async getYears() {
let years = await getDicts("sys_teacher_kpi_filling_year");
this.years = years.data;
this.years.unshift({
dictValue: "全部"
})
},
//驳回弹窗
showRefuseModal(item) {
let refuseTxt = "";
let title = "";
if (item.xwstatus == 2) {
title = "学务";
refuseTxt = item.xwidea
}
if (item.yjstatus == 2) {
title = "书记";
refuseTxt = item.yjidea
}
if (item.ksstatus == 2) {
title = "科室";
refuseTxt = item.ksidea
}
if (item.xgstatus == 2) {
title = "学工处长";
refuseTxt = item.xgidea
}
uni.showModal({
title: title + "驳回意见",
content: refuseTxt,
confirmText: "去修改",
success: (bool) => {
if (bool.confirm) {
const searchParams = new URLSearchParams({
id: item.id,
year: item.years,
substatus: item.substatus
});
uni.navigateTo({
url: `./personal-reporting?${searchParams.toString()}`
})
}
}
})
}
}
}
</script>
<style scoped lang="scss">
.empty {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 200rpx;
color: #9E9E9E;
font-size: 36rpx;
image {
width: 250rpx;
margin-bottom: 50rpx;
}
}
.filling-record {
background-color: #F5F5F7;
min-height: 100vh;
.tabs {
position: fixed;
left: 0;
right: 0;
display: flex;
background-color: white;
z-index: 2;
color: #1890FF;
box-shadow: 1px 1px 2px #999;
height: 90rpx;
line-height: 90rpx;
padding: 20rpx 0;
&>view {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
&:first-child {
border-right: 1.4px solid #1890FF;
}
}
}
scroll-view {
height: calc(100vh - 10px);
.no-more {
text-align: center;
color: gray;
padding-bottom: 10px;
}
}
.list {
padding: 120rpx 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;
&>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;
}
.popup-time {
width: 80%;
.popup-content {
width: 450rpx;
height: 400rpx;
padding: 40rpx 0rpx 40rpx;
.title {
text-align: center;
padding-bottom: 20rpx;
font-weight: bold;
font-size: 32rpx;
color: #3D3D3D;
border-bottom: 1px solid #F5F5F7;
}
.form-item {
width: 100%;
margin-top: 50rpx;
padding: 0 40rpx;
label {
font-weight: bold;
color: #202020;
}
picker {
margin-top: 20rpx;
border: 1px solid #E1E1E1;
height: 72rpx;
line-height: 72rpx;
padding-left: 8px;
border-radius: 10rpx;
.uni-input {
display: flex;
color: #202020;
.val {
flex: 1;
}
.uni-icons {
margin: 0 20rpx;
opacity: 0.5;
}
}
}
}
.btns {
display: flex;
margin-top: 50rpx;
position: absolute;
bottom: 0;
left: 0;
right: 0;
button {
flex: 1;
border-radius: 0;
height: 80rpx;
line-height: 80rpx;
&:first-child {
background-color: #ffffff;
border-top: 1px solid #F5F5F7;
}
&:last-child {
background-color: #258FE4;
border-top: 1px solid #258FE4;
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,387 @@
<template>
<view class="evidence-add">
<form>
<view class="form-item">
<label>活动类型</label>
<picker v-if="activityTypes.length>0" :value="activityIndex" :range="activityTypes"
@change="activityChangenge">
<view class="uni-input">
<text class="val">{{activityTypes[activityIndex]}}</text>
<uni-icons type="down" size="16" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>开展时间</label>
<picker @change="onChangeTime" mode="date" :value="formData.gzsTime">
<view class="uni-input">
<text class="val">{{formData.gzsTime}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item" v-for="(item,index) in inputArray" :key="index">
<label>{{item.text}}</label>
<textarea v-if="item.textarea" v-model="formData[item.val]" placeholder="请输入"></textarea>
<input v-else-if="item.isNum" v-model="formData[item.val]" type="number" placeholder="请输入" />
<input v-else v-model="formData[item.val]" type="text" placeholder="请输入" />
</view>
<view class="form-item">
<label>现场照片</label>
<view class="upload-img" v-if="tempSceneImgs.length==0" @tap="uploadSceneImg">
<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 tempSceneImgs">
<image @tap="previewImg(tempSceneImgs)" :src="img.path" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveSceneImg(index,img.path)">X</text>
</view>
</view>
<view v-if="tempSceneImgs.length<3" class="btn" @tap="uploadSceneImg">
+ 添加照片
</view>
</view>
</view>
<view class="form-item">
<label>新闻照片</label>
<view class="upload-img" v-if="tempNewsImgs.length==0" @tap="uploadNewsImg">
<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 tempNewsImgs">
<text>{{img.path}}</text>
<image @tap="previewImg(tempNewsImgs)" :src="img.path" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveNewsImg(index,img.path)">X</text>
</view>
</view>
<view v-if="tempNewsImgs.length<3" class="btn" @tap="uploadNewsImg">
+ 添加照片
</view>
</view>
</view>
<button type="primary" class="submit-btn" :disabled="isSubmitting" @tap="onSubmit">提交</button>
</form>
</view>
</template>
<script>
import {
uploadImg,
previewImg,
removeImg
} from "@/utils/uploadImg.js"
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js"
import {
instructorJobPerformanceAdd,
} from '@/api/compositive-performance/instructorJobPerformance.js';
import {
baseUrl
} from "@/config.js";
export default {
data() {
return {
isSubmitting: false, //表单提交标志位
activityTypes: ["沙龙", "研讨", "服务", "训练营", "其他"],
inputArray: [{
text: "地点",
val: "gzsPlace",
isNum: false
},
{
text: "参与领导",
val: "gzsParticipate"
},
{
text: "参与辅导员",
val: "gzsFdy"
},
{
text: "参与学生人数",
val: "gzsStu",
isNum: true
},
{
text: "活动主题",
val: "gzsTheme"
},
{
text: "活动开展情况介绍200字内",
val: "gzsIntroduce",
textarea: true
},
{
text: "分配比例",
val: "gzsProportion",
textarea:true
}
],
activityIndex: 0,
tempSceneImgs: [],
tempNewsImgs: [],
formData: {
activeType: "",
gzsTime: getCurrentDateTime(),
gzsPlace: "",
gzsParticipate: "",
gzsFdy: "",
gzsStu: "",
gzsTheme: "",
gzsIntroduce: "",
gzsProportion: "",
gzsNews: "",
gzsPicture: "",
fdName: uni.getStorageSync("stuName"),
years: "",
}
}
},
onLoad(option) {
this.formData.years = option.year;
this.formData.activeType = this.activityTypes[0];
},
methods: {
//上传新闻照片
uploadNewsImg() {
console.log(this.tempNewsImgs)
uploadImg('/common/upload', this.formData.gzsNews, this.tempNewsImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.gzsNews = result.photo;
}
});
},
//移除新闻照片
onRemoveNewsImg(index, path) {
removeImg(index, path, this.formData.gzsNews, this.tempNewsImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.gzsNews = result.photo;
}
});
},
//上传现场照片
uploadSceneImg() {
uploadImg('/common/upload', this.formData.gzsPicture, this.tempSceneImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.gzsPicture = result.photo;
}
});
},
//移除现场照片
onRemoveSceneImg(index, path) {
removeImg(index, path, this.formData.gzsPicture, this.tempSceneImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.gzsPicture = result.photo;
}
});
},
activityChangenge(e) {
this.activityIndex = e.detail.value;
this.formData.activeType = this.activityTypes[e.detail.value];
},
onChangeTime(e) {
this.formData.gzsTime = e.detail.value;
},
async onSubmit() {
console.log(this.formData);
const requiredFields = [
'gzsPlace',
'gzsParticipate',
'gzsFdy',
'gzsStu',
'gzsTheme',
'gzsIntroduce',
'gzsProportion',
'gzsPicture'
];
const emptyField = requiredFields.find(field => this.formData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写完整内容`,
icon: "none"
})
return;
}
this.isSubmitting = true; // 设置为正在提交
let res = await instructorJobPerformanceAdd(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
.getMaterialsList ===
'function') {
prevPage.queryParams.pageNum = 1;
prevPage.getMaterialsList();
}
}
}
})
}, 1000)
} else {
uni.showToast({
title: res.msg
})
}
},
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;
textarea {
border: 1px solid #E1E1E1;
border-radius: 10rpx;
width: 100%;
padding: 20rpx;
line-height: 40rpx;
}
.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,415 @@
<template>
<view class="evidence-detail">
<form>
<view class="form-item">
<label>活动类型</label>
<picker v-if="activityTypes.length>0" :value="activityIndex" :range="activityTypes"
@change="activityChangenge">
<view class="uni-input">
<text class="val">{{activityTypes[activityIndex]}}</text>
<uni-icons type="down" size="16" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>开展时间</label>
<picker @change="onChangeTime" mode="date" :value="formData.gzsTime">
<view class="uni-input">
<text class="val">{{formData.gzsTime}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item" v-for="(item,index) in inputArray" :key="index">
<label>{{item.text}}</label>
<textarea v-if="item.textarea" v-model="formData[item.val]" placeholder="请输入"></textarea>
<input v-else v-model="formData[item.val]" type="text" placeholder="请输入" />
</view>
<view class="form-item">
<label>现场照片</label>
<view class="upload-img" v-if="tempSceneImgs.length==0" @tap="uploadSceneImg">
<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 tempSceneImgs">
<image @tap="previewImg(tempSceneImgs)" :src="img.path" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveSceneImg(index,img.path)">X</text>
</view>
</view>
<view v-if="tempSceneImgs.length<3" class="btn" @tap="uploadSceneImg">
+ 添加照片
</view>
</view>
</view>
<view class="form-item">
<label>新闻照片</label>
<view class="upload-img" v-if="tempNewsImgs.length==0" @tap="uploadNewsImg">
<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 tempNewsImgs">
<image @tap="previewImg(tempNewsImgs)" :src="img.path" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveNewsImg(index,img.path)">X</text>
</view>
</view>
<view v-if="tempNewsImgs.length<3" class="btn" @tap="uploadNewsImg">
+ 添加照片
</view>
</view>
</view>
<button v-if="substatus!=1" :disabled="isSubmitting" type="primary" class="submit-btn" @tap="onEdit">保存修改</button>
</form>
</view>
</template>
<script>
import {
uploadImg,
previewImg,
removeImg
} from "@/utils/uploadImg.js"
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js"
import {
instructorJobPerformanceDetail,
instructorJobPerformanceUpdate
} from '@/api/compositive-performance/instructorJobPerformance.js';
import {
baseUrl
} from "@/config.js";
export default {
data() {
return {
isSubmitting: false, //表单提交标志位
activityTypes: ["沙龙", "研讨", "服务", "训练营", "其他"],
substatus:"",//提交状态
inputArray: [{
text: "地点",
val: "gzsPlace"
},
{
text: "参与领导",
val: "gzsParticipate"
},
{
text: "参与辅导员",
val: "gzsFdy"
},
{
text: "参与学生人数",
val: "gzsStu"
},
{
text: "活动主题",
val: "gzsTheme"
},
{
text: "活动开展情况介绍200字内",
val: "gzsIntroduce",
textarea:true
},
{
text: "分配比例",
val: "gzsProportion",
textarea:true
}
],
activityIndex: 0,
tempSceneImgs: [],
tempNewsImgs: [],
id: "", //佐证详情id
details: null,
formData: {
activeType: "",
gzsTime: getCurrentDateTime(),
gzsPlace: "",
gzsParticipate:"",
gzsFdy:"",
gzsStu:"",
gzsTheme:"",
gzsIntroduce:"",
gzsProportion:"",
gzsNews:"",
gzsPicture:"",
fdName: uni.getStorageSync("stuName"),
years: "",
}
}
},
onLoad(option) {
this.formData.years = option.year;
this.formData.activeType = this.activityTypes[0];
this.id = option.id;
this.substatus=option.substatus;
this.getDetails();
},
methods: {
//上传新闻照片
uploadNewsImg() {
uploadImg('/common/upload', this.formData.gzsNews, this.tempNewsImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.gzsNews=result.photo;
}
});
},
//移除新闻照片
onRemoveNewsImg(index, path) {
removeImg(index, path, this.formData.gzsNews, this.tempNewsImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.gzsNews=result.photo;
}
});
},
//上传现场照片
uploadSceneImg() {
uploadImg('/common/upload', this.formData.gzsPicture, this.tempSceneImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.gzsPicture = result.photo;
}
});
},
//移除现场照片
onRemoveSceneImg(index, path) {
removeImg(index, path, this.formData.gzsPicture, this.tempSceneImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.gzsPicture = result.photo;
}
});
},
activityChangenge(e) {
this.activityIndex = e.detail.value;
this.formData.activeType = this.activityTypes[e.detail.value];
},
onChangeTime(e) {
this.formData.gzsTime = e.detail.value;
},
async getDetails() {
let result = await instructorJobPerformanceDetail(this.id);
if (result.code == 200) {
console.log(result);
this.formData = result.data;
this.activityTypes.forEach((item, index) => {
if (item == this.formData.activeType) {
this.activityIndex = index;
}
})
if (this.formData.gzsPicture != null) {
let imgs = this.formData.gzsPicture.split(',');
this.tempSceneImgs = imgs.map(img => {
return {
path: baseUrl + img
};
})
}
if (this.formData.gzsNews != null) {
let imgs = this.formData.gzsNews.split(',');
this.tempNewsImgs = imgs.map(img => {
return {
path: baseUrl + img
};
})
}
}
},
async onEdit() {
console.log(this.formData);
const requiredFields = [
'gzsPlace',
'gzsParticipate',
'gzsFdy',
'gzsStu',
'gzsTheme',
'gzsIntroduce',
'gzsProportion',
'gzsPicture'
];
const emptyField = requiredFields.find(field => this.formData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写完整内容`,
icon: "none"
})
return;
}
this.isSubmitting = true; // 设置为正在提交
let res = await instructorJobPerformanceUpdate(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
.getMaterialsList ===
'function') {
prevPage.queryParams.pageNum = 1;
prevPage.getMaterialsList();
}
}
}
})
}, 1000)
} else {
uni.showToast({
title: res.msg
})
}
},
previewImg(imgs) {
previewImg(imgs);
}
}
}
</script>
<style scoped lang="scss">
.evidence-detail {
min-height: 95vh;
background-color: #F5F5F7;
padding: 40rpx;
.form-item {
padding: 22rpx 40rpx;
background-color: white;
margin-bottom: 20rpx;
border-radius: 16rpx;
textarea{
border: 1px solid #E1E1E1;
border-radius: 10rpx;
width: 100%;
padding:20rpx;
line-height:40rpx;
}
.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,229 @@
<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.activeType"></text>
</view>
<uni-icons type="right" size="16" color="#202020"></uni-icons>
</view>
<view class="content">
<view>活动主题{{item.gzsTheme}}</view>
<view>地点{{item.gzsPlace}}</view>
<view class="time">开展时间:{{item.gzsTime}}</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="substatus!=1">
+
</view>
</view>
</template>
<script>
import {
instructorJobPerformanceList,
delinstructorJobPerformance
} from '@/api/compositive-performance/instructorJobPerformance.js';
export default {
data() {
return {
actionOptions: [{
text: '删除',
style: {
width: "200px",
backgroundColor: '#df0000'
}
}],
list: [],
totalPages: 0,
loading: false,
substatus: "",
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
fdName: uni.getStorageSync("stuName"),
years: "",
},
}
},
onLoad(option) {
this.queryParams.years = option.year;
this.substatus = option.substatus;
this.getMaterialsList();
},
methods: {
scrolltolower() {
if (this.queryParams.pageNum < this.totalPages) {
this.queryParams.pageNum++;
this.loading = true;
setTimeout(() => {
this.getMaterialsList()
}, 1000)
} else {
}
},
addEvidence() {
uni.navigateTo({
url: `add?year=${this.queryParams.years}&sucesss=${this.sucesss}&reportingId=${this.reportingId}`
})
},
toDetail(id) {
uni.navigateTo({
url: `detail?id=${id}&substatus=${this.substatus}`
})
},
getMaterialsList() {
instructorJobPerformanceList(this.queryParams).then(res => {
this.loading = false;
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);
});
},
onDel(id) {
console.log(id);
uni.showModal({
title: "确定删除吗?",
success: (res) => {
if (res.confirm) {
delinstructorJobPerformance(id).then(res => {
if (res.code == 200) {
uni.showToast({
title: "删除成功"
})
this.getMaterialsList();
}
})
}
}
})
}
}
}
</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 {
margin-bottom: 10rpx;
}
.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,167 @@
<template>
<view class="evidence-add">
<form>
<view class="form-item">
<label>任务描述</label>
<textarea placeholder-class="input-placeholder" v-model="formData.taskDescribe"
placeholder="请输入"></textarea>
</view>
<view class="form-item">
<label>时间范围</label>
<picker @change="onChangeStartTime" mode="date" :value="formData.taskStart">
<view class="uni-input">
<text class="val">{{formData.taskStart==""?"开始时间":formData.taskStart}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
<picker class="end-time" :start="formData.taskStart" @change="onChangeEndTime" mode="date" :value="formData.taskEnd">
<view class="uni-input">
<text class="val">{{formData.taskEnd==""?"结束时间":formData.taskEnd}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
</view>
<button type="primary" :disabled="isSubmitting" class="submit-btn" @tap="onSubmit">提交</button>
</form>
</view>
</template>
<script>
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js"
import {
taskAdd,
} from '@/api/compositive-performance/majorReward.js';
export default {
data() {
return {
isSubmitting:false,
activityIndex: 0,
formData: {
taskDescribe: "",
taskStart: "",
taskEnd: "",
fdName: uni.getStorageSync("stuName"),
years: "",
}
}
},
onLoad(option) {
this.formData.years = option.year;
},
methods: {
onChangeStartTime(e) {
this.formData.taskStart = e.detail.value;
},
onChangeEndTime(e) {
this.formData.taskEnd = e.detail.value;
},
async onSubmit() {
const requiredFields = [
"taskDescribe",
"taskStart",
"taskEnd",
];
const emptyField = requiredFields.find(field => this.formData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写完所有内容`,
icon: "none"
})
return;
}
this.isSubmitting=true;
let res = await taskAdd(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
.getMaterialsList ===
'function') {
prevPage.queryParams.pageNum = 1;
prevPage.getMaterialsList();
}
}
}
})
}, 1000)
} else {
uni.showToast({
title: res.msg
})
}
},
}
}
</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;
}
textarea {
border: 1px solid #E1E1E1;
border-radius: 10rpx;
width: 100%;
padding: 15rpx;
.input-placeholder {
color: #3D3D3D;
opacity: 0.5;
}
}
.end-time {
margin-top: 40rpx;
}
picker {
border: 1px solid #E1E1E1;
height: 70rpx;
line-height: 70rpx;
padding: 0 30rpx;
border-radius: 10rpx;
.uni-input {
display: flex;
color: #797979;
.val {
flex: 1;
}
}
}
}
.submit-btn {
margin-top: 60rpx;
}
}
</style>

View File

@@ -0,0 +1,179 @@
<template>
<view class="evidence-add">
<form>
<view class="form-item">
<label>任务描述</label>
<textarea placeholder-class="input-placeholder" v-model="formData.taskDescribe"
placeholder="请输入"></textarea>
</view>
<view class="form-item">
<label>时间范围</label>
<picker @change="onChangeStartTime" mode="date" :value="formData.taskStart">
<view class="uni-input">
<text class="val">{{formData.taskStart==""?"开始时间":formData.taskStart}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
<picker class="end-time" :start="formData.taskStart" @change="onChangeEndTime" mode="date" :value="formData.taskEnd">
<view class="uni-input">
<text class="val">{{formData.taskEnd==""?"结束时间":formData.taskEnd}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
</view>
<button v-if="substatus!=1" :disabled="isSubmitting" type="primary" class="submit-btn" @tap="onEdit">保存修改</button>
</form>
</view>
</template>
<script>
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js"
import {
taskUpdate,
taskDetail
} from '@/api/compositive-performance/majorReward.js';
import { onUpdated } from "vue";
export default {
data() {
return {
isSubmitting:false,
activityIndex: 0,
id:"",
substatus:"",
formData: {
taskDescribe: "",
taskStart: "",
taskEnd: "",
fdName: uni.getStorageSync("stuName"),
years: "",
}
}
},
onLoad(option) {
this.formData.years = option.year;
this.id = option.id;
this.substatus=option.substatus;
this.getDetails();
},
methods: {
async getDetails() {
let result = await taskDetail(this.id);
console.log(result);
this.formData = result.data;
},
onChangeStartTime(e) {
this.formData.taskStart = e.detail.value;
},
onChangeEndTime(e) {
this.formData.taskEnd = e.detail.value;
},
async onEdit() {
const requiredFields = [
"taskDescribe",
"taskStart",
"taskEnd",
];
const emptyField = requiredFields.find(field => this.formData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写完所有内容`,
icon: "none"
})
return;
}
this.isSubmitting=true;
let res = await taskUpdate(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
.getMaterialsList ===
'function') {
prevPage.queryParams.pageNum = 1;
prevPage.getMaterialsList();
}
}
}
})
}, 1000)
} else {
uni.showToast({
title: res.msg
})
}
},
}
}
</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;
}
textarea {
border: 1px solid #E1E1E1;
border-radius: 10rpx;
width: 100%;
padding: 15rpx;
.input-placeholder {
color: #3D3D3D;
opacity: 0.5;
}
}
.end-time {
margin-top: 40rpx;
}
picker {
border: 1px solid #E1E1E1;
height: 70rpx;
line-height: 70rpx;
padding: 0 30rpx;
border-radius: 10rpx;
.uni-input {
display: flex;
color: #797979;
.val {
flex: 1;
}
}
}
}
.submit-btn {
margin-top: 60rpx;
}
}
</style>

View File

@@ -0,0 +1,224 @@
<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">
{{item.taskDescribe}}
</view>
<uni-icons type="right" size="16" color="#202020"></uni-icons>
</view>
<view class="content">
<view class="time">担任时间 : {{item.taskStart}}{{item.taskEnd}}</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="substatus!=1">
+
</view>
</view>
</template>
<script>
import {
taskList,
taskDel
} from '@/api/compositive-performance/majorReward.js';
export default {
data() {
return {
actionOptions: [{
text: '删除',
style: {
width: "200px",
backgroundColor: '#df0000'
}
}],
list: [],
totalPages: 0,
loading: false,
substatus: "",
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
fdName: uni.getStorageSync("stuName"),
years: "",
},
}
},
onLoad(option) {
this.queryParams.years = option.year;
this.substatus = option.substatus;
this.getMaterialsList();
},
methods: {
scrolltolower() {
if (this.queryParams.pageNum < this.totalPages) {
this.queryParams.pageNum++;
this.loading = true;
setTimeout(() => {
this.getMaterialsList()
}, 1000)
} else {
}
},
addEvidence() {
uni.navigateTo({
url: `add?year=${this.queryParams.years}`
})
},
toDetail(id) {
uni.navigateTo({
url: `detail?id=${id}&substatus=${this.substatus}`
})
},
getMaterialsList() {
taskList(this.queryParams).then(res => {
this.loading = false;
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);
});
},
onDel(id) {
console.log(id);
uni.showModal({
title: "确定删除吗?",
success: (res) => {
if (res.confirm) {
taskDel(id).then(res => {
if (res.code == 200) {
uni.showToast({
title: "删除成功"
})
this.getMaterialsList();
}
})
}
}
})
}
}
}
</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;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
color: #303030;
line-height: 50rpx;
}
.uni-icons {
opacity: 0.5;
color: #202020;
font-weight: 600;
}
}
.content {
padding-top: 22rpx;
&>view {
margin-bottom: 20rpx;
}
.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,251 @@
<template>
<view class="personal-reporting">
<view class="student-management">
<view class="form-item">
<label>01 指导学生取得第二课堂学分奖励</label>
<input type="number" v-model="passs" placeholder="请填写所带学生第二课堂合格人数"
placeholder-class="input-placeholder" />
</view>
<view class="form-item" @tap="toinstructorJobPerformance">
<label>02 辅导员工作业绩填报</label>
<uni-icons type="right" size="16" color="#202020"></uni-icons>
</view>
<view class="form-item" @tap="toundertakeStudentWorkAssignments">
<label>03 承接区级校级学生工作任务</label>
<uni-icons type="right" size="16" color="#202020"></uni-icons>
</view>
<view class="form-item" @tap="toholdAPost">
<label>04 担任职务</label>
<uni-icons type="right" size="16" color="#202020"></uni-icons>
</view>
<view class="form-item" @tap="tomajorReward">
<label>04 重大任务奖励</label>
<uni-icons type="right" size="16" color="#202020"></uni-icons>
</view>
</view>
<view class="btns" v-if="substatus!=1">
<button type="primary" class="save" style="margin-right: 25rpx;" @tap="onSave">保存</button>
<button type="primary" class="next-page" @tap="onSubmit">提交</button>
</view>
</view>
</template>
<script>
import {
servingUpdate
} from '../../../../api/compositive-performance/holdAPost';
import {
toBackPage
} from "@/utils/toBack.js"
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js"
import {
performanceUpdate,
passAdd,
passUpdate,
getInfoByFdNameAndYears
} from '@/api/compositive-performance/index.js';
export default {
data() {
return {
year: "", //年份
reportingId: "", //填报记录id
passs: "", //第二课堂合格人数
passsId: "", //第二课堂详情id
substatus: "", //提交状态
}
},
onLoad(option) {
this.year = option.year;
this.reportingId = option.id;
this.substatus = option.substatus;
this.getPassStuByFdNameAndYears();
},
methods: {
async getPassStuByFdNameAndYears() {
let res = await getInfoByFdNameAndYears({
fdName: uni.getStorageSync("stuName"),
years: this.year,
})
if (res.data) {
this.passs = res.data.passs;
this.passsId = res.data.id;
}
},
toinstructorJobPerformance() {
console.log(this.reportingId);
uni.navigateTo({
url: `./instructorJobPerformance/list?year=${this.year}&substatus=${this.substatus}`
})
},
toholdAPost() {
uni.navigateTo({
url: `./holdAPost/list?year=${this.year}&substatus=${this.substatus}`
})
},
toundertakeStudentWorkAssignments() {
uni.navigateTo({
url: `./undertakeStudentWorkAssignments/list?year=${this.year}&substatus=${this.substatus}`
})
},
tomajorReward() {
uni.navigateTo({
url: `./majorReward/list?year=${this.year}&substatus=${this.substatus}`
})
},
async onSave() {
if (this.reportingId && this.passsId == "") {
let res = await passAdd({
fdName: uni.getStorageSync("stuName"),
years: this.year,
passs: this.passs,
});
if (res.code == 200) {
uni.showToast({
title: "保存成功",
icon: "none"
})
toBackPage(500);
}
} else {
let res = await passUpdate({
fdName: uni.getStorageSync("stuName"),
years: this.year,
passs: this.passs,
id: this.passsId
});
if (res.code == 200) {
uni.showToast({
title: "保存成功",
icon: "none"
})
toBackPage(500);
}
}
},
onSubmit() {
uni.showModal({
title: "确定提交吗?",
success: async (bool) => {
if (bool.confirm) {
if (this.reportingId && this.passsId == "") {
let res = await passAdd({
fdName: uni.getStorageSync("stuName"),
years: this.year,
passs: this.passs,
});
if (res.code == 200) {
this.performanceUpdate()
}
} else {
let res = await passUpdate({
fdName: uni.getStorageSync("stuName"),
years: this.year,
passs: this.passs,
id: this.passsId
});
if (res.code == 200) {
this.performanceUpdate()
}
}
}
}
})
},
performanceUpdate() {
let formData = {
id: this.reportingId,
college: uni.getStorageSync("deptName"),
fdTime: getCurrentDateTime(),
fdName: uni.getStorageSync("stuName"),
years: this.year,
substatus: 1,
}
performanceUpdate(formData).then((result) => {
if (result.code == 200) {
uni.showToast({
title: "提交成功"
})
toBackPage(500);
}
})
}
}
}
</script>
<style scoped lang="scss">
.personal-reporting {
background-color: #f5f5f7;
height: calc(100vh - 44px);
padding: 40rpx;
.student-management {
.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;
color: #404040;
}
input {
border: 1px solid #E1E1E1;
border-radius: 10rpx;
height: 60rpx;
padding-left: 30rpx;
.input-placeholder {
color: #b6b6b6;
}
}
&:not(:first-child) {
padding: 0 40rpx;
height: 50px;
line-height: 50rpx;
display: flex;
justify-content: space-between;
align-items: center;
label {
margin: 0;
}
}
}
}
.btns {
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
margin-top: 100rpx;
padding: 20rpx 20rpx;
background-color: white;
button {
flex: 1;
height: 44px;
}
.save {
background-color: transparent;
color: #1890FF;
border: 1px solid #1890FF;
margin-right: 40rpx;
}
}
}
</style>

View File

@@ -0,0 +1,381 @@
<template>
<view class="evidence-add">
<form>
<view class="form-item">
<label>活动类型</label>
<picker v-if="activityTypes.length>0" :value="activityIndex" :range="activityTypes"
@change="activityChangenge">
<view class="uni-input">
<text class="val">{{activityTypes[activityIndex]}}</text>
<uni-icons type="down" size="16" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>开展时间</label>
<picker @change="onChangeTime" mode="date" :value="formData.rwTime">
<view class="uni-input">
<text class="val">{{formData.rwTime}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item" v-for="(item,index) in inputArray" :key="index">
<label>{{item.text}}</label>
<textarea v-if="item.textarea" v-model="formData[item.val]" placeholder="请输入"></textarea>
<input v-else v-model="formData[item.val]" type="text" placeholder="请输入" />
</view>
<view class="form-item">
<label>现场照片</label>
<view class="upload-img" v-if="tempSceneImgs.length==0" @tap="uploadSceneImg">
<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 tempSceneImgs">
<image @tap="previewImg(tempSceneImgs)" :src="img.path" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveSceneImg(index,img.path)">X</text>
</view>
</view>
<view v-if="tempSceneImgs.length<3" class="btn" @tap="uploadSceneImg">
+ 添加照片
</view>
</view>
</view>
<view class="form-item">
<label>新闻照片</label>
<view class="upload-img" v-if="tempNewsImgs.length==0" @tap="uploadNewsImg">
<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 tempNewsImgs">
<image @tap="previewImg(tempNewsImgs)" :src="img.path" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveNewsImg(index,img.path)">X</text>
</view>
</view>
<view v-if="tempNewsImgs.length<3" class="btn" @tap="uploadNewsImg">
+ 添加照片
</view>
</view>
</view>
<button type="primary" :disabled="isSubmitting" class="submit-btn" @tap="onSubmit">提交</button>
</form>
</view>
</template>
<script>
import {
uploadImg,
previewImg,
removeImg
} from "@/utils/uploadImg.js"
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js"
import {
undertakeStudentWorkAssignmentsAdd,
} from '@/api/compositive-performance/undertakeStudentWorkAssignments.js';
import {
baseUrl
} from "@/config.js";
export default {
data() {
return {
isSubmitting: false, //表单提交标志位
activityTypes: ["校级", "区级"],
inputArray: [{
text: "地点",
val: "rwPlace"
},
{
text: "参与领导",
val: "rwParticipate"
},
{
text: "工作人员",
val: "rwPeople"
},
{
text: "参与学生数",
val: "rwStu"
},
{
text: "活动主题",
val: "rwTheme"
},
{
text: "具体工作内容及完成情况 200字内",
val: "rwSituation",
textarea:true
},
{
text: "分配比例",
val: "rwProportion",
textarea:true
}
],
activityIndex: 0,
tempSceneImgs: [],
tempNewsImgs: [],
formData: {
rwType: "",
rwTime: getCurrentDateTime(),
rwPlace: "",
rwParticipate: "",
rwPeople: "",
rwStu: "",
rwTheme: "",
rwSituation: "",
rwProportion: "",
rwPicture: "",
rwNews: '',
fdName: uni.getStorageSync("stuName"),
years: "",
}
}
},
onLoad(option) {
this.formData.years = option.year;
this.formData.rwType = this.activityTypes[0];
},
methods: {
//上传新闻照片
uploadNewsImg() {
uploadImg('/common/upload', this.formData.rwNews, this.tempNewsImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.rwNews=result.photo;
}
});
},
//移除新闻照片
onRemoveNewsImg(index, path) {
removeImg(index, path, this.formData.rwNews, this.tempNewsImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.rwNews=result.photo;
}
});
},
//上传现场照片
uploadSceneImg() {
uploadImg('/common/upload', this.formData.rwPicture, this.tempSceneImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.rwPicture = result.photo;
}
});
},
//移除现场照片
onRemoveSceneImg(index, path) {
removeImg(index, path, this.formData.rwPicture, this.tempSceneImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.rwPicture = result.photo;
}
});
},
activityChangenge(e) {
this.activityIndex = e.detail.value;
this.formData.rwType = this.activityTypes[e.detail.value];
},
onChangeTime(e) {
this.formData.rwTime = e.detail.value;
},
async onSubmit() {
const requiredFields = [
'rwPlace',
'rwParticipate',
'rwPeople',
'rwStu',
'rwTheme',
'rwSituation',
'rwProportion',
'rwPicture',
'rwNews'
];
console.log(this.formData);
const emptyField = requiredFields.find(field => this.formData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写完整内容`,
icon: "none"
})
return;
}
this.isSubmitting=true; //表单提交标志位
let res = await undertakeStudentWorkAssignmentsAdd(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
.getMaterialsList ===
'function') {
prevPage.queryParams.pageNum = 1;
prevPage.getMaterialsList();
}
}
}
})
}, 1000)
} else {
uni.showToast({
title: res.msg
})
}
},
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;
textarea{
border: 1px solid #E1E1E1;
border-radius: 10rpx;
width: 100%;
padding:20rpx;
line-height:40rpx;
}
.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,416 @@
<template>
<view class="evidence-detail">
<form>
<view class="form-item">
<label>活动类型</label>
<picker v-if="activityTypes.length>0" :value="activityIndex" :range="activityTypes"
@change="activityChangenge">
<view class="uni-input">
<text class="val">{{activityTypes[activityIndex]}}</text>
<uni-icons type="down" size="16" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item">
<label>开展时间</label>
<picker @change="onChangeTime" mode="date" :value="formData.rwTime">
<view class="uni-input">
<text class="val">{{formData.rwTime}}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view>
</picker>
</view>
<view class="form-item" v-for="(item,index) in inputArray" :key="index">
<label>{{item.text}}</label>
<textarea v-if="item.textarea" v-model="formData[item.val]" placeholder="请输入"></textarea>
<input v-else v-model="formData[item.val]" type="text" placeholder="请输入" />
</view>
<view class="form-item">
<label>现场照片</label>
<view class="upload-img" v-if="tempSceneImgs.length==0" @tap="uploadSceneImg">
<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 tempSceneImgs">
<image @tap="previewImg(tempSceneImgs)" :src="img.path" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveSceneImg(index,img.path)">X</text>
</view>
</view>
<view v-if="tempSceneImgs.length<3" class="btn" @tap="uploadSceneImg">
+ 添加照片
</view>
</view>
</view>
<view class="form-item">
<label>新闻照片</label>
<view class="upload-img" v-if="tempNewsImgs.length==0" @tap="uploadNewsImg">
<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 tempNewsImgs">
<image @tap="previewImg(tempNewsImgs)" :src="img.path" mode="aspectFill"></image>
<text class="remove" @tap="onRemoveNewsImg(index,img.path)">X</text>
</view>
</view>
<view v-if="tempNewsImgs.length<3" class="btn" @tap="uploadNewsImg">
+ 添加照片
</view>
</view>
</view>
<button v-if="substatus!=1" :disabled="isSubmitting" type="primary" class="submit-btn" @tap="onEdit">保存修改</button>
</form>
</view>
</template>
<script>
import {
uploadImg,
previewImg,
removeImg
} from "@/utils/uploadImg.js"
import {
getCurrentDateTime
} from "@/utils/getCurrentDateTime.js"
import {
undertakeStudentWorkAssignmentsUpdate,
undertakeStudentWorkAssignmentsDetail
} from '@/api/compositive-performance/undertakeStudentWorkAssignments.js';
import {
baseUrl
} from "@/config.js";
import { onUpdated } from "vue";
export default {
data() {
return {
isSubmitting: false, //表单提交标志位
activityTypes: ["校级", "区级"],
substatus:"",
inputArray: [{
text: "地点",
val: "rwPlace"
},
{
text: "参与领导",
val: "rwParticipate"
},
{
text: "工作人员",
val: "rwPeople"
},
{
text: "参与学生数",
val: "rwStu"
},
{
text: "活动主题",
val: "rwTheme"
},
{
text: "具体工作内容及完成情况 200字内",
val: "rwSituation",
textarea:true
},
{
text: "分配比例",
val: "rwProportion",
textarea:true
}
],
activityIndex: 0,
tempSceneImgs: [],
tempNewsImgs: [],
formData: {
rwType: "",
rwTime: getCurrentDateTime(),
rwPlace: "",
rwParticipate: "",
rwPeople: "",
rwStu: "",
rwTheme: "",
rwSituation: "",
rwProportion: "",
rwPicture: "",
rwNews: '',
fdName: uni.getStorageSync("stuName"),
years: "",
}
}
},
onLoad(option) {
this.formData.years = option.year;
this.formData.rwType = this.activityTypes[0];
this.id = option.id;
this.substatus=option.substatus;
this.getDetails();
},
methods: {
async getDetails() {
let result = await undertakeStudentWorkAssignmentsDetail(this.id);
if (result.code == 200) {
console.log(result);
this.formData = result.data;
this.activityTypes.forEach((item, index) => {
if (item == this.formData.rwType) {
this.activityIndex = index;
}
})
if (this.formData.rwPicture != null||this.formData.rwPicture!="") {
let imgs = this.formData.rwPicture.split(',');
this.tempSceneImgs = imgs.map(img => {
return {
path: baseUrl + img
};
})
}
if (this.formData.rwNews != null||this.formData.rwNews!="") {
let imgs = this.formData.rwNews.split(',');
this.tempNewsImgs = imgs.map(img => {
return {
path: baseUrl + img
};
})
}
}
},
//上传新闻照片
uploadNewsImg() {
uploadImg('/common/upload', this.formData.rwNews, this.tempNewsImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.rwNews=result.photo;
}
});
},
//移除新闻照片
onRemoveNewsImg(index, path) {
removeImg(index, path, this.formData.rwNews, this.tempNewsImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.rwNews=result.photo;
}
});
},
//上传现场照片
uploadSceneImg() {
uploadImg('/common/upload', this.formData.rwPicture, this.tempSceneImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.rwPicture = result.photo;
}
});
},
//移除现场照片
onRemoveSceneImg(index, path) {
removeImg(index, path, this.formData.rwPicture, this.tempSceneImgs, baseUrl, (error, result) => {
if (!error) {
this.formData.rwPicture = result.photo;
}
});
},
activityChangenge(e) {
this.activityIndex = e.detail.value;
this.formData.rwType = this.activityTypes[e.detail.value];
},
onChangeTime(e) {
this.formData.rwTime = e.detail.value;
},
async onEdit() {
const requiredFields = [
'rwPlace',
'rwParticipate',
'rwPeople',
'rwStu',
'rwTheme',
'rwSituation',
'rwProportion',
'rwPicture',
'rwNews'
];
console.log(this.formData);
const emptyField = requiredFields.find(field => this.formData[field] === "");
if (emptyField) {
uni.showToast({
title: `请填写完整内容`,
icon: "none"
})
return;
}
this.isSubmitting=true; //表单提交标志位
let res = await undertakeStudentWorkAssignmentsUpdate(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
.getMaterialsList ===
'function') {
prevPage.queryParams.pageNum = 1;
prevPage.getMaterialsList();
}
}
}
})
}, 1000)
} else {
uni.showToast({
title: res.msg
})
}
},
previewImg(imgs) {
previewImg(imgs);
}
}
}
</script>
<style scoped lang="scss">
.evidence-detail {
min-height: 95vh;
background-color: #F5F5F7;
padding: 40rpx;
.form-item {
padding: 22rpx 40rpx;
background-color: white;
margin-bottom: 20rpx;
border-radius: 16rpx;
textarea{
border: 1px solid #E1E1E1;
border-radius: 10rpx;
width: 100%;
padding:20rpx;
line-height:40rpx;
}
.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,227 @@
<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">
{{item.rwType}}
</view>
<uni-icons type="right" size="16" color="#202020"></uni-icons>
</view>
<view class="content">
<view>活动主题{{item.rwTheme}}</view>
<view class="time">开展时间 : {{item.rwTime}}</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="substatus!=1">
+
</view>
</view>
</template>
<script>
import {
undertakeStudentWorkAssignmentsList,
undertakeStudentWorkAssignmentsDel
} from '@/api/compositive-performance/undertakeStudentWorkAssignments.js';
export default {
data() {
return {
actionOptions: [{
text: '删除',
style: {
width: "200px",
backgroundColor: '#df0000'
}
}],
list: [],
totalPages: 0,
loading: false,
substatus: "",
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
fdName: uni.getStorageSync("stuName"),
years: "",
},
}
},
onLoad(option) {
this.queryParams.years = option.year;
this.substatus = option.substatus;
this.getMaterialsList();
},
methods: {
scrolltolower() {
if (this.queryParams.pageNum < this.totalPages) {
this.queryParams.pageNum++;
this.loading = true;
setTimeout(() => {
this.getMaterialsList()
}, 1000)
} else {
}
},
addEvidence() {
uni.navigateTo({
url: `add?year=${this.queryParams.years}`
})
},
toDetail(id) {
uni.navigateTo({
url: `detail?id=${id}&substatus=${this.substatus}`
})
},
getMaterialsList() {
undertakeStudentWorkAssignmentsList(this.queryParams).then(res => {
this.loading = false;
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);
});
},
onDel(id) {
console.log(id);
uni.showModal({
title: "确定删除吗?",
success: (res) => {
if (res.confirm) {
undertakeStudentWorkAssignmentsDel(id).then(res => {
if (res.code == 200) {
uni.showToast({
title: "删除成功"
})
this.getMaterialsList();
}
})
}
}
})
}
}
}
</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 {
margin-bottom: 20rpx;
}
.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>