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;
|
||||
|
||||
@@ -173,20 +173,19 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uploadFile from "@/plugins/upload.js";
|
||||
import {
|
||||
baseUrl
|
||||
} from "@/config.js";
|
||||
import {
|
||||
calculateDays,
|
||||
convertToTimestamp
|
||||
} from "@/utils/time-calculation.js"
|
||||
import {
|
||||
addApply,
|
||||
getStuInfo,
|
||||
commonUpload,
|
||||
leaveSave
|
||||
} 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 {
|
||||
@@ -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) {
|
||||
|
||||
@@ -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>
|
||||
@@ -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,25 +173,24 @@
|
||||
<view v-if="dormInfo.length === 0 && !isLoading" class="no-data">暂无数据</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getDeptName,
|
||||
listAllCampus,
|
||||
listParkByCampus,
|
||||
listAllRoomByFloor,
|
||||
listBuildingByPark,
|
||||
listFloorByBuilding,
|
||||
listAllRoomByFloor,
|
||||
listStudent,
|
||||
getDeptName
|
||||
} from "@/api/dms/studentDormInfo/index.js"
|
||||
listGrade,
|
||||
listParkByCampus,
|
||||
listStudent
|
||||
} from "@/api/dms/studentDormInfo/index.js";
|
||||
import {
|
||||
getUserProfile
|
||||
} from '@/api/system/user'
|
||||
import {
|
||||
listGrade
|
||||
} from "@/api/dms/studentDormInfo/index.js"
|
||||
} from '@/api/system/user';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -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}` })
|
||||
},
|
||||
|
||||
// 获取年级
|
||||
@@ -693,6 +721,8 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 固定搜索区*/
|
||||
.fixed-search-wrap {
|
||||
position: fixed;
|
||||
@@ -791,6 +821,21 @@
|
||||
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 {
|
||||
transform: scale(0.99);
|
||||
}
|
||||
@@ -956,6 +1001,8 @@
|
||||
border-bottom: 1px solid #F5F5F7;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.form-item {
|
||||
width: 100%;
|
||||
margin-top: 40rpx;
|
||||
@@ -1019,3 +1066,50 @@
|
||||
}
|
||||
}
|
||||
</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">
|
||||
@@ -104,24 +114,26 @@
|
||||
|
||||
<script>
|
||||
import {
|
||||
addStudent,
|
||||
listAllCampus,
|
||||
listParkByCampus,
|
||||
listAllRoomByFloor,
|
||||
listBuildingByPark,
|
||||
listFloorByBuilding,
|
||||
listAllRoomByFloor,
|
||||
addStudent,
|
||||
submitOwnInfo as submitExtraInfo
|
||||
} from "@/api/dms/studentDormInfo/index.js"
|
||||
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"
|
||||
} 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";
|
||||
} from "@/utils/checkPic.js";
|
||||
import request from "@/utils/request";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -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,11 +507,11 @@
|
||||
stuNo: '',
|
||||
isDormitoryHead: '',
|
||||
checkinTime: '',
|
||||
photo: ''
|
||||
photo: '',
|
||||
xhk: '',
|
||||
bankAddr: ''
|
||||
};
|
||||
uni.redirectTo({
|
||||
url: `/pages/dormitory/studentDormInfo/index`
|
||||
})
|
||||
uni.redirectTo({ url: `/pages/dormitory/studentDormInfo/index` })
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user