学期计划预览

This commit is contained in:
paidaxing444 2020-09-08 10:35:20 +08:00
parent 13e47aff77
commit 20f1d72420
4 changed files with 97 additions and 235 deletions
ruoyi-ui/src
router
views/benyi/themetermplan
ruoyi/src/main/java/com/ruoyi/project/benyi/controller

@ -337,6 +337,21 @@ export const constantRoutes = [{
}
}]
},
{
path: '/benyi_course/themetermplanprint',
component: Layout,
hidden: true,
children: [{
path: 'table/:id',
component: () =>
import('@/views/benyi/themetermplan/table'),
name: 'Themetermplan2',
meta: {
title: '主题整合学期计划(表格)',
icon: ''
}
}]
},
{
path: '/benyi_course/math',
component: Layout,

@ -70,7 +70,7 @@
</el-row>
<el-table v-loading="loading" :data="termplanList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" :selectable="isShow"/>
<el-table-column type="selection" width="55" align="center" :selectable="isShow" />
<el-table-column label="班级名称" align="center" prop="classid" :formatter="classFormat" />
<el-table-column label="计划名称" align="center" prop="name" :show-overflow-tooltip="true">
<template slot-scope="scope">
@ -118,6 +118,13 @@
v-hasPermi="['benyi:themetermplan:edit']"
v-show="isShow(scope.row)"
>提交</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row)"
v-hasPermi="['benyi:themetermplan:query']"
>预览</el-button>
</template>
</el-table-column>
</el-table>
@ -375,15 +382,11 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm(
'是否确认删除主题整合学期计划数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
this.$confirm("是否确认删除主题整合学期计划数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return delTermplan(ids);
})
@ -414,6 +417,13 @@ export default {
})
.catch(function () {});
},
/** 预览按钮操作 */
handleView(row) {
const id = row.id;
this.$router.push({
path: "/benyi_course/themetermplanprint/table/"+id,
});
},
},
};
</script>

@ -17,7 +17,7 @@
</td>
<td>
<b class="table-title">学期</b>
{{month}}
{{xnxqFormat(xnxq)}}
</td>
<td class="w200">
<b class="table-title">制定人</b>
@ -29,51 +29,16 @@
<b>{{h.label}}</b>
</td>
</tr>
<tr v-for="item in bodyData.weekplanitemList" :key="item.daytime">
<tr v-for="item in bodyData.termplanitemList" :key="item.id">
<td class="align-center">
<span>{{item.month}}</span>
</td>
<td>{{item.theme}}</td>
<td>{{item.info}}</td>
</tr>
<tr>
<td colspan="3">
<h2 class="title title2">下学期课程计划2018年3月-2019年3月</h2>
</td>
</tr>
<tr class="align-center">
<!-- <td v-for="h in headerData" :key="h.title">
<b class="table-title">{{h.title}}</b>
{{h.name}}
</td>-->
<td>
<b class="table-title">班级</b>
{{classname}}
</td>
<td>
<b class="table-title">学期</b>
{{month}}
</td>
<td>
<b class="table-title">制定人</b>
{{tbr}}
</td>
</tr>
<tr class="align-center table-bg">
<td v-for="h in bodyData.title" :key="h.prop">
<b>{{h.label}}</b>
</td>
</tr>
<tr v-for="item in bodyData.weekplanitemList" :key="item.daytime">
<td class="align-center">
<span>{{item.month}}</span>
</td>
<td>{{item.theme}}</td>
<td>{{item.info}}</td>
<td class="align-center">{{themeFormat(item.themeconent)}}</td>
<td>{{item.remark}}</td>
</tr>
<tr>
<td class="align-center">教学主管审批</td>
<td colspan="2">{{bz}}</td>
<td colspan="2">{{spyj}}</td>
</tr>
</table>
<!-- <p
@ -84,40 +49,30 @@
</template>
<script>
import { listTermplan, getTermplan } from "@/api/benyi/themetermplan";
import {
listWeekplanitem,
getWeekplanitem,
} from "@/api/benyi/themeweekplanitem";
import { listWeekplan, getWeekplan } from "@/api/benyi/themeweekplan";
import { listActivityByThemeId } from "@/api/benyi/activity";
import { listMonthplan } from "@/api/benyi/thememonthplan";
import { listMonthplanitem } from "@/api/benyi/thememonthplanitem";
import { listThemeByIds, listThemeByActivityIds } from "@/api/benyi/theme";
listTermplanitem,
getTermplanitem,
} from "@/api/benyi/themetermplanitem";
import { listTheme } from "@/api/benyi/theme";
export default {
name: "TermTable",
data() {
return {
tableData: [],
title: "主题整合课程学期教学计划表",
zc: "",
month: "",
classname: "中二班",
//
xnxqOptions: [],
//
themeOptions: [],
title: "",
xnxq: "",
classname: "",
tbr: "",
monththeme: "",
bz: "",
spyj: "",
//idtheme
themenamebyactivityids: "",
//
fzxzOptions: [],
//
themeactivityOptions: [],
bodyData: {
title: [
{
label: "月时间",
label: "月份",
prop: "theme",
},
{
@ -129,197 +84,71 @@ export default {
prop: "help",
},
],
weekplanitemList: [
{
month: '1月',
theme: "春天的颜色",
info: '时代峰峻的斯洛伐克'
},
// {
// day: "",
// name: "",
// term: "",
// },
// {
// day: "",
// name: "",
// term: "",
// },
// {
// day: "",
// name: "",
// term: "",
// },
// {
// day: "",
// name: "",
// term: "",
// },
],
termplanitemList: [],
},
//
queryParams: {
wpid: undefined,
},
//
queryParams_MonPlan: {
xnxq: undefined,
month: undefined,
status: "2",
},
queryParams_MonPlanItem: {
mpid: undefined,
zc: undefined,
tpid: undefined,
},
};
},
created() {
const themeweekplanid = this.$route.params && this.$route.params.id;
this.getThemeWeekPlan(themeweekplanid);
this.getDicts("sys_dm_fzxz").then((response) => {
this.fzxzOptions = response.data;
const themetermplanid = this.$route.params && this.$route.params.id;
this.queryParams.tpid = themetermplanid;
this.getThemeTermPlan(themetermplanid);
this.getThemeList();
this.getDicts("sys_xnxq").then((response) => {
this.xnxqOptions = response.data;
});
},
methods: {
//
async themeFormat(themeids) {
var themename = "";
var ids = themeids.split(";");
var array = [];
//console.log(ids);
ids.forEach(function (value, key, arr) {
//console.log(value); // 123
if (value != "") {
array.push(parseInt(value));
}
});
if (array.length > 0) {
await listThemeByIds(array).then((response) => {
response.rows.forEach(function (value1, key1, arr1) {
themename = themename + value1.name + ";";
});
});
//(themename);
this.monththeme = themename;
}
// --
xnxqFormat(xnxq) {
return this.selectDictLabel(this.xnxqOptions, xnxq);
},
// --
themeactivityFormat(activityid) {
if (activityid != null) {
var ilength = activityid.split(";").length - 1;
themeFormat(themeids) {
if (themeids != "") {
var ilength = themeids.split(";").length - 1;
var names = "";
for (var i = 1; i < ilength; i++) {
names =
names +
this.selectMoeDictLabel(
this.themeactivityOptions,
activityid.split(";")[i]
) +
"";
this.selectMoeDictLabel(this.themeOptions, themeids.split(";")[i]) +
" ";
}
//this.selectDictLabel(this.scopeOptions, row.xnxq);
return names;
}
return "";
},
// --
fzxzFormat(fzxz) {
return this.selectDictLabel(this.fzxzOptions, fzxz);
},
//
getThemeActivityList(themeid) {
listActivityByThemeId(themeid).then((response) => {
//
getThemeList() {
listTheme(null).then((response) => {
//console.log(response.rows);
this.themeactivityOptions = response.rows;
this.themeOptions = response.rows;
});
},
//
getThemeWeekPlan(themeweekplanid) {
getWeekplan(themeweekplanid).then((response) => {
//(response);
this.queryParams.wpid = response.data.id;
//
getThemeTermPlan(themetermplanid) {
getTermplan(themetermplanid).then((response) => {
console.log(response.data);
this.title = response.data.name;
this.zc = response.data.zc;
this.month = response.data.month;
this.classname = response.classname;
this.tbr = response.createusername;
this.bz = response.data.remark;
this.classname = response.classname;
this.xnxq = response.data.xnxq;
this.spyj = response.data.shyj;
//id
this.queryParams_MonPlan.month = response.data.month;
this.queryParams_MonPlan.xnxq = response.data.xnxq;
listMonthplan(this.queryParams_MonPlan).then((resMonPlan) => {
//console.log(resMonPlan.rows);
//
var monththemeids = resMonPlan.rows[0].themes;
this.themeFormat(monththemeids);
this.queryParams_MonPlanItem.mpid = resMonPlan.rows[0].id;
this.queryParams_MonPlanItem.zc = response.data.zc;
listMonthplanitem(this.queryParams_MonPlanItem).then(
(resMonPlanItem) => {
//console.log(resMonPlanItem.rows);
var activityids = resMonPlanItem.rows[0].activityid.split(";");
var array = [];
//console.log(arr);
activityids.forEach(function (value, key, arr) {
//console.log(value); // 123
if (value != "") {
array.push(parseInt(value));
}
});
this.getThemeActivityList(array);
}
);
});
this.getList();
});
this.getThemeTermItemPlan();
},
//
getThemeTermItemPlan() {
listTermplanitem(this.queryParams).then((response) => {
console.log(response.rows);
this.bodyData.termplanitemList = response.rows;
});
},
/** 查询主题整合周计划明细列表 */
async getList() {
//console.log(this.queryParams.wpid);
await listWeekplanitem(this.queryParams).then((response) => {
this.bodyData.weekplanitemList = response.rows;
//id
var activityIds = "";
response.rows.forEach(function (value, key, arr) {
if (value.activityid != null) {
activityIds = activityIds + value.activityid + ";";
}
});
var array = [];
activityIds.split(";").forEach(function (value, key, arr) {
if (value != "") {
array.push(parseInt(value));
}
});
//id
this.getThemeByActivityIds(array);
});
},
//idtheme
async getThemeByActivityIds(array) {
if (array.length > 0) {
var themename = "";
await listThemeByActivityIds(array).then((response) => {
response.rows.forEach(function (value, key, arr) {
themename = themename + value.name + ";";
});
});
//console.log(themename);
this.themenamebyactivityids = themename;
}
this.bodyData.weekplanitemList[0].theme =
this.themenamebyactivityids == ""
? "未设置"
: this.themenamebyactivityids;
},
//
prints() {
//console.log(this.$refs.printMe);
this.$print(this.$refs.printMe);

@ -11,6 +11,7 @@ import com.ruoyi.project.benyi.domain.ByThemeTermplanitem;
import com.ruoyi.project.benyi.service.IByThemeTermplanitemService;
import com.ruoyi.project.common.SchoolCommon;
import com.ruoyi.project.system.service.IByClassService;
import com.ruoyi.project.system.service.ISysUserService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -47,6 +48,8 @@ public class ByThemeTermplanController extends BaseController {
private IByClassService byClassService;
@Autowired
private IByThemeTermplanitemService byThemeTermplanitemService;
@Autowired
private ISysUserService userService;
/**
* 查询主题整合学期计划列表
@ -84,7 +87,12 @@ public class ByThemeTermplanController extends BaseController {
@PreAuthorize("@ss.hasPermi('benyi:themetermplan:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) {
return AjaxResult.success(byThemeTermplanService.selectByThemeTermplanById(id));
AjaxResult ajax = AjaxResult.success();
ByThemeTermplan byThemeTermplan = byThemeTermplanService.selectByThemeTermplanById(id);
ajax.put(AjaxResult.DATA_TAG, byThemeTermplan);
ajax.put("classname", byClassService.selectByClassById(byThemeTermplan.getClassid()).getBjmc());
ajax.put("createusername", userService.selectUserById(byThemeTermplan.getCreateuserid()).getNickName());
return ajax;
}
/**