From b4c60d831498e65828a90668d532a706fad489e0 Mon Sep 17 00:00:00 2001 From: sk1551 <15175617877@163.com> Date: Fri, 28 Aug 2020 17:25:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=A8=E8=AE=A1=E5=88=92=E5=92=8C=E8=AF=A6?= =?UTF-8?q?=E7=BB=86=20=20=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/benyi/planweek/data.vue | 56 ++++++++--- ruoyi-ui/src/views/benyi/planweek/index.vue | 94 +++++++++++++------ .../project/benyi/domain/ByPlanweek.java | 30 ++++++ .../project/benyi/domain/ByPlanweekitem.java | 15 +++ .../mybatis/benyi/ByPlanweekMapper.xml | 14 ++- .../mybatis/benyi/ByPlanweekitemMapper.xml | 93 +++++++++--------- 6 files changed, 215 insertions(+), 87 deletions(-) diff --git a/ruoyi-ui/src/views/benyi/planweek/data.vue b/ruoyi-ui/src/views/benyi/planweek/data.vue index be1c48beb..4282d35da 100644 --- a/ruoyi-ui/src/views/benyi/planweek/data.vue +++ b/ruoyi-ui/src/views/benyi/planweek/data.vue @@ -49,7 +49,7 @@ size="small" @keyup.enter.native="handleQuery" /> - </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 icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> @@ -97,7 +97,11 @@ </el-col> </el-row> - <el-table v-loading="loading" :data="planweekitemList" @selection-change="handleSelectionChange"> + <el-table + v-loading="loading" + :data="planweekitemList" + @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="content" /> @@ -113,6 +117,7 @@ <span>{{ parseTime(scope.row.activitytime, '{y}-{m}-{d}') }}</span> </template> </el-table-column> + <el-table-column label="星期" align="center" prop="day" /> <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> <el-button @@ -176,8 +181,11 @@ type="date" value-format="yyyy-MM-dd" placeholder="选择活动时间" - :picker-options="pickerOptions7"> - ></el-date-picker> + :picker-options="pickerOptions7" + >></el-date-picker> + </el-form-item> + <el-form-item label="星期" prop="day"> + <el-input v-model="form.day" placeholder="请输入星期几" /> </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> @@ -200,6 +208,15 @@ import { import { getPlanweek, listPlanweek } from "@/api/benyi/planweek"; +const weekArr = [ + "星期日", + "星期一", + "星期二", + "星期三", + "星期四", + "星期五", + "星期六" +]; export default { name: "Planweekitem", data() { @@ -235,12 +252,13 @@ export default { content: undefined, activitytime: undefined, createuserid: undefined, - updateuserid: undefined + updateuserid: undefined, + day: undefined }, // 日期控件 只显示今天和今天以后一周时间区间 pickerOptions7: { disabledDate(time) { - let curDate = (new Date()).getTime(); + let curDate = new Date().getTime(); let three = 7 * 24 * 3600 * 1000; let threeMonths = curDate + three; let datestart = Date.now() - 86400000; @@ -252,14 +270,23 @@ export default { form: {}, // 表单校验 rules: { - activitytype: [{ required: true, message: "活动类型不能为空", trigger: "blur" }], - content: [{ required: true, message: "活动内容不能为空", trigger: "blur" }], - activitytime: [{ required: true, message: "活动时间不能为空", trigger: "blur" }], + activitytype: [ + { required: true, message: "活动类型不能为空", trigger: "blur" } + ], + content: [ + { required: true, message: "活动内容不能为空", trigger: "blur" } + ], + activitytime: [ + { required: true, message: "活动时间不能为空", trigger: "blur" } + ], + day: [ + { required: true, message: "星期不能为空", trigger: "blur" } + ] } }; }, created() { - const planweekid = this.$route.params && this.$route.params.id; + const planweekid = this.$route.params && this.$route.params.id; this.getPlanweek2(planweekid); this.getPlanWeekList(); this.getDicts("sys_math_type").then(response => { @@ -269,7 +296,7 @@ export default { methods: { // 周计划 getPlanweek2(planweekid) { - getPlanweek(planweekid).then((response) => { + getPlanweek(planweekid).then(response => { this.queryParams.wid = response.data.id; this.defaultWeekType = response.data.id; this.getList(); @@ -286,7 +313,7 @@ export default { }, // 查询周计划选项 getPlanWeekList() { - listPlanweek().then((response) => { + listPlanweek().then(response => { this.planweekOptions = response.rows; }); }, @@ -295,7 +322,7 @@ export default { // return this.selectDictLabel(this.classOptions, row.classid); var actions = []; var datas = this.planweekOptions; - Object.keys(datas).map((key) => { + Object.keys(datas).map(key => { if (datas[key].id == "" + row.wid) { actions.push(datas[key].name); return false; @@ -323,7 +350,8 @@ export default { createuserid: undefined, createTime: undefined, updateuserid: undefined, - updateTime: undefined + updateTime: undefined, + day: undefined }; this.resetForm("form"); }, diff --git a/ruoyi-ui/src/views/benyi/planweek/index.vue b/ruoyi-ui/src/views/benyi/planweek/index.vue index 07fd874fd..7c584cc33 100644 --- a/ruoyi-ui/src/views/benyi/planweek/index.vue +++ b/ruoyi-ui/src/views/benyi/planweek/index.vue @@ -19,7 +19,7 @@ :value="dict.dictValue" /> </el-select> - </el-form-item> --> + </el-form-item>--> <el-form-item label="开始时间" prop="starttime"> <el-date-picker clearable @@ -99,6 +99,11 @@ </router-link> </template> </el-table-column> + <el-table-column label="月份" align="center" prop="month" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.starttime, '{y}-{m}') }}</span> + </template> + </el-table-column> <el-table-column label="开始时间" align="center" prop="starttime" width="180"> <template slot-scope="scope"> <span>{{ parseTime(scope.row.starttime, '{y}-{m}-{d}') }}</span> @@ -109,6 +114,7 @@ <span>{{ parseTime(scope.row.endtime, '{y}-{m}-{d}') }}</span> </template> </el-table-column> + <el-table-column label="周次" align="center" prop="weekly" :formatter="weeklyFormat" /> <el-table-column label="本周主题" align="center" prop="themeofweek" /> <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> @@ -126,7 +132,7 @@ @click="handleCheck(scope.row)" v-hasPermi="['system:planweek:edit']" v-show="isShow(scope.row)" - >提交</el-button> --> + >提交</el-button>--> <el-button size="mini" type="text" @@ -152,6 +158,17 @@ <el-form-item label="计划名称" prop="name"> <el-input v-model="form.name" placeholder="请输入计划名称" /> </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" + placeholder="选择月份" + ></el-date-picker> + </el-form-item> <el-form-item label="开始时间" prop="starttime"> <el-date-picker clearable @@ -174,6 +191,16 @@ placeholder="选择结束时间" ></el-date-picker> </el-form-item> + <el-form-item label="周次" prop="weekly"> + <el-select v-model="form.weekly" placeholder="请选择周次"> + <el-option + v-for="dict in weeklyOptions" + :key="dict.dictValue" + :label="dict.dictLabel" + :value="dict.dictValue" + ></el-option> + </el-select> + </el-form-item> <el-form-item label="本周主题" prop="themeofweek"> <el-input v-model="form.themeofweek" placeholder="请输入本周主题" /> </el-form-item> @@ -234,6 +261,8 @@ export default { statusOptions: [], //班级 classOptions: [], + // 周次 + weeklyOptions: [], // 弹出层标题 title: "", // 是否显示弹出层 @@ -256,37 +285,43 @@ export default { createuserid: undefined, status: undefined, shrid: undefined, - shtime: undefined + shtime: undefined, + weekly: undefined, + month: undefined }, // 表单参数 form: {}, // 表单校验 rules: { - name: [{ required: true, message: "计划名称不能为空", trigger: "blur" }], + name: [ + { required: true, message: "计划名称不能为空", trigger: "blur" } + ], starttime: [ - { required: true, message: "开始时间不能为空", trigger: "blur" }, + { required: true, message: "开始时间不能为空", trigger: "blur" } ], endtime: [ - { required: true, message: "结束时间不能为空", trigger: "blur" }, + { required: true, message: "结束时间不能为空", trigger: "blur" } ], themeofweek: [ - { required: true, message: "本周主题不能为空", trigger: "blur" }, + { required: true, message: "本周主题不能为空", trigger: "blur" } ], jxmbSh: [ - { required: true, message: "教学目标(社会)不能为空", trigger: "blur" }, + { required: true, message: "教学目标(社会)不能为空", trigger: "blur" } ], jxmbYy: [ - { required: true, message: "教学目标(语言)不能为空", trigger: "blur" }, + { required: true, message: "教学目标(语言)不能为空", trigger: "blur" } ], jxmbJk: [ - { required: true, message: "教学目标(健康)不能为空", trigger: "blur" }, + { required: true, message: "教学目标(健康)不能为空", trigger: "blur" } ], jxmbKx: [ - { required: true, message: "教学目标(科学)不能为空", trigger: "blur" }, + { required: true, message: "教学目标(科学)不能为空", trigger: "blur" } ], jxmbYs: [ - { required: true, message: "教学目标(艺术)不能为空", trigger: "blur" }, - ] + { required: true, message: "教学目标(艺术)不能为空", trigger: "blur" } + ], + weekly: [{ required: true, message: "周次不能为空", trigger: "blur" }], + month: [{ required: true, message: "月份不能为空", trigger: "blur" }] } }; }, @@ -297,6 +332,9 @@ export default { this.getDicts("sys_dm_planweekstatus").then(response => { this.statusOptions = response.data; }); + this.getDicts("sys_dm_weekly").then(response => { + this.weeklyOptions = response.data; + }); }, methods: { /** 查询周计划(家长和教育部门)列表 */ @@ -310,7 +348,7 @@ export default { }, // 获取班级列表 getClassList() { - listClass(null).then((response) => { + listClass(null).then(response => { this.classOptions = response.rows; }); }, @@ -329,12 +367,16 @@ export default { statusFormat(row, column) { return this.selectDictLabel(this.statusOptions, row.status); }, + // 性别字典翻译 + weeklyFormat(row, column) { + return this.selectDictLabel(this.weeklyOptions, row.weekly); + }, // 班级字典翻译 classFormat(row, column) { // return this.selectDictLabel(this.classOptions, row.classid); var actions = []; var datas = this.classOptions; - Object.keys(datas).map((key) => { + Object.keys(datas).map(key => { if (datas[key].bjbh == "" + row.classid) { actions.push(datas[key].bjmc); return false; @@ -366,7 +408,9 @@ export default { createTime: undefined, status: "0", shrid: undefined, - shtime: undefined + shtime: undefined, + weekly: undefined, + month: undefined }; this.resetForm("form"); }, @@ -405,23 +449,19 @@ export default { /** 审核提交按钮操作 */ handleCheck(row) { const ids = row.id || this.ids; - this.$confirm( - '确认提交周计划编号为"' + ids + '"的数据项?', - "警告", - { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - } - ) - .then(function () { + this.$confirm('确认提交周计划编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(function() { return checkPlanweek(ids); }) .then(() => { this.getList(); this.msgSuccess("提交成功"); }) - .catch(function () {}); + .catch(function() {}); }, isShow(row) { if (row.status == "1" || row.status == "2") { diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByPlanweek.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByPlanweek.java index aaa74c731..604d22214 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByPlanweek.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByPlanweek.java @@ -121,6 +121,18 @@ public class ByPlanweek extends BaseEntity { @Excel(name = "审核意见") private String shyj; + /** + * 周次 + */ + @Excel(name = "周次") + private String weekly; + + /** + * 月份 + */ + @JsonFormat(pattern = "yyyy-MM") + @Excel(name = "月份", width = 30, dateFormat = "yyyy-MM") + private Date month; public void setId(String id) { @@ -272,6 +284,8 @@ public class ByPlanweek extends BaseEntity { .append("shrid", getShrid()) .append("shtime", getShtime()) .append("shyj", getShyj()) + .append("weekly", getWeekly()) + .append("month", getMonth()) .toString(); } @@ -282,4 +296,20 @@ public class ByPlanweek extends BaseEntity { public void setShyj(String shyj) { this.shyj = shyj; } + + public String getWeekly() { + return weekly; + } + + public void setWeekly(String weekly) { + this.weekly = weekly; + } + + public Date getMonth() { + return month; + } + + public void setMonth(Date month) { + this.month = month; + } } diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByPlanweekitem.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByPlanweekitem.java index 3d10f4b88..05ee37af6 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByPlanweekitem.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByPlanweekitem.java @@ -59,6 +59,12 @@ public class ByPlanweekitem extends BaseEntity { @Excel(name = "修改人") private Long updateuserid; + /** + * 星期几 + */ + @Excel(name = "星期几") + private String day; + public void setId(Long id) { this.id = id; } @@ -127,6 +133,15 @@ public class ByPlanweekitem extends BaseEntity { .append("createTime", getCreateTime()) .append("updateuserid", getUpdateuserid()) .append("updateTime", getUpdateTime()) + .append("day", getDay()) .toString(); } + + public String getDay() { + return day; + } + + public void setDay(String day) { + this.day = day; + } } diff --git a/ruoyi/src/main/resources/mybatis/benyi/ByPlanweekMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/ByPlanweekMapper.xml index 07afae43f..c249ccae1 100644 --- a/ruoyi/src/main/resources/mybatis/benyi/ByPlanweekMapper.xml +++ b/ruoyi/src/main/resources/mybatis/benyi/ByPlanweekMapper.xml @@ -22,11 +22,13 @@ <result property="status" column="status"/> <result property="shrid" column="shrid"/> <result property="shtime" column="shtime"/> - <result property="shyj" column="shyj" /> + <result property="shyj" column="shyj"/> + <result property="weekly" column="weekly"/> + <result property="month" column="month"/> </resultMap> <sql id="selectByPlanweekVo"> - select id, schoolid, classid, name, starttime, endtime, themeofweek, jxmb_sh, jxmb_yy, jxmb_jk, jxmb_kx, jxmb_ys, createuserid, create_time, status, shrid, shtime, shyj from by_planweek + select id, schoolid, classid, name, month, starttime, endtime, themeofweek, jxmb_sh, jxmb_yy, jxmb_jk, jxmb_kx, jxmb_ys, createuserid, create_time, status, shrid, shtime, shyj, weekly from by_planweek </sql> <select id="selectByPlanweekList" parameterType="ByPlanweek" resultMap="ByPlanweekResult"> @@ -48,6 +50,8 @@ <if test="shrid != null ">and shrid = #{shrid}</if> <if test="shtime != null ">and shtime = #{shtime}</if> <if test="shyj != null and shyj != ''"> and shyj = #{shyj}</if> + <if test="weekly != null and weekly != ''"> and weekly = #{weekly}</if> + <if test="month != null ">and month = #{month}</if> </where> </select> @@ -77,6 +81,8 @@ <if test="shrid != null ">shrid,</if> <if test="shtime != null ">shtime,</if> <if test="shyj != null and shyj != ''">shyj,</if> + <if test="weekly != null and weekly != ''">weekly,</if> + <if test="month != null ">month,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null and id != ''">#{id},</if> @@ -97,6 +103,8 @@ <if test="shrid != null ">#{shrid},</if> <if test="shtime != null ">#{shtime},</if> <if test="shyj != null and shyj != ''">#{shyj},</if> + <if test="weekly != null and weekly != ''">#{weekly},</if> + <if test="month != null ">#{month},</if> </trim> </insert> @@ -120,6 +128,8 @@ <if test="shrid != null ">shrid = #{shrid},</if> <if test="shtime != null ">shtime = #{shtime},</if> <if test="shyj != null and shyj != ''">shyj = #{shyj},</if> + <if test="weekly != null and weekly != ''">weekly = #{weekly},</if> + <if test="month != null ">month = #{month},</if> </trim> where id = #{id} </update> diff --git a/ruoyi/src/main/resources/mybatis/benyi/ByPlanweekitemMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/ByPlanweekitemMapper.xml index 0eee28af6..a3d600eac 100644 --- a/ruoyi/src/main/resources/mybatis/benyi/ByPlanweekitemMapper.xml +++ b/ruoyi/src/main/resources/mybatis/benyi/ByPlanweekitemMapper.xml @@ -5,16 +5,17 @@ <mapper namespace="com.ruoyi.project.benyi.mapper.ByPlanweekitemMapper"> <resultMap type="ByPlanweekitem" id="ByPlanweekitemResult"> - <result property="id" column="id" /> - <result property="wid" column="wid" /> - <result property="activitytype" column="activitytype" /> - <result property="content" column="content" /> - <result property="activitytime" column="activitytime" /> - <result property="createuserid" column="createuserid" /> - <result property="createTime" column="create_time" /> - <result property="updateuserid" column="updateuserid" /> - <result property="updateTime" column="update_time" /> - </resultMap> + <result property="id" column="id"/> + <result property="wid" column="wid"/> + <result property="activitytype" column="activitytype"/> + <result property="content" column="content"/> + <result property="activitytime" column="activitytime"/> + <result property="createuserid" column="createuserid"/> + <result property="createTime" column="create_time"/> + <result property="updateuserid" column="updateuserid"/> + <result property="updateTime" column="update_time"/> + <result property="day" column="day"/> + </resultMap> <sql id="selectByPlanweekitemVo"> select id, wid, activitytype, content, activitytime, createuserid, create_time, updateuserid, update_time from by_planweekitem @@ -23,13 +24,14 @@ <select id="selectByPlanweekitemList" parameterType="ByPlanweekitem" resultMap="ByPlanweekitemResult"> <include refid="selectByPlanweekitemVo"/> <where> - <if test="wid != null and wid != ''"> and wid = #{wid}</if> - <if test="activitytype != null and activitytype != ''"> and activitytype = #{activitytype}</if> - <if test="content != null and content != ''"> and content = #{content}</if> - <if test="activitytime != null "> and activitytime = #{activitytime}</if> - <if test="createuserid != null "> and createuserid = #{createuserid}</if> - <if test="updateuserid != null "> and updateuserid = #{updateuserid}</if> - </where> + <if test="wid != null and wid != ''">and wid = #{wid}</if> + <if test="activitytype != null and activitytype != ''">and activitytype = #{activitytype}</if> + <if test="content != null and content != ''">and content = #{content}</if> + <if test="activitytime != null ">and activitytime = #{activitytime}</if> + <if test="createuserid != null ">and createuserid = #{createuserid}</if> + <if test="updateuserid != null ">and updateuserid = #{updateuserid}</if> + <if test="day != null and day != ''">and day = #{day}</if> + </where> </select> <select id="selectByPlanweekitemById" parameterType="Long" resultMap="ByPlanweekitemResult"> @@ -40,39 +42,42 @@ <insert id="insertByPlanweekitem" parameterType="ByPlanweekitem" useGeneratedKeys="true" keyProperty="id"> insert into by_planweekitem <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="wid != null and wid != ''">wid,</if> - <if test="activitytype != null and activitytype != ''">activitytype,</if> - <if test="content != null and content != ''">content,</if> - <if test="activitytime != null ">activitytime,</if> - <if test="createuserid != null ">createuserid,</if> - <if test="createTime != null ">create_time,</if> - <if test="updateuserid != null ">updateuserid,</if> - <if test="updateTime != null ">update_time,</if> - </trim> + <if test="wid != null and wid != ''">wid,</if> + <if test="activitytype != null and activitytype != ''">activitytype,</if> + <if test="content != null and content != ''">content,</if> + <if test="activitytime != null ">activitytime,</if> + <if test="createuserid != null ">createuserid,</if> + <if test="createTime != null ">create_time,</if> + <if test="updateuserid != null ">updateuserid,</if> + <if test="updateTime != null ">update_time,</if> + <if test="day != null and day != ''">day,</if> + </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="wid != null and wid != ''">#{wid},</if> - <if test="activitytype != null and activitytype != ''">#{activitytype},</if> - <if test="content != null and content != ''">#{content},</if> - <if test="activitytime != null ">#{activitytime},</if> - <if test="createuserid != null ">#{createuserid},</if> - <if test="createTime != null ">#{createTime},</if> - <if test="updateuserid != null ">#{updateuserid},</if> - <if test="updateTime != null ">#{updateTime},</if> - </trim> + <if test="wid != null and wid != ''">#{wid},</if> + <if test="activitytype != null and activitytype != ''">#{activitytype},</if> + <if test="content != null and content != ''">#{content},</if> + <if test="activitytime != null ">#{activitytime},</if> + <if test="createuserid != null ">#{createuserid},</if> + <if test="createTime != null ">#{createTime},</if> + <if test="updateuserid != null ">#{updateuserid},</if> + <if test="updateTime != null ">#{updateTime},</if> + <if test="day != null and day != ''">#{day},</if> + </trim> </insert> <update id="updateByPlanweekitem" parameterType="ByPlanweekitem"> update by_planweekitem <trim prefix="SET" suffixOverrides=","> - <if test="wid != null and wid != ''">wid = #{wid},</if> - <if test="activitytype != null and activitytype != ''">activitytype = #{activitytype},</if> - <if test="content != null and content != ''">content = #{content},</if> - <if test="activitytime != null ">activitytime = #{activitytime},</if> - <if test="createuserid != null ">createuserid = #{createuserid},</if> - <if test="createTime != null ">create_time = #{createTime},</if> - <if test="updateuserid != null ">updateuserid = #{updateuserid},</if> - <if test="updateTime != null ">update_time = #{updateTime},</if> - </trim> + <if test="wid != null and wid != ''">wid = #{wid},</if> + <if test="activitytype != null and activitytype != ''">activitytype = #{activitytype},</if> + <if test="content != null and content != ''">content = #{content},</if> + <if test="activitytime != null ">activitytime = #{activitytime},</if> + <if test="createuserid != null ">createuserid = #{createuserid},</if> + <if test="createTime != null ">create_time = #{createTime},</if> + <if test="updateuserid != null ">updateuserid = #{updateuserid},</if> + <if test="updateTime != null ">update_time = #{updateTime},</if> + <if test="day != null and day != ''">day = #{day},</if> + </trim> where id = #{id} </update>