初始化

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,360 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="班会主题" prop="mettingTheme">
<el-input v-model="queryParams.mettingTheme" placeholder="请输入班会主题" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="班级名称" prop="cmhClassName">
<el-input v-model="queryParams.cmhClassName" placeholder="请输入班级名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="辅导员工号" prop="cmhTeacherNo">
<el-input v-model="queryParams.cmhTeacherNo" placeholder="请输入辅导员工号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="辅导员姓名" prop="cmhTeacherName">
<el-input v-model="queryParams.cmhTeacherName" placeholder="请输入辅导员姓名" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="班会时间" prop="cmhTimeRange">
<el-date-picker v-model="queryParams.cmhTimeRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" @change="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="['routine:classMettingHeld: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="['routine:classMettingHeld: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="['routine:classMettingHeld: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="['routine:classMettingHeld:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="classMettingHeldList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="班会主题" align="center" prop="mettingTheme" />
<el-table-column label="班级名称" align="center" prop="className" />
<el-table-column label="辅导员工号" align="center" prop="cmhTeacherNo" />
<el-table-column label="辅导员姓名" align="center" prop="cmhTeacherName" />
<el-table-column label="班会时间" align="center" prop="cmhTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.cmhTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="班会地址" align="center" prop="cmhAddr" />
<el-table-column label="备注" align="center" prop="remark" />
<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="['routine:classMettingHeld:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['routine:classMettingHeld:remove']">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleInfo(scope.row)" v-hasPermi="['routine:classMettingHeld:info']">查看</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="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="班会主题" prop="mettingTheme">
<el-input v-model="form.mettingTheme" placeholder="请输入班会主题" />
</el-form-item>
<el-form-item label="班会班级" prop="cmhClassNo">
<el-select v-if="isEmpty(form.cmhId)" multiple style="width: 100%" v-model="crClassNoList">
<el-option v-for="(v, i) in classList" :key="i" :label="v.className" :value="v.classId.toString()"></el-option>
</el-select>
<el-select v-else style="width: 100%" v-model="form.cmhClassNo">
<el-option v-for="(v, i) in classList" :key="i" :label="v.className" :value="v.classId.toString()"></el-option>
</el-select>
</el-form-item>
<el-form-item label="班会内容">
<editor v-model="form.cmhContent" :min-height="192" />
</el-form-item>
<el-form-item label="班会时间" prop="cmhTime">
<el-date-picker clearable v-model="form.cmhTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择班会时间"> </el-date-picker>
</el-form-item>
<el-form-item label="班会地址" prop="cmhAddr">
<el-input v-model="form.cmhAddr" placeholder="请输入班会地址" />
</el-form-item>
<el-form-item label="班会材料" prop="mettingFile">
<ImageUpload v-model="form.mettingFile" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" 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>
<!-- 添加或修改辅导员班会对话框 -->
<el-dialog :title="title" :visible.sync="openInfo" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="班会主题" prop="mettingTheme">
<el-input v-model="form.mettingTheme" placeholder="请输入班会主题" :disabled="isReadOnly"/>
</el-form-item>
<el-form-item label="班会班级" prop="cmhClassName">
<el-input v-model="form.cmhClassName" placeholder="请输入班会班级" :disabled="isReadOnly"/>
</el-form-item>
<el-form-item label="班会内容">
<editor v-model="form.cmhContent" :min-height="192" :disabled="isReadOnly"/>
</el-form-item>
<el-form-item label="班会时间" prop="cmhTime">
<el-date-picker clearable v-model="form.cmhTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择班会时间" :disabled="isReadOnly"> </el-date-picker>
</el-form-item>
<el-form-item label="班会地址" prop="cmhAddr">
<el-input v-model="form.cmhAddr" placeholder="请输入班会地址" :disabled="isReadOnly"/>
</el-form-item>
<el-form-item label="班会材料" prop="mettingFile">
<ImageUpload v-model="form.mettingFile" :disabled="isReadOnly"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" :disabled="isReadOnly"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { fullLoading, isEmpty } from "@/api/helpFunc";
import { addClassMettingHeld, delClassMettingHeld, getClassMettingHeld, listClassMettingHeld, updateClassMettingHeld } from '@/api/routine/classMettingHeld';
import { listClassByTNo } from "@/api/routine/theme/ClassMettingTheme";
export default {
name: 'ClassMettingHeld',
data() {
return {
isReadOnly:true,
isEmpty,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 辅导员班会表格数据
classMettingHeldList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
//班级id
crClassNoList: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
mettingFile: null,
mettingTheme: null,
cmhDepartmentNo: null,
cmhMajorNo: null,
cmhClassNo: null,
cmhTeacherNo: null,
cmhTextContent: null,
cmhContent: null,
cmhTime: null,
cmhAddr: null,
status: null,
cmhTimeRange: null,
},
// 表单参数
form: {
mettingTheme: '',
},
// 表单校验
rules: {},
classList:[],
openInfo: false,
}
},
created() {
this.listClassByTNo();
this.getList()
},
methods: {
async listClassByTNo() {
let loading = fullLoading(this);
let res = await listClassByTNo();
loading.close();
if (res.code == 200) {
this.classList = [...res.data];
console.log(this.classList);
}
},
/** 查询辅导员班会列表 */
getList() {
this.loading = true
listClassMettingHeld(this.queryParams).then((response) => {
this.classMettingHeldList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.crClassNoList = []
this.form = {
cmhId: null,
mettingFile: null,
mettingTheme: null,
cmhDepartmentNo: null,
cmhMajorNo: null,
cmhClassNo: null,
cmhTeacherNo: null,
cmhTextContent: null,
cmhContent: null,
cmhTime: null,
cmhAddr: null,
status: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
if (this.queryParams.cmhTimeRange && this.queryParams.cmhTimeRange.length === 2) {
this.queryParams.startTime = this.queryParams.cmhTimeRange[0]
this.queryParams.endTime = this.queryParams.cmhTimeRange[1]
} else {
this.queryParams.startTime = null
this.queryParams.endTime = null
}
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.cmhId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.crClassNoList = []
this.reset()
this.open = true
this.title = '添加辅导员班会'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const cmhId = row.cmhId || this.ids
getClassMettingHeld(cmhId).then((response) => {
this.form = response.data
this.open = true
this.crClassNoList = [Number(this.form.cmhDepartmentNo), Number(this.form.cmhMajorNo), Number(this.form.cmhClassNo)]; //赋值班级
this.title = '修改辅导员班会'
})
},
// 查看详情
handleInfo(row){
this.reset()
const cmhId = row.cmhId || this.ids
getClassMettingHeld(cmhId).then((response) => {
this.form = response.data
this.openInfo = true
this.crClassNoList = [Number(this.form.cmhDepartmentNo), Number(this.form.cmhMajorNo), Number(this.form.cmhClassNo)]; //赋值班级
this.title = '修改辅导员班会'
})
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.cmhId != null) {
updateClassMettingHeld(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
//获取到选中的className名并赋值给sdata的cmhClassName
if (this.crClassNoList.length != 0) {
let loading = fullLoading(this)
this.crClassNoList.map((x) => {
setTimeout(() => {
let sdata = { ...this.form }
sdata.cmhClassNo = x
addClassMettingHeld(sdata).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}, 1000)
})
loading.close()
} else {
this.$message.info('请选择班级')
}
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const cmhIds = row.cmhId || this.ids
this.$modal
.confirm('是否确认删除辅导员班会编号为"' + cmhIds + '"的数据项?')
.then(function () {
return delClassMettingHeld(cmhIds)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download(
'routine/classMettingHeld/export',
{
...this.queryParams,
},
`classMettingHeld_${new Date().getTime()}.xlsx`
)
},
},
}
</script>