Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
d1ec8bb5d2
@ -5,7 +5,7 @@ VUE_APP_TITLE = 幼儿园体质检测管理系统
|
||||
ENV = 'development'
|
||||
|
||||
# 若依管理系统/开发环境
|
||||
VUE_APP_BASE_API = 'http://192.168.16.64:8080'
|
||||
VUE_APP_BASE_API = 'http://192.168.16.62:8080'
|
||||
#'/dev-api'
|
||||
|
||||
# 路由懒加载
|
||||
|
||||
36
src/api/system/parentInfo.js
Normal file
36
src/api/system/parentInfo.js
Normal file
@ -0,0 +1,36 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询家长信息列表
|
||||
export function listParentInfo(query) {
|
||||
return request({
|
||||
url: '/system/parentInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询家长信息详细
|
||||
export function getParentInfo(id) {
|
||||
return request({
|
||||
url: '/system/parentInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 修改家长信息
|
||||
export function updateParentInfo(data) {
|
||||
return request({
|
||||
url: '/system/parentInfo/edit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除家长信息
|
||||
export function delParentInfo(id) {
|
||||
return request({
|
||||
url: '/system/parentInfo/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
51
src/api/system/studentInfo.js
Normal file
51
src/api/system/studentInfo.js
Normal file
@ -0,0 +1,51 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询学生信息列表
|
||||
export function listStudentInfo(query) {
|
||||
return request({
|
||||
url: '/system/studentInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询学生信息详细
|
||||
export function getStudentInfo(id) {
|
||||
return request({
|
||||
url: '/system/studentInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 新增家长信息
|
||||
export function addparentInfo(data) {
|
||||
return request({
|
||||
url: '/system/parentInfo/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 新增学生信息
|
||||
export function addStudentInfo(data) {
|
||||
return request({
|
||||
url: '/system/studentInfo/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改学生信息
|
||||
export function updateStudentInfo(data) {
|
||||
return request({
|
||||
url: '/system/studentInfo/edit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除学生信息
|
||||
export function delStudentInfo(id) {
|
||||
return request({
|
||||
url: '/system/studentInfo/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -236,7 +236,6 @@ export default {
|
||||
},
|
||||
/** 转换部门数据结构 */
|
||||
normalizer(node) {
|
||||
// console.log(node);
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
}
|
||||
@ -249,13 +248,11 @@ export default {
|
||||
/** 查询区域管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// console.log(this.queryParams);
|
||||
listArea(this.queryParams).then((response) => {
|
||||
// this.areaList = response.data.forEach((e) => {
|
||||
// e.code = Number(e.code);
|
||||
// });
|
||||
this.areaList = this.handleTree(response.data);
|
||||
console.log(this.areaList);
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
@ -291,10 +288,8 @@ export default {
|
||||
},
|
||||
/** 项目新增按钮操作 */
|
||||
handleAdd2(row) {
|
||||
console.log(row);
|
||||
this.reset();
|
||||
this.form.parentId = row.id;
|
||||
console.log(this.form);
|
||||
this.open = true;
|
||||
this.title = "添加区域管理";
|
||||
},
|
||||
@ -303,7 +298,6 @@ export default {
|
||||
this.reset();
|
||||
listArea(this.queryParams).then((response) => {
|
||||
this.areaList = this.handleTree(response.data);
|
||||
// console.log(this.areaList);
|
||||
});
|
||||
this.open = true;
|
||||
this.title = "添加区域管理";
|
||||
@ -312,7 +306,6 @@ export default {
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.form2.id = row.id;
|
||||
// console.log(this.form2);
|
||||
const id = row.id || this.ids;
|
||||
getArea(id).then((response) => {
|
||||
response.data.code = Number(response.data.code);
|
||||
@ -323,7 +316,6 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
console.log(this.form);
|
||||
this.form2.name = this.form.name;
|
||||
this.form2.code = this.form.code;
|
||||
this.form2.sort = this.form.sort;
|
||||
|
||||
@ -115,7 +115,7 @@
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column
|
||||
label="班级所在幼儿园"
|
||||
label="所属幼儿园"
|
||||
align="center"
|
||||
prop="kindergartenName"
|
||||
/>
|
||||
@ -168,7 +168,7 @@
|
||||
<!-- 添加或修改班级信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="所在幼儿园" prop="kindergartenId">
|
||||
<el-form-item label="所属幼儿园" prop="kindergartenId">
|
||||
<el-button
|
||||
type=""
|
||||
@click="innerVisible = true"
|
||||
@ -229,6 +229,44 @@
|
||||
:visible.sync="innerVisible"
|
||||
append-to-body
|
||||
>
|
||||
<el-form
|
||||
:model="queryParams2"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="幼儿园名称" prop="kindergartenName">
|
||||
<el-input
|
||||
v-model="queryParams2.kindergartenName"
|
||||
placeholder="请输入幼儿园名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="幼儿园地址" prop="kindergartenAddress">
|
||||
<el-input
|
||||
v-model="queryParams2.kindergartenAddress"
|
||||
placeholder="请输入幼儿园地址"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery2"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
:data="kindergartenInfoList"
|
||||
@row-click="kindergartenNameclick"
|
||||
@ -292,8 +330,8 @@
|
||||
<pagination
|
||||
v-show="total2 > 0"
|
||||
:total="total2"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:page.sync="queryParams2.pageNum"
|
||||
:limit.sync="queryParams2.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-dialog>
|
||||
@ -369,6 +407,13 @@ export default {
|
||||
className: null,
|
||||
classType: null,
|
||||
},
|
||||
queryParams2: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
kindergartenId: null,
|
||||
className: null,
|
||||
classType: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
@ -401,8 +446,6 @@ export default {
|
||||
this.kindergartenid2 = row.id;
|
||||
this.form.kindergartenId = row.id;
|
||||
this.innerVisible = false;
|
||||
console.log(row);
|
||||
console.log(this.form);
|
||||
},
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
@ -420,15 +463,12 @@ export default {
|
||||
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listKindergartenInfo(this.queryParams).then((response) => {
|
||||
listKindergartenInfo(this.queryParams2).then((response) => {
|
||||
this.kindergartenInfoList = response.rows;
|
||||
this.total2 = response.total;
|
||||
console.log(this.total2);
|
||||
console.log(this.kindergartenInfoList);
|
||||
});
|
||||
listClassinfo(this.queryParams).then((response) => {
|
||||
this.classinfoList = response.rows;
|
||||
console.log(this.classinfoList);
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
@ -437,12 +477,6 @@ export default {
|
||||
this.dictValue2 = res.data[1].dictValue;
|
||||
this.dictValue3 = res.data[2].dictValue;
|
||||
this.dictValue4 = res.data[3].dictValue;
|
||||
console.log(
|
||||
this.dictValue1,
|
||||
this.dictValue2,
|
||||
this.dictValue3,
|
||||
this.dictValue4
|
||||
);
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
@ -462,22 +496,21 @@ export default {
|
||||
phone: undefined,
|
||||
kindergartenName: null,
|
||||
};
|
||||
// this.form2 = {
|
||||
// kindergartenId: null,
|
||||
// className: null,
|
||||
// classType: null,
|
||||
// classTeacher: null,
|
||||
// phone: null,
|
||||
// kindergartenName: null,
|
||||
// };
|
||||
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery2() {
|
||||
this.queryParams2.pageNum = 1;
|
||||
listKindergartenInfo(this.queryParams2).then((response) => {
|
||||
this.kindergartenInfoList = response.rows;
|
||||
this.total2 = response.total;
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
listClassinfo(this.queryParams).then((response) => {
|
||||
this.classinfoList = response.rows;
|
||||
console.log(this.classinfoList);
|
||||
});
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
@ -489,7 +522,15 @@ export default {
|
||||
className: null,
|
||||
classType: null,
|
||||
};
|
||||
this.queryParams2 = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
kindergartenId: null,
|
||||
className: null,
|
||||
classType: null,
|
||||
};
|
||||
this.handleQuery();
|
||||
this.handleQuery2();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
@ -500,8 +541,6 @@ export default {
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
console.log(this.kindergartenName);
|
||||
console.log(this.kindergartenid2);
|
||||
this.open = true;
|
||||
this.kindergartenid2 = "";
|
||||
this.title = "添加班级信息";
|
||||
@ -509,11 +548,8 @@ export default {
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
console.log(row);
|
||||
this.kindergartenid2 = row.kindergartenId;
|
||||
this.reset();
|
||||
console.log(this.kindergartenName);
|
||||
console.log(this.kindergartenid2);
|
||||
const id = row.id || this.ids;
|
||||
getClassinfo(id).then((response) => {
|
||||
response.data.phone = Number(response.data.phone);
|
||||
@ -521,9 +557,6 @@ export default {
|
||||
this.kindergartenName = this.form.kindergartenName;
|
||||
this.open = true;
|
||||
this.title = "修改班级信息";
|
||||
console.log(this.form);
|
||||
// console.log(this.kindergartenName);
|
||||
console.log(this.kindergartenid2);
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
||||
@ -215,8 +215,12 @@
|
||||
<el-form-item label="联系人" prop="contacts">
|
||||
<el-input v-model="form.contacts" placeholder="请输入联系人姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人电话" prop="">
|
||||
<el-input v-model="form.phone" placeholder="请输入联系人电话" />
|
||||
<el-form-item label="联系人电话" prop="phone">
|
||||
<el-input
|
||||
v-model="form.phone"
|
||||
maxlength="11"
|
||||
placeholder="请输入联系人电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@ -237,6 +241,18 @@ export default {
|
||||
components: { Treeselect },
|
||||
name: "areas",
|
||||
data() {
|
||||
// 验证手机号的规则
|
||||
var checkMobile = (rule, value, cb) => {
|
||||
// 验证手机号的正则表达式
|
||||
const regMobile =
|
||||
/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/;
|
||||
|
||||
if (regMobile.test(value)) {
|
||||
return cb();
|
||||
}
|
||||
|
||||
cb(new Error("请输入合法的手机号"));
|
||||
};
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
@ -282,6 +298,14 @@ export default {
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
phone: [
|
||||
{
|
||||
required: true,
|
||||
validator: checkMobile,
|
||||
trigger: "blur",
|
||||
message: "请输入正确的手机号",
|
||||
},
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: "区域编码不能为空" },
|
||||
{ type: "number", message: "区域编码必须为数字值", trigger: "blur" },
|
||||
@ -343,7 +367,6 @@ export default {
|
||||
};
|
||||
},
|
||||
normalizer(node) {
|
||||
// console.log(node);
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
}
|
||||
@ -357,10 +380,8 @@ export default {
|
||||
getList() {
|
||||
listArea(this.queryParams).then((response) => {
|
||||
this.areaList = this.handleTree(response.data);
|
||||
console.log(this.areaList);
|
||||
});
|
||||
this.loading = true;
|
||||
console.log(this.queryParams);
|
||||
list(this.queryParams).then((response) => {
|
||||
this.List = this.handleTree(response.data);
|
||||
this.List2 = this.List;
|
||||
@ -414,11 +435,9 @@ export default {
|
||||
},
|
||||
/** 项目新增按钮操作 */
|
||||
handleAdd2(row) {
|
||||
console.log(row);
|
||||
this.reset();
|
||||
this.form.areaId = row.areaId;
|
||||
this.form.parentId = row.id;
|
||||
console.log(this.form);
|
||||
this.open = true;
|
||||
this.title = "添加区域管理";
|
||||
},
|
||||
@ -427,12 +446,10 @@ export default {
|
||||
this.reset();
|
||||
list(this.queryParams).then((response) => {
|
||||
this.List = this.handleTree(response.data);
|
||||
console.log(this.List);
|
||||
});
|
||||
this.reset();
|
||||
listArea(this.queryParams).then((response) => {
|
||||
this.areaList = this.handleTree(response.data);
|
||||
console.log(this.areaList);
|
||||
});
|
||||
this.open = true;
|
||||
this.title = "添加区域管理";
|
||||
@ -442,14 +459,12 @@ export default {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getinfo(id).then((response) => {
|
||||
console.log(response);
|
||||
if (response.data.phone == 0) {
|
||||
response.data.phone = "";
|
||||
}
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改区域管理";
|
||||
console.log(this.form);
|
||||
});
|
||||
},
|
||||
|
||||
@ -505,5 +520,4 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
|
||||
</style>
|
||||
@ -220,7 +220,11 @@
|
||||
<el-input v-model="form.contacts" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入联系电话" />
|
||||
<el-input
|
||||
v-model="form.phone"
|
||||
maxlength="11"
|
||||
placeholder="请输入联系电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -247,6 +251,18 @@ export default {
|
||||
name: "KindergartenInfo",
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
// 验证手机号的规则
|
||||
var checkMobile = (rule, value, cb) => {
|
||||
// 验证手机号的正则表达式
|
||||
const regMobile =
|
||||
/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/;
|
||||
|
||||
if (regMobile.test(value)) {
|
||||
return cb();
|
||||
}
|
||||
|
||||
cb(new Error("请输入合法的手机号"));
|
||||
};
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
@ -308,6 +324,14 @@ export default {
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
phone: [
|
||||
{
|
||||
required: true,
|
||||
validator: checkMobile,
|
||||
trigger: "blur",
|
||||
message: "请输入正确的手机号",
|
||||
},
|
||||
],
|
||||
kindergartenType: [{ required: true, message: "请选择幼儿园类型" }],
|
||||
kindergartenAddress: [
|
||||
{ required: true, message: "请输入幼儿园地址", trigger: "blur" },
|
||||
@ -352,11 +376,9 @@ export default {
|
||||
this.infolist = this.handleTree(response.data);
|
||||
this.infolist2 = response.data;
|
||||
this.loading = false;
|
||||
console.log(this.infolist2);
|
||||
});
|
||||
listKindergartenInfo(this.queryParams).then((response) => {
|
||||
this.kindergartenInfoList = response.rows;
|
||||
console.log(this.kindergartenInfoList);
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
@ -365,8 +387,6 @@ export default {
|
||||
this.type2 = res.data[1].dictValue;
|
||||
this.types[0].id = res.data[0].dictValue;
|
||||
this.types[1].id = res.data[1].dictValue;
|
||||
console.log(this.types);
|
||||
console.log(this.queryParams);
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
@ -389,10 +409,8 @@ export default {
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
console.log(this.queryParams);
|
||||
listKindergartenInfo(this.queryParams).then((response) => {
|
||||
this.kindergartenInfoList = response.rows;
|
||||
console.log(this.kindergartenInfoList);
|
||||
this.total = response.total;
|
||||
});
|
||||
},
|
||||
@ -434,29 +452,23 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
console.log(this.form);
|
||||
|
||||
if (this.form.phone == "" || this.form.phone.toString().length == 11) {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateKindergartenInfo(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addKindergartenInfo(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateKindergartenInfo(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addKindergartenInfo(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$message.error("请输入正确的手机号码");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
|
||||
341
src/views/system/parentInfo/index.vue
Normal file
341
src/views/system/parentInfo/index.vue
Normal file
@ -0,0 +1,341 @@
|
||||
<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="parentName">
|
||||
<el-input
|
||||
v-model="queryParams.parentName"
|
||||
placeholder="请输入家长姓名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入联系电话"
|
||||
clearable
|
||||
maxlength="11"
|
||||
@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="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:parentInfo: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="['system:parentInfo: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="['system:parentInfo:export']"
|
||||
>导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="parentInfoList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="家长姓名" align="center" prop="parentName" />
|
||||
<el-table-column label="家长性别" align="center" prop="parentSex">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.parentSex == "MALE" ? "男" : "女" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系电话" align="center" prop="phone" />
|
||||
<el-table-column label="创建人" align="center" prop="createBy" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="修改人" align="center" prop="updateBy" />
|
||||
<el-table-column label="修改时间" align="center" prop="updateTime" />
|
||||
|
||||
<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="['system:parentInfo:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:parentInfo: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="parentName">
|
||||
<el-input v-model="form.parentName" placeholder="请输入家长姓名" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="家长性别" prop="parentSex">
|
||||
<el-radio-group v-model="form.parentSex">
|
||||
<el-radio :label="male">男</el-radio>
|
||||
<el-radio :label="female">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input
|
||||
maxlength="11"
|
||||
v-model="form.phone"
|
||||
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 {
|
||||
listParentInfo,
|
||||
getParentInfo,
|
||||
delParentInfo,
|
||||
updateParentInfo,
|
||||
} from "@/api/system/parentInfo";
|
||||
|
||||
export default {
|
||||
name: "ParentInfo",
|
||||
data() {
|
||||
// 验证手机号的规则
|
||||
var checkMobile = (rule, value, cb) => {
|
||||
// 验证手机号的正则表达式
|
||||
const regMobile =
|
||||
/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/;
|
||||
|
||||
if (regMobile.test(value)) {
|
||||
return cb();
|
||||
}
|
||||
|
||||
cb(new Error("请输入合法的手机号"));
|
||||
};
|
||||
return {
|
||||
//性别
|
||||
male: "MALE",
|
||||
female: "FEMALE",
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 家长信息表格数据
|
||||
parentInfoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
parentName: null,
|
||||
parentSex: null,
|
||||
phone: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
parentSex: [{ required: true, message: "请选择家长性别" }],
|
||||
parentName: [{ required: true, message: "请输入家长姓名" }],
|
||||
phone: [
|
||||
{
|
||||
required: true,
|
||||
validator: checkMobile,
|
||||
trigger: "blur",
|
||||
message: "请输入正确的手机号",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询家长信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listParentInfo(this.queryParams).then((response) => {
|
||||
this.parentInfoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
parentName: null,
|
||||
parentSex: null,
|
||||
phone: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
listParentInfo(this.queryParams).then((response) => {
|
||||
this.parentInfoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
this.queryParams.parentName = null;
|
||||
this.queryParams.phone = null;
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
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;
|
||||
getParentInfo(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) {
|
||||
updateParentInfo(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 delParentInfo(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
"system/parentInfo/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`parentInfo_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
1379
src/views/system/studentInfo/index.vue
Normal file
1379
src/views/system/studentInfo/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user