周计划和详细 页面优化

This commit is contained in:
sk1551 2020-08-28 17:25:23 +08:00
parent 33afe5382a
commit b4c60d8314
6 changed files with 215 additions and 87 deletions

View File

@ -49,7 +49,7 @@
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</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 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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -97,7 +97,11 @@
</el-col> </el-col>
</el-row> </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 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="content" /> <el-table-column label="活动内容" align="center" prop="content" />
@ -113,6 +117,7 @@
<span>{{ parseTime(scope.row.activitytime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.activitytime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="星期" align="center" prop="day" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -176,8 +181,11 @@
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择活动时间" placeholder="选择活动时间"
:picker-options="pickerOptions7"> :picker-options="pickerOptions7"
></el-date-picker> >></el-date-picker>
</el-form-item>
<el-form-item label="星期" prop="day">
<el-input v-model="form.day" placeholder="请输入星期几" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -200,6 +208,15 @@ import {
import { getPlanweek, listPlanweek } from "@/api/benyi/planweek"; import { getPlanweek, listPlanweek } from "@/api/benyi/planweek";
const weekArr = [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六"
];
export default { export default {
name: "Planweekitem", name: "Planweekitem",
data() { data() {
@ -235,12 +252,13 @@ export default {
content: undefined, content: undefined,
activitytime: undefined, activitytime: undefined,
createuserid: undefined, createuserid: undefined,
updateuserid: undefined updateuserid: undefined,
day: undefined
}, },
// //
pickerOptions7: { pickerOptions7: {
disabledDate(time) { disabledDate(time) {
let curDate = (new Date()).getTime(); let curDate = new Date().getTime();
let three = 7 * 24 * 3600 * 1000; let three = 7 * 24 * 3600 * 1000;
let threeMonths = curDate + three; let threeMonths = curDate + three;
let datestart = Date.now() - 86400000; let datestart = Date.now() - 86400000;
@ -252,9 +270,18 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
activitytype: [{ required: true, message: "活动类型不能为空", trigger: "blur" }], activitytype: [
content: [{ required: true, message: "活动内容不能为空", trigger: "blur" }], { required: true, message: "活动类型不能为空", trigger: "blur" }
activitytime: [{ required: true, message: "活动时间不能为空", trigger: "blur" }], ],
content: [
{ required: true, message: "活动内容不能为空", trigger: "blur" }
],
activitytime: [
{ required: true, message: "活动时间不能为空", trigger: "blur" }
],
day: [
{ required: true, message: "星期不能为空", trigger: "blur" }
]
} }
}; };
}, },
@ -269,7 +296,7 @@ export default {
methods: { methods: {
// //
getPlanweek2(planweekid) { getPlanweek2(planweekid) {
getPlanweek(planweekid).then((response) => { getPlanweek(planweekid).then(response => {
this.queryParams.wid = response.data.id; this.queryParams.wid = response.data.id;
this.defaultWeekType = response.data.id; this.defaultWeekType = response.data.id;
this.getList(); this.getList();
@ -286,7 +313,7 @@ export default {
}, },
// //
getPlanWeekList() { getPlanWeekList() {
listPlanweek().then((response) => { listPlanweek().then(response => {
this.planweekOptions = response.rows; this.planweekOptions = response.rows;
}); });
}, },
@ -295,7 +322,7 @@ export default {
// return this.selectDictLabel(this.classOptions, row.classid); // return this.selectDictLabel(this.classOptions, row.classid);
var actions = []; var actions = [];
var datas = this.planweekOptions; var datas = this.planweekOptions;
Object.keys(datas).map((key) => { Object.keys(datas).map(key => {
if (datas[key].id == "" + row.wid) { if (datas[key].id == "" + row.wid) {
actions.push(datas[key].name); actions.push(datas[key].name);
return false; return false;
@ -323,7 +350,8 @@ export default {
createuserid: undefined, createuserid: undefined,
createTime: undefined, createTime: undefined,
updateuserid: undefined, updateuserid: undefined,
updateTime: undefined updateTime: undefined,
day: undefined
}; };
this.resetForm("form"); this.resetForm("form");
}, },

View File

@ -19,7 +19,7 @@
:value="dict.dictValue" :value="dict.dictValue"
/> />
</el-select> </el-select>
</el-form-item> --> </el-form-item>-->
<el-form-item label="开始时间" prop="starttime"> <el-form-item label="开始时间" prop="starttime">
<el-date-picker <el-date-picker
clearable clearable
@ -99,6 +99,11 @@
</router-link> </router-link>
</template> </template>
</el-table-column> </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"> <el-table-column label="开始时间" align="center" prop="starttime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.starttime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.starttime, '{y}-{m}-{d}') }}</span>
@ -109,6 +114,7 @@
<span>{{ parseTime(scope.row.endtime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.endtime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </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" prop="themeofweek" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
@ -126,7 +132,7 @@
@click="handleCheck(scope.row)" @click="handleCheck(scope.row)"
v-hasPermi="['system:planweek:edit']" v-hasPermi="['system:planweek:edit']"
v-show="isShow(scope.row)" v-show="isShow(scope.row)"
>提交</el-button> --> >提交</el-button>-->
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -152,6 +158,17 @@
<el-form-item label="计划名称" prop="name"> <el-form-item label="计划名称" prop="name">
<el-input v-model="form.name" placeholder="请输入计划名称" /> <el-input v-model="form.name" placeholder="请输入计划名称" />
</el-form-item> </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-form-item label="开始时间" prop="starttime">
<el-date-picker <el-date-picker
clearable clearable
@ -174,6 +191,16 @@
placeholder="选择结束时间" placeholder="选择结束时间"
></el-date-picker> ></el-date-picker>
</el-form-item> </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-form-item label="本周主题" prop="themeofweek">
<el-input v-model="form.themeofweek" placeholder="请输入本周主题" /> <el-input v-model="form.themeofweek" placeholder="请输入本周主题" />
</el-form-item> </el-form-item>
@ -234,6 +261,8 @@ export default {
statusOptions: [], statusOptions: [],
// //
classOptions: [], classOptions: [],
//
weeklyOptions: [],
// //
title: "", title: "",
// //
@ -256,37 +285,43 @@ export default {
createuserid: undefined, createuserid: undefined,
status: undefined, status: undefined,
shrid: undefined, shrid: undefined,
shtime: undefined shtime: undefined,
weekly: undefined,
month: undefined
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
name: [{ required: true, message: "计划名称不能为空", trigger: "blur" }], name: [
{ required: true, message: "计划名称不能为空", trigger: "blur" }
],
starttime: [ starttime: [
{ required: true, message: "开始时间不能为空", trigger: "blur" }, { required: true, message: "开始时间不能为空", trigger: "blur" }
], ],
endtime: [ endtime: [
{ required: true, message: "结束时间不能为空", trigger: "blur" }, { required: true, message: "结束时间不能为空", trigger: "blur" }
], ],
themeofweek: [ themeofweek: [
{ required: true, message: "本周主题不能为空", trigger: "blur" }, { required: true, message: "本周主题不能为空", trigger: "blur" }
], ],
jxmbSh: [ jxmbSh: [
{ required: true, message: "教学目标(社会)不能为空", trigger: "blur" }, { required: true, message: "教学目标(社会)不能为空", trigger: "blur" }
], ],
jxmbYy: [ jxmbYy: [
{ required: true, message: "教学目标(语言)不能为空", trigger: "blur" }, { required: true, message: "教学目标(语言)不能为空", trigger: "blur" }
], ],
jxmbJk: [ jxmbJk: [
{ required: true, message: "教学目标(健康)不能为空", trigger: "blur" }, { required: true, message: "教学目标(健康)不能为空", trigger: "blur" }
], ],
jxmbKx: [ jxmbKx: [
{ required: true, message: "教学目标(科学)不能为空", trigger: "blur" }, { required: true, message: "教学目标(科学)不能为空", trigger: "blur" }
], ],
jxmbYs: [ 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.getDicts("sys_dm_planweekstatus").then(response => {
this.statusOptions = response.data; this.statusOptions = response.data;
}); });
this.getDicts("sys_dm_weekly").then(response => {
this.weeklyOptions = response.data;
});
}, },
methods: { methods: {
/** 查询周计划(家长和教育部门)列表 */ /** 查询周计划(家长和教育部门)列表 */
@ -310,7 +348,7 @@ export default {
}, },
// //
getClassList() { getClassList() {
listClass(null).then((response) => { listClass(null).then(response => {
this.classOptions = response.rows; this.classOptions = response.rows;
}); });
}, },
@ -329,12 +367,16 @@ export default {
statusFormat(row, column) { statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status); return this.selectDictLabel(this.statusOptions, row.status);
}, },
//
weeklyFormat(row, column) {
return this.selectDictLabel(this.weeklyOptions, row.weekly);
},
// //
classFormat(row, column) { classFormat(row, column) {
// 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;
@ -366,7 +408,9 @@ export default {
createTime: undefined, createTime: undefined,
status: "0", status: "0",
shrid: undefined, shrid: undefined,
shtime: undefined shtime: undefined,
weekly: undefined,
month: undefined
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -405,23 +449,19 @@ export default {
/** 审核提交按钮操作 */ /** 审核提交按钮操作 */
handleCheck(row) { handleCheck(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$confirm( this.$confirm('确认提交周计划编号为"' + ids + '"的数据项?', "警告", {
'确认提交周计划编号为"' + ids + '"的数据项?',
"警告",
{
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning"
} })
) .then(function() {
.then(function () {
return checkPlanweek(ids); return checkPlanweek(ids);
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
this.msgSuccess("提交成功"); this.msgSuccess("提交成功");
}) })
.catch(function () {}); .catch(function() {});
}, },
isShow(row) { isShow(row) {
if (row.status == "1" || row.status == "2") { if (row.status == "1" || row.status == "2") {

View File

@ -121,6 +121,18 @@ public class ByPlanweek extends BaseEntity {
@Excel(name = "审核意见") @Excel(name = "审核意见")
private String shyj; 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) { public void setId(String id) {
@ -272,6 +284,8 @@ public class ByPlanweek extends BaseEntity {
.append("shrid", getShrid()) .append("shrid", getShrid())
.append("shtime", getShtime()) .append("shtime", getShtime())
.append("shyj", getShyj()) .append("shyj", getShyj())
.append("weekly", getWeekly())
.append("month", getMonth())
.toString(); .toString();
} }
@ -282,4 +296,20 @@ public class ByPlanweek extends BaseEntity {
public void setShyj(String shyj) { public void setShyj(String shyj) {
this.shyj = 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;
}
} }

View File

@ -59,6 +59,12 @@ public class ByPlanweekitem extends BaseEntity {
@Excel(name = "修改人") @Excel(name = "修改人")
private Long updateuserid; private Long updateuserid;
/**
* 星期几
*/
@Excel(name = "星期几")
private String day;
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
@ -127,6 +133,15 @@ public class ByPlanweekitem extends BaseEntity {
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateuserid", getUpdateuserid()) .append("updateuserid", getUpdateuserid())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("day", getDay())
.toString(); .toString();
} }
public String getDay() {
return day;
}
public void setDay(String day) {
this.day = day;
}
} }

View File

@ -22,11 +22,13 @@
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="shrid" column="shrid"/> <result property="shrid" column="shrid"/>
<result property="shtime" column="shtime"/> <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> </resultMap>
<sql id="selectByPlanweekVo"> <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> </sql>
<select id="selectByPlanweekList" parameterType="ByPlanweek" resultMap="ByPlanweekResult"> <select id="selectByPlanweekList" parameterType="ByPlanweek" resultMap="ByPlanweekResult">
@ -48,6 +50,8 @@
<if test="shrid != null ">and shrid = #{shrid}</if> <if test="shrid != null ">and shrid = #{shrid}</if>
<if test="shtime != null ">and shtime = #{shtime}</if> <if test="shtime != null ">and shtime = #{shtime}</if>
<if test="shyj != null and shyj != ''"> and shyj = #{shyj}</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> </where>
</select> </select>
@ -77,6 +81,8 @@
<if test="shrid != null ">shrid,</if> <if test="shrid != null ">shrid,</if>
<if test="shtime != null ">shtime,</if> <if test="shtime != null ">shtime,</if>
<if test="shyj != null and shyj != ''">shyj,</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>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if> <if test="id != null and id != ''">#{id},</if>
@ -97,6 +103,8 @@
<if test="shrid != null ">#{shrid},</if> <if test="shrid != null ">#{shrid},</if>
<if test="shtime != null ">#{shtime},</if> <if test="shtime != null ">#{shtime},</if>
<if test="shyj != null and shyj != ''">#{shyj},</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>
</insert> </insert>
@ -120,6 +128,8 @@
<if test="shrid != null ">shrid = #{shrid},</if> <if test="shrid != null ">shrid = #{shrid},</if>
<if test="shtime != null ">shtime = #{shtime},</if> <if test="shtime != null ">shtime = #{shtime},</if>
<if test="shyj != null and shyj != ''">shyj = #{shyj},</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> </trim>
where id = #{id} where id = #{id}
</update> </update>

View File

@ -5,15 +5,16 @@
<mapper namespace="com.ruoyi.project.benyi.mapper.ByPlanweekitemMapper"> <mapper namespace="com.ruoyi.project.benyi.mapper.ByPlanweekitemMapper">
<resultMap type="ByPlanweekitem" id="ByPlanweekitemResult"> <resultMap type="ByPlanweekitem" id="ByPlanweekitemResult">
<result property="id" column="id" /> <result property="id" column="id"/>
<result property="wid" column="wid" /> <result property="wid" column="wid"/>
<result property="activitytype" column="activitytype" /> <result property="activitytype" column="activitytype"/>
<result property="content" column="content" /> <result property="content" column="content"/>
<result property="activitytime" column="activitytime" /> <result property="activitytime" column="activitytime"/>
<result property="createuserid" column="createuserid" /> <result property="createuserid" column="createuserid"/>
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time"/>
<result property="updateuserid" column="updateuserid" /> <result property="updateuserid" column="updateuserid"/>
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time"/>
<result property="day" column="day"/>
</resultMap> </resultMap>
<sql id="selectByPlanweekitemVo"> <sql id="selectByPlanweekitemVo">
@ -23,12 +24,13 @@
<select id="selectByPlanweekitemList" parameterType="ByPlanweekitem" resultMap="ByPlanweekitemResult"> <select id="selectByPlanweekitemList" parameterType="ByPlanweekitem" resultMap="ByPlanweekitemResult">
<include refid="selectByPlanweekitemVo"/> <include refid="selectByPlanweekitemVo"/>
<where> <where>
<if test="wid != null and wid != ''"> and wid = #{wid}</if> <if test="wid != null and wid != ''">and wid = #{wid}</if>
<if test="activitytype != null and activitytype != ''"> and activitytype = #{activitytype}</if> <if test="activitytype != null and activitytype != ''">and activitytype = #{activitytype}</if>
<if test="content != null and content != ''"> and content = #{content}</if> <if test="content != null and content != ''">and content = #{content}</if>
<if test="activitytime != null "> and activitytime = #{activitytime}</if> <if test="activitytime != null ">and activitytime = #{activitytime}</if>
<if test="createuserid != null "> and createuserid = #{createuserid}</if> <if test="createuserid != null ">and createuserid = #{createuserid}</if>
<if test="updateuserid != null "> and updateuserid = #{updateuserid}</if> <if test="updateuserid != null ">and updateuserid = #{updateuserid}</if>
<if test="day != null and day != ''">and day = #{day}</if>
</where> </where>
</select> </select>
@ -48,6 +50,7 @@
<if test="createTime != null ">create_time,</if> <if test="createTime != null ">create_time,</if>
<if test="updateuserid != null ">updateuserid,</if> <if test="updateuserid != null ">updateuserid,</if>
<if test="updateTime != null ">update_time,</if> <if test="updateTime != null ">update_time,</if>
<if test="day != null and day != ''">day,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="wid != null and wid != ''">#{wid},</if> <if test="wid != null and wid != ''">#{wid},</if>
@ -58,6 +61,7 @@
<if test="createTime != null ">#{createTime},</if> <if test="createTime != null ">#{createTime},</if>
<if test="updateuserid != null ">#{updateuserid},</if> <if test="updateuserid != null ">#{updateuserid},</if>
<if test="updateTime != null ">#{updateTime},</if> <if test="updateTime != null ">#{updateTime},</if>
<if test="day != null and day != ''">#{day},</if>
</trim> </trim>
</insert> </insert>
@ -72,6 +76,7 @@
<if test="createTime != null ">create_time = #{createTime},</if> <if test="createTime != null ">create_time = #{createTime},</if>
<if test="updateuserid != null ">updateuserid = #{updateuserid},</if> <if test="updateuserid != null ">updateuserid = #{updateuserid},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if> <if test="updateTime != null ">update_time = #{updateTime},</if>
<if test="day != null and day != ''">day = #{day},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>