|
@@ -1,12 +1,12 @@
|
|
<template>
|
|
<template>
|
|
<div id="remind">
|
|
<div id="remind">
|
|
<detail-frame :title="pageTitle">
|
|
<detail-frame :title="pageTitle">
|
|
- <el-row type="flex" align="middle" justify="end" class="btn_bar">
|
|
|
|
|
|
+ <!-- <el-row type="flex" align="middle" justify="end" class="btn_bar">
|
|
<el-col :span="2">
|
|
<el-col :span="2">
|
|
<el-button type="primary" size="mini" @click="sendMsg()">发送本期通知</el-button>
|
|
<el-button type="primary" size="mini" @click="sendMsg()">发送本期通知</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
- </el-row>
|
|
|
|
- <data-table :fields="fields" :data="list" :opera="opera" @msg="toSendMsg" :usePage="false"></data-table>
|
|
|
|
|
|
+ </el-row> -->
|
|
|
|
+ <data-table :fields="fields" :data="list" :opera="opera" @msg="toSendMsg" @view="toView" :usePage="false"></data-table>
|
|
</detail-frame>
|
|
</detail-frame>
|
|
<el-dialog title="通知内容" :visible.sync="dialogSend">
|
|
<el-dialog title="通知内容" :visible.sync="dialogSend">
|
|
<send-form :form="form" @resetForm="resetForm" @submitForm="submitForm"></send-form>
|
|
<send-form :form="form" @resetForm="resetForm" @submitForm="submitForm"></send-form>
|
|
@@ -22,6 +22,7 @@ import sendForm from './parts/send-form';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions: classes } = createNamespacedHelpers('classes');
|
|
const { mapActions: classes } = createNamespacedHelpers('classes');
|
|
const { mapActions: student } = createNamespacedHelpers('student');
|
|
const { mapActions: student } = createNamespacedHelpers('student');
|
|
|
|
+const { mapActions: util } = createNamespacedHelpers('util');
|
|
const { mapActions: notice } = createNamespacedHelpers('notice');
|
|
const { mapActions: notice } = createNamespacedHelpers('notice');
|
|
export default {
|
|
export default {
|
|
name: 'remind',
|
|
name: 'remind',
|
|
@@ -39,6 +40,11 @@ export default {
|
|
icon: 'el-icon-message-solid',
|
|
icon: 'el-icon-message-solid',
|
|
method: 'msg',
|
|
method: 'msg',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ label: '查看通知情况',
|
|
|
|
+ icon: 'el-icon-view',
|
|
|
|
+ method: 'view',
|
|
|
|
+ },
|
|
],
|
|
],
|
|
fields: [
|
|
fields: [
|
|
{ label: '批次', prop: 'batch' },
|
|
{ label: '批次', prop: 'batch' },
|
|
@@ -51,7 +57,8 @@ export default {
|
|
},
|
|
},
|
|
created() {},
|
|
created() {},
|
|
methods: {
|
|
methods: {
|
|
- ...classes(['query']),
|
|
|
|
|
|
+ ...classes(['query', 'classNameList']),
|
|
|
|
+ ...util({ modelFetch: 'fetch' }),
|
|
...student({ getStudentList: 'query' }),
|
|
...student({ getStudentList: 'query' }),
|
|
...notice({ noticeCreate: 'create' }),
|
|
...notice({ noticeCreate: 'create' }),
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
@@ -75,10 +82,20 @@ export default {
|
|
// 通知确定
|
|
// 通知确定
|
|
async submitForm({ data }) {
|
|
async submitForm({ data }) {
|
|
let classid = this.classid;
|
|
let classid = this.classid;
|
|
|
|
+ let r = await this.classNameList(classid);
|
|
|
|
+ let elseList = [];
|
|
let res = await this.getStudentList({ classid });
|
|
let res = await this.getStudentList({ classid });
|
|
var notified = res.data.map(item => ({ notifiedid: item.id }));
|
|
var notified = res.data.map(item => ({ notifiedid: item.id }));
|
|
|
|
+ let rl = await this.modelFetch({ model: 'lesson', classid });
|
|
|
|
+ if (_.get(rl, `data`)) {
|
|
|
|
+ let { lessons } = _.get(rl, `data`);
|
|
|
|
+ elseList = _.uniq(_.compact(lessons.map(i => i.teaid)));
|
|
|
|
+ }
|
|
|
|
+ if (_.get(data, 'headteacherid')) elseList.push(_.get(data, 'headteacherid'));
|
|
|
|
+ if (_.get(data, 'lyteacherid')) elseList.push(_.get(data, 'lyteacherid'));
|
|
|
|
+ elseList = elseList.map(i => ({ notifiedid: i }));
|
|
data.noticeid = this.user.id;
|
|
data.noticeid = this.user.id;
|
|
- data.notified = notified;
|
|
|
|
|
|
+ data.notified = [...notified, ...elseList];
|
|
const arr = await this.noticeCreate(data);
|
|
const arr = await this.noticeCreate(data);
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
this.$message({
|
|
this.$message({
|
|
@@ -103,6 +120,9 @@ export default {
|
|
const resNotice = await this.sendNotice({ classids });
|
|
const resNotice = await this.sendNotice({ classids });
|
|
this.$checkRes(resNotice, '发送成功', '发送失败');
|
|
this.$checkRes(resNotice, '发送成功', '发送失败');
|
|
},
|
|
},
|
|
|
|
+ toView({ data }) {
|
|
|
|
+ this.$router.push({ path: '/train/plan/remind/detail', query: { id: data._id } });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
defaultOption: {
|
|
defaultOption: {
|