Compare commits
2 Commits
9f20ebcec6
...
b03b8ab6fc
| Author | SHA1 | Date | |
|---|---|---|---|
| b03b8ab6fc | |||
| d05cfe8c30 |
@@ -18,6 +18,23 @@ export function addStudent(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 根据关联表id查看详情
|
||||
export function getStudentDetail(id) {
|
||||
return request({
|
||||
url: `/dormitory/srs-dormitory-student/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改学生宿舍关联
|
||||
export function updateStudent(data) {
|
||||
return request({
|
||||
url: '/dormitory/srs-dormitory-student/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取校区
|
||||
export function listAllCampus() {
|
||||
return request({
|
||||
|
||||
32
api/task.js
32
api/task.js
@@ -1,32 +1,32 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function myProcess(data){
|
||||
export function myProcess(params){
|
||||
return request({
|
||||
'url': '/flowable/task/myProcess',
|
||||
'method': 'get',
|
||||
data
|
||||
url: '/flowable/task/myProcess',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function todoList(data){
|
||||
export function todoList(params){
|
||||
return request({
|
||||
'url': '/flowable/task/todoList',
|
||||
'method': 'get',
|
||||
data
|
||||
url: '/flowable/task/todoList',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function finishedList(data){
|
||||
export function finishedList(params){
|
||||
return request({
|
||||
'url': '/flowable/task/finishedList',
|
||||
'method': 'get',
|
||||
data
|
||||
url: '/flowable/task/finishedList',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function flowRecord(data){
|
||||
export function flowRecord(params){
|
||||
return request({
|
||||
'url': '/flowable/task/flowRecord',
|
||||
'method': 'get',
|
||||
data
|
||||
url: '/flowable/task/flowRecord',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function complete(data){
|
||||
|
||||
12
config.js
12
config.js
@@ -1,8 +1,12 @@
|
||||
// 应用全局配置
|
||||
module.exports = {
|
||||
// 统一通过本机 Nginx 反向代理访问后端
|
||||
// 若在同一台机器调试:使用 localhost:8066
|
||||
// 若手机在同一局域网:替换为本机局域网 IP,例如 172.16.96.111:8066
|
||||
// 页面在 https://zhxg.gxsdxy.cn 下访问,接口同域同协议以避免 CORS
|
||||
// baseUrl: 'https://zhxg.gxsdxy.cn/prod_api',
|
||||
// baseUrl: 'http://172.16.96.111:8085',
|
||||
// baseUrl: 'http://192.168.211.22:8085',
|
||||
// baseUrl: 'https://zhxg.gxsdxy.cn/prod_api',
|
||||
// 若本地/内网以 HTTP 访问页面,可改为:
|
||||
baseUrl: 'http://localhost:8085',
|
||||
// 应用信息
|
||||
appInfo: {
|
||||
@@ -28,7 +32,7 @@ module.exports = {
|
||||
/**
|
||||
* 开启cas
|
||||
*/
|
||||
casEnable: false,
|
||||
casEnable: true,
|
||||
|
||||
/**
|
||||
* 单点登录url
|
||||
@@ -38,5 +42,5 @@ module.exports = {
|
||||
/**
|
||||
* 单点登出url
|
||||
*/
|
||||
caslogoutUrl: 'https://rsso.gxsdxy.cn/logout?service=http://zhxg.gxsdxy.cn/prod_api_test/getinfo',
|
||||
caslogoutUrl: 'http://rsso.gxsdxy.cn/logout?service=http://zhxg.gxsdxy.cn/prod_api_test/getinfo',
|
||||
}
|
||||
@@ -371,6 +371,7 @@
|
||||
getRtStuQuitSchoolByProcInsId(procInsId) {
|
||||
getRtStuQuitSchoolByProcInsId(procInsId).then((res) => {
|
||||
this.formData = res.data;
|
||||
console.log(this.formData)
|
||||
this.get_penalty_type(this.formData.quitType);
|
||||
this.get_category(this.formData.quitCategory);
|
||||
if (this.tag == 1) {
|
||||
@@ -423,7 +424,7 @@
|
||||
if (pages && pages.length > 0) {
|
||||
const prevPage = pages[pages.length - 2] || pages[pages.length - 1];
|
||||
if (prevPage && typeof prevPage.handleChange === 'function') {
|
||||
prevPage.handleChange(this.tag || 1);
|
||||
prevPage.handleChange(2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -498,10 +499,10 @@
|
||||
uni.navigateBack({
|
||||
success: () => {
|
||||
const pages = getCurrentPages();
|
||||
if (pages && pages.length > 0) {
|
||||
const prevPage = pages[pages.length - 2] || pages[pages.length - 1];
|
||||
if (prevPage && typeof prevPage.handleChange === 'function') {
|
||||
prevPage.handleChange(this.tag || 1);
|
||||
if (pages.length > 0) {
|
||||
const prevPage = pages[pages.length - 2]
|
||||
if (prevPage && typeof prevPage.getList === 'function') {
|
||||
prevPage.handleChange(2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -529,8 +530,8 @@
|
||||
if (pages && pages.length > 0) {
|
||||
const prevPage = pages[pages.length - 2] || pages[pages.length - 1];
|
||||
if (prevPage && typeof prevPage.handleChange === 'function') {
|
||||
prevPage.handleChange(this.tag || 1);
|
||||
console.log('刷新任务数据');
|
||||
prevPage.handleChange(2);
|
||||
console.log('刷新已办任务数据');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,14 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="content" v-if="processes.length!==0">
|
||||
<view class="search-bar">
|
||||
<input class="input" placeholder="姓名" v-model="searchName" @confirm="doSearch" />
|
||||
<picker mode="date" :value="searchDate" @change="onDateChange">
|
||||
<view class="picker-text">{{ searchDate || '时间' }}</view>
|
||||
</picker>
|
||||
<button class="primary" @tap="doSearch">搜索</button>
|
||||
<button class="reset" @tap="resetSearch">重置</button>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item" v-for="(process,index) in processes" :key="index">
|
||||
<view class="top">
|
||||
@@ -75,7 +83,9 @@
|
||||
currentPage: 1,
|
||||
loading: false, // 加载状态标志
|
||||
topLoading: true,
|
||||
role: uni.getStorageSync("roles")
|
||||
role: uni.getStorageSync("roles"),
|
||||
searchName: '',
|
||||
searchDate: ''
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
@@ -130,12 +140,42 @@
|
||||
this.topLoading = true;
|
||||
this.getList();
|
||||
},
|
||||
doSearch() {
|
||||
this.currentPage = 1;
|
||||
this.processes = [];
|
||||
this.topLoading = true;
|
||||
this.getList();
|
||||
},
|
||||
resetSearch() {
|
||||
this.searchName = '';
|
||||
this.searchDate = '';
|
||||
this.currentPage = 1;
|
||||
this.processes = [];
|
||||
this.topLoading = true;
|
||||
this.getList();
|
||||
},
|
||||
onDateChange(e) {
|
||||
this.searchDate = e.detail.value;
|
||||
},
|
||||
getList() {
|
||||
this.loading = true;
|
||||
let sdata = {
|
||||
pageNum: this.currentPage,
|
||||
pageSize: 10
|
||||
pageSize: 10,
|
||||
};
|
||||
if (this.searchName) {
|
||||
sdata.startUserName = this.searchName;
|
||||
}
|
||||
if (this.searchDate) {
|
||||
if (this.currentTab === 2) {
|
||||
// 已办任务:PC端使用 startTime/endTime;时间对应“提交时间”
|
||||
sdata.startTime = this.searchDate;
|
||||
sdata.endTime = this.searchDate;
|
||||
} else {
|
||||
// 我发起的、待办任务:PC端使用 deployTime;时间对应“提交时间”
|
||||
sdata.deployTime = this.searchDate;
|
||||
}
|
||||
}
|
||||
console.log(this.processes);
|
||||
if (this.currentTab == 0) {
|
||||
myProcess(sdata).then(res => {
|
||||
@@ -320,6 +360,41 @@
|
||||
}
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 8px 10px;
|
||||
background-color: #ffffff;
|
||||
border-bottom: 1px solid #EDEDED;
|
||||
position: sticky;
|
||||
top: 58px;
|
||||
z-index: 998;
|
||||
.input {
|
||||
flex: 1;
|
||||
border: 1px solid #EDEDED;
|
||||
border-radius: 4px;
|
||||
padding: 6px 8px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.picker-text {
|
||||
border: 1px solid #EDEDED;
|
||||
border-radius: 4px;
|
||||
padding: 6px 8px;
|
||||
color: #555555;
|
||||
}
|
||||
button.primary {
|
||||
border: 1px solid #007aff;
|
||||
color: #007aff;
|
||||
}
|
||||
button.reset {
|
||||
border: 1px solid #909399;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -337,6 +412,7 @@
|
||||
.content {
|
||||
padding-top: 58px;
|
||||
|
||||
|
||||
.list {
|
||||
.item {
|
||||
padding: 20px 10px;
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<text class="label"> <text class="required">*</text> 请假起始时间:</text>
|
||||
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker @change="changeDate('start',$event)" returnType="timestamp"
|
||||
<uni-datetime-picker @change="changeDate('start', $event)" returnType="timestamp"
|
||||
v-model="formData.single" />
|
||||
|
||||
</view>
|
||||
@@ -75,7 +75,7 @@
|
||||
<view class="form-item"> <!-- 根据选择的申请类型来决定是否显示 -->
|
||||
<text class="label"> <text class="required">*</text> 请假结束时间:</text>
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker @change="changeDate('end',$event)" returnType="timestamp"
|
||||
<uni-datetime-picker @change="changeDate('end', $event)" returnType="timestamp"
|
||||
v-model="formData.endsingle" />
|
||||
</view>
|
||||
</view>
|
||||
@@ -120,7 +120,7 @@
|
||||
<!-- 签名 -->
|
||||
<view class="form-canvas">
|
||||
<text class="label"> <text class="required">*</text> 手写签字:</text>
|
||||
<view class="sign-img" v-if="signImg!=''">
|
||||
<view class="sign-img" v-if="signImg != ''">
|
||||
<image :src="signImg" mode=""></image>
|
||||
<text @tap="signToggle">重新签名</text>
|
||||
</view>
|
||||
@@ -145,7 +145,7 @@
|
||||
</view>
|
||||
</uni-popup> -->
|
||||
<!-- 新签名组件 -->
|
||||
<jp-signature-popup ref="jpSignature" :required="true" popup @change="uploadSign"/>
|
||||
<jp-signature-popup ref="jpSignature" :required="true" popup @change="uploadSign" />
|
||||
|
||||
<uni-popup class="safety-popup" :is-mask-click="false" ref="safetyPopup" background-color="#fff">
|
||||
<view class="popup-content">
|
||||
@@ -160,8 +160,8 @@
|
||||
4、如有特殊情况需要延长请假时间,会及时向学校或老师做出说明和沟通。
|
||||
5、意识到请假可能会对我的学业和成绩造成负面影响,我愿意承担相应的责任和后果。
|
||||
</view>
|
||||
<view class="time" v-if="safetime>0">
|
||||
请阅读{{safetime}}s承诺书
|
||||
<view class="time" v-if="safetime > 0">
|
||||
请阅读{{ safetime }}s承诺书
|
||||
</view>
|
||||
</view>
|
||||
<view class="safety-btn">
|
||||
@@ -173,21 +173,20 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uploadFile from "@/plugins/upload.js";
|
||||
import {
|
||||
baseUrl
|
||||
} from "@/config.js";
|
||||
import {
|
||||
calculateDays,
|
||||
convertToTimestamp
|
||||
} from "@/utils/time-calculation.js"
|
||||
import {
|
||||
import {
|
||||
addApply,
|
||||
getStuInfo,
|
||||
commonUpload,
|
||||
leaveSave
|
||||
} from "@/api/applyleave/applyleave.js";
|
||||
export default {
|
||||
} from "@/api/applyleave/applyleave.js";
|
||||
import {
|
||||
baseUrl
|
||||
} from "@/config.js";
|
||||
import uploadFile from "@/plugins/upload.js";
|
||||
import {
|
||||
calculateDays,
|
||||
convertToTimestamp
|
||||
} from "@/utils/time-calculation.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isSubmitting: false, //表单提交标志位
|
||||
@@ -306,7 +305,8 @@
|
||||
title: "请勾选承诺书",
|
||||
icon: "error"
|
||||
});
|
||||
return; // 阻止表单提交
|
||||
uni.hideLoading();
|
||||
return;
|
||||
}
|
||||
if (this.formData.signFile == '') {
|
||||
// 如果复选框未被选中,则不允许提交
|
||||
@@ -314,14 +314,16 @@
|
||||
title: "请先进行签名",
|
||||
icon: "error"
|
||||
});
|
||||
return; // 阻止表单提交
|
||||
uni.hideLoading();
|
||||
return;
|
||||
}
|
||||
if (this.formData.endsingle < this.formData.single) {
|
||||
uni.showToast({
|
||||
title: "起始时间不能晚于结束时间",
|
||||
icon: "none"
|
||||
})
|
||||
return; // 阻止表单提交
|
||||
uni.hideLoading();
|
||||
return;
|
||||
}
|
||||
//表单非空校验
|
||||
const requiredFields = [
|
||||
@@ -339,6 +341,7 @@
|
||||
title: `请填写完必填字段`,
|
||||
icon: "none"
|
||||
})
|
||||
uni.hideLoading();
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
@@ -400,17 +403,10 @@
|
||||
},
|
||||
//上传签名
|
||||
uploadSign(e) {
|
||||
const blob = this.base64ToBlob(e);
|
||||
const fileObj = new File([blob], 'signature', {
|
||||
type: 'image/png'
|
||||
});
|
||||
const formData = new FormData();
|
||||
formData.append("file", fileObj);
|
||||
const formDataObj = this.formDataToObject(formData);
|
||||
uploadFile('/common/upload', '', formDataObj).then((res) => {
|
||||
this.formData.signFile = JSON.parse(res).fileName;
|
||||
this.signImg = baseUrl + JSON.parse(res).fileName;
|
||||
// this.$refs.popup.close('center')
|
||||
uploadFile('/common/upload', e).then((res) => {
|
||||
const data = JSON.parse(res);
|
||||
this.formData.signFile = data.fileName;
|
||||
this.signImg = data.url || (baseUrl + data.fileName);
|
||||
})
|
||||
},
|
||||
formDataToObject(formData) {
|
||||
@@ -497,7 +493,7 @@
|
||||
});
|
||||
return; // 阻止表单提交
|
||||
}
|
||||
if (this.endsingle < this.single) {
|
||||
if (this.formData.endsingle < this.formData.single) {
|
||||
uni.showToast({
|
||||
title: "起始时间不能晚于结束时间",
|
||||
icon: "none"
|
||||
@@ -508,15 +504,15 @@
|
||||
let data = {
|
||||
applicantSignature: this.formData.signFile,
|
||||
attachment: this.attachmentFile,
|
||||
destination: this.endAddress,
|
||||
destinationDetails: this.address,
|
||||
endDate: this.endsingle,
|
||||
leaveDays: this.dataNum,
|
||||
leaveType: this.selectedPoliticalIndex,
|
||||
reason: this.deeds,
|
||||
destination: this.formData.endAddress,
|
||||
destinationDetails: this.formData.address,
|
||||
endDate: this.formData.endsingle,
|
||||
leaveDays: this.formData.dataNum,
|
||||
leaveType: this.formData.selectedPoliticalIndex,
|
||||
reason: this.formData.deeds,
|
||||
remark: this.remark,
|
||||
safetyPromise: 1,
|
||||
startDate: this.single
|
||||
startDate: this.formData.single
|
||||
}
|
||||
leaveSave(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
@@ -547,17 +543,17 @@
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.form-item {
|
||||
.form-item {
|
||||
padding: 15rpx 20rpx;
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
@@ -572,30 +568,30 @@
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.form-text {
|
||||
.form-text {
|
||||
width: 95%;
|
||||
margin-bottom: 20rpx;
|
||||
border-bottom: 1px solid #ededee;
|
||||
}
|
||||
}
|
||||
|
||||
.form-img {
|
||||
.form-img {
|
||||
width: 95%;
|
||||
margin-bottom: 20rpx;
|
||||
border-bottom: 1px solid #ededee;
|
||||
}
|
||||
}
|
||||
|
||||
.example-body {
|
||||
.example-body {
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.txt {
|
||||
.txt {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
.label {
|
||||
text-align: right;
|
||||
margin-right: 20rpx;
|
||||
|
||||
@@ -603,9 +599,9 @@
|
||||
color: red;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.select {
|
||||
.select {
|
||||
color: #888889;
|
||||
white-space: nowrap;
|
||||
/* 防止换行 */
|
||||
@@ -613,14 +609,14 @@
|
||||
/* 隐藏溢出部分 */
|
||||
text-overflow: ellipsis;
|
||||
/* 显示省略号 */
|
||||
}
|
||||
}
|
||||
|
||||
.uni-input {
|
||||
.uni-input {
|
||||
color: #888889;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
position: fixed;
|
||||
@@ -637,23 +633,23 @@
|
||||
background-color: #4097FE;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.form-address {
|
||||
.form-address {
|
||||
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
.labelsafe {
|
||||
.labelsafe {
|
||||
color: red;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.form-canvas {
|
||||
.form-canvas {
|
||||
width: 95%;
|
||||
margin-bottom: 25px;
|
||||
|
||||
@@ -685,9 +681,9 @@
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tab-box {
|
||||
.tab-box {
|
||||
width: 80%;
|
||||
height: 100vh;
|
||||
background-color: #f0f0f0;
|
||||
@@ -697,14 +693,14 @@
|
||||
height: 300rpx;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.safety-popup {}
|
||||
.safety-popup {}
|
||||
</style>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
.popup-content {
|
||||
.popup-content {
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -737,5 +733,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -419,8 +419,8 @@
|
||||
if (pages.length > 0) {
|
||||
const prevPage = pages[pages.length - 2] || pages[pages.length - 1]
|
||||
if (prevPage && typeof prevPage.handleChange === 'function') {
|
||||
prevPage.handleChange(2);
|
||||
console.log('刷新已办任务数据');
|
||||
prevPage.handleChange(1);
|
||||
console.log('切回待办任务');
|
||||
} else if (prevPage && typeof prevPage.getLeaveList === 'function') {
|
||||
prevPage.getLeaveList();
|
||||
}
|
||||
@@ -624,7 +624,7 @@
|
||||
if (pages.length > 0) {
|
||||
const prevPage = pages[pages.length - 2] || pages[pages.length - 1]
|
||||
if (prevPage && typeof prevPage.handleChange === 'function') {
|
||||
prevPage.handleChange(2);
|
||||
prevPage.handleChange(1);
|
||||
} else if (prevPage && typeof prevPage.getLeaveList ===
|
||||
'function') {
|
||||
prevPage.getLeaveList();
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
@change="handleGradeChange" class="filter-picker">
|
||||
<view class="picker-content">
|
||||
<!-- 添加空值判断 -->
|
||||
<text
|
||||
class="picker-text">{{ gradeList[gradeIndex] ? gradeList[gradeIndex].gradeName : '全部' }}</text>
|
||||
<text class="picker-text">{{ gradeList[gradeIndex] ? gradeList[gradeIndex].gradeName
|
||||
: '全部' }}</text>
|
||||
<uni-icons type="bottom" size="20rpx" color="#999"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
@@ -34,8 +34,8 @@
|
||||
<picker mode="selector" :range="dormAreaList" :range-key="'name'" :value="dormAreaIndex"
|
||||
@change="handleDormAreaChange" class="filter-picker">
|
||||
<view class="picker-content">
|
||||
<text
|
||||
class="picker-text">{{ dormAreaList[dormAreaIndex] ? dormAreaList[dormAreaIndex].name : '全部' }}</text>
|
||||
<text class="picker-text">{{ dormAreaList[dormAreaIndex] ?
|
||||
dormAreaList[dormAreaIndex].name : '全部' }}</text>
|
||||
<uni-icons type="bottom" size="20rpx" color="#999"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
@@ -48,8 +48,8 @@
|
||||
:disabled="!queryParams.campusId" @change="handleParkChange" class="filter-picker"
|
||||
id="park">
|
||||
<view class="picker-content">
|
||||
<text
|
||||
class="picker-text">{{ parkList[parkIndex] ? parkList[parkIndex].name : '全部' }}</text>
|
||||
<text class="picker-text">{{ parkList[parkIndex] ? parkList[parkIndex].name : '全部'
|
||||
}}</text>
|
||||
<uni-icons type="bottom" size="20rpx" color="#999"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
@@ -59,7 +59,7 @@
|
||||
<view class="filter-item">
|
||||
<text class="filter-label">宿舍</text>
|
||||
<view @click="addRecordsPopup" class="filter-input">
|
||||
{{ dormValue || '请输入'}}
|
||||
{{ dormValue || '请输入' }}
|
||||
</view>
|
||||
</view>
|
||||
<uni-popup ref="popupTime" class="popup-time" background-color="#ffffff">
|
||||
@@ -73,8 +73,8 @@
|
||||
<picker range-key="name" :value="buildingIndex" :range="buildingOptions"
|
||||
@change="handleBuildingChange">
|
||||
<view class="uni-input">
|
||||
<text
|
||||
class="val">{{buildingOptions[buildingIndex] ? buildingOptions[buildingIndex].name : '全部'}}</text>
|
||||
<text class="val">{{ buildingOptions[buildingIndex] ?
|
||||
buildingOptions[buildingIndex].name : '全部' }}</text>
|
||||
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
@@ -84,8 +84,8 @@
|
||||
<picker @change="handleFloorChange" :range="floorOptions" :range-key="'floor'"
|
||||
:disabled="!queryParams.buildingId">
|
||||
<view class="uni-input">
|
||||
<text
|
||||
class="val">{{floorOptions[floorIndex] ? floorOptions[floorIndex].floor : '全部'}}</text>
|
||||
<text class="val">{{ floorOptions[floorIndex] ?
|
||||
floorOptions[floorIndex].floor : '全部' }}</text>
|
||||
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
@@ -95,8 +95,8 @@
|
||||
<picker @change="handleDormChange" :range="dormOptions" :range-key="'roomNo'"
|
||||
:disabled="!queryParams.floorId">
|
||||
<view class="uni-input">
|
||||
<text
|
||||
class="val">{{dormOptions[dormIndex] ? dormOptions[dormIndex].roomNo : '全部'}}</text>
|
||||
<text class="val">{{ dormOptions[dormIndex] ?
|
||||
dormOptions[dormIndex].roomNo : '全部' }}</text>
|
||||
<uni-icons type="calendar" size="25" color="#202020"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
@@ -125,9 +125,17 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-modal :show="showNotice" title="提示"
|
||||
:content="noticeContent"
|
||||
:showCancelButton="false"
|
||||
:closeOnClickOverlay="true"
|
||||
@confirm="onCloseNotice"
|
||||
@close="onCloseNotice" />
|
||||
|
||||
<!-- 添加信息收集按钮 -->
|
||||
<view class="add" @click="addDormInfo" v-if="roleGroup == '学生'">+</view>
|
||||
|
||||
|
||||
<!-- 滚动容器 -->
|
||||
<scroll-view ref="scrollRef" class="scroll-container" scroll-y @scrolltolower="loadNextPage"
|
||||
@refresherrefresh="handleRefresh">
|
||||
@@ -153,6 +161,9 @@
|
||||
<view>入住时间: {{ item.checkinTime }}</view>
|
||||
<view>状态: {{ item.inStatus === '1' ? '已入住' : '未入住' }}</view>
|
||||
</view>
|
||||
<view class="item-actions">
|
||||
<button class="edit-btn" @click.stop="editItem(item)">详情</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -162,26 +173,25 @@
|
||||
<view v-if="dormInfo.length === 0 && !isLoading" class="no-data">暂无数据</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
import {
|
||||
getDeptName,
|
||||
listAllCampus,
|
||||
listParkByCampus,
|
||||
listAllRoomByFloor,
|
||||
listBuildingByPark,
|
||||
listFloorByBuilding,
|
||||
listAllRoomByFloor,
|
||||
listStudent,
|
||||
getDeptName
|
||||
} from "@/api/dms/studentDormInfo/index.js"
|
||||
import {
|
||||
listGrade,
|
||||
listParkByCampus,
|
||||
listStudent
|
||||
} from "@/api/dms/studentDormInfo/index.js";
|
||||
import {
|
||||
getUserProfile
|
||||
} from '@/api/system/user'
|
||||
import {
|
||||
listGrade
|
||||
} from "@/api/dms/studentDormInfo/index.js"
|
||||
export default {
|
||||
} from '@/api/system/user';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
queryParams: {
|
||||
@@ -230,10 +240,13 @@
|
||||
roleGroup: null,
|
||||
// 存储搜索区高度(非学生有搜索区,学生无)
|
||||
searchAreaHeight: 0,
|
||||
showNotice: false,
|
||||
noticeContent: '请在一周内确认自己的住宿信息和银行卡信息,并上传个人证件照',
|
||||
dormValue: ''
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.openNotice()
|
||||
// 每次显示页面时重置数据并重新加载
|
||||
this.resetData()
|
||||
this.getUserProfile()
|
||||
@@ -246,6 +259,9 @@
|
||||
this.setScrollContentPadding()
|
||||
})
|
||||
},
|
||||
onLoad() {
|
||||
this.$nextTick(() => this.openNotice())
|
||||
},
|
||||
watch: {
|
||||
// 监听角色变化,重新设置内边距(防止角色切换导致适配问题)
|
||||
roleGroup() {
|
||||
@@ -256,6 +272,13 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openNotice() {
|
||||
this.showNotice = true
|
||||
},
|
||||
onCloseNotice() {
|
||||
this.showNotice = false
|
||||
},
|
||||
onGoFill() {},
|
||||
// 重置分页数据(用于刷新或重新加载)
|
||||
resetData() {
|
||||
this.queryParams.pageNum = 1
|
||||
@@ -419,9 +442,14 @@
|
||||
|
||||
// 点击列表项
|
||||
handleItemClick(item) {
|
||||
console.log('点击学生信息:', item)
|
||||
// 可添加跳转详情页逻辑
|
||||
// uni.navigateTo({ url: `/pages/detail?id=${item.id}` })
|
||||
const itemId = item.id
|
||||
uni.navigateTo({ url: `/pages/dormitory/studentDormInfo/informationCollection?mode=edit&id=${itemId}` })
|
||||
},
|
||||
|
||||
// 明示编辑按钮
|
||||
editItem(item) {
|
||||
const itemId = item.id
|
||||
uni.navigateTo({ url: `/pages/dormitory/studentDormInfo/informationCollection?mode=edit&id=${itemId}` })
|
||||
},
|
||||
|
||||
// 获取年级
|
||||
@@ -680,21 +708,23 @@
|
||||
destroyed() {
|
||||
clearTimeout(this.searchTimer)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.page-container {
|
||||
.page-container {
|
||||
position: relative;
|
||||
height: 100vh;
|
||||
background-color: #f5f7fa;
|
||||
box-sizing: border-box;
|
||||
/* 禁止页面滚动 */
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
/* 固定搜索区*/
|
||||
.fixed-search-wrap {
|
||||
|
||||
|
||||
/* 固定搜索区*/
|
||||
.fixed-search-wrap {
|
||||
position: fixed;
|
||||
top: 44px;
|
||||
/* 原生title高度 */
|
||||
@@ -705,38 +735,38 @@
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 14px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
/* 触发器:样式简洁,点击区域大 */
|
||||
.search-header {
|
||||
/* 触发器:样式简洁,点击区域大 */
|
||||
.search-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid #f5f5f5;
|
||||
}
|
||||
}
|
||||
|
||||
.search-header-title {
|
||||
.search-header-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
/* 搜索内容*/
|
||||
.search-content {
|
||||
/* 搜索内容*/
|
||||
.search-content {
|
||||
transition: all 0.3s ease;
|
||||
/* 动画过渡更自然 */
|
||||
}
|
||||
}
|
||||
|
||||
.search-card {
|
||||
.search-card {
|
||||
padding: 20rpx;
|
||||
box-shadow: none;
|
||||
/* 收缩时去掉阴影,更简洁 */
|
||||
}
|
||||
}
|
||||
|
||||
/* 滚动容器:调整顶部内边距,适应搜索区高度变化 */
|
||||
.scroll-container {
|
||||
/* 滚动容器:调整顶部内边距,适应搜索区高度变化 */
|
||||
.scroll-container {
|
||||
position: absolute;
|
||||
top: 44px;
|
||||
/* 与原生title对齐 */
|
||||
@@ -747,20 +777,20 @@
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
/* 滚动内容容器:处理内边距,避免内容被遮挡 */
|
||||
.scroll-content {
|
||||
/* 滚动内容容器:处理内边距,避免内容被遮挡 */
|
||||
.scroll-content {
|
||||
/* 底部预留加载状态高度 */
|
||||
padding-bottom: 40rpx;
|
||||
/* 左右内边距 */
|
||||
padding-left: 20rpx;
|
||||
padding-right: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
/* 以下为原有样式,无需修改 */
|
||||
.add {
|
||||
/* 以下为原有样式,无需修改 */
|
||||
.add {
|
||||
position: fixed;
|
||||
bottom: 50rpx;
|
||||
right: 50rpx;
|
||||
@@ -775,121 +805,136 @@
|
||||
font-size: 60rpx;
|
||||
box-shadow: 0 4rpx 12rpx rgba(24, 144, 255, 0.3);
|
||||
z-index: 99;
|
||||
}
|
||||
}
|
||||
|
||||
.dorm-list {
|
||||
.dorm-list {
|
||||
// padding: 20rpx;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.dorm-item {
|
||||
.dorm-item {
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 28rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
}
|
||||
|
||||
.dorm-item:active {
|
||||
.item-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
background-color: #1890ff;
|
||||
color: #fff;
|
||||
border-radius: 8rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
|
||||
.dorm-item:active {
|
||||
transform: scale(0.99);
|
||||
}
|
||||
}
|
||||
|
||||
.item-header {
|
||||
.item-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
padding-bottom: 16rpx;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
.name {
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.tag {
|
||||
.tag {
|
||||
font-size: 24rpx;
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 20rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.head-tag {
|
||||
.head-tag {
|
||||
background-color: #28a745;
|
||||
}
|
||||
}
|
||||
|
||||
.item-content {
|
||||
.item-content {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
line-height: 1.8;
|
||||
}
|
||||
}
|
||||
|
||||
.item-content view {
|
||||
.item-content view {
|
||||
margin-bottom: 14rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item-content view:last-child {
|
||||
.item-content view:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.loading,
|
||||
.no-more,
|
||||
.no-data {
|
||||
.loading,
|
||||
.no-more,
|
||||
.no-data {
|
||||
text-align: center;
|
||||
padding: 30rpx 0;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.no-data {
|
||||
.no-data {
|
||||
padding: 100rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.search-row {
|
||||
.search-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #f5f7fa;
|
||||
border-radius: 60rpx;
|
||||
padding: 14rpx 20rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.search-icon {
|
||||
.search-icon {
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.search-input {
|
||||
.search-input {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.filter-row {
|
||||
.filter-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.filter-item {
|
||||
.filter-item {
|
||||
flex: 1;
|
||||
min-width: 120rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.filter-label {
|
||||
.filter-label {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
padding-left: 4rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.picker-content,
|
||||
.filter-input {
|
||||
.picker-content,
|
||||
.filter-input {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 26rpx;
|
||||
@@ -899,19 +944,19 @@
|
||||
border-radius: 12rpx;
|
||||
height: 60rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
.filter-input::placeholder {
|
||||
.filter-input::placeholder {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.action-row {
|
||||
.action-row {
|
||||
display: flex;
|
||||
gap: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.reset-btn,
|
||||
.search-btn {
|
||||
.reset-btn,
|
||||
.search-btn {
|
||||
flex: 1;
|
||||
height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
@@ -920,26 +965,26 @@
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.reset-btn {
|
||||
.reset-btn {
|
||||
background-color: #fff;
|
||||
color: #1890FF;
|
||||
border: 1px solid #1890FF;
|
||||
}
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
.search-btn {
|
||||
background-color: #1890FF;
|
||||
color: #fff;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
.btn-icon {
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.popup-time,
|
||||
.popup-audit {
|
||||
.popup-time,
|
||||
.popup-audit {
|
||||
width: 80%;
|
||||
|
||||
.popup-content {
|
||||
@@ -956,6 +1001,8 @@
|
||||
border-bottom: 1px solid #F5F5F7;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.form-item {
|
||||
width: 100%;
|
||||
margin-top: 40rpx;
|
||||
@@ -1017,5 +1064,52 @@
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
.notice-popup .notice-card{
|
||||
width: 80%;
|
||||
max-width: 680rpx;
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 40rpx 32rpx;
|
||||
box-shadow: 0 12rpx 32rpx rgba(0,0,0,0.12);
|
||||
}
|
||||
.notice-popup .title{
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
}
|
||||
.notice-popup .msg{
|
||||
margin-top: 28rpx;
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
text-align: center;
|
||||
}
|
||||
.notice-popup .actions{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 36rpx;
|
||||
}
|
||||
.notice-popup .btn{
|
||||
flex: 0 0 auto;
|
||||
min-width: 300rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 16rpx;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
.notice-popup .btn.cancel{
|
||||
background: #F5F7FA;
|
||||
color: #333;
|
||||
}
|
||||
.notice-popup .btn.primary{
|
||||
background: #1890FF;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="form-container">
|
||||
<view class="form-title">2025-2026学年学生宿舍入住收集表</view>
|
||||
<view class="form-title">学生宿舍入住收集表</view>
|
||||
<view class="form-desc">涉及住宿费核算,请同学们按照实际入住情况填写。</view>
|
||||
|
||||
<!-- 1. 校区 -->
|
||||
@@ -81,6 +81,16 @@
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="item-label">中国农业银行卡号</view>
|
||||
<input class="input" v-model="form.xhk" placeholder="请输入中国农业银行卡号" />
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="item-label">开户行</view>
|
||||
<input class="input" v-model="form.bankAddr" placeholder="请输入开户行" />
|
||||
</view>
|
||||
|
||||
<!-- 9. 本人证件照 -->
|
||||
<view class="form-item">
|
||||
<view class="item-label">
|
||||
@@ -103,26 +113,28 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
import {
|
||||
addStudent,
|
||||
listAllCampus,
|
||||
listParkByCampus,
|
||||
listAllRoomByFloor,
|
||||
listBuildingByPark,
|
||||
listFloorByBuilding,
|
||||
listAllRoomByFloor,
|
||||
addStudent,
|
||||
submitOwnInfo as submitExtraInfo
|
||||
} from "@/api/dms/studentDormInfo/index.js"
|
||||
import {
|
||||
listParkByCampus,
|
||||
submitOwnInfo as submitExtraInfo,
|
||||
getStudentDetail,
|
||||
updateStudent
|
||||
} from "@/api/dms/studentDormInfo/index.js";
|
||||
import { alipayVali } from "@/api/helpFunc/bank.js";
|
||||
import {
|
||||
getUserProfile
|
||||
} from '@/api/system/user'
|
||||
import {
|
||||
previewImg
|
||||
} from "@/utils/uploadImg.js"
|
||||
import {
|
||||
} from '@/api/system/user';
|
||||
import uploadFile from "@/plugins/upload.js";
|
||||
import config from '@/config'
|
||||
import {
|
||||
checkPic
|
||||
} from "@/utils/checkPic.js"
|
||||
import uploadFile from "@/plugins/upload.js";
|
||||
export default {
|
||||
} from "@/utils/checkPic.js";
|
||||
import request from "@/utils/request";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: [],
|
||||
@@ -137,6 +149,8 @@
|
||||
isDormHead: '',
|
||||
checkinTime: '',
|
||||
photo: '',
|
||||
xhk: '',
|
||||
bankAddr: '',
|
||||
teacherName: '',
|
||||
className: '',
|
||||
deptName: '',
|
||||
@@ -163,11 +177,18 @@
|
||||
selectedBuilding: null, // 选中的楼栋
|
||||
selectedFloor: null, // 选中的楼层
|
||||
selectedDorm: null, //选中的宿舍
|
||||
mode: 'add',
|
||||
editId: null
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(options) {
|
||||
this.getUserProfile()
|
||||
this.listAllCampus()
|
||||
if (options && options.mode === 'edit' && options.id) {
|
||||
this.mode = 'edit'
|
||||
this.editId = Number(options.id)
|
||||
this.initEdit(this.editId)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取用户信息
|
||||
@@ -187,6 +208,85 @@
|
||||
if (res.code == 200) {
|
||||
this.campusOptions = [...res.data]
|
||||
}
|
||||
},
|
||||
// 编辑模式初始化
|
||||
async initEdit(id) {
|
||||
try {
|
||||
const res = await getStudentDetail(id)
|
||||
if (res.code !== 200) {
|
||||
uni.showToast({ title: '加载详情失败', icon: 'none' })
|
||||
return
|
||||
}
|
||||
const d = res.data
|
||||
this.form.stuNo = d.stuNo || this.form.stuNo
|
||||
this.form.isDormHead = d.isDormitoryHead === 1 ? '是' : '否'
|
||||
this.form.checkinTime = d.checkinTime ? String(d.checkinTime).slice(0, 10) : ''
|
||||
this.form.isInStudentsleep = d.isInStudentsleep || this.form.isInStudentsleep
|
||||
|
||||
const own = await request({ url: '/system/student/getOwnInfo', method: 'get' })
|
||||
if (own && own.data) {
|
||||
this.form.xhk = own.data.xhk || ''
|
||||
this.form.bankAddr = own.data.bankAddr || ''
|
||||
}
|
||||
|
||||
const extra = await request({ url: '/comprehensive/extraInfo/getOwnInfo', method: 'get' })
|
||||
if (extra && extra.data) {
|
||||
this.form.photo = extra.data.whitePhoto || ''
|
||||
this.form.photoData = extra.data.whitePhoto ? (config.baseUrl + extra.data.whitePhoto) : ''
|
||||
}
|
||||
|
||||
const campusName = d.campusName
|
||||
const parkName = d.parkName
|
||||
const buildingName = d.buildingName
|
||||
const floorName = d.floorName
|
||||
const roomNo = d.roomNo
|
||||
|
||||
const campus = this.campusOptions.find(c => c.name === campusName)
|
||||
if (campus) {
|
||||
this.form.campusName = campus.name
|
||||
this.selectedCampus = campus.id
|
||||
await this.listParkByCampus(this.selectedCampus)
|
||||
const park = this.parkOptions.find(p => p.name === parkName)
|
||||
if (park) {
|
||||
this.form.parkName = park.name
|
||||
this.selectedPark = park.id
|
||||
await this.listBuildingByPark(this.selectedPark)
|
||||
const building = this.buildingOptions.find(b => b.name === buildingName)
|
||||
if (building) {
|
||||
this.form.buildingName = building.name
|
||||
this.selectedBuilding = building.id
|
||||
await this.listFloorByBuilding(this.selectedBuilding)
|
||||
let floor = this.floorOptions.find(f => String(f.floor) === String(floorName))
|
||||
if (!floor) {
|
||||
for (const f of this.floorOptions) {
|
||||
await this.listAllRoomByFloor(f.id)
|
||||
const dormTry = this.dormOptions.find(r => r.roomNo === roomNo)
|
||||
if (dormTry) {
|
||||
floor = f
|
||||
this.selectedDorm = dormTry.id
|
||||
this.form.roomNo = dormTry.roomNo
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if (floor) {
|
||||
this.form.floorName = floor.floor
|
||||
this.selectedFloor = floor.id
|
||||
if (!this.selectedDorm) {
|
||||
await this.listAllRoomByFloor(this.selectedFloor)
|
||||
const dorm = this.dormOptions.find(r => r.roomNo === roomNo)
|
||||
if (dorm) {
|
||||
this.form.roomNo = dorm.roomNo
|
||||
this.selectedDorm = dorm.id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
},
|
||||
// 根据校区id获取园区
|
||||
async listParkByCampus(id) {
|
||||
@@ -333,7 +433,7 @@
|
||||
(!this.form.roomNo && this.form.roomNo !== 0) || // 宿舍号(数值,排除0的误判)
|
||||
!this.form.isDormHead || // 是否宿舍长(值为"是"/"否")
|
||||
!this.form.checkinTime || // 入住时间(日期字符串,空则false)
|
||||
!this.form.photo // 证件照(blob路径,空则false,若必填需加)
|
||||
!this.form.photo
|
||||
) {
|
||||
uni.showToast({
|
||||
title: '带*号的为必填项,请填写完整',
|
||||
@@ -342,24 +442,56 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.form.dormitoryId = this.selectedDorm;
|
||||
// 模拟提交
|
||||
uni.showLoading({
|
||||
title: '提交中...'
|
||||
});
|
||||
// 添加入住信息
|
||||
let res = await addStudent(this.form);
|
||||
if (res.code == 200) {
|
||||
uni.hideLoading();
|
||||
if (this.form.xhk) {
|
||||
let cardRes = await alipayVali(this.form.xhk);
|
||||
if (!cardRes || cardRes.validated == false) {
|
||||
uni.showToast({
|
||||
title: '提交成功',
|
||||
icon: 'success'
|
||||
title: '请输入正确的银行卡号',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (cardRes.bank != 'ABC') {
|
||||
uni.showToast({
|
||||
title: '请输入正确的中国农业银行银行卡号',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.form.dormitoryId = this.selectedDorm;
|
||||
uni.showLoading({ title: '提交中...' });
|
||||
let res;
|
||||
if (this.mode === 'edit') {
|
||||
const dto = {
|
||||
id: this.editId,
|
||||
dormitoryId: this.form.dormitoryId,
|
||||
stuNo: this.form.stuNo,
|
||||
isDormitoryHead: this.form.isDormHead === '是' ? 1 : 0,
|
||||
checkinTime: this.form.checkinTime ? new Date(this.form.checkinTime) : null,
|
||||
isInStudentsleep: this.form.isInStudentsleep || '是'
|
||||
}
|
||||
res = await updateStudent(dto)
|
||||
} else {
|
||||
res = await addStudent(this.form);
|
||||
}
|
||||
if (res.code == 200) {
|
||||
// 上次图片头像
|
||||
let data = submitExtraInfo({
|
||||
userId: this.user.data.userId,
|
||||
whitePhoto: this.form.photo
|
||||
})
|
||||
let own = await request({ url: '/system/student/getOwnInfo', method: 'get' });
|
||||
let payload = {
|
||||
phone: own.data.phone,
|
||||
xhk: this.form.xhk ? this.form.xhk.replace(' ', '') : own.data.xhk,
|
||||
idCard: own.data.idCard,
|
||||
birthday: own.data.birthday,
|
||||
bankAddr: this.form.bankAddr ? this.form.bankAddr : own.data.bankAddr
|
||||
};
|
||||
await request({ url: '/system/student/changeOwnInfo', method: 'POST', data: payload });
|
||||
uni.hideLoading();
|
||||
uni.showToast({ title: '提交成功', icon: 'success' });
|
||||
// if (data.code == 200) {
|
||||
// console.log(data);
|
||||
// }
|
||||
@@ -375,67 +507,67 @@
|
||||
stuNo: '',
|
||||
isDormitoryHead: '',
|
||||
checkinTime: '',
|
||||
photo: ''
|
||||
photo: '',
|
||||
xhk: '',
|
||||
bankAddr: ''
|
||||
};
|
||||
uni.redirectTo({
|
||||
url: `/pages/dormitory/studentDormInfo/index`
|
||||
})
|
||||
uni.redirectTo({ url: `/pages/dormitory/studentDormInfo/index` })
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.form-container {
|
||||
.form-container {
|
||||
padding: 30rpx;
|
||||
background-color: #fff;
|
||||
min-height: 100vh;
|
||||
}
|
||||
}
|
||||
|
||||
.form-title {
|
||||
.form-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.form-desc {
|
||||
.form-desc {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.form-item {
|
||||
.form-item {
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item-label {
|
||||
.item-label {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
margin-bottom: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
// 红色*号样式
|
||||
.required {
|
||||
// 红色*号样式
|
||||
.required {
|
||||
color: #ff4d4f;
|
||||
margin-right: 6rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.item-desc {
|
||||
.item-desc {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 下拉框样式
|
||||
.picker-input {
|
||||
// 下拉框样式
|
||||
.picker-input {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
border: 1px solid #eee;
|
||||
@@ -446,10 +578,10 @@
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
}
|
||||
|
||||
// 输入框样式
|
||||
.input {
|
||||
// 输入框样式
|
||||
.input {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
border: 1px solid #eee;
|
||||
@@ -457,10 +589,10 @@
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 图片上传样式
|
||||
.upload-btn {
|
||||
// 图片上传样式
|
||||
.upload-btn {
|
||||
width: 200rpx;
|
||||
height: 80rpx;
|
||||
border: 1px dashed #ccc;
|
||||
@@ -472,33 +604,33 @@
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-icon {
|
||||
.upload-icon {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-tip {
|
||||
.upload-tip {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-preview {
|
||||
.upload-preview {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
border-radius: 8rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-preview image {
|
||||
.upload-preview image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
// 提交按钮样式
|
||||
.submit-btn {
|
||||
// 提交按钮样式
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
background-color: #1890ff;
|
||||
@@ -506,5 +638,5 @@
|
||||
font-size: 32rpx;
|
||||
border-radius: 45rpx;
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user