diff --git a/ruoyi-ui/src/views/benyi/dayflowassessment/index.vue b/ruoyi-ui/src/views/benyi/dayflowassessment/index.vue index e3dbbd87f..3e920ce7f 100644 --- a/ruoyi-ui/src/views/benyi/dayflowassessment/index.vue +++ b/ruoyi-ui/src/views/benyi/dayflowassessment/index.vue @@ -7,7 +7,7 @@ label-width="70px" > <el-form-item label="所属计划" prop="planid"> - <el-select v-model="form.planid" placeholder="请选择评估计划"> + <el-select v-model="queryParams.planid" placeholder="请选择评估计划"> <el-option v-for="dict in dayflowassessmentplanOptions" :key="dict.id" @@ -32,13 +32,14 @@ </el-select> </el-form-item> <el-form-item label="学年学期" prop="xnxq"> - <el-input - v-model="queryParams.xnxq" - placeholder="请输入评估学年学期" - clearable - size="small" - @keyup.enter.native="handleQuery" - /> + <el-select v-model="queryParams.xnxq" placeholder="请选择学年学期"> + <el-option + v-for="dict in xnxqOptions" + :key="dict.dictValue" + :label="dict.dictLabel" + :value="dict.dictValue" + /> + </el-select> </el-form-item> <el-form-item> <el-button @@ -95,21 +96,21 @@ @selection-change="handleSelectionChange" > <el-table-column type="selection" width="55" align="center" /> - <el-table-column label="所属计划" align="center" prop="planid" /> + <el-table-column label="所属计划" align="center" prop="planid" :formatter="planFormat"/> <el-table-column - label="班级编号" + label="班级名称" align="center" prop="classid" :formatter="classFormat" /> - <el-table-column label="班长姓名" align="center" prop="bzxm" /> - <el-table-column label="配班教师姓名" align="center" prop="pbxm" /> - <el-table-column label="助理教师姓名" align="center" prop="zlxm" /> - <el-table-column label="学年学期" align="center" prop="xnxq" /> + <el-table-column label="班长姓名" align="center" prop="bzbh" :formatter="bzbhFormat" /> + <el-table-column label="配班教师姓名" align="center" prop="pbbh" :formatter="pbbhFormat"/> + <el-table-column label="助理教师姓名" align="center" prop="zlbh" :formatter="zlbhFormat"/> + <el-table-column label="学年学期" align="center" prop="xnxq" :formatter="xnxqFormat"/> <el-table-column label="评估标准编号" align="center" prop="bzid" /> <el-table-column label="扣分值" align="center" prop="kfz" /> <el-table-column label="扣分次数" align="center" prop="kfcs" /> - <el-table-column label="评估对象" align="center" prop="pgdx" /> + <el-table-column label="评估对象" align="center" prop="pgdx" :formatter="pgdxFormat"/> <el-table-column label="操作" align="center" @@ -146,7 +147,7 @@ <!-- 添加或修改幼儿园一日流程评估对话框 --> <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 ref="form" :model="form" :rules="rules" label-width="120px"> <el-form-item label="所属计划" prop="planid"> <el-select v-model="form.planid" @@ -163,8 +164,7 @@ </el-form-item> <el-form-item label="班级编号" prop="classid"> <el-select - v-model="queryParams.classid" - clearable + v-model="form.classid" filterable size="small" placeholder="请选择班级" @@ -177,9 +177,9 @@ ></el-option> </el-select> </el-form-item> - <el-form-item label="班长编号" prop="bzbh"> + <el-form-item label="主班教师" prop="bzbh"> <el-select - v-model="queryParams.bzbh" + v-model="form.bzbh" filterable placeholder="请选择主班教师" > @@ -194,7 +194,7 @@ </el-form-item> <el-form-item label="配班教师" prop="pbbh"> <el-select - v-model="queryParams.pbbh" + v-model="form.pbbh" filterable placeholder="请选择配班教师" > @@ -209,7 +209,7 @@ </el-form-item> <el-form-item label="助理教师" prop="zlbh"> <el-select - v-model="queryParams.zlbh" + v-model="form.zlbh" filterable placeholder="请选择助理教师" > @@ -223,7 +223,14 @@ </el-select> </el-form-item> <el-form-item label="评估学年学期" prop="xnxq"> - <el-input v-model="form.xnxq" placeholder="请输入评估学年学期" /> + <el-select v-model="form.xnxq" placeholder="请选择学年学期"> + <el-option + v-for="dict in xnxqOptions" + :key="dict.dictValue" + :label="dict.dictLabel" + :value="dict.dictValue" + /> + </el-select> </el-form-item> <el-form-item label="评估标准编号" prop="bzid"> <el-input v-model="form.bzid" placeholder="请输入评估标准编号" /> @@ -235,7 +242,20 @@ <el-input v-model="form.kfcs" placeholder="请输入扣分次数" /> </el-form-item> <el-form-item label="评估对象" prop="pgdx"> - <el-input v-model="form.pgdx" placeholder="请输入评估对象" /> + <el-select + v-model="form.pgdx" + filterable + clearable + placeholder="请选择当时教师" + > + <el-option + v-for="item in userOptions" + :key="item.userId" + :label="item.nickName" + :value="item.userId" + :disabled="item.status == 1" + ></el-option> + </el-select> </el-form-item> <el-form-item label="执行人" prop="createUserid"> <el-input v-model="form.createUserid" placeholder="请输入执行人" /> @@ -257,12 +277,10 @@ import { addDayflowassessment, updateDayflowassessment, } from "@/api/benyi/dayflowassessment"; -import { - listDayflowassessmentplan, - getDayflowassessmentplan, -} from "@/api/benyi/dayflowassessmentplan"; +import { listDayflowassessmentplan, getDayflowassessmentplan, } from "@/api/benyi/dayflowassessmentplan"; import { listClass } from "@/api/system/class"; import { getUsersByRoleId } from "@/api/system/user"; +import { listUser } from "@/api/system/user"; export default { name: "Dayflowassessment", @@ -290,6 +308,10 @@ export default { pbjsOptions: [], //助理教师角色用户 zljsOptions: [], + // 学年学期 + xnxqOptions: [], + // 所有教师 + userOptions: [], // 弹出层标题 title: "", // 是否显示弹出层 @@ -323,6 +345,7 @@ export default { created() { this.getList(); this.getClassList(); + this.getUserList(); this.getDayflowassessmentplan(); //获取主班教师角色用户列表 getUsersByRoleId().then((response) => { @@ -330,6 +353,10 @@ export default { this.pbjsOptions = response.pbjs; this.zljsOptions = response.zljs; }); + // 获取学年学期 + this.getDicts("sys_xnxq").then((response) => { + this.xnxqOptions = response.data; + }); }, methods: { /** 查询幼儿园一日流程评估列表 */ @@ -345,7 +372,6 @@ export default { getDayflowassessmentplan() { listDayflowassessmentplan(null).then((response) => { this.dayflowassessmentplanOptions = response.rows; - console.log(this.dayflowassessmentplanOptions); }); }, // 获取班级列表 @@ -366,6 +392,83 @@ export default { }); return actions.join(""); }, + // 学年学期类型--字典状态字典翻译 + xnxqFormat(row, column) { + return this.selectDictLabel(this.xnxqOptions, row.xnxq); + }, + /** 查询用户列表 */ + getUserList() { + listUser(null).then( + (response) => { + this.userOptions = response.rows; + } + ); + }, + // 教师字典翻译 + bzbhFormat(row, column) { + var actions = []; + var datas = this.zbjsOptions; + Object.keys(datas).map((key) => { + if (datas[key].userId == "" + row.bzbh) { + actions.push(datas[key].nickName); + return false; + } + }); + return actions.join(""); + }, + // 教师字典翻译 + pbbhFormat(row, column) { + var actions = []; + var datas = this.pbjsOptions; + Object.keys(datas).map((key) => { + if (datas[key].userId == "" + row.pbbh) { + actions.push(datas[key].nickName); + return false; + } + }); + return actions.join(""); + }, + // 教师字典翻译 + zlbhFormat(row, column) { + var actions = []; + var datas = this.zljsOptions; + Object.keys(datas).map((key) => { + if (datas[key].userId == "" + row.zlbh) { + actions.push(datas[key].nickName); + return false; + } + }); + return actions.join(""); + }, + // 教师字典翻译 + pgdxFormat(row, column) { + var actions = []; + var datas = this.userOptions; + Object.keys(datas).map((key) => { + if (datas[key].userId == "" + row.pgdx) { + actions.push(datas[key].nickName); + return false; + } + }); + return actions.join(""); + }, + // 计划字典翻译 + planFormat(row, column) { + var actions = []; + var datas = this.dayflowassessmentplanOptions; + console.log(this.dayflowassessmentplanOptions); + Object.keys(datas).map((key) => { + if (datas[key].id == "" + row.planid) { + actions.push(datas[key].name); + return false; + } + }); + return actions.join(""); + }, + // 学年学期类型--字典状态字典翻译 + xnxqFormat(row, column) { + return this.selectDictLabel(this.xnxqOptions, row.xnxq); + }, // 取消按钮 cancel() { this.open = false; @@ -415,6 +518,12 @@ export default { this.reset(); this.open = true; this.title = "添加幼儿园一日流程评估"; + //获取主班教师角色用户列表 + getUsersByRoleId().then((response) => { + this.zbjsOptions = response.zbjs; + this.pbjsOptions = response.pbjs; + this.zljsOptions = response.zljs; + }); }, /** 修改按钮操作 */ handleUpdate(row) { @@ -424,6 +533,12 @@ export default { this.form = response.data; this.open = true; this.title = "修改幼儿园一日流程评估"; + //获取主班教师角色用户列表 + getUsersByRoleId().then((response) => { + this.zbjsOptions = response.zbjs; + this.pbjsOptions = response.pbjs; + this.zljsOptions = response.zljs; + }); }); }, /** 提交按钮 */ diff --git a/ruoyi-ui/src/views/benyi/dayflowassessmentplan/index.vue b/ruoyi-ui/src/views/benyi/dayflowassessmentplan/index.vue index d2fcd3ad5..259a1a1a9 100644 --- a/ruoyi-ui/src/views/benyi/dayflowassessmentplan/index.vue +++ b/ruoyi-ui/src/views/benyi/dayflowassessmentplan/index.vue @@ -103,13 +103,6 @@ @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="deptId" /> --> - <!-- <el-table-column label="评估月份" align="center" prop="month" width="180"> - <template slot-scope="scope"> - <span>{{ parseTime(scope.row.month, "{y}-{m}-{d}") }}</span> - </template> - </el-table-column> --> <el-table-column label="计划名称" align="center" prop="name" /> <el-table-column label="评估学年学期" @@ -124,6 +117,7 @@ :formatter="classFormat" /> <el-table-column label="评估内容" align="center" prop="connent" :formatter="dayFlowFormat"/> + <el-table-column label="内容分数" align="center" prop="score" /> <el-table-column label="评估时间" align="center" prop="starttime" /> <!-- <el-table-column label="创建人" align="center" prop="createUserid" /> --> <el-table-column @@ -173,18 +167,6 @@ /> </el-select> </el-form-item> - <!-- <el-form-item label="评估月份" prop="month"> - <el-date-picker - clearable - size="small" - style="width: 200px" - v-model="form.month" - type="month" - value-format="yyyy-MM-dd" - placeholder="选择评估月份" - > - </el-date-picker> - </el-form-item> --> <el-form-item label="评估班级" prop="classid"> <el-select v-model="form.classid" placeholder="请选择班级"> <el-option @@ -196,7 +178,7 @@ </el-select> </el-form-item> <el-form-item label="评估内容" prop="connent"> - <el-select v-model="form.connent" placeholder="请选择评估内容"> + <el-select v-model="form.connent" placeholder="请选择评估内容" @change="handleChange"> <el-option v-for="dict in detailOptions" :key="dict.id" @@ -273,6 +255,7 @@ export default { xnxq: undefined, classid: undefined, connent: undefined, + score: undefined, starttime: undefined, createUserid: undefined, }, @@ -353,6 +336,40 @@ export default { this.loading = false; }); }, + // 选择评估内容时改变分数 + handleChange(value) { + if (value === 1) { + this.form.score = 11.0; + } else if (value === 2) { + this.form.score = 6.5; + } else if (value === 3) { + this.form.score = 7.5; + } else if (value === 4) { + this.form.score = 3.0; + } else if (value === 5) { + this.form.score = 3.0; + } else if (value === 6) { + this.form.score = 2.0; + } else if (value === 7) { + this.form.score = 5.0; + } else if (value === 8) { + this.form.score = 5.5; + } else if (value === 9) { + this.form.score = 3.5; + } else if (value === 10) { + this.form.score = 5.0; + } else if (value === 11) { + this.form.score = 12.0; + } else if (value === 12) { + this.form.score = 3.0; + } else if (value === 13) { + this.form.score = 28.5; + } else if (value === 14) { + this.form.score = 1.5; + } else if (value === 15) { + this.form.score = 3.0; + } + }, // 取消按钮 cancel() { this.open = false; @@ -368,6 +385,7 @@ export default { xnxq: undefined, classid: undefined, connent: undefined, + score: undefined, starttime: undefined, createUserid: undefined, createTime: undefined, diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByDayflowassessmentController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByDayflowassessmentController.java index b0475cbf6..b67cf8981 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByDayflowassessmentController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByDayflowassessmentController.java @@ -74,6 +74,7 @@ public class ByDayflowassessmentController extends BaseController { @PostMapping public AjaxResult add(@RequestBody ByDayflowassessment byDayflowassessment) { byDayflowassessment.setDeptId(SecurityUtils.getLoginUser().getUser().getDeptId()); + byDayflowassessment.setCreateUserid(SecurityUtils.getLoginUser().getUser().getUserId()); return toAjax(byDayflowassessmentService.insertByDayflowassessment(byDayflowassessment)); } diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByDayflowassessmentplanController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByDayflowassessmentplanController.java index c4d961cf2..40dda3556 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByDayflowassessmentplanController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByDayflowassessmentplanController.java @@ -3,7 +3,9 @@ package com.ruoyi.project.benyi.controller; import java.util.List; import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.project.benyi.domain.ByDayflowassessment; import com.ruoyi.project.benyi.service.IByDayFlowDetailService; +import com.ruoyi.project.benyi.service.IByDayflowassessmentService; import com.ruoyi.project.common.SchoolCommon; import com.ruoyi.project.system.service.IByClassService; import com.ruoyi.project.system.service.ISysDictDataService; @@ -38,6 +40,8 @@ public class ByDayflowassessmentplanController extends BaseController { @Autowired private IByDayflowassessmentplanService byDayflowassessmentplanService; @Autowired + private IByDayflowassessmentService byDayflowassessmentService; + @Autowired private IByClassService byClassService; @Autowired private ISysDictDataService sysDictDataService; @@ -95,7 +99,53 @@ public class ByDayflowassessmentplanController extends BaseController { byDayflowassessmentplan.setDeptId(SecurityUtils.getLoginUser().getUser().getDeptId()); byDayflowassessmentplan.setCreateUserid(SecurityUtils.getLoginUser().getUser().getUserId()); byDayflowassessmentplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-" + sysDictDataService.selectDictLabel(dict_type, dict_value) + "-" + byDayFlowDetailService.selectByDayFlowDetailById(connentId).getName() + "-" + "评估计划" ); - return toAjax(byDayflowassessmentplanService.insertByDayflowassessmentplan(byDayflowassessmentplan)); + if + ( byClassService.selectByClassById(classId).getZbjs() == null && + byClassService.selectByClassById(classId).getPbjs() == null && + byClassService.selectByClassById(classId).getZljs() == null + ) + { + return AjaxResult.error("当前班级下没有教师,无法创建评估计划"); + } + int iCount = byDayflowassessmentplanService.insertByDayflowassessmentplan(byDayflowassessmentplan); + if (iCount > 0) { + // 判断班级下是否有老师 + int sum = 0; + Long zbjsNew = byClassService.selectByClassById(classId).getZbjs(); + Long pbjsNew = byClassService.selectByClassById(classId).getPbjs(); + Long zljsNew = byClassService.selectByClassById(classId).getZljs(); + ByDayflowassessment byDayflowassessment = null; + if (zbjsNew != null) { + System.out.println("这是主班教师111"); + + byDayflowassessment = new ByDayflowassessment(); + byDayflowassessment.setPlanid(byDayflowassessmentplan.getId()); + byDayflowassessment.setCreateUserid(SecurityUtils.getLoginUser().getUser().getUserId()); + byDayflowassessment.setDeptId(byDayflowassessmentplan.getDeptId()); + byDayflowassessment.setBzbh(zbjsNew); + byDayflowassessment.setPgdx(zbjsNew); + byDayflowassessment.setClassid(classId); + byDayflowassessment.setXnxq(byDayflowassessmentplan.getXnxq()); + byDayflowassessment.setBzid(Long.parseLong(byDayflowassessmentplan.getConnent())); + if (pbjsNew != null) { + byDayflowassessment.setPbbh(pbjsNew); + } + if (zljsNew != null) { + byDayflowassessment.setZlbh(zljsNew); + } + byDayflowassessmentService.insertByDayflowassessment(byDayflowassessment); + sum += 1; + } + if (pbjsNew != null) { + System.out.println("这是配班教师222"); + sum += 1; + } + if (zljsNew != null) { + System.out.println("这是助理教师333"); + sum += 1; + } + } + return toAjax(iCount); } /** @@ -128,3 +178,48 @@ public class ByDayflowassessmentplanController extends BaseController { return toAjax(byDayflowassessmentplanService.deleteByDayflowassessmentplanByIds(ids)); } } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByDayflowassessmentplan.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByDayflowassessmentplan.java index 0ddd32a9e..3e709699f 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByDayflowassessmentplan.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByDayflowassessmentplan.java @@ -58,6 +58,12 @@ public class ByDayflowassessmentplan extends BaseEntity { @Excel(name = "评估内容") private String connent; + /** + * 内容分数 + */ + @Excel(name = "内容分数") + private float score; + /** * 评估时间 */ @@ -145,6 +151,7 @@ public class ByDayflowassessmentplan extends BaseEntity { .append("xnxq", getXnxq()) .append("classid", getClassid()) .append("connent", getConnent()) + .append("score", getScore()) .append("starttime", getStarttime()) .append("createUserid", getCreateUserid()) .append("createTime", getCreateTime()) @@ -158,4 +165,12 @@ public class ByDayflowassessmentplan extends BaseEntity { public void setName(String name) { this.name = name; } + + public float getScore() { + return score; + } + + public void setScore(float score) { + this.score = score; + } } diff --git a/ruoyi/src/main/resources/mybatis/benyi/ByDayflowassessmentplanMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/ByDayflowassessmentplanMapper.xml index 382aa2972..58ecc0fe1 100644 --- a/ruoyi/src/main/resources/mybatis/benyi/ByDayflowassessmentplanMapper.xml +++ b/ruoyi/src/main/resources/mybatis/benyi/ByDayflowassessmentplanMapper.xml @@ -12,13 +12,14 @@ <result property="xnxq" column="xnxq"/> <result property="classid" column="classid"/> <result property="connent" column="connent"/> + <result property="score" column="score"/> <result property="starttime" column="starttime"/> <result property="createUserid" column="create_userid"/> <result property="createTime" column="create_time"/> </resultMap> <sql id="selectByDayflowassessmentplanVo"> - select id, name, dept_id, month, xnxq, classid, connent, starttime, create_userid, create_time from by_dayflowassessmentplan + select id, name, dept_id, month, xnxq, classid, connent, score, starttime, create_userid, create_time from by_dayflowassessmentplan </sql> <select id="selectByDayflowassessmentplanList" parameterType="ByDayflowassessmentplan" @@ -31,6 +32,7 @@ <if test="xnxq != null and xnxq != ''">and xnxq = #{xnxq}</if> <if test="classid != null and classid != ''">and classid = #{classid}</if> <if test="connent != null and connent != ''">and connent = #{connent}</if> + <if test="score != null and score != ''">and score = #{score}</if> <if test="starttime != null ">and starttime = #{starttime}</if> <if test="createUserid != null ">and create_userid = #{createUserid}</if> </where> @@ -45,23 +47,27 @@ keyProperty="id"> insert into by_dayflowassessmentplan <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null">id,</if> <if test="name != null and name != ''">name,</if> <if test="deptId != null ">dept_id,</if> <if test="month != null ">month,</if> <if test="xnxq != null and xnxq != ''">xnxq,</if> <if test="classid != null and classid != ''">classid,</if> <if test="connent != null and connent != ''">connent,</if> + <if test="score != null and score != ''">score,</if> <if test="starttime != null ">starttime,</if> <if test="createUserid != null ">create_userid,</if> <if test="createTime != null ">create_time,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null">#{id},</if> <if test="name != null and name != ''">#{name},</if> <if test="deptId != null ">#{deptId},</if> <if test="month != null ">#{month},</if> <if test="xnxq != null and xnxq != ''">#{xnxq},</if> <if test="classid != null and classid != ''">#{classid},</if> <if test="connent != null and connent != ''">#{connent},</if> + <if test="score != null and score != ''">#{score},</if> <if test="starttime != null ">#{starttime},</if> <if test="createUserid != null ">#{createUserid},</if> <if test="createTime != null ">#{createTime},</if> @@ -77,6 +83,7 @@ <if test="xnxq != null and xnxq != ''">xnxq = #{xnxq},</if> <if test="classid != null and classid != ''">classid = #{classid},</if> <if test="connent != null and connent != ''">connent = #{connent},</if> + <if test="score != null and score != ''">score = #{score},</if> <if test="starttime != null ">starttime = #{starttime},</if> <if test="createUserid != null ">create_userid = #{createUserid},</if> <if test="createTime != null ">create_time = #{createTime},</if>