学期计划预览

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

View File

@ -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', path: '/benyi_course/math',
component: Layout, component: Layout,

View File

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

View File

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

View File

@ -11,6 +11,7 @@ import com.ruoyi.project.benyi.domain.ByThemeTermplanitem;
import com.ruoyi.project.benyi.service.IByThemeTermplanitemService; import com.ruoyi.project.benyi.service.IByThemeTermplanitemService;
import com.ruoyi.project.common.SchoolCommon; import com.ruoyi.project.common.SchoolCommon;
import com.ruoyi.project.system.service.IByClassService; import com.ruoyi.project.system.service.IByClassService;
import com.ruoyi.project.system.service.ISysUserService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -47,6 +48,8 @@ public class ByThemeTermplanController extends BaseController {
private IByClassService byClassService; private IByClassService byClassService;
@Autowired @Autowired
private IByThemeTermplanitemService byThemeTermplanitemService; private IByThemeTermplanitemService byThemeTermplanitemService;
@Autowired
private ISysUserService userService;
/** /**
* 查询主题整合学期计划列表 * 查询主题整合学期计划列表
@ -84,7 +87,12 @@ public class ByThemeTermplanController extends BaseController {
@PreAuthorize("@ss.hasPermi('benyi:themetermplan:query')") @PreAuthorize("@ss.hasPermi('benyi:themetermplan:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String 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;
} }
/** /**