Compare commits

...

2 Commits

9 changed files with 2065 additions and 1745 deletions

View File

@@ -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() { export function listAllCampus() {
return request({ return request({

View File

@@ -1,32 +1,32 @@
import request from '@/utils/request' import request from '@/utils/request'
export function myProcess(data){ export function myProcess(params){
return request({ return request({
'url': '/flowable/task/myProcess', url: '/flowable/task/myProcess',
'method': 'get', method: 'get',
data params
}) })
} }
export function todoList(data){ export function todoList(params){
return request({ return request({
'url': '/flowable/task/todoList', url: '/flowable/task/todoList',
'method': 'get', method: 'get',
data params
}) })
} }
export function finishedList(data){ export function finishedList(params){
return request({ return request({
'url': '/flowable/task/finishedList', url: '/flowable/task/finishedList',
'method': 'get', method: 'get',
data params
}) })
} }
export function flowRecord(data){ export function flowRecord(params){
return request({ return request({
'url': '/flowable/task/flowRecord', url: '/flowable/task/flowRecord',
'method': 'get', method: 'get',
data params
}) })
} }
export function complete(data){ export function complete(data){

View File

@@ -1,8 +1,12 @@
// 应用全局配置 // 应用全局配置
module.exports = { module.exports = {
// 统一通过本机 Nginx 反向代理访问后端
// 若在同一台机器调试:使用 localhost:8066
// 若手机在同一局域网:替换为本机局域网 IP例如 172.16.96.111:8066
// 页面在 https://zhxg.gxsdxy.cn 下访问,接口同域同协议以避免 CORS
// baseUrl: 'https://zhxg.gxsdxy.cn/prod_api', // baseUrl: 'https://zhxg.gxsdxy.cn/prod_api',
// baseUrl: 'http://172.16.96.111:8085', // baseUrl: 'https://zhxg.gxsdxy.cn/prod_api',
// baseUrl: 'http://192.168.211.22:8085', // 若本地/内网以 HTTP 访问页面,可改为:
baseUrl: 'http://localhost:8085', baseUrl: 'http://localhost:8085',
// 应用信息 // 应用信息
appInfo: { appInfo: {
@@ -28,7 +32,7 @@ module.exports = {
/** /**
* 开启cas * 开启cas
*/ */
casEnable: false, casEnable: true,
/** /**
* 单点登录url * 单点登录url
@@ -38,5 +42,5 @@ module.exports = {
/** /**
* 单点登出url * 单点登出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',
} }

View File

@@ -371,6 +371,7 @@
getRtStuQuitSchoolByProcInsId(procInsId) { getRtStuQuitSchoolByProcInsId(procInsId) {
getRtStuQuitSchoolByProcInsId(procInsId).then((res) => { getRtStuQuitSchoolByProcInsId(procInsId).then((res) => {
this.formData = res.data; this.formData = res.data;
console.log(this.formData)
this.get_penalty_type(this.formData.quitType); this.get_penalty_type(this.formData.quitType);
this.get_category(this.formData.quitCategory); this.get_category(this.formData.quitCategory);
if (this.tag == 1) { if (this.tag == 1) {
@@ -423,7 +424,7 @@
if (pages && pages.length > 0) { if (pages && pages.length > 0) {
const prevPage = pages[pages.length - 2] || pages[pages.length - 1]; const prevPage = pages[pages.length - 2] || pages[pages.length - 1];
if (prevPage && typeof prevPage.handleChange === 'function') { if (prevPage && typeof prevPage.handleChange === 'function') {
prevPage.handleChange(this.tag || 1); prevPage.handleChange(2);
} }
} }
@@ -498,10 +499,10 @@
uni.navigateBack({ uni.navigateBack({
success: () => { success: () => {
const pages = getCurrentPages(); const pages = getCurrentPages();
if (pages && pages.length > 0) { if (pages.length > 0) {
const prevPage = pages[pages.length - 2] || pages[pages.length - 1]; const prevPage = pages[pages.length - 2]
if (prevPage && typeof prevPage.handleChange === 'function') { if (prevPage && typeof prevPage.getList === 'function') {
prevPage.handleChange(this.tag || 1); prevPage.handleChange(2);
} }
} }
@@ -529,8 +530,8 @@
if (pages && pages.length > 0) { if (pages && pages.length > 0) {
const prevPage = pages[pages.length - 2] || pages[pages.length - 1]; const prevPage = pages[pages.length - 2] || pages[pages.length - 1];
if (prevPage && typeof prevPage.handleChange === 'function') { if (prevPage && typeof prevPage.handleChange === 'function') {
prevPage.handleChange(this.tag || 1); prevPage.handleChange(2);
console.log('刷新任务数据'); console.log('刷新已办任务数据');
} }
} }
} }

View File

@@ -8,6 +8,14 @@
</view> </view>
</view> </view>
<view class="content" v-if="processes.length!==0"> <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="list">
<view class="item" v-for="(process,index) in processes" :key="index"> <view class="item" v-for="(process,index) in processes" :key="index">
<view class="top"> <view class="top">
@@ -75,7 +83,9 @@
currentPage: 1, currentPage: 1,
loading: false, // 加载状态标志 loading: false, // 加载状态标志
topLoading: true, topLoading: true,
role: uni.getStorageSync("roles") role: uni.getStorageSync("roles"),
searchName: '',
searchDate: ''
}; };
}, },
onLoad(option) { onLoad(option) {
@@ -130,12 +140,42 @@
this.topLoading = true; this.topLoading = true;
this.getList(); 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() { getList() {
this.loading = true; this.loading = true;
let sdata = { let sdata = {
pageNum: this.currentPage, 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); console.log(this.processes);
if (this.currentTab == 0) { if (this.currentTab == 0) {
myProcess(sdata).then(res => { 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 { .empty {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -337,6 +412,7 @@
.content { .content {
padding-top: 58px; padding-top: 58px;
.list { .list {
.item { .item {
padding: 20px 10px; padding: 20px 10px;

View File

@@ -173,20 +173,19 @@
</template> </template>
<script> <script>
import uploadFile from "@/plugins/upload.js";
import {
baseUrl
} from "@/config.js";
import {
calculateDays,
convertToTimestamp
} from "@/utils/time-calculation.js"
import { import {
addApply, addApply,
getStuInfo, getStuInfo,
commonUpload,
leaveSave leaveSave
} from "@/api/applyleave/applyleave.js"; } 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 { export default {
data() { data() {
return { return {
@@ -306,7 +305,8 @@
title: "请勾选承诺书", title: "请勾选承诺书",
icon: "error" icon: "error"
}); });
return; // 阻止表单提交 uni.hideLoading();
return;
} }
if (this.formData.signFile == '') { if (this.formData.signFile == '') {
// 如果复选框未被选中,则不允许提交 // 如果复选框未被选中,则不允许提交
@@ -314,14 +314,16 @@
title: "请先进行签名", title: "请先进行签名",
icon: "error" icon: "error"
}); });
return; // 阻止表单提交 uni.hideLoading();
return;
} }
if (this.formData.endsingle < this.formData.single) { if (this.formData.endsingle < this.formData.single) {
uni.showToast({ uni.showToast({
title: "起始时间不能晚于结束时间", title: "起始时间不能晚于结束时间",
icon: "none" icon: "none"
}) })
return; // 阻止表单提交 uni.hideLoading();
return;
} }
//表单非空校验 //表单非空校验
const requiredFields = [ const requiredFields = [
@@ -339,6 +341,7 @@
title: `请填写完必填字段`, title: `请填写完必填字段`,
icon: "none" icon: "none"
}) })
uni.hideLoading();
return; return;
} }
let data = { let data = {
@@ -400,17 +403,10 @@
}, },
//上传签名 //上传签名
uploadSign(e) { uploadSign(e) {
const blob = this.base64ToBlob(e); uploadFile('/common/upload', e).then((res) => {
const fileObj = new File([blob], 'signature', { const data = JSON.parse(res);
type: 'image/png' this.formData.signFile = data.fileName;
}); this.signImg = data.url || (baseUrl + data.fileName);
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')
}) })
}, },
formDataToObject(formData) { formDataToObject(formData) {
@@ -497,7 +493,7 @@
}); });
return; // 阻止表单提交 return; // 阻止表单提交
} }
if (this.endsingle < this.single) { if (this.formData.endsingle < this.formData.single) {
uni.showToast({ uni.showToast({
title: "起始时间不能晚于结束时间", title: "起始时间不能晚于结束时间",
icon: "none" icon: "none"
@@ -508,15 +504,15 @@
let data = { let data = {
applicantSignature: this.formData.signFile, applicantSignature: this.formData.signFile,
attachment: this.attachmentFile, attachment: this.attachmentFile,
destination: this.endAddress, destination: this.formData.endAddress,
destinationDetails: this.address, destinationDetails: this.formData.address,
endDate: this.endsingle, endDate: this.formData.endsingle,
leaveDays: this.dataNum, leaveDays: this.formData.dataNum,
leaveType: this.selectedPoliticalIndex, leaveType: this.formData.selectedPoliticalIndex,
reason: this.deeds, reason: this.formData.deeds,
remark: this.remark, remark: this.remark,
safetyPromise: 1, safetyPromise: 1,
startDate: this.single startDate: this.formData.single
} }
leaveSave(data).then(res => { leaveSave(data).then(res => {
if (res.code == 200) { if (res.code == 200) {

View File

@@ -419,8 +419,8 @@
if (pages.length > 0) { if (pages.length > 0) {
const prevPage = pages[pages.length - 2] || pages[pages.length - 1] const prevPage = pages[pages.length - 2] || pages[pages.length - 1]
if (prevPage && typeof prevPage.handleChange === 'function') { if (prevPage && typeof prevPage.handleChange === 'function') {
prevPage.handleChange(2); prevPage.handleChange(1);
console.log('刷新已办任务数据'); console.log('切回待办任务');
} else if (prevPage && typeof prevPage.getLeaveList === 'function') { } else if (prevPage && typeof prevPage.getLeaveList === 'function') {
prevPage.getLeaveList(); prevPage.getLeaveList();
} }
@@ -624,7 +624,7 @@
if (pages.length > 0) { if (pages.length > 0) {
const prevPage = pages[pages.length - 2] || pages[pages.length - 1] const prevPage = pages[pages.length - 2] || pages[pages.length - 1]
if (prevPage && typeof prevPage.handleChange === 'function') { if (prevPage && typeof prevPage.handleChange === 'function') {
prevPage.handleChange(2); prevPage.handleChange(1);
} else if (prevPage && typeof prevPage.getLeaveList === } else if (prevPage && typeof prevPage.getLeaveList ===
'function') { 'function') {
prevPage.getLeaveList(); prevPage.getLeaveList();

View File

@@ -21,8 +21,8 @@
@change="handleGradeChange" class="filter-picker"> @change="handleGradeChange" class="filter-picker">
<view class="picker-content"> <view class="picker-content">
<!-- 添加空值判断 --> <!-- 添加空值判断 -->
<text <text class="picker-text">{{ gradeList[gradeIndex] ? gradeList[gradeIndex].gradeName
class="picker-text">{{ gradeList[gradeIndex] ? gradeList[gradeIndex].gradeName : '全部' }}</text> : '全部' }}</text>
<uni-icons type="bottom" size="20rpx" color="#999"></uni-icons> <uni-icons type="bottom" size="20rpx" color="#999"></uni-icons>
</view> </view>
</picker> </picker>
@@ -34,8 +34,8 @@
<picker mode="selector" :range="dormAreaList" :range-key="'name'" :value="dormAreaIndex" <picker mode="selector" :range="dormAreaList" :range-key="'name'" :value="dormAreaIndex"
@change="handleDormAreaChange" class="filter-picker"> @change="handleDormAreaChange" class="filter-picker">
<view class="picker-content"> <view class="picker-content">
<text <text class="picker-text">{{ dormAreaList[dormAreaIndex] ?
class="picker-text">{{ dormAreaList[dormAreaIndex] ? dormAreaList[dormAreaIndex].name : '全部' }}</text> dormAreaList[dormAreaIndex].name : '全部' }}</text>
<uni-icons type="bottom" size="20rpx" color="#999"></uni-icons> <uni-icons type="bottom" size="20rpx" color="#999"></uni-icons>
</view> </view>
</picker> </picker>
@@ -48,8 +48,8 @@
:disabled="!queryParams.campusId" @change="handleParkChange" class="filter-picker" :disabled="!queryParams.campusId" @change="handleParkChange" class="filter-picker"
id="park"> id="park">
<view class="picker-content"> <view class="picker-content">
<text <text class="picker-text">{{ parkList[parkIndex] ? parkList[parkIndex].name : '全部'
class="picker-text">{{ parkList[parkIndex] ? parkList[parkIndex].name : '全部' }}</text> }}</text>
<uni-icons type="bottom" size="20rpx" color="#999"></uni-icons> <uni-icons type="bottom" size="20rpx" color="#999"></uni-icons>
</view> </view>
</picker> </picker>
@@ -73,8 +73,8 @@
<picker range-key="name" :value="buildingIndex" :range="buildingOptions" <picker range-key="name" :value="buildingIndex" :range="buildingOptions"
@change="handleBuildingChange"> @change="handleBuildingChange">
<view class="uni-input"> <view class="uni-input">
<text <text class="val">{{ buildingOptions[buildingIndex] ?
class="val">{{buildingOptions[buildingIndex] ? buildingOptions[buildingIndex].name : '全部'}}</text> buildingOptions[buildingIndex].name : '全部' }}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons> <uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view> </view>
</picker> </picker>
@@ -84,8 +84,8 @@
<picker @change="handleFloorChange" :range="floorOptions" :range-key="'floor'" <picker @change="handleFloorChange" :range="floorOptions" :range-key="'floor'"
:disabled="!queryParams.buildingId"> :disabled="!queryParams.buildingId">
<view class="uni-input"> <view class="uni-input">
<text <text class="val">{{ floorOptions[floorIndex] ?
class="val">{{floorOptions[floorIndex] ? floorOptions[floorIndex].floor : '全部'}}</text> floorOptions[floorIndex].floor : '全部' }}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons> <uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view> </view>
</picker> </picker>
@@ -95,8 +95,8 @@
<picker @change="handleDormChange" :range="dormOptions" :range-key="'roomNo'" <picker @change="handleDormChange" :range="dormOptions" :range-key="'roomNo'"
:disabled="!queryParams.floorId"> :disabled="!queryParams.floorId">
<view class="uni-input"> <view class="uni-input">
<text <text class="val">{{ dormOptions[dormIndex] ?
class="val">{{dormOptions[dormIndex] ? dormOptions[dormIndex].roomNo : '全部'}}</text> dormOptions[dormIndex].roomNo : '全部' }}</text>
<uni-icons type="calendar" size="25" color="#202020"></uni-icons> <uni-icons type="calendar" size="25" color="#202020"></uni-icons>
</view> </view>
</picker> </picker>
@@ -125,9 +125,17 @@
</view> </view>
</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> <view class="add" @click="addDormInfo" v-if="roleGroup == '学生'">+</view>
<!-- 滚动容器 --> <!-- 滚动容器 -->
<scroll-view ref="scrollRef" class="scroll-container" scroll-y @scrolltolower="loadNextPage" <scroll-view ref="scrollRef" class="scroll-container" scroll-y @scrolltolower="loadNextPage"
@refresherrefresh="handleRefresh"> @refresherrefresh="handleRefresh">
@@ -153,6 +161,9 @@
<view>入住时间: {{ item.checkinTime }}</view> <view>入住时间: {{ item.checkinTime }}</view>
<view>状态: {{ item.inStatus === '1' ? '已入住' : '未入住' }}</view> <view>状态: {{ item.inStatus === '1' ? '已入住' : '未入住' }}</view>
</view> </view>
<view class="item-actions">
<button class="edit-btn" @click.stop="editItem(item)">详情</button>
</view>
</view> </view>
</view> </view>
@@ -162,25 +173,24 @@
<view v-if="dormInfo.length === 0 && !isLoading" class="no-data">暂无数据</view> <view v-if="dormInfo.length === 0 && !isLoading" class="no-data">暂无数据</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
<script> <script>
import { import {
getDeptName,
listAllCampus, listAllCampus,
listParkByCampus, listAllRoomByFloor,
listBuildingByPark, listBuildingByPark,
listFloorByBuilding, listFloorByBuilding,
listAllRoomByFloor, listGrade,
listStudent, listParkByCampus,
getDeptName listStudent
} from "@/api/dms/studentDormInfo/index.js" } from "@/api/dms/studentDormInfo/index.js";
import { import {
getUserProfile getUserProfile
} from '@/api/system/user' } from '@/api/system/user';
import {
listGrade
} from "@/api/dms/studentDormInfo/index.js"
export default { export default {
data() { data() {
return { return {
@@ -230,10 +240,13 @@
roleGroup: null, roleGroup: null,
// 存储搜索区高度(非学生有搜索区,学生无) // 存储搜索区高度(非学生有搜索区,学生无)
searchAreaHeight: 0, searchAreaHeight: 0,
showNotice: false,
noticeContent: '请在一周内确认自己的住宿信息和银行卡信息,并上传个人证件照',
dormValue: '' dormValue: ''
} }
}, },
onShow() { onShow() {
this.openNotice()
// 每次显示页面时重置数据并重新加载 // 每次显示页面时重置数据并重新加载
this.resetData() this.resetData()
this.getUserProfile() this.getUserProfile()
@@ -246,6 +259,9 @@
this.setScrollContentPadding() this.setScrollContentPadding()
}) })
}, },
onLoad() {
this.$nextTick(() => this.openNotice())
},
watch: { watch: {
// 监听角色变化,重新设置内边距(防止角色切换导致适配问题) // 监听角色变化,重新设置内边距(防止角色切换导致适配问题)
roleGroup() { roleGroup() {
@@ -256,6 +272,13 @@
} }
}, },
methods: { methods: {
openNotice() {
this.showNotice = true
},
onCloseNotice() {
this.showNotice = false
},
onGoFill() {},
// 重置分页数据(用于刷新或重新加载) // 重置分页数据(用于刷新或重新加载)
resetData() { resetData() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
@@ -419,9 +442,14 @@
// 点击列表项 // 点击列表项
handleItemClick(item) { handleItemClick(item) {
console.log('点击学生信息:', item) const itemId = item.id
// 可添加跳转详情页逻辑 uni.navigateTo({ url: `/pages/dormitory/studentDormInfo/informationCollection?mode=edit&id=${itemId}` })
// uni.navigateTo({ url: `/pages/detail?id=${item.id}` }) },
// 明示编辑按钮
editItem(item) {
const itemId = item.id
uni.navigateTo({ url: `/pages/dormitory/studentDormInfo/informationCollection?mode=edit&id=${itemId}` })
}, },
// 获取年级 // 获取年级
@@ -693,6 +721,8 @@
overflow: hidden; overflow: hidden;
} }
/* 固定搜索区*/ /* 固定搜索区*/
.fixed-search-wrap { .fixed-search-wrap {
position: fixed; position: fixed;
@@ -791,6 +821,21 @@
transition: transform 0.2s; transition: transform 0.2s;
} }
.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 { .dorm-item:active {
transform: scale(0.99); transform: scale(0.99);
} }
@@ -956,6 +1001,8 @@
border-bottom: 1px solid #F5F5F7; border-bottom: 1px solid #F5F5F7;
} }
.form-item { .form-item {
width: 100%; width: 100%;
margin-top: 40rpx; margin-top: 40rpx;
@@ -1019,3 +1066,50 @@
} }
} }
</style> </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>

View File

@@ -1,6 +1,6 @@
<template> <template>
<view class="form-container"> <view class="form-container">
<view class="form-title">2025-2026学年学生宿舍入住收集表</view> <view class="form-title">学生宿舍入住收集表</view>
<view class="form-desc">涉及住宿费核算请同学们按照实际入住情况填写</view> <view class="form-desc">涉及住宿费核算请同学们按照实际入住情况填写</view>
<!-- 1. 校区 --> <!-- 1. 校区 -->
@@ -81,6 +81,16 @@
</picker> </picker>
</view> </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. 本人证件照 --> <!-- 9. 本人证件照 -->
<view class="form-item"> <view class="form-item">
<view class="item-label"> <view class="item-label">
@@ -104,24 +114,26 @@
<script> <script>
import { import {
addStudent,
listAllCampus, listAllCampus,
listParkByCampus, listAllRoomByFloor,
listBuildingByPark, listBuildingByPark,
listFloorByBuilding, listFloorByBuilding,
listAllRoomByFloor, listParkByCampus,
addStudent, submitOwnInfo as submitExtraInfo,
submitOwnInfo as submitExtraInfo getStudentDetail,
} from "@/api/dms/studentDormInfo/index.js" updateStudent
} from "@/api/dms/studentDormInfo/index.js";
import { alipayVali } from "@/api/helpFunc/bank.js";
import { import {
getUserProfile getUserProfile
} from '@/api/system/user' } from '@/api/system/user';
import { import uploadFile from "@/plugins/upload.js";
previewImg import config from '@/config'
} from "@/utils/uploadImg.js"
import { import {
checkPic checkPic
} from "@/utils/checkPic.js" } from "@/utils/checkPic.js";
import uploadFile from "@/plugins/upload.js"; import request from "@/utils/request";
export default { export default {
data() { data() {
return { return {
@@ -137,6 +149,8 @@
isDormHead: '', isDormHead: '',
checkinTime: '', checkinTime: '',
photo: '', photo: '',
xhk: '',
bankAddr: '',
teacherName: '', teacherName: '',
className: '', className: '',
deptName: '', deptName: '',
@@ -163,11 +177,18 @@
selectedBuilding: null, // 选中的楼栋 selectedBuilding: null, // 选中的楼栋
selectedFloor: null, // 选中的楼层 selectedFloor: null, // 选中的楼层
selectedDorm: null, //选中的宿舍 selectedDorm: null, //选中的宿舍
mode: 'add',
editId: null
}; };
}, },
onLoad() { onLoad(options) {
this.getUserProfile() this.getUserProfile()
this.listAllCampus() this.listAllCampus()
if (options && options.mode === 'edit' && options.id) {
this.mode = 'edit'
this.editId = Number(options.id)
this.initEdit(this.editId)
}
}, },
methods: { methods: {
// 获取用户信息 // 获取用户信息
@@ -187,6 +208,85 @@
if (res.code == 200) { if (res.code == 200) {
this.campusOptions = [...res.data] 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获取园区 // 根据校区id获取园区
async listParkByCampus(id) { async listParkByCampus(id) {
@@ -333,7 +433,7 @@
(!this.form.roomNo && this.form.roomNo !== 0) || // 宿舍号数值排除0的误判 (!this.form.roomNo && this.form.roomNo !== 0) || // 宿舍号数值排除0的误判
!this.form.isDormHead || // 是否宿舍长(值为"是"/"否" !this.form.isDormHead || // 是否宿舍长(值为"是"/"否"
!this.form.checkinTime || // 入住时间日期字符串空则false !this.form.checkinTime || // 入住时间日期字符串空则false
!this.form.photo // 证件照blob路径空则false若必填需加 !this.form.photo
) { ) {
uni.showToast({ uni.showToast({
title: '带*号的为必填项,请填写完整', title: '带*号的为必填项,请填写完整',
@@ -342,24 +442,56 @@
}); });
return; return;
} }
this.form.dormitoryId = this.selectedDorm; if (this.form.xhk) {
// 模拟提交 let cardRes = await alipayVali(this.form.xhk);
uni.showLoading({ if (!cardRes || cardRes.validated == false) {
title: '提交中...'
});
// 添加入住信息
let res = await addStudent(this.form);
if (res.code == 200) {
uni.hideLoading();
uni.showToast({ uni.showToast({
title: '提交成功', title: '请输入正确的银行卡号',
icon: 'success' 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({ let data = submitExtraInfo({
userId: this.user.data.userId, userId: this.user.data.userId,
whitePhoto: this.form.photo 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) { // if (data.code == 200) {
// console.log(data); // console.log(data);
// } // }
@@ -375,11 +507,11 @@
stuNo: '', stuNo: '',
isDormitoryHead: '', isDormitoryHead: '',
checkinTime: '', checkinTime: '',
photo: '' photo: '',
xhk: '',
bankAddr: ''
}; };
uni.redirectTo({ uni.redirectTo({ url: `/pages/dormitory/studentDormInfo/index` })
url: `/pages/dormitory/studentDormInfo/index`
})
}, 1000); }, 1000);
} }
} }