259 lines
9.0 KiB
Vue
259 lines
9.0 KiB
Vue
<template>
|
|
<div class="page-container">
|
|
<!-- 搜索表单 -->
|
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
<div v-show="showSearch" style="margin-bottom: 10px">
|
|
<el-card shadow="hover">
|
|
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
|
<el-row :gutter="20">
|
|
<el-col :span="6">
|
|
<el-form-item label="学生姓名" prop="studentName">
|
|
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable @keyup.enter="handleQuery" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="学号" prop="studentNo">
|
|
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable @keyup.enter="handleQuery" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="学院名称" prop="collegeName">
|
|
<el-input v-model="queryParams.collegeName" placeholder="请输入学院名称" clearable @keyup.enter="handleQuery" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="专业名称" prop="majorName">
|
|
<el-input v-model="queryParams.majorName" placeholder="请输入专业名称" clearable @keyup.enter="handleQuery" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row :gutter="20">
|
|
<el-col :span="6">
|
|
<el-form-item label="班级名称" prop="className">
|
|
<el-input v-model="queryParams.className" placeholder="请输入班级名称" clearable @keyup.enter="handleQuery" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="申请类型" prop="applicationType">
|
|
<el-select v-model="queryParams.applicationType" placeholder="请选择申请类型" clearable style="width: 100%">
|
|
<el-option v-for="dict in dorm_application_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="申请时间" prop="applyTime">
|
|
<el-date-picker
|
|
clearable
|
|
v-model="queryParams.applyTime"
|
|
type="date"
|
|
style="width: 100%"
|
|
value-format="YYYY-MM-DD"
|
|
placeholder="请选择申请时间"
|
|
/>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="审批状态" prop="applicationStatus">
|
|
<el-select v-model="queryParams.applicationStatus" placeholder="请选择审批状态" clearable style="width: 100%">
|
|
<el-option v-for="dict in student_leave_approval_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24" class="search-btn-container">
|
|
<el-form-item>
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
</el-card>
|
|
</div>
|
|
</transition>
|
|
|
|
<!-- 数据表格 -->
|
|
<el-card shadow="never">
|
|
<template #header>
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<span class="card-title">调宿/退宿申请列表</span>
|
|
</el-col>
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
</template>
|
|
|
|
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
|
<el-table-column label="学生姓名" align="center" prop="studentName" />
|
|
<el-table-column label="学号" align="center" prop="studentNo" />
|
|
<el-table-column label="学院" align="center" prop="collegeName" show-overflow-tooltip />
|
|
<el-table-column label="专业" align="center" prop="majorName" show-overflow-tooltip />
|
|
<el-table-column label="班级" align="center" prop="className" show-overflow-tooltip />
|
|
<el-table-column label="申请类型" align="center">
|
|
<template #default="scope">
|
|
<dict-tag :options="dorm_application_type" :value="scope.row.applicationType" />
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="当前宿舍" align="center" show-overflow-tooltip>
|
|
<template #default="scope"> {{ scope.row.currentBuildingName }}{{ scope.row.currentRoomNo }}{{ scope.row.currentBedNo }} </template>
|
|
</el-table-column>
|
|
<el-table-column label="目标宿舍" align="center" show-overflow-tooltip>
|
|
<template #default="scope">
|
|
<span v-if="scope.row.applicationType === '1'">
|
|
{{ scope.row.targetBuildingName }}{{ scope.row.targetRoomNo }}{{ scope.row.targetBedNo }}
|
|
</span>
|
|
<span v-else>—</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="审批状态" align="center">
|
|
<template #default="scope">
|
|
<dict-tag :options="student_leave_approval_status" :value="scope.row.applicationStatus" />
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="申请时间" align="center" prop="applyTime" width="180" />
|
|
<el-table-column label="操作" align="center" width="150" fixed="right">
|
|
<template #default="scope">
|
|
<el-tooltip content="查看" placement="top">
|
|
<el-button
|
|
link
|
|
type="primary"
|
|
icon="View"
|
|
@click="handleView(scope.row)"
|
|
v-hasPermi="['studentDynamics:dormApplication:query']"
|
|
></el-button>
|
|
</el-tooltip>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
</el-card>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts" name="DormApplicationTab">
|
|
import { getCurrentInstance, ref, onMounted, toRefs, type ComponentInternalInstance } from 'vue';
|
|
import { listDormApplication, type DormApplicationQuery } from '@/api/xg/studentDynamics';
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
const { dorm_application_type, student_leave_approval_status } = toRefs(
|
|
proxy?.useDict('dorm_application_type', 'student_leave_approval_status') || {}
|
|
);
|
|
|
|
// 数据状态
|
|
const loading = ref(true);
|
|
const showSearch = ref(true);
|
|
const dataList = ref([]);
|
|
const total = ref(0);
|
|
const ids = ref<Array<string | number>>([]);
|
|
const single = ref(true);
|
|
const multiple = ref(true);
|
|
|
|
// 查询参数
|
|
const queryParams = ref<DormApplicationQuery & any>({
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
studentName: undefined,
|
|
studentNo: undefined,
|
|
collegeName: undefined,
|
|
majorName: undefined,
|
|
className: undefined,
|
|
applicationType: undefined,
|
|
applicationStatus: undefined,
|
|
applyTime: undefined
|
|
});
|
|
|
|
// 表单引用
|
|
const queryFormRef = ref();
|
|
|
|
/**
|
|
* 查询列表数据
|
|
*/
|
|
const getList = async () => {
|
|
loading.value = true;
|
|
try {
|
|
const response = await listDormApplication(queryParams.value);
|
|
dataList.value = response.rows;
|
|
total.value = response.total;
|
|
} catch (error) {
|
|
console.error('获取调宿退宿申请列表失败:', error);
|
|
proxy?.$modal.msgError('获取数据失败');
|
|
} finally {
|
|
loading.value = false;
|
|
}
|
|
};
|
|
|
|
/**
|
|
* 搜索按钮操作
|
|
*/
|
|
const handleQuery = () => {
|
|
queryParams.value.pageNum = 1;
|
|
getList();
|
|
};
|
|
|
|
/**
|
|
* 重置按钮操作
|
|
*/
|
|
const resetQuery = () => {
|
|
queryFormRef.value?.resetFields();
|
|
handleQuery();
|
|
};
|
|
|
|
/**
|
|
* 多选框选中数据
|
|
*/
|
|
const handleSelectionChange = (selection: any) => {
|
|
ids.value = selection.map((item: any) => item.id);
|
|
single.value = selection.length !== 1;
|
|
multiple.value = !selection.length;
|
|
};
|
|
|
|
/**
|
|
* 查看详情
|
|
*/
|
|
const handleView = (row: any) => {
|
|
// 跳转到调宿退宿申请详情页面
|
|
proxy.$router.push({
|
|
path: `/xg/xsjcxx/xssssq/dialog`,
|
|
query: {
|
|
id: row.id,
|
|
type: 'update'
|
|
}
|
|
});
|
|
};
|
|
|
|
// 页面初始化
|
|
onMounted(() => {
|
|
getList();
|
|
});
|
|
</script>
|
|
|
|
<style scoped>
|
|
/* 页面容器样式 */
|
|
.page-container {
|
|
padding: 0;
|
|
}
|
|
|
|
.mb8 {
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
/* 搜索按钮容器样式 */
|
|
.search-btn-container {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.search-btn-container .el-form-item {
|
|
margin-bottom: 0 !important;
|
|
}
|
|
|
|
.card-title {
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
color: #303133;
|
|
}
|
|
</style>
|