初始化

This commit is contained in:
2025-07-28 15:52:07 +08:00
commit cd0e77b332
1304 changed files with 302802 additions and 0 deletions

View File

@@ -0,0 +1,381 @@
<template>
<div>
<el-form class="lookForm" :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="100px">
<el-collapse v-model="searInputS">
<el-collapse-item title="按宿舍信息搜索" name="1">
<el-form-item label="校区" prop="campusId">
<el-select @change="changeCampus" v-model="queryParams.campusId" placeholder="请选择校区" filterable
clearable>
<el-option v-for="(v, i) in campus_list" :key="i" :label="v.name" :value="v.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="园区" prop="parkId">
<el-select @change="changePark" v-model="queryParams.parkId" placeholder="请先选择校区再选择园区"
filterable clearable>
<el-option v-for="(v, i) in park_list" :key="i" :label="v.name" :value="v.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="楼栋" prop="buildingId">
<el-select @change="changeBuilding" v-model="queryParams.buildingId" placeholder="请先选择园区再选择楼栋"
filterable clearable>
<el-option v-for="(v, i) in building_list" :key="i" :label="v.name" :value="v.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="层" prop="floorId">
<el-select v-model="queryParams.floorId" @change="changeFloor" clearable>
<el-option v-for="(v, i) in floor_list" :key="i" :label="v.floor" :value="v.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="宿舍" prop="dormitoryId">
<el-select v-model="queryParams.dormitoryId" clearable filterable>
<el-option v-for="(v, i) in room_list" :key="i" :label="v.roomNo" :value="v.id"></el-option>
</el-select>
</el-form-item>
</el-collapse-item>
<el-collapse-item title="按学生信息搜索" name="2">
<el-form-item label="年级" prop="gradeId">
<el-select v-model="queryParams.gradeId" placeholder="请选择年级" filterable clearable>
<el-option v-for="(v, i) in gradeList" :key="i" :label="v.gradeName" :value="v.gradeId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="班级" prop="classId">
<el-select v-model="queryParams.classId" placeholder="请选择班级" filterable clearable>
<el-option v-for="(v, i) in classList" :key="i" :label="v.className" :value="v.classId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="学号" prop="stuNo">
<el-input v-model="queryParams.stuNo" placeholder="请输入学生学号" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="姓名" prop="stuName">
<el-input v-model="queryParams.stuName" placeholder="请输入学生姓名" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="辅导员姓名" prop="teacherName">
<el-input v-model="queryParams.teacherName" placeholder="请输入辅导员姓名" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="queryParams.idCard" placeholder="请输入身份证号" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="打卡日期" prop="needDate">
<el-date-picker value-format="yyyy-MM-dd" clearable v-model="queryParams.needDate" type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="是否打卡" prop="isCard">
<el-select v-model="queryParams.isCard" placeholder="请选择是否打卡" clearable>
<el-option label="是" value="是"></el-option>
<el-option label="否" value="否"></el-option>
</el-select>
</el-form-item>
</el-collapse-item>
</el-collapse>
<el-form-item label=" ">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button plain icon="el-icon-setting" type="success" size="mini"
@click="setVClick">按班级设置需要打卡的学生</el-button>
<el-button plain icon="el-icon-s-promotion" type="success" size="mini"
@click="sendTodayNeedCardMsg">向今日需要打卡的学生发送信息</el-button>
<span style="color: red;">*系统默认每天下午3点设置打卡每天给辅导员所带班级其中一个推送打卡</span>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tableList">
<el-table-column label="#" align="center" prop="id" />
<el-table-column label="需要打卡的日期" align="center" prop="needDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.needDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="需要打卡的学号" align="center" prop="stuNo" />
<el-table-column label="班级" align="center" prop="className" />
<el-table-column label="姓名" align="center" prop="stuName" />
<el-table-column label="是否打卡" align="center">
<template slot-scope="scope">
<span :style="{ color: scope.row.isCard === '是' ? '#52c41a' : '#f5222d', fontWeight: 'bold' }">
{{ scope.row.isCard }}
</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-check"
@click="cardClick(scope.row)">帮忙打卡</el-button>
<el-button size="mini" type="text" icon="el-icon-edit"
@click="cancelClick(scope.row)">标记为不需要打卡</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<el-dialog title="按班级设置需要打卡的学生" :visible.sync="setV" width="800px" append-to-body>
<el-form label-width="120px">
<el-form-item label="选择班级">
<el-select style="width:400px" v-model="setForm.classIds" multiple placeholder="请选择班级" filterable
clearable>
<el-option v-for="(v, i) in classList" :key="i" :label="v.className" :value="v.classId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="需要打卡的日期">
<el-date-picker style="width:400px" v-model="setForm.needDates" type="dates"
value-format="yyyy-MM-dd" placeholder="请选择需要打卡的日期" clearable :picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="">
<el-button type="primary" @click="setNeedCardByClass">确定</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { listFdy as getList, cancelNeedCard, cardNeedCard, setNeedCardByClass, sendTodayNeedCardMsg } from "@/api/dormitory/needCardStu";
import {
listAllCampus, listFloorByBuilding,
listParkByCampus, listBuildingByPark, listAllRoomByFloor
} from "@/api/dormitory/basedata/dormitory";
import { listOwnClass as listClass } from "@/api/stuCQS/info-fill/stu_eva_task";
import { listEnableGrade as listGrade } from '@/api/stuCQS/basedata/grade';
import { isEmpty, fullLoading } from "@/api/helpFunc";
export default {
name: "fdy",
data() {
return {
pickerOptions: {
disabledDate(time) {
// 获取今天的时间戳将当前时间的时分秒置为0
const today = new Date();
today.setHours(0, 0, 0, 0);
// 禁用今天之前的日期
return time.getTime() < today.getTime();
}
},
searInputS: ['1', '2'],
loading: true,
ids: [],
single: true,
multiple: true,
showSearch: true,
total: 0,
tableList: [],
title: "",
queryParams: {
pageNum: 1,
pageSize: 10,
dormitoryId: null,
bedId: null,
stuNo: null,
isDormitoryHead: null,
status: null,
checkinTime: null,
inStatus: null
},
classList: [],//班级列表
gradeList: [],//年级列表
campus_list: [],
park_list: [],
building_list: [],
floor_list: [],
room_list: [],
setV: false,
setForm: {
classIds: [],
needDates: []
}
}
},
created() {
this.listGrade();
this.getList();
this.listAllCampus();
this.listClass();
},
methods: {
async sendTodayNeedCardMsg() {
let loading = fullLoading(this);
let res = await sendTodayNeedCardMsg();
loading.close();
if (res.code == 200) {
this.$message.success(res.msg);
}
this.getList();
},
async setNeedCardByClass() {
let sdata = { ...this.setForm };
if (isEmpty(sdata.classIds)) {
this.$message.info("请选择班级");
return;
}
if (isEmpty(sdata.needDates)) {
this.$message.info("请选择需要打卡的日期");
return;
}
let loading = fullLoading(this);
let res = await setNeedCardByClass(sdata);
loading.close();
if (res.code == 200) {
this.$message.success(res.msg);
}
this.getList();
},
setVClick() {
this.setForm = {
classIds: [],
needDates: []
};
this.setV = true;
},
cardClick(row) {
this.$confirm('确认帮忙打卡学生:' + row.stuName + '吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 调用接口帮忙打卡
let loading = fullLoading(this);
cardNeedCard(row.id).then((res) => {
if (res.code == 200) {
this.$message.success(res.msg);
}
this.getList();
}).finally(() => {
loading.close();
});
});
},
cancelClick(row) {
this.$confirm('确认标记学生:' + row.stuName + '为不需要打卡吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 调用接口标记为不需要打卡
this.loading = true;
cancelNeedCard(row.id).then((res) => {
if (res.code == 200) {
this.$message.success(res.msg);
}
this.getList();
}).finally(() => {
this.loading = false;
});
});
},
async listGrade() {
let res = await listGrade();
this.gradeList = [...res.data];
},
async listClass() {
let res = await listClass();
this.classList = [...res.data];
},
getList() {
this.loading = true;
getList(this.queryParams).then(response => {
console.log(response);
this.tableList = response.rows;
this.total = response.total;
this.loading = false;
});
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
async listAllCampus() {
let res = await listAllCampus();
if (res.code == 200) {
this.campus_list = [...res.data];
}
},
async changeFloor(val) {
this.queryParams.dormitoryId = null;
this.room_list = [];
if (!isEmpty(val)) {
let res = await listAllRoomByFloor(this.queryParams.floorId);
if (res.code == 200) {
this.room_list = [...res.data];
}
}
},
async changeBuilding(val) {
this.queryParams.floorId = null;
this.floor_list = [];
this.room_list = [];
this.queryParams.dormitoryId = null;
if (!isEmpty(val)) {
let res = await listFloorByBuilding(this.queryParams.buildingId);
if (res.code == 200) {
this.floor_list = [...res.data];
}
}
},
async changePark(val) {
this.queryParams.buildingId = null;
this.queryParams.floorId = null;
this.queryParams.dormitoryId = null;
this.building_list = [];
this.floor_list = [];
this.room_list = [];
if (!isEmpty(val)) {
let res = await listBuildingByPark(this.queryParams.parkId);
if (res.code == 200) {
this.building_list = [...res.data];
}
}
},
async changeCampus(val) {
this.queryParams.parkId = null;
this.queryParams.buildingId = null;
this.queryParams.floorId = null;
this.queryParams.dormitoryId = null;
this.park_list = [];
this.building_list = [];
this.floor_list = [];
this.room_list = [];
if (!isEmpty(val)) {
let res = await listParkByCampus(this.queryParams.campusId);
if (res.code == 200) {
this.park_list = [...res.data];
}
}
},
}
}
</script>

View File

@@ -0,0 +1,220 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="140px">
<el-form-item label="需要打卡的日期" prop="needDate">
<el-date-picker clearable v-model="queryParams.needDate" type="date" value-format="yyyy-MM-dd"
placeholder="请选择需要打卡的日期">
</el-date-picker>
</el-form-item>
<el-form-item label="需要打卡的学号" prop="stuNo">
<el-input v-model="queryParams.stuNo" placeholder="请输入需要打卡的学号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['dormitory:needCardStu:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
v-hasPermi="['dormitory:needCardStu:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['dormitory:needCardStu:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['dormitory:needCardStu:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="needCardStuList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="#" align="center" prop="id" />
<el-table-column label="需要打卡的日期" align="center" prop="needDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.needDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="需要打卡的学号" align="center" prop="stuNo" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['dormitory:needCardStu:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['dormitory:needCardStu:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 添加或修改打卡设置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<el-form-item label="需要打卡的日期" prop="needDate">
<el-date-picker clearable v-model="form.needDate" type="date" value-format="yyyy-MM-dd"
placeholder="请选择需要打卡的日期">
</el-date-picker>
</el-form-item>
<el-form-item label="需要打卡的学号" prop="stuNo">
<el-input v-model="form.stuNo" placeholder="请输入需要打卡的学号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listNeedCardStu, getNeedCardStu, delNeedCardStu, addNeedCardStu, updateNeedCardStu } from "@/api/dormitory/needCardStu";
export default {
name: "NeedCardStu",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 打卡设置表格数据
needCardStuList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
needDate: null,
stuNo: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询打卡设置列表 */
getList() {
this.loading = true;
listNeedCardStu(this.queryParams).then(response => {
this.needCardStuList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
needDate: null,
stuNo: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加打卡设置";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getNeedCardStu(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改打卡设置";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateNeedCardStu(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addNeedCardStu(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除打卡设置编号为"' + ids + '"的数据项?').then(function () {
return delNeedCardStu(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
this.download('dormitory/needCardStu/export', {
...this.queryParams
}, `needCardStu_${new Date().getTime()}.xlsx`)
}
}
};
</script>