|
@@ -1,34 +1,15 @@
|
|
|
<template>
|
|
|
<div id="class-info">
|
|
|
<data-form ref="form" :inline="true" :needSave="false" :data="form" :fields="fields" :rules="{}" @save="handleSave" :reset="false">
|
|
|
- <!-- <template #options="{item, form}">
|
|
|
- <template v-if="item.model == 'headteacherid'">
|
|
|
- <el-option-group v-for="(dept, index) in headTeacherList" :label="dept.name" :key="index">
|
|
|
- <el-option v-for="(i, tIndex) in dept.list" :key="`${index}-${tIndex}`" :label="i.name" :value="i._id"></el-option>
|
|
|
- </el-option-group>
|
|
|
- </template>
|
|
|
- <template v-if="item.model == 'lyteacherid'">
|
|
|
- <el-option v-for="(tea, index) in lyTeacherList" :key="`${item.model}${index}`" :label="tea.name" :value="tea.id"></el-option>
|
|
|
- </template>
|
|
|
- <template v-if="item.model == 'jslocationid'">
|
|
|
- <el-option v-for="(place, index) in locationList" :key="`${item.model}${index}`" :label="place.name" :value="place.id"></el-option>
|
|
|
- </template>
|
|
|
- <template v-if="item.model == 'kbyslocationid'">
|
|
|
- <el-option v-for="(place, index) in locationList" :key="`${item.model}${index}`" :label="place.name" :value="place.id"></el-option>
|
|
|
- </template>
|
|
|
- <template v-if="item.model == 'kzjhlocationid'">
|
|
|
- <el-option v-for="(place, index) in locationList" :key="`${item.model}${index}`" :label="place.name" :value="place.id"></el-option>
|
|
|
- </template>
|
|
|
- <template v-if="item.model == 'yclocationid'">
|
|
|
- <el-option v-for="(place, index) in locationList" :key="`${item.model}${index}`" :label="place.name" :value="place.id"></el-option>
|
|
|
- </template>
|
|
|
- </template> -->
|
|
|
<template #custom="{item, form}">
|
|
|
<template v-if="item.model == 'headteacherid'">
|
|
|
{{ classInfo.headteacher || '暂无' }}
|
|
|
</template>
|
|
|
<template v-else-if="item.model == 'lyteacherid'">
|
|
|
{{ getly(form.lyteacherid) || '暂无' }}
|
|
|
+ <el-link :type="wordColor(getNoticeResult(form.lyteacherid))">
|
|
|
+ {{ getNoticeResult(form.lyteacherid) }}
|
|
|
+ </el-link>
|
|
|
</template>
|
|
|
<template v-else-if="item.model == 'jslocationid'">
|
|
|
{{ classInfo.jslocation || '暂无' }}
|
|
@@ -52,6 +33,7 @@ import _ from 'lodash';
|
|
|
import dataForm from '@frame/components/form';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: classes } = createNamespacedHelpers('classes');
|
|
|
+const { mapActions: mapUtil } = createNamespacedHelpers('util');
|
|
|
export default {
|
|
|
name: 'class-info',
|
|
|
props: {
|
|
@@ -75,10 +57,12 @@ export default {
|
|
|
{ label: '拓展训练地点', model: 'kzjhlocationid', type: 'text', custom: true },
|
|
|
{ label: '用餐地点', model: 'yclocationid', type: 'text', custom: true },
|
|
|
],
|
|
|
+ noticeList: [],
|
|
|
};
|
|
|
},
|
|
|
created() {},
|
|
|
methods: {
|
|
|
+ ...mapUtil(['fetch']),
|
|
|
...classes(['update']),
|
|
|
toSave() {
|
|
|
this.$refs.form.save();
|
|
@@ -93,6 +77,42 @@ export default {
|
|
|
let res = this.lyTeacherList.find(i => i.id == id);
|
|
|
if (res) return res.name;
|
|
|
},
|
|
|
+ // 消息列表
|
|
|
+ async getNoticeList() {
|
|
|
+ let { _id: classid, planid, termid } = this.classInfo;
|
|
|
+ let res = await this.fetch({ model: 'notice', classid: this.classInfo.id, type: '4', planid: this.classInfo.planid, termid: this.classInfo.termid });
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `noticeList`, res.data);
|
|
|
+ },
|
|
|
+ getNoticeResult(teaid) {
|
|
|
+ let word = '';
|
|
|
+ if (teaid) {
|
|
|
+ const { notified } = this.noticeList;
|
|
|
+ if (notified) {
|
|
|
+ const r = notified.find(f => f.notifiedid == teaid);
|
|
|
+ if (!r) word = '未收到通知';
|
|
|
+ else {
|
|
|
+ word = r.status == '0' ? '未确认' : '已确认';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return word;
|
|
|
+ },
|
|
|
+ wordColor(word) {
|
|
|
+ let type = 'danger';
|
|
|
+ if (word == '未确认') type = 'warning';
|
|
|
+ if (word == '已确认') type = 'success';
|
|
|
+ return type;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ classInfo: {
|
|
|
+ handler(val) {
|
|
|
+ let id = _.get(val, '_id');
|
|
|
+ if (id) this.getNoticeList();
|
|
|
+ },
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|