This commit is contained in:
zhanglipeng 2020-11-18 17:18:49 +08:00
parent d5dd1f11a9
commit ec7f9e81ed
8 changed files with 362 additions and 261 deletions

View File

@ -32,18 +32,13 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="childList" :data="childList"
border
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="编号" align="center" prop="id" /> --> <!-- <el-table-column label="编号" align="center" prop="id" /> -->
<!-- <el-table-column label="幼儿园名称" align="center" prop="schoolid" /> --> <!-- <el-table-column label="幼儿园名称" align="center" prop="schoolid" /> -->
<el-table-column <el-table-column fixed label="幼儿姓名" align="center" prop="name">
label="班级名称"
align="center"
prop="classid"
:formatter="classFormat"
/>
<el-table-column label="幼儿姓名" align="center" prop="name">
<template slot-scope="scope"> <template slot-scope="scope">
<router-link <router-link
:to="'/benyi/assessmentchildhistory/student/' + scope.row.id" :to="'/benyi/assessmentchildhistory/student/' + scope.row.id"
@ -53,6 +48,12 @@
</router-link> </router-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="班级名称"
align="center"
prop="classid"
:formatter="classFormat"
/>
<el-table-column label="幼儿出生日期" align="center" prop="csrq" /> <el-table-column label="幼儿出生日期" align="center" prop="csrq" />
<el-table-column <el-table-column
label="性别" label="性别"
@ -67,6 +68,7 @@
:formatter="statusFormat" :formatter="statusFormat"
/> />
<el-table-column <el-table-column
fixed="right"
label="操作" label="操作"
align="center" align="center"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"

View File

@ -81,7 +81,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['benyi:checkindetail:edit']" v-hasPermi="['benyi:checkindetail:edit']"
>修改</el-button> >修改</el-button
>
<el-button <el-button
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
@ -102,6 +103,7 @@
</div> </div>
<el-table <el-table
border
v-loading="loading" v-loading="loading"
:data="detailList" :data="detailList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@ -114,14 +116,14 @@
/> />
<!-- <el-table-column label="编号" align="center" prop="id" /> --> <!-- <el-table-column label="编号" align="center" prop="id" /> -->
<!-- <el-table-column label="学校编码" align="center" prop="schoolid" /> --> <!-- <el-table-column label="学校编码" align="center" prop="schoolid" /> -->
<!-- <el-table-column label="幼儿编码" align="center" prop="childid" /> -->
<el-table-column fixed label="幼儿姓名" align="center" prop="childname" />
<el-table-column <el-table-column
label="班级名称" label="班级名称"
align="center" align="center"
prop="classid" prop="classid"
:formatter="classFormat" :formatter="classFormat"
/> />
<!-- <el-table-column label="幼儿编码" align="center" prop="childid" /> -->
<el-table-column label="幼儿姓名" align="center" prop="childname" />
<el-table-column <el-table-column
label="出勤类型" label="出勤类型"
align="center" align="center"
@ -140,6 +142,7 @@
</el-table-column> </el-table-column>
<!-- <el-table-column label="创建人" align="center" prop="createuserid" /> --> <!-- <el-table-column label="创建人" align="center" prop="createuserid" /> -->
<el-table-column <el-table-column
fixed="right"
label="操作" label="操作"
align="center" align="center"
width="120" width="120"
@ -177,7 +180,12 @@
/> />
<!-- 添加或修改幼儿考勤对话框 --> <!-- 添加或修改幼儿考勤对话框 -->
<el-dialog :title="title" :visible.sync="open" class="v-dialog" append-to-body> <el-dialog
:title="title"
:visible.sync="open"
class="v-dialog"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="选择幼儿" prop="childname"> <el-form-item label="选择幼儿" prop="childname">
<el-checkbox <el-checkbox
@ -187,7 +195,7 @@
:disabled="isable" :disabled="isable"
>全选</el-checkbox >全选</el-checkbox
> >
<div style="margin: 15px 0;"></div> <div style="margin: 15px 0"></div>
<el-checkbox-group <el-checkbox-group
v-model="checkedChilds" v-model="checkedChilds"
@change="handlecheckedChildsChange" @change="handlecheckedChildsChange"
@ -228,7 +236,7 @@ import {
delDetail, delDetail,
addDetail, addDetail,
updateDetail, updateDetail,
exportDetail exportDetail,
} from "@/api/benyi/checkindetail"; } from "@/api/benyi/checkindetail";
import { listByCheck, listChild } from "@/api/benyi/child"; import { listByCheck, listChild } from "@/api/benyi/child";
@ -274,7 +282,7 @@ export default {
childname: undefined, childname: undefined,
type: undefined, type: undefined,
createuserid: undefined, createuserid: undefined,
createTime: undefined createTime: undefined,
}, },
// //
form: {}, form: {},
@ -284,17 +292,19 @@ export default {
{ {
required: true, required: true,
message: "请至少选择一个幼儿", message: "请至少选择一个幼儿",
trigger: "blur" trigger: "blur",
} },
], ],
type: [{ required: true, message: "出勤类型不能为空", trigger: "blur" }] type: [
} { required: true, message: "出勤类型不能为空", trigger: "blur" },
],
},
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getClassList(); this.getClassList();
this.getDicts("sys_dm_cqzt").then(response => { this.getDicts("sys_dm_cqzt").then((response) => {
this.checkinOptions = response.data; this.checkinOptions = response.data;
}); });
}, },
@ -311,7 +321,7 @@ export default {
}, },
// //
getClassList() { getClassList() {
listClass(null).then(response => { listClass(null).then((response) => {
this.classOptions = response.rows; this.classOptions = response.rows;
}); });
}, },
@ -324,7 +334,7 @@ export default {
// return this.selectDictLabel(this.classOptions, row.classid); // return this.selectDictLabel(this.classOptions, row.classid);
var actions = []; var actions = [];
var datas = this.classOptions; var datas = this.classOptions;
Object.keys(datas).map(key => { Object.keys(datas).map((key) => {
if (datas[key].bjbh == "" + row.classid) { if (datas[key].bjbh == "" + row.classid) {
actions.push(datas[key].bjmc); actions.push(datas[key].bjmc);
return false; return false;
@ -335,7 +345,7 @@ export default {
/** 查询幼儿考勤列表 */ /** 查询幼儿考勤列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listDetail(this.queryParams).then(response => { listDetail(this.queryParams).then((response) => {
this.detailList = response.rows; this.detailList = response.rows;
// console.log(response.rows); // console.log(response.rows);
this.total = response.total; this.total = response.total;
@ -357,7 +367,7 @@ export default {
childname: undefined, childname: undefined,
type: undefined, type: undefined,
createuserid: undefined, createuserid: undefined,
createTime: undefined createTime: undefined,
}; };
this.resetForm("form"); this.resetForm("form");
@ -375,7 +385,7 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id); this.ids = selection.map((item) => item.id);
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
@ -385,7 +395,7 @@ export default {
this.isable = false; this.isable = false;
this.open = true; this.open = true;
this.title = "幼儿考勤"; this.title = "幼儿考勤";
listByCheck(null).then(response => { listByCheck(null).then((response) => {
this.childs = response.rows; this.childs = response.rows;
}); });
}, },
@ -394,9 +404,9 @@ export default {
this.reset(); this.reset();
this.isable = true; this.isable = true;
const id = row.id || this.ids; const id = row.id || this.ids;
getDetail(id).then(response => { getDetail(id).then((response) => {
this.form = response.data; this.form = response.data;
listChild(null).then(response => { listChild(null).then((response) => {
this.childs = response.rows; this.childs = response.rows;
}); });
this.checkedChilds.push(response.data.childid); this.checkedChilds.push(response.data.childid);
@ -405,8 +415,8 @@ export default {
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.childname == "") { if (this.form.childname == "") {
this.msgError("请至少选择一个幼儿"); this.msgError("请至少选择一个幼儿");
@ -414,7 +424,7 @@ export default {
} }
if (valid) { if (valid) {
if (this.form.id != undefined) { if (this.form.id != undefined) {
updateDetail(this.form).then(response => { updateDetail(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改考勤成功"); this.msgSuccess("修改考勤成功");
this.open = false; this.open = false;
@ -423,7 +433,7 @@ export default {
}); });
} else { } else {
// //
addDetail(this.form).then(response => { addDetail(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("添加考勤成功"); this.msgSuccess("添加考勤成功");
this.open = false; this.open = false;
@ -444,17 +454,17 @@ export default {
{ {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
} }
) )
.then(function() { .then(function () {
return delDetail(ids); return delDetail(ids);
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}) })
.catch(function() {}); .catch(function () {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
@ -462,21 +472,21 @@ export default {
this.$confirm("是否确认导出所有幼儿考勤数据项?", "警告", { this.$confirm("是否确认导出所有幼儿考勤数据项?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(function() { .then(function () {
return exportDetail(queryParams); return exportDetail(queryParams);
}) })
.then(response => { .then((response) => {
this.download(response.msg); this.download(response.msg);
}) })
.catch(function() {}); .catch(function () {});
}, },
handleCheckAllChange(val) { handleCheckAllChange(val) {
// this.checkedChilds = val ? this.childs : []; // this.checkedChilds = val ? this.childs : [];
// this.isIndeterminate = false; // this.isIndeterminate = false;
this.checkedChilds = []; this.checkedChilds = [];
this.childs.forEach(item => { this.childs.forEach((item) => {
// //
this.checkedChilds.push(item.id); this.checkedChilds.push(item.id);
}); });
@ -485,7 +495,7 @@ export default {
//console.log(this.checkedChilds); //console.log(this.checkedChilds);
var cids = ""; var cids = "";
this.checkedChilds.forEach(item => { this.checkedChilds.forEach((item) => {
// //
cids = cids + item + ","; cids = cids + item + ",";
}); });
@ -500,13 +510,13 @@ export default {
//console.log(this.checkedChilds); //console.log(this.checkedChilds);
var cids = ""; var cids = "";
this.checkedChilds.forEach(item => { this.checkedChilds.forEach((item) => {
// //
cids = cids + item + ","; cids = cids + item + ",";
}); });
console.log(cids); console.log(cids);
this.form.childname = cids; this.form.childname = cids;
} },
} },
}; };
</script> </script>

View File

@ -123,20 +123,26 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
border
:data="childList" :data="childList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="编号" align="center" prop="id" /> --> <!-- <el-table-column label="编号" align="center" prop="id" /> -->
<!-- <el-table-column label="幼儿园名称" align="center" prop="schoolid" /> --> <!-- <el-table-column label="幼儿园名称" align="center" prop="schoolid" /> -->
<el-table-column fixed label="姓名" align="center" prop="name" />
<el-table-column <el-table-column
label="班级名称" label="班级名称"
align="center" align="center"
prop="classid" prop="classid"
:formatter="classFormat" :formatter="classFormat"
/> />
<el-table-column label="姓名" align="center" prop="name" /> <el-table-column
<el-table-column label="家长手机号码" width="120" align="center" prop="phone" /> label="家长手机号码"
width="120"
align="center"
prop="phone"
/>
<el-table-column <el-table-column
label="性别" label="性别"
align="center" align="center"
@ -179,6 +185,7 @@
:formatter="statusFormat" :formatter="statusFormat"
/> />
<el-table-column <el-table-column
fixed="right"
label="操作" label="操作"
align="center" align="center"
width="120" width="120"
@ -214,7 +221,12 @@
/> />
<!-- 添加或修改幼儿信息对话框 --> <!-- 添加或修改幼儿信息对话框 -->
<el-dialog :title="title" :visible.sync="open" class="big-dialog" append-to-body> <el-dialog
:title="title"
:visible.sync="open"
class="big-dialog"
append-to-body
>
<el-tabs type="border-card"> <el-tabs type="border-card">
<el-tab-pane label="幼儿基础信息"> <el-tab-pane label="幼儿基础信息">
<el-row :gutter="15"> <el-row :gutter="15">
@ -659,7 +671,7 @@ import {
addChild, addChild,
updateChild, updateChild,
updateChild_tb, updateChild_tb,
importTemplate importTemplate,
} from "@/api/benyi/child"; } from "@/api/benyi/child";
import { import {
listContactpeople, listContactpeople,
@ -667,7 +679,7 @@ import {
getContactpeopleByChildId, getContactpeopleByChildId,
delContactpeople, delContactpeople,
addContactpeople, addContactpeople,
updateContactpeople updateContactpeople,
} from "@/api/benyi/contactpeople"; } from "@/api/benyi/contactpeople";
import { listClass } from "@/api/system/class"; import { listClass } from "@/api/system/class";
@ -687,22 +699,22 @@ export default {
placeholders: { placeholders: {
province: "请选择省", province: "请选择省",
city: "请选择市", city: "请选择市",
area: "请选择区" area: "请选择区",
}, },
diglogForm: { diglogForm: {
province: null, province: null,
city: null, city: null,
area: null area: null,
}, },
diglogForm1: { diglogForm1: {
province: null, province: null,
city: null, city: null,
area: null area: null,
}, },
diglogForm2: { diglogForm2: {
province: null, province: null,
city: null, city: null,
area: null area: null,
}, },
// //
inviteCode: "", inviteCode: "",
@ -750,7 +762,7 @@ export default {
// //
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: "Bearer " + getToken() },
// //
url: process.env.VUE_APP_BASE_API + "/benyi/child/importData" url: process.env.VUE_APP_BASE_API + "/benyi/child/importData",
}, },
// //
queryParams: { queryParams: {
@ -794,7 +806,7 @@ export default {
firstLanguage: undefined, firstLanguage: undefined,
seconderLanguage: undefined, seconderLanguage: undefined,
otherLanguage: undefined, otherLanguage: undefined,
createuserid: undefined createuserid: undefined,
}, },
// //
form: {}, form: {},
@ -805,44 +817,44 @@ export default {
// //
rules: { rules: {
name: [ name: [
{ required: true, message: "幼儿姓名不能为空", trigger: "blur" } { required: true, message: "幼儿姓名不能为空", trigger: "blur" },
], ],
phone: [ phone: [
{ required: true, message: "家长手机号码不能为空", trigger: "blur" } { required: true, message: "家长手机号码不能为空", trigger: "blur" },
], ],
classid: [{ required: true, message: "班级不能为空", trigger: "blur" }] classid: [{ required: true, message: "班级不能为空", trigger: "blur" }],
}, },
rules_tb: { rules_tb: {
classid: [{ required: true, message: "班级不能为空", trigger: "blur" }] classid: [{ required: true, message: "班级不能为空", trigger: "blur" }],
} },
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getClassList(); this.getClassList();
this.getDicts("sys_user_sex").then(response => { this.getDicts("sys_user_sex").then((response) => {
this.sexOptions = response.data; this.sexOptions = response.data;
}); });
this.getDicts("sys_normal_disable").then(response => { this.getDicts("sys_normal_disable").then((response) => {
this.statusOptions = response.data; this.statusOptions = response.data;
}); });
this.getDicts("sys_dm_mz").then(response => { this.getDicts("sys_dm_mz").then((response) => {
this.mzOptions = response.data; this.mzOptions = response.data;
}); });
this.getDicts("sys_yes_no").then(response => { this.getDicts("sys_yes_no").then((response) => {
this.ynOptions = response.data; this.ynOptions = response.data;
}); });
this.getDicts("sys_dm_ryqd").then(response => { this.getDicts("sys_dm_ryqd").then((response) => {
this.sourceOptions = response.data; this.sourceOptions = response.data;
}); });
this.getDicts("sys_dm_jtgx").then(response => { this.getDicts("sys_dm_jtgx").then((response) => {
this.jtgxOptions = response.data; this.jtgxOptions = response.data;
}); });
this.getLink(); this.getLink();
}, },
components: { components: {
// //
VDistpicker VDistpicker,
}, },
methods: { methods: {
/** 导入按钮操作 */ /** 导入按钮操作 */
@ -852,7 +864,7 @@ export default {
}, },
// //
getLink() { getLink() {
getUserProfile().then(response => { getUserProfile().then((response) => {
var domain = window.location.host; var domain = window.location.host;
//console.log(domain); //console.log(domain);
//this.user = response.data; //this.user = response.data;
@ -862,14 +874,14 @@ export default {
// //
copy(e, text) { copy(e, text) {
const clipboard = new Clipboard(e.target, { text: () => text }); const clipboard = new Clipboard(e.target, { text: () => text });
clipboard.on("success", e => { clipboard.on("success", (e) => {
this.msgSuccess("复制成功"); this.msgSuccess("复制成功");
// //
clipboard.off("error"); clipboard.off("error");
clipboard.off("success"); clipboard.off("success");
clipboard.destroy(); clipboard.destroy();
}); });
clipboard.on("error", e => { clipboard.on("error", (e) => {
// //
this.msgError("手机权限不支持复制功能"); this.msgError("手机权限不支持复制功能");
// //
@ -904,7 +916,7 @@ export default {
// return this.selectDictLabel(this.classOptions, row.classid); // return this.selectDictLabel(this.classOptions, row.classid);
var actions = []; var actions = [];
var datas = this.classOptions; var datas = this.classOptions;
Object.keys(datas).map(key => { Object.keys(datas).map((key) => {
if (datas[key].bjbh == "" + row.classid) { if (datas[key].bjbh == "" + row.classid) {
actions.push(datas[key].bjmc); actions.push(datas[key].bjmc);
return false; return false;
@ -913,14 +925,14 @@ export default {
return actions.join(""); return actions.join("");
}, },
getClassList() { getClassList() {
listClass(null).then(response => { listClass(null).then((response) => {
this.classOptions = response.rows; this.classOptions = response.rows;
}); });
}, },
/** 查询幼儿信息列表 */ /** 查询幼儿信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listChild(this.queryParams).then(response => { listChild(this.queryParams).then((response) => {
this.childList = response.rows; this.childList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -979,7 +991,7 @@ export default {
seconderLanguage: undefined, seconderLanguage: undefined,
otherLanguage: undefined, otherLanguage: undefined,
createuserid: undefined, createuserid: undefined,
createTime: undefined createTime: undefined,
}; };
this.diglogForm.province = ""; this.diglogForm.province = "";
@ -1015,7 +1027,7 @@ export default {
gmphone: undefined, gmphone: undefined,
gmaddress: undefined, gmaddress: undefined,
gmoffphone: undefined, gmoffphone: undefined,
createTime: undefined createTime: undefined,
}; };
this.resetForm("form_jhr"); this.resetForm("form_jhr");
}, },
@ -1031,7 +1043,7 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id); this.ids = selection.map((item) => item.id);
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
@ -1045,7 +1057,7 @@ export default {
async handleUpdate(row) { async handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids; const id = row.id || this.ids;
await getChild(id).then(response => { await getChild(id).then((response) => {
this.form = response.data; this.form = response.data;
this.diglogForm.province = response.data.birthProvincename; this.diglogForm.province = response.data.birthProvincename;
@ -1064,20 +1076,20 @@ export default {
this.title = "修改幼儿信息"; this.title = "修改幼儿信息";
//id //id
getContactpeopleByChildId(this.form.id).then(res => { getContactpeopleByChildId(this.form.id).then((res) => {
// console.log("childid:" + this.form.id + ";jhr:" + res.data); // console.log("childid:" + this.form.id + ";jhr:" + res.data);
this.form_jhr = res.data; this.form_jhr = res.data;
}); });
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != undefined) { if (this.form.id != undefined) {
updateChild(this.form).then(response => { updateChild(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
updateContactpeople(this.form_jhr).then(res => { updateContactpeople(this.form_jhr).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
@ -1087,11 +1099,11 @@ export default {
} }
}); });
} else { } else {
addChild(this.form).then(response => { addChild(this.form).then((response) => {
// console.log(response); // console.log(response);
if (response.code === 200) { if (response.code === 200) {
this.form_jhr.childid = response.data; this.form_jhr.childid = response.data;
addContactpeople(this.form_jhr).then(res => { addContactpeople(this.form_jhr).then((res) => {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
@ -1103,11 +1115,11 @@ export default {
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm_tb: function() { submitForm_tb: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
console.log(this.ids + "---" + this.form.classid); console.log(this.ids + "---" + this.form.classid);
updateChild_tb(this.form, this.ids).then(response => { updateChild_tb(this.form, this.ids).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("调班成功"); this.msgSuccess("调班成功");
this.open_tb = false; this.open_tb = false;
@ -1127,23 +1139,19 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$confirm( this.$confirm("是否确认删除幼儿信息数据项?", "警告", {
'是否确认删除幼儿信息编号为"' + ids + '"的数据项?',
"警告",
{
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
} })
) .then(function () {
.then(function() {
return delChild(ids); return delChild(ids);
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}) })
.catch(function() {}); .catch(function () {});
}, },
// //
onSelected_brith(data) { onSelected_brith(data) {
@ -1201,7 +1209,7 @@ export default {
}, },
/** 下载模板操作 */ /** 下载模板操作 */
importTemplate() { importTemplate() {
importTemplate().then(response => { importTemplate().then((response) => {
this.download(response.msg); this.download(response.msg);
}); });
}, },
@ -1220,7 +1228,7 @@ export default {
// //
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
} },
} },
}; };
</script> </script>

View File

@ -86,6 +86,7 @@
</div> </div>
<el-table <el-table
border
v-loading="loading" v-loading="loading"
:data="contactpeopleList" :data="contactpeopleList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"

View File

@ -93,7 +93,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['benyi:schoolcalendar:edit']" v-hasPermi="['benyi:schoolcalendar:edit']"
>修改</el-button> >修改</el-button
>
<el-button <el-button
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
@ -114,6 +115,7 @@
</div> </div>
<el-table <el-table
border
v-loading="loading" v-loading="loading"
:data="schoolcalendarList" :data="schoolcalendarList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@ -125,7 +127,7 @@
:selectable="checkSelectable" :selectable="checkSelectable"
/> />
<!-- <el-table-column label="编号" align="center" prop="id" /> --> <!-- <el-table-column label="编号" align="center" prop="id" /> -->
<el-table-column label="名称" align="center" prop="name" /> <el-table-column fixed label="名称" align="center" prop="name" />
<el-table-column <el-table-column
label="活动类型" label="活动类型"
align="center" align="center"
@ -167,6 +169,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
fixed="right"
label="操作" label="操作"
align="center" align="center"
width="120" width="120"
@ -275,7 +278,7 @@ import {
delSchoolcalendar, delSchoolcalendar,
addSchoolcalendar, addSchoolcalendar,
updateSchoolcalendar, updateSchoolcalendar,
exportSchoolcalendar exportSchoolcalendar,
} from "@/api/benyi/schoolcalendar"; } from "@/api/benyi/schoolcalendar";
export default { export default {
@ -312,7 +315,7 @@ export default {
pickerOptions0: { pickerOptions0: {
disabledDate(time) { disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7; return time.getTime() < Date.now() - 8.64e7;
} },
}, },
// //
queryParams: { queryParams: {
@ -325,7 +328,7 @@ export default {
deptid: undefined, deptid: undefined,
activitytime: undefined, activitytime: undefined,
createuserid: undefined, createuserid: undefined,
createtime: undefined createtime: undefined,
}, },
// //
form: {}, form: {},
@ -333,26 +336,26 @@ export default {
rules: { rules: {
name: [{ required: true, message: "名称不能为空", trigger: "blur" }], name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
type: [ type: [
{ required: true, message: "活动类型不能为空", trigger: "blur" } { required: true, message: "活动类型不能为空", trigger: "blur" },
], ],
scope: [ scope: [
{ required: true, message: "活动范围不能为空", trigger: "blur" } { required: true, message: "活动范围不能为空", trigger: "blur" },
], ],
activitytime: [ activitytime: [
{ required: true, message: "活动时间不能为空", trigger: "blur" } { required: true, message: "活动时间不能为空", trigger: "blur" },
] ],
} },
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDicts("sys_schoolcalendartype").then(response => { this.getDicts("sys_schoolcalendartype").then((response) => {
this.schoolcalendartypeOptions = response.data; this.schoolcalendartypeOptions = response.data;
}); });
this.getDicts("sys_yebjlx").then(response => { this.getDicts("sys_yebjlx").then((response) => {
this.scopeOptions = response.data; this.scopeOptions = response.data;
}); });
this.getDicts("sys_xnxq").then(response => { this.getDicts("sys_xnxq").then((response) => {
this.xnxqOptions = response.data; this.xnxqOptions = response.data;
}); });
}, },
@ -394,7 +397,7 @@ export default {
this.loading = true; this.loading = true;
listSchoolcalendar( listSchoolcalendar(
this.addDateRange(this.queryParams, this.dateRange) this.addDateRange(this.queryParams, this.dateRange)
).then(response => { ).then((response) => {
this.schoolcalendarList = response.rows; this.schoolcalendarList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -412,7 +415,7 @@ export default {
name: undefined, name: undefined,
type: undefined, type: undefined,
scope: undefined, scope: undefined,
activitytime: undefined activitytime: undefined,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -429,7 +432,7 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id); this.ids = selection.map((item) => item.id);
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
@ -444,7 +447,7 @@ export default {
this.reset(); this.reset();
const id = row.id || this.ids; const id = row.id || this.ids;
var myArray = new Array(2); var myArray = new Array(2);
getSchoolcalendar(id).then(response => { getSchoolcalendar(id).then((response) => {
this.form = response.data; this.form = response.data;
myArray[0] = response.data.activitytime; myArray[0] = response.data.activitytime;
myArray[1] = response.data.activityendtime; myArray[1] = response.data.activityendtime;
@ -457,8 +460,8 @@ export default {
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
var arrscope = this.form.scope; var arrscope = this.form.scope;
this.form.scope = arrscope.join(";"); this.form.scope = arrscope.join(";");
@ -469,7 +472,7 @@ export default {
this.form.activityendtime = v2; this.form.activityendtime = v2;
if (this.form.id != undefined) { if (this.form.id != undefined) {
updateSchoolcalendar(this.form).then(response => { updateSchoolcalendar(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
@ -480,7 +483,7 @@ export default {
}); });
} else { } else {
//console.log(this.form.activitytime[1]); //console.log(this.form.activitytime[1]);
addSchoolcalendar(this.form).then(response => { addSchoolcalendar(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
@ -502,17 +505,17 @@ export default {
{ {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
} }
) )
.then(function() { .then(function () {
return delSchoolcalendar(ids); return delSchoolcalendar(ids);
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}) })
.catch(function() {}); .catch(function () {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
@ -520,16 +523,16 @@ export default {
this.$confirm("是否确认导出所有园历管理数据项?", "警告", { this.$confirm("是否确认导出所有园历管理数据项?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(function() { .then(function () {
return exportSchoolcalendar(queryParams); return exportSchoolcalendar(queryParams);
}) })
.then(response => { .then((response) => {
this.download(response.msg); this.download(response.msg);
}) })
.catch(function() {}); .catch(function () {});
} },
} },
}; };
</script> </script>

View File

@ -1,8 +1,18 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> <el-form
:model="queryParams"
ref="queryForm"
:inline="true"
label-width="68px"
>
<el-form-item label="活动类型" prop="type"> <el-form-item label="活动类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择活动类型" clearable size="small"> <el-select
v-model="queryParams.type"
placeholder="请选择活动类型"
clearable
size="small"
>
<el-option <el-option
v-for="dict in typeOptions" v-for="dict in typeOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -22,7 +32,12 @@
</el-select> </el-select>
</el-form-item>--> </el-form-item>-->
<el-form-item label="学年学期" prop="xnxq"> <el-form-item label="学年学期" prop="xnxq">
<el-select v-model="queryParams.xnxq" placeholder="请选择学年学期" clearable size="small"> <el-select
v-model="queryParams.xnxq"
placeholder="请选择学年学期"
clearable
size="small"
>
<el-option <el-option
v-for="dict in xnxqOptions" v-for="dict in xnxqOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -43,8 +58,16 @@
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item>
</el-form> </el-form>
@ -56,7 +79,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['benyi:schoolcalendarclass:add']" v-hasPermi="['benyi:schoolcalendarclass:add']"
>新增</el-button> >新增</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -66,7 +90,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['benyi:schoolcalendarclass:edit']" v-hasPermi="['benyi:schoolcalendarclass:edit']"
>修改</el-button> >修改</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -76,7 +101,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['benyi:schoolcalendarclass:remove']" v-hasPermi="['benyi:schoolcalendarclass:remove']"
>删除</el-button> >删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -85,28 +111,60 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['benyi:schoolcalendarclass:export']" v-hasPermi="['benyi:schoolcalendarclass:export']"
>导出</el-button> >导出</el-button
>
</el-col> </el-col>
</el-row> </el-row>
<el-table <el-table
border
v-loading="loading" v-loading="loading"
:data="schoolcalendarclassList" :data="schoolcalendarclassList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" :selectable="checkSelectable" /> <el-table-column
type="selection"
width="55"
align="center"
:selectable="checkSelectable"
/>
<!-- <el-table-column label="编号" align="center" prop="id" /> --> <!-- <el-table-column label="编号" align="center" prop="id" /> -->
<el-table-column label="名称" align="center" prop="name" /> <el-table-column fixed label="名称" align="center" prop="name" />
<el-table-column label="活动类型" align="center" prop="type" :formatter="typeFormat" /> <el-table-column
label="活动类型"
align="center"
prop="type"
:formatter="typeFormat"
/>
<el-table-column label="所属班级" align="center" prop="byClass.bjmc" /> <el-table-column label="所属班级" align="center" prop="byClass.bjmc" />
<el-table-column label="学年学期" align="center" prop="xnxq" :formatter="xnxqFormat" /> <el-table-column
<el-table-column label="活动时间" align="center" prop="activitytime" width="180" /> label="学年学期"
<el-table-column label="创建时间" align="center" prop="createtime" width="180"> align="center"
prop="xnxq"
:formatter="xnxqFormat"
/>
<el-table-column
label="活动时间"
align="center"
prop="activitytime"
width="180"
/>
<el-table-column
label="创建时间"
align="center"
prop="createtime"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createtime) }}</span> <span>{{ parseTime(scope.row.createtime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column
fixed="right"
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -115,7 +173,8 @@
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['benyi:schoolcalendarclass:edit']" v-hasPermi="['benyi:schoolcalendarclass:edit']"
:disabled="!checkSelectable(scope.row)" :disabled="!checkSelectable(scope.row)"
>修改</el-button> >修改</el-button
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -123,13 +182,14 @@
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['benyi:schoolcalendarclass:remove']" v-hasPermi="['benyi:schoolcalendarclass:remove']"
:disabled="!checkSelectable(scope.row)" :disabled="!checkSelectable(scope.row)"
>删除</el-button> >删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@ -140,7 +200,11 @@
<el-dialog :title="title" :visible.sync="open" width="500px"> <el-dialog :title="title" :visible.sync="open" width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="form.name" type="textarea" placeholder="请输入内容" /> <el-input
v-model="form.name"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-form-item>
<el-form-item label="活动类型" prop="type"> <el-form-item label="活动类型" prop="type">
<el-select v-model="form.type" placeholder="请选择活动类型"> <el-select v-model="form.type" placeholder="请选择活动类型">
@ -184,7 +248,7 @@ import {
delSchoolcalendarclass, delSchoolcalendarclass,
addSchoolcalendarclass, addSchoolcalendarclass,
updateSchoolcalendarclass, updateSchoolcalendarclass,
exportSchoolcalendarclass exportSchoolcalendarclass,
} from "@/api/benyi/schoolcalendarclass"; } from "@/api/benyi/schoolcalendarclass";
export default { export default {
@ -219,7 +283,7 @@ export default {
pickerOptions0: { pickerOptions0: {
disabledDate(time) { disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7; return time.getTime() < Date.now() - 8.64e7;
} },
}, },
// //
queryParams: { queryParams: {
@ -232,7 +296,7 @@ export default {
deptid: undefined, deptid: undefined,
activitytime: undefined, activitytime: undefined,
createuserid: undefined, createuserid: undefined,
createtime: undefined createtime: undefined,
}, },
// //
form: {}, form: {},
@ -241,21 +305,21 @@ export default {
rules: { rules: {
name: [{ required: true, message: "名称不能为空", trigger: "blur" }], name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
type: [ type: [
{ required: true, message: "活动类型不能为空", trigger: "blur" } { required: true, message: "活动类型不能为空", trigger: "blur" },
], ],
activitytime: [ activitytime: [
{ required: true, message: "活动时间不能为空", trigger: "blur" } { required: true, message: "活动时间不能为空", trigger: "blur" },
] ],
} },
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getListAll(); this.getListAll();
this.getDicts("sys_schoolcalendartype").then(response => { this.getDicts("sys_schoolcalendartype").then((response) => {
this.typeOptions = response.data; this.typeOptions = response.data;
}); });
this.getDicts("sys_xnxq").then(response => { this.getDicts("sys_xnxq").then((response) => {
this.xnxqOptions = response.data; this.xnxqOptions = response.data;
}); });
}, },
@ -263,7 +327,7 @@ export default {
/** 查询园历管理(班级)列表 */ /** 查询园历管理(班级)列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listSchoolcalendarclass(this.queryParams).then(response => { listSchoolcalendarclass(this.queryParams).then((response) => {
this.schoolcalendarclassList = response.rows; this.schoolcalendarclassList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -271,7 +335,7 @@ export default {
}, },
/** 查询所有班级名称列表 */ /** 查询所有班级名称列表 */
getListAll() { getListAll() {
listSchoolcalendarclassAll(this.queryParams).then(response => { listSchoolcalendarclassAll(this.queryParams).then((response) => {
this.classListAll = response.rows; this.classListAll = response.rows;
}); });
}, },
@ -311,7 +375,7 @@ export default {
deptid: undefined, deptid: undefined,
activitytime: undefined, activitytime: undefined,
createuserid: undefined, createuserid: undefined,
createtime: undefined createtime: undefined,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -327,7 +391,7 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id); this.ids = selection.map((item) => item.id);
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
@ -342,7 +406,7 @@ export default {
this.reset(); this.reset();
const id = row.id || this.ids; const id = row.id || this.ids;
var myArray = new Array(2); var myArray = new Array(2);
getSchoolcalendarclass(id).then(response => { getSchoolcalendarclass(id).then((response) => {
this.form = response.data; this.form = response.data;
myArray[0] = response.data.activitytime; myArray[0] = response.data.activitytime;
myArray[1] = response.data.activityendtime; myArray[1] = response.data.activityendtime;
@ -353,8 +417,8 @@ export default {
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
var v1 = this.form.activitytime[0]; var v1 = this.form.activitytime[0];
var v2 = this.form.activitytime[1]; var v2 = this.form.activitytime[1];
@ -362,7 +426,7 @@ export default {
this.form.activityendtime = v2; this.form.activityendtime = v2;
if (this.form.id != undefined) { if (this.form.id != undefined) {
updateSchoolcalendarclass(this.form).then(response => { updateSchoolcalendarclass(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
@ -372,7 +436,7 @@ export default {
} }
}); });
} else { } else {
addSchoolcalendarclass(this.form).then(response => { addSchoolcalendarclass(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
@ -394,17 +458,17 @@ export default {
{ {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
} }
) )
.then(function() { .then(function () {
return delSchoolcalendarclass(ids); return delSchoolcalendarclass(ids);
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}) })
.catch(function() {}); .catch(function () {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
@ -412,16 +476,16 @@ export default {
this.$confirm("是否确认导出所有园历管理(班级)数据项?", "警告", { this.$confirm("是否确认导出所有园历管理(班级)数据项?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(function() { .then(function () {
return exportSchoolcalendarclass(queryParams); return exportSchoolcalendarclass(queryParams);
}) })
.then(response => { .then((response) => {
this.download(response.msg); this.download(response.msg);
}) })
.catch(function() {}); .catch(function () {});
} },
} },
}; };
</script> </script>

View File

@ -128,6 +128,7 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
border
:data="classList" :data="classList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
@ -137,14 +138,14 @@
align="center" align="center"
prop="bjbh" prop="bjbh"
v-if="false" v-if="false"
/>> />
<el-table-column fixed label="班级名称" align="center" prop="bjmc" />
<el-table-column <el-table-column
label="班级类型" label="班级类型"
align="center" align="center"
:formatter="bjtypeFormat" :formatter="bjtypeFormat"
prop="bjtype" prop="bjtype"
/> />
<el-table-column label="班级名称" align="center" prop="bjmc" />
<el-table-column label="主班教师" align="center" prop="zbjsxm" /> <el-table-column label="主班教师" align="center" prop="zbjsxm" />
<el-table-column label="配班教师" align="center" prop="pbjsxm" /> <el-table-column label="配班教师" align="center" prop="pbjsxm" />
<el-table-column label="助理教师" align="center" prop="zljsxm" /> <el-table-column label="助理教师" align="center" prop="zljsxm" />
@ -159,6 +160,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
fixed="right"
label="操作" label="操作"
width="220" width="220"
align="center" align="center"
@ -267,7 +269,7 @@ import {
addClass, addClass,
updateClass, updateClass,
exportClass, exportClass,
delJsClass delJsClass,
} from "@/api/system/class"; } from "@/api/system/class";
import { getUsersByRoleId } from "@/api/system/user"; import { getUsersByRoleId } from "@/api/system/user";
@ -312,26 +314,28 @@ export default {
zbjsxm: undefined, zbjsxm: undefined,
pbjsxm: undefined, pbjsxm: undefined,
zljsxm: undefined, zljsxm: undefined,
createtime: undefined createtime: undefined,
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
bjtype: [ bjtype: [
{ required: true, message: "班级类型不能为空", trigger: "blur" } { required: true, message: "班级类型不能为空", trigger: "blur" },
], ],
bjmc: [{ required: true, message: "班级名称不能为空", trigger: "blur" }] bjmc: [
} { required: true, message: "班级名称不能为空", trigger: "blur" },
],
},
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDicts("sys_yebjlx").then(response => { this.getDicts("sys_yebjlx").then((response) => {
this.bjtypeOptions = response.data; this.bjtypeOptions = response.data;
}); });
// //
getUsersByRoleId().then(response => { getUsersByRoleId().then((response) => {
this.zbjsOptions = response.zbjs; this.zbjsOptions = response.zbjs;
this.pbjsOptions = response.pbjs; this.pbjsOptions = response.pbjs;
this.zljsOptions = response.zljs; this.zljsOptions = response.zljs;
@ -341,7 +345,7 @@ export default {
/** 查询班级信息列表 */ /** 查询班级信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listClass(this.queryParams).then(response => { listClass(this.queryParams).then((response) => {
this.classList = response.rows; this.classList = response.rows;
console.log(this.classList); console.log(this.classList);
this.total = response.total; this.total = response.total;
@ -367,7 +371,7 @@ export default {
zbjs: undefined, zbjs: undefined,
pbjs: undefined, pbjs: undefined,
zljs: undefined, zljs: undefined,
createtime: undefined createtime: undefined,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -383,7 +387,7 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.bjbh); this.ids = selection.map((item) => item.bjbh);
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
@ -393,7 +397,7 @@ export default {
this.open = true; this.open = true;
this.title = "添加班级信息"; this.title = "添加班级信息";
// //
getUsersByRoleId().then(response => { getUsersByRoleId().then((response) => {
this.zbjsOptions = response.zbjs; this.zbjsOptions = response.zbjs;
this.pbjsOptions = response.pbjs; this.pbjsOptions = response.pbjs;
this.zljsOptions = response.zljs; this.zljsOptions = response.zljs;
@ -403,13 +407,13 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const bjbh = row.bjbh || this.ids; const bjbh = row.bjbh || this.ids;
getClass(bjbh).then(response => { getClass(bjbh).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改班级信息"; this.title = "修改班级信息";
// //
getUsersByRoleId().then(response => { getUsersByRoleId().then((response) => {
this.zbjsOptions = response.zbjs; this.zbjsOptions = response.zbjs;
this.pbjsOptions = response.pbjs; this.pbjsOptions = response.pbjs;
this.zljsOptions = response.zljs; this.zljsOptions = response.zljs;
@ -417,11 +421,11 @@ export default {
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.bjbh != undefined) { if (this.form.bjbh != undefined) {
updateClass(this.form).then(response => { updateClass(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
@ -431,7 +435,7 @@ export default {
} }
}); });
} else { } else {
addClass(this.form).then(response => { addClass(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
@ -450,32 +454,32 @@ export default {
this.$confirm("是否确认删除选中的班级信息?", "警告", { this.$confirm("是否确认删除选中的班级信息?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(function() { .then(function () {
return delClass(bjbhs); return delClass(bjbhs);
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}) })
.catch(function() {}); .catch(function () {});
}, },
handleEditJs(row) { handleEditJs(row) {
const bjbhs = row.bjbh || this.ids; const bjbhs = row.bjbh || this.ids;
this.$confirm("是否确认清空选中的班级教师信息?", "警告", { this.$confirm("是否确认清空选中的班级教师信息?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(function() { .then(function () {
return delJsClass(bjbhs); return delJsClass(bjbhs);
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
this.msgSuccess("清空成功"); this.msgSuccess("清空成功");
}) })
.catch(function() {}); .catch(function () {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
@ -483,16 +487,16 @@ export default {
this.$confirm("是否确认导出所有班级信息数据项?", "警告", { this.$confirm("是否确认导出所有班级信息数据项?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(function() { .then(function () {
return exportClass(queryParams); return exportClass(queryParams);
}) })
.then(response => { .then((response) => {
this.download(response.msg); this.download(response.msg);
}) })
.catch(function() {}); .catch(function () {});
} },
} },
}; };
</script> </script>

View File

@ -89,11 +89,17 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
border
:data="teacherList" :data="teacherList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户名称" align="center" prop="user.nickName" /> <el-table-column
fixed
label="用户名称"
align="center"
prop="user.nickName"
/>
<el-table-column <el-table-column
label="出生日期" label="出生日期"
align="center" align="center"
@ -130,6 +136,7 @@
<el-table-column label="资格证书" align="center" prop="zgzs" :formatter="zgzsFormat" /> <el-table-column label="资格证书" align="center" prop="zgzs" :formatter="zgzsFormat" />
<el-table-column label="创建人" align="center" prop="createuserid" />--> <el-table-column label="创建人" align="center" prop="createuserid" />-->
<el-table-column <el-table-column
fixed="right"
label="操作" label="操作"
align="center" align="center"
width="200" width="200"
@ -139,7 +146,7 @@
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-view"
@click="handleDetail(scope.row)" @click="handleDetail(scope.row)"
v-hasPermi="['system:teacher:edit']" v-hasPermi="['system:teacher:edit']"
>详情</el-button >详情</el-button
@ -249,7 +256,9 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" v-show="!flag" @click="submitForm"
> </el-button
>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -264,7 +273,7 @@ import {
delTeacher, delTeacher,
addTeacher, addTeacher,
updateTeacher, updateTeacher,
exportTeacher exportTeacher,
} from "@/api/system/teacher"; } from "@/api/system/teacher";
export default { export default {
@ -301,7 +310,7 @@ export default {
pickerOptions0: { pickerOptions0: {
disabledDate(time) { disabledDate(time) {
return time.getTime() > Date.now() - 8.64e7; return time.getTime() > Date.now() - 8.64e7;
} },
}, },
// //
flag: "", flag: "",
@ -319,7 +328,7 @@ export default {
cjgzrq: undefined, cjgzrq: undefined,
zgzs: undefined, zgzs: undefined,
createuserid: undefined, createuserid: undefined,
createtime: undefined createtime: undefined,
}, },
// //
form: {}, form: {},
@ -330,22 +339,22 @@ export default {
required: false, required: false,
pattern: /^\d{18}$/, pattern: /^\d{18}$/,
message: "请输入正确的身份证号", message: "请输入正确的身份证号",
trigger: "blur" trigger: "blur",
} },
] ],
} },
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getList2(); this.getList2();
this.getDicts("sys_jsxl").then(response => { this.getDicts("sys_jsxl").then((response) => {
this.xlOptions = response.data; this.xlOptions = response.data;
}); });
this.getDicts("sys_jsxw").then(response => { this.getDicts("sys_jsxw").then((response) => {
this.xwOptions = response.data; this.xwOptions = response.data;
}); });
this.getDicts("sys_jszgzs").then(response => { this.getDicts("sys_jszgzs").then((response) => {
this.zgzsOptions = response.data; this.zgzsOptions = response.data;
}); });
}, },
@ -353,7 +362,7 @@ export default {
/** 查询教师基本信息列表 */ /** 查询教师基本信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listTeacher(this.queryParams).then(response => { listTeacher(this.queryParams).then((response) => {
this.teacherList = response.rows; this.teacherList = response.rows;
console.log(response); console.log(response);
this.total = response.total; this.total = response.total;
@ -361,7 +370,7 @@ export default {
}); });
}, },
getList2() { getList2() {
listTeacher2(this.queryParams).then(response => { listTeacher2(this.queryParams).then((response) => {
this.teacherListAll = response.rows; this.teacherListAll = response.rows;
}); });
}, },
@ -397,7 +406,7 @@ export default {
cjgzrq: undefined, cjgzrq: undefined,
zgzs: undefined, zgzs: undefined,
createuserid: undefined, createuserid: undefined,
createtime: undefined createtime: undefined,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -413,7 +422,7 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id); this.ids = selection.map((item) => item.id);
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
@ -427,7 +436,7 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids; const id = row.id || this.ids;
getTeacher(id).then(response => { getTeacher(id).then((response) => {
this.form = response.data; this.form = response.data;
this.teacherMingCheng = this.form.user.nickName; this.teacherMingCheng = this.form.user.nickName;
this.open = true; this.open = true;
@ -439,7 +448,7 @@ export default {
handleDetail(row) { handleDetail(row) {
this.reset(); this.reset();
const id = row.id; const id = row.id;
getTeacher(id).then(response => { getTeacher(id).then((response) => {
this.form = response.data; this.form = response.data;
this.teacherMingCheng = this.form.user.nickName; this.teacherMingCheng = this.form.user.nickName;
this.open = true; this.open = true;
@ -449,11 +458,11 @@ export default {
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != undefined) { if (this.form.id != undefined) {
updateTeacher(this.form).then(response => { updateTeacher(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
@ -463,7 +472,7 @@ export default {
} }
}); });
} else { } else {
addTeacher(this.form).then(response => { addTeacher(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
@ -485,17 +494,17 @@ export default {
{ {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
} }
) )
.then(function() { .then(function () {
return delTeacher(ids); return delTeacher(ids);
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}) })
.catch(function() {}); .catch(function () {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
@ -503,16 +512,16 @@ export default {
this.$confirm("是否确认导出所有教师基本信息数据项?", "警告", { this.$confirm("是否确认导出所有教师基本信息数据项?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}) })
.then(function() { .then(function () {
return exportTeacher(queryParams); return exportTeacher(queryParams);
}) })
.then(response => { .then((response) => {
this.download(response.msg); this.download(response.msg);
}) })
.catch(function() {}); .catch(function () {});
} },
} },
}; };
</script> </script>