周教学计划优化

This commit is contained in:
zhanglipeng 2020-11-18 11:23:06 +08:00
parent 477176c1b9
commit 6918402224
5 changed files with 113 additions and 64 deletions

View File

@ -77,7 +77,11 @@
align="center" align="center"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
prop="content" prop="content"
/> >
<template slot-scope="scope">
<div v-html="scope.row.content"></div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"

View File

@ -1,6 +1,11 @@
<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="wid"> <el-form-item label="周计划" prop="wid">
<el-select v-model="queryParams.wid" size="small"> <el-select v-model="queryParams.wid" size="small">
<el-option <el-option
@ -12,7 +17,12 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="活动类型" prop="activitytype"> <el-form-item label="活动类型" prop="activitytype">
<el-select v-model="queryParams.activitytype" placeholder="请选择活动类型" clearable size="small"> <el-select
v-model="queryParams.activitytype"
placeholder="请选择活动类型"
clearable
size="small"
>
<el-option <el-option
v-for="dict in activitytypeOptions" v-for="dict in activitytypeOptions"
:key="dict.dictValue" :key="dict.dictValue"
@ -33,8 +43,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>
@ -46,7 +64,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['benyi:planweek:add']" v-hasPermi="['benyi:planweek:add']"
>新增</el-button> >新增</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -56,7 +75,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['benyi:planweek:edit']" v-hasPermi="['benyi:planweek:edit']"
>修改</el-button> >修改</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -66,7 +86,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['benyi:planweek:remove']" v-hasPermi="['benyi:planweek:remove']"
>删除</el-button> >删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -75,7 +96,8 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['benyi:planweek:export']" v-hasPermi="['benyi:planweek:export']"
>导出</el-button> >导出</el-button
>
</el-col> </el-col>
</el-row> </el-row>
@ -86,21 +108,39 @@
> >
<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">
<el-table-column label="所属计划" align="center" prop="wid" :formatter="themePlanFormat" /> <template slot-scope="scope">
<div v-html="scope.row.content"></div>
</template>
</el-table-column>
<el-table-column
label="所属计划"
align="center"
prop="wid"
:formatter="themePlanFormat"
/>
<el-table-column <el-table-column
label="活动类型" label="活动类型"
align="center" align="center"
prop="activitytype" prop="activitytype"
:formatter="activitytypeFormat" :formatter="activitytypeFormat"
/> />
<el-table-column label="活动时间" align="center" prop="activitytime" width="180"> <el-table-column
label="活动时间"
align="center"
prop="activitytime"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<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" 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
size="mini" size="mini"
@ -108,14 +148,16 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['benyi:planweek:edit']" v-hasPermi="['benyi:planweek:edit']"
>修改</el-button> >修改</el-button
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['benyi:planweek:remove']" v-hasPermi="['benyi:planweek:remove']"
>删除</el-button> >删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -129,7 +171,12 @@
/> />
<!-- 添加或修改周计划(家长和教育部门细化)对话框 --> <!-- 添加或修改周计划(家长和教育部门细化)对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1024px" append-to-body> <el-dialog
:title="title"
:visible.sync="open"
width="1024px"
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="wid"> <el-form-item label="所属计划" prop="wid">
<el-select v-model="form.wid" size="small" :disabled="true"> <el-select v-model="form.wid" size="small" :disabled="true">
@ -160,8 +207,8 @@
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择活动时间" placeholder="选择活动时间"
:picker-options="pickerOptions7" >></el-date-picker
>></el-date-picker> >
</el-form-item> </el-form-item>
<el-form-item label="活动内容" prop="content"> <el-form-item label="活动内容" prop="content">
<Editor v-model="form.content" placeholder="请输入活动内容" /> <Editor v-model="form.content" placeholder="请输入活动内容" />
@ -185,7 +232,7 @@ import {
delPlanweekitem, delPlanweekitem,
addPlanweekitem, addPlanweekitem,
updatePlanweekitem, updatePlanweekitem,
exportPlanweekitem exportPlanweekitem,
} from "@/api/benyi/planweekitem"; } from "@/api/benyi/planweekitem";
import Editor from "@/components/Editor"; import Editor from "@/components/Editor";
@ -199,12 +246,12 @@ const weekArr = [
"星期三", "星期三",
"星期四", "星期四",
"星期五", "星期五",
"星期六" "星期六",
]; ];
export default { export default {
name: "Planweekitem", name: "Planweekitem",
components: { components: {
Editor Editor,
}, },
data() { data() {
return { return {
@ -240,7 +287,7 @@ export default {
activitytime: undefined, activitytime: undefined,
createuserid: undefined, createuserid: undefined,
updateuserid: undefined, updateuserid: undefined,
day: undefined day: undefined,
}, },
// //
pickerOptions7: { pickerOptions7: {
@ -250,7 +297,7 @@ export default {
let threeMonths = curDate + three; let threeMonths = curDate + three;
let datestart = Date.now() - 86400000; let datestart = Date.now() - 86400000;
return time.getTime() < datestart || time.getTime() > threeMonths; return time.getTime() < datestart || time.getTime() > threeMonths;
} },
}, },
// //
@ -258,32 +305,32 @@ export default {
// //
rules: { rules: {
activitytype: [ activitytype: [
{ required: true, message: "活动类型不能为空", trigger: "blur" } { required: true, message: "活动类型不能为空", trigger: "blur" },
], ],
content: [ content: [
{ required: true, message: "活动内容不能为空", trigger: "blur" } { required: true, message: "活动内容不能为空", trigger: "blur" },
], ],
activitytime: [ activitytime: [
{ required: true, message: "活动时间不能为空", trigger: "blur" } { required: true, message: "活动时间不能为空", trigger: "blur" },
], ],
// day: [ // day: [
// { required: true, message: "", trigger: "blur" } // { required: true, message: "", trigger: "blur" }
// ] // ]
} },
}; };
}, },
created() { created() {
const planweekid = this.$route.params && this.$route.params.id; const planweekid = this.$route.params && this.$route.params.id;
this.getPlanweek2(planweekid); this.getPlanweek2(planweekid);
this.getPlanWeekList(); this.getPlanWeekList();
this.getDicts("sys_dm_qyhdxs").then(response => { this.getDicts("sys_dm_qyhdxs").then((response) => {
this.activitytypeOptions = response.data; this.activitytypeOptions = response.data;
}); });
}, },
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();
@ -292,7 +339,7 @@ export default {
/** 查询周计划(家长和教育部门细化)列表 */ /** 查询周计划(家长和教育部门细化)列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listPlanweekitem(this.queryParams).then(response => { listPlanweekitem(this.queryParams).then((response) => {
this.planweekitemList = response.rows; this.planweekitemList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -300,7 +347,7 @@ export default {
}, },
// //
getPlanWeekList() { getPlanWeekList() {
listPlanweek().then(response => { listPlanweek().then((response) => {
this.planweekOptions = response.rows; this.planweekOptions = response.rows;
}); });
}, },
@ -309,7 +356,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;
@ -338,7 +385,7 @@ export default {
createTime: undefined, createTime: undefined,
updateuserid: undefined, updateuserid: undefined,
updateTime: undefined, updateTime: undefined,
day: undefined day: undefined,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -355,7 +402,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;
}, },
@ -370,7 +417,7 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids; const id = row.id || this.ids;
getPlanweekitem(id).then(response => { getPlanweekitem(id).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改周计划(家长和教育部门细化)"; this.title = "修改周计划(家长和教育部门细化)";
@ -378,10 +425,10 @@ 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) {
updatePlanweekitem(this.form).then(response => { updatePlanweekitem(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
@ -389,7 +436,7 @@ export default {
} }
}); });
} else { } else {
addPlanweekitem(this.form).then(response => { addPlanweekitem(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
@ -404,12 +451,12 @@ 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 () {
@ -430,17 +477,17 @@ export default {
{ {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
} }
) )
.then(function () { .then(function () {
return exportPlanweekitem(queryParams); return exportPlanweekitem(queryParams);
}) })
.then(response => { .then((response) => {
this.download(response.msg); this.download(response.msg);
}) })
.catch(function () {}); .catch(function () {});
} },
} },
}; };
</script> </script>

View File

@ -383,7 +383,7 @@ export default {
id: undefined, id: undefined,
schoolid: undefined, schoolid: undefined,
classid: undefined, classid: undefined,
name: undefined, name: '教学计划',
starttime: undefined, starttime: undefined,
endtime: undefined, endtime: undefined,
themeofweek: undefined, themeofweek: undefined,
@ -486,7 +486,7 @@ 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: "确定",

View File

@ -34,28 +34,23 @@
<span>周教学目标</span> <span>周教学目标</span>
</td> </td>
<td style="width: 140px;">社会</td> <td style="width: 140px;">社会</td>
<td>{{sh}}</td> <td v-html="sh" colspan="5"></td>
<td colspan="4"></td>
</tr> </tr>
<tr class="align-center"> <tr class="align-center">
<td>语言</td> <td>语言</td>
<td>{{yy}}</td> <td v-html="yy" colspan="5"></td>
<td colspan="4"></td>
</tr> </tr>
<tr class="align-center"> <tr class="align-center">
<td>健康</td> <td>健康</td>
<td>{{jk}}</td> <td v-html="jk" colspan="5"></td>
<td colspan="4"></td>
</tr> </tr>
<tr class="align-center"> <tr class="align-center">
<td>科学</td> <td>科学</td>
<td>{{kx}}</td> <td v-html="kx" colspan="5"></td>
<td colspan="4"></td>
</tr> </tr>
<tr class="align-center"> <tr class="align-center">
<td>艺术</td> <td>艺术</td>
<td>{{ys}}</td> <td v-html="ys" colspan="5"></td>
<td colspan="4"></td>
</tr> </tr>
<tr v-for="item in planweekitemList" :key="item.id"> <tr v-for="item in planweekitemList" :key="item.id">
@ -77,7 +72,7 @@
<td class="align-center">{{item.activitytime}}</td> <td class="align-center">{{item.activitytime}}</td>
<td class="align-center">{{item.day}}</td> <td class="align-center">{{item.day}}</td>
<td class="align-center">{{activitytypeFormat(item.activitytype)}}</td> <td class="align-center">{{activitytypeFormat(item.activitytype)}}</td>
<td class="align-center">{{(item.content)}}</td> <td class="align-center" v-html="item.content"></td>
</tr> </tr>
</table> </table>
<!-- <p <!-- <p

View File

@ -1,5 +1,6 @@
package com.ruoyi.project.benyi.controller; package com.ruoyi.project.benyi.controller;
import java.text.SimpleDateFormat;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
@ -98,6 +99,8 @@ public class ByPlanweekController extends BaseController {
// 首先判断当前账户是否为幼儿园账号 // 首先判断当前账户是否为幼儿园账号
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) { if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
String uuid = schoolCommon.getUuid(); String uuid = schoolCommon.getUuid();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
byPlanweek.setName(byPlanweek.getName()+"("+sdf.format(byPlanweek.getStarttime())+'-'+sdf.format(byPlanweek.getEndtime())+")");
byPlanweek.setId(uuid); byPlanweek.setId(uuid);
//学校id //学校id
byPlanweek.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId()); byPlanweek.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());