班级信息bug和月计划

This commit is contained in:
paidaxing444
2020-08-18 18:51:45 +08:00
parent 343046356f
commit 7c5ac8e992
17 changed files with 1117 additions and 30 deletions

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询主题整合月计划列表
export function listMonthplan(query) {
return request({
url: '/benyi/thememonthplan/list',
method: 'get',
params: query
})
}
// 查询主题整合月计划详细
export function getMonthplan(id) {
return request({
url: '/benyi/thememonthplan/' + id,
method: 'get'
})
}
// 新增主题整合月计划
export function addMonthplan(data) {
return request({
url: '/benyi/thememonthplan',
method: 'post',
data: data
})
}
// 修改主题整合月计划
export function updateMonthplan(data) {
return request({
url: '/benyi/thememonthplan',
method: 'put',
data: data
})
}
// 删除主题整合月计划
export function delMonthplan(id) {
return request({
url: '/benyi/thememonthplan/' + id,
method: 'delete'
})
}
// 导出主题整合月计划
export function exportMonthplan(query) {
return request({
url: '/benyi/thememonthplan/export',
method: 'get',
params: query
})
}

View File

@ -43,6 +43,14 @@ export function delClass(bjbh) {
})
}
// 清空班级教师信息
export function delJsClass(bjbh) {
return request({
url: '/system/class/deljs/' + bjbh,
method: 'delete'
})
}
// 导出班级信息
export function exportClass(query) {
return request({

View File

@ -0,0 +1,312 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="计划名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入计划名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属班级" prop="classid">
<el-input
v-model="queryParams.classid"
placeholder="请输入所属班级"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="学年学期" prop="xnxq">
<el-input
v-model="queryParams.xnxq"
placeholder="请输入学年学期"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="计划月份" prop="month">
<el-input
v-model="queryParams.month"
placeholder="请输入计划月份"
clearable
size="small"
@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"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['benyi:thememonthplan:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['benyi:thememonthplan:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['benyi:thememonthplan:remove']"
>删除</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="monthplanList" @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="name" />
<el-table-column label="所属班级" align="center" prop="classid" />
<el-table-column label="学年学期" align="center" prop="xnxq" />
<el-table-column label="计划月份" align="center" prop="month" />
<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="['benyi:thememonthplan:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['benyi:thememonthplan: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="80px">
<el-form-item label="计划名称" prop="name">
<el-input v-model="form.name" placeholder="请输入计划名称" />
</el-form-item>
<el-form-item label="所属班级" prop="classid">
<el-input v-model="form.classid" placeholder="请输入所属班级" />
</el-form-item>
<el-form-item label="学年学期" prop="xnxq">
<el-input v-model="form.xnxq" placeholder="请输入学年学期" />
</el-form-item>
<el-form-item label="计划月份" prop="month">
<el-input v-model="form.month" placeholder="请输入计划月份" />
</el-form-item>
<el-form-item label="本月主题" prop="themes">
<el-input v-model="form.themes" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="本月自定义主题" prop="selfthemes">
<el-input v-model="form.selfthemes" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="家长支持" prop="support">
<el-input v-model="form.support" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" 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>
</div>
</template>
<script>
import {
listMonthplan,
getMonthplan,
delMonthplan,
addMonthplan,
updateMonthplan,
} from "@/api/benyi/thememonthplan";
export default {
name: "Monthplan",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 总条数
total: 0,
// 主题整合月计划表格数据
monthplanList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined,
classid: undefined,
xnxq: undefined,
month: undefined,
themes: undefined,
selfthemes: undefined,
support: undefined,
remarks: undefined,
createuserid: undefined,
},
// 表单参数
form: {},
// 表单校验
rules: {},
};
},
created() {
this.getList();
},
methods: {
/** 查询主题整合月计划列表 */
getList() {
this.loading = true;
listMonthplan(this.queryParams).then((response) => {
this.monthplanList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: undefined,
name: undefined,
classid: undefined,
xnxq: undefined,
month: undefined,
themes: undefined,
selfthemes: undefined,
support: undefined,
remarks: undefined,
createuserid: undefined,
createTime: undefined,
};
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;
getMonthplan(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改主题整合月计划";
});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != undefined) {
updateMonthplan(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addMonthplan(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm(
'是否确认删除主题整合月计划编号为"' + ids + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delMonthplan(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
},
};
</script>

View File

@ -0,0 +1,3 @@
<template >
<router-view />
</template>

View File

@ -128,7 +128,14 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:class:remove']"
>删除</el-button>
>删除班级</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleEditJs(scope.row)"
v-hasPermi="['system:class:edit']"
>清空教师</el-button>
</template>
</el-table-column>
</el-table>
@ -206,7 +213,8 @@ import {
delClass,
addClass,
updateClass,
exportClass
exportClass,
delJsClass
} from "@/api/system/class";
import { getUsersByRoleId } from "@/api/system/user";
@ -399,6 +407,22 @@ export default {
})
.catch(function() {});
},
handleEditJs(row) {
const bjbhs = row.bjbh || this.ids;
this.$confirm("是否确认清空选中的班级教师信息?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(function() {
return delJsClass(bjbhs);
})
.then(() => {
this.getList();
this.msgSuccess("清空成功");
})
.catch(function() {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;

View File

@ -123,7 +123,7 @@
<!-- 添加或修改教师基本信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="flag">
<el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="flag">
<el-form-item label="id" prop="id" v-show="false">
<el-input v-model="form.id" />
</el-form-item>